From b56c98142b73627f17756ac270e6c507e3e5f34f Mon Sep 17 00:00:00 2001 From: Damiano Clementel Date: Thu, 20 Jun 2024 15:42:07 +0200 Subject: [PATCH] Updates structure viewer --- docs/39.61769452f9c238cb.js | 1 - docs/3rdpartylicenses.txt | 2125 +++--- docs/404.html | 20 - docs/509.ec6a8d82178da6d9.js | 1 - docs/772.0440337245892f34.js | 1 - docs/876.ad26e918280ccdc0.js | 1 - docs/chunk-IFRY76GO.js | 7 + docs/chunk-KRYPOJUJ.js | 6083 +++++++++++++++++ docs/chunk-M6PASJEJ.js | 7 + docs/chunk-OI2SMRDK.js | 3 + docs/chunk-TMD3IN23.js | 1 + docs/chunk-X4P3GI5V.js | 1 + docs/chunk-ZNC2MO6Y.js | 1 + docs/index.html | 5 +- docs/main-KWKHEO7E.js | 1 + docs/main.5b859c60ef271fc0.js | 1 - .../bootstrap-icons-OCU552PF.woff} | Bin .../bootstrap-icons-X6UQXWUS.woff2} | Bin .../dssp-helix-OTIKI7SN.svg} | 0 .../dssp-strand-head-QWRJLFK7.svg} | 0 .../dssp-strand-tail-PA4GJMUI.svg} | 0 docs/polyfills-6EAL64PA.js | 2 + docs/polyfills.97b80eb56ae3e13c.js | 1 - docs/runtime.048d90275c60126e.js | 1 - docs/styles-VE6TQEAQ.css | 1 + docs/styles.2596d53c3a552682.css | 5 - 26 files changed, 6876 insertions(+), 1393 deletions(-) delete mode 100644 docs/39.61769452f9c238cb.js delete mode 100644 docs/404.html delete mode 100644 docs/509.ec6a8d82178da6d9.js delete mode 100644 docs/772.0440337245892f34.js delete mode 100644 docs/876.ad26e918280ccdc0.js create mode 100644 docs/chunk-IFRY76GO.js create mode 100644 docs/chunk-KRYPOJUJ.js create mode 100644 docs/chunk-M6PASJEJ.js create mode 100644 docs/chunk-OI2SMRDK.js create mode 100644 docs/chunk-TMD3IN23.js create mode 100644 docs/chunk-X4P3GI5V.js create mode 100644 docs/chunk-ZNC2MO6Y.js create mode 100644 docs/main-KWKHEO7E.js delete mode 100644 docs/main.5b859c60ef271fc0.js rename docs/{bootstrap-icons.70a9dee9e5ab72aa.woff => media/bootstrap-icons-OCU552PF.woff} (100%) rename docs/{bootstrap-icons.bfa90bda92a84a6a.woff2 => media/bootstrap-icons-X6UQXWUS.woff2} (100%) rename docs/{dssp-helix.74d0a47e4d7ed27e.svg => media/dssp-helix-OTIKI7SN.svg} (100%) rename docs/{dssp-strand-head.85a295955fb4c220.svg => media/dssp-strand-head-QWRJLFK7.svg} (100%) rename docs/{dssp-strand-tail.783864b28823e2c7.svg => media/dssp-strand-tail-PA4GJMUI.svg} (100%) create mode 100644 docs/polyfills-6EAL64PA.js delete mode 100644 docs/polyfills.97b80eb56ae3e13c.js delete mode 100644 docs/runtime.048d90275c60126e.js create mode 100644 docs/styles-VE6TQEAQ.css delete mode 100644 docs/styles.2596d53c3a552682.css diff --git a/docs/39.61769452f9c238cb.js b/docs/39.61769452f9c238cb.js deleted file mode 100644 index 1cd5cf7..0000000 --- a/docs/39.61769452f9c238cb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[39],{3039:(A,m,u)=>{u.r(m),u.d(m,{PageSequenceViewerComponent:()=>P});const b={A:{background:"#FFBF00",color:"#000000"},R:{background:"#FF0000",color:"#FFFFFF"},N:{background:"#00FFFF",color:"#000000"},D:{background:"#0000FF",color:"#FFFFFF"},C:{background:"#FFFF00",color:"#000000"},Q:{background:"#00FF00",color:"#000000"},E:{background:"#FF00FF",color:"#FFFFFF"},G:{background:"#808080",color:"#FFFFFF"},H:{background:"#008000",color:"#FFFFFF"},I:{background:"#FFA500",color:"#000000"},L:{background:"#FFA500",color:"#000000"},K:{background:"#FF0000",color:"#FFFFFF"},M:{background:"#FFA500",color:"#000000"},F:{background:"#FFA500",color:"#000000"},P:{background:"#800080",color:"#FFFFFF"},S:{background:"#00FF00",color:"#000000"},T:{background:"#00FF00",color:"#000000"},W:{background:"#FFA500",color:"#000000"},Y:{background:"#FFA500",color:"#000000"},V:{background:"#FFA500",color:"#000000"},B:{background:"#FFA500",color:"#000000"},Z:{background:"#FFA500",color:"#000000"},X:{background:"#FFA500",color:"#000000"},"-":{background:"#FFFFFF",color:"#000000"}};var f=u(6354),C=u(9172),$=u(140),q=u(9568),v=u(4412),e=u(4438);let p=(()=>{class r{constructor(){this.selected$=new v.t(void 0)}set selected(o){this.selected$.next(o)}get selected(){return this.selected$.value}onMouseDown(o,n){this.selected=this.selected?void 0:{start:n,end:n,type:"range"}}onMouseEnter(o,n){1===o.buttons&&this.selected&&(this.selected={...this.selected,end:n})}static#e=this.\u0275fac=function(n){return new(n||r)};static#o=this.\u0275prov=e.jDH({token:r,factory:r.\u0275fac,providedIn:"platform"})}return r})(),x=(()=>{class r{set positions(o){this.input$.next(o)}get positions(){return this.input$.value}constructor(o){this.selectionService=o,this.input$=new v.t([])}static#e=this.\u0275fac=function(n){return new(n||r)(e.KVO(p))};static#o=this.\u0275prov=e.jDH({token:r,factory:r.\u0275fac,providedIn:"platform"})}return r})();var l=u(177);function S(r,a){if(1&r){const o=e.RV6();e.j41(0,"div",4),e.bIt("mouseenter",function(t){const s=e.eBV(o).$index,c=e.XpG();return e.Njj(c.onMouseEnter(t,c.index[s]))})("mousedown",function(t){const s=e.eBV(o).$index,c=e.XpG();return e.Njj(c.onMouseDown(t,c.index[s]))})("mouseup",function(t){e.eBV(o);const s=e.XpG();return e.Njj(s.onMouseUp(t))}),e.EFF(1),e.k0s()}if(2&r){const o=a.$implicit,n=a.$index,t=e.XpG();e.xc7("background",null==o?null:o.background)("color",null==o?null:o.color),e.Y8G("id","index-residue-"+n),e.R7$(),e.SpI(" ",t.index[n]," ")}}function y(r,a){if(1&r){const o=e.RV6();e.j41(0,"div",5),e.bIt("mouseenter",function(t){const s=e.eBV(o).$index,c=e.XpG();return e.Njj(c.onMouseEnter(t,c.index[s]))})("mousedown",function(t){const s=e.eBV(o).$index,c=e.XpG();return e.Njj(c.onMouseDown(t,c.index[s]))})("mouseup",function(t){e.eBV(o);const s=e.XpG();return e.Njj(s.onMouseUp(t))}),e.EFF(1),e.k0s()}if(2&r){const o=a.$implicit,n=a.$index,t=e.XpG();e.xc7("background",t.colors[o].background||t.colors["-"].background)("color",t.colors[o].color||t.colors["-"].color),e.Y8G("id","sequence-residue-"+n),e.R7$(),e.SpI(" ",o," ")}}let V=(()=>{class r{set positions(o){this.positionsService.positions=o}get positions(){return this.positionsService.positions}constructor(o,n){this.positionsService=o,this.selectionService=n,this.selected$=this.selectionService.selected$,this.positions$=this.selectionService.selected$.pipe((0,f.T)(t=>({...t,background:"#FFFFFF",color:"#000000"})),(0,C.Z)(void 0),(0,$.v)(this.positionsService.input$),(0,f.T)(([t,s])=>{s=[...s];const c=new Map(this.index.map((F,d)=>[F,d])),i=t?.start,g=t?.end;if(null!=i&&null!=g){let F=c.get(i),d=c.get(g);F>d&&([F,d]=[d,F]),s.splice(F,d-F+1,...Array(d-F+1).fill(t))}return s}),(0,q.t)(1))}ngOnChanges(o){if(o){if(o.sequence||o.index){if("string"==typeof this.sequence){if(!this.description&&">"===this.sequence[0]){const[c,...i]=this.sequence.split("\n");this.description=c,this.sequence=i.join("\n")}this.sequence=this.sequence.replace(/[\n\r\s\t]+/g,"").split("")}this.index||(this.index=Array.from({length:this.sequence.length},(c,i)=>i+1))}this.colors||(this.colors=b);const n=new Map(this.index.map((c,i)=>[c,i])),t=new Array(this.index.length).fill(void 0),s=(this.loci||[]).map(({start:c,end:i,type:g,background:F,color:d})=>{const _=n.get(c),w=void 0!==i?n.get(i):c,M={start:_,end:w,type:g,background:F,color:d};for(let h=_;h<=w;h++)t[h]=M;return M});s.sort((c,i)=>c.start-i.start||(c.end||0)-(i.end||0)),this.loci=s,this.positions=t}}onMouseUp(o){}onMouseDown(o,n){this.selectionService.onMouseDown(o,n)}onMouseEnter(o,n){this.selectionService.onMouseEnter(o,n)}static#e=this.\u0275fac=function(n){return new(n||r)(e.rXU(x),e.rXU(p))};static#o=this.\u0275cmp=e.VBU({type:r,selectors:[["ngx-sequence-viewer"]],inputs:{loci:"loci",index:"index",sequence:"sequence",colors:"colors",description:"description"},outputs:{selected$:"selected"},standalone:!0,features:[e.Jv_([x,p]),e.OA$,e.aNF],decls:7,vars:2,consts:[[1,"index"],[1,"index-residue",3,"id","background","color"],[1,"sequence"],[1,"sequence-residue",3,"id","background","color"],[1,"index-residue",3,"mouseenter","mousedown","mouseup","id"],[1,"sequence-residue",3,"mouseenter","mousedown","mouseup","id"]],template:function(n,t){1&n&&(e.j41(0,"div",0),e.Z7z(1,S,2,6,"div",1,e.Vm6),e.nI1(3,"async"),e.k0s(),e.j41(4,"div",2),e.Z7z(5,y,2,6,"div",3,e.Vm6),e.k0s()),2&n&&(e.R7$(),e.Dyx(e.bMT(3,0,t.positions$)),e.R7$(4),e.Dyx(t.sequence))},dependencies:[l.MD,l.Jj],styles:["[_nghost-%COMP%]{cursor:default;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .sequence[_ngcontent-%COMP%], [_nghost-%COMP%] .index[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch}[_nghost-%COMP%] .sequence[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], [_nghost-%COMP%] .index[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:0 0 auto;display:block;height:1rem;width:1rem;text-align:center;font-size:inherit;line-height:1rem}[_nghost-%COMP%] .sequence[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{text-align:center;vertical-align:center}[_nghost-%COMP%] .index[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:auto;text-align:left;transform:rotate(-180deg);writing-mode:vertical-rl;white-space:nowrap;padding-bottom:.25rem;padding-top:.25rem}"]})}return r})();var k=u(3286);function j(r,a){if(1&r&&e.nrm(0,"ngx-sequence-viewer",6),2&r){const o=e.XpG();e.Y8G("sequence",o.sequence)("index",o.index)("loci",o.loci)("colors",o.colors)}}let P=(()=>{class r{constructor(o,n){this.structureService=o,this.location=n,this.loci=[{start:"12",end:"43",type:"range",background:"#007A78",color:"#FFC745"},{start:"57",end:"58",type:"range",background:"#BDE673",color:"#000000"}],this.colors=b,this.structure$=this.structureService.structure$,this._structure=this.structure$.subscribe(()=>{this.sequence=this.structureService.residues.map(({authCompId1:s})=>s),this.index=this.structureService.residues.map(({authSeqId:s,pdbInsCode:c})=>s+c)});const t=this.location.prepareExternalUrl("assets/8vap.A.cif");this.source=this.structureService.source={type:"remote",label:"8VAP",binary:!1,format:"mmcif",link:t}}ngOnDestroy(){this._structure.unsubscribe()}static#e=this.\u0275fac=function(n){return new(n||r)(e.rXU(k.Z),e.rXU(l.aZ))};static#o=this.\u0275cmp=e.VBU({type:r,selectors:[["app-page-sequence-viewer"]],standalone:!0,features:[e.Jv_([k.Z]),e.aNF],decls:17,vars:6,consts:[[1,"container","pt-3"],[1,"row"],[1,"col-7"],[1,"col-5"],[1,"rounded","bg-body-tertiary","p-3"],["id","sequence-viewer-structure",1,"d-block","rounded","border","w-100","h-auto",2,"overflow-x","auto","overflow-y","hidden"],[3,"sequence","index","loci","colors"]],template:function(n,t){1&n&&(e.j41(0,"div",0)(1,"h1"),e.EFF(2,"Sequence viewer"),e.k0s(),e.j41(3,"div")(4,"h2"),e.EFF(5,"Visualize structure"),e.k0s(),e.j41(6,"div",1)(7,"div",2),e.EFF(8," In this example, the sequence underlying the PDB structure `1BRR`, chain `A` is shown. The colouring scheme chosen is based on the structural characteristics of the amino acids. "),e.k0s(),e.j41(9,"div",3)(10,"code")(11,"pre",4),e.EFF(12),e.nI1(13,"json"),e.k0s()()()(),e.j41(14,"div",5),e.DNE(15,j,1,4,"ngx-sequence-viewer",6),e.nI1(16,"async"),e.k0s()()()),2&n&&(e.R7$(12),e.JRh(e.bMT(13,2,t.source)),e.R7$(3),e.vxM(15,e.bMT(16,4,t.structure$)?15:-1))},dependencies:[l.MD,l.Jj,l.TG,V]})}return r})()}}]); \ No newline at end of file diff --git a/docs/3rdpartylicenses.txt b/docs/3rdpartylicenses.txt index 184cc6a..b34a2ff 100644 --- a/docs/3rdpartylicenses.txt +++ b/docs/3rdpartylicenses.txt @@ -1,69 +1,89 @@ -@angular/common -MIT -@angular/core -MIT +-------------------------------------------------------------------------------- +Package: @angular/platform-browser +License: "MIT" -@angular/platform-browser -MIT -@angular/router -MIT +-------------------------------------------------------------------------------- +Package: @angular/router +License: "MIT" -@babel/runtime -MIT -MIT License -Copyright (c) 2014-present Sebastian McKenzie and other contributors +-------------------------------------------------------------------------------- +Package: xhr2 +License: "MIT" -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Copyright (c) 2013 Victor Costan -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +Package: react +License: "MIT" -@ungap/structured-clone -ISC -ISC License +MIT License -Copyright (c) 2021, Andrea Giammarchi, @WebReflection +Copyright (c) Facebook, Inc. and its affiliates. -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +Package: inline-style-parser +License: "MIT" -bail -MIT (The MIT License) -Copyright (c) 2015 Titus Wormer +Copyright (c) 2012 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------------------- +Package: style-to-object +License: "MIT" + +The MIT License (MIT) + +Copyright (c) 2017 Menglin "Mark" Xu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including +"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to @@ -72,24 +92,25 @@ the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Package: extend +License: "MIT" -comma-separated-tokens -MIT -(The MIT License) +The MIT License (MIT) -Copyright (c) 2016 Titus Wormer +Copyright (c) 2014 Stefan Thomas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including +"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to @@ -98,169 +119,389 @@ the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -d3 -ISC -Copyright 2010-2023 Mike Bostock +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: scheduler +License: "MIT" +MIT License -d3-array -ISC -Copyright 2010-2023 Mike Bostock +Copyright (c) Facebook, Inc. and its affiliates. -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -d3-axis -ISC -Copyright 2010-2021 Mike Bostock +-------------------------------------------------------------------------------- +Package: react-dom +License: "MIT" -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. +MIT License -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. +Copyright (c) Facebook, Inc. and its affiliates. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -d3-brush -ISC -Copyright 2010-2021 Mike Bostock +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: molstar +License: "MIT" +The MIT License -d3-color -ISC -Copyright 2010-2022 Mike Bostock + Copyright (c) 2017 - now, Mol* contributors -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +Package: immutable +License: "MIT" -d3-dispatch -ISC -Copyright 2010-2021 Mike Bostock +MIT License -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. +Copyright (c) 2014-present, Lee Byron and other contributors. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -d3-drag -ISC -Copyright 2010-2021 Mike Bostock +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. +-------------------------------------------------------------------------------- +Package: immer +License: "MIT" -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. +MIT License +Copyright (c) 2017 Michel Weststrate -d3-ease -BSD-3-Clause -Copyright 2010-2021 Mike Bostock -Copyright 2001 Robert Penner -All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -* 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. +-------------------------------------------------------------------------------- +Package: comma-separated-tokens +License: "MIT" -* Neither the name of the author nor the names of contributors may be used to - endorse or promote products derived from this software without specific prior - written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +Package: estree-util-is-identifier-name +License: "MIT" -d3-format -ISC -Copyright 2010-2021 Mike Bostock +-------------------------------------------------------------------------------- +Package: hast-util-whitespace +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: property-information +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: space-separated-tokens +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: unist-util-position +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: unist-util-stringify-position +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: vfile-message +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: hast-util-to-jsx-runtime +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: html-url-attributes +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: react-markdown +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: mdast-util-to-string +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: decode-named-character-reference +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-chunked +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-combine-extensions +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-decode-numeric-character-reference +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-normalize-identifier +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-character +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-sanitize-uri +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-factory-space +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-classify-character +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-resolve-all +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-core-commonmark +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-subtokenize +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-factory-destination +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-factory-label +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-factory-title +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-factory-whitespace +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-html-tag-name +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: micromark-util-decode-string +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: mdast-util-from-markdown +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: remark-parse +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: mdast-util-to-hast +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: trim-lines +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: @ungap/structured-clone +License: "ISC" + +ISC License + +Copyright (c) 2021, Andrea Giammarchi, @WebReflection + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +-------------------------------------------------------------------------------- +Package: unist-util-is +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: unist-util-visit-parents +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: unist-util-visit +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: remark-rehype +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: bail +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: unified +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: is-plain-obj +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: trough +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: vfile +License: "MIT" + + +-------------------------------------------------------------------------------- +Package: d3-array +License: "ISC" + +Copyright 2010-2023 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice @@ -274,10 +515,11 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: internmap +License: "ISC" -d3-interpolate -ISC -Copyright 2010-2021 Mike Bostock +Copyright 2021 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice @@ -291,10 +533,11 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-axis +License: "ISC" -d3-path -ISC -Copyright 2015-2022 Mike Bostock +Copyright 2010-2021 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice @@ -308,9 +551,10 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-dispatch +License: "ISC" -d3-scale -ISC Copyright 2010-2021 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose @@ -325,9 +569,10 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-selection +License: "ISC" -d3-selection -ISC Copyright 2010-2021 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose @@ -342,10 +587,11 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-drag +License: "ISC" -d3-shape -ISC -Copyright 2010-2022 Mike Bostock +Copyright 2010-2021 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice @@ -359,10 +605,11 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-color +License: "ISC" -d3-timer -ISC -Copyright 2010-2021 Mike Bostock +Copyright 2010-2022 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice @@ -376,9 +623,10 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-interpolate +License: "ISC" -d3-transition -ISC Copyright 2010-2021 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose @@ -393,9 +641,10 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-timer +License: "ISC" -d3-zoom -ISC Copyright 2010-2021 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose @@ -410,233 +659,134 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-transition +License: "ISC" -decode-named-character-reference -MIT -(The MIT License) +Copyright 2010-2021 Mike Bostock -Copyright (c) 2021 Titus Wormer +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +-------------------------------------------------------------------------------- +Package: d3-ease +License: "BSD-3-Clause" -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Copyright 2010-2021 Mike Bostock +Copyright 2001 Robert Penner +All rights reserved. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -devlop -MIT -(The MIT License) +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -Copyright (c) 2023 Titus Wormer +* 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. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +* Neither the name of the author nor the names of contributors may be used to + endorse or promote products derived from this software without specific prior + written permission. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-brush +License: "ISC" +Copyright 2010-2021 Mike Bostock -estree-util-is-identifier-name -MIT -(The MIT License) +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. -Copyright (c) 2020 Titus Wormer +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +-------------------------------------------------------------------------------- +Package: d3-path +License: "ISC" -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Copyright 2015-2022 Mike Bostock -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. -extend -MIT -The MIT License (MIT) +-------------------------------------------------------------------------------- +Package: d3-format +License: "ISC" -Copyright (c) 2014 Stefan Thomas +Copyright 2010-2021 Mike Bostock -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-scale +License: "ISC" +Copyright 2010-2021 Mike Bostock +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. -hast-util-to-jsx-runtime -MIT -(The MIT License) - -Copyright (c) 2023 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -hast-util-whitespace -MIT -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -html-url-attributes -MIT - -immer -MIT -MIT License - -Copyright (c) 2017 Michel Weststrate - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -immutable -MIT -MIT License - -Copyright (c) 2014-present, Lee Byron and other contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -inline-style-parser -MIT -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-shape +License: "ISC" -internmap -ISC -Copyright 2021 Mike Bostock +Copyright 2010-2022 Mike Bostock Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice @@ -650,1006 +800,261 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: d3-zoom +License: "ISC" -is-plain-obj -MIT -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -mdast-util-from-markdown -MIT -(The MIT License) - -Copyright (c) 2020 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -mdast-util-to-hast -MIT -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -mdast-util-to-string -MIT -(The MIT License) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -micromark -MIT - -micromark-core-commonmark -MIT -(The MIT License) - -Copyright (c) Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -micromark-factory-destination -MIT - -micromark-factory-label -MIT - -micromark-factory-space -MIT - -micromark-factory-title -MIT - -micromark-factory-whitespace -MIT - -micromark-util-character -MIT - -micromark-util-chunked -MIT - -micromark-util-classify-character -MIT - -micromark-util-combine-extensions -MIT - -micromark-util-decode-numeric-character-reference -MIT - -micromark-util-decode-string -MIT - -micromark-util-html-tag-name -MIT - -micromark-util-normalize-identifier -MIT - -micromark-util-resolve-all -MIT - -micromark-util-sanitize-uri -MIT - -micromark-util-subtokenize -MIT -(The MIT License) - -Copyright (c) Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -molstar -MIT -The MIT License - - Copyright (c) 2017 - now, Mol* contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -ngx-features-viewer -MIT -MIT License - -Copyright (c) 2024 Damiano Clementel (damiano.clementel@gmail.com), Alessio Del Conte (ale.delconte96@gmail.com), BioComputing UP (biocomp@bio.unipd.it) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -ngx-sequence-viewer - -ngx-structure-viewer -MIT -MIT License +Copyright 2010-2021 Mike Bostock -Copyright (c) 2024 Damiano Clementel (damiano.clementel@gmail.com), Alessio Del Conte (ale.delconte96@gmail.com), BioComputing UP (biocomp@bio.unipd.it) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -property-information -MIT -(The MIT License) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -react -MIT -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -react-dom -MIT -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -react-markdown -MIT -The MIT License (MIT) - -Copyright (c) 2015 Espen Hovlandsdal - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -remark-parse -MIT -(The MIT License) - -Copyright (c) 2014 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -remark-rehype -MIT -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -rxjs -Apache-2.0 - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - -scheduler -MIT -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -space-separated-tokens -MIT -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -style-to-object -MIT -The MIT License (MIT) - -Copyright (c) 2017 Menglin "Mark" Xu - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -trim-lines -MIT -(The MIT License) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -trough -MIT -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -tslib -0BSD -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - -unified -MIT -(The MIT License) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -unist-util-is -MIT -(The MIT license) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -unist-util-position -MIT -(The MIT License) - -Copyright (c) 2015 Titus Wormer +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +-------------------------------------------------------------------------------- +Package: @angular/core +License: "MIT" -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Package: rxjs +License: "Apache-2.0" + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -unist-util-stringify-position -MIT -(The MIT License) + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Copyright (c) 2016 Titus Wormer + 1. Definitions. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -unist-util-visit -MIT -(The MIT License) + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -Copyright (c) 2015 Titus Wormer + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. -unist-util-visit-parents -MIT -(The MIT License) + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. -Copyright (c) 2016 Titus Wormer + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and -vfile -MIT -(The MIT License) + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. -Copyright (c) 2015 Titus Wormer + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. -vfile-message -MIT -(The MIT License) + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. -Copyright (c) 2017 Titus Wormer + END OF TERMS AND CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: + APPENDIX: How to apply the Apache License to your work. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -xhr2 -MIT -Copyright (c) 2013 Victor Costan + http://www.apache.org/licenses/LICENSE-2.0 -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +-------------------------------------------------------------------------------- +Package: tslib +License: "0BSD" + +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +Package: @angular/common +License: "MIT" -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +-------------------------------------------------------------------------------- +Package: zone.js +License: "MIT" -zone.js -MIT The MIT License Copyright (c) 2010-2024 Google LLC. https://angular.io/license @@ -1671,3 +1076,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------------------- diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 252d286..0000000 --- a/docs/404.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - ngx-bio-tools - - - - - - - - - - - - - - - diff --git a/docs/509.ec6a8d82178da6d9.js b/docs/509.ec6a8d82178da6d9.js deleted file mode 100644 index e0e18ca..0000000 --- a/docs/509.ec6a8d82178da6d9.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[509],{5621:(tn,Ue,n)=>{"use strict";n.d(Ue,{z:()=>zg});var e={};n.r(e),n.d(e,{AssignColorVolume:()=>L,DownloadDensity:()=>T});var t,oe,o=n(958),r=n(467);(oe=t||(t={})).create=function x(z){return z},oe.getDuration=function F(z,me){var Pe,Ge;if(me.customDurationMs)return me.customDurationMs;const Xe=null===(Ge=(Pe=me.definition).getDuration)||void 0===Ge?void 0:Ge.call(Pe,me.params,z);return"fixed"===Xe?.kind?Xe.durationMs:void 0};var A=n(381),y=n(1073),c=n(1832),i=n(6763),v=n(8277);const O=t.create({name:"built-in.animate-assembly-unwind",display:{name:"Unwind Assembly"},isExportable:!0,params:oe=>{const x=[["all","All"]],F=oe.state.data.select(c.QX.Generators.rootsOfType(A.O.Molecule.Structure));for(const z of F)x.push([z.transform.ref,z.obj.data.models[0].label]);return{durationInMs:v.t.Numeric(3e3,{min:100,max:1e4,step:100}),playOnce:v.t.Boolean(!1),target:v.t.Select(x[0][0],x)}},canApply:oe=>({canApply:oe.state.data.select(c.QX.Generators.ofType(A.O.Molecule.Structure.Representation3D,c.Cn.RootRef)).length>0}),getDuration:oe=>({kind:"fixed",durationMs:oe.durationInMs}),initialState:()=>({t:0}),setup(oe,x,F){const z=F.state.data,Pe=z.select(c.QX.Generators.ofType(A.O.Molecule.Structure.Representation3D,oe.target&&"all"!==oe.target?oe.target:c.Cn.RootRef)),Ge=z.build();let Xe=!1;for(const Qe of Pe)z.select(c.QX.Generators.ofTransformer(y.f.Representation.UnwindStructureAssemblyRepresentation3D,Qe.transform.ref)).length>0||(Xe=!0,Ge.to(Qe).apply(y.f.Representation.UnwindStructureAssemblyRepresentation3D,{t:0},{tags:"animate-assembly-unwind"}));if(Xe)return Ge.commit({doNotUpdateCurrent:!0})},teardown(oe,x,F){const z=F.state.data,me=z.select(c.QX.Generators.ofType(A.O.Molecule.Structure.Representation3DState).withTag("animate-assembly-unwind"));if(0===me.length)return;const Pe=z.build();for(const Ge of me)Pe.delete(Ge.transform.ref);return Pe.commit()},apply:(oe,x,F)=>(0,r.A)(function*(){const z=F.plugin.state.data,Pe=z.select(c.QX.Generators.ofTransformer(y.f.Representation.UnwindStructureAssemblyRepresentation3D,F.params.target&&"all"!==F.params.target?F.params.target:c.Cn.RootRef));if(0===Pe.length)return{kind:"finished"};const Ge=z.build();let Qe=oe.t+(x.current-x.lastApplied)/F.params.durationInMs,lt=!1;F.params.playOnce&&Qe>=1?(lt=!0,Qe=1):Qe%=1;for(const ft of Pe)Ge.to(ft).update({t:Qe});return yield i.a.State.Update(F.plugin,{state:z,tree:Ge,options:{doNotLogTiming:!0}}),lt?{kind:"finished"}:{kind:"next",state:{t:Qe}}})()});var b=n(127),_=n(5126),M=n(2086);const I=(0,M.e)(),l=(0,M.e)(),m=(0,_.k)(),u=t.create({name:"built-in.animate-camera-spin",display:{name:"Camera Spin",description:"Spin the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:v.t.Numeric(4e3,{min:100,max:2e4,step:100}),speed:v.t.Numeric(1,{min:1,max:10,step:1},{description:"How many times to spin in the specified duration."}),direction:v.t.Select("cw",[["cw","Clockwise"],["ccw","Counter Clockwise"]],{cycle:!0})}),initialState:(oe,x)=>{var F;return{snapshot:null===(F=x.canvas3d)||void 0===F?void 0:F.camera.getSnapshot()}},getDuration:oe=>({kind:"fixed",durationMs:oe.durationInMs}),teardown:(oe,x,F)=>{var z;null===(z=F.canvas3d)||void 0===z||z.requestCameraReset({snapshot:x.snapshot,durationMs:0})},apply:(oe,x,F)=>(0,r.A)(function*(){var z,me;if(0===x.current)return{kind:"next",state:oe};const Pe=oe.snapshot;if(Pe.radiusMax<1e-4)return{kind:"finished"};const Ge=x.animation?(null===(z=x.animation)||void 0===z?void 0:z.currentFrame)/(x.animation.frameCount+1):(0,b.qE)(x.current/F.params.durationInMs,0,1),Xe=2*Math.PI*Ge*F.params.speed*("ccw"===F.params.direction?-1:1);M.e.sub(I,Pe.position,Pe.target),M.e.normalize(l,Pe.up),_.k.setAxisAngle(m,l,Xe),M.e.transformQuat(I,I,m);const Qe=M.e.add((0,M.e)(),Pe.target,I);return null===(me=F.plugin.canvas3d)||void 0===me||me.requestCameraReset({snapshot:{...Pe,position:Qe},durationMs:0}),Ge>=.99999?{kind:"finished"}:{kind:"next",state:oe}})()}),d=t.create({name:"built-in.animate-model-index",display:{name:"Animate Trajectory"},isExportable:!0,params:()=>({mode:v.t.MappedStatic("loop",{palindrome:v.t.Group({}),loop:v.t.Group({direction:v.t.Select("forward",[["forward","Forward"],["backward","Backward"]])}),once:v.t.Group({direction:v.t.Select("forward",[["forward","Forward"],["backward","Backward"]])},{isFlat:!0})},{options:[["palindrome","Palindrome"],["loop","Loop"],["once","Once"]]}),duration:v.t.MappedStatic("fixed",{fixed:v.t.Group({durationInS:v.t.Numeric(5,{min:1,max:120,step:.1},{description:"Duration in seconds"})},{isFlat:!0}),computed:v.t.Group({targetFps:v.t.Numeric(30,{min:5,max:250,step:1},{label:"Target FPS"})},{isFlat:!0}),sequential:v.t.Group({maxFps:v.t.Numeric(30,{min:5,max:60,step:1})},{isFlat:!0})})}),canApply(oe){const x=oe.state.data,F=x.select(c.QX.Generators.ofTransformer(y.f.Model.ModelFromTrajectory));for(const z of F){const me=c.QX.findAncestorOfType(x.tree,x.cells,z.transform.ref,A.O.Molecule.Trajectory);if(me&&me.obj&&me.obj.data.frameCount>1)return{canApply:!0}}return{canApply:!1,reason:"No trajectory to animate"}},getDuration:(oe,x)=>{var F;if("fixed"===(null===(F=oe.duration)||void 0===F?void 0:F.name))return{kind:"fixed",durationMs:1e3*oe.duration.params.durationInS};if("computed"===oe.duration.name){const z=x.state.data,me=z.select(c.QX.Generators.ofTransformer(y.f.Model.ModelFromTrajectory));let Pe=0;for(const Ge of me){const Xe=c.QX.findAncestorOfType(z.tree,z.cells,Ge.transform.ref,A.O.Molecule.Trajectory);Xe&&Xe.obj&&(Pe=Math.max(Math.ceil(1e3*Xe.obj.data.frameCount/oe.duration.params.targetFps),Pe))}return{kind:"fixed",durationMs:Pe}}return{kind:"unknown"}},initialState:()=>({}),apply:(oe,x,F)=>(0,r.A)(function*(){if("sequential"===F.params.duration.name&&x.current>0&&x.current-x.lastApplied<1e3/F.params.duration.params.maxFps)return{kind:"skip"};const z=F.plugin.state.data,me=z.select(c.QX.Generators.ofTransformer(y.f.Model.ModelFromTrajectory));if(0===me.length)return{kind:"finished"};const Pe=z.build(),Ge=F.params,Xe=oe.palindromeDirections||{};let Qe=!1,lt=!0;for(const ft of me){const wt=c.QX.findAncestorOfType(z.tree,z.cells,ft.transform.ref,A.O.Molecule.Trajectory);if(!wt||!wt.obj)continue;const Ut=wt.obj;Ut.data.frameCount<=1||Pe.to(ft).update(Jt=>{const gn=Ut.data.frameCount;if(1===gn)return Jt;if(lt=!1,"sequential"===Ge.duration.name){let Pn=1;if("once"===Ge.mode.name){if(Pn="backward"===Ge.mode.params.direction?-1:1,-1===Pn&&0===Jt.modelIndex||1===Pn&&Jt.modelIndex===gn-1)return Qe=!0,Jt}else"palindrome"===Ge.mode.name&&(Pn=0===Jt.modelIndex?1:Jt.modelIndex===gn-1?-1:Xe[ft.transform.ref]||1);Xe[ft.transform.ref]=Pn;let wn=(Jt.modelIndex+Pn)%gn;return wn<0&&(wn+=gn),Qe=Qe||-1===Pn&&0===wn||1===Pn&&wn===gn-1,{modelIndex:wn}}{const Pn="fixed"===Ge.duration.name?1e3*Ge.duration.params.durationInS:Math.ceil(1e3*Ut.data.frameCount/Ge.duration.params.targetFps);if("once"===Ge.mode.name&&x.current>=Pn)return Qe=!0,{modelIndex:Ut.data.frameCount-1};let wn=x.current%Pn/Pn;return"loop"===Ge.mode.name&&"backward"===Ge.mode.params.direction&&(wn=1-wn),"palindrome"===Ge.mode.name&&(wn*=2,wn>1&&(wn=2-wn)),{modelIndex:Math.min(Math.floor(Ut.data.frameCount*wn),Ut.data.frameCount-1)}}})}return lt||(yield i.a.State.Update(F.plugin,{state:z,tree:Pe,options:{doNotLogTiming:!0}})),lt||"once"===Ge.mode.name&&Qe?{kind:"finished"}:"palindrome"===Ge.mode.name?{kind:"next",state:{palindromeDirections:Xe}}:{kind:"next",state:{}}})()});function s(oe,x){return C.apply(this,arguments)}function C(){return C=(0,r.A)(function*(oe,x,F=!1){var z,me,Pe,Ge;x.snapshot.data&&(yield oe.runTask(oe.state.data.setSnapshot(x.snapshot.data)),null===(z=oe.canvas3d)||void 0===z||z.setProps({trackball:null===(Pe=null===(me=x.snapshot.canvas3d)||void 0===me?void 0:me.props)||void 0===Pe?void 0:Pe.trackball})),x.snapshot.camera&&(null===(Ge=oe.canvas3d)||void 0===Ge||Ge.requestCameraReset({snapshot:x.snapshot.camera.current,durationMs:F||"instant"===x.snapshot.camera.transitionStyle?0:x.snapshot.camera.transitionDurationInMs}))}),C.apply(this,arguments)}const h=t.create({name:"built-in.animate-state-snapshots",display:{name:"State Snapshots"},isExportable:!0,params:()=>({}),canApply(oe){const x=oe.managers.snapshot.state.entries;return x.size<2?{canApply:!1,reason:"At least 2 states required."}:x.some(F=>!!F?.snapshot.startAnimation)?{canApply:!1,reason:"Nested animations not supported."}:{canApply:oe.managers.snapshot.state.entries.size>1}},setup(oe,x,F){const z=F.managers.snapshot.state.entries.get(0);s(F,z,!0)},getDuration:(oe,x)=>({kind:"fixed",durationMs:x.managers.snapshot.state.entries.toArray().reduce((F,z)=>{var me;return F+(null!==(me=z.snapshot.durationInMs)&&void 0!==me?me:0)},0)}),initialState:(oe,x)=>{const F=x.managers.snapshot.state.entries.toArray();return{totalDuration:F.reduce((z,me)=>{var Pe;return z+(null!==(Pe=me.snapshot.durationInMs)&&void 0!==Pe?Pe:0)},0),snapshots:F,currentIndex:0}},apply:(oe,x,F)=>(0,r.A)(function*(){var z;if(x.current>=oe.totalDuration)return{kind:"finished"};let me=0,Pe=0;for(const Ge of oe.snapshots){if(me+=null!==(z=Ge.snapshot.durationInMs)&&void 0!==z?z:0,x.current=oe.snapshots.length?{kind:"finished"}:Pe===oe.currentIndex?{kind:"skip"}:(yield s(F.plugin,oe.snapshots[Pe]),{kind:"next",state:{...oe,currentIndex:Pe}})})()});var a=n(4987),S=n(445),D=n(1732),R=n(4824),f=n(675),p=n(1861),E=n(1372);const T=c.KW.build({from:A.O.Root,display:{name:"Download Density",description:"Load a density from the provided source and create its default visual."},params:(oe,x)=>{const{options:F}=x.dataFormats;return{source:v.t.MappedStatic("pdb-xray",{"pdb-xray":v.t.Group({provider:v.t.Group({id:v.t.Text("1tqn",{label:"Id"}),server:v.t.Select("rcsb",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),type:v.t.Select("2fofc",[["2fofc","2Fo-Fc"],["fofc","Fo-Fc"]])},{isFlat:!0}),"pdb-xray-ds":v.t.Group({provider:v.t.Group({id:v.t.Text("1tqn",{label:"Id"}),server:v.t.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:v.t.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),"pdb-emd-ds":v.t.Group({provider:v.t.Group({id:v.t.Text("emd-8004",{label:"Id"}),server:v.t.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:v.t.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),url:v.t.Group({url:v.t.Url(""),isBinary:v.t.Boolean(!1),format:v.t.Select("auto",F)},{isFlat:!0})},{options:[["pdb-xray","PDB X-ray maps"],["pdb-emd-ds","PDB EMD Density Server"],["pdb-xray-ds","PDB X-ray Density Server"],["url","URL"]]})}}})(({params:oe},x)=>R.YZ.create("Download Density",function(){var F=(0,r.A)(function*(z){var me,Pe;const Ge=oe.source;let Xe,Qe;switch(Ge.name){case"url":Xe=Ge.params;break;case"pdb-xray":Xe="pdbe"===Ge.params.provider.server?{url:p.V.Url("2fofc"===Ge.params.type?`https://www.ebi.ac.uk/pdbe/coordinates/files/${Ge.params.provider.id.toLowerCase()}.ccp4`:`https://www.ebi.ac.uk/pdbe/coordinates/files/${Ge.params.provider.id.toLowerCase()}_diff.ccp4`),isBinary:!0,label:`PDBe X-ray map: ${Ge.params.provider.id}`}:{url:p.V.Url("2fofc"===Ge.params.type?`https://edmaps.rcsb.org/maps/${Ge.params.provider.id.toLowerCase()}_2fofc.dsn6`:`https://edmaps.rcsb.org/maps/${Ge.params.provider.id.toLowerCase()}_fofc.dsn6`),isBinary:!0,label:`RCSB X-ray map: ${Ge.params.provider.id}`};break;case"pdb-emd-ds":Xe="pdbe"===Ge.params.provider.server?{url:p.V.Url(`https://www.ebi.ac.uk/pdbe/densities/emd/${Ge.params.provider.id.toLowerCase()}/cell?detail=${Ge.params.detail}`),isBinary:!0,label:`PDBe EMD Density Server: ${Ge.params.provider.id}`}:{url:p.V.Url(`https://maps.rcsb.org/em/${Ge.params.provider.id.toLowerCase()}/cell?detail=${Ge.params.detail}`),isBinary:!0,label:`RCSB PDB EMD Density Server: ${Ge.params.provider.id}`};break;case"pdb-xray-ds":Xe="pdbe"===Ge.params.provider.server?{url:p.V.Url(`https://www.ebi.ac.uk/pdbe/densities/x-ray/${Ge.params.provider.id.toLowerCase()}/cell?detail=${Ge.params.detail}`),isBinary:!0,label:`PDBe X-ray Density Server: ${Ge.params.provider.id}`}:{url:p.V.Url(`https://maps.rcsb.org/x-ray/${Ge.params.provider.id.toLowerCase()}/cell?detail=${Ge.params.detail}`),isBinary:!0,label:`RCSB PDB X-ray Density Server: ${Ge.params.provider.id}`};break;default:(0,E.dr)(Ge)}const lt=yield x.builders.data.download(Xe);let ft;switch(Ge.name){case"url":Xe=Ge.params,Qe="auto"===Ge.params.format?x.dataFormats.auto((0,f.o)(p.V.getUrl(Xe.url)),null===(me=lt.cell)||void 0===me?void 0:me.obj):x.dataFormats.get(Ge.params.format);break;case"pdb-xray":ft=Ge.params.provider.id,Qe=x.dataFormats.get("pdbe"===Ge.params.provider.server?"ccp4":"dsn6");break;case"pdb-emd-ds":case"pdb-xray-ds":ft=Ge.params.provider.id,Qe=x.dataFormats.get("dscif");break;default:(0,E.dr)(Ge)}if(!Qe)return void x.log.warn("DownloadDensity: Format provider not found.");const wt=yield Qe.parse(x,lt,{entryId:ft});yield null===(Pe=Qe.visuals)||void 0===Pe?void 0:Pe.call(Qe,x,wt)});return function(z){return F.apply(this,arguments)}}())),L=c.KW.build({display:{name:"Assign Volume Colors",description:"Assigns another volume to be available for coloring."},from:A.O.Volume.Data,isApplicable:oe=>!oe.data.colorVolume,params(oe,x){const F=x.state.data.select(c.QX.Generators.root.subtree().ofType(A.O.Volume.Data).filter(z=>{var me;return!(!z.obj||null!==(me=z.obj)&&void 0!==me&&me.data.colorVolume||z.obj===oe)}));return 0===F.length?{ref:v.t.Text("",{isHidden:!0,label:"Volume"})}:{ref:v.t.Select(F[0].transform.ref,F.map(z=>[z.transform.ref,z.obj.label]),{label:"Volume"})}}})(({ref:oe,params:x},z)=>z.build().to(oe).apply(y.f.Volume.AssignColorVolume,{ref:x.ref},{dependsOn:[x.ref]}).commit());var w=n(6511);const Q={Structure:D,Volume:e,DataFormat:w};var G=n(9909);const V=t.create({name:"built-in.animate-state-interpolation",display:{name:"Animate State (experimental)"},params:()=>({transtionDurationInMs:v.t.Numeric(2e3,{min:100,max:3e4,step:10})}),canApply:oe=>({canApply:oe.managers.snapshot.state.entries.size>1}),initialState:()=>({}),apply:(oe,x,F)=>(0,r.A)(function*(){const z=F.plugin.managers.snapshot.state.entries;if(z.size<2)return{kind:"finished"};const me=x.current%F.params.transtionDurationInMs/F.params.transtionDurationInMs,Pe=Math.floor(x.current/F.params.transtionDurationInMs)%z.size;let Ge=Math.ceil(x.current/F.params.transtionDurationInMs);Ge===Pe&&Ge++,Ge%=z.size;const Xe=z.get(Pe).snapshot,Qe=z.get(Ge).snapshot;if(!Xe.data||!Qe.data)return{kind:"skip"};const lt=Xe.data.tree.transforms,ft=Qe.data.tree.transforms,wt=F.plugin.state.data,Ut=wt.build();for(const Jt of lt)for(const gn of ft){if(gn.ref!==Jt.ref||gn.version===Jt.version)continue;const Pn=c.Cn.fromJSON(Jt),wn=c.Cn.fromJSON(gn),Bn=wt.cells.get(Jt.ref);if(!Bn)continue;let Mn;Mn=Pn.transformer.definition.interpolate?Pn.transformer.definition.interpolate(Pn.params,wn.params,me,F.plugin):me<=.5?Pn.params:wn.params,(0,G.bN)(Bn,Mn)||Ut.to(Jt.ref).update(Mn)}return yield i.a.State.Update(F.plugin,{state:wt,tree:Ut,options:{doNotLogTiming:!0}}),{kind:"next",state:{}}})()}),U=t.create({name:"built-in.animate-structure-spin",display:{name:"Spin Structure"},isExportable:!0,params:()=>({durationInMs:v.t.Numeric(3e3,{min:100,max:1e4,step:100})}),initialState:()=>({t:0}),getDuration:oe=>({kind:"fixed",durationMs:oe.durationInMs}),setup:(oe,x,F)=>(0,r.A)(function*(){const z=F.state.data,me=z.select(c.QX.Generators.ofType(A.O.Molecule.Structure.Representation3D)),Pe=z.build();let Ge=!1;for(const Xe of me)z.select(c.QX.Generators.ofTransformer(y.f.Representation.SpinStructureRepresentation3D,Xe.transform.ref)).length>0||(Ge=!0,Pe.to(Xe.transform.ref).apply(y.f.Representation.SpinStructureRepresentation3D,{t:0},{tags:"animate-structure-spin"}));if(Ge)return Pe.commit({doNotUpdateCurrent:!0})})(),teardown(oe,x,F){const z=F.state.data,me=z.select(c.QX.Generators.ofType(A.O.Molecule.Structure.Representation3DState).withTag("animate-structure-spin"));if(0===me.length)return;const Pe=z.build();for(const Ge of me)Pe.delete(Ge.transform.ref);return Pe.commit()},apply:(oe,x,F)=>(0,r.A)(function*(){var z;const me=F.plugin.state.data,Pe=me.select(c.QX.Generators.ofTransformer(y.f.Representation.SpinStructureRepresentation3D));if(0===Pe.length)return{kind:"finished"};const Ge=me.build(),Qe=(oe.t+(x.current-x.lastApplied)/F.params.durationInMs)%1;for(const lt of Pe)Ge.to(lt).update({...null===(z=lt.params)||void 0===z?void 0:z.values,t:Qe});return yield i.a.State.Update(F.plugin,{state:me,tree:Ge,options:{doNotLogTiming:!0}}),{kind:"next",state:{t:Qe}}})()});var N=n(4490);const k=(0,M.e)(),H=(0,M.e)(),$=(0,_.k)(),J=t.create({name:"built-in.animate-camera-rock",display:{name:"Camera Rock",description:"Rock the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:v.t.Numeric(4e3,{min:100,max:2e4,step:100}),speed:v.t.Numeric(1,{min:1,max:10,step:1},{description:"How many times to rock from side to side."}),angle:v.t.Numeric(10,{min:0,max:180,step:1},{description:"How many degrees to rotate in each direction."})}),initialState:(oe,x)=>({snapshot:x.canvas3d.camera.getSnapshot()}),getDuration:oe=>({kind:"fixed",durationMs:oe.durationInMs}),teardown:(oe,x,F)=>{var z;null===(z=F.canvas3d)||void 0===z||z.requestCameraReset({snapshot:x.snapshot,durationMs:0})},apply:(oe,x,F)=>(0,r.A)(function*(){var z,me;if(0===x.current)return{kind:"next",state:oe};const Pe=oe.snapshot;if(Pe.radiusMax<1e-4)return{kind:"finished"};const Ge=x.animation?(null===(z=x.animation)||void 0===z?void 0:z.currentFrame)/(x.animation.frameCount+1):(0,b.qE)(x.current/F.params.durationInMs,0,1),Xe=Math.sin(Ge*F.params.speed*Math.PI*2)*(0,N.pu)(F.params.angle);M.e.sub(k,Pe.position,Pe.target),M.e.normalize(H,Pe.up),_.k.setAxisAngle($,H,Xe),M.e.transformQuat(k,k,$);const Qe=M.e.add((0,M.e)(),Pe.target,k);return null===(me=F.plugin.canvas3d)||void 0===me||me.requestCameraReset({snapshot:{...Pe,position:Qe},durationMs:0}),Ge>=.99999?{kind:"finished"}:{kind:"next",state:oe}})()});var W;!function(oe){oe.Action=function x(z,me){return{action:z,customControl:me&&me.customControl,autoUpdate:me&&me.autoUpdate}},oe.Behavior=function F(z,me={}){return{transformer:z,defaultParams:me}}}(W||(W={}));var de=n(9619),ye=n(1133),j=n(6230),Z=n(3584),q=n(7561),Y=n(7788),ee=n(6853),g=n(4369),_e=n(2745),xe=n(229),le=n(1827),Ae=n(9611);const Be={color:v.t.Color(_e.s.black,{description:"Display color of the volume."}),wireframe:v.t.Boolean(!1,{description:"Control display of the volume as a wireframe."}),opacity:v.t.Numeric(.3,{min:0,max:1,step:.01},{description:"Opacity of the volume."})},Ce=new Map([["em",[-5,5]],["2fo-fc",[0,3]],["fo-fc(+ve)",[1,5]],["fo-fc(-ve)",[-5,-1]]]);class Re extends ye.dL{constructor(){super(...arguments),this.ref=c.QX.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name),this.getVisible=()=>{const F=this.ref;return!!F&&!this.plugin.state.data.cells.get(F).state.isHidden},this.toggleVisible=()=>{const x=this.plugin.state.data,F=this.ref;F&&(0,le.setSubtreeVisibility)(x,F,!x.cells.get(F).state.isHidden)}}componentDidUpdate(){this.ref=c.QX.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name)}componentDidMount(){this.subscribe(this.plugin.state.data.events.cell.stateUpdated,x=>{this.ref===x.ref&&this.forceUpdate()})}render(){const x=this.props,{isRelative:F,stats:z}=x,me=x.channels[x.name],{min:Pe,max:Ge,mean:Xe,sigma:Qe}=z,lt=Math.round(100*("relative"===me.isoValue.kind?me.isoValue.relativeValue:me.isoValue.absoluteValue))/100;let ft=(Pe-Xe)/Qe,wt=(Ge-Xe)/Qe;if(!this.props.isUnbounded){const Bn=Ce.get(this.props.name);"em"===this.props.name?(ft=Math.max(Bn[0],ft),wt=Math.min(Bn[1],wt)):(ft=Bn[0],wt=Bn[1])}const Ut=Xe+Qe*ft,Jt=Xe+Qe*wt,gn=(0,xe.QX)(F?Math.round((Jt-Ut)/Qe)/100:Qe/100,2);return(0,de.jsx)(Z.U2,{label:x.label+(x.isRelative?" \u03c3":""),colorStripe:me.color,pivot:(0,de.jsxs)("div",{className:"msp-volume-channel-inline-controls",children:[(0,de.jsx)(Y.Ap,{value:lt,min:F?ft:Ut,max:F?wt:Jt,step:gn,onChange:Bn=>x.changeIso(x.name,Bn,F),onChangeImmediate:Bn=>x.changeIso(x.name,Bn,F),disabled:x.params.isDisabled,onEnter:x.params.events.onEnter}),(0,de.jsx)(Z.K0,{svg:this.getVisible()?Ae.zs:Ae.qF,onClick:this.toggleVisible,toggleState:!1,disabled:x.params.isDisabled})]}),controls:(0,de.jsx)(q.y1,{onChange:({name:Bn,value:Mn})=>x.changeParams(x.name,Bn,Mn),params:Be,values:me,onEnter:x.params.events.onEnter,isDisabled:x.params.isDisabled})})}}class ke extends ye.dL{constructor(){super(...arguments),this.changeIso=(x,F,z)=>{const me=this.props.params;this.newParams({...me,entry:{name:me.entry.name,params:{...me.entry.params,channels:{...me.entry.params.channels,[x]:{...me.entry.params.channels[x],isoValue:z?ee.f.IsoValue.relative(F):ee.f.IsoValue.absolute(F)}}}}})},this.changeParams=(x,F,z)=>{const me=this.props.params;this.newParams({...me,entry:{name:me.entry.name,params:{...me.entry.params,channels:{...me.entry.params.channels,[x]:{...me.entry.params.channels[x],[F]:z}}}}})},this.changeOption=({name:x,value:F})=>{const z=this.props.params;if("entry"===x)this.newParams({...z,entry:{name:F,params:z.entry.params}});else{const me=this.props.b.data,Pe="em"===me.info.kind,Ge=F.params.isRelative,Xe=me.info.header.sampling[0],Qe=z.entry.params.channels,ft={...z.entry.params.view.name===F.name?z.entry.params.view.params:this.props.info.params.entry.map(z.entry.name).params.view.map(F.name).defaultValue};"selection-box"===F.name?ft.radius=F.params.radius:"camera-target"===F.name?(ft.radius=F.params.radius,ft.dynamicDetailLevel=F.params.dynamicDetailLevel):"box"===F.name?(ft.bottomLeft=F.params.bottomLeft,ft.topRight=F.params.topRight):"auto"===F.name&&(ft.radius=F.params.radius,ft.selectionDetailLevel=F.params.selectionDetailLevel),ft.isUnbounded=!!F.params.isUnbounded,this.newParams({...z,entry:{name:z.entry.name,params:{...z.entry.params,view:{name:F.name,params:ft},detailLevel:F.params.detailLevel,channels:Pe?{em:this.convert(Qe.em,Xe.valuesInfo[0],Ge)}:{"2fo-fc":this.convert(Qe["2fo-fc"],Xe.valuesInfo[0],Ge),"fo-fc(+ve)":this.convert(Qe["fo-fc(+ve)"],Xe.valuesInfo[1],Ge),"fo-fc(-ve)":this.convert(Qe["fo-fc(-ve)"],Xe.valuesInfo[1],Ge)}}}})}}}areInitial(x){return v.t.areEqual(this.props.info.params,x,this.props.info.initialValues)}newParams(x){this.props.events.onChange(x,this.areInitial(x))}convert(x,F,z){return{...x,isoValue:z?ee.f.IsoValue.toRelative(x.isoValue,F):ee.f.IsoValue.toAbsolute(x.isoValue,F)}}render(){if(!this.props.b)return null;const x=this.props.b.data,F="em"===x.info.kind,z=F?"em":"2fo-fc",me=this.props.params,Pe=this.props.info.params.entry.map(me.entry.name),Ge=Pe.params.detailLevel,Xe={...Ge,label:"Dynamic Detail",defaultValue:Pe.params.view.map("camera-target").params.dynamicDetailLevel.defaultValue},Qe={...Ge,label:"Selection Detail",defaultValue:Pe.params.view.map("auto").params.selectionDetailLevel.defaultValue},lt=x.info.header.sampling[0],ft="relative"===me.entry.params.channels[z].isoValue.kind,wt=v.t.Boolean(ft,{description:"Use normalized or absolute isocontour scale.",label:"Normalized"}),Ut=!!me.entry.params.view.params.isUnbounded,Jt=v.t.Boolean(Ut,{description:"Show full/limited range of iso-values for more fine-grained control.",label:"Unbounded"}),gn="off"===me.entry.params.view.name,Pn={entry:v.t.Select(me.entry.name,x.data.entries.map(Bn=>[Bn.dataId,Bn.dataId]),{isHidden:gn,description:"Which entry with volume data to display."}),view:v.t.MappedStatic(me.entry.params.view.name,{off:v.t.Group({isRelative:v.t.Boolean(ft,{isHidden:!0}),isUnbounded:v.t.Boolean(Ut,{isHidden:!0})},{description:"Display off."}),box:v.t.Group({bottomLeft:v.t.Vec3(g.eB.zero()),topRight:v.t.Vec3(g.eB.zero()),detailLevel:Ge,isRelative:wt,isUnbounded:Jt},{description:"Static box defined by cartesian coords."}),"selection-box":v.t.Group({radius:v.t.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212b within which the volume is shown."}),detailLevel:Ge,isRelative:wt,isUnbounded:Jt},{description:"Box around focused element."}),"camera-target":v.t.Group({radius:v.t.Numeric(.5,{min:0,max:1,step:.05},{description:"Radius within which the volume is shown (relative to the field of view)."}),detailLevel:{...Ge,isHidden:!0},dynamicDetailLevel:Xe,isRelative:wt,isUnbounded:Jt},{description:"Box around camera target."}),cell:v.t.Group({detailLevel:Ge,isRelative:wt,isUnbounded:Jt},{description:"Box around the structure's bounding box."}),auto:v.t.Group({radius:v.t.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212b within which the volume is shown."}),detailLevel:Ge,selectionDetailLevel:Qe,isRelative:wt,isUnbounded:Jt},{description:"Box around focused element."})},{options:j.h.ViewTypeOptions,description:'Controls what of the volume is displayed. "Off" hides the volume alltogether. "Bounded box" shows the volume inside the given box. "Around Focus" shows the volume around the element/atom last interacted with. "Around Camera" shows the volume around the point the camera is targeting. "Whole Structure" shows the volume for the whole structure.'})},wn={entry:me.entry.name,view:{name:me.entry.params.view.name,params:{detailLevel:me.entry.params.detailLevel,radius:me.entry.params.view.params.radius,bottomLeft:me.entry.params.view.params.bottomLeft,topRight:me.entry.params.view.params.topRight,selectionDetailLevel:me.entry.params.view.params.selectionDetailLevel,dynamicDetailLevel:me.entry.params.view.params.dynamicDetailLevel,isRelative:ft,isUnbounded:Ut}}};return gn?(0,de.jsx)(q.y1,{onChange:this.changeOption,params:Pn,values:wn,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled}):(0,de.jsxs)(de.Fragment,{children:[!F&&(0,de.jsx)(Re,{label:"2Fo-Fc",name:"2fo-fc",bCell:this.props.bCell,channels:me.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:ft,params:this.props,stats:lt.valuesInfo[0],isUnbounded:Ut}),!F&&(0,de.jsx)(Re,{label:"Fo-Fc(+ve)",name:"fo-fc(+ve)",bCell:this.props.bCell,channels:me.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:ft,params:this.props,stats:lt.valuesInfo[1],isUnbounded:Ut}),!F&&(0,de.jsx)(Re,{label:"Fo-Fc(-ve)",name:"fo-fc(-ve)",bCell:this.props.bCell,channels:me.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:ft,params:this.props,stats:lt.valuesInfo[1],isUnbounded:Ut}),F&&(0,de.jsx)(Re,{label:"EM",name:"em",bCell:this.props.bCell,channels:me.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:ft,params:this.props,stats:lt.valuesInfo[0],isUnbounded:Ut}),(0,de.jsx)(q.y1,{onChange:this.changeOption,params:Pn,values:wn,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled})]})}}var ue,Oe=n(1025),Se=n(39),Ve=n(7786),Ne=n(152),K=n(3386),ne=n(5964),be=n(6697),Te=n(3177),ie=n(6345);!function(oe){oe.Registry=class x{constructor(){this.providers=(0,Se.uY)().asMutable(),this.defaultAutoAttachValues=new Map}getParams(z){const me={},Pe=[],Ge=[];if(z){const Xe=this.providers.values();for(;;){const Qe=Xe.next();if(Qe.done)break;const lt=Qe.value;lt.isApplicable(z)&&(lt.isHidden||(Pe.push([lt.descriptor.name,lt.label]),this.defaultAutoAttachValues.get(lt.descriptor.name)&&Ge.push(lt.descriptor.name)),me[lt.descriptor.name]=v.t.Group({...lt.getParams(z)},{label:lt.label,isHidden:lt.isHidden}))}}return{autoAttach:v.t.MultiSelect(Ge,Pe),properties:v.t.Group(me,{isFlat:!0})}}setDefaultAutoAttach(z,me){this.defaultAutoAttachValues.set(z,me)}get(z){if(!this.providers.get(z))throw new Error(`Custom property '${z}' is not registered.`);return this.providers.get(z)}register(z,me){this.providers.set(z.descriptor.name,z),this.defaultAutoAttachValues.set(z.descriptor.name,me)}unregister(z){this.providers.delete(z),this.defaultAutoAttachValues.delete(z)}}}(ue||(ue={}));var re=n(6990);class ve{get dataState(){return this.plugin.state.data}rawData(x,F){return this.dataState.build().toRoot().apply(re.RawData,x,F).commit({revertOnError:!0})}download(x,F){return this.dataState.build().toRoot().apply(re.Download,x,F).commit({revertOnError:!0})}downloadBlob(x,F){return this.dataState.build().toRoot().apply(re.DownloadBlob,x,F).commit({revertOnError:!0})}readFile(x,F){var z=this;return(0,r.A)(function*(){var me,Pe,Ge;return{data:yield z.dataState.build().toRoot().apply(re.ReadFile,x,F).commit({revertOnError:!0}),fileInfo:(0,f.o)(null!==(Ge=null===(Pe=null===(me=x.file)||void 0===me?void 0:me.file)||void 0===Pe?void 0:Pe.name)&&void 0!==Ge?Ge:"")}})()}constructor(x){this.plugin=x}}var ce=n(8382),se=n(2629),ae=n(9359),ge=n(1893),Ie=n(8010),Le=n(9880),nt=n(6115),je=n(237);class Lt{get dataState(){return this.plugin.state.data}resolveProvider(x){var F;return"string"==typeof x?null!==(F=Le.Bj[x])&&void 0!==F?F:(0,ce.L9)(this._providers,z=>z.id===x):x}hasPreset(x){for(const F of this._providers)if(!F.isApplicable||F.isApplicable(x,this.plugin))return!0;return!1}get providers(){return this._providers}getPresets(x){if(!x)return this.providers;const F=[];for(const z of this._providers)z.isApplicable&&!z.isApplicable(x,this.plugin)||F.push(z);return F}getPresetSelect(x){const F=[];for(const z of this._providers)x&&z.isApplicable&&!z.isApplicable(x,this.plugin)||F.push([z.id,z.display.name,z.display.group]);return v.t.Select("auto",F)}getPresetsWithOptions(x){const F=[],z=Object.create(null);for(const me of this._providers)me.isApplicable&&!me.isApplicable(x,this.plugin)||(F.push([me.id,me.display.name]),z[me.id]=me.params?v.t.Group(me.params(x,this.plugin)):v.t.EmptyGroup());return 0===F.length?v.t.MappedStatic("",{"":v.t.EmptyGroup()}):v.t.MappedStatic(F[0][0],z,{options:F})}registerPreset(x){if(this.providerMap.has(x.id))throw new Error(`Representation provider with id '${x.id}' already registered.`);this._providers.push(x),this.providerMap.set(x.id,x)}unregisterPreset(x){this.providerMap.delete(x.id),(0,nt.mO)(this._providers,x)}applyPreset(x,F,z){var me;const Pe=this.resolveProvider(F);if(!Pe)return;const Xe=c.so.resolveAndCheck(this.plugin.state.data,x);if(!Xe)return void(se.Zq||console.warn("Applying structure repr. provider to bad cell."));const Qe=(null===(me=Pe.params)||void 0===me?void 0:me.call(Pe,Xe.obj,this.plugin))||{};let lt=z||(Pe.params?v.t.getDefaultValues(Qe):{});const ft=this.plugin.config.get(je.AB.Structure.DefaultRepresentationPresetParams);lt=v.t.merge(Qe,ft,lt);const wt=R.YZ.create(`${Pe.display.name}`,()=>Pe.apply(Xe,lt,this.plugin));return this.plugin.runTask(wt)}addRepresentation(x,F,z){var me=this;return(0,r.A)(function*(){const Pe=me.dataState.build(),Ge=me.buildRepresentation(Pe,x,F,z);if(Ge)return yield Pe.commit(),Ge})()}buildRepresentation(x,F,z,me){var Pe,Ge;if(!F)return;const Xe=null===(Ge=null===(Pe=c.so.resolveAndCheck(this.dataState,F))||void 0===Pe?void 0:Pe.obj)||void 0===Ge?void 0:Ge.data;if(!Xe)return;const Qe=(0,ge.pQ)(this.plugin,Xe,z);return me?.tag?x.to(F).applyOrUpdateTagged(me.tag,Ie.StructureRepresentation3D,Qe,{state:me?.initialState}).selector:x.to(F).apply(Ie.StructureRepresentation3D,Qe,{state:me?.initialState}).selector}constructor(x){this.plugin=x,this._providers=[],this.providerMap=new Map,this.defaultProvider=Le.Bj.auto,(0,ae.IF)(Le.Bj,F=>this.registerPreset(F))}}var Je=n(9136),en=n(9651),Bt=n(5384),pn=n(1295),$e=n(5589),mt=n(8103);function _t(oe){return oe}!function(oe){oe.CommonParams=(x,F)=>({modelProperties:v.t.Optional(v.t.Group(c.xE.getParamDefinition(y.f.Model.CustomModelProperties,void 0,F))),structureProperties:v.t.Optional(v.t.Group(c.xE.getParamDefinition(y.f.Model.CustomStructureProperties,void 0,F))),representationPreset:v.t.Optional(v.t.Text("auto"))})}(_t||(_t={}));const Me=_t.CommonParams,ut=_t({id:"preset-trajectory-default",display:{name:"Default (Assembly)",group:"Preset",description:"Shows the first assembly or, if that is unavailable, the first model."},isApplicable:oe=>!0,params:(oe,x)=>({model:v.t.Optional(v.t.Group(c.xE.getParamDefinition(y.f.Model.ModelFromTrajectory,oe,x))),showUnitcell:v.t.Optional(v.t.Boolean(!1)),structure:v.t.Optional(pn.z.getParams(void 0,"assembly").type),representationPresetParams:v.t.Optional(v.t.Group(Le.n9.CommonParams)),...Me(oe,x)}),apply:(oe,x,F)=>(0,r.A)(function*(){const z=F.builders.structure,me=yield z.createModel(oe,x.model),Pe=yield z.insertModelProperties(me,x.modelProperties),Ge=yield z.createStructure(Pe||me,x.structure),Xe=yield z.insertStructureProperties(Ge,x.structureProperties),Qe=void 0===x.showUnitcell||x.showUnitcell?yield z.tryCreateUnitcell(Pe,void 0,{isHidden:!0}):void 0,lt=x.representationPreset||F.config.get(je.AB.Structure.DefaultRepresentationPreset)||Le.Bj.auto.id;return{model:me,modelProperties:Pe,unitcell:Qe,structure:Ge,structureProperties:Xe,representation:yield F.builders.structure.representation.applyPreset(Xe,lt,x.representationPresetParams)}})()}),sn=_t({id:"preset-trajectory-all-models",display:{name:"All Models",group:"Preset",description:"Shows all models; colored by trajectory-index."},isApplicable:oe=>oe.data.frameCount>1,params:(oe,x)=>({useDefaultIfSingleModel:v.t.Optional(v.t.Boolean(!1)),representationPresetParams:v.t.Optional(v.t.Group(Le.n9.CommonParams)),...Me(oe,x)}),apply:(oe,x,F)=>(0,r.A)(function*(){var z,me;const Pe=null===(me=null===(z=c.so.resolveAndCheck(F.state.data,oe))||void 0===z?void 0:z.obj)||void 0===me?void 0:me.data;if(!Pe)return{};if(1===Pe.frameCount&&x.useDefaultIfSingleModel)return ut.apply(oe,x,F);const Ge=F.builders.structure,Xe=[],Qe=[];for(let lt=0;lt({model:v.t.Optional(v.t.Group(c.xE.getParamDefinition(y.f.Model.ModelFromTrajectory,oe,x))),...Me(oe,x)});function yt(oe,x,F,z){return At.apply(this,arguments)}function At(){return At=(0,r.A)(function*(oe,x,F,z){const me=z.builders.structure,Pe=yield me.createModel(x,F.model),Ge=yield me.insertModelProperties(Pe,F.modelProperties),Xe=yield me.createStructure(Ge||Pe,{name:"symmetry",params:oe}),Qe=yield me.insertStructureProperties(Xe,F.structureProperties),lt=yield me.tryCreateUnitcell(Ge,void 0,{isHidden:!1}),ft=F.representationPreset||z.config.get(je.AB.Structure.DefaultRepresentationPreset)||Le.Bj.auto.id;return{model:Pe,modelProperties:Ge,unitcell:lt,structure:Xe,structureProperties:Qe,representation:yield z.builders.structure.representation.applyPreset(Qe,ft,{theme:{globalName:oe.theme}})}}),At.apply(this,arguments)}const Gt=_t({id:"preset-trajectory-unitcell",display:{name:"Unit Cell",group:"Preset",description:"Shows the fully populated unit cell."},isApplicable:oe=>Je.Kx.hasCrystalSymmetry(oe.data.representative),params:gt,apply:(oe,x,F)=>(0,r.A)(function*(){return yield yt({ijkMin:g.eB.create(0,0,0),ijkMax:g.eB.create(0,0,0)},oe,x,F)})()}),rn=_t({id:"preset-trajectory-supercell",display:{name:"Super Cell",group:"Preset",description:"Shows the super cell, i.e. the central unit cell and all adjacent unit cells."},isApplicable:oe=>Je.Kx.hasCrystalSymmetry(oe.data.representative),params:gt,apply:(oe,x,F)=>(0,r.A)(function*(){return yield yt({ijkMin:g.eB.create(-1,-1,-1),ijkMax:g.eB.create(1,1,1),theme:"operator-hkl"},oe,x,F)})()}),Mt=_t({id:"preset-trajectory-crystal-contacts",display:{name:"Crystal Contacts",group:"Preset",description:"Showsasymetric unit and chains from neighbours within 5 \u212b, i.e., symmetry mates."},isApplicable:oe=>Je.Kx.hasCrystalSymmetry(oe.data.representative),params:(oe,x)=>({model:v.t.Optional(v.t.Group(c.xE.getParamDefinition(y.f.Model.ModelFromTrajectory,oe,x))),...Me(oe,x)}),apply:(oe,x,F)=>(0,r.A)(function*(){const z=F.builders.structure,me=yield z.createModel(oe,x.model),Pe=yield z.insertModelProperties(me,x.modelProperties),Ge=yield z.createStructure(Pe||me,{name:"symmetry-mates",params:{radius:5}}),Xe=yield z.insertStructureProperties(Ge,x.structureProperties),Qe=yield z.tryCreateUnitcell(Pe,void 0,{isHidden:!0}),lt=x.representationPreset||F.config.get(je.AB.Structure.DefaultRepresentationPreset)||Le.Bj.auto.id;return{model:me,modelProperties:Pe,unitcell:Qe,structure:Ge,structureProperties:Xe,representation:yield F.builders.structure.representation.applyPreset(Xe,lt,{theme:{globalName:"operator-name",carbonColor:"operator-name",focus:{name:"element-symbol",params:{carbonColor:{name:"operator-name",params:mt.PO.defaultValues}}}}})}})()}),nn={default:ut,"all-models":sn,unitcell:Gt,supercell:rn,crystalContacts:Mt};class bn{resolveProvider(x){var F;return"string"==typeof x?null!==(F=nn[x])&&void 0!==F?F:(0,ce.L9)(this._providers,z=>z.id===x):x}hasPreset(x){for(const F of this._providers)if(!F.isApplicable||F.isApplicable(x,this.plugin))return!0;return!1}get providers(){return this._providers}getPresets(x){if(!x)return this.providers;const F=[];for(const z of this._providers)z.isApplicable&&!z.isApplicable(x,this.plugin)||F.push(z);return F}getPresetSelect(x){const F=[];for(const z of this._providers)x&&z.isApplicable&&!z.isApplicable(x,this.plugin)||F.push([z.id,z.display.name]);return v.t.Select("auto",F)}getPresetsWithOptions(x){const F=[],z=Object.create(null);for(const me of this._providers)me.isApplicable&&!me.isApplicable(x,this.plugin)||(F.push([me.id,me.display.name]),z[me.id]=me.params?v.t.Group(me.params(x,this.plugin)):v.t.EmptyGroup());return 0===F.length?v.t.MappedStatic("",{"":v.t.EmptyGroup()}):v.t.MappedStatic(F[0][0],z,{options:F})}registerPreset(x){if(this.providerMap.has(x.id))throw new Error(`Hierarchy provider with id '${x.id}' already registered.`);this._providers.push(x),this.providerMap.set(x.id,x)}unregisterPreset(x){this.providerMap.delete(x.id),(0,nt.mO)(this._providers,x)}applyPreset(x,F,z){const me=this.resolveProvider(F);if(!me)return;const Ge=c.so.resolveAndCheck(this.plugin.state.data,x);if(!Ge)return void(se.Zq||console.warn("Applying hierarchy preset provider to bad cell."));const Xe=z||(me.params?v.t.getDefaultValues(me.params(Ge.obj,this.plugin)):{}),Qe=R.YZ.create(`${me.display.name}`,()=>me.apply(Ge,Xe,this.plugin));return this.plugin.runTask(Qe)}constructor(x){this.plugin=x,this._providers=[],this.providerMap=new Map,this.defaultProvider=nn.default,(0,ae.IF)(nn,F=>this.registerPreset(F))}}class Dn{get dataState(){return this.plugin.state.data}parseTrajectoryData(x,F){var z=this;return(0,r.A)(function*(){const me="string"==typeof F?z.plugin.dataFormats.get(F):F;if(!me)throw new Error(`'${F}' is not a supported data format.`);const{trajectory:Pe}=yield me.parse(z.plugin,x);return Pe})()}parseTrajectoryBlob(x,F){return this.dataState.build().to(x).apply(y.f.Data.ParseBlob,F,{state:{isGhost:!0}}).apply(y.f.Model.TrajectoryFromBlob,void 0).commit({revertOnError:!0})}parseTrajectory(x,F){const z=c.so.resolveAndCheck(this.dataState,x);if(!z)throw new Error("Invalid data cell.");return A.O.Data.Blob.is(z.obj)?this.parseTrajectoryBlob(x,F):this.parseTrajectoryData(x,F)}createModel(x,F,z){return this.dataState.build().to(x).apply(y.f.Model.ModelFromTrajectory,F||{modelIndex:0},{state:z}).commit({revertOnError:!0})}insertModelProperties(x,F,z){return this.dataState.build().to(x).apply(y.f.Model.CustomModelProperties,F,{state:z}).commit({revertOnError:!0})}tryCreateUnitcell(x,F,z){var me,Pe,Ge;const Xe=this.dataState,Qe=null===(Pe=null===(me=c.so.resolveAndCheck(Xe,x))||void 0===me?void 0:me.obj)||void 0===Pe?void 0:Pe.data;if(!Qe)return;const lt=null===(Ge=en.i.Provider.get(Qe))||void 0===Ge?void 0:Ge.spacegroup.cell;return Bt.O8.isZero(lt)?void 0:Xe.build().to(x).apply(y.f.Representation.ModelUnitcell3D,F,{state:z}).commit({revertOnError:!0})}createStructure(x,F,z,me){var Pe;const Ge=this.dataState;if(!F){const Qe=c.so.resolveAndCheck(Ge,x);if(Qe){const lt=en.i.Provider.get(null===(Pe=Qe.obj)||void 0===Pe?void 0:Pe.data);(!lt||0===lt?.assemblies.length)&&(F={name:"model",params:{}})}}return Ge.build().to(x).apply(y.f.Model.StructureFromModel,{type:F||{name:"assembly",params:{}}},{state:z,tags:me}).commit({revertOnError:!0})}insertStructureProperties(x,F){return this.dataState.build().to(x).apply(y.f.Model.CustomStructureProperties,F).commit({revertOnError:!0})}isComponentTransform(x){return x.transform.transformer===y.f.Model.StructureComponent}tryCreateComponent(x,F,z,me){var Pe=this;return(0,r.A)(function*(){var Ge,Xe;const Qe=Pe.dataState,lt=Qe.build().to(x),ft=`structure-component-${z}`,wt=lt.applyOrUpdateTagged(ft,y.f.Model.StructureComponent,F,{tags:me?[...me,ft]:[ft]});yield wt.commit();const Ut=wt.selector;if(Ut.isOk&&0!==(null===(Xe=null===(Ge=Ut.cell)||void 0===Ge?void 0:Ge.obj)||void 0===Xe?void 0:Xe.data.elementCount))return Ut;yield Qe.build().delete(Ut.ref).commit()})()}tryCreateComponentFromExpression(x,F,z,me){return this.tryCreateComponent(x,{type:{name:"expression",params:F},nullIfEmpty:!0,label:(me?.label||"").trim()},z,me?.tags)}tryCreateComponentStatic(x,F,z){return this.tryCreateComponent(x,{type:{name:"static",params:F},nullIfEmpty:!0,label:(z?.label||"").trim()},`static-${F}`,z?.tags)}tryCreateComponentFromSelection(x,F,z,me){var Pe=this;return this.plugin.runTask(R.YZ.create("Query Component",function(){var Ge=(0,r.A)(function*(Xe){var Qe,lt;let{label:ft,tags:wt}=me||{};ft=(ft||"").trim();const Ut=null===(lt=null===(Qe=c.so.resolveAndCheck(Pe.dataState,x))||void 0===Qe?void 0:Qe.obj)||void 0===lt?void 0:lt.data;if(!Ut)return;const Jt=F.referencesCurrent?{type:{name:"bundle",params:Je.iZ.Bundle.fromSelection(yield F.getSelection(Pe.plugin,Xe,Ut))},nullIfEmpty:!0,label:ft||F.label}:{type:{name:"expression",params:F.expression},nullIfEmpty:!0,label:ft||F.label};return F.ensureCustomProperties&&(yield F.ensureCustomProperties({runtime:Xe,assetManager:Pe.plugin.managers.asset},Ut)),Pe.tryCreateComponent(x,Jt,z,wt)});return function(Xe){return Ge.apply(this,arguments)}}()))}constructor(x){this.plugin=x,this.hierarchy=new bn(this.plugin),this.representation=new Lt(this.plugin)}}var Ct,$t,jt=n(5953),It=n(1425),Dt=n(3442);!function(oe){oe.create=function x(F){const{name:z}=F;return{descriptor:F,get:me=>me._propertyData[z],set(me,Pe){me.customProperties.add(F),me._propertyData[z]=Pe}}}}(Ct||(Ct={})),function(oe){oe.Descriptor={name:"recommended_iso_value"},oe.Provider=Ct.create(oe.Descriptor)}($t||($t={}));var Vt=n(6570);const Wt="Volume";function yn(oe,x){return Zt.apply(this,arguments)}function Zt(){return Zt=(0,r.A)(function*(oe,x){if(!x)return;const{entryId:F}=x;return F&&F.toLowerCase().startsWith("emd")?oe.runTask(R.YZ.create("Try Set Recommended IsoValue",function(){var z=(0,r.A)(function*(me){try{const Pe=yield(0,Vt.$A)(oe,me,F);$t.Provider.set(x,ee.f.IsoValue.absolute(Pe))}catch(Pe){console.warn(Pe)}});return function(me){return z.apply(this,arguments)}}())):void 0}),Zt.apply(this,arguments)}function kt(oe){const x=$t.Provider.get(oe);if(x)return"relative"===x.kind?x:ee.f.adjustedIsoValue(oe,x.absoluteValue,"absolute")}function Ot(oe,x){return An.apply(this,arguments)}function An(){return An=(0,r.A)(function*(oe,x){const F={},z=x.volume.data&&kt(x.volume.data);return z&&(F.isoValue=z),[yield oe.build().to(x.volume).apply(y.f.Representation.VolumeRepresentation3D,(0,Dt.aK)(oe,x.volume.data,{type:"isosurface",typeParams:F})).commit()]}),An.apply(this,arguments)}const jn=(0,It.N)({label:"CCP4/MRC/MAP",description:"CCP4/MRC/MAP",category:Wt,binaryExtensions:["ccp4","mrc","map"],parse:function(){var oe=(0,r.A)(function*(x,F,z){const me=x.build().to(F).apply(y.f.Data.ParseCcp4,{},{state:{isGhost:!0}}),Pe=me.apply(y.f.Volume.VolumeFromCcp4,{entryId:z?.entryId});return yield me.commit({revertOnError:!0}),yield yn(x,Pe.selector.data),{format:me.selector,volume:Pe.selector}});return function(F,z,me){return oe.apply(this,arguments)}}(),visuals:Ot}),On=(0,It.N)({label:"DSN6/BRIX",description:"DSN6/BRIX",category:Wt,binaryExtensions:["dsn6","brix"],parse:function(){var oe=(0,r.A)(function*(x,F,z){const me=x.build().to(F).apply(y.f.Data.ParseDsn6,{},{state:{isGhost:!0}}),Pe=me.apply(y.f.Volume.VolumeFromDsn6,{entryId:z?.entryId});return yield me.commit({revertOnError:!0}),yield yn(x,Pe.selector.data),{format:me.selector,volume:Pe.selector}});return function(F,z,me){return oe.apply(this,arguments)}}(),visuals:Ot}),fr=(0,It.N)({label:"DX",description:"DX",category:Wt,stringExtensions:["dx"],binaryExtensions:["dxbin"],parse:function(){var oe=(0,r.A)(function*(x,F,z){const Pe=x.build().to(F).apply(y.f.Data.ParseDx,{},{state:{isGhost:!0}}).apply(y.f.Volume.VolumeFromDx,{entryId:z?.entryId});return yield Pe.commit({revertOnError:!0}),yield yn(x,Pe.selector.data),{volume:Pe.selector}});return function(F,z,me){return oe.apply(this,arguments)}}(),visuals:Ot}),Dr=(0,It.N)({label:"Cube",description:"Cube",category:Wt,stringExtensions:["cub","cube"],parse:function(){var oe=(0,r.A)(function*(x,F,z){const me=x.build().to(F).apply(y.f.Data.ParseCube,{},{state:{isGhost:!0}}),Pe=me.apply(y.f.Volume.VolumeFromCube,{entryId:z?.entryId}),Ge=me.apply(y.f.Model.TrajectoryFromCube,void 0,{state:{isGhost:!0}}).apply(y.f.Model.ModelFromTrajectory).apply(y.f.Model.StructureFromModel);return yield me.commit({revertOnError:!0}),yield yn(x,Pe.selector.data),{format:me.selector,volume:Pe.selector,structure:Ge.selector}});return function(F,z,me){return oe.apply(this,arguments)}}(),visuals:function(){var oe=(0,r.A)(function*(x,F){var z,me;const Pe=x.build(),Ge=[],Xe=null===(me=null===(z=F.volume.cell)||void 0===z?void 0:z.obj)||void 0===me?void 0:me.data;if(Xe&&ee.f.isOrbitals(Xe)){const ft=Pe.to(F.volume).apply(y.f.Representation.VolumeRepresentation3D,(0,Dt.aK)(x,Xe,{type:"isosurface",typeParams:{isoValue:ee.f.IsoValue.relative(1),alpha:.4},color:"uniform",colorParams:{value:_e.s.blue}})),wt=Pe.to(F.volume).apply(y.f.Representation.VolumeRepresentation3D,(0,Dt.aK)(x,Xe,{type:"isosurface",typeParams:{isoValue:ee.f.IsoValue.relative(-1),alpha:.4},color:"uniform",colorParams:{value:_e.s.red}}));Ge.push(ft.selector,wt.selector)}else{const ft=Pe.to(F.volume).apply(y.f.Representation.VolumeRepresentation3D,(0,Dt.aK)(x,Xe,{type:"isosurface",typeParams:{isoValue:ee.f.IsoValue.relative(2),alpha:.4},color:"uniform",colorParams:{value:_e.s.grey}}));Ge.push(ft.selector)}const Qe=yield x.builders.structure.representation.applyPreset(F.structure,"auto");yield Pe.commit();const lt=[];return(0,ae.IF)(Qe?.representations,ft=>{ft&<.push(ft)}),[...Ge,...lt]});return function(F,z){return oe.apply(this,arguments)}}()}),Pr=(0,It.N)({label:"DensityServer CIF",description:"DensityServer CIF",category:Wt,stringExtensions:["cif"],binaryExtensions:["bcif"],isApplicable:(oe,x)=>"dscif"===(0,It.v)(oe,x),parse:function(){var oe=(0,r.A)(function*(x,F,z){var me;const Pe=yield x.build().to(F).apply(y.f.Data.ParseCif).commit(),Ge=x.build().to(Pe),Xe=Pe.obj.data.blocks;if(0===Xe.length)throw new Error("no data blocks");const Qe=[];let lt=0;for(const ft of Xe){if("SERVER"===ft.header.toUpperCase())continue;const wt=Array.isArray(z?.entryId)?z?.entryId[lt]:z?.entryId;(null===(me=ft.categories.volume_data_3d_info)||void 0===me?void 0:me.rowCount)>0&&(Qe.push(Ge.apply(y.f.Volume.VolumeFromDensityServerCif,{blockHeader:ft.header,entryId:wt}).selector),lt++)}yield Ge.commit();for(const ft of Qe)yield yn(x,ft.data);return{volumes:Qe}});return function(F,z,me){return oe.apply(this,arguments)}}(),visuals:function(){var oe=(0,r.A)(function*(x,F){const{volumes:z}=F,me=x.build(),Pe=[];if(z.length>0){const Ge=z[0].data&&kt(z[0].data)||ee.f.IsoValue.relative(1.5);Pe[0]=me.to(z[0]).apply(y.f.Representation.VolumeRepresentation3D,Ie.VolumeRepresentation3DHelpers.getDefaultParamsStatic(x,"isosurface",{isoValue:Ge,alpha:1},"uniform",{value:_e.s.teal})).selector}if(z.length>1){const Ge=Ie.VolumeRepresentation3DHelpers.getDefaultParamsStatic(x,"isosurface",{isoValue:ee.f.IsoValue.relative(3),alpha:.3},"uniform",{value:_e.s.green}),Xe=Ie.VolumeRepresentation3DHelpers.getDefaultParamsStatic(x,"isosurface",{isoValue:ee.f.IsoValue.relative(-3),alpha:.3},"uniform",{value:_e.s.red});Pe[Pe.length]=me.to(z[1]).apply(y.f.Representation.VolumeRepresentation3D,Ge).selector,Pe[Pe.length]=me.to(z[1]).apply(y.f.Representation.VolumeRepresentation3D,Xe).selector}return yield me.commit(),Pe});return function(F,z){return oe.apply(this,arguments)}}()}),or=(0,It.N)({label:"Segmentation CIF",description:"Segmentation CIF",category:Wt,stringExtensions:["cif"],binaryExtensions:["bcif"],isApplicable:(oe,x)=>"segcif"===(0,It.v)(oe,x),parse:function(){var oe=(0,r.A)(function*(x,F){var z;const me=yield x.build().to(F).apply(y.f.Data.ParseCif).commit(),Pe=x.build().to(me),Ge=me.obj.data.blocks;if(0===Ge.length)throw new Error("no data blocks");const Xe=[];for(const Qe of Ge)"SERVER"!==Qe.header.toUpperCase()&&(null===(z=Qe.categories.volume_data_3d_info)||void 0===z?void 0:z.rowCount)>0&&Xe.push(Pe.apply(y.f.Volume.VolumeFromSegmentationCif,{blockHeader:Qe.header}).selector);return yield Pe.commit(),{volumes:Xe}});return function(F,z){return oe.apply(this,arguments)}}(),visuals:function(){var oe=(0,r.A)(function*(x,F){const{volumes:z}=F,me=x.build(),Pe=[];return z.length>0&&ee.f.Segmentation.get(z[0].data)&&(Pe[Pe.length]=me.to(z[0]).apply(y.f.Representation.VolumeRepresentation3D,Ie.VolumeRepresentation3DHelpers.getDefaultParams(x,"segment",z[0].data,{alpha:1,instanceGranularity:!0},"volume-segment",{})).selector),yield me.commit(),Pe});return function(F,z){return oe.apply(this,arguments)}}()}),Nr=[["ccp4",jn],["dsn6",On],["cube",Dr],["dx",fr],["dscif",Pr],["segcif",or]],Jr=[["ply",(0,It.N)({label:"PLY",description:"PLY",category:"Shape",stringExtensions:["ply"],parse:function(){var oe=(0,r.A)(function*(x,F){const z=x.state.data.build().to(F).apply(y.f.Data.ParsePly,{},{state:{isGhost:!0}}),me=z.apply(y.f.Model.ShapeFromPly);return yield z.commit(),{format:z.selector,shape:me.selector}});return function(F,z){return oe.apply(this,arguments)}}(),visuals:(oe,x)=>oe.state.data.build().to(x.shape).apply(y.f.Representation.ShapeRepresentation3D).commit()})]];var To=n(2945),un=n(1169);class ct{get types(){return this._list.map(x=>[x.name,x.provider.label])}get extensions(){if(this._extensions)return this._extensions;const x=new Set;return this._list.forEach(({provider:F})=>{var z,me;null===(z=F.stringExtensions)||void 0===z||z.forEach(Pe=>x.add(Pe)),null===(me=F.binaryExtensions)||void 0===me||me.forEach(Pe=>x.add(Pe))}),this._extensions=x,x}get binaryExtensions(){if(this._binaryExtensions)return this._binaryExtensions;const x=new Set;return this._list.forEach(({provider:F})=>{var z;return null===(z=F.binaryExtensions)||void 0===z?void 0:z.forEach(me=>x.add(me))}),this._binaryExtensions=x,x}get options(){if(this._options)return this._options;const x=[];return this._list.forEach(({name:F,provider:z})=>x.push([F,z.label,z.category||""])),this._options=x,x}constructor(){this._list=[],this._map=new Map,this._extensions=void 0,this._binaryExtensions=void 0,this._options=void 0;for(const[x,F]of Nr)this.add(x,F);for(const[x,F]of To.PO)this.add(x,F);for(const[x,F]of un.VE)this.add(x,F);for(const[x,F]of Jr)this.add(x,F);for(const[x,F]of jt.HQ)this.add(x,F)}_clear(){this._extensions=void 0,this._binaryExtensions=void 0,this._options=void 0}add(x,F){this._clear(),this._list.push({name:x,provider:F}),this._map.set(x,F)}remove(x){this._clear(),this._list.splice(this._list.findIndex(F=>F.name===x),1),this._map.delete(x)}auto(x,F){var z,me;for(let Pe=0,Ge=this.list.length;Pe[x.name,x.display.name]),{label:"Animation"})}),this._params}updateParams(x){if(this.isEmpty)return;this.updateState({params:{...this.state.params,...x}});const F=this.map.get(this.state.params.current),z=F.params(this.context);this._current={anim:F,params:z,paramValues:v.t.getDefaultValues(z),state:{},startedTime:-1,lastTime:0},this.triggerUpdate()}updateCurrentParams(x){this.isEmpty||(this._current.paramValues={...this._current.paramValues,...x},this.triggerUpdate())}register(x){this.map.has(x.name)?this.context.log.error(`Animation '${x.name}' is already registered.`):(this._params=void 0,this.map.set(x.name,x),this._animations.push(x),1===this._animations.length?this.updateParams({current:x.name}):this.triggerUpdate())}play(x,F){var z=this;return(0,r.A)(function*(){yield z.stop(),z.map.has(x.name)||z.register(x),z.updateParams({current:x.name}),z.updateCurrentParams(F),yield z.start()})()}tick(x,F,z){var me=this;return(0,r.A)(function*(){me.currentTime=x,!me.isStopped&&(F||z?yield me.applyFrame(z):me.applyAsync())})()}start(){var x=this;return(0,r.A)(function*(){x.updateState({animationState:"playing"}),x.context.behaviors.state.isAnimating.value||x.context.behaviors.state.isAnimating.next(!0),x.triggerUpdate();const F=x._current.anim;let z=x._current.anim.initialState(x._current.paramValues,x.context);if(F.setup){const me=yield F.setup(x._current.paramValues,z,x.context);me&&(z=me)}x._current.lastTime=0,x._current.startedTime=-1,x._current.state=z,x.isStopped=!1})()}stop(){var x=this;return(0,r.A)(function*(){if(x.isStopped=!0,"stopped"!==x.state.animationState){const F=x._current.anim;F.teardown&&(yield F.teardown(x._current.paramValues,x._current.state,x.context)),x.updateState({animationState:"stopped"}),x.triggerUpdate()}x.context.behaviors.state.isAnimating.value&&x.context.behaviors.state.isAnimating.next(!1)})()}get isAnimating(){return"playing"===this.state.animationState}applyAsync(){var x=this;return(0,r.A)(function*(){if(!x.isApplying){x.isApplying=!0;try{yield x.applyFrame()}finally{x.isApplying=!1}}})()}applyFrame(x){var F=this;return(0,r.A)(function*(){const z=F.currentTime;F._current.startedTime<0&&(F._current.startedTime=z);const me=yield F._current.anim.apply(F._current.state,{lastApplied:F._current.lastTime,current:z-F._current.startedTime,animation:x},{params:F._current.paramValues,plugin:F.context});"finished"===me.kind?F.stop():"next"===me.kind&&(F._current.state=me.state,F._current.lastTime=z-F._current.startedTime),F.triggerApply()})()}getSnapshot(){return this.current?{state:this.state,current:{paramValues:this._current.paramValues,state:this._current.anim.stateSerialization?this._current.anim.stateSerialization.toJSON(this._current.state):this._current.state}}:{state:this.state}}setSnapshot(x){this.isEmpty||(this.updateState({animationState:x.state.animationState}),this.updateParams(x.state.params),x.current&&(this.current.paramValues=x.current.paramValues,this.current.state=this._current.anim.stateSerialization?this._current.anim.stateSerialization.fromJSON(x.current.state):x.current.state,this.triggerUpdate(),"playing"===this.state.animationState&&this.resume()))}resume(){var x=this;return(0,r.A)(function*(){x._current.lastTime=0,x._current.startedTime=-1;const F=x._current.anim;x.context.behaviors.state.isAnimating.value||x.context.behaviors.state.isAnimating.next(!0),F.setup&&(yield F.setup(x._current.paramValues,x._current.state,x.context)),x.isStopped=!1})()}constructor(x){super({params:{current:""},animationState:"stopped"}),this.context=x,this.map=new Map,this._animations=[],this.currentTime=0,this._params=void 0,this.events={updated:this.ev(),applied:this.ev()},this.isStopped=!0,this.isApplying=!1}}var xn=n(7136),Rn=n(3246),er=n(8199),ir=n(5276);function br(oe,x,F){const z=F[0],me=F[1],Pe=F[2];return(z*oe[0]+me*oe[1]+Pe*oe[2]+(-z*x[0]-me*x[1]-Pe*x[2]))/Math.sqrt(z*z+me*me+Pe*Pe)}const Ur={identity:g.U.create(1,0,0,0,1,0,0,0,1),rotX90:g.U.create(1,0,0,0,0,1,0,-1,0),rotY90:g.U.create(0,0,-1,0,1,0,1,0,0),rotZ90:g.U.create(0,1,0,-1,0,0,0,0,1),rotX270:g.U.create(1,0,0,0,0,-1,0,1,0),rotY270:g.U.create(0,0,1,0,1,0,-1,0,0),rotZ270:g.U.create(0,-1,0,1,0,0,0,0,1),rotX180:g.U.create(1,0,0,0,-1,0,0,0,-1),rotY180:g.U.create(-1,0,0,0,1,0,0,0,-1),rotZ180:g.U.create(-1,0,0,0,-1,0,0,0,1)};function so(oe,x){const{onlyTrace:F,skipHydrogens:z,skipWater:me}=x,{x:Pe,y:Ge,z:Xe,type_symbol:Qe,label_comp_id:lt}=Je.StructureProperties.atom,ft=[];for(const wt of oe){const Ut=Je.iZ.Location.create(wt);for(const Jt of wt.units){Ut.unit=Jt;const gn=F?Jt.polymerElements:Jt.elements;for(let Pn=0;Pnme,F)}focusLoci(x,F){let z;if(Array.isArray(x)&&x.length>1){const me=[];for(const Pe of x){const Ge=Rn.QN.getBoundingSphere(this.transformedLoci(Pe));Ge&&me.push(Ge)}if(0===me.length)return;this.boundaryHelper.reset();for(const Pe of me)this.boundaryHelper.includeSphere(Pe);this.boundaryHelper.finishedIncludeStep();for(const Pe of me)this.boundaryHelper.radiusSphere(Pe);z=this.boundaryHelper.getSphere()}else if(Array.isArray(x)){if(0===x.length)return;z=Rn.QN.getBoundingSphere(this.transformedLoci(x[0]))}else z=Rn.QN.getBoundingSphere(this.transformedLoci(x));z&&this.focusSphere(z,F)}focusSpheres(x,F,z){const me=[];for(const Pe of x){const Ge=F(Pe);Ge&&me.push(Ge)}if(0!==me.length){if(1===me.length)return this.focusSphere(me[0],z);this.boundaryHelper.reset();for(const Pe of me)this.boundaryHelper.includeSphere(Pe);this.boundaryHelper.finishedIncludeStep();for(const Pe of me)this.boundaryHelper.radiusSphere(Pe);this.focusSphere(this.boundaryHelper.getSphere(),z)}}focusSphere(x,F){var z;const{canvas3d:me}=this.plugin;if(!me)return;const{extraRadius:Pe,minRadius:Ge,durationMs:Xe}={...Sn,...F},Qe=Math.max(x.radius+Pe,Ge);if(F?.principalAxes){const lt=function Mr(oe,x,F){if(!oe.canvas3d)return;const{origin:z,dirA:me,dirB:Pe,dirC:Ge}=F.principalAxes.boxAxes,Xe=M.e.clone(me),Qe=M.e.clone(Ge);if(F.positionToFlip){const{aroundX:ft,aroundY:wt}=function vr(oe,x,F,z){const me=br(oe,x,z);return{aroundX:br(oe,x,F)<0,aroundY:me<0}}(F.positionToFlip,z,Xe,Pe);ft&&(M.e.negate(Qe,Qe),M.e.negate(Xe,Xe)),wt&&M.e.negate(Qe,Qe)}const lt=M.e.scale((0,M.e)(),z,-100);return M.e.dot(lt,Xe)<=0&&M.e.negate(Qe,Qe),M.e.dot(M.e.unitY,Qe)<=0&&M.e.negate(Xe,Xe),oe.canvas3d.camera.getFocus(z,x,Xe,Qe,ir.i.createDefaultSnapshot())}(this.plugin,Qe,F);null===(z=this.plugin.canvas3d)||void 0===z||z.requestCameraReset({durationMs:Xe,snapshot:lt})}else{const lt=me.camera.getFocus(x.center,Qe);me.requestCameraReset({durationMs:Xe,snapshot:lt})}}orientAxes(x,F){if(!this.plugin.canvas3d)return;x||(x=this.plugin.state.data.selectQ(Xe=>Xe.ofType(A.O.Molecule.Structure)).filter(Xe=>Xe.obj&&!Xe.transform.transformer.definition.isDecorator&&!Xe.obj.data.parent).map(Xe=>{var Qe;return null===(Qe=Xe.obj)||void 0===Qe?void 0:Qe.data}).filter(Xe=>!!Xe));const{rotation:z}=function Ro(oe,x){const F=function po(oe,x){let F;return F=so(oe,{onlyTrace:!0}),F.length>=3*x||(F=so(oe,{skipHydrogens:!0,skipWater:!0}),F.length>=3*x)||(F=so(oe,{})),F}(oe,3);return function ro(oe,x){if(0===oe.length)return console.warn("Skipping PCA, no atoms"),{rotation:Ur.identity,origin:g.eB.zero()};const F=er.c.calculateMomentsAxes(oe),z=er.c.calculateNormalizedAxes(F),me=function Wo(oe,x,F){const z=(0,g.U)();return g.U.setValue(z,0,0,oe[0]),g.U.setValue(z,0,1,oe[1]),g.U.setValue(z,0,2,oe[2]),g.U.setValue(z,1,0,x[0]),g.U.setValue(z,1,1,x[1]),g.U.setValue(z,1,2,x[2]),g.U.setValue(z,2,0,F[0]),g.U.setValue(z,2,1,F[1]),g.U.setValue(z,2,2,F[2]),z}(z.dirA,z.dirB,z.dirC);!function We(oe){g.U.determinant(oe)<0&&(g.U.setValue(oe,2,0,-g.U.getValue(oe,2,0)),g.U.setValue(oe,2,1,-g.U.getValue(oe,2,1)),g.U.setValue(oe,2,2,-g.U.getValue(oe,2,2)))}(me);const Pe=x?function ho(oe,x){let F=Ur.identity,z=0;const me=(0,g.U)();for(const Pe of[Ur.identity,Ur.rotX180,Ur.rotY180,Ur.rotZ180]){const Ge=g.U.innerProduct(g.U.mul(me,Pe,oe),x);Ge>z&&(F=Pe,z=Ge)}return F}(me,x):function Bo(oe,x,F){const z=g.eB.create(g.U.getValue(x,0,0),g.U.getValue(x,0,1),g.U.getValue(x,0,2)),me=g.eB.create(g.U.getValue(x,1,0),g.U.getValue(x,1,1),g.U.getValue(x,1,2)),Pe=g.eB.create(g.U.getValue(x,2,0),g.U.getValue(x,2,1),g.U.getValue(x,2,2)),Ge=Math.floor(oe.length/3),Xe=(0,g.eB)();let Qe=0,lt=0,ft=0;for(let Jt=0;Jt(z.priority||0)-(F.priority||0)),this.isDirty=!0,this.showLabels()}removeProvider(x){this.providers=this.providers.filter(F=>F!==x),this.isDirty=!0,this.showLabels()}mark(x,F){const z=this.locis.findIndex(me=>dr.YL.Loci.areEqual(x,me));-1===z&&F===xr.xi.Highlight?(this.locis.push(x),this.isDirty=!0):-1!==z&&F===xr.xi.RemoveHighlight&&((0,nt.P6)(this.locis,z),this.isDirty=!0)}showLabels(){this.ctx.behaviors.labels.highlight.next({labels:this.getLabels()})}getLabels(){if(this.isDirty){this.groupedLabels.clear(),this.labels.length=0;for(const x of this.providers)for(const F of this.locis){if(Rn.QN.isEmpty(F.loci))continue;const z=x.label(F.loci,F.repr);if(z){const me=x.group?x.group(z):z.toString(),Pe=this.groupedLabels.get(me);Pe?Pe.push(z):this.groupedLabels.set(me,[z])}}this.labels.length=0,this.groupedLabels.forEach((x,F)=>{const z=x.length,me=z>1&&x[0]!==x[1]?F:x[0];this.labels.push(1===z?me:`${me} || \xd7 ${z}`)}),this.isDirty=!1}return this.labels}constructor(x){this.ctx=x,this.providers=[],this.locis=[],this.isDirty=!1,this.labels=[],this.groupedLabels=new Map,x.managers.interactivity.lociHighlights.addProvider((F,z,me)=>{0!==this.providers.length&&(this.mark(F,z),me||this.showLabels())})}}var Qt=n(856),ht=n(9039),pt=n(3917);class fn extends Yt.e{get current(){return this.state.current}get history(){return this.state.history}tryAddHistory(x){if(Je.iZ.Loci.isEmpty(x.loci))return;let z,F=0;for(const me of this.state.history){if(Je.iZ.Loci.areEqual(me.loci,x.loci)){z=me;break}F++}if(z)return(0,nt.P6)(this.state.history,F),this.state.history.unshift(x),void this.events.historyUpdated.next(void 0);this.state.history.unshift(x),this.state.history.length>8&&this.state.history.pop(),this.events.historyUpdated.next(void 0)}set(x){this.tryAddHistory(x),(!this.state.current||!Je.iZ.Loci.areEqual(this.state.current.loci,x.loci))&&(this.state.current=x,this.behaviors.current.next(x))}setFromLoci(x){const F=Rn.QN.normalize(x);Je.iZ.Loci.is(F)&&!Je.iZ.Loci.isEmpty(F)?this.set({loci:F,label:(0,pt.YQ)(F,{reverse:!0,hidePrefix:!0,htmlStyling:!1})}):this.clear()}addFromLoci(x){const F=this.state.current&&Je.iZ.Loci.is(x)&&x.structure===this.state.current.loci.structure?Je.iZ.Loci.union(x,this.state.current.loci):x;this.setFromLoci(F)}clear(){this.state.current&&(this.state.current=void 0,this.behaviors.current.next(void 0))}getSnapshot(){if(!this.current)return{};const x=this.plugin.helpers.substructureParent.get(this.current.loci.structure),F=x?.transform.ref;return F?{current:{label:this.current.label,ref:F,bundle:Je.iZ.Bundle.fromLoci(this.current.loci),category:this.current.category}}:{}}setSnapshot(x){var F,z;if(!x.current)return void this.clear();const{label:me,ref:Pe,bundle:Ge,category:Xe}=x.current,Qe=null===(z=null===(F=this.plugin.state.data.select(c.QX.Generators.byRef(Pe))[0])||void 0===F?void 0:F.obj)||void 0===z?void 0:z.data;if(!Qe)return;const lt=Je.iZ.Bundle.toLoci(Ge,Qe);this.set({label:me,loci:lt,category:Xe})}constructor(x){super({history:[]}),this.plugin=x,this.events={historyUpdated:this.ev()},this.behaviors={current:this.ev.behavior(void 0)},x.state.data.events.object.removed.subscribe(({obj:z})=>{var me;if(!A.O.Molecule.Structure.is(z))return;(null===(me=this.current)||void 0===me?void 0:me.loci.structure)===z.data&&this.clear();const Pe=[];for(const Ge of this.history)Ge.loci.structure===z.data&&Pe.push(Ge);Pe.length!==this.history.length&&(this.history.length=0,this.history.push(...Pe),this.events.historyUpdated.next(void 0))});const F=(0,Bt.f8)();x.state.data.events.object.updated.subscribe(({oldData:z,obj:me,action:Pe})=>{var Ge;if(A.O.Molecule.Structure.is(me)&&z!==me.data&&"in-place"===Pe){const Xe=this.state.current;if(Xe&&Xe.loci.structure===z){const lt=Je.iZ.Loci.remap(Xe.loci,me.data);this.state.current={...Xe,loci:lt},this.behaviors.current.next(this.state.current),Rn.QN.getBoundingSphere(lt,F);const ft=null===(Ge=this.plugin.canvas3d)||void 0===Ge?void 0:Ge.camera,wt=ft.getTargetDistance(F.radius+4);(g.eB.distance(ft.target,F.center)>F.radius||wt>ft.viewport.height/ft.zoom)&&this.plugin.managers.camera.focusSphere(F,{durationMs:0})}}})}}var on=n(2277),En=n(5995),Tt=n(3543);const Fe=new xn.Z("98");class Ye extends Yt.e{get entries(){return this.state.entries}get additionsHistory(){return this.state.additionsHistory}get stats(){return this.state.stats||(this.state.stats=this.calcStats()),this.state.stats}getEntry(x){const F=this.plugin.helpers.substructureParent.get(x,!0);if(!F)return;const z=F.transform.ref;if(!this.entries.has(z)){const me=new rt(Je.iZ.Loci(x,[]));return this.entries.set(z,me),me}return this.entries.get(z)}calcStats(){let x=0,F=0;const z=Je.iZ.Stats.create();this.entries.forEach(Pe=>{const{elements:Ge}=Pe.selection;if(Ge.length){x+=1;for(let Xe=0,Qe=Ge.length;Xe24&&this.additionsHistory.pop(),this.events.additionsHistoryUpdated.next(void 0)}clearHistory(){0!==this.state.additionsHistory.length&&(this.state.additionsHistory=[],this.events.additionsHistoryUpdated.next(void 0))}clearHistoryForStructure(x){const F=[];for(const z of this.state.additionsHistory)z.loci.structure.root===x.root&&F.push(z);for(const z of F)this.modifyHistory(z,"remove");0!==F.length&&this.events.additionsHistoryUpdated.next(void 0)}onRemove(x,F){var z;this.entries.has(x)&&(this.entries.delete(x),F?.data&&this.clearHistoryForStructure(F.data),(null===(z=this.referenceLoci)||void 0===z?void 0:z.structure)===F?.data&&(this.referenceLoci=void 0),this.state.stats=void 0,this.events.changed.next(void 0))}onUpdate(x,F,z){var me,Pe,Ge,Xe;if(F===z||F?.data===z.data)return;const Qe=this.plugin.helpers.substructureParent.get(z.data,!0);if(!Qe||x!==Qe.transform.ref||!this.entries.has(x))return;const lt=null===(Pe=null===(me=this.plugin.helpers.substructureParent.get(z.data))||void 0===me?void 0:me.obj)||void 0===Pe?void 0:Pe.data;if(lt)if(!F?.data||Je.oE.areUnitIdsAndIndicesEqual(F.data,z.data)){this.entries.set(x,function St(oe,x){return new rt(Je.iZ.Loci.remap(oe.selection,x))}(this.entries.get(x),lt)),(null===(Ge=this.referenceLoci)||void 0===Ge?void 0:Ge.structure.root)===lt.root&&(this.referenceLoci=Je.iZ.Loci.remap(this.referenceLoci,lt));let ft=!1;for(const wt of this.state.additionsHistory)wt.loci.structure.root===lt.root&&(wt.loci=Je.iZ.Loci.remap(wt.loci,lt),ft=!0);ft&&this.events.additionsHistoryUpdated.next(void 0)}else this.entries.set(x,new rt(Je.iZ.Loci(lt,[]))),(null===(Xe=this.referenceLoci)||void 0===Xe?void 0:Xe.structure.root)===lt.root&&(this.referenceLoci=void 0),this.clearHistoryForStructure(lt),this.state.stats=void 0,this.events.changed.next(void 0)}clear(){const x=this.entries.keys(),F=[];for(;;){const z=x.next();if(z.done)break;const me=this.entries.get(z.value);Je.iZ.Loci.isEmpty(me.selection)||F.push(me.selection),me.selection=Je.iZ.Loci(me.selection.structure,[])}return this.referenceLoci=void 0,this.state.stats=void 0,this.events.changed.next(void 0),this.events.loci.clear.next(void 0),this.clearHistory(),F}getLoci(x){const F=this.getEntry(x);return F?F.selection:Rn.BL}getStructure(x){const F=this.getEntry(x);if(F)return F.structure}structureHasSelection(x){var F,z;const me=null===(z=null===(F=x.cell)||void 0===F?void 0:F.obj)||void 0===z?void 0:z.data;if(!me)return!1;const Pe=this.getEntry(me);return!!Pe&&!Je.iZ.Loci.isEmpty(Pe.selection)}has(x){if(Je.iZ.Loci.is(x)){const F=this.getEntry(x.structure);if(F)return Je.iZ.Loci.isSubset(F.selection,x)}return!1}tryGetRange(x){if(!Je.iZ.Loci.is(x)||1!==x.elements.length||!this.getEntry(x.structure))return;const z=x.elements[0];if(!z)return;const me=this.referenceLoci;if(!me||!Je.iZ.Loci.is(me)||me.structure!==x.structure)return;let Pe;for(const Ge of me.elements)if(z.unit===Ge.unit){Pe=Ge;break}return Pe&&z.unit===Pe.unit?function vt(oe,x,F){const z=Math.min(Tt.CD.min(x.indices),Tt.CD.min(F.indices)),me=Math.max(Tt.CD.max(x.indices),Tt.CD.max(F.indices));return Je.iZ.Loci(oe,[{unit:x.unit,indices:Tt.CD.ofRange(z,me)}])}(x.structure,Pe,z):void 0}elementCount(){let x=0;return this.entries.forEach(F=>{x+=Je.iZ.Loci.size(F.selection)}),x}getBoundary(){const x=g.eB.create(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),F=g.eB.create(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);Fe.reset();const z=[];this.entries.forEach(me=>{const Pe=me.selection;Je.iZ.Loci.isEmpty(Pe)||z.push(Je.iZ.Loci.getBoundary(Pe))});for(let me=0,Pe=z.length;meF.selection))}modify(x,F){let z=!1;switch(x){case"add":z=this.add(F);break;case"remove":z=this.remove(F);break;case"intersect":z=this.intersect(F);break;case"set":z=this.set(F)}z&&(this.state.stats=void 0,this.events.changed.next(void 0))}get applicableStructures(){return this.plugin.managers.structure.hierarchy.selection.structures.filter(x=>!!x.cell.obj).map(x=>x.cell.obj.data)}triggerInteraction(x,F,z=!0){switch(x){case"add":this.plugin.managers.interactivity.lociSelects.select({loci:F},z);break;case"remove":this.plugin.managers.interactivity.lociSelects.deselect({loci:F},z);break;case"intersect":this.plugin.managers.interactivity.lociSelects.selectJoin({loci:F},z);break;case"set":this.plugin.managers.interactivity.lociSelects.selectOnly({loci:F},z)}}fromLoci(x,F,z=!0){this.triggerInteraction(x,F,z)}fromCompiledQuery(x,F,z=!0){for(const me of this.applicableStructures){const Pe=F(new Je.cY(me));this.triggerInteraction(x,Je.cv.toLociWithSourceUnits(Pe),z)}}fromSelectionQuery(x,F,z=!0){var me=this;this.plugin.runTask(R.YZ.create("Structure Selection",function(){var Pe=(0,r.A)(function*(Ge){for(const Xe of me.applicableStructures){const Qe=yield F.getSelection(me.plugin,Ge,Xe);me.triggerInteraction(x,Je.cv.toLociWithSourceUnits(Qe),z)}});return function(Ge){return Pe.apply(this,arguments)}}()))}fromSelections(x){var F;const z=c.so.resolveAndCheck(this.plugin.state.data,x);if(z&&z.obj){if(!A.O.Molecule.Structure.Selections.is(z.obj))return void console.warn("fromSelections applied to wrong object type.",z.obj);this.clear();for(const me of null===(F=z.obj)||void 0===F?void 0:F.data)this.fromLoci("set",me.loci)}}getSnapshot(){const x=[];return this.entries.forEach((F,z)=>{x.push({ref:z,bundle:Je.iZ.Bundle.fromLoci(F.selection)})}),{entries:x}}setSnapshot(x){var F,z;this.entries.clear();for(const{ref:me,bundle:Pe}of x.entries){const Ge=null===(z=null===(F=this.plugin.state.data.select(c.QX.Generators.byRef(me))[0])||void 0===F?void 0:F.obj)||void 0===z?void 0:z.data;if(!Ge)continue;const Xe=Je.iZ.Bundle.toLoci(Pe,Ge);this.fromLoci("set",Xe,!1)}}constructor(x){super({entries:new Map,additionsHistory:[],stats:{structureCount:0,elementCount:0,label:"Nothing Selected"}}),this.plugin=x,this.events={changed:this.ev(),additionsHistoryUpdated:this.ev(),loci:{add:this.ev(),remove:this.ev(),clear:this.ev()}},x.helpers.substructureParent.events.removed.subscribe(F=>this.onRemove(F.ref,F.obj)),x.helpers.substructureParent.events.updated.subscribe(F=>this.onUpdate(F.ref,F.oldObj,F.obj))}}class rt{get selection(){return this._selection}set selection(x){this._selection=x,this._structure=void 0}get structure(){return this._structure||(this._structure=Rn.QN.isEmpty(this._selection)?void 0:Je.iZ.Loci.toStructure(this._selection)),this._structure}constructor(x){this._structure=void 0,this._selection=x}}var mn=n(9012);const an=[["full","Full"],["hidden","Hidden"]],Vn={isExpanded:v.t.Boolean(!1),showControls:v.t.Boolean(!0),regionState:v.t.Group({left:v.t.Select("full",[["full","Full"],["collapsed","Collapsed"],["hidden","Hidden"]]),top:v.t.Select("full",an),right:v.t.Select("full",an),bottom:v.t.Select("full",an)}),controlsDisplay:v.t.Value("outside",{isHidden:!0})};class Fn extends Yt.e{updateProps(x){const F=!!this.state.isExpanded;this.updateState(x),this.root&&"boolean"==typeof x.isExpanded&&x.isExpanded!==F&&this.handleExpand(),this.events.updated.next(void 0)}setProps(x){this.updateState(x)}setRoot(x){this.root=x,this.state.isExpanded&&this.handleExpand()}getScrollElement(){return document.scrollingElement?document.scrollingElement:document.documentElement?document.documentElement:document.body}handleExpand(){try{const x=document.getElementsByTagName("body")[0],F=document.getElementsByTagName("head")[0];if(!x||!F||!this.root)return;if(this.state.isExpanded){const z=F.children,me=[];let Pe=!1;for(let ft=0;ftthis.updateProps(F.state)),typeof document<"u"&&(this.expandedViewport=document.createElement("meta"),this.expandedViewport.name="viewport",this.expandedViewport.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0")}}var rr=n(9283),Vr=n(377),tr=n(2741),Tr=n(2434),oo=n(1888),Gr=n(2556);const Ao={includeTypes:v.t.MultiSelect((0,E.mX)(Tr.I$.Names),v.t.objectToOptions(Tr.I$.Names)),excludeTypes:v.t.MultiSelect([],v.t.objectToOptions(Tr.I$.Names)),ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),aromaticBonds:v.t.Boolean(!0,{description:"Display aromatic bonds with dashes"}),multipleBonds:v.t.Select("symmetric",v.t.arrayToOptions(["off","symmetric","offset"]))},vo=(v.t.getDefaultValues(Ao),{...Vr.Lr,...Ao,adjustCylinderLength:v.t.Boolean(!1,{description:"Shorten cylinders to reduce overlap with spheres. Useful for for transparent bonds. Not working well with aromatic bonds."})}),Do=(v.t.getDefaultValues(vo),{...Vr.T9,...Ao});function So(oe,x,F){return!Tr.I$.is(oe,F)||Tr.I$.is(x,F)}function ao(oe,x,F){const z=x.elements,me=x.bonds,{a:Pe,b:Ge,edgeProps:Xe}=me,{flags:Qe}=Xe,{ignoreHydrogens:lt,ignoreHydrogensVariant:ft,includeTypes:wt,excludeTypes:Ut}=F,Jt=Tr.I$.fromNames(wt),gn=Tr.I$.fromNames(Ut),Pn=Tr.I$.isAll(Jt)&&0===gn,{child:wn}=oe,Bn=wn?.unitMap.get(x.id);if(wn&&!Bn)throw new Error("expected childUnit to exist if child exists");if(!Pn||lt||wn)return Mn=>{const Ln=Pe[Mn],cr=Ge[Mn];return!!(Bn&&!Tt.SortedArray.has(Bn.elements,z[Ln])||!Pn&&So(Jt,gn,Qe[Mn]))||!!lt&&!(!(0,Gr.v3)(oe,x,z[Ln],ft)&&!(0,Gr.v3)(oe,x,z[cr],ft))}}function Po(oe,x){const F=oe.interUnitBonds,{edges:z}=F,{ignoreHydrogens:me,ignoreHydrogensVariant:Pe,includeTypes:Ge,excludeTypes:Xe}=x,Qe=Tr.I$.fromNames(Ge),lt=Tr.I$.fromNames(Xe),ft=Tr.I$.isAll(Qe)&&0===lt,{child:wt}=oe;if(!ft||me||wt)return Ut=>{if(wt){const Jt=z[Ut],gn=wt.unitMap.get(Jt.unitA);if(!gn)return!0;const wn=oe.unitMap.get(Jt.unitA).elements[Jt.indexA];if(!Tt.SortedArray.has(gn.elements,wn))return!0}if(me){const Jt=z[Ut],gn=oe.unitMap.get(Jt.unitA),Pn=oe.unitMap.get(Jt.unitB);if((0,Gr.v3)(oe,gn,gn.elements[Jt.indexA],Pe)||(0,Gr.v3)(oe,Pn,Pn.elements[Jt.indexB],Pe))return!0}return!(ft||!So(Qe,lt,z[Ut].props.flag))}}var Yr;function jr(oe,x,F){const{objectId:z,instanceId:me,groupId:Pe}=oe;if(F===z){const{structure:Ge,group:Xe}=x,Qe=Xe.units[me];if(Je.Nf.isAtomic(Qe)){const{target:lt}=Ge,ft=Qe.bonds.a[Pe],wt=Qe.bonds.b[Pe];return Je.gn.Loci(lt,[Je.gn.Location(lt,Qe,ft,lt,Qe,wt),Je.gn.Location(lt,Qe,wt,lt,Qe,ft)])}}return Rn.BL}function Co(oe,x,F,z){let me=!1;if(Je.gn.isLoci(oe)){const{structure:Pe,group:Ge}=x;if(!Je.oE.areEquivalent(oe.structure,Pe))return!1;const Xe=Ge.units[0];if(!Je.Nf.isAtomic(Xe))return!1;const Qe=2*Xe.bonds.edgeCount;for(const lt of oe.bonds){if(lt.aUnit!==lt.bUnit)continue;const ft=Ge.unitIndexMap.get(lt.aUnit.id);if(void 0!==ft){const wt=Xe.bonds.getDirectedEdgeIndex(lt.aIndex,lt.bIndex);-1!==wt&&F(Tt.IX.ofSingleton(ft*Qe+wt))&&(me=!0)}}}else if(Je.iZ.Loci.is(oe)){const{structure:Pe,group:Ge}=x;if(!Je.oE.areEquivalent(oe.structure,Pe))return!1;const Xe=Ge.units[0];if(!Je.Nf.isAtomic(Xe))return!1;const Qe=2*Xe.bonds.edgeCount;for(const lt of oe.elements){const ft=Ge.unitIndexMap.get(lt.unit.id);if(void 0!==ft){const{offset:wt,b:Ut}=Xe.bonds;Tt.CD.forEach(lt.indices,Jt=>{for(let gn=wt[Jt],Pn=wt[Jt+1];gn{const gn=Pe.units[Jt];return ft.aUnit=gn,ft.bUnit=gn,ft.aIndex=gn.bonds.a[Ut],ft.bIndex=gn.bonds.b[Ut],ft};if(me?.includeLocation2){const Ut=Je.gn.Location(Ge,void 0,void 0,Ge,void 0,void 0);return(0,oo.iQ)(Qe,lt,1,wt,!1,()=>!1,(gn,Pn)=>{const wn=Pe.units[Pn];return Ut.aUnit=wn,Ut.bUnit=wn,Ut.aIndex=wn.bonds.b[gn],Ut.bIndex=wn.bonds.a[gn],Ut})}return(0,oo.iQ)(Qe,lt,1,wt)},oe.fromStructure=function F(z,me){const Pe=z.interUnitBonds.edgeCount,Xe=Je.gn.Location(z,void 0,void 0,z,void 0,void 0),Qe=lt=>{const ft=z.interUnitBonds.edges[lt];return Xe.aUnit=z.unitMap.get(ft.unitA),Xe.aIndex=ft.indexA,Xe.bUnit=z.unitMap.get(ft.unitB),Xe.bIndex=ft.indexB,Xe};if(me?.includeLocation2){const lt=Je.gn.Location(z,void 0,void 0,z,void 0,void 0);return(0,oo.iQ)(Pe,1,1,Qe,!0,()=>!1,wt=>{const Ut=z.interUnitBonds.edges[wt];return lt.aUnit=z.unitMap.get(Ut.unitB),lt.aIndex=Ut.indexB,lt.bUnit=z.unitMap.get(Ut.unitA),lt.bIndex=Ut.indexA,lt})}return(0,oo.iQ)(Pe,1,1,Qe,!0)}}(Yr||(Yr={}));const Fo=new Map;function ei(oe,x,F,z){let me=!1;if(Je.gn.isLoci(oe)){if(!Je.oE.areEquivalent(oe.structure,x))return!1;for(const Pe of oe.bonds){const Ge=x.interUnitBonds.getBondIndexFromLocation(Pe);-1!==Ge&&F(Tt.IX.ofSingleton(Ge))&&(me=!0)}}else if(Je.iZ.Loci.is(oe)){if(!Je.oE.areEquivalent(oe.structure,x)||z&&1===oe.elements.length)return!1;for(const Pe of oe.elements)Fo.set(Pe.unit.id,Pe.indices);for(const Pe of oe.elements){const{unit:Ge}=Pe;Je.Nf.isAtomic(Ge)&&x.interUnitBonds.getConnectedUnits(Ge.id).forEach(Xe=>{const Qe=Fo.get(Xe.unitB);(!z||Qe)&&Tt.CD.forEach(Pe.indices,lt=>{Xe.connectedIndices.includes(lt)&&Xe.getEdges(lt).forEach(ft=>{if(!z||Qe&&Tt.CD.has(Qe,ft.indexB)){const wt=x.interUnitBonds.getEdgeIndex(lt,Ge.id,ft.indexB,Xe.unitB);F(Tt.IX.ofSingleton(wt))&&(me=!0)}})})})}Fo.clear()}return me}var Yo=n(4506),ci=n(283);const Jo=Tr.I$.is;function Fi(oe,x,F,z){const me=oe.elements,Pe=oe.bonds,{edgeCount:Ge,a:Xe,b:Qe,edgeProps:lt,offset:ft}=Pe,{order:wt,flags:Ut}=lt,{sizeFactor:Jt,sizeAspectRatio:gn,adjustCylinderLength:Pn,aromaticBonds:wn,includeTypes:Bn,excludeTypes:Mn,multipleBonds:Ln}=z,cr="off"===Ln,qn="symmetric"===Ln,zn=So(Tr.I$.fromNames(Bn),Tr.I$.fromNames(Mn),32),Lr=(0,g.eB)(),wr=(0,g.eB)(),to=oe.conformation;let Cr;const Zr=Je.iZ.Location.create(x,oe),Io=Je.gn.Location(x,oe,void 0,x,oe,void 0),{child:wo}=x;if(z.includeParent&&wo){const go=wo.unitMap.get(oe.id);if(!go)throw new Error("expected childUnit to exist");Cr=Qo=>{const $o=me[Qe[Qo]];return Tt.SortedArray.has(go.elements,me[Xe[Qo]])&&!Tt.SortedArray.has(go.elements,$o)}}const{elementRingIndices:li,elementAromaticRingIndices:Vo}=oe.rings,jo=wn?oe.resonance.delocalizedTriplets:void 0;return{linkCount:2*Ge,referencePosition:go=>{let Qo=Xe[go],Ko=Qe[go];const $o=jo?.getThirdElement(Qo,Ko);if(void 0!==$o)return to.invariantPosition(me[$o],Lr);Qo>Ko&&([Qo,Ko]=[Ko,Qo]),ft[Qo+1]-ft[Qo]==1&&([Qo,Ko]=[Ko,Qo]);const fi=Vo.get(Qo)||li.get(Qo);let Zo=0;for(let ii=ft[Qo],Ai=ft[Qo+1];iiZo&&(Zo=As,to.invariantPosition(me[Xi],Lr))}}}return Zo>0?Lr:null},position:(go,Qo,Ko)=>{if(to.invariantPosition(me[Xe[Ko]],go),to.invariantPosition(me[Qe[Ko]],Qo),Pn){const $o=(go=>(Zr.element=me[Xe[go]],F.size.size(Zr)*Jt))(Ko),fi=(go=>(Zr.element=me[Qe[go]],F.size.size(Zr)*Jt))(Ko),Zo=Math.min($o,fi)*gn,ii=Math.sqrt(Math.max(0,$o*$o-Zo*Zo))-.05,Ai=Math.sqrt(Math.max(0,fi*fi-Zo*Zo))-.05;if(ii<=.01&&Ai<=.01)return;g.eB.normalize(wr,g.eB.sub(wr,Qo,go)),g.eB.scaleAndAdd(go,go,wr,ii),g.eB.scaleAndAdd(Qo,Qo,wr,-Ai)}},style:go=>{const Qo=wt[go],Ko=Ut[go];if(Jo(Ko,2)||Jo(Ko,4))return 1;if(3===Qo)return cr?0:qn?4:5;if(wn){const fi=Qe[go],Zo=Vo.get(Xe[go]),ii=Vo.get(fi),Ai=Zo&&ii?(0,nt.u$)(Zo,ii):0;if(Jo(Ko,16)||Ai&&!zn)return 2===Ai?8:7}return 2!==Qo||cr?0:qn?2:3},radius:go=>(go=>(Io.aIndex=Xe[go],Io.bIndex=Qe[go],F.size.size(Io)*Jt))(go)*gn,ignore:ao(x,oe,z),stub:Cr}}function hi(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x)||!x.bonds.edgeCount)return ci.S.createEmpty(Pe);const{child:Ge}=F,Xe=Ge?.unitMap.get(x.id);if(Ge&&!Xe)return ci.S.createEmpty(Pe);const Qe=Fi(x,F,z,me),{cylinders:lt,boundingSphere:ft}=(0,Vr.rm)(oe,Qe,me,Pe);if(ft)lt.setBoundingSphere(ft);else if(lt.cylinderCount>0){const wt=Bt.f8.expand((0,Bt.f8)(),(Xe??x).boundary.sphere,1*me.sizeFactor);lt.setBoundingSphere(wt)}return lt}function No(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x)||!x.bonds.edgeCount)return rr.e.createEmpty(Pe);const{child:Ge}=F,Xe=Ge?.unitMap.get(x.id);if(Ge&&!Xe)return rr.e.createEmpty(Pe);const Qe=Fi(x,F,z,me),{mesh:lt,boundingSphere:ft}=(0,Vr.C1)(oe,Qe,me,Pe);if(ft)lt.setBoundingSphere(ft);else if(lt.triangleCount>0){const wt=Bt.f8.expand((0,Bt.f8)(),(Xe??x).boundary.sphere,1*me.sizeFactor);lt.setBoundingSphere(wt)}return lt}const Ci={...tr.Te,...tr.lm,...vo,sizeFactor:v.t.Numeric(.3,{min:0,max:10,step:.01}),sizeAspectRatio:v.t.Numeric(2/3,{min:0,max:3,step:.01}),tryUseImpostor:v.t.Boolean(!0),includeParent:v.t.Boolean(!1)};function mi(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth?function qi(oe){return(0,tr.Vb)({defaultProps:v.t.getDefaultValues(Ci),createGeometry:hi,createLocationIterator:(x,F)=>Yr.fromGroup(x,{includeLocation2:"interpolate"===F.colorMode}),getLoci:jr,eachLocation:Co,setUpdateState:(x,F,z,me,Pe,Ge,Xe)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.sizeAspectRatio!==z.sizeAspectRatio||F.linkScale!==z.linkScale||F.linkSpacing!==z.linkSpacing||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.linkCap!==z.linkCap||F.aromaticScale!==z.aromaticScale||F.aromaticSpacing!==z.aromaticSpacing||F.aromaticDashCount!==z.aromaticDashCount||F.dashCount!==z.dashCount||F.dashScale!==z.dashScale||F.dashCap!==z.dashCap||F.stubCap!==z.stubCap||!(0,G.af)(F.includeTypes,z.includeTypes)||!(0,G.af)(F.excludeTypes,z.excludeTypes)||F.adjustCylinderLength!==z.adjustCylinderLength||F.aromaticBonds!==z.aromaticBonds||F.multipleBonds!==z.multipleBonds,F.colorMode!==z.colorMode&&(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0);const Qe=Ge.group.units[0],lt=Xe.group.units[0];Je.Nf.isAtomic(Qe)&&Je.Nf.isAtomic(lt)&&(Yo.O.areEqual(Qe.bonds,lt.bonds)||(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0,x.updateSize=!0))},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function Oi(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(Ci),createGeometry:No,createLocationIterator:x=>Yr.fromGroup(x),getLoci:jr,eachLocation:Co,setUpdateState:(x,F,z,me,Pe,Ge,Xe)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.sizeAspectRatio!==z.sizeAspectRatio||F.radialSegments!==z.radialSegments||F.linkScale!==z.linkScale||F.linkSpacing!==z.linkSpacing||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.linkCap!==z.linkCap||F.aromaticScale!==z.aromaticScale||F.aromaticSpacing!==z.aromaticSpacing||F.aromaticDashCount!==z.aromaticDashCount||F.dashCount!==z.dashCount||F.dashScale!==z.dashScale||F.dashCap!==z.dashCap||F.stubCap!==z.stubCap||!(0,G.af)(F.includeTypes,z.includeTypes)||!(0,G.af)(F.excludeTypes,z.excludeTypes)||F.adjustCylinderLength!==z.adjustCylinderLength||F.aromaticBonds!==z.aromaticBonds||F.multipleBonds!==z.multipleBonds;const Qe=Ge.group.units[0],lt=Xe.group.units[0];Je.Nf.isAtomic(Qe)&&Je.Nf.isAtomic(lt)&&(Yo.O.areEqual(Qe.bonds,lt.bonds)||(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0,x.updateSize=!0))},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}var ti=n(3892),es=n(1839);const Si=new Je.gn.ElementBondIterator;function Pi(oe,x,F,z){for(Si.setElement(x,F,z);Si.hasNext;){const me=Si.move();return me.otherUnit.conformation.position(me.otherUnit.elements[me.otherIndex],oe),oe}return null}const ni=(0,g.eB)();function gi(oe,x,F){const z=Je.iZ.Location.create(oe),me=Je.gn.Location(oe,void 0,void 0,oe,void 0,void 0),Pe=oe.interUnitBonds,{edgeCount:Ge,edges:Xe}=Pe,{sizeFactor:Qe,sizeAspectRatio:lt,adjustCylinderLength:ft,aromaticBonds:wt,multipleBonds:Ut}=F,Jt="off"===Ut,gn="symmetric"===Ut,Pn=(0,g.eB)();let wn;const{child:Bn}=oe;return F.includeParent&&Bn&&(wn=qn=>{const Qn=Xe[qn],Zn=Bn.unitMap.get(Qn.unitA),zn=Bn.unitMap.get(Qn.unitB),wr=oe.unitMap.get(Qn.unitA).elements[Qn.indexA],Cr=oe.unitMap.get(Qn.unitB).elements[Qn.indexB];return Zn&&es.X.has(Zn.elements,wr)&&(!zn||!es.X.has(zn.elements,Cr))}),{linkCount:Ge,referencePosition:qn=>{const Qn=Xe[qn];let Zn,zn,Lr,wr;if(Qn.unitAQn.unitB))throw new Error("same units in createInterUnitBondCylinderMesh");Zn=oe.unitMap.get(Qn.unitB),zn=oe.unitMap.get(Qn.unitA),Lr=Qn.indexB,wr=Qn.indexA}return Pi(ni,oe,Zn,Lr)||Pi(ni,oe,zn,wr)},position:(qn,Qn,Zn)=>{const zn=Xe[Zn],Lr=oe.unitMap.get(zn.unitA),wr=oe.unitMap.get(zn.unitB);if(Lr.conformation.position(Lr.elements[zn.indexA],qn),wr.conformation.position(wr.elements[zn.indexB],Qn),ft){const to=(qn=>{const Qn=Xe[qn];return z.unit=oe.unitMap.get(Qn.unitA),z.element=z.unit.elements[Qn.indexA],x.size.size(z)*Qe})(Zn),Cr=(qn=>{const Qn=Xe[qn];return z.unit=oe.unitMap.get(Qn.unitB),z.element=z.unit.elements[Qn.indexB],x.size.size(z)*Qe})(Zn),Zr=Math.min(to,Cr)*lt,Io=Math.sqrt(Math.max(0,to*to-Zr*Zr))-.05,wo=Math.sqrt(Math.max(0,Cr*Cr-Zr*Zr))-.05;if(Io<=.01&&wo<=.01)return;g.eB.normalize(Pn,g.eB.sub(Pn,Qn,qn)),g.eB.scaleAndAdd(qn,qn,Pn,Io),g.eB.scaleAndAdd(Qn,Qn,Pn,-wo)}},style:qn=>{const Qn=Xe[qn].props.order,Zn=G.NJ.create(Xe[qn].props.flag);return Tr.I$.is(Zn,2)||Tr.I$.is(Zn,4)?1:3===Qn?Jt?0:gn?4:5:wt&&Tr.I$.is(Zn,16)?7:2!==Qn||Jt?0:gn?2:3},radius:qn=>(qn=>{const Qn=Xe[qn];return me.aUnit=oe.unitMap.get(Qn.unitA),me.aIndex=Qn.indexA,me.bUnit=oe.unitMap.get(Qn.unitB),me.bIndex=Qn.indexB,x.size.size(me)*Qe})(qn)*lt,ignore:Po(oe,F),stub:wn}}function Wi(oe,x,F,z,me){if(!x.interUnitBonds.edgeCount)return ci.S.createEmpty(me);const Pe=gi(x,F,z),{cylinders:Ge,boundingSphere:Xe}=(0,Vr.rm)(oe,Pe,z,me);if(Xe)Ge.setBoundingSphere(Xe);else if(Ge.cylinderCount>0){const{child:Qe}=x,lt=Bt.f8.expand((0,Bt.f8)(),(Qe??x).boundary.sphere,1*z.sizeFactor);Ge.setBoundingSphere(lt)}return Ge}function Ri(oe,x,F,z,me){if(!x.interUnitBonds.edgeCount)return rr.e.createEmpty(me);const Pe=gi(x,F,z),{mesh:Ge,boundingSphere:Xe}=(0,Vr.C1)(oe,Pe,z,me);if(Xe)Ge.setBoundingSphere(Xe);else if(Ge.triangleCount>0){const{child:Qe}=x,lt=Bt.f8.expand((0,Bt.f8)(),(Qe??x).boundary.sphere,1*z.sizeFactor);Ge.setBoundingSphere(lt)}return Ge}const Qi={...ti.EN,...ti.KE,...vo,sizeFactor:v.t.Numeric(.3,{min:0,max:10,step:.01}),sizeAspectRatio:v.t.Numeric(2/3,{min:0,max:3,step:.01}),tryUseImpostor:v.t.Boolean(!0),includeParent:v.t.Boolean(!1)};function Hn(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth?function qr(oe){return(0,ti.UM)({defaultProps:v.t.getDefaultValues(Qi),createGeometry:Wi,createLocationIterator:(x,F)=>Yr.fromStructure(x,{includeLocation2:"interpolate"===F.colorMode}),getLoci:Eo,eachLocation:ei,setUpdateState:(x,F,z,me,Pe,Ge,Xe)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.sizeAspectRatio!==z.sizeAspectRatio||F.linkScale!==z.linkScale||F.linkSpacing!==z.linkSpacing||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.linkCap!==z.linkCap||F.aromaticScale!==z.aromaticScale||F.aromaticSpacing!==z.aromaticSpacing||F.aromaticDashCount!==z.aromaticDashCount||F.dashCount!==z.dashCount||F.dashScale!==z.dashScale||F.dashCap!==z.dashCap||F.stubCap!==z.stubCap||!(0,G.af)(F.includeTypes,z.includeTypes)||!(0,G.af)(F.excludeTypes,z.excludeTypes)||F.adjustCylinderLength!==z.adjustCylinderLength||F.multipleBonds!==z.multipleBonds,F.colorMode!==z.colorMode&&(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0),Ge.interUnitBonds!==Xe.interUnitBonds&&(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0,x.updateSize=!0)},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function co(oe){return(0,ti.wA)({defaultProps:v.t.getDefaultValues(Qi),createGeometry:Ri,createLocationIterator:x=>Yr.fromStructure(x),getLoci:Eo,eachLocation:ei,setUpdateState:(x,F,z,me,Pe,Ge,Xe)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.sizeAspectRatio!==z.sizeAspectRatio||F.radialSegments!==z.radialSegments||F.linkScale!==z.linkScale||F.linkSpacing!==z.linkSpacing||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.linkCap!==z.linkCap||F.aromaticScale!==z.aromaticScale||F.aromaticSpacing!==z.aromaticSpacing||F.aromaticDashCount!==z.aromaticDashCount||F.dashCount!==z.dashCount||F.dashScale!==z.dashScale||F.dashCap!==z.dashCap||F.stubCap!==z.stubCap||!(0,G.af)(F.includeTypes,z.includeTypes)||!(0,G.af)(F.excludeTypes,z.excludeTypes)||F.adjustCylinderLength!==z.adjustCylinderLength||F.multipleBonds!==z.multipleBonds,Ge.interUnitBonds!==Xe.interUnitBonds&&(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0,x.updateSize=!0)},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}var zr=n(9132),lr=n(573),kr=n(4439),Qr=n(8231);const vi=ce.Gm.add3,Ti=ce.Gm.add;var Bi;!function(oe){oe.create=function x(F=2048,z=1024,me){const Pe=ce.Gm.create(Float32Array,3,z,me?me.centerBuffer.ref.value:F),Ge=ce.Gm.create(Float32Array,1,z,me?me.groupBuffer.ref.value:F);return{add:(Xe,Qe,lt,ft)=>{vi(Pe,Xe,Qe,lt),Ti(Ge,ft)},getSpheres:()=>{const Xe=ce.Gm.compact(Pe,!0),Qe=ce.Gm.compact(Ge,!0);return Qr.v.create(Xe,Qe,Pe.elementCount,me)}}}}(Bi||(Bi={}));const Li=g.eB.add;function bi(oe,x,F){const{ignoreHydrogens:z,ignoreHydrogensVariant:me,traceOnly:Pe}=F,Ge=Je.Nf.isCoarse(x),{child:Xe}=oe,Qe=Xe?.unitMap.get(x.id);if(Xe&&!Qe)throw new Error("expected childUnit to exist if child exists");if(Xe||z||Pe)return lt=>!!Qe&&!Tt.SortedArray.has(Qe.elements,lt)||!Ge&&z&&(0,Gr.v3)(oe,x,lt,me)||Pe&&!(0,Gr.UQ)(x,lt)}function Vi(oe,x,F,z,me,Pe){const{child:Ge}=F,Xe=Ge?.unitMap.get(x.id);if(Ge&&!Xe)return rr.e.createEmpty(Pe);const{detail:Qe,sizeFactor:lt,stride:ft}=me,{elements:wt,conformation:Ut}=x,Jt=wt.length,gn=Jt*(0,zr.J)(Qe),Pn=lr.P.createState(gn,gn/2,Pe),wn=(0,g.eB)(),Bn=bi(F,x,me),Mn=Je.iZ.Location.create(F,x),Ln=z.size.size,cr=(0,g.eB)();let qn=0,Qn=0;for(let wr=0;wrqn&&(qn=to),Pn.currentGroup=wr,(0,kr.X)(Pn,wn,to*lt,Qe)}const Zn=Pe?Bt.f8.clone(Pe.boundingSphere):void 0,zn=lr.P.getMesh(Pn);if(0===Qn)return zn;let Lr;return g.eB.scale(cr,cr,1/Qn),Lr=Zn&&g.eB.distance(cr,Zn.center)/Zn.radius<.1?Zn:Bt.f8.expand((0,Bt.f8)(),(Xe??x).boundary.sphere,qn*lt+.05),zn.setBoundingSphere(Lr),zn}function Ei(oe,x,F,z,me,Pe){const{child:Ge}=F,Xe=Ge?.unitMap.get(x.id);if(Ge&&!Xe)return Qr.v.createEmpty(Pe);const{sizeFactor:Qe,stride:lt}=me,{elements:ft,conformation:wt}=x,Ut=ft.length,Jt=Bi.create(Ut,Ut/2,Pe),gn=(0,g.eB)(),Pn=bi(F,x,me),wn=Je.iZ.Location.create(F,x),Bn=z.size.size,Mn=(0,g.eB)();let Ln=0,cr=0;if(lt&<>1||Pn||"uniform"!==z.size.granularity)for(let zn=0;znLn&&(Ln=Lr)}else{for(let zn=0;znPn&&(Pn=Io),Ut.currentGroup=lt(cr,Zr),(0,kr.X)(Ut,Lr,Io*Xe,Ge)}}const Bn=me?Bt.f8.clone(me.boundingSphere):void 0,Mn=lr.P.getMesh(Ut);if(0===wn)return Mn;let Ln;return g.eB.scale(gn,gn,1/wn),Ln=Bn&&g.eB.distance(gn,Bn.center)/Bn.radius<1?Bn:Bt.f8.expand((0,Bt.f8)(),(Pe??x).boundary.sphere,Pn*Xe+.05),Mn.setBoundingSphere(Ln),Mn}function ar(oe,x,F,z,me){const{child:Pe}=x,{sizeFactor:Ge,stride:Xe}=z,{getSerialIndex:Qe}=x.serialMapping,lt=x.elementCount,ft=Bi.create(lt,lt/2,me),wt=F.size.size,Ut=(0,g.eB)();let Jt=0,gn=0;for(const Mn of x.units){const Ln=Pe?.unitMap.get(Mn.id);if(Pe&&!Ln)return Qr.v.createEmpty(me);const{elements:cr,conformation:qn}=Mn,Qn=cr.length,Zn=(0,g.eB)(),zn=bi(x,Mn,z),Lr=Je.iZ.Location.create(x,Mn);if(Xe&&Xe>1||zn||"uniform"!==F.size.granularity)for(let wr=0;wrJt&&(Jt=Cr)}else{for(let wr=0;wr{const Ut=me.units[wt];return Qe.unit=Ut,Qe.element=Ut.elements[ft],Qe})},oe.fromStructure=function F(z){const{units:me,elementCount:Pe}=z,Ge=Pe,{unitIndices:Qe,elementIndices:lt}=z.serialMapping,ft=Je.iZ.Location.create(z);return(0,oo.iQ)(Ge,1,1,Ut=>(ft.unit=me[Qe[Ut]],ft.element=lt[Ut],ft),!0)}}(sr||(sr={}));var Jn=n(5019);const Br={sizeFactor:v.t.Numeric(1,{min:0,max:10,step:.1}),detail:v.t.Numeric(0,{min:0,max:3,step:1},Jn.iy.CustomQualityParamInfo),ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),traceOnly:v.t.Boolean(!1),tryUseImpostor:v.t.Boolean(!0),stride:v.t.Numeric(1,{min:1,max:100,step:1})},st={...tr.Te,...tr.qg,...Br};function et(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth&&z.extensions.textureFloat?function at(oe){return(0,tr.uF)({defaultProps:v.t.getDefaultValues(st),createGeometry:Ei,createLocationIterator:sr.fromGroup,getLoci:Ht,eachLocation:ln,setUpdateState:(x,F,z)=>{x.createGeometry=F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.traceOnly!==z.traceOnly||F.stride!==z.stride},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function Et(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(st),createGeometry:Vi,createLocationIterator:sr.fromGroup,getLoci:Ht,eachLocation:ln,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.traceOnly!==z.traceOnly||F.stride!==z.stride},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}const Nt={...ti.EN,...ti.T9,...Br};function qt(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth&&z.extensions.textureFloat?function Cn(oe){return(0,ti.zo)({defaultProps:v.t.getDefaultValues(Nt),createGeometry:ar,createLocationIterator:sr.fromStructure,getLoci:ur,eachLocation:kn,setUpdateState:(x,F,z)=>{x.createGeometry=F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.traceOnly!==z.traceOnly||F.stride!==z.stride},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function Un(oe){return(0,ti.wA)({defaultProps:v.t.getDefaultValues(Nt),createGeometry:Gn,createLocationIterator:sr.fromStructure,getLoci:ur,eachLocation:kn,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.traceOnly!==z.traceOnly||F.stride!==z.stride},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}var vn=n(8688),nr=n(1137),pr=n(1758),Rr=n(5201);const mo={"element-sphere":(oe,x)=>(0,vn.T)("Element sphere",oe,x,et),"intra-bond":(oe,x)=>(0,vn.T)("Intra-unit bond cylinder",oe,x,mi),"inter-bond":(oe,x)=>(0,nr.K)("Inter-unit bond cylinder",oe,x,Hn)},Uo={...st,traceOnly:v.t.Boolean(!1,{isHidden:!0}),...Ci,...Qi,includeParent:v.t.Boolean(!1),unitKinds:(0,Rr.R8)(["atomic"]),sizeFactor:v.t.Numeric(.15,{min:.01,max:10,step:.01}),sizeAspectRatio:v.t.Numeric(2/3,{min:.01,max:3,step:.01}),visuals:v.t.MultiSelect(["element-sphere","intra-bond","inter-bond"],v.t.objectToOptions(mo)),bumpFrequency:v.t.Numeric(0,{min:0,max:10,step:.1},Jn.iy.ShadingCategory)},fo=(0,pr.GT)({name:"ball-and-stick",label:"Ball & Stick",description:"Displays atoms as spheres and bonds as cylinders.",factory:function ri(oe,x){return dr.YL.createMulti("Ball & Stick",oe,x,pr.J1,mo)},getParams:function qo(oe,x){if(Je.oE.getSize(x)>=Je.oE.Size.Huge){const z=v.t.clone(Uo);return z.visuals.defaultValue=["element-sphere","intra-bond"],z}return Uo},defaultValues:v.t.getDefaultValues(Uo),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:oe=>oe.elementCount>0,getData:(oe,x)=>x.includeParent?oe.asParent():oe,mustRecreate:(oe,x)=>oe.includeParent!==x.includeParent});function Lo(oe,x,F,z,me){const{links:Pe,elements:Ge}=x.carbohydrates,{linkSizeFactor:Xe}=z,Qe=Je.iZ.Location.create(x),lt={linkCount:Pe.length,position:(Ut,Jt,gn)=>{const Pn=Pe[gn];g.eB.copy(Ut,Ge[Pn.carbohydrateIndexA].geometry.center),g.eB.copy(Jt,Ge[Pn.carbohydrateIndexB].geometry.center)},radius:Ut=>{const gn=Ge[Pe[Ut].carbohydrateIndexA],Pn=gn.unit.rings.all[gn.ringIndex];return Qe.unit=gn.unit,Qe.element=gn.unit.elements[Pn[0]],F.size.size(Qe)*Xe}},{mesh:ft,boundingSphere:wt}=(0,Vr.C1)(oe,lt,z,me);if(wt)ft.setBoundingSphere(wt);else if(ft.triangleCount>0){const Ut=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*Xe);ft.setBoundingSphere(Ut)}return ft}const Ni={...tr.Te,...Vr.Lr,linkSizeFactor:v.t.Numeric(.3,{min:0,max:3,step:.01})};function rs(oe){return(0,ti.wA)({defaultProps:v.t.getDefaultValues(Ni),createGeometry:Lo,createLocationIterator:Gi,getLoci:_o,eachLocation:Wr,setUpdateState:(x,F,z)=>{x.createGeometry=F.linkSizeFactor!==z.linkSizeFactor||F.radialSegments!==z.radialSegments||F.linkCap!==z.linkCap}},oe)}function Gi(oe){const{elements:x,links:F}=oe.carbohydrates,z=F.length,Pe=Je.iZ.Location.create(oe);return(0,oo.iQ)(z,1,1,Xe=>{const lt=x[F[Xe].carbohydrateIndexA],ft=lt.unit.rings.all[lt.ringIndex];return Pe.unit=lt.unit,Pe.element=lt.unit.elements[ft[0]],Pe},!0)}function _o(oe,x,F){const{objectId:z,groupId:me}=oe;if(F===z){const{links:Pe,elements:Ge}=x.carbohydrates,Xe=Pe[me],Qe=Ge[Xe.carbohydrateIndexA],lt=Ge[Xe.carbohydrateIndexB];return Je.iZ.Loci.union((0,Gr.rS)(x,Qe.unit,Qe.residueIndex,Qe.altId),(0,Gr.rS)(x,lt.unit,lt.residueIndex,lt.altId))}return Rn.BL}const hr=new Set;function Wr(oe,x,F){let z=!1;if(!Je.iZ.Loci.is(oe)||!Je.oE.areEquivalent(oe.structure,x))return!1;const{getLinkIndices:me}=x.carbohydrates;for(const{unit:Pe,indices:Ge}of oe.elements)Je.Nf.isAtomic(Pe)&&(hr.clear(),Tt.CD.forEach(Ge,Xe=>{const Qe=me(Pe,Pe.elements[Xe]);for(let lt=0,ft=Qe.length;lt{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail}},oe)}function Ya(oe){const x=oe.carbohydrates.elements,F=2*x.length,me=Je.iZ.Location.create(oe);return(0,oo.iQ)(F,1,1,function Pe(Xe,Qe){const lt=x[Math.floor(Xe/2)],ft=lt.unit.rings.all[lt.ringIndex];return me.unit=lt.unit,me.element=lt.unit.elements[ft[0]],me},!0,function Ge(Xe,Qe){return Xe%2==1})}function Zc(oe,x,F){const{objectId:z,groupId:me}=oe;if(F===z){const Pe=x.carbohydrates.elements[Math.floor(me/2)];return(0,Gr.rS)(x,Pe.unit,Pe.residueIndex,Pe.altId)}return Rn.BL}const Pa=new Set;function _m(oe,x,F){const{getElementIndices:z}=x.carbohydrates;let me=!1;if(!Je.iZ.Loci.is(oe)||!Je.oE.areEquivalent(oe.structure,x))return!1;for(const{unit:Pe,indices:Ge}of oe.elements)Je.Nf.isAtomic(Pe)&&(Pa.clear(),Tt.CD.forEach(Ge,Xe=>{const Qe=z(Pe,Pe.elements[Xe]);for(let lt=0,ft=Qe.length;lt{const Pn=Pe[gn];Pn.fromCarbohydrate?(g.eB.copy(Ut,Ge[Pn.carbohydrateIndex].geometry.center),Pn.elementUnit.conformation.position(Pn.elementUnit.elements[Pn.elementIndex],Jt)):(Pn.elementUnit.conformation.position(Pn.elementUnit.elements[Pn.elementIndex],Ut),g.eB.copy(Jt,Ge[Pn.carbohydrateIndex].geometry.center))},radius:Ut=>{const Jt=Pe[Ut];if(Jt.fromCarbohydrate){const gn=Ge[Jt.carbohydrateIndex],Pn=gn.unit.rings.all[gn.ringIndex];Qe.unit=gn.unit,Qe.element=gn.unit.elements[Pn[0]]}else Qe.unit=Jt.elementUnit,Qe.element=Jt.elementUnit.elements[Jt.elementIndex];return F.size.size(Qe)*Xe},style:Ut=>{const Jt=Pe[Ut],Pn=(0,sd.Yd)(Jt.elementUnit.model.atomicHierarchy.atoms.type_symbol.value(Jt.elementUnit.elements[Jt.elementIndex]));return sd.ZL.has(Pn)?1:0}},{mesh:ft,boundingSphere:wt}=(0,Vr.C1)(oe,lt,z,me);if(wt)ft.setBoundingSphere(wt);else if(ft.triangleCount>0){const Ut=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*Xe);ft.setBoundingSphere(Ut)}return ft}const ad={...tr.Te,...Vr.Lr,terminalLinkSizeFactor:v.t.Numeric(.2,{min:0,max:3,step:.01})};function xm(oe){return(0,ti.wA)({defaultProps:v.t.getDefaultValues(ad),createGeometry:bm,createLocationIterator:Cm,getLoci:Sm,eachLocation:Em,setUpdateState:(x,F,z)=>{x.createGeometry=F.terminalLinkSizeFactor!==z.terminalLinkSizeFactor||F.radialSegments!==z.radialSegments||F.linkCap!==z.linkCap}},oe)}function Cm(oe){const{elements:x,terminalLinks:F}=oe.carbohydrates,z=F.length,Pe=Je.iZ.Location.create(oe);return(0,oo.iQ)(z,1,1,Xe=>{const Qe=F[Xe];if(Qe.fromCarbohydrate){const lt=x[Qe.carbohydrateIndex],ft=lt.unit.rings.all[lt.ringIndex];Pe.unit=lt.unit,Pe.element=lt.unit.elements[ft[0]]}else Pe.unit=Qe.elementUnit,Pe.element=Qe.elementUnit.elements[Qe.elementIndex];return Pe},!0)}function Sm(oe,x,F){const{objectId:z,groupId:me}=oe;if(F===z){const{terminalLinks:Pe,elements:Ge}=x.carbohydrates,Xe=Pe[me],Qe=Ge[Xe.carbohydrateIndex];return Je.iZ.Loci.union((0,Gr.rS)(x,Qe.unit,Qe.residueIndex,Qe.altId),(0,Gr.uh)(x,Xe.elementUnit,Xe.elementUnit.elements[Xe.elementIndex]))}return Rn.BL}const Vu=new Set;function Em(oe,x,F){let z=!1;if(!Je.iZ.Loci.is(oe)||!Je.oE.areEquivalent(oe.structure,x))return!1;const{getTerminalLinkIndices:me}=x.carbohydrates;for(const{unit:Pe,indices:Ge}of oe.elements)Je.Nf.isAtomic(Pe)&&(Vu.clear(),Tt.CD.forEach(Ge,Xe=>{const Qe=me(Pe,Pe.elements[Xe]);for(let lt=0,ft=Qe.length;lt(0,nr.K)("Carbohydrate symbol mesh",oe,x,ma),"carbohydrate-link":(oe,x)=>(0,nr.K)("Carbohydrate link cylinder",oe,x,rs),"carbohydrate-terminal-link":(oe,x)=>(0,nr.K)("Carbohydrate terminal link cylinder",oe,x,xm)},ud={...Es,...Ni,...ad,visuals:v.t.MultiSelect(["carbohydrate-symbol","carbohydrate-link","carbohydrate-terminal-link"],v.t.objectToOptions(cd)),bumpFrequency:v.t.Numeric(0,{min:0,max:10,step:.1},Jn.iy.ShadingCategory)},Pm=(0,pr.GT)({name:"carbohydrate",label:"Carbohydrate",description:"Displays carbohydrate symbols (3D SNFG).",factory:function Am(oe,x){return dr.YL.createMulti("Carbohydrate",oe,x,pr.J1,cd)},getParams:function Im(oe,x){return ud},defaultValues:v.t.getDefaultValues(ud),defaultColorTheme:{name:"carbohydrate-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:oe=>oe.models.some(x=>Je.Kx.hasCarbohydrate(x))});var _i=n(2802),oa=n(5734);function ld(oe,x){switch(oe.kind){case 0:return function Tm(oe,x){const F=oe.model.atomicRanges.cyclicPolymerMap,z=oa.m.transientSegments(Lc(oe),oe.elements),me=Tt.hT.transientSegments(oe.model.atomicHierarchy.residueAtomSegments,oe.elements),Pe=oe.model.atomicHierarchy.derived.residue.traceElementIndex,{moleculeType:Ge}=oe.model.atomicHierarchy.derived.residue;let Xe=-1,Qe=-1,lt=!0,ft=-1,wt=0;for(;z.hasNext;){for(lt=!0,ft=wt,me.setSegment(z.move());me.hasNext;){if(lt){const Jt=me.move().index;if(++wt,!me.hasNext)continue;lt=!1,Qe=Jt}Xe=Qe,Qe=me.move().index,x(Pe[Xe],Pe[Qe],wt-1,wt,Ge[Xe]),++wt}F.has(Qe)&&(Xe=Qe,Qe=F.get(Xe),x(Pe[Xe],Pe[Qe],wt-1,ft,Ge[Xe]))}}(oe,x);case 1:case 2:return function Bm(oe,x){const F=oa.m.transientSegments(Lc(oe),oe.elements),{elements:z}=oe;let me=!0,Pe=0;for(;F.hasNext;){me=!0;const Ge=F.move();for(let lt=Ge.start,ft=Ge.end;ltft)continue;me=!1}x(z[lt-1],z[lt],Pe-1,Pe,0),++Pe}}}(oe,x)}}function dd(oe,x){switch(oe.kind){case 0:return function Dm(oe,x){const F=oa.m.transientSegments(Lc(oe),oe.elements),z=Tt.hT.transientSegments(oe.model.atomicHierarchy.residueAtomSegments,oe.elements),me=oe.model.atomicHierarchy.derived.residue.traceElementIndex;let Pe=0;for(;F.hasNext;)for(z.setSegment(F.move());z.hasNext;)x(me[z.move().index],Pe),++Pe}(oe,x);case 1:case 2:return function Mm(oe,x){const F=oa.m.transientSegments(Lc(oe),oe.elements),{elements:z}=oe;let me=0;for(;F.hasNext;){const Pe=F.move();for(let Qe=Pe.start,lt=Pe.end;Qe({}),isApplicable:oe=>!0,obtain:function(){var oe=(0,r.A)(function*(x,F){return{value:Um(F)}});return function(F,z){return oe.apply(this,arguments)}}()});function Hs(oe){return Tr.gG.is(oe,2)}function zu(oe,x,F={}){switch(oe.kind){case 0:return new Gm(oe,x,F);case 1:case 2:return new zm(oe,x)}}const Xc=Tr.gG.create(536870912);function md(oe,x){return{center:Je.iZ.Location.create(oe,x),centerPrev:Je.iZ.Location.create(oe,x),centerNext:Je.iZ.Location.create(oe,x),first:!1,last:!1,initial:!1,final:!1,secStrucFirst:!1,secStrucLast:!1,secStrucType:Xc,moleculeType:0,coarseBackboneFirst:!1,coarseBackboneLast:!1,isCoarseBackbone:!1,p0:(0,g.eB)(),p1:(0,g.eB)(),p2:(0,g.eB)(),p3:(0,g.eB)(),p4:(0,g.eB)(),d12:(0,g.eB)(),d23:(0,g.eB)()}}const xo=(0,g.eB)(),$c=(0,g.eB)(),Jc=(0,g.eB)();class Gm{atomicPos(x,F){-1!==F&&(x[0]=this.atomicConformation.x[F],x[1]=this.atomicConformation.y[F],x[2]=this.atomicConformation.z[F])}pos(x,F,z){const me=this.traceElementIndex[F];this.helixOrientationCenters&&Hs(z)?g.eB.fromArray(x,this.helixOrientationCenters,3*F):this.atomicPos(x,me)}updateResidueSegmentRange(x){const{index:F}=this.residueAtomSegments;this.residueSegmentMin=F[this.polymerRanges[2*x.index]],this.residueSegmentMax=F[this.polymerRanges[2*x.index+1]]}getResidueIndex(x){if(xthis.residueSegmentMax){const F=this.cyclicPolymerMap.get(this.residueSegmentMax);x=void 0!==F?F+(x-this.residueSegmentMax-1):this.residueSegmentMax}return x}getSecStruc(x){if(this.secondaryStructure){const{type:F,getIndex:z}=this.secondaryStructure,me=F[z(x)];return Hs(me)?2:me}return Xc}setControlPoint(x,F,z,me,Pe){(function Vm(oe){return Tr.gG.is(oe,4)})(Pe)||this.helixOrientationCenters&&Hs(Pe)?g.eB.scale(x,g.eB.add(x,F,g.eB.add(x,me,g.eB.add(x,z,z))),1/4):g.eB.copy(x,z)}setFromToVector(x,F,z){this.value.isCoarseBackbone||this.helixOrientationCenters&&Hs(z)?g.eB.set(x,1,0,0):(this.atomicPos($c,this.directionFromElementIndex[F]),this.atomicPos(Jc,this.directionToElementIndex[F]),g.eB.sub(x,Jc,$c))}setDirection(x,F,z,me){g.eB.matchDirection($c,F,z),g.eB.matchDirection(Jc,me,z),g.eB.scale(x,g.eB.add(x,$c,g.eB.add(x,Jc,g.eB.add(x,z,z))),1/4)}move(){const{residueIt:x,polymerIt:F,value:z}=this;if(0===this.state)for(;F.hasNext;)if(this.polymerSegment=F.move(),x.setSegment(this.polymerSegment),this.updateResidueSegmentRange(this.polymerSegment),x.hasNext){this.state=1;const me=this.residueAtomSegments.index[this.unit.elements[this.polymerSegment.start]],Pe=this.getResidueIndex(me-1);this.currSecStrucType=me===Pe?Xc:this.getSecStruc(Pe),this.nextSecStrucType=this.getSecStruc(me),this.currCoarseBackbone=-1===this.directionFromElementIndex[Pe]||-1===this.directionToElementIndex[Pe],this.nextCoarseBackbone=-1===this.directionFromElementIndex[me]||-1===this.directionToElementIndex[me];break}if(1===this.state){const{index:me}=x.move(),Pe=this.getResidueIndex(me-3),Ge=this.getResidueIndex(me-2),Xe=this.getResidueIndex(me-1),Qe=this.getResidueIndex(me+1),lt=this.getResidueIndex(me+2),ft=this.getResidueIndex(me+3);this.prevSecStrucType=this.getSecStruc(Xe),this.currSecStrucType=this.getSecStruc(me),this.nextSecStrucType=me===Qe?Xc:this.getSecStruc(Qe),this.prevCoarseBackbone=this.currCoarseBackbone,this.currCoarseBackbone=this.nextCoarseBackbone,this.nextCoarseBackbone=-1===this.directionFromElementIndex[Qe]||-1===this.directionToElementIndex[Qe],z.secStrucType=this.currSecStrucType,z.secStrucFirst=this.prevSecStrucType!==this.currSecStrucType,z.secStrucLast=this.currSecStrucType!==this.nextSecStrucType,z.isCoarseBackbone=this.currCoarseBackbone,z.coarseBackboneFirst=this.prevCoarseBackbone!==this.currCoarseBackbone,z.coarseBackboneLast=this.currCoarseBackbone!==this.nextCoarseBackbone,z.first=me===this.residueSegmentMin,z.last=me===this.residueSegmentMax,z.moleculeType=this.moleculeType[me],z.initial=me===Xe,z.final=me===Qe,z.centerPrev.element=this.traceElementIndex[Xe],z.center.element=this.traceElementIndex[me],z.centerNext.element=this.traceElementIndex[Qe];const wt=this.getSecStruc(Pe),Ut=this.getSecStruc(Ge),Jt=this.getSecStruc(Xe),gn=this.getSecStruc(me),Pn=this.getSecStruc(Qe),wn=this.getSecStruc(lt),Bn=this.getSecStruc(ft);this.pos(this.p0,Pe,wt),this.pos(this.p1,Ge,Ut),this.pos(this.p2,Xe,Jt),this.pos(this.p3,me,gn),this.pos(this.p4,Qe,Pn),this.pos(this.p5,lt,wn),this.pos(this.p6,ft,Bn);const Mn=Hs(wt),Ln=Hs(Ut),cr=Hs(Jt),qn=Hs(gn),Qn=Hs(Pn),Zn=Hs(wn),zn=Hs(Bn);this.helixOrientationCenters&&(qn!==cr?qn?(g.eB.copy(this.p0,this.p3),g.eB.copy(this.p1,this.p3),g.eB.copy(this.p2,this.p3)):cr&&(g.eB.scale(xo,g.eB.sub(xo,this.p2,this.p3),2),g.eB.add(this.p2,this.p3,xo),g.eB.add(this.p1,this.p2,xo),g.eB.add(this.p0,this.p1,xo)):qn!==Ln?qn?(g.eB.copy(this.p0,this.p2),g.eB.copy(this.p1,this.p2)):Ln&&(g.eB.scale(xo,g.eB.sub(xo,this.p1,this.p2),2),g.eB.add(this.p1,this.p2,xo),g.eB.add(this.p0,this.p1,xo)):qn!==Mn&&(qn?g.eB.copy(this.p0,this.p1):Mn&&(g.eB.scale(xo,g.eB.sub(xo,this.p0,this.p1),2),g.eB.add(this.p0,this.p1,xo))),qn!==Qn?qn?(g.eB.copy(this.p4,this.p3),g.eB.copy(this.p5,this.p3),g.eB.copy(this.p6,this.p3)):Qn&&(g.eB.scale(xo,g.eB.sub(xo,this.p4,this.p3),2),g.eB.add(this.p4,this.p3,xo),g.eB.add(this.p5,this.p4,xo),g.eB.add(this.p6,this.p5,xo)):qn!==Zn?qn?(g.eB.copy(this.p5,this.p4),g.eB.copy(this.p6,this.p4)):Zn&&(g.eB.scale(xo,g.eB.sub(xo,this.p5,this.p4),2),g.eB.add(this.p5,this.p4,xo),g.eB.add(this.p6,this.p5,xo)):qn!==zn&&(qn?g.eB.copy(this.p6,this.p5):zn&&(g.eB.scale(xo,g.eB.sub(xo,this.p6,this.p5),2),g.eB.add(this.p6,this.p5,xo)))),this.setFromToVector(this.d01,Xe,Jt),this.setFromToVector(this.d12,me,gn),this.setFromToVector(this.d23,Qe,Pn),this.setFromToVector(this.d34,lt,wn);const Lr=qn&&this.helixOrientationCenters,wr=1.5;me===Xe||gn!==Jt&&Lr?(g.eB.setMagnitude(xo,g.eB.sub(xo,this.p3,this.p4),wr),g.eB.add(this.p2,this.p3,xo),g.eB.add(this.p1,this.p2,xo),g.eB.add(this.p0,this.p1,xo)):Xe===Ge||gn!==Ut&&Lr?(g.eB.setMagnitude(xo,g.eB.sub(xo,this.p2,this.p3),wr),g.eB.add(this.p1,this.p2,xo),g.eB.add(this.p0,this.p1,xo)):(Ge===Pe||gn!==wt&&Lr)&&(g.eB.setMagnitude(xo,g.eB.sub(xo,this.p1,this.p2),wr),g.eB.add(this.p0,this.p1,xo)),me===Qe||gn!==Pn&&Lr?(g.eB.setMagnitude(xo,g.eB.sub(xo,this.p3,this.p2),wr),g.eB.add(this.p4,this.p3,xo),g.eB.add(this.p5,this.p4,xo),g.eB.add(this.p6,this.p5,xo)):Qe===lt||gn!==wn&&Lr?(g.eB.setMagnitude(xo,g.eB.sub(xo,this.p4,this.p3),wr),g.eB.add(this.p5,this.p4,xo),g.eB.add(this.p6,this.p5,xo)):(lt===ft||gn!==Bn&&Lr)&&(g.eB.setMagnitude(xo,g.eB.sub(xo,this.p5,this.p4),wr),g.eB.add(this.p6,this.p5,xo)),this.setControlPoint(z.p0,this.p0,this.p1,this.p2,Ut),this.setControlPoint(z.p1,this.p1,this.p2,this.p3,Jt),this.setControlPoint(z.p2,this.p2,this.p3,this.p4,gn),this.setControlPoint(z.p3,this.p3,this.p4,this.p5,Pn),this.setControlPoint(z.p4,this.p4,this.p5,this.p6,wn),this.setDirection(z.d12,this.d01,this.d12,this.d23),this.setDirection(z.d23,this.d12,this.d23,this.d34),x.hasNext||(this.state=0)}return this.hasNext=x.hasNext||F.hasNext,this.value}constructor(x,F,z={}){var me;if(this.unit=x,this.state=0,this.p0=(0,g.eB)(),this.p1=(0,g.eB)(),this.p2=(0,g.eB)(),this.p3=(0,g.eB)(),this.p4=(0,g.eB)(),this.p5=(0,g.eB)(),this.p6=(0,g.eB)(),this.d01=(0,g.eB)(),this.d12=(0,g.eB)(),this.d23=(0,g.eB)(),this.d34=(0,g.eB)(),this.hasNext=!1,this.atomicConformation=x.model.atomicConformation,this.residueAtomSegments=x.model.atomicHierarchy.residueAtomSegments,this.polymerRanges=x.model.atomicRanges.polymerRanges,this.traceElementIndex=x.model.atomicHierarchy.derived.residue.traceElementIndex,this.directionFromElementIndex=x.model.atomicHierarchy.derived.residue.directionFromElementIndex,this.directionToElementIndex=x.model.atomicHierarchy.derived.residue.directionToElementIndex,this.moleculeType=x.model.atomicHierarchy.derived.residue.moleculeType,this.cyclicPolymerMap=x.model.atomicRanges.cyclicPolymerMap,this.polymerIt=oa.m.transientSegments(this.polymerRanges,x.elements),this.residueIt=Tt.hT.transientSegments(this.residueAtomSegments,x.elements),this.value=md(F,x),this.hasNext=this.residueIt.hasNext&&this.polymerIt.hasNext,z.ignoreSecondaryStructure||(this.secondaryStructure=null===(me=Yc.v.get(F).value)||void 0===me?void 0:me.get(x.invariantId)),z.useHelixOrientation){const Pe=Gu.get(x.model).value;if(!Pe)throw new Error("missing helix-orientation");this.helixOrientationCenters=Pe.centers}}}class zm{getElementIndex(x){return Math.min(Math.max(this.polymerSegment.start,x),this.polymerSegment.end-1)}pos(x,F){const z=this.unit.elements[F];x[0]=this.conformation.x[z],x[1]=this.conformation.y[z],x[2]=this.conformation.z[z]}move(){if(0===this.state)for(;this.polymerIt.hasNext;)if(this.polymerSegment=this.polymerIt.move(),this.elementIndex=this.polymerSegment.start,this.elementIndex=this.polymerSegment.end&&(this.state=0)}return this.hasNext=this.elementIndex+1=0)){Xe=lt;break}}if(Ge<0)return!1;let Qe=Ge;for(let lt=Pe;lt>Xe;lt--){const ft=F[lt];if(ft<0)continue;const wt=Tt.CD.indexOf(x,ft);if(wt>=0){Qe=wt;break}}return z(Tt.IX.ofRange(oe+Ge,oe+Qe))}function Sd(oe,x,F,z,me){let Pe=!1;const{elements:Ge}=me.unit,{traceElementIndex:Xe}=me.unit.model.atomicHierarchy.derived.residue,{index:Qe}=me.unit.model.atomicHierarchy.residueAtomSegments,lt=F(me.unit);if(Tt.IX.is(me.indices))Pe=0===Tt.IX.start(me.indices)&&Tt.IX.end(me.indices)===me.unit.elements.length?z(Tt.IX.ofBounds(oe,oe+x))||Pe:Cd(oe,lt,Xe,z,Qe[Ge[Tt.IX.min(me.indices)]],Qe[Ge[Tt.IX.max(me.indices)]])||Pe;else{const{indices:ft}=me;for(let wt=0,Ut=ft.length;wt1)break;gn=wn,Pn++}wt=Pn-1,Pe=Cd(oe,lt,Xe,z,Jt,gn)||Pe}}return Pe}function Xm(oe){return oe.polymerElements}function Da(oe,x,F){let z=!1;if(!Je.iZ.Loci.is(oe))return!1;const{structure:me,group:Pe}=x;if(!Je.oE.areEquivalent(oe.structure,me))return!1;const Ge=Pe.units[0].polymerElements.length;for(const Xe of oe.elements){if(!Pe.unitIndexMap.has(Xe.unit.id))continue;const Qe=Pe.unitIndexMap.get(Xe.unit.id)*Ge;if(Je.Nf.isAtomic(Xe.unit))z=Sd(Qe,Ge,Xm,F,Xe)||z;else if(Tt.IX.is(Xe.indices)){const lt=Qe+Tt.IX.start(Xe.indices),ft=Qe+Tt.IX.end(Xe.indices);z=F(Tt.IX.ofBounds(lt,ft))||z}else for(let lt=0,ft=Xe.indices.length;lt{const ft=Tt.CD.indexOf(Xe.unit.gapElements,Xe.unit.elements[lt]);-1!==ft&&F(Tt.IX.ofSingleton(Qe*Ge+ft))&&(z=!0)})}}return z}function Ma(oe,x,F){const{objectId:z,instanceId:me,groupId:Pe}=oe;if(F===z){const{structure:Ge,group:Xe}=x,Qe=Xe.units[me];if(Je.Nf.isAtomic(Qe))return(0,Gr.nR)(Ge,Qe,Qe.nucleotideElements[Pe])}return Rn.BL}function qm(oe){return oe.nucleotideElements}function Oa(oe,x,F){let z=!1;if(!Je.iZ.Loci.is(oe))return!1;const{structure:me,group:Pe}=x;if(!Je.oE.areEquivalent(oe.structure,me))return!1;const Ge=Pe.units[0];if(!Je.Nf.isAtomic(Ge))return!1;const{nucleotideElements:Xe}=Ge,Qe=Xe.length;for(const lt of oe.elements){if(!Je.Nf.isAtomic(lt.unit)||!Pe.unitIndexMap.has(lt.unit.id))continue;const ft=Pe.unitIndexMap.get(lt.unit.id)*Qe;Je.Nf.isAtomic(lt.unit)&&(z=Sd(ft,Qe,qm,F,lt)||z)}return z}!function(oe){oe.fromGroup=function x(F,z){const{group:me,structure:Pe}=F,Ge=me.units[0].polymerElements,Xe=Ge.length,Qe=me.units.length,lt=Je.iZ.Location.create(Pe),wt=!!z?.asSecondary;return(0,oo.iQ)(Xe,Qe,1,(Jt,gn)=>(lt.unit=me.units[gn],lt.element=Ge[Jt],lt),!1,function Ut(Jt,gn){return wt})}}(ia||(ia={})),function(oe){oe.fromGroup=function x(F){const{group:z,structure:me}=F,Pe=z.units[0].gapElements,Ge=Pe.length,Xe=z.units.length,Qe=Je.iZ.Location.create(me);return(0,oo.iQ)(Ge,Xe,1,(ft,wt)=>(Qe.unit=z.units[wt],Qe.element=Pe[ft],Qe))}}($u||($u={})),function(oe){oe.fromGroup=function x(F){const{group:z,structure:me}=F,Pe=z.units[0],Ge=Je.Nf.isAtomic(Pe)?Pe.nucleotideElements:[],Xe=Ge.length,Qe=z.units.length,lt=Je.iZ.Location.create(me);return(0,oo.iQ)(Xe,Qe,1,(wt,Ut)=>(lt.unit=z.units[Ut],lt.element=Ge[wt],lt))}}(sa||(sa={}));const ep=(0,M.e)(),tp=(0,M.e)();function Ra(oe,x){const{model:F,conformation:z}=oe,{residueAtomSegments:me,atoms:Pe,index:Ge}=F.atomicHierarchy,{label_comp_id:Xe}=Pe,Qe=Xe.value(me.offsets[x]);let lt=(0,Tr.VH)(Qe),ft=(0,Tr.qN)(Qe);if(!lt&&!ft){const wt=Ge.findAtomOnResidue(x,"C4"),Ut=Ge.findAtomOnResidue(x,"N9");-1!==wt&&-1!==Ut&&M.e.distance(z.invariantPosition(wt,ep),z.invariantPosition(Ut,tp))<1.6?lt=!0:ft=!0}return{isPurine:lt,isPyrimidine:ft}}function wa(oe,x,F){const z=x.model.atomicHierarchy.index,{traceElementIndex:me}=x.model.atomicHierarchy.derived.residue;return oe.trace=me[F],oe.N1=z.findAtomOnResidue(F,"N1"),oe.C2=z.findAtomOnResidue(F,"C2"),oe.N3=z.findAtomOnResidue(F,"N3"),oe.C4=z.findAtomOnResidue(F,"C4"),oe.C5=z.findAtomOnResidue(F,"C5"),-1===oe.C5&&(oe.C5=z.findAtomOnResidue(F,"N5")),oe.C6=z.findAtomOnResidue(F,"C6"),oe.N7=z.findAtomOnResidue(F,"N7"),-1===oe.N7&&(oe.N7=z.findAtomOnResidue(F,"C7")),oe.C8=z.findAtomOnResidue(F,"C8"),oe.N9=z.findAtomOnResidue(F,"N9"),oe}function qa(oe){return-1!==oe.trace&&-1!==oe.N1&&-1!==oe.C2&&-1!==oe.N3&&-1!==oe.C4&&-1!==oe.C5&&-1!==oe.C6&&-1!==oe.N7&&-1!==oe.C8&&-1!==oe.N9}function Fa(oe,x,F){const z=x.model.atomicHierarchy.index,{traceElementIndex:me}=x.model.atomicHierarchy.derived.residue;return oe.trace=me[F],oe.N1=z.findAtomOnResidue(F,"N1"),-1===oe.N1&&(oe.N1=z.findAtomOnResidue(F,"C1")),oe.C2=z.findAtomOnResidue(F,"C2"),oe.N3=z.findAtomOnResidue(F,"N3"),oe.C4=z.findAtomOnResidue(F,"C4"),oe.C5=z.findAtomOnResidue(F,"C5"),oe.C6=z.findAtomOnResidue(F,"C6"),oe}function ec(oe){return-1!==oe.trace&&-1!==oe.N1&&-1!==oe.C2&&-1!==oe.N3&&-1!==oe.C4&&-1!==oe.C5&&-1!==oe.C6}function wc(oe,x,F){const z=x.model.atomicHierarchy.index,{traceElementIndex:me}=x.model.atomicHierarchy.derived.residue;return oe.trace=me[F],oe.C1_1=z.findAtomOnResidue(F,"C1'"),oe.C2_1=z.findAtomOnResidue(F,"C2'"),oe.C3_1=z.findAtomOnResidue(F,"C3'"),oe.C4_1=z.findAtomOnResidue(F,"C4'"),oe.O4_1=z.findAtomOnResidue(F,"O4'"),oe}function Fc(oe){return-1!==oe.trace&&-1!==oe.C1_1&&-1!==oe.C2_1&&-1!==oe.C3_1&&-1!==oe.C4_1&&-1!==oe.O4_1}const ru=(0,g.eB)(),Ju=(0,g.eB)(),Ed=(0,g.eB)(),Id=(0,g.eB)(),Ad=(0,g.eB)(),Pd=(0,g.eB)(),ou=(0,g.eB)(),qu=(0,g.eB)(),el=(0,g.eB)(),Td=(0,g.eB)(),Nc=g.$I.identity(),np=(0,g.eB)(),Bd=(0,no.az)(),Dd={sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01}),thicknessFactor:v.t.Numeric(1,{min:0,max:2,step:.01}),radialSegments:v.t.Numeric(16,{min:2,max:56,step:2},Jn.iy.CustomQualityParamInfo)};function rp(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x))return rr.e.createEmpty(Pe);const Ge=x.nucleotideElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{sizeFactor:Xe,thicknessFactor:Qe,radialSegments:lt}=me,ft=Ge*(Bd.vertices.length/3+2*lt),wt=lr.P.createState(ft,ft/4,Pe),{elements:Ut,model:Jt,conformation:gn}=x,{chainAtomSegments:Pn,residueAtomSegments:wn}=Jt.atomicHierarchy,{moleculeType:Bn}=Jt.atomicHierarchy.derived.residue,Mn=Tt.hT.transientSegments(Pn,Ut),Ln=Tt.hT.transientSegments(wn,Ut),cr=1*Xe,Qn=Qe*Xe*2,Zn={radiusTop:cr,radiusBottom:cr,radialSegments:lt,bottomCap:!0};let zn=0;for(;Mn.hasNext;)for(Ln.setSegment(Mn.move());Ln.hasNext;){const{index:to}=Ln.move();if((0,Tr.OV)(Bn[to])){const Cr={trace:-1,N1:-1,C2:-1,N3:-1,C4:-1,C5:-1,C6:-1,N7:-1,C8:-1,N9:-1,C1_1:-1,C2_1:-1,C3_1:-1,C4_1:-1,O4_1:-1};let Zr=-1,Io=-1,wo=-1,si=-1,Ii=-1,ai=4.5;const{isPurine:li,isPyrimidine:Vo}=Ra(x,to);li?(ai=4.5,wa(Cr,x,to),Zr=Cr.N1,Io=Cr.C4,wo=Cr.C6,si=Cr.C2,Ii=Cr.N9):Vo&&(ai=3,Fa(Cr,x,to),Zr=Cr.N3,Io=Cr.C6,wo=Cr.C4,si=Cr.C2,Ii=Cr.N1),-1!==Ii&&-1!==Cr.trace&&(gn.invariantPosition(Ii,Ad),gn.invariantPosition(Cr.trace,Pd),wt.currentGroup=zn,(0,_i.y9)(wt,Ad,Pd,1,Zn),-1!==Zr&&-1!==Io&&-1!==wo&&-1!==si&&(gn.invariantPosition(Zr,ru),gn.invariantPosition(Io,Ju),gn.invariantPosition(wo,Ed),gn.invariantPosition(si,Id),g.eB.normalize(ou,g.eB.sub(ou,Ju,ru)),g.eB.normalize(qu,g.eB.sub(qu,Id,Ed)),g.eB.normalize(el,g.eB.cross(el,ou,qu)),g.$I.targetTo(Nc,ru,Ju,el),g.eB.scaleAndAdd(Td,ru,ou,ai/2-.2),g.$I.scale(Nc,Nc,g.eB.set(np,4.5,Qn,ai)),g.$I.setTranslation(Nc,Td),lr.P.addPrimitive(wt,Nc,Bd))),++zn}}const Lr=lr.P.getMesh(wt),wr=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,cr);return Lr.setBoundingSphere(wr),Lr}v.t.getDefaultValues(Dd);const Md={...tr.Te,...Dd};function op(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(Md),createGeometry:rp,createLocationIterator:sa.fromGroup,getLoci:Ma,eachLocation:Oa,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.thicknessFactor!==z.thicknessFactor||F.radialSegments!==z.radialSegments}},oe)}const iu=(0,g.eB)(),ha=(0,g.eB)(),su=(0,g.eB)(),au=(0,g.eB)(),tc=(0,g.eB)(),nc=(0,g.eB)(),cu=(0,g.eB)(),Od=(0,g.eB)(),Rd=(0,g.eB)(),uu=(0,g.eB)(),ga=(0,g.eB)(),Ld={sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01}),thicknessFactor:v.t.Numeric(1,{min:0,max:2,step:.01}),radialSegments:v.t.Numeric(16,{min:2,max:56,step:2},Jn.iy.CustomQualityParamInfo),detail:v.t.Numeric(0,{min:0,max:3,step:1},Jn.iy.CustomQualityParamInfo)},lu=(v.t.getDefaultValues(Ld),new Float32Array(54)),ip=new Uint32Array([0,1,2,3,4,5,6,7,16,17,14,15,12,13,8,9,10,11,0,1]),sp=new Uint32Array([8,12,14,16,6,4,2,0,10]),ap=new Uint32Array([9,11,1,3,5,7,17,15,13]),du=new Float32Array(36),cp=new Uint32Array([0,1,2,3,4,5,6,7,8,9,10,11,0,1]),up=new Uint32Array([0,10,8,6,4,2]),lp=new Uint32Array([1,3,5,7,9,11]),wd=(0,g.eB)();function Fd(oe,x,...F){for(let z=0,me=F.length;z{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.thicknessFactor!==z.thicknessFactor||F.radialSegments!==z.radialSegments}},oe)}const rc=(0,g.eB)(),fu=(0,g.eB)(),mu=(0,g.eB)(),oc=(0,g.eB)(),ic=(0,g.eB)(),pu=(0,g.eB)(),Ud=(0,g.eB)(),Vd=(0,g.eB)(),Gd=(0,g.eB)(),hu=(0,g.eB)(),tl=(0,g.eB)(),gu=(0,g.eB)(),yu=(0,g.eB)(),nl=(0,g.eB)(),sc=(0,g.eB)(),fs=(0,g.eB)(),ac=(0,g.eB)(),zd={sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01}),thicknessFactor:v.t.Numeric(1,{min:0,max:2,step:.01})},vu=(v.t.getDefaultValues(zd),new Float32Array(54)),mp=new Uint32Array([0,1,2,3,4,5,6,7,16,17,14,15,12,13,8,9,10,11,0,1]),pp=new Uint32Array([8,12,14,16,6,4,2,0,10]),hp=new Uint32Array([9,11,1,3,5,7,17,15,13]),_u=new Float32Array(36),gp=new Uint32Array([2,3,4,5,6,7,8,9,10,11,2,3]),yp=new Uint32Array([0,10,8,6,4,2,10]),vp=new Uint32Array([1,3,5,7,9,11,3]),bu=new Float32Array(36),_p=new Uint32Array([0,1,2,3,4,5,6,7,8,9,10,11,0,1]),bp=new Uint32Array([0,10,8,6,4,2]),xp=new Uint32Array([1,3,5,7,9,11]),kd=(0,g.eB)();function rl(oe,x,...F){for(let z=0,me=F.length;z{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.thicknessFactor!==z.thicknessFactor}},oe)}var jd=n(1989);const ms=(0,g.eB)(),xi=(0,g.eB)(),os=(0,g.eB)(),is=(0,g.eB)(),ki=(0,g.eB)(),Hi=(0,g.eB)(),ss=(0,g.eB)(),Ys=(0,g.eB)(),Xs=(0,g.eB)(),Zi=(0,g.eB)(),Yi=(0,g.eB)(),$s=(0,g.eB)(),Ps=(0,g.eB)(),Js=(0,g.eB)(),qs=(0,g.eB)(),ol={...tr.Te,...tr.lm,sizeFactor:v.t.Numeric(.3,{min:0,max:10,step:.01}),radialSegments:v.t.Numeric(16,{min:2,max:56,step:2},Jn.iy.CustomQualityParamInfo),tryUseImpostor:v.t.Boolean(!0)};function Ep(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth?function Ap(oe){return(0,tr.Vb)({defaultProps:v.t.getDefaultValues(ol),createGeometry:Ip,createLocationIterator:sa.fromGroup,getLoci:Ma,eachLocation:Oa,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function Tp(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(ol),createGeometry:Pp,createLocationIterator:sa.fromGroup,getLoci:Ma,eachLocation:Oa,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.radialSegments!==z.radialSegments},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}function Ip(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x))return ci.S.createEmpty(Pe);const Ge=x.nucleotideElements.length;if(!Ge)return ci.S.createEmpty(Pe);const Xe=15*Ge,Qe=jd.h.create(Xe,Xe/4,Pe),{elements:lt,model:ft,conformation:wt}=x,{chainAtomSegments:Ut,residueAtomSegments:Jt}=ft.atomicHierarchy,{moleculeType:gn}=ft.atomicHierarchy.derived.residue,Pn=Tt.hT.transientSegments(Ut,lt),wn=Tt.hT.transientSegments(Jt,lt);let Bn=0;for(;Pn.hasNext;)for(wn.setSegment(Pn.move());wn.hasNext;){const{index:qn}=wn.move();if((0,Tr.OV)(gn[qn])){const Qn={trace:-1,N1:-1,C2:-1,N3:-1,C4:-1,C5:-1,C6:-1,N7:-1,C8:-1,N9:-1,C1_1:-1,C2_1:-1,C3_1:-1,C4_1:-1,O4_1:-1};wc(Qn,x,qn),Fc(Qn)&&(wt.invariantPosition(Qn.C1_1,Yi),wt.invariantPosition(Qn.C2_1,$s),wt.invariantPosition(Qn.C3_1,Ps),wt.invariantPosition(Qn.C4_1,Js),wt.invariantPosition(Qn.O4_1,qs),wt.invariantPosition(Qn.trace,ms),Qe.add(Ps[0],Ps[1],Ps[2],ms[0],ms[1],ms[2],1,!0,!0,2,Bn),Qe.add(Ps[0],Ps[1],Ps[2],Js[0],Js[1],Js[2],1,!0,!0,2,Bn),Qe.add(Js[0],Js[1],Js[2],qs[0],qs[1],qs[2],1,!0,!0,2,Bn),Qe.add(qs[0],qs[1],qs[2],Yi[0],Yi[1],Yi[2],1,!0,!0,2,Bn),Qe.add(Yi[0],Yi[1],Yi[2],$s[0],$s[1],$s[2],1,!0,!0,2,Bn),Qe.add($s[0],$s[1],$s[2],Ps[0],Ps[1],Ps[2],1,!0,!0,2,Bn));const{isPurine:Zn,isPyrimidine:zn}=Ra(x,qn);Zn?(wa(Qn,x,qn),-1!==Qn.C1_1&&-1!==Qn.N9?(wt.invariantPosition(Qn.C1_1,Yi),wt.invariantPosition(Qn.N9,Zi),Qe.add(Zi[0],Zi[1],Zi[2],Yi[0],Yi[1],Yi[2],1,!0,!0,2,Bn)):-1!==Qn.N9&&-1!==Qn.trace&&(wt.invariantPosition(Qn.N9,Zi),wt.invariantPosition(Qn.trace,ms),Qe.add(Zi[0],Zi[1],Zi[2],ms[0],ms[1],ms[2],1,!0,!0,2,Bn)),qa(Qn)&&(wt.invariantPosition(Qn.N1,xi),wt.invariantPosition(Qn.C2,os),wt.invariantPosition(Qn.N3,is),wt.invariantPosition(Qn.C4,ki),wt.invariantPosition(Qn.C5,Hi),wt.invariantPosition(Qn.C6,ss),wt.invariantPosition(Qn.N7,Ys),wt.invariantPosition(Qn.C8,Xs),wt.invariantPosition(Qn.N9,Zi),Qe.add(Zi[0],Zi[1],Zi[2],Xs[0],Xs[1],Xs[2],1,!0,!0,2,Bn),Qe.add(Xs[0],Xs[1],Xs[2],Ys[0],Ys[1],Ys[2],1,!0,!0,2,Bn),Qe.add(Ys[0],Ys[1],Ys[2],Hi[0],Hi[1],Hi[2],1,!0,!0,2,Bn),Qe.add(Hi[0],Hi[1],Hi[2],ss[0],ss[1],ss[2],1,!0,!0,2,Bn),Qe.add(ss[0],ss[1],ss[2],xi[0],xi[1],xi[2],1,!0,!0,2,Bn),Qe.add(xi[0],xi[1],xi[2],os[0],os[1],os[2],1,!0,!0,2,Bn),Qe.add(os[0],os[1],os[2],is[0],is[1],is[2],1,!0,!0,2,Bn),Qe.add(is[0],is[1],is[2],ki[0],ki[1],ki[2],1,!0,!0,2,Bn),Qe.add(ki[0],ki[1],ki[2],Hi[0],Hi[1],Hi[2],1,!0,!0,2,Bn),Qe.add(ki[0],ki[1],ki[2],Zi[0],Zi[1],Zi[2],1,!0,!0,2,Bn))):zn&&(Fa(Qn,x,qn),-1!==Qn.C1_1&&-1!==Qn.N1?(wt.invariantPosition(Qn.N1,xi),wt.invariantPosition(Qn.C1_1,Yi),Qe.add(xi[0],xi[1],xi[2],Yi[0],Yi[1],Yi[2],1,!0,!0,2,Bn)):-1!==Qn.N1&&-1!==Qn.trace&&(wt.invariantPosition(Qn.N1,xi),wt.invariantPosition(Qn.trace,ms),Qe.add(xi[0],xi[1],xi[2],ms[0],ms[1],ms[2],1,!0,!0,2,Bn)),ec(Qn)&&(wt.invariantPosition(Qn.N1,xi),wt.invariantPosition(Qn.C2,os),wt.invariantPosition(Qn.N3,is),wt.invariantPosition(Qn.C4,ki),wt.invariantPosition(Qn.C5,Hi),wt.invariantPosition(Qn.C6,ss),Qe.add(xi[0],xi[1],xi[2],ss[0],ss[1],ss[2],1,!0,!0,2,Bn),Qe.add(ss[0],ss[1],ss[2],Hi[0],Hi[1],Hi[2],1,!0,!0,2,Bn),Qe.add(Hi[0],Hi[1],Hi[2],ki[0],ki[1],ki[2],1,!0,!0,2,Bn),Qe.add(ki[0],ki[1],ki[2],is[0],is[1],is[2],1,!0,!0,2,Bn),Qe.add(is[0],is[1],is[2],os[0],os[1],os[2],1,!0,!0,2,Bn),Qe.add(os[0],os[1],os[2],xi[0],xi[1],xi[2],1,!0,!0,2,Bn))),++Bn}}const Ln=Qe.getCylinders(),cr=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return Ln.setBoundingSphere(cr),Ln}function Pp(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x))return rr.e.createEmpty(Pe);const Ge=x.nucleotideElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{sizeFactor:Xe,radialSegments:Qe}=me,lt=Ge*(15*Qe),ft=lr.P.createState(lt,lt/4,Pe),{elements:wt,model:Ut,conformation:Jt}=x,{chainAtomSegments:gn,residueAtomSegments:Pn}=Ut.atomicHierarchy,{moleculeType:wn}=Ut.atomicHierarchy.derived.residue,Bn=Tt.hT.transientSegments(gn,wt),Mn=Tt.hT.transientSegments(Pn,wt),Ln={radiusTop:1*Xe,radiusBottom:1*Xe,radialSegments:Qe};let cr=0;for(;Bn.hasNext;)for(Mn.setSegment(Bn.move());Mn.hasNext;){const{index:Zn}=Mn.move();if((0,Tr.OV)(wn[Zn])){const zn={trace:-1,N1:-1,C2:-1,N3:-1,C4:-1,C5:-1,C6:-1,N7:-1,C8:-1,N9:-1,C1_1:-1,C2_1:-1,C3_1:-1,C4_1:-1,O4_1:-1};ft.currentGroup=cr,wc(zn,x,Zn),Fc(zn)&&(Jt.invariantPosition(zn.C1_1,Yi),Jt.invariantPosition(zn.C2_1,$s),Jt.invariantPosition(zn.C3_1,Ps),Jt.invariantPosition(zn.C4_1,Js),Jt.invariantPosition(zn.O4_1,qs),Jt.invariantPosition(zn.trace,ms),(0,_i.y9)(ft,Ps,ms,1,Ln),(0,_i.y9)(ft,Ps,Js,1,Ln),(0,_i.y9)(ft,Js,qs,1,Ln),(0,_i.y9)(ft,qs,Yi,1,Ln),(0,_i.y9)(ft,Yi,$s,1,Ln),(0,_i.y9)(ft,$s,Ps,1,Ln));const{isPurine:Lr,isPyrimidine:wr}=Ra(x,Zn);Lr?(wa(zn,x,Zn),-1!==zn.C1_1&&-1!==zn.N9?(Jt.invariantPosition(zn.C1_1,Yi),Jt.invariantPosition(zn.N9,Zi),(0,_i.y9)(ft,Zi,Yi,1,Ln)):-1!==zn.N9&&-1!==zn.trace&&(Jt.invariantPosition(zn.N9,Zi),Jt.invariantPosition(zn.trace,ms),(0,_i.y9)(ft,Zi,ms,1,Ln)),qa(zn)&&(Jt.invariantPosition(zn.N1,xi),Jt.invariantPosition(zn.C2,os),Jt.invariantPosition(zn.N3,is),Jt.invariantPosition(zn.C4,ki),Jt.invariantPosition(zn.C5,Hi),Jt.invariantPosition(zn.C6,ss),Jt.invariantPosition(zn.N7,Ys),Jt.invariantPosition(zn.C8,Xs),Jt.invariantPosition(zn.N9,Zi),(0,_i.y9)(ft,Zi,Xs,1,Ln),(0,_i.y9)(ft,Xs,Ys,1,Ln),(0,_i.y9)(ft,Ys,Hi,1,Ln),(0,_i.y9)(ft,Hi,ss,1,Ln),(0,_i.y9)(ft,ss,xi,1,Ln),(0,_i.y9)(ft,xi,os,1,Ln),(0,_i.y9)(ft,os,is,1,Ln),(0,_i.y9)(ft,is,ki,1,Ln),(0,_i.y9)(ft,ki,Hi,1,Ln),(0,_i.y9)(ft,ki,Zi,1,Ln))):wr&&(Fa(zn,x,Zn),-1!==zn.C1_1&&-1!==zn.N1?(Jt.invariantPosition(zn.N1,xi),Jt.invariantPosition(zn.C1_1,Yi),(0,_i.y9)(ft,xi,Yi,1,Ln)):-1!==zn.N1&&-1!==zn.trace&&(Jt.invariantPosition(zn.N1,xi),Jt.invariantPosition(zn.trace,ms),(0,_i.y9)(ft,xi,ms,1,Ln)),ec(zn)&&(Jt.invariantPosition(zn.N1,xi),Jt.invariantPosition(zn.C2,os),Jt.invariantPosition(zn.N3,is),Jt.invariantPosition(zn.C4,ki),Jt.invariantPosition(zn.C5,Hi),Jt.invariantPosition(zn.C6,ss),(0,_i.y9)(ft,xi,ss,1,Ln),(0,_i.y9)(ft,ss,Hi,1,Ln),(0,_i.y9)(ft,Hi,ki,1,Ln),(0,_i.y9)(ft,ki,is,1,Ln),(0,_i.y9)(ft,is,os,1,Ln),(0,_i.y9)(ft,os,xi,1,Ln))),++cr}}const qn=lr.P.getMesh(ft),Qn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return qn.setBoundingSphere(Qn),qn}const cc=(0,g.eB)(),Rs=(0,g.eB)(),Ls=(0,g.eB)(),ws=(0,g.eB)(),Fs=(0,g.eB)(),Ds=(0,g.eB)(),Ns=(0,g.eB)(),uc=(0,g.eB)(),lc=(0,g.eB)(),dc=(0,g.eB)(),fc=(0,g.eB)(),mc=(0,g.eB)(),pc=(0,g.eB)(),hc=(0,g.eB)(),gc=(0,g.eB)(),il={...tr.Te,...tr.qg,sizeFactor:v.t.Numeric(.3,{min:0,max:10,step:.01}),detail:v.t.Numeric(0,{min:0,max:3,step:1},Jn.iy.CustomQualityParamInfo),tryUseImpostor:v.t.Boolean(!0)};function Bp(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth?function Mp(oe){return(0,tr.uF)({defaultProps:v.t.getDefaultValues(il),createGeometry:Dp,createLocationIterator:sa.fromGroup,getLoci:Ma,eachLocation:Oa,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function Rp(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(il),createGeometry:Op,createLocationIterator:sa.fromGroup,getLoci:Ma,eachLocation:Oa,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}function Dp(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x))return Qr.v.createEmpty(Pe);const Ge=x.nucleotideElements.length;if(!Ge)return Qr.v.createEmpty(Pe);const Xe=15*Ge,Qe=Bi.create(Xe,Xe/4,Pe),{elements:lt,model:ft,conformation:wt}=x,{chainAtomSegments:Ut,residueAtomSegments:Jt}=ft.atomicHierarchy,{moleculeType:gn}=ft.atomicHierarchy.derived.residue,Pn=Tt.hT.transientSegments(Ut,lt),wn=Tt.hT.transientSegments(Jt,lt);let Bn=0;for(;Pn.hasNext;)for(wn.setSegment(Pn.move());wn.hasNext;){const{index:cr}=wn.move();if((0,Tr.OV)(gn[cr])){const qn={trace:-1,N1:-1,C2:-1,N3:-1,C4:-1,C5:-1,C6:-1,N7:-1,C8:-1,N9:-1,C1_1:-1,C2_1:-1,C3_1:-1,C4_1:-1,O4_1:-1};wc(qn,x,cr),Fc(qn)&&(wt.invariantPosition(qn.C1_1,fc),wt.invariantPosition(qn.C2_1,mc),wt.invariantPosition(qn.C3_1,pc),wt.invariantPosition(qn.C4_1,hc),wt.invariantPosition(qn.O4_1,gc),wt.invariantPosition(qn.trace,cc),Qe.add(cc[0],cc[1],cc[2],Bn),Qe.add(pc[0],pc[1],pc[2],Bn),Qe.add(hc[0],hc[1],hc[2],Bn),Qe.add(gc[0],gc[1],gc[2],Bn),Qe.add(fc[0],fc[1],fc[2],Bn),Qe.add(mc[0],mc[1],mc[2],Bn));const{isPurine:Qn,isPyrimidine:Zn}=Ra(x,cr);Qn?(wa(qn,x,cr),qa(qn)&&(wt.invariantPosition(qn.N1,Rs),wt.invariantPosition(qn.C2,Ls),wt.invariantPosition(qn.N3,ws),wt.invariantPosition(qn.C4,Fs),wt.invariantPosition(qn.C5,Ds),wt.invariantPosition(qn.C6,Ns),wt.invariantPosition(qn.N7,uc),wt.invariantPosition(qn.C8,lc),wt.invariantPosition(qn.N9,dc),Qe.add(dc[0],dc[1],dc[2],Bn),Qe.add(lc[0],lc[1],lc[2],Bn),Qe.add(uc[0],uc[1],uc[2],Bn),Qe.add(Ds[0],Ds[1],Ds[2],Bn),Qe.add(Ns[0],Ns[1],Ns[2],Bn),Qe.add(Rs[0],Rs[1],Rs[2],Bn),Qe.add(Ls[0],Ls[1],Ls[2],Bn),Qe.add(ws[0],ws[1],ws[2],Bn),Qe.add(Fs[0],Fs[1],Fs[2],Bn))):Zn&&(Fa(qn,x,cr),ec(qn)&&(wt.invariantPosition(qn.N1,Rs),wt.invariantPosition(qn.C2,Ls),wt.invariantPosition(qn.N3,ws),wt.invariantPosition(qn.C4,Fs),wt.invariantPosition(qn.C5,Ds),wt.invariantPosition(qn.C6,Ns),Qe.add(Rs[0],Rs[1],Rs[2],Bn),Qe.add(Ns[0],Ns[1],Ns[2],Bn),Qe.add(Ds[0],Ds[1],Ds[2],Bn),Qe.add(Fs[0],Fs[1],Fs[2],Bn),Qe.add(ws[0],ws[1],ws[2],Bn),Qe.add(Ls[0],Ls[1],Ls[2],Bn))),++Bn}}const Mn=Qe.getSpheres(),Ln=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return Mn.setBoundingSphere(Ln),Mn}function Op(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x))return rr.e.createEmpty(Pe);const Ge=x.nucleotideElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{sizeFactor:Xe,detail:Qe}=me,lt=Ge*(0,zr.J)(Qe),ft=lr.P.createState(lt,lt/2,Pe),{elements:wt,model:Ut,conformation:Jt}=x,{chainAtomSegments:gn,residueAtomSegments:Pn}=Ut.atomicHierarchy,{moleculeType:wn}=Ut.atomicHierarchy.derived.residue,Bn=Tt.hT.transientSegments(gn,wt),Mn=Tt.hT.transientSegments(Pn,wt),Ln=1*Xe;let cr=0;for(;Bn.hasNext;)for(Mn.setSegment(Bn.move());Mn.hasNext;){const{index:Zn}=Mn.move();if((0,Tr.OV)(wn[Zn])){const zn={trace:-1,N1:-1,C2:-1,N3:-1,C4:-1,C5:-1,C6:-1,N7:-1,C8:-1,N9:-1,C1_1:-1,C2_1:-1,C3_1:-1,C4_1:-1,O4_1:-1};ft.currentGroup=cr,wc(zn,x,Zn),Fc(zn)&&(Jt.invariantPosition(zn.C1_1,fc),Jt.invariantPosition(zn.C2_1,mc),Jt.invariantPosition(zn.C3_1,pc),Jt.invariantPosition(zn.C4_1,hc),Jt.invariantPosition(zn.O4_1,gc),Jt.invariantPosition(zn.trace,cc),(0,kr.X)(ft,cc,Ln,Qe),(0,kr.X)(ft,hc,Ln,Qe),(0,kr.X)(ft,gc,Ln,Qe),(0,kr.X)(ft,fc,Ln,Qe),(0,kr.X)(ft,mc,Ln,Qe),(0,kr.X)(ft,pc,Ln,Qe));const{isPurine:Lr,isPyrimidine:wr}=Ra(x,Zn);Lr?(wa(zn,x,Zn),qa(zn)&&(Jt.invariantPosition(zn.N1,Rs),Jt.invariantPosition(zn.C2,Ls),Jt.invariantPosition(zn.N3,ws),Jt.invariantPosition(zn.C4,Fs),Jt.invariantPosition(zn.C5,Ds),Jt.invariantPosition(zn.C6,Ns),Jt.invariantPosition(zn.N7,uc),Jt.invariantPosition(zn.C8,lc),Jt.invariantPosition(zn.N9,dc),(0,kr.X)(ft,lc,Ln,Qe),(0,kr.X)(ft,uc,Ln,Qe),(0,kr.X)(ft,Ds,Ln,Qe),(0,kr.X)(ft,Ns,Ln,Qe),(0,kr.X)(ft,Rs,Ln,Qe),(0,kr.X)(ft,Ls,Ln,Qe),(0,kr.X)(ft,ws,Ln,Qe),(0,kr.X)(ft,Fs,Ln,Qe),(0,kr.X)(ft,Ds,Ln,Qe),(0,kr.X)(ft,dc,Ln,Qe))):wr&&(Fa(zn,x,Zn),ec(zn)&&(Jt.invariantPosition(zn.N1,Rs),Jt.invariantPosition(zn.C2,Ls),Jt.invariantPosition(zn.N3,ws),Jt.invariantPosition(zn.C4,Fs),Jt.invariantPosition(zn.C5,Ds),Jt.invariantPosition(zn.C6,Ns),(0,kr.X)(ft,Ns,Ln,Qe),(0,kr.X)(ft,Ds,Ln,Qe),(0,kr.X)(ft,Fs,Ln,Qe),(0,kr.X)(ft,ws,Ln,Qe),(0,kr.X)(ft,Ls,Ln,Qe),(0,kr.X)(ft,Rs,Ln,Qe))),++cr}}const qn=lr.P.getMesh(ft),Qn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return qn.setBoundingSphere(Qn),qn}const Na=g.eB.zero(),yc=g.eB.zero(),Ua=g.eB.zero(),Wd=g.eB.zero(),ts=(0,Di.n)(3,!1);let sl;const Va=g.$I.identity(),Fp=g.eB.zero(),Qd=g.eB.zero(),Kd=g.eB.zero(),cl=g.eB.zero(),Np=4,Up=4,Vp=6,Gp=function wp(){return sl||(sl=function Lp(){const oe=(0,zo.nT)(8);for(let x=0;x<3;++x){const F=(x+1)%3;g.eB.set(Na,ts[3*x],ts[3*x+1],-.5),g.eB.set(yc,ts[3*F],ts[3*F+1],-.5),g.eB.set(Ua,ts[3*F],ts[3*F+1],.5),g.eB.set(Wd,ts[3*x],ts[3*x+1],.5),oe.add(Na,yc,Ua),oe.add(Ua,Wd,Na)}return g.eB.set(Na,ts[0],ts[1],-.5),g.eB.set(yc,ts[3],ts[4],-.5),g.eB.set(Ua,ts[6],ts[7],-.5),oe.add(Ua,yc,Na),g.eB.set(Na,ts[0],ts[1],.5),g.eB.set(yc,ts[3],ts[4],.5),g.eB.set(Ua,ts[6],ts[7],.5),oe.add(Na,yc,Ua),oe.getPrimitive()}()),sl}(),Zd={sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01})};function zp(oe,x,F,z,me,Pe){const Ge=x.polymerElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{sizeFactor:Xe}=me,Qe=24*Ge,lt=lr.P.createState(Qe,Qe/10,Pe),wt=ju(1),{normalVectors:Ut,binormalVectors:Jt}=wt;let gn=0;const Pn=zu(x,F);for(;Pn.hasNext;){const Mn=Pn.move();lt.currentGroup=gn;const Ln=(0,Tr.OV)(Mn.moleculeType),cr=Tr.gG.is(Mn.secStrucType,4);if(Wu(wt,Mn,Ln||cr?.5:.9,Ln?.3:.5),cr&&!Mn.secStrucLast||!cr){const Zn=z.size.size(Mn.center)*Xe,zn=Np*Zn,Lr=Up*Zn,wr=Vp*Zn,to=Ln?Jt:Ut;g.eB.fromArray(Qd,to,0),g.eB.fromArray(Kd,to,3),g.eB.normalize(cl,g.eB.add(cl,Qd,Kd)),g.$I.targetTo(Va,Mn.p3,Mn.p1,cl),g.$I.mul(Va,Va,g.$I.rotY90Z180),g.$I.scale(Va,Va,g.eB.set(Fp,wr,Lr,zn)),g.$I.setTranslation(Va,Mn.p2),lr.P.addPrimitive(lt,Va,Gp)}++gn}const wn=lr.P.getMesh(lt),Bn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return wn.setBoundingSphere(Bn),wn}v.t.getDefaultValues(Zd);const Yd={...tr.Te,...Zd};function kp(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(Yd),createGeometry:zp,createLocationIterator:x=>ia.fromGroup(x),getLoci:Ba,eachLocation:Da,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor}},oe)}const ul=10,Xd={sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01}),radialSegments:v.t.Numeric(16,{min:2,max:56,step:2},Jn.iy.CustomQualityParamInfo)};function Hp(oe,x,F,z,me,Pe){const Ge=x.gapElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{sizeFactor:Xe,radialSegments:Qe}=me,lt=ul*Qe*2*Ge*2,ft=lr.P.createState(lt,lt/10,Pe),wt=(0,g.eB)(),Ut=(0,g.eB)(),Jt={radiusTop:1,radiusBottom:1,topCap:!0,bottomCap:!0,radialSegments:Qe};let gn=0;const Pn=function Om(oe,x){switch(x.kind){case 0:return new Rm(oe,x);case 1:case 2:return new Lm(oe,x)}}(F,x);for(;Pn.hasNext;){const{centerA:Mn,centerB:Ln}=Pn.move();Mn.element===Ln.element||(x.conformation.invariantPosition(Mn.element,wt),x.conformation.invariantPosition(Ln.element,Ut),Jt.radiusTop=Jt.radiusBottom=z.size.size(Mn)*Xe,ft.currentGroup=gn,(0,_i.GH)(ft,wt,Ut,.5,ul,!1,Jt),Jt.radiusTop=Jt.radiusBottom=z.size.size(Ln)*Xe,ft.currentGroup=gn+1,(0,_i.GH)(ft,Ut,wt,.5,ul,!1,Jt)),gn+=2}const wn=lr.P.getMesh(ft),Bn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return wn.setBoundingSphere(Bn),wn}v.t.getDefaultValues(Xd);const xu={...tr.Te,...Xd};function ll(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(xu),createGeometry:Hp,createLocationIterator:$u.fromGroup,getLoci:$m,eachLocation:Jm,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.radialSegments!==z.radialSegments}},oe)}const oi=(0,g.eB)(),di=(0,g.eB)(),jp=(0,g.eB)(),Ms=(0,g.eB)(),ea=(0,g.eB)(),Cu=(0,g.eB)(),Su=(0,g.eB)(),Uc=(0,g.eB)(),Ws=(0,g.eB)(),ta=(0,g.eB)(),dl=(0,g.eB)(),ya=(0,g.eB)(),va=(0,g.eB)(),_a=(0,g.eB)(),ba=(0,g.eB)(),Us=g.eB.fromArray,vc=g.eB.scale,Vs=g.eB.add,aa=g.eB.sub,Wp=g.eB.magnitude,$d=g.eB.negate,fl=g.eB.copy,Jd=g.eB.cross,Qp=g.eB.set,yi=ce.Gm.add3,Kp=ce.Gm.add;function Eu(oe,x,F,z,me,Pe,Ge,Xe,Qe){const{vertices:lt,normals:ft,indices:wt}=x,Ut=lt.elementCount;if(Us(oi,z,oe),vc(Su,oi,Ge),vc(Cu,oi,Xe),Us(di,me,oe),vc(Ms,di,Pe),Jd(ta,di,oi),Us(Ws,F,oe),Vs(ya,Vs(ya,Ws,Ms),Cu),aa(va,Vs(va,Ws,Ms),Su),aa(_a,aa(_a,Ws,Ms),Su),Vs(ba,aa(ba,Ws,Ms),Cu),Ge0?(Us(oi,x,0),Us(di,x,3*me),wn=Xe/Wp(aa(jp,di,oi))):Qp(Uc,0,0,0);for(let Mn=0;Mn<=me;++Mn){const Ln=Pe[Mn],qn=0===Xe?Ge[Mn]:Xe*(1-Mn/me),Qn=3*Mn;Us(ea,F,Qn),vc(ea,ea,qn),Us(Ms,z,Qn),vc(Ms,Ms,Ln),Xe>0&&(Us(oi,F,Qn),Us(di,z,Qn),vc(Uc,Jd(Uc,oi,di),wn)),Us(Ws,x,Qn),Us(ta,F,Qn),Us(dl,z,Qn),Vs(oi,Vs(oi,Ws,Ms),ea),Vs(di,ta,Uc),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2]),Vs(oi,aa(oi,Ws,Ms),ea),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2]),$d(di,dl),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2]),aa(oi,aa(oi,Ws,Ms),ea),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2]),Vs(di,$d(di,ta),Uc),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2]),aa(oi,Vs(oi,Ws,Ms),ea),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2]),fl(di,dl),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2]),Vs(oi,Vs(oi,Ws,Ms),ea),yi(wt,oi[0],oi[1],oi[2]),yi(Ut,di[0],di[1],di[2])}for(let Mn=0;Mn0){const Mn=Pe[0],Ln=Ge[0];Eu(0,oe,x,F,z,Mn,Xe,-Ln,!1),Eu(0,oe,x,F,z,Mn,-Xe,Ln,!1)}if(lt&&0===Xe){const Ln=Ge[me];Eu(3*me,oe,x,F,z,Pe[me],Ln,Ln,!0)}for(let Mn=0,Ln=8*(me+1)+(Qe?4:Xe>0?8:0)+(lt&&0===Xe?4:0);MnLr;for(let Cr=0;Cr=cr?wr-Lr:-wr+Lr:Cr>=Ln&&CrLr;to&&(wr-=Lr),wn=Ut.elementCount;for(let Cr=0;Cr=cr?wr:-wr)):_c(ns,ps,xs,Is,wr*Bn[Cr],Lr*Mn[Cr]),Cs(Ut,ns[0],ns[1],ns[2]),Cs(Jt,ji[0],ji[1],ji[2]),Cs(gn,wn+(Cr+1)%Pe,wn+Cr,zn)}if(lt){const Zn=3*me,zn=Ut.elementCount;ca(ps,F,Zn),ca(xs,z,Zn),ca(Is,x,Zn),qd(ji,ps,xs),Cs(Ut,Is[0],Is[1],Is[2]),Cs(Jt,ji[0],ji[1],ji[2]);const Lr=Ge[me];let wr=Xe[me];const to="rounded"===ft&&wr>Lr;to&&(wr-=Lr),wn=Ut.elementCount;for(let Cr=0;Cr=cr?wr:-wr)):_c(ns,ps,xs,Is,wr*Bn[Cr],Lr*Mn[Cr]),Cs(Ut,ns[0],ns[1],ns[2]),Cs(Jt,ji[0],ji[1],ji[2]),Cs(gn,wn+Cr,wn+(Cr+1)%Pe,zn)}ce.Gm.addRepeat(Pn,(me+1)*Pe+(Qe?Pe+1:0)+(lt?Pe+1:0),wt)}const ua=g.eB.fromArray,Jp=g.eB.magnitude,gl=g.eB.sub,ef=g.eB.add,yl=g.eB.scale,qp=g.eB.negate,eh=g.eB.copy,th=g.eB.cross,Gs=ce.Gm.add3,nh=ce.Gm.add,as=(0,g.eB)(),hs=(0,g.eB)(),rh=(0,g.eB)(),vl=(0,g.eB)(),Ga=(0,g.eB)(),tf=(0,g.eB)(),Vc=(0,g.eB)(),oh=(0,g.eB)(),_l=(0,g.eB)();function Pu(oe,x,F,z,me,Pe,Ge,Xe){const{currentGroup:Qe,vertices:lt,normals:ft,indices:wt,groups:Ut}=oe,Jt=lt.elementCount;let gn=0;Xe>0&&(ua(as,x,0),ua(hs,x,3*me),gn=Xe/Jp(gl(rh,hs,as)));for(let wn=0;wn<=me;++wn){const Bn=Pe[wn],Ln=0===Xe?Ge[wn]:Xe*(1-wn/me),cr=3*wn;ua(Ga,F,cr),yl(Ga,Ga,Ln),ua(vl,z,cr),yl(vl,vl,Bn),Xe>0&&(ua(as,F,cr),ua(hs,z,cr),yl(tf,th(tf,as,hs),gn)),ua(Vc,x,cr),ua(oh,F,cr),ua(_l,z,cr),ef(as,Vc,Ga),qp(hs,_l),Gs(lt,as[0],as[1],as[2]),Gs(ft,hs[0],hs[1],hs[2]),gl(as,Vc,Ga),Gs(lt,as[0],as[1],as[2]),Gs(ft,hs[0],hs[1],hs[2]),ef(as,Vc,Ga),eh(hs,_l),Gs(lt,as[0],as[1],as[2]),Gs(ft,hs[0],hs[1],hs[2]),gl(as,Vc,Ga),Gs(lt,as[0],as[1],as[2]),Gs(ft,hs[0],hs[1],hs[2])}for(let wn=0;wnia.fromGroup(x,{asSecondary:!0}),getLoci:Ba,eachLocation:Da,setUpdateState:(x,F,z,me,Pe,Ge,Xe)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.tubularHelices!==z.tubularHelices||F.detail!==z.detail||F.linearSegments!==z.linearSegments||F.radialSegments!==z.radialSegments||F.aspectRatio!==z.aspectRatio||F.arrowFactor!==z.arrowFactor||F.helixProfile!==z.helixProfile||F.nucleicProfile!==z.nucleicProfile;const Qe=Yc.v.get(Ge.structure).version;x.info.secondaryStructureHash!==Qe&&(void 0!==x.info.secondaryStructureHash&&(x.createGeometry=!0),x.info.secondaryStructureHash=Qe)}},oe)}const of={"polymer-trace":(oe,x)=>(0,vn.T)("Polymer trace mesh",oe,x,sh),"polymer-gap":(oe,x)=>(0,vn.T)("Polymer gap cylinder",oe,x,ll),"nucleotide-block":(oe,x)=>(0,vn.T)("Nucleotide block mesh",oe,x,op),"nucleotide-ring":(oe,x)=>(0,vn.T)("Nucleotide ring mesh",oe,x,fp),"nucleotide-atomic-ring-fill":(oe,x)=>(0,vn.T)("Nucleotide atomic ring fill",oe,x,Sp),"nucleotide-atomic-bond":(oe,x)=>(0,vn.T)("Nucleotide atomic bond",oe,x,Ep),"nucleotide-atomic-element":(oe,x)=>(0,vn.T)("Nucleotide atomic element",oe,x,Bp),"direction-wedge":(oe,x)=>(0,vn.T)("Polymer direction wedge",oe,x,kp)},sf={...rf,...xu,...Md,...Nd,...ol,...il,...Hd,...Yd,sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01}),visuals:v.t.MultiSelect(["polymer-trace","polymer-gap","nucleotide-ring","nucleotide-atomic-ring-fill","nucleotide-atomic-bond","nucleotide-atomic-element"],v.t.objectToOptions(of)),bumpFrequency:v.t.Numeric(2,{min:0,max:10,step:.1},Jn.iy.ShadingCategory),colorMode:v.t.Select("default",v.t.arrayToOptions(["default","interpolate"]),{...Jn.iy.ShadingCategory,isHidden:!0})},uh=(0,pr.GT)({name:"cartoon",label:"Cartoon",description:"Displays ribbons, planks, tubes smoothly following the trace atoms of polymers.",factory:function ch(oe,x){return dr.YL.createMulti("Cartoon",oe,x,pr.J1,of)},getParams:function ah(oe,x){const F=v.t.clone(sf);let z=!1,me=!1;return x.units.forEach(Pe=>{!z&&Je.Nf.isAtomic(Pe)&&Pe.nucleotideElements.length&&(z=!0),!me&&Pe.gapElements.length&&(me=!0)}),F.visuals.defaultValue=["polymer-trace"],z&&F.visuals.defaultValue.push("nucleotide-ring"),me&&F.visuals.defaultValue.push("polymer-gap"),F},defaultValues:v.t.getDefaultValues(sf),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:oe=>oe.polymerResidueCount>0,ensureCustomProperties:{attach:function(){var oe=(0,r.A)(function*(x,F){yield Yc.v.attach(x,F,void 0,!0);for(const z of F.models)yield Gu.attach(x,z,void 0,!0)});return function(F,z){return oe.apply(this,arguments)}}(),detach:oe=>{Yc.v.ref(oe,!1);for(const x of oe.models)Gu.ref(x,!1)}}});var af=n(4777),cf=n(8593),bc=n(2028);const uf={...tr.Te,sizeFactor:v.t.Numeric(1,{min:0,max:10,step:.1}),detail:v.t.Numeric(0,{min:0,max:3,step:1},Jn.iy.CustomQualityParamInfo),ignoreHydrogens:v.t.Boolean(!1)};function lh(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(uf),createGeometry:dh,createLocationIterator:sr.fromGroup,getLoci:Ht,eachLocation:ln,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail||F.ignoreHydrogens!==z.ignoreHydrogens}},oe)}function dh(oe,x,F,z,me,Pe){const{child:Ge}=F,Xe=Ge?.unitMap.get(x.id);if(Ge&&!Xe)return rr.e.createEmpty(Pe);const{detail:Qe,sizeFactor:lt,ignoreHydrogens:ft}=me,{elements:wt,model:Ut}=x,{atomicNumber:Jt}=x.model.atomicHierarchy.derived.atom,gn=wt.length,Pn=gn*(0,zr.J)(Qe),wn=lr.P.createState(Pn,Pn/2,Pe),Bn=cf._.Provider.get(Ut);if(!Bn)return rr.e.createEmpty(Pe);const Mn=(0,g.eB)(),Ln=(0,g.U)(),cr=(0,g.eB)(),qn=(0,g.eB)(),Qn=(0,g.eB)(),{elementToAnsiotrop:Zn,data:zn}=Bn,{U:Lr}=zn,wr=zn._schema.U.space,to=x.conformation,Cr=Je.iZ.Location.create(F);Cr.unit=x;for(let wo=0;wo(0,pr.TP)("Ellipsoid Mesh",oe,x,lh),"intra-bond":(oe,x)=>(0,pr.TP)("Intra-unit bond cylinder",oe,x,mi),"inter-bond":(oe,x)=>(0,pr.Kp)("Inter-unit bond cylinder",oe,x,Hn)},df={...uf,...Ci,...Qi,includeParent:v.t.Boolean(!1),adjustCylinderLength:v.t.Boolean(!1,{isHidden:!0}),unitKinds:(0,Rr.R8)(["atomic"]),sizeFactor:v.t.Numeric(1,{min:.01,max:10,step:.01}),sizeAspectRatio:v.t.Numeric(.1,{min:.01,max:3,step:.01}),linkCap:v.t.Boolean(!0),visuals:v.t.MultiSelect(["ellipsoid-mesh","intra-bond","inter-bond"],v.t.objectToOptions(lf)),bumpFrequency:v.t.Numeric(0,{min:0,max:10,step:.1},Jn.iy.ShadingCategory)},ph=(0,pr.GT)({name:"ellipsoid",label:"Ellipsoid",description:"Displays anisotropic displacement ellipsoids of atomic elements plus bonds as cylinders.",factory:function mh(oe,x){return dr.YL.createMulti("Ellipsoid",oe,x,pr.J1,lf)},getParams:function fh(oe,x){return df},defaultValues:v.t.getDefaultValues(df),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:oe=>oe.elementCount>0&&oe.models.some(x=>cf._.Provider.isApplicable(x)),getData:(oe,x)=>x.includeParent?oe.asParent():oe,mustRecreate:(oe,x)=>oe.includeParent!==x.includeParent});var hh=n(9421),gh=(n(4951),n(2897)),yh=n(4143),cs=n(4511);const vh="\nprecision highp float;\n\nattribute vec3 aPosition;\nattribute float aRadius;\n\nvarying vec3 vPosition;\nvarying float vRadiusSqInv;\n\n#if defined(dCalcType_groupId)\n attribute float aGroup;\n varying float vGroup;\n#endif\n\nuniform vec3 uBboxSize;\nuniform vec3 uBboxMin;\nuniform float uResolution;\n\nvoid main() {\n vRadiusSqInv = 1.0 / (aRadius * aRadius);\n #if defined(dCalcType_groupId)\n vGroup = aGroup;\n #endif\n gl_PointSize = ceil(((aRadius * 3.0) / uResolution) + uResolution);\n vPosition = (aPosition - uBboxMin) / uResolution;\n gl_Position = vec4(((aPosition - uBboxMin) / uBboxSize) * 2.0 - 1.0, 1.0);\n}\n",_h="\nprecision highp float;\n\nvarying vec3 vPosition;\nvarying float vRadiusSqInv;\n#if defined(dCalcType_groupId)\n #if defined(dGridTexType_2d)\n precision highp sampler2D;\n uniform sampler2D tMinDistanceTex;\n uniform vec3 uGridTexDim;\n #elif defined(dGridTexType_3d)\n precision highp sampler3D;\n uniform sampler3D tMinDistanceTex;\n #endif\n varying float vGroup;\n#endif\n\n#include common\n\nuniform vec3 uGridDim;\nuniform vec2 uGridTexScale;\nuniform float uCurrentSlice;\nuniform float uCurrentX;\nuniform float uCurrentY;\nuniform float uAlpha;\nuniform float uResolution;\nuniform float uRadiusFactorInv;\n\nvoid main() {\n vec2 v = gl_FragCoord.xy - vec2(uCurrentX, uCurrentY) - 0.5;\n vec3 fragPos = vec3(v.x, v.y, uCurrentSlice);\n float dist = distance(fragPos, vPosition) * uResolution;\n\n #if defined(dCalcType_density)\n float density = exp(-uAlpha * ((dist * dist) * vRadiusSqInv));\n gl_FragColor.a = density * uRadiusFactorInv;\n #elif defined(dCalcType_minDistance)\n gl_FragColor.a = 1.0 - dist * uRadiusFactorInv;\n #elif defined(dCalcType_groupId)\n #if defined(dGridTexType_2d)\n float minDistance = 1.0 - texture2D(tMinDistanceTex, (gl_FragCoord.xy) / (uGridTexDim.xy / uGridTexScale)).a;\n #elif defined(dGridTexType_3d)\n float minDistance = 1.0 - texelFetch(tMinDistanceTex, ivec3(gl_FragCoord.xy, uCurrentSlice), 0).a;\n #endif\n if (dist * uRadiusFactorInv > minDistance + uResolution * 0.05)\n discard;\n gl_FragColor.rgb = packIntToRGB(vGroup);\n #endif\n}\n",bh={drawCount:(0,cs.Xb)("number"),instanceCount:(0,cs.Xb)("number"),aRadius:(0,cs.Yz)("float32",1,0),aPosition:(0,cs.Yz)("float32",3,0),aGroup:(0,cs.Yz)("float32",1,0),uCurrentSlice:(0,cs.w5)("f"),uCurrentX:(0,cs.w5)("f"),uCurrentY:(0,cs.w5)("f"),uBboxMin:(0,cs.w5)("v3","material"),uBboxSize:(0,cs.w5)("v3","material"),uGridDim:(0,cs.w5)("v3","material"),uGridTexDim:(0,cs.w5)("v3","material"),uGridTexScale:(0,cs.w5)("v2","material"),uAlpha:(0,cs.w5)("f","material"),uResolution:(0,cs.w5)("f","material"),uRadiusFactorInv:(0,cs.w5)("f","material"),tMinDistanceTex:(0,cs.$G)("texture","rgba","float","nearest","material"),dGridTexType:(0,cs.$F)("string",["2d","3d"]),dCalcType:(0,cs.$F)("string",["density","minDistance","groupId"])},na="gaussian-density";function bl(oe){return oe.namedFramebuffers[na]||(oe.namedFramebuffers[na]=oe.resources.framebuffer()),oe.namedFramebuffers[na]}function xl(oe,x,F,z,me,Pe){const Ge=`${na}-${oe}`;return x.namedTextures[Ge]||(x.namedTextures[Ge]=x.resources.texture(F,z,me,Pe)),x.namedTextures[Ge]}function ff(oe,x,F,z,me,Pe){return oe.isWebGL2?function xh(oe,x,F,z,me,Pe){se.g$&&oe.timer.mark("GaussianDensityTexture3d");const Ge=function Ch(oe,x,F,z,me,Pe){const{gl:Ge,resources:Xe,state:Qe,extensions:{colorBufferFloat:lt,textureFloat:ft,colorBufferHalfFloat:wt,textureHalfFloat:Ut}}=oe,{smoothness:Jt,resolution:gn}=me,{drawCount:Pn,positions:wn,radii:Bn,groups:Mn,scale:Ln,expandedBox:cr,dim:qn,maxRadius:Qn}=gf(x,F,z,me),[Zn,zn,Lr]=qn,wr=xl("min-dist-3d",oe,"volume-uint8","rgba","ubyte","nearest");wr.define(Zn,zn,Lr);const to=g.ZY.create(1,1),Cr=2*Qn,Zr=yf(oe,Pn,wn,Bn,Mn,wr,cr,qn,qn,to,Jt,gn,Cr),{uCurrentSlice:Io}=Zr.values,wo=bl(oe);function si(Ii,ai){Qe.currentRenderItemId=-1;for(let li=0;li=Io&&(Xi-=Io,vs+=wr,As=0,G.IQ.update($o,vs)),G.IQ.update(Ko,As),G.IQ.update(Qo,xa),lt.viewport(As,vs,Lr,wr),lt.scissor(As,vs,Lr,wr),go.render(),++Xi,As+=Lr;Xe.flush()}return fi.bind(),vf(oe),Ge||(Ge=Ut&&Jt?Qe.texture("image-float16","rgba","fp16","linear"):ft&&wt?Qe.texture("image-float32","rgba","float","linear"):Qe.texture("image-uint8","rgba","ubyte","linear")),Ge.define(li,Vo),bf(oe,go),Zo(Ge,!0),gn&&(_f(oe,go),Zo(jo,!0),xf(oe,go),Zo(Ge,!1)),{texture:Ge,scale:qn,bbox:Qn,gridDim:Zn,gridTexDim:si,gridTexScale:Ii,radiusFactor:ai,resolution:wn,maxRadius:zn}}(oe,x,F,z,me,Pe,Ge);return se.g$&&oe.timer.markEnd("GaussianDensityTexture2d"),mf(Xe)}function mf({texture:oe,scale:x,bbox:F,gridDim:z,gridTexDim:me,gridTexScale:Pe,radiusFactor:Ge,resolution:Xe,maxRadius:Qe}){return{transform:pf(x,F),texture:oe,bbox:F,gridDim:z,gridTexDim:me,gridTexScale:Pe,radiusFactor:Ge,resolution:Xe,maxRadius:Qe}}function pf(oe,x){const F=g.$I.identity();return g.$I.fromScaling(F,oe),g.$I.setTranslation(F,x.min),F}function gf(oe,x,F,z){const{resolution:me,radiusOffset:Pe}=z,Ge=1/me,{indices:Xe,x:Qe,y:lt,z:ft,id:wt}=oe,Ut=Tt.CD.size(Xe),Jt=new Float32Array(3*Ut),gn=new Float32Array(Ut),Pn=new Float32Array(Ut);let wn=0;for(let Qn=0;Qn0?"3d":"2d"),G.IQ.updateIfChanged(gn.dCalcType,"density"),oe.namedComputeRenderables[na].update()}else oe.namedComputeRenderables[na]=function Sh(oe,x,F,z,me,Pe,Ge,Xe,Qe,lt,ft,wt,Ut){const Jt=g.eB.sub((0,g.eB)(),Ge.max,Ge.min),gn={drawCount:G.IQ.create(x),instanceCount:G.IQ.create(1),aRadius:G.IQ.create(z),aPosition:G.IQ.create(F),aGroup:G.IQ.create(me),uCurrentSlice:G.IQ.create(0),uCurrentX:G.IQ.create(0),uCurrentY:G.IQ.create(0),uBboxMin:G.IQ.create(Ge.min),uBboxSize:G.IQ.create(Jt),uGridDim:G.IQ.create(Xe),uGridTexDim:G.IQ.create(Qe),uGridTexScale:G.IQ.create(lt),uAlpha:G.IQ.create(ft),uResolution:G.IQ.create(wt),uRadiusFactorInv:G.IQ.create(1/Ut),tMinDistanceTex:G.IQ.create(Pe),dGridTexType:G.IQ.create(Pe.getDepth()>0?"3d":"2d"),dCalcType:G.IQ.create("density")},Pn={...bh},wn=(0,gh.NG)(na,vh,_h),Bn=(0,yh.$h)(oe,"points",wn,Pn,gn);return(0,hh._)(Bn,gn)}(oe,x,F,z,me,Pe,Ge,Xe,Qe,lt,ft,wt,Ut);return oe.namedComputeRenderables[na]}function vf(oe){const{gl:x,state:F}=oe;F.disable(x.CULL_FACE),F.enable(x.BLEND),F.disable(x.DEPTH_TEST),F.enable(x.SCISSOR_TEST),F.depthMask(!1),F.clearColor(0,0,0,0)}function _f(oe,x){const{gl:F,state:z}=oe;if(G.IQ.update(x.values.dCalcType,"minDistance"),x.update(),z.colorMask(!1,!1,!1,!0),z.blendFunc(F.ONE,F.ONE),!oe.extensions.blendMinMax)throw new Error("GPU gaussian surface calculation requires EXT_blend_minmax");z.blendEquation(oe.extensions.blendMinMax.MAX)}function bf(oe,x){const{gl:F,state:z}=oe;G.IQ.update(x.values.dCalcType,"density"),x.update(),z.colorMask(!1,!1,!1,!0),z.blendFunc(F.ONE,F.ONE),z.blendEquation(F.FUNC_ADD)}function xf(oe,x){const{gl:F,state:z}=oe;G.IQ.update(x.values.dCalcType,"groupId"),x.update(),z.colorMask(!0,!0,!0,!1),z.blendFunc(F.ONE,F.ZERO),z.blendEquation(F.FUNC_ADD)}var Ah=n(9886);function Cf(oe,x,F,z,me){return Sl.apply(this,arguments)}function Sl(){return Sl=(0,r.A)(function*(oe,x,F,z,me){const{resolution:Pe,radiusOffset:Ge,smoothness:Xe}=me,Qe=1/Pe,{indices:lt,x:ft,y:wt,z:Ut,id:Jt}=x,gn=Tt.CD.size(lt),Pn=new Float32Array(gn);let wn=0;for(let Zo=0;ZoVo[ra]&&(Vo[ra]=fa,Lr[ra]=Jt?Jt[Ai]:Ai)}}}}}}function $o(){return($o=(0,r.A)(function*(){for(let Zo=0;Zo1)return!1;const z=F.maxTextureSize/3,{areaCells:me,maxAreaCells:Pe}=(0,Gr.Dt)(oe.boundary.box,x.resolution,z*z);return me{F.resolution!==z.resolution&&(x.createGeometry=!0),F.radiusOffset!==z.radiusOffset&&(x.createGeometry=!0),F.smoothness!==z.smoothness&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0),F.smoothColors.name!==z.smoothColors.name?x.updateColor=!0:"on"===F.smoothColors.name&&"on"===z.smoothColors.name&&(F.smoothColors.params.resolutionFactor!==z.smoothColors.params.resolutionFactor&&(x.updateColor=!0),F.smoothColors.params.sampleStride!==z.smoothColors.params.sampleStride&&(x.updateColor=!0))},mustRecreate:(x,F,z)=>!F.tryUseGpu||!z||!Cc(x.structure,F,z),processValues:(x,F,z,me,Pe)=>{const{resolution:Ge,colorTexture:Xe}=F.meta,Qe=(0,Jn.Y0)(z.smoothColors,me.color.preferSmoothing,Ge);Qe&&Pe&&((0,Pf._i)(x,Qe.resolution,Qe.stride,Pe,Xe),F.meta.colorTexture=x.tColorGrid.ref.value)},dispose:x=>{var F;x.vertexTexture.ref.value.destroy(),x.groupTexture.ref.value.destroy(),x.normalTexture.ref.value.destroy(),x.doubleBuffer.destroy(),null===(F=x.meta.colorTexture)||void 0===F||F.destroy()}},oe)}(oe):function wh(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(El),createGeometry:Lh,createLocationIterator:sr.fromGroup,getLoci:Ht,eachLocation:ln,setUpdateState:(x,F,z)=>{F.resolution!==z.resolution&&(x.createGeometry=!0),F.radiusOffset!==z.radiusOffset&&(x.createGeometry=!0),F.smoothness!==z.smoothness&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0),F.smoothColors.name!==z.smoothColors.name?x.updateColor=!0:"on"===F.smoothColors.name&&"on"===z.smoothColors.name&&(F.smoothColors.params.resolutionFactor!==z.smoothColors.params.resolutionFactor&&(x.updateColor=!0),F.smoothColors.params.sampleStride!==z.smoothColors.params.sampleStride&&(x.updateColor=!0))},mustRecreate:(x,F,z)=>F.tryUseGpu&&!!z&&Cc(x.structure,F,z),processValues:(x,F,z,me,Pe)=>{const{resolution:Ge,colorTexture:Xe}=F.meta,Qe=(0,Jn.Y0)(z.smoothColors,me.color.preferSmoothing,Ge);Qe&&((0,Tu.XP)(x,Qe.resolution,Qe.stride,Pe,Xe),F.meta.colorTexture=x.tColorGrid.ref.value)},dispose:x=>{var F;null===(F=x.meta.colorTexture)||void 0===F||F.destroy()}},oe)}(oe)}function Rh(oe,x,F,z){return F.tryUseGpu&&z&&Df(z)&&Cc(x,F,z)?function zh(oe){return(0,ti.hJ)({defaultProps:v.t.getDefaultValues(Bf),createGeometry:Gh,createLocationIterator:sr.fromStructure,getLoci:ur,eachLocation:kn,setUpdateState:(x,F,z)=>{F.resolution!==z.resolution&&(x.createGeometry=!0),F.radiusOffset!==z.radiusOffset&&(x.createGeometry=!0),F.smoothness!==z.smoothness&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0),F.smoothColors.name!==z.smoothColors.name?x.updateColor=!0:"on"===F.smoothColors.name&&"on"===z.smoothColors.name&&(F.smoothColors.params.resolutionFactor!==z.smoothColors.params.resolutionFactor&&(x.updateColor=!0),F.smoothColors.params.sampleStride!==z.smoothColors.params.sampleStride&&(x.updateColor=!0))},mustRecreate:(x,F,z)=>!F.tryUseGpu||!z||!Cc(x,F,z),processValues:(x,F,z,me,Pe)=>{const{resolution:Ge,colorTexture:Xe}=F.meta,Qe=(0,Jn.Y0)(z.smoothColors,me.color.preferSmoothing,Ge);Qe&&Pe&&((0,Pf._i)(x,Qe.resolution,Qe.stride,Pe,Xe),F.meta.colorTexture=x.tColorGrid.ref.value)},dispose:x=>{var F;x.vertexTexture.ref.value.destroy(),x.groupTexture.ref.value.destroy(),x.normalTexture.ref.value.destroy(),x.doubleBuffer.destroy(),null===(F=x.meta.colorTexture)||void 0===F||F.destroy()}},oe)}(oe):function Nh(oe){return(0,ti.wA)({defaultProps:v.t.getDefaultValues(Bf),createGeometry:Fh,createLocationIterator:sr.fromStructure,getLoci:ur,eachLocation:kn,setUpdateState:(x,F,z)=>{F.resolution!==z.resolution&&(x.createGeometry=!0),F.radiusOffset!==z.radiusOffset&&(x.createGeometry=!0),F.smoothness!==z.smoothness&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.smoothColors.name!==z.smoothColors.name?x.updateColor=!0:"on"===F.smoothColors.name&&"on"===z.smoothColors.name&&(F.smoothColors.params.resolutionFactor!==z.smoothColors.params.resolutionFactor&&(x.updateColor=!0),F.smoothColors.params.sampleStride!==z.smoothColors.params.sampleStride&&(x.updateColor=!0))},mustRecreate:(x,F,z)=>F.tryUseGpu&&!!z&&Cc(x,F,z),processValues:(x,F,z,me,Pe)=>{const{resolution:Ge,colorTexture:Xe}=F.meta,Qe=(0,Jn.Y0)(z.smoothColors,me.color.preferSmoothing,Ge);Qe&&((0,Tu.XP)(x,Qe.resolution,Qe.stride,Pe,Xe),F.meta.colorTexture=x.tColorGrid.ref.value)},dispose:x=>{var F;null===(F=x.meta.colorTexture)||void 0===F||F.destroy()}},oe)}(oe)}function Lh(oe,x,F,z,me,Pe){return Il.apply(this,arguments)}function Il(){return Il=(0,r.A)(function*(oe,x,F,z,me,Pe){const{smoothness:Ge}=me,{transform:Xe,field:Qe,idField:lt,radiusFactor:ft,resolution:wt,maxRadius:Ut}=yield Ef(F,x,z.size,me).runInContext(oe.runtime),Jt={isoLevel:Math.exp(-Ge)/ft,scalarField:Qe,idField:lt},gn=yield(0,xc.O)(Jt,Pe).runAsChild(oe.runtime);gn.meta.resolution=wt,rr.e.transform(gn,Xe),oe.webgl&&!oe.webgl.isWebGL2?(rr.e.uniformTriangleGroup(gn),Bu.IQ.updateIfChanged(gn.varyingGroup,!1)):Bu.IQ.updateIfChanged(gn.varyingGroup,!0);const Pn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,Ut);return gn.setBoundingSphere(Pn),gn}),Il.apply(this,arguments)}function Fh(oe,x,F,z,me){return Al.apply(this,arguments)}function Al(){return Al=(0,r.A)(function*(oe,x,F,z,me){const{smoothness:Pe}=z,{transform:Ge,field:Xe,idField:Qe,radiusFactor:lt,resolution:ft,maxRadius:wt}=yield function Bh(oe,x,F){const{position:z,boundary:me,radius:Pe}=(0,Gr.oc)(oe,x,F),Ge=(0,Gr.FC)(me.box,F);return R.YZ.create("Gaussian Density",function(){var Xe=(0,r.A)(function*(Qe){return yield Cf(Qe,z,me.box,Pe,Ge)});return function(Qe){return Xe.apply(this,arguments)}}())}(x,F.size,z).runInContext(oe.runtime),Ut={isoLevel:Math.exp(-Pe)/lt,scalarField:Xe,idField:Qe},Jt=yield(0,xc.O)(Ut,me).runAsChild(oe.runtime);Jt.meta.resolution=ft,rr.e.transform(Jt,Ge),oe.webgl&&!oe.webgl.isWebGL2?(rr.e.uniformTriangleGroup(Jt),Bu.IQ.updateIfChanged(Jt.varyingGroup,!1)):Bu.IQ.updateIfChanged(Jt.varyingGroup,!0);const gn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,wt);return Jt.setBoundingSphere(gn),Jt}),Al.apply(this,arguments)}const Sc="gaussian-surface";function Uh(oe,x,F,z,me,Pe){return Pl.apply(this,arguments)}function Pl(){return Pl=(0,r.A)(function*(oe,x,F,z,me,Pe){if(!oe.webgl)throw new Error("webgl context required to create gaussian surface texture-mesh");se.g$&&oe.webgl.timer.mark("createGaussianSurfaceTextureMesh");const{namedTextures:Ge,resources:Xe,extensions:{colorBufferFloat:Qe,textureFloat:lt,colorBufferHalfFloat:ft,textureHalfFloat:wt}}=oe.webgl;Ge[Sc]||(Ge[Sc]=ft&&wt?Xe.texture("image-float16","rgba","fp16","linear"):Qe&<?Xe.texture("image-float32","rgba","float","linear"):Xe.texture("image-uint8","rgba","ubyte","linear"));const Ut=yield function Th(oe,x,F,z,me,Pe,Ge){const{position:Xe,boundary:Qe,radius:lt}=(0,Gr.LT)(oe,x,F,me),ft=(0,Gr.FC)(Qe.box,me,Sf(Pe,oe));return R.YZ.create("Gaussian Density",function(){var wt=(0,r.A)(function*(Ut){return Cl(Pe,Xe,Qe.box,lt,z,ft,Ge)});return function(Ut){return wt.apply(this,arguments)}}())}(F,x,z.size,!0,me,oe.webgl,Ge[Sc]).runInContext(oe.runtime),Jt=Math.exp(-me.smoothness)/Ut.radiusFactor,gn=g.eB.create(0,1,2),Pn=Pe?.doubleBuffer.get(),wn=(0,Af._)(oe.webgl,Ut.texture,Ut.gridDim,Ut.gridTexDim,Ut.gridTexScale,Ut.transform,Jt,!1,!0,gn,!0,Pn?.vertex,Pn?.group,Pn?.normal);se.g$&&oe.webgl.timer.markEnd("createGaussianSurfaceTextureMesh");const Bn=x.elements.length,Mn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,Ut.maxRadius),Ln=If.X.create(wn.vertexCount,Bn,wn.vertexTexture,wn.groupTexture,wn.normalTexture,Mn,Pe);return Ln.meta.resolution=Ut.resolution,Ln.meta.webgl=oe.webgl,Ln}),Pl.apply(this,arguments)}function Gh(oe,x,F,z,me){return Tl.apply(this,arguments)}function Tl(){return Tl=(0,r.A)(function*(oe,x,F,z,me){if(!oe.webgl)throw new Error("webgl context required to create structure gaussian surface texture-mesh");se.g$&&oe.webgl.timer.mark("createStructureGaussianSurfaceTextureMesh");const{namedTextures:Pe,resources:Ge,extensions:{colorBufferFloat:Xe,textureFloat:Qe,colorBufferHalfFloat:lt,textureHalfFloat:ft}}=oe.webgl;Pe[Sc]||(Pe[Sc]=lt&&ft?Ge.texture("image-float16","rgba","fp16","linear"):Xe&&Qe?Ge.texture("image-float32","rgba","float","linear"):Ge.texture("image-uint8","rgba","ubyte","linear"));const wt=yield function Mh(oe,x,F,z,me,Pe){const{box:Ge}=oe.lookup3d.boundary,{position:Xe,boundary:Qe,radius:lt}=(0,Gr.oc)(oe,x,z),ft=(0,Gr.FC)(Qe.box,z);return R.YZ.create("Gaussian Density",function(){var wt=(0,r.A)(function*(Ut){return Cl(me,Xe,Ge,lt,F,ft,Pe)});return function(Ut){return wt.apply(this,arguments)}}())}(x,F.size,!0,z,oe.webgl,Pe[Sc]).runInContext(oe.runtime),Ut=Math.exp(-z.smoothness)/wt.radiusFactor,Jt=g.eB.create(0,1,2),gn=me?.doubleBuffer.get(),Pn=(0,Af._)(oe.webgl,wt.texture,wt.gridDim,wt.gridTexDim,wt.gridTexScale,wt.transform,Ut,!1,!0,Jt,!0,gn?.vertex,gn?.group,gn?.normal);se.g$&&oe.webgl.timer.markEnd("createStructureGaussianSurfaceTextureMesh");const wn=x.elementCount,Bn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,wt.maxRadius),Mn=If.X.create(Pn.vertexCount,wn,Pn.vertexTexture,Pn.groupTexture,Pn.normalTexture,Bn,me);return Mn.meta.resolution=wt.resolution,Mn.meta.webgl=oe.webgl,Mn}),Tl.apply(this,arguments)}var za=n(5315);function kh(oe,x,F,z,me,Pe){return Bl.apply(this,arguments)}function Bl(){return Bl=(0,r.A)(function*(oe,x,F,z,me,Pe){const{smoothness:Ge}=me,{transform:Xe,field:Qe,idField:lt,maxRadius:ft}=yield Ef(F,x,z.size,me).runInContext(oe.runtime),wt={isoLevel:Math.exp(-Ge),scalarField:Qe,idField:lt},Ut=yield(0,xc.e)(wt,Pe).runAsChild(oe.runtime);za.q.transform(Ut,Xe);const Jt=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,ft);return Ut.setBoundingSphere(Jt),Ut}),Bl.apply(this,arguments)}const Mf={...tr.zj,...Gc,sizeFactor:v.t.Numeric(3,{min:0,max:10,step:.1}),lineSizeAttenuation:v.t.Boolean(!1),ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),includeParent:v.t.Boolean(!1,{isHidden:!0})};function Hh(oe){return(0,tr.zK)({defaultProps:v.t.getDefaultValues(Mf),createGeometry:kh,createLocationIterator:sr.fromGroup,getLoci:Ht,eachLocation:ln,setUpdateState:(x,F,z)=>{F.resolution!==z.resolution&&(x.createGeometry=!0),F.radiusOffset!==z.radiusOffset&&(x.createGeometry=!0),F.smoothness!==z.smoothness&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0)}},oe)}const Of={"gaussian-surface-mesh":(oe,x)=>(0,vn.T)("Gaussian surface mesh",oe,x,Oh),"structure-gaussian-surface-mesh":(oe,x)=>(0,pr.Kp)("Structure-Gaussian surface mesh",oe,x,Rh),"gaussian-surface-wireframe":(oe,x)=>(0,vn.T)("Gaussian surface wireframe",oe,x,Hh)},Rf={...El,...Mf,visuals:v.t.MultiSelect(["gaussian-surface-mesh"],v.t.objectToOptions(Of)),bumpFrequency:v.t.Numeric(1,{min:0,max:10,step:.1},Jn.iy.ShadingCategory)},Qh=(0,pr.GT)({name:"gaussian-surface",label:"Gaussian Surface",description:"Displays a gaussian molecular surface.",factory:function Wh(oe,x){return dr.YL.createMulti("Gaussian Surface",oe,x,pr.J1,Of)},getParams:function jh(oe,x){return Rf},defaultValues:v.t.getDefaultValues(Rf),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:oe=>oe.elementCount>0});var Dl=n(7377);const Lf={...ti.ip,background:v.t.Boolean(!1),backgroundMargin:v.t.Numeric(0,{min:0,max:1,step:.01}),backgroundColor:v.t.Color(_e.s.black),backgroundOpacity:v.t.Numeric(.5,{min:0,max:1,step:.01}),borderWidth:v.t.Numeric(.25,{min:0,max:.5,step:.01}),level:v.t.Select("residue",[["chain","Chain"],["residue","Residue"],["element","Element"]],{isEssential:!0}),ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),chainScale:v.t.Numeric(10,{min:0,max:20,step:.1}),residueScale:v.t.Numeric(1,{min:0,max:20,step:.1}),elementScale:v.t.Numeric(.5,{min:0,max:20,step:.1})};function Kh(oe){return(0,ti.Go)({defaultProps:v.t.getDefaultValues(Lf),createGeometry:Zh,createLocationIterator:sr.fromStructure,getLoci:ur,eachLocation:kn,setUpdateState:(x,F,z)=>{x.createGeometry=F.level!==z.level||"chain"===F.level&&F.chainScale!==z.chainScale||"residue"===F.level&&F.residueScale!==z.residueScale||"element"===F.level&&F.elementScale!==z.elementScale||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant}},oe)}function Zh(oe,x,F,z,me){switch(z.level){case"chain":return function Yh(oe,x,F,z,me){const Pe=Je.iZ.Location.create(x),{units:Ge,serialMapping:Xe}=x,{auth_asym_id:Qe,label_asym_id:lt}=Je.StructureProperties.chain,{cumulativeUnitElementCount:ft}=Xe,wt=Ge.length,{chainScale:Ut}=z,Jt=Dl.t.create(z,wt,wt/2,me);for(let gn=0,Pn=Ge.length;gn(0,pr.Kp)("Label text",oe,x,Kh)},Ff={...Lf,visuals:v.t.MultiSelect(["label-text"],v.t.objectToOptions(wf))},e0=(0,pr.GT)({name:"label",label:"Label",description:"Displays labels.",factory:function qh(oe,x){const F=dr.YL.createMulti("Label",oe,x,pr.J1,wf);return F.setState({pickable:!1,markerActions:xr.xi.None}),F},getParams:function Jh(oe,x){return Ff},defaultValues:v.t.getDefaultValues(Ff),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"physical"},isApplicable:oe=>oe.elementCount>0});var Ml=n(6639);const Ol={probeRadius:v.t.Numeric(1.4,{min:0,max:10,step:.1},{description:"Radius of the probe tracing the molecular surface."}),resolution:v.t.Numeric(.5,{min:.01,max:20,step:.01},{description:"Grid resolution/cell spacing.",...Jn.iy.CustomQualityParamInfo}),probePositions:v.t.Numeric(36,{min:12,max:90,step:1},{description:"Number of positions tested for probe target intersection.",...Jn.iy.CustomQualityParamInfo})};function Rl(){return Rl=(0,r.A)(function*(oe,x,F,z,me,Pe){let Ge=-1;function Xe(pi,_s,$i,Ji,us){if(-1!==Ge){const Ui=Ge;if(Ui!==Ji&&Ui!==us&&Qe(Ui,pi,_s,$i))return Ui;Ge=-1}for(let Ui=0,gs=to.count;Ui0&&vm{F.resolution!==z.resolution&&(x.createGeometry=!0),F.probeRadius!==z.probeRadius&&(x.createGeometry=!0),F.probePositions!==z.probePositions&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0),F.smoothColors.name!==z.smoothColors.name?x.updateColor=!0:"on"===F.smoothColors.name&&"on"===z.smoothColors.name&&(F.smoothColors.params.resolutionFactor!==z.smoothColors.params.resolutionFactor&&(x.updateColor=!0),F.smoothColors.params.sampleStride!==z.smoothColors.params.sampleStride&&(x.updateColor=!0))},processValues:(x,F,z,me,Pe)=>{const{resolution:Ge,colorTexture:Xe}=F.meta,Qe=(0,Jn.Y0)(z.smoothColors,me.color.preferSmoothing,Ge);Qe&&((0,Tu.XP)(x,Qe.resolution,Qe.stride,Pe,Xe),F.meta.colorTexture=x.tColorGrid.ref.value)},dispose:x=>{var F;null===(F=x.meta.colorTexture)||void 0===F||F.destroy()}},oe)}function u0(oe,x,F,z,me){return Nl.apply(this,arguments)}function Nl(){return Nl=(0,r.A)(function*(oe,x,F,z,me){const{transform:Pe,field:Ge,idField:Xe,resolution:Qe,maxRadius:lt}=yield function s0(oe,x,F){const{position:z,boundary:me,maxRadius:Pe}=function i0(oe,x,F){const{probeRadius:z}=F,{position:me,boundary:Pe,radius:Ge}=(0,Gr.oc)(oe,x,F),{indices:Xe}=me,Qe=Tt.CD.size(Xe),lt=new Float32Array(Tt.CD.end(Xe));let ft=0;for(let wt=0;wt{F.resolution!==z.resolution&&(x.createGeometry=!0),F.probeRadius!==z.probeRadius&&(x.createGeometry=!0),F.probePositions!==z.probePositions&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0),F.smoothColors.name!==z.smoothColors.name?x.updateColor=!0:"on"===F.smoothColors.name&&"on"===z.smoothColors.name&&(F.smoothColors.params.resolutionFactor!==z.smoothColors.params.resolutionFactor&&(x.updateColor=!0),F.smoothColors.params.sampleStride!==z.smoothColors.params.sampleStride&&(x.updateColor=!0))},processValues:(x,F,z,me,Pe)=>{const{resolution:Ge,colorTexture:Xe}=F.meta,Qe=(0,Jn.Y0)(z.smoothColors,me.color.preferSmoothing,Ge);Qe&&((0,Tu.XP)(x,Qe.resolution,Qe.stride,Pe,Xe),F.meta.colorTexture=x.tColorGrid.ref.value)},dispose:x=>{var F;null===(F=x.meta.colorTexture)||void 0===F||F.destroy()}},oe)}const Vf={...tr.zj,...Ol,...Gr.$J,sizeFactor:v.t.Numeric(1.5,{min:0,max:10,step:.1})};function d0(oe,x,F,z,me,Pe){return Ul.apply(this,arguments)}function Ul(){return Ul=(0,r.A)(function*(oe,x,F,z,me,Pe){const{transform:Ge,field:Xe,idField:Qe,maxRadius:lt}=yield Nf(F,x,z.size,me).runInContext(oe.runtime),ft={isoLevel:me.probeRadius,scalarField:Xe,idField:Qe},wt=yield(0,xc.e)(ft,Pe).runAsChild(oe.runtime);za.q.transform(wt,Ge);const Ut=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,lt);return wt.setBoundingSphere(Ut),wt}),Ul.apply(this,arguments)}function f0(oe){return(0,tr.zK)({defaultProps:v.t.getDefaultValues(Vf),createGeometry:d0,createLocationIterator:sr.fromGroup,getLoci:Ht,eachLocation:ln,setUpdateState:(x,F,z)=>{F.resolution!==z.resolution&&(x.createGeometry=!0),F.probeRadius!==z.probeRadius&&(x.createGeometry=!0),F.probePositions!==z.probePositions&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0)}},oe)}const Gf={"molecular-surface-mesh":(oe,x)=>(0,vn.T)("Molecular surface mesh",oe,x,c0),"structure-molecular-surface-mesh":(oe,x)=>(0,pr.Kp)("Structure Molecular surface mesh",oe,x,l0),"molecular-surface-wireframe":(oe,x)=>(0,vn.T)("Molecular surface wireframe",oe,x,f0)},zf={...wl,...Vf,visuals:v.t.MultiSelect(["molecular-surface-mesh"],v.t.objectToOptions(Gf)),bumpFrequency:v.t.Numeric(1,{min:0,max:10,step:.1},Jn.iy.ShadingCategory)},h0=(0,pr.GT)({name:"molecular-surface",label:"Molecular Surface",description:"Displays a molecular surface.",factory:function p0(oe,x){return dr.YL.createMulti("Molecular Surface",oe,x,pr.J1,Gf)},getParams:function m0(oe,x){return zf},defaultValues:v.t.getDefaultValues(zf),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:oe=>oe.elementCount>0}),kf={...tr.Te,sizeFactor:v.t.Numeric(1,{min:0,max:2,step:.1}),detail:v.t.Numeric(0,{min:0,max:3,step:1},Jn.iy.CustomQualityParamInfo)};function g0(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(kf),createGeometry:v0,createLocationIterator:_0,getLoci:b0,eachLocation:x0,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail}},oe)}function v0(oe,x,F,z,me,Pe){if(!function y0(oe){if(Je.Nf.Traits.is(oe.traits,Je.Nf.Trait.MultiChain)||Je.Nf.Traits.is(oe.traits,Je.Nf.Trait.Partitioned))return!1;if(Je.Nf.isCoarse(oe))return!0;if(0===oe.elements.length)return!1;const F=oe.model.atomicHierarchy.derived.residue.moleculeType[oe.residueIndex[oe.elements[0]]];return!(3===F||2===F)}(x))return rr.e.createEmpty(Pe);const{detail:Ge,sizeFactor:Xe}=me,lt=lr.P.createState(256,128,Pe),ft=x.principalAxes.boxAxes,{origin:wt,dirA:Ut,dirB:Jt}=ft,gn=Bt.n.size((0,g.eB)(),ft);g.eB.scale(gn,gn,Xe/2);const Pn=g.eB.create(gn[2],gn[1],gn[0]);lt.currentGroup=0,(0,af.P)(lt,wt,Ut,Jt,Pn,Ge+1);const wn=lr.P.getMesh(lt),Bn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return wn.setBoundingSphere(Bn),wn}function _0(oe){const{group:x,structure:F}=oe,me=x.units.length,Pe=Je.iZ.Location.create(F);return(0,oo.iQ)(1,me,1,(Xe,Qe)=>{const lt=x.units[Qe];return Pe.unit=lt,Pe.element=lt.elements[Xe],Pe})}function b0(oe,x,F){const{objectId:z,instanceId:me}=oe;if(F===z){const{structure:Pe,group:Ge}=x,Xe=Ge.units[me],Qe=Tt.CD.ofBounds(0,Xe.elements.length);return Je.iZ.Loci(Pe,[{unit:Xe,indices:Qe}])}return Rn.BL}function x0(oe,x,F){let z=!1;if(!Je.iZ.Loci.is(oe))return!1;const{structure:me,group:Pe}=x;if(!Je.oE.areEquivalent(oe.structure,me))return!1;const Ge=Pe.elements.length;for(const Xe of oe.elements){const Qe=Pe.unitIndexMap.get(Xe.unit.id);void 0!==Qe&&Tt.CD.size(Xe.indices)===Ge&&F(Tt.IX.ofSingleton(Qe))&&(z=!0)}return z}const Hf={"orientation-ellipsoid-mesh":(oe,x)=>(0,vn.T)("Orientation ellipsoid mesh",oe,x,g0)},jf={...kf,visuals:v.t.MultiSelect(["orientation-ellipsoid-mesh"],v.t.objectToOptions(Hf)),bumpFrequency:v.t.Numeric(1,{min:0,max:10,step:.1},Jn.iy.ShadingCategory)},E0=(0,pr.GT)({name:"orientation",label:"Orientation",description:"Displays orientation ellipsoids for polymer chains.",factory:function S0(oe,x){return dr.YL.createMulti("Orientation",oe,x,pr.J1,Hf)},getParams:function C0(oe,x){return jf},defaultValues:v.t.getDefaultValues(jf),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:oe=>oe.elementCount>0});var Vl=n(5299);const I0=ce.Gm.add3,A0=ce.Gm.add;var Gl;!function(oe){oe.create=function x(F=2048,z=1024,me){const Pe=ce.Gm.create(Float32Array,3,z,me?me.centerBuffer.ref.value:F),Ge=ce.Gm.create(Float32Array,1,z,me?me.groupBuffer.ref.value:F);return{add:(Xe,Qe,lt,ft)=>{I0(Pe,Xe,Qe,lt),A0(Ge,ft)},getPoints:()=>{const Xe=ce.Gm.compact(Pe,!0),Qe=ce.Gm.compact(Ge,!0);return Vl.O.create(Xe,Qe,Pe.elementCount,me)}}}}(Gl||(Gl={}));const Wf=g.eB.add,zl={...tr.PJ,pointSizeAttenuation:v.t.Boolean(!1),ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),traceOnly:v.t.Boolean(!1),stride:v.t.Numeric(1,{min:1,max:100,step:1})};function P0(oe,x,F,z,me,Pe){const{child:Ge}=F;if(Ge&&!Ge.unitMap.get(x.id))return Vl.O.createEmpty(Pe);const Xe=x.elements,Qe=Xe.length,lt=Gl.create(Qe,Qe/10,Pe),ft=(0,g.eB)(),wt=x.conformation,Ut=bi(F,x,me),Jt=(0,g.eB)();let gn=0;if(Ut)for(let Mn=0;Mn{x.createGeometry=F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.traceOnly!==z.traceOnly||F.stride!==z.stride}},oe)}const T0={"element-point":(oe,x)=>(0,vn.T)("Points",oe,x,Qf)},Kf={...zl},M0=(0,pr.GT)({name:"point",label:"Point",description:"Displays elements (atoms, coarse spheres) as points.",factory:function D0(oe,x){return dr.YL.createMulti("Point",oe,x,pr.J1,T0)},getParams:function B0(oe,x){return Kf},defaultValues:v.t.getDefaultValues(Kf),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:oe=>oe.elementCount>0}),Zf={sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01}),detail:v.t.Numeric(0,{min:0,max:3,step:1},Jn.iy.CustomQualityParamInfo),linearSegments:v.t.Numeric(8,{min:1,max:48,step:1},Jn.iy.CustomQualityParamInfo),radialSegments:v.t.Numeric(16,{min:2,max:56,step:2},Jn.iy.CustomQualityParamInfo)},Bs=(v.t.getDefaultValues(Zf),(0,g.eB)());function O0(oe,x,F,z,me,Pe){const Ge=x.polymerElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{sizeFactor:Xe,detail:Qe,linearSegments:lt,radialSegments:ft}=me,wt=lt*ft*Ge+(ft+1)*Ge*2,Ut=lr.P.createState(wt,wt/10,Pe),Jt=ju(lt),{curvePoints:gn,normalVectors:Pn,binormalVectors:wn,widthValues:Bn,heightValues:Mn}=Jt;let Ln=0;const cr=zu(x,F,{ignoreSecondaryStructure:!0});for(;cr.hasNext;){const Zn=cr.move();Ut.currentGroup=Ln;const Lr=(0,Tr.OV)(Zn.moleculeType)?tu:eu;Wu(Jt,Zn,bd,Lr);const wr=Zn.coarseBackboneFirst||Zn.first,to=Zn.coarseBackboneLast||Zn.last,Cr=z.size.size(Zn.centerPrev)*Xe,Zr=z.size.size(Zn.center)*Xe,Io=z.size.size(Zn.centerNext)*Xe;Xu(Jt,Cr,Zr,Io,Cr,Zr,Io,Lr);let wo=lt;if(Zn.initial){wo=Math.max(Math.round(lt*Lr),1);const si=lt-wo;gn.copyWithin(0,3*si),wn.copyWithin(0,3*si),Pn.copyWithin(0,3*si),Bn.copyWithin(0,3*si),Mn.copyWithin(0,3*si),g.eB.fromArray(Bs,gn,3),g.eB.normalize(Bs,g.eB.sub(Bs,Zn.p2,Bs)),g.eB.scaleAndAdd(Bs,Zn.p2,Bs,Zr*nu),g.eB.toArray(Bs,gn,0)}else Zn.final&&(wo=Math.max(Math.round(lt*(1-Lr)),1),g.eB.fromArray(Bs,gn,3*wo-3),g.eB.normalize(Bs,g.eB.sub(Bs,Zn.p2,Bs)),g.eB.scaleAndAdd(Bs,Zn.p2,Bs,Zr*nu),g.eB.toArray(Bs,gn,3*wo));!0===Zn.initial&&!0===Zn.final?(0,kr.X)(Ut,Zn.p2,2*Zr,Qe):2===ft?Pu(Ut,gn,Pn,wn,wo,Bn,Mn,0):4===ft?Iu(Ut,gn,Pn,wn,wo,Bn,Mn,0,wr,to):hl(Ut,gn,Pn,wn,wo,ft,Bn,Mn,wr,to,"elliptical"),++Ln}const qn=lr.P.getMesh(Ut),Qn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return qn.setBoundingSphere(Qn),qn}const Yf={...tr.Te,...Zf};function R0(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(Yf),createGeometry:O0,createLocationIterator:x=>ia.fromGroup(x,{asSecondary:!0}),getLoci:Ba,eachLocation:Da,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail||F.linearSegments!==z.linearSegments||F.radialSegments!==z.radialSegments}},oe)}const Xf={"polymer-tube":(oe,x)=>(0,vn.T)("Polymer tube mesh",oe,x,R0),"polymer-gap":(oe,x)=>(0,vn.T)("Polymer gap cylinder",oe,x,ll)},$f={...Yf,...xu,sizeFactor:v.t.Numeric(.2,{min:0,max:10,step:.01}),visuals:v.t.MultiSelect(["polymer-tube","polymer-gap"],v.t.objectToOptions(Xf)),bumpFrequency:v.t.Numeric(2,{min:0,max:10,step:.1},Jn.iy.ShadingCategory)},F0=(0,pr.GT)({name:"putty",label:"Putty",description:"Displays a tube smoothly following the trace atoms of polymers.",factory:function w0(oe,x){return dr.YL.createMulti("Putty",oe,x,pr.J1,Xf)},getParams:function L0(oe,x){const F=v.t.clone($f);let z=!1,me=!1;return x.units.forEach(Pe=>{!z&&Je.Nf.isAtomic(Pe)&&Pe.nucleotideElements.length&&(z=!0),!me&&Pe.gapElements.length&&(me=!0)}),F.visuals.defaultValue=["polymer-tube"],me&&F.visuals.defaultValue.push("polymer-gap"),F},defaultValues:v.t.getDefaultValues($f),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uncertainty"},isApplicable:oe=>oe.polymerResidueCount>0}),Jf={"element-sphere":(oe,x)=>(0,vn.T)("Sphere mesh/impostor",oe,x,et),"structure-element-sphere":(oe,x)=>(0,pr.Kp)("Structure sphere mesh/impostor",oe,x,qt)},kl={...st,bumpFrequency:v.t.Numeric(1,{min:0,max:10,step:.1},Jn.iy.ShadingCategory),visuals:v.t.MultiSelect(["element-sphere"],v.t.objectToOptions(Jf))};let Du;const V0=(0,pr.GT)({name:"spacefill",label:"Spacefill",description:"Displays atomic/coarse elements as spheres.",factory:function U0(oe,x){return dr.YL.createMulti("Spacefill",oe,x,pr.J1,Jf)},getParams:function N0(oe,x){return x.isCoarseGrained?(Du||(Du=v.t.clone(kl),Du.sizeFactor.defaultValue=2),Du):kl},defaultValues:v.t.getDefaultValues(kl),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:oe=>oe.elementCount>0}),Hl=Tr.I$.is;function G0(oe,x,F,z,me,Pe){if(!Je.Nf.isAtomic(x))return za.q.createEmpty(Pe);const{child:Ge}=F,Xe=Ge?.unitMap.get(x.id);if(Ge&&!Xe)return za.q.createEmpty(Pe);const Qe=Je.iZ.Location.create(F,x),lt=x.elements,ft=x.bonds,{edgeCount:wt,a:Ut,b:Jt,edgeProps:gn,offset:Pn}=ft;if(!wt)return za.q.createEmpty(Pe);const{order:wn,flags:Bn}=gn,{sizeFactor:Mn,aromaticBonds:Ln,includeTypes:cr,excludeTypes:qn,multipleBonds:Qn}=me,Zn="off"===Qn,zn="symmetric"===Qn,to=So(Tr.I$.fromNames(cr),Tr.I$.fromNames(qn),32),Cr=(0,g.eB)(),Zr=x.conformation,{elementRingIndices:Io,elementAromaticRingIndices:wo}=x.rings,si=Ln?x.resonance.delocalizedTriplets:void 0,Ii={linkCount:2*wt,referencePosition:Vo=>{let jo=Ut[Vo],go=Jt[Vo];const Qo=si?.getThirdElement(jo,go);if(void 0!==Qo)return Zr.invariantPosition(lt[Qo],Cr);jo>go&&([jo,go]=[go,jo]),Pn[jo+1]-Pn[jo]==1&&([jo,go]=[go,jo]);const Ko=wo.get(jo)||Io.get(jo);let $o=0;for(let fi=Pn[jo],Zo=Pn[jo+1];fi$o&&($o=Xi,Zr.invariantPosition(lt[ii],Cr))}}}return $o>0?Cr:null},position:(Vo,jo,go)=>{Zr.invariantPosition(lt[Ut[go]],Vo),Zr.invariantPosition(lt[Jt[go]],jo)},style:Vo=>{const jo=wn[Vo],go=Bn[Vo];if(Hl(go,2)||Hl(go,4))return 1;if(3===jo)return Zn?0:zn?4:5;if(Ln){const Ko=Jt[Vo],$o=wo.get(Ut[Vo]),fi=wo.get(Ko),Zo=$o&&fi?(0,nt.u$)($o,fi):0;if(Hl(go,16)||Zo&&!to)return 2===Zo?8:7}return 2!==jo||Zn?0:zn?2:3},radius:Vo=>{Qe.element=lt[Ut[Vo]];const jo=z.size.size(Qe);Qe.element=lt[Jt[Vo]];const go=z.size.size(Qe);return Math.min(jo,go)*Mn},ignore:ao(F,x,me)},{lines:ai,boundingSphere:li}=(0,Vr.Yz)(oe,Ii,me,Pe);if(li)ai.setBoundingSphere(li);else if(ai.lineCount>0){const Vo=Bt.f8.expand((0,Bt.f8)(),(Xe??x).boundary.sphere,1*Mn);ai.setBoundingSphere(Vo)}return ai}const qf={...tr.zj,...Do,includeParent:v.t.Boolean(!1)};function z0(oe){return(0,tr.zK)({defaultProps:v.t.getDefaultValues(qf),createGeometry:G0,createLocationIterator:x=>Yr.fromGroup(x),getLoci:jr,eachLocation:Co,setUpdateState:(x,F,z,me,Pe,Ge,Xe)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.linkScale!==z.linkScale||F.linkSpacing!==z.linkSpacing||F.aromaticDashCount!==z.aromaticDashCount||F.dashCount!==z.dashCount||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||!(0,G.af)(F.includeTypes,z.includeTypes)||!(0,G.af)(F.excludeTypes,z.excludeTypes)||F.aromaticBonds!==z.aromaticBonds||F.multipleBonds!==z.multipleBonds;const Qe=Ge.group.units[0],lt=Xe.group.units[0];Je.Nf.isAtomic(Qe)&&Je.Nf.isAtomic(lt)&&(Yo.O.areEqual(Qe.bonds,lt.bonds)||(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0,x.updateSize=!0))}},oe)}const jl=new Je.gn.ElementBondIterator;function em(oe,x,F,z){for(jl.setElement(x,F,z);jl.hasNext;){const me=jl.move();return me.otherUnit.conformation.position(me.otherUnit.elements[me.otherIndex],oe),oe}return null}function k0(oe,x,F,z,me){const Pe=x.interUnitBonds,{edgeCount:Ge,edges:Xe}=Pe;if(!Ge)return za.q.createEmpty(me);const{sizeFactor:Qe,aromaticBonds:lt,multipleBonds:ft}=z,wt="off"===ft,Ut="symmetric"===ft,Jt=(0,g.eB)(),gn=Je.iZ.Location.create(),Pn={linkCount:Ge,referencePosition:Mn=>{const Ln=Xe[Mn];let cr,qn,Qn,Zn;if(Ln.unitALn.unitB))throw new Error("same units in createInterUnitBondLines");cr=x.unitMap.get(Ln.unitB),qn=x.unitMap.get(Ln.unitA),Qn=Ln.indexB,Zn=Ln.indexA}return em(Jt,x,cr,Qn)||em(Jt,x,qn,Zn)},position:(Mn,Ln,cr)=>{const qn=Xe[cr],Qn=x.unitMap.get(qn.unitA),Zn=x.unitMap.get(qn.unitB);Qn.conformation.position(Qn.elements[qn.indexA],Mn),Zn.conformation.position(Zn.elements[qn.indexB],Ln)},style:Mn=>{const Ln=Xe[Mn].props.order,cr=G.NJ.create(Xe[Mn].props.flag);return Tr.I$.is(cr,2)||Tr.I$.is(cr,4)?1:3===Ln?wt?0:Ut?4:5:lt&&Tr.I$.is(cr,16)?7:2!==Ln||wt?0:Ut?2:3},radius:Mn=>{const Ln=Xe[Mn];gn.structure=x,gn.unit=x.unitMap.get(Ln.unitA),gn.element=gn.unit.elements[Ln.indexA];const cr=F.size.size(gn);gn.unit=x.unitMap.get(Ln.unitB),gn.element=gn.unit.elements[Ln.indexB];const qn=F.size.size(gn);return Math.min(cr,qn)*Qe},ignore:Po(x,z)},{lines:wn,boundingSphere:Bn}=(0,Vr.Yz)(oe,Pn,z,me);if(Bn)wn.setBoundingSphere(Bn);else if(wn.lineCount>0){const{child:Mn}=x,Ln=Bt.f8.expand((0,Bt.f8)(),(Mn??x).boundary.sphere,1*Qe);wn.setBoundingSphere(Ln)}return wn}const tm={...ti.YD,...Do,includeParent:v.t.Boolean(!1)};function H0(oe){return(0,ti.yd)({defaultProps:v.t.getDefaultValues(tm),createGeometry:k0,createLocationIterator:x=>Yr.fromStructure(x),getLoci:Eo,eachLocation:ei,setUpdateState:(x,F,z,me,Pe,Ge,Xe)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.linkScale!==z.linkScale||F.linkSpacing!==z.linkSpacing||F.aromaticDashCount!==z.aromaticDashCount||F.dashCount!==z.dashCount||F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||!(0,G.af)(F.includeTypes,z.includeTypes)||!(0,G.af)(F.excludeTypes,z.excludeTypes)||F.multipleBonds!==z.multipleBonds,Ge.interUnitBonds!==Xe.interUnitBonds&&(x.createGeometry=!0,x.updateTransform=!0,x.updateColor=!0,x.updateSize=!0)}},oe)}var j0=n(5821),W0=n(7767);const Ec=g.eB.scaleAndAdd,nm=g.eB.unitX,rm=g.eB.unitY,om=g.eB.unitZ,im={...tr.zj,lineSizeAttenuation:v.t.Boolean(!1),ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),traceOnly:v.t.Boolean(!1),crosses:v.t.Select("lone",v.t.arrayToOptions(["lone","all"])),crossSize:v.t.Numeric(.35,{min:0,max:2,step:.01})};function Q0(oe,x,F,z,me,Pe){const{child:Ge}=F;if(Ge&&!Ge.unitMap.get(x.id))return za.q.createEmpty(Pe);const Xe=x.elements,Qe=Xe.length,lt=j0.d.create(Qe,Qe/10,Pe),ft=(0,g.eB)(),wt=(0,g.eB)(),Ut=(0,g.eB)(),Jt=x.conformation,gn=bi(F,x,me),Pn=me.crossSize/2,wn="lone"===me.crosses;for(let Ln=0;Ln{x.createGeometry=F.ignoreHydrogens!==z.ignoreHydrogens||F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant||F.traceOnly!==z.traceOnly||F.crosses!==z.crosses||F.crossSize!==z.crossSize}},oe)}const sm={"intra-bond":(oe,x)=>(0,vn.T)("Intra-unit bond line",oe,x,z0),"inter-bond":(oe,x)=>(0,nr.K)("Inter-unit bond line",oe,x,H0),"element-point":(oe,x)=>(0,vn.T)("Points",oe,x,Qf),"element-cross":(oe,x)=>(0,vn.T)("Crosses",oe,x,K0)},Wl={...qf,...tm,...zl,...im,pointStyle:v.t.Select("circle",v.t.objectToOptions(Vl.O.StyleTypes)),multipleBonds:v.t.Select("offset",v.t.arrayToOptions(["off","symmetric","offset"])),includeParent:v.t.Boolean(!1),sizeFactor:v.t.Numeric(2,{min:.01,max:10,step:.01}),unitKinds:(0,Rr.R8)(["atomic"]),visuals:v.t.MultiSelect(["intra-bond","inter-bond","element-point","element-cross"],v.t.objectToOptions(sm))},X0=(0,pr.GT)({name:"line",label:"Line",description:"Displays bonds as lines and atoms as points or croses.",factory:function Y0(oe,x){return dr.YL.createMulti("Line",oe,x,pr.J1,sm)},getParams:function Z0(oe,x){if(Je.oE.getSize(x)>=Je.oE.Size.Huge){const z=v.t.clone(Wl);return z.visuals.defaultValue=["intra-bond","element-point","element-cross"],z}return Wl},defaultValues:v.t.getDefaultValues(Wl),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:oe=>oe.elementCount>0,getData:(oe,x)=>x.includeParent?oe.asParent():oe,mustRecreate:(oe,x)=>oe.includeParent!==x.includeParent});var am=n(9928);function $0(oe,x,F,z,me){return Ql.apply(this,arguments)}function Ql(){return Ql=(0,r.A)(function*(oe,x,F,z,me){const{runtime:Pe,webgl:Ge}=oe;if(!Ge||!Ge.extensions.blendMinMax)throw new Error("GaussianDensityVolume requires `webgl` and `blendMinMax` extension");const Xe=me?me.gridTexture.ref.value:void 0,Qe=yield function Dh(oe,x,F,z,me){const{position:Pe,boundary:Ge,radius:Xe}=(0,Gr.oc)(oe,x,F),Qe=(0,Gr.FC)(Ge.box,F);return R.YZ.create("Gaussian Density",function(){var lt=(0,r.A)(function*(ft){return ff(z,Pe,Ge.box,Xe,Qe,me)});return function(ft){return lt.apply(this,arguments)}}())}(x,F.size,z,Ge,Xe).runInContext(Pe),{transform:lt,texture:ft,bbox:wt,gridDim:Ut}=Qe,gn=g.$I.mul((0,g.$I)(),lt,g.$I.fromScaling((0,g.$I)(),Ut)),Pn=g.$I.getScaling((0,g.eB)(),lt),wn=g.eB.create(0,1,2),Bn=am.E.create(wt,Ut,lt,gn,Pn,ft,{min:0,max:1,mean:.04,sigma:.01},!0,wn,me),Mn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,Qe.maxRadius);return Bn.setBoundingSphere(Mn),Bn}),Ql.apply(this,arguments)}const cm={...ti.I,...Gc,ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),includeParent:v.t.Boolean(!1,{isHidden:!0})};function J0(oe){return(0,ti.Yl)({defaultProps:v.t.getDefaultValues(cm),createGeometry:$0,createLocationIterator:sr.fromStructure,getLoci:ur,eachLocation:kn,setUpdateState:(x,F,z)=>{F.resolution!==z.resolution&&(x.createGeometry=!0),F.radiusOffset!==z.radiusOffset&&(x.createGeometry=!0),F.smoothness!==z.smoothness&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0)},dispose:x=>{x.gridTexture.ref.value.destroy()}},oe)}function q0(oe,x,F,z,me,Pe){return Kl.apply(this,arguments)}function Kl(){return Kl=(0,r.A)(function*(oe,x,F,z,me,Pe){const{runtime:Ge,webgl:Xe}=oe;if(!Xe)throw new Error("GaussianDensityVolume requires `webgl`");const Qe=Pe?Pe.gridTexture.ref.value:void 0,lt=yield function Ph(oe,x,F,z,me,Pe){const{position:Ge,boundary:Xe,radius:Qe}=(0,Gr.LT)(oe,x,F,z),lt=(0,Gr.FC)(Xe.box,z,Sf(me,oe));return R.YZ.create("Gaussian Density",function(){var ft=(0,r.A)(function*(wt){return ff(me,Ge,Xe.box,Qe,lt,Pe)});return function(wt){return ft.apply(this,arguments)}}())}(F,x,z.size,me,Xe,Qe).runInContext(Ge),{transform:ft,texture:wt,bbox:Ut,gridDim:Jt}=lt,Pn=g.$I.mul((0,g.$I)(),ft,g.$I.fromScaling((0,g.$I)(),Jt)),wn=g.$I.getScaling((0,g.eB)(),ft),Bn=g.eB.create(0,1,2),Mn=am.E.create(Ut,Jt,ft,Pn,wn,wt,{min:0,max:1,mean:.04,sigma:.01},!0,Bn,Pe),Ln=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,lt.maxRadius);return Mn.setBoundingSphere(Ln),Mn}),Kl.apply(this,arguments)}const eg={...tr.Ny,...Gc,ignoreHydrogens:v.t.Boolean(!1),ignoreHydrogensVariant:v.t.Select("all",v.t.arrayToOptions(["all","non-polar"])),includeParent:v.t.Boolean(!1,{isHidden:!0})};function tg(oe){return(0,tr.Pi)({defaultProps:v.t.getDefaultValues(eg),createGeometry:q0,createLocationIterator:sr.fromGroup,getLoci:Ht,eachLocation:ln,setUpdateState:(x,F,z)=>{F.resolution!==z.resolution&&(x.createGeometry=!0),F.radiusOffset!==z.radiusOffset&&(x.createGeometry=!0),F.smoothness!==z.smoothness&&(x.createGeometry=!0),F.ignoreHydrogens!==z.ignoreHydrogens&&(x.createGeometry=!0),F.ignoreHydrogensVariant!==z.ignoreHydrogensVariant&&(x.createGeometry=!0),F.traceOnly!==z.traceOnly&&(x.createGeometry=!0),F.includeParent!==z.includeParent&&(x.createGeometry=!0)},dispose:x=>{x.gridTexture.ref.value.destroy()}},oe)}const um={"gaussian-volume":(oe,x)=>(0,pr.Kp)("Gaussian volume",oe,x,J0),"units-gaussian-volume":(oe,x)=>(0,pr.TP)("Units-Gaussian volume",oe,x,tg)},lm={...cm,jumpLength:v.t.Numeric(4,{min:0,max:20,step:.1}),visuals:v.t.MultiSelect(["gaussian-volume"],v.t.objectToOptions(um))},og=(0,pr.GT)({name:"gaussian-volume",label:"Gaussian Volume",description:"Displays a gaussian molecular density using direct volume rendering.",factory:function rg(oe,x){return dr.YL.createMulti("Gaussian Volume",oe,x,pr.J1,um)},getParams:function ng(oe,x){return lm},defaultValues:v.t.getDefaultValues(lm),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:oe=>oe.elementCount>0}),ig=g.eB.scale,sg=g.eB.add,ag=g.eB.sub,Zl={...tr.Te,...tr.lm,sizeFactor:v.t.Numeric(.3,{min:0,max:10,step:.01}),radialSegments:v.t.Numeric(16,{min:2,max:56,step:2},Jn.iy.CustomQualityParamInfo),tryUseImpostor:v.t.Boolean(!0)};function cg(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth?function lg(oe){return(0,tr.Vb)({defaultProps:v.t.getDefaultValues(Zl),createGeometry:ug,createLocationIterator:x=>ia.fromGroup(x),getLoci:Ba,eachLocation:Da,setUpdateState:(x,F,z)=>{},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function fg(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(Zl),createGeometry:dg,createLocationIterator:x=>ia.fromGroup(x),getLoci:Ba,eachLocation:Da,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.radialSegments!==z.radialSegments},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}function ug(oe,x,F,z,me,Pe){const Ge=x.polymerElements.length;if(!Ge)return ci.S.createEmpty(Pe);const Xe=2*Ge,Qe=jd.h.create(Xe,Xe/4,Pe),lt=x.conformation,ft=(0,g.eB)(),wt=(0,g.eB)(),Ut=(0,g.eB)();ld(x,function(wn,Bn,Mn,Ln,cr){lt.invariantPosition(wn,ft),lt.invariantPosition(Bn,wt);const Qn=(0,Tr.OV)(cr)?tu:eu;sg(Ut,ft,ig(Ut,ag(Ut,wt,ft),Qn)),Qe.add(ft[0],ft[1],ft[2],Ut[0],Ut[1],Ut[2],1,!1,!1,2,Mn),Qe.add(Ut[0],Ut[1],Ut[2],wt[0],wt[1],wt[2],1,!1,!1,2,Ln)});const gn=Qe.getCylinders(),Pn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return gn.setBoundingSphere(Pn),gn}function dg(oe,x,F,z,me,Pe){const Ge=x.polymerElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{radialSegments:Xe,sizeFactor:Qe}=me,lt=2*Xe*Ge*2,ft=lr.P.createState(lt,lt/10,Pe),wt=x.conformation,Ut=(0,g.eB)(),Jt=(0,g.eB)(),gn={radiusTop:1,radiusBottom:1,radialSegments:Xe},Pn=Je.iZ.Location.create(F,x),wn=Je.iZ.Location.create(F,x);ld(x,function(cr,qn,Qn,Zn,zn){Pn.element=cr,wn.element=qn,wt.invariantPosition(Pn.element,Ut),wt.invariantPosition(wn.element,Jt);const wr=(0,Tr.OV)(zn)?tu:eu;gn.radiusTop=gn.radiusBottom=z.size.size(Pn)*Qe,ft.currentGroup=Qn,(0,_i.y9)(ft,Ut,Jt,wr,gn),gn.radiusTop=gn.radiusBottom=z.size.size(wn)*Qe,ft.currentGroup=Zn,(0,_i.y9)(ft,Jt,Ut,1-wr,gn)});const Mn=lr.P.getMesh(ft),Ln=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return Mn.setBoundingSphere(Ln),Mn}const Yl={...tr.Te,...tr.qg,sizeFactor:v.t.Numeric(.3,{min:0,max:10,step:.01}),detail:v.t.Numeric(0,{min:0,max:3,step:1},Jn.iy.CustomQualityParamInfo),tryUseImpostor:v.t.Boolean(!0)};function mg(oe,x,F,z){return F.tryUseImpostor&&z&&z.extensions.fragDepth&&z.extensions.textureFloat?function hg(oe){return(0,tr.uF)({defaultProps:v.t.getDefaultValues(Yl),createGeometry:pg,createLocationIterator:x=>ia.fromGroup(x),getLoci:Ba,eachLocation:Da,setUpdateState:(x,F,z)=>{},mustRecreate:(x,F,z)=>!F.tryUseImpostor||!z},oe)}(oe):function yg(oe){return(0,tr.Pv)({defaultProps:v.t.getDefaultValues(Yl),createGeometry:gg,createLocationIterator:x=>ia.fromGroup(x),getLoci:Ba,eachLocation:Da,setUpdateState:(x,F,z)=>{x.createGeometry=F.sizeFactor!==z.sizeFactor||F.detail!==z.detail},mustRecreate:(x,F,z)=>F.tryUseImpostor&&!!z},oe)}(oe)}function pg(oe,x,F,z,me,Pe){const Ge=x.polymerElements.length;if(!Ge)return Qr.v.createEmpty(Pe);const Xe=Bi.create(Ge,Ge/2,Pe),Qe=x.conformation,lt=(0,g.eB)();dd(x,(Jt,gn)=>{Qe.invariantPosition(Jt,lt),Xe.add(lt[0],lt[1],lt[2],gn)});const wt=Xe.getSpheres(),Ut=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return wt.setBoundingSphere(Ut),wt}function gg(oe,x,F,z,me,Pe){const Ge=x.polymerElements.length;if(!Ge)return rr.e.createEmpty(Pe);const{detail:Xe,sizeFactor:Qe}=me,lt=Ge*(0,zr.J)(Xe),ft=lr.P.createState(lt,lt/2,Pe),wt=x.conformation,Ut=(0,g.eB)(),Jt=Je.iZ.Location.create(F,x);dd(x,(Bn,Mn)=>{Jt.element=Bn,wt.invariantPosition(Jt.element,Ut),ft.currentGroup=Mn,(0,kr.X)(ft,Ut,z.size.size(Jt)*Qe,Xe)});const Pn=lr.P.getMesh(ft),wn=Bt.f8.expand((0,Bt.f8)(),x.boundary.sphere,1*me.sizeFactor);return Pn.setBoundingSphere(wn),Pn}const dm={"polymer-backbone-cylinder":(oe,x)=>(0,vn.T)("Polymer backbone cylinder",oe,x,cg),"polymer-backbone-sphere":(oe,x)=>(0,vn.T)("Polymer backbone sphere",oe,x,mg),"polymer-gap":(oe,x)=>(0,vn.T)("Polymer gap cylinder",oe,x,ll)},fm={...Yl,...Zl,...xu,sizeAspectRatio:v.t.Numeric(1,{min:.1,max:3,step:.1}),visuals:v.t.MultiSelect(["polymer-backbone-cylinder","polymer-backbone-sphere","polymer-gap"],v.t.objectToOptions(dm)),bumpFrequency:v.t.Numeric(0,{min:0,max:10,step:.1},Jn.iy.ShadingCategory),colorMode:v.t.Select("default",v.t.arrayToOptions(["default","interpolate"]),{...Jn.iy.ShadingCategory,isHidden:!0})},bg=(0,pr.GT)({name:"backbone",label:"Backbone",description:"Displays polymer backbone with cylinders and spheres.",factory:function _g(oe,x){return dr.YL.createMulti("Backbone",oe,x,pr.J1,dm)},getParams:function vg(oe,x){const F=v.t.clone(fm);let z=!1;return x.units.forEach(me=>{!z&&me.gapElements.length&&(z=!0)}),F.visuals.defaultValue=["polymer-backbone-cylinder","polymer-backbone-sphere"],z&&F.visuals.defaultValue.push("polymer-gap"),F},defaultValues:v.t.getDefaultValues(fm),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:oe=>oe.polymerResidueCount>0});class kc extends dr.lN{constructor(){super(),(0,ae.IF)(kc.BuiltIn,(x,F)=>{if(x.name!==F)throw new Error(`Fix BuiltInStructureRepresentations to have matching names. ${x.name} ${F}`);this.add(x)})}}!function(oe){oe.BuiltIn={cartoon:uh,backbone:bg,"ball-and-stick":fo,carbohydrate:Pm,ellipsoid:ph,"gaussian-surface":Qh,"gaussian-volume":og,label:e0,line:X0,"molecular-surface":h0,orientation:E0,point:M0,putty:F0,spacefill:V0}}(kc||(kc={}));var xg=n(3866),mm=n(274),pm=n(2832),hm=n(190),Cg=n(3188),Hc=n(4080),Mu=n(2229),Xl=n(8956),$l=n(9854),Sg=n(2098);class Eg{get isAnimating(){return this._isAnimating}tick(x,F){var z=this;return(0,r.A)(function*(){var me,Pe;if(yield z.plugin.managers.animation.tick(x,F?.isSynchronous,F?.animation),null===(me=z.plugin.canvas3d)||void 0===me||me.tick(x,F),se.g$){const Ge=null===(Pe=z.plugin.canvas3d)||void 0===Pe?void 0:Pe.webgl.timer.resolve();if(Ge)for(const Xe of Ge)(0,Sg.d)([Xe])}})()}resetTime(x=(0,$l.t)()){var F;null===(F=this.plugin.canvas3d)||void 0===F||F.resetTime(x)}start(x){var F;null===(F=this.plugin.canvas3d)||void 0===F||F.resume(),this._isAnimating=!0,this.resetTime(),x?.immediate?this.frame():this.currentFrame=requestAnimationFrame(this.frame)}stop(x){var F;this._isAnimating=!1,void 0!==this.currentFrame&&(cancelAnimationFrame(this.currentFrame),this.currentFrame=void 0),x?.noDraw&&(null===(F=this.plugin.canvas3d)||void 0===F||F.pause(x?.noDraw))}constructor(x){this.plugin=x,this.currentFrame=void 0,this._isAnimating=!1,this.frame=()=>{this.tick((0,$l.t)()),this._isAnimating&&(this.currentFrame=requestAnimationFrame(this.frame))}}}var ka=n(1164),Ig=n(6852),Ag=n(2768);class Pg{getDecorator(x){const F=this.plugin.state.data.tree,z=F.children.get(x);if(1!==z.size)return x;const me=z.first();return F.transforms.get(me).transformer.definition.isDecorator?this.getDecorator(me):x}get(x,F=!1){const z=this.root.get(x);if(z)return this.plugin.state.data.cells.get(F?z.ref:this.getDecorator(z.ref))}addMapping(x,F,z){if(!A.O.Molecule.Structure.is(z))return!1;if(this.tracked.set(F,z.data),this.root.has(z.data))this.root.get(z.data).count++;else{const me=x.select(c.QX.Generators.byRef(F).rootOfType([A.O.Molecule.Structure]))[0];this.root.set(z.data,me?{ref:me.transform.ref,count:1}:{ref:F,count:1})}return!0}removeMapping(x){if(!this.tracked.has(x))return!1;const F=this.tracked.get(x);this.tracked.delete(x);const z=this.root.get(F);return z.count>1?z.count--:this.root.delete(F),!0}updateMapping(x,F,z,me){return!!A.O.Molecule.Structure.is(me)&&(this.removeMapping(F),this.addMapping(x,F,me),!0)}dispose(){this.ev.dispose()}constructor(x){this.plugin=x,this.ev=Xl.V.create(),this.events={updated:this.ev(),removed:this.ev()},this.root=new Map,this.tracked=new Map,x.state.data.events.object.created.subscribe(F=>{this.addMapping(F.state,F.ref,F.obj)}),x.state.data.events.object.removed.subscribe(F=>{this.removeMapping(F.ref)&&this.events.removed.next({ref:F.ref,obj:F.obj})}),x.state.data.events.object.updated.subscribe(F=>{this.updateMapping(F.state,F.ref,F.oldObj,F.obj)&&this.events.updated.next({ref:F.ref,oldObj:F.oldObj,obj:F.obj})})}}var gm=n(6241);class Jl{constructor(){this.ev=Xl.V.create(),this.id=0,this.runningTasks=new Set,this.abortRequests=new Map,this.options=new Map,this.currentContext=[],this.events={progress:this.ev(),finished:this.ev()}}tryGetAbortTaskId(x){if(this.abortRequests.has(x.progress.taskId))return x.progress.taskId;for(const F of x.children){const z=this.tryGetAbortTaskId(F);if(void 0!==z)return z}}track(x,F){return z=>{var me;if(z.canAbort&&z.requestAbort){const Ge=this.tryGetAbortTaskId(z.root);void 0!==Ge&&z.requestAbort(this.abortRequests.get(Ge))}const Pe=(0,$l.t)()-z.root.progress.startedTime;this.events.progress.next({id:x,useOverlay:null===(me=this.options.get(F))||void 0===me?void 0:me.useOverlay,level:Pe<250?"none":"background",progress:z})}}run(x,F){var z=this;return(0,r.A)(function*(){const me=z.id++;let Pe;F?.createNewContext||0===z.currentContext.length?Pe={ctx:(0,gm.pm)(x,z.track(me,x.id),100),refCount:1}:(Pe=z.currentContext[z.currentContext.length-1],Pe.refCount++);try{return z.options.set(x.id,{useOverlay:!!F?.useOverlay}),z.runningTasks.add(x.id),yield(0,gm.yR)(Pe.ctx,x)}finally{z.options.delete(x.id),z.runningTasks.delete(x.id),z.events.finished.next({id:me}),z.abortRequests.delete(x.id),Pe.refCount--,0===Pe.refCount&&(0,nt.mO)(z.currentContext,Pe)}})()}requestAbortAll(x){this.runningTasks.forEach(F=>this.abortRequests.set(F,x))}requestAbort(x,F){this.abortRequests.set("number"==typeof x?x:x.root.progress.taskId,F)}dispose(){this.ev.dispose()}}!function(oe){function x(z){return new Promise(me=>setTimeout(me,z))}oe.testTask=function F(z){return R.YZ.create("Test",function(){var me=(0,r.A)(function*(Pe){let Ge=0;for(;Ge!!F&&F.key===x)}show(x){let z,F=this.state.entries;const me=++this.serialId;let Pe;x.key&&(z=this.findByKey(x.key))?(void 0!==z.timeout&&clearTimeout(z.timeout),Pe=z.serialNumber,F=F.remove(z.id)):Pe=++this.serialNumber,z={id:me,serialNumber:Pe,key:x.key,title:x.title,message:x.message,timeout:this.timeout(me,x.timeoutMs),hide:()=>this.hideId(me)},this.updateState({entries:F.set(me,z)})&&this.events.changed.next(void 0)}timeout(x,F){if(void 0!==F)return F<0&&(F=500),setTimeout(()=>{const z=this.state.entries.get(x);z.timeout=void 0,this.hide(z)},F)}hideId(x){this.hide(this.state.entries.get(x))}hide(x){x&&(void 0!==x.timeout&&clearTimeout(x.timeout),x.hide=void 0,this.updateState({entries:this.state.entries.delete(x.id)})&&this.events.changed.next(void 0))}constructor(x){super({entries:(0,Se.uY)()}),this.events={changed:this.ev()},this.serialNumber=0,this.serialId=0,i.a.Toast.Show.subscribe(x,F=>this.show(F)),i.a.Toast.Hide.subscribe(x,F=>this.hide(this.findByKey(F.key)))}}var Bg=n(7028),Dg=n(2732),Mg=n(9986);class Og extends Yt.N{createParams(){const x=Math.min(this.plugin.canvas3d?this.plugin.canvas3d.webgl.maxRenderbufferSize:4096,4096);return{resolution:v.t.MappedStatic("viewport",{viewport:v.t.Group({}),hd:v.t.Group({}),"full-hd":v.t.Group({}),"ultra-hd":v.t.Group({}),custom:v.t.Group({width:v.t.Numeric(1920,{min:128,max:x,step:1}),height:v.t.Numeric(1080,{min:128,max:x,step:1})},{isFlat:!0})},{options:[["viewport","Viewport"],["hd","HD (1280 x 720)"],["full-hd","Full HD (1920 x 1080)"],["ultra-hd","Ultra HD (3840 x 2160)"],["custom","Custom"]]}),transparent:v.t.Boolean(!1),axes:Bg.kf.axes}}get params(){return this._params?this._params:this._params=this.createParams()}get values(){return this.behaviors.values.value}get cropParams(){return this.behaviors.cropParams.value}get relativeCrop(){return this.behaviors.relativeCrop.value}getCanvasSize(){var x,F;return{width:(null===(x=this.plugin.canvas3d)||void 0===x?void 0:x.webgl.gl.drawingBufferWidth)||0,height:(null===(F=this.plugin.canvas3d)||void 0===F?void 0:F.webgl.gl.drawingBufferHeight)||0}}getSize(){const x=this.values;switch(x.resolution.name){case"viewport":return this.getCanvasSize();case"hd":return{width:1280,height:720};case"full-hd":return{width:1920,height:1080};case"ultra-hd":return{width:3840,height:2160};default:return{width:x.resolution.params.width,height:x.resolution.params.height}}}createPass(x){const F=this.plugin.canvas3d,{colorBufferFloat:z,textureFloat:me}=F.webgl.extensions,Pe=F.props.postprocessing.occlusion;return F.getImagePass({transparentBackground:this.values.transparent,cameraHelper:{axes:this.values.axes},multiSample:{...F.props.multiSample,mode:x?"on":"off",sampleLevel:z&&me?4:2},postprocessing:{...F.props.postprocessing,occlusion:"on"===Pe.name?{name:"on",params:{...Pe.params,samples:128,resolutionScale:F.webgl.pixelRatio}}:Pe},marking:{...F.props.marking}})}get previewPass(){return this._previewPass||(this._previewPass=this.createPass(!1))}get imagePass(){if(this._imagePass){const x=this.plugin.canvas3d,F=x.props.postprocessing.occlusion;return this._imagePass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:{...x.props.postprocessing,occlusion:"on"===F.name?{name:"on",params:{...F.params,samples:128,resolutionScale:x.webgl.pixelRatio}}:F},marking:{...x.props.marking}}),this._imagePass}return this._imagePass=this.createPass(!0)}getFilename(x=".png"){const F=this.plugin.state.data.select(c.QX.Generators.rootsOfType(A.O.Molecule.Model)).map(Pe=>Pe.obj.data),z=new Set;return F.forEach(Pe=>z.add(Pe.entryId.toUpperCase())),`${Mg.M.toArray(z).join("-")||"molstar-image"}${x}`}resetCrop(){this.behaviors.relativeCrop.next({x:0,y:0,width:1,height:1})}toggleAutocrop(){this.cropParams.auto?(this.behaviors.cropParams.next({...this.cropParams,auto:!1}),this.resetCrop()):this.behaviors.cropParams.next({...this.cropParams,auto:!0})}get isFullFrame(){const x=this.relativeCrop;return(0,bc.T)(x.x,0,1e-5)&&(0,bc.T)(x.y,0,1e-5)&&(0,bc.T)(x.width,1,1e-5)&&(0,bc.T)(x.height,1,1e-5)}autocrop(x=this.cropParams.relativePadding){const{data:F,width:z,height:me}=this.previewData.image,Pe=this.previewData.transparent,Ge=Pe?this.previewData.background:4278190080|this.previewData.background;let Xe=z,Qe=0,lt=me,ft=0;for(let gn=0;gnQe&&(Qe=wn),gnft&&(ft=gn)}}if(Xe>Qe){const gn=Xe;Xe=Qe,Qe=gn}if(lt>ft){const gn=lt;lt=ft,ft=gn}const wt=Qe-Xe+1,Ut=ft-lt+1;Xe-=x*wt,Qe+=x*wt,lt-=x*Ut,ft+=x*Ut;const Jt={x:Math.max(0,Xe/z),y:Math.max(0,lt/me),width:Math.min(1,(Qe-Xe+1)/z),height:Math.min(1,(ft-lt+1)/me)};this.behaviors.relativeCrop.next(Jt)}getPreview(x=320){const{width:F,height:z}=this.getSize();if(F<=0||z<=0)return;const me=F/z;let Pe=0,Ge=0;me>1?(Pe=x,Ge=Math.round(x/me)):(Ge=x,Pe=Math.round(x*me));const Xe=this.plugin.canvas3d.props;this.previewPass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:Xe.postprocessing,marking:Xe.marking});const Qe=this.previewPass.getImageData(Pe,Ge),lt=this.previewCanvas;lt.width=Qe.width,lt.height=Qe.height,this.previewData.image=Qe,this.previewData.background=Xe.renderer.backgroundColor,this.previewData.transparent=this.values.transparent;const ft=lt.getContext("2d");if(!ft)throw new Error("Could not create canvas 2d context");return ft.putImageData(Qe,0,0),this.cropParams.auto&&this.autocrop(),this.events.previewed.next(void 0),{canvas:lt,width:Pe,height:Ge}}getSizeAndViewport(){const{width:x,height:F}=this.getSize(),z=this.relativeCrop,me={x:Math.floor(z.x*x),y:Math.floor(z.y*F),width:Math.ceil(z.width*x),height:Math.ceil(z.height*F)};return me.width+me.x>x&&(me.width=x-me.x),me.height+me.y>F&&(me.height=F-me.y),{width:x,height:F,viewport:me}}draw(x){var F=this;return(0,r.A)(function*(){const{width:z,height:me,viewport:Pe}=F.getSizeAndViewport();if(z<=0||me<=0)return;yield x.update("Rendering image...");const Ge=F.imagePass;yield Ge.updateBackground();const Xe=Ge.getImageData(z,me,Pe);yield x.update("Encoding image...");const Qe=F.canvas;Qe.width=Xe.width,Qe.height=Xe.height;const lt=Qe.getContext("2d");if(!lt)throw new Error("Could not create canvas 2d context");lt.putImageData(Xe,0,0)})()}copyToClipboardTask(){var x=this;const F=navigator.clipboard;if(F?.write)return R.YZ.create("Copy Image",function(){var z=(0,r.A)(function*(me){yield x.draw(me),yield me.update("Converting image...");const Pe=yield(0,ie.PG)(x.canvas,"png"),Ge=new ClipboardItem({"image/png":Pe});yield F.write([Ge]),x.plugin.log.message("Image copied to clipboard.")});return function(me){return z.apply(this,arguments)}}());this.plugin.log.error("clipboard.write not supported!")}getImageDataUri(){var x=this;return this.plugin.runTask(R.YZ.create("Generate Image",function(){var F=(0,r.A)(function*(z){return yield x.draw(z),yield z.update("Converting image..."),x.canvas.toDataURL("png")});return function(z){return F.apply(this,arguments)}}()))}copyToClipboard(){const x=this.copyToClipboardTask();if(x)return this.plugin.runTask(x)}downloadTask(x){var F=this;return R.YZ.create("Download Image",function(){var z=(0,r.A)(function*(me){yield F.draw(me),yield me.update("Downloading image...");const Pe=yield(0,ie.PG)(F.canvas,"png");(0,Dg.R)(Pe,x??F.getFilename())});return function(me){return z.apply(this,arguments)}}())}download(x){this.plugin.runTask(this.downloadTask(x))}constructor(x){super(),this.plugin=x,this._params=void 0,this.behaviors={values:this.ev.behavior({transparent:this.params.transparent.defaultValue,axes:{name:"off",params:{}},resolution:this.params.resolution.defaultValue}),cropParams:this.ev.behavior({auto:!0,relativePadding:.1}),relativeCrop:this.ev.behavior({x:0,y:0,width:1,height:1})},this.events={previewed:this.ev()},this.canvas=document.createElement("canvas"),this.previewCanvas=document.createElement("canvas"),this.previewData={image:{data:new Uint8ClampedArray(1),width:1,height:0},background:(0,hm.Q1)(0),transparent:!1}}}var ym=n(6101);class Rg{addHandler(x,F){const z=this.handlers.findIndex(me=>me[0]===x);z<0?this.handlers.push([x,F]):this.handlers[z][1]=F}removeHandler(x){const F=this.handlers.findIndex(z=>z[0]===x);F>=0&&this.handlers.splice(F,1)}handle(x){var F=this;return(0,r.A)(function*(){for(let z=F.handlers.length-1;z>=0;z--){const me=F.handlers[z][1];if(yield me(x,F.plugin))return}!function Lg(oe,x){const F=x.filter(z=>{const me=z.name.toLowerCase();return me.endsWith(".molx")||me.endsWith(".molj")});F.length>0?i.a.State.Snapshots.OpenFile(oe,{file:F[0]}):oe.runTask(oe.state.data.applyAction(w.OpenFiles,{files:x.map(z=>p.V.File(z)),format:{name:"auto",params:{}},visuals:!0}))}(F.plugin,x)})()}dispose(){this.handlers.length=0}constructor(x){this.plugin=x,this.handlers=[]}}class wg{get isInitialized(){return this._isInitialized}build(){return this.state.data.build()}initContainer(x){var F;if(this.canvasContainer)return!0;const z=document.createElement("div");Object.assign(z.style,{position:"absolute",left:0,top:0,right:0,bottom:0,"-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none","touch-action":"manipulation"});let me=null===(F=x?.canvas3dContext)||void 0===F?void 0:F.canvas;return me||(me=document.createElement("canvas"),x?.checkeredCanvasBackground&&Object.assign(me.style,{"background-image":"linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey), linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey)","background-size":"60px 60px","background-position":"0 0, 30px 30px"}),z.appendChild(me)),!!this.initViewer(me,z,x?.canvas3dContext)&&(this.canvasContainer=z,!0)}mount(x,F){var z;if(this.disposed)throw new Error("Cannot mount a disposed context");return!!this.initContainer(F)&&(this.canvasContainer.parentElement!==x&&(null===(z=this.canvasContainer.parentElement)||void 0===z||z.removeChild(this.canvasContainer)),x.appendChild(this.canvasContainer),this.handleResize(),!0)}unmount(){var x,F;null===(F=null===(x=this.canvasContainer)||void 0===x?void 0:x.parentElement)||void 0===F||F.removeChild(this.canvasContainer)}initViewer(x,F,z){var me,Pe,Ge,Xe,Qe,lt;try{this.layout.setRoot(F),this.spec.layout&&this.spec.layout.initial&&this.layout.setProps(this.spec.layout.initial),z||(z=Te.H7.fromCanvas(x,this.managers.asset,{antialias:!(null!==(me=this.config.get(je.AB.General.DisableAntialiasing))&&void 0!==me&&me),preserveDrawingBuffer:!(null!==(Pe=this.config.get(je.AB.General.DisablePreserveDrawingBuffer))&&void 0!==Pe&&Pe),preferWebGl1:this.config.get(je.AB.General.PreferWebGl1)||!1,failIfMajorPerformanceCaveat:!(null!==(Ge=this.config.get(je.AB.General.AllowMajorPerformanceCaveat))&&void 0!==Ge&&Ge),powerPreference:this.config.get(je.AB.General.PowerPreference)||"high-performance",handleResize:this.handleResize},{pixelScale:this.config.get(je.AB.General.PixelScale)||1,pickScale:this.config.get(je.AB.General.PickScale)||.25,transparency:this.config.get(je.AB.General.Transparency)||"wboit"})),this.canvas3dContext=z,this.canvas3d=Te.mX.create(this.canvas3dContext),this.canvas3dInit.next(!0);let ft=this.spec.canvas3d;const wt=(0,hm.Q1)(16579577);return ft?(void 0===(null===(Qe=ft.renderer)||void 0===Qe?void 0:Qe.backgroundColor)&&(ft=(0,Oe.jM)(ft,Ut=>{Ut.renderer?Ut.renderer.backgroundColor=wt:Ut.renderer={backgroundColor:wt}})),null===(lt=this.canvas3d)||void 0===lt||lt.setProps(ft)):null===(Xe=this.canvas3d)||void 0===Xe||Xe.setProps({renderer:{backgroundColor:wt}}),this.animationLoop.start(),this.helpers.viewportScreenshot=new Og(this),this.subs.push(this.canvas3d.interaction.click.subscribe(Ut=>this.behaviors.interaction.click.next(Ut))),this.subs.push(this.canvas3d.interaction.drag.subscribe(Ut=>this.behaviors.interaction.drag.next(Ut))),this.subs.push(this.canvas3d.interaction.hover.subscribe(Ut=>this.behaviors.interaction.hover.next(Ut))),this.subs.push(this.canvas3d.input.resize.pipe((0,Ne.B)(50),(0,K.c)(100,void 0,{leading:!1,trailing:!0})).subscribe(()=>this.handleResize())),this.subs.push(this.canvas3d.input.keyDown.subscribe(Ut=>this.behaviors.interaction.key.next(Ut))),this.subs.push(this.canvas3d.input.keyUp.subscribe(Ut=>this.behaviors.interaction.keyReleased.next(Ut))),this.subs.push(this.layout.events.updated.subscribe(()=>requestAnimationFrame(()=>this.handleResize()))),this.handleResize(),R._F.setImmediate(()=>this.initCanvas3dPromiseCallbacks[0]()),!0}catch(ft){return this.log.error(""+ft),console.error(ft),R._F.setImmediate(()=>this.initCanvas3dPromiseCallbacks[1](ft)),!1}}get isBusy(){return this.behaviors.state.isAnimating.value||this.behaviors.state.isUpdating.value}get selectionMode(){return this.behaviors.interaction.selectionMode.value}set selectionMode(x){this.behaviors.interaction.selectionMode.next(x)}dataTransaction(x,F){return this.runTask(this.state.data.transaction(x,F))}clear(x=!1){var F;return x&&(null===(F=this.canvas3d)||void 0===F||F.setProps(Te.FN)),i.a.State.RemoveObject(this,{state:this.state.data,ref:c.Cn.RootRef})}dispose(x){var F,z;if(!this.disposed){for(const me of this.subs)me.unsubscribe();this.subs=[],this.animationLoop.stop(),this.commands.dispose(),null===(F=this.canvas3d)||void 0===F||F.dispose(),null===(z=this.canvas3dContext)||void 0===z||z.dispose(x),this.ev.dispose(),this.state.dispose(),this.helpers.substructureParent.dispose(),(0,ae.IF)(this.managers,me=>{var Pe;return null===(Pe=me?.dispose)||void 0===Pe?void 0:Pe.call(me)}),(0,ae.IF)(this.managers.structure,me=>{var Pe;return null===(Pe=me?.dispose)||void 0===Pe?void 0:Pe.call(me)}),(0,ae.IF)(this.managers.volume,me=>{var Pe;return null===(Pe=me?.dispose)||void 0===Pe?void 0:Pe.call(me)}),this.unmount(),this.canvasContainer=void 0,this.customState={},this.disposed=!0}}initBehaviorEvents(){this.subs.push((0,Ve.h)(this.state.data.behaviors.isUpdating,this.state.behaviors.behaviors.isUpdating).subscribe(Ge=>{this.behaviors.state.isUpdating.value!==Ge&&this.behaviors.state.isUpdating.next(Ge)}));const x=this.config.get(je.AB.General.IsBusyTimeoutMs)||750,F=this.behaviors.state.isBusy;let z;const me=()=>{F.value||F.next(!0)},Pe=()=>{void 0!==z&&clearTimeout(z),z=void 0};this.subs.push((0,Ve.h)(this.behaviors.state.isUpdating,this.behaviors.state.isAnimating).subscribe(Ge=>{this.behaviors.state.isUpdating.value||this.behaviors.state.isAnimating.value?F.value||(Pe(),z=setTimeout(me,x)):(Pe(),F.next(!1))})),this.subs.push(this.behaviors.interaction.selectionMode.subscribe(Ge=>{var Xe;Ge||null===(Xe=this.managers.interactivity)||void 0===Xe||Xe.lociSelects.deselectAll()}))}initBuiltInBehavior(){a.U0.State.registerDefault(this),a.U0.Representation.registerDefault(this),a.U0.Camera.registerDefault(this),a.U0.Misc.registerDefault(this),this.subs.push((0,Ve.h)(this.state.data.events.log,this.state.behaviors.events.log).subscribe(x=>this.events.log.next(x)))}initBehaviors(){var x=this;return(0,r.A)(function*(){let F=x.state.behaviors.build();for(const z of Object.keys(ka.A.Categories))F.toRoot().apply(ka.A.CreateCategory,{label:ka.A.Categories[z]},{ref:z,state:{isLocked:!0}});for(const z of x.spec.behaviors)"custom-props"===ka.A.getCategoryId(z.transformer)&&F.to(ka.A.getCategoryId(z.transformer)).apply(z.transformer,z.defaultParams,{ref:z.transformer.id});yield x.runTask(x.state.behaviors.updateTree(F,{doNotUpdateCurrent:!0,doNotLogTiming:!0})),F=x.state.behaviors.build();for(const z of x.spec.behaviors)"custom-props"!==ka.A.getCategoryId(z.transformer)&&F.to(ka.A.getCategoryId(z.transformer)).apply(z.transformer,z.defaultParams,{ref:z.transformer.id});yield x.runTask(x.state.behaviors.updateTree(F,{doNotUpdateCurrent:!0,doNotLogTiming:!0}))})()}initCustomFormats(){if(this.spec.customFormats)for(const x of this.spec.customFormats)this.dataFormats.add(x[0],x[1])}initAnimations(){if(this.spec.animations)for(const x of this.spec.animations)this.managers.animation.register(x)}initDataActions(){if(this.spec.actions)for(const x of this.spec.actions)this.state.data.actions.add(x.action)}init(){var x=this;return(0,r.A)(function*(){try{x.subs.push(x.events.log.subscribe(F=>x.log.entries=x.log.entries.push(F))),x.initCustomFormats(),x.initBehaviorEvents(),x.initBuiltInBehavior(),x.managers.interactivity=new Kn.d(x),x.managers.lociLabels=new Ft(x),x.builders.structure=new Dn(x),x.initAnimations(),x.initDataActions(),yield x.initBehaviors(),x.log.message(`Mol* Plugin ${ym.j} [${ym.s.toLocaleString()}]`),se.Zq||x.log.message("Development mode enabled"),se.Bb&&x.log.message("Debug mode enabled"),x._isInitialized=!0,x.initializedPromiseCallbacks[0]()}catch(F){throw x.initializedPromiseCallbacks[1](F),F}})()}constructor(x){var F;this.spec=x,this.runTask=(z,me)=>this.managers.task.run(z,me),this.resolveTask=z=>{if(z)return R.YZ.is(z)?this.runTask(z):z},this.subs=[],this.initCanvas3dPromiseCallbacks=[()=>{},()=>{}],this._isInitialized=!1,this.initializedPromiseCallbacks=[()=>{},()=>{}],this.disposed=!1,this.canvasContainer=void 0,this.ev=Xl.V.create(),this.config=new je.tf(this.spec.config),this.state=new Ag.p(this),this.commands=new Ig.K,this.canvas3dInit=this.ev.behavior(!1),this.behaviors={state:{isAnimating:this.ev.behavior(!1),isUpdating:this.ev.behavior(!1),isBusy:this.ev.behavior(!1)},interaction:{hover:this.ev.behavior({current:dr.YL.Loci.Empty,modifiers:Hc.Fs.None,buttons:0,button:0}),click:this.ev.behavior({current:dr.YL.Loci.Empty,modifiers:Hc.Fs.None,buttons:0,button:0}),drag:this.ev.behavior({current:dr.YL.Loci.Empty,modifiers:Hc.Fs.None,buttons:0,button:0,pageStart:(0,g.ZY)(),pageEnd:(0,g.ZY)()}),key:this.ev.behavior(Hc.Vl),keyReleased:this.ev.behavior(Hc.Vl),selectionMode:this.ev.behavior(!1)},labels:{highlight:this.ev.behavior({labels:[]})},layout:{leftPanelTabName:this.ev.behavior("root")},canvas3d:{initialized:this.canvas3dInit.pipe((0,ne.p)(z=>!!z),(0,be.s)(1))}},this.canvas3dInitialized=new Promise((z,me)=>{this.initCanvas3dPromiseCallbacks=[z,me]}),this.initialized=new Promise((z,me)=>{this.initializedPromiseCallbacks=[z,me]}),this.layout=new Fn(this),this.animationLoop=new Eg(this),this.representation={structure:{registry:new kc,themes:{colorThemeRegistry:mm.J.createRegistry(),sizeThemeRegistry:pm.F.createRegistry()}},volume:{registry:new xg.H,themes:{colorThemeRegistry:mm.J.createRegistry(),sizeThemeRegistry:pm.F.createRegistry()}}},this.query={structure:{registry:new dt.lL}},this.dataFormats=new ct,this.builders={data:new ve(this),structure:void 0},this.helpers={substructureParent:new Pg(this),viewportScreenshot:void 0},this.managers={structure:{hierarchy:new on.G(this),component:new ht.C(this),measurement:new En.$T(this),selection:new Ye(this),focus:new fn(this)},volume:{hierarchy:new mn.L(this)},interactivity:void 0,camera:new Nn(this),animation:new cn(this),snapshot:new Qt.g(this),lociLabels:void 0,toast:new Tg(this),asset:new p.E,task:new Jl,dragAndDrop:new Rg(this)},this.events={log:this.ev(),task:this.managers.task.events,canvas3d:{settingsUpdated:this.ev()}},this.customModelProperties=new ue.Registry,this.customStructureProperties=new ue.Registry,this.customStructureControls=new Map,this.customImportControls=new Map,this.genericRepresentationControls=new Map,this.customState=Object.create(null),this.handleResize=()=>{var z,me;const Pe=null===(z=this.canvas3dContext)||void 0===z?void 0:z.canvas,Ge=this.layout.root;Ge&&Pe&&((0,ie.H5)(Pe,Ge,this.canvas3dContext.props.pixelScale),null===(me=this.canvas3d)||void 0===me||me.requestResize())},this.log={entries:(0,Se.B8)(),entry:z=>this.events.log.next(z),error:z=>this.events.log.next(Mu.x.error(z)),message:z=>this.events.log.next(Mu.x.message(z)),info:z=>this.events.log.next(Mu.x.info(z)),warn:z=>this.events.log.next(Mu.x.warning(z))},this.fetch=Cg.hW,(0,Oe.ht)(!1),(0,uo.GW)(null!==(F=this.config.get(je.AB.Structure.SaccharideCompIdMapType))&&void 0!==F?F:"default")}}class Fg extends wg{initCustomParamEditors(){if(this.spec.customParamEditors)for(const[x,F]of this.spec.customParamEditors)this.customParamEditors.set(x.id,F)}dispose(x){super.dispose(x),this.layout.dispose()}constructor(x){super(x),this.spec=x,this.customParamEditors=new Map,this.initCustomParamEditors()}}var Ng=n(6648),Ug=n(6354),Vg=n(9568),Gg=n(4438);let zg=(()=>{class oe{constructor(){this.plugin=new Fg({actions:[W.Action(Q.Structure.DownloadStructure),W.Action(Q.Volume.DownloadDensity),W.Action(Q.DataFormat.DownloadFile),W.Action(Q.DataFormat.OpenFiles),W.Action(Q.Structure.LoadTrajectory),W.Action(Q.Structure.EnableModelCustomProps),W.Action(Q.Structure.EnableStructureCustomProps),W.Action(o.p3),W.Action(o.Cd),W.Action(o.N$),W.Action(y.f.Data.Download),W.Action(y.f.Data.ParseCif),W.Action(y.f.Data.ParseCcp4),W.Action(y.f.Data.ParseDsn6),W.Action(y.f.Model.TrajectoryFromMmCif),W.Action(y.f.Model.TrajectoryFromCifCore),W.Action(y.f.Model.TrajectoryFromPDB),W.Action(y.f.Model.TransformStructureConformation),W.Action(y.f.Model.StructureFromModel),W.Action(y.f.Model.StructureFromTrajectory),W.Action(y.f.Model.ModelFromTrajectory),W.Action(y.f.Model.StructureSelectionFromScript),W.Action(y.f.Representation.StructureRepresentation3D),W.Action(y.f.Representation.StructureSelectionsDistance3D),W.Action(y.f.Representation.StructureSelectionsAngle3D),W.Action(y.f.Representation.StructureSelectionsDihedral3D),W.Action(y.f.Representation.StructureSelectionsLabel3D),W.Action(y.f.Representation.StructureSelectionsOrientation3D),W.Action(y.f.Representation.ModelUnitcell3D),W.Action(y.f.Representation.StructureBoundingBox3D),W.Action(y.f.Representation.ExplodeStructureRepresentation3D),W.Action(y.f.Representation.SpinStructureRepresentation3D),W.Action(y.f.Representation.UnwindStructureAssemblyRepresentation3D),W.Action(y.f.Representation.OverpaintStructureRepresentation3DFromScript),W.Action(y.f.Representation.TransparencyStructureRepresentation3DFromScript),W.Action(y.f.Representation.ClippingStructureRepresentation3DFromScript),W.Action(y.f.Representation.SubstanceStructureRepresentation3DFromScript),W.Action(y.f.Representation.ThemeStrengthRepresentation3D),W.Action(L),W.Action(y.f.Volume.VolumeFromCcp4),W.Action(y.f.Volume.VolumeFromDsn6),W.Action(y.f.Volume.VolumeFromCube),W.Action(y.f.Volume.VolumeFromDx),W.Action(y.f.Representation.VolumeRepresentation3D)],behaviors:[W.Behavior(a.Zw.Representation.HighlightLoci),W.Behavior(a.Zw.Representation.SelectLoci),W.Behavior(a.Zw.Representation.DefaultLociLabelProvider),W.Behavior(a.Zw.Representation.FocusLoci),W.Behavior(a.Zw.Camera.FocusLoci),W.Behavior(a.Zw.Camera.CameraAxisHelper),W.Behavior(a.Zw.Camera.CameraControls),W.Behavior(S.b),W.Behavior(a.Zw.CustomProps.StructureInfo),W.Behavior(a.Zw.CustomProps.AccessibleSurfaceArea),W.Behavior(a.Zw.CustomProps.BestDatabaseSequenceMapping),W.Behavior(a.Zw.CustomProps.Interactions),W.Behavior(a.Zw.CustomProps.SecondaryStructure),W.Behavior(a.Zw.CustomProps.ValenceModel),W.Behavior(a.Zw.CustomProps.CrossLinkRestraint)],animations:[d,u,J,h,O,U,V],customParamEditors:[[o.N$,ke]],config:[[je.AB.VolumeStreaming.Enabled,!1]]}),this.plugin$=(0,Ng.H)(this.plugin.init()).pipe((0,Ug.T)(()=>this.plugin),(0,Vg.t)(1))}static#e=this.\u0275fac=function(z){return new(z||oe)};static#t=this.\u0275prov=Gg.jDH({token:oe,factory:oe.\u0275fac,providedIn:"platform"})}return oe})()},3286:(tn,Ue,n)=>{"use strict";n.d(Ue,{Z:()=>l});var e=n(467),o=n(4412),r=n(5558),t=n(5964),A=n(6354),y=n(6648),c=n(8141),i=n(9568),v=n(9136),O=n(1861);const b=new Map([["ALA","A"],["ARG","R"],["ASN","N"],["ASP","D"],["CYS","C"],["GLN","Q"],["GLU","E"],["GLY","G"],["HIS","H"],["ILE","I"],["LEU","L"],["LYS","K"],["MET","M"],["PHE","F"],["PRO","P"],["SER","S"],["THR","T"],["TRP","W"],["TYR","Y"],["VAL","V"]]);new Map(Array.from(b.entries()).map(([m,u])=>[u,m]));var M=n(4438),I=n(5621);let l=(()=>{class m{set source(d){this.source$.next(d)}constructor(d){var s=this;this.pluginService=d,this.source$=new o.t(null),this.structure$=this.pluginService.plugin$.pipe((0,r.n)(C=>this.source$.pipe((0,t.p)(h=>null!=h),(0,A.T)(h=>({plugin:C,source:h})))),(0,r.n)(({source:C})=>(0,y.H)((0,e.A)(function*(){return"local"===C.type?{data:yield s.parseLocalSource(C),source:C}:{data:yield s.parseRemoteSource(C),source:C}})())),(0,r.n)(({data:C,source:h})=>(0,y.H)((0,e.A)(function*(){const a=s.pluginService.plugin,S=yield a.builders.structure.parseTrajectory(C,h.format),D=yield a.builders.structure.createModel(S,{modelIndex:0});return a.builders.structure.createStructure(D,{name:"model",params:{}})})())),(0,c.M)(C=>{let h=0;this.residues=[];const a=this.r2i=new Map,S=this.i2r=new Map;v.oE.eachAtomicHierarchyElement(C.cell?.obj?.data,{residue:D=>{const R=v.StructureProperties.residue.auth_seq_id(D),f=v.StructureProperties.residue.pdbx_PDB_ins_code(D),p=v.StructureProperties.chain.auth_asym_id(D),E=v.StructureProperties.atom.auth_comp_id(D),T=(p+R+f).trim();a.set(T,h),S.set(h,T),this.residues.push({pdbInsCode:f,authSeqId:R,authAsymId:p,authCompId3:b.has(E)?E:"XXX",authCompId1:b.get(E)||"X"}),h++}})}),(0,i.t)(1))}parseRemoteSource(d){var s=this;return(0,e.A)(function*(){const C=O.V.Url(d.link);return s.pluginService.plugin.builders.data.download({url:C,label:d.label,isBinary:d.binary})})()}parseLocalSource(d){var s=this;return(0,e.A)(function*(){const C=d.binary,h=d.label,a=s.pluginService.plugin;if("string"==typeof d.data)return a.builders.data.rawData({data:d.data,label:h});let S;S=d.data instanceof File?O.V.File(d.data):O.V.File(new File([d.data],`${h}.${"mmcif"===d.format?"cif":"ent"}`));const{data:D}=yield a.builders.data.readFile({file:S,label:h,isBinary:C});return D})()}static#e=this.\u0275fac=function(s){return new(s||m)(M.KVO(I.z))};static#t=this.\u0275prov=M.jDH({token:m,factory:m.\u0275fac,providedIn:"platform"})}return m})()},39:(tn,Ue,n)=>{"use strict";n.d(Ue,{B8:()=>ao,CD:()=>nr,T5:()=>fn,uY:()=>Ci});var e="delete",o=5,r=1<>>0;if(""+ze!==fe||4294967295===ze)return NaN;fe=ze}return fe<0?v(he)+fe:fe}function b(){return!0}function _(he,fe,ze){return(0===he&&!m(he)||void 0!==ze&&he<=-ze)&&(void 0===fe||void 0!==ze&&fe>=ze)}function M(he,fe){return l(he,fe,0)}function I(he,fe){return l(he,fe,fe)}function l(he,fe,ze){return void 0===he?ze:m(he)?fe===1/0?fe:0|Math.max(0,fe+he):void 0===fe||fe===he?he:0|Math.min(fe,he)}function m(he){return he<0||0===he&&1/he==-1/0}var u="@@__IMMUTABLE_ITERABLE__@@";function d(he){return!(!he||!he[u])}var s="@@__IMMUTABLE_KEYED__@@";function C(he){return!(!he||!he[s])}var h="@@__IMMUTABLE_INDEXED__@@";function a(he){return!(!he||!he[h])}function S(he){return C(he)||a(he)}var D=function(fe){return d(fe)?fe:xe(fe)},R=function(he){function fe(ze){return C(ze)?ze:le(ze)}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe}(D),f=function(he){function fe(ze){return a(ze)?ze:Ae(ze)}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe}(D),p=function(he){function fe(ze){return d(ze)&&!S(ze)?ze:Be(ze)}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe}(D);D.Keyed=R,D.Indexed=f,D.Set=p;var E="@@__IMMUTABLE_SEQ__@@";function T(he){return!(!he||!he[E])}var L="@@__IMMUTABLE_RECORD__@@";function w(he){return!(!he||!he[L])}function Q(he){return d(he)||w(he)}var G="@@__IMMUTABLE_ORDERED__@@";function V(he){return!(!he||!he[G])}var U=0,N=1,k=2,H="function"==typeof Symbol&&Symbol.iterator,$="@@iterator",J=H||$,W=function(fe){this.next=fe};function te(he,fe,ze,Ze){var it=0===he?fe:1===he?ze:[fe,ze];return Ze?Ze.value=it:Ze={value:it,done:!1},Ze}function de(){return{value:void 0,done:!0}}function ye(he){return!!Array.isArray(he)||!!q(he)}function j(he){return he&&"function"==typeof he.next}function Z(he){var fe=q(he);return fe&&fe.call(he)}function q(he){var fe=he&&(H&&he[H]||he[$]);if("function"==typeof fe)return fe}W.prototype.toString=function(){return"[Iterator]"},W.KEYS=U,W.VALUES=N,W.ENTRIES=k,W.prototype.inspect=W.prototype.toSource=function(){return this.toString()},W.prototype[J]=function(){return this};var g=Object.prototype.hasOwnProperty;function _e(he){return!(!Array.isArray(he)&&"string"!=typeof he)||he&&"object"==typeof he&&Number.isInteger(he.length)&&he.length>=0&&(0===he.length?1===Object.keys(he).length:he.hasOwnProperty(he.length-1))}var xe=function(he){function fe(ze){return null==ze?Oe():Q(ze)?ze.toSeq():function Ne(he){var fe=K(he);if(fe)return function Y(he){var fe=q(he);return fe&&fe===he.entries}(he)?fe.fromEntrySeq():function ee(he){var fe=q(he);return fe&&fe===he.keys}(he)?fe.toSetSeq():fe;if("object"==typeof he)return new Re(he);throw new TypeError("Expected Array or collection object of values, or keyed object: "+he)}(ze)}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.prototype.toSeq=function(){return this},fe.prototype.toString=function(){return this.__toString("Seq {","}")},fe.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},fe.prototype.__iterate=function(Ze,it){var Rt=this._cache;if(Rt){for(var X=Rt.length,pe=0;pe!==X;){var De=Rt[it?X-++pe:pe++];if(!1===Ze(De[1],De[0],this))break}return pe}return this.__iterateUncached(Ze,it)},fe.prototype.__iterator=function(Ze,it){var Rt=this._cache;if(Rt){var X=Rt.length,pe=0;return new W(function(){if(pe===X)return{value:void 0,done:!0};var De=Rt[it?X-++pe:pe++];return te(Ze,De[0],De[1])})}return this.__iteratorUncached(Ze,it)},fe}(D),le=function(he){function fe(ze){return null==ze?Oe().toKeyedSeq():d(ze)?C(ze)?ze.toSeq():ze.fromEntrySeq():w(ze)?ze.toSeq():Se(ze)}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.prototype.toKeyedSeq=function(){return this},fe}(xe),Ae=function(he){function fe(ze){return null==ze?Oe():d(ze)?C(ze)?ze.entrySeq():ze.toIndexedSeq():w(ze)?ze.toSeq().entrySeq():Ve(ze)}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.of=function(){return fe(arguments)},fe.prototype.toIndexedSeq=function(){return this},fe.prototype.toString=function(){return this.__toString("Seq [","]")},fe}(xe),Be=function(he){function fe(ze){return(d(ze)&&!S(ze)?ze:Ae(ze)).toSetSeq()}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.of=function(){return fe(arguments)},fe.prototype.toSetSeq=function(){return this},fe}(xe);xe.isSeq=T,xe.Keyed=le,xe.Set=Be,xe.Indexed=Ae,xe.prototype[E]=!0;var Ce=function(he){function fe(ze){this._array=ze,this.size=ze.length}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.prototype.get=function(Ze,it){return this.has(Ze)?this._array[O(this,Ze)]:it},fe.prototype.__iterate=function(Ze,it){for(var Rt=this._array,X=Rt.length,pe=0;pe!==X;){var De=it?X-++pe:pe++;if(!1===Ze(Rt[De],De,this))break}return pe},fe.prototype.__iterator=function(Ze,it){var Rt=this._array,X=Rt.length,pe=0;return new W(function(){if(pe===X)return{value:void 0,done:!0};var De=it?X-++pe:pe++;return te(Ze,De,Rt[De])})},fe}(Ae),Re=function(he){function fe(ze){var Ze=Object.keys(ze).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(ze):[]);this._object=ze,this._keys=Ze,this.size=Ze.length}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.prototype.get=function(Ze,it){return void 0===it||this.has(Ze)?this._object[Ze]:it},fe.prototype.has=function(Ze){return g.call(this._object,Ze)},fe.prototype.__iterate=function(Ze,it){for(var Rt=this._object,X=this._keys,pe=X.length,De=0;De!==pe;){var Ee=X[it?pe-++De:De++];if(!1===Ze(Rt[Ee],Ee,this))break}return De},fe.prototype.__iterator=function(Ze,it){var Rt=this._object,X=this._keys,pe=X.length,De=0;return new W(function(){if(De===pe)return{value:void 0,done:!0};var Ee=X[it?pe-++De:De++];return te(Ze,Ee,Rt[Ee])})},fe}(le);Re.prototype[G]=!0;var we,ke=function(he){function fe(ze){this._collection=ze,this.size=ze.length||ze.size}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.prototype.__iterateUncached=function(Ze,it){if(it)return this.cacheResult().__iterate(Ze,it);var X=Z(this._collection),pe=0;if(j(X))for(var De;!(De=X.next()).done&&!1!==Ze(De.value,pe++,this););return pe},fe.prototype.__iteratorUncached=function(Ze,it){if(it)return this.cacheResult().__iterator(Ze,it);var X=Z(this._collection);if(!j(X))return new W(de);var pe=0;return new W(function(){var De=X.next();return De.done?De:te(Ze,pe++,De.value)})},fe}(Ae);function Oe(){return we||(we=new Ce([]))}function Se(he){var fe=K(he);if(fe)return fe.fromEntrySeq();if("object"==typeof he)return new Re(he);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+he)}function Ve(he){var fe=K(he);if(fe)return fe;throw new TypeError("Expected Array or collection object of values: "+he)}function K(he){return _e(he)?new Ce(he):ye(he)?new ke(he):void 0}var ne="@@__IMMUTABLE_MAP__@@";function be(he){return!(!he||!he[ne])}function Te(he){return be(he)&&V(he)}function ie(he){return!(!he||"function"!=typeof he.equals||"function"!=typeof he.hashCode)}function ue(he,fe){if(he===fe||he!=he&&fe!=fe)return!0;if(!he||!fe)return!1;if("function"==typeof he.valueOf&&"function"==typeof fe.valueOf){if((he=he.valueOf())===(fe=fe.valueOf())||he!=he&&fe!=fe)return!0;if(!he||!fe)return!1}return!!(ie(he)&&ie(fe)&&he.equals(fe))}var re="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(fe,ze){var Ze=65535&(fe|=0),it=65535&(ze|=0);return Ze*it+((fe>>>16)*it+Ze*(ze>>>16)<<16>>>0)|0};function ve(he){return he>>>1&1073741824|3221225471&he}var ce=Object.prototype.valueOf;function se(he){if(null==he)return ae(he);if("function"==typeof he.hashCode)return ve(he.hashCode(he));var fe=function Bt(he){return he.valueOf!==ce&&"function"==typeof he.valueOf?he.valueOf(he):he}(he);if(null==fe)return ae(fe);switch(typeof fe){case"boolean":return fe?1108378657:1108378656;case"number":return function ge(he){if(he!=he||he===1/0)return 0;var fe=0|he;for(fe!==he&&(fe^=4294967295*he);he>4294967295;)fe^=he/=4294967295;return ve(fe)}(fe);case"string":return fe.length>ut?function Ie(he){var fe=gt[he];return void 0===fe&&(fe=Le(he),sn===Kt&&(sn=0,gt={}),sn++,gt[he]=fe),fe}(fe):Le(fe);case"object":case"function":return function je(he){var fe;if($e&&void 0!==(fe=mt.get(he))||void 0!==(fe=he[Ke])||!Je&&(void 0!==(fe=he.propertyIsEnumerable&&he.propertyIsEnumerable[Ke])||(fe=function en(he){if(he&&he.nodeType>0)switch(he.nodeType){case 1:return he.uniqueID;case 9:return he.documentElement&&he.documentElement.uniqueID}}(he),void 0!==fe)))return fe;if(fe=pn(),$e)mt.set(he,fe);else{if(void 0!==Lt&&!1===Lt(he))throw new Error("Non-extensible objects are not allowed as keys.");if(Je)Object.defineProperty(he,Ke,{enumerable:!1,configurable:!1,writable:!1,value:fe});else if(void 0!==he.propertyIsEnumerable&&he.propertyIsEnumerable===he.constructor.prototype.propertyIsEnumerable)he.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},he.propertyIsEnumerable[Ke]=fe;else{if(void 0===he.nodeType)throw new Error("Unable to set a non-enumerable property on object.");he[Ke]=fe}}return fe}(fe);case"symbol":return function nt(he){var fe=_t[he];return void 0!==fe||(fe=pn(),_t[he]=fe),fe}(fe);default:if("function"==typeof fe.toString)return Le(fe.toString());throw new Error("Value type "+typeof fe+" cannot be hashed.")}}function ae(he){return null===he?1108378658:1108378659}function Le(he){for(var fe=0,ze=0;ze=0&&(Ee.get=function(qe,bt){return(qe=O(this,qe))>=0&&qeDe)return{value:void 0,done:!0};var In=xt.next();return Ze||qe===N||In.done?In:te(qe,dn-1,qe===U?void 0:In.value[1],In)})},Ee}function $t(he,fe,ze,Ze){var it=Pr(he);return it.__iterateUncached=function(Rt,X){var pe=this;if(X)return this.cacheResult().__iterate(Rt,X);var De=!0,Ee=0;return he.__iterate(function(qe,bt,xt){if(!De||!(De=fe.call(ze,qe,bt,xt)))return Ee++,Rt(qe,Ze?bt:Ee-1,pe)}),Ee},it.__iteratorUncached=function(Rt,X){var pe=this;if(X)return this.cacheResult().__iterator(Rt,X);var De=he.__iterator(k,X),Ee=!0,qe=0;return new W(function(){var bt,xt,hn;do{if((bt=De.next()).done)return Ze||Rt===N?bt:te(Rt,qe++,Rt===U?void 0:bt.value[1],bt);var dn=bt.value;xt=dn[0],hn=dn[1],Ee&&(Ee=fe.call(ze,hn,xt,pe))}while(Ee);return Rt===k?bt:te(Rt,xt,hn,bt)})},it}function Wt(he,fe,ze){var Ze=Pr(he);return Ze.__iterateUncached=function(it,Rt){if(Rt)return this.cacheResult().__iterate(it,Rt);var X=0,pe=!1;return function De(Ee,qe){Ee.__iterate(function(bt,xt){return(!fe||qe0}function jn(he,fe,ze,Ze){var it=Pr(he),Rt=new Ce(ze).map(function(X){return X.size});return it.size=Ze?Rt.max():Rt.min(),it.__iterate=function(X,pe){for(var Ee,De=this.__iterator(N,pe),qe=0;!(Ee=De.next()).done&&!1!==X(Ee.value,qe++,this););return qe},it.__iteratorUncached=function(X,pe){var De=ze.map(function(bt){return bt=D(bt),Z(pe?bt.reverse():bt)}),Ee=0,qe=!1;return new W(function(){var bt;return qe||(bt=De.map(function(xt){return xt.next()}),qe=Ze?bt.every(function(xt){return xt.done}):bt.some(function(xt){return xt.done})),qe?{value:void 0,done:!0}:te(X,Ee++,fe.apply(null,bt.map(function(xt){return xt.value})))})},it}function On(he,fe){return he===fe?he:T(he)?fe:he.constructor(fe)}function fr(he){if(he!==Object(he))throw new TypeError("Expected [K, V] tuple: "+he)}function Dr(he){return C(he)?R:a(he)?f:p}function Pr(he){return Object.create((C(he)?le:a(he)?Ae:Be).prototype)}function or(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):xe.prototype.cacheResult.call(this)}function Nr(he,fe){return void 0===he&&void 0===fe?0:void 0===he?1:void 0===fe?-1:he>fe?1:he0;)fe[ze]=arguments[ze+1];if("function"!=typeof he)throw new TypeError("Invalid merger function: "+he);return so(this,fe,he)}function so(he,fe,ze){for(var Ze=[],it=0;it0;)fe[ze]=arguments[ze+1];return We(this,fe,he)}function xr(he){for(var fe=[],ze=arguments.length-1;ze-- >0;)fe[ze]=arguments[ze+1];return Yn(this,he,zt(),function(Ze){return Pt(Ze,fe)})}function Ft(he){for(var fe=[],ze=arguments.length-1;ze-- >0;)fe[ze]=arguments[ze+1];return Yn(this,he,zt(),function(Ze){return We(Ze,fe)})}function Qt(he){var fe=this.asMutable();return he(fe),fe.wasAltered()?fe.__ensureOwner(this.__ownerID):this}function ht(){return this.__ownerID?this:this.__ensureOwner(new i)}function pt(){return this.__ensureOwner()}function Xt(){return this.__altered}var fn=function(he){function fe(ze){return null==ze?zt():be(ze)&&!V(ze)?ze:zt().withMutations(function(Ze){var it=he(ze);Jr(it.size),it.forEach(function(Rt,X){return Ze.set(X,Rt)})})}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.of=function(){for(var Ze=[],it=arguments.length;it--;)Ze[it]=arguments[it];return zt().withMutations(function(Rt){for(var X=0;X=Ze.length)throw new Error("Missing value for key: "+Ze[X]);Rt.set(Ze[X],Ze[X+1])}})},fe.prototype.toString=function(){return this.__toString("Map {","}")},fe.prototype.get=function(Ze,it){return this._root?this._root.get(0,void 0,Ze,it):it},fe.prototype.set=function(Ze,it){return an(this,Ze,it)},fe.prototype.remove=function(Ze){return an(this,Ze,A)},fe.prototype.deleteAll=function(Ze){var it=D(Ze);return 0===it.size?this:this.withMutations(function(Rt){it.forEach(function(X){return Rt.remove(X)})})},fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):zt()},fe.prototype.sort=function(Ze){return Ci(kt(this,Ze))},fe.prototype.sortBy=function(Ze,it){return Ci(kt(this,it,Ze))},fe.prototype.map=function(Ze,it){var Rt=this;return this.withMutations(function(X){X.forEach(function(pe,De){X.set(De,Ze.call(it,pe,De,Rt))})})},fe.prototype.__iterator=function(Ze,it){return new ot(this,Ze,it)},fe.prototype.__iterate=function(Ze,it){var Rt=this,X=0;return this._root&&this._root.iterate(function(pe){return X++,Ze(pe[1],pe[0],Rt)},it),X},fe.prototype.__ensureOwner=function(Ze){return Ze===this.__ownerID?this:Ze?vt(this.size,this._root,Ze,this.__hash):0===this.size?zt():(this.__ownerID=Ze,this.__altered=!1,this)},fe}(R);fn.isMap=be;var on=fn.prototype;on[ne]=!0,on[e]=on.remove,on.removeAll=on.deleteAll,on.setIn=Hr,on.removeIn=on.deleteIn=Fr,on.update=Ur,on.updateIn=Ro,on.merge=on.concat=ro,on.mergeWith=po,on.mergeDeep=Kn,on.mergeDeepWith=dr,on.mergeIn=xr,on.mergeDeepIn=Ft,on.withMutations=Qt,on.wasAltered=Xt,on.asImmutable=pt,on["@@transducer/init"]=on.asMutable=ht,on["@@transducer/step"]=function(he,fe){return he.set(fe[0],fe[1])},on["@@transducer/result"]=function(he){return he.asImmutable()};var En=function(fe,ze){this.ownerID=fe,this.entries=ze};En.prototype.get=function(fe,ze,Ze,it){for(var Rt=this.entries,X=0,pe=Rt.length;X=vo)return function Vr(he,fe,ze,Ze){he||(he=new i);for(var it=new Ye(he,se(ze),[ze,Ze]),Rt=0;Rt>>fe)&t),X=this.bitmap;return X&Rt?this.nodes[oo(X&Rt-1)].get(fe+o,ze,Ze,it):it},Tt.prototype.update=function(fe,ze,Ze,it,Rt,X,pe){void 0===Ze&&(Ze=se(it));var De=(0===ze?Ze:Ze>>>ze)&t,Ee=1<=Kr)return function Tr(he,fe,ze,Ze,it){for(var Rt=0,X=new Array(r),pe=0;0!==ze;pe++,ze>>>=1)X[pe]=1&ze?fe[Rt++]:void 0;return X[Ze]=it,new Fe(he,Rt+1,X)}(fe,hn,qe,De,In);if(bt&&!In&&2===hn.length&&Fn(hn[1^xt]))return hn[1^xt];if(bt&&In&&1===hn.length&&Fn(In))return In;var Tn=fe&&fe===this.ownerID,_n=bt?In?qe:qe^Ee:qe|Ee,Wn=bt?In?Gr(hn,xt,In,Tn):function yo(he,fe,ze){var Ze=he.length-1;if(ze&&fe===Ze)return he.pop(),he;for(var it=new Array(Ze),Rt=0,X=0;X>>fe)&t];return X?X.get(fe+o,ze,Ze,it):it},Fe.prototype.update=function(fe,ze,Ze,it,Rt,X,pe){void 0===Ze&&(Ze=se(it));var De=(0===ze?Ze:Ze>>>ze)&t,qe=this.nodes,bt=qe[De];if(Rt===A&&!bt)return this;var xt=Vn(bt,fe,ze+o,Ze,it,Rt,X,pe);if(xt===bt)return this;var hn=this.count;if(bt){if(!xt&&--hn>>ze)&t,X=(0===ze?Ze:Ze>>>ze)&t,De=Rt===X?[rr(he,fe,ze+o,Ze,it)]:(pe=new Ye(fe,Ze,it),Rt>1&1431655765))+(he>>2&858993459))+(he>>4)&252645135,127&(he+=he>>8)+(he>>16)}function Gr(he,fe,ze,Ze){var it=Ze?he:Ir(he);return it[fe]=ze,it}var vo=r/4,Kr=r/2,Do=r/4,lo="@@__IMMUTABLE_LIST__@@";function So(he){return!(!he||!he[lo])}var ao=function(he){function fe(ze){var Ze=ei();if(null==ze)return Ze;if(So(ze))return ze;var it=he(ze),Rt=it.size;return 0===Rt?Ze:(Jr(Rt),Rt>0&&Rt=0&&Ze=he.size||fe<0)return he.withMutations(function(X){fe<0?hi(X,fe).set(0,ze):hi(X,0,fe+1).set(fe,ze)});var Ze=he._tail,it=he._root,Rt={value:!1};return(fe+=he._origin)>=No(he._capacity)?Ze=ci(Ze,he.__ownerID,0,fe,ze,Rt):it=ci(it,he.__ownerID,he._level,fe,ze,Rt),Rt.value?he.__ownerID?(he._root=it,he._tail=Ze,he.__hash=void 0,he.__altered=!0,he):Eo(he._origin,he._capacity,he._level,it,Ze):he}(this,Ze,it)},fe.prototype.remove=function(Ze){return this.has(Ze)?0===Ze?this.shift():Ze===this.size-1?this.pop():this.splice(Ze,1):this},fe.prototype.insert=function(Ze,it){return this.splice(Ze,0,it)},fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=o,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):ei()},fe.prototype.push=function(){var Ze=arguments,it=this.size;return this.withMutations(function(Rt){hi(Rt,0,it+Ze.length);for(var X=0;X>>ze&t;if(it>=this.array.length)return new Yr([],fe);var X,Rt=0===it;if(ze>0){var pe=this.array[it];if((X=pe&&pe.removeBefore(fe,ze-o,Ze))===pe&&Rt)return this}if(Rt&&!X)return this;var De=Jo(this,fe);if(!Rt)for(var Ee=0;Ee>>ze&t;if(it>=this.array.length)return this;if(ze>0){var X=this.array[it];if((Rt=X&&X.removeAfter(fe,ze-o,Ze))===X&&it===this.array.length-1)return this}var pe=Jo(this,fe);return pe.array.splice(it+1),Rt&&(pe.array[it]=Rt),pe};var Fo,jr={};function Co(he,fe){var ze=he._origin,Ze=he._capacity,it=No(Ze),Rt=he._tail;return function X(Ee,qe,bt){return 0===qe?function pe(Ee,qe){var bt=qe===it?Rt&&Rt.array:Ee&&Ee.array,xt=qe>ze?0:ze-qe,hn=Ze-qe;return hn>r&&(hn=r),function(){if(xt===hn)return jr;var dn=fe?--hn:xt++;return bt&&bt[dn]}}(Ee,bt):function De(Ee,qe,bt){var xt,hn=Ee&&Ee.array,dn=bt>ze?0:ze-bt>>qe,In=1+(Ze-bt>>qe);return In>r&&(In=r),function(){for(;;){if(xt){var Tn=xt();if(Tn!==jr)return Tn;xt=null}if(dn===In)return jr;var _n=fe?--In:dn++;xt=X(hn&&hn[_n],qe-o,bt+(_n<>>ze&t,pe=he&&X0){var Ee=he&&he.array[X],qe=ci(Ee,fe,ze-o,Ze,it,Rt);return qe===Ee?he:((De=Jo(he,fe)).array[X]=qe,De)}return pe&&he.array[X]===it?he:(Rt&&c(Rt),De=Jo(he,fe),void 0===it&&X===De.array.length-1?De.array.pop():De.array[X]=it,De)}function Jo(he,fe){return fe&&he&&fe===he.ownerID?he:new Yr(he?he.array.slice():[],fe)}function Fi(he,fe){if(fe>=No(he._capacity))return he._tail;if(fe<1<0;)ze=ze.array[fe>>>Ze&t],Ze-=o;return ze}}function hi(he,fe,ze){void 0!==fe&&(fe|=0),void 0!==ze&&(ze|=0);var Ze=he.__ownerID||new i,it=he._origin,Rt=he._capacity,X=it+fe,pe=void 0===ze?Rt:ze<0?Rt+ze:it+ze;if(X===it&&pe===Rt)return he;if(X>=pe)return he.clear();for(var De=he._level,Ee=he._root,qe=0;X+qe<0;)Ee=new Yr(Ee&&Ee.array.length?[void 0,Ee]:[],Ze),qe+=1<<(De+=o);qe&&(X+=qe,it+=qe,pe+=qe,Rt+=qe);for(var bt=No(Rt),xt=No(pe);xt>=1<bt?new Yr([],Ze):hn;if(hn&&xt>bt&&Xo;Tn-=o){var _n=bt>>>Tn&t;In=In.array[_n]=Jo(In.array[_n],Ze)}In.array[bt>>>o&t]=hn}if(pe=xt)X-=xt,pe-=xt,De=o,Ee=null,dn=dn&&dn.removeBefore(Ze,0,X);else if(X>it||xt>>De&t;if(Wn!==xt>>>De&t)break;Wn&&(qe+=(1<it&&(Ee=Ee.removeBefore(Ze,De,X-qe)),Ee&&xt>>o<=r&&it.size>=2*Ze.size?(pe=(De=it.filter(function(Ee,qe){return void 0!==Ee&&Rt!==qe})).toKeyedSeq().map(function(Ee){return Ee[0]}).flip().toMap(),he.__ownerID&&(pe.__ownerID=De.__ownerID=he.__ownerID)):(pe=Ze.remove(fe),De=Rt===it.size-1?it.pop():it.set(Rt,void 0))}else if(X){if(ze===it.get(Rt)[1])return he;pe=Ze,De=it.set(Rt,[fe,ze])}else pe=Ze.set(fe,it.size),De=it.set(it.size,[fe,ze]);return he.__ownerID?(he.size=pe.size,he._map=pe,he._list=De,he.__hash=void 0,he.__altered=!0,he):mi(pe,De)}Ci.isOrderedMap=Te,Ci.prototype[G]=!0,Ci.prototype[e]=Ci.prototype.remove;var es="@@__IMMUTABLE_STACK__@@";function Si(he){return!(!he||!he[es])}var Pi=function(he){function fe(ze){return null==ze?Ri():Si(ze)?ze:Ri().pushAll(ze)}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.of=function(){return this(arguments)},fe.prototype.toString=function(){return this.__toString("Stack [","]")},fe.prototype.get=function(Ze,it){var Rt=this._head;for(Ze=O(this,Ze);Rt&&Ze--;)Rt=Rt.next;return Rt?Rt.value:it},fe.prototype.peek=function(){return this._head&&this._head.value},fe.prototype.push=function(){var Ze=arguments;if(0===arguments.length)return this;for(var it=this.size+arguments.length,Rt=this._head,X=arguments.length-1;X>=0;X--)Rt={value:Ze[X],next:Rt};return this.__ownerID?(this.size=it,this._head=Rt,this.__hash=void 0,this.__altered=!0,this):gi(it,Rt)},fe.prototype.pushAll=function(Ze){if(0===(Ze=he(Ze)).size)return this;if(0===this.size&&Si(Ze))return Ze;Jr(Ze.size);var it=this.size,Rt=this._head;return Ze.__iterate(function(X){it++,Rt={value:X,next:Rt}},!0),this.__ownerID?(this.size=it,this._head=Rt,this.__hash=void 0,this.__altered=!0,this):gi(it,Rt)},fe.prototype.pop=function(){return this.slice(1)},fe.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):Ri()},fe.prototype.slice=function(Ze,it){if(_(Ze,it,this.size))return this;var Rt=M(Ze,this.size);if(I(it,this.size)!==this.size)return he.prototype.slice.call(this,Ze,it);for(var pe=this.size-Rt,De=this._head;Rt--;)De=De.next;return this.__ownerID?(this.size=pe,this._head=De,this.__hash=void 0,this.__altered=!0,this):gi(pe,De)},fe.prototype.__ensureOwner=function(Ze){return Ze===this.__ownerID?this:Ze?gi(this.size,this._head,Ze,this.__hash):0===this.size?Ri():(this.__ownerID=Ze,this.__altered=!1,this)},fe.prototype.__iterate=function(Ze,it){var Rt=this;if(it)return new Ce(this.toArray()).__iterate(function(De,Ee){return Ze(De,Ee,Rt)},it);for(var X=0,pe=this._head;pe&&!1!==Ze(pe.value,X++,this);)pe=pe.next;return X},fe.prototype.__iterator=function(Ze,it){if(it)return new Ce(this.toArray()).__iterator(Ze,it);var Rt=0,X=this._head;return new W(function(){if(X){var pe=X.value;return X=X.next,te(Ze,Rt++,pe)}return{value:void 0,done:!0}})},fe}(f);Pi.isStack=Si;var Wi,ni=Pi.prototype;function gi(he,fe,ze,Ze){var it=Object.create(ni);return it.size=he,it._head=fe,it.__ownerID=ze,it.__hash=Ze,it.__altered=!1,it}function Ri(){return Wi||(Wi=gi(0))}ni[es]=!0,ni.shift=ni.pop,ni.unshift=ni.push,ni.unshiftAll=ni.pushAll,ni.withMutations=Qt,ni.wasAltered=Xt,ni.asImmutable=pt,ni["@@transducer/init"]=ni.asMutable=ht,ni["@@transducer/step"]=function(he,fe){return he.unshift(fe)},ni["@@transducer/result"]=function(he){return he.asImmutable()};var Qi="@@__IMMUTABLE_SET__@@";function Hn(he){return!(!he||!he[Qi])}function qr(he){return Hn(he)&&V(he)}function co(he,fe){if(he===fe)return!0;if(!d(fe)||void 0!==he.size&&void 0!==fe.size&&he.size!==fe.size||void 0!==he.__hash&&void 0!==fe.__hash&&he.__hash!==fe.__hash||C(he)!==C(fe)||a(he)!==a(fe)||V(he)!==V(fe))return!1;if(0===he.size&&0===fe.size)return!0;var ze=!S(he);if(V(he)){var Ze=he.entries();return fe.every(function(De,Ee){var qe=Ze.next().value;return qe&&ue(qe[1],De)&&(ze||ue(qe[0],Ee))})&&Ze.next().done}var it=!1;if(void 0===he.size)if(void 0===fe.size)"function"==typeof he.cacheResult&&he.cacheResult();else{it=!0;var Rt=he;he=fe,fe=Rt}var X=!0,pe=fe.__iterate(function(De,Ee){if(ze?!he.has(De):it?!ue(De,he.get(Ee,A)):!ue(he.get(Ee,A),De))return X=!1,!1});return X&&he.size===pe}function zr(he,fe){var ze=function(Ze){he.prototype[Ze]=fe[Ze]};return Object.keys(fe).forEach(ze),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(fe).forEach(ze),he}function lr(he){if(!he||"object"!=typeof he)return he;if(!d(he)){if(!dt(he))return he;he=xe(he)}if(C(he)){var fe={};return he.__iterate(function(Ze,it){fe[it]=lr(Ze)}),fe}var ze=[];return he.__iterate(function(Ze){ze.push(lr(Ze))}),ze}var kr=function(he){function fe(ze){return null==ze?Li():Hn(ze)&&!V(ze)?ze:Li().withMutations(function(Ze){var it=he(ze);Jr(it.size),it.forEach(function(Rt){return Ze.add(Rt)})})}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.of=function(){return this(arguments)},fe.fromKeys=function(Ze){return this(R(Ze).keySeq())},fe.intersect=function(Ze){return(Ze=D(Ze).toArray()).length?Qr.intersect.apply(fe(Ze.pop()),Ze):Li()},fe.union=function(Ze){return(Ze=D(Ze).toArray()).length?Qr.union.apply(fe(Ze.pop()),Ze):Li()},fe.prototype.toString=function(){return this.__toString("Set {","}")},fe.prototype.has=function(Ze){return this._map.has(Ze)},fe.prototype.add=function(Ze){return vi(this,this._map.set(Ze,Ze))},fe.prototype.remove=function(Ze){return vi(this,this._map.remove(Ze))},fe.prototype.clear=function(){return vi(this,this._map.clear())},fe.prototype.map=function(Ze,it){var Rt=this,X=!1,pe=vi(this,this._map.mapEntries(function(De){var Ee=De[1],qe=Ze.call(it,Ee,Ee,Rt);return qe!==Ee&&(X=!0),[qe,qe]},it));return X?pe:this},fe.prototype.union=function(){for(var Ze=[],it=arguments.length;it--;)Ze[it]=arguments[it];return 0===(Ze=Ze.filter(function(Rt){return 0!==Rt.size})).length?this:0!==this.size||this.__ownerID||1!==Ze.length?this.withMutations(function(Rt){for(var X=0;X=0&&it=0&&Rt>>-15,461845907),fe=re(fe<<13|fe>>>-13,5),fe=re((fe=fe+3864292196^he)^fe>>>16,2246822507),fe=ve((fe=re(fe^fe>>>13,3266489909))^fe>>>16)}(he.__iterate(ze?fe?function(Rt,X){Ze=31*Ze+vn(se(Rt),se(X))|0}:function(Rt,X){Ze=Ze+vn(se(Rt),se(X))|0}:fe?function(Rt){Ze=31*Ze+se(Rt)|0}:function(Rt){Ze=Ze+se(Rt)|0}),Ze)}(this))}});var kn=D.prototype;kn[u]=!0,kn[J]=kn.values,kn.toJSON=kn.toArray,kn.__toStringMapper=Yt,kn.inspect=kn.toSource=function(){return this.toString()},kn.chain=kn.flatMap,kn.contains=kn.includes,zr(R,{flip:function(){return On(this,tt(this))},mapEntries:function(fe,ze){var Ze=this,it=0;return On(this,this.toSeq().map(function(Rt,X){return fe.call(ze,[X,Rt],it++,Ze)}).fromEntrySeq())},mapKeys:function(fe,ze){var Ze=this;return On(this,this.toSeq().flip().map(function(it,Rt){return fe.call(ze,it,Rt,Ze)}).flip())}});var ur=R.prototype;ur[s]=!0,ur[J]=kn.entries,ur.toJSON=ar,ur.__toStringMapper=function(he,fe){return Yt(fe)+": "+Yt(he)},zr(f,{toKeyedSeq:function(){return new yt(this,!1)},filter:function(fe,ze){return On(this,bn(this,fe,ze,!1))},findIndex:function(fe,ze){var Ze=this.findEntry(fe,ze);return Ze?Ze[0]:-1},indexOf:function(fe){var ze=this.keyOf(fe);return void 0===ze?-1:ze},lastIndexOf:function(fe){var ze=this.lastKeyOf(fe);return void 0===ze?-1:ze},reverse:function(){return On(this,nn(this,!1))},slice:function(fe,ze){return On(this,Dt(this,fe,ze,!1))},splice:function(fe,ze){var Ze=arguments.length;if(ze=Math.max(ze||0,0),0===Ze||2===Ze&&!ze)return this;fe=M(fe,fe<0?this.count():this.size);var it=this.slice(0,fe);return On(this,1===Ze?it:it.concat(Ir(arguments,2),this.slice(fe+ze)))},findLastIndex:function(fe,ze){var Ze=this.findLastEntry(fe,ze);return Ze?Ze[0]:-1},first:function(fe){return this.get(0,fe)},flatten:function(fe){return On(this,Wt(this,fe,!1))},get:function(fe,ze){return(fe=O(this,fe))<0||this.size===1/0||void 0!==this.size&&fe>this.size?ze:this.find(function(Ze,it){return it===fe},void 0,ze)},has:function(fe){return(fe=O(this,fe))>=0&&(void 0!==this.size?this.size===1/0||fefe?-1:0}function vn(he,fe){return he^fe+2654435769+(he<<6)+(he>>2)}Jn.has=kn.includes,Jn.contains=Jn.includes,Jn.keys=Jn.values,zr(le,ur),zr(Ae,sr),zr(Be,Jn);var nr=function(he){function fe(ze){return null==ze?Uo():qr(ze)?ze:Uo().withMutations(function(Ze){var it=p(ze);Jr(it.size),it.forEach(function(Rt){return Ze.add(Rt)})})}return he&&(fe.__proto__=he),(fe.prototype=Object.create(he&&he.prototype)).constructor=fe,fe.of=function(){return this(arguments)},fe.fromKeys=function(Ze){return this(R(Ze).keySeq())},fe.prototype.toString=function(){return this.__toString("OrderedSet {","}")},fe}(kr);nr.isOrderedSet=qr;var mo,pr=nr.prototype;function Rr(he,fe){var ze=Object.create(pr);return ze.size=he?he.size:0,ze._map=he,ze.__ownerID=fe,ze}function Uo(){return mo||(mo=Rr(Oi()))}pr[G]=!0,pr.zip=sr.zip,pr.zipWith=sr.zipWith,pr.zipAll=sr.zipAll,pr.__empty=Uo,pr.__make=Rr;var fo=function(fe,ze){var Ze;!function ri(he){if(w(he))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Q(he))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===he||"object"!=typeof he)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(fe);var it=function(pe){var De=this;if(pe instanceof it)return pe;if(!(this instanceof it))return new it(pe);if(!Ze){Ze=!0;var Ee=Object.keys(fe),qe=Rt._indices={};Rt._name=ze,Rt._keys=Ee,Rt._defaultValues=fe;for(var bt=0;bt{"use strict";n.d(Ue,{i:()=>O});var e=n(4369),o=n(7361),r=n(127);class t{get source(){return this._source}get target(){return this._target}apply(l,m=0,u){(!this.inTransition||m>0)&&O.copySnapshot(this._source,this.camera.state),this.inTransition||O.copySnapshot(this._target,this.camera.state),O.copySnapshot(this._target,l),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&&m<=0||typeof l.mode<"u"&&l.mode!==this.camera.state.mode?this.finish(this._target):(this.inTransition=!0,this.func=u||t.defaultTransition,(!this.inTransition||m>0)&&(this.start=this.t,this.durationMs=m))}tick(l){this.t=l,this.update()}finish(l){O.copySnapshot(this.camera.state,l),this.inTransition=!1}update(){if(!this.inTransition)return;const l=Math.min((this.t-this.start)/this.durationMs,1);1!==l?(this.func(this._current,l,this._source,this._target),O.copySnapshot(this.camera.state,this._current)):this.finish(this._target)}constructor(l){this.camera=l,this.t=0,this.func=t.defaultTransition,this.start=0,this.inTransition=!1,this.durationMs=0,this._source=O.createDefaultSnapshot(),this._target=O.createDefaultSnapshot(),this._current=O.createDefaultSnapshot()}}!function(I){const l=e.k.identity();I.defaultTransition=function m(u,d,s,C){O.copySnapshot(u,C),e.k.slerp(l,e.k.Identity,e.k.rotationTo(l,s.up,C.up),d),e.eB.transformQuat(u.up,s.up,l),e.eB.lerp(u.target,s.target,C.target,d),e.eB.lerp(u.position,s.position,C.position,d),u.radius=(0,r.Cc)(s.radius,C.radius,d),u.radiusMax=(0,r.Cc)(s.radiusMax,C.radiusMax,d),u.fov=(0,r.Cc)(s.fov,C.fov,d),u.fog=(0,r.Cc)(s.fog,C.fog,d)}}(t||(t={}));var A=n(4412),y=n(1372);const c=(0,e.eB)(),i=(0,e.eB)(),v=(0,e.Zb)();class O{get position(){return this.state.position}set position(l){e.eB.copy(this.state.position,l)}get up(){return this.state.up}set up(l){e.eB.copy(this.state.up,l)}get target(){return this.state.target}set target(l){e.eB.copy(this.state.target,l)}update(){const l=this.state;if(0===l.radiusMax)return!1;const m=2*Math.tan(l.fov/2)*e.eB.distance(l.position,l.target);switch(this.zoom=this.viewport.height/m,function M(I){let{radius:l,radiusMax:m,fog:d,clipFar:s,minNear:C,minFar:h}=I.state;l<.01&&(l=.01);const a=Math.max(s?l:m,h),S=e.eB.distance(I.position,I.target);let D=S-l,R=S+a;D=Math.max(Math.min(m,C),D),R=Math.max(C,R),D===R&&(R=D+.01);const p=S-a*(-(50-d)/50),E=R;I.near=D,I.far=R,I.fogNear=p,I.fogFar=E}(this),this.state.mode){case"orthographic":!function b(I){const{viewport:l,zoom:m,near:u,far:d,viewOffset:s}=I,C=-l.width/2,h=l.width/2,a=l.height/2,S=-l.height/2,D=(h-C)/(2*m),R=(a-S)/(2*m),f=(h+C)/2,p=(a+S)/2;let E=f-D,T=f+D,L=p+R,w=p-R;if(s.enabled){const Q=m/(s.width/s.fullWidth),G=m/(s.height/s.fullHeight),V=(h-C)/s.width,U=(a-S)/s.height;E+=V*(s.offsetX/Q),T=E+V*(s.width/Q),L-=U*(s.offsetY/G),w=L-U*(s.height/G)}e.$I.ortho(I.projection,E,T,L,w,u,d),e.$I.lookAt(I.view,I.position,I.target,I.up)}(this);break;case"perspective":!function _(I){const l=I.viewport.width/I.viewport.height,{near:m,far:u,viewOffset:d}=I;let s=m*Math.tan(.5*I.state.fov),C=2*s,h=l*C,a=-.5*h;d.enabled&&(a+=d.offsetX*h/d.fullWidth,s-=d.offsetY*C/d.fullHeight,h*=d.width/d.fullWidth,C*=d.height/d.fullHeight),e.$I.perspective(I.projection,a,a+h,s,s-C,m,u),e.$I.lookAt(I.view,I.position,I.target,I.up)}(this);break;default:(0,y.dr)(this.state.mode)}const u=!e.$I.areEqual(this.projection,this.prevProjection,e.p8)||!e.$I.areEqual(this.view,this.prevView,e.p8);if(u){if(e.$I.mul(this.projectionView,this.projection,this.view),!e.$I.tryInvert(this.inverseProjectionView,this.projectionView))return e.$I.copy(this.view,this.prevView),e.$I.copy(this.projection,this.prevProjection),e.$I.mul(this.projectionView,this.projection,this.view),!1;e.$I.copy(this.prevView,this.view),e.$I.copy(this.prevProjection,this.projection)}return u}setState(l,m){this.transition.apply(l,m),this.stateChanged.next(l)}getSnapshot(){return O.copySnapshot(O.createDefaultSnapshot(),this.state)}getTargetDistance(l){return O.targetDistance(l,this.state.mode,this.state.fov,this.viewport.width,this.viewport.height)}getFocus(l,m,u,d,s){var C,h;const a=Math.max(m,.01),S=this.getTargetDistance(a);e.eB.sub(this.deltaDirection,null!==(C=s?.target)&&void 0!==C?C:this.target,null!==(h=s?.position)&&void 0!==h?h:this.position),d&&e.eB.matchDirection(this.deltaDirection,d,this.deltaDirection),e.eB.setMagnitude(this.deltaDirection,this.deltaDirection,S),e.eB.sub(this.newPosition,l,this.deltaDirection);const D=O.copySnapshot(O.createDefaultSnapshot(),this.state);return D.target=e.eB.clone(l),D.radius=a,D.position=e.eB.clone(this.newPosition),u&&e.eB.matchDirection(D.up,u,D.up),D}getCenter(l,m){e.eB.sub(this.deltaDirection,this.target,this.position),e.eB.sub(this.newPosition,l,this.deltaDirection);const u=O.copySnapshot(O.createDefaultSnapshot(),this.state);return u.target=e.eB.clone(l),u.position=e.eB.clone(this.newPosition),m&&(u.radius=Math.max(m,.01)),u}getInvariantFocus(l,m,u,d){const s=Math.max(m,.01),C=this.getTargetDistance(s);e.eB.copy(this.deltaDirection,d),e.eB.setMagnitude(this.deltaDirection,this.deltaDirection,C),e.eB.sub(this.newPosition,l,this.deltaDirection);const h=O.copySnapshot(O.createDefaultSnapshot(),this.state);return h.target=e.eB.clone(l),h.radius=s,h.position=e.eB.clone(this.newPosition),e.eB.copy(h.up,u),h}focus(l,m,u,d,s){m>0&&this.setState(this.getFocus(l,m,d,s),u)}center(l,m){this.setState(this.getCenter(l),m)}project(l,m){return(0,o.$u)(l,m,this.viewport,this.projectionView)}unproject(l,m){return(0,o.IW)(l,m,this.viewport,this.inverseProjectionView)}getPixelSize(l){return this.project(v,l),this.unproject(c,v),v[0]+=1,this.unproject(i,v),e.eB.distance(c,i)}constructor(l,m=o.LM.create(0,0,128,128)){this.view=e.$I.identity(),this.projection=e.$I.identity(),this.projectionView=e.$I.identity(),this.inverseProjectionView=e.$I.identity(),this.state=O.createDefaultSnapshot(),this.viewOffset=O.ViewOffset(),this.near=1,this.far=1e4,this.fogNear=5e3,this.fogFar=1e4,this.zoom=1,this.transition=new t(this),this.stateChanged=new A.t(this.state),this.prevProjection=e.$I.identity(),this.prevView=e.$I.identity(),this.deltaDirection=(0,e.eB)(),this.newPosition=(0,e.eB)(),this.viewport=m,O.copySnapshot(this.state,l)}}var I;(I=O||(O={})).ViewOffset=function l(){return{enabled:!1,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}},I.setViewOffset=function m(a,S,D,R,f,p,E){a.fullWidth=S,a.fullHeight=D,a.offsetX=R,a.offsetY=f,a.width=p,a.height=E},I.copyViewOffset=function u(a,S){a.enabled=S.enabled,a.fullWidth=S.fullWidth,a.fullHeight=S.fullHeight,a.offsetX=S.offsetX,a.offsetY=S.offsetY,a.width=S.width,a.height=S.height},I.targetDistance=function d(a,S,D,R,f){const p=Math.max(a,.01),T=f{"use strict";n.d(Ue,{$u:()=>t,IW:()=>A,LM:()=>o});var y,e=n(4369);function o(){return o.zero()}(y=o||(o={})).zero=function c(){return{x:0,y:0,width:0,height:0}},y.create=function i(I,l,m,u){return{x:I,y:l,width:m,height:u}},y.clone=function v(I){return{...I}},y.copy=function O(I,l){return Object.assign(I,l)},y.set=function b(I,l,m,u,d){return I.x=l,I.y=m,I.width=u,I.height=d,I},y.toVec4=function _(I,l){return I[0]=l.x,I[1]=l.y,I[2]=l.width,I[3]=l.height,I},y.equals=function M(I,l){return I.x===l.x&&I.y===l.y&&I.width===l.width&&I.height===l.height};const r=(0,e.Zb)();function t(y,c,i,v){const{x:O,y:b,width:_,height:M}=i;e.Zb.set(r,c[0],c[1],c[2],1),e.Zb.transformMat4(r,r,v);const I=r[3];return 0!==I&&(r[0]/=I,r[1]/=I,r[2]/=I),y[0]=(r[0]+1)*_*.5+O,y[1]=(r[1]+1)*M*.5+b,y[2]=.5*(r[2]+1),y[3]=0===I?0:1/I,y}function A(y,c,i,v){const{x:O,y:b,width:_,height:M}=i,l=c[1]-b,m=c[2];return y[0]=2*(c[0]-O)/_-1,y[1]=2*l/M-1,y[2]=2*m-1,e.eB.transformMat4(y,y,v)}},3177:(tn,Ue,n)=>{"use strict";n.d(Ue,{mX:()=>En,H7:()=>Xt,_i:()=>ht,FN:()=>pt});var e=n(4412),o=n(9854),r=n(4369),t=n(4080),A=n(7361),y=n(190),c=n(9909),i=n(8277),v=n(4490),O=n(6115),b=n(127),_=n(2629),M=n(9137),I=n(9457),l=function(Tt){return Tt[Tt.None=0]="None",Tt[Tt.Object=1]="Object",Tt[Tt.Instance=2]="Instance",Tt[Tt.Group=3]="Group",Tt}(l||{}),m=function(Tt){return Tt[Tt.None=0]="None",Tt[Tt.Depth=1]="Depth",Tt[Tt.Mask=2]="Mask",Tt}(m||{});const u={backgroundColor:i.t.Color((0,y.Q1)(0),{description:"Background color of the 3D canvas"}),pickingAlphaThreshold:i.t.Numeric(.5,{min:0,max:1,step:.01},{description:"The minimum opacity value needed for an object to be pickable."}),interiorDarkening:i.t.Numeric(.5,{min:0,max:1,step:.01}),interiorColorFlag:i.t.Boolean(!0,{label:"Use Interior Color"}),interiorColor:i.t.Color(y.Q1.fromNormalizedRgb(.3,.3,.3)),colorMarker:i.t.Boolean(!0,{description:"Enable color marker"}),highlightColor:i.t.Color(y.Q1.fromNormalizedRgb(1,.4,.6)),selectColor:i.t.Color(y.Q1.fromNormalizedRgb(.2,1,.1)),dimColor:i.t.Color(y.Q1.fromNormalizedRgb(1,1,1)),highlightStrength:i.t.Numeric(.3,{min:0,max:1,step:.1}),selectStrength:i.t.Numeric(.3,{min:0,max:1,step:.1}),dimStrength:i.t.Numeric(0,{min:0,max:1,step:.1}),markerPriority:i.t.Select(1,[[1,"Highlight"],[2,"Select"]]),xrayEdgeFalloff:i.t.Numeric(1,{min:0,max:3,step:.1}),exposure:i.t.Numeric(1,{min:0,max:3,step:.01}),light:i.t.ObjectList({inclination:i.t.Numeric(150,{min:0,max:180,step:1}),azimuth:i.t.Numeric(320,{min:0,max:360,step:1}),color:i.t.Color(y.Q1.fromNormalizedRgb(1,1,1)),intensity:i.t.Numeric(.6,{min:0,max:5,step:.01})},Tt=>y.Q1.toHexString(Tt.color),{defaultValue:[{inclination:150,azimuth:320,color:y.Q1.fromNormalizedRgb(1,1,1),intensity:.6}]}),ambientColor:i.t.Color(y.Q1.fromNormalizedRgb(1,1,1)),ambientIntensity:i.t.Numeric(.4,{min:0,max:2,step:.01})},d=(0,r.eB)(),s=(0,r.eB)();function C(Tt,Fe){const He=Tt.length,{direction:Ye,color:ot}=Fe||{direction:new Array(3*He).fill(0),color:new Array(3*He).fill(0)};for(let rt=0;rt{var zr,lr,kr;if(Hn.state.disposed||!Hn.state.visible||!Hn.state.pickable&&"pick"===qr||!M.Q.intersectsSphere3D(Po,Hn.values.boundingSphere.ref.value))return;const[Qr,vi]=Hn.values.uLod.ref.value;if(0!==Qr||0!==vi){const{center:bi,radius:Vi}=Hn.values.boundingSphere.ref.value,Ei=I.i.distanceToPoint(So,bi);if(Ei+Vivi)return}const Ti=Hn.values.instanceGrid.ref.value.cellSize>1;Ti||Ti&&Hn.values.lodLevels?Hn.cull(So,Po,rr,He.stats):Hn.uncull();let Bi=!1;Hn.values.dLightCount.ref.value!==mn.count&&(c.IQ.update(Hn.values.dLightCount,mn.count),Bi=!0),Hn.values.dColorMarker.ref.value!==vt.colorMarker&&(c.IQ.update(Hn.values.dColorMarker,vt.colorMarker),Bi=!0),Bi&&Hn.update();const Li=Hn.getProgram(qr);if(rt.currentProgramId!==Li.id&&(Eo=!0,Li.use()),Eo&&(Li.setUniforms(Co),Li.bindTextures(tr,0),Eo=!1),"directVolume"===Hn.values.dGeometryType.ref.value){if("color"!==qr)return;rt.disable(ot.CULL_FACE),rt.frontFace(ot.CCW),3===co&&(rt.disable(ot.DEPTH_TEST),rt.depthMask(!1))}else 1===co?(rt.enable(ot.CULL_FACE),null!==(zr=Hn.values.dFlipSided)&&void 0!==zr&&zr.ref.value?(rt.frontFace(ot.CW),rt.cullFace(ot.FRONT)):(rt.frontFace(ot.CCW),rt.cullFace(ot.BACK))):2===co?(rt.enable(ot.CULL_FACE),null!==(lr=Hn.values.dFlipSided)&&void 0!==lr&&lr.ref.value?(rt.frontFace(ot.CW),rt.cullFace(ot.BACK)):(rt.frontFace(ot.CCW),rt.cullFace(ot.FRONT))):(Hn.values.uDoubleSided?Hn.values.uDoubleSided.ref.value||Hn.values.hasReflection.ref.value?rt.disable(ot.CULL_FACE):rt.enable(ot.CULL_FACE):rt.disable(ot.CULL_FACE),null!==(kr=Hn.values.dFlipSided)&&void 0!==kr&&kr.ref.value?(rt.frontFace(ot.CW),rt.cullFace(ot.FRONT)):(rt.frontFace(ot.CCW),rt.cullFace(ot.BACK)));Hn.render(qr,tr.length)},Yo=(Hn,qr,co,zr,lr)=>{(0,O.$6)(tr,"tDepth",co||Vr),c.IQ.update(jr.uModel,Hn.view),c.IQ.update(jr.uModelView,r.$I.mul(Gr,qr.view,Hn.view)),c.IQ.update(jr.uInvModelView,r.$I.invert(Ao,Gr)),c.IQ.update(jr.uModelViewProjection,r.$I.mul(vo,Gr,qr.projection)),c.IQ.update(jr.uInvModelViewProjection,r.$I.invert(Kr,vo)),c.IQ.updateIfChanged(jr.uRenderMask,zr),c.IQ.updateIfChanged(jr.uMarkingDepthTest,lr),rt.enable(ot.SCISSOR_TEST),rt.colorMask(!0,!0,!0,!0);const{x:kr,y:Qr,width:vi,height:Ti}=zt;rt.viewport(kr,Qr,vi,Ti),rt.scissor(kr,Qr,vi,Ti),Eo=!0,rt.currentRenderItemId=-1},ci=function(Hn){var qr,co,zr,lr;const kr=(0,b.qE)(Hn.values.alpha.ref.value*Hn.state.alphaFactor,0,1),Qr="on"===(null===(qr=Hn.values.dXrayShaded)||void 0===qr?void 0:qr.ref.value)||"inverted"===(null===(co=Hn.values.dXrayShaded)||void 0===co?void 0:co.ref.value);return 1===kr&&1!==Hn.values.transparencyAverage.ref.value&&"directVolume"!==Hn.values.dGeometryType.ref.value&&"fuzzy"!==(null===(zr=Hn.values.dPointStyle)||void 0===zr?void 0:zr.ref.value)&&!Qr||"opaque"===(null===(lr=Hn.values.dTransparentBackfaces)||void 0===lr?void 0:lr.ref.value)},Jo=function(Hn){var qr,co,zr;const lr=(0,b.qE)(Hn.values.alpha.ref.value*Hn.state.alphaFactor,0,1),kr="on"===(null===(qr=Hn.values.dXrayShaded)||void 0===qr?void 0:qr.ref.value)||"inverted"===(null===(co=Hn.values.dXrayShaded)||void 0===co?void 0:co.ref.value);return lr<1&&0!==lr||Hn.values.transparencyAverage.ref.value>0||"directVolume"===Hn.values.dGeometryType.ref.value||"fuzzy"===(null===(zr=Hn.values.dPointStyle)||void 0===zr?void 0:zr.ref.value)||"text"===Hn.values.dGeometryType.ref.value||"image"===Hn.values.dGeometryType.ref.value||kr},es=(Hn,qr,co)=>{_.g$&&He.timer.mark("Renderer.renderBlendedOpaque"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,1,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{var zr,lr;_.g$&&He.timer.mark("Renderer.renderBlendedTransparent"),Fn?rt.blendFunc(ot.ONE,ot.ONE_MINUS_SRC_ALPHA):rt.blendFuncSeparate(ot.SRC_ALPHA,ot.ONE_MINUS_SRC_ALPHA,ot.ONE,ot.ONE_MINUS_SRC_ALPHA),rt.enable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!1),Yo(Hn,qr,co,2,!1);const{renderables:kr}=Hn;for(let Qr=0,vi=kr.length;Qr{rt.enable(ot.SCISSOR_TEST),rt.enable(ot.DEPTH_TEST),rt.colorMask(!0,!0,!0,!0),rt.depthMask(!0),Fn&&!qr?rt.clearColor(0,0,0,0):Hn?rt.clearColor(Vn[0],Vn[1],Vn[2],1):rt.clearColor(1,1,1,1),ot.clear(ot.COLOR_BUFFER_BIT|ot.DEPTH_BUFFER_BIT)},clearDepth:(Hn=!1)=>{rt.enable(ot.SCISSOR_TEST),Hn?(rt.colorMask(!0,!0,!0,!0),rt.clearColor(1,1,1,1),ot.clear(ot.COLOR_BUFFER_BIT|ot.DEPTH_BUFFER_BIT)):(rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),ot.clear(ot.DEPTH_BUFFER_BIT))},update:(Hn,qr)=>{c.IQ.update(jr.uView,Hn.view),c.IQ.update(jr.uInvView,r.$I.invert(oo,Hn.view)),c.IQ.update(jr.uProjection,Hn.projection),c.IQ.update(jr.uInvProjection,r.$I.invert(yo,Hn.projection)),c.IQ.updateIfChanged(jr.uIsOrtho,"orthographic"===Hn.state.mode?1:0),c.IQ.update(jr.uViewOffset,Hn.viewOffset.enabled?r.ZY.set(ao,16*Hn.viewOffset.offsetX,16*Hn.viewOffset.offsetY):r.ZY.set(ao,0,0)),c.IQ.update(jr.uCameraPosition,r.eB.copy(lo,Hn.state.position)),c.IQ.update(jr.uCameraDir,r.eB.normalize(Do,r.eB.sub(Do,Hn.state.target,Hn.state.position))),c.IQ.updateIfChanged(jr.uFar,Hn.far),c.IQ.updateIfChanged(jr.uNear,Hn.near),c.IQ.updateIfChanged(jr.uFog,Hn.state.fog>0),c.IQ.updateIfChanged(jr.uFogFar,Hn.fogFar),c.IQ.updateIfChanged(jr.uFogNear,Hn.fogNear),c.IQ.updateIfChanged(jr.uTransparentBackground,Fn),M.Q.fromProjectionMatrix(Po,Hn.projectionView),I.i.copy(So,Po[5]),So.constant-=I.i.distanceToPoint(So,lo),c.IQ.update(jr.uCameraPlane,I.i.toArray(So,jr.uCameraPlane.ref.value,0)),c.IQ.updateIfChanged(jr.uMarkerAverage,qr.markerAverage)},renderPick:(Hn,qr,co,zr,lr)=>{_.g$&&He.timer.mark("Renderer.renderPick"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,zr,0,!1),c.IQ.updateIfChanged(jr.uPickType,lr);const{renderables:kr}=Hn;for(let Qr=0,vi=kr.length;Qr{_.g$&&He.timer.mark("Renderer.renderDepth"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,0,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderDepthOpaque"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,1,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderDepthTransparent"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,2,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderMarkingDepth"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,0,!1),c.IQ.updateIfChanged(jr.uMarkingType,m.Depth);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderMarkingMask"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,0,!!co),c.IQ.updateIfChanged(jr.uMarkingType,m.Mask);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr0&&Fo(zr[lr],"marking",0);_.g$&&He.timer.markEnd("Renderer.renderMarkingMask")},renderEmissive:(Hn,qr,co)=>{_.g$&&He.timer.mark("Renderer.renderEmissive"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,1,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{Hn.hasOpaque&&es(Hn,qr,null),Hn.opacityAverage<1&&Si(Hn,qr,null)},renderBlendedOpaque:es,renderBlendedTransparent:Si,renderBlendedVolume:(Hn,qr,co)=>{_.g$&&He.timer.mark("Renderer.renderBlendedVolume"),rt.blendFunc(ot.ONE,ot.ONE_MINUS_SRC_ALPHA),rt.enable(ot.BLEND),rt.depthMask(!1),Yo(Hn,qr,co,2,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderWboitOpaque"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,1,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderWboitTransparent"),Yo(Hn,qr,co,2,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderDpoitOpaque"),rt.disable(ot.BLEND),rt.enable(ot.DEPTH_TEST),rt.depthMask(!0),Yo(Hn,qr,co,1,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{_.g$&&He.timer.mark("Renderer.renderDpoitTransparent"),rt.enable(ot.BLEND),(0,O.$6)(tr,"tDpoitDepth",zr.depth),(0,O.$6)(tr,"tDpoitFrontColor",zr.frontColor),(0,O.$6)(tr,"tDpoitBackColor",zr.backColor),Yo(Hn,qr,co,2,!1);const{renderables:lr}=Hn;for(let kr=0,Qr=lr.length;kr{_.g$&&He.timer.mark("Renderer.renderDpoitVolume"),rt.blendFunc(ot.ONE,ot.ONE_MINUS_SRC_ALPHA),rt.enable(ot.BLEND),Yo(Hn,qr,co,2,!1);const{renderables:zr}=Hn;for(let lr=0,kr=zr.length;lr{void 0!==Hn.backgroundColor&&Hn.backgroundColor!==vt.backgroundColor&&(vt.backgroundColor=Hn.backgroundColor,y.Q1.toVec3Normalized(Vn,vt.backgroundColor),c.IQ.update(jr.uFogColor,r.eB.copy(jr.uFogColor.ref.value,Vn))),void 0!==Hn.pickingAlphaThreshold&&Hn.pickingAlphaThreshold!==vt.pickingAlphaThreshold&&(vt.pickingAlphaThreshold=Hn.pickingAlphaThreshold,c.IQ.update(jr.uPickingAlphaThreshold,vt.pickingAlphaThreshold)),void 0!==Hn.interiorDarkening&&Hn.interiorDarkening!==vt.interiorDarkening&&(vt.interiorDarkening=Hn.interiorDarkening,c.IQ.update(jr.uInteriorDarkening,vt.interiorDarkening)),void 0!==Hn.interiorColorFlag&&Hn.interiorColorFlag!==vt.interiorColorFlag&&(vt.interiorColorFlag=Hn.interiorColorFlag,c.IQ.update(jr.uInteriorColorFlag,vt.interiorColorFlag)),void 0!==Hn.interiorColor&&Hn.interiorColor!==vt.interiorColor&&(vt.interiorColor=Hn.interiorColor,c.IQ.update(jr.uInteriorColor,y.Q1.toVec3Normalized(jr.uInteriorColor.ref.value,vt.interiorColor))),void 0!==Hn.colorMarker&&Hn.colorMarker!==vt.colorMarker&&(vt.colorMarker=Hn.colorMarker),void 0!==Hn.highlightColor&&Hn.highlightColor!==vt.highlightColor&&(vt.highlightColor=Hn.highlightColor,c.IQ.update(jr.uHighlightColor,y.Q1.toVec3Normalized(jr.uHighlightColor.ref.value,vt.highlightColor))),void 0!==Hn.selectColor&&Hn.selectColor!==vt.selectColor&&(vt.selectColor=Hn.selectColor,c.IQ.update(jr.uSelectColor,y.Q1.toVec3Normalized(jr.uSelectColor.ref.value,vt.selectColor))),void 0!==Hn.dimColor&&Hn.dimColor!==vt.dimColor&&(vt.dimColor=Hn.dimColor,c.IQ.update(jr.uDimColor,y.Q1.toVec3Normalized(jr.uDimColor.ref.value,vt.dimColor))),void 0!==Hn.highlightStrength&&Hn.highlightStrength!==vt.highlightStrength&&(vt.highlightStrength=Hn.highlightStrength,c.IQ.update(jr.uHighlightStrength,vt.highlightStrength)),void 0!==Hn.selectStrength&&Hn.selectStrength!==vt.selectStrength&&(vt.selectStrength=Hn.selectStrength,c.IQ.update(jr.uSelectStrength,vt.selectStrength)),void 0!==Hn.dimStrength&&Hn.dimStrength!==vt.dimStrength&&(vt.dimStrength=Hn.dimStrength,c.IQ.update(jr.uDimStrength,vt.dimStrength)),void 0!==Hn.markerPriority&&Hn.markerPriority!==vt.markerPriority&&(vt.markerPriority=Hn.markerPriority,c.IQ.update(jr.uMarkerPriority,vt.markerPriority)),void 0!==Hn.xrayEdgeFalloff&&Hn.xrayEdgeFalloff!==vt.xrayEdgeFalloff&&(vt.xrayEdgeFalloff=Hn.xrayEdgeFalloff,c.IQ.update(jr.uXrayEdgeFalloff,vt.xrayEdgeFalloff)),void 0!==Hn.exposure&&Hn.exposure!==vt.exposure&&(vt.exposure=Hn.exposure,c.IQ.update(jr.uExposure,vt.exposure)),void 0!==Hn.light&&!(0,c.bD)(Hn.light,vt.light)&&(vt.light=Hn.light,Object.assign(mn,C(Hn.light,mn)),c.IQ.update(jr.uLightDirection,mn.direction),c.IQ.update(jr.uLightColor,mn.color)),void 0!==Hn.ambientColor&&Hn.ambientColor!==vt.ambientColor&&(vt.ambientColor=Hn.ambientColor,r.eB.scale(Yr,y.Q1.toArrayNormalized(vt.ambientColor,Yr,0),vt.ambientIntensity),c.IQ.update(jr.uAmbientColor,Yr)),void 0!==Hn.ambientIntensity&&Hn.ambientIntensity!==vt.ambientIntensity&&(vt.ambientIntensity=Hn.ambientIntensity,r.eB.scale(Yr,y.Q1.toArrayNormalized(vt.ambientColor,Yr,0),vt.ambientIntensity),c.IQ.update(jr.uAmbientColor,Yr))},setViewport:(Hn,qr,co,zr)=>{rt.viewport(Hn,qr,co,zr),rt.scissor(Hn,qr,co,zr),(Hn!==zt.x||qr!==zt.y||co!==zt.width||zr!==zt.height)&&(A.LM.set(zt,Hn,qr,co,zr),c.IQ.update(jr.uViewport,r.Zb.set(jr.uViewport.ref.value,Hn,qr,co,zr)))},setTransparentBackground:Hn=>{Fn=Hn},setDrawingBufferSize:(Hn,qr)=>{(Hn!==an[0]||qr!==an[1])&&c.IQ.update(jr.uDrawingBufferSize,r.ZY.set(an,Hn,qr))},setPixelRatio:Hn=>{c.IQ.update(jr.uPixelRatio,Hn)},setOcclusionTest:Hn=>{rr=Hn},props:vt,get stats(){return{programCount:He.stats.resourceCounts.program,shaderCount:He.stats.resourceCounts.shader,attributeCount:He.stats.resourceCounts.attribute,elementsCount:He.stats.resourceCounts.elements,framebufferCount:He.stats.resourceCounts.framebuffer,renderbufferCount:He.stats.resourceCounts.renderbuffer,textureCount:He.stats.resourceCounts.texture,vertexArrayCount:He.stats.resourceCounts.vertexArray,drawCount:St.drawCount,instanceCount:St.instanceCount,instancedDrawCount:St.instancedDrawCount}},get light(){return mn},dispose:()=>{}}};var a=n(4123);const S=t.qt,D=t.Fs,R=a.O.Trigger,f=a.O.TriggerKey,p={dragRotate:(0,a.O)([R(S.Flag.Primary,D.create())],"Rotate","Drag using ${triggers}"),dragRotateZ:(0,a.O)([R(S.Flag.Primary,D.create({shift:!0,control:!0}))],"Rotate around z-axis (roll)","Drag using ${triggers}"),dragPan:(0,a.O)([R(S.Flag.Secondary,D.create()),R(S.Flag.Primary,D.create({control:!0}))],"Pan","Drag using ${triggers}"),dragZoom:a.O.Empty,dragFocus:(0,a.O)([R(S.Flag.Forth,D.create())],"Focus","Drag using ${triggers}"),dragFocusZoom:(0,a.O)([R(S.Flag.Auxilary,D.create())],"Focus and zoom","Drag using ${triggers}"),scrollZoom:(0,a.O)([R(S.Flag.Auxilary,D.create())],"Zoom","Scroll using ${triggers}"),scrollFocus:(0,a.O)([R(S.Flag.Auxilary,D.create({shift:!0}))],"Clip","Scroll using ${triggers}"),scrollFocusZoom:a.O.Empty,keyMoveForward:(0,a.O)([f("KeyW")],"Move forward","Press ${triggers}"),keyMoveBack:(0,a.O)([f("KeyS")],"Move back","Press ${triggers}"),keyMoveLeft:(0,a.O)([f("KeyA")],"Move left","Press ${triggers}"),keyMoveRight:(0,a.O)([f("KeyD")],"Move right","Press ${triggers}"),keyMoveUp:(0,a.O)([f("KeyR")],"Move up","Press ${triggers}"),keyMoveDown:(0,a.O)([f("KeyF")],"Move down","Press ${triggers}"),keyRollLeft:(0,a.O)([f("KeyQ")],"Roll left","Press ${triggers}"),keyRollRight:(0,a.O)([f("KeyE")],"Roll right","Press ${triggers}"),keyPitchUp:(0,a.O)([f("ArrowUp",D.create({shift:!0}))],"Pitch up","Press ${triggers}"),keyPitchDown:(0,a.O)([f("ArrowDown",D.create({shift:!0}))],"Pitch down","Press ${triggers}"),keyYawLeft:(0,a.O)([f("ArrowLeft",D.create({shift:!0}))],"Yaw left","Press ${triggers}"),keyYawRight:(0,a.O)([f("ArrowRight",D.create({shift:!0}))],"Yaw right","Press ${triggers}"),boostMove:(0,a.O)([f("ShiftLeft")],"Boost move","Press ${triggers}"),enablePointerLock:(0,a.O)([f("Space",D.create({control:!0}))],"Enable pointer lock","Press ${triggers}")},E={noScroll:i.t.Boolean(!0,{isHidden:!0}),rotateSpeed:i.t.Numeric(5,{min:1,max:10,step:1}),zoomSpeed:i.t.Numeric(7,{min:1,max:15,step:1}),panSpeed:i.t.Numeric(1,{min:.1,max:5,step:.1}),moveSpeed:i.t.Numeric(.75,{min:.1,max:3,step:.1}),boostMoveFactor:i.t.Numeric(5,{min:.1,max:10,step:.1}),flyMode:i.t.Boolean(!1),animate:i.t.MappedStatic("off",{off:i.t.EmptyGroup(),spin:i.t.Group({speed:i.t.Numeric(1,{min:-20,max:20,step:1})},{description:"Spin the 3D scene around the x-axis in view space"}),rock:i.t.Group({speed:i.t.Numeric(.3,{min:-5,max:5,step:.1}),angle:i.t.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:i.t.Boolean(!0,{isHidden:!0}),dynamicDampingFactor:i.t.Numeric(.2,{},{isHidden:!0}),minDistance:i.t.Numeric(.01,{},{isHidden:!0}),maxDistance:i.t.Numeric(1e150,{},{isHidden:!0}),gestureScaleFactor:i.t.Numeric(1,{},{isHidden:!0}),maxWheelDelta:i.t.Numeric(.02,{},{isHidden:!0}),bindings:i.t.Value(p,{isHidden:!0}),autoAdjustMinMaxDistance:i.t.MappedStatic("on",{off:i.t.EmptyGroup(),on:i.t.Group({minDistanceFactor:i.t.Numeric(0),minDistancePadding:i.t.Numeric(5),maxDistanceFactor:i.t.Numeric(10),maxDistanceMin:i.t.Numeric(20)})},{isHidden:!0})};var T;(T||(T={})).create=function Fe(He,Ye,ot,rt={}){const St={...i.t.getDefaultValues(E),...rt,bindings:{...p,...rt.bindings}},vt=St.bindings,mn=A.LM.clone(Ye.viewport);let zt=!1;const an=He.drag.subscribe(function et({x:hr,y:Wr,pageX:no,pageY:zo,buttons:Di,modifiers:zi,isStart:Ki}){const Mi=sr(hr,Wr);if(Ki&&Mi||!Ki&&!yo)return;yo=!0,Gi();const ds=a.O.match(vt.dragRotate,Di,zi),he=a.O.match(vt.dragRotateZ,Di,zi),fe=a.O.match(vt.dragPan,Di,zi),ze=a.O.match(vt.dragZoom,Di,zi),Ze=a.O.match(vt.dragFocus,Di,zi),it=a.O.match(vt.dragFocusZoom,Di,zi);ti(no,zo),function qi(hr,Wr){r.ZY.set(mi,(hr-mn.x)/mn.width,(Wr-mn.y)/mn.height)}(no,zo);const Rt=He.pixelRatio,X=(hr*Rt-mn.width/2-mn.x)/mn.width,pe=-(He.height-Wr*Rt-mn.height/2-mn.y)/mn.height;if(Ki&&(ds&&(r.ZY.copy(lo,Oi),r.ZY.copy(Do,lo)),he&&(r.ZY.set(Yr,X,pe),r.ZY.copy(Po,Yr)),(ze||it)&&(r.ZY.copy(Fo,mi),r.ZY.copy(ei,Fo)),Ze&&(r.ZY.copy(Yo,mi),r.ZY.copy(ci,Yo)),fe&&(r.ZY.copy(Jo,mi),r.ZY.copy(Fi,Jo))),ds&&r.ZY.copy(lo,Oi),he&&r.ZY.set(Yr,X,pe),(ze||it)&&r.ZY.copy(ei,mi),Ze&&r.ZY.copy(ci,mi),it){const De=r.eB.distance(Ye.state.position,Ye.state.target);Ye.setState({radius:De/5})}fe&&r.ZY.copy(Fi,mi)}),Vn=He.interactionEnd.subscribe(function at(){yo=!1}),Fn=He.wheel.subscribe(function Et({x:hr,y:Wr,spinX:no,spinY:zo,dz:Di,buttons:zi,modifiers:Ki}){if(sr(hr,Wr))return;let Mi=(0,v.TY)(.075*no,.075*zo,1e-4*Di);Mi<-St.maxWheelDelta?Mi=-St.maxWheelDelta:Mi>St.maxWheelDelta&&(Mi=St.maxWheelDelta),a.O.match(vt.scrollZoom,zi,Ki)&&(ei[1]+=Mi),a.O.match(vt.scrollFocus,zi,Ki)&&(ci[1]+=Mi)}),rr=He.pinch.subscribe(function Nt({fractionDelta:hr,buttons:Wr,modifiers:no}){a.O.match(vt.scrollZoom,Wr,no)&&(yo=!0,ei[1]+=St.gestureScaleFactor*hr)}),Vr=He.gesture.subscribe(function qt({deltaScale:hr}){yo=!0,ei[1]+=St.gestureScaleFactor*hr}),tr=He.keyDown.subscribe(function Un({modifiers:hr,code:Wr,key:no,x:zo,y:Di}){sr(zo,Di)||(a.O.matchKey(vt.keyMoveForward,Wr,hr,no)?Ht.moveForward=1:a.O.matchKey(vt.keyMoveBack,Wr,hr,no)?Ht.moveBack=1:a.O.matchKey(vt.keyMoveLeft,Wr,hr,no)?Ht.moveLeft=1:a.O.matchKey(vt.keyMoveRight,Wr,hr,no)?Ht.moveRight=1:a.O.matchKey(vt.keyMoveUp,Wr,hr,no)?Ht.moveUp=1:a.O.matchKey(vt.keyMoveDown,Wr,hr,no)?Ht.moveDown=1:a.O.matchKey(vt.keyRollLeft,Wr,hr,no)?Ht.rollLeft=1:a.O.matchKey(vt.keyRollRight,Wr,hr,no)?Ht.rollRight=1:a.O.matchKey(vt.keyPitchUp,Wr,hr,no)?Ht.pitchUp=1:a.O.matchKey(vt.keyPitchDown,Wr,hr,no)?Ht.pitchDown=1:a.O.matchKey(vt.keyYawLeft,Wr,hr,no)?Ht.yawLeft=1:a.O.matchKey(vt.keyYawRight,Wr,hr,no)&&(Ht.yawRight=1),a.O.matchKey(vt.boostMove,Wr,hr,no)&&(Ht.boostMove=1),a.O.matchKey(vt.enablePointerLock,Wr,hr,no)&&He.requestPointerLock(mn))}),Tr=He.keyUp.subscribe(function vn({modifiers:hr,code:Wr,key:no,x:zo,y:Di}){var zi,Ki,Mi,ds,he,fe,ze,Ze,it,Rt,X,pe;if(sr(zo,Di))return;let De=!1;Wr.startsWith("Alt")?(De=!0,hr.alt=!0):Wr.startsWith("Shift")?(De=!0,hr.shift=!0):Wr.startsWith("Control")?(De=!0,hr.control=!0):Wr.startsWith("Meta")&&(De=!0,hr.meta=!0);const Ee=[];De?(Ht.moveForward&&Ee.push((null===(zi=vt.keyMoveForward.triggers[0])||void 0===zi?void 0:zi.code)||""),Ht.moveBack&&Ee.push((null===(Ki=vt.keyMoveBack.triggers[0])||void 0===Ki?void 0:Ki.code)||""),Ht.moveLeft&&Ee.push((null===(Mi=vt.keyMoveLeft.triggers[0])||void 0===Mi?void 0:Mi.code)||""),Ht.moveRight&&Ee.push((null===(ds=vt.keyMoveRight.triggers[0])||void 0===ds?void 0:ds.code)||""),Ht.moveUp&&Ee.push((null===(he=vt.keyMoveUp.triggers[0])||void 0===he?void 0:he.code)||""),Ht.moveDown&&Ee.push((null===(fe=vt.keyMoveDown.triggers[0])||void 0===fe?void 0:fe.code)||""),Ht.rollLeft&&Ee.push((null===(ze=vt.keyRollLeft.triggers[0])||void 0===ze?void 0:ze.code)||""),Ht.rollRight&&Ee.push((null===(Ze=vt.keyRollRight.triggers[0])||void 0===Ze?void 0:Ze.code)||""),Ht.pitchUp&&Ee.push((null===(it=vt.keyPitchUp.triggers[0])||void 0===it?void 0:it.code)||""),Ht.pitchDown&&Ee.push((null===(Rt=vt.keyPitchDown.triggers[0])||void 0===Rt?void 0:Rt.code)||""),Ht.yawLeft&&Ee.push((null===(X=vt.keyYawLeft.triggers[0])||void 0===X?void 0:X.code)||""),Ht.yawRight&&Ee.push((null===(pe=vt.keyYawRight.triggers[0])||void 0===pe?void 0:pe.code)||"")):Ee.push(Wr);for(const qe of Ee)a.O.matchKey(vt.keyMoveForward,qe,hr,no)?Ht.moveForward=0:a.O.matchKey(vt.keyMoveBack,qe,hr,no)?Ht.moveBack=0:a.O.matchKey(vt.keyMoveLeft,qe,hr,no)?Ht.moveLeft=0:a.O.matchKey(vt.keyMoveRight,qe,hr,no)?Ht.moveRight=0:a.O.matchKey(vt.keyMoveUp,qe,hr,no)?Ht.moveUp=0:a.O.matchKey(vt.keyMoveDown,qe,hr,no)?Ht.moveDown=0:a.O.matchKey(vt.keyRollLeft,qe,hr,no)?Ht.rollLeft=0:a.O.matchKey(vt.keyRollRight,qe,hr,no)?Ht.rollRight=0:a.O.matchKey(vt.keyPitchUp,qe,hr,no)?Ht.pitchUp=0:a.O.matchKey(vt.keyPitchDown,qe,hr,no)?Ht.pitchDown=0:a.O.matchKey(vt.keyYawLeft,qe,hr,no)?Ht.yawLeft=0:a.O.matchKey(vt.keyYawRight,qe,hr,no)&&(Ht.yawRight=0);a.O.matchKey(vt.boostMove,Wr,hr,no)&&(Ht.boostMove=0)}),oo=He.move.subscribe(function Cn({movementX:hr,movementY:Wr}){if(!He.pointerLock||void 0===hr||void 0===Wr)return;const no=.5*mn.width-mn.x,zo=.5*mn.height-mn.y;r.ZY.copy(Do,ti(no,zo)),r.ZY.copy(lo,ti(hr+no,Wr+zo))}),Gr=He.lock.subscribe(function Rr(hr){hr?nr():pr()}),Ao=He.leave.subscribe(function Uo(){!function mo(){Ht.moveForward=0,Ht.moveBack=0,Ht.moveLeft=0,Ht.moveRight=0,Ht.moveUp=0,Ht.moveDown=0,Ht.rollLeft=0,Ht.rollRight=0,Ht.pitchUp=0,Ht.pitchDown=0,Ht.yawLeft=0,Ht.yawRight=0,Ht.boostMove=0}()});let yo=!1;const vo=(0,r.eB)(),Kr=(0,r.eB)(),Do=(0,r.ZY)(),lo=(0,r.ZY)(),So=(0,r.eB)();let ao=0;const Po=(0,r.ZY)(),Yr=(0,r.ZY)();let jr=0,Co=0,Eo=0;const Fo=(0,r.ZY)(),ei=(0,r.ZY)(),Yo=(0,r.ZY)(),ci=(0,r.ZY)(),Jo=(0,r.ZY)(),Fi=(0,r.ZY)(),hi=r.eB.clone(Ye.target),No=r.eB.clone(Ye.position),Ci=r.eB.clone(Ye.up),mi=(0,r.ZY)(),Oi=(0,r.ZY)();function ti(hr,Wr){return r.ZY.set(Oi,(hr-.5*mn.width-mn.x)/(.5*mn.width),(mn.height+2*(mn.y-Wr))/mn.width)}function es(){return St.rotateSpeed*He.pixelRatio*(He.width/He.height||1)}const Si=(0,r.eB)(),Pi=(0,r.k)(),ni=(0,r.eB)(),gi=(0,r.eB)(),Wi=(0,r.eB)(),Ri=(0,r.eB)(),Hn=(0,r.k)(),qr=(0,r.eB)(),zr=(0,r.k)(),lr=(0,r.eB)(),Qr=(0,r.k)(),vi=(0,r.eB)(),bi=(0,r.ZY)(),Vi=(0,r.eB)(),Ei=(0,r.eB)(),Ht={moveUp:0,moveDown:0,moveLeft:0,moveRight:0,moveForward:0,moveBack:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0,boostMove:0},Gn=(0,r.eB)(),ar=(0,r.eB)();function ur(){const hr=Math.min(Math.max(1e3*Ye.state.radiusMax,.01),St.maxDistance);r.eB.squaredMagnitude(Kr)>hr*hr&&(r.eB.setMagnitude(Kr,Kr,hr),r.eB.add(Ye.position,Ye.target,Kr),r.ZY.copy(Fo,ei),r.ZY.copy(Yo,ci)),r.eB.squaredMagnitude(Kr)mn.x+mn.width||He.height-Wr>mn.y+mn.height||hr0&&("spin"===St.animate.name?function fo(hr){if("spin"!==St.animate.name||0===St.animate.params.speed||yo)return;const Wr=St.animate.params.speed/1e3;ri[0]=60*Math.min(Math.abs(hr),125)/1e3*Wr,r.ZY.add(lo,Do,ri)}(Wr):"rock"===St.animate.name&&function rs(hr){if("rock"!==St.animate.name||0===St.animate.params.speed||yo)return;const Wr=hr/1e3*St.animate.params.speed,no=(0,v.pu)(St.animate.params.angle)/es(),zo=Math.sin(Lo*Math.PI*2)*no,Di=Math.sin((Lo+Wr)*Math.PI*2)*no;Ni[0]=Di-zo,r.ZY.add(lo,Do,Ni),Lo+=Wr,Lo>=1&&(Lo=0)}(Wr)),r.eB.sub(Kr,Ye.position,Ye.target),function Qi(){const hr=lo[0]-Do[0],Wr=lo[1]-Do[1];r.eB.set(Ri,hr,Wr,0);const no=r.eB.magnitude(Ri)*es();no?(r.eB.sub(Kr,Ye.position,Ye.target),r.eB.normalize(ni,Kr),r.eB.normalize(gi,Ye.up),r.eB.normalize(Wi,r.eB.cross(Wi,gi,ni)),r.eB.setMagnitude(gi,gi,Wr),r.eB.setMagnitude(Wi,Wi,hr),r.eB.add(Ri,gi,Wi),r.eB.normalize(Si,r.eB.cross(Si,Ri,Kr)),r.k.setAxisAngle(Pi,Si,no),r.eB.transformQuat(Kr,Kr,Pi),r.eB.transformQuat(Ye.up,Ye.up,Pi),r.eB.copy(So,Si),ao=no):!St.staticMoving&&ao&&(ao*=Math.sqrt(1-St.dynamicDampingFactor),r.eB.sub(Kr,Ye.position,Ye.target),r.k.setAxisAngle(Pi,So,ao),r.eB.transformQuat(Kr,Kr,Pi),r.eB.transformQuat(Ye.up,Ye.up,Pi)),r.ZY.copy(Do,lo)}(),function co(){const hr=(Ht.rollRight-Ht.rollLeft)/45,Wr=(Yr[0]-Po[0])*-Math.sign(Yr[1]),no=(Yr[1]-Po[1])*-Math.sign(Yr[0]),zo=-St.rotateSpeed*(-Wr+no)+hr;zo?(r.eB.normalize(qr,Kr),r.k.setAxisAngle(Hn,qr,zo),r.eB.transformQuat(Ye.up,Ye.up,Hn),jr=zo):!St.staticMoving&&jr&&(jr*=Math.sqrt(1-St.dynamicDampingFactor),r.eB.normalize(qr,Kr),r.k.setAxisAngle(Hn,qr,jr),r.eB.transformQuat(Ye.up,Ye.up,Hn)),r.ZY.copy(Po,Yr)}(),function kr(){const Wr=(Ht.pitchUp-Ht.pitchDown)/(St.flyMode?360:90)*-St.rotateSpeed;Wr?(r.eB.cross(lr,Kr,Ye.up),r.eB.normalize(lr,lr),r.k.setAxisAngle(zr,lr,Wr),r.eB.transformQuat(Kr,Kr,zr),r.eB.transformQuat(Ye.up,Ye.up,zr),Co=Wr):!St.staticMoving&&Co&&(Co*=Math.sqrt(1-St.dynamicDampingFactor),r.eB.cross(lr,Kr,Ye.up),r.eB.normalize(lr,lr),r.k.setAxisAngle(zr,lr,Co),r.eB.transformQuat(Kr,Kr,zr),r.eB.transformQuat(Ye.up,Ye.up,zr))}(),function Ti(){const Wr=(Ht.yawRight-Ht.yawLeft)/(St.flyMode?360:90)*-St.rotateSpeed;Wr?(r.eB.normalize(vi,Ye.up),r.k.setAxisAngle(Qr,vi,Wr),r.eB.transformQuat(Kr,Kr,Qr),r.eB.transformQuat(Ye.up,Ye.up,Qr),Eo=Wr):!St.staticMoving&&Eo&&(Eo*=Math.sqrt(1-St.dynamicDampingFactor),r.eB.normalize(vi,Ye.up),r.k.setAxisAngle(Qr,vi,Eo),r.eB.transformQuat(Kr,Kr,Qr),r.eB.transformQuat(Ye.up,Ye.up,Qr))}(),function Bi(){const hr=1+(ei[1]-Fo[1])*St.zoomSpeed;1!==hr&&hr>0&&r.eB.scale(Kr,Kr,hr),St.staticMoving?r.ZY.copy(Fo,ei):Fo[1]+=(ei[1]-Fo[1])*St.dynamicDampingFactor}(),function Li(){const hr=(ci[1]-Yo[1])*St.zoomSpeed;if(0!==hr){const Wr=Math.max(1,Ye.state.radius+Ye.state.radius*hr);Ye.setState({radius:Wr})}St.staticMoving?r.ZY.copy(Yo,ci):Yo[1]+=(ci[1]-Yo[1])*St.dynamicDampingFactor}(),function ln(){if(r.ZY.sub(bi,r.ZY.copy(bi,Fi),Jo),r.ZY.squaredMagnitude(bi)){const hr=He.pixelRatio*St.panSpeed;bi[0]*=1/Ye.zoom*Ye.viewport.width*hr,bi[1]*=1/Ye.zoom*Ye.viewport.height*hr,r.eB.cross(Ei,r.eB.copy(Ei,Kr),Ye.up),r.eB.setMagnitude(Ei,Ei,bi[0]),r.eB.setMagnitude(Vi,Ye.up,bi[1]),r.eB.add(Ei,Ei,Vi),r.eB.add(Ye.position,Ye.position,Ei),r.eB.add(Ye.target,Ye.target,Ei),St.staticMoving?r.ZY.copy(Jo,Fi):(r.ZY.sub(bi,Fi,Jo),r.ZY.scale(bi,bi,St.dynamicDampingFactor),r.ZY.add(Jo,Jo,bi))}}(),r.eB.add(Ye.position,Ye.target,Kr),ur(),Jn>0&&function kn(hr){r.eB.sub(ar,Ye.position,Ye.target);const Wr=Math.max(Ye.state.minNear,St.minDistance);r.eB.setMagnitude(ar,ar,Wr);const no=.06*hr*St.moveSpeed*(1===Ht.boostMove?St.boostMoveFactor:1);if(1===Ht.moveForward&&(r.eB.normalize(Gn,ar),r.eB.scaleAndSub(Ye.position,Ye.position,Gn,no),(St.flyMode||He.pointerLock)&&r.eB.sub(Ye.target,Ye.position,ar)),1===Ht.moveBack&&(r.eB.normalize(Gn,ar),r.eB.scaleAndAdd(Ye.position,Ye.position,Gn,no),(St.flyMode||He.pointerLock)&&r.eB.sub(Ye.target,Ye.position,ar)),1===Ht.moveLeft&&(r.eB.cross(Gn,ar,Ye.up),r.eB.normalize(Gn,Gn),St.flyMode||He.pointerLock?(r.eB.scaleAndAdd(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,ar)):(r.eB.scaleAndSub(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,Kr))),1===Ht.moveRight&&(r.eB.cross(Gn,ar,Ye.up),r.eB.normalize(Gn,Gn),St.flyMode||He.pointerLock?(r.eB.scaleAndSub(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,ar)):(r.eB.scaleAndAdd(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,Kr))),1===Ht.moveUp&&(r.eB.normalize(Gn,Ye.up),St.flyMode||He.pointerLock?(r.eB.scaleAndAdd(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,ar)):(r.eB.scaleAndSub(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,Kr))),1===Ht.moveDown&&(r.eB.normalize(Gn,Ye.up),St.flyMode||He.pointerLock?(r.eB.scaleAndSub(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,ar)):(r.eB.scaleAndAdd(Ye.position,Ye.position,Gn,no),r.eB.sub(Ye.target,Ye.position,Kr))),St.flyMode||He.pointerLock){const zo=r.eB.distance(Ye.position,ot.boundingSphereVisible.center);Ye.setState({minFar:zo+ot.boundingSphereVisible.radius})}}(Math.min(Wr,250)),r.eB.sub(Kr,Ye.position,Ye.target),ur(),r.eB.squaredDistance(vo,Ye.position)>r.p8&&r.eB.copy(vo,Ye.position),Jn=hr}function nr(){r.eB.sub(ar,Ye.position,Ye.target);const hr=Math.max(Ye.state.minNear,St.minDistance);r.eB.setMagnitude(ar,ar,hr),r.eB.sub(Ye.target,Ye.position,ar);const Wr=r.eB.distance(Ye.position,ot.boundingSphereVisible.center);Ye.setState({minFar:Wr+ot.boundingSphereVisible.radius})}function pr(){const{center:hr,radius:Wr}=ot.boundingSphereVisible;if(r.eB.distance(Ye.position,hr)>Wr){const zo=Ye.getFocus(hr,Wr);Ye.setState({...zo,minFar:0})}else Ye.setState({minFar:0,radius:ot.boundingSphereVisible.radius})}const ri=r.ZY.create(.005,0);let Lo=0;const Ni=r.ZY.create(.005,0);function Gi(){Lo=0}return{viewport:mn,get isAnimating(){return"off"!==St.animate.name},get isMoving(){return 1===Ht.moveForward||1===Ht.moveBack||1===Ht.moveLeft||1===Ht.moveRight||1===Ht.moveUp||1===Ht.moveDown||1===Ht.rollLeft||1===Ht.rollRight||1===Ht.pitchUp||1===Ht.pitchDown||1===Ht.yawLeft||1===Ht.yawRight},get props(){return St},setProps:hr=>{var Wr;"rock"===(null===(Wr=hr.animate)||void 0===Wr?void 0:Wr.name)&&"rock"!==St.animate.name&&Gi(),void 0!==hr.flyMode&&hr.flyMode!==St.flyMode&&(hr.flyMode?nr():pr()),Object.assign(St,hr),Object.assign(vt,hr.bindings)},start:function _o(hr){Jn=-1,Br(hr)},update:Br,reset:function st(){r.eB.copy(Ye.target,hi),r.eB.copy(Ye.position,No),r.eB.copy(Ye.up,Ci),r.eB.sub(Kr,Ye.position,Ye.target),r.eB.copy(vo,Ye.position)},dispose:function qo(){zt||(zt=!0,an.unsubscribe(),Fn.unsubscribe(),rr.unsubscribe(),Vr.unsubscribe(),Vn.unsubscribe(),tr.unsubscribe(),Tr.unsubscribe(),oo.unsubscribe(),Gr.unsubscribe(),Ao.unsubscribe())}}};var L=n(6349),w=n(2443),Q=n(4536),G=n(3246),V=n(5276),U=n(8353),N=n(573),k=n(4439),H=n(9283),$=n(5384),J=n(2745),W=n(9132),te=n(542);const de={sceneBoundingSpheres:i.t.Boolean(!1,{description:"Show full scene bounding spheres."}),visibleSceneBoundingSpheres:i.t.Boolean(!1,{description:"Show visible scene bounding spheres."}),objectBoundingSpheres:i.t.Boolean(!1,{description:"Show bounding spheres of visible render objects."}),instanceBoundingSpheres:i.t.Boolean(!1,{description:"Show bounding spheres of visible instances."})};class ye{constructor(Fe,He,Ye){this.objectsData=new Map,this.instancesData=new Map,this.scene=Q.Z.create(Fe,"blended"),this.parent=He,this._props={...i.t.getDefaultValues(de),...Ye}}update(){const Fe=j(this.scene,this.parent.boundingSphere,this.sceneData,J.s.lightgrey,q);Fe&&(this.sceneData=Fe);const He=j(this.scene,this.parent.boundingSphereVisible,this.visibleSceneData,J.s.black,Y);He&&(this.visibleSceneData=He),this.parent.forEach((Ye,ot)=>{const rt=this.objectsData.get(ot),St=j(this.scene,Ye.values.boundingSphere.ref.value,rt,J.s.tomato,ee);St&&this.objectsData.set(ot,St);const vt=this.instancesData.get(ot),mn=j(this.scene,Ye.values.invariantBoundingSphere.ref.value,vt,J.s.skyblue,g,{aTransform:ot.values.aTransform,matrix:ot.values.matrix,transform:ot.values.transform,extraTransform:ot.values.extraTransform,uInstanceCount:ot.values.uInstanceCount,instanceCount:ot.values.instanceCount,aInstance:ot.values.aInstance,hasReflection:ot.values.hasReflection,instanceGrid:ot.values.instanceGrid});mn&&this.instancesData.set(ot,mn)}),this.objectsData.forEach((Ye,ot)=>{this.parent.has(ot)||(this.scene.remove(Ye.renderObject),this.objectsData.delete(ot))}),this.instancesData.forEach((Ye,ot)=>{this.parent.has(ot)||(this.scene.remove(Ye.renderObject),this.instancesData.delete(ot))}),this.scene.update(void 0,!1),this.scene.commit()}syncVisibility(){this.sceneData&&(this.sceneData.renderObject.state.visible=this._props.sceneBoundingSpheres),this.visibleSceneData&&(this.visibleSceneData.renderObject.state.visible=this._props.visibleSceneBoundingSpheres),this.parent.forEach((Fe,He)=>{const Ye=this.objectsData.get(He);Ye&&(Ye.renderObject.state.visible=He.state.visible&&this._props.objectBoundingSpheres);const ot=this.instancesData.get(He);ot&&(ot.renderObject.state.visible=He.state.visible&&this._props.instanceBoundingSpheres)})}clear(){this.sceneData=void 0,this.objectsData.clear(),this.scene.clear()}get isEnabled(){return this._props.sceneBoundingSpheres||this._props.visibleSceneBoundingSpheres||this._props.objectBoundingSpheres||this._props.instanceBoundingSpheres}get props(){return this._props}setProps(Fe){Object.assign(this._props,Fe),this.isEnabled&&this.update()}}function j(Tt,Fe,He,Ye,ot,rt){if(!He||!$.f8.equals(He.boundingSphere,Fe)){const St=function Z(Tt,Fe){const Ye=(0,W.J)(2),ot=N.P.createState(Ye,Ye/2,Fe);if(Tt.radius&&((0,k.X)(ot,Tt.center,Tt.radius,2),$.f8.hasExtrema(Tt)))for(const rt of Tt.extrema)(0,k.X)(ot,rt,1,0);return N.P.getMesh(ot)}(Fe,He&&He.mesh),vt=He?He.renderObject:function _e(Tt,Fe,He,Ye){const ot=H.e.Utils.createValuesSimple(Tt,{alpha:.1,doubleSided:!1,cellSize:0,batchSize:0},Fe,1,Ye);return(0,U.o)("mesh",ot,{disposed:!1,visible:!0,alphaFactor:1,pickable:!1,colorOnly:!1,opaque:!1,writeDepth:!1},He)}(St,Ye,ot,rt);return He?c.IQ.updateIfChanged(vt.values.drawCount,te.V.getDrawCount(St)):Tt.add(vt),{boundingSphere:$.f8.clone(Fe),renderObject:vt,mesh:St}}}const q=(0,U.Q0)(),Y=(0,U.Q0)(),ee=(0,U.Q0)(),g=(0,U.Q0)();var xe=n(9986),le=n(8956),Ae=n(9136),Be=function(Tt){return Tt[Tt.Move=0]="Move",Tt[Tt.Click=1]="Click",Tt[Tt.Drag=2]="Drag",Tt}(Be||{});const Ce=(0,r.eB)(),Re=(0,r.eB)(),ke=(0,r.eB)(),we={maxFps:i.t.Numeric(30,{min:10,max:60,step:10}),preferAtomPixelPadding:i.t.Numeric(3,{min:0,max:20,step:1},{description:"Number of extra pixels at which to prefer atoms over bonds."})};class Oe{setProps(Fe){Object.assign(this.props,Fe)}identify(Fe,He){const Ye=this.startX!==this.endX||this.startY!==this.endY||this.input.pointerLock&&!this.controls.isMoving;if(Fe===Be.Drag)return void(Ye&&!this.outsideViewport(this.startX,this.startY)&&(this.events.drag.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers,pageStart:r.ZY.create(this.startX,this.startY),pageEnd:r.ZY.create(this.endX,this.endY)}),this.startX=this.endX,this.startY=this.endY));if(Ye){const rt=this.canvasIdentify(this.endX,this.endY);this.id=rt?.id,this.position=rt?.position,this.startX=this.endX,this.startY=this.endY}if(Fe===Be.Click){const rt=this.getLoci(this.id,this.position);return this.events.click.next({current:rt,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:r.ZY.create(this.endX,this.endY),position:this.position}),void(this.prevLoci=rt)}if(!this.inside||this.currentIdentifyT!==He||!Ye||this.outsideViewport(this.endX,this.endY))return;const ot=this.getLoci(this.id,this.position);this.events.hover.next({current:ot,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:r.ZY.create(this.endX,this.endY),position:this.position}),this.prevLoci=ot}tick(Fe){this.inside&&Fe-this.prevT>1e3/this.props.maxFps&&(this.prevT=Fe,this.currentIdentifyT=Fe,this.identify(this.isInteracting?Be.Drag:Be.Move,Fe))}leave(){this.inside=!1,w.YL.Loci.isEmpty(this.prevLoci)||(this.prevLoci=w.YL.Loci.Empty,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers}))}move(Fe,He,Ye,ot,rt){this.inside=!0,this.buttons=Ye,this.button=ot,this.modifiers=rt,this.endX=Fe,this.endY=He}click(Fe,He,Ye,ot,rt){this.endX=Fe,this.endY=He,this.buttons=Ye,this.button=ot,this.modifiers=rt,this.identify(Be.Click,0)}drag(Fe,He,Ye,ot,rt){this.endX=Fe,this.endY=He,this.buttons=Ye,this.button=ot,this.modifiers=rt,this.identify(Be.Drag,0)}modify(Fe){t.Fs.areEqual(Fe,this.modifiers)||(this.modifiers=Fe,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:r.ZY.create(this.endX,this.endY),position:this.position}))}outsideViewport(Fe,He){const{input:Ye,camera:{viewport:ot}}=this;return He*=Ye.pixelRatio,(Fe*=Ye.pixelRatio)>ot.x+ot.width||Ye.height-He>ot.y+ot.height||Fe{this.isInteracting=!0,this.drag(vt,mn,zt,an,Vn)}),Ye.move.subscribe(({x:vt,y:mn,inside:zt,buttons:an,button:Vn,modifiers:Fn,onElement:rr})=>{if(zt&&!this.isInteracting){if(!rr)return void this.leave();this.move(vt,mn,an,Vn,Fn)}}),Ye.leave.subscribe(()=>{this.leave()}),Ye.click.subscribe(({x:vt,y:mn,buttons:zt,button:an,modifiers:Vn})=>{this.outsideViewport(vt,mn)||this.click(vt,mn,zt,an,Vn)}),Ye.interactionEnd.subscribe(()=>{this.isInteracting=!1}),Ye.modifiers.subscribe(vt=>{this.modify(vt)})}}var Se=n(3099),Ve=n(9007),Ne=n(4511),K=n(2897),ne=n(4143),be=n(9421),Te=n(9387);const ue={...Ve.du,tColor:(0,Ne.$G)("texture","rgba","ubyte","nearest"),uTexSize:(0,Ne.w5)("v2"),uWeight:(0,Ne.w5)("f")},re=(0,K.NG)("compose",Te.e,"\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform vec2 uTexSize;\nuniform float uWeight;\n\nvoid main() {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n gl_FragColor = texture2D(tColor, coords) * uWeight;\n}\n"),ce={mode:i.t.Select("temporal",[["off","Off"],["on","On"],["temporal","Temporal"]]),sampleLevel:i.t.Numeric(2,{min:0,max:5,step:1},{description:"Take level^2 samples."}),reduceFlicker:i.t.Boolean(!0,{description:'Reduce flicker in "temporal" mode.'})};class se{static isEnabled(Fe){return"off"!==Fe.mode}constructor(Fe,He){this.webgl=Fe,this.drawPass=He;const{colorBufferFloat:Ye,textureFloat:ot,colorBufferHalfFloat:rt,textureHalfFloat:St}=Fe.extensions,vt=He.colorTarget.getWidth(),mn=He.colorTarget.getHeight();this.colorTarget=Fe.createRenderTarget(vt,mn,!1),this.composeTarget=Fe.createRenderTarget(vt,mn,!1,rt&&St?"fp16":Ye&&ot?"float32":"uint8"),this.holdTarget=Fe.createRenderTarget(vt,mn,!1),this.compose=function ve(Tt,Fe){const He={...Ve.OM,tColor:c.IQ.create(Fe),uTexSize:c.IQ.create(r.ZY.create(Fe.getWidth(),Fe.getHeight())),uWeight:c.IQ.create(1)},Ye={...ue},ot=(0,ne.$h)(Tt,"triangles",re,Ye,He);return(0,be._)(ot,He)}(Fe,He.colorTarget.texture)}syncSize(){const Fe=this.drawPass.colorTarget.getWidth(),He=this.drawPass.colorTarget.getHeight(),[Ye,ot]=this.compose.values.uTexSize.ref.value;(Fe!==Ye||He!==ot)&&(this.colorTarget.setSize(Fe,He),this.composeTarget.setSize(Fe,He),this.holdTarget.setSize(Fe,He),c.IQ.update(this.compose.values.uTexSize,r.ZY.set(this.compose.values.uTexSize.ref.value,Fe,He)))}render(Fe,He,Ye,ot,rt){return"temporal"!==Ye.multiSample.mode||rt?(this.renderMultiSample(He,ot,Ye),-2):this.renderTemporalMultiSample(Fe,He,Ye,ot)}bindOutputTarget(Fe){Fe?this.webgl.unbindFramebuffer():this.colorTarget.bind()}renderMultiSample(Fe,He,Ye){const{camera:ot}=Fe,{compose:rt,composeTarget:St,drawPass:vt,webgl:mn}=this,{gl:zt,state:an}=mn;_.g$&&mn.timer.mark("MultiSamplePass.renderMultiSample");const Vn=ae[Math.max(0,Math.min(Ye.multiSample.sampleLevel,5))],{x:Fn,y:rr,width:Vr,height:tr}=ot.viewport,Tr=1/Vn.length;ot.viewOffset.enabled=!0,c.IQ.update(rt.values.tColor,vt.getColorTarget(Ye.postprocessing).texture),rt.update();for(let Gr=0;Gr=rr.length)return-2;const{x:Vr,y:tr,width:Tr,height:oo}=rt.viewport,Gr=1/rr.length;if(-1===Fe)zt.render(He,Ye,!1),c.IQ.update(St.values.uWeight,1),c.IQ.update(St.values.tColor,zt.getColorTarget(Ye.postprocessing).texture),St.update(),mn.bind(),Fn.disable(Vn.BLEND),Fn.disable(Vn.DEPTH_TEST),Fn.depthMask(!1),Fn.viewport(Vr,tr,Tr,oo),Fn.scissor(Vr,tr,Tr,oo),St.render(),Fe+=1;else{rt.viewOffset.enabled=!0,c.IQ.update(St.values.tColor,zt.getColorTarget(Ye.postprocessing).texture),c.IQ.update(St.values.uWeight,Gr),St.update();const yo=Math.pow(2,Math.max(0,Ye.multiSample.sampleLevel-2));for(let vo=0;vo=rr.length)break}}zt.postprocessing.setOcclusionOffset(0,0),this.bindOutputTarget(ot),Fn.viewport(Vr,tr,Tr,oo),Fn.scissor(Vr,tr,Tr,oo);const Ao=Fe*Gr;return Ao>0&&(c.IQ.update(St.values.uWeight,1),c.IQ.update(St.values.tColor,vt.texture),St.update(),Fn.disable(Vn.BLEND),St.render()),Ao<1&&(c.IQ.update(St.values.uWeight,1-Ao),c.IQ.update(St.values.tColor,mn.texture),St.update(),0===Ao?Fn.disable(Vn.BLEND):Fn.enable(Vn.BLEND),St.render()),rt.viewOffset.enabled=!1,rt.update(),_.g$&&an.timer.markEnd("MultiSamplePass.renderTemporalMultiSample"),Fe>=rr.length?-2:Fe}}const ae=[[[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]]];ae.forEach(Tt=>{Tt.forEach(Fe=>{Fe[0]*=.0625,Fe[1]*=.0625})});class ge{update(Fe,He){return Fe&&(this.sampleIndex=-1),"temporal"===He.mode&&-2!==this.sampleIndex}render(Fe,He,Ye,ot){return this.sampleIndex=this.multiSamplePass.render(this.sampleIndex,Fe,He,Ye,!!ot),this.sampleIndex<0}constructor(Fe){this.multiSamplePass=Fe,this.sampleIndex=-2}}var Ie=n(8437),Le=n(4951);const nt={eyeSeparation:i.t.Numeric(.062,{min:.02,max:.1,step:.001},{description:"Distance between left and right camera."}),focus:i.t.Numeric(10,{min:1,max:20,step:.1},{description:"Apparent object distance."})},je=i.t.getDefaultValues(nt);class Lt{get viewport(){return this.parent.viewport}get viewOffset(){return this.parent.viewOffset}constructor(Fe,He={}){this.parent=Fe,this.left=new Je,this.right=new Je,this.props={...je,...He}}setProps(Fe){Object.assign(this.props,Fe)}update(){this.parent.update(),function pn(Tt,Fe,He,Ye){A.LM.copy(He.viewport,Tt.viewport),r.$I.copy(He.view,Tt.view),r.$I.copy(He.projection,Tt.projection),V.i.copySnapshot(He.state,Tt.state),V.i.copyViewOffset(He.viewOffset,Tt.viewOffset),He.far=Tt.far,He.near=Tt.near,He.fogFar=Tt.fogFar,He.fogNear=Tt.fogNear,A.LM.copy(Ye.viewport,Tt.viewport),r.$I.copy(Ye.view,Tt.view),r.$I.copy(Ye.projection,Tt.projection),V.i.copySnapshot(Ye.state,Tt.state),V.i.copyViewOffset(Ye.viewOffset,Tt.viewOffset),Ye.far=Tt.far,Ye.near=Tt.near,Ye.fogFar=Tt.fogFar,Ye.fogNear=Tt.fogNear;const ot=Math.floor(Tt.viewport.width/2),rt=ot/Tt.viewport.height;He.viewport.width=ot,Ye.viewport.x+=ot,Ye.viewport.width-=ot;const St=Fe.eyeSeparation/2,vt=St*Tt.near/Fe.focus,mn=Tt.near*Math.tan(.5*Tt.state.fov);let zt,an;en[12]=-St,Bt[12]=St,zt=-mn*rt+vt,an=mn*rt+vt,He.projection[0]=2*Tt.near/(an-zt),He.projection[8]=(an+zt)/(an-zt),r.$I.mul(He.view,He.view,en),r.$I.mul(He.projectionView,He.projection,He.view),r.$I.invert(He.inverseProjectionView,He.projectionView),zt=-mn*rt-vt,an=mn*rt-vt,Ye.projection[0]=2*Tt.near/(an-zt),Ye.projection[8]=(an+zt)/(an-zt),r.$I.mul(Ye.view,Ye.view,Bt),r.$I.mul(Ye.projectionView,Ye.projection,Ye.view),r.$I.invert(Ye.inverseProjectionView,Ye.projectionView)}(this.parent,this.props,this.left,this.right)}}!function(Tt){Tt.is=function Fe(He){return"left"in He&&"right"in He}}(Lt||(Lt={}));class Je{constructor(){this.viewport=A.LM.create(0,0,0,0),this.view=(0,r.$I)(),this.projection=(0,r.$I)(),this.projectionView=(0,r.$I)(),this.inverseProjectionView=(0,r.$I)(),this.state=V.i.createDefaultSnapshot(),this.viewOffset=V.i.ViewOffset(),this.far=0,this.near=0,this.fogFar=0,this.fogNear=0}}const en=r.$I.identity(),Bt=r.$I.identity(),$e=Math.pow(2,24)-2;class mt{constructor(Fe,He,Ye){this.webgl=Fe,this.drawPass=He,this.pickScale=Ye;const ot=Ye/Fe.pixelRatio;this.pickWidth=Math.ceil(He.colorTarget.getWidth()*ot),this.pickHeight=Math.ceil(He.colorTarget.getHeight()*ot);const{resources:rt,extensions:{drawBuffers:St},gl:vt}=Fe;St?(this.objectPickTexture=rt.texture("image-uint8","rgba","ubyte","nearest"),this.objectPickTexture.define(this.pickWidth,this.pickHeight),this.instancePickTexture=rt.texture("image-uint8","rgba","ubyte","nearest"),this.instancePickTexture.define(this.pickWidth,this.pickHeight),this.groupPickTexture=rt.texture("image-uint8","rgba","ubyte","nearest"),this.groupPickTexture.define(this.pickWidth,this.pickHeight),this.depthPickTexture=rt.texture("image-uint8","rgba","ubyte","nearest"),this.depthPickTexture.define(this.pickWidth,this.pickHeight),this.framebuffer=rt.framebuffer(),this.objectPickFramebuffer=rt.framebuffer(),this.instancePickFramebuffer=rt.framebuffer(),this.groupPickFramebuffer=rt.framebuffer(),this.depthPickFramebuffer=rt.framebuffer(),this.framebuffer.bind(),St.drawBuffers([St.COLOR_ATTACHMENT0,St.COLOR_ATTACHMENT1,St.COLOR_ATTACHMENT2,St.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=(0,Ie.C6)(vt)?rt.renderbuffer("depth32f","depth",this.pickWidth,this.pickHeight):rt.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=Fe.createRenderTarget(this.pickWidth,this.pickHeight),this.instancePickTarget=Fe.createRenderTarget(this.pickWidth,this.pickHeight),this.groupPickTarget=Fe.createRenderTarget(this.pickWidth,this.pickHeight),this.depthPickTarget=Fe.createRenderTarget(this.pickWidth,this.pickHeight))}get pickRatio(){return this.pickScale/this.webgl.pixelRatio}setPickScale(Fe){this.pickScale=Fe,this.syncSize()}bindObject(){this.webgl.extensions.drawBuffers?this.objectPickFramebuffer.bind():this.objectPickTarget.bind()}bindInstance(){this.webgl.extensions.drawBuffers?this.instancePickFramebuffer.bind():this.instancePickTarget.bind()}bindGroup(){this.webgl.extensions.drawBuffers?this.groupPickFramebuffer.bind():this.groupPickTarget.bind()}bindDepth(){this.webgl.extensions.drawBuffers?this.depthPickFramebuffer.bind():this.depthPickTarget.bind()}get drawingBufferHeight(){return this.drawPass.colorTarget.getHeight()}syncSize(){const Fe=this.pickScale/this.webgl.pixelRatio,He=Math.ceil(this.drawPass.colorTarget.getWidth()*Fe),Ye=Math.ceil(this.drawPass.colorTarget.getHeight()*Fe);(He!==this.pickWidth||Ye!==this.pickHeight)&&(this.pickWidth=He,this.pickHeight=Ye,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)))}renderVariant(Fe,He,Ye,ot,rt,St){Fe.clear(!1),Fe.update(He,Ye),Fe.renderPick(Ye.primitives,He,rt,null,St),ot.handle.isEnabled&&Fe.renderPick(ot.handle.scene,He,rt,null,St),ot.camera.isEnabled&&(ot.camera.update(He),Fe.update(ot.camera.camera,ot.camera.scene),Fe.renderPick(ot.camera.scene,ot.camera.camera,rt,null,St))}render(Fe,He,Ye,ot){this.webgl.extensions.drawBuffers?(this.framebuffer.bind(),this.renderVariant(Fe,He,Ye,ot,"pick",l.None)):(this.objectPickTarget.bind(),this.renderVariant(Fe,He,Ye,ot,"pick",l.Object),this.instancePickTarget.bind(),this.renderVariant(Fe,He,Ye,ot,"pick",l.Instance),this.groupPickTarget.bind(),this.renderVariant(Fe,He,Ye,ot,"pick",l.Group),this.depthPickTarget.bind(),this.renderVariant(Fe,He,Ye,ot,"depth",l.None))}}class _t{setupBuffers(){const Fe=this.pickWidth*this.pickHeight*4;(!this.objectBuffer||this.objectBuffer.length!==Fe)&&(this.objectBuffer=new Uint8Array(Fe),this.instanceBuffer=new Uint8Array(Fe),this.groupBuffer=new Uint8Array(Fe),this.depthBuffer=new Uint8Array(Fe))}setViewport(Fe,He,Ye,ot){A.LM.set(this.viewport,Fe,He,Ye,ot),this.pickRatio=this.pickPass.pickRatio,this.pickX=Math.ceil(Fe*this.pickRatio),this.pickY=Math.ceil(He*this.pickRatio);const rt=Math.floor(Ye*this.pickRatio),St=Math.floor(ot*this.pickRatio);(rt!==this.pickWidth||St!==this.pickHeight)&&(this.pickWidth=rt,this.pickHeight=St,this.halfPickWidth=Math.floor(this.pickWidth/2),this.setupBuffers()),this.spiral=(0,v.k4)(Math.round(this.pickRatio*this.pickPadding))}syncBuffers(){_.g$&&this.webgl.timer.mark("PickHelper.syncBuffers");const{pickX:Fe,pickY:He,pickWidth:Ye,pickHeight:ot}=this;this.pickPass.bindObject(),this.webgl.readPixels(Fe,He,Ye,ot,this.objectBuffer),this.pickPass.bindInstance(),this.webgl.readPixels(Fe,He,Ye,ot,this.instanceBuffer),this.pickPass.bindGroup(),this.webgl.readPixels(Fe,He,Ye,ot,this.groupBuffer),this.pickPass.bindDepth(),this.webgl.readPixels(Fe,He,Ye,ot,this.depthBuffer),_.g$&&this.webgl.timer.markEnd("PickHelper.syncBuffers")}getBufferIdx(Fe,He){return 4*(He*this.pickWidth+Fe)}getDepth(Fe,He){const Ye=this.getBufferIdx(Fe,He),ot=this.depthBuffer;return(0,Le.FO)(ot[Ye],ot[Ye+1],ot[Ye+2],ot[Ye+3])}getId(Fe,He,Ye){const ot=this.getBufferIdx(Fe,He);return(0,Le.OK)(Ye[ot],Ye[ot+1],Ye[ot+2])}render(Fe){_.g$&&this.webgl.timer.mark("PickHelper.render",!0);const{pickX:He,pickY:Ye,pickWidth:ot,pickHeight:rt,halfPickWidth:St}=this,{renderer:vt,scene:mn,helper:zt}=this;vt.setTransparentBackground(!1),vt.setDrawingBufferSize(ot,rt),vt.setPixelRatio(this.pickRatio),Lt.is(Fe)?(vt.setViewport(He,Ye,St,rt),this.pickPass.render(vt,Fe.left,mn,zt),vt.setViewport(He+St,Ye,ot-St,rt),this.pickPass.render(vt,Fe.right,mn,zt)):(vt.setViewport(He,Ye,ot,rt),this.pickPass.render(vt,Fe,mn,zt)),this.dirty=!1,_.g$&&this.webgl.timer.markEnd("PickHelper.render")}identifyInternal(Fe,He,Ye){const{webgl:ot,pickRatio:rt}=this;if(ot.isContextLost)return;Fe*=ot.pixelRatio,He=this.pickPass.drawingBufferHeight-(He*=ot.pixelRatio);const{viewport:St}=this;if(FeSt.x+St.width||He>St.y+St.height)return;this.dirty&&(_.g$&&this.webgl.timer.mark("PickHelper.identify"),this.render(Ye),this.syncBuffers(),_.g$&&this.webgl.timer.markEnd("PickHelper.identify"));const vt=Fe-St.x,mn=He-St.y,zt=Math.floor(vt*rt),an=Math.floor(mn*rt),Vn=this.getId(zt,an,this.objectBuffer);if(-1===Vn||Vn===$e)return;const Fn=this.getId(zt,an,this.instanceBuffer);if(-1===Fn||Fn===$e)return;const rr=this.getId(zt,an,this.groupBuffer);if(-1===rr||rr===$e)return;const Vr=this.getDepth(zt,an),tr=r.eB.create(Fe,He,Vr);if(Lt.is(Ye)){const Tr=Math.floor(St.width/2);Fe>St.x+Tr?(tr[0]=St.x+2*(vt-Tr),(0,A.IW)(tr,tr,St,Ye.right.inverseProjectionView)):(tr[0]=St.x+2*vt,(0,A.IW)(tr,tr,St,Ye.left.inverseProjectionView))}else(0,A.IW)(tr,tr,St,Ye.inverseProjectionView);return{id:{objectId:Vn,instanceId:Fn,groupId:rr},position:tr}}identify(Fe,He,Ye){for(const ot of this.spiral){const rt=this.identifyInternal(Fe+ot[0],He+ot[1],Ye);if(rt)return rt}}constructor(Fe,He,Ye,ot,rt,St,vt=1){this.webgl=Fe,this.renderer=He,this.scene=Ye,this.helper=ot,this.pickPass=rt,this.pickPadding=vt,this.dirty=!0,this.viewport=(0,A.LM)(),this.setViewport(St.x,St.y,St.width,St.height)}}var Me=n(2021);const ut={...Ve.du,tWboitA:(0,Ne.$G)("texture","rgba","float","nearest"),tWboitB:(0,Ne.$G)("texture","rgba","float","nearest"),uTexSize:(0,Ne.w5)("v2")},Kt=(0,K.NG)("evaluate-wboit",Te.e,"\nprecision highp float;\n\nuniform sampler2D tWboitA;\nuniform sampler2D tWboitB;\nuniform vec2 uTexSize;\n\nvoid main() {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n\n vec4 accum = texture2D(tWboitA, coords);\n float r = 1.0 - accum.a;\n\n accum.a = texture2D(tWboitB, coords).r;\n // divisor needs to allow very small values for nice fading\n gl_FragColor = vec4(accum.rgb / clamp(accum.a, 0.00000001, 50000.0), r);\n}\n");class gt{get supported(){return this._supported}bind(){const{state:Fe,gl:He}=this.webgl;this.framebuffer.bind(),Fe.clearColor(0,0,0,1),He.clear(He.COLOR_BUFFER_BIT),Fe.disable(He.DEPTH_TEST),Fe.blendFuncSeparate(He.ONE,He.ONE,He.ZERO,He.ONE_MINUS_SRC_ALPHA),Fe.enable(He.BLEND)}render(){_.g$&&this.webgl.timer.mark("WboitPass.render");const{state:Fe,gl:He}=this.webgl;Fe.blendFuncSeparate(He.SRC_ALPHA,He.ONE_MINUS_SRC_ALPHA,He.ONE,He.ONE_MINUS_SRC_ALPHA),Fe.enable(He.BLEND),this.renderable.update(),this.renderable.render(),_.g$&&this.webgl.timer.markEnd("WboitPass.render")}setSize(Fe,He){const[Ye,ot]=this.renderable.values.uTexSize.ref.value;(Fe!==Ye||He!==ot)&&(this.textureA.define(Fe,He),this.textureB.define(Fe,He),this.depthRenderbuffer.setSize(Fe,He),c.IQ.update(this.renderable.values.uTexSize,r.ZY.set(this.renderable.values.uTexSize.ref.value,Fe,He)))}reset(){this._supported&&this._init()}_init(){const{extensions:{drawBuffers:Fe}}=this.webgl;this.framebuffer.bind(),Fe.drawBuffers([Fe.COLOR_ATTACHMENT0,Fe.COLOR_ATTACHMENT1]),this.textureA.attachFramebuffer(this.framebuffer,"color0"),this.textureB.attachFramebuffer(this.framebuffer,"color1"),this.depthRenderbuffer.attachFramebuffer(this.framebuffer)}static isSupported(Fe){const{extensions:{drawBuffers:He,textureFloat:Ye,colorBufferFloat:ot,depthTexture:rt}}=Fe;if(Ye&&ot&&rt&&He)return!0;if(_.Bb){const St=[];Ye||St.push("textureFloat"),ot||St.push("colorBufferFloat"),rt||St.push("depthTexture"),He||St.push("drawBuffers"),console.log(`Missing "${St.join('", "')}" extensions required for "wboit"`)}return!1}constructor(Fe,He,Ye){if(this.webgl=Fe,this._supported=!1,!gt.isSupported(Fe))return;const{resources:ot,gl:rt}=Fe;this.textureA=ot.texture("image-float32","rgba","float","nearest"),this.textureA.define(He,Ye),this.textureB=ot.texture("image-float32","rgba","float","nearest"),this.textureB.define(He,Ye),this.depthRenderbuffer=(0,Ie.C6)(rt)?ot.renderbuffer("depth32f","depth",He,Ye):ot.renderbuffer("depth16","depth",He,Ye),this.renderable=function sn(Tt,Fe,He){const Ye={...Ve.OM,tWboitA:c.IQ.create(Fe),tWboitB:c.IQ.create(He),uTexSize:c.IQ.create(r.ZY.create(Fe.getWidth(),Fe.getHeight()))},ot={...ut},rt=(0,ne.$h)(Tt,"triangles",Kt,ot,Ye);return(0,be._)(rt,Ye)}(Fe,this.textureA,this.textureB),this.framebuffer=ot.framebuffer(),this._supported=!0,this._init()}}const Gt={...Ve.du,tDpoitBackColor:(0,Ne.$G)("texture","rgba","float","nearest"),uTexSize:(0,Ne.w5)("v2")},rn=(0,K.NG)("blend-back-dpoit",Te.e,"\n precision highp float;\n\n uniform sampler2D tDpoitBackColor;\n uniform vec2 uTexSize;\n\n void main() {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n gl_FragColor = texture2D(tDpoitBackColor, coords);\n if (gl_FragColor.a == 0.0) {\n discard;\n }\n }\n"),Mt={...Ve.du,tDpoitFrontColor:(0,Ne.$G)("texture","rgba","float","nearest"),uTexSize:(0,Ne.w5)("v2")},nn=(0,K.NG)("evaluate-dpoit",Te.e,"\nprecision highp float;\n\nuniform sampler2D tDpoitFrontColor;\nuniform vec2 uTexSize;\n\nvoid main() {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n gl_FragColor = texture2D(tDpoitFrontColor, coords);\n}\n");class Dn{get supported(){return this._supported}bind(){const{state:Fe,gl:He,extensions:{blendMinMax:Ye}}=this.webgl;return this.passCount=0,this.depthFramebuffers[0].bind(),Fe.clearColor(this.DEPTH_CLEAR_VALUE,this.DEPTH_CLEAR_VALUE,0,0),He.clear(He.COLOR_BUFFER_BIT),this.depthFramebuffers[1].bind(),Fe.clearColor(-this.MIN_DEPTH,this.MAX_DEPTH,0,0),He.clear(He.COLOR_BUFFER_BIT),this.colorFramebuffers[0].bind(),Fe.clearColor(0,0,0,0),He.clear(He.COLOR_BUFFER_BIT),this.colorFramebuffers[1].bind(),Fe.clearColor(0,0,0,0),He.clear(He.COLOR_BUFFER_BIT),this.depthFramebuffers[0].bind(),Fe.blendEquation(Ye.MAX),Fe.depthMask(!1),{depth:this.depthTextures[1],frontColor:this.colorFrontTextures[1],backColor:this.colorBackTextures[1]}}bindDualDepthPeeling(){const{state:Fe,gl:He,extensions:{blendMinMax:Ye}}=this.webgl;return this.readId=this.passCount%2,this.writeId=1-this.readId,this.passCount+=1,this.depthFramebuffers[this.writeId].bind(),Fe.clearColor(this.DEPTH_CLEAR_VALUE,this.DEPTH_CLEAR_VALUE,0,0),He.clear(He.COLOR_BUFFER_BIT),this.colorFramebuffers[this.writeId].bind(),Fe.clearColor(0,0,0,0),He.clear(He.COLOR_BUFFER_BIT),this.depthFramebuffers[this.writeId].bind(),Fe.blendEquation(Ye.MAX),Fe.depthMask(!1),{depth:this.depthTextures[this.readId],frontColor:this.colorFrontTextures[this.readId],backColor:this.colorBackTextures[this.readId]}}renderBlendBack(){_.g$&&this.webgl.timer.mark("DpoitPass.renderBlendBack");const{state:Fe,gl:He}=this.webgl;Fe.blendEquation(He.FUNC_ADD),Fe.blendFuncSeparate(He.SRC_ALPHA,He.ONE_MINUS_SRC_ALPHA,He.ONE,He.ONE_MINUS_SRC_ALPHA),c.IQ.update(this.blendBackRenderable.values.tDpoitBackColor,this.colorBackTextures[this.writeId]),this.blendBackRenderable.update(),this.blendBackRenderable.render(),_.g$&&this.webgl.timer.markEnd("DpoitPass.renderBlendBack")}render(){_.g$&&this.webgl.timer.mark("DpoitPass.render");const{state:Fe,gl:He}=this.webgl;Fe.blendFunc(He.ONE,He.ONE_MINUS_SRC_ALPHA),c.IQ.update(this.renderable.values.tDpoitFrontColor,this.colorFrontTextures[this.writeId]),this.renderable.update(),this.renderable.render(),_.g$&&this.webgl.timer.markEnd("DpoitPass.render")}setSize(Fe,He){const[Ye,ot]=this.renderable.values.uTexSize.ref.value;if(Fe!==Ye||He!==ot){for(let rt=0;rt<2;rt++)this.depthTextures[rt].define(Fe,He),this.colorFrontTextures[rt].define(Fe,He),this.colorBackTextures[rt].define(Fe,He);c.IQ.update(this.renderable.values.uTexSize,r.ZY.set(this.renderable.values.uTexSize.ref.value,Fe,He)),c.IQ.update(this.blendBackRenderable.values.uTexSize,r.ZY.set(this.blendBackRenderable.values.uTexSize.ref.value,Fe,He))}}reset(){this._supported&&this._init()}_init(){const{extensions:{drawBuffers:Fe}}=this.webgl;for(let He=0;He<2;He++)this.depthFramebuffers[He].bind(),Fe.drawBuffers([Fe.COLOR_ATTACHMENT0,Fe.COLOR_ATTACHMENT1,Fe.COLOR_ATTACHMENT2]),this.colorFrontTextures[He].attachFramebuffer(this.depthFramebuffers[He],"color0"),this.colorBackTextures[He].attachFramebuffer(this.depthFramebuffers[He],"color1"),this.depthTextures[He].attachFramebuffer(this.depthFramebuffers[He],"color2"),this.colorFramebuffers[He].bind(),Fe.drawBuffers([Fe.COLOR_ATTACHMENT0,Fe.COLOR_ATTACHMENT1]),this.colorFrontTextures[He].attachFramebuffer(this.colorFramebuffers[He],"color0"),this.colorBackTextures[He].attachFramebuffer(this.colorFramebuffers[He],"color1")}static isSupported(Fe){const{extensions:{drawBuffers:He,textureFloat:Ye,colorBufferFloat:ot,depthTexture:rt,blendMinMax:St}}=Fe;if(Ye&&ot&&rt&&He&&St)return!0;if(_.Bb){const vt=[];Ye||vt.push("textureFloat"),ot||vt.push("colorBufferFloat"),rt||vt.push("depthTexture"),He||vt.push("drawBuffers"),St||vt.push("blendMinMax"),console.log(`Missing "${vt.join('", "')}" extensions required for "dpoit"`)}return!1}constructor(Fe,He,Ye){if(this.webgl=Fe,this.DEPTH_CLEAR_VALUE=-99999,this.MAX_DEPTH=1,this.MIN_DEPTH=0,this.passCount=0,this._supported=!1,!Dn.isSupported(Fe))return;const{resources:ot,extensions:{colorBufferHalfFloat:rt,textureHalfFloat:St}}=Fe;(0,Ie.C6)(Fe.gl)?(this.depthTextures=[ot.texture("image-float32","rg","float","nearest"),ot.texture("image-float32","rg","float","nearest")],this.colorFrontTextures=rt&&St?[ot.texture("image-float16","rgba","fp16","nearest"),ot.texture("image-float16","rgba","fp16","nearest")]:[ot.texture("image-float32","rgba","float","nearest"),ot.texture("image-float32","rgba","float","nearest")],this.colorBackTextures=rt&&St?[ot.texture("image-float16","rgba","fp16","nearest"),ot.texture("image-float16","rgba","fp16","nearest")]:[ot.texture("image-float32","rgba","float","nearest"),ot.texture("image-float32","rgba","float","nearest")]):(this.depthTextures=[ot.texture("image-float32","rgba","float","nearest"),ot.texture("image-float32","rgba","float","nearest")],this.colorFrontTextures=[ot.texture("image-float32","rgba","float","nearest"),ot.texture("image-float32","rgba","float","nearest")],this.colorBackTextures=[ot.texture("image-float32","rgba","float","nearest"),ot.texture("image-float32","rgba","float","nearest")]),this.depthTextures[0].define(He,Ye),this.depthTextures[1].define(He,Ye),this.colorFrontTextures[0].define(He,Ye),this.colorFrontTextures[1].define(He,Ye),this.colorBackTextures[0].define(He,Ye),this.colorBackTextures[1].define(He,Ye),this.depthFramebuffers=[ot.framebuffer(),ot.framebuffer()],this.colorFramebuffers=[ot.framebuffer(),ot.framebuffer()],this.blendBackRenderable=function tt(Tt,Fe){const He={...Ve.OM,tDpoitBackColor:c.IQ.create(Fe),uTexSize:c.IQ.create(r.ZY.create(Fe.getWidth(),Fe.getHeight()))},Ye={...Gt},ot=(0,ne.$h)(Tt,"triangles",rn,Ye,He);return(0,be._)(ot,He)}(Fe,this.colorBackTextures[0]),this.renderable=function bn(Tt,Fe){const He={...Ve.OM,tDpoitFrontColor:c.IQ.create(Fe),uTexSize:c.IQ.create(r.ZY.create(Fe.getWidth(),Fe.getHeight()))},Ye={...Mt},ot=(0,ne.$h)(Tt,"triangles",nn,Ye,He);return(0,be._)(ot,He)}(Fe,this.colorFrontTextures[0]),this._supported=!0,this._init()}}const Dt={enabled:i.t.Boolean(!0),highlightEdgeColor:i.t.Color(y.Q1.darken(y.Q1.fromNormalizedRgb(1,.4,.6),1)),selectEdgeColor:i.t.Color(y.Q1.darken(y.Q1.fromNormalizedRgb(.2,1,.1),1)),edgeScale:i.t.Numeric(1,{min:1,max:3,step:1},{description:"Thickness of the edge."}),highlightEdgeStrength:i.t.Numeric(1,{min:0,max:1,step:.1}),selectEdgeStrength:i.t.Numeric(1,{min:0,max:1,step:.1}),ghostEdgeStrength:i.t.Numeric(.3,{min:0,max:1,step:.1},{description:"Opacity of the hidden edges that are covered by other geometry. When set to 1, one less geometry render pass is done."}),innerEdgeFactor:i.t.Numeric(1.5,{min:0,max:3,step:.1},{description:"Factor to multiply the inner edge color with - for added contrast."})};class Ct{static isEnabled(Fe){return Fe.enabled}constructor(Fe,He,Ye){this.webgl=Fe,this.depthTarget=Fe.createRenderTarget(He,Ye),this.maskTarget=Fe.createRenderTarget(He,Ye),this.edgesTarget=Fe.createRenderTarget(He,Ye),this.edge=function Wt(Tt,Fe){const He=Fe.getWidth(),Ye=Fe.getHeight(),ot={...Ve.OM,tMaskTexture:c.IQ.create(Fe),uTexSizeInv:c.IQ.create(r.ZY.create(1/He,1/Ye)),dEdgeScale:c.IQ.create(1)},rt={...$t},St=(0,ne.$h)(Tt,"triangles",Vt,rt,ot);return(0,be._)(St,ot)}(Fe,this.maskTarget.texture),this.overlay=function kt(Tt,Fe){const He=Fe.getWidth(),Ye=Fe.getHeight(),ot={...Ve.OM,tEdgeTexture:c.IQ.create(Fe),uTexSizeInv:c.IQ.create(r.ZY.create(1/He,1/Ye)),uHighlightEdgeColor:c.IQ.create((0,r.eB)()),uSelectEdgeColor:c.IQ.create((0,r.eB)()),uHighlightEdgeStrength:c.IQ.create(1),uSelectEdgeStrength:c.IQ.create(1),uGhostEdgeStrength:c.IQ.create(0),uInnerEdgeFactor:c.IQ.create(0)},rt={...yn},St=(0,ne.$h)(Tt,"triangles",Zt,rt,ot);return(0,be._)(St,ot)}(Fe,this.edgesTarget.texture)}setEdgeState(Fe){const{gl:He,state:Ye}=this.webgl;Ye.enable(He.SCISSOR_TEST),Ye.enable(He.BLEND),Ye.blendFunc(He.ONE,He.ONE),Ye.blendEquation(He.FUNC_ADD),Ye.disable(He.DEPTH_TEST),Ye.depthMask(!1);const{x:ot,y:rt,width:St,height:vt}=Fe;Ye.viewport(ot,rt,St,vt),Ye.scissor(ot,rt,St,vt),Ye.clearColor(0,0,0,0),He.clear(He.COLOR_BUFFER_BIT)}setOverlayState(Fe){const{gl:He,state:Ye}=this.webgl;Ye.enable(He.SCISSOR_TEST),Ye.enable(He.BLEND),Ye.blendFunc(He.SRC_ALPHA,He.ONE_MINUS_SRC_ALPHA),Ye.blendEquation(He.FUNC_ADD),Ye.disable(He.DEPTH_TEST),Ye.depthMask(!1);const{x:ot,y:rt,width:St,height:vt}=Fe;Ye.viewport(ot,rt,St,vt),Ye.scissor(ot,rt,St,vt)}setSize(Fe,He){const Ye=this.depthTarget.getWidth(),ot=this.depthTarget.getHeight();(Fe!==Ye||He!==ot)&&(this.depthTarget.setSize(Fe,He),this.maskTarget.setSize(Fe,He),this.edgesTarget.setSize(Fe,He),c.IQ.update(this.edge.values.uTexSizeInv,r.ZY.set(this.edge.values.uTexSizeInv.ref.value,1/Fe,1/He)),c.IQ.update(this.overlay.values.uTexSizeInv,r.ZY.set(this.overlay.values.uTexSizeInv.ref.value,1/Fe,1/He)))}update(Fe){const{highlightEdgeColor:He,selectEdgeColor:Ye,edgeScale:ot,innerEdgeFactor:rt,ghostEdgeStrength:St,highlightEdgeStrength:vt,selectEdgeStrength:mn}=Fe,{values:zt}=this.edge,an=Math.max(1,Math.round(ot*this.webgl.pixelRatio));zt.dEdgeScale.ref.value!==an&&(c.IQ.update(zt.dEdgeScale,an),this.edge.update());const{values:Vn}=this.overlay;c.IQ.update(Vn.uHighlightEdgeColor,y.Q1.toVec3Normalized(Vn.uHighlightEdgeColor.ref.value,He)),c.IQ.update(Vn.uSelectEdgeColor,y.Q1.toVec3Normalized(Vn.uSelectEdgeColor.ref.value,Ye)),c.IQ.updateIfChanged(Vn.uInnerEdgeFactor,rt),c.IQ.updateIfChanged(Vn.uGhostEdgeStrength,St),c.IQ.updateIfChanged(Vn.uHighlightEdgeStrength,vt),c.IQ.updateIfChanged(Vn.uSelectEdgeStrength,mn)}render(Fe,He){_.g$&&this.webgl.timer.mark("MarkingPass.render"),this.edgesTarget.bind(),this.setEdgeState(Fe),this.edge.render(),He?He.bind():this.webgl.unbindFramebuffer(),this.setOverlayState(Fe),this.overlay.render(),_.g$&&this.webgl.timer.markEnd("MarkingPass.render")}}const $t={...Ve.du,tMaskTexture:(0,Ne.$G)("texture","rgba","ubyte","linear"),uTexSizeInv:(0,Ne.w5)("v2"),dEdgeScale:(0,Ne.$F)("number")},Vt=(0,K.NG)("edge",Te.e,"\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tMaskTexture;\nuniform vec2 uTexSizeInv;\n\nvoid main() {\n vec2 coords = gl_FragCoord.xy * uTexSizeInv;\n vec4 offset = vec4(float(dEdgeScale), 0.0, 0.0, float(dEdgeScale)) * vec4(uTexSizeInv, uTexSizeInv);\n vec4 c0 = texture2D(tMaskTexture, coords);\n vec4 c1 = texture2D(tMaskTexture, coords + offset.xy);\n vec4 c2 = texture2D(tMaskTexture, coords - offset.xy);\n vec4 c3 = texture2D(tMaskTexture, coords + offset.yw);\n vec4 c4 = texture2D(tMaskTexture, coords - offset.yw);\n float diff1 = (c1.r - c2.r) * 0.5;\n float diff2 = (c3.r - c4.r) * 0.5;\n float d = length(vec2(diff1, diff2));\n if (d <= 0.0)\n discard;\n float a1 = min(c1.g, c2.g);\n float a2 = min(c3.g, c4.g);\n float visibility = min(a1, a2) > 0.001 ? 1.0 : 0.0;\n float mask = c0.r;\n float marker = min(c1.b, min(c2.b, min(c3.b, c4.b)));\n float fogAlpha = min(c1.a, min(c2.a, min(c3.a, c4.a)));\n gl_FragColor = vec4(visibility, mask, marker, fogAlpha);\n}\n"),yn={...Ve.du,tEdgeTexture:(0,Ne.$G)("texture","rgba","ubyte","linear"),uTexSizeInv:(0,Ne.w5)("v2"),uHighlightEdgeColor:(0,Ne.w5)("v3"),uSelectEdgeColor:(0,Ne.w5)("v3"),uHighlightEdgeStrength:(0,Ne.w5)("f"),uSelectEdgeStrength:(0,Ne.w5)("f"),uGhostEdgeStrength:(0,Ne.w5)("f"),uInnerEdgeFactor:(0,Ne.w5)("f")},Zt=(0,K.NG)("overlay",Te.e,"\nprecision highp float;\nprecision highp sampler2D;\n\nuniform vec2 uTexSizeInv;\nuniform sampler2D tEdgeTexture;\nuniform vec3 uHighlightEdgeColor;\nuniform vec3 uSelectEdgeColor;\nuniform float uHighlightEdgeStrength;\nuniform float uSelectEdgeStrength;\nuniform float uGhostEdgeStrength;\nuniform float uInnerEdgeFactor;\n\nvoid main() {\n vec2 coords = gl_FragCoord.xy * uTexSizeInv;\n vec4 edgeValue = texture2D(tEdgeTexture, coords);\n if (edgeValue.a > 0.0) {\n vec3 edgeColor = edgeValue.b == 1.0 ? uHighlightEdgeColor : uSelectEdgeColor;\n gl_FragColor.rgb = edgeValue.g > 0.0 ? edgeColor : edgeColor * uInnerEdgeFactor;\n gl_FragColor.a = (edgeValue.r == 1.0 ? uGhostEdgeStrength : 1.0) * edgeValue.a;\n float edgeStrength = edgeValue.b == 1.0 ? uHighlightEdgeStrength : uSelectEdgeStrength;\n gl_FragColor.a *= edgeStrength;\n } else {\n gl_FragColor = vec4(0.0);\n }\n}\n");var Ot=n(6049),An=n(3770);class jn{setTransparency(Fe){"wboit"===Fe?(this.transparencyMode=this.wboit.supported?"wboit":"blended",_.Bb&&!this.wboit.supported&&console.log('Missing "wboit" support, falling back to "blended".')):"dpoit"===Fe?(this.transparencyMode=this.dpoit.supported?"dpoit":"blended",_.Bb&&!this.dpoit.supported&&console.log('Missing "dpoit" support, falling back to "blended".')):this.transparencyMode="blended",this.depthTextureOpaque.detachFramebuffer(this.postprocessing.target.framebuffer,"depth")}get transparency(){return this.transparencyMode}constructor(Fe,He,Ye,ot,rt){this.webgl=Fe,this.transparencyMode="blended";const{extensions:St,resources:vt,isWebGL2:mn}=Fe;this.drawTarget=(0,Me.T)(Fe.gl),this.colorTarget=Fe.createRenderTarget(Ye,ot,!0,"uint8","linear"),this.packedDepth=!St.depthTexture,this.depthTargetTransparent=Fe.createRenderTarget(Ye,ot),this.depthTextureTransparent=this.depthTargetTransparent.texture,this.depthTargetOpaque=this.packedDepth?Fe.createRenderTarget(Ye,ot):null,this.depthTextureOpaque=this.depthTargetOpaque?this.depthTargetOpaque.texture:vt.texture("image-depth","depth",mn?"float":"ushort","nearest"),this.packedDepth||this.depthTextureOpaque.define(Ye,ot),this.wboit=new gt(Fe,Ye,ot),this.dpoit=new Dn(Fe,Ye,ot),this.marking=new Ct(Fe,Ye,ot),this.postprocessing=new Se.Pv(Fe,He,this),this.antialiasing=new Se.SK(Fe,Ye,ot),this.bloom=new An.P(Fe,Ye,ot),this.dof=new Ot.z(Fe,Ye,ot),this.copyFboTarget=(0,Ve._0)(Fe,this.colorTarget.texture),this.copyFboPostprocessing=(0,Ve._0)(Fe,this.postprocessing.target.texture),this.setTransparency(rt)}reset(){this.wboit.reset(),this.dpoit.reset()}setSize(Fe,He){const Ye=this.colorTarget.getWidth(),ot=this.colorTarget.getHeight();(Fe!==Ye||He!==ot)&&(this.colorTarget.setSize(Fe,He),this.depthTargetTransparent.setSize(Fe,He),this.depthTargetOpaque?this.depthTargetOpaque.setSize(Fe,He):this.depthTextureOpaque.define(Fe,He),c.IQ.update(this.copyFboTarget.values.uTexSize,r.ZY.set(this.copyFboTarget.values.uTexSize.ref.value,Fe,He)),c.IQ.update(this.copyFboPostprocessing.values.uTexSize,r.ZY.set(this.copyFboPostprocessing.values.uTexSize.ref.value,Fe,He))),this.wboit.supported&&this.wboit.setSize(Fe,He),this.dpoit.supported&&this.dpoit.setSize(Fe,He),this.marking.setSize(Fe,He),this.postprocessing.setSize(Fe,He),this.antialiasing.setSize(Fe,He),this.dof.setSize(Fe,He),this.bloom.setSize(Fe,He)}_renderDpoit(Fe,He,Ye,ot,rt,St){if(!this.dpoit.supported)throw new Error("expected dpoit to be supported");if(this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer,"depth"),Fe.clear(!0),Ye.hasOpaque&&Fe.renderDpoitOpaque(Ye.primitives,He,null),Se.Pv.isEnabled(St)&&((Se.Pv.isTransparentOutlineEnabled(St)||Ot.z.isEnabled(St))&&(this.depthTargetTransparent.bind(),Fe.clearDepth(!0),Ye.opacityAverage<1&&Fe.renderDepthTransparent(Ye.primitives,He,this.depthTextureOpaque)),this.postprocessing.render(He,!1,rt,Fe.props.backgroundColor,St,Fe.light)),this.depthTextureOpaque.detachFramebuffer(this.colorTarget.framebuffer,"depth"),Ye.opacityAverage<1){const vt=Se.Pv.isEnabled(St)?this.postprocessing.target:this.colorTarget,mn=this.dpoit.bind();Fe.renderDpoitTransparent(Ye.primitives,He,this.depthTextureOpaque,mn);for(let zt=0;zt0&&Fe.renderDpoitVolume(Ye.volumes,He,this.depthTextureOpaque)}_renderWboit(Fe,He,Ye,ot,rt){if(!this.wboit.supported)throw new Error("expected wboit to be supported");this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer,"depth"),Fe.clear(!0),Ye.hasOpaque&&Fe.renderWboitOpaque(Ye.primitives,He,null),Se.Pv.isEnabled(rt)&&((Se.Pv.isTransparentOutlineEnabled(rt)||Ot.z.isEnabled(rt))&&(this.depthTargetTransparent.bind(),Fe.clearDepth(!0),Ye.opacityAverage<1&&Fe.renderDepthTransparent(Ye.primitives,He,this.depthTextureOpaque)),this.postprocessing.render(He,!1,ot,Fe.props.backgroundColor,rt,Fe.light)),(Ye.opacityAverage<1||Ye.volumes.renderables.length>0)&&(this.wboit.bind(),Ye.opacityAverage<1&&Fe.renderWboitTransparent(Ye.primitives,He,this.depthTextureOpaque),Ye.volumes.renderables.length>0&&Fe.renderWboitTransparent(Ye.volumes,He,this.depthTextureOpaque),Se.Pv.isEnabled(rt)?this.postprocessing.target.bind():this.colorTarget.bind(),this.wboit.render())}_renderBlended(Fe,He,Ye,ot,rt,St){var vt,mn,zt,an;if(ot?this.drawTarget.bind():this.packedDepth?this.colorTarget.bind():this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer,"depth"),Fe.clear(!0),Ye.hasOpaque&&Fe.renderBlendedOpaque(Ye.primitives,He,null),!ot&&(this.depthTargetOpaque&&(this.depthTargetOpaque.bind(),Fe.clearDepth(!0),Fe.renderDepthOpaque(Ye.primitives,He,null),this.colorTarget.bind()),Se.Pv.isEnabled(St)&&(this.packedDepth?null===(vt=this.colorTarget.depthRenderbuffer)||void 0===vt||vt.detachFramebuffer(this.postprocessing.target.framebuffer):this.depthTextureOpaque.detachFramebuffer(this.postprocessing.target.framebuffer,"depth"),(Se.Pv.isTransparentOutlineEnabled(St)||Ot.z.isEnabled(St))&&(this.depthTargetTransparent.bind(),Fe.clearDepth(!0),Ye.opacityAverage<1&&Fe.renderDepthTransparent(Ye.primitives,He,this.depthTextureOpaque)),this.postprocessing.render(He,!1,rt,Fe.props.backgroundColor,St,Fe.light),this.packedDepth?null===(mn=this.colorTarget.depthRenderbuffer)||void 0===mn||mn.attachFramebuffer(this.postprocessing.target.framebuffer):this.depthTextureOpaque.attachFramebuffer(this.postprocessing.target.framebuffer,"depth")),Ye.volumes.renderables.length>0)){const Vn=Se.Pv.isEnabled(St)?this.postprocessing.target:this.colorTarget;this.packedDepth?null===(zt=this.colorTarget.depthRenderbuffer)||void 0===zt||zt.detachFramebuffer(Vn.framebuffer):this.depthTextureOpaque.detachFramebuffer(Vn.framebuffer,"depth"),Vn.bind(),Fe.renderBlendedVolume(Ye.volumes,He,this.depthTextureOpaque),this.packedDepth?null===(an=this.colorTarget.depthRenderbuffer)||void 0===an||an.attachFramebuffer(Vn.framebuffer):this.depthTextureOpaque.attachFramebuffer(Vn.framebuffer,"depth"),Vn.bind()}Ye.opacityAverage<1&&Fe.renderBlendedTransparent(Ye.primitives,He,null)}_render(Fe,He,Ye,ot,rt,St,vt){var mn,zt;const an=Ye.volumes.renderables.length>0,Vn=Se.Pv.isEnabled(vt.postprocessing),Fn=Se.SK.isEnabled(vt.postprocessing),rr=Ct.isEnabled(vt.marking),Vr=Ot.z.isEnabled(vt.postprocessing),{x:tr,y:Tr,width:oo,height:Gr}=He.viewport;Fe.setViewport(tr,Tr,oo,Gr),Fe.update(He,Ye),St&&!Fn&&rt&&(this.drawTarget.bind(),Fe.clear(!1));let Ao=!1;"wboit"===this.transparencyMode&&this.wboit.supported?(this._renderWboit(Fe,He,Ye,St,vt.postprocessing),Ao=!0):"dpoit"===this.transparencyMode&&this.dpoit.supported?(this._renderDpoit(Fe,He,Ye,vt.dpoitIterations,St,vt.postprocessing),Ao=!0):this._renderBlended(Fe,He,Ye,!an&&!Vn&&!Fn&&rt,St,vt.postprocessing);const yo=Vn?this.postprocessing.target:!rt||an||Ao?this.colorTarget:this.drawTarget;if(rr&&Ye.markerAverage>0){const Kr=vt.marking.ghostEdgeStrength<1;Kr&&1!==Ye.markerAverage&&(this.marking.depthTarget.bind(),Fe.clear(!1,!0),Fe.renderMarkingDepth(Ye.primitives,He,null)),this.marking.maskTarget.bind(),Fe.clear(!1,!0),Fe.renderMarkingMask(Ye.primitives,He,Kr?this.marking.depthTarget.texture:null),this.marking.update(vt.marking),this.marking.render(He.viewport,yo)}else yo.bind();ot.debug.isEnabled&&(ot.debug.syncVisibility(),Fe.renderBlended(ot.debug.scene,He)),ot.handle.isEnabled&&Fe.renderBlended(ot.handle.scene,He),ot.camera.isEnabled&&(ot.camera.update(He),Fe.update(ot.camera.camera,ot.camera.scene),Fe.renderBlended(ot.camera.scene,ot.camera.camera));let vo=!1;if(Fn){const Kr=Se.Pv.isEnabled(vt.postprocessing)?this.postprocessing.target.texture:this.colorTarget.texture;this.antialiasing.render(He,Kr,rt&&!Vr,vt.postprocessing)}else rt&&!Ot.z.isEnabled(vt.postprocessing)&&(vo=!0);if("on"===vt.postprocessing.dof.name){const Kr=Se.SK.isEnabled(vt.postprocessing)?this.antialiasing.target.texture:Se.Pv.isEnabled(vt.postprocessing)?this.postprocessing.target.texture:this.colorTarget.texture;this.dof.update(He,Kr,(null===(mn=this.depthTargetOpaque)||void 0===mn?void 0:mn.texture)||this.depthTextureOpaque,this.depthTextureTransparent,vt.postprocessing.dof.params,Ye.boundingSphereVisible),this.dof.render(He.viewport,rt?void 0:this.getColorTarget(vt.postprocessing))}else rt&&!Se.SK.isEnabled(vt.postprocessing)&&(vo=!0);if(vo&&(this.drawTarget.bind(),this.webgl.state.disable(this.webgl.gl.DEPTH_TEST),Vn?this.copyFboPostprocessing.render():(an||Ao)&&this.copyFboTarget.render()),"on"===vt.postprocessing.bloom.name){const Kr="emissive"===vt.postprocessing.bloom.params.mode;Kr&&Ye.emissiveAverage>0&&(this.bloom.emissiveTarget.bind(),Fe.clear(!1,!0),Fe.update(He,Ye),Fe.renderEmissive(Ye.primitives,He,null)),(!Kr||Ye.emissiveAverage>0)&&(this.bloom.update(this.colorTarget.texture,this.bloom.emissiveTarget.texture,(null===(zt=this.depthTargetOpaque)||void 0===zt?void 0:zt.texture)||this.depthTextureOpaque,vt.postprocessing.bloom.params),this.bloom.render(He.viewport,rt?void 0:this.getColorTarget(vt.postprocessing)))}this.webgl.gl.flush()}render(Fe,He,Ye){_.g$&&this.webgl.timer.mark("DrawPass.render");const{renderer:ot,camera:rt,scene:St,helper:vt}=Fe;this.postprocessing.setTransparentBackground(He.transparentBackground);const mn=He.transparentBackground||this.postprocessing.background.isEnabled(He.postprocessing.background);ot.setTransparentBackground(mn),ot.setDrawingBufferSize(this.colorTarget.getWidth(),this.colorTarget.getHeight()),ot.setPixelRatio(this.webgl.pixelRatio),Lt.is(rt)?(_.g$&&this.webgl.timer.mark("StereoCamera.left"),this._render(ot,rt.left,St,vt,Ye,mn,He),_.g$&&this.webgl.timer.markEnd("StereoCamera.left"),_.g$&&this.webgl.timer.mark("StereoCamera.right"),this._render(ot,rt.right,St,vt,Ye,mn,He),_.g$&&this.webgl.timer.markEnd("StereoCamera.right")):this._render(ot,rt,St,vt,Ye,mn,He),_.g$&&this.webgl.timer.markEnd("DrawPass.render")}getColorTarget(Fe){return Ot.z.isEnabled(Fe)?this.dof.target:Se.SK.isEnabled(Fe)?this.antialiasing.target:Se.Pv.isEnabled(Fe)?this.postprocessing.target:this.colorTarget}}var On=n(2775),fr=n(7028);const Dr={transparentBackground:i.t.Boolean(!1),dpoitIterations:i.t.Numeric(2,{min:1,max:10,step:1}),multiSample:i.t.Group(ce),postprocessing:i.t.Group(Se.co),marking:i.t.Group(Dt),cameraHelper:i.t.Group(fr.kf)};class Pr{get colorTarget(){return this._colorTarget}get width(){return this._width}get height(){return this._height}constructor(Fe,He,Ye,ot,rt,St,vt,mn){this.webgl=Fe,this.renderer=Ye,this.scene=ot,this.camera=rt,this._width=0,this._height=0,this._camera=new V.i,this.props={...i.t.getDefaultValues(Dr),...mn},this.drawPass=new jn(Fe,He,128,128,vt),this.multiSamplePass=new se(Fe,this.drawPass),this.multiSampleHelper=new ge(this.multiSamplePass),this.helper={camera:new fr.WT(Fe,this.props.cameraHelper),debug:St.debug,handle:St.handle},this.setSize(1024,768)}updateBackground(){return new Promise(Fe=>{this.drawPass.postprocessing.background.update(this.camera,this.props.postprocessing.background,()=>{Fe()})})}setSize(Fe,He){Fe===this._width&&He===this._height||(this._width=Fe,this._height=He,this.drawPass.setSize(Fe,He),this.multiSamplePass.syncSize())}setProps(Fe={}){Object.assign(this.props,Fe),Fe.cameraHelper&&this.helper.camera.setProps(Fe.cameraHelper)}render(){V.i.copySnapshot(this._camera.state,this.camera.state),A.LM.set(this._camera.viewport,0,0,this._width,this._height),this._camera.update();const Fe={renderer:this.renderer,camera:this._camera,scene:this.scene,helper:this.helper};se.isEnabled(this.props.multiSample)?(this.multiSampleHelper.render(Fe,this.props,!1),this._colorTarget=this.multiSamplePass.colorTarget):(this.drawPass.render(Fe,this.props,!1),this._colorTarget=this.drawPass.getColorTarget(this.props.postprocessing))}getImageData(Fe,He,Ye){var ot,rt;this.setSize(Fe,He),this.render(),this.colorTarget.bind();const St=null!==(ot=Ye?.width)&&void 0!==ot?ot:Fe,vt=null!==(rt=Ye?.height)&&void 0!==rt?rt:He,mn=new Uint8Array(St*vt*4);Ye?this.webgl.readPixels(Ye.x,He-Ye.y-Ye.height,St,vt,mn):this.webgl.readPixels(0,0,St,vt,mn);const zt=On.N.create(mn,St,vt);return On.N.flipY(zt),On.N.divideByAlpha(zt),new ImageData(new Uint8ClampedArray(mn),St,vt)}}var or=n(1025),Nr=n(2802),Ir=n(3558),Or=n(6825),Jr=n(5117),To=n(3543);const un={...H.e.Params,alpha:{...H.e.Params.alpha,defaultValue:1},ignoreLight:{...H.e.Params.ignoreLight,defaultValue:!0},colorX:i.t.Color(J.s.red,{isEssential:!0}),colorY:i.t.Color(J.s.green,{isEssential:!0}),colorZ:i.t.Color(J.s.blue,{isEssential:!0}),scale:i.t.Numeric(.33,{min:.1,max:2,step:.1},{isEssential:!0})},ct={handle:i.t.MappedStatic("off",{on:i.t.Group(un),off:i.t.Group({})},{cycle:!0,description:"Show handle tool"})};class dt{getBoundingSphere(Fe,He){return this.renderObject&&($.f8.copy(Fe,this.renderObject.values.invariantBoundingSphere.ref.value),r.$I.fromArray(this._transform,this.renderObject.values.aTransform.ref.value,16*He),$.f8.transform(Fe,Fe,this._transform)),Fe}setProps(Fe){this.props=(0,or.jM)(this.props,He=>{if(void 0!==Fe.handle&&(He.handle.name=Fe.handle.name,"on"===Fe.handle.name)){this.scene.clear(),this.pixelRatio=this.webgl.pixelRatio;const Ye={...Fe.handle.params,scale:Fe.handle.params.scale*this.webgl.pixelRatio,cellSize:0};this.renderObject=function ir(Tt){const Fe=function er(Tt,Fe){const He=10*Tt.scale,Ye=function Yt(Tt,Fe){const He=N.P.createState(512,256,Fe),Ye=.05*Tt,ot=r.eB.scale((0,r.eB)(),r.eB.unitX,Tt),rt=r.eB.scale((0,r.eB)(),r.eB.unitY,Tt),St=r.eB.scale((0,r.eB)(),r.eB.unitZ,Tt),vt={radiusTop:Ye,radiusBottom:Ye,radialSegments:32};return He.currentGroup=cn.TranslateScreenXY,(0,k.X)(He,r.eB.origin,3*Ye,2),He.currentGroup=cn.TranslateObjectX,(0,k.X)(He,ot,Ye,2),(0,Nr.y9)(He,r.eB.origin,ot,1,vt),He.currentGroup=cn.TranslateObjectY,(0,k.X)(He,rt,Ye,2),(0,Nr.y9)(He,r.eB.origin,rt,1,vt),He.currentGroup=cn.TranslateObjectZ,(0,k.X)(He,St,Ye,2),(0,Nr.y9)(He,r.eB.origin,St,1,vt),N.P.getMesh(He)}(He,Fe?.geometry);Ye.setBoundingSphere($.f8.create(r.eB.create(He/2,He/2,He/2),He+He/4));return Ir.y.create("handle",{},Ye,rt=>{switch(rt){case cn.TranslateObjectX:return Tt.colorX;case cn.TranslateObjectY:return Tt.colorY;case cn.TranslateObjectZ:return Tt.colorZ;default:return J.s.grey}},()=>1,()=>"")}(Tt);return Ir.y.createRenderObject(Fe,Tt)}(Ye),this.scene.add(this.renderObject),this.scene.commit(),He.handle.params={...Fe.handle.params}}})}get isEnabled(){return"on"===this.props.handle.name}update(Fe,He,Ye){this.renderObject&&(this.pixelRatio!==this.webgl.pixelRatio&&this.setProps(this.props),r.$I.setTranslation(this.renderObject.values.aTransform.ref.value,He),r.$I.fromMat3(this.renderObject.values.aTransform.ref.value,Ye),c.IQ.update(this.renderObject.values.aTransform,this.renderObject.values.aTransform.ref.value),this.scene.update([this.renderObject],!0))}getLoci(Fe){const{objectId:He,groupId:Ye,instanceId:ot}=Fe;return this.renderObject&&He===this.renderObject.id?function xn(Tt,Fe,He){return(0,G.g9)("handle",Tt,[{groupId:Fe,instanceId:He}],Ye=>Tt.getBoundingSphere(Ye,He),()=>`Handle Helper | Group Id ${Fe} | Instance Id ${He}`)}(this,Ye,ot):G.BL}mark(Fe,He){return!(!Or.sY.is(Or.sY.Highlighting,He)||!((0,G.xc)(Fe)||Rn(Fe)&&Fe.data===this))&&Jr.b.mark(this.renderObject,Fe,He,this.eachGroup)}constructor(Fe,He={}){this.webgl=Fe,this.props={handle:{name:"off",params:{}}},this.pixelRatio=1,this._transform=(0,r.$I)(),this.eachGroup=(Ye,ot)=>{if(!this.renderObject||!Rn(Ye))return!1;let rt=!1;const St=this.renderObject.values.uGroupCount.ref.value,{elements:vt}=Ye;for(const{groupId:mn,instanceId:zt}of vt)ot(To.IX.ofSingleton(zt*St+mn))&&(rt=!0);return rt},this.scene=Q.Z.create(Fe,"blended"),this.setProps(He)}}const cn={None:0,TranslateScreenXY:1,TranslateObjectX:3,TranslateObjectY:4,TranslateObjectZ:5};function Rn(Tt){return"data-loci"===Tt.kind&&"handle"===Tt.tag}const Yn={debug:i.t.Group(de),camera:i.t.Group({helper:i.t.Group(fr.kf)}),handle:i.t.Group(ct)},br=i.t.getDefaultValues(Yn);class vr{constructor(Fe,He,Ye={}){const ot={...br,...Ye};this.debug=new ye(Fe,He,ot.debug),this.camera=new fr.WT(Fe,ot.camera.helper),this.handle=new dt(Fe,ot.handle)}}class Hr{constructor(Fe,He,Ye={}){this.webgl=Fe;const{gl:ot}=Fe;this.draw=new jn(Fe,He,ot.drawingBufferWidth,ot.drawingBufferHeight,Ye.transparency||"blended"),this.pick=new mt(Fe,this.draw,Ye.pickScale||.25),this.multiSample=new se(Fe,this.draw)}setPickScale(Fe){this.pick.setPickScale(Fe)}setTransparency(Fe){this.draw.setTransparency(Fe)}updateSize(){const{gl:Fe}=this.webgl,He=Math.max(Fe.drawingBufferWidth,2),Ye=Math.max(Fe.drawingBufferHeight,2);this.draw.setSize(He,Ye),this.pick.syncSize(),this.multiSample.syncSize()}}var Mr=n(9359),Fr=n(325),Sr=n(7187);const Ro={...Ve.du,tPreviousLevel:(0,Ne.$G)("texture","alpha","float","nearest"),uInvSize:(0,Ne.w5)("v2"),uOffset:(0,Ne.w5)("v2")},ro=(0,K.NG)("hi-z",Te.e,"\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tPreviousLevel;\nuniform vec2 uInvSize;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec2 position = gl_FragCoord.xy * uInvSize + uOffset;\n\n float x = texture(tPreviousLevel, position).r;\n float y = textureOffset(tPreviousLevel, position, ivec2(-1, 0)).r;\n float z = textureOffset(tPreviousLevel, position, ivec2(-1, -1)).r;\n float w = textureOffset(tPreviousLevel, position, ivec2(0, -1)).r;\n\n gl_FragColor = vec4(max(max(x, y), max(z, w)));\n}\n");var so=n(9886),ho=n(2086),Bo=n(4677);const Go=ho.e.transformMat4,Wo=r.Zb.set,We=so.ey;function Nn(Tt,Fe,He,Ye){return-1===Ye[11]?function Pt(Tt,Fe,He){return Fe*He/((He-Fe)*Tt-He)}(Tt,Fe,He):function Sn(Tt,Fe,He){return Tt*(Fe-He)-Fe}(Tt,Fe,He)}const Ft={enabled:i.t.Boolean(!1,{description:"Hierarchical Z-buffer occlusion culling. Only available for WebGL2."}),maxFrameLag:i.t.Numeric(10,{min:1,max:30,step:1},{description:"Maximum number of frames to wait for Z-buffer data."}),minLevel:i.t.Numeric(3,{min:1,max:10,step:1})};class Qt{clear(){if(!this.supported)return;const{gl:Fe}=this.webgl;(0,Ie.C6)(Fe)&&(null!==this.sync&&(Fe.deleteSync(this.sync),this.sync=null),this.frameLag=0,this.ready=!1,this.debug&&(this.debug.rect.style.display="none",this.debug.container.style.display="none"))}render(Fe){if(!this.supported||!this.props.enabled)return;const{gl:He,state:Ye}=this.webgl;if(!(0,Ie.C6)(He)||null!==this.sync)return;this.nextNear=Fe.near,this.nextFar=Fe.far,r.$I.copy(this.nextView,Fe.view),r.$I.copy(this.nextProjection,Fe.projection),_.g$&&this.webgl.timer.mark("hi-Z"),Ye.disable(He.CULL_FACE),Ye.disable(He.BLEND),Ye.disable(He.DEPTH_TEST),Ye.disable(He.SCISSOR_TEST),Ye.depthMask(!1),Ye.colorMask(!0,!0,!0,!0),Ye.clearColor(0,0,0,0);const ot=this.renderable.values,rt=Math.pow(2,Math.ceil(Math.log(Math.max(He.drawingBufferWidth,He.drawingBufferHeight))/Math.log(2))-1);for(let mn=0,zt=this.levelData.length;mn0?(Sr.IQ.update(ot.uInvSize,an.invSize),Sr.IQ.update(ot.uOffset,Fr.Z.set(ot.uOffset.ref.value,0,0)),Sr.IQ.update(ot.tPreviousLevel,this.levelData[mn-1].texture)):(Sr.IQ.update(ot.uInvSize,Fr.Z.set(ot.uInvSize.ref.value,1/rt,1/rt)),Sr.IQ.update(ot.uOffset,Fr.Z.set(ot.uOffset.ref.value,this.viewport.x/He.drawingBufferWidth,this.viewport.y/He.drawingBufferHeight)),Sr.IQ.update(ot.tPreviousLevel,this.drawPass.depthTextureOpaque)),Ye.currentRenderItemId=-1,Ye.viewport(0,0,an.size[0],an.size[1]),He.clear(He.COLOR_BUFFER_BIT),this.renderable.update(),this.renderable.render(),mn>=this.props.minLevel&&(this.tex.bind(0),He.copyTexSubImage2D(He.TEXTURE_2D,0,an.offset,0,0,0,an.size[0],an.size[1]),this.tex.unbind(0))}this.tex.attachFramebuffer(this.fb,0);const St=this.tex.getWidth(),vt=this.tex.getHeight();He.bindBuffer(He.PIXEL_PACK_BUFFER,this.buf),He.bufferData(He.PIXEL_PACK_BUFFER,this.buffer.byteLength,He.STREAM_READ),He.readPixels(0,0,St,vt,He.RED,He.FLOAT,0),He.bindBuffer(He.PIXEL_PACK_BUFFER,null),this.sync=He.fenceSync(He.SYNC_GPU_COMMANDS_COMPLETE,0),He.flush(),_.g$&&this.webgl.timer.markEnd("hi-Z")}tick(){if(!this.supported||!this.props.enabled||null===this.sync)return;const{gl:Fe}=this.webgl;if(!(0,Ie.C6)(Fe))return;const He=Fe.clientWaitSync(this.sync,0,0);He===Fe.WAIT_FAILED||this.frameLag>=this.props.maxFrameLag?(Fe.deleteSync(this.sync),this.sync=null,this.frameLag=0,this.ready=!1):He===Fe.TIMEOUT_EXPIRED?this.frameLag+=1:(Fe.bindBuffer(Fe.PIXEL_PACK_BUFFER,this.buf),Fe.getBufferSubData(Fe.PIXEL_PACK_BUFFER,0,this.buffer),Fe.bindBuffer(Fe.PIXEL_PACK_BUFFER,null),Fe.deleteSync(this.sync),this.sync=null,this.frameLag=0,this.ready=!0,this.near=this.nextNear,this.far=this.nextFar,r.$I.copy(this.view,this.nextView),r.$I.copy(this.projection,this.nextProjection))}transform(Fe){const{view:He,vp:Ye}=this;return Go(Ye,Fe.center,He),{vp:Ye,r:1.2*Fe.radius+1.52}}project(Fe,He){const{projection:Ye,aabb:ot,viewport:rt}=this;!function xr(Tt,Fe,He,Ye){return-1===Ye[11]?function Kn(Tt,Fe,He,Ye){const ot=Fe[0]*He,rt=Fe[1]*He,St=Fe[2]*He,vt=Fe[2]*Fe[2]-He*He,mn=Math.sqrt(Fe[0]*Fe[0]+vt),zt=(mn*Fe[0]-St)/(mn*Fe[2]+ot)*Ye[0],an=(mn*Fe[0]+St)/(mn*Fe[2]-ot)*Ye[0],Vn=Math.sqrt(Fe[1]*Fe[1]+vt);return Wo(Tt,-.5*an+.5,(Vn*Fe[1]-St)/(Vn*Fe[2]+rt)*Ye[5]*.5+.5,-.5*zt+.5,(Vn*Fe[1]+St)/(Vn*Fe[2]-rt)*Ye[5]*.5+.5)}(Tt,Fe,He,Ye):function dr(Tt,Fe,He,Ye){const ot=Ye[0],rt=Ye[5];return Wo(Tt,(Fe[0]-He)*ot*.5+.5,(Fe[1]+He)*rt*-.5+.5,(Fe[0]+He)*ot*.5+.5,(Fe[1]-He)*rt*-.5+.5)}(Tt,Fe,He,Ye)}(ot,Fe,He,Ye);const St=ot[2]-ot[0],vt=ot[3]-ot[1],mn=Math.max(St*rt.width,vt*rt.height);return{aabb:ot,w:St,h:vt,pr:mn,lod:Math.ceil(We(mn/2))}}setViewport(Fe,He,Ye,ot){if(!this.supported)return;Ye=Math.max(Ye,2),ot=Math.max(ot,2),A.LM.set(this.viewport,Fe,He,Ye,ot);const rt=Math.ceil(Math.log(Math.max(Ye,ot))/Math.log(2));if(rt===this.levelData.length)return;const{minLevel:St}=this.props;this.buffer=new Float32Array(Math.pow(2,rt-St)*Math.pow(2,rt-1-St)),this.tex.define(Math.pow(2,rt-St),Math.pow(2,rt-1-St));for(const mn of this.levelData)mn.framebuffer.destroy(),mn.texture.destroy();this.levelData.length=0;for(let mn=0;mn=St&&(this.levelData[mn].offset=vt,vt+=an.size[0])}this.clear()}setProps(Fe){if(this.supported)if(this.props.minLevel!==Fe.minLevel){Object.assign(this.props,Fe);const{x:He,y:Ye,width:ot,height:rt}=this.viewport;this.setViewport(He,Ye,ot,rt)}else Object.assign(this.props,Fe),this.props.enabled||this.clear()}initDebug(Fe){if(!Fe.parentElement)return;const He=document.createElement("div");Object.assign(He.style,{display:"block",position:"absolute",pointerEvents:"none"}),Fe.parentElement.appendChild(He);const Ye=document.createElement("canvas"),ot=Ye.getContext("2d");if(!ot)throw new Error("Could not create canvas 2d context");Object.assign(Ye.style,{width:"100%",height:"100%",imageRendering:"pixelated",position:"relative",pointerEvents:"none"}),He.appendChild(Ye);const rt=document.createElement("div");Object.assign(rt.style,{display:"none",position:"absolute",pointerEvents:"none"}),Fe.parentElement.appendChild(rt),this.debug={container:He,canvas:Ye,ctx:ot,rect:rt}}canDebug(Fe){return this.supported&&this.props.enabled&&this.ready&&!!this.debug}showRect(Fe,He){if(!this.canDebug(this.debug))return;const{gl:{drawingBufferHeight:Ye},pixelRatio:ot}=this.webgl,{viewport:{x:rt,y:St,width:vt,height:mn}}=this,zt=(Fe[0]*vt+rt)/ot,an=(Fe[1]*mn-St)/ot;Object.assign(this.debug.rect.style,{border:He?"solid red":"solid green",display:"block",left:`${zt}px`,top:`${an+(Ye-mn)/ot}px`,width:(Fe[2]*vt+rt)/ot-zt+"px",height:(Fe[3]*mn-St)/ot-an+"px"})}showBuffer(Fe){if(!this.canDebug(this.debug))return;if(Fe>=this.levelData.length||Fe{if(!this.supported||!this.props.enabled||!this.ready)return!1;const{vp:an,r:Vn}=this.transform(zt),{near:Fn,far:rr,projection:Vr}=this,tr=an[2]+Vn;if(-tr=this.levelData.length||Ao=lo||Yr+1>=lo)return!1;const Co=(lo-Yr-1)*jr+Po+yo;if(tr>Nn(this.buffer[Co],Fn,rr,Vr)||tr>Nn(this.buffer[Co+1],Fn,rr,Vr))return!1;const Eo=(lo-Yr+1-1)*jr+Po+yo;return!(tr>Nn(this.buffer[Eo],Fn,rr,Vr)||tr>Nn(this.buffer[Eo+1],Fn,rr,Vr))};const{gl:rt,extensions:St}=Fe;if(!(0,Ie.C6)(rt)||!St.colorBufferFloat)return _.Bb&&console.log('Missing webgl2 and/or colorBufferFloat support required for "Hi-Z"'),void(this.supported=!1);this.fb=Fe.resources.framebuffer(),this.tex=Fe.resources.texture("image-float32","alpha","float","nearest"),this.tex.attachFramebuffer(this.fb,0);const vt=rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_FORMAT),mn=rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_TYPE);if(vt!==rt.RED||mn!==rt.FLOAT)return _.Bb&&console.log('Missing red/float reading support required for "Hi-Z"'),void(this.supported=!1);this.supported=!0,this.props={...i.t.getDefaultValues(Ft),...ot},this.buf=(0,Bo.Zo)(rt),this.renderable=function po(Tt,Fe){const He={...Ve.OM,tPreviousLevel:Sr.IQ.create(Fe),uInvSize:Sr.IQ.create((0,Fr.Z)()),uOffset:Sr.IQ.create((0,Fr.Z)())},Ye={...Ro},ot=(0,ne.$h)(Tt,"triangles",ro,Ye,He);return(0,be._)(ot,He)}(Fe,this.drawPass.depthTextureOpaque),_.Bb&&Ye&&this.initDebug(Ye)}}const ht={camera:i.t.Group({mode:i.t.Select("perspective",i.t.arrayToOptions(["perspective","orthographic"]),{label:"Camera"}),helper:i.t.Group(fr.kf,{isFlat:!0}),stereo:i.t.MappedStatic("off",{on:i.t.Group(nt),off:i.t.Group({})},{cycle:!0,hideIf:Tt=>"perspective"!==Tt?.mode}),fov:i.t.Numeric(45,{min:10,max:130,step:1},{label:"Field of View"}),manualReset:i.t.Boolean(!1,{isHidden:!0})},{pivot:"mode"}),cameraFog:i.t.MappedStatic("on",{on:i.t.Group({intensity:i.t.Numeric(15,{min:1,max:100,step:1})}),off:i.t.Group({})},{cycle:!0,description:"Show fog in the distance"}),cameraClipping:i.t.Group({radius:i.t.Numeric(100,{min:0,max:99,step:1},{label:"Clipping",description:"How much of the scene to show."}),far:i.t.Boolean(!0,{description:"Hide scene in the distance"}),minNear:i.t.Numeric(5,{min:.1,max:100,step:.1},{description:"Note, may cause performance issues rendering impostors when set too small and cause issues with outline rendering when too close to 0."})},{pivot:"radius"}),viewport:i.t.MappedStatic("canvas",{canvas:i.t.Group({}),"static-frame":i.t.Group({x:i.t.Numeric(0),y:i.t.Numeric(0),width:i.t.Numeric(128),height:i.t.Numeric(128)}),"relative-frame":i.t.Group({x:i.t.Numeric(.33,{min:0,max:1,step:.01}),y:i.t.Numeric(.33,{min:0,max:1,step:.01}),width:i.t.Numeric(.5,{min:.01,max:1,step:.01}),height:i.t.Numeric(.5,{min:.01,max:1,step:.01})})}),cameraResetDurationMs:i.t.Numeric(250,{min:0,max:1e3,step:1},{description:"The time it takes to reset the camera."}),sceneRadiusFactor:i.t.Numeric(1,{min:1,max:10,step:.1}),transparentBackground:i.t.Boolean(!1),dpoitIterations:i.t.Numeric(2,{min:1,max:10,step:1}),pickPadding:i.t.Numeric(3,{min:0,max:10,step:1},{description:"extra pixels to around target to check in case target is empty"}),multiSample:i.t.Group(ce),postprocessing:i.t.Group(Se.co),marking:i.t.Group(Dt),hiZ:i.t.Group(Ft),renderer:i.t.Group(u),trackball:i.t.Group(E),interaction:i.t.Group(we),debug:i.t.Group(de),handle:i.t.Group(ct)},pt=i.t.getDefaultValues(ht);var Xt;!function(Tt){Tt.DefaultAttribs={powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,antialias:!0,preserveDrawingBuffer:!0,preferWebGl1:!1,handleResize:()=>{}},Tt.Params={pixelScale:i.t.Numeric(1,{min:.1,max:2,step:.05}),pickScale:i.t.Numeric(.25,{min:.1,max:1,step:.05}),transparency:i.t.Select("wboit",[["blended","Blended"],["wboit","Weighted, Blended"],["dpoit","Depth Peeling"]])},Tt.DefaultProps=i.t.getDefaultValues(Tt.Params),Tt.fromCanvas=function Fe(He,Ye,ot={},rt={}){const St={...Tt.DefaultAttribs,...ot},vt={...Tt.DefaultProps,...rt},{powerPreference:mn,failIfMajorPerformanceCaveat:zt,antialias:an,preserveDrawingBuffer:Vn,preferWebGl1:Fn}=St,rr=(0,L.$i)(He,{powerPreference:mn,failIfMajorPerformanceCaveat:zt,antialias:an,preserveDrawingBuffer:Vn,alpha:!0,depth:!0,premultipliedAlpha:!0,preferWebGl1:Fn});if(null===rr)throw new Error("Could not create a WebGL rendering context");const{pixelScale:Vr,pickScale:tr,transparency:Tr}=vt,oo=t.bP.fromElement(He,{pixelScale:Vr,preventGestures:!0}),Gr=(0,L.q6)(rr,{pixelScale:Vr}),Ao=new Hr(Gr,Ye,{pickScale:tr,transparency:Tr});if(_.Bb){const lo=rr.getExtension("WEBGL_lose_context");lo&&He.addEventListener("mousedown",So=>{Gr.isContextLost||!So.shiftKey||!So.ctrlKey||!So.altKey||(_.Bb&&console.log("lose context"),lo.loseContext(),setTimeout(()=>{Gr.isContextLost&&(_.Bb&&console.log("restore context"),lo.restoreContext())},1e3))},!1)}const yo=new e.t(0),vo=lo=>{Gr.setContextLost(),lo.preventDefault(),_.Bb&&console.log("context lost"),yo.next((0,o.t)())},Kr=()=>{Gr.isContextLost&&(Gr.handleContextRestored(()=>{Ao.draw.reset()}),_.Bb&&console.log("context restored"))};He.addEventListener("webglcontextlost",vo,!1),He.addEventListener("webglcontextrestored",Kr,!1);const Do=new e.t(void 0);return{canvas:He,webgl:Gr,input:oo,passes:Ao,attribs:St,get props(){return{...vt}},contextLost:yo,contextRestored:Gr.contextRestored,assetManager:Ye,changed:Do,setProps:lo=>{if(!lo)return;let So=!1;void 0!==lo.pixelScale&&lo.pixelScale!==vt.pixelScale&&(vt.pixelScale=lo.pixelScale,oo.setPixelScale(lo.pixelScale),Gr.setPixelScale(lo.pixelScale),St.handleResize(),So=!0),void 0!==lo.pickScale&&lo.pickScale!==vt.pickScale&&(vt.pickScale=lo.pickScale,Ao.setPickScale(lo.pickScale),So=!0),void 0!==lo.transparency&&lo.transparency!==vt.transparency&&(vt.transparency=lo.transparency,Ao.setTransparency(lo.transparency),So=!0),So&&Do.next(void 0)},dispose:lo=>{oo.dispose(),He.removeEventListener("webglcontextlost",vo,!1),He.removeEventListener("webglcontextrestored",Kr,!1),Gr.destroy(lo)}}}}(Xt||(Xt={}));const fn=typeof window<"u"?window.requestAnimationFrame:Tt=>setImmediate(()=>Tt(Date.now())),on=typeof window<"u"?window.cancelAnimationFrame:Tt=>clearImmediate(Tt);var En;!function(Tt){Tt.create=function Fe(He,Ye={}){var ot;const{webgl:rt,input:St,passes:vt,assetManager:mn,canvas:zt}=He,an={...(0,Mr.Go)(pt),...(0,Mr.Go)(Ye)},Vn=new Map,Fn=new Map,rr=new e.t(0);let Vr=(0,o.t)();const tr=new e.t(0),Tr=new e.t(0),oo=new e.t(0),{gl:Gr,contextRestored:Ao}=rt;let yo=0,vo=0,Kr=128,Do=128,lo=!1,So=0;st();const ao=Q.Z.create(rt,vt.draw.transparency);function Po(){return ao.boundingSphere.radius*an.sceneRadiusFactor}const Yr=new V.i({position:r.eB.create(0,0,100),mode:an.camera.mode,fog:"on"===an.cameraFog.name?an.cameraFog.params.intensity:0,clipFar:an.cameraClipping.far,minNear:an.cameraClipping.minNear,fov:(0,v.pu)(an.camera.fov)},{x:yo,y:vo,width:Kr,height:Do}),jr=new Lt(Yr,an.camera.stereo.params),Co=T.create(St,Yr,ao,an.trackball),Eo=new vr(rt,ao,an),Fo=new Qt(rt,vt.draw,zt,an.hiZ),ei=h.create(rt,an.renderer);ei.setOcclusionTest(Fo.isOccluded);const Yo=new _t(rt,ei,ao,Eo,vt.pick,{x:yo,y:vo,width:Kr,height:Do},an.pickPadding),ci=new Oe(kr,qi,St,Yr,Co,an.interaction),Jo=new ge(vt.multiSample);vt.draw.postprocessing.background.update(Yr,an.postprocessing.background,at=>{at&&Ri()});let hi,No,Fi=!1,Ci=!1,mi=!0;function qi(at){let Et=G.BL,Nt=w.YL.Empty;if(at){const qt=Eo.camera.getLoci(at);if(qt!==G.BL)return{loci:qt,repr:Nt};Et=Eo.handle.getLoci(at),Vn.forEach((Cn,Un)=>{const vn=Un.getLoci(at);(0,G.$M)(vn)||((0,G.$M)(Et)||console.warn("found another loci, this should not happen"),Et=vn,Nt=Un)})}return{loci:Et,repr:Nt}}let Oi=[];function Si(at,Et){const{repr:Nt,loci:qt}=at;let Cn=!1;return Nt?Cn=Nt.mark(qt,Et)||Cn:Vn.forEach((Un,vn)=>{Cn=vn.mark(qt,Et)||Cn}),Cn=Eo.handle.mark(qt,Et)||Cn,Cn=Eo.camera.mark(qt,Et)||Cn,Cn}let ni=!1,gi=!1;function Wi(at){gi||function Pi(at){if(rt.isContextLost)return!1;let Et=!1;if(Ci&&(Jn(!1),Ci=!1,Et=!0),yo>Gr.drawingBufferWidth||yo+Kr<0||vo>Gr.drawingBufferHeight||vo+Do<0)return!1;const Nt=function es(){let at=!1;for(const[Et,Nt]of Oi)at=Si(Et,Nt)||at;return Oi=[],at&&(ao.update(void 0,!0),Eo.handle.scene.update(void 0,!0),Eo.camera.scene.update(void 0,!0)),at}()&&(ei.props.colorMarker||an.marking.enabled);let qt=!1;Co.update(So);const Cn=Yr.update(),Un=at||Cn||Et||lo;lo=!1;const vn=Jo.update(Nt||Un,an.multiSample);if(Un||vn||Nt){let nr=Yr;"on"===an.camera.stereo.name&&(jr.update(),nr=jr),_.g$&&rt.timer.mark("Canvas3D.render",!0);const pr={renderer:ei,camera:nr,scene:ao,helper:Eo};se.isEnabled(an.multiSample)?Jo.render(pr,an,!0,an.multiSample.reduceFlicker&&!Cn&&Nt&&!Co.isAnimating):vt.draw.render(pr,an,!0),Fo.render(Yr),_.g$&&rt.timer.markEnd("Canvas3D.render"),Yo.dirty=Yo.dirty||Un,qt=!0}return qt}(!!at?.force)&&mi&&tr.next((0,o.t)()-Vr)}function Ri(){lo=!0}let Qi=0;function Hn(at,Et){So=at,Qr(Et?.isSynchronous),Et?.updateControls&&Co.update(So),Yr.transition.tick(So),Fo.tick(),!Et?.manualDraw&&(Wi(),!Yr.transition.inTransition&&!rt.isContextLost&&ci.tick(So))}function qr(){Hn((0,o.t)()),Qi=fn(qr)}function kr(at,Et){return rt.isContextLost?void 0:Yo.identify(at,Et,"on"===an.camera.stereo.name?jr:Yr)}function Qr(at=!1){(function Vi(at){return!ao.needsCommit||($.f8.copy(Ti,ao.boundingSphereVisible),Fo.clear(),ao.commit(at?void 0:bi)?(oo.next(0),Eo.debug.isEnabled&&Eo.debug.update(),!an.camera.manualReset&&(0===rr.value||function Li(){if(0===Yr.state.radiusMax)return!0;if(Yr.transition.inTransition||No)return!1;let at=!0,Et=!0;$.f8.set(Bi,Yr.state.target,Yr.state.radius);for(const Nt of ao.renderables){if(!Nt.state.visible)continue;const qt=Nt.values.boundingSphere.ref.value;if(!qt.radius)continue;Et=!1;const Cn=r.eB.distance(Bi.center,qt.center);if((Cn>Bi.radius||Cn>qt.radius||qt.radius>Yr.state.radiusMax)&&!$.f8.includes(Ti,qt))return!0;$.f8.overlaps(Bi,qt)&&(at=!1)}return at||!Et&&Bi.radius<=.1}())&&(Fi=!0),0===Ti.radius&&(hi=0),an.camera.manualReset||Yr.setState({radiusMax:Po()},0),rr.next(Vn.size),_.Bb&&Ei(),!0):(oo.next(ao.commitQueueSize),!1))})(at)&&(function vi(){if(!Fi)return;const at=ao.boundingSphereVisible,{center:Et,radius:Nt}=at,qt=Co.props.autoAdjustMinMaxDistance;if("on"===qt.name){const Cn=qt.params.minDistanceFactor*Nt+qt.params.minDistancePadding,Un=Math.max(qt.params.maxDistanceFactor*Nt,qt.params.maxDistanceMin);Co.setProps({minDistance:Cn,maxDistance:Un})}if(Nt>0){const Cn=void 0===hi?an.cameraResetDurationMs:hi,Un=Yr.getFocus(Et,Nt),vn="function"==typeof No?No(ao,Yr):No,nr=vn?{...Un,...vn}:Un;Yr.setState({...nr,radiusMax:Po()},Cn)}hi=void 0,No=void 0,Fi=!1}(),ni&&(Eo.debug.isEnabled&&Eo.debug.update(),Wi({force:!0}),ni=!1),Tr.next((0,o.t)()))}const Ti=(0,$.f8)(),Bi=(0,$.f8)(),bi=250;function Ei(){const at=ao.renderables.map(Cn=>({drawCount:Cn.values.drawCount.ref.value,instanceCount:Cn.values.instanceCount.ref.value,materialId:Cn.materialId,renderItemId:Cn.id}));console.groupCollapsed(`${at.length} RenderItems`),at.length<50?console.table(at):console.log(at),console.log(JSON.stringify(rt.stats,void 0,4));const{texture:Et,attribute:Nt,elements:qt}=rt.resources.getByteCounts();console.log(JSON.stringify({texture:`${(Et/1024/1024).toFixed(3)} MiB`,attribute:`${(Nt/1024/1024).toFixed(3)} MiB`,elements:`${(qt/1024/1024).toFixed(3)} MiB`},void 0,4)),console.log(JSON.stringify(rt.timer.formatedStats(),void 0,4)),console.groupEnd()}function kn(){const at=ao.boundingSphere.radius>0?100-Math.round(Yr.transition.target.radius/Po()*100):0;return{camera:{mode:Yr.state.mode,helper:{...Eo.camera.props},stereo:{...an.camera.stereo},fov:Math.round((0,v.H)(Yr.state.fov)),manualReset:!!an.camera.manualReset},cameraFog:Yr.state.fog>0?{name:"on",params:{intensity:Yr.state.fog}}:{name:"off",params:{}},cameraClipping:{far:Yr.state.clipFar,radius:at,minNear:Yr.state.minNear},cameraResetDurationMs:an.cameraResetDurationMs,sceneRadiusFactor:an.sceneRadiusFactor,transparentBackground:an.transparentBackground,dpoitIterations:an.dpoitIterations,pickPadding:an.pickPadding,viewport:an.viewport,postprocessing:{...an.postprocessing},marking:{...an.marking},multiSample:{...an.multiSample},hiZ:{...Fo.props},renderer:{...ei.props},trackball:{...Co.props},interaction:{...ci.props},debug:{...Eo.debug.props},handle:{...Eo.handle.props}}}const ur=Ao.subscribe(()=>{Yo.dirty=!0,Wi({force:!0}),Wi({force:!0})}),sr=new e.t(0);function Jn(at=!0){vt.updateSize(),st(),et(),at&&Ri(),sr.next(+new Date)}(0,_.fv)(Ei);const Br=null===(ot=He.changed)||void 0===ot?void 0:ot.subscribe(()=>{ao.setTransparency(vt.draw.transparency),Ri()});if(_.Bb&&zt){let at;const Et=Nt=>{const qt=Nt&&G.QN.getBoundingSphere(G.QN.normalize(Nt,"residue"));Fo.debugOcclusion(qt)};St.click.subscribe(Nt=>{if(!Nt.modifiers.control||2!==Nt.button)return;const qt=kr(Nt.x,Nt.y);if(!qt)return at=void 0,void Et(at);at=qi(qt.id).loci,Et(at)}),tr.subscribe(()=>{setTimeout(()=>{Et(at)},100)})}return{webgl:rt,add:function ln(at){!function Gn(at){Fn.has(at)||Fn.set(at,at.updated.subscribe(Et=>{at.state.syncManually||ln(at)}))}(at);const Et=Vn.get(at),Nt=new Set;at.renderObjects.forEach(qt=>Nt.add(qt)),Et?xe.M.areEqual(Nt,Et)||(Nt.forEach(qt=>{Et.has(qt)||ao.add(qt)}),Et.forEach(qt=>{Nt.has(qt)||ao.remove(qt)})):at.renderObjects.forEach(qt=>ao.add(qt)),Vn.set(at,Nt),ao.update(at.renderObjects,!1),ni=!0,_.Bb&&Ei()},remove:function Ht(at){!function ar(at){const Et=Fn.get(at);Et&&(Et.unsubscribe(),Fn.delete(at))}(at);const Et=Vn.get(at);Et&&(Et.forEach(Nt=>ao.remove(Nt)),Vn.delete(at),ni=!0,_.Bb&&Ei())},commit:Qr,update:(at,Et)=>{if(at){if(!Vn.has(at))return;ao.update(at.renderObjects,!!Et)}else ao.update(void 0,!!Et);ni=!0},clear:()=>{Fn.forEach(at=>at.unsubscribe()),Fn.clear(),Vn.clear(),ao.clear(),Eo.debug.clear(),Ri(),rr.next(Vn.size)},syncVisibility:()=>{0===Yr.state.radiusMax&&(Fi=!0,hi=0),ao.syncVisibility()&&Eo.debug.isEnabled&&Eo.debug.update(),Ri()},requestDraw:Ri,tick:Hn,animate:function zr(){gi=!1,Co.start((0,o.t)()),0===Qi&&qr()},resetTime:function co(at){Vr=at,Co.start(at)},pause:function lr(at=!1){gi=at,on(Qi),Qi=0},resume:()=>{gi=!1},identify:kr,mark:function ti(at,Et){Oi.push([at,Et])},getLoci:qi,handleResize:Jn,requestResize:()=>{Ci=!0},requestCameraReset:at=>{hi=at?.durationMs,No=at?.snapshot,Fi=!0},camera:Yr,boundingSphere:ao.boundingSphere,boundingSphereVisible:ao.boundingSphereVisible,get notifyDidDraw(){return mi},set notifyDidDraw(at){mi=at},didDraw:tr,commited:Tr,commitQueueSize:oo,reprCount:rr,resized:sr,setProps:(at,Et=!1)=>{var Nt,qt,Cn,Un;const vn="function"==typeof at?(0,or.jM)(kn(),at):at;void 0!==vn.sceneRadiusFactor&&(an.sceneRadiusFactor=vn.sceneRadiusFactor,Yr.setState({radiusMax:Po()},0));const nr=Object.create(null);vn.camera&&void 0!==vn.camera.mode&&vn.camera.mode!==Yr.state.mode&&(nr.mode=vn.camera.mode);const pr=Math.round((0,v.H)(Yr.state.fov));if(vn.camera&&void 0!==vn.camera.fov&&vn.camera.fov!==pr&&(nr.fov=(0,v.pu)(vn.camera.fov)),void 0!==vn.cameraFog&&vn.cameraFog.params){const Rr="on"===vn.cameraFog.name?vn.cameraFog.params.intensity:0;Rr!==Yr.state.fog&&(nr.fog=Rr)}if(void 0!==vn.cameraClipping&&(void 0!==vn.cameraClipping.far&&vn.cameraClipping.far!==Yr.state.clipFar&&(nr.clipFar=vn.cameraClipping.far),void 0!==vn.cameraClipping.minNear&&vn.cameraClipping.minNear!==Yr.state.minNear&&(nr.minNear=vn.cameraClipping.minNear),void 0!==vn.cameraClipping.radius)){const Rr=Po()/100*(100-vn.cameraClipping.radius);Rr>0&&Rr!==nr.radius&&(nr.radius=Math.max(Rr,.01))}Object.keys(nr).length>0&&Yr.setState(nr),!(null===(Nt=vn.camera)||void 0===Nt)&&Nt.helper&&Eo.camera.setProps(vn.camera.helper),void 0!==(null===(qt=vn.camera)||void 0===qt?void 0:qt.manualReset)&&(an.camera.manualReset=vn.camera.manualReset),void 0!==(null===(Cn=vn.camera)||void 0===Cn?void 0:Cn.stereo)&&(Object.assign(an.camera.stereo,vn.camera.stereo),jr.setProps(an.camera.stereo.params)),void 0!==vn.cameraResetDurationMs&&(an.cameraResetDurationMs=vn.cameraResetDurationMs),void 0!==vn.transparentBackground&&(an.transparentBackground=vn.transparentBackground),void 0!==vn.dpoitIterations&&(an.dpoitIterations=vn.dpoitIterations),void 0!==vn.pickPadding&&(an.pickPadding=vn.pickPadding),void 0!==vn.viewport&&(an.viewport===vn.viewport||an.viewport.name===vn.viewport.name&&(0,c.bN)(an.viewport.params,vn.viewport.params)||(an.viewport=vn.viewport,st(),et())),!(null===(Un=vn.postprocessing)||void 0===Un)&&Un.background&&(Object.assign(an.postprocessing.background,vn.postprocessing.background),vt.draw.postprocessing.background.update(Yr,an.postprocessing.background,Rr=>{Rr&&!Et&&Ri()})),vn.postprocessing&&Object.assign(an.postprocessing,vn.postprocessing),vn.marking&&Object.assign(an.marking,vn.marking),vn.multiSample&&Object.assign(an.multiSample,vn.multiSample),vn.hiZ&&Fo.setProps(vn.hiZ),vn.renderer&&ei.setProps(vn.renderer),vn.trackball&&Co.setProps(vn.trackball),vn.interaction&&ci.setProps(vn.interaction),vn.debug&&Eo.debug.setProps(vn.debug),vn.handle&&Eo.handle.setProps(vn.handle),"orthographic"===nr.mode&&(an.camera.stereo.name="off"),Et||Ri()},getImagePass:(at={})=>new Pr(rt,mn,ei,ao,Yr,Eo,vt.draw.transparency,at),getRenderObjects(){const at=[];return ao.forEach((Et,Nt)=>at.push(Nt)),at},get props(){return kn()},get input(){return St},get stats(){return ei.stats},get interaction(){return ci.events},dispose:()=>{ur.unsubscribe(),Br?.unsubscribe(),on(Qi),Oi=[],ao.clear(),Eo.debug.clear(),Co.dispose(),ei.dispose(),ci.dispose(),Fo.dispose(),(0,_.EF)(Ei)}};function st(){const at=yo,Et=vo,Nt=Kr,qt=Do;"canvas"===an.viewport.name?(yo=0,vo=0,Kr=Gr.drawingBufferWidth,Do=Gr.drawingBufferHeight):"static-frame"===an.viewport.name?(yo=an.viewport.params.x*rt.pixelRatio,Do=an.viewport.params.height*rt.pixelRatio,vo=Gr.drawingBufferHeight-Do-an.viewport.params.y*rt.pixelRatio,Kr=an.viewport.params.width*rt.pixelRatio):"relative-frame"===an.viewport.name&&(yo=Math.round(an.viewport.params.x*Gr.drawingBufferWidth),Do=Math.round(an.viewport.params.height*Gr.drawingBufferHeight),vo=Math.round(Gr.drawingBufferHeight-Do-an.viewport.params.y*Gr.drawingBufferHeight),Kr=Math.round(an.viewport.params.width*Gr.drawingBufferWidth)),(at!==yo||Et!==vo||Nt!==Kr||qt!==Do)&&(lo=!0)}function et(){Yo.setViewport(yo,vo,Kr,Do),ei.setViewport(yo,vo,Kr,Do),A.LM.set(Yr.viewport,yo,vo,Kr,Do),A.LM.set(Co.viewport,yo,vo,Kr,Do),Fo.setViewport(yo,vo,Kr,Do)}}}(En||(En={}))},7028:(tn,Ue,n)=>{"use strict";n.d(Ue,{E2:()=>f,Nz:()=>S,WT:()=>a,kf:()=>h});var e=n(1025),o=n(7103),r=n(2802),t=n(4439),A=n(9283),y=n(573),c=n(4255),i=n(7377),v=n(4536),O=n(5384),b=n(4369),_=n(3246),M=n(3558),I=n(5117),l=n(2745),m=n(6825),u=n(8277),d=n(1372),s=n(5276);const C={alpha:u.t.Numeric(.51,{min:0,max:1,step:.01},{isEssential:!0,label:"Opacity"}),colorX:u.t.Color(l.s.red,{isEssential:!0}),colorY:u.t.Color(l.s.green,{isEssential:!0}),colorZ:u.t.Color(l.s.blue,{isEssential:!0}),scale:u.t.Numeric(.33,{min:.1,max:2,step:.1},{isEssential:!0}),location:u.t.Select("bottom-left",u.t.arrayToOptions(["bottom-left","bottom-right","top-left","top-right"])),locationOffsetX:u.t.Numeric(0),locationOffsetY:u.t.Numeric(0),originColor:u.t.Color(l.s.grey),radiusScale:u.t.Numeric(.075,{min:.01,max:.3,step:.001}),showPlanes:u.t.Boolean(!0),planeColorXY:u.t.Color(l.s.grey,{label:"Plane Color XY"}),planeColorXZ:u.t.Color(l.s.grey,{label:"Plane Color XZ"}),planeColorYZ:u.t.Color(l.s.grey,{label:"Plane Color YZ"}),showLabels:u.t.Boolean(!1),labelX:u.t.Text("X"),labelY:u.t.Text("Y"),labelZ:u.t.Text("Z"),labelColorX:u.t.Color(l.s.grey),labelColorY:u.t.Color(l.s.grey),labelColorZ:u.t.Color(l.s.grey),labelOpacity:u.t.Numeric(1,{min:0,max:1,step:.01}),labelScale:u.t.Numeric(.25,{min:.1,max:1,step:.01})},h={axes:u.t.MappedStatic("on",{on:u.t.Group(C),off:u.t.Group({})},{cycle:!0,description:"Show camera orientation axes"})};class a{constructor(U,N={}){this.webgl=U,this.props={axes:{name:"off",params:{}}},this.pixelRatio=1,this.eachGroup=(k,H)=>{if(!f(k))return!1;let $=!1;if(this.meshRenderObject){const J=this.meshRenderObject.values.uGroupCount.ref.value;for(const{groupId:W,instanceId:te}of k.elements)H(o.I.ofSingleton(te*J+W))&&($=!0)}if(this.textRenderObject){const J=this.textRenderObject.values.uGroupCount.ref.value;for(const{groupId:W,instanceId:te}of k.elements)H(o.I.ofSingleton(te*J+W))&&($=!0)}return $},this.scene=v.Z.create(U,"blended"),this.camera=new s.i,b.eB.set(this.camera.up,0,1,0),b.eB.set(this.camera.target,0,0,0),this.setProps(N)}setProps(U){this.props=(0,e.jM)(this.props,N=>{if(void 0!==U.axes&&(N.axes.name=U.axes.name,"on"===U.axes.name)){this.scene.clear(),this.pixelRatio=this.webgl.pixelRatio;const k={...U.axes.params,scale:U.axes.params.scale*this.pixelRatio,labelScale:U.axes.params.labelScale*this.pixelRatio};this.meshRenderObject=function L(V){const U=function T(V,U){const N=100*V.scale,k=function E(V,U){const N=y.P.createState(512,256,U),k=100*V.scale,H=V.radiusScale*k,$=V.showLabels?100*V.labelScale/3:0,J=b.eB.scale((0,b.eB)(),b.eB.unitX,k-$),W=b.eB.scale((0,b.eB)(),b.eB.unitY,k-$),te=b.eB.scale((0,b.eB)(),b.eB.unitZ,k-$),de={radiusTop:H,radiusBottom:H,radialSegments:32};if(N.currentGroup=S.Origin,(0,t.X)(N,b.eB.origin,H,2),N.currentGroup=S.X,(0,t.X)(N,J,H,2),(0,r.y9)(N,b.eB.origin,J,1,de),N.currentGroup=S.Y,(0,t.X)(N,W,H,2),(0,r.y9)(N,b.eB.origin,W,1,de),N.currentGroup=S.Z,(0,t.X)(N,te,H,2),(0,r.y9)(N,b.eB.origin,te,1,de),V.showPlanes){b.eB.scale(J,J,.5),b.eB.scale(W,W,.5),b.eB.scale(te,te,.5),N.currentGroup=S.XY,y.P.addTriangle(N,b.eB.origin,J,W),y.P.addTriangle(N,b.eB.origin,W,J);const ye=b.eB.add((0,b.eB)(),J,W);y.P.addTriangle(N,ye,J,W),y.P.addTriangle(N,ye,W,J),N.currentGroup=S.XZ,y.P.addTriangle(N,b.eB.origin,J,te),y.P.addTriangle(N,b.eB.origin,te,J);const j=b.eB.add((0,b.eB)(),J,te);y.P.addTriangle(N,j,J,te),y.P.addTriangle(N,j,te,J),N.currentGroup=S.YZ,y.P.addTriangle(N,b.eB.origin,W,te),y.P.addTriangle(N,b.eB.origin,te,W);const Z=b.eB.add((0,b.eB)(),W,te);y.P.addTriangle(N,Z,W,te),y.P.addTriangle(N,Z,te,W)}return y.P.getMesh(N)}(V,U?.geometry);k.setBoundingSphere(O.f8.create(b.eB.create(N/2,N/2,N/2),N+N/4));return M.y.create("axes-mesh",{},k,$=>{switch($){case S.X:return V.colorX;case S.Y:return V.colorY;case S.Z:return V.colorZ;case S.XY:return V.planeColorXY;case S.XZ:return V.planeColorXZ;case S.YZ:return V.planeColorYZ;case S.Origin:return V.originColor;default:return l.s.grey}},()=>1,()=>"")}(V);return M.y.createRenderObject(U,{...u.t.getDefaultValues(A.e.Params),...V,ignoreLight:!0,cellSize:0})}(k),this.scene.add(this.meshRenderObject),U.axes.params.showLabels?(this.textRenderObject=function G(V){const U=function Q(V,U){const N=100*V.scale,k=function w(V,U){const N=i.t.create(V,8,8,U),k=100*V.scale,H=b.eB.scale((0,b.eB)(),b.eB.unitX,k),$=b.eB.scale((0,b.eB)(),b.eB.unitY,k),J=b.eB.scale((0,b.eB)(),b.eB.unitZ,k),W=100*V.labelScale;return N.add(V.labelX,H[0],H[1],H[2],0,W,S.X),N.add(V.labelY,$[0],$[1],$[2],0,W,S.Y),N.add(V.labelZ,J[0],J[1],J[2],0,W,S.Z),N.getText()}(V,U?.geometry);k.setBoundingSphere(O.f8.create(b.eB.create(N/2,N/2,N/2),N));return M.y.create("axes-text",{},k,$=>{switch($){case S.X:return V.labelColorX;case S.Y:return V.labelColorY;case S.Z:return V.labelColorZ;default:return l.s.grey}},()=>1,()=>"")}(V);return M.y.createRenderObject(U,{...u.t.getDefaultValues(c.E.Params),...V,alpha:V.labelOpacity,cellSize:0})}(k),this.scene.add(this.textRenderObject)):this.textRenderObject=void 0,this.scene.commit(),b.eB.set(this.camera.position,0,0,200*k.scale),b.$I.lookAt(this.camera.view,this.camera.position,this.camera.target,this.camera.up),N.axes.params={...U.axes.params}}})}get isEnabled(){return"on"===this.props.axes.name}getLoci(U){const{objectId:N,groupId:k,instanceId:H}=U;return(this.meshRenderObject&&N===this.meshRenderObject.id||this.textRenderObject&&N===this.textRenderObject.id)&&k!==S.None?function R(V,U,N){return(0,_.g9)("camera-axes",V,[{groupId:U,instanceId:N}],void 0,()=>function D(V,U){const N=U.props.axes,k="on"===N.name?N.params.labelX:"X",H="on"===N.name?N.params.labelY:"Y",$="on"===N.name?N.params.labelZ:"Z";switch(V){case S.X:return`${k} Axis`;case S.Y:return`${H} Axis`;case S.Z:return`${$} Axis`;case S.XY:return`${k}${H} Plane`;case S.XZ:return`${k}${$} Plane`;case S.YZ:return`${H}${$} Plane`;case S.Origin:return"Origin";default:return"Axes"}}(U,V))}(this,k,H):_.BL}mark(U,N){return!(!m.sY.is(m.sY.Highlighting,N)||!((0,_.xc)(U)||f(U)&&U.data===this))&&(I.b.mark(this.meshRenderObject,U,N,this.eachGroup)||I.b.mark(this.textRenderObject,U,N,this.eachGroup))}update(U){if(!this.meshRenderObject||"off"===this.props.axes.name)return;this.pixelRatio!==this.webgl.pixelRatio&&this.setProps(this.props),function p(V,U,N){const{near:k,far:H}=V,$=-U.width/2,J=U.width/2,W=U.height/2,te=-U.height/2,de=(J-$)/2,ye=(W-te)/2,j=(J+$)/2,Z=(W+te)/2;let q=j-de,Y=j+de,ee=Z+ye,g=Z-ye;if(N.enabled){const _e=(J-$)/N.width,xe=(W-te)/N.height;q+=_e*N.offsetX,Y=q+_e*N.width,ee-=xe*N.offsetY,g=ee-xe*N.height}b.$I.ortho(V.projection,q,Y,ee,g,k,H)}(this.camera,U.viewport,U.viewOffset),b.$I.extractRotation(this.scene.view,U.view);const N=this.textRenderObject?this.textRenderObject.values.boundingSphere.ref.value.radius:this.meshRenderObject.values.boundingSphere.ref.value.radius,k=this.props.axes.params.location,H=this.props.axes.params.locationOffsetX*this.pixelRatio,$=this.props.axes.params.locationOffsetY*this.pixelRatio;"bottom-left"===k?b.$I.setTranslation(this.scene.view,b.eB.create(-U.viewport.width/2+N+H,-U.viewport.height/2+N+$,0)):"bottom-right"===k?b.$I.setTranslation(this.scene.view,b.eB.create(U.viewport.width/2-N-H,-U.viewport.height/2+N+$,0)):"top-left"===k?b.$I.setTranslation(this.scene.view,b.eB.create(-U.viewport.width/2+N+H,U.viewport.height/2-N-$,0)):"top-right"===k?b.$I.setTranslation(this.scene.view,b.eB.create(U.viewport.width/2-N-H,U.viewport.height/2-N-$,0)):(0,d.dr)(k)}}var S=function(V){return V[V.None=0]="None",V[V.X=1]="X",V[V.Y=2]="Y",V[V.Z=3]="Z",V[V.XY=4]="XY",V[V.XZ=5]="XZ",V[V.YZ=6]="YZ",V[V.Origin=7]="Origin",V}(S||{});function f(V){return"data-loci"===V.kind&&"camera-axes"===V.tag}},3770:(tn,Ue,n)=>{"use strict";n.d(Ue,{c:()=>u,P:()=>d});var e=n(9007),o=n(9421),r=n(4511),t=n(2897),A=n(4143),y=n(4648),c=n(4369),i=n(9909),v=n(8277),O=n(9387),b=n(2629),l=n(1094);const u={strength:v.t.Numeric(1,{min:0,max:3,step:.1}),radius:v.t.Numeric(0,{min:0,max:1,step:.01}),threshold:v.t.Numeric(0,{min:0,max:1,step:.01},{description:"Luminosity threshold",hideIf:G=>"emissive"===G.mode}),mode:v.t.Select("emissive",[["luminosity","Luminosity"],["emissive","Emissive"]])};class d{static isEnabled(V){return"on"===V.bloom.name}constructor(V,U,N){this.webgl=V,this.horizontalBlurTargets=[],this.verticalBlurTargets=[],this.emissiveTarget=V.createRenderTarget(U,N,!0,"uint8","linear","rgba"),this.luminosityTarget=V.createRenderTarget(U,N,!1,"uint8","linear"),this.compositeTarget=V.createRenderTarget(U,N,!1,"uint8","linear");let k=Math.round(U/2),H=Math.round(N/2);for(let J=0;J<5;++J)this.horizontalBlurTargets[J]=V.createRenderTarget(k,H,!1,"uint8","linear"),this.verticalBlurTargets[J]=V.createRenderTarget(k,H,!1,"uint8","linear"),k=Math.round(k/2),H=Math.round(H/2);const $=(0,y.z6)();this.luminosityRenderable=function h(G,V,U,N){const k=V.getWidth(),H=V.getHeight(),$={...e.OM,tColor:i.IQ.create(V),tEmissive:i.IQ.create(U),tDepth:i.IQ.create(N),uTexSizeInv:i.IQ.create(c.ZY.create(1/k,1/H)),uDefaultColor:i.IQ.create((0,c.eB)()),uDefaultOpacity:i.IQ.create(0),uLuminosityThreshold:i.IQ.create(0),uSmoothWidth:i.IQ.create(1),dMode:i.IQ.create("emissive")},J={...s},W=(0,A.$h)(G,"triangles",C,J,$);return(0,o._)(W,$)}(V,$,$,$),this.blurRenderable=function T(G,V){const U=V.getWidth(),N=V.getHeight(),k={...e.OM,tInput:i.IQ.create(V),uTexSizeInv:i.IQ.create(c.ZY.create(1/U,1/N)),uDirection:i.IQ.create((0,c.ZY)()),uGaussianCoefficients:i.IQ.create([]),dKernelRadius:i.IQ.create(D[0])},H={...p},$=(0,A.$h)(G,"triangles",E,H,k);return(0,o._)($,k)}(V,$),this.compositeRenderable=function Q(G,V,U,N,k,H,$,J){const W={...e.OM,uTexSizeInv:i.IQ.create(c.ZY.create(V,U)),tBlur1:i.IQ.create(N),tBlur2:i.IQ.create(k),tBlur3:i.IQ.create(H),tBlur4:i.IQ.create($),tBlur5:i.IQ.create(J),uBloomStrength:i.IQ.create(1),uBloomRadius:i.IQ.create(0),uBloomFactors:i.IQ.create([1,.8,.6,.4,.2]),uBloomTints:i.IQ.create(new Array(15).fill(1))},te={...L},de=(0,A.$h)(G,"triangles",w,te,W);return(0,o._)(de,W)}(V,U,N,this.verticalBlurTargets[0].texture,this.verticalBlurTargets[1].texture,this.verticalBlurTargets[2].texture,this.verticalBlurTargets[3].texture,this.verticalBlurTargets[4].texture),this.copyRenderable=(0,e._0)(V,this.compositeTarget.texture)}setSize(V,U){const N=this.luminosityTarget.getWidth(),k=this.luminosityTarget.getHeight();if(V!==N||U!==k){this.emissiveTarget.setSize(V,U),this.luminosityTarget.setSize(V,U),this.compositeTarget.setSize(V,U);let H=Math.round(V/2),$=Math.round(U/2);for(let J=0;J<5;++J)this.horizontalBlurTargets[J].setSize(H,$),this.verticalBlurTargets[J].setSize(H,$),H=Math.round(H/2),$=Math.round($/2);i.IQ.update(this.luminosityRenderable.values.uTexSizeInv,c.ZY.set(this.compositeRenderable.values.uTexSizeInv.ref.value,1/V,1/U)),i.IQ.update(this.compositeRenderable.values.uTexSizeInv,c.ZY.set(this.compositeRenderable.values.uTexSizeInv.ref.value,1/V,1/U)),i.IQ.update(this.copyRenderable.values.uTexSize,c.ZY.set(this.copyRenderable.values.uTexSize.ref.value,V,U))}}update(V,U,N,k){let H=!1;this.luminosityRenderable.values.tColor.ref.value!==V&&(i.IQ.update(this.luminosityRenderable.values.tColor,V),H=!0),this.luminosityRenderable.values.tEmissive.ref.value!==U&&(i.IQ.update(this.luminosityRenderable.values.tEmissive,U),H=!0),this.luminosityRenderable.values.tDepth.ref.value!==N&&(i.IQ.update(this.luminosityRenderable.values.tDepth,N),H=!0),this.luminosityRenderable.values.dMode.ref.value!==k.mode&&(i.IQ.update(this.luminosityRenderable.values.dMode,k.mode),H=!0),i.IQ.updateIfChanged(this.luminosityRenderable.values.uLuminosityThreshold,k.threshold),H&&this.luminosityRenderable.update();let $=!1;this.blurRenderable.values.tInput.ref.value!==V&&(i.IQ.update(this.blurRenderable.values.tInput,V),$=!0),$&&this.blurRenderable.update(),i.IQ.update(this.compositeRenderable.values.uBloomRadius,k.radius),i.IQ.update(this.compositeRenderable.values.uBloomStrength,k.strength)}render(V,U){b.g$&&this.webgl.timer.mark("BloomPass.render");const{gl:N,state:k}=this.webgl,{x:H,y:$,width:J,height:W}=V;k.viewport(H,$,J,W),k.scissor(H,$,J,W),k.enable(N.SCISSOR_TEST),k.disable(N.BLEND),k.disable(N.DEPTH_TEST),k.depthMask(!1),this.luminosityTarget.bind(),this.luminosityRenderable.render();for(let te=0;te<5;++te){const de=this.horizontalBlurTargets[te].getWidth(),ye=this.horizontalBlurTargets[te].getHeight();k.viewport(0,0,de,ye),k.scissor(0,0,de,ye),i.IQ.update(this.blurRenderable.values.dKernelRadius,D[te]),i.IQ.update(this.blurRenderable.values.uGaussianCoefficients,S(D[te])),i.IQ.update(this.blurRenderable.values.uTexSizeInv,c.ZY.set(this.blurRenderable.values.uTexSizeInv.ref.value,1/de,1/ye)),this.horizontalBlurTargets[te].bind(),i.IQ.update(this.blurRenderable.values.tInput,0===te?this.luminosityTarget.texture:this.verticalBlurTargets[te-1].texture),i.IQ.update(this.blurRenderable.values.uDirection,R),this.blurRenderable.update(),this.blurRenderable.render(),this.verticalBlurTargets[te].bind(),i.IQ.update(this.blurRenderable.values.tInput,this.horizontalBlurTargets[te].texture),i.IQ.update(this.blurRenderable.values.uDirection,f),this.blurRenderable.update(),this.blurRenderable.render()}k.viewport(H,$,J,W),k.scissor(H,$,J,W),this.compositeTarget.bind(),this.compositeRenderable.update(),this.compositeRenderable.render(),U?U.bind():this.webgl.unbindFramebuffer(),k.enable(N.BLEND),k.blendFunc(N.ONE,N.ONE),this.copyRenderable.render(),b.g$&&this.webgl.timer.markEnd("BloomPass.render")}}const s={...e.du,tColor:(0,r.$G)("texture","rgba","ubyte","linear"),tEmissive:(0,r.$G)("texture","rgba","ubyte","linear"),tDepth:(0,r.$G)("texture","rgba","ubyte","nearest"),uTexSizeInv:(0,r.w5)("v2"),uDefaultColor:(0,r.w5)("v3"),uDefaultOpacity:(0,r.w5)("f"),uLuminosityThreshold:(0,r.w5)("f"),uSmoothWidth:(0,r.w5)("f"),dMode:(0,r.$F)("string",["luminosity","emissive"])},C=(0,t.NG)("Bloom Luminosity",O.e,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform sampler2D tEmissive;\nuniform sampler2D tDepth;\nuniform vec2 uTexSizeInv;\n\nuniform vec3 uDefaultColor;\nuniform float uDefaultOpacity;\nuniform float uLuminosityThreshold;\nuniform float uSmoothWidth;\n\n#include common\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\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy * uTexSizeInv;\n vec4 texel = texture2D(tColor, coords);\n float emissive = texture2D(tEmissive, coords).a;\n float depth = getDepth(coords);\n\n if (isBackground(depth)) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n return;\n }\n\n vec4 outputColor = vec4(uDefaultColor.rgb, uDefaultOpacity);\n\n #if defined(dMode_luminosity)\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float v = dot(texel.xyz, luma);\n float alpha = smoothstep(uLuminosityThreshold, uLuminosityThreshold + uSmoothWidth, v);\n\n gl_FragColor = mix(outputColor, texel, alpha);\n #elif defined(dMode_emissive)\n gl_FragColor = mix(outputColor, texel, emissive);\n #endif\n}\n"),S=(0,l.E)(function a(G){const V=[];for(let U=0;U{"use strict";n.d(Ue,{w:()=>M,z:()=>I});var e=n(9007),o=n(9421),r=n(4511),t=n(2897),A=n(4143),y=n(4648),c=n(4369),i=n(9909),v=n(8277),O=n(9387),_=n(2629);const M={blurSize:v.t.Numeric(9,{min:1,max:32,step:1}),blurSpread:v.t.Numeric(1,{min:0,max:10,step:.1}),inFocus:v.t.Numeric(0,{min:-5e3,max:5e3,step:1},{description:"Distance from the scene center that will be in focus"}),PPM:v.t.Numeric(20,{min:0,max:5e3,step:.1},{description:"Size of the area that will be in focus"}),center:v.t.Select("camera-target",v.t.arrayToOptions(["scene-center","camera-target"])),mode:v.t.Select("plane",v.t.arrayToOptions(["plane","sphere"]))};class I{static isEnabled(s){return"off"!==s.dof.name}constructor(s,C,h){this.webgl=s,this.target=s.createRenderTarget(C,h,!1);const a=(0,y.z6)();this.renderable=function u(d,s,C,h){const a=s.getWidth(),S=s.getHeight(),D={...e.OM,tDepthOpaque:i.IQ.create(C),tDepthTransparent:i.IQ.create(h),tColor:i.IQ.create(s),uTexSize:i.IQ.create(c.ZY.create(a,S)),uProjection:i.IQ.create(c.$I.identity()),uInvProjection:i.IQ.create(c.$I.identity()),uBounds:i.IQ.create((0,c.Zb)()),uCenter:i.IQ.create((0,c.eB)()),uMode:i.IQ.create(0),dOrthographic:i.IQ.create(0),uNear:i.IQ.create(1),uFar:i.IQ.create(1e4),dBlurSize:i.IQ.create(5),uBlurSpread:i.IQ.create(300),uInFocus:i.IQ.create(20),uPPM:i.IQ.create(20)},R={...l},f=(0,A.$h)(d,"triangles",m,R,D);return(0,o._)(f,D)}(s,a,a,a)}updateState(s){const{gl:C,state:h}=this.webgl;h.enable(C.SCISSOR_TEST),h.disable(C.BLEND),h.disable(C.DEPTH_TEST),h.depthMask(!1);const{x:a,y:S,width:D,height:R}=s;h.viewport(a,S,D,R),h.scissor(a,S,D,R),h.clearColor(0,0,0,1),C.clear(C.COLOR_BUFFER_BIT)}setSize(s,C){const h=this.target.texture.getWidth(),a=this.target.texture.getHeight();(s!==h||C!==a)&&(this.target.setSize(s,C),i.IQ.update(this.renderable.values.uTexSize,c.ZY.set(this.renderable.values.uTexSize.ref.value,s,C)))}update(s,C,h,a,S,D){let R=!1;this.renderable.values.tColor.ref.value!==C&&(i.IQ.update(this.renderable.values.tColor,C),R=!0),this.renderable.values.tDepthOpaque.ref.value!==h&&(i.IQ.update(this.renderable.values.tDepthOpaque,h),R=!0),this.renderable.values.tDepthTransparent.ref.value!==a&&(i.IQ.update(this.renderable.values.tDepthTransparent,a),R=!0);const f="orthographic"===s.state.mode?1:0,p=this.renderable.values.uInvProjection.ref.value;c.$I.invert(p,s.projection);const[E,T]=this.renderable.values.uTexSize.ref.value,L=s.viewport;i.IQ.update(this.renderable.values.uProjection,s.projection),i.IQ.update(this.renderable.values.uInvProjection,p),i.IQ.update(this.renderable.values.uMode,"sphere"===S.mode?1:0),c.Zb.set(this.renderable.values.uBounds.ref.value,L.x/E,L.y/T,(L.x+L.width)/E,(L.y+L.height)/T),i.IQ.update(this.renderable.values.uBounds,this.renderable.values.uBounds.ref.value),i.IQ.updateIfChanged(this.renderable.values.uNear,s.near),i.IQ.updateIfChanged(this.renderable.values.uFar,s.far),i.IQ.updateIfChanged(this.renderable.values.dOrthographic,f),this.renderable.values.dBlurSize.ref.value!==S.blurSize&&(i.IQ.update(this.renderable.values.dBlurSize,S.blurSize),R=!0);const w="scene-center"===S.center?D.center:s.state.target,G=c.eB.distance(s.state.position,w)+S.inFocus;i.IQ.updateIfChanged(this.renderable.values.uInFocus,G);const V=this.renderable.values.uCenter.ref.value;c.eB.transformMat4(V,w,s.view),i.IQ.update(this.renderable.values.uCenter,V),i.IQ.updateIfChanged(this.renderable.values.uBlurSpread,S.blurSpread),i.IQ.updateIfChanged(this.renderable.values.uPPM,S.PPM),R&&this.renderable.update()}render(s,C){_.g$&&this.webgl.timer.mark("DofPass.render"),C?C.bind():this.webgl.unbindFramebuffer(),this.updateState(s),this.renderable.render(),_.g$&&this.webgl.timer.markEnd("DofPass.render")}}const l={...e.du,tDepthOpaque:(0,r.$G)("texture","rgba","ubyte","nearest"),tDepthTransparent:(0,r.$G)("texture","rgba","ubyte","nearest"),tColor:(0,r.$G)("texture","rgba","ubyte","nearest"),uTexSize:(0,r.w5)("v2"),uProjection:(0,r.w5)("m4"),uInvProjection:(0,r.w5)("m4"),uBounds:(0,r.w5)("v4"),uCenter:(0,r.w5)("v3"),uMode:(0,r.w5)("i"),dOrthographic:(0,r.$F)("number"),uNear:(0,r.w5)("f"),uFar:(0,r.w5)("f"),dBlurSize:(0,r.$F)("number"),uBlurSpread:(0,r.w5)("f"),uInFocus:(0,r.w5)("f"),uPPM:(0,r.w5)("f")},m=(0,t.NG)("dof",O.e,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#include common\n\nuniform sampler2D tColor;\nuniform sampler2D tDepthOpaque;\nuniform sampler2D tDepthTransparent;\n\nuniform vec2 uTexSize;\nuniform vec4 uBounds;\n\nuniform float uBlurSpread;\nuniform float uInFocus;\nuniform float uPPM;\n\nuniform float uNear; // Near plane\nuniform float uFar; // Far plane\n\nuniform mat4 uInvProjection; // Inverse projection\nuniform mat4 uProjection; // projection\n\nuniform int uMode; // 0-planar, 1-spherical\nuniform vec3 uCenter; // Center of focus sphere in view space\n\n// Function to convert depth value from depth buffer to view space Z\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\n// Retrieve depth from opaque depth texture\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\n// Retrieve depth from transparent depth texture\nfloat getDepthTransparent(const in vec2 coords) {\n return unpackRGBAToDepth(texture2D(tDepthTransparent, coords));\n}\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nfloat getDepth(const in vec2 coords) {\n return min(getDepthOpaque(coords), getDepthTransparent(coords));\n}\n\nfloat getCOC(vec2 uv) {\n float depth = getDepth(uv);\n float viewDist = getViewZ(depth);\n vec3 aposition = screenSpaceToViewSpace(vec3(uv.xy, depth), uInvProjection);\n float focusDist = length(aposition - uCenter);\n float coc = 0.0; // Circle of Confusion\n if (uMode == 0) { // planar Depth of field\n coc = (abs(viewDist) - uInFocus) / uPPM; //focus distance, focus range\n } else if(uMode == 1) { // spherical Depth of field\n coc = focusDist / uPPM ;\n }\n coc = clamp(coc, -1.0, 1.0);\n return coc;\n}\n\n// Simple box blur for blurring the image\nvec3 getBlurredImage(vec2 coords) {\n vec4 blurColor = vec4(0);\n vec2 texelSize = vec2(1.0 / uTexSize.x, 1.0 / uTexSize.y);\n float count = 0.0;\n for (int x = 0; x < int(dBlurSize); x++) {\n for (int y = 0; y < int(dBlurSize); y++) {\n vec2 offset = vec2(float(x) - float(dBlurSize) / 2.0, float(y) - float(dBlurSize) / 2.0);\n vec2 uvPixel = coords.xy + offset * texelSize * uBlurSpread;\n float coc = getCOC(uvPixel);\n coc = smoothstep(0.0, 1.0, abs(coc));\n // mix blurColor with new color with weight coc\n blurColor.rgb = blurColor.rgb + texture2D(tColor, uvPixel).xyz * coc;\n count+=coc;\n }\n }\n blurColor = blurColor / count;\n return blurColor.rgb;\n}\n\n// simplification from https://catlikecoding.com/unity/tutorials/advanced-rendering/depth-of-field/\nvoid main() {\n vec2 uv = gl_FragCoord.xy / uTexSize;\n vec4 color = texture2D(tColor, uv);\n float depth = getDepth(uv);\n\n float viewDist = getViewZ(depth);\n\n vec3 aposition = screenSpaceToViewSpace(vec3(uv.xy, depth), uInvProjection);\n float focusDist = length(aposition - uCenter);\n vec3 blurColor = getBlurredImage(uv);\n\n float coc = getCOC(uv); // Circle of Confusion\n\n // for debugging the coc\n // color.rgb = (coc < 0.0) ? (1.0 - abs(coc)) * vec3(1.0,0.0,0.0) : vec3(0.0, 1.0 - coc, 0.0) ;//mix(color.rgb, blurColor.rgb, abs(coc));\n color.rgb = mix(color.rgb, blurColor, smoothstep(0.0, 1.0, abs(coc))); // Smooth blending based on CoC\n gl_FragColor = color;\n}\n")},3099:(tn,Ue,n)=>{"use strict";n.d(Ue,{SK:()=>Dn,co:()=>Mt,Pv:()=>bn});var e=n(9007),o=n(4511),r=n(2897),t=n(9909),A=n(4143),y=n(9421),c=n(4369),i=n(8277),v=n(9387),I=n(190),m=n(2629);const u={edgeThresholdMin:i.t.Numeric(.0312,{min:.0312,max:.0833,step:1e-4},{description:"Trims the algorithm from processing darks."}),edgeThresholdMax:i.t.Numeric(.063,{min:.063,max:.333,step:.001},{description:"The minimum amount of local contrast required to apply algorithm."}),iterations:i.t.Numeric(12,{min:0,max:16,step:1},{description:"Number of edge exploration steps."}),subpixelQuality:i.t.Numeric(.3,{min:0,max:1,step:.01},{description:"Choose the amount of sub-pixel aliasing removal."})};class d{constructor(It,Dt){this.webgl=It,this.renderable=function h(jt,It){const Dt=It.getWidth(),Ct=It.getHeight(),$t={...e.OM,tColor:t.IQ.create(It),uTexSizeInv:t.IQ.create(c.ZY.create(1/Dt,1/Ct)),dEdgeThresholdMin:t.IQ.create(.0312),dEdgeThresholdMax:t.IQ.create(.125),dIterations:t.IQ.create(12),dSubpixelQuality:t.IQ.create(.3)},Vt={...s},Wt=(0,A.$h)(jt,"triangles",C,Vt,$t);return(0,y._)(Wt,$t)}(It,Dt)}updateState(It){const{gl:Dt,state:Ct}=this.webgl;Ct.enable(Dt.SCISSOR_TEST),Ct.disable(Dt.BLEND),Ct.disable(Dt.DEPTH_TEST),Ct.depthMask(!1);const{x:$t,y:Vt,width:Wt,height:yn}=It;Ct.viewport($t,Vt,Wt,yn),Ct.scissor($t,Vt,Wt,yn),Ct.clearColor(0,0,0,1),Dt.clear(Dt.COLOR_BUFFER_BIT)}setSize(It,Dt){t.IQ.update(this.renderable.values.uTexSizeInv,c.ZY.set(this.renderable.values.uTexSizeInv.ref.value,1/It,1/Dt))}update(It,Dt){const{values:Ct}=this.renderable,{edgeThresholdMin:$t,edgeThresholdMax:Vt,iterations:Wt,subpixelQuality:yn}=Dt;let Zt=!1;Ct.tColor.ref.value!==It&&(t.IQ.update(this.renderable.values.tColor,It),Zt=!0),Ct.dEdgeThresholdMin.ref.value!==$t&&(Zt=!0),t.IQ.updateIfChanged(Ct.dEdgeThresholdMin,$t),Ct.dEdgeThresholdMax.ref.value!==Vt&&(Zt=!0),t.IQ.updateIfChanged(Ct.dEdgeThresholdMax,Vt),Ct.dIterations.ref.value!==Wt&&(Zt=!0),t.IQ.updateIfChanged(Ct.dIterations,Wt),Ct.dSubpixelQuality.ref.value!==yn&&(Zt=!0),t.IQ.updateIfChanged(Ct.dSubpixelQuality,yn),Zt&&this.renderable.update()}render(It,Dt){m.g$&&this.webgl.timer.mark("FxaaPass.render"),Dt?Dt.bind():this.webgl.unbindFramebuffer(),this.updateState(It),this.renderable.render(),m.g$&&this.webgl.timer.markEnd("FxaaPass.render")}}const s={...e.du,tColor:(0,o.$G)("texture","rgba","ubyte","linear"),uTexSizeInv:(0,o.w5)("v2"),dEdgeThresholdMin:(0,o.$F)("number"),dEdgeThresholdMax:(0,o.$F)("number"),dIterations:(0,o.$F)("number"),dSubpixelQuality:(0,o.$F)("number")},C=(0,r.NG)("fxaa",v.e,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform vec2 uTexSizeInv;\n\n// adapted from https://github.com/kosua20/Rendu\n// MIT License Copyright (c) 2017 Simon Rodriguez\n\n#define QUALITY(q) ((q) < 5 ? 1.0 : ((q) > 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");var a=n(4648),T=n(7361);const L={edgeThreshold:i.t.Numeric(.1,{min:.05,max:.15,step:.01}),maxSearchSteps:i.t.Numeric(16,{min:0,max:32,step:1})};class w{get supported(){return this._supported}constructor(It,Dt){if(this.webgl=It,this._supported=!1,typeof HTMLImageElement>"u")return void(m.Bb&&console.log('Missing "HTMLImageElement" required for "SMAA"'));const Ct=Dt.getWidth(),$t=Dt.getHeight();this.edgesTarget=It.createRenderTarget(Ct,$t,!1,"uint8","linear"),this.weightsTarget=It.createRenderTarget(Ct,$t,!1,"uint8","linear"),this.edgesRenderable=function V(jt,It){const Dt=It.getWidth(),Ct=It.getHeight(),$t={...e.OM,tColor:t.IQ.create(It),uTexSizeInv:t.IQ.create(c.ZY.create(1/Dt,1/Ct)),uViewport:t.IQ.create((0,c.Zb)()),dEdgeThreshold:t.IQ.create(.1)},Vt={...Q},Wt=(0,A.$h)(jt,"triangles",G,Vt,$t);return(0,y._)(Wt,$t)}(It,Dt),this.weightsRenderable=function k(jt,It){const Dt=It.getWidth(),Ct=It.getHeight(),$t=jt.resources.texture("image-uint8","rgb","ubyte","linear"),Vt=jt.resources.texture("image-uint8","rgba","ubyte","nearest"),Wt={...e.OM,tEdges:t.IQ.create(It),tArea:t.IQ.create($t),tSearch:t.IQ.create(Vt),uTexSizeInv:t.IQ.create(c.ZY.create(1/Dt,1/Ct)),uViewport:t.IQ.create((0,c.Zb)()),dMaxSearchSteps:t.IQ.create(16)};(0,a.pg)("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII=",Wt.tArea,$t),(0,a.pg)("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII=",Wt.tSearch,Vt);const yn={...U},Zt=(0,A.$h)(jt,"triangles",N,yn,Wt);return(0,y._)(Zt,Wt)}(It,this.edgesTarget.texture),this.blendRenderable=function J(jt,It,Dt){const Ct=It.getWidth(),$t=It.getHeight(),Vt={...e.OM,tColor:t.IQ.create(It),tWeights:t.IQ.create(Dt),uTexSizeInv:t.IQ.create(c.ZY.create(1/Ct,1/$t)),uViewport:t.IQ.create((0,c.Zb)())},Wt={...H},yn=(0,A.$h)(jt,"triangles",$,Wt,Vt);return(0,y._)(yn,Vt)}(It,Dt,this.weightsTarget.texture),this._supported=!0}updateState(It){const{gl:Dt,state:Ct}=this.webgl;Ct.enable(Dt.SCISSOR_TEST),Ct.disable(Dt.BLEND),Ct.disable(Dt.DEPTH_TEST),Ct.depthMask(!1);const{x:$t,y:Vt,width:Wt,height:yn}=It;Ct.viewport($t,Vt,Wt,yn),Ct.scissor($t,Vt,Wt,yn),Ct.colorMask(!0,!0,!0,!0),Ct.clearColor(0,0,0,1),Dt.clear(Dt.COLOR_BUFFER_BIT),t.IQ.update(this.edgesRenderable.values.uViewport,T.LM.toVec4(this.edgesRenderable.values.uViewport.ref.value,It)),t.IQ.update(this.weightsRenderable.values.uViewport,T.LM.toVec4(this.weightsRenderable.values.uViewport.ref.value,It)),t.IQ.update(this.blendRenderable.values.uViewport,T.LM.toVec4(this.blendRenderable.values.uViewport.ref.value,It))}setSize(It,Dt){const Ct=this.edgesTarget.getWidth(),$t=this.edgesTarget.getHeight();(It!==Ct||Dt!==$t)&&(this.edgesTarget.setSize(It,Dt),this.weightsTarget.setSize(It,Dt),t.IQ.update(this.edgesRenderable.values.uTexSizeInv,c.ZY.set(this.edgesRenderable.values.uTexSizeInv.ref.value,1/It,1/Dt)),t.IQ.update(this.weightsRenderable.values.uTexSizeInv,c.ZY.set(this.weightsRenderable.values.uTexSizeInv.ref.value,1/It,1/Dt)),t.IQ.update(this.blendRenderable.values.uTexSizeInv,c.ZY.set(this.blendRenderable.values.uTexSizeInv.ref.value,1/It,1/Dt)))}update(It,Dt){let Ct=!1;this.edgesRenderable.values.tColor.ref.value!==It&&(t.IQ.update(this.edgesRenderable.values.tColor,It),Ct=!0),this.edgesRenderable.values.dEdgeThreshold.ref.value!==Dt.edgeThreshold&&(t.IQ.update(this.edgesRenderable.values.dEdgeThreshold,Dt.edgeThreshold),Ct=!0),Ct&&this.edgesRenderable.update(),this.weightsRenderable.values.dMaxSearchSteps.ref.value!==Dt.maxSearchSteps&&(t.IQ.update(this.weightsRenderable.values.dMaxSearchSteps,Dt.maxSearchSteps),this.weightsRenderable.update()),this.blendRenderable.values.tColor.ref.value!==It&&(t.IQ.update(this.blendRenderable.values.tColor,It),this.blendRenderable.update())}render(It,Dt){m.g$&&this.webgl.timer.mark("SmaaPass.render"),this.edgesTarget.bind(),this.updateState(It),this.edgesRenderable.render(),this.weightsTarget.bind(),this.updateState(It),this.weightsRenderable.render(),Dt?Dt.bind():this.webgl.unbindFramebuffer(),this.updateState(It),this.blendRenderable.render(),m.g$&&this.webgl.timer.markEnd("SmaaPass.render")}}const Q={...e.du,tColor:(0,o.$G)("texture","rgba","ubyte","linear"),uTexSizeInv:(0,o.w5)("v2"),uViewport:(0,o.w5)("v4"),dEdgeThreshold:(0,o.$F)("number")},G=(0,r.NG)("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"),U={...e.du,tEdges:(0,o.$G)("texture","rgba","ubyte","linear"),tArea:(0,o.$G)("texture","rgb","ubyte","linear"),tSearch:(0,o.$G)("texture","rgba","ubyte","nearest"),uTexSizeInv:(0,o.w5)("v2"),uViewport:(0,o.w5)("v4"),dMaxSearchSteps:(0,o.$F)("number")},N=(0,r.NG)("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"),H={...e.du,tColor:(0,o.$G)("texture","rgba","ubyte","linear"),tWeights:(0,o.$G)("texture","rgba","ubyte","linear"),uTexSizeInv:(0,o.w5)("v2"),uViewport:(0,o.w5)("v4")},$=(0,r.NG)("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");var j=n(6639),Z=n(7187),q=n(5276),Y=n(2086),ee=n(325),g=n(1861),_e=n(8599),xe=n(4490),le=n(7630),Ae=n(1372),Be=n(127);function Ce(){return Ce.zero()}!function(jt){function It(){const On=[.1,0,0];return On[0]=0,On}function Ct(On,fr,Dr,Pr){return On[0]=fr,On[0]=Dr,On[0]=Pr,On}function Wt(On,fr,Dr){const Pr=fr[0],or=fr[4],Nr=fr[8],Ir=fr[1],Or=fr[5],Jr=fr[9],To=fr[2],un=fr[6],ct=fr[10];switch(Dr){case"XYZ":On[1]=Math.asin((0,Be.qE)(Nr,-1,1)),Math.abs(Nr)<.9999999?(On[0]=Math.atan2(-Jr,ct),On[2]=Math.atan2(-or,Pr)):(On[0]=Math.atan2(un,Or),On[2]=0);break;case"YXZ":On[0]=Math.asin(-(0,Be.qE)(Jr,-1,1)),Math.abs(Jr)<.9999999?(On[1]=Math.atan2(Nr,ct),On[2]=Math.atan2(Ir,Or)):(On[1]=Math.atan2(-To,Pr),On[2]=0);break;case"ZXY":On[0]=Math.asin((0,Be.qE)(un,-1,1)),Math.abs(un)<.9999999?(On[1]=Math.atan2(-To,ct),On[2]=Math.atan2(-or,Or)):(On[1]=0,On[2]=Math.atan2(Ir,Pr));break;case"ZYX":On[1]=Math.asin(-(0,Be.qE)(To,-1,1)),Math.abs(To)<.9999999?(On[0]=Math.atan2(un,ct),On[2]=Math.atan2(Ir,Pr)):(On[0]=0,On[2]=Math.atan2(-or,Or));break;case"YZX":On[2]=Math.asin((0,Be.qE)(Ir,-1,1)),Math.abs(Ir)<.9999999?(On[0]=Math.atan2(-Jr,Or),On[1]=Math.atan2(-To,Pr)):(On[0]=0,On[1]=Math.atan2(Nr,ct));break;case"XZY":On[2]=Math.asin(-(0,Be.qE)(or,-1,1)),Math.abs(or)<.9999999?(On[0]=Math.atan2(un,Or),On[1]=Math.atan2(Nr,Pr)):(On[0]=Math.atan2(-Jr,ct),On[1]=0);break;default:(0,Ae.dr)(Dr)}return On}jt.zero=It,jt.create=function Dt(On,fr,Dr){const Pr=It();return Pr[0]=On,Pr[1]=fr,Pr[2]=Dr,Pr},jt.set=Ct,jt.clone=function $t(On){const fr=It();return fr[0]=On[0],fr[1]=On[1],fr[2]=On[2],fr},jt.copy=function Vt(On,fr){return On[0]=fr[0],On[1]=fr[1],On[2]=fr[2],On},jt.fromMat4=Wt;const yn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];jt.fromQuat=function Zt(On,fr,Dr){return j.$.fromQuat(yn,fr),Wt(On,yn,Dr)},jt.fromVec3=function kt(On,fr){return Ct(On,fr[0],fr[1],fr[2])},jt.exactEquals=function Ot(On,fr){return On[0]===fr[0]&&On[1]===fr[1]&&On[2]===fr[2]},jt.fromArray=function An(On,fr,Dr){return On[0]=fr[Dr+0],On[1]=fr[Dr+1],On[2]=fr[Dr+2],On},jt.toArray=function jn(On,fr,Dr){return fr[Dr+0]=On[0],fr[Dr+1]=On[1],fr[Dr+2]=On[2],fr}}(Ce||(Ce={}));const Re={opacity:i.t.Numeric(1,{min:0,max:1,step:.01}),saturation:i.t.Numeric(0,{min:-1,max:1,step:.01}),lightness:i.t.Numeric(0,{min:-1,max:1,step:.01})},ke={faces:i.t.MappedStatic("urls",{urls:i.t.Group({nx:i.t.Text("",{label:"Negative X / Left"}),ny:i.t.Text("",{label:"Negative Y / Bottom"}),nz:i.t.Text("",{label:"Negative Z / Back"}),px:i.t.Text("",{label:"Positive X / Right"}),py:i.t.Text("",{label:"Positive Y / Top"}),pz:i.t.Text("",{label:"Positive Z / Front"})},{isExpanded:!0,label:"URLs"}),files:i.t.Group({nx:i.t.File({label:"Negative X / Left",accept:"image/*"}),ny:i.t.File({label:"Negative Y / Bottom",accept:"image/*"}),nz:i.t.File({label:"Negative Z / Back",accept:"image/*"}),px:i.t.File({label:"Positive X / Right",accept:"image/*"}),py:i.t.File({label:"Positive Y / Top",accept:"image/*"}),pz:i.t.File({label:"Positive Z / Front",accept:"image/*"})},{isExpanded:!0,label:"Files"})}),blur:i.t.Numeric(0,{min:0,max:1,step:.01},{description:'Note, this only works in WebGL2 or when "EXT_shader_texture_lod" is available.'}),rotation:i.t.Group({x:i.t.Numeric(0,{min:0,max:360,step:1},{immediateUpdate:!0}),y:i.t.Numeric(0,{min:0,max:360,step:1},{immediateUpdate:!0}),z:i.t.Numeric(0,{min:0,max:360,step:1},{immediateUpdate:!0})}),...Re},we={source:i.t.MappedStatic("url",{url:i.t.Text(""),file:i.t.File({accept:"image/*"})}),blur:i.t.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.'}),...Re,coverage:i.t.Select("viewport",i.t.arrayToOptions(["viewport","canvas"]))},Oe={topColor:i.t.Color((0,I.Q1)(14540253)),bottomColor:i.t.Color((0,I.Q1)(15658734)),ratio:i.t.Numeric(.5,{min:0,max:1,step:.01}),coverage:i.t.Select("viewport",i.t.arrayToOptions(["viewport","canvas"]))},Se={centerColor:i.t.Color((0,I.Q1)(14540253)),edgeColor:i.t.Color((0,I.Q1)(15658734)),ratio:i.t.Numeric(.5,{min:0,max:1,step:.01}),coverage:i.t.Select("viewport",i.t.arrayToOptions(["viewport","canvas"]))},Ve={variant:i.t.MappedStatic("off",{off:i.t.EmptyGroup(),skybox:i.t.Group(ke,{isExpanded:!0}),image:i.t.Group(we,{isExpanded:!0}),horizontalGradient:i.t.Group(Oe,{isExpanded:!0}),radialGradient:i.t.Group(Se,{isExpanded:!0})},{label:"Environment"})};class Ne{constructor(It,Dt,Ct,$t){this.webgl=It,this.assetManager=Dt,this.camera=new q.i,this.target=(0,Y.e)(),this.position=(0,Y.e)(),this.dir=(0,Y.e)(),this.renderable=function Ie(jt,It,Dt){const Ct={drawCount:Z.IQ.create(6),instanceCount:Z.IQ.create(1),aPosition:Z.IQ.create(e.Wp),tSkybox:Z.IQ.create((0,a.z6)()),tImage:Z.IQ.create((0,a.z6)()),uImageScale:Z.IQ.create((0,ee.Z)()),uImageOffset:Z.IQ.create((0,ee.Z)()),uTexSize:Z.IQ.create(ee.Z.create(It,Dt)),uViewport:Z.IQ.create((0,_e.Z)()),uViewportAdjusted:Z.IQ.create(!0),uViewDirectionProjectionInverse:Z.IQ.create((0,j.$)()),uGradientColorA:Z.IQ.create((0,Y.e)()),uGradientColorB:Z.IQ.create((0,Y.e)()),uGradientRatio:Z.IQ.create(.5),uBlur:Z.IQ.create(0),uOpacity:Z.IQ.create(1),uSaturation:Z.IQ.create(0),uLightness:Z.IQ.create(0),uRotation:Z.IQ.create(le.U.identity()),dVariant:Z.IQ.create("skybox")},$t={...ae},Vt=(0,A.$h)(jt,"triangles",ge,$t,Ct);return(0,y._)(Vt,Ct)}(It,Ct,$t)}setSize(It,Dt){const[Ct,$t]=this.renderable.values.uTexSize.ref.value;(It!==Ct||Dt!==$t)&&Z.IQ.update(this.renderable.values.uTexSize,ee.Z.set(this.renderable.values.uTexSize.ref.value,It,Dt))}clearSkybox(){void 0!==this.skybox&&(this.skybox.texture.destroy(),this.skybox.assets.forEach(It=>this.assetManager.release(It)),this.skybox=void 0)}updateSkybox(It,Dt,Ct){var $t;const Vt=null===($t=this.skybox)||void 0===$t?void 0:$t.props.faces,Wt=Dt.faces.params;if(!(Wt.nx&&Wt.ny&&Wt.nz&&Wt.px&&Wt.py&&Wt.pz))return this.clearSkybox(),void Ct?.(!1);if(this.skybox&&Vt&&function ie(jt,It){return Te(jt)===Te(It)}(Dt.faces,this.skybox.props.faces))Ct?.(!1);else{this.clearSkybox();const{texture:Ot,assets:An}=function ue(jt,It,Dt,Ct){const $t=function ne(jt,It){return"urls"===It.name?{nx:g.V.getUrlAsset(jt,It.params.nx),ny:g.V.getUrlAsset(jt,It.params.ny),nz:g.V.getUrlAsset(jt,It.params.nz),px:g.V.getUrlAsset(jt,It.params.px),py:g.V.getUrlAsset(jt,It.params.py),pz:g.V.getUrlAsset(jt,It.params.pz)}:{nx:It.params.nx,ny:It.params.ny,nz:It.params.nz,px:It.params.px,py:It.params.py,pz:It.params.pz}}(It,Dt),Vt=function be(jt,It){const Dt=Ct=>jt.resolve(Ct,"binary").run().then($t=>new Blob([$t.data]));return{nx:Dt(It.nx),ny:Dt(It.ny),nz:Dt(It.nz),px:Dt(It.px),py:Dt(It.py),pz:Dt(It.pz)}}(It,$t),Wt=[$t.nx,$t.ny,$t.nz,$t.px,$t.py,$t.pz];return typeof HTMLImageElement>"u"?(console.error('Missing "HTMLImageElement" required for background skybox'),Ct?.(!0),{texture:(0,a.z6)(),assets:Wt}):{texture:jt.resources.cubeTexture(Vt,!0,Ct),assets:Wt}}(this.webgl,this.assetManager,Dt.faces,jn=>{this.skybox&&(this.skybox.loaded=!jn),Ct?.(!0)});this.skybox={texture:Ot,props:{...Dt},assets:An,loaded:!1},Z.IQ.update(this.renderable.values.tSkybox,Ot),this.renderable.update()}if(!this.skybox)return;let yn=It;"orthographic"===It.state.mode&&(this.camera.setState({...It.state,mode:"perspective"}),this.camera.update(),yn=this.camera);const Zt=this.renderable.values.uViewDirectionProjectionInverse.ref.value;Y.e.sub(this.dir,yn.state.position,yn.state.target),Y.e.setMagnitude(this.dir,this.dir,.1),Y.e.copy(this.position,this.dir),j.$.lookAt(Zt,this.position,this.target,yn.state.up),j.$.mul(Zt,yn.projection,Zt),j.$.invert(Zt,Zt),Z.IQ.update(this.renderable.values.uViewDirectionProjectionInverse,Zt);const kt=this.renderable.values.uRotation.ref.value;le.U.fromEuler(kt,Ce.create((0,xe.pu)(Dt.rotation.x),(0,xe.pu)(Dt.rotation.y),(0,xe.pu)(Dt.rotation.z)),"XYZ"),Z.IQ.update(this.renderable.values.uRotation,kt),Z.IQ.updateIfChanged(this.renderable.values.uBlur,Dt.blur),Z.IQ.updateIfChanged(this.renderable.values.uOpacity,Dt.opacity),Z.IQ.updateIfChanged(this.renderable.values.uSaturation,Dt.saturation),Z.IQ.updateIfChanged(this.renderable.values.uLightness,Dt.lightness),Z.IQ.updateIfChanged(this.renderable.values.dVariant,"skybox"),this.renderable.update()}clearImage(){void 0!==this.image&&(this.image.texture.destroy(),this.assetManager.release(this.image.asset),this.image=void 0)}updateImage(It,Dt){if(!It.source.params)return this.clearImage(),void Dt?.(!1);if(this.image&&this.image.props.source.params&&function ce(jt,It){return ve(jt)===ve(It)}(It.source,this.image.props.source))Dt?.(!1);else{this.clearImage();const{texture:Ct,asset:$t}=function se(jt,It,Dt,Ct){const $t="url"===Dt.name?g.V.getUrlAsset(It,Dt.params):Dt.params;if(typeof HTMLImageElement>"u")return console.error('Missing "HTMLImageElement" required for background image'),Ct?.(!0),{texture:(0,a.z6)(),asset:$t};const Vt=jt.resources.texture("image-uint8","rgba","ubyte","linear"),Wt=new Image;return Wt.onload=()=>{Vt.load(Wt),(jt.isWebGL2||(0,xe.r6)(Wt.width)&&(0,xe.r6)(Wt.height))&&Vt.mipmap(),Ct?.()},Wt.onerror=()=>{Ct?.(!0)},It.resolve($t,"binary").run().then(yn=>{const Zt=new Blob([yn.data]);Wt.src=URL.createObjectURL(Zt)}),{texture:Vt,asset:$t}}(this.webgl,this.assetManager,It.source,Vt=>{this.image&&(this.image.loaded=!Vt),Dt?.(!0)});this.image={texture:Ct,props:{...It},asset:$t,loaded:!1},Z.IQ.update(this.renderable.values.tImage,Ct),this.renderable.update()}this.image&&(Z.IQ.updateIfChanged(this.renderable.values.uBlur,It.blur),Z.IQ.updateIfChanged(this.renderable.values.uOpacity,It.opacity),Z.IQ.updateIfChanged(this.renderable.values.uSaturation,It.saturation),Z.IQ.updateIfChanged(this.renderable.values.uLightness,It.lightness),Z.IQ.updateIfChanged(this.renderable.values.uViewportAdjusted,"viewport"===It.coverage),Z.IQ.updateIfChanged(this.renderable.values.dVariant,"image"),this.renderable.update())}updateImageScaling(){var It,Dt;const Ct=this.renderable.values,[$t,Vt]=Ct.uTexSize.ref.value,Wt=(null===(It=this.image)||void 0===It?void 0:It.texture.getWidth())||0,yn=(null===(Dt=this.image)||void 0===Dt?void 0:Dt.texture.getHeight())||0,Zt=$t/Vt;Z.IQ.update(Ct.uImageScale,ZtZt?ee.Z.set(Ct.uImageOffset.ref.value,(1-Zt/jn)/2,0):ee.Z.set(Ct.uImageOffset.ref.value,0,(1-jn/Zt)/2))}updateGradient(It,Dt,Ct,$t,Vt){Z.IQ.update(this.renderable.values.uGradientColorA,I.Q1.toVec3Normalized(this.renderable.values.uGradientColorA.ref.value,It)),Z.IQ.update(this.renderable.values.uGradientColorB,I.Q1.toVec3Normalized(this.renderable.values.uGradientColorB.ref.value,Dt)),Z.IQ.updateIfChanged(this.renderable.values.uGradientRatio,Ct),Z.IQ.updateIfChanged(this.renderable.values.uViewportAdjusted,Vt),Z.IQ.updateIfChanged(this.renderable.values.dVariant,$t),this.renderable.update()}update(It,Dt,Ct){if("off"===Dt.variant.name)return this.clearSkybox(),this.clearImage(),void Ct?.(!1);"skybox"===Dt.variant.name?(this.clearImage(),this.updateSkybox(It,Dt.variant.params,Ct)):"image"===Dt.variant.name?(this.clearSkybox(),this.updateImage(Dt.variant.params,Ct)):"horizontalGradient"===Dt.variant.name?(this.clearSkybox(),this.clearImage(),this.updateGradient(Dt.variant.params.topColor,Dt.variant.params.bottomColor,Dt.variant.params.ratio,Dt.variant.name,"viewport"===Dt.variant.params.coverage),Ct?.(!1)):"radialGradient"===Dt.variant.name&&(this.clearSkybox(),this.clearImage(),this.updateGradient(Dt.variant.params.centerColor,Dt.variant.params.edgeColor,Dt.variant.params.ratio,Dt.variant.name,"viewport"===Dt.variant.params.coverage),Ct?.(!1));const{x:$t,y:Vt,width:Wt,height:yn}=It.viewport;Z.IQ.update(this.renderable.values.uViewport,_e.Z.set(this.renderable.values.uViewport.ref.value,$t,Vt,Wt,yn))}isEnabled(It){return!!(this.skybox&&this.skybox.loaded||this.image&&this.image.loaded||"horizontalGradient"===It.variant.name||"radialGradient"===It.variant.name)}isReady(){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)}render(){this.isReady()&&("image"===this.renderable.values.dVariant.ref.value&&this.updateImageScaling(),m.g$&&this.webgl.timer.mark("BackgroundPass.render"),this.renderable.render(),m.g$&&this.webgl.timer.markEnd("BackgroundPass.render"))}dispose(){this.clearSkybox(),this.clearImage()}}const K="background-skybox";function Te(jt){var It,Dt,Ct,$t,Vt,Wt;return"urls"===jt.name?`${K}_${jt.params.nx}|${jt.params.ny}|${jt.params.nz}|${jt.params.px}|${jt.params.py}|${jt.params.pz}`:`${K}_${null===(It=jt.params.nx)||void 0===It?void 0:It.id}|${null===(Dt=jt.params.ny)||void 0===Dt?void 0:Dt.id}|${null===(Ct=jt.params.nz)||void 0===Ct?void 0:Ct.id}|${null===($t=jt.params.px)||void 0===$t?void 0:$t.id}|${null===(Vt=jt.params.py)||void 0===Vt?void 0:Vt.id}|${null===(Wt=jt.params.pz)||void 0===Wt?void 0:Wt.id}`}const re="background-image";function ve(jt){var It;return"url"===jt.name?`${re}_${jt.params}`:`${re}_${null===(It=jt.params)||void 0===It?void 0:It.id}`}const ae={drawCount:(0,o.Xb)("number"),instanceCount:(0,o.Xb)("number"),aPosition:(0,o.Yz)("float32",2,0),tSkybox:(0,o.$G)("texture","rgba","ubyte","linear"),tImage:(0,o.$G)("texture","rgba","ubyte","linear"),uImageScale:(0,o.w5)("v2"),uImageOffset:(0,o.w5)("v2"),uTexSize:(0,o.w5)("v2"),uViewport:(0,o.w5)("v4"),uViewportAdjusted:(0,o.w5)("b"),uViewDirectionProjectionInverse:(0,o.w5)("m4"),uGradientColorA:(0,o.w5)("v3"),uGradientColorB:(0,o.w5)("v3"),uGradientRatio:(0,o.w5)("f"),uBlur:(0,o.w5)("f"),uOpacity:(0,o.w5)("f"),uSaturation:(0,o.w5)("f"),uLightness:(0,o.w5)("f"),uRotation:(0,o.w5)("m3"),dVariant:(0,o.$F)("string",["skybox","image","verticalGradient","horizontalGradient","radialGradient"])},ge=(0,r.NG)("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 uniform mat3 uRotation;\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, uRotation * normalize(t.xyz / t.w), uBlur * 8.0);\n #else\n gl_FragColor = textureCube(tSkybox, uRotation * 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"}),je={sharpness:i.t.Numeric(.5,{min:0,max:1,step:.05}),denoise:i.t.Boolean(!0)};class Lt{constructor(It,Dt){this.webgl=It,this.renderable=function Bt(jt,It){const Dt=It.getWidth(),Ct=It.getHeight(),$t={...e.OM,tColor:t.IQ.create(It),uTexSizeInv:t.IQ.create(c.ZY.create(1/Dt,1/Ct)),uSharpness:t.IQ.create(.5),dDenoise:t.IQ.create(!0)},Vt={...Je},Wt=(0,A.$h)(jt,"triangles",en,Vt,$t);return(0,y._)(Wt,$t)}(It,Dt)}updateState(It){const{gl:Dt,state:Ct}=this.webgl;Ct.enable(Dt.SCISSOR_TEST),Ct.disable(Dt.BLEND),Ct.disable(Dt.DEPTH_TEST),Ct.depthMask(!1);const{x:$t,y:Vt,width:Wt,height:yn}=It;Ct.viewport($t,Vt,Wt,yn),Ct.scissor($t,Vt,Wt,yn),Ct.clearColor(0,0,0,1),Dt.clear(Dt.COLOR_BUFFER_BIT)}setSize(It,Dt){t.IQ.update(this.renderable.values.uTexSizeInv,c.ZY.set(this.renderable.values.uTexSizeInv.ref.value,1/It,1/Dt))}update(It,Dt){const{values:Ct}=this.renderable,{sharpness:$t,denoise:Vt}=Dt;let Wt=!1;Ct.tColor.ref.value!==It&&(t.IQ.update(this.renderable.values.tColor,It),Wt=!0),t.IQ.updateIfChanged(Ct.uSharpness,2-2*Math.pow($t,.25)),Ct.dDenoise.ref.value!==Vt&&(Wt=!0),t.IQ.updateIfChanged(Ct.dDenoise,Vt),Wt&&this.renderable.update()}render(It,Dt){m.g$&&this.webgl.timer.mark("CasPass.render"),Dt?Dt.bind():this.webgl.unbindFramebuffer(),this.updateState(It),this.renderable.render(),m.g$&&this.webgl.timer.markEnd("CasPass.render")}}const Je={...e.du,tColor:(0,o.$G)("texture","rgba","ubyte","linear"),uTexSizeInv:(0,o.w5)("v2"),uSharpness:(0,o.w5)("f"),dDenoise:(0,o.$F)("boolean")},en=(0,r.NG)("cas",v.e,"\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");var pn=n(6049),$e=n(3770);const mt={...e.du,tDepthOpaque:(0,o.$G)("texture","rgba","ubyte","nearest"),tDepthTransparent:(0,o.$G)("texture","rgba","ubyte","nearest"),uTexSize:(0,o.w5)("v2"),dOrthographic:(0,o.$F)("number"),uNear:(0,o.w5)("f"),uFar:(0,o.w5)("f"),uInvProjection:(0,o.w5)("m4"),uOutlineThreshold:(0,o.w5)("f"),dTransparentOutline:(0,o.$F)("boolean")},Me={...e.du,tDepth:(0,o.$G)("texture","rgba","ubyte","nearest"),uTexSize:(0,o.w5)("v2"),uProjection:(0,o.w5)("m4"),uInvProjection:(0,o.w5)("m4"),uBounds:(0,o.w5)("v4"),dOrthographic:(0,o.$F)("number"),uNear:(0,o.w5)("f"),uFar:(0,o.w5)("f"),dSteps:(0,o.$F)("number"),uMaxDistance:(0,o.w5)("f"),uTolerance:(0,o.w5)("f"),uBias:(0,o.w5)("f"),uLightDirection:(0,o.w5)("v3[]"),uLightColor:(0,o.w5)("v3[]"),dLightCount:(0,o.$F)("number")},ut={...e.du,tDepth:(0,o.$G)("texture","rgba","ubyte","nearest"),tDepthHalf:(0,o.$G)("texture","rgba","ubyte","nearest"),tDepthQuarter:(0,o.$G)("texture","rgba","ubyte","nearest"),uSamples:(0,o.w5)("v3[]"),dNSamples:(0,o.$F)("number"),uProjection:(0,o.w5)("m4"),uInvProjection:(0,o.w5)("m4"),uBounds:(0,o.w5)("v4"),uTexSize:(0,o.w5)("v2"),uRadius:(0,o.w5)("f"),uBias:(0,o.w5)("f"),dMultiScale:(0,o.$F)("boolean"),dLevels:(0,o.$F)("number"),uLevelRadius:(0,o.w5)("f[]"),uLevelBias:(0,o.w5)("f[]"),uNearThreshold:(0,o.w5)("f"),uFarThreshold:(0,o.w5)("f")},sn={...e.du,tSsaoDepth:(0,o.$G)("texture","rgba","ubyte","nearest"),uTexSize:(0,o.w5)("v2"),uKernel:(0,o.w5)("f[]"),dOcclusionKernelSize:(0,o.$F)("number"),uBlurDirectionX:(0,o.w5)("f"),uBlurDirectionY:(0,o.w5)("f"),uInvProjection:(0,o.w5)("m4"),uNear:(0,o.w5)("f"),uFar:(0,o.w5)("f"),uBounds:(0,o.w5)("v4"),dOrthographic:(0,o.$F)("number")};function gt(jt,It,Dt){const Ct={...e.OM,tSsaoDepth:t.IQ.create(It),uTexSize:t.IQ.create(c.ZY.create(It.getWidth(),It.getHeight())),uKernel:t.IQ.create(yt(15)),dOcclusionKernelSize:t.IQ.create(15),uBlurDirectionX:t.IQ.create("horizontal"===Dt?1:0),uBlurDirectionY:t.IQ.create("vertical"===Dt?1:0),uInvProjection:t.IQ.create(c.$I.identity()),uNear:t.IQ.create(0),uFar:t.IQ.create(1e4),uBounds:t.IQ.create((0,c.Zb)()),dOrthographic:t.IQ.create(0)},$t={...sn},Vt=(0,r.NG)("ssao_blur",v.e,"\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 // max diff depth between two pixels\n float maxDiffViewZ = 1.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 float sampleViewZ = getViewZ(sampleDepth);\n if (abs(selfViewZ - sampleViewZ) > maxDiffViewZ) {\n continue;\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 gl_FragColor = vec4(packUnitIntervalToRG(sum / kernelSum), packedDepth);\n}\n"),Wt=(0,A.$h)(jt,"triangles",Vt,$t,Ct);return(0,y._)(Wt,Ct)}function yt(jt){const It=jt/3,Dt=Math.floor((jt+1)/2),Ct=[];for(let $t=0;$t`${jt.radius}, ${jt.bias}`,{defaultValue:[{radius:2,bias:1},{radius:5,bias:1},{radius:8,bias:1},{radius:11,bias:1}]}),nearThreshold:i.t.Numeric(10,{min:0,max:50,step:1}),farThreshold:i.t.Numeric(1500,{min:0,max:1e4,step:100})}),off:i.t.Group({})},{cycle:!0}),radius:i.t.Numeric(5,{min:0,max:20,step:.1},{description:"Final occlusion radius is 2^x",hideIf:jt=>"on"===jt?.multiScale.name}),bias:i.t.Numeric(.8,{min:0,max:3,step:.1}),blurKernelSize:i.t.Numeric(15,{min:1,max:25,step:2}),resolutionScale:i.t.Numeric(1,{min:.1,max:1,step:.05},{description:"Adjust resolution of occlusion calculation"}),color:i.t.Color((0,I.Q1)(0))}),off:i.t.Group({})},{cycle:!0,description:"Darken occluded crevices with the ambient occlusion effect"}),shadow:i.t.MappedStatic("off",{on:i.t.Group({steps:i.t.Numeric(1,{min:1,max:64,step:1}),bias:i.t.Numeric(.6,{min:0,max:1,step:.01}),maxDistance:i.t.Numeric(3,{min:0,max:256,step:1}),tolerance:i.t.Numeric(1,{min:0,max:10,step:.1})}),off:i.t.Group({})},{cycle:!0,description:"Simplistic shadows"}),outline:i.t.MappedStatic("off",{on:i.t.Group({scale:i.t.Numeric(1,{min:1,max:5,step:1}),threshold:i.t.Numeric(.33,{min:.01,max:1,step:.01}),color:i.t.Color((0,I.Q1)(0)),includeTransparent:i.t.Boolean(!0,{description:"Whether to show outline for transparent objects"})}),off:i.t.Group({})},{cycle:!0,description:"Draw outline around 3D objects"}),dof:i.t.MappedStatic("off",{on:i.t.Group(pn.w),off:i.t.Group({})},{cycle:!0,description:"DOF"}),antialiasing:i.t.MappedStatic("smaa",{fxaa:i.t.Group(u),smaa:i.t.Group(L),off:i.t.Group({})},{options:[["fxaa","FXAA"],["smaa","SMAA"],["off","Off"]],description:"Smooth pixel edges"}),sharpening:i.t.MappedStatic("off",{on:i.t.Group(je),off:i.t.Group({})},{cycle:!0,description:"Contrast Adaptive Sharpening"}),background:i.t.Group(Ve,{isFlat:!0}),bloom:i.t.MappedStatic("on",{on:i.t.Group($e.c),off:i.t.Group({})},{cycle:!0,description:"Bloom"})};class bn{static isEnabled(It){return"on"===It.occlusion.name||"on"===It.shadow.name||"on"===It.outline.name||"off"!==It.background.variant.name}static isTransparentOutlineEnabled(It){return"on"===It.outline.name&&It.outline.params.includeTransparent}calcSsaoScale(It){return Math.min(1,1/this.webgl.pixelRatio)*It}constructor(It,Dt,Ct){this.webgl=It,this.drawPass=Ct,this.bgColor=(0,c.eB)(),this.occlusionOffset=[0,0],this.transparentBackground=!1;const{colorTarget:$t,depthTextureTransparent:Vt,depthTextureOpaque:Wt}=Ct,yn=$t.getWidth(),Zt=$t.getHeight();this.nSamples=1,this.blurKernelSize=1,this.ssaoScale=this.calcSsaoScale(1),this.levels=[],this.target=It.createRenderTarget(yn,Zt,!1,"uint8","linear"),this.outlinesTarget=It.createRenderTarget(yn,Zt,!1),this.outlinesRenderable=function _t(jt,It,Dt,Ct){const $t=It.getWidth(),Vt=It.getHeight(),Wt={...e.OM,tDepthOpaque:t.IQ.create(It),tDepthTransparent:t.IQ.create(Dt),uTexSize:t.IQ.create(c.ZY.create($t,Vt)),dOrthographic:t.IQ.create(0),uNear:t.IQ.create(1),uFar:t.IQ.create(1e4),uInvProjection:t.IQ.create(c.$I.identity()),uOutlineThreshold:t.IQ.create(.33),dTransparentOutline:t.IQ.create(Ct)},yn={...mt},Zt=(0,r.NG)("outlines",v.e,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tDepthOpaque;\nuniform sampler2D tDepthTransparent;\nuniform vec2 uTexSize;\n\nuniform float uNear;\nuniform float uFar;\nuniform mat4 uInvProjection;\n\nuniform float uOutlineThreshold;\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 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 float backgroundViewZ = 2.0 * uFar;\n\n vec2 coords = gl_FragCoord.xy / uTexSize;\n vec2 invTexSize = 1.0 / uTexSize;\n\n float selfDepthOpaque = getDepthOpaque(coords);\n float selfViewZOpaque = isBackground(selfDepthOpaque) ? backgroundViewZ : getViewZ(selfDepthOpaque);\n float pixelSizeOpaque = getPixelSize(coords, selfDepthOpaque) * uOutlineThreshold;\n\n float selfDepthTransparent = getDepthTransparent(coords);\n float selfViewZTransparent = isBackground(selfDepthTransparent) ? backgroundViewZ : getViewZ(selfDepthTransparent);\n float pixelSizeTransparent = getPixelSize(coords, selfDepthTransparent) * uOutlineThreshold;\n\n float outline = 1.0;\n float bestDepth = 1.0;\n float transparentFlag = 0.0;\n\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 sampleCoords = coords + vec2(float(x), float(y)) * invTexSize;\n\n float sampleDepthOpaque = getDepthOpaque(sampleCoords);\n float sampleDepthTransparent = getDepthTransparent(sampleCoords);\n\n float sampleViewZOpaque = isBackground(sampleDepthOpaque) ? backgroundViewZ : getViewZ(sampleDepthOpaque);\n if (abs(selfViewZOpaque - sampleViewZOpaque) > 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"),kt=(0,A.$h)(jt,"triangles",Zt,yn,Wt);return(0,y._)(kt,Wt)}(It,Wt,Vt,!0),this.shadowsTarget=It.createRenderTarget(yn,Zt,!1),this.shadowsRenderable=function Ke(jt,It){const Dt=It.getWidth(),Ct=It.getHeight(),$t={...e.OM,tDepth:t.IQ.create(It),uTexSize:t.IQ.create(c.ZY.create(Dt,Ct)),uProjection:t.IQ.create(c.$I.identity()),uInvProjection:t.IQ.create(c.$I.identity()),uBounds:t.IQ.create((0,c.Zb)()),dOrthographic:t.IQ.create(0),uNear:t.IQ.create(1),uFar:t.IQ.create(1e4),dSteps:t.IQ.create(1),uMaxDistance:t.IQ.create(3),uTolerance:t.IQ.create(1),uBias:t.IQ.create(.6),uLightDirection:t.IQ.create([]),uLightColor:t.IQ.create([]),dLightCount:t.IQ.create(0)},Vt={...Me},Wt=(0,r.NG)("shadows",v.e,"\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"),yn=(0,A.$h)(jt,"triangles",Wt,Vt,$t);return(0,y._)(yn,$t)}(It,Wt),this.ssaoFramebuffer=It.resources.framebuffer(),this.ssaoBlurFirstPassFramebuffer=It.resources.framebuffer(),this.ssaoBlurSecondPassFramebuffer=It.resources.framebuffer();const kt=Math.floor(yn*this.ssaoScale),Ot=Math.floor(Zt*this.ssaoScale),An=Math.max(1,Math.floor(.5*kt)),jn=Math.max(1,Math.floor(.5*Ot)),On=Math.max(1,Math.floor(.25*kt)),fr=Math.max(1,Math.floor(.25*Ot));this.downsampledDepthTarget=Ct.packedDepth?It.createRenderTarget(kt,Ot,!1,"uint8","nearest","rgba"):It.createRenderTarget(kt,Ot,!1,"float32","nearest",It.isWebGL2?"alpha":"rgba"),this.downsampleDepthRenderable=(0,e._0)(It,Wt);const Dr=1===this.ssaoScale?Wt:this.downsampledDepthTarget.texture;this.depthHalfTarget=Ct.packedDepth?It.createRenderTarget(An,jn,!1,"uint8","nearest","rgba"):It.createRenderTarget(An,jn,!1,"float32","nearest",It.isWebGL2?"alpha":"rgba"),this.depthHalfRenderable=(0,e._0)(It,Dr),this.depthQuarterTarget=Ct.packedDepth?It.createRenderTarget(On,fr,!1,"uint8","nearest","rgba"):It.createRenderTarget(On,fr,!1,"float32","nearest",It.isWebGL2?"alpha":"rgba"),this.depthQuarterRenderable=(0,e._0)(It,this.depthHalfTarget.texture),this.ssaoDepthTexture=It.resources.texture("image-uint8","rgba","ubyte","nearest"),this.ssaoDepthTexture.define(kt,Ot),this.ssaoDepthTexture.attachFramebuffer(this.ssaoFramebuffer,"color0"),this.ssaoDepthBlurProxyTexture=It.resources.texture("image-uint8","rgba","ubyte","nearest"),this.ssaoDepthBlurProxyTexture.define(kt,Ot),this.ssaoDepthBlurProxyTexture.attachFramebuffer(this.ssaoBlurFirstPassFramebuffer,"color0"),this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer,"color0"),this.ssaoRenderable=function Kt(jt,It,Dt,Ct){const $t={...e.OM,tDepth:t.IQ.create(It),tDepthHalf:t.IQ.create(Dt),tDepthQuarter:t.IQ.create(Ct),uSamples:t.IQ.create(Gt(32)),dNSamples:t.IQ.create(32),uProjection:t.IQ.create(c.$I.identity()),uInvProjection:t.IQ.create(c.$I.identity()),uBounds:t.IQ.create((0,c.Zb)()),uTexSize:t.IQ.create(c.ZY.create(jt.gl.drawingBufferWidth,jt.gl.drawingBufferHeight)),uRadius:t.IQ.create(Math.pow(2,5)),uBias:t.IQ.create(.8),dMultiScale:t.IQ.create(!1),dLevels:t.IQ.create(3),uLevelRadius:t.IQ.create([Math.pow(2,2),Math.pow(2,5),Math.pow(2,8)]),uLevelBias:t.IQ.create([.8,.8,.8]),uNearThreshold:t.IQ.create(10),uFarThreshold:t.IQ.create(1500)},Vt={...ut},Wt=(0,r.NG)("ssao",v.e,"\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\n// adapted from https://gist.github.com/bgolus/a07ed65602c009d5e2f753826e8078a0\nvec3 viewNormalAtPixelPositionAccurate(vec2 vpos) {\n // current pixel's depth\n float c = getDepth(vpos);\n\n // get current pixel's view space position\n vec3 viewSpacePos_c = screenSpaceToViewSpace(vec3(vpos, c), uInvProjection);\n\n // get view space position at 1 pixel offsets in each major direction\n vec3 viewSpacePos_l = screenSpaceToViewSpace(vec3(vpos + vec2(-1.0, 0.0) / uTexSize, getDepth(vpos + vec2(-1.0, 0.0) / uTexSize)), uInvProjection);\n vec3 viewSpacePos_r = screenSpaceToViewSpace(vec3(vpos + vec2( 1.0, 0.0) / uTexSize, getDepth(vpos + vec2( 1.0, 0.0) / uTexSize)), uInvProjection);\n vec3 viewSpacePos_d = screenSpaceToViewSpace(vec3(vpos + vec2( 0.0,-1.0) / uTexSize, getDepth(vpos + vec2( 0.0,-1.0) / uTexSize)), uInvProjection);\n vec3 viewSpacePos_u = screenSpaceToViewSpace(vec3(vpos + vec2( 0.0, 1.0) / uTexSize, getDepth(vpos + vec2( 0.0, 1.0) / uTexSize)), uInvProjection);\n\n // get the difference between the current and each offset position\n vec3 l = viewSpacePos_c - viewSpacePos_l;\n vec3 r = viewSpacePos_r - viewSpacePos_c;\n vec3 d = viewSpacePos_c - viewSpacePos_d;\n vec3 u = viewSpacePos_u - viewSpacePos_c;\n\n // get depth values at 1 & 2 pixels offsets from current along the horizontal axis\n vec4 H = vec4(\n getDepth(vpos + vec2(-1.0, 0.0) / uTexSize),\n getDepth(vpos + vec2( 1.0, 0.0) / uTexSize),\n getDepth(vpos + vec2(-2.0, 0.0) / uTexSize),\n getDepth(vpos + vec2( 2.0, 0.0) / uTexSize)\n );\n\n // get depth values at 1 & 2 pixels offsets from current along the vertical axis\n vec4 V = vec4(\n getDepth(vpos + vec2(0.0,-1.0) / uTexSize),\n getDepth(vpos + vec2(0.0, 1.0) / uTexSize),\n getDepth(vpos + vec2(0.0,-2.0) / uTexSize),\n getDepth(vpos + vec2(0.0, 2.0) / uTexSize)\n );\n\n // current pixel's depth difference from slope of offset depth samples\n // differs from original article because we're using non-linear depth values\n // see article's comments\n vec2 he = abs((2.0 * H.xy - H.zw) - c);\n vec2 ve = abs((2.0 * V.xy - V.zw) - c);\n\n // pick horizontal and vertical diff with the smallest depth difference from slopes\n vec3 hDeriv = he.x < he.y ? l : r;\n vec3 vDeriv = ve.x < ve.y ? d : u;\n\n // get view space normal from the cross product of the best derivatives\n vec3 viewNormal = normalize(cross(hDeriv, vDeriv));\n\n return viewNormal;\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 vec3 selfViewNormal = viewNormalAtPixelPositionAccurate(selfCoords);\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 // get sample position:\n vec3 sampleViewPos = TBN * uSamples[i];\n sampleViewPos = selfViewPos + sampleViewPos * uLevelRadius[l];\n\n // project sample position:\n vec4 offset = vec4(sampleViewPos, 1.0);\n offset = uProjection * offset;\n offset.xyz = (offset.xyz / offset.w) * 0.5 + 0.5;\n\n // get sample depth:\n float sampleDepth = getMappedDepth(offset.xy, selfCoords);\n float sampleViewZ = screenSpaceToViewSpace(vec3(offset.xy, sampleDepth), uInvProjection).z;\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"),yn=(0,A.$h)(jt,"triangles",Wt,Vt,$t);return(0,y._)(yn,$t)}(It,Dr,this.depthHalfTarget.texture,this.depthQuarterTarget.texture),this.ssaoBlurFirstPassRenderable=gt(It,this.ssaoDepthTexture,"horizontal"),this.ssaoBlurSecondPassRenderable=gt(It,this.ssaoDepthBlurProxyTexture,"vertical"),this.renderable=function tt(jt,It,Dt,Ct,$t,Vt,Wt,yn){const Zt={...e.OM,tSsaoDepth:t.IQ.create(Wt),tColor:t.IQ.create(It),tDepthOpaque:t.IQ.create(Dt),tDepthTransparent:t.IQ.create(Ct),tShadows:t.IQ.create($t),tOutlines:t.IQ.create(Vt),uTexSize:t.IQ.create(c.ZY.create(It.getWidth(),It.getHeight())),dOrthographic:t.IQ.create(0),uNear:t.IQ.create(1),uFar:t.IQ.create(1e4),uFogNear:t.IQ.create(1e4),uFogFar:t.IQ.create(1e4),uFogColor:t.IQ.create(c.eB.create(1,1,1)),uOutlineColor:t.IQ.create(c.eB.create(0,0,0)),uOcclusionColor:t.IQ.create(c.eB.create(0,0,0)),uTransparentBackground:t.IQ.create(!1),dOcclusionEnable:t.IQ.create(!0),uOcclusionOffset:t.IQ.create(c.ZY.create(0,0)),dShadowEnable:t.IQ.create(!1),dOutlineEnable:t.IQ.create(!1),dOutlineScale:t.IQ.create(1),dTransparentOutline:t.IQ.create(yn)},kt={...rn},Ot=(0,r.NG)("postprocessing",v.e,"\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"),An=(0,A.$h)(jt,"triangles",Ot,kt,Zt);return(0,y._)(An,Zt)}(It,$t.texture,Wt,Vt,this.shadowsTarget.texture,this.outlinesTarget.texture,this.ssaoDepthTexture,!0),this.background=new Ne(It,Dt,yn,Zt)}setSize(It,Dt){const[Ct,$t]=this.renderable.values.uTexSize.ref.value,Vt=this.calcSsaoScale(1);if(It!==Ct||Dt!==$t||this.ssaoScale!==Vt){this.ssaoScale=Vt,this.target.setSize(It,Dt),this.outlinesTarget.setSize(It,Dt),this.shadowsTarget.setSize(It,Dt);const Wt=Math.floor(It*this.ssaoScale),yn=Math.floor(Dt*this.ssaoScale);this.downsampledDepthTarget.setSize(Wt,yn),this.ssaoDepthTexture.define(Wt,yn),this.ssaoDepthBlurProxyTexture.define(Wt,yn);const Zt=Math.max(1,Math.floor(.5*Wt)),kt=Math.max(1,Math.floor(.5*yn));this.depthHalfTarget.setSize(Zt,kt);const Ot=Math.max(1,Math.floor(.25*Wt)),An=Math.max(1,Math.floor(.25*yn));this.depthQuarterTarget.setSize(Ot,An),t.IQ.update(this.renderable.values.uTexSize,c.ZY.set(this.renderable.values.uTexSize.ref.value,It,Dt)),t.IQ.update(this.outlinesRenderable.values.uTexSize,c.ZY.set(this.outlinesRenderable.values.uTexSize.ref.value,It,Dt)),t.IQ.update(this.shadowsRenderable.values.uTexSize,c.ZY.set(this.shadowsRenderable.values.uTexSize.ref.value,It,Dt)),t.IQ.update(this.downsampleDepthRenderable.values.uTexSize,c.ZY.set(this.downsampleDepthRenderable.values.uTexSize.ref.value,Wt,yn)),t.IQ.update(this.depthHalfRenderable.values.uTexSize,c.ZY.set(this.depthHalfRenderable.values.uTexSize.ref.value,Zt,kt)),t.IQ.update(this.depthQuarterRenderable.values.uTexSize,c.ZY.set(this.depthQuarterRenderable.values.uTexSize.ref.value,Ot,An)),t.IQ.update(this.ssaoRenderable.values.uTexSize,c.ZY.set(this.ssaoRenderable.values.uTexSize.ref.value,Wt,yn)),t.IQ.update(this.ssaoBlurFirstPassRenderable.values.uTexSize,c.ZY.set(this.ssaoBlurFirstPassRenderable.values.uTexSize.ref.value,Wt,yn)),t.IQ.update(this.ssaoBlurSecondPassRenderable.values.uTexSize,c.ZY.set(this.ssaoBlurSecondPassRenderable.values.uTexSize.ref.value,Wt,yn));const jn=1===this.ssaoScale?this.drawPass.depthTextureOpaque:this.downsampledDepthTarget.texture;t.IQ.update(this.depthHalfRenderable.values.tColor,jn),t.IQ.update(this.ssaoRenderable.values.tDepth,jn),this.depthHalfRenderable.update(),this.ssaoRenderable.update(),this.background.setSize(It,Dt)}}updateState(It,Dt,Ct,$t,Vt){var Wt;let yn=!1,Zt=!1,kt=!1,Ot=!1,An=!1,jn=!1;const On="orthographic"===It.state.mode?1:0,fr="on"===$t.outline.name,Dr="on"===$t.shadow.name,Pr="on"===$t.occlusion.name,or=c.$I.identity();c.$I.invert(or,It.projection);const[Nr,Ir]=this.renderable.values.uTexSize.ref.value,Or=It.viewport;if("on"===$t.occlusion.name){t.IQ.update(this.ssaoRenderable.values.uProjection,It.projection),t.IQ.update(this.ssaoRenderable.values.uInvProjection,or);const un=this.ssaoRenderable.values.uBounds,ct=this.ssaoScale;c.Zb.set(un.ref.value,Math.floor(Or.x*ct)/(Nr*ct),Math.floor(Or.y*ct)/(Ir*ct),Math.ceil((Or.x+Or.width)*ct)/(Nr*ct),Math.ceil((Or.y+Or.height)*ct)/(Ir*ct)),t.IQ.update(un,un.ref.value),t.IQ.update(this.ssaoBlurFirstPassRenderable.values.uBounds,un.ref.value),t.IQ.update(this.ssaoBlurSecondPassRenderable.values.uBounds,un.ref.value),t.IQ.updateIfChanged(this.ssaoBlurFirstPassRenderable.values.uNear,It.near),t.IQ.updateIfChanged(this.ssaoBlurSecondPassRenderable.values.uNear,It.near),t.IQ.updateIfChanged(this.ssaoBlurFirstPassRenderable.values.uFar,It.far),t.IQ.updateIfChanged(this.ssaoBlurSecondPassRenderable.values.uFar,It.far),t.IQ.update(this.ssaoBlurFirstPassRenderable.values.uInvProjection,or),t.IQ.update(this.ssaoBlurSecondPassRenderable.values.uInvProjection,or),this.ssaoBlurFirstPassRenderable.values.dOrthographic.ref.value!==On&&(Ot=!0,t.IQ.update(this.ssaoBlurFirstPassRenderable.values.dOrthographic,On),t.IQ.update(this.ssaoBlurSecondPassRenderable.values.dOrthographic,On)),this.nSamples!==$t.occlusion.params.samples&&(kt=!0,this.nSamples=$t.occlusion.params.samples,t.IQ.update(this.ssaoRenderable.values.uSamples,Gt(this.nSamples)),t.IQ.updateIfChanged(this.ssaoRenderable.values.dNSamples,this.nSamples));const dt="on"===$t.occlusion.params.multiScale.name;if(this.ssaoRenderable.values.dMultiScale.ref.value!==dt&&(kt=!0,t.IQ.update(this.ssaoRenderable.values.dMultiScale,dt)),"on"===$t.occlusion.params.multiScale.name){const cn=$t.occlusion.params.multiScale.params;if(!(0,t.bD)(this.levels,cn.levels)){kt=!0,this.levels=cn.levels;const xn=function nn(jt,It){const Dt=jt.length,{radius:Ct,bias:$t}=It||{radius:new Array(3*Dt).fill(0),bias:new Array(3*Dt).fill(0)};jt=jt.slice().sort((Vt,Wt)=>Vt.radius-Wt.radius);for(let Vt=0;Vt{"use strict";n.d(Ue,{H5:()=>r,PG:()=>A});var e=n(467);function r(c,i,v=1){let O=window.innerWidth,b=window.innerHeight;i!==document.body&&(O=i.offsetWidth,b=i.offsetHeight),function o(c,i,v,O=1){c.width=Math.round(window.devicePixelRatio*O*i),c.height=Math.round(window.devicePixelRatio*O*v),Object.assign(c.style,{width:`${i}px`,height:`${v}px`})}(c,O,b,v)}function A(c,i,v){return y.apply(this,arguments)}function y(){return(y=(0,e.A)(function*(c,i,v){return new Promise((O,b)=>{const _=M=>{M?O(M):b("no blob returned")};HTMLCanvasElement.prototype.toBlob?c.toBlob(_,i,v):function t(c,i,v,O){const b=atob(c.toDataURL(v,O).split(",")[1]),_=b.length,M=_>>2,I=new Uint8Array(_),l=new Uint32Array(I.buffer,0,M);let m=0;for(let d=0;d{"use strict";n.d(Ue,{VP:()=>O,iu:()=>e,Wm:()=>w,XI:()=>L});var e={};function o(Q,G){return{start:G&&typeof G.start<"u"?Math.max(Math.min(G.start,Q-1),0):0,end:G&&typeof G.end<"u"?Math.min(G.end,Q):Q}}function r(Q,G){const V=G&&typeof G.array<"u"?G.array:Array,{start:U,end:N}=o(Q,G);return{array:new V(N-U),start:U,end:N}}function t(Q,G,V){for(let U=0,N=G.length;UA,createArray:()=>r,fillArrayValues:()=>t,getArrayBounds:()=>o,isTypedArray:()=>y,typedArrayWindow:()=>c});var O,i=n(4369),v=n(2025);function M(Q,G,V,U){return{schema:V,__array:void 0,isDefined:0===U,rowCount:G,value:k=>Q,valueKind:k=>U,toArray:k=>{const{array:H}=r(G,k);for(let $=0,J=H.length;$!0}}function I({value:Q,valueKind:G,areValuesEqual:V,rowCount:U,schema:N}){return{schema:N,__array:void 0,isDefined:!0,rowCount:U,value:Q,valueKind:G||(k=>0),toArray:k=>{const{array:H,start:$}=r(U,k);for(let J=0,W=H.length;JQ(k)===Q(H))}}function l({array:Q,schema:G,valueKind:V}){const U=Q.length,N=G.T,k="str"===G.valueType?"lowercase"===G.transform?$=>{const J=Q[$];return"string"==typeof J?J.toLowerCase():`${J??N}`.toLowerCase()}:"uppercase"===G.transform?$=>{const J=Q[$];return"string"==typeof J?J.toUpperCase():`${J??N}`.toUpperCase()}:$=>{const J=Q[$];return"string"==typeof J?J:`${J??N}`}:$=>Q[$],H=y(Q);return{schema:G,__array:Q,isDefined:!0,rowCount:U,value:k,valueKind:V||($=>0),toArray:"str"===G.valueType?"lowercase"===G.transform?$=>{const{start:J,end:W}=o(U,$),te=new($&&typeof $.array<"u"?$.array:Q.constructor)(W-J);for(let de=0,ye=W-J;de{const{start:J,end:W}=o(U,$),te=new($&&typeof $.array<"u"?$.array:Q.constructor)(W-J);for(let de=0,ye=W-J;de{const{start:J,end:W}=o(U,$),te=new($&&typeof $.array<"u"?$.array:Q.constructor)(W-J);for(let de=0,ye=W-J;dec(Q,$):$=>{const{start:J,end:W}=o(U,$);if(0===J&&W===Q.length)return Q;const te=new($&&typeof $.array<"u"?$.array:Q.constructor)(W-J);for(let de=0,ye=W-J;deQ[$]===Q[J]}}!function(Q){let G;function U(ke,we){return M(we.T,ke,we,1)}function k(ke){return I(ke)}!function(ke){function Ve(Te,ie=ke.float){return{"@type":"tensor",T:Te.create(),space:Te,valueType:"tensor",baseType:ie}}ke.str={"@type":"str",T:"",valueType:"str"},ke.ustr={"@type":"str",T:"",valueType:"str",transform:"uppercase"},ke.lstr={"@type":"str",T:"",valueType:"str",transform:"lowercase"},ke.int={"@type":"int",T:0,valueType:"int"},ke.coord={"@type":"coord",T:0,valueType:"float"},ke.float={"@type":"float",T:0,valueType:"float"},ke.Str=function we(Te){var ie;return{"@type":"str",T:null!==(ie=Te?.defaultValue)&&void 0!==ie?ie:"",transform:Te?.transform,valueType:"str"}},ke.Int=function Oe(Te=0){return{"@type":"int",T:Te,valueType:"int"}},ke.Float=function Se(Te=0){return{"@type":"float",T:Te,valueType:"float"}},ke.Tensor=Ve,ke.Vector=function Ne(Te,ie=ke.float){return Ve(i.qY.Vector(Te,"int"===ie["@type"]?Int32Array:Float64Array),ie)},ke.Matrix=function K(Te,ie,ue=ke.float){return Ve(i.qY.ColumnMajorMatrix(Te,ie,"int"===ue["@type"]?Int32Array:Float64Array),ue)},ke.Aliased=function ne(Te){return Te},ke.List=function be(Te,ie,ue=[]){return{"@type":"list",T:ue,separator:Te,itemParse:ie,valueType:"list"}}}(G=Q.Schema||(Q.Schema={})),Q.is=function V(ke){return!!ke&&!!ke.schema&&!!ke.value},Q.ValueKind={Present:0,NotPresent:1,Unknown:2},Q.Undefined=U,Q.ofConst=function N(ke,we,Oe){return M(ke,we,Oe,0)},Q.ofLambda=k,Q.range=function H(ke,we){return k({value:Oe=>Oe+ke,rowCount:Math.max(we-ke+1,0),schema:G.int})},Q.ofArray=function $(ke){return l(ke)},Q.ofIntArray=function J(ke){return l({array:ke,schema:G.int})},Q.ofFloatArray=function W(ke){return l({array:ke,schema:G.float})},Q.ofStringArray=function te(ke){return l({array:ke,schema:G.str})},Q.ofStringAliasArray=function de(ke){return l({array:ke,schema:G.Aliased(G.str)})},Q.ofStringListArray=function ye(ke,we=","){return l({array:ke,schema:G.List(we,Oe=>Oe)})},Q.ofIntTokens=function j(ke){const{count:we,data:Oe,indices:Se}=ke;return I({value:Ve=>(0,v.H9)(Oe,Se[2*Ve],Se[2*Ve+1])||0,rowCount:we,schema:G.int})},Q.ofFloatTokens=function Z(ke){const{count:we,data:Oe,indices:Se}=ke;return I({value:Ve=>(0,v.sS)(Oe,Se[2*Ve],Se[2*Ve+1])||0,rowCount:we,schema:G.float})},Q.ofStringTokens=function q(ke){const{count:we,data:Oe,indices:Se}=ke;return I({value:Ve=>{const Ne=Oe.substring(Se[2*Ve],Se[2*Ve+1]);return"."===Ne||"?"===Ne?"":Ne},rowCount:we,schema:G.str})},Q.window=function Y(ke,we,Oe){return function m(Q,G,V){return Q.isDefined?0===G&&V===Q.rowCount?Q:Q.__array&&y(Q.__array)?function u(Q,G,V){const U=c(Q.__array,{start:G,end:V}),N=Q.valueKind;return l({array:U,schema:Q.schema,valueKind:k=>N(G+k)})}(Q,G,V):function d(Q,G,V){const U=Q.value,N=Q.valueKind,k=Q.areValuesEqual,H=0===G?U:J=>U(J+G),$=V-G;return{schema:Q.schema,__array:void 0,isDefined:Q.isDefined,rowCount:$,value:H,valueKind:0===G?N:J=>N(J+G),toArray:J=>{const{array:W}=r($,J);for(let te=0,de=W.length;tek(J+G,W+G)}}(Q,G,V):O.Undefined(V-G,Q.schema)}(ke,we,Oe)},Q.view=function ee(ke,we,Oe=!0){return function C(Q,G,V){return 0===Q.rowCount||V&&function s(Q,G){if(Q.length!==G)return!1;for(let V=0,U=Q.length;VN(G[k])})}(Q,G):function a(Q,G){const V=Q.value,U=Q.valueKind,N=Q.areValuesEqual,H=G.length;return{schema:Q.schema,__array:void 0,isDefined:Q.isDefined,rowCount:H,value:$=>V(G[$]),valueKind:$=>U(G[$]),toArray:$=>{const{array:J}=r(H,$);for(let W=0,te=J.length;WN(G[$],G[J])}}(Q,G)}(ke,we,Oe)},Q.createFirstIndexMap=function g(ke){return function b(Q){const G=new Map;for(let V=0,U=Q.rowCount;VG.has(V)?G.get(V):-1}(ke)},Q.mapToArray=function xe(ke,we,Oe){return function S(Q,G,V){const U=new V(Q.rowCount);for(let N=0,k=Q.rowCount;Nle[ke][Re],valueKind:ke=>typeof le[ke][Re]>"u"?1:0});return Ae},Q.ofArrays=function $(xe,le){var Ae;const Be=Object.create(null),Ce=Object.keys(xe);Be._rowCount=0,Be._columns=Ce,Be._schema=xe;for(const Re of Ce)typeof le[Re]<"u"?(Be[Re]=O.ofArray({array:le[Re],schema:xe[Re]}),Be._rowCount=null===(Ae=le[Re])||void 0===Ae?void 0:Ae.length):Be[Re]=O.Undefined(Be._rowCount,xe[Re]);return Be},Q.view=J,Q.pick=function W(xe,le,Ae){const Be=[];for(let Ce=0,Re=xe._rowCount;Cele(ke,we));let Be=!0;for(let Re=0,ke=Ae.length;Re{"use strict";n.d(Ue,{bw:()=>o,wl:()=>r,th:()=>y});class e{add(i){const v=this.getHash(i);if(this.byHash.has(v)){const O=this.byHash.get(v);for(let b=0,_=O.length;b<_;b++)if(this.areEqual(i,O[b]))return!1;return O[O.length]=i,this.size++,!0}return this.byHash.set(v,[i]),this.size++,!0}has(i){const v=this.getHash(i);if(!this.byHash.has(v))return!1;const O=this.byHash.get(v);for(let b=0,_=O.length;b<_;b++)if(this.areEqual(i,O[b]))return!0;return!1}constructor(i,v){this.getHash=i,this.areEqual=v,this.size=0,this.byHash=new Map}}function o(c,i){return new e(c,i)}function r(){return new A}function t(c){return{previous:null,next:null,inList:!0,value:c}}class A{constructor(){this.count=0,this.first=null,this.last=null}addFirst(i){const v=t(i);return v.inList=!0,this.first&&(this.first.previous=v),v.next=this.first,this.first=v,this.count++,this.last||(this.last=v),v}addLast(i){const v=t(i);return null!==this.last&&(this.last.next=v),v.previous=this.last,this.last=v,null===this.first&&(this.first=v),v.inList=!0,this.count++,v}removeFirst(){const i=this.first;if(i)return this.remove(i),i.value}removeLast(){const i=this.last;if(i)return this.remove(i),i.value}remove(i){i.inList&&(i.inList=!1,null!==i.previous?i.previous.next=i.next:null===i.previous&&(this.first=i.next),null!==i.next?i.next.previous=i.previous:null===i.next&&(this.last=i.previous),i.next=null,i.previous=null,this.count--)}find(i){let v=this.first;for(;null!==v;){if(v.value===i)return v;v=v.next}}}var y,c;(c=y||(y={})).create=function i(){return{keys:new Set,array:[]}},c.add=function v({keys:b,array:_},M,I){return!b.has(M)&&(b.add(M),_[_.length]=I,!0)},c.has=function O({keys:b},_){return b.has(_)}},3543:(tn,Ue,n)=>{"use strict";n.d(Ue,{Yz:()=>v,IX:()=>e.I,YB:()=>y,CD:()=>o.C,hT:()=>r.h,SortedArray:()=>t.X});var e=n(7103),o=n(5100),r=n(2928),t=n(1839);function y(b){return new c(b)}n(3370);class c{remove(_){const{prev:M,next:I}=this,l=M[_],m=I[_];l>=0&&(I[l]=m,M[_]=-1),m>=0&&(M[m]=l,I[_]=-1),_===this.head&&(this.head=l<0?m:l)}has(_){return this.prev[_]>=0||this.next[_]>=0||this.head===_}constructor(_){this.head=_>0?0:-1,this.prev=new Int32Array(_),this.next=new Int32Array(_);for(let M=0;M<_;M++)this.next[M]=M+1,this.prev[M]=M-1;this.prev[0]=-1,this.next[_-1]=-1}}var v,i=n(8382);!function(b){function M(){return new Map}b.Empty=new Map,b.keyArray=function _(u){return(0,i.ZR)(u.keys())},b.Mutable=M,b.asImmutable=function I(u){return u},b.copy=function l(u){const d=M(),s=u.keys();for(;;){const{done:C,value:h}=s.next();if(C)break;d.set(h,u.get(h))}return d},b.addFrom=function m(u,d){const s=d.keys();for(;;){const{done:C,value:h}=s.next();if(C)break;u.set(h,d.get(h))}return u}}(v||(v={})),n(862)},7103:(tn,Ue,n)=>{"use strict";n.d(Ue,{I:()=>R});var e=n(3370);const o=e.U.Zero;function r(f,p){return e.U.create(f,p0&&T>0&&O(f)>=v(p)&&v(f)<=O(p)}function C(f,p){const E=c(f);if(p<=E)return 0;const T=i(f);return p>=T?T-E:p-E}function a(f,p,E){return t(C(f,p),C(f,E+1))}var R,f;(f=R||(R={})).Empty=o,f.ofSingleton=p=>r(p,p),f.ofRange=r,f.ofBounds=t,f.ofLength=function A(f){return e.U.create(0,f<0?0:f)},f.is=y,f.has=function I(f,p){return e.U.fst(f)<=p&&p=E&&p=i(p):0===b(p)},f.findPredecessorIndex=C,f.findPredecessorIndexInInterval=function h(f,p,E){const T=c(E),L=c(f);if(p<=T+L)return T;const w=i(E);return p>=w+L?w:p-L},f.findRange=a,f.intersectionSize=function D(f,p){return b(a(f,v(p),O(p)))},f.intersect=function S(f,p){return d(f,p)?t(Math.max(c(f),c(p)),Math.min(i(f),i(p))):o}},5100:(tn,Ue,n)=>{"use strict";n.d(Ue,{C:()=>ye});var e=n(1839),o=n(7103);const r=o.I.Empty,t=o.I.ofSingleton,A=o.I.ofRange,y=o.I.ofBounds;function c(j){return j.length?e.X.isRange(j)?o.I.ofRange(j[0],j[j.length-1]):j:r}function i(j){return o.I.is(j)?o.I.size(j):e.X.size(j)}function b(j,Z){return o.I.is(j)?o.I.getAt(j,Z):j[Z]}function _(j){return o.I.is(j)?o.I.min(j):e.X.min(j)}function M(j){return o.I.is(j)?o.I.max(j):e.X.max(j)}function E(j,Z){return o.I.size(j)===e.X.size(Z)&&o.I.start(j)===e.X.start(Z)&&o.I.end(j)===e.X.end(Z)}function T(j,Z){return 0!==j.length&&0!==o.I.size(e.X.findRange(j,o.I.min(Z),o.I.max(Z)))}function U(j,Z){const q=o.I.size(Z);if(!q)return j;if(function G(j,Z){return i(j)?!i(Z)||_(j)<=_(Z)&&M(j)>=M(Z):0===i(Z)}(Z,j))return Z;const Y=o.I.min(Z),ee=o.I.max(Z),g=e.X.findRange(j,Y,ee),_e=o.I.start(g),xe=o.I.end(g),le=new Int32Array(_e+(j.length-xe)+q);let Ae=0;for(let Be=0;Be<_e;Be++)le[Ae++]=j[Be];for(let Be=Y;Be<=ee;Be++)le[Ae++]=Be;for(let Be=xe,Ce=j.length;Be=q&&g<=Y}(j,Z):o.I.is(Z)?function L(j,Z){const q=o.I.min(Z),Y=o.I.max(Z);if(Y-q+1==0)return!0;const ee=e.X.min(j),g=e.X.max(j);if(qg)return!1;const _e=e.X.findRange(j,q,Y);return o.I.size(_e)===o.I.size(Z)}(j,Z):e.X.isSubset(j,Z)},j.union=function R(j,Z){return o.I.is(j)?o.I.is(Z)?function V(j,Z){if(o.I.areEqual(j,Z))return j;const q=o.I.size(j),Y=o.I.size(Z);if(!Y)return j;if(!q)return Z;const ee=o.I.min(j),g=o.I.min(Z);if(function Q(j,Z){const q=i(j),Y=i(Z);return 0===q&&0===Y||q>0&&Y>0&&M(j)>=_(Z)&&_(j)<=M(Z)}(j,Z))return o.I.ofRange(Math.min(ee,g),Math.max(o.I.max(j),o.I.max(Z)));let _e,xe,le,Ae;eewe||(le++,Be++),Ce++)}if(0===le)return r;if(le===ee&&le===g)return j;const Re=new Int32Array(le);for(Ae=0,Be=0,Ce=_e;Bewe||(Re[Ae++]=Ce,Be++),Ce++)}return c(Re)},j.subtract=function p(j,Z){return o.I.is(j)?o.I.is(Z)?function H(j,Z){if(o.I.areEqual(j,Z))return r;if(!o.I.areIntersecting(j,Z))return j;const q=o.I.min(j),Y=o.I.max(j),ee=o.I.min(Z),g=o.I.max(Z);if(Yle.push(Ae)),le},j.toString=function _e(xe){return function u(j){return o.I.is(j)?o.I.toString(j):e.X.toString(j)}(xe)}},2928:(tn,Ue,n)=>{"use strict";n.d(Ue,{h:()=>b});var b,_,e=n(5100),o=n(7103),r=n(1839);function t(_){const M=r.X.ofSortedArray(_),I=r.X.max(M),l=new Int32Array(I);for(let m=0,u=_.length-1;m=this.segmentMin&&o.I.size(this.setRange)>0;break}this.updateSegmentRange()}return this.value}updateValue(){const I=e.C.findPredecessorIndexInInterval(this.set,this.segments[this.segmentMin+1],this.setRange);return this.value.start=o.I.start(this.setRange),this.value.end=I,this.setRange=o.I.ofBounds(I,o.I.end(this.setRange)),I>this.value.start}updateSegmentRange(){const M=o.I.min(this.setRange),I=o.I.max(this.setRange);I=this.segmentMin)}setSegment(M){this.setRange=o.I.ofBounds(M.start,M.end),this.updateSegmentRange()}constructor(M,I,l,m){this.segments=M,this.segmentMap=I,this.set=l,this.segmentMin=0,this.segmentMax=0,this.setRange=o.I.Empty,this.value={index:0,start:0,end:0},this.hasNext=!1,this.setRange=m,this.updateSegmentRange()}}(_=b||(b={})).create=t,_.ofOffsets=function A(_,M){const I=o.I.start(M),l=new Int32Array(_.length+1);for(let m=0,u=_.length;m=e.C.max(_)?-1:e.C.findPredecessorIndex(_,I-1);return e.C.findRange(M,e.C.getAt(_,m),e.C.getAt(_,m+1)-1)},_.transientSegments=function O(_,M,I){const l=typeof I<"u"?o.I.ofBounds(I.start,I.end):o.I.ofBounds(0,e.C.size(M));return new v(_.offsets,_.index,M,l)}},1839:(tn,Ue,n)=>{"use strict";n.d(Ue,{X:()=>J});var e=n(8382),o=n(7103);const r=[];function c(W,te){if(teW[de-1]?de:p(W,te,0,de)}function f(W,te,de,ye){let j=de,Z=ye-1;for(;j<=Z;){if(j+11>Z){for(let ee=j;ee<=Z;ee++)if(te===W[ee])return ee;return-1}const q=j+Z>>1,Y=W[q];if(teY))return q;j=q+1}}return-1}function p(W,te,de,ye){let j=de,Z=ye-1;for(;jZ){for(let ee=j;ee<=Z;ee++)if(te<=W[ee])return ee;return Z+1}const q=j+Z>>1,Y=W[q];if(teY))return q;j=q+1}}return j>Z?Z+1:W[j]>=te?j:j+1}function G(W,te,de,ye,j,Z){let q=de,Y=ye,ee=0;for(;q_e?Y++:(q++,Y++,ee++)}return ee}const H={startI:0,startJ:0,endI:0,endJ:0};function $(W,te){const de=W.length,ye=te.length,j=de/ye;return de>=128||ye>=128||j<=.34||j>=2.99?(H.startI=S(W,O(te)),H.startJ=S(te,O(W)),H.endI=S(W,b(te)),H.endJ=S(te,b(W))):(H.startI=0,H.startJ=0,H.endI=de,H.endJ=ye),H}var J,W;(W=J||(J={})).Empty=r,W.ofUnsortedArray=function y(W){return(0,e.eh)(W),W},W.ofSingleton=function t(W){return[W]},W.ofSortedArray=function A(W){return W},W.ofRange=c,W.ofBounds=(te,de)=>c(te,de-1),W.is=function i(W){return W&&(Array.isArray(W)||!!W.buffer)},W.isRange=v,W.has=function C(W,te){return u(W,te)>=0},W.indexOf=u,W.indexOfInInterval=function d(W,te,de){return s(W,te,o.I.start(de),o.I.end(de))},W.indexOfInRange=s,W.start=O,W.end=b,W.min=function _(W){return W[0]},W.max=function M(W){return W[W.length-1]},W.size=I,W.hashCode=function l(W){const te=W.length;return te?te>2?(0,e.hX)(te,W[0],W[te-1],W[te>>1]):(0,e.CP)(te,W[0],W[te-1]):0},W.toString=function m(W){const te=W.length;return te>5?`[${W[0]}, ${W[1]}, ..., ${W[te-1]}], length ${te}`:`[${W.join(", ")}]`},W.areEqual=a,W.areIntersecting=function T(W,te){if(W===te)return!0;let{startI:de,startJ:ye,endI:j,endJ:Z}=$(W,te);for(;deY))return!0;ye++}}return!1},W.isSubset=function L(W,te){if(W===te)return!0;const de=te.length;let{startI:ye,startJ:j,endI:Z,endJ:q}=$(W,te);if(q-jg?j++:(ye++,j++,Y++)}return Y===de},W.union=function w(W,te){if(W===te)return W;const de=W.length,ye=te.length;if(0===de)return te;if(0===ye)return W;if(W[0]>te[0])return w(te,W);const{startI:j,startJ:Z,endI:q,endJ:Y}=$(W,te),ee=G(W,te,j,Z,q,Y);if(ee===de&&ee===ye||ee===ye)return W;if(ee===de)return te;const g=new Int32Array(de+ye-ee);let _e=0,xe=0,le=0;for(_e=0;_ete[xe];)g[le++]=te[xe++];for(;_eBe?(g[le++]=Be,xe++):(g[le++]=Ae,_e++,xe++)}for(;_eBe||(g[_e++]=Ae,xe++),le++)}return g},W.subtract=function U(W,te){if(W===te)return r;const de=W.length,{startI:ye,startJ:j,endI:Z,endJ:q}=$(W,te);let Y=ye,ee=j,g=0;for(;YAe?ee++:(Y++,ee++,g++)}if(!g)return W;if(g>=de)return r;const _e=new Int32Array(de-g);let xe=0;for(let le=0;leAe||Y++,ee++)}for(;Yye&&te>W[j-1]?j:te-Z<=11?function E(W,te,de,ye){for(let j=de;jAe?Y++:(q++,Y++,ee++)}if(!ee)return r;if(ee===W.length)return(0,e.vc)(0,W.length-1);const _e=new Int32Array(ee);let xe=0;for(q=de,Y=ye;qAe||(_e[xe++]=q,q++),Y++)}return _e}},5734:(tn,Ue,n)=>{"use strict";n.d(Ue,{m:()=>o});var o,e=n(3543);!function(r){function i(S){return S[S.length-1]}function O(S){return S.length/2}function b(S,D){return S[2*D]}function _(S,D){return S[2*D+1]+1}function M(S,D){return S[2*D]}function I(S,D){return S[2*D+1]}function s(S,D){return C(S,D,0)}function C(S,D,R){if(M(S,R)>e.CD.max(D)||i(S){"use strict";n.d(Ue,{U:()=>o});var o,e=n(8382);!function(r){r.Zero=0;const{_int32:t,_float64:A,_int32_1:y,_float64_1:c}=function(){const d=new ArrayBuffer(8),s=new ArrayBuffer(8);return{_int32:new Int32Array(d),_float64:new Float64Array(d),_int32_1:new Int32Array(s),_float64_1:new Float64Array(s)}}();r.is=function i(d){return"number"==typeof d},r.create=function v(d,s){return t[0]=d,t[1]=s,A[0]},r.diff=function O(d){return A[0]=d,t[1]-t[0]},r.fst=function b(d){return A[0]=d,t[0]},r.snd=function _(d){return A[0]=d,t[1]},r.areEqual=function M(d,s){return A[0]=d,c[0]=s,t[0]===y[0]&&t[1]===y[1]},r.compare=function I(d,s){A[0]=d,c[0]=s;const C=t[0]-y[0];return 0!==C?C:t[1]-y[1]},r.compareInArray=function l(d,s,C){A[0]=d[s],c[0]=d[C];const h=t[0]-y[0];return 0!==h?h:t[1]-y[1]},r.hashCode=function m(d){return A[0]=d,(0,e.vb)(t[0],t[1])},r.toString=function u(d){return A[0]=d,`(${t[0]}, ${t[1]})`}}(o||(o={}))},862:(tn,Ue,n)=>{"use strict";n.d(Ue,{f:()=>y});class e{move(){return++this.index,this.lastValue=this.xs[this.index],this.hasNext=this.index0,this.xs=i,this.index=-1,this.lastValue=i.length>0?i[0]:void 0}}class o{move(){return++this.value,this.hasNext=this.value=i}}class r{move(){return this.hasNext=!1,this.value}constructor(i){this.value=i,this.hasNext=!0}}class t{move(){const i=this.f(this.base.move());return this.hasNext=this.base.hasNext,i}constructor(i,v){this.base=i,this.f=v,this.hasNext=!1,this.hasNext=i.hasNext}}class A{move(){const i=this.next;return this.hasNext=this.findNext(),i}findNext(){for(;this.base.hasNext;)if(this.next=this.base.move(),this.p(this.next))return!0;return!1}constructor(i,v){this.base=i,this.p=v,this.hasNext=this.findNext()}}var y,c;(c=y||(y={})).Empty=new o(0,-1),c.Array=function i(I){return new e(I)},c.Value=function v(I){return new r(I)},c.Range=function O(I,l){return new o(I,l)},c.map=function b(I,l){return new t(I,l)},c.filter=function _(I,l){return new A(I,l)},c.forEach=function M(I,l,m){for(;I.hasNext;)if(l(I.move(),m))return m;return m}},8382:(tn,Ue,n)=>{"use strict";var e;n.d(Ue,{Gm:()=>e,BI:()=>c,L9:()=>h,qI:()=>D,VE:()=>o.VE,m1:()=>M,vc:()=>S,C_:()=>i,vb:()=>v,CP:()=>O,hX:()=>b,TI:()=>m,YZ:()=>_,Ao:()=>l,ZR:()=>a,h3:()=>A,di:()=>o.di,eh:()=>o.eh,bd:()=>I}),function(f){function E(H){const $=H.growBy*H.elementSize;H.currentSize=$,H.currentIndex=0,H.currentChunk=new H.ctor($),H.allocatedSize+=$,H.chunks[H.chunks.length]=H.currentChunk}function N(H,$){const{ctor:J,chunks:W,currentIndex:te}=H;if(!W.length)return new J(0);if(1===W.length&&($||te===H.allocatedSize))return W[0];let de=0;for(let q=0,Y=W.length-1;q=H.currentSize)ye.set(Z,j);else for(let q=0,Y=Z.length;q=H.currentSize&&E(H);const de=H.currentChunk,ye=H.currentIndex;return de[ye]=$,de[ye+1]=J,de[ye+2]=W,de[ye+3]=te,H.currentIndex+=4,H.elementCount++},f.add3=function L(H,$,J,W){H.currentIndex>=H.currentSize&&E(H);const te=H.currentChunk,de=H.currentIndex;return te[de]=$,te[de+1]=J,te[de+2]=W,H.currentIndex+=3,H.elementCount++},f.add2=function w(H,$,J){H.currentIndex>=H.currentSize&&E(H);const W=H.currentChunk,te=H.currentIndex;return W[te]=$,W[te+1]=J,H.currentIndex+=2,H.elementCount++},f.add=function Q(H,$){return H.currentIndex>=H.currentSize&&E(H),H.currentChunk[H.currentIndex]=$,H.currentIndex+=1,H.elementCount++},f.addRepeat=function G(H,$,J){for(let W=0;W<$;W++)H.currentIndex>=H.currentSize&&E(H),H.currentChunk[H.currentIndex++]=J,H.elementCount++;return H.elementCount},f.addMany=function V(H,$){const{elementSize:J}=H;for(let W=0,te=$.length;W=H.currentSize&&E(H);const{currentChunk:de}=H;for(let ye=0;ye"u")return te;if("number"==typeof W)return te.currentChunk=new H(W*$),te.allocatedSize=W*$,te.currentSize=te.currentChunk.length,te.chunks[0]=te.currentChunk,te;const de=W;if(de.length%$!=0)throw new Error("initialChunk length must be a multiple of the element size.");return te.currentChunk=de,te.allocatedSize=de.length,te.currentSize=de.length,te.chunks[0]=de,te}}(e||(e={}));var o=n(5527);function r(f,p,E){return f[p].keyQ[$].key){N=!1;break}if(V&&N){for(let $=0;$>4;return p=(3735928559^p)+(p<<5),p^=p>>11,p}function v(f,p){let E=23;return E=31*E+f|0,E=31*E+p|0,E^=E>>4,E=(3735928559^E)+(E<<5),E^=E>>11,E}function O(f,p,E){let T=23;return T=31*T+f|0,T=31*T+p|0,T=31*T+E|0,T^=T>>4,T=(3735928559^T)+(T<<5),T^=T>>11,T}function b(f,p,E,T){let L=23;return L=31*L+f|0,L=31*L+p|0,L=31*L+E|0,L=31*L+T|0,L^=L>>4,L=(3735928559^L)+(L<<5),L^=L>>11,L}function _(f){let p=0;for(let E=0,T=f.length;E>>0}function h(f,p){for(let E=0,T=f.length;E{"use strict";function e(M,I,l){return M[I]-M[l]}function o(M,I,l){const m=M[I];M[I]=M[l],M[l]=m}function r(M,I,l,m){const u=l+m>>1;return I(M,l,m)>0?I(M,l,u)>0?I(M,u,m)>0?u:m:l:I(M,m,u)>0?I(M,u,l)>0?u:l:m}function t(M,I,l){const{cmp:m,swap:u,data:d,parts:s}=M;let C=I+1,h=l;for(u(d,I,r(d,m,I,l));m(d,h,I)>0;)--h;for(let a=I+1;a<=h;a++){const S=m(d,a,I);if(S>0){for(u(d,a,h),--h;m(d,h,I)>0;)--h;a--}else 0===S&&(u(d,a,C),C++)}for(let a=I;a=m&&I(M,s,s+1)>0;)l(M,s,s+1),s-=1}}function y(M,I,l){const{parts:m}=M;for(;Is;)--d;for(let C=l+1;C<=d;C++){const h=M[C];if(h>s){for(o(M,C,d),--d;M[d]>s;)--d;C--}else h===s&&(o(M,C,u),++u)}for(let C=l;C=I&&M[d]>u;)M[d+1]=M[d],d-=1;M[d+1]=u}}function v(M,I,l,m){for(;lo,di:()=>_,eh:()=>O})},5019:(tn,Ue,n)=>{"use strict";n.d(Ue,{Y0:()=>s,iy:()=>C,jH:()=>d,sF:()=>m,uE:()=>u});var e=n(9909),o=n(1888),r=n(8277),t=n(3596),A=n(2745),y=n(364),c=n(9347),i=n(5013),v=n(127),O=n(6765),b=n(9390),_=n(2086),M=n(8599);const l=Object.keys({custom:{},auto:{},highest:{},higher:{},high:{},medium:{},low:{},lower:{},lowest:{}}),m=r.t.arrayToOptions(l),u={smoothColors:r.t.MappedStatic("auto",{auto:r.t.Group({}),on:r.t.Group({resolutionFactor:r.t.Numeric(2,{min:.5,max:6,step:.1}),sampleStride:r.t.Numeric(3,{min:1,max:12,step:1})}),off:r.t.Group({})})};function d(h){return!!h.smoothColors}function s(h,a,S){if(("on"===h.name||"auto"===h.name&&a)&&S&&S<3){let D=3;return"on"===h.name?(S*=h.params.resolutionFactor,D=h.params.sampleStride):(S*=2-(0,v.TF)(0,1.1,S),(S=Math.max(.5,S))>1.2&&(D=2)),{resolution:S,stride:D}}}var C,h;(h=C||(C={})).MaterialCategory={category:"Material"},h.ShadingCategory={category:"Shading"},h.CullingLodCategory={category:"Culling & LOD"},h.CustomQualityParamInfo={category:"Custom Quality",hideIf:p=>typeof p.quality<"u"&&"custom"!==p.quality},h.Params={alpha:r.t.Numeric(1,{min:0,max:1,step:.01},{label:"Opacity",isEssential:!0,description:"How opaque/transparent the representation is rendered."}),quality:r.t.Select("auto",m,{isEssential:!0,description:"Visual/rendering quality of the representation."}),material:O.i.getParam(),clip:r.t.Group(b.B.Params),emissive:r.t.Numeric(0,{min:0,max:1,step:.01}),instanceGranularity:r.t.Boolean(!1,{description:"Use instance granularity for marker, transparency, clipping, overpaint, substance data to save memory."}),lod:r.t.Vec3((0,_.e)(),void 0,{...h.CullingLodCategory,description:"Level of detail.",fieldLabels:{x:"Min Distance",y:"Max Distance",z:"Overlap (Shader)"}}),cellSize:r.t.Numeric(200,{min:0,max:5e3,step:100},{...h.CullingLodCategory,description:"Instance grid cell size."}),batchSize:r.t.Numeric(2e3,{min:0,max:5e4,step:500},{...h.CullingLodCategory,description:"Instance grid batch size."})},h.createSimple=function a(p=A.s.grey,E=1,T){return T||(T=(0,t.Zk)()),{transform:T,locationIterator:(0,o.iQ)(1,T.instanceCount.ref.value,1,()=>y.LU,!1,()=>!1),theme:{color:(0,c.TA)({},{value:p,lightness:0,saturation:0}),size:(0,i.ru)({},{value:E})}}},h.createValues=function S(p,E){const T=b.B.getClip(p.clip);return{alpha:e.IQ.create(p.alpha),uAlpha:e.IQ.create(p.alpha),uVertexCount:e.IQ.create(E.vertexCount),uGroupCount:e.IQ.create(E.groupCount),drawCount:e.IQ.create(E.drawCount),uMetalness:e.IQ.create(p.material.metalness),uRoughness:e.IQ.create(p.material.roughness),uBumpiness:e.IQ.create(p.material.bumpiness),uEmissive:e.IQ.create(p.emissive),dLightCount:e.IQ.create(1),dColorMarker:e.IQ.create(!0),dClipObjectCount:e.IQ.create(T.objects.count),dClipVariant:e.IQ.create(T.variant),uClipObjectType:e.IQ.create(T.objects.type),uClipObjectInvert:e.IQ.create(T.objects.invert),uClipObjectPosition:e.IQ.create(T.objects.position),uClipObjectRotation:e.IQ.create(T.objects.rotation),uClipObjectScale:e.IQ.create(T.objects.scale),instanceGranularity:e.IQ.create(p.instanceGranularity),uLod:e.IQ.create(M.Z.create(p.lod[0],p.lod[1],p.lod[2],0))}},h.updateValues=function D(p,E){e.IQ.updateIfChanged(p.alpha,E.alpha),e.IQ.updateIfChanged(p.uMetalness,E.material.metalness),e.IQ.updateIfChanged(p.uRoughness,E.material.roughness),e.IQ.updateIfChanged(p.uBumpiness,E.material.bumpiness),e.IQ.updateIfChanged(p.uEmissive,E.emissive);const T=b.B.getClip(E.clip);e.IQ.updateIfChanged(p.dClipObjectCount,T.objects.count),e.IQ.updateIfChanged(p.dClipVariant,T.variant),e.IQ.update(p.uClipObjectType,T.objects.type),e.IQ.update(p.uClipObjectInvert,T.objects.invert),e.IQ.update(p.uClipObjectPosition,T.objects.position),e.IQ.update(p.uClipObjectRotation,T.objects.rotation),e.IQ.update(p.uClipObjectScale,T.objects.scale),e.IQ.updateIfChanged(p.instanceGranularity,E.instanceGranularity),e.IQ.update(p.uLod,M.Z.set(p.uLod.ref.value,E.lod[0],E.lod[1],E.lod[2],0))},h.createRenderableState=function R(p={}){const E=void 0===p.alpha||1===p.alpha;return{disposed:!1,visible:!0,alphaFactor:1,pickable:!0,colorOnly:!1,opaque:E,writeDepth:E}},h.updateRenderableState=function f(p,E){p.opaque=E.alpha*p.alphaFactor>=1,p.writeDepth=p.opaque}},5077:(tn,Ue,n)=>{"use strict";n.d(Ue,{$G:()=>y,EN:()=>i,HB:()=>t,eO:()=>A});var e=n(7187),o=n(4369),r=n(3784);function t(v,O,b,_){return v.fill(_,O,b),!0}function A(v,O,b){v.fill(0,O,b)}function y(v,O,b){const _=(0,r.xg)(Math.max(1,v),1,Uint8Array,b&&b.tClipping.ref.value.array);return b?(e.IQ.update(b.tClipping,_),e.IQ.update(b.uClippingTexDim,o.ZY.create(_.width,_.height)),e.IQ.updateIfChanged(b.dClipping,v>0),e.IQ.updateIfChanged(b.dClippingType,O),b):{tClipping:e.IQ.create(_),uClippingTexDim:e.IQ.create(o.ZY.create(_.width,_.height)),dClipping:e.IQ.create(v>0),dClippingType:e.IQ.create(O)}}const c={array:new Uint8Array(1),width:1,height:1};function i(v){return v?(e.IQ.update(v.tClipping,c),e.IQ.update(v.uClippingTexDim,o.ZY.create(1,1)),e.IQ.updateIfChanged(v.dClipping,!1),v):{tClipping:e.IQ.create(c),uClippingTexDim:e.IQ.create(o.ZY.create(1,1)),dClipping:e.IQ.create(!1),dClippingType:e.IQ.create("groupInstance")}}},2712:(tn,Ue,n)=>{"use strict";n.d(Ue,{D1:()=>c});var e=n(9909),o=n(3784),r=n(190),t=n(4369),A=n(364),y=n(4648);function c(C,h,a,S){const D=function i(C,h,a,S){switch(a.granularity){case"uniform":return function b(C,h,a){return function O(C,h){return h?(e.IQ.update(h.uColor,r.Q1.toVec3Normalized(h.uColor.ref.value,C)),e.IQ.updateIfChanged(h.dColorType,"uniform"),h):{uColor:e.IQ.create(r.Q1.toVec3Normalized((0,t.eB)(),C)),tColor:e.IQ.create({array:new Uint8Array(3),width:1,height:1}),tColorGrid:e.IQ.create((0,y.z6)()),tPalette:e.IQ.create({array:new Uint8Array(3),width:1,height:1}),uColorTexDim:e.IQ.create(t.ZY.create(1,1)),uColorGridDim:e.IQ.create(t.eB.create(1,1,1)),uColorGridTransform:e.IQ.create(t.Zb.create(0,0,0,1)),dColorType:e.IQ.create("uniform"),dUsePalette:e.IQ.create(!1)}}(h(A.LU,!1),a)}(0,a.color,S);case"instance":return C.nonInstanceable?I(C,a.color,S):function M(C,h,a){const{instanceCount:S}=C,D=(0,o.xg)(Math.max(1,S),3,Uint8Array,a&&a.tColor.ref.value.array);for(C.reset();C.hasNext;){const{location:R,isSecondary:f,instanceIndex:p}=C.move();r.Q1.toArray(h(R,f),D.array,3*p),C.skipInstance()}return _(D,"instance",a)}(C,a.color,S);case"group":return I(C,a.color,S);case"groupInstance":return function l(C,h,a){const{groupCount:S,instanceCount:D,hasLocation2:R}=C,p=(0,o.xg)(Math.max(1,D*S*(R?2:1)),3,Uint8Array,a&&a.tColor.ref.value.array);C.reset();const E=R?6:3;for(;C.hasNext;){const{location:T,location2:L,isSecondary:w,index:Q}=C.move();r.Q1.toArray(h(T,w),p.array,Q*E),R&&r.Q1.toArray(h(L,w),p.array,Q*E+3)}return _(p,"groupInstance",a)}(C,a.color,S);case"vertex":return function m(C,h,a){const{groupCount:S,stride:D}=C,R=(0,o.xg)(Math.max(1,S),3,Uint8Array,a&&a.tColor.ref.value.array);for(C.reset(),C.voidInstances();C.hasNext&&!C.isNextNewInstance;){const{location:f,isSecondary:p,groupIndex:E}=C.move(),T=h(f,p);for(let L=0;L{"use strict";n.d(Ue,{h:()=>v});var e=n(8382),o=n(283),r=n(4369);const t=(0,r.eB)(),A=(0,r.eB)(),y=(0,r.eB)(),c=e.Gm.add,i=e.Gm.add3;var v;(v||(v={})).create=function _(M=2048,I=1024,l){const m=e.Gm.create(Float32Array,1,I,l?l.groupBuffer.ref.value:M),u=e.Gm.create(Float32Array,3,I,l?l.startBuffer.ref.value:M),d=e.Gm.create(Float32Array,3,I,l?l.endBuffer.ref.value:M),s=e.Gm.create(Float32Array,1,I,l?l.scaleBuffer.ref.value:M),C=e.Gm.create(Float32Array,1,I,l?l.capBuffer.ref.value:M),h=e.Gm.create(Float32Array,1,I,l?l.colorModeBuffer.ref.value:M),a=(D,R,f,p,E,T,L,w,Q,G,V)=>{for(let U=0;U<6;++U)i(u,D,R,f),i(d,p,E,T),c(m,V),c(s,L),c(C,(w?1:0)+(Q?2:0)),c(h,G)},S=(D,R,f,p,E,T,L,w,Q)=>{const G=r.eB.distance(D,R),V=f%2!=0,U=Math.floor((f+1)/2),N=G/(f+.5);let k=2;r.eB.setMagnitude(y,r.eB.sub(y,R,D),N),r.eB.copy(t,D);for(let H=0;H{const Q=r.eB.distance(D,R);S(D,R,Q/f,p,E,T,!0,L,w)},getCylinders:()=>{const D=m.elementCount/6,R=e.Gm.compact(m,!0),f=e.Gm.compact(u,!0),p=e.Gm.compact(d,!0),E=e.Gm.compact(s,!0),T=e.Gm.compact(C,!0),L=e.Gm.compact(h,!0),w=l&&D<=l.cylinderCount?l.mappingBuffer.ref.value:new Float32Array(18*D),Q=l&&D<=l.cylinderCount?l.indexBuffer.ref.value:new Uint32Array(12*D);return(!l||D>l.cylinderCount)&&function O(b,_,M){for(let I=0;I{"use strict";n.d(Ue,{S:()=>d});var d,e=n(9909),o=n(4369),r=n(4559),t=n(2712),A=n(8013),y=n(7684),c=n(1888),i=n(8277),v=n(3784),O=n(5384),b=n(5019),_=n(2075),M=n(9197),I=n(8382),l=n(5077),m=n(8307),u=n(6022);!function(s){function C(G,V,U,N,k,H,$,J,W,te){return te?function D(G,V,U,N,k,H,$,J,W,te){return W>te.cylinderCount&&(e.IQ.update(te.mappingBuffer,G),e.IQ.update(te.indexBuffer,V)),te.cylinderCount=W,e.IQ.update(te.groupBuffer,U),e.IQ.update(te.startBuffer,N),e.IQ.update(te.endBuffer,k),e.IQ.update(te.scaleBuffer,H),e.IQ.update(te.capBuffer,$),e.IQ.update(te.colorModeBuffer,J),te}(G,V,U,N,k,H,$,J,W,te):function S(G,V,U,N,k,H,$,J,W){const te=(0,O.f8)();let de,ye=-1,j=-1;const Z={kind:"cylinders",cylinderCount:W,mappingBuffer:e.IQ.create(G),indexBuffer:e.IQ.create(V),groupBuffer:e.IQ.create(U),startBuffer:e.IQ.create(N),endBuffer:e.IQ.create(k),scaleBuffer:e.IQ.create(H),capBuffer:e.IQ.create($),colorModeBuffer:e.IQ.create(J),get boundingSphere(){const q=a(Z);if(q!==ye){const Y=(0,v.sL)(Z.startBuffer.ref.value,6*Z.cylinderCount,6),ee=(0,v.sL)(Z.endBuffer.ref.value,6*Z.cylinderCount,6);O.f8.expandBySphere(te,Y,ee),ye=q}return te},get groupMapping(){return Z.groupBuffer.ref.version!==j&&(de=(0,r.AA)(Z.groupBuffer.ref.value,Z.cylinderCount,6),j=Z.groupBuffer.ref.version),de},setBoundingSphere(q){O.f8.copy(te,q),ye=a(Z)}};return Z}(G,V,U,N,k,H,$,J,W)}function h(G){return C(G?G.mappingBuffer.ref.value:new Float32Array(0),G?G.indexBuffer.ref.value:new Uint32Array(0),G?G.groupBuffer.ref.value:new Float32Array(0),G?G.startBuffer.ref.value:new Float32Array(0),G?G.endBuffer.ref.value:new Float32Array(0),G?G.scaleBuffer.ref.value:new Float32Array(0),G?G.capBuffer.ref.value:new Float32Array(0),G?G.colorModeBuffer.ref.value:new Float32Array(0),0,G)}function a(G){return(0,I.TI)([G.cylinderCount,G.mappingBuffer.ref.version,G.indexBuffer.ref.version,G.groupBuffer.ref.version,G.startBuffer.ref.version,G.endBuffer.ref.version,G.scaleBuffer.ref.version,G.capBuffer.ref.version,G.colorModeBuffer.ref.version])}function f(G,V){const U=6*G.cylinderCount,N=V.instanceCount.ref.value,k=(0,c.tu)(),H=k.position,$=G.startBuffer.ref.value,J=G.endBuffer.ref.value,W=V.aTransform.ref.value;return(0,c.iQ)(U,N,2,(de,ye)=>{const j=de%6==0?$:J;return ye<0?o.eB.fromArray(H,j,3*de):o.eB.transformMat4Offset(H,j,W,0,3*de,16*ye),k})}function p(G,V,U,N,k){const{instanceCount:H,groupCount:$}=U,J=f(G,V),W=(0,t.D1)(U,J,N.color),te=(0,y.v3)(U,N.size),de=k.instanceGranularity?(0,A.Km)(H,"instance"):(0,A.Km)(H*$,"groupInstance"),ye=(0,_.WG)(),j=(0,M.MD)(),Z=(0,u.JS)(),q=(0,m.IB)(),Y=(0,l.EN)(),ee={drawCount:4*G.cylinderCount*3,vertexCount:6*G.cylinderCount,groupCount:$,instanceCount:H},g=(0,y.yx)(te)*k.sizeFactor,_e=O.f8.clone(G.boundingSphere),xe=(0,v.Ax)(_e,V.aTransform.ref.value,H,0);return{dGeometryType:e.IQ.create("cylinders"),aMapping:G.mappingBuffer,aGroup:G.groupBuffer,aStart:G.startBuffer,aEnd:G.endBuffer,aScale:G.scaleBuffer,aCap:G.capBuffer,aColorMode:G.colorModeBuffer,elements:G.indexBuffer,boundingSphere:e.IQ.create(xe),invariantBoundingSphere:e.IQ.create(_e),uInvariantBoundingSphere:e.IQ.create(o.Zb.ofSphere(_e)),...W,...te,...de,...ye,...j,...Z,...q,...Y,...V,padding:e.IQ.create(g),...b.iy.createValues(k,ee),uSizeFactor:e.IQ.create(k.sizeFactor*k.sizeAspectRatio),uDoubleSided:e.IQ.create(k.doubleSided),dIgnoreLight:e.IQ.create(k.ignoreLight),dXrayShaded:e.IQ.create("inverted"===k.xrayShaded?"inverted":!0===k.xrayShaded?"on":"off"),dTransparentBackfaces:e.IQ.create(k.transparentBackfaces),dSolidInterior:e.IQ.create(k.solidInterior),uBumpFrequency:e.IQ.create(k.bumpFrequency),uBumpAmplitude:e.IQ.create(k.bumpAmplitude),dDualColor:e.IQ.create("interpolate"===k.colorMode)}}function Q(G,V){b.iy.updateRenderableState(G,V),G.opaque=G.opaque&&!V.xrayShaded,G.writeDepth=G.opaque}s.create=C,s.createEmpty=h,s.transform=function R(G,V){const U=G.startBuffer.ref.value;(0,r.pi)(V,U,0,6*G.cylinderCount),e.IQ.update(G.startBuffer,U);const N=G.endBuffer.ref.value;(0,r.pi)(V,N,0,6*G.cylinderCount),e.IQ.update(G.endBuffer,N)},s.Params={...b.iy.Params,sizeFactor:i.t.Numeric(1,{min:0,max:10,step:.1}),sizeAspectRatio:i.t.Numeric(1,{min:0,max:3,step:.01}),doubleSided:i.t.Boolean(!1,b.iy.CustomQualityParamInfo),ignoreLight:i.t.Boolean(!1,b.iy.ShadingCategory),xrayShaded:i.t.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],b.iy.ShadingCategory),transparentBackfaces:i.t.Select("off",i.t.arrayToOptions(["off","on","opaque"]),b.iy.ShadingCategory),solidInterior:i.t.Boolean(!0,b.iy.ShadingCategory),bumpFrequency:i.t.Numeric(0,{min:0,max:10,step:.1},b.iy.ShadingCategory),bumpAmplitude:i.t.Numeric(1,{min:0,max:5,step:.1},b.iy.ShadingCategory),colorMode:i.t.Select("default",i.t.arrayToOptions(["default","interpolate"]),b.iy.ShadingCategory)},s.Utils={Params:s.Params,createEmpty:h,createValues:p,createValuesSimple:function E(G,V,U,N,k){const H=b.iy.createSimple(U,N,k),$={...i.t.getDefaultValues(s.Params),...V};return p(G,H.transform,H.locationIterator,H.theme,$)},updateValues:function T(G,V){b.iy.updateValues(G,V),e.IQ.updateIfChanged(G.uSizeFactor,V.sizeFactor*V.sizeAspectRatio),e.IQ.updateIfChanged(G.uDoubleSided,V.doubleSided),e.IQ.updateIfChanged(G.dIgnoreLight,V.ignoreLight),e.IQ.updateIfChanged(G.dXrayShaded,"inverted"===V.xrayShaded?"inverted":!0===V.xrayShaded?"on":"off"),e.IQ.updateIfChanged(G.dTransparentBackfaces,V.transparentBackfaces),e.IQ.updateIfChanged(G.dSolidInterior,V.solidInterior),e.IQ.updateIfChanged(G.uBumpFrequency,V.bumpFrequency),e.IQ.updateIfChanged(G.uBumpAmplitude,V.bumpAmplitude),e.IQ.updateIfChanged(G.dDualColor,"interpolate"===V.colorMode)},updateBoundingSphere:function L(G,V){const U=O.f8.clone(V.boundingSphere),N=(0,v.Ax)(U,G.aTransform.ref.value,G.instanceCount.ref.value,0);O.f8.equals(N,G.boundingSphere.ref.value)||e.IQ.update(G.boundingSphere,N),O.f8.equals(U,G.invariantBoundingSphere.ref.value)||(e.IQ.update(G.invariantBoundingSphere,U),e.IQ.update(G.uInvariantBoundingSphere,o.Zb.fromSphere(G.uInvariantBoundingSphere.ref.value,U)))},createRenderableState:function w(G){const V=b.iy.createRenderableState(G);return Q(V,G),V},updateRenderableState:Q,createPositionIterator:f}}(d||(d={}))},9928:(tn,Ue,n)=>{"use strict";n.d(Ue,{E:()=>D});var e=n(8382),o=n(1888),r=n(3784),t=n(4648),A=n(5384),y=n(4369),c=n(9909),i=n(8277),v=n(3280),O=n(5019),b=n(2712),_=n(8013),M=n(2075),I=n(9197),l=n(127);function u(f){return f.map(p=>({x:p[0],alpha:p[1]}))}function d(f,p){const E=[{x:0,alpha:0},{x:0,alpha:0},...f,{x:1,alpha:0},{x:1,alpha:0}],L=p?p.ref.value.array:new Uint8Array(256);let Q,G,V,U,N,k,w=0;const H=f.length+1;for(let J=0;J0?"3d":"2d"),uGridTexDim:Y,tGridTex:q,uGridStats:ee,uCellDim:te.cellDim,uCartnToUnit:te.cartnToUnit,uUnitToCartn:te.unitToCartn,dPackedGroup:te.packedGroup,dAxisOrder:c.IQ.create(te.axisOrder.ref.value.join("")),dIgnoreLight:c.IQ.create(Z.ignoreLight),dXrayShaded:c.IQ.create("inverted"===Z.xrayShaded?"inverted":!0===Z.xrayShaded?"on":"off")}}f.create=p,f.createEmpty=w,f.Params={...O.iy.Params,ignoreLight:i.t.Boolean(!1,O.iy.ShadingCategory),xrayShaded:i.t.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],O.iy.ShadingCategory),controlPoints:i.t.LineGraph([y.ZY.create(.19,0),y.ZY.create(.2,.05),y.ZY.create(.25,.05),y.ZY.create(.26,0),y.ZY.create(.79,0),y.ZY.create(.8,.05),y.ZY.create(.85,.05),y.ZY.create(.86,0)],{isEssential:!0}),stepsPerCell:i.t.Numeric(3,{min:1,max:10,step:1}),jumpLength:i.t.Numeric(0,{min:0,max:20,step:.1})},f.Utils={Params:f.Params,createEmpty:w,createValues:N,createValuesSimple:function k(te,de,ye,j,Z){const q=O.iy.createSimple(ye,j,Z),Y={...i.t.getDefaultValues(f.Params),...de};return N(te,q.transform,q.locationIterator,q.theme,Y)},updateValues:function H(te,de){O.iy.updateValues(te,de),c.IQ.updateIfChanged(te.dIgnoreLight,de.ignoreLight),c.IQ.updateIfChanged(te.dXrayShaded,"inverted"===de.xrayShaded?"inverted":!0===de.xrayShaded?"on":"off"),d(u(de.controlPoints),te.tTransferTex),c.IQ.updateIfChanged(te.uMaxSteps,G(te.uGridDim.ref.value,de.stepsPerCell)),c.IQ.updateIfChanged(te.uStepScale,V(te.uCellDim.ref.value,de.stepsPerCell)),c.IQ.updateIfChanged(te.uTransferScale,U(de.stepsPerCell)),c.IQ.updateIfChanged(te.uJumpLength,de.jumpLength)},updateBoundingSphere:function $(te,de){const ye=A.f8.clone(de.boundingSphere),j=(0,r.Ax)(ye,te.aTransform.ref.value,te.instanceCount.ref.value,0);A.f8.equals(j,te.boundingSphere.ref.value)||c.IQ.update(te.boundingSphere,j),A.f8.equals(ye,te.invariantBoundingSphere.ref.value)||(c.IQ.update(te.invariantBoundingSphere,ye),c.IQ.update(te.uInvariantBoundingSphere,y.Zb.fromSphere(te.uInvariantBoundingSphere.ref.value,ye)))},createRenderableState:function J(te){const de=O.iy.createRenderableState(te);return de.opaque=!1,de.writeDepth=!1,de},updateRenderableState:function W(te,de){O.iy.updateRenderableState(te,de),te.opaque=!1,te.writeDepth=!1},createPositionIterator:function Q(te,de){const ye=te.transform.ref.value,[j,Z,q]=te.gridDimension.ref.value,Y=j*Z*q,ee=de.instanceCount.ref.value,g=(0,o.tu)(),_e=g.position,xe=de.aTransform.ref.value;return(0,o.iQ)(Y,ee,1,(Ae,Be)=>{const Ce=Math.floor(Ae/q);return _e[0]=Math.floor(Ce/Z),_e[1]=Ce%Z,_e[2]=Ae%q,y.eB.transformMat4(_e,_e,ye),Be>=0&&y.eB.transformMat4Offset(_e,_e,xe,0,0,16*Be),g})}}}(D||(D={}))},6022:(tn,Ue,n)=>{"use strict";n.d(Ue,{JS:()=>O,Ns:()=>A,Sj:()=>i,bO:()=>y,dQ:()=>c});var e=n(7187),o=n(4369),r=n(3784),t=n(4648);function A(b,_,M,I){for(let l=_;l0),e.IQ.updateIfChanged(M.emissiveAverage,y(I.array,b)),e.IQ.updateIfChanged(M.dEmissiveType,_),M):{tEmissive:e.IQ.create(I),uEmissiveTexDim:e.IQ.create(o.ZY.create(I.width,I.height)),dEmissive:e.IQ.create(b>0),emissiveAverage:e.IQ.create(0),tEmissiveGrid:e.IQ.create((0,t.z6)()),uEmissiveGridDim:e.IQ.create(o.eB.create(1,1,1)),uEmissiveGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dEmissiveType:e.IQ.create(_),uEmissiveStrength:e.IQ.create(1)}}const v={array:new Uint8Array(1),width:1,height:1};function O(b){return b?(e.IQ.update(b.tEmissive,v),e.IQ.update(b.uEmissiveTexDim,o.ZY.create(1,1)),b):{tEmissive:e.IQ.create(v),uEmissiveTexDim:e.IQ.create(o.ZY.create(1,1)),dEmissive:e.IQ.create(!1),emissiveAverage:e.IQ.create(0),tEmissiveGrid:e.IQ.create((0,t.z6)()),uEmissiveGridDim:e.IQ.create(o.eB.create(1,1,1)),uEmissiveGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dEmissiveType:e.IQ.create("groupInstance"),uEmissiveStrength:e.IQ.create(1)}}},542:(tn,Ue,n)=>{"use strict";n.d(Ue,{V:()=>b});var b,e=n(9283),o=n(5299),r=n(4255),t=n(5315),A=n(9928),y=n(8231),c=n(6115),i=n(799),v=n(7135),O=n(283);!function(_){function M(d){switch(d.kind){case"mesh":return 3*d.triangleCount;case"points":return d.pointCount;case"spheres":return 2*d.sphereCount*3;case"cylinders":return 4*d.cylinderCount*3;case"text":return 2*d.charCount*3;case"lines":return 2*d.lineCount*3;case"direct-volume":return 36;case"image":return 6;case"texture-mesh":return d.vertexCount}}_.getDrawCount=M,_.getVertexCount=function I(d){switch(d.kind){case"mesh":case"texture-mesh":return d.vertexCount;case"points":return d.pointCount;case"spheres":return 6*d.sphereCount;case"cylinders":return 6*d.cylinderCount;case"text":return 4*d.charCount;case"lines":return 4*d.lineCount;case"direct-volume":const[s,C,h]=d.gridDimension.ref.value;return s*C*h;case"image":return 4}},_.getGroupCount=function l(d){switch(d.kind){case"mesh":case"points":case"spheres":case"cylinders":case"text":case"lines":return 0===M(d)?0:(0,c._M)(d.groupBuffer.ref.value)+1;case"direct-volume":return 1;case"image":return(0,c._M)(d.groupTexture.ref.value.array)+1;case"texture-mesh":return d.groupCount}},_.getUtils=function m(d){switch(d.kind){case"mesh":return e.e.Utils;case"points":return o.O.Utils;case"spheres":return y.v.Utils;case"cylinders":return O.S.Utils;case"text":return r.E.Utils;case"lines":return t.q.Utils;case"direct-volume":return A.E.Utils;case"image":return v._V.Utils;case"texture-mesh":return i.X.Utils}},_.getGranularity=function u(d,s){return"instance"===s&&d.nonInstanceable?"group":s}}(b||(b={}))},7135:(tn,Ue,n)=>{"use strict";n.d(Ue,{Bd:()=>a,_V:()=>S});var e=n(8382),o=n(1888),r=n(3784),t=n(5384),A=n(4369),y=n(9909),c=n(8277),i=n(5019),v=n(2712),O=n(8013),b=n(2075),_=n(9197),M=n(6115),I=n(5077),l=n(364),m=n(9007),u=n(8307),d=n(6022);const s=new Uint32Array([0,1,2,1,3,2]),C=new Float32Array([0,1,0,0,1,1,1,0]),h={nearest:"Nearest",catmulrom:"Catmulrom (Cubic)",mitchell:"Mitchell (Cubic)",bspline:"B-Spline (Cubic)"},a=Object.keys(h);var S;!function(R){function f(k,H,$,J){return J?function T(k,H,$,J){const W=k.width,te=k.height;return y.IQ.update(J.imageTexture,k),y.IQ.update(J.imageTextureDim,A.ZY.set(J.imageTextureDim.ref.value,W,te)),y.IQ.update(J.cornerBuffer,H),y.IQ.update(J.groupTexture,$),J}(k,H,$,J):function E(k,H,$){const J=(0,t.f8)();let W=-1;const te=k.width,de=k.height,ye={kind:"image",imageTexture:y.IQ.create(k),imageTextureDim:y.IQ.create(A.ZY.create(te,de)),cornerBuffer:y.IQ.create(H),groupTexture:y.IQ.create($),get boundingSphere(){const j=function p(k){return(0,e.TI)([k.cornerBuffer.ref.version])}(ye);if(j!==W){const Z=function D(R){const f=(0,A.eB)(),p=[];for(let L=0,w=R.length;LE&&(E=w)}const T=t.f8.create(f,E);return t.f8.setExtrema(T,p),T}(ye.cornerBuffer.ref.value);t.f8.copy(J,Z),W=j}return J}};return ye}(k,H,$)}function L(k){return f((0,r.xg)(0,4,Uint8Array),k?k.cornerBuffer.ref.value:new Float32Array(24),(0,r.xg)(0,4,Uint8Array),k)}function w(k,H,$,J,W){const{instanceCount:te,groupCount:de}=$,ye=R.Utils.createPositionIterator(k,H),j=(0,v.D1)($,ye,J.color),Z=W.instanceGranularity?(0,O.Km)(te,"instance"):(0,O.Km)(te*de,"groupInstance"),q=(0,b.WG)(),Y=(0,_.MD)(),ee=(0,d.JS)(),g=(0,u.IB)(),_e=(0,I.EN)(),xe={drawCount:s.length,vertexCount:m.Wp.length/3,groupCount:de,instanceCount:te},le=t.f8.clone(k.boundingSphere),Ae=(0,r.Ax)(le,H.aTransform.ref.value,te,0);return{dGeometryType:y.IQ.create("image"),...j,...Z,...q,...Y,...ee,...g,..._e,...H,...i.iy.createValues(W,xe),aPosition:k.cornerBuffer,aUv:y.IQ.create(C),elements:y.IQ.create(s),aGroup:y.IQ.create((0,M.WE)(new Float32Array(4))),boundingSphere:y.IQ.create(Ae),invariantBoundingSphere:y.IQ.create(le),uInvariantBoundingSphere:y.IQ.create(A.Zb.ofSphere(le)),dInterpolation:y.IQ.create(W.interpolation),uImageTexDim:k.imageTextureDim,tImageTex:k.imageTexture,tGroupTex:k.groupTexture}}R.create=f,R.createEmpty=L,R.Params={...i.iy.Params,interpolation:c.t.Select("bspline",c.t.objectToOptions(h))},R.Utils={Params:R.Params,createEmpty:L,createValues:w,createValuesSimple:function Q(k,H,$,J,W){const te=i.iy.createSimple($,J,W),de={...c.t.getDefaultValues(R.Params),...H};return w(k,te.transform,te.locationIterator,te.theme,de)},updateValues:function G(k,H){i.iy.updateValues(k,H),y.IQ.updateIfChanged(k.dInterpolation,H.interpolation)},updateBoundingSphere:function V(k,H){const $=t.f8.clone(H.boundingSphere),J=(0,r.Ax)($,k.aTransform.ref.value,k.instanceCount.ref.value,0);t.f8.equals(J,k.boundingSphere.ref.value)||y.IQ.update(k.boundingSphere,J),t.f8.equals($,k.invariantBoundingSphere.ref.value)||(y.IQ.update(k.invariantBoundingSphere,$),y.IQ.update(k.uInvariantBoundingSphere,A.Zb.fromSphere(k.uInvariantBoundingSphere.ref.value,$)))},createRenderableState:function U(k){const H=i.iy.createRenderableState(k);return H.opaque=!1,H},updateRenderableState:function N(k,H){i.iy.updateRenderableState(k,H),k.opaque=!1},createPositionIterator:()=>(0,o.iQ)(1,1,1,()=>l.LU)}}(S||(S={}))},5821:(tn,Ue,n)=>{"use strict";n.d(Ue,{d:()=>v});var e=n(8382),o=n(5315),r=n(4369);const t=(0,r.eB)(),A=(0,r.eB)(),y=(0,r.eB)(),c=e.Gm.add,i=e.Gm.add3;var v;(v||(v={})).create=function _(M=2048,I=1024,l){const m=e.Gm.create(Float32Array,1,I,l?l.groupBuffer.ref.value:M),u=e.Gm.create(Float32Array,3,I,l?l.startBuffer.ref.value:M),d=e.Gm.create(Float32Array,3,I,l?l.endBuffer.ref.value:M),s=(a,S,D,R,f,p,E)=>{for(let T=0;T<4;++T)i(u,a,S,D),i(d,R,f,p),c(m,E)},h=(a,S,D,R)=>{const f=r.eB.distance(a,S),p=D%2!=0,E=Math.floor((D+1)/2),T=f/(D+.5);r.eB.setMagnitude(y,r.eB.sub(y,S,a),T),r.eB.copy(t,a);for(let L=0;L{for(let R=0;R<4;++R)i(u,a[0],a[1],a[2]),i(d,S[0],S[1],S[2]),c(m,D)},addFixedCountDashes:h,addFixedLengthDashes:(a,S,D,R)=>{const f=r.eB.distance(a,S);h(a,S,f/D,R)},addCage:(a,S,D)=>{const{vertices:R,edges:f}=S;for(let p=0,E=f.length;p{const a=m.elementCount/4,S=e.Gm.compact(m,!0),D=e.Gm.compact(u,!0),R=e.Gm.compact(d,!0),f=l&&a<=l.lineCount?l.mappingBuffer.ref.value:new Float32Array(8*a),p=l&&a<=l.lineCount?l.indexBuffer.ref.value:new Uint32Array(6*a);return(!l||a>l.lineCount)&&function O(b,_,M){for(let I=0;I{"use strict";n.d(Ue,{q:()=>s});var s,e=n(9909),o=n(4369),r=n(4559),t=n(2712),A=n(8013),y=n(7684),c=n(1888),i=n(5821),v=n(8277),O=n(3784),b=n(5384),_=n(5019),M=n(2075),I=n(9197),l=n(8382),m=n(5077),u=n(8307),d=n(6022);!function(C){function h(G,V,U,N,k,H,$){return $?function f(G,V,U,N,k,H,$){return H>$.lineCount&&(e.IQ.update($.mappingBuffer,G),e.IQ.update($.indexBuffer,V)),$.lineCount=H,e.IQ.update($.groupBuffer,U),e.IQ.update($.startBuffer,N),e.IQ.update($.endBuffer,k),$}(G,V,U,N,k,H,$):function R(G,V,U,N,k,H){const $=(0,b.f8)();let J,W=-1,te=-1;const de={kind:"lines",lineCount:H,mappingBuffer:e.IQ.create(G),indexBuffer:e.IQ.create(V),groupBuffer:e.IQ.create(U),startBuffer:e.IQ.create(N),endBuffer:e.IQ.create(k),get boundingSphere(){const ye=D(de);if(ye!==W){const j=(0,O.sL)(de.startBuffer.ref.value,4*de.lineCount,4),Z=(0,O.sL)(de.endBuffer.ref.value,4*de.lineCount,4);b.f8.expandBySphere($,j,Z),W=ye}return $},get groupMapping(){return de.groupBuffer.ref.version!==te&&(J=(0,r.AA)(de.groupBuffer.ref.value,de.lineCount,4),te=de.groupBuffer.ref.version),J},setBoundingSphere(ye){b.f8.copy($,ye),W=D(de)}};return de}(G,V,U,N,k,H)}function a(G){return h(G?G.mappingBuffer.ref.value:new Float32Array(0),G?G.indexBuffer.ref.value:new Uint32Array(0),G?G.groupBuffer.ref.value:new Float32Array(0),G?G.startBuffer.ref.value:new Float32Array(0),G?G.endBuffer.ref.value:new Float32Array(0),0,G)}function D(G){return(0,l.TI)([G.lineCount,G.mappingBuffer.ref.version,G.indexBuffer.ref.version,G.groupBuffer.ref.version,G.startBuffer.ref.version,G.endBuffer.ref.version])}function E(G,V){const U=4*G.lineCount,N=V.instanceCount.ref.value,k=(0,c.tu)(),H=k.position,$=G.startBuffer.ref.value,J=G.endBuffer.ref.value,W=V.aTransform.ref.value;return(0,c.iQ)(U,N,2,(de,ye)=>{const j=de%4==0?$:J;return ye<0?o.eB.fromArray(H,j,3*de):o.eB.transformMat4Offset(H,j,W,0,3*de,16*ye),k})}function T(G,V,U,N,k){const{instanceCount:H,groupCount:$}=U,J=E(G,V),W=(0,t.D1)(U,J,N.color),te=(0,y.v3)(U,N.size),de=k.instanceGranularity?(0,A.Km)(H,"instance"):(0,A.Km)(H*$,"groupInstance"),ye=(0,M.WG)(),j=(0,I.MD)(),Z=(0,d.JS)(),q=(0,u.IB)(),Y=(0,m.EN)(),ee={drawCount:2*G.lineCount*3,vertexCount:4*G.lineCount,groupCount:$,instanceCount:H},g=b.f8.clone(G.boundingSphere),_e=(0,O.Ax)(g,V.aTransform.ref.value,H,0);return{dGeometryType:e.IQ.create("lines"),aMapping:G.mappingBuffer,aGroup:G.groupBuffer,aStart:G.startBuffer,aEnd:G.endBuffer,elements:G.indexBuffer,boundingSphere:e.IQ.create(_e),invariantBoundingSphere:e.IQ.create(g),uInvariantBoundingSphere:e.IQ.create(o.Zb.ofSphere(g)),...W,...te,...de,...ye,...j,...Z,...q,...Y,...V,..._.iy.createValues(k,ee),uSizeFactor:e.IQ.create(k.sizeFactor),dLineSizeAttenuation:e.IQ.create(k.lineSizeAttenuation),uDoubleSided:e.IQ.create(!0),dFlipSided:e.IQ.create(!1)}}C.create=h,C.createEmpty=a,C.fromMesh=function S(G,V){const U=G.vertexBuffer.ref.value,N=G.indexBuffer.ref.value,k=G.groupBuffer.ref.value,H=i.d.create(3*G.triangleCount,G.triangleCount/10,V);for(let $=0,J=3*G.triangleCount;${"use strict";n.d(Ue,{Km:()=>y,Xl:()=>A});var e=n(7187),o=n(4369),r=n(3784);const t=new Uint8Array(772);function A(v,O){if(0===O)return 0;const b=new Uint32Array(v.buffer,0,v.buffer.byteLength>>2),_=O-4>>2,M=4*_;let I=0;if(_<0)for(let l=0;l>16]}for(let l=M;l{"use strict";n.d(Ue,{y9:()=>D,Jz:()=>R,GH:()=>f});var e=n(4369),o=n(573),r=n(6928);const t={radiusTop:1,radiusBottom:1,height:1,radialSegments:8,heightSegments:1,topCap:!1,bottomCap:!1,thetaStart:0,thetaLength:2*Math.PI};var y=n(3220),c=n(863),i=n(8382);const v=new Map,O=e.eB.create(0,1,0),b=(0,e.eB)(),_=(0,e.eB)(),M=(0,e.eB)(),I=(0,e.$I)(),l=(0,e.$I)(),m=(0,e.eB)(),u=(0,e.eB)(),d=(0,e.eB)();function s(p,E,T,L,w){return e.eB.setMagnitude(_,T,L/2),e.eB.add(M,E,_),w?e.eB.matchDirection(d,O,_):e.eB.copy(d,O),e.eB.set(m,1,L,1),e.eB.makeRotation(l,d,_),e.$I.scale(p,l,m),e.$I.setTranslation(p,M)}const C=new Int32Array(9);function a(p){const E=function h(p){var E,T,L,w,Q,G,V,U,N;return C[0]=Math.round(1e3*(null!==(E=p.radiusTop)&&void 0!==E?E:t.radiusTop)),C[1]=Math.round(1e3*(null!==(T=p.radiusBottom)&&void 0!==T?T:t.radiusBottom)),C[2]=Math.round(1e3*(null!==(L=p.height)&&void 0!==L?L:t.height)),C[3]=null!==(w=p.radialSegments)&&void 0!==w?w:t.radialSegments,C[4]=null!==(Q=p.heightSegments)&&void 0!==Q?Q:t.heightSegments,C[5]=(null!==(G=p.topCap)&&void 0!==G?G:t.topCap)?1:0,C[6]=(null!==(V=p.bottomCap)&&void 0!==V?V:t.bottomCap)?1:0,C[7]=Math.round(1e3*(null!==(U=p.thetaStart)&&void 0!==U?U:t.thetaStart)),C[8]=Math.round(1e3*(null!==(N=p.thetaLength)&&void 0!==N?N:t.thetaLength)),(0,i.TI)(C)}(p);let T=v.get(E);if(void 0===T){if(p.radialSegments&&p.radialSegments<=4){const L=Math.max(3,p.radialSegments),w=(0,y.My)((0,c.n)(L,!0,p.radiusTop),p);T=(0,r._2)(w,e.$I.rotX90)}else T=function A(p){const{radiusTop:E,radiusBottom:T,height:L,radialSegments:w,heightSegments:Q,topCap:G,bottomCap:V,thetaStart:U,thetaLength:N}={...t,...p},k=[],H=[],$=[];let J=0;const W=[],te=L/2;return function de(){const j=e.eB.zero(),Z=(T-E)/L;for(let q=0;q<=Q;++q){const Y=[],ee=q/Q,g=ee*(T-E)+E;for(let _e=0;_e<=w;++_e){const le=_e/w*N+U,Ae=Math.sin(le),Be=Math.cos(le);H.push(g*Ae,-ee*L+te,g*Be),e.eB.normalize(j,e.eB.set(j,Ae,Z,Be)),$.push(...j),Y.push(J++)}W.push(Y)}for(let q=0;q0&&ye(!0),V&&T>0&&ye(!1),{vertices:new Float32Array(H),normals:new Float32Array($),indices:new Uint32Array(k)};function ye(j){const Z=!0===j?E:T,q=!0===j?1:-1,Y=J;for(let g=1;g<=w;++g)H.push(0,te*q,0),$.push(0,q,0),++J;const ee=J;for(let g=0;g<=w;++g){const xe=g/w*N+U,le=Math.cos(xe),Ae=Math.sin(xe);H.push(Z*Ae,te*q,Z*le),$.push(0,q,0),++J}for(let g=0;g{"use strict";n.d(Ue,{P:()=>c});var e=n(4369),o=n(573),r=n(4439);const t=e.$I.identity(),A=(0,e.eB)();function c(i,v,O,b,_,M){o.P.addPrimitive(i,function y(i,v,O,b,_){return e.eB.add(A,v,O),e.$I.targetTo(i,v,A,b),e.$I.setTranslation(i,v),e.$I.scale(i,i,_)}(t,v,O,b,_),(0,r.q)(M))}},4439:(tn,Ue,n)=>{"use strict";n.d(Ue,{X:()=>i,q:()=>c});var e=n(4369),o=n(573),r=n(9132);const t=new Map,A=e.$I.identity();function c(v){let O=t.get(v);return void 0===O&&(O=(0,r.i)(v),t.set(v,O)),O}function i(v,O,b,_){o.P.addPrimitive(v,function y(v,O,b){return e.$I.scaleUniformly(v,e.$I.fromTranslation(v,O),b)}(A,O,b),c(_))}},4992:(tn,Ue,n)=>{"use strict";n.d(Ue,{Cn:()=>d,WT:()=>_,XP:()=>O,_j:()=>I,bj:()=>m});var e=n(3784),o=n(5384),r=n(127),t=n(4369),A=n(4178),y=n(9909);function c(s,C,h,a,S){const{colorType:D,vertexCount:R,groupCount:f,positionBuffer:p,transformBuffer:E,groupBuffer:T,itemSize:L}=s,w=D.endsWith("Instance"),Q=o.DJ.fromSphere3D((0,o.DJ)(),w?s.boundingSphere:s.invariantBoundingSphere),G=1+C,V=o.DJ.expand((0,o.DJ)(),Q,t.eB.create(G,G,G)),U=1/C,N=o.DJ.scale((0,o.DJ)(),V,U),k=o.DJ.size((0,t.eB)(),N);t.eB.ceil(k,k),t.eB.add(k,k,t.eB.create(2,2,2));const{min:H}=V,[$,J]=k,{width:W,height:te}=(0,A.Ud)(k),de=new Float32Array(W*te*L),ye=new Float32Array(W*te),j=new Uint8Array(W*te*L),Z={array:j,width:W,height:te,filter:"linear"},q=w?s.instanceCount:1,Y=s.colorData.array;function ee(ke,we,Oe){const Se=Math.floor(Oe*$%W/$),Ve=Math.floor(Oe*$/W);return L*(Ve*J*W+we*W+(Se*$+ke))}const[_e,xe,le]=k,Ae=(0,t.eB)();for(let ke=0;ke2)continue;const Lt=2-je,Je=ee(se,ge,Le);for(let en=0;enE)throw new Error("outputStride + itemOffset must NOT be larger than colorStride");const w=s.colorType.endsWith("Instance"),Q=w?s.instanceCount:1,G=(0,e.xg)(Math.max(1,Q*C),L,Uint8Array),{array:V}=G,[U,N]=D,k=R[0],H=t.eB.fromArray((0,t.eB)(),f,0),$=f[3];function J(j,Z,q){const Y=Math.floor(q*U%k/U),ee=Math.floor(q*U/k);return E*(ee*N*k+Z*k+(Y*U+j))}const W=(0,t.eB)(),te=(0,t.eB)(),de=(0,t.eB)(),ye=(0,t.eB)();for(let j=0;j{"use strict";n.d(Ue,{P:()=>C});var e=n(4369),o=n(8382),r=n(9283),t=n(4439),A=n(2802);const y=(0,e.eB)(),c=(0,e.U)(),i=(0,e.eB)(),v=(0,e.eB)(),O=(0,e.eB)(),b=(0,e.eB)(),_=e.eB.fromArray,M=e.eB.triangleNormal,I=e.eB.copy,l=e.eB.transformMat4,m=e.eB.transformMat3,u=e.U.directionTransform,d=o.Gm.add3,s=o.Gm.add;var C;!function(h){function S(G,V,U,N){const{vertices:k,normals:H,indices:$,groups:J,currentGroup:W}=G,te=k.elementCount;d(k,V[0],V[1],V[2]),d(k,U[0],U[1],U[2]),d(k,N[0],N[1],N[2]),M(y,V,U,N);for(let de=0;de<3;++de)d(H,y[0],y[1],y[2]),s(J,W);d($,te,te+1,te+2)}function D(G,V,U,N,k){const{vertices:H,normals:$,indices:J,groups:W,currentGroup:te}=G,de=H.elementCount;d(H,V[0],V[1],V[2]),d(H,U[0],U[1],U[2]),d(H,N[0],N[1],N[2]);for(let ye=0;ye<3;++ye)d($,k[0],k[1],k[2]),s(W,te);d(J,de,de+1,de+2)}function E(G,V,U){const{vertices:N,normals:k,indices:H}=U,{vertices:$,normals:J,indices:W,groups:te,currentGroup:de}=G,ye=$.elementCount,j=u(c,V);for(let Z=0,q=N.length;Z{"use strict";n.d(Ue,{e:()=>s});var s,e=n(9909),o=n(4369),r=n(5384),t=n(4559),A=n(8013),y=n(1888),c=n(2712),i=n(8382),v=n(8277),O=n(3784),b=n(5019),_=n(2075),M=n(9197),I=n(5077),l=n(6115),m=n(4490),u=n(8307),d=n(6022);!function(C){function h(q,Y,ee,g,_e,xe,le){return le?function R(q,Y,ee,g,_e,xe,le){return le.vertexCount=_e,le.triangleCount=xe,e.IQ.update(le.vertexBuffer,q),e.IQ.update(le.indexBuffer,Y),e.IQ.update(le.normalBuffer,ee),e.IQ.update(le.groupBuffer,g),le}(q,Y,ee,g,_e,xe,le):function D(q,Y,ee,g,_e,xe){const le=(0,r.f8)();let Ae,Be=-1,Ce=-1;const Re={kind:"mesh",vertexCount:_e,triangleCount:xe,vertexBuffer:e.IQ.create(q),indexBuffer:e.IQ.create(Y),normalBuffer:e.IQ.create(ee),groupBuffer:e.IQ.create(g),varyingGroup:e.IQ.create(!1),get boundingSphere(){const ke=S(Re);if(ke!==Be){const we=(0,O.sL)(Re.vertexBuffer.ref.value,Re.vertexCount,1);r.f8.copy(le,we),Be=ke}return le},get groupMapping(){return Re.groupBuffer.ref.version!==Ce&&(Ae=(0,t.AA)(Re.groupBuffer.ref.value,Re.vertexCount),Ce=Re.groupBuffer.ref.version),Ae},setBoundingSphere(ke){r.f8.copy(le,ke),Be=S(Re)},meta:{}};return Re}(q,Y,ee,g,_e,xe)}function a(q){return h(q?q.vertexBuffer.ref.value:new Float32Array(0),q?q.indexBuffer.ref.value:new Uint32Array(0),q?q.normalBuffer.ref.value:new Float32Array(0),q?q.groupBuffer.ref.value:new Float32Array(0),0,0,q)}function S(q){return(0,i.TI)([q.vertexCount,q.triangleCount,q.vertexBuffer.ref.version,q.indexBuffer.ref.version,q.normalBuffer.ref.version,q.groupBuffer.ref.version])}C.create=h,C.createEmpty=a,C.computeNormals=function f(q){const{vertexCount:Y,triangleCount:ee}=q,g=q.vertexBuffer.ref.value,_e=q.indexBuffer.ref.value,xe=q.normalBuffer.ref.value.length>=3*Y?q.normalBuffer.ref.value:new Float32Array(3*Y);xe===q.normalBuffer.ref.value&&xe.fill(0,0,3*Y),(0,t.xL)(g,_e,xe,Y,ee),e.IQ.update(q.normalBuffer,xe)},C.checkForDuplicateVertices=function p(q,Y=3){const ee=q.vertexBuffer.ref.value,g=new Map,_e=(Ae,Be)=>`${Ae[0].toFixed(Be)}|${Ae[1].toFixed(Be)}|${Ae[2].toFixed(Be)}`;let xe=0;const le=(0,o.eB)();for(let Ae=0,Be=q.vertexCount;Ae{const Ae=(0,i.bd)(xe,le),Be=g.get(Ae)||0;g.set(Ae,Be+1)};for(let xe=0;xe{1===g&&((0,i.Ao)(ee,_e),Y.add(ee[0]),Y.add(ee[1]))}),Y}function U(q,Y,ee){const g=new Map,_e=(xe,le)=>{g.has(xe)?(0,l.Z2)(g.get(xe),le):g.set(xe,[le])};return Y.forEach(xe=>{const le=q[xe];for(const Ae of le)Y.has(Ae)&&1===ee.get((0,i.bd)(xe,Ae))&&_e(xe,Ae)}),g}function k(q,Y,ee,g){var _e;const{vertexBuffer:xe,indexBuffer:le,normalBuffer:Ae,triangleCount:Be}=q,Ce=xe.ref.value,Re=le.ref.value,ke=Ae.ref.value,we=i.Gm.create(Uint32Array,3,1024,Be);let Oe=0;for(let ge=0;geee.get(ge).length<2).map(ge=>{const Ie=ee.get(ge);return o.eB.fromArray(Se,Ce,3*ge),o.eB.fromArray(Ve,Ce,3*Ie[0]),o.eB.fromArray(Ne,Ce,3*Ie[1]),o.eB.sub(ne,Ve,Se),o.eB.sub(be,Ne,Se),[ge,o.eB.angle(ne,be)]});se.sort(([,ge],[,Ie])=>ge-Ie);for(const[ge,Ie]of se){if(ce.has(ge)||Ie>ve)continue;const Le=ee.get(ge);if(Y[Le[0]].includes(Le[1])&&(null===(_e=ee.get(Le[0]))||void 0===_e||!_e.includes(Le[1]))||(o.eB.fromArray(Se,Ce,3*ge),o.eB.fromArray(Ve,Ce,3*Le[0]),o.eB.fromArray(Ne,Ce,3*Le[1]),o.eB.sub(ne,Ve,Se),o.eB.sub(be,Ne,Se),o.eB.add(ie,ne,be),o.eB.squaredDistance(Se,Ve)>=g))continue;let nt=!1;for(const je of Y[ge])if(!Le.includes(je)&&(o.eB.fromArray(K,Ce,3*je),o.eB.sub(Te,K,Se),o.eB.dot(ie,Te)<0)){nt=!0;break}nt&&(o.eB.fromArray(ue,ke,3*ge),o.eB.triangleNormal(re,Se,Ve,Ne),o.eB.dot(re,ue)>0?i.Gm.add3(we,ge,Le[0],Le[1]):i.Gm.add3(we,Le[1],Le[0],ge),ce.add(ge),ce.add(Le[0]),ce.add(Le[1]),Oe+=1)}const ae=i.Gm.compact(we);return q.triangleCount=Oe,e.IQ.update(le,ae),q}function J(q,Y){const ee=q.vertexCount,g=Y.instanceCount.ref.value,_e=(0,y.tu)(),xe=_e.position,le=_e.normal,Ae=q.vertexBuffer.ref.value,Be=q.normalBuffer.ref.value,Ce=Y.aTransform.ref.value;return(0,y.iQ)(ee,g,1,(ke,we)=>(we<0?(o.eB.fromArray(xe,Ae,3*ke),o.eB.fromArray(le,Be,3*ke)):(o.eB.transformMat4Offset(xe,Ae,Ce,0,3*ke,16*we),o.eB.transformDirectionOffset(le,Be,Ce,0,3*ke,16*we)),_e))}function W(q,Y,ee,g,_e){const{instanceCount:xe,groupCount:le}=ee,Ae=J(q,Y),Be=(0,c.D1)(ee,Ae,g.color),Ce=_e.instanceGranularity?(0,A.Km)(xe,"instance"):(0,A.Km)(xe*le,"groupInstance"),Re=(0,_.WG)(),ke=(0,M.MD)(),we=(0,d.JS)(),Oe=(0,u.IB)(),Se=(0,I.EN)(),Ve={drawCount:3*q.triangleCount,vertexCount:q.vertexCount,groupCount:le,instanceCount:xe},Ne=r.f8.clone(q.boundingSphere),K=(0,O.Ax)(Ne,Y.aTransform.ref.value,xe,0);return{dGeometryType:e.IQ.create("mesh"),aPosition:q.vertexBuffer,aNormal:q.normalBuffer,aGroup:q.groupBuffer,elements:q.indexBuffer,dVaryingGroup:q.varyingGroup,boundingSphere:e.IQ.create(K),invariantBoundingSphere:e.IQ.create(Ne),uInvariantBoundingSphere:e.IQ.create(o.Zb.ofSphere(Ne)),...Be,...Ce,...Re,...ke,...we,...Oe,...Se,...Y,...b.iy.createValues(_e,Ve),uDoubleSided:e.IQ.create(_e.doubleSided),dFlatShaded:e.IQ.create(_e.flatShaded),dFlipSided:e.IQ.create(_e.flipSided),dIgnoreLight:e.IQ.create(_e.ignoreLight),dXrayShaded:e.IQ.create("inverted"===_e.xrayShaded?"inverted":!0===_e.xrayShaded?"on":"off"),dTransparentBackfaces:e.IQ.create(_e.transparentBackfaces),uBumpFrequency:e.IQ.create(_e.bumpFrequency),uBumpAmplitude:e.IQ.create(_e.bumpAmplitude),meta:e.IQ.create(q.meta)}}function Z(q,Y){b.iy.updateRenderableState(q,Y),q.opaque=q.opaque&&!Y.xrayShaded,q.writeDepth=q.opaque}C.transform=function T(q,Y){const ee=q.vertexBuffer.ref.value;if((0,t.pi)(Y,ee,0,q.vertexCount),!o.$I.isTranslationAndUniformScaling(Y)){const g=o.U.directionTransform(E,Y);(0,t.TL)(g,q.normalBuffer.ref.value,0,q.vertexCount)}e.IQ.update(q.vertexBuffer,ee)},C.getOriginalData=function L(q){const{originalData:Y}="kind"in q?q.meta:q.meta.ref.value;return Y},C.uniformTriangleGroup=function w(q,Y=!0){const{indexBuffer:ee,vertexBuffer:g,groupBuffer:_e,normalBuffer:xe,triangleCount:le,vertexCount:Ae}=q,Be=ee.ref.value,Ce=g.ref.value,Re=_e.ref.value,ke=xe.ref.value,we=i.Gm.create(Uint32Array,3,1024,le),Oe=i.Gm.create(Float32Array,3,1024,Ce);Oe.currentIndex=3*Ae,Oe.elementCount=Ae;const Se=i.Gm.create(Float32Array,3,1024,ke);Se.currentIndex=3*Ae,Se.elementCount=Ae;const Ve=i.Gm.create(Float32Array,1,1024,Re);Ve.currentIndex=Ae,Ve.elementCount=Ae;const Ne=(0,o.eB)(),K=(0,o.eB)(),ne=(0,o.eB)(),be=(0,o.eB)(),Te=(0,o.eB)(),ie=(0,o.eB)();function ue(je){o.eB.fromArray(Ne,Ce,3*je),o.eB.fromArray(be,ke,3*je),i.Gm.add3(Oe,Ne[0],Ne[1],Ne[2]),i.Gm.add3(Se,be[0],be[1],be[2])}function re(je,Lt){o.eB.fromArray(Ne,Ce,3*je),o.eB.fromArray(K,Ce,3*Lt),o.eB.scale(Ne,o.eB.add(Ne,Ne,K),.5),o.eB.fromArray(be,ke,3*je),o.eB.fromArray(Te,ke,3*Lt),o.eB.scale(be,o.eB.add(be,be,Te),.5),i.Gm.add3(Oe,Ne[0],Ne[1],Ne[2]),i.Gm.add3(Se,be[0],be[1],be[2])}function ve(je,Lt,Je){o.eB.fromArray(Ne,Ce,3*je),o.eB.fromArray(K,Ce,3*Lt),o.eB.fromArray(ne,Ce,3*Je),o.eB.scale(Ne,o.eB.add(Ne,o.eB.add(Ne,Ne,K),ne),1/3),o.eB.fromArray(be,ke,3*je),o.eB.fromArray(Te,ke,3*Lt),o.eB.fromArray(ie,ke,3*Je),o.eB.scale(be,o.eB.add(be,o.eB.add(be,be,Te),ie),1/3),i.Gm.add3(Oe,Ne[0],Ne[1],Ne[2]),i.Gm.add3(Se,be[0],be[1],be[2])}function ce(je,Lt,Je,en,Bt){++ae,ue(je),re(je,Lt),re(je,Je),i.Gm.add3(we,se,se+1,se+2);for(let pn=0;pn<3;++pn)i.Gm.add(Ve,en);se+=3,ae+=2,ue(Lt),ue(Je),re(je,Lt),re(je,Je),i.Gm.add3(we,se,se+1,se+3),i.Gm.add3(we,se,se+3,se+2);for(let pn=0;pn<4;++pn)i.Gm.add(Ve,Bt);se+=4}let se=Ae,ae=0;if(Y)for(let je=0,Lt=le;je{const Oe=q.vertexBuffer.ref.value;Re.set(Oe),Y.forEach((Ve,Ne)=>{if(2!==Ve.length)return;o.eB.fromArray(xe,Oe,3*Ne),o.eB.fromArray(le,Oe,3*Ve[0]),o.eB.fromArray(Ae,Oe,3*Ve[1]);const K=1/o.eB.distance(xe,le),ne=1/o.eB.distance(xe,Ae);o.eB.scale(le,le,K),o.eB.scale(Ae,Ae,ne),o.eB.add(Be,le,Ae),o.eB.scale(Be,Be,1/(K+ne)),o.eB.sub(Be,Be,xe),o.eB.scale(Be,Be,we),o.eB.add(Be,xe,Be),o.eB.toArray(Be,Re,3*Ne)});const Se=q.vertexBuffer.ref.value;e.IQ.update(q.vertexBuffer,Re),Re=Se};for(let we=0;we{"use strict";n.d(Ue,{MD:()=>c,WG:()=>O,qp:()=>y,zj:()=>i});var e=n(7187),o=n(4369),r=n(3784),t=n(190),A=n(4648);function y(b,_,M,I){for(let l=_;l0),e.IQ.updateIfChanged(M.dOverpaintType,_),M):{tOverpaint:e.IQ.create(I),uOverpaintTexDim:e.IQ.create(o.ZY.create(I.width,I.height)),dOverpaint:e.IQ.create(b>0),tOverpaintGrid:e.IQ.create((0,A.z6)()),uOverpaintGridDim:e.IQ.create(o.eB.create(1,1,1)),uOverpaintGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dOverpaintType:e.IQ.create(_),uOverpaintStrength:e.IQ.create(1)}}const v={array:new Uint8Array(4),width:1,height:1};function O(b){return b?(e.IQ.update(b.tOverpaint,v),e.IQ.update(b.uOverpaintTexDim,o.ZY.create(1,1)),b):{tOverpaint:e.IQ.create(v),uOverpaintTexDim:e.IQ.create(o.ZY.create(1,1)),dOverpaint:e.IQ.create(!1),tOverpaintGrid:e.IQ.create((0,A.z6)()),uOverpaintGridDim:e.IQ.create(o.eB.create(1,1,1)),uOverpaintGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dOverpaintType:e.IQ.create("groupInstance"),uOverpaintStrength:e.IQ.create(1)}}},5299:(tn,Ue,n)=>{"use strict";n.d(Ue,{O:()=>d});var d,e=n(9909),o=n(4369),r=n(4559),t=n(2712),A=n(8013),y=n(7684),c=n(1888),i=n(8277),v=n(3784),O=n(5384),b=n(5019),_=n(2075),M=n(9197),I=n(8382),l=n(5077),m=n(8307),u=n(6022);!function(s){function C(G,V,U,N){return N?function D(G,V,U,N){return N.pointCount=U,e.IQ.update(N.centerBuffer,G),e.IQ.update(N.groupBuffer,V),N}(G,V,U,N):function S(G,V,U){const N=(0,O.f8)();let k,H=-1,$=-1;const J={kind:"points",pointCount:U,centerBuffer:e.IQ.create(G),groupBuffer:e.IQ.create(V),get boundingSphere(){const W=a(J);if(W!==H){const te=(0,v.sL)(J.centerBuffer.ref.value,J.pointCount,1);O.f8.copy(N,te),H=W}return N},get groupMapping(){return J.groupBuffer.ref.version!==$&&(k=(0,r.AA)(J.groupBuffer.ref.value,J.pointCount),$=J.groupBuffer.ref.version),k},setBoundingSphere(W){O.f8.copy(N,W),H=a(J)}};return J}(G,V,U)}function h(G){return C(G?G.centerBuffer.ref.value:new Float32Array(0),G?G.groupBuffer.ref.value:new Float32Array(0),0,G)}function a(G){return(0,I.TI)([G.pointCount,G.centerBuffer.ref.version,G.groupBuffer.ref.version])}function f(G,V){const U=G.pointCount,N=V.instanceCount.ref.value,k=(0,c.tu)(),H=k.position,$=G.centerBuffer.ref.value,J=V.aTransform.ref.value;return(0,c.iQ)(U,N,1,(te,de)=>(de<0?o.eB.fromArray(H,$,3*te):o.eB.transformMat4Offset(H,$,J,0,3*te,16*de),k))}function p(G,V,U,N,k){const{instanceCount:H,groupCount:$}=U,J=f(G,V),W=(0,t.D1)(U,J,N.color),te=(0,y.v3)(U,N.size),de=k.instanceGranularity?(0,A.Km)(H,"instance"):(0,A.Km)(H*$,"groupInstance"),ye=(0,_.WG)(),j=(0,M.MD)(),Z=(0,u.JS)(),q=(0,m.IB)(),Y=(0,l.EN)(),ee={drawCount:G.pointCount,vertexCount:G.pointCount,groupCount:$,instanceCount:H},g=O.f8.clone(G.boundingSphere),_e=(0,v.Ax)(g,V.aTransform.ref.value,H,0);return{dGeometryType:e.IQ.create("points"),aPosition:G.centerBuffer,aGroup:G.groupBuffer,boundingSphere:e.IQ.create(_e),invariantBoundingSphere:e.IQ.create(g),uInvariantBoundingSphere:e.IQ.create(o.Zb.ofSphere(g)),...W,...te,...de,...ye,...j,...Z,...q,...Y,...V,...b.iy.createValues(k,ee),uSizeFactor:e.IQ.create(k.sizeFactor),dPointSizeAttenuation:e.IQ.create(k.pointSizeAttenuation),dPointStyle:e.IQ.create(k.pointStyle)}}function Q(G,V){b.iy.updateRenderableState(G,V),G.opaque=G.opaque&&"fuzzy"!==V.pointStyle,G.writeDepth=G.opaque}s.create=C,s.createEmpty=h,s.transform=function R(G,V){const U=G.centerBuffer.ref.value;(0,r.pi)(V,U,0,G.pointCount),e.IQ.update(G.centerBuffer,U)},s.StyleTypes={square:"Square",circle:"Circle",fuzzy:"Fuzzy"},s.StyleTypeNames=Object.keys(s.StyleTypes),s.Params={...b.iy.Params,sizeFactor:i.t.Numeric(3,{min:0,max:10,step:.1}),pointSizeAttenuation:i.t.Boolean(!1),pointStyle:i.t.Select("square",i.t.objectToOptions(s.StyleTypes))},s.Utils={Params:s.Params,createEmpty:h,createValues:p,createValuesSimple:function E(G,V,U,N,k){const H=b.iy.createSimple(U,N,k),$={...i.t.getDefaultValues(s.Params),...V};return p(G,H.transform,H.locationIterator,H.theme,$)},updateValues:function T(G,V){b.iy.updateValues(G,V),e.IQ.updateIfChanged(G.uSizeFactor,V.sizeFactor),e.IQ.updateIfChanged(G.dPointSizeAttenuation,V.pointSizeAttenuation),e.IQ.updateIfChanged(G.dPointStyle,V.pointStyle)},updateBoundingSphere:function L(G,V){const U=O.f8.clone(V.boundingSphere),N=(0,v.Ax)(U,G.aTransform.ref.value,G.instanceCount.ref.value,0);O.f8.equals(N,G.boundingSphere.ref.value)||e.IQ.update(G.boundingSphere,N),O.f8.equals(U,G.invariantBoundingSphere.ref.value)||(e.IQ.update(G.invariantBoundingSphere,U),e.IQ.update(G.uInvariantBoundingSphere,o.Zb.fromSphere(G.uInvariantBoundingSphere.ref.value,U)))},createRenderableState:function w(G){const V=b.iy.createRenderableState(G);return Q(V,G),V},updateRenderableState:Q,createPositionIterator:f}}(d||(d={}))},7684:(tn,Ue,n)=>{"use strict";n.d(Ue,{v3:()=>c,yx:()=>v});var e=n(9909),o=n(4369),r=n(3784),t=n(364),A=n(542),y=n(4951);function c(d,s,C){switch(A.V.getGranularity(d,s.granularity)){case"uniform":return function M(d,s,C){return function _(d,s){return s?(e.IQ.update(s.uSize,d),e.IQ.updateIfChanged(s.dSizeType,"uniform"),s):{uSize:e.IQ.create(d),tSize:e.IQ.create(O),uSizeTexDim:e.IQ.create(o.ZY.create(1,1)),dSizeType:e.IQ.create("uniform")}}(s(t.LU),C)}(0,s.size,C);case"group":return function m(d,s,C){const{groupCount:h}=d,a=(0,r.xg)(Math.max(1,h),3,Uint8Array,C&&C.tSize.ref.value.array);for(d.reset();d.hasNext&&!d.isNextNewInstance;){const S=d.move();(0,y.Gu)(s(S.location)*i,a.array,3*S.groupIndex)}return I(a,"group",C)}(d,s.size,C);case"groupInstance":return function u(d,s,C){const{groupCount:h,instanceCount:a}=d,D=(0,r.xg)(Math.max(1,a*h),3,Uint8Array,C&&C.tSize.ref.value.array);for(d.reset();d.hasNext;){const R=d.move();(0,y.Gu)(s(R.location)*i,D.array,3*R.index)}return I(D,"groupInstance",C)}(d,s.size,C);case"instance":return function l(d,s,C){const{instanceCount:h}=d,a=(0,r.xg)(Math.max(1,h),3,Uint8Array,C&&C.tSize.ref.value.array);for(d.reset();d.hasNext&&!d.isNextNewInstance;){const S=d.move();(0,y.Gu)(s(S.location)*i,a.array,3*S.instanceIndex),d.skipInstance()}return I(a,"instance",C)}(d,s.size,C)}}const i=100;function v(d){switch(d.dSizeType.ref.value){case"uniform":return d.uSize.ref.value;case"instance":case"group":case"groupInstance":let C=0;const h=d.tSize.ref.value.array;for(let a=0,S=h.length;a{"use strict";n.d(Ue,{v:()=>d});var d,e=n(9909),o=n(8277),r=n(1888),t=n(2712),A=n(8013),y=n(3784),c=n(5384),i=n(7684),v=n(5019),O=n(2075),b=n(9197),_=n(8382),M=n(4559),I=n(5077),l=n(4369),m=n(8307),u=n(6022);!function(s){function C(H,$,J,W){return W?function D(H,$,J,W){return W.sphereCount=J,e.IQ.update(W.centerBuffer,H),e.IQ.update(W.groupBuffer,$),W.shaderData.update(),W}(H,$,J,W):function S(H,$,J){const W=(0,c.f8)();let te,de=-1,ye=-1;const j=e.IQ.create((0,y.xg)(1,4,Float32Array)),Z=e.IQ.create(l.ZY.create(0,0)),q=e.IQ.create([]),Y=e.IQ.create(0),ee={kind:"spheres",sphereCount:J,centerBuffer:e.IQ.create(H),groupBuffer:e.IQ.create($),get boundingSphere(){const g=a(ee);if(g!==de){const _e=(0,y.sL)(ee.centerBuffer.ref.value,ee.sphereCount,1);c.f8.copy(W,_e),de=g}return W},get groupMapping(){return ee.groupBuffer.ref.version!==ye&&(te=(0,M.AA)(ee.groupBuffer.ref.value,ee.sphereCount),ye=ee.groupBuffer.ref.version),te},setBoundingSphere(g){c.f8.copy(W,g),de=a(ee)},shaderData:{positionGroup:j,texDim:Z,lodLevels:q,sizeFactor:Y,update(g){var _e,xe;const le=null!==(_e=g?.lodLevels)&&void 0!==_e?_e:E(q.ref.value),Ae=null!==(xe=g?.sizeFactor)&&void 0!==xe?xe:Y.ref.value,Be=L(le,Ae),Ce=(0,y.xg)(ee.sphereCount,4,Float32Array,j.ref.value.array),Re=R(Ce,ee.centerBuffer.ref.value,ee.groupBuffer.ref.value,ee.sphereCount,Be),ke=Re?p(le,Ae,Re,ee.sphereCount):[];e.IQ.update(j,Ce),e.IQ.update(Z,l.ZY.set(Z.ref.value,Ce.width,Ce.height)),e.IQ.update(q,ke),e.IQ.update(Y,Ae)}}};return ee.shaderData.update(),ee}(H,$,J)}function h(H){return C(H?H.centerBuffer.ref.value:new Float32Array(0),H?H.groupBuffer.ref.value:new Float32Array(0),0,H)}function a(H){return(0,_.TI)([H.sphereCount,H.centerBuffer.ref.version,H.groupBuffer.ref.version])}function R(H,$,J,W,te){const{array:de}=H;if(0===te.length){for(let Z=0;Z{const ye=T(te,$);return[te.minDistance,te.maxDistance,te.overlap,J[J.length-1-de],Math.pow(Math.min(W,ye),1/te.scaleBias),te.stride,te.scaleBias]})}function E(H){return H.map($=>({minDistance:$[0],maxDistance:$[1],overlap:$[2],stride:$[5],scaleBias:$[6]}))}function T(H,$){return Math.max(1,Math.round(H.stride/Math.pow($,H.scaleBias)))}function L(H,$){return H.map(J=>T(J,$)).reverse()}function w(H,$){const J=H.sphereCount,W=$.instanceCount.ref.value,te=(0,r.tu)(),de=te.position,ye=H.centerBuffer.ref.value,j=$.aTransform.ref.value;return(0,r.iQ)(J,W,1,(q,Y)=>(Y<0?l.eB.fromArray(de,ye,3*q):l.eB.transformMat4Offset(de,ye,j,0,3*q,16*Y),te))}function Q(H,$,J,W,te){const{instanceCount:de,groupCount:ye}=J,j=w(H,$),Z=(0,t.D1)(J,j,W.color),q=(0,i.v3)(J,W.size),Y=te.instanceGranularity?(0,A.Km)(de,"instance"):(0,A.Km)(de*ye,"groupInstance"),ee=(0,O.WG)(),g=(0,b.MD)(),_e=(0,u.JS)(),xe=(0,m.IB)(),le=(0,I.EN)(),Ae={drawCount:2*H.sphereCount*3,vertexCount:6*H.sphereCount,groupCount:ye,instanceCount:de},Be=H.boundingSphere.radius?(0,i.yx)(q)*te.sizeFactor:0,Ce=c.f8.expand((0,c.f8)(),H.boundingSphere,Be),Re=(0,y.Ax)(Ce,$.aTransform.ref.value,de,0);return H.shaderData.update({lodLevels:te.lodLevels,sizeFactor:te.sizeFactor}),{dGeometryType:e.IQ.create("spheres"),uTexDim:H.shaderData.texDim,tPositionGroup:H.shaderData.positionGroup,boundingSphere:e.IQ.create(Re),invariantBoundingSphere:e.IQ.create(Ce),uInvariantBoundingSphere:e.IQ.create(l.Zb.ofSphere(Ce)),...Z,...q,...Y,...ee,...g,..._e,...xe,...le,...$,padding:e.IQ.create(Be),...v.iy.createValues(te,Ae),uSizeFactor:H.shaderData.sizeFactor,uDoubleSided:e.IQ.create(te.doubleSided),dIgnoreLight:e.IQ.create(te.ignoreLight),dXrayShaded:e.IQ.create("inverted"===te.xrayShaded?"inverted":!0===te.xrayShaded?"on":"off"),dTransparentBackfaces:e.IQ.create(te.transparentBackfaces),dSolidInterior:e.IQ.create(te.solidInterior),dClipPrimitive:e.IQ.create(te.clipPrimitive),dApproximate:e.IQ.create(te.approximate),uAlphaThickness:e.IQ.create(te.alphaThickness),uBumpFrequency:e.IQ.create(te.bumpFrequency),uBumpAmplitude:e.IQ.create(te.bumpAmplitude),lodLevels:H.shaderData.lodLevels,centerBuffer:H.centerBuffer,groupBuffer:H.groupBuffer}}function k(H,$){v.iy.updateRenderableState(H,$),H.opaque=H.opaque&&!$.xrayShaded,H.writeDepth=H.opaque}s.create=C,s.createEmpty=h,s.Params={...v.iy.Params,sizeFactor:o.t.Numeric(1,{min:0,max:10,step:.1}),doubleSided:o.t.Boolean(!1,v.iy.CustomQualityParamInfo),ignoreLight:o.t.Boolean(!1,v.iy.ShadingCategory),xrayShaded:o.t.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],v.iy.ShadingCategory),transparentBackfaces:o.t.Select("off",o.t.arrayToOptions(["off","on","opaque"]),v.iy.ShadingCategory),solidInterior:o.t.Boolean(!0,v.iy.ShadingCategory),clipPrimitive:o.t.Boolean(!1,{...v.iy.ShadingCategory,description:"Clip whole sphere instead of cutting it."}),approximate:o.t.Boolean(!1,{...v.iy.ShadingCategory,description:"Faster rendering, but has artifacts."}),alphaThickness:o.t.Numeric(0,{min:0,max:20,step:1},{...v.iy.ShadingCategory,description:"If not zero, adjusts alpha for radius."}),bumpFrequency:o.t.Numeric(0,{min:0,max:10,step:.1},v.iy.ShadingCategory),bumpAmplitude:o.t.Numeric(1,{min:0,max:5,step:.1},v.iy.ShadingCategory),lodLevels:o.t.ObjectList({minDistance:o.t.Numeric(0),maxDistance:o.t.Numeric(0),overlap:o.t.Numeric(0),stride:o.t.Numeric(0),scaleBias:o.t.Numeric(3,{min:.1,max:10,step:.1})},H=>`${H.stride}`,{...v.iy.CullingLodCategory,defaultValue:[]})},s.Utils={Params:s.Params,createEmpty:h,createValues:Q,createValuesSimple:function G(H,$,J,W,te){const de=v.iy.createSimple(J,W,te),ye={...o.t.getDefaultValues(s.Params),...$};return Q(H,de.transform,de.locationIterator,de.theme,ye)},updateValues:function V(H,$){v.iy.updateValues(H,$),e.IQ.updateIfChanged(H.uSizeFactor,$.sizeFactor),e.IQ.updateIfChanged(H.uDoubleSided,$.doubleSided),e.IQ.updateIfChanged(H.dIgnoreLight,$.ignoreLight),e.IQ.updateIfChanged(H.dXrayShaded,"inverted"===$.xrayShaded?"inverted":!0===$.xrayShaded?"on":"off"),e.IQ.updateIfChanged(H.dTransparentBackfaces,$.transparentBackfaces),e.IQ.updateIfChanged(H.dSolidInterior,$.solidInterior),e.IQ.updateIfChanged(H.dClipPrimitive,$.clipPrimitive),e.IQ.updateIfChanged(H.dApproximate,$.approximate),e.IQ.updateIfChanged(H.uAlphaThickness,$.alphaThickness),e.IQ.updateIfChanged(H.uBumpFrequency,$.bumpFrequency),e.IQ.updateIfChanged(H.uBumpAmplitude,$.bumpAmplitude);const J=E(H.lodLevels.ref.value);if(!function f(H,$){if(H.length!==$.length)return!1;for(let J=0,W=H.length;J{"use strict";n.d(Ue,{C2:()=>c,IB:()=>O,fZ:()=>i,mx:()=>y});var e=n(7187),o=n(4369),r=n(3784),t=n(4648),A=n(6765);function y(b,_,M,I){for(let l=_;l0),e.IQ.updateIfChanged(M.dSubstanceType,_),M):{tSubstance:e.IQ.create(I),uSubstanceTexDim:e.IQ.create(o.ZY.create(I.width,I.height)),dSubstance:e.IQ.create(b>0),tSubstanceGrid:e.IQ.create((0,t.z6)()),uSubstanceGridDim:e.IQ.create(o.eB.create(1,1,1)),uSubstanceGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dSubstanceType:e.IQ.create(_),uSubstanceStrength:e.IQ.create(1)}}const v={array:new Uint8Array(4),width:1,height:1};function O(b){return b?(e.IQ.update(b.tSubstance,v),e.IQ.update(b.uSubstanceTexDim,o.ZY.create(1,1)),b):{tSubstance:e.IQ.create(v),uSubstanceTexDim:e.IQ.create(o.ZY.create(1,1)),dSubstance:e.IQ.create(!1),tSubstanceGrid:e.IQ.create((0,t.z6)()),uSubstanceGridDim:e.IQ.create(o.eB.create(1,1,1)),uSubstanceGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dSubstanceType:e.IQ.create("groupInstance"),uSubstanceStrength:e.IQ.create(1)}}},331:(tn,Ue,n)=>{"use strict";n.d(Ue,{nZ:()=>i,pS:()=>c});var e=n(8277);function o(I,l,m,u,d,s,C){for(let h=0;hu&&(this.currentX=0,this.currentY+=this.scratchH),this.currentY+this.scratchH>d)return console.warn("canvas to small"),this.placeholder;this.mapped[l]={x:this.currentX,y:this.currentY,w:this.scratchW,h:this.scratchH,nw:this.scratchW/this.lineHeight,nh:this.scratchH/this.lineHeight};for(let C=0;C{"use strict";n.d(Ue,{t:()=>O});var e=n(8277),o=n(8382),r=n(4255),t=n(331),A=n(1372);const y=new Uint16Array([0,1,2,1,3,2]),c=o.Gm.add3,i=o.Gm.add2,v=o.Gm.add;var O;(O||(O={})).create=function _(M={},I=2048,l=1024,m){I*=2,l*=2;const u=o.Gm.create(Float32Array,3,l,m?m.centerBuffer.ref.value:I),d=o.Gm.create(Float32Array,2,l,m?m.mappingBuffer.ref.value:I),s=o.Gm.create(Float32Array,1,l,m?m.depthBuffer.ref.value:I),C=o.Gm.create(Uint32Array,3,l,m?m.indexBuffer.ref.value:I),h=o.Gm.create(Float32Array,1,l,m?m.groupBuffer.ref.value:I),a=o.Gm.create(Float32Array,2,l,m?m.tcoordBuffer.ref.value:I),S={...e.t.getDefaultValues(r.E.Params),...M},{attachment:D,background:R,backgroundMargin:f,tether:p,tetherLength:E,tetherBaseWidth:T}=S,L=(0,t.pS)(S),w=.4*f,Q=L.buffer/L.lineHeight,G=(V,U,N,k,H)=>{c(u,V,U,N),v(s,k),v(h,H)};return{add:(V,U,N,k,H,$,J)=>{let W=0;const te=V.length;for(let _e=0;_e{const V=L.texture,U=o.Gm.compact(u,!0),N=o.Gm.compact(d,!0),k=o.Gm.compact(s,!0),H=o.Gm.compact(C,!0),$=o.Gm.compact(h,!0),J=o.Gm.compact(a,!0);return r.E.create(V,U,N,k,H,$,J,C.elementCount/2,m)}}}},4255:(tn,Ue,n)=>{"use strict";n.d(Ue,{E:()=>a});var a,e=n(8277),o=n(9909),r=n(1888),t=n(2712),A=n(7684),y=n(8013),c=n(2745),i=n(5384),v=n(3784),O=n(190),b=n(4369),_=n(331),M=n(127),I=n(5019),l=n(2075),m=n(9197),u=n(8382),d=n(4559),s=n(5077),C=n(8307),h=n(6022);function S(D,R,f,p){let E=0,T=0;for(let L=0,w=4*f;LE&&(E=G);const V=Math.abs(D[Q+1]);V>E&&(E=V);const U=Math.abs(R[L]);U>T&&(T=U)}return Math.max(T,p+p*E)}!function(D){function R(k,H,$,J,W,te,de,ye,j){return j?function T(k,H,$,J,W,te,de,ye,j){return j.charCount=ye,o.IQ.update(j.fontTexture,k),o.IQ.update(j.centerBuffer,H),o.IQ.update(j.mappingBuffer,$),o.IQ.update(j.depthBuffer,J),o.IQ.update(j.indexBuffer,W),o.IQ.update(j.groupBuffer,te),o.IQ.update(j.tcoordBuffer,de),j}(k,H,$,J,W,te,de,ye,j):function E(k,H,$,J,W,te,de,ye){const j=(0,i.f8)();let Z,q=-1,Y=-1;const ee={kind:"text",charCount:ye,fontTexture:o.IQ.create(k),centerBuffer:o.IQ.create(H),mappingBuffer:o.IQ.create($),depthBuffer:o.IQ.create(J),indexBuffer:o.IQ.create(W),groupBuffer:o.IQ.create(te),tcoordBuffer:o.IQ.create(de),get boundingSphere(){const g=p(ee);if(g!==q){const _e=(0,v.sL)(ee.centerBuffer.ref.value,4*ee.charCount,4);i.f8.copy(j,_e),q=g}return j},get groupMapping(){return ee.groupBuffer.ref.version!==Y&&(Z=(0,d.AA)(ee.groupBuffer.ref.value,ee.charCount,4),Y=ee.groupBuffer.ref.version),Z},setBoundingSphere(g){i.f8.copy(j,g),q=p(ee)}};return ee}(k,H,$,J,W,te,de,ye)}function f(k){return R(k?k.fontTexture.ref.value:(0,v.xg)(0,1,Uint8Array),k?k.centerBuffer.ref.value:new Float32Array(0),k?k.mappingBuffer.ref.value:new Float32Array(0),k?k.depthBuffer.ref.value:new Float32Array(0),k?k.indexBuffer.ref.value:new Uint32Array(0),k?k.groupBuffer.ref.value:new Float32Array(0),k?k.tcoordBuffer.ref.value:new Float32Array(0),0,k)}function p(k){return(0,u.TI)([k.charCount,k.fontTexture.ref.version,k.centerBuffer.ref.version,k.mappingBuffer.ref.version,k.depthBuffer.ref.version,k.indexBuffer.ref.version,k.groupBuffer.ref.version,k.tcoordBuffer.ref.version])}function L(k,H){const $=4*k.charCount,J=H.instanceCount.ref.value,W=(0,r.tu)(),te=W.position,de=k.centerBuffer.ref.value,ye=H.aTransform.ref.value;return(0,r.iQ)($,J,4,(Z,q)=>(q<0?b.eB.fromArray(te,de,3*Z):b.eB.transformMat4Offset(te,de,ye,0,3*Z,16*q),W))}function w(k,H,$,J,W){const{instanceCount:te,groupCount:de}=$,ye=L(k,H),j=(0,t.D1)($,ye,J.color),Z=(0,A.v3)($,J.size),q=W.instanceGranularity?(0,y.Km)(te,"instance"):(0,y.Km)(te*de,"groupInstance"),Y=(0,l.WG)(),ee=(0,m.MD)(),g=(0,h.JS)(),_e=(0,C.IB)(),xe=(0,s.EN)(),le={drawCount:2*k.charCount*3,vertexCount:4*k.charCount,groupCount:de,instanceCount:te},Ae=S(k.mappingBuffer.ref.value,k.depthBuffer.ref.value,k.charCount,(0,A.yx)(Z)),Be=i.f8.expand((0,i.f8)(),k.boundingSphere,Ae),Ce=(0,v.Ax)(Be,H.aTransform.ref.value,te,0);return{dGeometryType:o.IQ.create("text"),aPosition:k.centerBuffer,aMapping:k.mappingBuffer,aDepth:k.depthBuffer,aGroup:k.groupBuffer,elements:k.indexBuffer,boundingSphere:o.IQ.create(Ce),invariantBoundingSphere:o.IQ.create(Be),uInvariantBoundingSphere:o.IQ.create(b.Zb.ofSphere(Be)),...j,...Z,...q,...Y,...ee,...g,..._e,...xe,...H,aTexCoord:k.tcoordBuffer,tFont:k.fontTexture,padding:o.IQ.create(Ae),...I.iy.createValues(W,le),uSizeFactor:o.IQ.create(W.sizeFactor),uBorderWidth:o.IQ.create((0,M.qE)(W.borderWidth,0,.5)),uBorderColor:o.IQ.create(O.Q1.toArrayNormalized(W.borderColor,b.eB.zero(),0)),uOffsetX:o.IQ.create(W.offsetX),uOffsetY:o.IQ.create(W.offsetY),uOffsetZ:o.IQ.create(W.offsetZ),uBackgroundColor:o.IQ.create(O.Q1.toArrayNormalized(W.backgroundColor,b.eB.zero(),0)),uBackgroundOpacity:o.IQ.create(W.backgroundOpacity)}}function N(k,H){I.iy.updateRenderableState(k,H),k.pickable=!1,k.opaque=!1,k.writeDepth=!0}D.create=R,D.createEmpty=f,D.Params={...I.iy.Params,..._.nZ,sizeFactor:e.t.Numeric(1,{min:0,max:10,step:.1}),borderWidth:e.t.Numeric(0,{min:0,max:.5,step:.01}),borderColor:e.t.Color(c.s.grey),offsetX:e.t.Numeric(0,{min:0,max:10,step:.1}),offsetY:e.t.Numeric(0,{min:0,max:10,step:.1}),offsetZ:e.t.Numeric(0,{min:0,max:10,step:.1}),background:e.t.Boolean(!1),backgroundMargin:e.t.Numeric(.2,{min:0,max:1,step:.01}),backgroundColor:e.t.Color(c.s.grey),backgroundOpacity:e.t.Numeric(1,{min:0,max:1,step:.01}),tether:e.t.Boolean(!1),tetherLength:e.t.Numeric(1,{min:0,max:5,step:.1}),tetherBaseWidth:e.t.Numeric(.3,{min:0,max:1,step:.01}),attachment:e.t.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"]])},D.Utils={Params:D.Params,createEmpty:f,createValues:w,createValuesSimple:function Q(k,H,$,J,W){const te=I.iy.createSimple($,J,W),de={...e.t.getDefaultValues(D.Params),...H};return w(k,te.transform,te.locationIterator,te.theme,de)},updateValues:function G(k,H){I.iy.updateValues(k,H),o.IQ.updateIfChanged(k.uSizeFactor,H.sizeFactor),o.IQ.updateIfChanged(k.uBorderWidth,H.borderWidth),O.Q1.fromNormalizedArray(k.uBorderColor.ref.value,0)!==H.borderColor&&(O.Q1.toArrayNormalized(H.borderColor,k.uBorderColor.ref.value,0),o.IQ.update(k.uBorderColor,k.uBorderColor.ref.value)),o.IQ.updateIfChanged(k.uOffsetX,H.offsetX),o.IQ.updateIfChanged(k.uOffsetY,H.offsetY),o.IQ.updateIfChanged(k.uOffsetZ,H.offsetZ),O.Q1.fromNormalizedArray(k.uBackgroundColor.ref.value,0)!==H.backgroundColor&&(O.Q1.toArrayNormalized(H.backgroundColor,k.uBackgroundColor.ref.value,0),o.IQ.update(k.uBackgroundColor,k.uBackgroundColor.ref.value)),o.IQ.updateIfChanged(k.uBackgroundOpacity,H.backgroundOpacity)},updateBoundingSphere:function V(k,H){const $=S(k.aMapping.ref.value,k.aDepth.ref.value,H.charCount,(0,A.yx)(k)),J=i.f8.expand((0,i.f8)(),H.boundingSphere,$),W=(0,v.Ax)(J,k.aTransform.ref.value,k.instanceCount.ref.value,0);i.f8.equals(W,k.boundingSphere.ref.value)||o.IQ.update(k.boundingSphere,W),i.f8.equals(J,k.invariantBoundingSphere.ref.value)||(o.IQ.update(k.invariantBoundingSphere,J),o.IQ.update(k.uInvariantBoundingSphere,b.Zb.fromSphere(k.uInvariantBoundingSphere.ref.value,J))),o.IQ.update(k.padding,$)},createRenderableState:function U(k){const H=I.iy.createRenderableState(k);return N(H,k),H},updateRenderableState:N,createPositionIterator:L}}(a||(a={}))},6280:(tn,Ue,n)=>{"use strict";n.d(Ue,{_i:()=>V,ij:()=>J,FB:()=>N,DG:()=>te,NQ:()=>H});var e=n(9909),o=n(9421),r=n(4648),t=n(2897),A=n(4143),y=n(4511),c=n(9387);const i="\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform sampler2D tCount;\nuniform vec2 uTexSize;\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n vec4 color = texture2D(tColor, coords);\n float count = texture2D(tCount, coords).r;\n\n gl_FragColor = color / count;\n}\n";var v=n(9007),O=n(4369),b=n(5384);const _="\nprecision highp float;\n\nvarying vec3 vPosition;\nvarying vec4 vColor;\n\nuniform float uCurrentSlice;\nuniform float uCurrentX;\nuniform float uCurrentY;\nuniform float uResolution;\n\nconst float p = 2.0;\n\nvoid main() {\n vec2 v = gl_FragCoord.xy - vec2(uCurrentX, uCurrentY) - 0.5;\n vec3 fragPos = vec3(v.x, v.y, uCurrentSlice);\n float dist = distance(fragPos, vPosition);\n if (dist > p) discard;\n\n float f = p - dist;\n gl_FragColor = vColor * f;\n gl_FragData[1] = vec4(f);\n}\n",M="\nprecision highp float;\n\n#include common\n#include read_from_texture\n\nuniform int uGroupCount;\n\nattribute float aSample;\n#define SampleID int(aSample)\n\nattribute mat4 aTransform;\nattribute float aInstance;\n\nuniform vec2 uGeoTexDim;\nuniform sampler2D tPosition;\nuniform sampler2D tGroup;\n\nuniform vec2 uColorTexDim;\nuniform sampler2D tColor;\n\nvarying vec3 vPosition;\nvarying vec4 vColor;\n\nuniform vec3 uBboxSize;\nuniform vec3 uBboxMin;\nuniform float uResolution;\n\nvoid main() {\n vec3 position = readFromTexture(tPosition, SampleID, uGeoTexDim).xyz;\n float group = unpackRGBToInt(readFromTexture(tGroup, SampleID, uGeoTexDim).rgb);\n\n position = (aTransform * vec4(position, 1.0)).xyz;\n gl_PointSize = 7.0;\n vPosition = (position - uBboxMin) / uResolution;\n gl_Position = vec4(((position - uBboxMin) / uBboxSize) * 2.0 - 1.0, 1.0);\n\n #if defined(dColorType_group)\n vColor = readFromTexture(tColor, group, uColorTexDim);\n #elif defined(dColorType_groupInstance)\n vColor = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim);\n #endif\n}\n";var I=n(8437),l=n(2629);const m={drawCount:(0,y.Xb)("number"),instanceCount:(0,y.Xb)("number"),stride:(0,y.Xb)("number"),uGroupCount:(0,y.w5)("i","material"),aTransform:(0,y.Yz)("float32",16,1),aInstance:(0,y.Yz)("float32",1,1),aSample:(0,y.Yz)("float32",1,0),uGeoTexDim:(0,y.w5)("v2","material"),tPosition:(0,y.$G)("texture","rgba","float","nearest","material"),tGroup:(0,y.$G)("texture","rgba","float","nearest","material"),uColorTexDim:(0,y.w5)("v2","material"),tColor:(0,y.$G)("texture","rgba","ubyte","nearest","material"),dColorType:(0,y.$F)("string",["group","groupInstance","vertex","vertexInstance"]),uCurrentSlice:(0,y.w5)("f"),uCurrentX:(0,y.w5)("f"),uCurrentY:(0,y.w5)("f"),uBboxMin:(0,y.w5)("v3","material"),uBboxSize:(0,y.w5)("v3","material"),uResolution:(0,y.w5)("f","material")},u="color-accumulate",d="color-count";function s(de,ye){const j=new Float32Array(de);for(let Z=0;Zee.drawCount.ref.value||q!==ee.stride.ref.value)&&e.IQ.update(ee.aSample,s(g,q)),e.IQ.updateIfChanged(ee.drawCount,g),e.IQ.updateIfChanged(ee.instanceCount,ye.instanceCount),e.IQ.updateIfChanged(ee.stride,q),e.IQ.updateIfChanged(ee.uGroupCount,ye.groupCount),e.IQ.update(ee.aTransform,ye.transformBuffer),e.IQ.update(ee.aInstance,ye.instanceBuffer),e.IQ.update(ee.uGeoTexDim,O.ZY.set(ee.uGeoTexDim.ref.value,ye.positionTexture.getWidth(),ye.positionTexture.getHeight())),e.IQ.update(ee.tPosition,ye.positionTexture),e.IQ.update(ee.tGroup,ye.groupTexture),e.IQ.update(ee.uColorTexDim,O.ZY.set(ee.uColorTexDim.ref.value,ye.colorData.getWidth(),ye.colorData.getHeight())),e.IQ.update(ee.tColor,ye.colorData),e.IQ.updateIfChanged(ee.dColorType,ye.colorType),e.IQ.updateIfChanged(ee.uCurrentSlice,0),e.IQ.updateIfChanged(ee.uCurrentX,0),e.IQ.updateIfChanged(ee.uCurrentY,0),e.IQ.update(ee.uBboxMin,j.min),e.IQ.update(ee.uBboxSize,Y),e.IQ.updateIfChanged(ee.uResolution,Z),de.namedComputeRenderables[u].update()}else de.namedComputeRenderables[u]=function h(de,ye,j,Z,q){const Y=O.eB.sub((0,O.eB)(),j.max,j.min),ee=Math.round(ye.vertexCount/q),g={drawCount:e.IQ.create(ee),instanceCount:e.IQ.create(ye.instanceCount),stride:e.IQ.create(q),uGroupCount:e.IQ.create(ye.groupCount),aTransform:e.IQ.create(ye.transformBuffer),aInstance:e.IQ.create(ye.instanceBuffer),aSample:e.IQ.create(s(ee,q)),uGeoTexDim:e.IQ.create(O.ZY.create(ye.positionTexture.getWidth(),ye.positionTexture.getHeight())),tPosition:e.IQ.create(ye.positionTexture),tGroup:e.IQ.create(ye.groupTexture),uColorTexDim:e.IQ.create(O.ZY.create(ye.colorData.getWidth(),ye.colorData.getHeight())),tColor:e.IQ.create(ye.colorData),dColorType:e.IQ.create(ye.colorType),uCurrentSlice:e.IQ.create(0),uCurrentX:e.IQ.create(0),uCurrentY:e.IQ.create(0),uBboxMin:e.IQ.create(j.min),uBboxSize:e.IQ.create(Y),uResolution:e.IQ.create(Z)},_e={...m},xe=(0,t.NG)("accumulate",M,_,{drawBuffers:"required"}),le=(0,A.$h)(de,"points",xe,_e,g);return(0,o._)(le,g)}(de,ye,j,Z,q);return de.namedComputeRenderables[u]}(Z,de,Re,ye,j);_e.currentRenderItemId=-1,ie.bind(),Y.drawBuffers([Y.COLOR_ATTACHMENT0,Y.COLOR_ATTACHMENT1]);const{uCurrentSlice:ce,uCurrentX:se,uCurrentY:ae}=ve.values;l.g$&&Z.timer.mark("ColorAccumulate.render"),function a(de){const{gl:ye,state:j}=de;j.disable(ye.CULL_FACE),j.enable(ye.BLEND),j.disable(ye.DEPTH_TEST),j.enable(ye.SCISSOR_TEST),j.depthMask(!1),j.clearColor(0,0,0,0),j.blendFunc(ye.ONE,ye.ONE),j.blendEquation(ye.FUNC_ADD)}(Z),_e.viewport(0,0,ne,be),_e.scissor(0,0,ne,be),ee.clear(ee.COLOR_BUFFER_BIT),e.IQ.update(ae,0);let ge=0,Ie=0,Le=0;for(let Je=0;Je=Te&&(ge-=Te,Ie+=Ne,Le=0,e.IQ.update(ae,Ie)),e.IQ.update(se,Le),e.IQ.update(ce,Je),_e.viewport(Le,Ie,Ve,Ne),_e.scissor(Le,Ie,Ve,Ne),ve.render(),++ge,Le+=Ve;ue.detachFramebuffer(ie,0),re.detachFramebuffer(ie,1),Y.drawBuffers([ee.COLOR_ATTACHMENT0,ee.NONE]),l.g$&&Z.timer.markEnd("ColorAccumulate.render"),l.g$&&Z.timer.mark("ColorNormalize.render"),(!q||(0,r.NP)(q))&&(q=g.texture("image-uint8","rgba","ubyte","linear")),q.define(ne,be);const nt=function R(de,ye,j){if(de.namedComputeRenderables[D]){const Z=de.namedComputeRenderables[D].values;e.IQ.update(Z.tColor,ye),e.IQ.update(Z.tCount,j),e.IQ.update(Z.uTexSize,O.ZY.set(Z.uTexSize.ref.value,ye.getWidth(),ye.getHeight())),de.namedComputeRenderables[D].update()}else de.namedComputeRenderables[D]=function f(de,ye,j){const Z={...v.OM,tColor:e.IQ.create(ye),tCount:e.IQ.create(j),uTexSize:e.IQ.create(O.ZY.create(ye.getWidth(),ye.getHeight()))},q={...S},Y=(0,t.NG)("normalize",c.e,i),ee=(0,A.$h)(de,"triangles",Y,q,Z);return(0,o._)(ee,Z)}(de,ye,j);return de.namedComputeRenderables[D]}(Z,ue,re);_e.currentRenderItemId=-1,function p(de){const{gl:ye,state:j}=de;j.disable(ye.CULL_FACE),j.enable(ye.BLEND),j.disable(ye.DEPTH_TEST),j.enable(ye.SCISSOR_TEST),j.depthMask(!1),j.clearColor(0,0,0,0),j.blendFunc(ye.ONE,ye.ONE),j.blendEquation(ye.FUNC_ADD)}(Z),q.attachFramebuffer(ie,0),_e.viewport(0,0,ne,be),_e.scissor(0,0,ne,be),ee.clear(ee.COLOR_BUFFER_BIT),nt.render(),l.g$&&Z.timer.markEnd("ColorNormalize.render");const je=O.Zb.create(Se[0],Se[1],Se[2],ke),Lt=Ae?"volumeInstance":"volume";return l.g$&&Z.timer.markEnd("calcTextureMeshColorSmoothing"),{texture:q,gridDim:Oe,gridTexDim:O.ZY.create(ne,be),gridTransform:je,type:Lt}}const L="color-smoothing-rgb",w="color-smoothing-rgba",Q="color-smoothing-alpha";function V(de,ye,j,Z,q){if(!function G(de){return"group"===de||"groupInstance"===de}(de.dColorType.ref.value))return;j*=3,Z.namedTextures[L]||(Z.namedTextures[L]=Z.resources.texture("image-uint8","rgb","ubyte","nearest"));const Y=Z.namedTextures[L];Y.load(de.tColor.ref.value);const ee=T({vertexCount:de.uVertexCount.ref.value,instanceCount:de.uInstanceCount.ref.value,groupCount:de.uGroupCount.ref.value,transformBuffer:de.aTransform.ref.value,instanceBuffer:de.aInstance.ref.value,positionTexture:de.tPosition.ref.value,groupTexture:de.tGroup.ref.value,colorData:Y,colorType:de.dColorType.ref.value,boundingSphere:de.boundingSphere.ref.value,invariantBoundingSphere:de.invariantBoundingSphere.ref.value},ye,j,Z,q);e.IQ.updateIfChanged(de.dColorType,ee.type),e.IQ.update(de.tColorGrid,ee.texture),e.IQ.update(de.uColorTexDim,ee.gridTexDim),e.IQ.update(de.uColorGridDim,ee.gridDim),e.IQ.update(de.uColorGridTransform,ee.gridTransform)}function N(de,ye,j,Z,q){if(!function U(de){return"groupInstance"===de}(de.dOverpaintType.ref.value))return;j*=3,Z.namedTextures[w]||(Z.namedTextures[w]=Z.resources.texture("image-uint8","rgba","ubyte","nearest"));const Y=Z.namedTextures[w];Y.load(de.tOverpaint.ref.value);const ee=T({vertexCount:de.uVertexCount.ref.value,instanceCount:de.uInstanceCount.ref.value,groupCount:de.uGroupCount.ref.value,transformBuffer:de.aTransform.ref.value,instanceBuffer:de.aInstance.ref.value,positionTexture:de.tPosition.ref.value,groupTexture:de.tGroup.ref.value,colorData:Y,colorType:de.dOverpaintType.ref.value,boundingSphere:de.boundingSphere.ref.value,invariantBoundingSphere:de.invariantBoundingSphere.ref.value},ye,j,Z,q);e.IQ.updateIfChanged(de.dOverpaintType,ee.type),e.IQ.update(de.tOverpaintGrid,ee.texture),e.IQ.update(de.uOverpaintTexDim,ee.gridTexDim),e.IQ.update(de.uOverpaintGridDim,ee.gridDim),e.IQ.update(de.uOverpaintGridTransform,ee.gridTransform)}function H(de,ye,j,Z,q){if(!function k(de){return"groupInstance"===de}(de.dTransparencyType.ref.value))return;j*=3,Z.namedTextures[Q]||(Z.namedTextures[Q]=Z.resources.texture("image-uint8","alpha","ubyte","nearest"));const Y=Z.namedTextures[Q];Y.load(de.tTransparency.ref.value);const ee=T({vertexCount:de.uVertexCount.ref.value,instanceCount:de.uInstanceCount.ref.value,groupCount:de.uGroupCount.ref.value,transformBuffer:de.aTransform.ref.value,instanceBuffer:de.aInstance.ref.value,positionTexture:de.tPosition.ref.value,groupTexture:de.tGroup.ref.value,colorData:Y,colorType:de.dTransparencyType.ref.value,boundingSphere:de.boundingSphere.ref.value,invariantBoundingSphere:de.invariantBoundingSphere.ref.value},ye,j,Z,q);e.IQ.updateIfChanged(de.dTransparencyType,ee.type),e.IQ.update(de.tTransparencyGrid,ee.texture),e.IQ.update(de.uTransparencyTexDim,ee.gridTexDim),e.IQ.update(de.uTransparencyGridDim,ee.gridDim),e.IQ.update(de.uTransparencyGridTransform,ee.gridTransform)}function J(de,ye,j,Z,q){if(!function $(de){return"groupInstance"===de}(de.dEmissiveType.ref.value))return;j*=3,Z.namedTextures[Q]||(Z.namedTextures[Q]=Z.resources.texture("image-uint8","alpha","ubyte","nearest"));const Y=Z.namedTextures[Q];Y.load(de.tEmissive.ref.value);const ee=T({vertexCount:de.uVertexCount.ref.value,instanceCount:de.uInstanceCount.ref.value,groupCount:de.uGroupCount.ref.value,transformBuffer:de.aTransform.ref.value,instanceBuffer:de.aInstance.ref.value,positionTexture:de.tPosition.ref.value,groupTexture:de.tGroup.ref.value,colorData:Y,colorType:de.dEmissiveType.ref.value,boundingSphere:de.boundingSphere.ref.value,invariantBoundingSphere:de.invariantBoundingSphere.ref.value},ye,j,Z,q);e.IQ.updateIfChanged(de.dEmissiveType,ee.type),e.IQ.update(de.tEmissiveGrid,ee.texture),e.IQ.update(de.uEmissiveTexDim,ee.gridTexDim),e.IQ.update(de.uEmissiveGridDim,ee.gridDim),e.IQ.update(de.uEmissiveGridTransform,ee.gridTransform)}function te(de,ye,j,Z,q){if(!function W(de){return"groupInstance"===de}(de.dSubstanceType.ref.value))return;j*=3,Z.namedTextures[w]||(Z.namedTextures[w]=Z.resources.texture("image-uint8","rgba","ubyte","nearest"));const Y=Z.namedTextures[w];Y.load(de.tSubstance.ref.value);const ee=T({vertexCount:de.uVertexCount.ref.value,instanceCount:de.uInstanceCount.ref.value,groupCount:de.uGroupCount.ref.value,transformBuffer:de.aTransform.ref.value,instanceBuffer:de.aInstance.ref.value,positionTexture:de.tPosition.ref.value,groupTexture:de.tGroup.ref.value,colorData:Y,colorType:de.dSubstanceType.ref.value,boundingSphere:de.boundingSphere.ref.value,invariantBoundingSphere:de.invariantBoundingSphere.ref.value},ye,j,Z,q);e.IQ.updateIfChanged(de.dSubstanceType,ee.type),e.IQ.update(de.tSubstanceGrid,ee.texture),e.IQ.update(de.uSubstanceTexDim,ee.gridTexDim),e.IQ.update(de.uSubstanceGridDim,ee.gridDim),e.IQ.update(de.uSubstanceGridTransform,ee.gridTransform)}},799:(tn,Ue,n)=>{"use strict";n.d(Ue,{X:()=>u});var u,e=n(9909),o=n(5384),r=n(8277),t=n(1888),A=n(2712),y=n(8013),c=n(5019),i=n(2075),v=n(9197),O=n(3784),b=n(4648),_=n(4369),M=n(5077),I=n(364),l=n(8307),m=n(6022);!function(d){class s{constructor(){this.index=0,this.textures=[]}get(){return this.textures[this.index]}set(w,Q,G){this.textures[this.index]=Object.assign(this.textures[this.index]||{},{vertex:w,group:Q,normal:G}),this.index=(this.index+1)%2}destroy(){for(const w of this.textures)w.vertex.destroy(),w.group.destroy(),w.normal.destroy()}}function C(L,w,Q,G,V,U,N){const k=Q.getWidth(),H=Q.getHeight();return N?(N.vertexCount=L,N.groupCount=w,e.IQ.update(N.geoTextureDim,_.ZY.set(N.geoTextureDim.ref.value,k,H)),e.IQ.update(N.vertexTexture,Q),e.IQ.update(N.groupTexture,G),e.IQ.update(N.normalTexture,V),N.doubleBuffer.set(Q,G,V),o.f8.copy(N.boundingSphere,U),N):{kind:"texture-mesh",vertexCount:L,groupCount:w,geoTextureDim:e.IQ.create(_.ZY.create(k,H)),vertexTexture:e.IQ.create(Q),groupTexture:e.IQ.create(G),normalTexture:e.IQ.create(V),varyingGroup:e.IQ.create(!1),doubleBuffer:new s,boundingSphere:o.f8.clone(U),meta:{}}}function h(L){return C(0,0,L?L.vertexTexture.ref.value:(0,b.z6)(),L?L.groupTexture.ref.value:(0,b.z6)(),L?L.normalTexture.ref.value:(0,b.z6)(),L?L.boundingSphere:(0,o.f8)(),L)}d.DoubleBuffer=s,d.create=C,d.createEmpty=h,d.Params={...c.iy.Params,doubleSided:r.t.Boolean(!1,c.iy.CustomQualityParamInfo),flipSided:r.t.Boolean(!1,c.iy.ShadingCategory),flatShaded:r.t.Boolean(!1,c.iy.ShadingCategory),ignoreLight:r.t.Boolean(!1,c.iy.ShadingCategory),xrayShaded:r.t.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],c.iy.ShadingCategory),transparentBackfaces:r.t.Select("off",r.t.arrayToOptions(["off","on","opaque"]),c.iy.ShadingCategory),bumpFrequency:r.t.Numeric(0,{min:0,max:10,step:.1},c.iy.ShadingCategory),bumpAmplitude:r.t.Numeric(1,{min:0,max:5,step:.1},c.iy.ShadingCategory)},d.Utils={Params:d.Params,createEmpty:h,createValues:D,createValuesSimple:function R(L,w,Q,G,V){const U=c.iy.createSimple(Q,G,V),N={...r.t.getDefaultValues(d.Params),...w};return D(L,U.transform,U.locationIterator,U.theme,N)},updateValues:function f(L,w){c.iy.updateValues(L,w),e.IQ.updateIfChanged(L.uDoubleSided,w.doubleSided),e.IQ.updateIfChanged(L.dFlatShaded,w.flatShaded),e.IQ.updateIfChanged(L.dFlipSided,w.flipSided),e.IQ.updateIfChanged(L.dIgnoreLight,w.ignoreLight),e.IQ.updateIfChanged(L.dXrayShaded,"inverted"===w.xrayShaded?"inverted":!0===w.xrayShaded?"on":"off"),e.IQ.updateIfChanged(L.dTransparentBackfaces,w.transparentBackfaces),e.IQ.updateIfChanged(L.uBumpFrequency,w.bumpFrequency),e.IQ.updateIfChanged(L.uBumpAmplitude,w.bumpAmplitude)},updateBoundingSphere:function p(L,w){const Q=o.f8.clone(w.boundingSphere),G=(0,O.Ax)(Q,L.aTransform.ref.value,L.instanceCount.ref.value,0);o.f8.equals(G,L.boundingSphere.ref.value)||e.IQ.update(L.boundingSphere,G),o.f8.equals(Q,L.invariantBoundingSphere.ref.value)||(e.IQ.update(L.invariantBoundingSphere,Q),e.IQ.update(L.uInvariantBoundingSphere,_.Zb.fromSphere(L.uInvariantBoundingSphere.ref.value,Q)))},createRenderableState:function E(L){const w=c.iy.createRenderableState(L);return T(w,L),w},updateRenderableState:T,createPositionIterator:function S(L,w){const Q=L.meta.webgl;if(!Q)return(0,t.iQ)(1,1,1,()=>I.LU);Q.namedFramebuffers[a]||(Q.namedFramebuffers[a]=Q.resources.framebuffer());const G=Q.namedFramebuffers[a],[V,U]=L.geoTextureDim.ref.value,N=new Float32Array(V*U*4);G.bind(),L.vertexTexture.ref.value.attachFramebuffer(G,0),Q.readPixels(0,0,V,U,N);const k=new Float32Array(V*U*4);G.bind(),L.normalTexture.ref.value.attachFramebuffer(G,0),Q.readPixels(0,0,V,U,k);const H=L.vertexCount,$=w.instanceCount.ref.value,J=(0,t.tu)(),W=J.position,te=J.normal,de=w.aTransform.ref.value;return(0,t.iQ)(H,$,1,(j,Z)=>(Z<0?(_.eB.fromArray(W,N,4*j),_.eB.fromArray(te,k,4*j)):(_.eB.transformMat4Offset(W,N,de,0,4*j,16*Z),_.eB.transformDirectionOffset(te,k,de,0,4*j,16*Z)),J))}};const a="texture-mesh";function D(L,w,Q,G,V){const{instanceCount:U,groupCount:N}=Q,k=d.Utils.createPositionIterator(L,w),H=(0,A.D1)(Q,k,G.color),$=V.instanceGranularity?(0,y.Km)(U,"instance"):(0,y.Km)(U*N,"groupInstance"),J=(0,i.WG)(),W=(0,v.MD)(),te=(0,m.JS)(),de=(0,l.IB)(),ye=(0,M.EN)(),j={drawCount:L.vertexCount,vertexCount:L.vertexCount,groupCount:N,instanceCount:U},Z=o.f8.clone(L.boundingSphere),q=(0,O.Ax)(Z,w.aTransform.ref.value,U,0);return{dGeometryType:e.IQ.create("textureMesh"),uGeoTexDim:L.geoTextureDim,tPosition:L.vertexTexture,tGroup:L.groupTexture,tNormal:L.normalTexture,dVaryingGroup:L.varyingGroup,boundingSphere:e.IQ.create(q),invariantBoundingSphere:e.IQ.create(Z),uInvariantBoundingSphere:e.IQ.create(_.Zb.ofSphere(Z)),...H,...$,...J,...W,...te,...de,...ye,...w,...c.iy.createValues(V,j),uDoubleSided:e.IQ.create(V.doubleSided),dFlatShaded:e.IQ.create(V.flatShaded),dFlipSided:e.IQ.create(V.flipSided),dIgnoreLight:e.IQ.create(V.ignoreLight),dXrayShaded:e.IQ.create("inverted"===V.xrayShaded?"inverted":!0===V.xrayShaded?"on":"off"),dTransparentBackfaces:e.IQ.create(V.transparentBackfaces),uBumpFrequency:e.IQ.create(V.bumpFrequency),uBumpAmplitude:e.IQ.create(V.bumpAmplitude),meta:e.IQ.create(L.meta)}}function T(L,w){c.iy.updateRenderableState(L,w),L.opaque=L.opaque&&!w.xrayShaded,L.writeDepth=L.opaque}}(u||(u={}))},3596:(tn,Ue,n)=>{"use strict";n.d(Ue,{Zk:()=>h,l1:()=>s,ES:()=>a,CY:()=>S});var e=n(9909),o=n(4369),r=n(6115),t=n(5100),A=n(5384),y=n(2086),c=n(9307),i=n(8184);const v=y.e.transformMat4Offset,O=y.e.fromArray,b=A.DJ.add;const m=(0,o.U)(),u=(0,o.$I)();function s(D,R,f,p,E,T){const L=function d(D,R){for(let f=0;f=16*R?T.transform.ref.value:new Float32Array(16*R);w.set(D),e.IQ.update(T.transform,w),e.IQ.updateIfChanged(T.uInstanceCount,R),e.IQ.updateIfChanged(T.instanceCount,R);const Q=T.aTransform.ref.value.length>=16*R?T.aTransform.ref.value:new Float32Array(16*R);e.IQ.update(T.aTransform,Q);const G=T.extraTransform.ref.value.length>=16*R?T.extraTransform.ref.value:new Float32Array(16*R);e.IQ.update(T.extraTransform,a(G,R));const V=T.aInstance.ref.value.length>=R?T.aInstance.ref.value:new Float32Array(R);e.IQ.update(T.aInstance,(0,r.WE)(V,R)),e.IQ.update(T.hasReflection,L)}else T={aTransform:e.IQ.create(new Float32Array(16*R)),matrix:e.IQ.create(o.$I.identity()),transform:e.IQ.create(new Float32Array(D)),extraTransform:e.IQ.create(a(new Float32Array(16*R),R)),uInstanceCount:e.IQ.create(R),instanceCount:e.IQ.create(R),aInstance:e.IQ.create((0,r.WE)(new Float32Array(R))),hasReflection:e.IQ.create(L),instanceGrid:e.IQ.create({cellSize:0,cellCount:0,cellOffsets:new Uint32Array,cellSpheres:new Float32Array,cellTransform:new Float32Array,cellInstance:new Float32Array,batchSize:0,batchCount:0,batchOffsets:new Uint32Array,batchSpheres:new Float32Array,batchCell:new Uint32Array})};return S(T,f,p,E),T}const C=new Float32Array(16);function h(D){return s(new Float32Array(C),1,void 0,0,0,D)}function a(D,R){for(let f=0;f0){const V=function M(D,R,f){const p=function I(D,R){const{instanceCount:f,instance:p,transform:E,invariantBoundingSphere:T}=D,L=new Float32Array(f),w=new Float32Array(f),Q=new Float32Array(f),G=t.C.ofBounds(0,f),V=A.DJ.setEmpty((0,A.DJ)()),{center:U,radius:N}=T,k=y.e.create(N,N,N),H=(0,y.e)();for(let le=0;le{"use strict";n.d(Ue,{Gg:()=>y,MD:()=>O,Ti:()=>i,UG:()=>A,m6:()=>c});var e=n(7187),o=n(4369),r=n(3784),t=n(4648);function A(b,_,M,I){for(let l=_;l0),e.IQ.updateIfChanged(M.transparencyAverage,y(I.array,b)),e.IQ.updateIfChanged(M.dTransparencyType,_),M):{tTransparency:e.IQ.create(I),uTransparencyTexDim:e.IQ.create(o.ZY.create(I.width,I.height)),dTransparency:e.IQ.create(b>0),transparencyAverage:e.IQ.create(0),tTransparencyGrid:e.IQ.create((0,t.z6)()),uTransparencyGridDim:e.IQ.create(o.eB.create(1,1,1)),uTransparencyGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dTransparencyType:e.IQ.create(_),uTransparencyStrength:e.IQ.create(1)}}const v={array:new Uint8Array(1),width:1,height:1};function O(b){return b?(e.IQ.update(b.tTransparency,v),e.IQ.update(b.uTransparencyTexDim,o.ZY.create(1,1)),b):{tTransparency:e.IQ.create(v),uTransparencyTexDim:e.IQ.create(o.ZY.create(1,1)),dTransparency:e.IQ.create(!1),transparencyAverage:e.IQ.create(0),tTransparencyGrid:e.IQ.create((0,t.z6)()),uTransparencyGridDim:e.IQ.create(o.eB.create(1,1,1)),uTransparencyGridTransform:e.IQ.create(o.Zb.create(0,0,0,1)),dTransparencyType:e.IQ.create("groupInstance"),uTransparencyStrength:e.IQ.create(1)}}},3280:(tn,Ue,n)=>{"use strict";n.d(Ue,{UC:()=>m,az:()=>_,wV:()=>I});var e=n(4369),o=n(6928),r=n(863),t=n(8937);const A=(0,e.eB)(),y=(0,e.eB)(),c=(0,e.eB)(),i=(0,e.eB)(),v=(0,r.n)(4,!0);function O(u){const C=(0,o.nT)(12,u?36:24);for(let h=0;h<4;++h){const a=(h+1)%4;e.eB.set(A,v[3*h],v[3*h+1],-.5),e.eB.set(y,v[3*a],v[3*a+1],-.5),e.eB.set(c,v[3*a],v[3*a+1],.5),e.eB.set(i,v[3*h],v[3*h+1],.5),u?C.add(A,y,c):C.addQuad(A,y,c,i)}return e.eB.set(A,v[0],v[1],-.5),e.eB.set(y,v[3],v[4],-.5),e.eB.set(c,v[6],v[7],-.5),e.eB.set(i,v[9],v[10],-.5),u?C.add(c,y,A):C.addQuad(i,c,y,A),e.eB.set(A,v[0],v[1],.5),e.eB.set(y,v[3],v[4],.5),e.eB.set(c,v[6],v[7],.5),e.eB.set(i,v[9],v[10],.5),u?C.add(A,y,c):C.addQuad(A,y,c,i),C.getPrimitive()}let b,M,l;function _(){return b||(b=O(!1)),b}function I(){return M||(M=O(!0)),M}function m(){return l||(l=(0,t.L3)([.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])),l}},8937:(tn,Ue,n)=>{"use strict";n.d(Ue,{L3:()=>o,b0:()=>A,so:()=>r});var e=n(4369);function o(y,c){return{vertices:y,edges:c}}function r(y){return{vertices:new Float32Array(y.vertices),edges:new Uint32Array(y.edges)}}const t=e.eB.zero();function A(y,c){const{vertices:i}=y;for(let v=0,O=i.length;v{"use strict";function e(o,r,t=-1){const A=new Float32Array(3*o),y=-1===t?o<=4?Math.sqrt(2)/2:.6:t,c=r?1:0;for(let i=0,v=o;ie})},6928:(tn,Ue,n)=>{"use strict";n.d(Ue,{_2:()=>b,m9:()=>A,nT:()=>i});var e=n(4369);const o=(0,e.eB)(),r=(0,e.eB)(),t=(0,e.eB)();function A(_,M){const I=M.length,l=i(I/3);for(let m=0;m{e.eB.toArray(s,I,u),e.eB.toArray(C,I,u+3),e.eB.toArray(h,I,u+6),e.eB.triangleNormal(c,s,C,h);for(let a=0;a<3;++a)e.eB.toArray(c,l,u+3*a),m[d+a]=u/3+a;u+=9,d+=3},addQuad:(s,C,h,a)=>{e.eB.toArray(s,I,u),e.eB.toArray(C,I,u+3),e.eB.toArray(h,I,u+6),e.eB.toArray(a,I,u+9),e.eB.triangleNormal(c,s,C,h);for(let D=0;D<4;++D)e.eB.toArray(c,l,u+3*D);const S=u/3;m[d]=S,m[d+1]=S+1,m[d+2]=S+2,m[d+3]=S+2,m[d+4]=S+3,m[d+5]=S,u+=12,d+=6},getPrimitive:()=>({vertices:I,normals:l,indices:m})}}const v=(0,e.eB)(),O=(0,e.U)();function b(_,M){const{vertices:I,normals:l}=_,m=e.U.directionTransform(O,M);for(let u=0,d=I.length;u{"use strict";n.d(Ue,{My:()=>b,SM:()=>s,VH:()=>h,jg:()=>u,r7:()=>l,uo:()=>M});var e=n(4369),o=n(6928),r=n(863);const t=(0,e.eB)(),A=(0,e.eB)(),y=(0,e.eB)(),c=(0,e.eB)(),i=(0,e.eB)(),v=(0,e.eB)(),O={height:1,topCap:!0,bottomCap:!0};function b(T,L){const w=T.length/3;if(w<3)throw new Error("need at least 3 points to build a prism");const{height:Q,topCap:G,bottomCap:V}={...O,...L};let U=2*w,N=4*w;const k=(G?1:0)+(V?1:0);3===w?(U+=k,N+=3*k):4===w?(U+=2*k,N+=4*k):(U+=k*w,N+=k*w*3);const H=(0,o.nT)(U,N),$=.5*Q;e.eB.set(t,0,0,-$),e.eB.set(A,0,0,$);for(let J=0;J{"use strict";n.d(Ue,{i:()=>s,J:()=>d});var e=n(4369),o=n(4559);const r={radius:1,detail:0};var y=n(6928),c=n(8937);const i=(1+Math.sqrt(5))/2,v=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],O=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];let _;(0,c.L3)(v,[0,11,5,11,0,5,1,5,0,1,1,7,0,7,7,10,0,10,10,11,5,9,4,11,2,10,6,7,1,8,3,9,4,9,3,4,2,4,2,3,2,6,3,6,6,8,3,8,8,9,4,5,2,11,6,10,7,8,1,9]);const{vertices:m,indices:u}=function M(){return _||(_=(0,y.m9)(v,O)),_}();function d(C){return 10*Math.pow(Math.pow(2,C),2)+2}function s(C){return function t(C,h,a){const{radius:S,detail:D}={...r,...a},R=function A(){const C=[],h=[],a=new Map;function S(D){const R=`${D[0].toFixed(5)}|${D[1].toFixed(5)}|${D[2].toFixed(5)}`;let f=a.get(R);return void 0===f&&(f=C.length/3,a.set(R,f),C.push(...D)),f}return{vertices:C,indices:h,add:(D,R,f)=>{h.push(S(D),S(R),S(f))}}}(),{vertices:f,indices:p}=R;(function T(w){const Q=(0,e.eB)(),G=(0,e.eB)(),V=(0,e.eB)();for(let U=0;U{"use strict";n.d(Ue,{AA:()=>l,TL:()=>y,lm:()=>c,pi:()=>A,xL:()=>M});var e=n(4369),o=n(6115);const t=(0,e.eB)();function A(m,u,d,s){for(let C=0,h=3*s;C{"use strict";n.d(Ue,{ZC:()=>A,iQ:()=>r,tu:()=>t});var e=n(4369),o=n(364);function r(y,c,i,v,O=!1,b=(()=>!1),_){if(y%i!=0)throw new Error("incompatible groupCount and stride");const M={location:o.LU,location2:o.LU,index:0,groupIndex:0,instanceIndex:0,isSecondary:!1};let I=M.groupIndex(I&&(M.groupIndex=m,M.instanceIndex=u,M.index=u*y+m,M.location=v(m,d?-1:u),s&&(M.location2=_(m,d?-1:u)),M.isSecondary=b(m,d?-1:u),m+=i,m===y?(++u,l=!0,u{"use strict";n.d(Ue,{e:()=>M,O:()=>_});var e=n(467),o=n(4824),r=n(7834),t=n(9909),A=n(8382),y=n(9283),c=n(5821);function O(m){return{...m,bottomLeft:(0,t.NT)(m.bottomLeft,[0,0,0]),topRight:(0,t.NT)(m.topRight,m.scalarField.space.dimensions)}}function b(m){return{dX:m.topRight[0]-m.bottomLeft[0],dY:m.topRight[1]-m.bottomLeft[1],dZ:m.topRight[2]-m.bottomLeft[2]}}function _(m,u){return o.YZ.create("Marching Cubes Mesh",function(){var d=(0,e.A)(function*(s){const C=O(m),{dX:h,dY:a,dZ:S}=b(C),R=function i(m,u){const d=Math.min(65536,4*m),s=A.Gm.create(Float32Array,3,m,u&&u.vertexBuffer.ref.value),C=A.Gm.create(Float32Array,3,m,u&&u.normalBuffer.ref.value),h=A.Gm.create(Float32Array,1,m,u&&u.groupBuffer.ref.value),a=A.Gm.create(Uint32Array,3,d,u&&u.indexBuffer.ref.value);let S=0,D=0;return{addVertex:(R,f,p)=>(++S,A.Gm.add3(s,R,f,p)),addNormal:(R,f,p)=>{A.Gm.add3(C,R,f,p)},addGroup:R=>{A.Gm.add(h,R)},addTriangle:(R,f,p,E)=>{const T=R[f],L=R[p],w=R[E];T>=0&&L>=0&&w>=0&&(++D,A.Gm.add3(a,T,L,w))},get:()=>{const R=A.Gm.compact(s,!0),f=A.Gm.compact(C,!0),p=A.Gm.compact(a,!0),E=A.Gm.compact(h,!0);return y.e.create(R,p,f,E,S,D,u)}}}(Math.min(262144,Math.max(h*a*S/32,1024)),u);return yield new I(s,R,C).run(),R.get()});return function(s){return d.apply(this,arguments)}}())}function M(m,u){return o.YZ.create("Marching Cubes Lines",function(){var d=(0,e.A)(function*(s){const C=O(m),{dX:h,dY:a,dZ:S}=b(C),R=function v(m,u){const d=A.Gm.create(Float32Array,3,m),s=A.Gm.create(Float32Array,1,m),C=A.Gm.create(Float32Array,2,m);let h=0;return{addVertex:(a,S,D)=>A.Gm.add3(d,a,S,D),addNormal:()=>t.lQ,addGroup:a=>{A.Gm.add(s,a)},addTriangle:(a,S,D,R,f)=>{a[S]>=0&&a[D]>=0&&a[R]>=0&&(r.my[S][D]&f&&(++h,A.Gm.add2(C,a[S],a[D])),r.my[D][R]&f&&(++h,A.Gm.add2(C,a[D],a[R])),r.my[S][R]&f&&(++h,A.Gm.add2(C,a[S],a[R])))},get:()=>{const a=A.Gm.compact(d,!0),S=A.Gm.compact(C,!0),D=A.Gm.compact(s,!0),R=c.d.create(h,h/10,u);for(let f=0;f0)return C-1;const h=this.scalarField,a=this.scalarFieldGet,S=r.WH[u],D=S.a,R=S.b,f=D.i+this.i,p=D.j+this.j,E=D.k+this.k,T=R.i+this.i,L=R.j+this.j,w=R.k+this.k,Q=a(h,f,p,E),G=a(h,T,L,w),V=(this.isoLevel-Q)/(Q-G);if(this.idField){const j=this.idFieldGet(this.idField,f,p,E),Z=this.idFieldGet(this.idField,T,L,w);let q=V<.5?j:Z;if(-1===q&&(q=V<.5?Z:j),-2===q)return-1;this.builder.addGroup(q)}else this.builder.addGroup(0);const U=this.builder.addVertex(f+V*(f-T),p+V*(p-L),E+V*(E-w));this.verticesOnEdges[s]=U+1;const N=a(h,Math.max(0,f-1),p,E)-a(h,Math.min(this.nX-1,f+1),p,E),k=a(h,f,Math.max(0,p-1),E)-a(h,f,Math.min(this.nY-1,p+1),E),H=a(h,f,p,Math.max(0,E-1))-a(h,f,p,Math.min(this.nZ,E+1)),te=N+V*(N-(a(h,Math.max(0,T-1),L,w)-a(h,Math.min(this.nX-1,T+1),L,w))),de=k+V*(k-(a(h,T,Math.max(0,L-1),w)-a(h,T,Math.min(this.nY-1,L+1),w))),ye=H+V*(H-(a(h,T,L,Math.max(0,w-1))-a(h,T,L,Math.min(this.nZ-1,w+1))));return this.isoLevel>=0?this.builder.addNormal(te,de,ye):this.builder.addNormal(-te,-de,-ye),U}constructor(u,d){this.builder=u,this.vertList=[0,0,0,0,0,0,0,0,0,0,0,0],this.i=0,this.j=0,this.k=0;const s=d.scalarField.space.dimensions;this.nX=s[0],this.nY=s[1],this.nZ=s[2],this.isoLevel=d.isoLevel,this.scalarFieldGet=d.scalarField.space.get,this.scalarField=d.scalarField.data,d.idField&&(this.idField=d.idField.data,this.idFieldGet=d.idField.space.get),this.verticesOnEdges=new Int32Array(3*this.nX*this.nY*2)}get(u,d,s){return this.scalarFieldGet(this.scalarField,u,d,s)}processCell(u,d,s,C){let h=0;if(this.get(u,d,s)0&&(this.vertList[0]=this.interpolate(0)),(2&a)>0&&(this.vertList[1]=this.interpolate(1)),(4&a)>0&&(this.vertList[2]=this.interpolate(2)),(8&a)>0&&(this.vertList[3]=this.interpolate(3)),(16&a)>0&&(this.vertList[4]=this.interpolate(4)),(32&a)>0&&(this.vertList[5]=this.interpolate(5)),(64&a)>0&&(this.vertList[6]=this.interpolate(6)),(128&a)>0&&(this.vertList[7]=this.interpolate(7)),(256&a)>0&&(this.vertList[8]=this.interpolate(8)),(512&a)>0&&(this.vertList[9]=this.interpolate(9)),(1024&a)>0&&(this.vertList[10]=this.interpolate(10)),(2048&a)>0&&(this.vertList[11]=this.interpolate(11));const S=r.sE[h];for(let D=0;D=0?this.builder.addTriangle(this.vertList,R,f,p,C):this.builder.addTriangle(this.vertList,p,f,R,C)}}}},7834:(tn,Ue,n)=>{"use strict";function e(_,M,I){return{i:_,j:M,k:I}}function o(_,M){return{a:_,b:M}}n.d(Ue,{Dn:()=>i,IT:()=>v,WH:()=>c,my:()=>b,sE:()=>O});const y=[e(0,0,0),e(1,0,0),e(1,1,0),e(0,1,0),e(0,0,1),e(1,0,1),e(1,1,1),e(0,1,1)],c=[o(y[0],y[1]),o(y[1],y[2]),o(y[2],y[3]),o(y[3],y[0]),o(y[4],y[5]),o(y[5],y[6]),o(y[6],y[7]),o(y[7],y[4]),o(y[0],y[4]),o(y[1],y[5]),o(y[2],y[6]),o(y[3],y[7])],i=[{i:0,j:0,k:0,e:0},{i:1,j:0,k:0,e:1},{i:0,j:1,k:0,e:0},{i:0,j:0,k:0,e:1},{i:0,j:0,k:1,e:0},{i:1,j:0,k:1,e:1},{i:0,j:1,k:1,e:0},{i:0,j:0,k:1,e:1},{i:0,j:0,k:0,e:2},{i:1,j:0,k:0,e:2},{i:1,j:1,k:0,e:2},{i:0,j:1,k:0,e:2}],v=[0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0],O=[[],[0,8,3],[0,1,9],[1,8,3,9,8,1],[1,2,10],[0,8,3,1,2,10],[9,2,10,0,2,9],[2,8,3,2,10,8,10,9,8],[3,11,2],[0,11,2,8,11,0],[1,9,0,2,3,11],[1,11,2,1,9,11,9,8,11],[3,10,1,11,10,3],[0,10,1,0,8,10,8,11,10],[3,9,0,3,11,9,11,10,9],[9,8,10,10,8,11],[4,7,8],[4,3,0,7,3,4],[0,1,9,8,4,7],[4,1,9,4,7,1,7,3,1],[1,2,10,8,4,7],[3,4,7,3,0,4,1,2,10],[9,2,10,9,0,2,8,4,7],[2,10,9,2,9,7,2,7,3,7,9,4],[8,4,7,3,11,2],[11,4,7,11,2,4,2,0,4],[9,0,1,8,4,7,2,3,11],[4,7,11,9,4,11,9,11,2,9,2,1],[3,10,1,3,11,10,7,8,4],[1,11,10,1,4,11,1,0,4,7,11,4],[4,7,8,9,0,11,9,11,10,11,0,3],[4,7,11,4,11,9,9,11,10],[9,5,4],[9,5,4,0,8,3],[0,5,4,1,5,0],[8,5,4,8,3,5,3,1,5],[1,2,10,9,5,4],[3,0,8,1,2,10,4,9,5],[5,2,10,5,4,2,4,0,2],[2,10,5,3,2,5,3,5,4,3,4,8],[9,5,4,2,3,11],[0,11,2,0,8,11,4,9,5],[0,5,4,0,1,5,2,3,11],[2,1,5,2,5,8,2,8,11,4,8,5],[10,3,11,10,1,3,9,5,4],[4,9,5,0,8,1,8,10,1,8,11,10],[5,4,0,5,0,11,5,11,10,11,0,3],[5,4,8,5,8,10,10,8,11],[9,7,8,5,7,9],[9,3,0,9,5,3,5,7,3],[0,7,8,0,1,7,1,5,7],[1,5,3,3,5,7],[9,7,8,9,5,7,10,1,2],[10,1,2,9,5,0,5,3,0,5,7,3],[8,0,2,8,2,5,8,5,7,10,5,2],[2,10,5,2,5,3,3,5,7],[7,9,5,7,8,9,3,11,2],[9,5,7,9,7,2,9,2,0,2,7,11],[2,3,11,0,1,8,1,7,8,1,5,7],[11,2,1,11,1,7,7,1,5],[9,5,8,8,5,7,10,1,3,10,3,11],[5,7,0,5,0,9,7,11,0,1,0,10,11,10,0],[11,10,0,11,0,3,10,5,0,8,0,7,5,7,0],[11,10,5,7,11,5],[10,6,5],[0,8,3,5,10,6],[9,0,1,5,10,6],[1,8,3,1,9,8,5,10,6],[1,6,5,2,6,1],[1,6,5,1,2,6,3,0,8],[9,6,5,9,0,6,0,2,6],[5,9,8,5,8,2,5,2,6,3,2,8],[2,3,11,10,6,5],[11,0,8,11,2,0,10,6,5],[0,1,9,2,3,11,5,10,6],[5,10,6,1,9,2,9,11,2,9,8,11],[6,3,11,6,5,3,5,1,3],[0,8,11,0,11,5,0,5,1,5,11,6],[3,11,6,0,3,6,0,6,5,0,5,9],[6,5,9,6,9,11,11,9,8],[5,10,6,4,7,8],[4,3,0,4,7,3,6,5,10],[1,9,0,5,10,6,8,4,7],[10,6,5,1,9,7,1,7,3,7,9,4],[6,1,2,6,5,1,4,7,8],[1,2,5,5,2,6,3,0,4,3,4,7],[8,4,7,9,0,5,0,6,5,0,2,6],[7,3,9,7,9,4,3,2,9,5,9,6,2,6,9],[3,11,2,7,8,4,10,6,5],[5,10,6,4,7,2,4,2,0,2,7,11],[0,1,9,4,7,8,2,3,11,5,10,6],[9,2,1,9,11,2,9,4,11,7,11,4,5,10,6],[8,4,7,3,11,5,3,5,1,5,11,6],[5,1,11,5,11,6,1,0,11,7,11,4,0,4,11],[0,5,9,0,6,5,0,3,6,11,6,3,8,4,7],[6,5,9,6,9,11,4,7,9,7,11,9],[10,4,9,6,4,10],[4,10,6,4,9,10,0,8,3],[10,0,1,10,6,0,6,4,0],[8,3,1,8,1,6,8,6,4,6,1,10],[1,4,9,1,2,4,2,6,4],[3,0,8,1,2,9,2,4,9,2,6,4],[0,2,4,4,2,6],[8,3,2,8,2,4,4,2,6],[10,4,9,10,6,4,11,2,3],[0,8,2,2,8,11,4,9,10,4,10,6],[3,11,2,0,1,6,0,6,4,6,1,10],[6,4,1,6,1,10,4,8,1,2,1,11,8,11,1],[9,6,4,9,3,6,9,1,3,11,6,3],[8,11,1,8,1,0,11,6,1,9,1,4,6,4,1],[3,11,6,3,6,0,0,6,4],[6,4,8,11,6,8],[7,10,6,7,8,10,8,9,10],[0,7,3,0,10,7,0,9,10,6,7,10],[10,6,7,1,10,7,1,7,8,1,8,0],[10,6,7,10,7,1,1,7,3],[1,2,6,1,6,8,1,8,9,8,6,7],[2,6,9,2,9,1,6,7,9,0,9,3,7,3,9],[7,8,0,7,0,6,6,0,2],[7,3,2,6,7,2],[2,3,11,10,6,8,10,8,9,8,6,7],[2,0,7,2,7,11,0,9,7,6,7,10,9,10,7],[1,8,0,1,7,8,1,10,7,6,7,10,2,3,11],[11,2,1,11,1,7,10,6,1,6,7,1],[8,9,6,8,6,7,9,1,6,11,6,3,1,3,6],[0,9,1,11,6,7],[7,8,0,7,0,6,3,11,0,11,6,0],[7,11,6],[7,6,11],[3,0,8,11,7,6],[0,1,9,11,7,6],[8,1,9,8,3,1,11,7,6],[10,1,2,6,11,7],[1,2,10,3,0,8,6,11,7],[2,9,0,2,10,9,6,11,7],[6,11,7,2,10,3,10,8,3,10,9,8],[7,2,3,6,2,7],[7,0,8,7,6,0,6,2,0],[2,7,6,2,3,7,0,1,9],[1,6,2,1,8,6,1,9,8,8,7,6],[10,7,6,10,1,7,1,3,7],[10,7,6,1,7,10,1,8,7,1,0,8],[0,3,7,0,7,10,0,10,9,6,10,7],[7,6,10,7,10,8,8,10,9],[6,8,4,11,8,6],[3,6,11,3,0,6,0,4,6],[8,6,11,8,4,6,9,0,1],[9,4,6,9,6,3,9,3,1,11,3,6],[6,8,4,6,11,8,2,10,1],[1,2,10,3,0,11,0,6,11,0,4,6],[4,11,8,4,6,11,0,2,9,2,10,9],[10,9,3,10,3,2,9,4,3,11,3,6,4,6,3],[8,2,3,8,4,2,4,6,2],[0,4,2,4,6,2],[1,9,0,2,3,4,2,4,6,4,3,8],[1,9,4,1,4,2,2,4,6],[8,1,3,8,6,1,8,4,6,6,10,1],[10,1,0,10,0,6,6,0,4],[4,6,3,4,3,8,6,10,3,0,3,9,10,9,3],[10,9,4,6,10,4],[4,9,5,7,6,11],[0,8,3,4,9,5,11,7,6],[5,0,1,5,4,0,7,6,11],[11,7,6,8,3,4,3,5,4,3,1,5],[9,5,4,10,1,2,7,6,11],[6,11,7,1,2,10,0,8,3,4,9,5],[7,6,11,5,4,10,4,2,10,4,0,2],[3,4,8,3,5,4,3,2,5,10,5,2,11,7,6],[7,2,3,7,6,2,5,4,9],[9,5,4,0,8,6,0,6,2,6,8,7],[3,6,2,3,7,6,1,5,0,5,4,0],[6,2,8,6,8,7,2,1,8,4,8,5,1,5,8],[9,5,4,10,1,6,1,7,6,1,3,7],[1,6,10,1,7,6,1,0,7,8,7,0,9,5,4],[4,0,10,4,10,5,0,3,10,6,10,7,3,7,10],[7,6,10,7,10,8,5,4,10,4,8,10],[6,9,5,6,11,9,11,8,9],[3,6,11,0,6,3,0,5,6,0,9,5],[0,11,8,0,5,11,0,1,5,5,6,11],[6,11,3,6,3,5,5,3,1],[1,2,10,9,5,11,9,11,8,11,5,6],[0,11,3,0,6,11,0,9,6,5,6,9,1,2,10],[11,8,5,11,5,6,8,0,5,10,5,2,0,2,5],[6,11,3,6,3,5,2,10,3,10,5,3],[5,8,9,5,2,8,5,6,2,3,8,2],[9,5,6,9,6,0,0,6,2],[1,5,8,1,8,0,5,6,8,3,8,2,6,2,8],[1,5,6,2,1,6],[1,3,6,1,6,10,3,8,6,5,6,9,8,9,6],[10,1,0,10,0,6,9,5,0,5,6,0],[0,3,8,5,6,10],[10,5,6],[11,5,10,7,5,11],[11,5,10,11,7,5,8,3,0],[5,11,7,5,10,11,1,9,0],[10,7,5,10,11,7,9,8,1,8,3,1],[11,1,2,11,7,1,7,5,1],[0,8,3,1,2,7,1,7,5,7,2,11],[9,7,5,9,2,7,9,0,2,2,11,7],[7,5,2,7,2,11,5,9,2,3,2,8,9,8,2],[2,5,10,2,3,5,3,7,5],[8,2,0,8,5,2,8,7,5,10,2,5],[9,0,1,5,10,3,5,3,7,3,10,2],[9,8,2,9,2,1,8,7,2,10,2,5,7,5,2],[1,3,5,3,7,5],[0,8,7,0,7,1,1,7,5],[9,0,3,9,3,5,5,3,7],[9,8,7,5,9,7],[5,8,4,5,10,8,10,11,8],[5,0,4,5,11,0,5,10,11,11,3,0],[0,1,9,8,4,10,8,10,11,10,4,5],[10,11,4,10,4,5,11,3,4,9,4,1,3,1,4],[2,5,1,2,8,5,2,11,8,4,5,8],[0,4,11,0,11,3,4,5,11,2,11,1,5,1,11],[0,2,5,0,5,9,2,11,5,4,5,8,11,8,5],[9,4,5,2,11,3],[2,5,10,3,5,2,3,4,5,3,8,4],[5,10,2,5,2,4,4,2,0],[3,10,2,3,5,10,3,8,5,4,5,8,0,1,9],[5,10,2,5,2,4,1,9,2,9,4,2],[8,4,5,8,5,3,3,5,1],[0,4,5,1,0,5],[8,4,5,8,5,3,9,0,5,0,3,5],[9,4,5],[4,11,7,4,9,11,9,10,11],[0,8,3,4,9,7,9,11,7,9,10,11],[1,10,11,1,11,4,1,4,0,7,4,11],[3,1,4,3,4,8,1,10,4,7,4,11,10,11,4],[4,11,7,9,11,4,9,2,11,9,1,2],[9,7,4,9,11,7,9,1,11,2,11,1,0,8,3],[11,7,4,11,4,2,2,4,0],[11,7,4,11,4,2,8,3,4,3,2,4],[2,9,10,2,7,9,2,3,7,7,4,9],[9,10,7,9,7,4,10,2,7,8,7,0,2,0,7],[3,7,10,3,10,2,7,4,10,1,10,0,4,0,10],[1,10,2,8,7,4],[4,9,1,4,1,7,7,1,3],[4,9,1,4,1,7,0,8,1,8,7,1],[4,0,3,7,4,3],[4,8,7],[9,10,8,10,11,8],[3,0,9,3,9,11,11,9,10],[0,1,10,0,10,8,8,10,11],[3,1,10,11,3,10],[1,2,11,1,11,9,9,11,8],[3,0,9,3,9,11,1,2,9,2,11,9],[0,2,11,8,0,11],[3,2,11],[2,3,8,2,8,10,10,8,9],[9,10,2,0,9,2],[2,3,8,2,8,10,0,1,8,1,10,8],[1,10,2],[1,3,8,9,1,8],[0,9,1],[0,3,8],[]],b=[[0,4,4,4,2,0,0,0,2,2,0,0],[4,0,4,4,0,8,0,0,0,8,8,0],[4,4,0,4,0,0,8,0,0,0,8,8],[4,4,4,0,0,0,0,1,1,0,0,1],[2,0,0,0,0,8,8,8,2,2,0,0],[0,8,0,0,8,0,8,8,0,8,8,0],[0,0,8,0,8,8,0,8,0,0,8,8],[0,0,0,1,8,8,8,0,1,0,0,1],[2,0,0,1,2,0,0,1,0,2,0,1],[2,8,0,0,2,8,0,0,2,0,8,0],[0,8,8,0,0,8,8,0,0,8,0,8],[0,0,8,1,0,0,8,1,1,0,8,0]]},8187:(tn,Ue,n)=>{"use strict";n.d(Ue,{_:()=>xe});var e=n(9421),o=n(4143),r=n(4511),t=n(2897),A=n(9909),y=n(9007),c=n(4951),i=n(9387);const v="\nprecision highp float;\nprecision highp int;\n\n#if __VERSION__ == 100\n precision highp sampler2D;\n uniform sampler2D tTexture;\n#else\n precision highp isampler2D;\n uniform isampler2D tTexture;\n#endif\n\nvoid main(void) {\n #if __VERSION__ == 100\n gl_FragColor = texture2D(tTexture, vec2(0.5));\n #else\n gl_FragColor = ivec4(texture2D(tTexture, vec2(0.5)).r);\n #endif\n}\n";var O=n(8437),b=n(2629);const _={...y.du,tTexture:(0,r.$G)("texture","rgba","float","nearest")},M="histopyramid-sum";const u=new Uint8Array(4),d=new Int32Array(4);var C=n(4490);const h="\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tInputLevel;\n\n// previous level used to evaluate the new level\n#if __VERSION__ == 100\n uniform sampler2D tPreviousLevel;\n#else\n precision highp isampler2D;\n uniform isampler2D tPreviousLevel;\n#endif\n\n// inverted size of the previous level texture.\nuniform float uSize;\nuniform float uTexSize;\nuniform bool uFirst;\n\n#include common\n\nvoid main(void) {\n float k = 0.5 * uSize;\n vec2 position = floor((gl_FragCoord.xy / uTexSize) / uSize) * uSize;\n\n #if __VERSION__ == 100\n float a, b, c, d;\n\n if (uFirst) {\n a = texture2D(tInputLevel, position).r * 255.0;\n b = texture2D(tInputLevel, position + vec2(k, 0.0)).r * 255.0;\n c = texture2D(tInputLevel, position + vec2(0.0, k)).r * 255.0;\n d = texture2D(tInputLevel, position + vec2(k, k)).r * 255.0;\n } else {\n a = unpackRGBToInt(texture2D(tPreviousLevel, position).rgb);\n b = unpackRGBToInt(texture2D(tPreviousLevel, position + vec2(k, 0.0)).rgb);\n c = unpackRGBToInt(texture2D(tPreviousLevel, position + vec2(0.0, k)).rgb);\n d = unpackRGBToInt(texture2D(tPreviousLevel, position + vec2(k, k)).rgb);\n }\n gl_FragColor = vec4(packIntToRGB(a + b + c + d), 1.0);\n #else\n int a, b, c, d;\n\n if (uFirst) {\n a = int(texture2D(tInputLevel, position).r * 255.0);\n b = int(texture2D(tInputLevel, position + vec2(k, 0.0)).r * 255.0);\n c = int(texture2D(tInputLevel, position + vec2(0.0, k)).r * 255.0);\n d = int(texture2D(tInputLevel, position + vec2(k, k)).r * 255.0);\n } else {\n a = texture2D(tPreviousLevel, position).r;\n b = texture2D(tPreviousLevel, position + vec2(k, 0.0)).r;\n c = texture2D(tPreviousLevel, position + vec2(0.0, k)).r;\n d = texture2D(tPreviousLevel, position + vec2(k, k)).r;\n }\n gl_FragColor = ivec4(a + b + c + d);\n #endif\n}\n",a={...y.du,tInputLevel:(0,r.$G)("texture","rgba","float","nearest"),tPreviousLevel:(0,r.$G)("texture","rgba","float","nearest"),uSize:(0,r.w5)("f"),uTexSize:(0,r.w5)("f"),uFirst:(0,r.w5)("b")},S="histogram-pyramid";function f(le,Ae){const Be=Math.pow(2,Ae),Ce=`level${Ae}`,Re=le.isWebGL2?T(Ce,le,"image-int32","alpha","int","nearest"):T(Ce,le,"image-uint8","rgba","ubyte","nearest");Re.define(Be,Be);let ke=function L(le,Ae){return Ae.namedFramebuffers[`${S}-${le}`]}(Ce,le);return ke||(ke=E(Ce,le),Re.attachFramebuffer(ke,0)),{texture:Re,framebuffer:ke}}function E(le,Ae){const Be=`${S}-${le}`;return Ae.namedFramebuffers[Be]||(Ae.namedFramebuffers[Be]=Ae.resources.framebuffer()),Ae.namedFramebuffers[Be]}function T(le,Ae,Be,Ce,Re,ke){const we=`${S}-${le}`;return Ae.namedTextures[we]||(Ae.namedTextures[we]=Ae.resources.texture(Be,Ce,Re,ke)),Ae.namedTextures[we]}function w(le,Ae,Be,Ce){b.g$&&le.timer.mark("createHistogramPyramid");const{gl:Re,state:ke}=le,we=Ae.getWidth();if(we!==Ae.getHeight()||!(0,C.r6)(we))throw new Error("inputTexture must be of square power-of-two size");const Se=Math.ceil(Math.log(we)/Math.log(2)),Ve=Math.pow(2,Se),Ne=Math.pow(2,Se),K=Math.pow(2,Se-1),ne=le.isWebGL2?T("pyramid",le,"image-int32","alpha","int","nearest"):T("pyramid",le,"image-uint8","rgba","ubyte","nearest");ne.define(Ne,K);const be=E("pyramid",le);ne.attachFramebuffer(be,0),ke.viewport(0,0,Ne,K),(0,O.C6)(Re)?Re.clearBufferiv(Re.COLOR,0,[0,0,0,0]):Re.clear(Re.COLOR_BUFFER_BIT);const Te=[];for(let ce=0;ce0&&(A.IQ.update(ie.values.tPreviousLevel,Te[Se-ce].texture),ie.update()),ke.currentRenderItemId=-1,ke.viewport(0,0,ge,ge),ke.scissor(0,0,ge,ge),(0,O.C6)(Re)?Re.clearBufferiv(Re.COLOR,0,[0,0,0,0]):Re.clear(Re.COLOR_BUFFER_BIT),ke.scissor(0,0,Ce[0],Ce[1]),ie.render(),ne.bind(0),Re.copyTexSubImage2D(Re.TEXTURE_2D,0,ue,0,0,0,ge,ge),ne.unbind(0),ue+=ge}Re.finish(),b.g$&&le.timer.markEnd("createHistogramPyramid");const re=Math.max(1,function s(le,Ae){b.g$&&le.timer.mark("getHistopyramidSum");const{gl:Be,state:Ce,resources:Re}=le,ke=function I(le,Ae){return le.namedComputeRenderables[M]?(A.IQ.update(le.namedComputeRenderables[M].values.tTexture,Ae),le.namedComputeRenderables[M].update()):le.namedComputeRenderables[M]=function l(le,Ae){const Be={...y.OM,tTexture:A.IQ.create(Ae)},Ce={..._},Re=(0,t.NG)("sum",i.e,v,{},{0:"ivec4"}),ke=(0,o.$h)(le,"triangles",Re,Ce,Be);return(0,e._)(ke,Be)}(le,Ae),le.namedComputeRenderables[M]}(le,Ae);le.state.currentRenderItemId=-1,le.namedFramebuffers[M]||(le.namedFramebuffers[M]=Re.framebuffer());const we=le.namedFramebuffers[M];return le.namedTextures[M]||(le.namedTextures[M]=(0,O.C6)(Be)?Re.texture("image-int32","rgba","int","nearest"):Re.texture("image-uint8","rgba","ubyte","nearest"),le.namedTextures[M].define(1,1)),le.namedTextures[M].attachFramebuffer(we,0),function m(le){const{gl:Ae,state:Be}=le;Be.disable(Ae.CULL_FACE),Be.disable(Ae.BLEND),Be.disable(Ae.DEPTH_TEST),Be.disable(Ae.SCISSOR_TEST),Be.depthMask(!1),Be.colorMask(!0,!0,!0,!0),Be.clearColor(0,0,0,0)}(le),Ce.viewport(0,0,1,1),ke.render(),Be.finish(),le.readPixels(0,0,1,1,(0,O.C6)(Be)?d:u),le.unbindFramebuffer(),b.g$&&le.timer.markEnd("getHistopyramidSum"),(0,O.C6)(Be)?d[0]:(0,c.OK)(u[0],u[1],u[2])}(le,Te[0].texture));return{pyramidTex:ne,count:re,height:Math.ceil(re/Math.pow(2,Se)),levels:Se,scale:Be}}var Q=n(7834),G=n(3784);let V,N;function U(){if(void 0!==V)return V;V=(0,G.xg)(256,1,Uint8Array);const{array:le}=V;for(let Ae=0,Be=Q.sE.length;Ae{"use strict";n.d(Ue,{Wp:()=>O,du:()=>b,OM:()=>_,_0:()=>l}),n(4648);var o=n(9909),r=n(4511),t=n(4369),A=n(2897),c=n(9387),i=n(4143),v=n(9421);const O=new Float32Array([1,1,-1,1,-1,-1,-1,-1,1,-1,1,1]),b={drawCount:(0,r.Xb)("number"),instanceCount:(0,r.Xb)("number"),aPosition:(0,r.Yz)("float32",2,0),uQuadScale:(0,r.w5)("v2")},_={drawCount:o.IQ.create(6),instanceCount:o.IQ.create(1),aPosition:o.IQ.create(O),uQuadScale:o.IQ.create(t.ZY.create(1,1))},M={...b,tColor:(0,r.$G)("texture","rgba","ubyte","nearest"),uTexSize:(0,r.w5)("v2")},I=(0,A.NG)("copy",c.e,"\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform vec2 uTexSize;\n\nvoid main() {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n gl_FragColor = texture2D(tColor, coords);\n}\n");function l(a,S){const D={..._,tColor:o.IQ.create(S),uTexSize:o.IQ.create(t.ZY.create(S.getWidth(),S.getHeight()))},R={...M},f=(0,i.$h)(a,"triangles",I,R,D);return(0,v._)(f,D)}},8353:(tn,Ue,n)=>{"use strict";n.d(Ue,{o:()=>E,R2:()=>T,Q0:()=>p});var e=n(7778),o=n(9421),r=n(4143),t=n(4511),A=n(2897),y=n(9909);const c={...t.DQ,aPosition:(0,t.Yz)("float32",3,0),elements:(0,t.Xs)("uint32"),uBboxMin:(0,t.w5)("v3"),uBboxMax:(0,t.w5)("v3"),uBboxSize:(0,t.w5)("v3"),uMaxSteps:(0,t.w5)("i"),uStepScale:(0,t.w5)("f"),uJumpLength:(0,t.w5)("f"),uTransform:(0,t.w5)("m4"),uGridDim:(0,t.w5)("v3"),tTransferTex:(0,t.$G)("image-uint8","alpha","ubyte","linear"),uTransferScale:(0,t.w5)("f","material"),dGridTexType:(0,t.$F)("string",["2d","3d"]),uGridTexDim:(0,t.w5)("v3"),tGridTex:(0,t.$G)("texture","rgba","ubyte","linear"),uGridStats:(0,t.w5)("v4"),uCellDim:(0,t.w5)("v3"),uCartnToUnit:(0,t.w5)("m4"),uUnitToCartn:(0,t.w5)("m4"),dPackedGroup:(0,t.$F)("boolean"),dAxisOrder:(0,t.$F)("string",["012","021","102","120","201","210"]),dIgnoreLight:(0,t.$F)("boolean"),dXrayShaded:(0,t.$F)("string",["off","on","inverted"])},v={...t.DQ,aGroup:(0,t.Yz)("float32",1,0),aPosition:(0,t.Yz)("float32",3,0),aNormal:(0,t.Yz)("float32",3,0),elements:(0,t.Xs)("uint32"),dVaryingGroup:(0,t.$F)("boolean"),dFlatShaded:(0,t.$F)("boolean"),uDoubleSided:(0,t.w5)("b","material"),dFlipSided:(0,t.$F)("boolean"),dIgnoreLight:(0,t.$F)("boolean"),dXrayShaded:(0,t.$F)("string",["off","on","inverted"]),dTransparentBackfaces:(0,t.$F)("string",["off","on","opaque"]),uBumpFrequency:(0,t.w5)("f","material"),uBumpAmplitude:(0,t.w5)("f","material"),meta:(0,t.Xb)("unknown")},b={...t.DQ,...t.Hw,aGroup:(0,t.Yz)("float32",1,0),aPosition:(0,t.Yz)("float32",3,0),dPointSizeAttenuation:(0,t.$F)("boolean"),dPointStyle:(0,t.$F)("string",["square","circle","fuzzy"])},M={...t.DQ,...t.Hw,aGroup:(0,t.Yz)("float32",1,0),aMapping:(0,t.Yz)("float32",2,0),aStart:(0,t.Yz)("float32",3,0),aEnd:(0,t.Yz)("float32",3,0),elements:(0,t.Xs)("uint32"),dLineSizeAttenuation:(0,t.$F)("boolean"),uDoubleSided:(0,t.w5)("b","material"),dFlipSided:(0,t.$F)("boolean")},l={...t.DQ,...t.Hw,uTexDim:(0,t.w5)("v2"),tPositionGroup:(0,t.$G)("image-float32","rgba","float","nearest"),padding:(0,t.Xb)("number"),uDoubleSided:(0,t.w5)("b","material"),dIgnoreLight:(0,t.$F)("boolean"),dXrayShaded:(0,t.$F)("string",["off","on","inverted"]),dTransparentBackfaces:(0,t.$F)("string",["off","on","opaque"]),dSolidInterior:(0,t.$F)("boolean"),dClipPrimitive:(0,t.$F)("boolean"),dApproximate:(0,t.$F)("boolean"),uAlphaThickness:(0,t.w5)("f"),uBumpFrequency:(0,t.w5)("f","material"),uBumpAmplitude:(0,t.w5)("f","material"),lodLevels:(0,t.Xb)("unknown"),centerBuffer:(0,t.Xb)("float32"),groupBuffer:(0,t.Xb)("float32")},u={...t.DQ,...t.Hw,aGroup:(0,t.Yz)("float32",1,0),aPosition:(0,t.Yz)("float32",3,0),aMapping:(0,t.Yz)("float32",2,0),aDepth:(0,t.Yz)("float32",1,0),elements:(0,t.Xs)("uint32"),aTexCoord:(0,t.Yz)("float32",2,0),tFont:(0,t.$G)("image-uint8","alpha","ubyte","linear"),padding:(0,t.Xb)("number"),uBorderWidth:(0,t.w5)("f","material"),uBorderColor:(0,t.w5)("v3","material"),uOffsetX:(0,t.w5)("f","material"),uOffsetY:(0,t.w5)("f","material"),uOffsetZ:(0,t.w5)("f","material"),uBackgroundColor:(0,t.w5)("v3","material"),uBackgroundOpacity:(0,t.w5)("f","material")},s={...t.DQ,uGeoTexDim:(0,t.w5)("v2","buffered"),tPosition:(0,t.$G)("texture","rgb","float","nearest"),tGroup:(0,t.$G)("texture","alpha","float","nearest"),tNormal:(0,t.$G)("texture","rgb","float","nearest"),dVaryingGroup:(0,t.$F)("boolean"),dFlatShaded:(0,t.$F)("boolean"),uDoubleSided:(0,t.w5)("b","material"),dFlipSided:(0,t.$F)("boolean"),dIgnoreLight:(0,t.$F)("boolean"),dXrayShaded:(0,t.$F)("string",["off","on","inverted"]),dTransparentBackfaces:(0,t.$F)("string",["off","on","opaque"]),uBumpFrequency:(0,t.w5)("f","material"),uBumpAmplitude:(0,t.w5)("f","material"),meta:(0,t.Xb)("unknown")};var h=n(7135);const a={...t.DQ,aGroup:(0,t.Yz)("float32",1,0),aPosition:(0,t.Yz)("float32",3,0),aUv:(0,t.Yz)("float32",2,0),elements:(0,t.Xs)("uint32"),uImageTexDim:(0,t.w5)("v2"),tImageTex:(0,t.$G)("image-uint8","rgba","ubyte","nearest"),tGroupTex:(0,t.$G)("image-uint8","rgba","ubyte","nearest"),dInterpolation:(0,t.$F)("string",h.Bd)},D={...t.DQ,...t.Hw,aGroup:(0,t.Yz)("float32",1,0),aStart:(0,t.Yz)("float32",3,0),aEnd:(0,t.Yz)("float32",3,0),aMapping:(0,t.Yz)("float32",3,0),aScale:(0,t.Yz)("float32",1,0),aCap:(0,t.Yz)("float32",1,0),aColorMode:(0,t.Yz)("float32",1,0),elements:(0,t.Xs)("uint32"),padding:(0,t.Xb)("number"),uDoubleSided:(0,t.w5)("b","material"),dIgnoreLight:(0,t.$F)("boolean"),dXrayShaded:(0,t.$F)("string",["off","on","inverted"]),dTransparentBackfaces:(0,t.$F)("string",["off","on","opaque"]),dSolidInterior:(0,t.$F)("boolean"),uBumpFrequency:(0,t.w5)("f","material"),uBumpAmplitude:(0,t.w5)("f","material"),dDualColor:(0,t.$F)("boolean")},f=(0,e.q)(0,2147483647),p=(0,e.q)(0,2147483647);function E(L,w,Q,G){return{id:f(),type:L,values:w,state:Q,materialId:G}}function T(L,w,Q){switch(w.type){case"mesh":return function O(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...v},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.uO,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"points":return function _(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...b},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"points",A.g2,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"spheres":return function m(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...l},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.n5,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"cylinders":return function R(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...D},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.UT,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"text":return function d(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...u},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.G7,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"lines":return function I(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...M},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.wv,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"direct-volume":return function i(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...c};L.isWebGL2||(N.uMaxSteps=(0,t.$F)("number"));const k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.m5,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"image":return function S(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...a},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.u3,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q);case"texture-mesh":return function C(L,w,Q,G,V,U){const N={...t.X9,...t.YU,...t.rG,...s},k={uObjectId:y.IQ.create(w)},$=(0,r.vC)(L,"triangles",A.uO,N,{...Q,...k},V,U);return(0,o.R)($,Q,G)}(L,w.id,w.values,w.state,w.materialId,Q)}throw new Error("unsupported type")}},9421:(tn,Ue,n)=>{"use strict";n.d(Ue,{R:()=>I,_:()=>l});var e=n(9909),o=n(7778),r=n(127),t=n(9137),A=n(9457),y=n(5384),c=n(8599),i=n(2629);const v=A.i.distanceToPoint,O=t.Q.intersectsSphere3D,b=y.f8.fromArray,_=(0,o.q)();function M(m,u){return u&&u.instanceCounts.length>=m?u:{firsts:new Int32Array(m),counts:new Int32Array(m),offsets:new Int32Array(m),instanceCounts:new Int32Array(m),baseVertices:new Int32Array(m),baseInstances:new Uint32Array(m),count:0,uniforms:[]}}function I(m,u,d){const s=_();let C=M(0);const h=[];let a=!1,S=-1;const D=(0,y.f8)(),R=()=>{var f;const p=null===(f=u.lodLevels)||void 0===f?void 0:f.ref.value;if(p&&p.length>0){const{cellCount:E}=u.instanceGrid.ref.value;h.length=p.length;for(let T=0,L=p.length;T{var L,w;if(a=!1,0===u.drawCount.ref.value||0===u.instanceCount.ref.value||u.instanceGrid.ref.value.cellSize<=1)return;const{cellOffsets:Q,cellSpheres:G,cellCount:V,batchOffsets:U,batchSpheres:N,batchCount:k,batchCell:H,batchSize:$}=u.instanceGrid.ref.value,[J,W]=u.uLod.ref.value,te=0!==J||0!==W,de=2*$,ye=null===(L=u.lodLevels)||void 0===L?void 0:L.ref.value;if(ye&&ye.length>0){if((null===(w=u.lodLevels)||void 0===w?void 0:w.ref.version)!==S)R();else for(let j=0,Z=ye.length;jW))i.g$&&(T.culled.lod+=Q[H[q-1]+1]-Q[H[Z]]);else if(O(p,D))if(null!==E&&E(D))i.g$&&(T.culled.occlusion+=Q[H[q-1]+1]-Q[H[Z]]);else for(let g=Z;gW))i.g$&&(T.culled.lod+=Ae);else if(O(p,D))if(null!==E&&Be-D.radiusye[Ce][1])continue;const ke=h[Ce],we=ke.count;we>0&&ke.baseInstances[we-1]+ke.instanceCounts[we-1]===xe&&ke.counts[we-1]===ye[Ce][3]?ke.instanceCounts[we-1]+=Ae:(ke.counts[we]=ye[Ce][3],ke.instanceCounts[we]=Ae,ke.baseInstances[we]=xe,ke.count+=1)}else i.g$&&(T.culled.frustum+=Ae)}else i.g$&&(T.culled.frustum+=Q[H[q-1]+1]-Q[H[Z]])}}else{C=M(V,C);const{baseInstances:j,instanceCounts:Z,counts:q}=C;let Y=0;for(let ee=0;eeW){i.g$&&(T.culled.lod+=Q[H[_e-1]+1]-Q[H[g]]);continue}}if(!O(p,D)){i.g$&&(T.culled.frustum+=Q[H[_e-1]+1]-Q[H[g]]);continue}if(null!==E&&E(D)){i.g$&&(T.culled.occlusion+=Q[H[_e-1]+1]-Q[H[g]]);continue}for(let le=g;le<_e;++le){const Ae=H[le],Be=Q[Ae],Re=Q[Ae+1]-Be;if(0===Re)continue;b(D,G,4*Ae);const ke=v(f,D.center);te&&(ke+D.radiusW)?i.g$&&(T.culled.lod+=Re):O(p,D)?null!==E&&ke-D.radius0&&j[Y-1]+Z[Y-1]===Be?Z[Y-1]+=Re:(q[Y]=u.drawCount.ref.value,Z[Y]=Re,j[Y]=Be,Y+=1):i.g$&&(T.culled.frustum+=Re)}}}C.count=Y,h.length=1,h[0]=C,h[0].uniforms.length=0}a=!0},uncull:()=>{a=!1},render:(f,p)=>{u.uAlpha&&u.alpha&&e.IQ.updateIfChanged(u.uAlpha,(0,r.qE)(u.alpha.ref.value*d.alphaFactor,0,1)),m.render(f,p,a?h:void 0)},getProgram:f=>m.getProgram(f),setTransparency:f=>m.setTransparency(f),update:()=>{m.update(),R()},dispose:()=>m.destroy()}}function l(m,u){return{id:_(),values:u,render:()=>m.render("compute",0),update:()=>m.update(),dispose:()=>m.destroy()}}},4511:(tn,Ue,n)=>{"use strict";function e(h,a){const S={},D={},R={},f={},p={},E={},T={};return Object.keys(h).forEach(L=>{const w=h[L];"attribute"===w.type&&(S[L]=a[L]),"define"===w.type&&(D[L]=a[L]),"texture"===w.type&&void 0!==a[L]&&("material"===w.variant?f[L]=a[L]:R[L]=a[L]),"uniform"===w.type&&void 0!==a[L]&&("material"===w.variant?E[L]=a[L]:"buffered"===w.variant?T[L]=a[L]:p[L]=a[L])}),{attributeValues:S,defineValues:D,textureValues:R,materialTextureValues:f,uniformValues:p,materialUniformValues:E,bufferedUniformValues:T}}function o(h){const a={};return Object.keys(h).forEach(S=>{a[S]=h[S].ref.version}),a}function r(h,a,S){return{type:"attribute",kind:h,itemSize:a,divisor:S}}function t(h,a){return{type:"uniform",kind:h,variant:a}}function A(h,a,S,D,R){return{type:"texture",kind:h,format:a,dataType:S,filter:D,variant:R}}function y(h){return{type:"elements",kind:h}}function c(h,a){return{type:"define",kind:h,options:a}}function i(h){return{type:"value",kind:h}}n.d(Ue,{$F:()=>c,$G:()=>A,DQ:()=>C,Hw:()=>M,X9:()=>v,Xb:()=>i,Xs:()=>y,YU:()=>O,Yz:()=>r,fb:()=>o,rG:()=>b,tC:()=>e,w5:()=>t});const v={uDrawId:t("i"),uModel:t("m4"),uView:t("m4"),uInvView:t("m4"),uModelView:t("m4"),uInvModelView:t("m4"),uProjection:t("m4"),uInvProjection:t("m4"),uModelViewProjection:t("m4"),uInvModelViewProjection:t("m4"),uIsOrtho:t("f"),uPixelRatio:t("f"),uViewport:t("v4"),uViewOffset:t("v2"),uDrawingBufferSize:t("v2"),uCameraPosition:t("v3"),uCameraDir:t("v3"),uCameraPlane:t("v4"),uNear:t("f"),uFar:t("f"),uFog:t("b"),uFogNear:t("f"),uFogFar:t("f"),uFogColor:t("v3"),uTransparentBackground:t("b"),uLightDirection:t("v3[]"),uLightColor:t("v3[]"),uAmbientColor:t("v3"),uPickingAlphaThreshold:t("f"),uInteriorDarkening:t("f"),uInteriorColorFlag:t("b"),uInteriorColor:t("v3"),uHighlightColor:t("v3"),uSelectColor:t("v3"),uDimColor:t("v3"),uHighlightStrength:t("f"),uSelectStrength:t("f"),uDimStrength:t("f"),uMarkerPriority:t("i"),uMarkerAverage:t("f"),uXrayEdgeFalloff:t("f"),uExposure:t("f"),uRenderMask:t("i"),uMarkingDepthTest:t("b"),uMarkingType:t("i"),uPickType:t("i")},O={tDepth:A("texture","depth","ushort","nearest"),tDpoitDepth:A("texture","rg","float","nearest"),tDpoitFrontColor:A("texture","rgba","float","nearest"),tDpoitBackColor:A("texture","rgba","float","nearest")},b={uObjectId:t("i")},_={uColor:t("v3","material"),uColorTexDim:t("v2"),uColorGridDim:t("v3"),uColorGridTransform:t("v4"),tColor:A("image-uint8","rgb","ubyte","nearest"),tPalette:A("image-uint8","rgb","ubyte","nearest"),tColorGrid:A("texture","rgb","ubyte","linear"),dColorType:c("string",["uniform","attribute","instance","group","groupInstance","vertex","vertexInstance","volume","volumeInstance","direct"]),dUsePalette:c("boolean")},M={uSize:t("f","material"),uSizeTexDim:t("v2"),tSize:A("image-uint8","rgb","ubyte","nearest"),dSizeType:c("string",["uniform","attribute","instance","group","groupInstance"]),uSizeFactor:t("f","material")},I={uMarker:t("f"),uMarkerTexDim:t("v2"),tMarker:A("image-uint8","alpha","ubyte","nearest"),markerAverage:i("number"),markerStatus:i("number"),dMarkerType:c("string",["instance","groupInstance"])},l={uOverpaintTexDim:t("v2"),tOverpaint:A("image-uint8","rgba","ubyte","nearest"),dOverpaint:c("boolean"),uOverpaintGridDim:t("v3"),uOverpaintGridTransform:t("v4"),tOverpaintGrid:A("texture","rgba","ubyte","linear"),dOverpaintType:c("string",["instance","groupInstance","volumeInstance"]),uOverpaintStrength:t("f","material")},m={uTransparencyTexDim:t("v2"),tTransparency:A("image-uint8","alpha","ubyte","nearest"),dTransparency:c("boolean"),transparencyAverage:i("number"),uTransparencyGridDim:t("v3"),uTransparencyGridTransform:t("v4"),tTransparencyGrid:A("texture","alpha","ubyte","linear"),dTransparencyType:c("string",["instance","groupInstance","volumeInstance"]),uTransparencyStrength:t("f","material")},u={uEmissiveTexDim:t("v2"),tEmissive:A("image-uint8","alpha","ubyte","nearest"),dEmissive:c("boolean"),emissiveAverage:i("number"),uEmissiveGridDim:t("v3"),uEmissiveGridTransform:t("v4"),tEmissiveGrid:A("texture","alpha","ubyte","linear"),dEmissiveType:c("string",["instance","groupInstance","volumeInstance"]),uEmissiveStrength:t("f","material")},d={uSubstanceTexDim:t("v2"),tSubstance:A("image-uint8","rgba","ubyte","nearest"),dSubstance:c("boolean"),uSubstanceGridDim:t("v3"),uSubstanceGridTransform:t("v4"),tSubstanceGrid:A("texture","rgba","ubyte","linear"),dSubstanceType:c("string",["instance","groupInstance","volumeInstance"]),uSubstanceStrength:t("f","material")},s={uClippingTexDim:t("v2"),tClipping:A("image-uint8","alpha","ubyte","nearest"),dClipping:c("boolean"),dClippingType:c("string",["instance","groupInstance"])},C={dGeometryType:c("string",["cylinders","directVolume","image","lines","mesh","points","spheres","text","textureMesh"]),..._,...I,...l,...m,...u,...d,...s,dLightCount:c("number"),dColorMarker:c("boolean"),dClipObjectCount:c("number"),dClipVariant:c("string",["instance","pixel"]),uClipObjectType:t("i[]","material"),uClipObjectInvert:t("b[]","material"),uClipObjectPosition:t("v3[]","material"),uClipObjectRotation:t("v4[]","material"),uClipObjectScale:t("v3[]","material"),aInstance:r("float32",1,1),aTransform:r("float32",16,1),uAlpha:t("f","material"),uMetalness:t("f","material"),uRoughness:t("f","material"),uBumpiness:t("f","material"),uEmissive:t("f","material"),uVertexCount:t("i"),uInstanceCount:t("i"),uGroupCount:t("i"),uInvariantBoundingSphere:t("v4"),uLod:t("v4"),drawCount:i("number"),instanceCount:i("number"),alpha:i("number"),matrix:i("m4"),transform:i("float32"),extraTransform:i("float32"),hasReflection:i("boolean"),instanceGranularity:i("boolean"),boundingSphere:i("sphere"),invariantBoundingSphere:i("sphere"),instanceGrid:i("instanceGrid")}},3784:(tn,Ue,n)=>{"use strict";n.d(Ue,{Ax:()=>h,sL:()=>s,xg:()=>i});var e=n(5384),o=n(4369),r=n(7136);n(6115);const A=o.eB.fromArray,y=o.eB.transformMat4Offset;function i(S,D,R,f){const{length:p,width:E,height:T}=function c(S,D){S=Math.max(S,2);const R=Math.sqrt(S);let f=Math.ceil(R);f+=(D-f%D)%D;const p=f>0?Math.ceil(S/f):0;return{width:f,height:p,length:f*p*D}}(S,D);return{array:f=f&&f.length>=p?f:new R(p),width:E,height:T}}const l=(0,o.eB)(),m=new r.Z("14"),u=new r.Z("98");function d(S){return S>1e5?m:u}function s(S,D,R){const f=3*R,p=d(D);p.reset();for(let T=0,L=3*D;T{"use strict";n.d(Ue,{Z:()=>l});var r,e=n(8353),o=n(4369);!function(m){m.create=function u(){return{view:o.$I.identity(),position:o.eB.create(0,0,0),direction:o.eB.create(0,0,-1),up:o.eB.create(0,1,0)}};const d=o.eB.zero();m.update=function s(C){o.eB.add(d,C.position,C.direction),o.$I.lookAt(C.view,C.position,d,C.up)}}(r||(r={}));var t=n(8184),A=n(9677);class y{constructor(){this.removeList=(0,A.wl)(),this.removeMap=new Map,this.addList=(0,A.wl)(),this.addMap=new Map}get isEmpty(){return 0===this.removeList.count&&0===this.addList.count}get size(){return this.removeMap.size+this.addMap.size}add(u){if(this.removeMap.has(u)){const s=this.removeMap.get(u);this.removeMap.delete(u),this.removeList.remove(s)}if(this.addMap.has(u))return;const d=this.addList.addLast(u);this.addMap.set(u,d)}remove(u){if(this.addMap.has(u)){const s=this.addMap.get(u);this.addMap.delete(u),this.addList.remove(s)}if(this.removeMap.has(u))return;const d=this.removeList.addLast(u);this.removeMap.set(u,d)}tryGetRemove(){const u=this.removeList.removeFirst();return u&&this.removeMap.delete(u),u}tryGetAdd(){const u=this.addList.removeFirst();return u&&this.addMap.delete(u),u}}var c=n(9854),i=n(6115),v=n(7136),O=n(8382),b=n(127);const _=new v.Z("98");function M(m,u,d){_.reset();for(let s=0,C=m.length;s{s=le;for(let Ae=0,Be=h.length;Aej.add(le),remove:le=>j.remove(le),commit:(le=Number.MAX_VALUE)=>function ye(le){const Ae=(0,c.t)();let Be=0;for(;;){const Ce=j.tryGetRemove();if(!Ce)break;if(te(Ce),++Be%100==0&&(0,c.t)()-Ae>le)return!1}for(;;){const Ce=j.tryGetAdd();if(!Ce)break;if(W(Ce),++Be%100==0&&(0,c.t)()-Ae>le)return!1}return h.sort(I),E=!0,T=!0,L=!0,w=!0,!0}(le),get commitQueueSize(){return j.size},get needsCommit(){return!j.isEmpty},has:le=>C.has(le),clear:()=>{for(let le=0,Ae=h.length;le{C.forEach(le)},get count(){return h.length},get boundingSphere(){return f&&(M(h,a,!1),f=!1),a},get boundingSphereVisible(){return p&&(M(h,S,!0),p=!1),S},get markerAverage(){return E&&(Q=function ee(){if(0===D.length)return 0;let le=0,Ae=0;for(let Be=0,Ce=D.length;Be0?Ae/le:0}(),E=!1),Q},get emissiveAverage(){return T&&(G=function g(){if(0===D.length)return 0;let le=0,Ae=0;for(let Be=0,Ce=D.length;Be0?Ae/le:0}(),T=!1),G},get opacityAverage(){return L&&(V=function _e(){var le,Ae;if(0===D.length)return 0;let Be=0,Ce=0;for(let Re=0,ke=D.length;Re0?Ce/Be:0}(),L=!1),V},get hasOpaque(){return w&&(U=function xe(){var le;if(0===D.length)return!1;for(let Ae=0,Be=D.length;Ae{"use strict";n.d(Ue,{UT:()=>ve,m5:()=>ge,u3:()=>Ie,wv:()=>se,uO:()=>ae,g2:()=>ue,NG:()=>be,n5:()=>re,G7:()=>ce,NB:()=>$e});var e=n(7778),o=n(8437),r=n(1372);const Ae=(0,e.q)(),Be={apply_fog:"\nfloat preFogAlpha = gl_FragColor.a;\nif (uFog) {\n float viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar);\n float fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ));\n float fogAlpha = (1.0 - fogFactor) * gl_FragColor.a;\n if (!uTransparentBackground) {\n if (gl_FragColor.a < 1.0) {\n // transparent objects are blended with background color\n gl_FragColor.a = fogAlpha;\n } else {\n // mix opaque objects with background color\n gl_FragColor.rgb = mix(gl_FragColor.rgb, uFogColor, fogFactor);\n }\n } else {\n #if defined(dRenderVariant_colorDpoit)\n if (gl_FragColor.a < 1.0) {\n // transparent objects are blended with background color\n gl_FragColor.a = fogAlpha;\n } else {\n // opaque objects need to be pre-multiplied alpha\n gl_FragColor.rgb *= fogAlpha;\n gl_FragColor.a = fogAlpha;\n }\n #else\n // pre-multiplied alpha expected for transparent background\n gl_FragColor.rgb *= fogAlpha;\n gl_FragColor.a = fogAlpha;\n #endif\n }\n}\n",apply_interior_color:"\nif (interior) {\n if (uInteriorColorFlag) {\n gl_FragColor.rgb = uInteriorColor;\n } else {\n gl_FragColor.rgb *= 1.0 - uInteriorDarkening;\n }\n\n #ifdef dTransparentBackfaces_opaque\n gl_FragColor.a = 1.0;\n #endif\n}\n",apply_light_color:"\n#if defined(dIgnoreLight)\n #ifdef bumpEnabled\n if (uBumpFrequency > 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 #if defined(dRenderVariant_color)\n material.rgb += material.rgb * emissive;\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 #if defined(dRenderVariant_color)\n outgoingLight += color.rgb * emissive;\n #endif\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 #if defined(dDualColor)\n vec4 color2;\n if (aColorMode == 2.0) {\n vColor.rgb = readFromTexture(tColor, group, uColorTexDim).rgb;\n } else {\n vColor.rgb = readFromTexture(tColor, group * 2.0, uColorTexDim).rgb;\n color2.rgb = readFromTexture(tColor, group * 2.0 + 1.0, uColorTexDim).rgb;\n }\n #else\n vColor.rgb = readFromTexture(tColor, group, uColorTexDim).rgb;\n #endif\n #elif defined(dColorType_groupInstance)\n #if defined(dDualColor)\n vec4 color2;\n if (aColorMode == 2.0) {\n vColor.rgb = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim).rgb;\n } else {\n vColor.rgb = readFromTexture(tColor, (aInstance * float(uGroupCount) + group) * 2.0, uColorTexDim).rgb;\n color2.rgb = readFromTexture(tColor, (aInstance * float(uGroupCount) + group) * 2.0 + 1.0, uColorTexDim).rgb;\n }\n #else\n vColor.rgb = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim).rgb;\n #endif\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 dEmissive\n #if defined(dEmissiveType_instance)\n vEmissive = readFromTexture(tEmissive, aInstance, uEmissiveTexDim).a;\n #elif defined(dEmissiveType_groupInstance)\n vEmissive = readFromTexture(tEmissive, aInstance * float(uGroupCount) + group, uEmissiveTexDim).a;\n #elif defined(dEmissiveType_vertexInstance)\n vEmissive = readFromTexture(tEmissive, int(aInstance) * uVertexCount + VertexID, uEmissiveTexDim).a;\n #elif defined(dEmissiveType_volumeInstance)\n vec3 egridPos = (uEmissiveGridTransform.w * (vModelPosition - uEmissiveGridTransform.xyz)) / uEmissiveGridDim;\n vEmissive = texture3dFrom2dLinear(tEmissiveGrid, egridPos, uEmissiveGridDim, uEmissiveTexDim).a;\n #endif\n vEmissive *= uEmissiveStrength;\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_emissive)\n #ifdef dEmissive\n #if defined(dEmissiveType_instance)\n vEmissive = readFromTexture(tEmissive, aInstance, uEmissiveTexDim).a;\n #elif defined(dEmissiveType_groupInstance)\n vEmissive = readFromTexture(tEmissive, aInstance * float(uGroupCount) + group, uEmissiveTexDim).a;\n #elif defined(dEmissiveType_vertexInstance)\n vEmissive = readFromTexture(tEmissive, int(aInstance) * uVertexCount + VertexID, uEmissiveTexDim).a;\n #elif defined(dEmissiveType_volumeInstance)\n vec3 egridPos = (uEmissiveGridTransform.w * (vModelPosition - uEmissiveGridTransform.xyz)) / uEmissiveGridDim;\n vEmissive = texture3dFrom2dLinear(tEmissiveGrid, egridPos, uEmissiveGridDim, uEmissiveTexDim).a;\n #endif\n vEmissive *= uEmissiveStrength;\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 emissive = uEmissive;\n #ifdef dEmissive\n emissive += vEmissive;\n #endif\n\n float metalness = uMetalness;\n float roughness = uRoughness;\n float bumpiness = uBumpiness;\n #ifdef dSubstance\n float sf = clamp(vSubstance.a, 0.0, 0.99); // clamp to avoid artifacts\n metalness = mix(metalness, vSubstance.r, sf);\n roughness = mix(roughness, vSubstance.g, sf);\n bumpiness = mix(bumpiness, vSubstance.b, sf);\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#elif defined(dRenderVariant_emissive)\n float emissive = uEmissive;\n #ifdef dEmissive\n emissive += vEmissive;\n #endif\n vec4 material = vec4(emissive);\n#endif\n\n// apply per-group transparency\n#if defined(dTransparency) && (defined(dRenderVariant_pick) || defined(dRenderVariant_color) || defined(dRenderVariant_emissive))\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 * uAlpha < uPickingAlphaThreshold)\n discard; // ignore so the element below can be picked\n #elif defined(dRenderVariant_emissive)\n if (ta < 1.0)\n discard; // emissive not supported with transparency\n #elif defined(dRenderVariant_color)\n material.a *= ta;\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",check_transparency:"\n#if defined(dRenderVariant_color)\n #if defined(dTransparentBackfaces_off)\n if (interior && material.a < 1.0) discard;\n #elif defined(dTransparentBackfaces_opaque)\n if (interior) material.a = 1.0;\n #endif\n\n #if !defined(dXrayShaded_on) && !defined(dXrayShaded_inverted)\n if ((uRenderMask == MaskOpaque && material.a < 1.0) ||\n (uRenderMask == MaskTransparent && material.a == 1.0)\n ) {\n discard;\n }\n #endif\n#endif\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\nuniform float uEmissive;\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 dEmissive\n varying float vEmissive;\n #endif\n\n #ifdef dSubstance\n varying vec4 vSubstance;\n #endif\n#elif defined(dRenderVariant_emissive)\n #ifdef dEmissive\n varying float vEmissive;\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 dEmissive\n #if defined(dEmissiveType_instance) || defined(dEmissiveType_groupInstance) || defined(dEmissiveType_vertexInstance)\n varying float vEmissive;\n uniform vec2 uEmissiveTexDim;\n uniform sampler2D tEmissive;\n #elif defined(dEmissiveType_volumeInstance)\n varying float vEmissive;\n uniform vec2 uEmissiveTexDim;\n uniform vec3 uEmissiveGridDim;\n uniform vec4 uEmissiveGridTransform;\n uniform sampler2D tEmissiveGrid;\n #endif\n uniform float uEmissiveStrength;\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_emissive)\n #ifdef dEmissive\n #if defined(dEmissiveType_instance) || defined(dEmissiveType_groupInstance) || defined(dEmissiveType_vertexInstance)\n varying float vEmissive;\n uniform vec2 uEmissiveTexDim;\n uniform sampler2D tEmissive;\n #elif defined(dEmissiveType_volumeInstance)\n varying float vEmissive;\n uniform vec2 uEmissiveTexDim;\n uniform vec3 uEmissiveGridDim;\n uniform vec4 uEmissiveGridTransform;\n uniform sampler2D tEmissiveGrid;\n #endif\n uniform float uEmissiveStrength;\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\nuniform vec4 uCameraPlane;\nuniform vec4 uLod;\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 if (det == 0.0) return normal;\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;\nuniform vec4 uCameraPlane;\n\nuniform int uObjectId;\nuniform int uVertexCount;\nuniform int uInstanceCount;\nuniform int uGroupCount;\nuniform vec4 uInvariantBoundingSphere;\nuniform vec4 uLod;\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\n#if defined(enabledMultiDraw)\n #define DrawID gl_DrawID\n#else\n #define DrawID uDrawId\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",fade_lod:"\nif (uLod.w == 0.0 && (uLod.x != 0.0 || uLod.y != 0.0)) {\n float d = dot(uCameraPlane.xyz, vModelPosition) + uCameraPlane.w;\n float ta = min(\n smoothstep(uLod.x, uLod.x + uLod.z, d),\n 1.0 - smoothstep(uLod.y - uLod.z, uLod.y, d)\n );\n\n #if defined(dRenderVariant_color)\n float at = 0.0;\n\n // shift by view-offset during multi-sample rendering to allow for blending\n vec2 coord = gl_FragCoord.xy + uViewOffset * 0.25;\n\n const mat4 thresholdMatrix = mat4(\n 1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,\n 13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,\n 4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,\n 16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0\n );\n int ci = int(intMod(coord.x, 4.0));\n int ri = int(intMod(coord.y, 4.0));\n #if __VERSION__ == 100\n vec4 i = vec4(float(ci * 4 + ri));\n vec4 v = thresholdMatrix[0] * vec4(equal(i, vec4(0.0, 1.0, 2.0, 3.0))) +\n thresholdMatrix[1] * vec4(equal(i, vec4(4.0, 5.0, 6.0, 7.0))) +\n thresholdMatrix[2] * vec4(equal(i, vec4(8.0, 9.0, 10.0, 11.0))) +\n thresholdMatrix[3] * vec4(equal(i, vec4(12.0, 13.0, 14.0, 15.0)));\n at = v.x + v.y + v.z + v.w;\n #else\n at = thresholdMatrix[ci][ri];\n #endif\n\n if (ta < 0.99 && (ta < 0.01 || ta < at)) {\n discard;\n }\n #else\n if (ta < uPickingAlphaThreshold) {\n discard;\n }\n #endif\n}\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"},Ce=/^(?!\/\/)\s*#include\s+(\S+)/gm,Re=/#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,ke=/[ \t]*\/\/.*\n/g,we=/[ \t]*\/\*[\s\S]*?\*\//g,Oe=/\n{2,}/g;function Se(mt){return mt.replace(Ce,(_t,Me)=>{const Ke=Be[Me];if(!Ke)throw new Error(`empty chunk, '${Me}'`);return Ke}).trim().replace(ke,"\n").replace(we,"\n").replace(Oe,"\n")}function Ne(mt,_t,Me,Ke){let ut="";for(let Kt=parseInt(_t);Kt 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(dPointStyle_fuzzy) && defined(dRenderVariant_color)\n material.a *= fuzzyAlpha;\n #endif\n\n #include check_transparency\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_emissive)\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"},{},ie),re=be("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 vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n float d;\n if (uLod.w != 0.0 && (uLod.x != 0.0 || uLod.y != 0.0)) {\n d = dot(uCameraPlane.xyz, vModelPosition) + uCameraPlane.w;\n float f = min(\n smoothstep(uLod.x, uLod.x + uLod.z, d),\n 1.0 - smoothstep(uLod.y - uLod.z, uLod.y, d)\n ) * uLod.w;\n vRadius *= f;\n }\n\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 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 (uLod.w != 0.0 && (uLod.x != 0.0 || uLod.y != 0.0)) {\n if (d < uLod.x || d > uLod.y) {\n // move out of [ -w, +w ] to 'discard' in vert shader\n gl_Position.z = 2.0 * gl_Position.w;\n }\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 #include fade_lod\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_color)\n if (uRenderMask == MaskTransparent && uAlphaThickness > 0.0) {\n material.a *= min(1.0, vRadius / uAlphaThickness);\n }\n #endif\n\n #include check_transparency\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_emissive)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n vec3 normal = -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"},{},Te),ve=be("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;\nattribute float aColorMode;\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 float f = aMapping.x > 0.0 ? 1.0 : 0.0;\n // ensure cylinder 'dir' is pointing towards the camera\n if(dot(camDir, dir) < 0.0) {\n dir = -dir;\n f = 1.0 - f;\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 #if defined(dDualColor) && defined(dRenderVariant_color) && (defined(dColorType_group) || defined(dColorType_groupInstance))\n // dual-color mixing\n // - for aColorMode between 0 and 1 use aColorMode to interpolate\n // - for aColorMode == 2 do nothing, i.e., use vColor\n // - for aColorMode == 3 use position on cylinder axis to interpolate\n if (aColorMode <= 1.0){\n vColor.rgb = mix(vColor.rgb, color2.rgb, aColorMode);\n } else if (aColorMode == 3.0) {\n vColor.rgb = mix(vColor.rgb, color2.rgb, mix(-0.25, 1.25, f / 1.5));\n }\n #endif\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 fade_lod\n #include clip_pixel\n #include assign_material_color\n #include check_transparency\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_emissive)\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"},{},Te),ce=be("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 fade_lod\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 = clamp(0.0, 1.0, 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 // 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 #include check_transparency\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_emissive)\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"},{},ie),se=be("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 fade_lod\n #include clip_pixel\n\n float fragmentDepth = gl_FragCoord.z;\n #include assign_material_color\n #include check_transparency\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_emissive)\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"},{},ie),ae=be("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 fade_lod\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 #include check_transparency\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_emissive)\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"},{},Te),ge=be("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;\nuniform float uEmissive;\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 float emissive = uEmissive;\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 #if defined(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 defined(dRenderVariant_emissive)\n discard;\n #else\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 #endif\n}\n",{fragDepth:"optional",drawBuffers:"optional"},{},Te),Ie=be("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 = abs(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 fade_lod\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 imageData.a *= uAlpha;\n if (imageData.a < 0.05)\n discard;\n\n float fragmentDepth = gl_FragCoord.z;\n\n if ((uRenderMask == MaskOpaque && imageData.a < 1.0) ||\n (uRenderMask == MaskTransparent && imageData.a == 1.0)\n ) {\n discard;\n }\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_emissive)\n gl_FragColor = vec4(0.0);\n #elif defined(dRenderVariant_color)\n gl_FragColor = imageData;\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"},{},ie);function Le(mt,_t){var Me;if(void 0===mt)return"";const Ke=(null===(Me=mt.dRenderVariant)||void 0===Me?void 0:Me.ref.value)||"",ut=[];for(const Kt in mt){if(_t?.(Kt,Ke,mt))continue;const gt=mt[Kt].ref.value;void 0!==gt&&("string"==typeof gt?ut.push(`#define ${Kt}_${gt}`):"number"==typeof gt?ut.push(`#define ${Kt} ${gt}`):"boolean"==typeof gt?gt&&ut.push(`#define ${Kt}`):(0,r.dr)(gt))}return ut.join("\n")+"\n"}const Lt="\n#define attribute in\n#define varying out\n#define texture2D texture\n",Je="\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 $e(mt,_t,Me,Ke){const ut=Le(Me,Ke.ignoreDefine),Kt=Le(Me,Ke.ignoreDefine),sn=(0,o.C6)(mt)?function en(mt,_t){const Me=["#version 300 es"];if(_t.drawBuffers&&mt.drawBuffers&&Me.push("#define requiredDrawBuffers"),_t.multiDraw)if(mt.multiDraw)Me.push("#extension GL_ANGLE_multi_draw : require"),Me.push("#define enabledMultiDraw");else if("required"===_t.multiDraw)throw new Error("required 'GL_ANGLE_multi_draw' extension not available");if(_t.clipCullDistance)if(mt.clipCullDistance)Me.push("#extension GL_ANGLE_clip_cull_distance : enable"),Me.push("#define enabledClipCullDistance");else if("required"===_t.clipCullDistance)throw new Error("required 'GL_ANGLE_clip_cull_distance' extension not available");if(_t.conservativeDepth)if(mt.conservativeDepth)Me.push("#extension GL_EXT_conservative_depth : enable"),Me.push("#define enabledConservativeDepth");else if("required"===_t.conservativeDepth)throw new Error("required 'GL_EXT_conservative_depth' extension not available");return mt.noNonInstancedActiveAttribs&&Me.push("#define noNonInstancedActiveAttribs"),Me.push(Lt),Me.join("\n")+"\n"}(_t,Ke.extensions):function nt(mt,_t){const Me=[];if(_t.drawBuffers)if(mt.drawBuffers)Me.push("#define requiredDrawBuffers");else if("required"===_t.drawBuffers)throw new Error("required 'GL_EXT_draw_buffers' extension not available");if(_t.multiDraw)if(mt.multiDraw)Me.push("#extension GL_ANGLE_multi_draw : require"),Me.push("#define enabledMultiDraw");else if("required"===_t.multiDraw)throw new Error("required 'GL_ANGLE_multi_draw' extension not available");return Me.join("\n")+"\n"}(_t,Ke.extensions),gt=(0,o.C6)(mt)?function Bt(mt,_t,Me,Ke){const ut=["#version 300 es",`layout(location = 0) out highp ${Ke[0]||"vec4"} out_FragData0;`];if(Me.fragDepth&&_t.fragDepth&&ut.push("#define enabledFragDepth"),Me.drawBuffers&&_t.drawBuffers){ut.push("#define requiredDrawBuffers");for(let sn=1,gt=mt.getParameter(mt.MAX_DRAW_BUFFERS);sn{"use strict";n.d(Ue,{e:()=>e});const e="\nprecision highp float;\n\nattribute vec2 aPosition;\nuniform vec2 uQuadScale;\n\nvoid main(void) {\n vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale;\n gl_Position = vec4(position, 0.0, 1.0);\n}\n"},4677:(tn,Ue,n)=>{"use strict";n.d(Ue,{Fu:()=>_,Zo:()=>v,ki:()=>I,oq:()=>M,xB:()=>b});var e=n(7778),o=n(1372),r=n(8437);const t=(0,e.q)();function v(l){const m=l.createBuffer();if(null===m)throw new Error("Could not create WebGL buffer");return m}function O(l,m,u,d){let s=v(l);const C=function A(l,m){switch(m){case"static":return l.STATIC_DRAW;case"dynamic":return l.DYNAMIC_DRAW;case"stream":return l.STREAM_DRAW}}(l,u),h=function i(l,m){switch(m){case"attribute":return l.ARRAY_BUFFER;case"elements":return l.ELEMENT_ARRAY_BUFFER;case"uniform":if((0,r.C6)(l))return l.UNIFORM_BUFFER;throw new Error("WebGL2 is required for uniform buffers")}}(l,d),a=function c(l,m){return m instanceof Uint8Array?l.UNSIGNED_BYTE:m instanceof Int8Array?l.BYTE:m instanceof Uint16Array?l.UNSIGNED_SHORT:m instanceof Int16Array?l.SHORT:m instanceof Uint32Array?l.UNSIGNED_INT:m instanceof Int32Array?l.INT:m instanceof Float32Array?l.FLOAT:void(0,o.dr)(m)}(l,m),S=m.BYTES_PER_ELEMENT,D=m.length;function R(p){l.bindBuffer(h,s),l.bufferData(h,p,C)}R(m);let f=!1;return{id:t(),_usageHint:C,_bufferType:h,_dataType:a,_bpe:S,length:D,getBuffer:()=>s,updateData:R,updateSubData:(p,E,T)=>{l.bindBuffer(h,s),T-E===p.length?l.bufferSubData(h,0,p):l.bufferSubData(h,E*S,p.subarray(E,E+T))},reset:()=>{s=v(l),R(m)},destroy:()=>{f||(l.deleteBuffer(s),f=!0)}}}function b(l,m,u){if("float32"===m)switch(u){case 1:return l.FLOAT;case 2:return l.FLOAT_VEC2;case 3:return l.FLOAT_VEC3;case 4:return l.FLOAT_VEC4;case 16:return l.FLOAT_MAT4}(0,o.dr)(m)}function _(l,m,u,d,s,C,h="static"){const{instancedArrays:a}=u,S=O(l,d,h,"attribute"),{_bufferType:D,_dataType:R,_bpe:f}=S;return{...S,divisor:C,bind:p=>{if(l.bindBuffer(D,S.getBuffer()),16===s)for(let E=0;E<4;++E)m.enableVertexAttrib(p+E),l.vertexAttribPointer(p+E,4,R,!1,16*f,4*E*f),a.vertexAttribDivisor(p+E,C);else m.enableVertexAttrib(p),l.vertexAttribPointer(p,s,R,!1,0,0),a.vertexAttribDivisor(p,C)},changeOffset:(p,E)=>{const T=E*f*s;if(l.bindBuffer(D,S.getBuffer()),16===s)for(let L=0;L<4;++L)l.vertexAttribPointer(p+L,4,R,!1,16*f,4*L*f+T);else l.vertexAttribPointer(p,s,R,!1,0,T)}}}function M(l,m,u){const d=[];return Object.keys(m).forEach(s=>{const C=m[s];"attribute"===C.type&&(d[d.length]=[s,l.resources.attribute(u[s].ref.value,C.itemSize,C.divisor)])}),d}function I(l,m,u="static"){const d=O(l,m,u,"elements");return{...d,bind:()=>{l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,d.getBuffer())}}}},8437:(tn,Ue,n)=>{"use strict";n.d(Ue,{Bs:()=>_,C6:()=>y,CI:()=>h,Du:()=>U,J6:()=>C,JR:()=>M,Kt:()=>R,L4:()=>f,MS:()=>I,MT:()=>l,QB:()=>D,VD:()=>G,WD:()=>c,Yl:()=>T,Z1:()=>Q,af:()=>u,bt:()=>d,ct:()=>m,dh:()=>v,e_:()=>i,jU:()=>S,kR:()=>L,l4:()=>O,m6:()=>s,n_:()=>a,qf:()=>V,qr:()=>E,qt:()=>w,w1:()=>b,wM:()=>p});var e=n(2629),o=n(6349),r=n(7579),t=n(4098);function y(J){return typeof WebGL2RenderingContext<"u"&&J instanceof WebGL2RenderingContext}function c(J){if(y(J))return{drawArraysInstanced:J.drawArraysInstanced.bind(J),drawElementsInstanced:J.drawElementsInstanced.bind(J),vertexAttribDivisor:J.vertexAttribDivisor.bind(J),VERTEX_ATTRIB_ARRAY_DIVISOR:J.VERTEX_ATTRIB_ARRAY_DIVISOR};{const W=J.getExtension("ANGLE_instanced_arrays");return null===W?null:{drawArraysInstanced:W.drawArraysInstancedANGLE.bind(W),drawElementsInstanced:W.drawElementsInstancedANGLE.bind(W),vertexAttribDivisor:W.vertexAttribDivisorANGLE.bind(W),VERTEX_ATTRIB_ARRAY_DIVISOR:W.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE}}}function i(J){if(y(J))return{FRAGMENT_SHADER_DERIVATIVE_HINT:J.FRAGMENT_SHADER_DERIVATIVE_HINT};{const W=J.getExtension("OES_standard_derivatives");return null===W?null:{FRAGMENT_SHADER_DERIVATIVE_HINT:W.FRAGMENT_SHADER_DERIVATIVE_HINT_OES}}}function v(J){return y(J)?{}:J.getExtension("OES_element_index_uint")}function O(J){if(y(J))return{VERTEX_ARRAY_BINDING:J.VERTEX_ARRAY_BINDING,bindVertexArray:J.bindVertexArray.bind(J),createVertexArray:J.createVertexArray.bind(J),deleteVertexArray:J.deleteVertexArray.bind(J),isVertexArray:J.isVertexArray.bind(J)};{const W=J.getExtension("OES_vertex_array_object");return null===W?null:{VERTEX_ARRAY_BINDING:W.VERTEX_ARRAY_BINDING_OES,bindVertexArray:W.bindVertexArrayOES.bind(W),createVertexArray:W.createVertexArrayOES.bind(W),deleteVertexArray:W.deleteVertexArrayOES.bind(W),isVertexArray:W.isVertexArrayOES.bind(W)}}}function b(J){return y(J)?{}:J.getExtension("OES_texture_float")}function _(J){return J.getExtension("OES_texture_float_linear")}function M(J){if(y(J))return{HALF_FLOAT:J.HALF_FLOAT};{const W=J.getExtension("OES_texture_half_float");return null===W?null:{HALF_FLOAT:W.HALF_FLOAT_OES}}}function I(J){return J.getExtension("OES_texture_half_float_linear")}function l(J){if(y(J))return{MIN:J.MIN,MAX:J.MAX};{const W=J.getExtension("EXT_blend_minmax");return null===W?null:{MIN:W.MIN_EXT,MAX:W.MAX_EXT}}}function m(J){return y(J)?{}:J.getExtension("EXT_frag_depth")}function u(J){if(y(J))return null===J.getExtension("EXT_color_buffer_float")?null:(J.getExtension("EXT_float_blend"),{RGBA32F:J.RGBA32F});{const W=J.getExtension("WEBGL_color_buffer_float");return null===W?(J.getExtension("OES_texture_float"),$(J,J.FLOAT)?{RGBA32F:34836}:null):(J.getExtension("EXT_float_blend"),{RGBA32F:W.RGBA32F_EXT})}}function d(J){if(y(J))return null===J.getExtension("EXT_color_buffer_half_float")?null:(J.getExtension("EXT_float_blend"),{RGBA16F:J.RGBA16F});{const W=J.getExtension("EXT_color_buffer_half_float");return null===W?(J.getExtension("OES_texture_half_float"),$(J,36193)?{RGBA16F:34842}:null):(J.getExtension("EXT_float_blend"),{RGBA16F:W.RGBA16F_EXT})}}function s(J){if(y(J))return{drawBuffers:J.drawBuffers.bind(J),COLOR_ATTACHMENT0:J.COLOR_ATTACHMENT0,COLOR_ATTACHMENT1:J.COLOR_ATTACHMENT1,COLOR_ATTACHMENT2:J.COLOR_ATTACHMENT2,COLOR_ATTACHMENT3:J.COLOR_ATTACHMENT3,COLOR_ATTACHMENT4:J.COLOR_ATTACHMENT4,COLOR_ATTACHMENT5:J.COLOR_ATTACHMENT5,COLOR_ATTACHMENT6:J.COLOR_ATTACHMENT6,COLOR_ATTACHMENT7:J.COLOR_ATTACHMENT7,DRAW_BUFFER0:J.DRAW_BUFFER0,DRAW_BUFFER1:J.DRAW_BUFFER1,DRAW_BUFFER2:J.DRAW_BUFFER2,DRAW_BUFFER3:J.DRAW_BUFFER3,DRAW_BUFFER4:J.DRAW_BUFFER4,DRAW_BUFFER5:J.DRAW_BUFFER5,DRAW_BUFFER6:J.DRAW_BUFFER6,DRAW_BUFFER7:J.DRAW_BUFFER7,MAX_COLOR_ATTACHMENTS:J.MAX_COLOR_ATTACHMENTS,MAX_DRAW_BUFFERS:J.MAX_DRAW_BUFFERS};{const W=J.getExtension("WEBGL_draw_buffers");return null===W?null:{drawBuffers:W.drawBuffersWEBGL.bind(W),COLOR_ATTACHMENT0:W.COLOR_ATTACHMENT0_WEBGL,COLOR_ATTACHMENT1:W.COLOR_ATTACHMENT1_WEBGL,COLOR_ATTACHMENT2:W.COLOR_ATTACHMENT2_WEBGL,COLOR_ATTACHMENT3:W.COLOR_ATTACHMENT3_WEBGL,COLOR_ATTACHMENT4:W.COLOR_ATTACHMENT4_WEBGL,COLOR_ATTACHMENT5:W.COLOR_ATTACHMENT5_WEBGL,COLOR_ATTACHMENT6:W.COLOR_ATTACHMENT6_WEBGL,COLOR_ATTACHMENT7:W.COLOR_ATTACHMENT7_WEBGL,DRAW_BUFFER0:W.DRAW_BUFFER0_WEBGL,DRAW_BUFFER1:W.DRAW_BUFFER1_WEBGL,DRAW_BUFFER2:W.DRAW_BUFFER2_WEBGL,DRAW_BUFFER3:W.DRAW_BUFFER3_WEBGL,DRAW_BUFFER4:W.DRAW_BUFFER4_WEBGL,DRAW_BUFFER5:W.DRAW_BUFFER5_WEBGL,DRAW_BUFFER6:W.DRAW_BUFFER6_WEBGL,DRAW_BUFFER7:W.DRAW_BUFFER7_WEBGL,MAX_COLOR_ATTACHMENTS:W.MAX_COLOR_ATTACHMENTS_WEBGL,MAX_DRAW_BUFFERS:W.MAX_DRAW_BUFFERS_WEBGL}}}function C(J){const W=J.getExtension("OES_draw_buffers_indexed");return null===W?null:{enablei:W.enableiOES.bind(W),disablei:W.disableiOES.bind(W),blendEquationi:W.blendEquationiOES.bind(W),blendEquationSeparatei:W.blendEquationSeparateiOES.bind(W),blendFunci:W.blendFunciOES.bind(W),blendFuncSeparatei:W.blendFuncSeparateiOES.bind(W),colorMaski:W.colorMaskiOES.bind(W)}}function h(J){return y(J)?{}:J.getExtension("EXT_shader_texture_lod")}function a(J){if(y(J))return{UNSIGNED_INT_24_8:J.UNSIGNED_INT_24_8};{const W=J.getExtension("WEBGL_depth_texture");return null===W?null:{UNSIGNED_INT_24_8:W.UNSIGNED_INT_24_8_WEBGL}}}function S(J){if(y(J))return{FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:J.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING,SRGB8_ALPHA8:J.SRGB8_ALPHA8,SRGB8:J.SRGB8,SRGB:J.SRGB};{const W=J.getExtension("EXT_sRGB");return null===W?null:{FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:W.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT,SRGB8_ALPHA8:W.SRGB8_ALPHA8_EXT,SRGB8:W.SRGB_ALPHA_EXT,SRGB:W.SRGB_EXT}}}function D(J){if(y(J)){const W=J.getExtension("EXT_disjoint_timer_query_webgl2")||J.getExtension("EXT_disjoint_timer_query");return null===W?null:{QUERY_COUNTER_BITS:W.QUERY_COUNTER_BITS_EXT,CURRENT_QUERY:J.CURRENT_QUERY,QUERY_RESULT:J.QUERY_RESULT,QUERY_RESULT_AVAILABLE:J.QUERY_RESULT_AVAILABLE,TIME_ELAPSED:W.TIME_ELAPSED_EXT,TIMESTAMP:W.TIMESTAMP_EXT,GPU_DISJOINT:W.GPU_DISJOINT_EXT,createQuery:J.createQuery.bind(J),deleteQuery:J.deleteQuery.bind(J),isQuery:J.isQuery.bind(J),beginQuery:J.beginQuery.bind(J),endQuery:J.endQuery.bind(J),queryCounter:W.queryCounterEXT.bind(W),getQuery:J.getQuery.bind(J),getQueryParameter:J.getQueryParameter.bind(J)}}{const W=J.getExtension("EXT_disjoint_timer_query");return null===W?null:{QUERY_COUNTER_BITS:W.QUERY_COUNTER_BITS_EXT,CURRENT_QUERY:W.CURRENT_QUERY_EXT,QUERY_RESULT:W.QUERY_RESULT_EXT,QUERY_RESULT_AVAILABLE:W.QUERY_RESULT_AVAILABLE_EXT,TIME_ELAPSED:W.TIME_ELAPSED_EXT,TIMESTAMP:W.TIMESTAMP_EXT,GPU_DISJOINT:W.GPU_DISJOINT_EXT,createQuery:W.createQueryEXT.bind(W),deleteQuery:W.deleteQueryEXT.bind(W),isQuery:W.isQueryEXT.bind(W),beginQuery:W.beginQueryEXT.bind(W),endQuery:W.endQueryEXT.bind(W),queryCounter:W.queryCounterEXT.bind(W),getQuery:W.getQueryEXT.bind(W),getQueryParameter:W.getQueryObjectEXT.bind(W)}}}function R(J){const W=J.getExtension("WEBGL_multi_draw");return W?{multiDrawArrays:W.multiDrawArraysWEBGL.bind(W),multiDrawElements:W.multiDrawElementsWEBGL.bind(W),multiDrawArraysInstanced:W.multiDrawArraysInstancedWEBGL.bind(W),multiDrawElementsInstanced:W.multiDrawElementsInstancedWEBGL.bind(W)}:null}function f(J){const W=J.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");return W?{drawArraysInstancedBaseInstance:W.drawArraysInstancedBaseInstanceWEBGL.bind(W),drawElementsInstancedBaseVertexBaseInstance:W.drawElementsInstancedBaseVertexBaseInstanceWEBGL.bind(W)}:null}function p(J){const W=J.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");return W?{multiDrawArraysInstancedBaseInstance:W.multiDrawArraysInstancedBaseInstanceWEBGL.bind(W),multiDrawElementsInstancedBaseVertexBaseInstance:W.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL.bind(W)}:null}function E(J){const W=J.getExtension("KHR_parallel_shader_compile");return null===W?null:{COMPLETION_STATUS:W.COMPLETION_STATUS_KHR}}function T(J){return y(J)?{}:J.getExtension("OES_fbo_render_mipmap")}function L(J){if(y(J)){const W=J.getExtension("WEBGL_provoking_vertex");if(W)return{FIRST_VERTEX_CONVENTION:W.FIRST_VERTEX_CONVENTION_WEBGL,LAST_VERTEX_CONVENTION:W.LAST_VERTEX_CONVENTION_WEBGL,PROVOKING_VERTEX:W.PROVOKING_VERTEX_WEBGL,provokingVertex:W.provokingVertexWEBGL.bind(W)}}return null}function w(J){if(y(J)){const W=J.getExtension("WEBGL_clip_cull_distance");if(W)return{MAX_CLIP_DISTANCES:W.MAX_CLIP_DISTANCES_WEBGL,MAX_CULL_DISTANCES:W.MAX_CULL_DISTANCES_WEBGL,MAX_COMBINED_CLIP_AND_CULL_DISTANCES:W.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL,CLIP_DISTANCE0:W.CLIP_DISTANCE0_WEBGL,CLIP_DISTANCE1:W.CLIP_DISTANCE1_WEBGL,CLIP_DISTANCE2:W.CLIP_DISTANCE2_WEBGL,CLIP_DISTANCE3:W.CLIP_DISTANCE3_WEBGL,CLIP_DISTANCE4:W.CLIP_DISTANCE4_WEBGL,CLIP_DISTANCE5:W.CLIP_DISTANCE5_WEBGL,CLIP_DISTANCE6:W.CLIP_DISTANCE6_WEBGL,CLIP_DISTANCE7:W.CLIP_DISTANCE7_WEBGL}}return null}function Q(J){return y(J)&&J.getExtension("EXT_conservative_depth")?{}:null}function G(J){if(y(J)){const W=J.getExtension("WEBGL_stencil_texturing");if(W)return{DEPTH_STENCIL_TEXTURE_MODE:W.DEPTH_STENCIL_TEXTURE_MODE_WEBGL,STENCIL_INDEX:W.STENCIL_INDEX_WEBGL}}return null}function V(J){const W=J.getExtension("EXT_clip_control");return W?{LOWER_LEFT:W.LOWER_LEFT_EXT,UPPER_LEFT:W.UPPER_LEFT_EXT,NEGATIVE_ONE_TO_ONE:W.NEGATIVE_ONE_TO_ONE_EXT,ZERO_TO_ONE:W.ZERO_TO_ONE_EXT,CLIP_ORIGIN:W.CLIP_ORIGIN_EXT,CLIP_DEPTH_MODE:W.CLIP_DEPTH_MODE_EXT,clipControl:W.clipControlEXT.bind(W)}:null}function U(J){if(!y(J))return!1;if(typeof navigator<"u"){const W=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./);return!W||parseInt(W[1])>=85}return!1}const N="\nattribute vec4 aPosition;\n\nvoid main() {\n gl_Position = aPosition;\n}",k="\nprecision mediump float;\nuniform vec4 uColor;\nuniform sampler2D uTexture;\n\nvoid main() {\n gl_FragColor = texture2D(uTexture, vec2(0.5, 0.5)) * uColor;\n}",H=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]);function $(J,W){const te=(0,t.A)(J,{type:"vert",source:N}),de=(0,t.A)(J,{type:"frag",source:k});if(!te||!de)return!1;const ye=(0,r.J)(J);J.attachShader(ye,te),J.attachShader(ye,de),J.linkProgram(ye),J.useProgram(ye);const j=J.getAttribLocation(ye,"aPosition"),Z=J.getUniformLocation(ye,"uColor");if(!Z)return e.Bb&&console.log("error getting 'uColor' uniform location"),!1;const q=J.createBuffer();J.bindBuffer(J.ARRAY_BUFFER,q),J.bufferData(J.ARRAY_BUFFER,H,J.STATIC_DRAW),J.enableVertexAttribArray(j),J.vertexAttribPointer(j,2,J.FLOAT,!1,0,0);const Y=J.createTexture(),ee=new Uint8Array([255,255,255,255]);J.bindTexture(J.TEXTURE_2D,Y),J.texImage2D(J.TEXTURE_2D,0,J.RGBA,1,1,0,J.RGBA,J.UNSIGNED_BYTE,ee);const g=J.createTexture();J.bindTexture(J.TEXTURE_2D,g),J.texImage2D(J.TEXTURE_2D,0,J.RGBA,1,1,0,J.RGBA,W,null),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,J.NEAREST),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,J.NEAREST);const _e=J.createFramebuffer();if(J.bindFramebuffer(J.FRAMEBUFFER,_e),J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,g,0),J.checkFramebufferStatus(J.FRAMEBUFFER)!==J.FRAMEBUFFER_COMPLETE)return e.Bb&&console.log(`error creating framebuffer for '${W}'`),!1;J.bindTexture(J.TEXTURE_2D,Y),J.uniform4fv(Z,[0,10,20,1]),J.drawArrays(J.TRIANGLES,0,6),J.bindTexture(J.TEXTURE_2D,g),J.bindFramebuffer(J.FRAMEBUFFER,null),J.clearColor(1,0,0,1),J.clear(J.COLOR_BUFFER_BIT),J.uniform4fv(Z,[0,.1,.05,1]),J.drawArrays(J.TRIANGLES,0,6);const le=new Uint8Array(4);if(J.readPixels(0,0,1,1,J.RGBA,J.UNSIGNED_BYTE,le),0!==le[0]||le[1]<248||le[2]<248||le[3]<254)return e.Bb&&console.log(`not able to actually render to '${W}' texture`),!1;if(W===J.FLOAT){J.bindFramebuffer(J.FRAMEBUFFER,_e);const Ae=new Float32Array(4);J.readPixels(0,0,1,1,J.RGBA,J.FLOAT,Ae);const Be=J.getError();if(Be)return e.Bb&&console.log(`error reading float pixels: '${(0,o.tL)(J,Be)}'`),!1}return!0}},6349:(tn,Ue,n)=>{"use strict";n.d(Ue,{Lq:()=>N,q6:()=>ee,tL:()=>U,$i:()=>V});var e=n(467),o=n(8437),r=n(3648),t=n(4824),A=n(2629);function y(g){const _e=(0,o.WD)(g);if(null===_e)throw new Error('Could not find support for "instanced_arrays"');const xe=(0,o.dh)(g);if(null===xe)throw new Error('Could not find support for "element_index_uint"');const le=(0,o.e_)(g);if(null===le)throw new Error('Could not find support for "standard_derivatives"');const Ae=(0,o.w1)(g);A.Bb&&null===Ae&&console.log('Could not find support for "texture_float"');const Be=(0,o.Bs)(g);A.Bb&&null===Be&&console.log('Could not find support for "texture_float_linear"');const Ce=(0,o.JR)(g);A.Bb&&null===Ce&&console.log('Could not find support for "texture_half_float"');const Re=(0,o.MS)(g);A.Bb&&null===Re&&console.log('Could not find support for "texture_half_float_linear"');const ke=(0,o.n_)(g);A.Bb&&null===ke&&console.log('Could not find support for "depth_texture"');const we=(0,o.MT)(g);A.Bb&&null===we&&console.log('Could not find support for "blend_minmax"');const Oe=(0,o.l4)(g);A.Bb&&null===Oe&&console.log('Could not find support for "vertex_array_object"');const Se=(0,o.ct)(g);A.Bb&&null===Se&&console.log('Could not find support for "frag_depth"');const Ve=(0,o.af)(g);A.Bb&&null===Ve&&console.log('Could not find support for "color_buffer_float"');const Ne=(0,o.bt)(g);A.Bb&&null===Ne&&console.log('Could not find support for "color_buffer_half_float"');const K=(0,o.m6)(g);A.Bb&&null===K&&console.log('Could not find support for "draw_buffers"');const ne=(0,o.J6)(g);A.Bb&&null===ne&&console.log('Could not find support for "draw_buffers_indexed"');const be=(0,o.CI)(g);A.Bb&&null===be&&console.log('Could not find support for "shader_texture_lod"');const Te=(0,o.jU)(g);A.Bb&&null===Te&&console.log('Could not find support for "sRGB"');const ie=(0,o.QB)(g);A.Bb&&null===ie&&console.log('Could not find support for "disjoint_timer_query"');const ue=(0,o.Kt)(g);A.Bb&&null===ue&&console.log('Could not find support for "multi_draw"');const re=(0,o.L4)(g);A.Bb&&null===re&&console.log('Could not find support for "draw_instanced_base_vertex_base_instance"');const ve=(0,o.wM)(g);A.Bb&&null===ve&&console.log('Could not find support for "multi_draw_instanced_base_vertex_base_instance"');const ce=(0,o.qr)(g);A.Bb&&null===ce&&console.log('Could not find support for "parallel_shader_compile"');const se=(0,o.Yl)(g);A.Bb&&null===se&&console.log('Could not find support for "fbo_render_mipmap"');const ae=(0,o.kR)(g);A.Bb&&null===ae&&console.log('Could not find support for "provoking_vertex"');const ge=(0,o.qt)(g);A.Bb&&null===ge&&console.log('Could not find support for "clip_cull_distance"');const Ie=(0,o.Z1)(g);A.Bb&&null===Ie&&console.log('Could not find support for "conservative_depth"');const Le=(0,o.VD)(g);A.Bb&&null===Le&&console.log('Could not find support for "stencil_texturing"');const nt=(0,o.qf)(g);return A.Bb&&null===nt&&console.log('Could not find support for "clip_control"'),{instancedArrays:_e,standardDerivatives:le,elementIndexUint:xe,textureFloat:Ae,textureFloatLinear:Be,textureHalfFloat:Ce,textureHalfFloatLinear:Re,depthTexture:ke,blendMinMax:we,vertexArrayObject:Oe,fragDepth:Se,colorBufferFloat:Ve,colorBufferHalfFloat:Ne,drawBuffers:K,drawBuffersIndexed:ne,shaderTextureLod:be,sRGB:Te,disjointTimerQuery:ie,multiDraw:ue,drawInstancedBaseVertexBaseInstance:re,multiDrawInstancedBaseVertexBaseInstance:ve,parallelShaderCompile:ce,fboRenderMipmap:se,provokingVertex:ae,clipCullDistance:ge,conservativeDepth:Ie,stencilTexturing:Le,clipControl:nt,noNonInstancedActiveAttribs:(0,o.Du)(g)}}var i=n(2775),v=n(7579),O=n(4098),b=n(4677);function I(g,_e,xe){const le=new Map;return{get:Ae=>{const Be=g(Ae);let Ce=le.get(Be);return Ce||(Ce=function _(g,_e=0){return{value:g,usageCount:_e}}(_e(Ae)),le.set(Be,Ce)),Ce.usageCount+=1,function M(g){return{free:()=>{g.usageCount-=1},value:g.value}}(Ce)},clear:()=>{le.forEach((Ae,Be)=>{Ae.usageCount<=0&&(Ae.usageCount<0&&console.warn("Reference usageCount below zero."),xe(Ae.value),le.delete(Be))})},get count(){return le.size},dispose:()=>{le.forEach(Ae=>xe(Ae.value)),le.clear()}}}var l=n(8382),m=n(7778);const u=(0,m.q)();function C(g){const _e=g.createRenderbuffer();if(null===_e)throw new Error("Could not create WebGL renderbuffer");return _e}var a=n(4648);const S=(0,m.q)();function D(g){const{vertexArrayObject:_e}=g;if(!_e)throw new Error("VertexArrayObject not supported");const xe=_e.createVertexArray();if(!xe)throw new Error("Could not create WebGL vertex array");return xe}function R(g){const{vertexArrayObject:_e}=g;if(null===_e)throw new Error("VertexArrayObject not supported");return _e}function E(g){return{...g.value,destroy:()=>{g.free()}}}function T(g,_e,xe,le){const Ae={attribute:new Set,elements:new Set,framebuffer:new Set,program:new Set,renderbuffer:new Set,shader:new Set,texture:new Set,cubeTexture:new Set,vertexArray:new Set};function Be(we,Oe){return Ae[we].add(Oe),xe.resourceCounts[we]+=1,{...Oe,destroy:()=>{Oe.destroy(),Ae[we].delete(Oe),xe.resourceCounts[we]-=1}}}const Ce=I(we=>JSON.stringify(we),we=>Be("shader",(0,O.g)(g,we)),we=>{we.destroy()});function Re(we,Oe){return E(Ce.get({type:we,source:Oe}))}const ke=I(we=>{var Oe;const Se=[we.shaderCode.id],Ve=(null===(Oe=we.defineValues.dRenderVariant)||void 0===Oe?void 0:Oe.ref.value)||"";return Object.keys(we.defineValues).forEach(Ne=>{var K,ne;null!==(ne=(K=we.shaderCode).ignoreDefine)&&void 0!==ne&&ne.call(K,Ne,Ve,we.defineValues)||Se.push((0,l.YZ)(Ne),function p(g){return"boolean"==typeof g?g?1:0:"number"==typeof g?1e4*g:(0,l.YZ)(g)}(we.defineValues[Ne].ref.value))}),(0,l.TI)(Se).toString()},we=>Be("program",(0,v.r)(g,_e,le,Re,we)),we=>{we.destroy()});return{attribute:(we,Oe,Se,Ve)=>Be("attribute",(0,b.Fu)(g,_e,le,we,Oe,Se,Ve)),elements:(we,Oe)=>Be("elements",(0,b.ki)(g,we,Oe)),framebuffer:()=>Be("framebuffer",(0,r.oN)(g)),program:(we,Oe,Se)=>E(ke.get({defineValues:we,shaderCode:Oe,schema:Se})),renderbuffer:(we,Oe,Se,Ve)=>Be("renderbuffer",function h(g,_e,xe,le,Ae){let Be=C(g);const Ce=()=>g.bindRenderbuffer(g.RENDERBUFFER,Be),Re=function d(g,_e){switch(_e){case"depth16":return g.DEPTH_COMPONENT16;case"stencil8":return g.STENCIL_INDEX8;case"rgba4":return g.RGBA4;case"depth-stencil":return g.DEPTH_STENCIL;case"depth24":if((0,o.C6)(g))return g.DEPTH_COMPONENT24;throw new Error("WebGL2 needed for `depth24` renderbuffer format");case"depth32f":if((0,o.C6)(g))return g.DEPTH_COMPONENT32F;throw new Error("WebGL2 needed for `depth32f` renderbuffer format");case"depth24-stencil8":if((0,o.C6)(g))return g.DEPTH24_STENCIL8;throw new Error("WebGL2 needed for `depth24-stencil8` renderbuffer format");case"depth32f-stencil8":if((0,o.C6)(g))return g.DEPTH32F_STENCIL8;throw new Error("WebGL2 needed for `depth32f-stencil8` renderbuffer format")}}(g,_e),ke=function s(g,_e){switch(_e){case"depth":return g.DEPTH_ATTACHMENT;case"stencil":return g.STENCIL_ATTACHMENT;case"depth-stencil":return g.DEPTH_STENCIL_ATTACHMENT;case"color0":return g.COLOR_ATTACHMENT0}}(g,xe);function we(){Ce(),g.renderbufferStorage(g.RENDERBUFFER,Re,le,Ae)}we();let Oe=!1;return{id:u(),bind:Ce,attachFramebuffer:Se=>{Se.bind(),Ce(),g.framebufferRenderbuffer(g.FRAMEBUFFER,ke,g.RENDERBUFFER,Be),A.Bb&&(0,r.kD)(g)},detachFramebuffer:Se=>{Se.bind(),Ce(),g.framebufferRenderbuffer(g.FRAMEBUFFER,ke,g.RENDERBUFFER,null),A.Bb&&(0,r.kD)(g)},setSize:(Se,Ve)=>{le=Se,Ae=Ve,we()},reset:()=>{Be=C(g),we()},destroy:()=>{Oe||(g.deleteRenderbuffer(Be),Oe=!0)}}}(g,we,Oe,Se,Ve)),shader:Re,texture:(we,Oe,Se,Ve)=>Be("texture",(0,a.sZ)(g,le,we,Oe,Se,Ve)),cubeTexture:(we,Oe,Se)=>Be("cubeTexture",(0,a.ji)(g,we,Oe,Se)),vertexArray:(we,Oe,Se)=>Be("vertexArray",function f(g,_e,xe,le,Ae){const Be=S();let Ce=D(_e),Re=R(_e);function ke(){Re.bindVertexArray(Ce),Ae&&Ae.bind(),xe.bindAttributes(le),Re.bindVertexArray(null)}ke();let we=!1;return{id:Be,bind:()=>{Re.bindVertexArray(Ce)},update:ke,reset:()=>{Ce=D(_e),Re=R(_e),ke()},destroy:()=>{we||(Ae&&(Re.bindVertexArray(Ce),g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,null)),Re.deleteVertexArray(Ce),we=!0)}}}(g,le,we,Oe,Se)),getByteCounts:()=>{let we=0;Ae.texture.forEach(Ve=>{we+=Ve.getByteCount()}),Ae.cubeTexture.forEach(Ve=>{we+=Ve.getByteCount()});let Oe=0;Ae.attribute.forEach(Ve=>{Oe+=4*Ve.length});let Se=0;return Ae.elements.forEach(Ve=>{Se+=4*Ve.length}),{texture:we,attribute:Oe,elements:Se}},reset:()=>{Ae.attribute.forEach(we=>we.reset()),Ae.elements.forEach(we=>we.reset()),Ae.framebuffer.forEach(we=>we.reset()),Ae.renderbuffer.forEach(we=>we.reset()),Ae.shader.forEach(we=>we.reset()),Ae.program.forEach(we=>we.reset()),Ae.vertexArray.forEach(we=>we.reset()),Ae.texture.forEach(we=>we.reset())},destroy:()=>{Ae.attribute.forEach(we=>we.destroy()),Ae.elements.forEach(we=>we.destroy()),Ae.framebuffer.forEach(we=>we.destroy()),Ae.renderbuffer.forEach(we=>we.destroy()),Ae.shader.forEach(we=>we.destroy()),Ae.program.forEach(we=>we.destroy()),Ae.vertexArray.forEach(we=>we.destroy()),Ae.texture.forEach(we=>we.destroy()),Ce.clear(),ke.clear()}}}var L=n(2021),w=n(4412),Q=n(9854),G=n(2098);function V(g,_e){function xe(Ae){try{return g.getContext(Ae,_e)}catch{return null}}const le=(_e?.preferWebGl1?null:xe("webgl2"))||xe("webgl")||xe("experimental-webgl");return A.Bb&&console.log(`isWebgl2: ${(0,o.C6)(le)}`),le}function U(g,_e){switch(_e){case g.NO_ERROR:return"no error";case g.INVALID_ENUM:return"invalid enum";case g.INVALID_VALUE:return"invalid value";case g.INVALID_OPERATION:return"invalid operation";case g.INVALID_FRAMEBUFFER_OPERATION:return"invalid framebuffer operation";case g.OUT_OF_MEMORY:return"out of memory";case g.CONTEXT_LOST_WEBGL:return"context lost"}return"unknown error"}function N(g){const _e=g.getError();if(_e!==g.NO_ERROR)throw new Error(`WebGL error: '${U(g,_e)}'`)}function $(g){g.bindFramebuffer(g.FRAMEBUFFER,null)}const J=new Uint8Array(4);function W(g,_e,xe){g.getSyncParameter(_e,g.SYNC_STATUS)===g.SIGNALED?(g.deleteSync(_e),xe()):t._F.setImmediate(W,g,_e,xe)}function te(g,_e){const xe=g.fenceSync(g.SYNC_GPU_COMMANDS_COMPLETE,0);xe?t._F.setImmediate(W,g,xe,_e):(console.warn("Could not create a WebGLSync object"),g.readPixels(0,0,1,1,g.RGBA,g.UNSIGNED_BYTE,J),_e())}let de=!1;function j(g){g.bindFramebuffer(g.FRAMEBUFFER,null),g.readPixels(0,0,1,1,g.RGBA,g.UNSIGNED_BYTE,J)}function Z(g,_e,xe,le,Ae,Be){if(A.Bb&&(0,r.kD)(g),Be instanceof Uint8Array)g.readPixels(_e,xe,le,Ae,g.RGBA,g.UNSIGNED_BYTE,Be);else if(Be instanceof Float32Array)g.readPixels(_e,xe,le,Ae,g.RGBA,g.FLOAT,Be);else{if(!(Be instanceof Int32Array&&(0,o.C6)(g)))throw new Error("unsupported readPixels buffer type");g.readPixels(_e,xe,le,Ae,g.RGBA_INTEGER,g.INT,Be)}A.Bb&&N(g)}function ee(g,_e={}){const xe=y(g),le=function c(g,_e){let xe={},le=g.getParameter(g.FRONT_FACE),Ae=g.getParameter(g.CULL_FACE_MODE),Be=g.getParameter(g.DEPTH_WRITEMASK),Ce=g.getParameter(g.DEPTH_CLEAR_VALUE),Re=g.getParameter(g.DEPTH_FUNC),ke=g.getParameter(g.COLOR_WRITEMASK),we=g.getParameter(g.COLOR_CLEAR_VALUE),Oe=g.getParameter(g.BLEND_SRC_RGB),Se=g.getParameter(g.BLEND_DST_RGB),Ve=g.getParameter(g.BLEND_SRC_ALPHA),Ne=g.getParameter(g.BLEND_DST_ALPHA),K=g.getParameter(g.BLEND_COLOR),ne=g.getParameter(g.BLEND_EQUATION_RGB),be=g.getParameter(g.BLEND_EQUATION_ALPHA),Te=g.getParameter(g.STENCIL_FUNC),ie=g.getParameter(g.STENCIL_VALUE_MASK),ue=g.getParameter(g.STENCIL_REF),re=g.getParameter(g.STENCIL_BACK_FUNC),ve=g.getParameter(g.STENCIL_BACK_VALUE_MASK),ce=g.getParameter(g.STENCIL_BACK_REF),se=g.getParameter(g.STENCIL_WRITEMASK),ae=g.getParameter(g.STENCIL_BACK_WRITEMASK),ge=g.getParameter(g.STENCIL_FAIL),Ie=g.getParameter(g.STENCIL_PASS_DEPTH_PASS),Le=g.getParameter(g.STENCIL_PASS_DEPTH_FAIL),nt=g.getParameter(g.STENCIL_BACK_FAIL),je=g.getParameter(g.STENCIL_BACK_PASS_DEPTH_PASS),Lt=g.getParameter(g.STENCIL_BACK_PASS_DEPTH_FAIL),Je=g.getParameter(g.MAX_VERTEX_ATTRIBS);const en=[];let Bt=g.getParameter(g.VIEWPORT),pn=g.getParameter(g.SCISSOR_BOX),$e=_e.clipControl?g.getParameter(_e.clipControl.CLIP_ORIGIN):-1,mt=_e.clipControl?g.getParameter(_e.clipControl.CLIP_DEPTH_MODE):-1;const _t=()=>{for(let Me=0;Me{!0!==xe[Me]&&(g.enable(Me),xe[Me]=!0)},disable:Me=>{!1!==xe[Me]&&(g.disable(Me),xe[Me]=!1)},frontFace:Me=>{Me!==le&&(g.frontFace(Me),le=Me)},cullFace:Me=>{Me!==Ae&&(g.cullFace(Me),Ae=Me)},depthMask:Me=>{Me!==Be&&(g.depthMask(Me),Be=Me)},clearDepth:Me=>{Me!==Ce&&(g.clearDepth(Me),Ce=Me)},depthFunc:Me=>{Me!==Re&&(g.depthFunc(Me),Re=Me)},colorMask:(Me,Ke,ut,Kt)=>{(Me!==ke[0]||Ke!==ke[1]||ut!==ke[2]||Kt!==ke[3])&&(g.colorMask(Me,Ke,ut,Kt),ke[0]=Me,ke[1]=Ke,ke[2]=ut,ke[3]=Kt)},clearColor:(Me,Ke,ut,Kt)=>{(Me!==we[0]||Ke!==we[1]||ut!==we[2]||Kt!==we[3])&&(g.clearColor(Me,Ke,ut,Kt),we[0]=Me,we[1]=Ke,we[2]=ut,we[3]=Kt)},blendFunc:(Me,Ke)=>{(Me!==Oe||Ke!==Se||Me!==Ve||Ke!==Ne)&&(g.blendFunc(Me,Ke),Oe=Me,Se=Ke,Ve=Me,Ne=Ke)},blendFuncSeparate:(Me,Ke,ut,Kt)=>{(Me!==Oe||Ke!==Se||ut!==Ve||Kt!==Ne)&&(g.blendFuncSeparate(Me,Ke,ut,Kt),Oe=Me,Se=Ke,Ve=ut,Ne=Kt)},blendEquation:Me=>{(Me!==ne||Me!==be)&&(g.blendEquation(Me),ne=Me,be=Me)},blendEquationSeparate:(Me,Ke)=>{(Me!==ne||Ke!==be)&&(g.blendEquationSeparate(Me,Ke),ne=Me,be=Ke)},blendColor:(Me,Ke,ut,Kt)=>{(Me!==K[0]||Ke!==K[1]||ut!==K[2]||Kt!==K[3])&&(g.blendColor(Me,Ke,ut,Kt),K[0]=Me,K[1]=Ke,K[2]=ut,K[3]=Kt)},stencilFunc:(Me,Ke,ut)=>{(Me!==Te||Ke!==ue||ut!==ie||Me!==re||Ke!==ce||ut!==ve)&&(g.stencilFunc(Me,Ke,ut),Te=Me,ue=Ke,ie=ut,re=Me,ce=Ke,ve=ut)},stencilFuncSeparate:(Me,Ke,ut,Kt)=>{Me===g.FRONT?(Ke!==Te||ut!==ue||Kt!==ie)&&(g.stencilFuncSeparate(Me,Ke,ut,Kt),Te=Ke,ue=ut,ie=Kt):Me===g.BACK?(Ke!==re||ut!==ce||Kt!==ve)&&(g.stencilFuncSeparate(Me,Ke,ut,Kt),re=Ke,ce=ut,ve=Kt):Me===g.FRONT_AND_BACK&&(Ke!==Te||ut!==ue||Kt!==ie||Ke!==re||ut!==ce||Kt!==ve)&&(g.stencilFuncSeparate(Me,Ke,ut,Kt),Te=Ke,ue=ut,ie=Kt,re=Ke,ce=ut,ve=Kt)},stencilMask:Me=>{(Me!==se||Me!==ae)&&(g.stencilMask(Me),se=Me,ae=Me)},stencilMaskSeparate:(Me,Ke)=>{Me===g.FRONT?Ke!==se&&(g.stencilMaskSeparate(Me,Ke),se=Ke):Me===g.BACK?Ke!==ae&&(g.stencilMaskSeparate(Me,Ke),ae=Ke):Me===g.FRONT_AND_BACK&&(Ke!==se||Ke!==ae)&&(g.stencilMaskSeparate(Me,Ke),se=Ke,ae=Ke)},stencilOp:(Me,Ke,ut)=>{(Me!==ge||Ke!==Le||ut!==Ie||Me!==nt||Ke!==Lt||ut!==je)&&(g.stencilOp(Me,Ke,ut),ge=Me,Le=Ke,Ie=ut,nt=Me,Lt=Ke,je=ut)},stencilOpSeparate:(Me,Ke,ut,Kt)=>{Me===g.FRONT?(Ke!==ge||ut!==Le||Kt!==Ie)&&(g.stencilOpSeparate(Me,Ke,ut,Kt),ge=Ke,Le=ut,Ie=Kt):Me===g.BACK?(Ke!==nt||ut!==Lt||Kt!==je)&&(g.stencilOpSeparate(Me,Ke,ut,Kt),nt=Ke,Lt=ut,je=Kt):Me===g.FRONT_AND_BACK&&(Ke!==ge||ut!==Le||Kt!==Ie||Ke!==nt||ut!==Lt||Kt!==je)&&(g.stencilOpSeparate(Me,Ke,ut,Kt),ge=Ke,Le=ut,Ie=Kt,nt=Ke,Lt=ut,je=Kt)},enableVertexAttrib:Me=>{g.enableVertexAttribArray(Me),en[Me]=1},clearVertexAttribsState:_t,disableUnusedVertexAttribs:()=>{for(let Me=0;Me{(Me!==Bt[0]||Ke!==Bt[1]||ut!==Bt[2]||Kt!==Bt[3])&&(g.viewport(Me,Ke,ut,Kt),Bt[0]=Me,Bt[1]=Ke,Bt[2]=ut,Bt[3]=Kt)},scissor:(Me,Ke,ut,Kt)=>{(Me!==pn[0]||Ke!==pn[1]||ut!==pn[2]||Kt!==pn[3])&&(g.scissor(Me,Ke,ut,Kt),pn[0]=Me,pn[1]=Ke,pn[2]=ut,pn[3]=Kt)},clipControl:_e.clipControl?(Me,Ke)=>{(Me!==$e||Ke!==mt)&&(_e.clipControl.clipControl(Me,Ke),$e=Me,mt=Ke)}:void 0,reset:()=>{xe={},le=g.getParameter(g.FRONT_FACE),Ae=g.getParameter(g.CULL_FACE_MODE),Be=g.getParameter(g.DEPTH_WRITEMASK),Ce=g.getParameter(g.DEPTH_CLEAR_VALUE),Re=g.getParameter(g.DEPTH_FUNC),ke=g.getParameter(g.COLOR_WRITEMASK),we=g.getParameter(g.COLOR_CLEAR_VALUE),Oe=g.getParameter(g.BLEND_SRC_RGB),Se=g.getParameter(g.BLEND_DST_RGB),Ve=g.getParameter(g.BLEND_SRC_ALPHA),Ne=g.getParameter(g.BLEND_DST_ALPHA),K=g.getParameter(g.BLEND_COLOR),ne=g.getParameter(g.BLEND_EQUATION_RGB),be=g.getParameter(g.BLEND_EQUATION_ALPHA),Te=g.getParameter(g.STENCIL_FUNC),ie=g.getParameter(g.STENCIL_VALUE_MASK),ue=g.getParameter(g.STENCIL_REF),re=g.getParameter(g.STENCIL_BACK_FUNC),ve=g.getParameter(g.STENCIL_BACK_VALUE_MASK),ce=g.getParameter(g.STENCIL_BACK_REF),se=g.getParameter(g.STENCIL_WRITEMASK),ae=g.getParameter(g.STENCIL_BACK_WRITEMASK),ge=g.getParameter(g.STENCIL_FAIL),Ie=g.getParameter(g.STENCIL_PASS_DEPTH_PASS),Le=g.getParameter(g.STENCIL_PASS_DEPTH_FAIL),nt=g.getParameter(g.STENCIL_BACK_FAIL),je=g.getParameter(g.STENCIL_BACK_PASS_DEPTH_PASS),Lt=g.getParameter(g.STENCIL_BACK_PASS_DEPTH_FAIL),Je=g.getParameter(g.MAX_VERTEX_ATTRIBS),en.length=0;for(let Me=0;Me= 8');const ke=xe.provokingVertex;ke?.provokingVertex(ke.FIRST_VERTEX_CONVENTION);let we=!1;const Oe=new w.t(0);let Ve,Se=_e.pixelScale||1;if((0,o.C6)(g)){const K=g.createBuffer();let ne,be,Te=!1;const ie=()=>{g.bindBuffer(g.PIXEL_PACK_BUFFER,K),g.getBufferSubData(g.PIXEL_PACK_BUFFER,0,ne),g.bindBuffer(g.PIXEL_PACK_BUFFER,null),Te=!1,be(),be=void 0,ne=void 0};Ve=(ue,re,ve,ce,se)=>new Promise((ae,ge)=>{Te?ge("Can not call multiple readPixelsAsync at the same time"):(Te=!0,g.bindBuffer(g.PIXEL_PACK_BUFFER,K),g.bufferData(g.PIXEL_PACK_BUFFER,ve*ce*4,g.STREAM_READ),g.readPixels(ue,re,ve,ce,g.RGBA,g.UNSIGNED_BYTE,0),g.bindBuffer(g.PIXEL_PACK_BUFFER,null),be=ae,ne=se,te(g,ie))})}else Ve=function(){var K=(0,e.A)(function*(ne,be,Te,ie,ue){Z(g,ne,be,Te,ie,ue)});return function(be,Te,ie,ue,re){return K.apply(this,arguments)}}();const Ne=new Set;return{gl:g,isWebGL2:(0,o.C6)(g),get pixelRatio(){return(typeof window<"u"&&window.devicePixelRatio||1)*(Se||1)},extensions:xe,state:le,stats:Ae,resources:Be,timer:Ce,get maxTextureSize(){return Re.maxTextureSize},get max3dTextureSize(){return Re.max3dTextureSize},get maxRenderbufferSize(){return Re.maxRenderbufferSize},get maxDrawBuffers(){return Re.maxDrawBuffers},get maxTextureImageUnits(){return Re.maxTextureImageUnits},namedComputeRenderables:Object.create(null),namedFramebuffers:Object.create(null),namedTextures:Object.create(null),get isContextLost(){return we||g.isContextLost()},contextRestored:Oe,setContextLost:()=>{we=!0,Ce.clear()},handleContextRestored:K=>{Object.assign(xe,y(g)),le.reset(),le.currentMaterialId=-1,le.currentProgramId=-1,le.currentRenderItemId=-1,Be.reset(),Ne.forEach(ne=>ne.reset()),K?.(),we=!1,Oe.next((0,Q.t)())},setPixelScale:K=>{Se=K},createRenderTarget:(K,ne,be,Te,ie,ue)=>{const re=(0,L.m)(g,Be,K,ne,be,Te,ie,ue);return Ne.add(re),{...re,destroy:()=>{re.destroy(),Ne.delete(re)}}},unbindFramebuffer:()=>$(g),readPixels:(K,ne,be,Te,ie)=>{Z(g,K,ne,be,Te,ie)},readPixelsAsync:Ve,waitForGpuCommandsComplete:()=>function ye(g){return new Promise(_e=>{(0,o.C6)(g)?te(g,_e):(de||(console.info("Sync object not supported in WebGL"),de=!0),j(g),_e())})}(g),waitForGpuCommandsCompleteSync:()=>j(g),getDrawingBufferPixelData:()=>function q(g,_e){const xe=g.drawingBufferWidth,le=g.drawingBufferHeight,Ae=new Uint8Array(xe*le*4);return $(g),_e.viewport(0,0,xe,le),Z(g,0,0,xe,le,Ae),i.N.flipY(i.N.create(Ae,xe,le))}(g,le),clear:(K,ne,be,Te)=>{$(g),le.enable(g.SCISSOR_TEST),le.depthMask(!0),le.colorMask(!0,!0,!0,!0),le.clearColor(K,ne,be,Te),le.viewport(0,0,g.drawingBufferWidth,g.drawingBufferHeight),le.scissor(0,0,g.drawingBufferWidth,g.drawingBufferHeight),g.clear(g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT)},destroy:K=>{var ne,be;Be.destroy(),function H(g){const _e=g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS);for(let Ae=0;Ae<_e;++Ae)g.activeTexture(g.TEXTURE0+Ae),g.bindTexture(g.TEXTURE_2D,null),g.bindTexture(g.TEXTURE_CUBE_MAP,null),(0,o.C6)(g)&&(g.bindTexture(g.TEXTURE_2D_ARRAY,null),g.bindTexture(g.TEXTURE_3D,null));const xe=g.createBuffer();g.bindBuffer(g.ARRAY_BUFFER,xe);const le=g.getParameter(g.MAX_VERTEX_ATTRIBS);for(let Ae=0;Ae{"use strict";n.d(Ue,{Vv:()=>i,kD:()=>A,oN:()=>c});var e=n(7778),o=n(8437);const r=(0,e.q)();function A(v){const O=v.checkFramebufferStatus(v.FRAMEBUFFER);if(O!==v.FRAMEBUFFER_COMPLETE){const b=function t(v,O){switch(O){case v.FRAMEBUFFER_COMPLETE:return"complete";case v.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"incomplete attachment";case v.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"incomplete missing attachment";case v.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"incomplete dimensions";case v.FRAMEBUFFER_UNSUPPORTED:return"unsupported"}if((0,o.C6)(v))switch(O){case v.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:return"incomplete multisample";case v.RENDERBUFFER_SAMPLES:return"renderbuffer samples"}return"unknown error"}(v,O);throw new Error(`Framebuffer status: ${b}`)}}function y(v){const O=v.createFramebuffer();if(null===O)throw new Error("Could not create WebGL framebuffer");return O}function c(v){let O=y(v),b=!1;return{id:r(),bind:()=>v.bindFramebuffer(v.FRAMEBUFFER,O),reset:()=>{O=y(v)},destroy:()=>{b||(v.deleteFramebuffer(O),b=!0)}}}function i(){return{id:r(),bind:()=>{},reset:()=>{},destroy:()=>{}}}},7579:(tn,Ue,n)=>{"use strict";n.d(Ue,{J:()=>_,r:()=>M});var e=n(2897),o=n(2879),r=n(4677),t=n(7778),A=n(2629),y=n(8437);const c=(0,t.q)();function _(I){const l=I.createProgram();if(null===l)throw new Error("Could not create WebGL program");return l}function M(I,l,m,u,d){const{defineValues:s,shaderCode:C,schema:h}=d;let a=_(I);const S=c(),D=(0,e.NB)(I,m,s,C),R=u("vert",D.vert),f=u("frag",D.frag);let p,E;function T(){R.attach(a),f.attach(a),I.linkProgram(a),A.Bb&&function b(I,l){if(!I.getProgramParameter(l,I.LINK_STATUS))throw new Error(`Could not compile WebGL program. \n\n${I.getProgramInfoLog(l)}`)}(I,a),p=function i(I,l,m){const u={};return Object.keys(m).forEach(d=>{const s=m[d];if("attribute"===s.type){const C=I.getAttribLocation(l,d);u[d]=C}else if("uniform"===s.type){let C=I.getUniformLocation(l,d);null===C&&(0,o.a5)(s.kind)&&(C=I.getUniformLocation(l,d+"[0]")),u[d]=C}else if("texture"===s.type){const C=I.getUniformLocation(l,d);u[d]=C}}),u}(I,a,h),E=(0,o.Pi)(h),A.Bb&&(function v(I,l,m){const u=I.getProgramParameter(l,I.ACTIVE_ATTRIBUTES);for(let d=0;d{l.currentProgramId=S,I.useProgram(a)},setUniforms:w=>{for(let Q=0,G=w.length;Q{const G=p[w];null!==G&&E[w](I,G,Q)},bindAttributes:w=>{l.clearVertexAttribsState();for(let Q=0,G=w.length;Q{for(let G=0,V=w.length;G{for(let G=0,V=w.length;G{a=_(I),T()},destroy:()=>{L||(R.destroy(),f.destroy(),I.deleteProgram(a),L=!0)}}}},4143:(tn,Ue,n)=>{"use strict";n.d(Ue,{$h:()=>S,vC:()=>a});var e=n(4677),o=n(4648),r=n(6349),t=n(4511),A=n(7778),y=n(9909),c=n(3648),i=n(2629),v=n(6115),O=n(9359),b=n(2879);const _=(0,A.q)(),l=Object.keys({color:"",pick:"",depth:"",marking:"",emissive:""}),u=Object.keys({compute:""});function d(R,f,p,E,T){return p={...p,dRenderVariant:y.IQ.create(f)},void 0===T.dRenderVariant&&Object.defineProperty(T,"dRenderVariant",{value:(0,t.$F)("string")}),R.resources.program(p,E,T)}function h(R,f){if("color"===R)switch(f){case"blended":return"colorBlended";case"wboit":return"colorWboit";case"dpoit":return"colorDpoit"}return R}function a(R,f,p,E,T,L,w){return D(R,f,p,E,T,L,l,w)}function S(R,f,p,E,T,L=-1){return D(R,f,p,E,T,L,u,void 0)}function D(R,f,p,E,T,L,w,Q){const G=_(),{stats:V,state:U,resources:N}=R,{instancedArrays:k,vertexArrayObject:H,multiDrawInstancedBaseVertexBaseInstance:$,drawInstancedBaseVertexBaseInstance:J}=R.extensions;T.uVertexCount&&!R.extensions.noNonInstancedActiveAttribs&&(T.aVertex=y.IQ.create((0,v.WE)(new Float32Array(T.uVertexCount.ref.value))),E.aVertex=(0,t.Yz)("float32",1,0));const{attributeValues:W,defineValues:te,textureValues:de,materialTextureValues:ye,uniformValues:j,materialUniformValues:Z,bufferedUniformValues:q}=(0,t.tC)(E,T),Y=Object.entries(j),ee=Object.entries(Z),g=Object.entries(q),_e=Object.entries((0,b.kB)(q)),xe=Object.entries(te),le=(0,t.fb)(T),Ae=function M(R,f){const{gl:p}=R;switch(f){case"points":return p.POINTS;case"lines":return p.LINES;case"line-strip":return p.LINE_STRIP;case"line-loop":return p.LINE_LOOP;case"triangles":return p.TRIANGLES;case"triangle-strip":return p.TRIANGLE_STRIP;case"triangle-fan":return p.TRIANGLE_FAN}}(R,f),Be={};for(const ie of w)Be[ie]=d(R,h(ie,Q),te,p,E);const Ce=(0,o.z1)(R,E,de),Re=(0,o.z1)(R,E,ye),ke=(0,e.oq)(R,E,W),we=[];for(let ie=0,ue=ke.length;ieBe[ie],setTransparency:ie=>{if(ie!==Q){Q=ie;for(const ue of w)Be[ue].destroy(),Be[ue]=d(R,h(ue,Q),te,p,E)}},render:(ie,ue,re)=>{if(0===Ne||0===K)return;const ve=Be[ie];if(ve.id===Te&&U.currentRenderItemId===G)ve.setUniforms(Y),ve.bindTextures(Ce,ue);else{const ce=Ve[ie];(ve.id!==U.currentProgramId||ve.id!==Te||-1===L||L!==U.currentMaterialId)&&(ve.id!==U.currentProgramId&&ve.use(),ve.setUniforms(ee),ve.bindTextures(Re,ue+Ce.length),U.currentMaterialId=L,Te=ve.id),ve.setUniforms(Y),ve.setUniforms(_e),ve.bindTextures(Ce,ue),ce?(ce.bind(),Oe&&Oe.bind()):(Oe&&Oe.bind(),ve.bindAttributes(ke)),U.currentRenderItemId=G}if(i.Bb)try{(0,c.kD)(R.gl)}catch(ce){throw new Error(`Framebuffer error rendering item id ${G}: '${ce}'`)}if(re){for(const ce of re)if(0!==ce.count){if(ve.setUniforms(ce.uniforms),$)Oe?$.multiDrawElementsInstancedBaseVertexBaseInstance(Ae,ce.counts,0,Oe._dataType,ce.offsets,0,ce.instanceCounts,0,ce.baseVertices,0,ce.baseInstances,0,ce.count):$.multiDrawArraysInstancedBaseInstance(Ae,ce.firsts,0,ce.counts,0,ce.instanceCounts,0,ce.baseInstances,0,ce.count);else if(J)if(Oe)for(let se=0;se0&&(ve.uniform("uDrawId",se),J.drawElementsInstancedBaseVertexBaseInstance(Ae,ce.counts[se],Oe._dataType,ce.offsets[se],ce.instanceCounts[se],ce.baseVertices[se],ce.baseInstances[se]));else for(let se=0;se0&&(ve.uniform("uDrawId",se),J.drawArraysInstancedBaseInstance(Ae,ce.firsts[se],ce.counts[se],ce.instanceCounts[se],ce.baseInstances[se]));else if(Oe)for(let se=0;se0&&(ve.uniform("uDrawId",se),ve.offsetAttributes(we,ce.baseInstances[se]),k.drawElementsInstanced(Ae,ce.counts[se],Oe._dataType,ce.offsets[se],ce.instanceCounts[se]));else for(let se=0;se0&&(ve.uniform("uDrawId",se),ve.offsetAttributes(we,ce.baseInstances[se]),k.drawArraysInstanced(Ae,0,ce.counts[se],ce.instanceCounts[se]));if(i.g$){$?V.calls.multiDrawInstancedBase+=1:J?V.calls.drawInstancedBase+=ce.count:V.calls.drawInstanced+=ce.count;for(let se=0;se{if(function C(R){R.attributes=!1,R.defines=!1,R.elements=!1,R.textures=!1}(ne),T.aVertex){const ie=T.uVertexCount.ref.value;T.aVertex.ref.value.length=ce.ref.value.length)ve.updateSubData(ce.ref.value,0,ve.length);else{ve.destroy();const{itemSize:se,divisor:ae}=E[re];ke[ie][1]=N.attribute(ce.ref.value,se,ae),ne.attributes=!0}le[re]=ce.ref.version}}if(Oe&&T.elements.ref.version!==le.elements&&(Oe.length>=T.elements.ref.value.length?Oe.updateSubData(T.elements.ref.value,0,Oe.length):(Oe.destroy(),Oe=N.elements(T.elements.ref.value),ne.elements=!0),le.elements=T.elements.ref.version),ne.attributes||ne.defines||ne.elements)for(const ie of w){const ue=Ve[ie];ue&&ue.destroy(),Ve[ie]=H?N.vertexArray(Be[ie],ke,Oe):null}for(let ie=0,ue=Ce.length;ie{if(!be){for(const ie of w){Be[ie].destroy();const ue=Ve[ie];ue&&ue.destroy()}Ce.forEach(([ie,ue])=>{"texture"!==E[ie].kind&&ue.destroy()}),Re.forEach(([ie,ue])=>{"texture"!==E[ie].kind&&ue.destroy()}),ke.forEach(([ie,ue])=>ue.destroy()),Oe&&Oe.destroy(),V.drawCount-=Ne,V.instanceCount-=K,V.instancedDrawCount-=K*Ne,be=!0}}}}},2021:(tn,Ue,n)=>{"use strict";n.d(Ue,{T:()=>c,m:()=>y});var e=n(7778),o=n(4648),r=n(3648),t=n(8437);const A=(0,e.q)();function y(i,v,O,b,_=!0,M="uint8",I="nearest",l="rgba"){if("alpha"===l&&!(0,t.C6)(i))throw new Error("cannot render to alpha format in webgl1");const m=v.framebuffer(),u="fp16"===M?v.texture("image-float16",l,"fp16",I):"float32"===M?v.texture("image-float32",l,"float",I):v.texture("image-uint8",l,"ubyte",I),d=_?(0,t.C6)(i)?v.renderbuffer("depth32f","depth",O,b):v.renderbuffer("depth16","depth",O,b):null;function s(){u.define(O,b),u.attachFramebuffer(m,"color0"),d&&d.attachFramebuffer(m)}s();let C=!1;return{id:A(),texture:u,framebuffer:m,depthRenderbuffer:d,getWidth:()=>O,getHeight:()=>b,bind:()=>{m.bind()},setSize:(h,a)=>{O===h&&b===a||(u.define(O=h,b=a),d&&d.setSize(O,b))},reset:()=>{s()},destroy:()=>{C||(u.destroy(),m.destroy(),d&&d.destroy(),C=!0)}}}function c(i){return{id:A(),texture:(0,o.z6)(i),framebuffer:(0,r.Vv)(),depthRenderbuffer:null,getWidth:()=>0,getHeight:()=>0,bind:()=>{i.bindFramebuffer(i.FRAMEBUFFER,null)},setSize:()=>{},reset:()=>{},destroy:()=>{}}}},4098:(tn,Ue,n)=>{"use strict";n.d(Ue,{A:()=>A,g:()=>y});var e=n(7778),o=n(2629);const r=(0,e.q)();function A(c,i){const{type:v,source:O}=i,b=c.createShader("vert"===v?c.VERTEX_SHADER:c.FRAGMENT_SHADER);if(null===b)throw new Error(`Error creating ${v} shader`);if(c.shaderSource(b,O),c.compileShader(b),o.Bb&&!1===c.getShaderParameter(b,c.COMPILE_STATUS))throw console.warn(`'${v}' shader info log '${c.getShaderInfoLog(b)}'\n${function t(c){const i=c.split("\n");for(let v=0;v{c.attachShader(O,v)},reset:()=>{v=A(c,i)},destroy:()=>{c.deleteShader(v)}}}},4648:(tn,Ue,n)=>{"use strict";n.d(Ue,{NP:()=>p,ji:()=>R,pg:()=>S,sZ:()=>h,z1:()=>a,z6:()=>E});var e=n(9909),o=n(7778),r=n(8437),t=n(1372),A=n(9359),y=n(4490);const c=(0,o.q)();function v(T,L,w){switch(L){case"alpha":return(0,r.C6)(T)&&"float"===w?T.RED:(0,r.C6)(T)&&"int"===w?T.RED_INTEGER:T.ALPHA;case"rgb":return(0,r.C6)(T)&&"int"===w?T.RGB_INTEGER:T.RGB;case"rg":if((0,r.C6)(T)&&"float"===w)return T.RG;if((0,r.C6)(T)&&"int"===w)return T.RG_INTEGER;throw new Error('texture format "rg" requires webgl2 and type "float" or int"');case"rgba":return(0,r.C6)(T)&&"int"===w?T.RGBA_INTEGER:T.RGBA;case"depth":return T.DEPTH_COMPONENT}}function b(T,L,w,Q,G){return function _(T){switch(T){case"alpha":return 1;case"rg":return 2;case"rgb":return 3;case"rgba":case"depth":return 4}}(T)*function M(T){switch(T){case"ubyte":return 1;case"ushort":case"fp16":return 2;case"float":case"int":return 4}}(L)*w*Q*(G||1)}function l(T,L){switch(L){case"nearest":return T.NEAREST;case"linear":return T.LINEAR}}function m(T,L,w){switch(w){case"depth":return T.DEPTH_ATTACHMENT;case"stencil":return T.STENCIL_ATTACHMENT;case"color0":case 0:return T.COLOR_ATTACHMENT0}if(L.drawBuffers)switch(w){case"color1":case 1:return L.drawBuffers.COLOR_ATTACHMENT1;case"color2":case 2:return L.drawBuffers.COLOR_ATTACHMENT2;case"color3":case 3:return L.drawBuffers.COLOR_ATTACHMENT3;case"color4":case 4:return L.drawBuffers.COLOR_ATTACHMENT4;case"color5":case 5:return L.drawBuffers.COLOR_ATTACHMENT5;case"color6":case 6:return L.drawBuffers.COLOR_ATTACHMENT6;case"color7":case 7:return L.drawBuffers.COLOR_ATTACHMENT7}throw new Error("unknown texture attachment")}function u(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement}function s(T,L,w){return L===w.TEXTURE_3D}function C(T){const L=T.createTexture();if(null===L)throw new Error("Could not create WebGL texture");return L}function h(T,L,w,Q,G,V){const U=c();let N=C(T);if(w.endsWith("float32")&&"float"!==G||w.endsWith("float16")&&"fp16"!==G||w.endsWith("uint8")&&"ubyte"!==G||w.endsWith("int32")&&"int"!==G||w.endsWith("depth")&&"ushort"!==G&&"float"!==G)throw new Error(`texture kind '${w}' and type '${G}' are incompatible`);if(!L.depthTexture&&"depth"===Q)throw new Error("extension 'WEBGL_depth_texture' needed for 'depth' texture format");const k=function i(T,L){switch(L){case"image-uint8":case"image-float32":case"image-float16":case"image-depth":return T.TEXTURE_2D}if((0,r.C6)(T))switch(L){case"image-int32":return T.TEXTURE_2D;case"volume-uint8":case"volume-float32":case"volume-float16":return T.TEXTURE_3D}throw new Error(`unknown texture kind '${L}'`)}(T,w),H=l(T,V),$=v(T,Q,G),J=function O(T,L,w){if((0,r.C6)(T))switch(L){case"alpha":switch(w){case"ubyte":return T.ALPHA;case"float":return T.R32F;case"fp16":return T.R16F;case"int":return T.R32I}case"rg":switch(w){case"ubyte":return T.RG;case"float":return T.RG32F;case"fp16":return T.RG16F;case"int":return T.RG32I}case"rgb":switch(w){case"ubyte":return T.RGB;case"float":return T.RGB32F;case"fp16":return T.RGB16F;case"int":return T.RGB32I}case"rgba":switch(w){case"ubyte":return T.RGBA;case"float":return T.RGBA32F;case"fp16":return T.RGBA16F;case"int":return T.RGBA32I}case"depth":switch(w){case"ushort":return T.DEPTH_COMPONENT16;case"float":return T.DEPTH_COMPONENT32F}}return v(T,L,w)}(T,Q,G),W=function I(T,L,w){switch(w){case"ubyte":return T.UNSIGNED_BYTE;case"ushort":return T.UNSIGNED_SHORT;case"float":return T.FLOAT;case"fp16":if(L.textureHalfFloat)return L.textureHalfFloat.HALF_FLOAT;throw new Error('extension "texture_half_float" unavailable');case"int":if((0,r.C6)(T))return T.INT;throw new Error('texture type "int" requires webgl2')}}(T,L,G);function te(){T.bindTexture(k,N),T.texParameteri(k,T.TEXTURE_MAG_FILTER,H),T.texParameteri(k,T.TEXTURE_MIN_FILTER,H),T.texParameteri(k,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(k,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.bindTexture(k,null)}te();let Z,de=0,ye=0,j=0,q=!1,Y=!1;function ee(le,Ae,Be){if(0===le||0===Ae||(0,r.C6)(T)&&k===T.TEXTURE_3D&&0===Be)throw new Error("empty textures are not allowed");if(de!==le||ye!==Ae||j!==(Be||0))if(de=le,ye=Ae,j=Be||0,T.bindTexture(k,N),k===T.TEXTURE_2D)T.texImage2D(k,0,J,de,ye,0,$,W,null);else{if(!(0,r.C6)(T)||k!==T.TEXTURE_3D||void 0===j)throw new Error("unknown texture target");T.texImage3D(k,0,J,de,ye,j,0,$,W,null)}}function g(le,Ae=!1){if(0===le.width||0===le.height||!u(le)&&(0,r.C6)(T)&&s(0,k,T)&&0===le.depth)throw new Error("empty textures are not allowed");if(T.bindTexture(k,N),T.pixelStorei(T.UNPACK_ALIGNMENT,1),T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.NONE),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),u(le))de=le.width,ye=le.height,T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,!1),T.bindTexture(T.TEXTURE_2D,N),T.texImage2D(T.TEXTURE_2D,0,J,$,W,le);else if(function d(T,L,w){return L===w.TEXTURE_2D}(0,k,T)){const Be=le.filter?l(T,le.filter):H;T.texParameteri(k,T.TEXTURE_MAG_FILTER,Be),T.texParameteri(k,T.TEXTURE_MIN_FILTER,Be),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,!!le.flipY),Ae?T.texSubImage2D(k,0,0,0,le.width,le.height,$,W,le.array):(de=le.width,ye=le.height,T.texImage2D(k,0,J,de,ye,0,$,W,le.array))}else{if(!(0,r.C6)(T)||!s(0,k,T))throw new Error("unknown texture target");T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,!1),Ae?T.texSubImage3D(k,0,0,0,0,le.width,le.height,le.depth,$,W,le.array):(de=le.width,ye=le.height,j=le.depth,T.texImage3D(k,0,J,de,ye,j,0,$,W,le.array))}T.bindTexture(k,null),Z=le}function _e(){if(k!==T.TEXTURE_2D)throw new Error("mipmap only supported for 2d textures");if(!((0,r.C6)(T)||(0,y.r6)(de)&&(0,y.r6)(ye)))throw new Error("mipmap unsupported for non-power-of-two textures and webgl1");T.bindTexture(k,N),T.texParameteri(k,T.TEXTURE_MIN_FILTER,T.LINEAR_MIPMAP_LINEAR),T.generateMipmap(k),T.bindTexture(k,null),q=!0}return ee(1,1,(0,r.C6)(T)&&k===T.TEXTURE_3D?1:0),{id:U,target:k,format:$,internalFormat:J,type:W,filter:H,getWidth:()=>de,getHeight:()=>ye,getDepth:()=>j,getByteCount:()=>b(Q,G,de,ye,j),define:ee,load:g,mipmap:_e,bind:le=>{T.activeTexture(T.TEXTURE0+le),T.bindTexture(k,N)},unbind:le=>{T.activeTexture(T.TEXTURE0+le),T.bindTexture(k,null)},attachFramebuffer:function xe(le,Ae,Be){if(le.bind(),k===T.TEXTURE_2D)T.framebufferTexture2D(T.FRAMEBUFFER,m(T,L,Ae),T.TEXTURE_2D,N,0);else{if(!(0,r.C6)(T)||k!==T.TEXTURE_3D)throw new Error("unknown/unsupported texture target");if(void 0===Be)throw new Error("need `layer` to attach 3D texture");T.framebufferTextureLayer(T.FRAMEBUFFER,m(T,L,Ae),N,0,Be)}},detachFramebuffer:(le,Ae)=>{if(le.bind(),k===T.TEXTURE_2D)T.framebufferTexture2D(T.FRAMEBUFFER,m(T,L,Ae),T.TEXTURE_2D,null,0);else{if(!(0,r.C6)(T)||k!==T.TEXTURE_3D)throw new Error("unknown texture target");T.framebufferTextureLayer(T.FRAMEBUFFER,m(T,L,Ae),null,0,0)}},reset:()=>{N=C(T),te();const[le,Ae,Be]=[de,ye,j];de=0,ye=0,j=0,ee(le,Ae,Be),Z&&g(Z),q&&_e()},destroy:()=>{Y||(T.deleteTexture(N),Y=!0)}}}function a(T,L,w){const{resources:Q}=T,G=[];return Object.keys(L).forEach(V=>{const U=L[V];if("texture"===U.type){const N=w[V];if(N)if("texture"===U.kind)G[G.length]=[V,N.ref.value];else{const k=Q.texture(U.kind,U.format,U.dataType,U.filter);k.load(N.ref.value),G[G.length]=[V,k]}}}),G}function S(T,L,w){const Q=new Image;Q.onload=function(){w.load(Q),e.IQ.update(L,w)},Q.src=T}function R(T,L,w,Q){const G=T.TEXTURE_CUBE_MAP,V=T.LINEAR,U=T.RGBA,N=T.RGBA,k=T.UNSIGNED_BYTE;let H=0;const $=T.createTexture();T.bindTexture(G,$);let J=0;(0,A.IF)(L,(te,de)=>{if(!te)return;const j=function D(T,L){switch(L){case"nx":return T.TEXTURE_CUBE_MAP_NEGATIVE_X;case"ny":return T.TEXTURE_CUBE_MAP_NEGATIVE_Y;case"nz":return T.TEXTURE_CUBE_MAP_NEGATIVE_Z;case"px":return T.TEXTURE_CUBE_MAP_POSITIVE_X;case"py":return T.TEXTURE_CUBE_MAP_POSITIVE_Y;case"pz":return T.TEXTURE_CUBE_MAP_POSITIVE_Z}}(T,de),Z=new Image;te instanceof File?Z.src=URL.createObjectURL(te):(0,t.$X)(te)?te.then(q=>{Z.src=URL.createObjectURL(q)}):Z.src=te,Z.addEventListener("load",()=>{0===H&&(H=Z.width),T.texImage2D(j,0,U,H,H,0,N,k,null),T.pixelStorei(T.UNPACK_ALIGNMENT,4),T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.NONE),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,!1),T.bindTexture(G,$),T.texImage2D(j,0,U,N,k,Z),J+=1,6===J&&(W||(w?(T.texParameteri(G,T.TEXTURE_MIN_FILTER,T.LINEAR_MIPMAP_LINEAR),T.generateMipmap(G)):T.texParameteri(G,T.TEXTURE_MIN_FILTER,V),T.texParameteri(G,T.TEXTURE_MAG_FILTER,V)),Q?.(W))}),Z.addEventListener("error",()=>{Q?.(!0)})});let W=!1;return{id:c(),target:G,format:N,internalFormat:U,type:k,filter:V,getWidth:()=>H,getHeight:()=>H,getDepth:()=>0,getByteCount:()=>6*b("rgba","ubyte",H,H,0)*(w?2:1),define:()=>{},load:()=>{},mipmap:()=>{},bind:te=>{T.activeTexture(T.TEXTURE0+te),T.bindTexture(G,$)},unbind:te=>{T.activeTexture(T.TEXTURE0+te),T.bindTexture(G,null)},attachFramebuffer:()=>{},detachFramebuffer:()=>{},reset:()=>{},destroy:()=>{W||(T.deleteTexture($),W=!0)}}}const f=-1;function p(T){return T.format===f}function E(T){var L;const w=null!==(L=T?.TEXTURE_2D)&&void 0!==L?L:3553;return{id:c(),target:w,format:f,internalFormat:0,type:0,filter:0,getWidth:()=>0,getHeight:()=>0,getDepth:()=>0,getByteCount:()=>0,define:()=>{},load:()=>{},mipmap:()=>{},bind:Q=>{T&&(T.activeTexture(T.TEXTURE0+Q),T.bindTexture(w,null))},unbind:Q=>{T&&(T.activeTexture(T.TEXTURE0+Q),T.bindTexture(w,null))},attachFramebuffer:()=>{throw new Error("cannot attach null-texture to a framebuffer")},detachFramebuffer:()=>{throw new Error("cannot detach null-texture from a framebuffer")},reset:()=>{},destroy:()=>{}}}},2098:(tn,Ue,n)=>{"use strict";n.d(Ue,{C:()=>y,d:()=>i});var e=n(9854);class r{add(O,b){let _=this.avgs.get(O)||b;return _=function o(v,O,b){return(v-=v/b)+O/b}(_,b,this.count),this.avgs.set(O,_),_}get(O){return this.avgs.get(O)}stats(){return Object.fromEntries(this.avgs.entries())}clear(){this.avgs.clear()}constructor(O){this.count=O,this.avgs=new Map}}function y(v,O,b,_){var M;const I=O.disjointTimerQuery,l=null!==(M=_?.avgCount)&&void 0!==M?M:30,m=new Map,u=new Map,d=[],s=new r(l),C=new r(l);let h=[],a=null,S=!1;const D=()=>{I&&(m.forEach((f,p)=>{I.deleteQuery(p)}),u.clear(),d.length=0,s.clear(),C.clear(),h=[],a=null,S=!1)},R=()=>{if(!I)return;const f=function A(v){return v.disjointTimerQuery?v.disjointTimerQuery.createQuery():null}(O);f&&(I.beginQuery(I.TIME_ELAPSED,f),u.forEach((p,E)=>{p.queries.push(f)}),m.set(f,{refCount:u.size}),a=f)};return{resolve:()=>{const f=[];if(!I||!h.length)return f;m.forEach((E,T)=>{if(void 0!==E.timeElapsed)return;const L=I.getQueryParameter(T,I.QUERY_RESULT_AVAILABLE),w=v.getParameter(I.GPU_DISJOINT);if(L&&!w){const Q=I.getQueryParameter(T,I.QUERY_RESULT);E.timeElapsed=Q}(L||w)&&I.deleteQuery(T)});const p=[];for(const E of h)if(E.queries.every(T=>{var L;return void 0!==(null===(L=m.get(T))||void 0===L?void 0:L.timeElapsed)})){let T=0;for(const L of E.queries){const w=m.get(L);T+=w.timeElapsed,w.refCount-=1}if(E.timeElapsed=T,E.root){const L=[],w=(G,V)=>{for(const U of G){const N=U.timeElapsed,k=U.cpu.end-U.cpu.start,H={label:U.label,gpuElapsed:N,gpuAvg:s.add(U.label,N),cpuElapsed:k,cpuAvg:C.add(U.label,k),children:[],calls:U.calls};V.push(H),w(U.children,H.children)}};w(E.children,L);const Q=E.cpu.end-E.cpu.start;f.push({label:E.label,gpuElapsed:T,gpuAvg:s.add(E.label,T),cpuElapsed:Q,cpuAvg:C.add(E.label,Q),children:L,calls:E.calls})}}else p.push(E);return h=p,m.forEach((E,T)=>{0===E.refCount&&m.delete(T)}),f},mark:(f,p=!1)=>{if(!I)return;if(u.has(f))throw new Error(`Timer mark for '${f}' already exists`);null!==a&&I.endQuery(I.TIME_ELAPSED);const E={label:f,queries:[],children:[],root:null===a,cpu:{start:(0,e.t)(),end:-1},captureStats:p};if(u.set(f,E),d.length&&d[d.length-1].children.push(E),d.push(E),p){if(S)throw new Error("Already capturing stats");(function t(v){v.calls.drawInstanced=0,v.calls.drawInstancedBase=0,v.calls.multiDrawInstancedBase=0,v.calls.counts=0,v.culled.lod=0,v.culled.frustum=0,v.culled.occlusion=0})(b),S=!0}R()},markEnd:f=>{var p;if(!I)return;const E=u.get(f);if(!E)throw new Error(`Timer mark for '${f}' does not exist`);if((null===(p=d.pop())||void 0===p?void 0:p.label)!==f)throw new Error(`Timer mark for '${f}' has pending nested mark`);I.endQuery(I.TIME_ELAPSED),u.delete(f),E.cpu.end=(0,e.t)(),E.captureStats&&(E.calls={...b.calls},S=!1),h.push(E),u.size>0?R():a=null},stats:()=>({gpu:s.stats(),cpu:C.stats()}),formatedStats:()=>{const f={},p=s.stats(),E=C.stats();for(const T of Object.keys(p)){const L=`${(p[T]/1e3/1e3).toFixed(2)}`,w=`${E[T].toFixed(2)}`;f[T]=`${L} ms | CPU: ${w} ms`}return f},clear:D,destroy:()=>{D()}}}function i(v){v.map(O=>{const b=function c(v){const O=`${(v.gpuElapsed/1e3/1e3).toFixed(2)}`,b=`${(v.gpuAvg/1e3/1e3).toFixed(2)}`,_=`${v.cpuElapsed.toFixed(2)}`,M=`${v.cpuAvg.toFixed(2)}`;return`${v.label} ${O} ms (avg. ${b} ms) | CPU: ${_} ms (avg. ${M} ms)`}(O);O.children.length||O.calls?(console.groupCollapsed(b),O.calls&&console.log(O.calls),i(O.children),console.groupEnd()):console.log(b)})}},2879:(tn,Ue,n)=>{"use strict";n.d(Ue,{NM:()=>r,Pi:()=>d,a5:()=>t,kB:()=>h});var e=n(9909),o=n(9359);function r(a,S){switch(S){case"b":case"b[]":return a.BOOL;case"f":case"f[]":return a.FLOAT;case"i":case"i[]":return a.INT;case"v2":case"v2[]":return a.FLOAT_VEC2;case"v3":case"v3[]":return a.FLOAT_VEC3;case"v4":case"v4[]":return a.FLOAT_VEC4;case"iv2":case"iv2[]":return a.INT_VEC2;case"iv3":case"iv3[]":return a.INT_VEC3;case"iv4":case"iv4[]":return a.INT_VEC4;case"m3":case"m3[]":return a.FLOAT_MAT3;case"m4":case"m4[]":return a.FLOAT_MAT4;default:console.error(`unknown uniform kind '${S}'`)}}function t(a){return a.endsWith("[]")}function A(a,S,D){a.uniform1f(S,D)}function y(a,S,D){a.uniform1fv(S,D)}function c(a,S,D){a.uniform1i(S,D)}function i(a,S,D){a.uniform1iv(S,D)}function v(a,S,D){a.uniform2fv(S,D)}function O(a,S,D){a.uniform3fv(S,D)}function b(a,S,D){a.uniform4fv(S,D)}function _(a,S,D){a.uniform2iv(S,D)}function M(a,S,D){a.uniform3iv(S,D)}function I(a,S,D){a.uniform4iv(S,D)}function l(a,S,D){a.uniformMatrix3fv(S,!1,D)}function m(a,S,D){a.uniformMatrix4fv(S,!1,D)}function u(a){switch(a){case"f":return A;case"f[]":return y;case"i":case"t":case"b":return c;case"i[]":case"t[]":case"b[]":return i;case"v2":case"v2[]":return v;case"v3":case"v3[]":return O;case"v4":case"v4[]":return b;case"iv2":case"iv2[]":return _;case"iv3":case"iv3[]":return M;case"iv4":case"iv4[]":return I;case"m3":case"m3[]":return l;case"m4":case"m4[]":return m}}function d(a){const S={};return Object.keys(a).forEach(D=>{const R=a[D];"uniform"===R.type?S[D]=u(R.kind):"texture"===R.type&&(S[D]=u("t"))}),S}function h(a){const S={};return Object.keys(a).forEach(D=>{S[D]=e.IQ.create((0,o.Go)(a[D].ref.value))}),S}},144:(tn,Ue,n)=>{"use strict";n.d(Ue,{ar:()=>D.ar,ND:()=>D.ND,xv:()=>e.x,D4:()=>t});var e=n(7864),o=n(3897),r=n(1372);function t(f){let p=f.data;for(let E=f.encoding.length-1;E>=0;E--)p=A(p,f.encoding[E]);return p}function A(f,p){switch(p.kind){case"ByteArray":switch(p.type){case e.W.IntDataType.Uint8:return f;case e.W.IntDataType.Int8:return function i(f){return new Int8Array(f.buffer,f.byteOffset)}(f);case e.W.IntDataType.Int16:return function O(f){return v(f,2,Int16Array)}(f);case e.W.IntDataType.Uint16:return function b(f){return v(f,2,Uint16Array)}(f);case e.W.IntDataType.Int32:return function _(f){return v(f,4,Int32Array)}(f);case e.W.IntDataType.Uint32:return function M(f){return v(f,4,Uint32Array)}(f);case e.W.FloatDataType.Float32:return function I(f){return v(f,4,Float32Array)}(f);case e.W.FloatDataType.Float64:return function l(f){return v(f,8,Float64Array)}(f);default:(0,r.dr)(p.type)}case"FixedPoint":return function m(f,p){const E=f.length,T=c(p.srcType,E),L=1/p.factor;for(let w=0;w{"use strict";n.d(Ue,{ND:()=>y,ar:()=>A});var A,y,e=n(8382),o=n(7864),r=n(6640);class t{and(i){return new t(this.providers.concat([i]))}encode(i){const v=[];for(const O of this.providers){const b=O(i);if(!b.encodings.length)throw new Error("Encodings must be non-empty.");i=b.data;for(const _ of b.encodings)v.push(_)}if(!(i instanceof Uint8Array))throw new Error("The encoding must result in a Uint8Array. Fix your encoding chain.");return{encoding:v,data:i}}constructor(i){this.providers=i}}!function(c){function i(b){return new t([b])}function O(b){switch(b.kind){case"ByteArray":return y.byteArray;case"FixedPoint":return y.fixedPoint(b.factor);case"IntervalQuantization":return y.intervalQuantizaiton(b.min,b.max,b.numSteps);case"RunLength":return y.runLength;case"Delta":return y.delta;case"IntegerPacking":return y.integerPacking;case"StringArray":return y.stringArray}}c.by=i,c.fromEncoding=function v(b){let _=i(O(b[0]));for(let M=1;M=0?G/E|0:G/T|0}return L+=p.length,L}c.byteArray=M,c.fixedPoint=function l(p){return E=>function I(p,E){const T=o.W.getDataType(p),L=new Int32Array(p.length);for(let w=0,Q=p.length;wfunction m(p,E,T,L,w){const Q=o.W.getDataType(p);if(!p.length)return{encodings:[{kind:"IntervalQuantization",min:E,max:T,numSteps:L,srcType:Q}],data:new Int32Array(0)};if(T=T?L-1:0|Math.round((k-E)/G)}return{encodings:[{kind:"IntervalQuantization",min:E,max:T,numSteps:L,srcType:Q}],data:V}}(w,p,E,T,L)},c.runLength=function d(p){let E=o.W.getDataType(p);if(void 0===E&&(p=new Int32Array(p),E=o.W.IntDataType.Int32),!p.length)return{encodings:[{kind:"RunLength",srcType:E,srcSize:0}],data:new Int32Array(0)};let T=2;for(let G=1,V=p.length;G=0)for(;N>=T;)Q[G]=T,++G,N-=T;else for(;N<=L;)Q[G]=L,++G,N-=L;Q[G]=N,++G}const V=M(Q);return{encodings:[{kind:"IntegerPacking",byteCount:E.bytesPerElement,isUnsigned:!E.isSigned,srcSize:w},V.encodings[0]],data:V.data}}(p,E)},c.stringArray=function f(p){const E=Object.create(null),T=[],L=new Int32Array(p.length),w=e.Gm.create(Int32Array,1,Math.min(1024,p.length<32?p.length+1:Math.round(p.length/8)+1));e.Gm.add(w,0);let Q=0,G=0;for(const $ of p){if(null==$){L[G++]=-1;continue}let J=E[$];void 0===J&&(Q+=$.length,J=T.length,T[J]=$,E[$]=J,e.Gm.add(w,Q)),L[G++]=J}const V=e.Gm.compact(w),N=(0,r.P)(V).encode(V),H=(0,r.P)(L).encode(L);return{encodings:[{kind:"StringArray",dataEncoding:H.encoding,stringData:T.join(""),offsetEncoding:N.encoding,offsets:N.data}],data:H.data}}}(y||(y={}))},6640:(tn,Ue,n)=>{"use strict";n.d(Ue,{O:()=>A,P:()=>t});var y,c,e=n(5657),o=n(229),r=n(1372);function t(i){return y.classify(i)}function A(i){return c.classify(i)}!function(i){function v(h,a){return h>=0?Math.ceil((h+1)/a):Math.ceil((h+1)/(-a-1))}function _({limit8:h,limit16:a},S,D){S.pack8+=v(D,h),S.pack16+=v(D,a),S.count+=1}function M(h,a){h.pack8+=v(a,127),h.pack16+=v(a,32767),h.count+=1}function I(h){return 4*h.count<2*h.pack16?{length:4*h.count,elem:4}:2*h.pack16D.length-R.length),S}i.getSize=s,i.classify=function C(h){if(h.length<2)return e.ND.by(e.ND.byteArray);const S=s(h)[0];switch(S.kind){case"pack":return e.ND.by(e.ND.integerPacking);case"rle":return e.ND.by(e.ND.runLength).and(e.ND.integerPacking);case"delta":return e.ND.by(e.ND.delta).and(e.ND.integerPacking);case"delta-rle":return e.ND.by(e.ND.delta).and(e.ND.runLength).and(e.ND.integerPacking);default:(0,r.dr)(S)}}}(y||(y={})),(c||(c={})).classify=function O(_){const{mantissaDigits:I,integerDigits:l}=(0,o.In)(_,4,1e-6);if(I<0||I+l>10)return e.ND.by(e.ND.byteArray);if(0===I)return y.classify(_);const m=function b(_){let M=1;for(let I=0;I<_;I++)M*=10;return M}(I),u=new Int32Array(_.length);for(let h=0,a=_.length;h{"use strict";n.d(Ue,{W:()=>o,x:()=>e});const e="0.3.0";var o;!function(r){let t;var i;let A;(i=t=r.IntDataType||(r.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"}(A=r.FloatDataType||(r.FloatDataType={})),r.getDataType=function y(i){let v;return v=i instanceof Int8Array?r.IntDataType.Int8:i instanceof Int16Array?r.IntDataType.Int16:i instanceof Int32Array?r.IntDataType.Int32:i instanceof Uint8Array?r.IntDataType.Uint8:i instanceof Uint16Array?r.IntDataType.Uint16:i instanceof Uint32Array?r.IntDataType.Uint32:i instanceof Float32Array?r.FloatDataType.Float32:i instanceof Float64Array?r.FloatDataType.Float64:r.IntDataType.Int32,v},r.isSignedIntegerDataType=function c(i){if(i instanceof Int8Array||i instanceof Int16Array||i instanceof Int32Array)return!0;for(let v=0,O=i.length;v{"use strict";n.d(Ue,{$q:()=>t,vX:()=>e,yw:()=>o});const e=13330===new Uint16Array(new Uint8Array([18,52]).buffer)[0];function o(A,y){const c=new ArrayBuffer(A.length),i=new Uint8Array(c);for(let v=0,O=A.length;vr){const y=[];for(let c=0;c{"use strict";n.d(Ue,{L:()=>r});var r,e=n(9909),o=n(1241);(r||(r={})).fromBuffer=function A(y,c){return{name:c,readBuffer:(i,v,O,b)=>{let _,M;if("number"==typeof v){O=(0,e.NT)(O,v);const I=i,l=Math.min(y.length,I+O);_=l-I,M=o.N.fromUint8Array(new Uint8Array(y.buffer,I,l-I))}else{O=(0,e.NT)(O,v.length);const I=i,l=Math.min(y.length,I+O);v.set(y.subarray(I,l),b),_=l-I,M=v}return O!==_&&console.warn(`byteCount ${O} and bytesRead ${_} differ`),Promise.resolve({bytesRead:_,buffer:M})},writeBuffer:(i,v,O)=>(O=(0,e.NT)(O,v.length),console.error(".writeBuffer not implemented for FileHandle.fromBuffer"),Promise.resolve(0)),writeBufferSync:(i,v,O)=>(O=(0,e.NT)(O,v.length),console.error(".writeSync not implemented for FileHandle.fromBuffer"),0),close:e.lQ}}},5295:(tn,Ue,n)=>{"use strict";n.d(Ue,{J:()=>o});var e=n(275);function o(i){return c({buffer:i,offset:0,dataView:new DataView(i.buffer)})}function r(i,v){const O={};for(let b=0;b{"use strict";n.d(Ue,{N:()=>o});var o,e=n(9909);!function(r){function t(O){const b=new DataView(O.buffer);return Object.assign(O.subarray(0),{readInt8:_=>b.getInt8(_),readUInt8:_=>b.getUint8(_),writeInt8:(_,M)=>b.setInt8(M,_),writeUInt8:(_,M)=>b.setUint8(M,_),readInt16LE:_=>b.getInt16(_,!0),readInt32LE:_=>b.getInt32(_,!0),readUInt16LE:_=>b.getUint16(_,!0),readUInt32LE:_=>b.getUint32(_,!0),readFloatLE:_=>b.getFloat32(_,!0),readDoubleLE:_=>b.getFloat64(_,!0),writeInt16LE:(_,M)=>b.setInt16(M,_,!0),writeInt32LE:(_,M)=>b.setInt32(M,_,!0),writeUInt16LE:(_,M)=>b.setUint16(M,_,!0),writeUInt32LE:(_,M)=>b.setUint32(M,_,!0),writeFloatLE:(_,M)=>b.setFloat32(M,_,!0),writeDoubleLE:(_,M)=>b.setFloat64(M,_,!0),readInt16BE:_=>b.getInt16(_,!1),readInt32BE:_=>b.getInt32(_,!1),readUInt16BE:_=>b.getUint16(_,!1),readUInt32BE:_=>b.getUint32(_,!1),readFloatBE:_=>b.getFloat32(_,!1),readDoubleBE:_=>b.getFloat64(_,!1),writeInt16BE:(_,M)=>b.setInt16(M,_,!1),writeInt32BE:(_,M)=>b.setInt32(M,_,!1),writeUInt16BE:(_,M)=>b.setUint16(M,_,!1),writeUInt32BE:(_,M)=>b.setUint32(M,_,!1),writeFloatBE:(_,M)=>b.setFloat32(M,_,!1),writeDoubleBE:(_,M)=>b.setFloat64(M,_,!1),copy:(_,M,I,l)=>(M=(0,e.NT)(M,0),I=(0,e.NT)(I,0),l=(0,e.NT)(l,O.length),_.set(O.subarray(I,l),M),l-I)})}function c(O,b,_,M,I){for(let l=0,m=_;l>8&255}},r.ensureLittleEndian=function v(O,b,_,M,I){r.IsNativeEndianLittle||!_||M<=1||c(O,b,_,M,I)}}(o||(o={}))},702:(tn,Ue,n)=>{"use strict";n.d(Ue,{RW:()=>r,SV:()=>t,tM:()=>c,ye:()=>i});var e=n(467),o=n(1241),r=function(O){return O.Float32="float32",O.Int8="int8",O.Int16="int16",O.Uint16="uint16",O}(r||{});function t(O){return O===r.Float32?4:O===r.Int16||O===r.Uint16?2:1}function A(O,b,_=0,M){return O===r.Float32?new Float32Array(b,_,M):O===r.Int16?new Int16Array(b,_,M):O===r.Uint16?new Uint16Array(b,_,M):new Int8Array(b,_,M)}function c(O,b){const _=t(b),M=new ArrayBuffer(_*O),I=o.N.fromArrayBuffer(M),l=o.N.IsNativeEndianLittle?M:new ArrayBuffer(_*O);return{type:b,elementByteSize:_,readBuffer:I,valuesBuffer:new Uint8Array(l),values:A(b,l)}}function i(O,b,_,M,I,l){return v.apply(this,arguments)}function v(){return(v=(0,e.A)(function*(O,b,_,M,I,l){return yield b.readBuffer(_,O.readBuffer,M,I),O.elementByteSize>1&&(void 0!==l&&l!==o.N.IsNativeEndianLittle||!o.N.IsNativeEndianLittle)&&o.N.flipByteOrder(O.readBuffer,O.valuesBuffer,M,O.elementByteSize,I),O.values})).apply(this,arguments)}},275:(tn,Ue,n)=>{"use strict";function e(i,v,O){for(let b=0,_=O.length;b<_;b++){const M=O.charCodeAt(b);if(M<128)i[v++]=M>>>0&127;else if(M<2048)i[v++]=M>>>6&31|192,i[v++]=M>>>0&63|128;else if(M<65536)i[v++]=M>>>12&15|224,i[v++]=M>>>6&63|128,i[v++]=M>>>0&63|128;else{if(!(M<1114112))throw new Error("bad codepoint "+M);i[v++]=M>>>18&7|240,i[v++]=M>>>12&63|128,i[v++]=M>>>6&63|128,i[v++]=M>>>0&63|128}}}n.d(Ue,{VH:()=>c,rj:()=>e,ss:()=>y});const o=function(){const i=[];for(let v=0;v<1024;v++)i[v]=String.fromCharCode(v);return i}();function r(i){throw new Error(i)}const A=typeof TextDecoder<"u"?new TextDecoder:void 0;function y(i,v,O){if(A){const b=v||O!==i.length?i.subarray(v,v+O):i;return A.decode(b)}return function t(i,v,O){const b=o;let _,M=0;const I=[];for(let m=v,u=v+O;m0&&(_[_.length]=I.slice(0,M).join("")),_.join("")):I.slice(0,M).join("")}(i,v,O)}function c(i){let v=0;for(let O=0,b=i.length;O{"use strict";n.d(Ue,{q7:()=>M,qg:()=>d});var e=n(467),o=n(4824),r=n(355),t=n(1009),A=n(1241),y=n(702);function i(){return(i=(0,e.A)(function*(s){const{buffer:h}=yield s.readBuffer(0,1024),a=String.fromCharCode(h.readUInt8(208),h.readUInt8(209),h.readUInt8(210),h.readUInt8(211));if("MAP "!==a)throw new Error('ccp4 format error, missing "MAP " string');const S=[h.readUInt8(212),h.readUInt8(213)];let D=!1;68===S[0]&&65===S[1]?D=!0:17===S[0]&&17===S[1]?D=!1:h.readInt32LE(12)<=16&&(D=!0);const R=D?E=>h.readInt32LE(4*E):E=>h.readInt32BE(4*E),f=D?E=>h.readFloatLE(4*E):E=>h.readFloatBE(4*E);return{header:{NC:R(0),NR:R(1),NS:R(2),MODE:R(3),NCSTART:R(4),NRSTART:R(5),NSSTART:R(6),NX:R(7),NY:R(8),NZ:R(9),xLength:f(10),yLength:f(11),zLength:f(12),alpha:f(13),beta:f(14),gamma:f(15),MAPC:R(16),MAPR:R(17),MAPS:R(18),AMIN:f(19),AMAX:f(20),AMEAN:f(21),ISPG:R(22),NSYMBT:R(23),LSKFLG:R(24),SKWMAT:[],SKWTRN:[],userFlag1:R(39),userFlag2:R(40),originX:f(49),originY:f(50),originZ:f(51),MAP:a,MACHST:S,ARMS:f(54)},littleEndian:D}})).apply(this,arguments)}function O(){return(O=(0,e.A)(function*(s,C,h,a,S,D){if(_(s)){const R=3*S;yield h.readBuffer(a,C.readBuffer,S,R);const f=new Int8Array(C.valuesBuffer.buffer,R),p=(s.AMAX-s.AMIN)/255,E=.5*(s.AMIN+s.AMAX+p);for(let T=0,L=S;T{"use strict";n.d(Ue,{f$:()=>rn,xA:()=>o.xA,RF:()=>o.RF});var e=n(467),o=n(2241),r=n(5555),t=n(355),A=n(4824);function y(tt){for(;tt.position=tt.length)return void(tt.tokenType=6);tt.tokenStart=tt.position,tt.tokenEnd=tt.position,tt.isEscaped=!1;const nn=tt.data.charCodeAt(tt.position);switch(nn){case 35:(function b(tt){for(;tt.position=5&&95===tt.data.charCodeAt(tt.tokenStart+4)?function I(tt){let Mt=tt.data.charCodeAt(tt.tokenStart);return!(68!==Mt&&100!==Mt||(Mt=tt.data.charCodeAt(tt.tokenStart+1),65!==Mt&&97!==Mt)||(Mt=tt.data.charCodeAt(tt.tokenStart+2),84!==Mt&&116!==Mt)||(Mt=tt.data.charCodeAt(tt.tokenStart+3),65!==Mt&&97!==Mt))}(tt)?0:function l(tt){let Mt=tt.data.charCodeAt(tt.tokenStart);return!(83!==Mt&&115!==Mt||(Mt=tt.data.charCodeAt(tt.tokenStart+1),65!==Mt&&97!==Mt)||(Mt=tt.data.charCodeAt(tt.tokenStart+2),86!==Mt&&118!==Mt)||(Mt=tt.data.charCodeAt(tt.tokenStart+3),69!==Mt&&101!==Mt))}(tt)?1:function m(tt){if(tt.tokenEnd-tt.tokenStart!=5)return!1;let Mt=tt.data.charCodeAt(tt.tokenStart);return!(76!==Mt&&108!==Mt||(Mt=tt.data.charCodeAt(tt.tokenStart+1),79!==Mt&&111!==Mt)||(Mt=tt.data.charCodeAt(tt.tokenStart+2),79!==Mt&&111!==Mt)||(Mt=tt.data.charCodeAt(tt.tokenStart+3),80!==Mt&&112!==Mt))}(tt)?2:3:3}}function D(tt){for(S(tt);5===tt.tokenType;)S(tt)}function f(){return{categoryNames:[],categoryData:Object.create(null)}}function p(tt,Mt){const nn=Object.create(null);for(const bn of tt){const Dn=Mt[bn];nn[bn]=o.xA(Dn.name,Dn.rowCount,Dn.fieldNames,Dn.fields)}return nn}function E(tt,Mt,nn){return o.IU(tt.categoryNames,p(tt.categoryNames,tt.categoryData),Mt,nn)}function T(tt,Mt){return o.IU(tt.categoryNames,p(tt.categoryNames,tt.categoryData),Mt)}function L(tt,Mt,nn,bn,Dn){if(Mt in tt.categoryData){const jt=tt.categoryData[Mt];jt.fieldNames.push(...bn),Object.assign(jt.fields,Dn)}else tt.categoryData[Mt]={name:Mt,rowCount:nn,fieldNames:bn,fields:Dn},tt.categoryNames.push(Mt)}function w(tt,Mt){const nn=tt.tokenStart,bn=s(tt),Dn=C(tt,bn),jt=Object.create(null),It=[];let Dt=!0;for(;Dt;){if(4!==tt.tokenType||!d(tt,nn,bn)){Dt=!1;break}const Ct=a(tt).substring(Dn.length+1);if(D(tt),3!==tt.tokenType)return{hasError:!0,errorLine:tt.lineNumber,errorMessage:"Expected value."};jt[Ct]=o.RF.ofTokens({data:tt.data,indices:[tt.tokenStart,tt.tokenEnd],count:1}),It[It.length]=Ct,D(tt)}return L(Mt,Dn.substr(1),1,It,jt),{hasError:!1,errorLine:0,errorMessage:""}}function Q(tt,Mt){const{tokenizer:nn,tokens:bn,fieldCount:Dn}=Mt;let jt=Mt.tokenCount,It=0;for(;3===nn.tokenType&&It0&&nn.push(E(jt,Dn,It)),Dn=tt.substring(bn.tokenStart+5,bn.tokenEnd),jt=f(),It=[],D(bn)}else if(1===Vt){if(bn.tokenEnd-bn.tokenStart==5)Dt.categoryNames.length>0&&(It[It.length]=T(Dt,$t)),bn.inSaveFrame=!1;else{if(bn.inSaveFrame)return N(bn.lineNumber,"Save frames cannot be nested.");bn.inSaveFrame=!0,$t=tt.substring(bn.tokenStart+5,bn.tokenEnd),Dt=f()}D(bn)}else if(2===Vt){const Wt=yield V(bn,bn.inSaveFrame?Dt:jt);if(Wt.hasError)return N(Wt.errorLine,Wt.errorMessage)}else{if(4!==Vt)return console.log(bn.tokenType,r._F.getTokenString(bn)),N(bn.lineNumber,"Unexpected token. Expected data_, loop_, or data name.");{const Wt=w(bn,bn.inSaveFrame?Dt:jt);if(Wt.hasError)return N(Wt.errorLine,Wt.errorMessage)}}}return bn.inSaveFrame?N(bn.lineNumber,`Unfinished save frame (${Ct.header}).`):((jt.categoryNames.length>0||It.length>0)&&nn.push(E(jt,Dn,It)),function k(tt){return t.H.success(tt)}(o.jG(nn)))})).apply(this,arguments)}function J(tt){return A.YZ.create("Parse CIF",function(){var Mt=(0,e.A)(function*(nn){return yield function H(tt,Mt){return $.apply(this,arguments)}(tt,nn)});return function(nn){return Mt.apply(this,arguments)}}())}var W=n(6651),te=n(144),de=n(2025),j=n(5295);function q(tt){const Mt=Object.create(null),nn=Object.create(null);for(const bn of tt.columns)Mt[bn.name]=bn;return{rowCount:tt.rowCount,name:tt.name.substr(1),fieldNames:tt.columns.map(bn=>bn.name),getField(bn){const Dn=Mt[bn];if(Dn)return nn[bn]||(nn[bn]=function ye(tt){const Mt=tt.mask?(0,te.D4)(tt.mask):void 0,nn=(0,te.D4)(tt.data),bn=W.iu.isTypedArray(nn),Dn=bn?Mt?$t=>0===Mt[$t]?""+nn[$t]:"":$t=>""+nn[$t]:Mt?$t=>0===Mt[$t]?nn[$t]:"":$t=>nn[$t],jt=bn?$t=>nn[$t]:$t=>{const Vt=nn[$t];return(0,de.H9)(Vt,0,Vt.length)},It=bn?$t=>nn[$t]:$t=>{const Vt=nn[$t];return(0,de.sS)(Vt,0,Vt.length)},Ct=nn.length;return{__array:nn,binaryEncoding:tt.data.encoding,isDefined:!0,rowCount:Ct,str:Dn,int:jt,float:It,valueKind:Mt?$t=>Mt[$t]:$t=>0,areValuesEqual:($t,Vt)=>nn[$t]===nn[Vt],toStringArray:$t=>W.iu.createAndFillArray(Ct,Dn,$t),toIntArray:bn?$t=>W.iu.typedArrayWindow(nn,$t):$t=>W.iu.createAndFillArray(Ct,jt,$t),toFloatArray:bn?$t=>W.iu.typedArrayWindow(nn,$t):$t=>W.iu.createAndFillArray(Ct,It,$t)}}(Dn)),nn[bn]}}}function Y(tt){return A.YZ.create("Parse BinaryCIF",function(){var Mt=(0,e.A)(function*(nn){const bn=[0,3];try{const Dn=(0,j.J)(tt);if(!function Z(tt,Mt){for(let nn=0;nn<2;nn++)if(tt[nn]>Mt[nn])return!1;return!0}(bn,Dn.version.match(/(\d)\.(\d)\.\d/).slice(1).map(It=>+It)))return t.H.error(`Unsupported format version. Current ${Dn.version}, required ${bn.join(".")}.`);const jt=o.jG(Dn.dataBlocks.map(It=>{const Dt=Object.create(null);for(const Ct of It.categories)Dt[Ct.name.substr(1)]=q(Ct);return o.IU(It.categories.map(Ct=>Ct.name.substr(1)),Dt,It.header)}));return t.H.success(jt)}catch(Dn){return t.H.error(""+Dn)}});return function(nn){return Mt.apply(this,arguments)}}())}var ee=n(7754),g=n(7357),_e=W.VP.Schema;const xe=_e.str,Ae=_e.List,Be=_e.lstr,Ce=_e.Aliased,Re=_e.int,ke=_e.coord,we={chem_comp:{formula:xe,formula_weight:_e.float,id:xe,mon_nstd_parent_comp_id:Ae(",",tt=>tt),name:xe,one_letter_code:xe,three_letter_code:xe,type:Ce(Be),pdbx_synonyms:Ae(";",tt=>tt),pdbx_type:xe,pdbx_ambiguous_flag:xe,pdbx_replaced_by:xe,pdbx_replaces:xe,pdbx_formal_charge:Re,pdbx_model_coordinates_details:xe,pdbx_model_coordinates_db_code:xe,pdbx_ideal_coordinates_details:xe,pdbx_ideal_coordinates_missing_flag:Ce(Be),pdbx_model_coordinates_missing_flag:Ce(Be),pdbx_initial_date:xe,pdbx_modified_date:xe,pdbx_release_status:Ce(xe),pdbx_processing_site:Ce(xe)},chem_comp_atom:{alt_atom_id:xe,atom_id:xe,charge:Re,model_Cartn_x:ke,model_Cartn_y:ke,model_Cartn_z:ke,comp_id:xe,type_symbol:xe,pdbx_align:Re,pdbx_ordinal:Re,pdbx_model_Cartn_x_ideal:ke,pdbx_model_Cartn_y_ideal:ke,pdbx_model_Cartn_z_ideal:ke,pdbx_stereo_config:Ce(Be),pdbx_aromatic_flag:Ce(Be),pdbx_leaving_atom_flag:Ce(Be)},chem_comp_bond:{atom_id_1:xe,atom_id_2:xe,comp_id:xe,value_order:Ce(Be),pdbx_ordinal:Re,pdbx_stereo_config:Ce(Be),pdbx_aromatic_flag:Ce(Be)},pdbx_chem_comp_descriptor:{comp_id:xe,descriptor:xe,type:Ce(Be),program:xe,program_version:xe},pdbx_chem_comp_identifier:{comp_id:xe,identifier:xe,type:Ce(xe),program:xe,program_version:xe}};var Oe=W.VP.Schema;const Se=Oe.str,Ne=Oe.lstr,K=Oe.Aliased,ne=Oe.int,be={pdbx_reference_molecule:{prd_id:Se,formula_weight:Oe.float,formula:Se,type:K(Ne),type_evidence_code:Se,class:K(Ne),class_evidence_code:Se,name:Se,represent_as:K(Ne),chem_comp_id:Se,compound_details:Se,description:Se,representative_PDB_id_code:Se,release_status:K(Ne),replaces:Se,replaced_by:Se},pdbx_reference_entity_list:{prd_id:Se,ref_entity_id:Se,type:K(Ne),details:Se,component_id:ne},pdbx_reference_entity_nonpoly:{prd_id:Se,ref_entity_id:Se,name:Se,chem_comp_id:Se},pdbx_reference_entity_link:{link_id:ne,prd_id:Se,details:Se,ref_entity_id_1:Se,ref_entity_id_2:Se,entity_seq_num_1:ne,entity_seq_num_2:ne,comp_id_1:Se,comp_id_2:Se,atom_id_1:Se,atom_id_2:Se,value_order:K(Ne),component_1:ne,component_2:ne,link_class:K(Se)},pdbx_reference_entity_poly_link:{link_id:ne,prd_id:Se,ref_entity_id:Se,component_id:ne,entity_seq_num_1:ne,entity_seq_num_2:ne,comp_id_1:Se,comp_id_2:Se,atom_id_1:Se,atom_id_2:Se,value_order:K(Ne)},pdbx_reference_entity_poly:{prd_id:Se,ref_entity_id:Se,type:K(Se),db_code:Se,db_name:Se},pdbx_reference_entity_poly_seq:{prd_id:Se,ref_entity_id:Se,mon_id:Se,parent_mon_id:Se,num:ne,observed:K(Ne),hetero:K(Ne)},pdbx_reference_entity_sequence:{prd_id:Se,ref_entity_id:Se,type:K(Se),NRP_flag:K(Se),one_letter_codes:Se},pdbx_reference_entity_src_nat:{prd_id:Se,ref_entity_id:Se,ordinal:ne,organism_scientific:Se,taxid:Se,db_code:Se,db_name:Se},pdbx_prd_audit:{prd_id:Se,date:Se,processing_site:K(Se),action_type:K(Se)}};var Te=W.VP.Schema;const ie=Te.str,nt={datablock:{id:ie,description:ie},dictionary:{title:ie,datablock_id:ie,version:ie},dictionary_history:{version:ie,update:ie,revision:ie},sub_category:{id:ie,description:ie},category_group_list:{id:ie,parent_id:ie,description:ie},item_type_list:{code:ie,primitive_code:ie,construct:ie,detail:ie},item_units_list:{code:ie,detail:ie},item_units_conversion:{from_code:ie,to_code:ie,operator:ie,factor:Te.float}};var je=W.VP.Schema;const Lt=je.str,Je=je.int,en=je.float,Bt=je.Aliased,pn=je.Vector,mt=(Bt(Lt),Bt(Lt),Bt(Lt),Bt(Lt),pn(3),pn(3),{volume_data_3d_info:{name:Lt,axis_order:pn(3,Je),origin:pn(3),dimensions:pn(3),sample_rate:Je,sample_count:pn(3,Je),spacegroup_number:Je,spacegroup_cell_size:pn(3),spacegroup_cell_angles:pn(3),mean_source:en,mean_sampled:en,sigma_source:en,sigma_sampled:en,min_source:en,min_sampled:en,max_source:en,max_sampled:en},volume_data_3d:{values:en}});var _t=W.VP.Schema;const Me=_t.float,Ke=_t.int,ut=_t.str,sn={cell:{angle_alpha:Me,angle_beta:Me,angle_gamma:Me,formula_units_z:Ke,length_a:Me,length_b:Me,length_c:Me,volume:Me},chemical:{melting_point:Me,name_common:ut,name_systematic:ut},chemical_formula:{moiety:ut,sum:ut,weight:Me},space_group:{crystal_system:ut,it_number:Ke,"name_h-m_full":ut},space_group_symop:{operation_xyz:ut},geom_bond:{atom_site_label_1:ut,atom_site_label_2:ut,distance:Me,publ_flag:ut,site_symmetry_1:ut,site_symmetry_2:ut,valence:Me},audit:{block_doi:ut},database_code:{cod:ut,csd:ut,depnum_ccdc_archive:ut,depnum_ccdc_fiz:ut,icsd:ut,mdf:ut,nbs:ut},atom_site:{adp_type:ut,calc_flag:ut,disorder_assembly:ut,disorder_group:ut,fract_x:Me,fract_y:Me,fract_z:Me,label:ut,occupancy:Me,refinement_flags:ut,site_symmetry_multiplicity:Ke,type_symbol:ut,u_iso_or_equiv:Me},atom_site_aniso:{label:ut,u_11:Me,u:(0,_t.Matrix)(3,3),u_12:Me,u_13:Me,u_22:Me,u_23:Me,u_33:Me},atom_type:{description:ut,symbol:ut},atom_type_scat:{dispersion_imag:Me,dispersion_real:Me,source:ut}},gt={"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"]},At=W.VP.Schema.int,Gt={volume_data_3d_info:mt.volume_data_3d_info,segmentation_data_table:{set_id:At,segment_id:At},segmentation_data_3d:{values:At}},rn={parse:tt=>"string"==typeof tt?J(tt):Y(tt),parseText:J,parseBinary:Y,toDatabaseCollection:ee.nN,toDatabase:ee.Pd,schema:{mmCIF:tt=>(0,ee.Pd)(g.r,tt),CCD:tt=>(0,ee.Pd)(we,tt),BIRD:tt=>(0,ee.Pd)(be,tt),dic:tt=>(0,ee.Pd)(nt,tt),cifCore:tt=>(0,ee.Pd)(sn,tt,gt),densityServer:tt=>(0,ee.Pd)(mt,tt),segmentation:tt=>(0,ee.Pd)(Gt,tt)}}},2241:(tn,Ue,n)=>{"use strict";n.d(Ue,{G:()=>v,IU:()=>A,RF:()=>i,cS:()=>O,jG:()=>t,p4:()=>y,xA:()=>c});var i,e=n(6651),o=n(2025),r=n(3656);function t(_,M){return{name:M,blocks:_}}function A(_,M,I,l=[]){return{categoryNames:_,header:I,categories:M,saveFrames:l,getField(m){const[u,d]=m.split(".");return M[u].getField(d||"")}}}function y(_,M,I){return{categoryNames:_,header:I,categories:M}}function c(_,M,I,l){return{rowCount:M,name:_,fieldNames:[...I],getField:m=>l[m]}}function v(_,M,I,l){const m=I?0:1;switch(M){case 1:return"brackets"===l?u=>`${_}[${u+m}]`:u=>`${_}_${u+m}`;case 2:return"brackets"===l?(u,d)=>`${_}[${u+m}][${d+m}]`:(u,d)=>`${_}_${u+m}${d+m}`;case 3:return"brackets"===l?(u,d,s)=>`${_}[${u+m}][${d+m}][${s+m}]`:(u,d,s)=>`${_}_${u+m}${d+m}${s+m}`;default:throw new Error("Tensors with rank > 3 or rank 0 are currently not supported.")}}function O(_,M,I,l){const m=M.create();if(1===M.rank){const u=M.dimensions[0];for(let d=0;d 3 or rank 0 are currently not supported.");{const u=M.dimensions[0],d=M.dimensions[1],s=M.dimensions[2];for(let C=0;C0?u[d[0]].rowCount:0,name:m,fieldNames:d,getField:s=>u[s]}}_.empty=function M(m){return{rowCount:0,name:m,fieldNames:[],getField(u){}}},_.ofFields=I,_.ofTable=function l(m,u){const d={};for(const s of u._columns)d[s]=i.ofColumn(u[s]);return I(m,d)}}(c||(c={})),function(_){function I(s){const C=s.length,h=R=>{const f=s[R];return f&&"."!==f&&"?"!==f?f:""},a=R=>{const f=s[R];return(0,o.H9)(f,0,f.length)||0},S=R=>{const f=s[R];return(0,o.sS)(f,0,f.length)||0};return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:C,str:h,int:a,float:S,valueKind:R=>{const f=s[R],p=f.length;if(p>1)return 0;if(0===p)return 1;const E=f.charCodeAt(0);return 46===E?1:63===E?2:0},areValuesEqual:(R,f)=>s[R]===s[f],toStringArray:R=>R?e.iu.createAndFillArray(C,h,R):s,toIntArray:R=>e.iu.createAndFillArray(C,a,R),toFloatArray:R=>e.iu.createAndFillArray(C,S,R)}}function u(s){const{rowCount:C,valueKind:h,areValuesEqual:a,isDefined:S}=s;let D,R,f;switch(s.schema.valueType){case"float":case"int":D=E=>""+s.value(E),R=s.value,f=s.value;break;case"str":D=s.value,R=E=>{const T=s.value(E);return(0,o.H9)(T,0,T.length)||0},f=E=>{const T=s.value(E);return(0,o.sS)(T,0,T.length)||0};break;case"list":const{separator:p}=s.schema;D=E=>s.value(E).join(p),R=E=>NaN,f=E=>NaN;break;default:throw new Error(`unsupported valueType '${s.schema.valueType}'`)}return{__array:void 0,binaryEncoding:void 0,isDefined:S,rowCount:C,str:D,int:R,float:f,valueKind:h,areValuesEqual:a,toStringArray:p=>e.iu.createAndFillArray(C,D,p),toIntArray:p=>e.iu.createAndFillArray(C,R,p),toFloatArray:p=>e.iu.createAndFillArray(C,f,p)}}_.ofString=function M(s){return I([s])},_.ofStrings=I,_.ofNumbers=function l(s){const C=s.length,h=R=>""+s[R],a=R=>s[R],D=R=>!R||R.array&&s instanceof R.array?s:e.iu.createAndFillArray(C,a,R);return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:C,str:h,int:a,float:a,valueKind:R=>0,areValuesEqual:(R,f)=>s[R]===s[f],toStringArray:R=>e.iu.createAndFillArray(C,h,R),toIntArray:D,toFloatArray:D}},_.ofTokens=function m(s){const{data:C,indices:h,count:a}=s,S=p=>{const E=C.substring(h[2*p],h[2*p+1]);return"."===E||"?"===E?"":E},D=p=>(0,o.H9)(C,h[2*p],h[2*p+1])||0,R=p=>(0,o.sS)(C,h[2*p],h[2*p+1])||0;return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:a,str:S,int:D,float:R,valueKind:p=>{const E=h[2*p],T=h[2*p+1]-E;if(T>1)return 0;if(0===T)return 1;const L=C.charCodeAt(E);return 46===L?1:63===L?2:0},areValuesEqual:(0,r.k5)(s),toStringArray:p=>e.iu.createAndFillArray(a,S,p),toIntArray:p=>e.iu.createAndFillArray(a,D,p),toFloatArray:p=>e.iu.createAndFillArray(a,R,p)}},_.ofColumn=u,_.ofUndefined=function d(s,C){return u(e.VP.Undefined(s,C))}}(i||(i={}))},7754:(tn,Ue,n)=>{"use strict";n.d(Ue,{MR:()=>i,Pd:()=>c,nN:()=>y});var A,e=n(6651),o=n(4369),r=n(9909),t=n(2241);function y(s,C,h){const a={};for(const S of C.blocks)a[S.header]=c(s,S,h);return a}function c(s,C,h){return function l(s,C,h){const a=Object.create(null);for(const S of Object.keys(s))a[S]=d(S,s[S],C,h);return e.Wm.ofTables(C.header,s,a)}(s,C,h)}function i(s,C){return new I(C,s,!0)}function v(s){switch(s.valueType){case"str":return(C,h,a)=>function O(s,C,h,a){return{schema:s,__array:C.__array,isDefined:C.isDefined,rowCount:C.rowCount,value:"lowercase"===s.transform?S=>h(S).toLowerCase():"uppercase"===s.transform?S=>h(S).toUpperCase():h,valueKind:C.valueKind,areValuesEqual:C.areValuesEqual,toArray:"lowercase"===s.transform?S=>Array.from(a(S)).map(D=>D.toLowerCase()):"uppercase"===s.transform?S=>Array.from(a(S)).map(D=>D.toUpperCase()):a}}(s,C,C.str,C.toStringArray);case"int":return(C,h,a)=>b(s,C,C.int,C.toIntArray);case"float":return(C,h,a)=>b(s,C,C.float,C.toFloatArray);case"list":throw new Error("Use createListColumn instead.");case"tensor":throw new Error("Use createTensorColumn instead.")}}function b(s,C,h,a){return{schema:s,__array:C.__array,isDefined:C.isDefined,rowCount:C.rowCount,value:h,valueKind:C.valueKind,areValuesEqual:C.areValuesEqual,toArray:a}}function _(s,C,h){const a=s.separator,S=s.itemParse,D=C.getField(h),R=D?p=>D.str(p).split(a).map(E=>S(E.trim())).filter(E=>!!E):p=>[];return{schema:s,__array:void 0,isDefined:!!D,rowCount:C.rowCount,value:R,valueKind:D?D.valueKind:()=>1,areValuesEqual:(p,E)=>(0,r.af)(R(p),R(E)),toArray:p=>e.iu.createAndFillArray(C.rowCount,R,p)}}function M(s,C,h){const a=s.space,S=C.fieldNames.includes(`${h}[0]`)||C.fieldNames.includes(`${h}[0][0]`)||C.fieldNames.includes(`${h}[0][0][0]`),D=S?0:1,R=C.fieldNames.includes(`${h}_1`)||C.fieldNames.includes(`${h}_11`)||C.fieldNames.includes(`${h}_111`)?"underscore":"brackets",f=t.G(h,a.rank,S,R),p=C.getField(f(D,D,D))||e.VP.Undefined(C.rowCount,s),E=L=>t.cS(C,a,L,f);return{schema:s,__array:void 0,isDefined:p.isDefined,rowCount:C.rowCount,value:E,valueKind:p.valueKind,areValuesEqual:(L,w)=>o.qY.areEqualExact(E(L),E(w)),toArray:L=>e.iu.createAndFillArray(C.rowCount,E,L)}}!function(s){function C(S){return S.replace(".","_").replace(/\[/,"_").replace(/(\[|\])/g,"")}s.canonical=C,s.equal=function h(S,D){return C(S)===C(D)},s.create=function a(S,D,R=!1){const f=`${S}${D?`.${D}`:""}`;return R?C(f):f}}(A||(A={}));class I{constructor(C,h,a){this._isDefined=a;const S=Object.keys(h);this._rowCount=C.rowCount,this._columns=S,this._schema=h;const D=Object.create(null);for(const R of S)Object.defineProperty(this,R,{get:function(){if(D[R])return D[R];const f=h[R];if("list"===f.valueType)D[R]=_(f,C,R);else if("tensor"===f.valueType)D[R]=M(f,C,R);else{const p=v(f),E=C.getField(R);D[R]=E?p(E,C,R):e.VP.Undefined(C.rowCount,f)}return D[R]},enumerable:!0,configurable:!1})}}function u(s,C,h,a){const S=A.create(C,s),D=A.canonical(S);if(D in h)return h[D];if(a&&S in a)for(const R of a[S]){const f=A.canonical(R);if(f in h)return h[f]}}function d(s,C,h,a){let S=h.categories[s];if(a){const D=function m(s){const C=Object.create(null);for(const h of Object.keys(s.categories))for(const a of s.categories[h].fieldNames)C[A.create(h,a,!0)]=s.categories[h].getField(a);return C}(h),R=Object.create(null),f=[];let p=0;for(const E of Object.keys(C)){const T=u(E,s,D,a);T&&(R[E]=T,f.push(E),p=T.rowCount)}S={rowCount:p,name:s,fieldNames:[...f],getField:E=>R[E]}}return new I(S||t.xA.empty(s),C,!!S)}},7357:(tn,Ue,n)=>{"use strict";n.d(Ue,{r:()=>_});var o=n(6651).VP.Schema;const r=o.str,t=o.int,A=o.float,y=o.coord,c=o.Aliased,i=o.Matrix,v=o.Vector,O=o.lstr,b=o.List,_={atom_site:{auth_asym_id:r,auth_atom_id:r,auth_comp_id:r,auth_seq_id:t,B_iso_or_equiv:A,Cartn_x:y,Cartn_y:y,Cartn_z:y,group_PDB:c(r),id:t,label_alt_id:r,label_asym_id:r,label_atom_id:r,label_comp_id:r,label_entity_id:r,label_seq_id:t,occupancy:A,type_symbol:r,pdbx_PDB_ins_code:r,pdbx_PDB_model_num:t,pdbx_formal_charge:t,pdbx_label_index:t,pdbx_sifts_xref_db_name:r,pdbx_sifts_xref_db_acc:r,pdbx_sifts_xref_db_num:r,pdbx_sifts_xref_db_res:r,ihm_model_id:t},atom_site_anisotrop:{id:t,type_symbol:r,U:i(3,3),U_esd:i(3,3),pdbx_auth_seq_id:r,pdbx_auth_asym_id:r,pdbx_auth_atom_id:r,pdbx_auth_comp_id:r,pdbx_label_seq_id:t,pdbx_label_alt_id:r,pdbx_label_asym_id:r,pdbx_label_atom_id:r,pdbx_label_comp_id:r,pdbx_PDB_ins_code:r},atom_sites:{entry_id:r,fract_transf_matrix:i(3,3),fract_transf_vector:v(3)},audit_author:{name:r,pdbx_ordinal:t,identifier_ORCID:r},audit_conform:{dict_location:r,dict_name:r,dict_version:r},cell:{angle_alpha:A,angle_beta:A,angle_gamma:A,entry_id:r,length_a:A,length_b:A,length_c:A,Z_PDB:t,pdbx_unique_axis:r},chem_comp:{formula:r,formula_weight:A,id:r,mon_nstd_flag:c(O),name:r,type:c(O),pdbx_synonyms:b(";",M=>M)},chem_comp_bond:{atom_id_1:r,atom_id_2:r,comp_id:r,value_order:c(O),pdbx_ordinal:t,pdbx_stereo_config:c(O),pdbx_aromatic_flag:c(O)},citation:{book_publisher:r,country:r,id:r,journal_abbrev:r,journal_id_ASTM:r,journal_id_CSD:r,journal_id_ISSN:r,journal_volume:r,page_first:r,page_last:r,title:r,year:t,pdbx_database_id_DOI:r,pdbx_database_id_PubMed:t},citation_author:{citation_id:r,name:r,ordinal:t},database_2:{database_id:c(O),database_code:r},entity:{details:r,formula_weight:A,id:r,src_method:c(O),type:c(O),pdbx_description:b(",",M=>M),pdbx_number_of_molecules:t,pdbx_mutation:r,pdbx_fragment:r,pdbx_ec:b(",",M=>M)},entity_poly:{entity_id:r,nstd_linkage:c(O),nstd_monomer:c(O),type:c(r),pdbx_strand_id:b(",",M=>M),pdbx_seq_one_letter_code:r,pdbx_seq_one_letter_code_can:r,pdbx_target_identifier:r},entity_poly_seq:{entity_id:r,hetero:c(O),mon_id:r,num:t},entry:{id:r},exptl:{entry_id:r,method:c(r)},software:{classification:r,date:r,description:r,name:r,type:c(O),version:r,pdbx_ordinal:t},struct:{entry_id:r,title:r,pdbx_descriptor:r},struct_asym:{details:r,entity_id:r,id:r,pdbx_modified:r,pdbx_blank_PDB_chainid_flag:c(r)},struct_conf:{beg_label_asym_id:r,beg_label_comp_id:r,beg_label_seq_id:t,beg_auth_asym_id:r,beg_auth_comp_id:r,beg_auth_seq_id:t,conf_type_id:c(O),details:r,end_label_asym_id:r,end_label_comp_id:r,end_label_seq_id:t,end_auth_asym_id:r,end_auth_comp_id:r,end_auth_seq_id:t,id:r,pdbx_beg_PDB_ins_code:r,pdbx_end_PDB_ins_code:r,pdbx_PDB_helix_class:r,pdbx_PDB_helix_length:t,pdbx_PDB_helix_id:r},struct_conn:{conn_type_id:c(O),details:r,id:r,ptnr1_label_asym_id:r,ptnr1_label_atom_id:r,ptnr1_label_comp_id:r,ptnr1_label_seq_id:t,ptnr1_auth_asym_id:r,ptnr1_auth_comp_id:r,ptnr1_auth_seq_id:t,ptnr1_symmetry:r,ptnr2_label_asym_id:r,ptnr2_label_atom_id:r,ptnr2_label_comp_id:r,ptnr2_label_seq_id:t,ptnr2_auth_asym_id:r,ptnr2_auth_comp_id:r,ptnr2_auth_seq_id:t,ptnr2_symmetry:r,pdbx_ptnr1_PDB_ins_code:r,pdbx_ptnr1_label_alt_id:r,pdbx_ptnr1_standard_comp_id:r,pdbx_ptnr2_PDB_ins_code:r,pdbx_ptnr2_label_alt_id:r,pdbx_ptnr3_PDB_ins_code:r,pdbx_ptnr3_label_alt_id:r,pdbx_ptnr3_label_asym_id:r,pdbx_ptnr3_label_atom_id:r,pdbx_ptnr3_label_comp_id:r,pdbx_ptnr3_label_seq_id:t,pdbx_PDB_id:r,pdbx_dist_value:A,pdbx_value_order:c(O)},struct_conn_type:{criteria:r,id:c(O),reference:r},struct_keywords:{entry_id:r,text:b(",",M=>M),pdbx_keywords:r},struct_ncs_oper:{code:c(r),details:r,id:t,matrix:i(3,3),vector:v(3)},struct_sheet_range:{beg_label_asym_id:r,beg_label_comp_id:r,beg_label_seq_id:t,end_label_asym_id:r,end_label_comp_id:r,end_label_seq_id:t,beg_auth_asym_id:r,beg_auth_comp_id:r,beg_auth_seq_id:t,end_auth_asym_id:r,end_auth_comp_id:r,end_auth_seq_id:t,id:r,sheet_id:r,pdbx_beg_PDB_ins_code:r,pdbx_end_PDB_ins_code:r},struct_site:{details:r,id:r,pdbx_num_residues:t,pdbx_evidence_code:r,pdbx_auth_asym_id:r,pdbx_auth_comp_id:r,pdbx_auth_seq_id:r,pdbx_auth_ins_code:r},struct_site_gen:{details:r,id:r,label_alt_id:r,label_asym_id:r,label_atom_id:r,label_comp_id:r,label_seq_id:t,auth_asym_id:r,auth_comp_id:r,auth_seq_id:r,site_id:r,symmetry:r,pdbx_auth_ins_code:r,pdbx_num_res:t},symmetry:{entry_id:r,cell_setting:c(O),Int_Tables_number:t,space_group_name_Hall:r,"space_group_name_H-M":r},pdbx_database_status:{status_code:c(r),status_code_sf:c(r),status_code_mr:c(r),entry_id:r,recvd_initial_deposition_date:r,SG_entry:c(O),deposit_site:c(r),process_site:c(r),status_code_cs:c(r),methods_development_category:c(r),pdb_format_compatible:c(O)},pdbx_nonpoly_scheme:{asym_id:r,entity_id:r,mon_id:r,pdb_strand_id:r,ndb_seq_num:r,pdb_seq_num:r,auth_seq_num:r,pdb_mon_id:r,auth_mon_id:r,pdb_ins_code:r},pdbx_database_related:{db_name:r,details:r,db_id:r,content_type:c(r)},pdbx_entity_nonpoly:{entity_id:r,comp_id:r,name:r},pdbx_chem_comp_synonyms:{name:r,comp_id:r,provenance:c(r)},pdbx_chem_comp_identifier:{comp_id:r,identifier:r,type:c(r),program:r,program_version:r},pdbx_unobs_or_zero_occ_residues:{id:t,polymer_flag:c(O),occupancy_flag:c(t),PDB_model_num:t,auth_asym_id:r,auth_comp_id:r,auth_seq_id:r,PDB_ins_code:r,label_asym_id:r,label_comp_id:r,label_seq_id:t},pdbx_struct_mod_residue:{id:t,auth_asym_id:r,auth_comp_id:r,auth_seq_id:t,PDB_ins_code:r,label_asym_id:r,label_comp_id:r,label_seq_id:t,parent_comp_id:r,details:r},pdbx_struct_oper_list:{id:r,type:c(r),name:r,symmetry_operation:r,matrix:i(3,3),vector:v(3)},pdbx_struct_assembly:{method_details:r,oligomeric_details:r,oligomeric_count:t,details:r,id:r},pdbx_struct_assembly_gen:{asym_id_list:b(",",M=>M),assembly_id:r,oper_expression:r},pdbx_reference_entity_list:{prd_id:r,ref_entity_id:r,type:c(O),details:r,component_id:t},pdbx_reference_entity_link:{link_id:t,prd_id:r,details:r,ref_entity_id_1:r,ref_entity_id_2:r,entity_seq_num_1:t,entity_seq_num_2:t,comp_id_1:r,comp_id_2:r,atom_id_1:r,atom_id_2:r,value_order:c(O),component_1:t,component_2:t,link_class:c(r)},pdbx_reference_entity_poly_link:{link_id:t,prd_id:r,ref_entity_id:r,component_id:t,entity_seq_num_1:t,entity_seq_num_2:t,comp_id_1:r,comp_id_2:r,atom_id_1:r,atom_id_2:r,value_order:c(O)},pdbx_molecule:{prd_id:r,instance_id:t,asym_id:r},pdbx_molecule_features:{prd_id:r,class:c(O),type:c(O),name:r,details:r},entity_src_nat:{entity_id:r,pdbx_organism_scientific:r,pdbx_plasmid_name:r,pdbx_src_id:t,pdbx_beg_seq_num:t,pdbx_end_seq_num:t},entity_src_gen:{entity_id:r,pdbx_gene_src_gene:b(",",M=>M),pdbx_gene_src_scientific_name:r,plasmid_name:r,pdbx_src_id:t,pdbx_beg_seq_num:t,pdbx_end_seq_num:t},pdbx_entity_src_syn:{organism_scientific:r,entity_id:r,pdbx_src_id:t,pdbx_beg_seq_num:t,pdbx_end_seq_num:t},pdbx_entity_branch_descriptor:{entity_id:r,descriptor:r,type:c(O),program:r,program_version:r,ordinal:t},pdbx_entity_instance_feature:{details:r,feature_type:c(r),auth_asym_id:r,asym_id:r,auth_seq_num:r,seq_num:t,comp_id:r,auth_comp_id:r,ordinal:t},pdbx_entity_branch_list:{entity_id:r,hetero:c(O),comp_id:r,num:t},pdbx_entity_branch_link:{link_id:t,details:r,entity_id:r,entity_branch_list_num_1:t,entity_branch_list_num_2:t,comp_id_1:r,comp_id_2:r,atom_id_1:r,leaving_atom_id_1:r,atom_stereo_config_1:c(O),atom_id_2:r,leaving_atom_id_2:r,atom_stereo_config_2:c(O),value_order:c(O)},pdbx_entity_branch:{entity_id:r,type:c(r)},pdbx_branch_scheme:{entity_id:r,hetero:c(O),asym_id:r,mon_id:r,num:t,pdb_asym_id:r,pdb_seq_num:r,pdb_mon_id:r,auth_asym_id:r,auth_seq_num:r,auth_mon_id:r},pdbx_chem_comp_related:{comp_id:r,related_comp_id:r,relationship_type:c(r),details:r},ihm_starting_model_details:{starting_model_id:r,entity_id:r,entity_description:r,asym_id:r,entity_poly_segment_id:t,starting_model_source:c(r),starting_model_auth_asym_id:r,starting_model_sequence_offset:t,dataset_list_id:t},ihm_starting_comparative_models:{id:t,starting_model_id:r,starting_model_auth_asym_id:r,starting_model_seq_id_begin:t,starting_model_seq_id_end:t,template_auth_asym_id:r,template_seq_id_begin:t,template_seq_id_end:t,template_sequence_identity:A,template_sequence_identity_denominator:c(t),template_dataset_list_id:t,alignment_file_id:t},ihm_starting_model_seq_dif:{id:t,entity_id:r,asym_id:r,seq_id:t,comp_id:r,starting_model_id:r,db_asym_id:r,db_seq_id:t,db_comp_id:r,details:r},ihm_model_representation:{id:t,name:r,details:r},ihm_model_representation_details:{id:t,representation_id:t,entity_poly_segment_id:t,entity_id:r,entity_description:r,entity_asym_id:r,model_object_primitive:c(r),starting_model_id:r,model_mode:c(r),model_granularity:c(r),model_object_count:t},ihm_struct_assembly_details:{id:t,assembly_id:t,parent_assembly_id:t,entity_description:r,entity_id:r,asym_id:r,entity_poly_segment_id:t},ihm_struct_assembly:{id:t,name:r,description:r},ihm_modeling_protocol:{id:t,num_steps:t,protocol_name:r},ihm_modeling_protocol_details:{id:t,protocol_id:t,step_id:t,struct_assembly_id:t,dataset_group_id:t,struct_assembly_description:r,step_name:r,step_method:r,num_models_begin:t,num_models_end:t,multi_scale_flag:c(O),multi_state_flag:c(O),ordered_flag:c(O),script_file_id:t,software_id:t},ihm_multi_state_modeling:{state_id:t,state_group_id:t,population_fraction:A,population_fraction_sd:A,state_type:r,state_name:r,experiment_type:c(r),details:r},ihm_modeling_post_process:{id:t,protocol_id:t,analysis_id:t,step_id:t,type:c(r),feature:c(r),num_models_begin:t,num_models_end:t},ihm_ensemble_info:{ensemble_id:t,ensemble_name:r,post_process_id:t,model_group_id:t,ensemble_clustering_method:c(r),ensemble_clustering_feature:c(r),num_ensemble_models:t,num_ensemble_models_deposited:t,ensemble_precision_value:A,ensemble_file_id:t},ihm_model_list:{model_id:t,model_name:r,assembly_id:t,protocol_id:t,representation_id:t},ihm_model_group:{id:t,name:r,details:r},ihm_model_group_link:{model_id:t,group_id:t},ihm_model_representative:{id:t,model_group_id:t,model_id:t,selection_criteria:c(r)},ihm_dataset_list:{id:t,data_type:c(r),database_hosted:c(O)},ihm_dataset_group:{id:t,name:r,application:c(r),details:r},ihm_dataset_group_link:{dataset_list_id:t,group_id:t},ihm_related_datasets:{dataset_list_id_derived:t,dataset_list_id_primary:t},ihm_dataset_related_db_reference:{id:t,dataset_list_id:t,db_name:c(r),accession_code:r,version:r,details:r},ihm_external_reference_info:{reference_id:t,reference_provider:r,reference_type:c(r),reference:r,refers_to:c(r),associated_url:r},ihm_external_files:{id:t,reference_id:t,file_path:r,content_type:c(r),file_size_bytes:A,details:r},ihm_dataset_external_reference:{id:t,dataset_list_id:t,file_id:t},ihm_localization_density_files:{id:t,file_id:t,ensemble_id:t,entity_id:r,entity_poly_segment_id:t,asym_id:r},ihm_predicted_contact_restraint:{id:t,group_id:t,entity_id_1:r,entity_id_2:r,asym_id_1:r,asym_id_2:r,comp_id_1:r,comp_id_2:r,seq_id_1:t,seq_id_2:t,rep_atom_1:c(r),rep_atom_2:c(r),distance_lower_limit:A,distance_upper_limit:A,probability:A,restraint_type:c(r),model_granularity:c(r),dataset_list_id:t,software_id:t},ihm_cross_link_list:{id:t,group_id:t,entity_description_1:r,entity_description_2:r,entity_id_1:r,entity_id_2:r,comp_id_1:r,comp_id_2:r,seq_id_1:t,seq_id_2:t,linker_type:c(r),dataset_list_id:t},ihm_cross_link_restraint:{id:t,group_id:t,entity_id_1:r,entity_id_2:r,asym_id_1:r,asym_id_2:r,comp_id_1:r,comp_id_2:r,seq_id_1:t,seq_id_2:t,atom_id_1:r,atom_id_2:r,restraint_type:c(r),conditional_crosslink_flag:c(r),model_granularity:c(r),distance_threshold:A,psi:A,sigma_1:A,sigma_2:A},ihm_cross_link_result_parameters:{id:t,restraint_id:t,model_id:t,psi:A,sigma_1:A,sigma_2:A},ihm_2dem_class_average_restraint:{id:t,dataset_list_id:t,number_raw_micrographs:t,pixel_size_width:A,pixel_size_height:A,image_resolution:A,image_segment_flag:c(O),number_of_projections:t,struct_assembly_id:t,details:r},ihm_2dem_class_average_fitting:{id:t,restraint_id:t,model_id:t,cross_correlation_coefficient:A,rot_matrix:i(3,3),tr_vector:v(3)},ihm_3dem_restraint:{id:t,dataset_list_id:t,model_id:t,struct_assembly_id:t,fitting_method:r,number_of_gaussians:t,cross_correlation_coefficient:A},ihm_sas_restraint:{id:t,dataset_list_id:t,model_id:t,struct_assembly_id:t,profile_segment_flag:c(O),fitting_atom_type:r,fitting_method:r,fitting_state:c(r),radius_of_gyration:A,chi_value:A,details:r},ihm_starting_model_coord:{ordinal_id:t,starting_model_id:r,group_PDB:c(r),id:t,type_symbol:r,entity_id:r,atom_id:r,comp_id:r,seq_id:t,asym_id:r,Cartn_x:A,Cartn_y:A,Cartn_z:A,B_iso_or_equiv:A},ihm_sphere_obj_site:{id:t,entity_id:r,seq_id_begin:t,seq_id_end:t,asym_id:r,Cartn_x:A,Cartn_y:A,Cartn_z:A,object_radius:A,rmsf:A,model_id:t},ihm_gaussian_obj_site:{id:t,entity_id:r,seq_id_begin:t,seq_id_end:t,asym_id:r,mean_Cartn_x:A,mean_Cartn_y:A,mean_Cartn_z:A,weight:A,covariance_matrix:i(3,3),model_id:t},ihm_gaussian_obj_ensemble:{id:t,entity_id:r,seq_id_begin:t,seq_id_end:t,asym_id:r,mean_Cartn_x:A,mean_Cartn_y:A,mean_Cartn_z:A,weight:A,covariance_matrix:i(3,3),ensemble_id:t},ihm_feature_list:{feature_id:t,feature_type:c(r),entity_type:c(r)},ihm_poly_residue_feature:{ordinal_id:t,feature_id:t,entity_id:r,asym_id:r,comp_id_begin:r,comp_id_end:r,seq_id_begin:t,seq_id_end:t},ihm_derived_distance_restraint:{id:t,group_id:t,feature_id_1:t,feature_id_2:t,group_conditionality:c(r),random_exclusion_fraction:A,distance_upper_limit:A,restraint_type:c(r),dataset_list_id:t},ma_model_list:{ordinal_id:t,model_id:t,model_group_id:t,model_name:r,model_group_name:r,model_type:c(r),data_id:t},ma_target_entity:{entity_id:r,data_id:t,origin:c(r)},ma_target_entity_instance:{asym_id:r,entity_id:r,details:r},ma_target_ref_db_details:{target_entity_id:r,db_name:c(r),db_code:r,db_accession:r,seq_db_isoform:r,seq_db_align_begin:r,seq_db_align_end:r,ncbi_taxonomy_id:r,organism_scientific:r},ma_data:{id:t,content_type:c(r),content_type_other_details:r,name:r},ma_software_group:{ordinal_id:t,group_id:t,software_id:t},ma_qa_metric:{id:t,name:r,type:c(r),mode:c(r),software_group_id:t},ma_qa_metric_global:{ordinal_id:t,model_id:t,metric_id:t,metric_value:A},ma_qa_metric_local:{ordinal_id:t,model_id:t,label_asym_id:r,label_seq_id:t,label_comp_id:r,metric_id:t,metric_value:A}}},3656:(tn,Ue,n)=>{"use strict";n.d(Ue,{E7:()=>t,Yb:()=>y,do:()=>r,k5:()=>A});var e=n(6651),o=n(2025);function r(c){return function(i){return t(c,i)}}function t(c,i){const{data:v,indices:O,count:b}=c,{valueType:_}=i,M="str"===_?I=>v.substring(O[2*I],O[2*I+1]):"int"===_?I=>(0,o.H9)(v,O[2*I],O[2*I+1])||0:I=>(0,o.sS)(v,O[2*I],O[2*I+1])||0;return{schema:i,__array:void 0,isDefined:!0,rowCount:b,value:M,valueKind:I=>0,toArray:I=>e.iu.createAndFillArray(b,M,I),areValuesEqual:A(c)}}function A(c){const{data:i,indices:v}=c;return function(O,b){const _=v[2*O],M=v[2*b],I=v[2*O+1]-_;if(I!==v[2*b+1]-M)return!1;for(let l=0;l{"use strict";function e(O,b,_){for(;b<_&&32===O.charCodeAt(b);)b++;return o(O,b,_)}function o(O,b,_){let M=b,I=0,l=1;for(45===O.charCodeAt(M)?(l=-1,++M):43===O.charCodeAt(M)&&++M;M<_;M++){const m=O.charCodeAt(M)-48;if(m>9||m<0)return l*I|0;I=10*I+m|0}return l*I}function r(O,b,_,M){return 43===b.charCodeAt(_)&&_++,O*Math.pow(10,o(b,_,M))}function t(O,b,_){for(;b<_&&32===O.charCodeAt(b);)b++;return A(O,b,_)}function A(O,b,_){let M=b,I=1,l=0,m=0,u=1;for(45===O.charCodeAt(M)?(I=-1,++M):43===O.charCodeAt(M)&&++M;M<_;){let d=O.charCodeAt(M)-48;if(!(d>=0&&d<10)){if(-2===d){for(++M;M<_;){if(d=O.charCodeAt(M)-48,!(d>=0&&d<10))return 53===d||21===d?r(I*(l+m/u),O,M+1,_):I*(l+m/u);m=10*m+d,u*=10,++M}return I*(l+m/u)}if(53===d||21===d)return r(I*l,O,M+1,_);break}l=10*l+d,++M}return I*l}n.d(Ue,{Al:()=>t,H9:()=>o,jj:()=>e,sS:()=>A})},5555:(tn,Ue,n)=>{"use strict";n.d(Ue,{_F:()=>r,qk:()=>t,tM:()=>A});var A,e=n(467),o=n(4824);function r(y){return{data:y,position:0,length:y.length,lineNumber:1,tokenStart:0,tokenEnd:0}}function t(y,c,i){let v=c,O=i-1,b=y.charCodeAt(v);for(;(9===b||32===b)&&v<=O;)b=y.charCodeAt(++v);for(b=y.charCodeAt(O);(9===b||32===b)&&O>=v;)b=y.charCodeAt(--O);return y.substring(v,O+1)}!function(y){function c(f){return f.data.substring(f.tokenStart,f.tokenEnd)}function v(f){const{data:p}=f;for(;f.position{const V=Math.min(p-w,Q);return I(G,V,L),w+=V,V},(Q,G)=>Q.update({message:"Parsing...",current:G.position,max:G.length})),L})).apply(this,arguments)}function a(){return(a=(0,e.A)(function*(f,p,E=1e5){const T=y(f),L=A.create(T.data,Math.max(f.length/80,2));return yield(0,o.yB)(p,E,T,(w,Q)=>(function C(f,p,E){let T=0;for(let L=0;Lw.update({message:"Parsing...",current:Q.position,max:Q.length})),L})).apply(this,arguments)}function R(f,p,E){const{data:T}=f;let L=p,w=E-1,Q=T.charCodeAt(L);for(;(9===Q||32===Q)&&L<=w;)Q=T.charCodeAt(++L);for(Q=T.charCodeAt(w);(9===Q||32===Q)&&w>=L;)Q=T.charCodeAt(--w);return f.tokenStart=L,f.tokenEnd=w+1,f.position=E,f}y.getTokenString=c,y.reset=function i(f){f.position=0,f.lineNumber=1,f.tokenStart=0,f.tokenEnd=0},y.eatLine=v,y.markStart=function O(f){f.tokenStart=f.position},y.markLine=b,y.readLine=function _(f){return b(f),c(f)},y.readLineTrim=function M(f){b(f);const p=f.position;return R(f,f.tokenStart,f.tokenEnd),f.position=p,c(f)},y.markLines=function l(f,p){const E=A.create(f.data,2*p);return I(f,p,E),E},y.readLines=function m(f,p){const E=[];for(let T=0;Tl.indicesLenMinus2&&function c(_){const M=new Uint32Array(1.61*_.indices.length|0);M.set(_.indices),_.indices=M,_.indicesLenMinus2=M.length-2|0}(l),l.indices[l.offset++]=M,l.indices[l.offset++]=I,_.count++}y.add=i,y.addToken=function v(_,M){i(_,M.tokenStart,M.tokenEnd)},y.addUnchecked=function O(_,M,I){_.indices[_.offset++]=M,_.indices[_.offset++]=I,_.count++},y.create=function b(_,M){return{data:_,indicesLenMinus2:(M=Math.max(10,M))-2|0,count:0,offset:0,indices:new Uint32Array(M)}}}(A||(A={}))},355:(tn,Ue,n)=>{"use strict";var e;n.d(Ue,{H:()=>e}),function(o){o.error=function r(c,i=-1){return new A(c,i)},o.success=function t(c,i=[]){return new y(c,i)};class A{toString(){return this.line>=0?`[Line ${this.line}] ${this.message}`:this.message}constructor(i,v){this.message=i,this.line=v,this.isError=!0}}o.Error=A;class y{constructor(i,v){this.result=i,this.warnings=v,this.isError=!1}}o.Success=y}(e||(e={}))},7421:(tn,Ue,n)=>{"use strict";n.d(Ue,{c:()=>Z});var A,y,q,c,e=n(9115),o=n(862),r=n(144),t=n(1372);function i(q){return(Y,ee)=>ee[q].value(Y)}function v(q){return(Y,ee)=>ee[q].value(Y).join(ee[q].schema.separator)}function O(q,...Y){return(ee,g)=>g[q].schema.space.get(g[q].value(ee),...Y)}function b(q){return(Y,ee)=>ee[q].valueKind(Y)}function _(q,Y){const ee=[],_e=b(q);if(1===Y.rank){const xe=Y.dimensions[0];for(let le=0;le 3 or rank 0 are currently not supported.");{const xe=Y.dimensions[0],le=Y.dimensions[1],Ae=Y.dimensions[2];for(let Be=0;Be!!Y.shouldInclude)?q.fields.filter(Y=>!Y.shouldInclude||q.source.some(ee=>Y.shouldInclude(ee.data))):q.fields}function C(q,Y){const ee=q.instance(Y),g=ee.source.filter(le=>le.rowCount>0);return g.length?{instance:ee,rowCount:g.reduce((le,Ae)=>le+Ae.rowCount,0),source:g.map(le=>({data:le.data,keys:()=>le.keys?le.keys():o.f.Range(0,le.rowCount-1),rowCount:le.rowCount}))}:{instance:ee,rowCount:0,source:[]}}!function(q){function ee(Ae,Be,Ce){return{name:Ae,type:1,value:Be,valueKind:Ce&&Ce.valueKind,defaultFormat:Ce?{encoder:Ce.encoder,typedArray:Ce.typedArray}:void 0,shouldInclude:Ce&&Ce.shouldInclude}}q.str=function Y(Ae,Be,Ce){return{name:Ae,type:0,value:Be,valueKind:Ce&&Ce.valueKind,defaultFormat:Ce&&Ce.encoder?{encoder:Ce.encoder}:void 0,shouldInclude:Ce&&Ce.shouldInclude}},q.int=ee,q.float=function g(Ae,Be,Ce){return{name:Ae,type:2,value:Be,valueKind:Ce&&Ce.valueKind,defaultFormat:Ce?{encoder:Ce.encoder,typedArray:Ce.typedArray,digitCount:typeof Ce.digitCount<"u"?Ce.digitCount:void 0}:void 0,shouldInclude:Ce&&Ce.shouldInclude}},q.index=function _e(Ae){return ee(Ae,(Be,Ce,Re)=>Re+1,{typedArray:Int32Array,encoder:r.ND.by(r.ND.delta).and(r.ND.runLength).and(r.ND.integerPacking)})};class xe{constructor(){this.fields=[]}index(Be){return this.fields.push(q.index(Be)),this}str(Be,Ce,Re){return this.fields.push(q.str(Be,Ce,Re)),this}int(Be,Ce,Re){return this.fields.push(q.int(Be,Ce,Re)),this}vec(Be,Ce,Re){for(let ke=0;keCe.split(".")[0]);return{includeCategory:Ce=>!xe.includes(Ce)&&(_e.length<=0||-1!==_e.indexOf(Ce)),includeField(Ce,Re){const ke=Ce+"."+Re;return!Ae.includes(ke)&&(!Be.includes(Ce)||le.includes(ke))}}},q.DefaultFilter={includeCategory:g=>!0,includeField:(g,_e)=>!0},q.DefaultFormatter={getFormat(g,_e){}},q.ofTable=function ee(g,_e){return _e?{fields:M(g._schema),source:[{data:g,rowCount:_e.length,keys:()=>o.f.Array(_e)}]}:{fields:M(g._schema),source:[{data:g,rowCount:g._rowCount}]}},function(q){function Y(g,_e,xe){g.startDataBlock(_e);for(const le of xe._tableNames)g.writeCategory({name:le,instance:()=>y.ofTable(xe[le])})}q.writeDatabase=Y,q.writeDatabaseCollection=function ee(g,_e){for(const xe of Object.keys(_e))Y(g,xe,_e[xe])}}(c||(c={})),n(6651),n(3543),n(8382),n(9677);class h{constructor(){this.builder=e.f.create(),this.encoded=!1,this.dataBlockCreated=!1,this.filter=y.DefaultFilter,this.formatter=y.DefaultFormatter,this.isBinary=!1,this.binaryEncodingProvider=void 0}setFilter(Y){this.filter=Y||y.DefaultFilter}isCategoryIncluded(Y){return this.filter.includeCategory(Y)}setFormatter(Y){this.formatter=Y||y.DefaultFormatter}startDataBlock(Y){this.dataBlockCreated=!0,e.f.write(this.builder,`data_${(Y||"").replace(/[ \n\t]/g,"").toUpperCase()}\n#\n`)}writeCategory(Y,ee,g){if(this.encoded)throw new Error("The writer contents have already been encoded, no more writing.");if(!this.dataBlockCreated)throw new Error("No data block created.");if(!g?.ignoreFilter&&!this.filter.includeCategory(Y.name))return;const{instance:_e,rowCount:xe,source:le}=C(Y,ee);xe&&(1===xe?function D(q,Y,ee,g,_e,xe){const le=s(Y),Ae=ee[0],Be=Ae.data;let Ce=le.reduce((Oe,Se)=>_e.includeField(q.name,Se.name)?Math.max(Oe,Se.name.length):0,0);if(0===Ce)return;Ce+=q.name.length+6;const ke=Ae.keys().move(),we=S(q.name,Y.fields,xe);for(let Oe=0;Oe_e.includeField(q.name,ke.name)),Be=Ae.length;if(0===Be)return;const Ce=S(q.name,Ae,xe);p(g,"loop_");for(let ke=0;ke=0}(Be)?(G(q,Be),!0):function Q(q,Y){if(!Y)return e.f.writeSafe(q,". "),!1;const ee=Y.charCodeAt(0);let g=!1,_e=0,xe=!1,le=!1;for(let Ae=0,Be=Y.length-1;Ae<=Be;Ae++)switch(Y.charCodeAt(Ae)){case 9:case 32:g=!0;break;case 10:return G(q,Y),!0;case 34:if(Ae&&Ae===Be)break;if(xe)return G(q,Y),!0;le=!0,g=!0,_e=0;break;case 39:if(Ae&&Ae===Be)break;if(le)return G(q,Y),!0;xe=!0,g=!0,_e=1}return!g&&(35===ee||36===ee||59===ee||91===ee||93===ee||95===ee)&&(g=!0),g?(e.f.writeSafe(q,_e?'"':"'"),e.f.writeSafe(q,Y),e.f.writeSafe(q,_e?'" ':"' ")):(e.f.writeSafe(q,Y),e.f.writeSafe(q," ")),!1}(q,Be);1===Ce?function E(q,Y){e.f.writeInteger(q,Y),e.f.whitespace1(q)}(q,Be):function T(q,Y,ee){e.f.writeFloat(q,Y,ee),e.f.whitespace1(q)}(q,Be,_e)}return!1}function S(q,Y,ee){const g=[];for(const _e of Y){const xe=ee.getFormat(q,_e.name);g[g.length]=xe&&typeof xe.digitCount<"u"?2===_e.type?Math.pow(10,Math.max(0,Math.min(xe.digitCount,15))):0:2===_e.type?Math.pow(10,d(_e)):0}return g}function p(q,Y){e.f.write(q,Y),e.f.newline(q)}function G(q,Y){e.f.writeSafe(q,"\n;"+Y),e.f.writeSafe(q,"\n;\n")}var V=n(275);function U(q){const Y=new ArrayBuffer(N(q)),ee=new DataView(Y),g=new Uint8Array(Y);return k(q,ee,g,0),g}function N(q){const Y=typeof q;if("string"===Y){const ee=(0,V.VH)(q);if(ee<32)return 1+ee;if(ee<256)return 2+ee;if(ee<65536)return 3+ee;if(ee<4294967296)return 5+ee}if(q instanceof Uint8Array){const ee=q.byteLength;if(ee<256)return 2+ee;if(ee<65536)return 3+ee;if(ee<4294967296)return 5+ee}if("number"===Y){if(Math.floor(q)!==q)return 9;if(q>=0){if(q<128)return 1;if(q<256)return 2;if(q<65536)return 3;if(q<4294967296)return 5;throw new Error("Number too big 0x"+q.toString(16))}if(q>=-32)return 1;if(q>=-128)return 2;if(q>=-32768)return 3;if(q>=-2147483648)return 5;throw new Error("Number too small -0x"+q.toString(16).substr(1))}if("boolean"===Y||null==q)return 1;if("object"===Y){let ee,g=0;if(Array.isArray(q)){ee=q.length;for(let _e=0;_e=0){if(q<128)return Y.setUint8(g,q),1;if(q<256)return Y.setUint8(g,204),Y.setUint8(g+1,q),2;if(q<65536)return Y.setUint8(g,205),Y.setUint16(g+1,q),3;if(q<4294967296)return Y.setUint8(g,206),Y.setUint32(g+1,q),5;throw new Error("Number too big 0x"+q.toString(16))}if(q>=-32)return Y.setInt8(g,q),1;if(q>=-128)return Y.setUint8(g,208),Y.setInt8(g+1,q),2;if(q>=-32768)return Y.setUint8(g,209),Y.setInt16(g+1,q),3;if(q>=-2147483648)return Y.setUint8(g,210),Y.setInt32(g+1,q),5;throw new Error("Number too small -0x"+(-q).toString(16).substr(1))}if(null==q)return Y.setUint8(g,192),1;if("boolean"===_e)return Y.setUint8(g,q?195:194),1;if("object"===_e){let xe,le=0;const Ae=Array.isArray(q);let Be;if(Ae?xe=q.length:(Be=Object.keys(q),xe=Be.length),xe<16?(Y.setUint8(g,xe|(Ae?144:128)),le=1):xe<65536?(Y.setUint8(g,Ae?220:222),Y.setUint16(g+1,xe),le=3):xe<4294967296&&(Y.setUint8(g,Ae?221:223),Y.setUint32(g+1,xe),le=5),Ae)for(let Ce=0;Ce{"use strict";n.d(Ue,{RL:()=>O,ey:()=>d});const e=new ArrayBuffer(4);new Int32Array(e),new Float32Array(e);const A=new ArrayBuffer(4),y=new Int32Array(A),c=new Float32Array(A);function O(Se){return function i(Se){return y[0]=(1<<23)*((Se<-126?-126:Se)+126.94269504),c[0]}(1.44269504*Se)}const b=new ArrayBuffer(8);new Int32Array(b),new Float32Array(b);const l=new ArrayBuffer(4),m=new Int32Array(l),u=new Float32Array(l);function d(Se){return u[0]=Se,1.1920928955078125e-7*m[0]-126.94269504}Math,Math,Math,Math,Math,Math,Math,Math,Math;const k=new ArrayBuffer(16);new Int32Array(k),new Float32Array(k);const te=new ArrayBuffer(8);new Int32Array(te),new Float32Array(te);const xe=new ArrayBuffer(4);new Int32Array(xe),new Float32Array(xe),Math},5384:(tn,Ue,n)=>{"use strict";n.d(Ue,{n:()=>C.n,DJ:()=>d.D,Eh:()=>u.E,Q7:()=>m.Q,is:()=>l,O8:()=>I,f8:()=>s.f,JX:()=>t.J,oI:()=>r});var e=n(4369);function r(h,a,S){const D=new Float32Array(h);for(let R=0;R146&&++a,h>148&&++a,h>155&&++a,h>160&&++a,h>161&&++a,h>166&&++a,h>167&&++a,h-1+a}(h):i[h];return typeof a>"u"||typeof b[a]>"u"?-1:a}(D);if(p<0)return console.warn(`Unknown spacegroup '${D}', returning a 'P 1' with cellsize [1, 1, 1]`),h.Zero;const E=R[0]*R[1]*R[2],T=f[0],L=f[1],w=f[2],Q=R[0],G=R[1],V=R[2],U=Math.cos(L),N=(Math.cos(T)-Math.cos(L)*Math.cos(w))/Math.sin(w),k=Math.sqrt(1-U*U-N*N),H=[Q,0,0],$=[Math.cos(w)*G,Math.sin(w)*G,0],J=[U*V,N*V,k*V],W=e.$I.ofRows([[H[0],$[0],J[0],0],[0,$[1],J[1],0],[0,0,J[2],0],[0,0,0,1]]);return{index:p,size:R,volume:E,anglesInRadians:f,toFractional:e.$I.invert(e.$I.zero(),W),fromFractional:W}}h.Zero=S("P 1",e.eB.create(1,1,1),e.eB.create(Math.PI/2,Math.PI/2,Math.PI/2)),h.isZero=function a(D){return!D||0===D.index&&1===D.size[0]&&1===D.size[1]&&1===D.size[1]},h.create=S}(I||(I={})),function(h){function a(k){const H=c[k.index].map(W=>function Q(k){return e.$I.ofRows([A[k[0]],A[k[1]],A[k[2]],[0,0,0,1]])}(y[W]));return{name:b[k.index],num:_[k.index],cell:k,operators:H}}h.ZeroP1=a(I.Zero),h.create=a;const S=(0,e.eB)(),D=(0,e.$I)();function R(k,H,$,J,W,te){return e.eB.set(S,$,J,W),e.$I.fromTranslation(D,S),e.$I.mul(te,e.$I.mul(te,e.$I.mul(te,k.cell.fromFractional,D),k.operators[H]),k.cell.toFractional)}h.setOperatorMatrix=R,h.getSymmetryOperator=function f(k,H,$,J,W){const te=R(k,H,$,J,W,e.$I.zero());return t.J.create(`${H+1}_${5+$}${5+J}${5+W}`,te,{hkl:e.eB.create($,J,W),spgrOp:H})};const p=(0,e.eB)(),E=(0,e.eB)(),T=(0,e.eB)(),L=(0,e.eB)();function V(k,H,$){const J=[];if(k>0?J.push("+X"):k<0&&J.push("-X"),H>0?J.push("+Y"):H<0&&J.push("-Y"),$>0?J.push("+Z"):$<0&&J.push("-Z"),1===J.length)return"+"===J[0].charAt(0)?J[0].substr(1):J[0];if(2===J.length){const W=J[0].charAt(0),te=J[1].charAt(0);if("+"===W)return`${J[0].substr(1)}${J[1]}`;if("+"===te)return`${J[1].substr(1)}${J[0]}`}throw new Error(`unknown rotation '${J}', ${k} ${H} ${$}`)}function U(k){switch(k){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 N(k,H){return""===H?k:k.length>2?`${k}+${H}`:"-"===k.charAt(0)?`${H}${k}`:`${H}+${k}`}h.getSymmetryOperatorRef=function w(k,H,$,J,W,te){const de=e.$I.zero();e.eB.set(S,$,J,W),e.eB.floor(p,te),e.$I.copy(de,k.operators[H]),e.eB.floor(E,e.eB.transformMat4(E,te,de)),e.$I.getTranslation(L,de),e.eB.sub(L,L,E),e.eB.add(L,L,p),e.eB.add(L,L,S),e.$I.setTranslation(de,L),e.$I.mul(de,k.cell.fromFractional,de),e.$I.mul(de,de,k.cell.toFractional),e.eB.sub(T,E,p);const ye=$-T[0],j=J-T[1],Z=W-T[2];return t.J.create(`${H+1}_${5+ye}${5+j}${5+Z}`,de,{hkl:e.eB.create(ye,j,Z),spgrOp:H})},h.getOperatorXyz=function G(k){return[N(V(k[0],k[4],k[8]),U(k[12])),N(V(k[1],k[5],k[9]),U(k[13])),N(V(k[2],k[6],k[10]),U(k[14]))].join(",")}}(l||(l={}));var m=n(654),u=n(9307),d=n(6642),s=n(8184),C=n(5560)},7136:(tn,Ue,n)=>{"use strict";n.d(Ue,{Z:()=>v});var e=n(2086),o=n(6290),r=n(5384),t=n(6642);const A=e.e.dot,y=e.e.copy,c=e.e.scaleAndSub,i=e.e.scaleAndAdd;class v{computeExtrema(d,s){const C=A(this.dir[d],s);Cthis.maxDist[d]&&(this.maxDist[d]=C,y(this.extrema[2*d+1],s))}computeSphereExtrema(d,s,C){const h=this.dir[d],a=A(h,s);a-Cthis.maxDist[d]&&(this.maxDist[d]=a+C,i(this.extrema[2*d+1],s,h,C))}includeSphere(d){if(r.f8.hasExtrema(d)&&d.extrema.length>1)for(const s of d.extrema)this.includePosition(s);else this.includePositionRadius(d.center,d.radius)}includePosition(d){for(let s=0;s1)for(const s of d.extrema)this.radiusPosition(s);else this.radiusPositionRadius(d.center,d.radius)}radiusPosition(d){this.centroidHelper.radiusStep(d)}radiusPositionRadius(d,s){this.centroidHelper.radiusSphereStep(d,s)}getSphere(d){return r.f8.setExtrema(this.centroidHelper.getSphere(d),this.extrema.slice())}getBox(d){return t.D.fromVec3Array(d||(0,t.D)(),this.extrema)}reset(){for(let d=0;d{const C=e.e.create(s[0],s[1],s[2]);return e.e.normalize(C,C)})}(d),this.dirLength=this.dir.length,this.reset()}}const b=[[1,0,0],[0,1,0],[0,0,1]],_=[[1,1,1],[-1,1,1],[-1,-1,1],[1,-1,1]],M=[[1,1,0],[1,-1,0],[1,0,1],[1,0,-1],[0,1,1],[0,1,-1]],I=[[0,1,2],[0,2,1],[1,0,2],[2,0,1],[1,2,0],[2,1,0],[0,1,-2],[0,2,-1],[1,0,-2],[2,0,-1],[1,-2,0],[2,-1,0]],l=[[1,1,2],[2,1,1],[1,2,1],[1,-1,2],[1,1,-2],[1,-1,-2],[2,-1,1],[2,1,-1],[2,-1,-1],[1,-2,1],[1,2,-1],[1,-2,-1]],m=[[2,2,1],[1,2,2],[2,1,2],[2,-2,1],[2,2,-1],[2,-2,-1],[1,-2,2],[1,2,-2],[1,-2,-2],[2,-1,2],[2,1,-2],[2,-1,-2]]},9535:(tn,Ue,n)=>{"use strict";n.d(Ue,{b:()=>v,r:()=>b});var e=n(4369),o=n(3543),r=n(7136),t=n(5384);const A=e.eB.set,y=new r.Z("14"),c=new r.Z("98");function v(_){const M=t.DJ.computeBounding(_);return{box:M,sphere:t.f8.fromBox3D((0,t.f8)(),M)}}const O=(0,e.eB)();function b(_){const{x:M,y:I,z:l,radius:m,indices:u}=_,d=o.CD.size(u);if(d>25e4)return v(_);const s=function i(_){return _>1e4?y:c}(d);s.reset();for(let h=0;h{"use strict";n.d(Ue,{p:()=>y});var e=n(2086),o=n(8184);const r=e.e.add,t=e.e.squaredDistance,A=e.e.distance;class y{reset(){e.e.set(this.center,0,0,0),this.radiusSq=0,this.count=0}includeStep(i){r(this.center,this.center,i),this.count++}finishedIncludeStep(){0!==this.count&&e.e.scale(this.center,this.center,1/this.count)}radiusStep(i){const v=t(i,this.center);v>this.radiusSq&&(this.radiusSq=v)}radiusSphereStep(i,v){const O=A(i,this.center)+v,b=O*O;b>this.radiusSq&&(this.radiusSq=b)}getSphere(i){return i||(i=(0,o.f)()),e.e.copy(i.center,this.center),i.radius=Math.sqrt(this.radiusSq),i}getCount(){return this.count}constructor(){this.count=0,this.center=(0,e.e)(),this.radiusSq=0}}!function(c){const i=new c,v=(0,e.e)(),O=(0,e.e)();c.fromArrays=function b({x:I,y:l,z:m},u){i.reset();const d=I.length;for(let s=0;s{"use strict";var e,o;n.d(Ue,{Q:()=>e}),(o=e||(e={})).add=function r(c,i,v){c.squaredDistances[c.count]=v,c.indices[c.count++]=i},o.reset=function t(c){c.count=0},o.create=function A(){return{count:0,indices:[],squaredDistances:[]}},o.copy=function y(c,i){for(let v=0;v{"use strict";n.d(Ue,{E:()=>y});var e=n(654),o=n(6642),r=n(4369),t=n(3543),A=n(8361);function y(h,a,S){return new c(h,a,S)}class c{find(a,S,D,R,f){this.ctx.x=a,this.ctx.y=S,this.ctx.z=D,this.ctx.radius=R,this.ctx.isCheck=!1;const p=f??this.result;return b(this.ctx,p),p}nearest(a,S,D,R=1,f,p){this.ctx.x=a,this.ctx.y=S,this.ctx.z=D,this.ctx.k=R,this.ctx.stopIf=f;const E=p??this.result;return function C(h,a){const{min:S,expandedBox:D,boundingSphere:{center:R},size:[f,p,E],bucketOffset:T,bucketCounts:L,bucketArray:w,grid:Q,data:{x:G,y:V,z:U,indices:N,radius:k},delta:H,maxRadius:$}=h.grid,{x:J,y:W,z:te,k:de,stopIf:ye}=h,j=t.CD.size(N);if(e.Q.reset(a),0===j||de<=0)return!1;let Z,q,Y,Re,ee=!1,g=1,_e=!0,xe=0,le=m,Ae=u,Be=0,Ce=!0,ke=!1;const we=d,Oe=$*$;le.length=0,we.length=0,I.clear(),s.clear(),r.eB.set(M,J,W,te),o.D.containsVec3(D,M)?(Z=Math.floor((J-S[0])/H[0]),q=Math.floor((W-S[1])/H[1]),Y=Math.floor((te-S[2])/H[2])):(o.D.nearestIntersectionWithRay(M,D,M,r.eB.normalize(_,r.eB.sub(_,R,M))),Z=Math.max(0,Math.min(f-1,Math.floor((M[0]-S[0])/H[0]))),q=Math.max(0,Math.min(p-1,Math.floor((M[1]-S[1])/H[1]))),Y=Math.max(0,Math.min(E-1,Math.floor((M[2]-S[2])/H[2]))));const Se=0!==$?Math.max(1,Math.min(f-1,Math.ceil($/H[0]))):1,Ve=0!==$?Math.max(1,Math.min(p-1,Math.ceil($/H[1]))):1,Ne=0!==$?Math.max(1,Math.min(E-1,Math.ceil($/H[2]))):1;for(le.push(Z,q,Y,(Z*p+q)*E+Y);a.count=Q.length;const be=Q[Re];if(0!==be){const Te=Be,ie=be-1,ue=T[ie],ve=ue+L[ie];for(let ce=ue;ceBe&&(Be=nt),s.insert(nt,se)}Te=f))for(let ie=-Ve;ie<=Ve;ie++){const ue=q+ie;if(!(ue<0||ue>=p))for(let re=-Ne;re<=Ne;re++){const ve=Y+re;if(!(ve<0||ve>=E||(Re=(Te*p+ue)*E+ve,l.has(Re)||(l.add(Re),I.has(Re))))){if(!_e){const ce=S[0]+Te*H[0]-J,se=S[1]+ue*H[1]-W,ae=S[2]+ve*H[2]-te;if(ce*ce+se*se+ae*ae-Oe>Be){we.push(Te,ue,ve,Re);continue}}Ae.push(Te,ue,ve,Re),xe++}}}}}if(_e=!1,0===xe){if(1===de){const ne=s.findMinimum();if(ne){const{key:be,value:Te}=ne;return e.Q.add(a,Te,be),!0}}else for(;!s.isEmpty()&&(ke||s.findMinimum().key<=Be)&&a.count=de||ee||a.count>=j)return a.count>0;if(_e=!0,Ce=!0,we.length>0){for(let ne=0,be=we.length;ne0){const V=Math.ceil(T/L),U=Math.pow(V/(f[0]*f[1]*f[2]),1/3);E=[Math.ceil(f[0]*U),Math.ceil(f[1]*U),Math.ceil(f[2]*U)],p=[f[0]/E[0],f[1]/E[1],f[2]/E[2]]}else p=f,E=[1,1,1];return function i(h){const{expandedBox:a,size:[S,D,R],data:{x:f,y:p,z:E,radius:T,indices:L},elementCount:w,delta:Q}=h,G=S*D*R,{min:[V,U,N]}=a;let k=0,H=0;const $=new Uint32Array(G),J=new Int32Array(w);for(let j=0;jk&&(k=T[Z])}const W=new Int32Array(H);for(let j=0,Z=0;j0&&($[j]=Z+1,W[Z]=q,Z+=1)}const te=new Uint32Array(H);for(let j=1;j0){const q=Z-1;ye[te[q]+de[q]]=j,de[q]+=1}}return{size:h.size,bucketArray:ye,bucketCounts:W,bucketOffset:te,grid:$,delta:Q,min:h.expandedBox.min,data:h.data,maxRadius:k,expandedBox:h.expandedBox,boundingBox:h.boundingBox,boundingSphere:h.boundingSphere}}({size:E,data:{x:h.x,y:h.y,z:h.z,indices:R,radius:h.radius},expandedBox:D,boundingBox:a.box,boundingSphere:a.sphere,elementCount:T,delta:p})}(a,S,D);this.ctx=function O(h){return{grid:h,x:.1,y:.1,z:.1,k:1,stopIf:void 0,radius:.1,isCheck:!1}}(R),this.boundary={box:R.boundingBox,sphere:R.boundingSphere},this.buckets={offset:R.bucketOffset,count:R.bucketCounts,array:R.bucketArray},this.result=e.Q.create()}}function b(h,a){const{min:S,size:[D,R,f],bucketOffset:p,bucketCounts:E,bucketArray:T,grid:L,data:{x:w,y:Q,z:G,indices:V,radius:U},delta:N,maxRadius:k}=h.grid,{radius:H,isCheck:$,x:J,y:W,z:te}=h,de=H+k,ye=de*de;e.Q.reset(a);const j=Math.max(0,Math.floor((J-de-S[0])/N[0])),Z=Math.max(0,Math.floor((W-de-S[1])/N[1])),q=Math.max(0,Math.floor((te-de-S[2])/N[2])),Y=Math.min(D-1,Math.floor((J+de-S[0])/N[0])),ee=Math.min(R-1,Math.floor((W+de-S[1])/N[1])),g=Math.min(f-1,Math.floor((te+de-S[2])/N[2]));if(j>Y||Z>ee||q>g)return!1;for(let _e=j;_e<=Y;_e++)for(let xe=Z;xe<=ee;xe++)for(let le=q;le<=g;le++){const Ae=L[(_e*R+xe)*f+le];if(0===Ae)continue;const Be=Ae-1,Ce=p[Be],ke=Ce+E[Be];for(let we=Ce;we0&&Math.sqrt(K)-U[Oe]>H)continue;if($)return!0;e.Q.add(a,T[we],K)}}}return a.count>0}const _=(0,r.eB)(),M=(0,r.eB)(),I=new Set,l=new Set,m=[.1],u=[.1],d=[.1],s=new A.h},5560:(tn,Ue,n)=>{"use strict";n.d(Ue,{n:()=>o});var e=n(4369);function o(){return o.empty()}!function(r){function A(){return{origin:(0,e.eB)(),dirA:(0,e.eB)(),dirB:(0,e.eB)(),dirC:(0,e.eB)()}}function y(l,m){return e.eB.copy(l.origin,m.origin),e.eB.copy(l.dirA,m.dirA),e.eB.copy(l.dirB,m.dirB),e.eB.copy(l.dirC,m.dirC),l}function i(l,m){return e.eB.set(l,2*e.eB.magnitude(m.dirA),2*e.eB.magnitude(m.dirB),2*e.eB.magnitude(m.dirC))}r.create=function t(l,m,u,d){return{origin:l,dirA:m,dirB:u,dirC:d}},r.empty=A,r.copy=y,r.clone=function c(l){return y(A(),l)},r.size=i;const v=(0,e.eB)();r.volume=function O(l){return i(v,l),v[0]*v[1]*v[2]},r.normalize=function b(l,m){return e.eB.copy(l.origin,m.origin),e.eB.normalize(l.dirA,m.dirA),e.eB.normalize(l.dirB,m.dirB),e.eB.normalize(l.dirC,m.dirC),l};const _=(0,e.U)();r.transform=function M(l,m,u){e.eB.transformMat4(l.origin,m.origin,u);const d=e.U.directionTransform(_,u);return e.eB.transformMat3(l.dirA,m.dirA,d),e.eB.transformMat3(l.dirB,m.dirB,d),e.eB.transformMat3(l.dirC,m.dirC,d),l},r.scale=function I(l,m,u){return e.eB.scale(l.dirA,m.dirA,u),e.eB.scale(l.dirB,m.dirB,u),e.eB.scale(l.dirC,m.dirC,u),l}}(o||(o={}))},6642:(tn,Ue,n)=>{"use strict";n.d(Ue,{D:()=>t});var e=n(3543),o=n(8184),r=n(2086);function t(){return t.zero()}!function(A){function c(){return{min:(0,r.e)(),max:(0,r.e)()}}function i(L,w){return r.e.copy(L.min,w.min),r.e.copy(L.max,w.max),L}A.create=function y(L,w){return{min:L,max:w}},A.zero=c,A.copy=i,A.clone=function v(L){return i(c(),L)};const O=(0,r.e)();function _(L,w){for(let Q=0,G=w.length;Q=14?M(L,w.extrema):(r.e.set(O,w.radius,w.radius,w.radius),r.e.sub(L.min,w.center,O),r.e.add(L.max,w.center,O),L)},A.addVec3Array=_,A.fromVec3Array=M,A.addSphere3D=function I(L,w){return o.f.hasExtrema(w)&&w.extrema.length>=14?_(L,w.extrema):(h(L,r.e.subScalar(O,w.center,w.radius)),h(L,r.e.addScalar(O,w.center,w.radius)),L)},A.intersectsSphere3D=function l(L,w){return r.e.clamp(O,w.center,L.min,L.max),r.e.squaredDistance(O,w.center)<=w.radius*w.radius},A.computeBounding=function m(L){const w=r.e.create(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),Q=r.e.create(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),{x:G,y:V,z:U,indices:N}=L;for(let k=0,H=e.CD.size(N);kL.max[0]||w[1]L.max[1]||w[2]L.max[2])},A.overlaps=function p(L,w){return!(L.max[0]w.max[0]||L.max[1]w.max[1]||L.max[2]w.max[2])},A.containsSphere3D=function E(L,w){const Q=w.center,G=w.radius;return!(Q[0]-GL.max[0]||Q[1]-GL.max[1]||Q[2]-GL.max[2])},A.nearestIntersectionWithRay=function T(L,w,Q,G){const[V,U,N]=w.min,[k,H,$]=w.max,[J,W,te]=Q,de=1/G[0],ye=1/G[1],j=1/G[2];let Z,q,Y,ee,g,_e;return de>=0?(Z=(V-J)*de,q=(k-J)*de):(Z=(k-J)*de,q=(V-J)*de),ye>=0?(Y=(U-W)*ye,ee=(H-W)*ye):(Y=(H-W)*ye,ee=(U-W)*ye),j>=0?(g=(N-te)*j,_e=($-te)*j):(g=($-te)*j,_e=(N-te)*j),Y>Z&&(Z=Y),eeZ&&(Z=g),_e{"use strict";n.d(Ue,{Q:()=>r});var e=n(2086),o=n(9457);function r(){return r.create((0,o.i)(),(0,o.i)(),(0,o.i)(),(0,o.i)(),(0,o.i)(),(0,o.i)())}!function(t){function y(M,I){for(let l=0;l<6;++l)o.i.copy(M[l],I[l]);return M}t.create=function A(M,I,l,m,u,d){return[M,I,l,m,u,d]},t.copy=y,t.clone=function c(M){return y(t(),M)},t.fromProjectionMatrix=function i(M,I){const l=I[0],m=I[1],u=I[2],d=I[3],s=I[4],C=I[5],h=I[6],a=I[7],S=I[8],D=I[9],R=I[10],f=I[11],p=I[12],E=I[13],T=I[14],L=I[15];return o.i.setUnnormalized(M[0],d-l,a-s,f-S,L-p),o.i.setUnnormalized(M[1],d+l,a+s,f+S,L+p),o.i.setUnnormalized(M[2],d+m,a+C,f+D,L+E),o.i.setUnnormalized(M[3],d-m,a-C,f-D,L-E),o.i.setUnnormalized(M[4],d-u,a-h,f-R,L-T),o.i.setUnnormalized(M[5],d+u,a+h,f+R,L+T),M},t.intersectsSphere3D=function v(M,I){const l=I.center,m=-I.radius;for(let u=0;u<6;++u)if(o.i.distanceToPoint(M[u],l)0?I.max[0]:I.min[0],O[1]=m.normal[1]>0?I.max[1]:I.min[1],O[2]=m.normal[2]>0?I.max[2]:I.min[2],o.i.distanceToPoint(m,O)<0)return!1}return!0},t.containsPoint=function _(M,I){for(let l=0;l<6;++l)if(o.i.distanceToPoint(M[l],I)<0)return!1;return!0}}(r||(r={}))},9457:(tn,Ue,n)=>{"use strict";n.d(Ue,{i:()=>o});var e=n(2086);function o(){return o.create(e.e.create(1,0,0),0)}!function(r){function A(d,s){return e.e.copy(d.normal,s.normal),d.constant=s.constant,d}function b(d,s,C){return e.e.copy(d.normal,s),d.constant=-e.e.dot(d.normal,C),d}r.create=function t(d,s){return{normal:d,constant:s}},r.copy=A,r.clone=function y(d){return A(r(),d)},r.normalize=function c(d,s){const C=1/e.e.magnitude(s.normal);return e.e.scale(d.normal,s.normal,C),d.constant=s.constant*C,d},r.negate=function i(d,s){return e.e.negate(d.normal,s.normal),d.constant=-s.constant,d},r.toArray=function v(d,s,C){return e.e.toArray(d.normal,s,C),s[C+3]=d.constant,s},r.fromArray=function O(d,s,C){return e.e.fromArray(d.normal,s,C),d.constant=s[C+3],d},r.fromNormalAndCoplanarPoint=b,r.fromCoplanarPoints=function _(d,s,C,h){return b(d,e.e.triangleNormal((0,e.e)(),s,C,h),s),d};const M=(0,e.e)();function l(d,s){return e.e.dot(d.normal,s)+d.constant}r.setUnnormalized=function I(d,s,C,h,a){e.e.set(M,s,C,h);const S=1/e.e.magnitude(M);return e.e.scale(d.normal,M,S),d.constant=a*S,d},r.distanceToPoint=l,r.distanceToSpher3D=function m(d,s){return l(d,s.center)-s.radius},r.projectPoint=function u(d,s,C){return e.e.scaleAndAdd(d,d,s.normal,-l(s,C))}}(o||(o={}))},8184:(tn,Ue,n)=>{"use strict";n.d(Ue,{f:()=>A});var e=n(4369),o=n(3543),r=n(5560),t=n(8199);function A(){return A.zero()}!function(y){function c(V){return void 0!==V.extrema}function i(V,U){return{center:V,radius:U}}function M(V,U){return void 0!==V.extrema?(V.extrema.length=0,V.extrema.push(...U)):V.extrema=U,V}y.hasExtrema=c,y.create=i,y.zero=function v(){return{center:(0,e.eB)(),radius:0}},y.clone=function O(V){const U=i(e.eB.clone(V.center),V.radius);return c(V)&&(U.extrema=V.extrema.map(N=>e.eB.clone(N))),U},y.set=function b(V,U,N){return e.eB.copy(V.center,U),V.radius=N,V},y.copy=function _(V,U){return e.eB.copy(V.center,U.center),V.radius=U.radius,c(U)&&M(V,U.extrema.map(N=>e.eB.clone(N))),V},y.setExtrema=M,y.computeBounding=function I(V){const{x:U,y:N,z:k,indices:H}=V;let $=0,J=0,W=0,te=0;const de=o.CD.size(H);for(let ye=0;ye0&&($/=de,J/=de,W/=de);for(let ye=0;yete&&(te=ee)}return{center:e.eB.create($,J,W),radius:Math.sqrt(te)}},y.transform=function l(V,U,N){return e.eB.transformMat4(V.center,U.center,N),V.radius=U.radius*e.$I.getMaxScaleOnAxis(N),c(U)&&M(V,U.extrema.map(k=>e.eB.transformMat4((0,e.eB)(),k,N))),V},y.translate=function m(V,U,N){return e.eB.add(V.center,U.center,N),c(U)&&M(V,U.extrema.map(k=>e.eB.add((0,e.eB)(),k,N))),V},y.toArray=function u(V,U,N){return e.eB.toArray(V.center,U,N),U[N+3]=V.radius,U},y.fromArray=function d(V,U,N){return e.eB.fromArray(V.center,U,N),V.radius=U[N+3],V},y.fromBox3D=function s(V,U){return e.eB.scale(V.center,e.eB.add(V.center,U.max,U.min),.5),V.radius=e.eB.distance(V.center,U.max),y.setExtrema(V,[e.eB.create(U.min[0],U.min[1],U.min[2]),e.eB.create(U.max[0],U.max[1],U.max[2]),e.eB.create(U.max[0],U.min[1],U.min[2]),e.eB.create(U.min[0],U.max[1],U.max[2]),e.eB.create(U.min[0],U.min[1],U.max[2]),e.eB.create(U.max[0],U.min[1],U.max[2]),e.eB.create(U.max[0],U.max[1],U.min[2]),e.eB.create(U.min[0],U.max[1],U.min[2])]),V},y.fromAxes3D=function C(V,U){return e.eB.copy(V.center,U.origin),V.radius=Math.max(e.eB.magnitude(U.dirA),e.eB.magnitude(U.dirB),e.eB.magnitude(U.dirC)),V};const h=(0,e.eB)();y.fromDimensionsAndTransform=function a(V,U,N){const[k,H,$]=U,J=e.eB.create(0,0,0);e.eB.transformMat4(J,J,N);const W=e.eB.create(k,H,$);e.eB.transformMat4(W,W,N);const te=e.eB.create(k,0,0);e.eB.transformMat4(te,te,N);const de=e.eB.create(0,H,$);e.eB.transformMat4(de,de,N);const ye=e.eB.create(0,0,$);e.eB.transformMat4(ye,ye,N);const j=e.eB.create(k,0,$);e.eB.transformMat4(j,j,N);const Z=e.eB.create(k,H,0);e.eB.transformMat4(Z,Z,N);const q=e.eB.create(0,H,0);e.eB.transformMat4(q,q,N),e.eB.add(h,J,W),e.eB.scale(h,h,.5);const Y=Math.max(e.eB.distance(J,W),e.eB.distance(te,de));return y.set(V,h,Y/2),y.setExtrema(V,[J,W,te,de,ye,j,Z,q]),V};const S=(0,e.eB)();y.addVec3=function D(V,U,N){return e.eB.distance(U.center,N)e.eB.clone(k)),...N.extrema.map(k=>e.eB.clone(k))]),V};const f=(0,e.eB)();y.expand=function p(V,U,N){var k,H;if(e.eB.copy(V.center,U.center),V.radius=U.radius+N,U.radius<1e-12||(null!==(H=null===(k=U.extrema)||void 0===k?void 0:k.length)&&void 0!==H?H:0)<=1)return V.extrema=void 0,V;if(c(U)){const $=new Float32Array(3*U.extrema.length);for(let W=0;W{e.eB.normalize(f,e.eB.sub(f,W,U.center));const te=e.eB.clone(W),de=e.eB.dot(f,J.dirA)<0?-1:1;e.eB.scaleAndAdd(te,te,J.dirA,de);const ye=e.eB.dot(f,J.dirB)<0?-1:1;e.eB.scaleAndAdd(te,te,J.dirB,ye);const j=e.eB.dot(f,J.dirC)<0?-1:1;return e.eB.scaleAndAdd(te,te,J.dirC,j),e.eB.distance(V.center,te)>V.radius&&(U.extrema.length>=14&&e.eB.normalize(f,e.eB.sub(f,te,U.center)),e.eB.scaleAndAdd(te,V.center,f,V.radius)),te}))}return V},y.exactEquals=function E(V,U){return V.radius===U.radius&&e.eB.exactEquals(V.center,U.center)},y.equals=function T(V,U){const N=V.radius,k=U.radius;return Math.abs(N-k)<=e.p8*Math.max(1,Math.abs(N),Math.abs(k))&&e.eB.equals(V.center,U.center)},y.includes=function L(V,U){if(c(U)){for(const N of U.extrema)if(e.eB.distance(V.center,N)>V.radius)return!1;return!0}return e.eB.distance(V.center,U.center)+U.radius<=V.radius},y.overlaps=function w(V,U){return e.eB.distance(V.center,U.center)<=V.radius+U.radius},y.distance=function Q(V,U){return e.eB.distance(V.center,U.center)-V.radius+U.radius},y.distanceToVec=function G(V,U){const{center:N,radius:k}=V;return e.eB.distance(U,N)-k}}(A||(A={}))},7552:(tn,Ue,n)=>{"use strict";n.d(Ue,{J:()=>y});var y,e=n(127),o=n(7630),r=n(6639),t=n(5126),A=n(2086);function c(v){return 0}!function(v){function O(p,E,T){let{assembly:L,ncsId:w,hkl:Q,spgrOp:G,key:V}=T||{};const U=Q?A.e.clone(Q):(0,A.e)();G=G??-1,V=V??-1,w=w||-1;const N=r.$.isIdentity(E),k=function _(p,E){if(!p)return"";if(p.assembly)return function b(p){return!!p&&!!p.matrix&&!!p.inverse&&"string"==typeof p.name}(p)?p.suffix:E?"":`_${p.assembly.operId}`;if(typeof p.spgrOp<"u"&&typeof p.hkl<"u"&&-1!==p.spgrOp){const[T,L,w]=p.hkl;return`-${p.spgrOp+1}_${5+T}${5+L}${5+w}`}return-1!==p.ncsId?`_${p.ncsId}`:""}(T,N);return N?{name:p,assembly:L,matrix:E,inverse:r.$.identity(),isIdentity:!0,hkl:U,spgrOp:G,ncsId:w,suffix:k,key:V}:(r.$.isRotationAndTranslation(E,v.RotationTranslationEpsilon)||console.warn(`Symmetry operator (${p}) should be a composition of rotation and translation.`),{name:p,assembly:L,matrix:E,inverse:r.$.invert((0,r.$)(),E),isIdentity:!1,hkl:U,spgrOp:G,key:V,ncsId:w,suffix:k})}v.DefaultName="1_555",v.Default=O(v.DefaultName,r.$.identity()),v.RotationTranslationEpsilon=.005,v.create=O;const M=(0,r.$)();v.checkIfRotationAndTranslation=function I(p,E){r.$.setIdentity(M);for(let T=0;T<3;T++)for(let L=0;L<3;L++)r.$.setValue(M,T,L,o.U.getValue(p,T,L));return r.$.setTranslation(M,E),r.$.isRotationAndTranslation(M,v.RotationTranslationEpsilon)},v.ofRotationAndOffset=function l(p,E,T,L){const w=r.$.identity();for(let Q=0;Q<3;Q++)for(let G=0;G<3;G++)r.$.setValue(w,Q,G,o.U.getValue(E,Q,G));return r.$.setTranslation(w,T),O(p,w,{ncsId:L})};const m=t.k.identity(),u=(0,t.k)(),d=(0,t.k)(),s=(0,A.e)();v.lerpFromIdentity=function C(p,E,T){const L=E.inverse;if(E.isIdentity)return r.$.copy(p,L);const w=1-T;r.$.getRotation(u,L),t.k.slerp(u,m,u,w);const Q=t.k.getAxisAngle(s,u);return r.$.fromRotation(p,Q,s),r.$.setValue(p,0,3,w*r.$.getValue(L,0,3)),r.$.setValue(p,1,3,w*r.$.getValue(L,1,3)),r.$.setValue(p,2,3,w*r.$.getValue(L,2,3)),p},v.slerp=function h(p,E,T,L){if(Math.abs(L)<=1e-5)return r.$.copy(p,E);if(Math.abs(L-1)<=1e-5)return r.$.copy(p,T);r.$.getRotation(u,E),r.$.getRotation(d,T),t.k.slerp(d,u,d,L);const w=t.k.getAxisAngle(s,d);return r.$.fromRotation(p,w,s),r.$.setValue(p,0,3,(0,e.Cc)(r.$.getValue(E,0,3),r.$.getValue(T,0,3),L)),r.$.setValue(p,1,3,(0,e.Cc)(r.$.getValue(E,1,3),r.$.getValue(T,1,3),L)),r.$.setValue(p,2,3,(0,e.Cc)(r.$.getValue(E,2,3),r.$.getValue(T,2,3),L)),p},v.compose=function a(p,E){const T=r.$.mul((0,r.$)(),E.matrix,p.matrix);return O(E.name,T,E)};class S{constructor(E,T,L=c){this.operator=E,this.coordinates=T,this.r=L,this._x=T.x,this._y=T.y,this._z=T.z,this._m=E.matrix}invariantPosition(E,T){return T[0]=this._x[E],T[1]=this._y[E],T[2]=this._z[E],T}position(E,T){return T[0]=this._x[E],T[1]=this._y[E],T[2]=this._z[E],A.e.transformMat4(T,T,this._m),T}x(E){const T=this._m,V=this._x[E],U=this._y[E],N=this._z[E];return(T[0]*V+T[4]*U+T[8]*N+T[12])/(T[3]*V+T[7]*U+T[11]*N+T[15]||1)}y(E){const T=this._m,V=this._x[E],U=this._y[E],N=this._z[E];return(T[1]*V+T[5]*U+T[9]*N+T[13])/(T[3]*V+T[7]*U+T[11]*N+T[15]||1)}z(E){const T=this._m,V=this._x[E],U=this._y[E],N=this._z[E];return(T[2]*V+T[6]*U+T[10]*N+T[14])/(T[3]*V+T[7]*U+T[11]*N+T[15]||1)}}class D{constructor(E,T,L=c){this.operator=E,this.coordinates=T,this.r=L,this._x=T.x,this._y=T.y,this._z=T.z,this._m=E.matrix}invariantPosition(E,T){return T[0]=this._x[E],T[1]=this._y[E],T[2]=this._z[E],T}position(E,T){return T[0]=this.x(E),T[1]=this.y(E),T[2]=this.z(E),T}x(E){const T=this._m;return T[0]*this._x[E]+T[4]*this._y[E]+T[8]*this._z[E]+T[12]}y(E){const T=this._m;return T[1]*this._x[E]+T[5]*this._y[E]+T[9]*this._z[E]+T[13]}z(E){const T=this._m;return T[2]*this._x[E]+T[6]*this._y[E]+T[10]*this._z[E]+T[14]}}class R{constructor(E,T,L=c){this.operator=E,this.coordinates=T,this.r=L,this._x=T.x,this._y=T.y,this._z=T.z}invariantPosition(E,T){return T[0]=this._x[E],T[1]=this._y[E],T[2]=this._z[E],T}position(E,T){return T[0]=this._x[E],T[1]=this._y[E],T[2]=this._z[E],T}x(E){return this._x[E]}y(E){return this._y[E]}z(E){return this._z[E]}}v.createMapping=function f(p,E,T=c){return r.$.isIdentity(p.matrix)?new R(p,E,T):function i(v){return 0===v[3]&&0===v[7]&&0===v[11]&&1===v[15]}(p.matrix)?new D(p,E,T):new S(p,E,T)}}(y||(y={}))},4506:(tn,Ue,n)=>{"use strict";n.d(Ue,{O:()=>r});var r,e=n(8382),o=n(3543);function t(A,y,c,i,v){const{b:O,offset:b}=A,_=[];for(let M=0,I=y.length;M1&&t(A,_,c,i-1,v)}!function(A){A.areEqual=function y(m,u){if(m===u)return!0;if(m.vertexCount!==u.vertexCount||m.edgeCount!==u.edgeCount)return!1;const{a:d,b:s,offset:C}=m,{a:h,b:a,offset:S}=u;for(let D=0,R=m.a.length;Dd&&(s=d,C=u);const h=(0,e.m1)(s,C);return!this.included.has(h)&&(this.included.add(h),this.xs[this.xs.length]=s,this.ys[this.ys.length]=C,!0)}getGraph(){return _(this.vertexCount,this.xs,this.ys)}getEdgeBuiler(){return new v(this.vertexCount,this.xs,this.ys)}constructor(u){this.vertexCount=u,this.xs=[],this.ys=[],this.included=new Set}},A.fromVertexPairs=_,A.induceByVertices=function M(m,u,d){const{b:s,offset:C,vertexCount:h,edgeProps:a}=m,S=new Int32Array(h);for(let Q=0,G=u.length;QQ&&0!==S[s[G]]&&D++;const R=new Int32Array(u.length+1),f=new Int32Array(2*D),p=new Int32Array(2*D),E=new Int32Array(2*D);let T=0,L=0;for(let Q=0;Q0;){const D=a.pop(),R=d[D];for(let f=C[D],p=C[D+1];f=0&&(a.push(S.head),d[S.head]=++s,S.remove(S.head))}return{componentCount:u,componentIndex:d}},A.areVertexSetsConnected=function l(m,u,d,s){if(o.SortedArray.areIntersecting(u,d))return!0;if(s<1)return!1;const C=new Set;for(let h=0,a=u.length;h{"use strict";n.d(Ue,{Z:()=>o});var e=n(9677);class o{getConnectedUnits(A){return this.map.has(A)?this.map.get(A):r}getEdgeIndex(A,y,c,i){const v=o.getEdgeKey(A,y,c,i),O=this.edgeKeyIndex.get(v);return void 0!==O?O:-1}hasEdge(A,y,c,i){return-1!==this.getEdgeIndex(A,y,c,i)}getEdge(A,y,c,i){const v=this.getEdgeIndex(A,y,c,i);return-1!==v?this.edges[v]:void 0}getEdgeIndices(A,y){return this.vertexKeyIndex.get(o.getVertexKey(A,y))||[]}constructor(A){this.map=A;let y=0;const c=[],i=new Map,v=new Map;this.map.forEach(O=>{O.forEach(b=>{y+=b.edgeCount,b.connectedIndices.forEach(_=>{b.getEdges(_).forEach(M=>{const{unitA:I,unitB:l}=b,m=o.getEdgeKey(_,I,M.indexB,l);i.set(m,c.length);const u=o.getVertexKey(_,I),d=v.get(u);void 0===d?v.set(u,[c.length]):d.push(c.length),c.push({...M,indexA:_,unitA:I,unitB:l})})})})}),this.edgeCount=y,this.edges=c,this.edgeKeyIndex=i,this.vertexKeyIndex=v}}!function(t){class A{hasEdges(b){return this.edgeMap.has(b)}getEdges(b){return this.edgeMap.has(b)?this.edgeMap.get(b):r}get areUnitsOrdered(){return this.unitA{"use strict";function o(M,I,l){return Math.max(I,Math.min(l,M))}function y(M,I,l){return M+(I-M)*l}function c(M,I,l,m,u,d){const s=(l-M)*d,C=(m-I)*d,h=u*u;return(2*I-2*l+s+C)*(u*h)+(-3*I+3*l-2*s-C)*h+s*u+I}function i(M,I,l,m){const u=1-m;return u*u*M+2*u*m*I+m*m*l}function v(M,I,l){return(l=function t(M){return o(M,0,1)}(function e(M,I,l){return(M-I)/(l-I)}(l,M,I)))*l*(3-2*l)}n.d(Ue,{Cc:()=>y,TF:()=>v,Y7:()=>c,iD:()=>i,qE:()=>o})},4369:(tn,Ue,n)=>{"use strict";n.d(Ue,{p8:()=>c.p,U:()=>o.U,$I:()=>e.$,k:()=>y.k,qY:()=>i,ZY:()=>r.Z,eB:()=>t.e,Zb:()=>A.Z});var i,e=n(6639),o=n(7630),r=n(325),t=n(2086),A=n(8599),y=n(5126),c=n(2028);!function(v){function _(L,w,Q){const G=function O(L,w,Q){const G=[];for(let U=0;UG[V],set:(G,V,U)=>G[V]=U,add:(G,V,U)=>G[V]+=U,dataOffset:G=>G,getCoords:(G,V)=>(V[0]=G,V)};case 2:if(0===Q[0]&&1===Q[1]){const G=w[0];return{get:(V,U,N)=>V[N*G+U],set:(V,U,N,k)=>V[N*G+U]=k,add:(V,U,N,k)=>V[N*G+U]+=k,dataOffset:(V,U)=>U*G+V,getCoords:(V,U)=>(U[0]=V%G,U[1]=Math.floor(V/G),U)}}if(1===Q[0]&&0===Q[1]){const G=w[1];return{get:(V,U,N)=>V[U*G+N],set:(V,U,N,k)=>V[U*G+N]=k,add:(V,U,N,k)=>V[U*G+N]+=k,dataOffset:(V,U)=>V*G+U,getCoords:(V,U)=>(U[0]=Math.floor(V/G),U[1]=V%G,U)}}throw new Error("bad axis order");case 3:if(0===Q[0]&&1===Q[1]&&2===Q[2]){const G=w[0],V=w[1],U=G*V;return{get:(N,k,H,$)=>N[k+H*G+$*U],set:(N,k,H,$,J)=>N[k+H*G+$*U]=J,add:(N,k,H,$,J)=>N[k+H*G+$*U]+=J,dataOffset:(N,k,H)=>N+k*G+H*U,getCoords:(N,k)=>{const H=Math.floor(N/G);return k[0]=N%G,k[1]=H%V,k[2]=Math.floor(H/V),k}}}if(0===Q[0]&&2===Q[1]&&1===Q[2]){const G=w[0],V=w[2],U=G*V;return{get:(N,k,H,$)=>N[k+$*G+H*U],set:(N,k,H,$,J)=>N[k+$*G+H*U]=J,add:(N,k,H,$,J)=>N[k+$*G+H*U]+=J,dataOffset:(N,k,H)=>N+H*G+k*U,getCoords:(N,k)=>{const H=Math.floor(N/G);return k[0]=N%G,k[1]=Math.floor(H/V),k[2]=H%V,k}}}if(1===Q[0]&&0===Q[1]&&2===Q[2]){const G=w[1],V=w[0],U=G*V;return{get:(N,k,H,$)=>N[H+k*G+$*U],set:(N,k,H,$,J)=>N[H+k*G+$*U]=J,add:(N,k,H,$,J)=>N[H+k*G+$*U]+=J,dataOffset:(N,k,H)=>k+N*G+H*U,getCoords:(N,k)=>{const H=Math.floor(N/G);return k[0]=H%V,k[1]=N%G,k[2]=Math.floor(H/V),k}}}if(1===Q[0]&&2===Q[1]&&0===Q[2]){const G=w[1],V=w[2],U=G*V;return{get:(N,k,H,$)=>N[H+$*G+k*U],set:(N,k,H,$,J)=>N[H+$*G+k*U]=J,add:(N,k,H,$,J)=>N[H+$*G+k*U]+=J,dataOffset:(N,k,H)=>k+H*G+N*U,getCoords:(N,k)=>{const H=Math.floor(N/G);return k[0]=Math.floor(H/V),k[1]=N%G,k[2]=H%V,k}}}if(2===Q[0]&&0===Q[1]&&1===Q[2]){const G=w[2],V=w[0],U=G*V;return{get:(N,k,H,$)=>N[$+k*G+H*U],set:(N,k,H,$,J)=>N[$+k*G+H*U]=J,add:(N,k,H,$,J)=>N[$+k*G+H*U]+=J,dataOffset:(N,k,H)=>H+N*G+k*U,getCoords:(N,k)=>{const H=Math.floor(N/G);return k[0]=H%V,k[1]=Math.floor(H/V),k[2]=N%G,k}}}if(2===Q[0]&&1===Q[1]&&0===Q[2]){const G=w[2],V=w[1],U=G*V;return{get:(N,k,H,$)=>N[$+H*G+k*U],set:(N,k,H,$,J)=>N[$+H*G+k*U]=J,add:(N,k,H,$,J)=>N[$+H*G+k*U]+=J,dataOffset:(N,k,H)=>H+k*G+N*U,getCoords:(N,k)=>{const H=Math.floor(N/G);return k[0]=Math.floor(H/V),k[1]=H%V,k[2]=N%G,k}}}throw new Error("bad axis order");default:return{get:(G,...V)=>G[D(L,V)],set:(G,...V)=>G[D(L,V)]=V[V.length-1],add:(G,...V)=>G[D(L,V)]+=V[V.length-1],dataOffset:(...G)=>D(L,G),getCoords:(G,V)=>function R(L,w,Q){const{dimensions:G,axisOrderFastToSlow:V}=L,U=G.length;let N=w;for(let k=0;knew(G||L.defaultCtor)(Q)}function D(L,w){const{accessDimensions:Q,axisOrderFastToSlow:G}=L,V=Q.length-1;let U=Q[V]*w[G[V]];for(let N=V-1;N>=0;N--)U=(U+w[G[N]])*Q[N];return U}function p(L,w){const Q=[];for(let G=0;Gp(Q,w)},v.convertToCanonicalAxisIndicesSlowToFast=function T(L){const w=new Int32Array(L.length);for(let Q=0;Qp(Q,w)}}(i||(i={}))},2028:(tn,Ue,n)=>{"use strict";n.d(Ue,{T:()=>o,p:()=>e});const e=1e-6;function o(r,t,A){return Math.abs(r-t)<=A}},7630:(tn,Ue,n)=>{"use strict";n.d(Ue,{U:()=>t});var e=n(2028),o=n(6639),r=n(2086);function t(){return t.zero()}!function(A){function y(){const Y=[.1,0,0,0,0,0,0,0,0];return Y[0]=0,Y}function c(){const Y=y();return Y[0]=1,Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=1,Y[5]=0,Y[6]=0,Y[7]=0,Y[8]=1,Y}function _(Y,ee){return Y[0]=ee[0],Y[1]=ee[1],Y[2]=ee[2],Y[3]=ee[4],Y[4]=ee[5],Y[5]=ee[6],Y[6]=ee[8],Y[7]=ee[9],Y[8]=ee[10],Y}A.zero=y,A.identity=c,A.setIdentity=function i(Y){return Y[0]=1,Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=1,Y[5]=0,Y[6]=0,Y[7]=0,Y[8]=1,Y},A.toArray=function v(Y,ee,g){return ee[g+0]=Y[0],ee[g+1]=Y[1],ee[g+2]=Y[2],ee[g+3]=Y[3],ee[g+4]=Y[4],ee[g+5]=Y[5],ee[g+6]=Y[6],ee[g+7]=Y[7],ee[g+8]=Y[8],ee},A.fromArray=function O(Y,ee,g){return Y[0]=ee[g+0],Y[1]=ee[g+1],Y[2]=ee[g+2],Y[3]=ee[g+3],Y[4]=ee[g+4],Y[5]=ee[g+5],Y[6]=ee[g+6],Y[7]=ee[g+7],Y[8]=ee[g+8],Y},A.fromColumns=function b(Y,ee,g,_e){return Y[0]=ee[0],Y[1]=ee[1],Y[2]=ee[2],Y[3]=g[0],Y[4]=g[1],Y[5]=g[2],Y[6]=_e[0],Y[7]=_e[1],Y[8]=_e[2],Y},A.fromMat4=_;const M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];A.fromEuler=function I(Y,ee,g){return o.$.fromEuler(M,ee,g),_(Y,M)},A.create=function l(Y,ee,g,_e,xe,le,Ae,Be,Ce){const Re=y();return Re[0]=Y,Re[1]=ee,Re[2]=g,Re[3]=_e,Re[4]=xe,Re[5]=le,Re[6]=Ae,Re[7]=Be,Re[8]=Ce,Re};const m=c();function C(Y,ee,g){for(let _e=0;_e<9;_e++)if(Math.abs(Y[_e]-ee[_e])>g)return!1;return!0}function S(Y,ee){return Y[0]=ee[0],Y[1]=ee[1],Y[2]=ee[2],Y[3]=ee[3],Y[4]=ee[4],Y[5]=ee[5],Y[6]=ee[6],Y[7]=ee[7],Y[8]=ee[8],Y}function D(Y,ee){if(Y===ee){const g=ee[1],_e=ee[2],xe=ee[5];Y[1]=ee[3],Y[2]=ee[6],Y[3]=g,Y[5]=ee[7],Y[6]=_e,Y[7]=xe}else Y[0]=ee[0],Y[1]=ee[3],Y[2]=ee[6],Y[3]=ee[1],Y[4]=ee[4],Y[5]=ee[7],Y[6]=ee[2],Y[7]=ee[5],Y[8]=ee[8];return Y}function R(Y,ee){const g=ee[0],_e=ee[1],xe=ee[2],le=ee[3],Ae=ee[4],Be=ee[5],Ce=ee[6],Re=ee[7],ke=ee[8],we=ke*Ae-Be*Re,Oe=-ke*le+Be*Ce,Se=Re*le-Ae*Ce;let Ve=g*we+_e*Oe+xe*Se;return Ve?(Ve=1/Ve,Y[0]=we*Ve,Y[1]=(-ke*_e+xe*Re)*Ve,Y[2]=(Be*_e-xe*Ae)*Ve,Y[3]=Oe*Ve,Y[4]=(ke*g-xe*Ce)*Ve,Y[5]=(-Be*g+xe*le)*Ve,Y[6]=Se*Ve,Y[7]=(-Re*g+_e*Ce)*Ve,Y[8]=(Ae*g-_e*le)*Ve,Y):(console.warn("non-invertible matrix.",ee),Y)}function E(Y){const xe=Y[3],le=Y[4],Ae=Y[5],Be=Y[6],Ce=Y[7],Re=Y[8];return Y[0]*(Re*le-Ae*Ce)+Y[1]*(-Re*xe+Ae*Be)+Y[2]*(Ce*xe-le*Be)}function T(Y){return Y[0]+Y[4]+Y[8]}function L(Y,ee,g){return Y[0]=ee[0]-g[0],Y[1]=ee[1]-g[1],Y[2]=ee[2]-g[2],Y[3]=ee[3]-g[3],Y[4]=ee[4]-g[4],Y[5]=ee[5]-g[5],Y[6]=ee[6]-g[6],Y[7]=ee[7]-g[7],Y[8]=ee[8]-g[8],Y}function U(Y,ee,g){return Y[0]=ee[0]*g,Y[1]=ee[1]*g,Y[2]=ee[2]*g,Y[3]=ee[3]*g,Y[4]=ee[4]*g,Y[5]=ee[5]*g,Y[6]=ee[6]*g,Y[7]=ee[7]*g,Y[8]=ee[8]*g,Y}A.isIdentity=function u(Y,ee){return C(Y,m,typeof ee>"u"?e.p:ee)},A.hasNaN=function d(Y){for(let ee=0;ee<9;ee++)if(isNaN(Y[ee]))return!0;return!1},A.clone=function s(Y){return S(y(),Y)},A.areEqual=C,A.setValue=function h(Y,ee,g,_e){Y[3*g+ee]=_e},A.getValue=function a(Y,ee,g){return Y[3*g+ee]},A.copy=S,A.transpose=D,A.invert=R,A.symmtricFromUpper=function f(Y,ee){return Y===ee?(Y[3]=ee[1],Y[6]=ee[2],Y[7]=ee[5]):(Y[0]=ee[0],Y[1]=ee[1],Y[2]=ee[2],Y[3]=ee[1],Y[4]=ee[4],Y[5]=ee[5],Y[6]=ee[2],Y[7]=ee[5],Y[8]=ee[8]),Y},A.symmtricFromLower=function p(Y,ee){return Y===ee?(Y[1]=ee[3],Y[2]=ee[6],Y[5]=ee[7]):(Y[0]=ee[0],Y[1]=ee[3],Y[2]=ee[6],Y[3]=ee[3],Y[4]=ee[4],Y[5]=ee[7],Y[6]=ee[6],Y[7]=ee[7],Y[8]=ee[8]),Y},A.determinant=E,A.trace=T,A.sub=L,A.add=function w(Y,ee,g){return Y[0]=ee[0]+g[0],Y[1]=ee[1]+g[1],Y[2]=ee[2]+g[2],Y[3]=ee[3]+g[3],Y[4]=ee[4]+g[4],Y[5]=ee[5]+g[5],Y[6]=ee[6]+g[6],Y[7]=ee[7]+g[7],Y[8]=ee[8]+g[8],Y},A.mul=function Q(Y,ee,g){const _e=ee[0],xe=ee[1],le=ee[2],Ae=ee[3],Be=ee[4],Ce=ee[5],Re=ee[6],ke=ee[7],we=ee[8],Oe=g[0],Se=g[1],Ve=g[2],Ne=g[3],K=g[4],ne=g[5],be=g[6],Te=g[7],ie=g[8];return Y[0]=Oe*_e+Se*Ae+Ve*Re,Y[1]=Oe*xe+Se*Be+Ve*ke,Y[2]=Oe*le+Se*Ce+Ve*we,Y[3]=Ne*_e+K*Ae+ne*Re,Y[4]=Ne*xe+K*Be+ne*ke,Y[5]=Ne*le+K*Ce+ne*we,Y[6]=be*_e+Te*Ae+ie*Re,Y[7]=be*xe+Te*Be+ie*ke,Y[8]=be*le+Te*Ce+ie*we,Y},A.subScalar=function G(Y,ee,g){return Y[0]=ee[0]-g,Y[1]=ee[1]-g,Y[2]=ee[2]-g,Y[3]=ee[3]-g,Y[4]=ee[4]-g,Y[5]=ee[5]-g,Y[6]=ee[6]-g,Y[7]=ee[7]-g,Y[8]=ee[8]-g,Y},A.addScalar=function V(Y,ee,g){return Y[0]=ee[0]+g,Y[1]=ee[1]+g,Y[2]=ee[2]+g,Y[3]=ee[3]+g,Y[4]=ee[4]+g,Y[5]=ee[5]+g,Y[6]=ee[6]+g,Y[7]=ee[7]+g,Y[8]=ee[8]+g,Y},A.mulScalar=U;const N=Math.PI/3,k=y();A.symmetricEigenvalues=function H(Y,ee){const g=ee[1]*ee[1]+ee[2]*ee[2]+ee[5]*ee[5];if(0===g)Y[0]=ee[0],Y[1]=ee[4],Y[2]=ee[8];else{const _e=T(ee)/3,xe=ee[0]-_e,le=ee[4]-_e,Ae=ee[8]-_e,Ce=Math.sqrt((xe*xe+le*le+Ae*Ae+2*g)/6);U(k,A.Identity,_e),L(k,ee,k),U(k,k,1/Ce);const Re=E(k)/2,ke=Re<=-1?N:Re>=1?0:Math.acos(Re)/3;Y[0]=_e+2*Ce*Math.cos(ke),Y[2]=_e+2*Ce*Math.cos(ke+2*N),Y[1]=3*_e-Y[0]-Y[2]}return Y};const $=[.1,0,0],J=[.1,0,0],W=[.1,0,0],te=[.1,0,0],de=[.1,0,0],ye=[.1,0,0];A.eigenvector=function j(Y,ee,g){r.e.set($,ee[0]-g,ee[1],ee[2]),r.e.set(J,ee[1],ee[4]-g,ee[5]),r.e.set(W,ee[2],ee[5],ee[8]-g),r.e.cross(te,$,J),r.e.cross(de,$,W),r.e.cross(ye,J,W);const _e=r.e.dot(te,te),xe=r.e.dot(de,de),le=r.e.dot(ye,ye);let Ae=_e,Be=0;return xe>Ae&&(Ae=xe,Be=1),le>Ae&&(Be=2),0===Be?r.e.scale(Y,te,1/Math.sqrt(_e)):1===Be?r.e.scale(Y,de,1/Math.sqrt(xe)):r.e.scale(Y,ye,1/Math.sqrt(le)),Y},A.directionTransform=function Z(Y,ee){return _(Y,ee),R(Y,Y),D(Y,Y),Y},A.Identity=c(),A.innerProduct=function q(Y,ee){return Y[0]*ee[0]+Y[1]*ee[1]+Y[2]*ee[2]+Y[3]*ee[3]+Y[4]*ee[4]+Y[5]*ee[5]+Y[6]*ee[6]+Y[7]*ee[7]+Y[8]*ee[8]}}(t||(t={}))},6639:(tn,Ue,n)=>{"use strict";n.d(Ue,{$:()=>t});var e=n(2028),o=n(2086),r=n(4490);function t(){return t.zero()}!function(A){function y(){const K=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];return K[0]=0,K}function c(){const K=y();return K[0]=1,K[1]=0,K[2]=0,K[3]=0,K[4]=0,K[5]=1,K[6]=0,K[7]=0,K[8]=0,K[9]=0,K[10]=1,K[11]=0,K[12]=0,K[13]=0,K[14]=0,K[15]=1,K}function i(K){return K[0]=1,K[1]=0,K[2]=0,K[3]=0,K[4]=0,K[5]=1,K[6]=0,K[7]=0,K[8]=0,K[9]=0,K[10]=1,K[11]=0,K[12]=0,K[13]=0,K[14]=0,K[15]=1,K}function v(K){for(let ne=0;ne<16;ne++)K[ne]=0;return K}A.zero=y,A.identity=c,A.setIdentity=i,A.setZero=v,A.ofRows=function O(K){const ne=y();for(let be=0;be<4;be++){const Te=K[be];for(let ie=0;ie<4;ie++)ne[4*ie+be]=Te[ie]}return ne};const b=c();function I(K,ne,be){for(let Te=0;Te<16;Te++)if(Math.abs(K[Te]-ne[Te])>be)return!1;return!0}function l(K,ne,be,Te){K[4*be+ne]=Te}function C(K,ne){return K[0]=ne[0],K[1]=ne[1],K[2]=ne[2],K[3]=ne[3],K[4]=ne[4],K[5]=ne[5],K[6]=ne[6],K[7]=ne[7],K[8]=ne[8],K[9]=ne[9],K[10]=ne[10],K[11]=ne[11],K[12]=ne[12],K[13]=ne[13],K[14]=ne[14],K[15]=ne[15],K}function D(K,ne){const be=ne[0]+ne[5]+ne[10];let Te=0;return be>0?(Te=2*Math.sqrt(be+1),K[3]=.25*Te,K[0]=(ne[6]-ne[9])/Te,K[1]=(ne[8]-ne[2])/Te,K[2]=(ne[1]-ne[4])/Te):ne[0]>ne[5]&&ne[0]>ne[10]?(Te=2*Math.sqrt(1+ne[0]-ne[5]-ne[10]),K[3]=(ne[6]-ne[9])/Te,K[0]=.25*Te,K[1]=(ne[1]+ne[4])/Te,K[2]=(ne[8]+ne[2])/Te):ne[5]>ne[10]?(Te=2*Math.sqrt(1+ne[5]-ne[0]-ne[10]),K[3]=(ne[8]-ne[2])/Te,K[0]=(ne[1]+ne[4])/Te,K[1]=.25*Te,K[2]=(ne[6]+ne[9])/Te):(Te=2*Math.sqrt(1+ne[10]-ne[0]-ne[5]),K[3]=(ne[1]-ne[4])/Te,K[0]=(ne[8]+ne[2])/Te,K[1]=(ne[6]+ne[9])/Te,K[2]=.25*Te),K}function p(K,ne){const be=ne[0],Te=ne[1],ie=ne[2],ue=ne[3],re=ne[4],ve=ne[5],ce=ne[6],se=ne[7],ae=ne[8],ge=ne[9],Ie=ne[10],Le=ne[11],nt=ne[12],je=ne[13],Lt=ne[14],Je=ne[15],en=be*ve-Te*re,Bt=be*ce-ie*re,pn=be*se-ue*re,$e=Te*ce-ie*ve,mt=Te*se-ue*ve,_t=ie*se-ue*ce,Me=ae*je-ge*nt,Ke=ae*Lt-Ie*nt,ut=ae*Je-Le*nt,Kt=ge*Lt-Ie*je,sn=ge*Je-Le*je,gt=Ie*Je-Le*Lt;let yt=en*gt-Bt*sn+pn*Kt+$e*ut-mt*Ke+_t*Me;return!!yt&&(yt=1/yt,K[0]=(ve*gt-ce*sn+se*Kt)*yt,K[1]=(ie*sn-Te*gt-ue*Kt)*yt,K[2]=(je*_t-Lt*mt+Je*$e)*yt,K[3]=(Ie*mt-ge*_t-Le*$e)*yt,K[4]=(ce*ut-re*gt-se*Ke)*yt,K[5]=(be*gt-ie*ut+ue*Ke)*yt,K[6]=(Lt*pn-nt*_t-Je*Bt)*yt,K[7]=(ae*_t-Ie*pn+Le*Bt)*yt,K[8]=(re*sn-ve*ut+se*Me)*yt,K[9]=(Te*ut-be*sn-ue*Me)*yt,K[10]=(nt*mt-je*pn+Je*en)*yt,K[11]=(ge*pn-ae*mt-Le*en)*yt,K[12]=(ve*Ke-re*Kt-ce*Me)*yt,K[13]=(be*Kt-Te*Ke+ie*Me)*yt,K[14]=(je*Bt-nt*$e-Lt*en)*yt,K[15]=(ae*$e-ge*Bt+Ie*en)*yt,!0)}function T(K,ne,be){const Te=ne[0],ie=ne[1],ue=ne[2],re=ne[3],ve=ne[4],ce=ne[5],se=ne[6],ae=ne[7],ge=ne[8],Ie=ne[9],Le=ne[10],nt=ne[11],je=ne[12],Lt=ne[13],Je=ne[14],en=ne[15];let Bt=be[0],pn=be[1],$e=be[2],mt=be[3];return K[0]=Bt*Te+pn*ve+$e*ge+mt*je,K[1]=Bt*ie+pn*ce+$e*Ie+mt*Lt,K[2]=Bt*ue+pn*se+$e*Le+mt*Je,K[3]=Bt*re+pn*ae+$e*nt+mt*en,Bt=be[4],pn=be[5],$e=be[6],mt=be[7],K[4]=Bt*Te+pn*ve+$e*ge+mt*je,K[5]=Bt*ie+pn*ce+$e*Ie+mt*Lt,K[6]=Bt*ue+pn*se+$e*Le+mt*Je,K[7]=Bt*re+pn*ae+$e*nt+mt*en,Bt=be[8],pn=be[9],$e=be[10],mt=be[11],K[8]=Bt*Te+pn*ve+$e*ge+mt*je,K[9]=Bt*ie+pn*ce+$e*Ie+mt*Lt,K[10]=Bt*ue+pn*se+$e*Le+mt*Je,K[11]=Bt*re+pn*ae+$e*nt+mt*en,Bt=be[12],pn=be[13],$e=be[14],mt=be[15],K[12]=Bt*Te+pn*ve+$e*ge+mt*je,K[13]=Bt*ie+pn*ce+$e*Ie+mt*Lt,K[14]=Bt*ue+pn*se+$e*Le+mt*Je,K[15]=Bt*re+pn*ae+$e*nt+mt*en,K}function k(K,ne,be){let Te=be[0],ie=be[1],ue=be[2],re=Math.sqrt(Te*Te+ie*ie+ue*ue);if(Math.abs(re)"u"?e.p:ne)},A.hasNaN=function M(K){for(let ne=0;ne<16;ne++)if(isNaN(K[ne]))return!0;return!1},A.areEqual=I,A.setValue=l,A.getValue=function m(K,ne,be){return K[4*be+ne]},A.toArray=function u(K,ne,be){return ne[be+0]=K[0],ne[be+1]=K[1],ne[be+2]=K[2],ne[be+3]=K[3],ne[be+4]=K[4],ne[be+5]=K[5],ne[be+6]=K[6],ne[be+7]=K[7],ne[be+8]=K[8],ne[be+9]=K[9],ne[be+10]=K[10],ne[be+11]=K[11],ne[be+12]=K[12],ne[be+13]=K[13],ne[be+14]=K[14],ne[be+15]=K[15],ne},A.fromArray=function d(K,ne,be){return K[0]=ne[be+0],K[1]=ne[be+1],K[2]=ne[be+2],K[3]=ne[be+3],K[4]=ne[be+4],K[5]=ne[be+5],K[6]=ne[be+6],K[7]=ne[be+7],K[8]=ne[be+8],K[9]=ne[be+9],K[10]=ne[be+10],K[11]=ne[be+11],K[12]=ne[be+12],K[13]=ne[be+13],K[14]=ne[be+14],K[15]=ne[be+15],K},A.fromBasis=function s(K,ne,be,Te){return v(K),l(K,0,0,ne[0]),l(K,1,0,ne[1]),l(K,2,0,ne[2]),l(K,0,1,be[0]),l(K,1,1,be[1]),l(K,2,1,be[2]),l(K,0,2,Te[0]),l(K,1,2,Te[1]),l(K,2,2,Te[2]),l(K,3,3,1),K},A.copy=C,A.clone=function h(K){return C(y(),K)},A.getTranslation=function a(K,ne){return K[0]=ne[12],K[1]=ne[13],K[2]=ne[14],K},A.getScaling=function S(K,ne){const be=ne[0],Te=ne[1],ie=ne[2],ue=ne[4],re=ne[5],ve=ne[6],ce=ne[8],se=ne[9],ae=ne[10];return K[0]=Math.sqrt(be*be+Te*Te+ie*ie),K[1]=Math.sqrt(ue*ue+re*re+ve*ve),K[2]=Math.sqrt(ce*ce+se*se+ae*ae),K},A.getRotation=D,A.extractRotation=function R(K,ne){const be=1/Math.sqrt(ne[0]*ne[0]+ne[1]*ne[1]+ne[2]*ne[2]),Te=1/Math.sqrt(ne[4]*ne[4]+ne[5]*ne[5]+ne[6]*ne[6]),ie=1/Math.sqrt(ne[8]*ne[8]+ne[9]*ne[9]+ne[10]*ne[10]);return K[0]=ne[0]*be,K[1]=ne[1]*be,K[2]=ne[2]*be,K[3]=0,K[4]=ne[4]*Te,K[5]=ne[5]*Te,K[6]=ne[6]*Te,K[7]=0,K[8]=ne[8]*ie,K[9]=ne[9]*ie,K[10]=ne[10]*ie,K[11]=0,K[12]=0,K[13]=0,K[14]=0,K[15]=1,K},A.transpose=function f(K,ne){if(K===ne){const be=ne[1],Te=ne[2],ie=ne[3],ue=ne[6],re=ne[7],ve=ne[11];K[1]=ne[4],K[2]=ne[8],K[3]=ne[12],K[4]=be,K[6]=ne[9],K[7]=ne[13],K[8]=Te,K[9]=ue,K[11]=ne[14],K[12]=ie,K[13]=re,K[14]=ve}else K[0]=ne[0],K[1]=ne[4],K[2]=ne[8],K[3]=ne[12],K[4]=ne[1],K[5]=ne[5],K[6]=ne[9],K[7]=ne[13],K[8]=ne[2],K[9]=ne[6],K[10]=ne[10],K[11]=ne[14],K[12]=ne[3],K[13]=ne[7],K[14]=ne[11],K[15]=ne[15];return K},A.tryInvert=p,A.invert=function E(K,ne){return p(K,ne)||console.warn("non-invertible matrix.",ne),K},A.mul=T,A.mulOffset=function L(K,ne,be,Te,ie,ue){const re=ne[0+ie],ve=ne[1+ie],ce=ne[2+ie],se=ne[3+ie],ae=ne[4+ie],ge=ne[5+ie],Ie=ne[6+ie],Le=ne[7+ie],nt=ne[8+ie],je=ne[9+ie],Lt=ne[10+ie],Je=ne[11+ie],en=ne[12+ie],Bt=ne[13+ie],pn=ne[14+ie],$e=ne[15+ie];let mt=be[0+ue],_t=be[1+ue],Me=be[2+ue],Ke=be[3+ue];return K[0+Te]=mt*re+_t*ae+Me*nt+Ke*en,K[1+Te]=mt*ve+_t*ge+Me*je+Ke*Bt,K[2+Te]=mt*ce+_t*Ie+Me*Lt+Ke*pn,K[3+Te]=mt*se+_t*Le+Me*Je+Ke*$e,mt=be[4+ue],_t=be[5+ue],Me=be[6+ue],Ke=be[7+ue],K[4+Te]=mt*re+_t*ae+Me*nt+Ke*en,K[5+Te]=mt*ve+_t*ge+Me*je+Ke*Bt,K[6+Te]=mt*ce+_t*Ie+Me*Lt+Ke*pn,K[7+Te]=mt*se+_t*Le+Me*Je+Ke*$e,mt=be[8+ue],_t=be[9+ue],Me=be[10+ue],Ke=be[11+ue],K[8+Te]=mt*re+_t*ae+Me*nt+Ke*en,K[9+Te]=mt*ve+_t*ge+Me*je+Ke*Bt,K[10+Te]=mt*ce+_t*Ie+Me*Lt+Ke*pn,K[11+Te]=mt*se+_t*Le+Me*Je+Ke*$e,mt=be[12+ue],_t=be[13+ue],Me=be[14+ue],Ke=be[15+ue],K[12+Te]=mt*re+_t*ae+Me*nt+Ke*en,K[13+Te]=mt*ve+_t*ge+Me*je+Ke*Bt,K[14+Te]=mt*ce+_t*Ie+Me*Lt+Ke*pn,K[15+Te]=mt*se+_t*Le+Me*Je+Ke*$e,K},A.mul3=function w(K,ne,be,Te){return T(K,T(K,ne,be),Te)},A.translate=function Q(K,ne,be){const Te=be[0],ie=be[1],ue=be[2];let re,ve,ce,se,ae,ge,Ie,Le,nt,je,Lt,Je;return ne===K?(K[12]=ne[0]*Te+ne[4]*ie+ne[8]*ue+ne[12],K[13]=ne[1]*Te+ne[5]*ie+ne[9]*ue+ne[13],K[14]=ne[2]*Te+ne[6]*ie+ne[10]*ue+ne[14],K[15]=ne[3]*Te+ne[7]*ie+ne[11]*ue+ne[15]):(re=ne[0],ve=ne[1],ce=ne[2],se=ne[3],ae=ne[4],ge=ne[5],Ie=ne[6],Le=ne[7],nt=ne[8],je=ne[9],Lt=ne[10],Je=ne[11],K[0]=re,K[1]=ve,K[2]=ce,K[3]=se,K[4]=ae,K[5]=ge,K[6]=Ie,K[7]=Le,K[8]=nt,K[9]=je,K[10]=Lt,K[11]=Je,K[12]=re*Te+ae*ie+nt*ue+ne[12],K[13]=ve*Te+ge*ie+je*ue+ne[13],K[14]=ce*Te+Ie*ie+Lt*ue+ne[14],K[15]=se*Te+Le*ie+Je*ue+ne[15]),K},A.fromTranslation=function G(K,ne){return K[0]=1,K[1]=0,K[2]=0,K[3]=0,K[4]=0,K[5]=1,K[6]=0,K[7]=0,K[8]=0,K[9]=0,K[10]=1,K[11]=0,K[12]=ne[0],K[13]=ne[1],K[14]=ne[2],K[15]=1,K},A.setTranslation=function V(K,ne){return K[12]=ne[0],K[13]=ne[1],K[14]=ne[2],K},A.setAxes=function U(K,ne,be,Te){return K[0]=be[0],K[4]=be[1],K[8]=be[2],K[1]=Te[0],K[5]=Te[1],K[9]=Te[2],K[2]=ne[0],K[6]=ne[1],K[10]=ne[2],K},A.rotate=function N(K,ne,be,Te){let ie=Te[0],ue=Te[1],re=Te[2],ve=Math.sqrt(ie*ie+ue*ue+re*re);if(Math.abs(ve)0&&(Le=1/Math.sqrt(Le),ae*=Le,ge*=Le,Ie*=Le);let nt=ce*Ie-se*ge,je=se*ae-ve*Ie,Lt=ve*ge-ce*ae;return Le=nt*nt+je*je+Lt*Lt,Le>0&&(Le=1/Math.sqrt(Le),nt*=Le,je*=Le,Lt*=Le),K[0]=nt,K[1]=je,K[2]=Lt,K[3]=0,K[4]=ge*Lt-Ie*je,K[5]=Ie*nt-ae*Lt,K[6]=ae*je-ge*nt,K[7]=0,K[8]=ae,K[9]=ge,K[10]=Ie,K[11]=0,K[12]=ie,K[13]=ue,K[14]=re,K[15]=1,K},A.fromPermutation=function we(K,ne){v(K);for(let be=0;be<4;be++)l(K,be,ne[be],1);return K},A.getMaxScaleOnAxis=function Oe(K){return Math.sqrt(Math.max(K[0]*K[0]+K[1]*K[1]+K[2]*K[2],K[4]*K[4]+K[5]*K[5]+K[6]*K[6],K[8]*K[8]+K[9]*K[9]+K[10]*K[10]))};const Se=[1,0,0],Ve=[0,1,0],Ne=[0,0,1];A.rotX90=k(y(),(0,r.pu)(90),Se),A.rotX180=k(y(),(0,r.pu)(180),Se),A.rotY90=k(y(),(0,r.pu)(90),Ve),A.rotY180=k(y(),(0,r.pu)(180),Ve),A.rotY270=k(y(),(0,r.pu)(270),Ve),A.rotZ90=k(y(),(0,r.pu)(90),Ne),A.rotZ180=k(y(),(0,r.pu)(180),Ne),A.rotXY90=T(y(),A.rotX90,A.rotY90),A.rotZY90=T(y(),A.rotZ90,A.rotY90),A.rotZYZ90=T(y(),A.rotZY90,A.rotZ90),A.rotZ90X180=T(y(),A.rotZ90,A.rotX180),A.rotY90Z180=T(y(),A.rotY90,A.rotZ180),A.id=c()}(t||(t={}))},5126:(tn,Ue,n)=>{"use strict";n.d(Ue,{k:()=>t});var e=n(2086),o=n(2028),r=n(1372);function t(){return t.zero()}!function(A){function y(){const j=[.1,0,0,0];return j[0]=0,j}function c(){const j=y();return j[3]=1,j}function b(j,Z,q){q*=.5;const Y=Math.sin(q);return j[0]=Y*Z[0],j[1]=Y*Z[1],j[2]=Y*Z[2],j[3]=Math.cos(q),j}function d(j,Z,q,Y){const ee=Z[0],g=Z[1],_e=Z[2],xe=Z[3];let Re,ke,we,Oe,Se,le=q[0],Ae=q[1],Be=q[2],Ce=q[3];return ke=ee*le+g*Ae+_e*Be+xe*Ce,ke<0&&(ke=-ke,le=-le,Ae=-Ae,Be=-Be,Ce=-Ce),1-ke>1e-6?(Re=Math.acos(ke),we=Math.sin(Re),Oe=Math.sin((1-Y)*Re)/we,Se=Math.sin(Y*Re)/we):(Oe=1-Y,Se=Y),j[0]=Oe*ee+Se*le,j[1]=Oe*g+Se*Ae,j[2]=Oe*_e+Se*Be,j[3]=Oe*xe+Se*Ce,j}function a(j,Z){const q=Z[0]+Z[4]+Z[8];let Y;if(q>0)Y=Math.sqrt(q+1),j[3]=.5*Y,Y=.5/Y,j[0]=(Z[5]-Z[7])*Y,j[1]=(Z[6]-Z[2])*Y,j[2]=(Z[1]-Z[3])*Y;else{let ee=0;Z[4]>Z[0]&&(ee=1),Z[8]>Z[3*ee+ee]&&(ee=2);const g=(ee+1)%3,_e=(ee+2)%3;Y=Math.sqrt(Z[3*ee+ee]-Z[3*g+g]-Z[3*_e+_e]+1),j[ee]=.5*Y,Y=.5/Y,j[3]=(Z[3*g+_e]-Z[3*_e+g])*Y,j[g]=(Z[3*g+ee]+Z[3*ee+g])*Y,j[_e]=(Z[3*_e+ee]+Z[3*ee+_e])*Y}return j}A.zero=y,A.identity=c,A.setIdentity=function i(j){j[0]=0,j[1]=0,j[2]=0,j[3]=1},A.hasNaN=function v(j){return isNaN(j[0])||isNaN(j[1])||isNaN(j[2])||isNaN(j[3])},A.create=function O(j,Z,q,Y){const ee=c();return ee[0]=j,ee[1]=Z,ee[2]=q,ee[3]=Y,ee},A.setAxisAngle=b,A.getAxisAngle=function _(j,Z){const q=2*Math.acos(Z[3]),Y=Math.sin(q/2);return 0!==Y?(j[0]=Z[0]/Y,j[1]=Z[1]/Y,j[2]=Z[2]/Y):(j[0]=1,j[1]=0,j[2]=0),q},A.multiply=function M(j,Z,q){const Y=Z[0],ee=Z[1],g=Z[2],_e=Z[3],xe=q[0],le=q[1],Ae=q[2],Be=q[3];return j[0]=Y*Be+_e*xe+ee*Ae-g*le,j[1]=ee*Be+_e*le+g*xe-Y*Ae,j[2]=g*Be+_e*Ae+Y*le-ee*xe,j[3]=_e*Be-Y*xe-ee*le-g*Ae,j},A.rotateX=function I(j,Z,q){q*=.5;const Y=Z[0],ee=Z[1],g=Z[2],_e=Z[3],xe=Math.sin(q),le=Math.cos(q);return j[0]=Y*le+_e*xe,j[1]=ee*le+g*xe,j[2]=g*le-ee*xe,j[3]=_e*le-Y*xe,j},A.rotateY=function l(j,Z,q){q*=.5;const Y=Z[0],ee=Z[1],g=Z[2],_e=Z[3],xe=Math.sin(q),le=Math.cos(q);return j[0]=Y*le-g*xe,j[1]=ee*le+_e*xe,j[2]=g*le+Y*xe,j[3]=_e*le-ee*xe,j},A.rotateZ=function m(j,Z,q){q*=.5;const Y=Z[0],ee=Z[1],g=Z[2],_e=Z[3],xe=Math.sin(q),le=Math.cos(q);return j[0]=Y*le+ee*xe,j[1]=ee*le-Y*xe,j[2]=g*le+_e*xe,j[3]=_e*le-g*xe,j},A.calculateW=function u(j,Z){const q=Z[0],Y=Z[1],ee=Z[2];return j[0]=q,j[1]=Y,j[2]=ee,j[3]=Math.sqrt(Math.abs(1-q*q-Y*Y-ee*ee)),j},A.slerp=d,A.invert=function s(j,Z){const q=Z[0],Y=Z[1],ee=Z[2],g=Z[3],_e=q*q+Y*Y+ee*ee+g*g,xe=_e?1/_e:0;return j[0]=-q*xe,j[1]=-Y*xe,j[2]=-ee*xe,j[3]=g*xe,j},A.conjugate=function C(j,Z){return j[0]=-Z[0],j[1]=-Z[1],j[2]=-Z[2],j[3]=Z[3],j},A.dot=function h(j,Z){return j[0]*Z[0]+j[1]*Z[1]+j[2]*Z[2]+j[3]*Z[3]},A.fromMat3=a,A.fromEuler=function S(j,Z,q){const[Y,ee,g]=Z,_e=Math.cos(Y/2),xe=Math.cos(ee/2),le=Math.cos(g/2),Ae=Math.sin(Y/2),Be=Math.sin(ee/2),Ce=Math.sin(g/2);switch(q){case"XYZ":j[0]=Ae*xe*le+_e*Be*Ce,j[1]=_e*Be*le-Ae*xe*Ce,j[2]=_e*xe*Ce+Ae*Be*le,j[3]=_e*xe*le-Ae*Be*Ce;break;case"YXZ":j[0]=Ae*xe*le+_e*Be*Ce,j[1]=_e*Be*le-Ae*xe*Ce,j[2]=_e*xe*Ce-Ae*Be*le,j[3]=_e*xe*le+Ae*Be*Ce;break;case"ZXY":j[0]=Ae*xe*le-_e*Be*Ce,j[1]=_e*Be*le+Ae*xe*Ce,j[2]=_e*xe*Ce+Ae*Be*le,j[3]=_e*xe*le-Ae*Be*Ce;break;case"ZYX":j[0]=Ae*xe*le-_e*Be*Ce,j[1]=_e*Be*le+Ae*xe*Ce,j[2]=_e*xe*Ce-Ae*Be*le,j[3]=_e*xe*le+Ae*Be*Ce;break;case"YZX":j[0]=Ae*xe*le+_e*Be*Ce,j[1]=_e*Be*le+Ae*xe*Ce,j[2]=_e*xe*Ce-Ae*Be*le,j[3]=_e*xe*le-Ae*Be*Ce;break;case"XZY":j[0]=Ae*xe*le-_e*Be*Ce,j[1]=_e*Be*le-Ae*xe*Ce,j[2]=_e*xe*Ce+Ae*Be*le,j[3]=_e*xe*le+Ae*Be*Ce;break;default:(0,r.dr)(q)}return j};const D=[0,0,0];function V(j,Z){const q=Z[0],Y=Z[1],ee=Z[2],g=Z[3];let _e=q*q+Y*Y+ee*ee+g*g;return _e>0&&(_e=1/Math.sqrt(_e),j[0]=q*_e,j[1]=Y*_e,j[2]=ee*_e,j[3]=g*_e),j}A.fromUnitVec3=function R(j,Z,q){let Y=e.e.dot(Z,q)+1;return YMath.abs(Z[2])?e.e.set(D,-Z[1],Z[0],0):e.e.set(D,0,-Z[2],Z[1])):e.e.cross(D,Z,q),j[0]=D[0],j[1]=D[1],j[2]=D[2],j[3]=Y,V(j,j),j},A.clone=function f(j){const Z=y();return Z[0]=j[0],Z[1]=j[1],Z[2]=j[2],Z[3]=j[3],Z},A.toArray=function p(j,Z,q){return Z[q+0]=j[0],Z[q+1]=j[1],Z[q+2]=j[2],Z[q+3]=j[3],Z},A.fromArray=function E(j,Z,q){return j[0]=Z[q+0],j[1]=Z[q+1],j[2]=Z[q+2],j[3]=Z[q+3],j},A.copy=function T(j,Z){return j[0]=Z[0],j[1]=Z[1],j[2]=Z[2],j[3]=Z[3],j},A.set=function L(j,Z,q,Y,ee){return j[0]=Z,j[1]=q,j[2]=Y,j[3]=ee,j},A.exactEquals=function w(j,Z){return j[0]===Z[0]&&j[1]===Z[1]&&j[2]===Z[2]&&j[3]===Z[3]},A.equals=function Q(j,Z){const q=j[0],Y=j[1],ee=j[2],g=j[3],_e=Z[0],xe=Z[1],le=Z[2],Ae=Z[3];return Math.abs(q-_e)<=o.p*Math.max(1,Math.abs(q),Math.abs(_e))&&Math.abs(Y-xe)<=o.p*Math.max(1,Math.abs(Y),Math.abs(xe))&&Math.abs(ee-le)<=o.p*Math.max(1,Math.abs(ee),Math.abs(le))&&Math.abs(g-Ae)<=o.p*Math.max(1,Math.abs(g),Math.abs(Ae))},A.add=function G(j,Z,q){return j[0]=Z[0]+q[0],j[1]=Z[1]+q[1],j[2]=Z[2]+q[2],j[3]=Z[3]+q[3],j},A.normalize=V;const U=[0,0,0],N=[1,0,0],k=[0,1,0];A.rotationTo=function H(j,Z,q){const Y=e.e.dot(Z,q);return Y<-.999999?(e.e.cross(U,N,Z),e.e.magnitude(U)<1e-6&&e.e.cross(U,k,Z),e.e.normalize(U,U),b(j,U,Math.PI),j):Y>.999999?(j[0]=0,j[1]=0,j[2]=0,j[3]=1,j):(e.e.cross(U,Z,q),j[0]=U[0],j[1]=U[1],j[2]=U[2],j[3]=1+Y,V(j,j))};const $=y(),J=y();A.sqlerp=function W(j,Z,q,Y,ee,g){return d($,Z,ee,g),d(J,q,Y,g),d(j,$,J,2*g*(1-g)),j};const te=[0,0,0,0,0,0,0,0,0];A.setAxes=function de(j,Z,q,Y){return te[0]=q[0],te[3]=q[1],te[6]=q[2],te[1]=Y[0],te[4]=Y[1],te[7]=Y[2],te[2]=-Z[0],te[5]=-Z[1],te[8]=-Z[2],V(j,a(j,te))},A.toString=function ye(j,Z){return`[${j[0].toPrecision(Z)} ${j[1].toPrecision(Z)} ${j[2].toPrecision(Z)} ${j[3].toPrecision(Z)}]`},A.Identity=c()}(t||(t={}))},325:(tn,Ue,n)=>{"use strict";function e(){return e.zero()}n.d(Ue,{Z:()=>e}),function(o){function r(){const f=[.1,0];return f[0]=0,f}o.zero=r,o.clone=function t(f){const p=r();return p[0]=f[0],p[1]=f[1],p},o.create=function A(f,p){const E=r();return E[0]=f,E[1]=p,E},o.hasNaN=function y(f){return isNaN(f[0])||isNaN(f[1])},o.toArray=function c(f,p,E){return p[E+0]=f[0],p[E+1]=f[1],p},o.fromArray=function i(f,p,E){return f[0]=p[E+0],f[1]=p[E+1],f},o.copy=function v(f,p){return f[0]=p[0],f[1]=p[1],f},o.set=function O(f,p,E){return f[0]=p,f[1]=E,f},o.add=function b(f,p,E){return f[0]=p[0]+E[0],f[1]=p[1]+E[1],f},o.sub=function _(f,p,E){return f[0]=p[0]-E[0],f[1]=p[1]-E[1],f},o.mul=function M(f,p,E){return f[0]=p[0]*E[0],f[1]=p[1]*E[1],f},o.div=function I(f,p,E){return f[0]=p[0]/E[0],f[1]=p[1]/E[1],f},o.scale=function l(f,p,E){return f[0]=p[0]*E,f[1]=p[1]*E,f},o.round=function m(f,p){return f[0]=Math.round(p[0]),f[1]=Math.round(p[1]),f},o.ceil=function u(f,p){return f[0]=Math.ceil(p[0]),f[1]=Math.ceil(p[1]),f},o.floor=function d(f,p){return f[0]=Math.floor(p[0]),f[1]=Math.floor(p[1]),f},o.distance=function s(f,p){const E=p[0]-f[0],T=p[1]-f[1];return Math.sqrt(E*E+T*T)},o.squaredDistance=function C(f,p){const E=p[0]-f[0],T=p[1]-f[1];return E*E+T*T},o.magnitude=function h(f){const p=f[0],E=f[1];return Math.sqrt(p*p+E*E)},o.squaredMagnitude=function a(f){const p=f[0],E=f[1];return p*p+E*E},o.inverse=function S(f,p){return f[0]=1/p[0],f[1]=1/p[1],f},o.areEqual=function D(f,p){return f[0]===p[0]&&f[1]===p[1]},o.toString=function R(f,p){return`[${f[0].toPrecision(p)} ${f[1].toPrecision(p)}}]`}}(e||(e={}))},2086:(tn,Ue,n)=>{"use strict";n.d(Ue,{e:()=>A});var e=n(6639),o=n(127),r=n(2028);const t=isFinite;function A(){return A.zero()}!function(y){function c(){const Me=[.1,0,0];return Me[0]=0,Me}function m(Me,Ke,ut){const Kt=c();return Kt[0]=Me,Kt[1]=Ke,Kt[2]=ut,Kt}function s(Me,Ke){return Me[0]=Ke[0],Me[1]=Ke[1],Me[2]=Ke[2],Me}function C(Me,Ke,ut){return Me[0]=Ke[0]+ut[0],Me[1]=Ke[1]+ut[1],Me[2]=Ke[2]+ut[2],Me}function h(Me,Ke,ut){return Me[0]=Ke[0]-ut[0],Me[1]=Ke[1]-ut[1],Me[2]=Ke[2]-ut[2],Me}function D(Me,Ke,ut){return Me[0]=Ke[0]*ut,Me[1]=Ke[1]*ut,Me[2]=Ke[2]*ut,Me}function R(Me,Ke,ut,Kt){return Me[0]=Ke[0]+ut[0]*Kt,Me[1]=Ke[1]+ut[1]*Kt,Me[2]=Ke[2]+ut[2]*Kt,Me}function J(Me){const Ke=Me[0],ut=Me[1],Kt=Me[2];return Ke*Ke+ut*ut+Kt*Kt}function te(Me,Ke){return Me[0]=-Ke[0],Me[1]=-Ke[1],Me[2]=-Ke[2],Me}function ye(Me,Ke){const ut=Ke[0],Kt=Ke[1],sn=Ke[2];let gt=ut*ut+Kt*Kt+sn*sn;return gt>0&&(gt=1/Math.sqrt(gt),Me[0]=Ke[0]*gt,Me[1]=Ke[1]*gt,Me[2]=Ke[2]*gt),Me}function j(Me,Ke){return Me[0]*Ke[0]+Me[1]*Ke[1]+Me[2]*Ke[2]}function Z(Me,Ke,ut){const Kt=Ke[0],sn=Ke[1],gt=Ke[2],yt=ut[0],At=ut[1],Gt=ut[2];return Me[0]=sn*Gt-gt*At,Me[1]=gt*yt-Kt*Gt,Me[2]=Kt*At-sn*yt,Me}y.zero=c,y.clone=function i(Me){const Ke=c();return Ke[0]=Me[0],Ke[1]=Me[1],Ke[2]=Me[2],Ke},y.isFinite=function v(Me){return t(Me[0])&&t(Me[1])&&t(Me[2])},y.hasNaN=function O(Me){return isNaN(Me[0])||isNaN(Me[1])||isNaN(Me[2])},y.setNaN=function b(Me){return Me[0]=NaN,Me[1]=NaN,Me[2]=NaN,Me},y.fromObj=function _(Me){return m(Me.x,Me.y,Me.z)},y.toObj=function M(Me){return{x:Me[0],y:Me[1],z:Me[2]}},y.fromArray=function I(Me,Ke,ut){return Me[0]=Ke[ut+0],Me[1]=Ke[ut+1],Me[2]=Ke[ut+2],Me},y.toArray=function l(Me,Ke,ut){return Ke[ut+0]=Me[0],Ke[ut+1]=Me[1],Ke[ut+2]=Me[2],Ke},y.create=m,y.ofArray=function u(Me){const Ke=c();return Ke[0]=Me[0],Ke[1]=Me[1],Ke[2]=Me[2],Ke},y.set=function d(Me,Ke,ut,Kt){return Me[0]=Ke,Me[1]=ut,Me[2]=Kt,Me},y.copy=s,y.add=C,y.sub=h,y.mul=function a(Me,Ke,ut){return Me[0]=Ke[0]*ut[0],Me[1]=Ke[1]*ut[1],Me[2]=Ke[2]*ut[2],Me},y.div=function S(Me,Ke,ut){return Me[0]=Ke[0]/ut[0],Me[1]=Ke[1]/ut[1],Me[2]=Ke[2]/ut[2],Me},y.scale=D,y.scaleAndAdd=R,y.scaleAndSub=function f(Me,Ke,ut,Kt){return Me[0]=Ke[0]-ut[0]*Kt,Me[1]=Ke[1]-ut[1]*Kt,Me[2]=Ke[2]-ut[2]*Kt,Me},y.addScalar=function p(Me,Ke,ut){return Me[0]=Ke[0]+ut,Me[1]=Ke[1]+ut,Me[2]=Ke[2]+ut,Me},y.subScalar=function E(Me,Ke,ut){return Me[0]=Ke[0]-ut,Me[1]=Ke[1]-ut,Me[2]=Ke[2]-ut,Me},y.round=function T(Me,Ke){return Me[0]=Math.round(Ke[0]),Me[1]=Math.round(Ke[1]),Me[2]=Math.round(Ke[2]),Me},y.ceil=function L(Me,Ke){return Me[0]=Math.ceil(Ke[0]),Me[1]=Math.ceil(Ke[1]),Me[2]=Math.ceil(Ke[2]),Me},y.floor=function w(Me,Ke){return Me[0]=Math.floor(Ke[0]),Me[1]=Math.floor(Ke[1]),Me[2]=Math.floor(Ke[2]),Me},y.trunc=function Q(Me,Ke){return Me[0]=Math.trunc(Ke[0]),Me[1]=Math.trunc(Ke[1]),Me[2]=Math.trunc(Ke[2]),Me},y.abs=function G(Me,Ke){return Me[0]=Math.abs(Ke[0]),Me[1]=Math.abs(Ke[1]),Me[2]=Math.abs(Ke[2]),Me},y.min=function V(Me,Ke,ut){return Me[0]=Math.min(Ke[0],ut[0]),Me[1]=Math.min(Ke[1],ut[1]),Me[2]=Math.min(Ke[2],ut[2]),Me},y.max=function U(Me,Ke,ut){return Me[0]=Math.max(Ke[0],ut[0]),Me[1]=Math.max(Ke[1],ut[1]),Me[2]=Math.max(Ke[2],ut[2]),Me},y.clamp=function N(Me,Ke,ut,Kt){return Me[0]=Math.max(ut[0],Math.min(Kt[0],Ke[0])),Me[1]=Math.max(ut[1],Math.min(Kt[1],Ke[1])),Me[2]=Math.max(ut[2],Math.min(Kt[2],Ke[2])),Me},y.distance=function k(Me,Ke){const ut=Ke[0]-Me[0],Kt=Ke[1]-Me[1],sn=Ke[2]-Me[2];return Math.sqrt(ut*ut+Kt*Kt+sn*sn)},y.squaredDistance=function H(Me,Ke){const ut=Ke[0]-Me[0],Kt=Ke[1]-Me[1],sn=Ke[2]-Me[2];return ut*ut+Kt*Kt+sn*sn},y.magnitude=function $(Me){const Ke=Me[0],ut=Me[1],Kt=Me[2];return Math.sqrt(Ke*Ke+ut*ut+Kt*Kt)},y.squaredMagnitude=J,y.setMagnitude=function W(Me,Ke,ut){return D(Me,ye(Me,Ke),ut)},y.negate=te,y.inverse=function de(Me,Ke){return Me[0]=1/Ke[0],Me[1]=1/Ke[1],Me[2]=1/Ke[2],Me},y.normalize=ye,y.dot=j,y.cross=Z,y.lerp=function q(Me,Ke,ut,Kt){const sn=Ke[0],gt=Ke[1],yt=Ke[2];return Me[0]=sn+Kt*(ut[0]-sn),Me[1]=gt+Kt*(ut[1]-gt),Me[2]=yt+Kt*(ut[2]-yt),Me};const Y=c();function Se(Me,Ke){const ut=Math.sqrt(J(Me)*J(Ke));if(0===ut)return Math.PI/2;const Kt=j(Me,Ke)/ut;return Math.acos((0,o.qE)(Kt,-1,1))}y.slerp=function ee(Me,Ke,ut,Kt){const sn=(0,o.qE)(j(Ke,ut),-1,1),gt=Math.acos(sn)*Kt;return R(Y,ut,Ke,-sn),ye(Y,Y),C(Me,D(Me,Ke,Math.cos(gt)),D(Y,Y,Math.sin(gt)))},y.hermite=function g(Me,Ke,ut,Kt,sn,gt){const yt=gt*gt,At=yt*(2*gt-3)+1,Gt=yt*(gt-2)+gt,rn=yt*(gt-1),tt=yt*(3-2*gt);return Me[0]=Ke[0]*At+ut[0]*Gt+Kt[0]*rn+sn[0]*tt,Me[1]=Ke[1]*At+ut[1]*Gt+Kt[1]*rn+sn[1]*tt,Me[2]=Ke[2]*At+ut[2]*Gt+Kt[2]*rn+sn[2]*tt,Me},y.bezier=function _e(Me,Ke,ut,Kt,sn,gt){const yt=1-gt,At=yt*yt,Gt=gt*gt,rn=At*yt,tt=3*gt*At,Mt=3*Gt*yt,nn=Gt*gt;return Me[0]=Ke[0]*rn+ut[0]*tt+Kt[0]*Mt+sn[0]*nn,Me[1]=Ke[1]*rn+ut[1]*tt+Kt[1]*Mt+sn[1]*nn,Me[2]=Ke[2]*rn+ut[2]*tt+Kt[2]*Mt+sn[2]*nn,Me},y.quadraticBezier=function xe(Me,Ke,ut,Kt,sn){return Me[0]=(0,o.iD)(Ke[0],ut[0],Kt[0],sn),Me[1]=(0,o.iD)(Ke[1],ut[1],Kt[1],sn),Me[2]=(0,o.iD)(Ke[2],ut[2],Kt[2],sn),Me},y.spline=function le(Me,Ke,ut,Kt,sn,gt,yt){return Me[0]=(0,o.Y7)(Ke[0],ut[0],Kt[0],sn[0],gt,yt),Me[1]=(0,o.Y7)(Ke[1],ut[1],Kt[1],sn[1],gt,yt),Me[2]=(0,o.Y7)(Ke[2],ut[2],Kt[2],sn[2],gt,yt),Me},y.random=function Ae(Me,Ke){const ut=2*Math.random()*Math.PI,Kt=2*Math.random()-1,sn=Math.sqrt(1-Kt*Kt)*Ke;return Me[0]=Math.cos(ut)*sn,Me[1]=Math.sin(ut)*sn,Me[2]=Kt*Ke,Me},y.transformMat4=function Be(Me,Ke,ut){const Kt=Ke[0],sn=Ke[1],gt=Ke[2],yt=1/(ut[3]*Kt+ut[7]*sn+ut[11]*gt+ut[15]||1);return Me[0]=(ut[0]*Kt+ut[4]*sn+ut[8]*gt+ut[12])*yt,Me[1]=(ut[1]*Kt+ut[5]*sn+ut[9]*gt+ut[13])*yt,Me[2]=(ut[2]*Kt+ut[6]*sn+ut[10]*gt+ut[14])*yt,Me},y.transformDirection=function Ce(Me,Ke,ut){const Kt=Ke[0],sn=Ke[1],gt=Ke[2];return Me[0]=ut[0]*Kt+ut[4]*sn+ut[8]*gt,Me[1]=ut[1]*Kt+ut[5]*sn+ut[9]*gt,Me[2]=ut[2]*Kt+ut[6]*sn+ut[10]*gt,ye(Me,Me)},y.transformMat4Offset=function Re(Me,Ke,ut,Kt,sn,gt){const yt=Ke[0+sn],At=Ke[1+sn],Gt=Ke[2+sn],rn=1/(ut[3+gt]*yt+ut[7+gt]*At+ut[11+gt]*Gt+ut[15+gt]||1);return Me[0+Kt]=(ut[0+gt]*yt+ut[4+gt]*At+ut[8+gt]*Gt+ut[12+gt])*rn,Me[1+Kt]=(ut[1+gt]*yt+ut[5+gt]*At+ut[9+gt]*Gt+ut[13+gt])*rn,Me[2+Kt]=(ut[2+gt]*yt+ut[6+gt]*At+ut[10+gt]*Gt+ut[14+gt])*rn,Me},y.transformDirectionOffset=function ke(Me,Ke,ut,Kt,sn,gt){const yt=Ke[0+sn],At=Ke[1+sn],Gt=Ke[2+sn];Me[0+Kt]=ut[0+gt]*yt+ut[4+gt]*At+ut[8+gt]*Gt,Me[1+Kt]=ut[1+gt]*yt+ut[5+gt]*At+ut[9+gt]*Gt,Me[2+Kt]=ut[2+gt]*yt+ut[6+gt]*At+ut[10+gt]*Gt;const rn=Math.hypot(Me[0+Kt],Me[1+Kt],Me[2+Kt]);return rn>0&&(Me[0+Kt]/=rn,Me[1+Kt]/=rn,Me[2+Kt]/=rn),Me},y.transformMat3=function we(Me,Ke,ut){const Kt=Ke[0],sn=Ke[1],gt=Ke[2];return Me[0]=Kt*ut[0]+sn*ut[3]+gt*ut[6],Me[1]=Kt*ut[1]+sn*ut[4]+gt*ut[7],Me[2]=Kt*ut[2]+sn*ut[5]+gt*ut[8],Me},y.transformQuat=function Oe(Me,Ke,ut){const Kt=Ke[0],sn=Ke[1],gt=Ke[2],yt=ut[0],At=ut[1],Gt=ut[2],rn=ut[3],tt=rn*Kt+At*gt-Gt*sn,Mt=rn*sn+Gt*Kt-yt*gt,nn=rn*gt+yt*sn-At*Kt,bn=-yt*Kt-At*sn-Gt*gt;return Me[0]=tt*rn+bn*-yt+Mt*-Gt-nn*-At,Me[1]=Mt*rn+bn*-At+nn*-yt-tt*-Gt,Me[2]=nn*rn+bn*-Gt+tt*-At-Mt*-yt,Me},y.angle=Se;const Ve=c(),Ne=c(),K=c(),ne=c(),be=c(),Te=c(),ie=c();y.dihedralAngle=function ue(Me,Ke,ut,Kt){h(Ve,Me,Ke),h(Ne,ut,Ke),h(K,Ke,ut),h(ne,Kt,ut),Z(be,Ve,Ne),Z(Te,K,ne);const sn=Se(be,Te);return Z(ie,be,Te),j(Ne,ie)>0?sn:-sn},y.directionFromSpherical=function re(Me,Ke,ut,Kt){return y.set(Me,Kt*Math.cos(ut)*Math.sin(Ke),Kt*Math.sin(ut)*Math.sin(Ke),Kt*Math.cos(Ke))},y.exactEquals=function ve(Me,Ke){return Me[0]===Ke[0]&&Me[1]===Ke[1]&&Me[2]===Ke[2]},y.equals=function ce(Me,Ke){const ut=Me[0],Kt=Me[1],sn=Me[2],gt=Ke[0],yt=Ke[1],At=Ke[2];return Math.abs(ut-gt)<=r.p*Math.max(1,Math.abs(ut),Math.abs(gt))&&Math.abs(Kt-yt)<=r.p*Math.max(1,Math.abs(Kt),Math.abs(yt))&&Math.abs(sn-At)<=r.p*Math.max(1,Math.abs(sn),Math.abs(At))};const se=c();y.makeRotation=function ae(Me,Ke,ut){const Kt=Se(Ke,ut);if(Math.abs(Kt)<1e-4)return e.$.setIdentity(Me);if(Math.abs(Kt-Math.PI)0?s(Me,Ke):te(Me,s(Me,Ke)),Me};const pn=c(),$e=c();y.triangleNormal=function mt(Me,Ke,ut,Kt){return h(pn,ut,Ke),h($e,Kt,Ke),ye(Me,Z(Me,pn,$e))},y.toString=function _t(Me,Ke){return`[${Me[0].toPrecision(Ke)} ${Me[1].toPrecision(Ke)} ${Me[2].toPrecision(Ke)}]`},y.origin=m(0,0,0),y.unit=m(1,1,1),y.negUnit=m(-1,-1,-1),y.unitX=m(1,0,0),y.unitY=m(0,1,0),y.unitZ=m(0,0,1),y.negUnitX=m(-1,0,0),y.negUnitY=m(0,-1,0),y.negUnitZ=m(0,0,-1)}(A||(A={}))},8599:(tn,Ue,n)=>{"use strict";n.d(Ue,{Z:()=>o});var e=n(2028);function o(){return o.zero()}!function(r){function t(){const w=[.1,0,0,0];return w[0]=0,w}function c(w,Q){return w[0]=Q.center[0],w[1]=Q.center[1],w[2]=Q.center[2],w[3]=Q.radius,w}r.zero=t,r.clone=function A(w){const Q=t();return Q[0]=w[0],Q[1]=w[1],Q[2]=w[2],Q[3]=w[3],Q},r.create=function y(w,Q,G,V){const U=t();return U[0]=w,U[1]=Q,U[2]=G,U[3]=V,U},r.fromSphere=c,r.ofSphere=function i(w){return c(t(),w)},r.hasNaN=function v(w){return isNaN(w[0])||isNaN(w[1])||isNaN(w[2])||isNaN(w[3])},r.toArray=function O(w,Q,G){return Q[G+0]=w[0],Q[G+1]=w[1],Q[G+2]=w[2],Q[G+3]=w[3],Q},r.fromArray=function b(w,Q,G){return w[0]=Q[G+0],w[1]=Q[G+1],w[2]=Q[G+2],w[3]=Q[G+3],w},r.toVec3Array=function _(w,Q,G){Q[G+0]=w[0],Q[G+1]=w[1],Q[G+2]=w[2]},r.fromVec3Array=function M(w,Q,G){return w[0]=Q[G+0],w[1]=Q[G+1],w[2]=Q[G+2],w[3]=0,w},r.copy=function I(w,Q){return w[0]=Q[0],w[1]=Q[1],w[2]=Q[2],w[3]=Q[3],w},r.set=function l(w,Q,G,V,U){return w[0]=Q,w[1]=G,w[2]=V,w[3]=U,w},r.add=function m(w,Q,G){return w[0]=Q[0]+G[0],w[1]=Q[1]+G[1],w[2]=Q[2]+G[2],w[3]=Q[3]+G[3],w},r.distance=function u(w,Q){const G=Q[0]-w[0],V=Q[1]-w[1],U=Q[2]-w[2],N=Q[3]-w[3];return Math.sqrt(G*G+V*V+U*U+N*N)},r.scale=function d(w,Q,G){return w[0]=Q[0]*G,w[1]=Q[1]*G,w[2]=Q[2]*G,w[4]=Q[4]*G,w},r.round=function s(w,Q){return w[0]=Math.round(Q[0]),w[1]=Math.round(Q[1]),w[2]=Math.round(Q[2]),w[3]=Math.round(Q[3]),w},r.ceil=function C(w,Q){return w[0]=Math.ceil(Q[0]),w[1]=Math.ceil(Q[1]),w[2]=Math.ceil(Q[2]),w[3]=Math.ceil(Q[3]),w},r.floor=function h(w,Q){return w[0]=Math.floor(Q[0]),w[1]=Math.floor(Q[1]),w[2]=Math.floor(Q[2]),w[3]=Math.floor(Q[3]),w},r.squaredDistance=function a(w,Q){const G=Q[0]-w[0],V=Q[1]-w[1],U=Q[2]-w[2],N=Q[3]-w[3];return G*G+V*V+U*U+N*N},r.norm=function S(w){const Q=w[0],G=w[1],V=w[2],U=w[3];return Math.sqrt(Q*Q+G*G+V*V+U*U)},r.squaredNorm=function D(w){const Q=w[0],G=w[1],V=w[2],U=w[3];return Q*Q+G*G+V*V+U*U},r.transformMat4=function R(w,Q,G){const V=Q[0],U=Q[1],N=Q[2],k=Q[3];return w[0]=G[0]*V+G[4]*U+G[8]*N+G[12]*k,w[1]=G[1]*V+G[5]*U+G[9]*N+G[13]*k,w[2]=G[2]*V+G[6]*U+G[10]*N+G[14]*k,w[3]=G[3]*V+G[7]*U+G[11]*N+G[15]*k,w},r.dot=function f(w,Q){return w[0]*Q[0]+w[1]*Q[1]+w[2]*Q[2]+w[3]*Q[3]},r.inverse=function p(w,Q){return w[0]=1/Q[0],w[1]=1/Q[1],w[2]=1/Q[2],w[3]=1/Q[3],w},r.exactEquals=function E(w,Q){return w[0]===Q[0]&&w[1]===Q[1]&&w[2]===Q[2]&&w[3]===Q[3]},r.equals=function T(w,Q){const G=w[0],V=w[1],U=w[2],N=w[3],k=Q[0],H=Q[1],$=Q[2],J=Q[3];return Math.abs(G-k)<=e.p*Math.max(1,Math.abs(G),Math.abs(k))&&Math.abs(V-H)<=e.p*Math.max(1,Math.abs(V),Math.abs(H))&&Math.abs(U-$)<=e.p*Math.max(1,Math.abs(U),Math.abs($))&&Math.abs(N-J)<=e.p*Math.max(1,Math.abs(N),Math.abs(J))},r.toString=function L(w,Q){return`[${w[0].toPrecision(Q)} ${w[1].toPrecision(Q)} ${w[2].toPrecision(Q)} ${w[3].toPrecision(Q)}]`}}(o||(o={}))},1778:(tn,Ue,n)=>{"use strict";var e,o;n.d(Ue,{u:()=>e}),(o=e||(e={})).create=function r(I,l,m=Float32Array){const u=I*l;return{data:new m(u),size:u,cols:I,rows:l}},o.get=function t(I,l,m){return I.data[I.rows*m+l]},o.set=function A(I,l,m,u){return I.data[I.rows*m+l]=u,I},o.add=function y(I,l,m,u){return I.data[I.rows*m+l]+=u,I},o.makeZero=function c(I){return I.data.fill(0),I},o.clone=function i(I){return{data:I.data.slice(),size:I.size,cols:I.cols,rows:I.rows}},o.fromArray=function v(I,l,m){return{data:I,size:l*m,cols:l,rows:m}},o.transpose=function O(I,l){if(I.cols!==l.rows||I.rows!==l.cols)throw new Error("transpose: matrix dimensions incompatible");if(I.data===l.data)throw new Error("transpose: matrices share memory");const m=l.rows,u=l.cols,d=l.data,s=I.data;for(let C=0,h=0,a=0;C{"use strict";n.d(Ue,{c:()=>b});var e=n(1778),o=n(2086);function r(_,M,I,l){l=_[M],_[M]=_[I],_[I]=l}function t(_,M){return(_=Math.abs(_))>(M=Math.abs(M))?(M/=_,_*Math.sqrt(1+M*M)):M>0?(_/=M,M*Math.sqrt(1+_*_)):0}var b,v=n(5384),O=n(2028);!function(_){function I(d){if(3===d.length)return v.n.create(o.e.fromArray((0,o.e)(),d,0),o.e.create(1,0,0),o.e.create(0,1,0),o.e.create(0,0,1));const s=e.u.fromArray(d,3,d.length/3),C=s.rows,h=C/3,a=e.u.create(3,3),S=e.u.create(1,3),D=e.u.create(3,3),R=e.u.create(3,3),f=e.u.meanRows(s),p=e.u.subRows(e.u.clone(s),f),E=e.u.transpose(e.u.create(C,3),p);e.u.multiplyABt(a,E,E),function i(_,M,I,l){let m=0,u=0;const d=_.rows,s=_.cols;let C=d,h=s;C>16?Z:-Z,_[a*M+D]=j;for(R=0;R<2;R++)for(S=0;S0?W>C&&(C=W):W>h&&(h=W),o.e.projectPointOnVector(f,o.e.fromArray(f,d,H),T.dirB,E);const te=o.e.dot(T.dirB,o.e.normalize(p,o.e.sub(p,f,E))),de=o.e.distance(f,E);te>0?de>a&&(a=de):de>S&&(S=de),o.e.projectPointOnVector(f,o.e.fromArray(f,d,H),T.dirC,E);const ye=o.e.dot(T.dirC,o.e.normalize(p,o.e.sub(p,f,E))),j=o.e.distance(f,E);ye>0?j>D&&(D=j):j>R&&(R=j)}const L=o.e.setMagnitude((0,o.e)(),T.dirA,(C+h)/2),w=o.e.setMagnitude((0,o.e)(),T.dirB,(a+S)/2),Q=o.e.setMagnitude((0,o.e)(),T.dirC,(D+R)/2),G=o.e.isFinite(L),V=o.e.isFinite(w),U=o.e.isFinite(Q),N=(0,o.e)(),k=function(H,$,J){o.e.copy(m,E),G&&o.e.scaleAndAdd(m,m,T.dirA,H),V&&o.e.scaleAndAdd(m,m,T.dirB,$),U&&o.e.scaleAndAdd(m,m,T.dirC,J),o.e.add(N,N,m)};return k(C,a,D),k(C,a,-R),k(C,-S,-R),k(C,-S,D),k(-h,-S,-R),k(-h,-S,D),k(-h,a,D),k(-h,a,-R),o.e.scale(N,N,1/8),v.n.create(N,L,w,Q)}_.calculateBoxAxes=u}(b||(b={}))},4490:(tn,Ue,n)=>{"use strict";n.d(Ue,{H:()=>t,N7:()=>c,TY:()=>y,fC:()=>e,k4:()=>i,pu:()=>r,r6:()=>A});const e=Math.PI/2,o=Math.PI/180;function r(v){return v*o}function t(v){return v/o}function A(v){return 0!==v&&!(v&v-1)}function y(...v){let O=0,b=0;for(let _=0,M=v.length;_b&&(O=I,b=l)}return O}function c(v,O){return v*O}function i(v){let O=0,b=0;const _=[0,-1],M=2*v+1,I=M/2,l=[];for(let m=Math.pow(M,2);m>0;--m)-I0&&O===1-b)&&([_[0],_[1]]=[-_[1],_[0]]),O+=_[0],b+=_[1];return l}},2921:(tn,Ue,n)=>{"use strict";n.d(Ue,{X:()=>ae});var e=n(467),o=n(6651),r=n(3559),t=n(4632),A=n(1692),y=n(3543),c=n(7754),i=n(5384),v=n(4369),O=n(1490),b=n(2008),_=n(2434),M=n(2789),I=n(2629),m=n(6724),u=n(8382);function d($e,mt){return mt?1===mt.length?(0,u.m1)(mt.charCodeAt(0),$e):2===mt.length?(0,u.m1)(mt.charCodeAt(0),(0,u.m1)(mt.charCodeAt(1),$e)):`${$e} ${mt}`:$e}function s($e,mt,_t,Me){if($e.has(mt)){const Ke=$e.get(mt);Ke.has(_t)||Ke.set(_t,Me)}else{const Ke=new Map;$e.set(mt,Ke),Ke.set(_t,Me)}}function C($e){throw new Error(`Missing entity entry for entity id '${$e}'.`)}const a=m.or.EmptyResidueKey();class S{getEntityFromChain(mt){return this.map.chain_index_entity_index[mt]}findEntity(mt){const _t=this.map.label_asym_id.get(mt);return void 0!==_t?_t:-1}findChainLabel(mt){const _t=this.entityIndex(mt.label_entity_id);if(_t<0||!this.map.entity_index_label_asym_id.has(_t))return-1;const Me=this.map.entity_index_label_asym_id.get(_t);return Me&&Me.has(mt.label_asym_id)?Me.get(mt.label_asym_id):-1}findChainAuth(mt){if(!this.map.auth_asym_id_auth_seq_id.has(mt.auth_asym_id))return-1;const _t=this.map.auth_asym_id_auth_seq_id.get(mt.auth_asym_id);return _t.has(mt.auth_seq_id)?_t.get(mt.auth_seq_id):-1}findResidue(mt,_t,Me,Ke){let ut;1===arguments.length?ut=mt:(a.label_entity_id=mt,a.label_asym_id=_t,a.auth_seq_id=Me,a.pdbx_PDB_ins_code=Ke,ut=a);const Kt=this.findChainLabel(ut);if(Kt<0)return-1;const sn=this.map.chain_index_auth_seq_id.get(Kt),gt=d(ut.auth_seq_id,ut.pdbx_PDB_ins_code||"");return sn.has(gt)?sn.get(gt):-1}findResidueLabel(mt){const _t=this.findChainLabel(mt);if(_t<0)return-1;const Me=this.map.chain_index_label_seq_id.get(_t),Ke=d(mt.label_seq_id,mt.pdbx_PDB_ins_code||"");return Me.has(Ke)?Me.get(Ke):-1}findResidueAuth(mt){const _t=this.findChainAuth(mt);if(_t<0)return-1;const Me=this.map.chain_index_auth_seq_id.get(_t),Ke=d(mt.auth_seq_id,mt.pdbx_PDB_ins_code||"");return Me.has(Ke)?Me.get(Ke):-1}findResidueInsertion(mt){const _t=this.findChainLabel(mt);if(_t<0)return-1;const Me=this.map.chain_index_label_seq_id.get(_t),Ke=d(mt.label_seq_id,mt.pdbx_PDB_ins_code||"");if(Me.has(Ke))return Me.get(Ke);const ut=y.SortedArray.findPredecessorIndex(this.map.label_seq_id,mt.label_seq_id),Kt=m.vE.chainStartResidueIndex(this.map.segments,_t);if(ut=sn?sn:ut}findAtom(mt){const _t=this.findResidue(mt);return _t<0?-1:typeof mt.label_alt_id>"u"?D(this.residueOffsets[_t],this.residueOffsets[_t+1],this.map.label_atom_id,mt.label_atom_id):f(this.residueOffsets[_t],this.residueOffsets[_t+1],this.map.label_atom_id,this.map.label_alt_id,mt.label_atom_id,mt.label_alt_id)}findAtomAuth(mt){const _t=this.findResidueAuth(mt);return _t<0?-1:typeof mt.label_alt_id>"u"?D(this.residueOffsets[_t],this.residueOffsets[_t+1],this.map.auth_atom_id,mt.auth_atom_id):f(this.residueOffsets[_t],this.residueOffsets[_t+1],this.map.auth_atom_id,this.map.label_alt_id,mt.auth_atom_id,mt.label_alt_id)}findAtomOnResidue(mt,_t,Me){return typeof Me>"u"?D(this.residueOffsets[mt],this.residueOffsets[mt+1],this.map.label_atom_id,_t):f(this.residueOffsets[mt],this.residueOffsets[mt+1],this.map.label_atom_id,this.map.label_alt_id,_t,Me)}findAtomsOnResidue(mt,_t){return function R($e,mt,_t,Me){for(let Ke=$e;Ke=gt[yt+1]&&(yt+=1,At=0),Kt[Gt]=++At;Ke.label_seq_id=o.VP.ofIntArray(Kt)}return o.XI.columnToArray(Ke,"label_seq_id",Int32Array),o.XI.columnToArray(Ke,"auth_seq_id",Int32Array),{atoms:Me,residues:Ke,chains:ut,atomSourceIndex:mt}}($e,mt,Kt),gt=function V($e,mt){const _t=new Map;if(!T.K4.is(mt))return _t;const{molstar_atom_site_operator_mapping:Me}=(0,c.Pd)(O.mQ,mt.data.frame);if(0===Me._rowCount)return _t;const Ke=new Map,ut=new Map;for(let At=0;At-1,findChainKey:()=>-1,getEntityFromChain:()=>-1,count:0,entity_id:o.VP.Undefined(0,o.VP.Schema.str),asym_id:o.VP.Undefined(0,o.VP.Schema.str),seq_id_begin:o.VP.Undefined(0,o.VP.Schema.int),seq_id_end:o.VP.Undefined(0,o.VP.Schema.int),chainElementSegments:y.hT.create([]),polymerRanges:k.m.ofSortedRanges([]),gapRanges:k.m.ofSortedRanges([])};var $=function($e){return $e.Empty={isDefined:!1,spheres:H,gaussians:H},$e}($||{});function J($e,mt,_t){if($e.has(mt))return $e.get(mt);const Me=_t.index++;return $e.set(mt,Me),Me}function W($e,mt){if($e.has(mt))return $e.get(mt);const _t=new Map;return $e.set(mt,_t),_t}function de($e){throw new Error(`Missing entity entry for entity id '${$e}'.`)}function ye($e,mt){const{entity_id:_t,asym_id:Me,seq_id_begin:Ke,seq_id_end:ut,count:Kt,chainElementSegments:sn}=$e,gt=new Map,yt=new Map,At={index:0},Gt=new Int32Array(Kt),rn=new Int32Array(Kt),tt=new Int32Array(sn.count);for(let Dn=0;Dn{const gt=Me(Kt);if(gt<0)return-1;const yt=mt.get(gt);return yt.has(sn)?yt.get(sn):-1},findSequenceKey:(Kt,sn,gt)=>{const yt=Me(Kt);if(yt<0)return-1;const At=mt.get(yt);if(void 0===At)return-1;const Gt=At.get(sn);if(void 0===Gt)return-1;const rn=_t.get(Gt),{elementIndices:tt,seqRanges:Mt}=rn,nn=k.m.firstIntersectionIndex(Mt,y.CD.ofSingleton(gt));return-1!==nn?tt[nn]:-1}}}(mt,yt,gt);return{chainKey:Gt,entityKey:rn,findSequenceKey:nn,findChainKey:Mt,getEntityFromChain:Dn=>tt[Dn]}}var j=n(9909);function Z($e,mt){const _t=[],Me=[],Ke=y.hT.transientSegments($e.chainElementSegments,y.IX.ofBounds(0,$e.count)),{seq_id_begin:ut,seq_id_end:Kt}=$e;for(;Ke.hasNext;){const{start:sn,end:gt}=Ke.move();let yt=-1,At=-1;for(let Gt=sn;Gt1&&(_t.push(yt,Gt-1),Me.push(Gt-1,Gt),yt=Gt),Gt===gt-1&&_t.push(yt,Gt),At=rn}}return{polymerRanges:k.m.ofSortedRanges(_t),gapRanges:k.m.ofSortedRanges(Me)}}var q=n(2449);const Y={hierarchy:$.Empty,conformation:void 0};function xe($e,mt,_t){const Me=[0];for(let Ke=1,ut=$e.rowCount;Ke`${Ke}|${ut}|${Kt}`,Me=$e.pdbx_unobs_or_zero_occ_residues;for(let Ke=0,ut=Me._rowCount;Kemt.has(_t(Ke,ut,Kt)),get:(Ke,ut,Kt)=>mt.get(_t(Ke,ut,Kt)),size:mt.size}}function ne($e){const mt=new Map;if($e.chem_comp._rowCount>0){const{id:_t}=$e.chem_comp;for(let Me=0,Ke=_t.rowCount;Me{mt.set(Me,(0,_.bM)(Me))});return mt}function be($e){const mt=new Map;if($e.pdbx_chem_comp_identifier._rowCount>0){const{comp_id:_t,type:Me,identifier:Ke}=$e.pdbx_chem_comp_identifier;for(let ut=0,Kt=_t.rowCount;ut0){const{id:_t,type:Me}=$e.chem_comp;for(let Ke=0,ut=_t.rowCount;Ke{!mt.has(Ke)&&_t.has(Ke)&&mt.set(Ke,Me)})}return mt}const Te=(0,n(1094).E)($e=>{const mt=new Set,{label_comp_id:_t,auth_comp_id:Me}=$e.atom_site,Ke=_t.isDefined?_t:Me;for(let ut=0,Kt=Ke.rowCount;ut0?yield function Bt($e,mt,_t,Me){return pn.apply(this,arguments)}(_t,$e,Me,mt):yield function Lt($e,mt,_t,Me){return Je.apply(this,arguments)}(_t,$e,Me,mt);for(let ut=0;ut0?Ke[Ke.length-1]:void 0);Ke.push(Gt),sn=gt}}return Ke})).apply(this,arguments)}function en($e,mt){const _t=new Map,Me=$e._rowCount;let Ke=0;for(;Ke{"use strict";n.d(Ue,{e:()=>c,z:()=>i});var e=n(7357),o=n(6651);o.VP.Schema.Str();const A={...e.r.chem_comp,type:o.VP.Schema.Aliased(o.VP.Schema.str)};var y=n(1049);const c={entry:e.r.entry,struct:e.r.struct,struct_asym:e.r.struct_asym,ihm_model_list:e.r.ihm_model_list,ihm_model_group:e.r.ihm_model_group,ihm_model_group_link:e.r.ihm_model_group_link,entity:e.r.entity,entity_poly:e.r.entity_poly,entity_poly_seq:e.r.entity_poly_seq,pdbx_entity_branch:e.r.pdbx_entity_branch,chem_comp:A,pdbx_chem_comp_identifier:e.r.pdbx_chem_comp_identifier,atom_site:e.r.atom_site,ihm_sphere_obj_site:e.r.ihm_sphere_obj_site,ihm_gaussian_obj_site:e.r.ihm_gaussian_obj_site,pdbx_unobs_or_zero_occ_residues:e.r.pdbx_unobs_or_zero_occ_residues,pdbx_molecule:e.r.pdbx_molecule};function i(v,O=!1){const b=Object.create(null);for(const _ of Object.keys(c))b[_]=_ in v?v[_]:o.XI.ofUndefinedColumns(c[_],0);return O&&(b.atom_site=(0,y.W)(b.atom_site)),b}},1049:(tn,Ue,n)=>{"use strict";n.d(Ue,{O:()=>o,W:()=>A});var e=n(6651);function o(y,c){const{ihm_model_group:i,ihm_model_group_link:v}=c,O=e.XI.pickRow(v,b=>v.model_id.value(b)===y);if(O){const b=e.XI.pickRow(i,_=>i.id.value(_)===O.group_id);if(b)return b.name}return""}function r(y){for(let c=0,i=y.rowCount;c{"use strict";n.d(Ue,{N:()=>_});var e=n(6651),o=n(2434),r=n(9986),t=n(2449),A=n(442);const y=[new Set(["CA"]),new Set(["C"]),new Set(["N"])],c=[new Set(["P","O3'","O3*"]),new Set(["C4'","C4*"]),new Set(["O2'","O2*","F2'","F2*"])],i=[new Set(["P","O3'","O3*"]),new Set(["C3'","C3*"]),new Set(["O2'","O2*","F2'","F2*"])],v=new Set(["FMN","NCN","FNS","FMA","ATP","ADP","AMP","GTP","GDP","GMP","LIG"]),O=function(){const M=new Map;return[{id:"HIS",name:"HISTIDINE",type:"l-peptide linking"},{id:"ARG",name:"ARGININE",type:"l-peptide linking"},{id:"LYS",name:"LYSINE",type:"l-peptide linking"},{id:"ILE",name:"ISOLEUCINE",type:"l-peptide linking"},{id:"PHE",name:"PHENYLALANINE",type:"l-peptide linking"},{id:"LEU",name:"LEUCINE",type:"l-peptide linking"},{id:"TRP",name:"TRYPTOPHAN",type:"l-peptide linking"},{id:"ALA",name:"ALANINE",type:"l-peptide linking"},{id:"MET",name:"METHIONINE",type:"l-peptide linking"},{id:"CYS",name:"CYSTEINE",type:"l-peptide linking"},{id:"ASN",name:"ASPARAGINE",type:"l-peptide linking"},{id:"VAL",name:"VALINE",type:"l-peptide linking"},{id:"GLY",name:"GLYCINE",type:"peptide linking"},{id:"SER",name:"SERINE",type:"l-peptide linking"},{id:"GLN",name:"GLUTAMINE",type:"l-peptide linking"},{id:"TYR",name:"TYROSINE",type:"l-peptide linking"},{id:"ASP",name:"ASPARTIC ACID",type:"l-peptide linking"},{id:"GLU",name:"GLUTAMIC ACID",type:"l-peptide linking"},{id:"THR",name:"THREONINE",type:"l-peptide linking"},{id:"PRO",name:"PROLINE",type:"l-peptide linking"},{id:"SEC",name:"SELENOCYSTEINE",type:"l-peptide linking"},{id:"PYL",name:"PYRROLYSINE",type:"l-peptide linking"},{id:"MSE",name:"SELENOMETHIONINE",type:"l-peptide linking"},{id:"SEP",name:"PHOSPHOSERINE",type:"l-peptide linking"},{id:"TPO",name:"PHOSPHOTHREONINE",type:"l-peptide linking"},{id:"PTR",name:"O-PHOSPHOTYROSINE",type:"l-peptide linking"},{id:"PCA",name:"PYROGLUTAMIC ACID",type:"l-peptide linking"},{id:"A",name:"ADENOSINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"C",name:"CYTIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"T",name:"THYMIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"G",name:"GUANOSINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"I",name:"INOSINIC ACID",type:"rna linking"},{id:"U",name:"URIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"DA",name:"2'-DEOXYADENOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DC",name:"2'-DEOXYCYTIDINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DT",name:"THYMIDINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DG",name:"2'-DEOXYGUANOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DI",name:"2'-DEOXYINOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DU",name:"2'-DEOXYURIDINE-5'-MONOPHOSPHATE",type:"dna linking"}].forEach(l=>M.set(l.id,l)),M}(),b=function(){const M=new Map;return[{id:"ZN2",name:"ZINC ION",type:"ion"},{id:"SOD",name:"SODIUM ION",type:"ion"},{id:"CES",name:"CESIUM ION",type:"ion"},{id:"CLA",name:"CHLORIDE ION",type:"ion"},{id:"CAL",name:"CALCIUM ION",type:"ion"},{id:"POT",name:"POTASSIUM ION",type:"ion"}].forEach(l=>M.set(l.id,l)),M}();class _{set(I){this.comps.set(I.id,I),this.ids.push(I.id),this.names.push(I.name),this.types.push(I.type),this.mon_nstd_flags.push(o.px.has(I.id)?"y":"n")}getAtomIds(I){const l=new Set,m=this.seqId.value(I);for(;Ithis.namesMap.set(l[0],l[1]))}constructor(I,l){this.seqId=I,this.atomId=l,this.namesMap=new Map,this.comps=new Map,this.ids=[],this.names=[],this.types=[],this.mon_nstd_flags=[]}}},3573:(tn,Ue,n)=>{"use strict";n.d(Ue,{V:()=>t});var e=n(2434),o=n(6651),r=n(2449);class t{constructor(){this.count=0,this.ids=[],this.types=[],this.descriptions=[],this.compoundsMap=new Map,this.namesMap=new Map,this.heteroMap=new Map,this.chainMap=new Map}set(y,c){this.count+=1,this.ids.push(`${this.count}`),this.types.push(y),this.descriptions.push([c])}getEntityId(y,c,i,v){return 2===c?(void 0===this.waterId&&(this.set("water",v?.customName||"Water"),this.waterId=`${this.count}`),this.waterId):(0,e.z7)(c)?this.compoundsMap.has(i)?this.compoundsMap.get(i):(this.chainMap.has(i)||(this.set("polymer",v?.customName||`Polymer ${this.chainMap.size+1}`),this.chainMap.set(i,`${this.count}`)),this.chainMap.get(i)):(this.heteroMap.has(y)||(this.set("non-polymer",v?.customName||this.namesMap.get(y)||y),this.heteroMap.set(y,`${this.count}`)),this.heteroMap.get(y))}getEntityTable(){return o.XI.ofPartialColumns(r.e.entity,{id:o.VP.ofStringArray(this.ids),type:o.VP.ofStringAliasArray(this.types),pdbx_description:o.VP.ofStringListArray(this.descriptions)},this.count)}setCompounds(y){for(let c=0,i=y.length;cthis.namesMap.set(c[0],c[1]))}}},9207:(tn,Ue,n)=>{"use strict";n.d(Ue,{q:()=>o});class e{constructor(){this.map=new Map,this.applicable=new Map}add(t,A,y){this.map.set(t,A),y&&this.applicable.set(t,y)}remove(t){this.map.delete(t),this.applicable.delete(t)}get(t){return this.map.get(t)}isApplicable(t){if(!this.map.has(t.sourceData.kind))return!1;const A=this.applicable.get(t.sourceData.kind);return!A||A(t)}}var o;(o||(o={})).create=function t(A,y){const{name:c}=A,i=new e;return{descriptor:A,formatRegistry:i,isApplicable:v=>i.isApplicable(v),get(v){const O=y?.asDynamic?v._dynamicPropertyData:v._staticPropertyData;if(O[c])return O[c];if(v.customProperties.has(A))return;const b=i.get(v.sourceData.kind);return b?(O[c]=b(v),v.customProperties.add(A),O[c]):void 0},set(v,O){y?.asDynamic?v._dynamicPropertyData[c]=O:v._staticPropertyData[c]=O},delete(v){y?.asDynamic?delete v._dynamicPropertyData[c]:delete v._staticPropertyData[c]}}}},2524:(tn,Ue,n)=>{"use strict";n.d(Ue,{K4:()=>S,OQ:()=>D,YG:()=>f});var S,w,R,e=n(467),o=n(4632),r=n(4824),t=n(5165),A=n(2921),y=n(9651),c=n(6710),i=n(6651),v=n(8593),O=n(9344),b=n(8737),_=n(9136),M=n(4811),I=n(2449),l=n(3573),m=n(3671);function D(w,Q){const G=S.fromFrame(w,void 0,void 0,Q),V=(0,I.z)(G.data.db,!0);return r.YZ.create("Create mmCIF Model",U=>(0,A.X)(V,G,U))}function f(w){const Q=R.fromFrame(w);return r.YZ.create("Create CCD Models",G=>function p(w,Q,G){return E.apply(this,arguments)}(Q.data.db,R.fromFrame(w),G))}function E(){return E=(0,e.A)(function*(w,Q,G){const V=yield T(w,Q,{coordinateType:"ideal",cartn_x:"pdbx_model_Cartn_x_ideal",cartn_y:"pdbx_model_Cartn_y_ideal",cartn_z:"pdbx_model_Cartn_z_ideal"},G),U=yield T(w,Q,{coordinateType:"model",cartn_x:"model_Cartn_x",cartn_y:"model_Cartn_y",cartn_z:"model_Cartn_z"},G),N=[];V&&N.push(V),U&&N.push(U);for(let k=0,H=N.length;k0||(g[g.length]=ce);const _e=g.length,xe=i.VP.ofConst("A",_e,i.VP.Schema.str),le=i.VP.ofConst(1,_e,i.VP.Schema.int),Ae=i.VP.ofConst("1",_e,i.VP.Schema.str),Be=i.VP.ofConst(1,_e,i.VP.Schema.float),Ce=i.VP.ofConst(1,_e,i.VP.Schema.int),Re=i.VP.view(ye,g),ke=i.VP.view(Z,g),we=i.VP.view(N[$],g),Oe=i.VP.view(N[J],g),Se=i.VP.view(N[W],g),Ve=i.VP.view(q,g),Ne=i.VP.view(Y,g),K=i.VP.view(j,g),ne=i.XI.ofPartialColumns(I.e.atom_site,{auth_asym_id:xe,auth_atom_id:Re,auth_comp_id:ke,auth_seq_id:le,Cartn_x:we,Cartn_y:Oe,Cartn_z:Se,id:Ve,label_asym_id:xe,label_atom_id:Re,label_comp_id:ke,label_seq_id:le,label_entity_id:Ae,occupancy:Be,type_symbol:Ne,pdbx_PDB_model_num:Ce,pdbx_formal_charge:K},_e),be=new l.V;be.setNames([[de,`${te} (${H})`]]),be.getEntityId(de,0,"A");const Te=new m.N(le,Y);Te.setNames([[de,`${te} (${H})`]]),Te.add(de,0);const ie=(0,I.z)({entity:be.getEntityTable(),chem_comp:Te.getChemCompTable(),atom_site:ne}),ue=yield(0,A.X)(ie,Q,V);if(!ue.representative)return;const re=ue.representative,ve=O.X.getEntriesFromChemCompBond(k);return O.X.Provider.set(re,{data:k,entries:ve}),R.CoordinateType.set(re,H),ue.representative}),L.apply(this,arguments)}y.i.Provider.formatRegistry.add("mmCIF",function u(w){if(S.is(w.sourceData))return y.i.fromData(w.sourceData.data.db)}),c.v.Provider.formatRegistry.add("mmCIF",function d(w){if(!S.is(w.sourceData))return;const{struct_conf:Q,struct_sheet_range:G}=w.sourceData.data.db;return c.v.fromStruct(Q,G,w.atomicHierarchy)}),v._.Provider.formatRegistry.add("mmCIF",function s(w){if(!S.is(w.sourceData))return;const{atom_site_anisotrop:Q}=w.sourceData.data.db;return{data:i.XI.ofColumns(v._.Schema,Q),elementToAnsiotrop:v._.getElementToAnsiotrop(w.atomicConformation.atomId,Q.id)}},function C(w){return!!S.is(w.sourceData)&&w.sourceData.data.db.atom_site_anisotrop.U.isDefined}),O.X.Provider.formatRegistry.add("mmCIF",function h(w){if(!S.is(w.sourceData))return;const{chem_comp_bond:Q}=w.sourceData.data.db;return 0!==Q._rowCount?{data:Q,entries:O.X.getEntriesFromChemCompBond(Q)}:void 0}),b.A.Provider.formatRegistry.add("mmCIF",function a(w){if(!S.is(w.sourceData))return;const{struct_conn:Q}=w.sourceData.data.db;if(0===Q._rowCount)return;const G=b.A.getEntriesFromStructConn(Q,w);return{data:Q,byAtomIndex:b.A.getAtomIndexFromEntries(G),entries:G}}),M.T.Provider.formatRegistry.add("mmCIF",M.T.fromMmCif,M.T.hasData),(w=S||(S={})).is=function Q(V){return"mmCIF"===V?.kind},w.fromFrame=function G(V,U,N,k){return U||(U=t.f$.schema.mmCIF(V)),{kind:"mmCIF",name:U._name,data:{db:U,file:k,frame:V,source:N}}},function(w){const Q="__CcdCoordinateType__";w.CoordinateType={get:U=>U._staticPropertyData[Q],set:(U,N)=>U._staticPropertyData[Q]=N},w.is=function G(U){return"CCD"===U?.kind},w.fromFrame=function V(U,N){return N||(N=t.f$.schema.CCD(U)),{kind:"CCD",name:N._name,data:{db:N,frame:U}}}}(R||(R={}))},8593:(tn,Ue,n)=>{"use strict";n.d(Ue,{_:()=>y});var y,c,e=n(7357),o=n(7421),r=n(9207),t=n(2524);(c=y||(y={})).Schema={U:e.r.atom_site_anisotrop.U,U_esd:e.r.atom_site_anisotrop.U_esd},c.Descriptor={name:"atom_site_anisotrop",cifExport:{prefix:"",categories:[{name:"atom_site_anisotrop",instance:O=>c.Provider.get(O.firstModel)&&t.K4.is(O.firstModel.sourceData)?o.c.Category.ofTable(O.firstModel.sourceData.data.db.atom_site_anisotrop):o.c.Category.Empty}]}},c.Provider=r.q.create(c.Descriptor),c.getElementToAnsiotrop=function i(O,b){const _=new Int32Array(O.rowCount);_.fill(-1);for(let I=0,l=O.rowCount;I{"use strict";n.d(Ue,{X:()=>A});var A,e=n(7357),o=n(7421),r=n(6651),t=n(9207);!function(y){y.Descriptor={name:"chem_comp_bond",cifExport:{prefix:"",categories:[{name:"chem_comp_bond",instance(O){const b=y.Provider.get(O.firstModel);if(!b)return o.c.Category.Empty;const _=b.data;if(!_)return o.c.Category.Empty;const M=O.structures[0].uniqueResidueNames,{comp_id:I,_rowCount:l}=_,m=[];for(let u=0;uO.properties.chemicalComponentMap.has(b.comp_id.value(_)))},y.getEntriesFromChemCompBond=function i(O){const b=new Map;function _(h){if(b.has(h))return b.get(h);const a=new v(h);return b.set(h,a),a}const{comp_id:M,atom_id_1:I,atom_id_2:l,value_order:m,pdbx_aromatic_flag:u,_rowCount:d,pdbx_ordinal:s}=O;let C=_(M.value(0));for(let h=0;h{"use strict";n.d(Ue,{z:()=>t});var t,A,e=n(4506),o=n(9207);function r(A,y,c,i){const v=new e.O.EdgeBuilder(i,A,y),O=new Int32Array(v.slotCount),b=new Array(v.slotCount),_=new Array(v.slotCount),M=new Int8Array(v.slotCount),I=new Array(v.slotCount),l=new Array(v.slotCount);for(let m=0,u=v.edgeCount;m{"use strict";n.d(Ue,{A:()=>y});var y,e=n(6651),o=n(3543),r=n(7421),t=n(5373),A=n(9207);!function(c){function v({units:_},M){for(let I=0,l=_.length;I=0)return!0;return!1}c.Descriptor={name:"struct_conn",cifExport:{prefix:"",categories:[{name:"struct_conn",instance(_){const M=c.Provider.get(_.firstModel);if(!M||0===M.entries.length)return r.c.Category.Empty;const I=_.structures[0],l=[];for(const m of M.entries)v(I,m.partnerA.atomIndex)&&v(I,m.partnerB.atomIndex)&&(l[l.length]=m.rowIndex);return r.c.Category.ofTable(M.data,l)}}]}},c.Provider=A.q.create(c.Descriptor),c.isExhaustive=function i(_){const M=c.Provider.get(_);return!!M&&M.data.id.rowCount/_.atomicConformation.atomId.rowCount>.95},c.getAtomIndexFromEntries=function O(_){const M=new Map;for(const I of _){const{partnerA:{atomIndex:l},partnerB:{atomIndex:m}}=I;M.has(l)?M.get(l).push(I):M.set(l,[I]),M.has(m)?M.get(m).push(I):M.set(m,[I])}return M},c.getEntriesFromStructConn=function b(_,M){const{conn_type_id:I,pdbx_dist_value:l,pdbx_value_order:m}=_,u={label_asym_id:_.ptnr1_label_asym_id,label_seq_id:_.ptnr1_label_seq_id,auth_seq_id:_.ptnr1_auth_seq_id,label_atom_id:_.ptnr1_label_atom_id,label_alt_id:_.pdbx_ptnr1_label_alt_id,ins_code:_.pdbx_ptnr1_PDB_ins_code,symmetry:_.ptnr1_symmetry},d={label_asym_id:_.ptnr2_label_asym_id,label_seq_id:_.ptnr2_label_seq_id,auth_seq_id:_.ptnr2_auth_seq_id,label_atom_id:_.ptnr2_label_atom_id,label_alt_id:_.pdbx_ptnr2_label_alt_id,ins_code:_.pdbx_ptnr2_PDB_ins_code,symmetry:_.ptnr2_symmetry},s=Array.from(M.entities.data.id.toArray()),C=(a,S)=>{if(0!==S.label_asym_id.valueKind(a))return;const D=S.label_asym_id.value(a),R=S.label_atom_id.value(a);if(!R)return;const f=S.auth_seq_id.valueKind(a)===e.VP.ValueKind.Present?S.auth_seq_id.value(a):S.label_seq_id.value(a),p=S.ins_code.value(a),E=S.label_alt_id.value(a);for(const T of s){const L=M.atomicHierarchy.index.findResidue(T,D,f,p);if(L<0)continue;const w=M.atomicHierarchy.index.findAtomOnResidue(L,R,E);if(!(w<0))return{residueIndex:L,atomIndex:w,symmetry:S.symmetry.value(a)}}},h=[];for(let a=0;a<_._rowCount;a++){const S=C(a,u),D=C(a,d);if(void 0===S||void 0===D)continue;const R=I.value(a);let p=0,E=1;switch(m.value(a)||""){case"sing":E=1;break;case"doub":E=2;break;case"trip":E=3;break;case"quad":E=4;break;default:E=(0,t.m)(_.ptnr1_label_comp_id.value(a),_.ptnr1_label_atom_id.value(a),_.ptnr2_label_comp_id.value(a),_.ptnr2_label_atom_id.value(a))}switch(R){case"covale":p=1;break;case"disulf":p=9;break;case"hydrog":p=4;break;case"metalc":p=2}h.push({rowIndex:a,flags:p,order:E,distance:l.value(a),partnerA:S,partnerB:D})}return h}}(y||(y={}))},4366:(tn,Ue,n)=>{"use strict";n.d(Ue,{j:()=>o});var o,r,e=n(9207);(r=o||(o={})).Descriptor={name:"atom_partial_charge"},r.Provider=e.q.create(r.Descriptor)},6710:(tn,Ue,n)=>{"use strict";n.d(Ue,{v:()=>A});var A,b,e=n(2434),o=n(2008),r=n(4743),t=n(9207);function v(b,_,M,I,l,m){const{auth_seq_id:u,label_seq_id:d,pdbx_PDB_ins_code:s}=b.residues,{endSeqId:C,endInsCode:h,key:a,type:S}=M,D="label"===_?d:u;let R=I;for(;RC||f===C&&s.value(R)===h)break;R++}}(b=A||(A={})).Descriptor={name:"model_secondary_structure"},b.Provider=t.q.create(b.Descriptor),b.fromStruct=function _(M,I,l){const m=new Map,u=[{kind:"none"}],d=function y(b,_){if(b._rowCount>0){if(0!==b.beg_label_seq_id.valueKind(0)||0!==b.end_label_seq_id.valueKind(0))return"auth"}else if(_&&(0!==_.beg_label_seq_id.valueKind(0)||0!==_.end_label_seq_id.valueKind(0)))return"auth";return"label"}(M,I);(function c(b,_,M,I){if(!b._rowCount)return;const{beg_label_asym_id:l,beg_label_seq_id:m,beg_auth_seq_id:u,pdbx_beg_PDB_ins_code:d}=b,{end_label_seq_id:s,end_auth_seq_id:C,pdbx_end_PDB_ins_code:h}=b,{pdbx_PDB_helix_class:a,conf_type_id:S,details:D}=b,R="label"===_?m:u,f="label"===_?s:C;for(let p=0,E=b._rowCount;p0&&function O(b,_,M,I){const{count:l}=b.chainAtomSegments,{label_asym_id:m}=b.chains,{auth_seq_id:u,label_seq_id:d,pdbx_PDB_ins_code:s}=b.residues,C="label"===_?d:u;for(let h=0;ha)}},9651:(tn,Ue,n)=>{"use strict";n.d(Ue,{i:()=>m});var e=n(7357),o=n(5384),r=n(4369),t=n(7552),A=n(9032),y=n(9136);function i(h,a,S,D){const R=h.id.value(S),f=h.details.value(S),p=[],{assembly_id:E,oper_expression:T,asym_id_list:L}=a;for(let w=0,Q=a._rowCount;w{const S=[];let D=0;for(let R=0;Ry.StructureProperties.unit.operator_name(w.element),t.J.DefaultName),y.RT.pred.inSet(w=>y.StructureProperties.chain.label_asym_id(w.element),f.asymIds))});S[S.length]={selector:L,operators:T,asymIds:f.asymIds},D+=T.length}return S}}(p,D))}function b(h){const a=[],S=[];for(let D=0;D{const p=[];f.split(",").forEach(E=>{const T=E.indexOf("-");if(T>0){const L=parseInt(E.substring(0,T)),w=parseInt(E.substr(T+1));for(let Q=L;Q<=w;Q++)p[p.length]=Q.toString()}else p[p.length]=E.trim()}),D[D.length]=p}),D}var m,h,l=n(9207);function C(h){if(0===h._rowCount)return;const{id:a,matrix:S,vector:D}=h,R=e.r.struct_ncs_oper.matrix.space,f=e.r.struct_ncs_oper.vector.space,p=[];for(let E=0;E{"use strict";n.d(Ue,{C:()=>y,f:()=>c});var c,i,e=n(467),o=n(4369),r=n(4824),t=n(6115),A=n(1692);function y(i,v){return r.YZ.create("Create Volume",(0,e.A)(function*(){const{header:O,values:b}=i,_=o.qY.Space(O.dim,[0,1,2],Float64Array);let M;if(0===O.dataSetIds.length)M=b;else{const[u,d,s]=O.dim,C=(v?.dataIndex||0)+1;let h=0,a=0;M=new Float64Array(u*d*s);for(let S=0;S{"use strict";n.d(Ue,{G:()=>y,T:()=>c});var c,i,e=n(467),o=n(4824),r=n(5384),t=n(4369),A=n(1692);function y(i,v){return o.YZ.create("Create Volume",function(){var O=(0,e.A)(function*(b){const{volume_data_3d_info:_,volume_data_3d:M}=i,I=r.O8.create(_.spacegroup_number.value(0),t.eB.ofArray(_.spacegroup_cell_size.value(0)),t.eB.scale(t.eB.zero(),t.eB.ofArray(_.spacegroup_cell_angles.value(0)),Math.PI/180)),l=_.axis_order.value(0),m=t.qY.convertToCanonicalAxisIndicesFastToSlow(l),u=m(_.sample_count.value(0)),d=t.qY.Space(u,t.qY.invertAxisOrder(l),Float32Array),s=t.qY.create(d,t.qY.Data1(M.values.toArray({array:Float32Array}))),C=t.eB.ofArray(m(_.origin.value(0))),h=t.eB.ofArray(m(_.dimensions.value(0)));return{label:v?.label,entryId:v?.entryId,grid:{transform:{kind:"spacegroup",cell:I,fractionalBox:r.DJ.create(C,t.eB.add(t.eB.zero(),C,h))},cells:s,stats:{min:_.min_sampled.value(0),max:_.max_sampled.value(0),mean:_.mean_sampled.value(0),sigma:_.sigma_sampled.value(0)}},sourceData:c.create(i),customProperties:new A.v,_propertyData:Object.create(null)}});return function(b){return O.apply(this,arguments)}}())}(i=c||(c={})).is=function v(b){return"dscif"===b?.kind},i.create=function O(b){return{kind:"dscif",name:b._name,data:b}}},387:(tn,Ue,n)=>{"use strict";n.d(Ue,{_:()=>y});var y,e=n(467),o=n(8277),r=n(9909),t=n(1692),A=n(7785);!function(c){function i(O){const b=O.descriptor.name,_="static"===O.type?"_staticPropertyData":"_dynamicPropertyData",M=l=>(b in l[_]||(l[_][b]={props:{...o.t.getDefaultValues(O.getParams(l))},data:r.xv.create(void 0)}),l[_][b]),I=(l,m,u)=>{const d=M(l);l[_][b]={props:m,data:r.xv.withValue(d.data,u)}};return{label:O.label,descriptor:O.descriptor,isHidden:O.isHidden,getParams:l=>{const m=o.t.clone(O.getParams(l));return o.t.setDefaultValues(m,M(l).props),m},defaultParams:O.defaultParams,isApplicable:O.isApplicable,attach:(l=(0,e.A)(function*(m,u,d={},s){s&&u.customProperties.reference(O.descriptor,!0);const C=M(u),h=o.t.merge(O.defaultParams,C.props,d);if(C.data.value&&o.t.areEqual(O.defaultParams,C.props,h))return;const{value:a,assets:S}=yield O.obtain(m,u,h);u.customProperties.add(O.descriptor),u.customProperties.assets(O.descriptor,S),I(u,h,a)}),function(u,d){return l.apply(this,arguments)}),ref:(l,m)=>l.customProperties.reference(O.descriptor,m),get:l=>{var m;return null===(m=M(l))||void 0===m?void 0:m.data},set:(l,m={},u)=>{const d=M(l),s=o.t.merge(O.defaultParams,d.props,m);o.t.areEqual(O.defaultParams,d.props,s)||(I(l,s,u),l.customProperties.assets(O.descriptor))},props:l=>M(l).props};var l}c.createProvider=i,c.createSimple=function v(O,b,_){const M={value:o.t.Value(_,{isHidden:!0})};return i({label:(0,A.Mk)(O),descriptor:(0,t.e)({name:O}),isHidden:!0,type:b,defaultParams:M,getParams:()=>({value:o.t.Value(_,{isHidden:!0})}),isApplicable:()=>!0,obtain:(I=(0,e.A)(function*(l,m,u){return{...o.t.getDefaultValues(M),...u}}),function(m,u,d){return I.apply(this,arguments)})});var I}}(y||(y={}))},5439:(tn,Ue,n)=>{"use strict";n.d(Ue,{S:()=>y});var y,e=n(467),o=n(8277),r=n(9909),t=n(1692),A=n(7785);!function(c){function i(O){const b=O.descriptor.name,_="root"===O.type?"inheritedPropertyData":"currentPropertyData",M=l=>(b in l[_]||(l[_][b]={props:{...o.t.getDefaultValues(O.getParams(l))},data:r.xv.create(void 0)}),l[_][b]),I=(l,m,u)=>{const d=M(l);l[_][b]={props:m,data:r.xv.withValue(d.data,u)}};return{label:O.label,descriptor:O.descriptor,isHidden:O.isHidden,getParams:l=>{const m=o.t.clone(O.getParams(l));return o.t.setDefaultValues(m,M(l).props),m},defaultParams:O.defaultParams,isApplicable:O.isApplicable,attach:(l=(0,e.A)(function*(m,u,d={},s){s&&u.customPropertyDescriptors.reference(O.descriptor,!0),"root"===O.type&&(u=u.root);const C=M(u.root).props,h=M(u),a=o.t.merge(O.defaultParams,C,d);if(h.data.value&&o.t.areEqual(O.defaultParams,h.props,a))return;const{value:S,assets:D}=yield O.obtain(m,u,a);u.customPropertyDescriptors.add(O.descriptor),u.customPropertyDescriptors.assets(O.descriptor,D),I(u,a,S)}),function(u,d){return l.apply(this,arguments)}),ref:(l,m)=>l.customPropertyDescriptors.reference(O.descriptor,m),get:l=>M(l).data,set:(l,m={},u)=>{"root"===O.type&&(l=l.root);const d=M(l),s=o.t.merge(O.defaultParams,d.props,m);o.t.areEqual(O.defaultParams,d.props,s)||(I(l,s,u),l.customPropertyDescriptors.assets(O.descriptor))},props:l=>M(l).props};var l}c.createProvider=i,c.createSimple=function v(O,b,_){const M={value:o.t.Value(_,{isHidden:!0})};return i({label:(0,A.Mk)(O),descriptor:(0,t.e)({name:O}),isHidden:!0,type:b,defaultParams:M,getParams:()=>({value:o.t.Value(_,{isHidden:!0})}),isApplicable:()=>!0,obtain:(I=(0,e.A)(function*(l,m,u){return{...o.t.getDefaultValues(M),...u}}),function(m,u,d){return I.apply(this,arguments)})});var I}}(y||(y={}))},6948:(tn,Ue,n)=>{"use strict";n.d(Ue,{GE:()=>h,VL:()=>b,XM:()=>d,bf:()=>_,lo:()=>M,vM:()=>u,z$:()=>m}),n(7126),n(2434);var r=n(7767);function b(S,D,R){return"S"===(0,r.$X)(D,R)&&3===(0,r.IS)(S,D,R,"O")}function _(S,D,R){return"S"===(0,r.$X)(D,R)&&4===(0,r.IS)(S,D,R,"O")}function M(S,D,R){return"P"===(0,r.$X)(D,R)&&(0,r.IS)(S,D,R,"O")===(0,r.Hm)(S,D,R)}function m(S,D,R){let f=0;return"C"===(0,r.$X)(D,R)&&2===(0,r.IS)(S,D,R,"O")&&1===(0,r.IS)(S,D,R,"C")&&(0,r.LH)(S,D,R,(p,E)=>{"O"===(0,r.$X)(p,E)&&(0,r.Hm)(S,p,E)-(0,r.IS)(S,p,E,"H")==1&&(f+=1)}),2===f}function u(S,D,R){let f=0;return"C"===(0,r.$X)(D,R)&&3===(0,r.Hm)(S,D,R)&&3===(0,r.IS)(S,D,R,"N")&&(0,r.LH)(S,D,R,(p,E)=>{(0,r.Hm)(S,p,E)-(0,r.IS)(S,p,E,"H")==1&&(f+=1)}),2===f}function d(S,D,R){let f=0;return"C"===(0,r.$X)(D,R)&&3===(0,r.Hm)(S,D,R)&&2===(0,r.IS)(S,D,R,"N")&&1===(0,r.IS)(S,D,R,"C")&&(0,r.LH)(S,D,R,(p,E)=>{(0,r.Hm)(S,p,E)-(0,r.IS)(S,p,E,"H")==1&&(f+=1)}),2===f}const s=new Set(["N","O","S","F","CL","BR","I"]);function h(S,D,R){let f=!1;return(0,r.LH)(S,D,R,(p,E)=>{(function C(S){return s.has(S)})((0,r.$X)(p,E))&&(f=!0)}),f}},3024:(tn,Ue,n)=>{"use strict";n.d(Ue,{$Z:()=>I,Ci:()=>M,Fc:()=>A,G0:()=>t,UV:()=>c,kx:()=>y});var e=n(4490),o=n(4369),r=n(7767),t=function(l){return l[l.Spherical=0]="Spherical",l[l.Terminal=1]="Terminal",l[l.Linear=2]="Linear",l[l.Trigonal=3]="Trigonal",l[l.Tetrahedral=4]="Tetrahedral",l[l.TrigonalBiPyramidal=5]="TrigonalBiPyramidal",l[l.Octahedral=6]="Octahedral",l[l.SquarePlanar=7]="SquarePlanar",l[l.Unknown=8]="Unknown",l}(t||{});function A(l){switch(l){case t.Spherical:return"Spherical";case t.Terminal:return"Terminal";case t.Linear:return"Linear";case t.Trigonal:return"Trigonal";case t.Tetrahedral:return"Tetrahedral";case t.TrigonalBiPyramidal:return"Trigonal Bi-Pyramidal";case t.Octahedral:return"Octahedral";case t.SquarePlanar:return"Square Planar";case t.Unknown:return"Unknown"}}function y(l){switch(l){case 0:return t.Spherical;case 1:return t.Terminal;case 2:return t.Linear;case 3:return t.Trigonal;case 4:return t.Tetrahedral;default:return t.Unknown}}const c=new Map([[t.Linear,(0,e.pu)(180)],[t.Trigonal,(0,e.pu)(120)],[t.Tetrahedral,(0,e.pu)(109.4721)],[t.Octahedral,(0,e.pu)(90)]]),i=(0,o.eB)(),v=(0,o.eB)(),O=(0,o.eB)(),b=(0,o.eB)(),_=(0,o.eB)();function M(l,m,u,d,s){const C=[];return m.conformation.position(m.elements[u],O),d.conformation.position(d.elements[s],b),o.eB.sub(i,b,O),(0,r.LH)(l,m,u,(h,a)=>{"H"!==(0,r.$X)(h,a)&&(h.conformation.position(h.elements[a],_),o.eB.sub(v,_,O),C.push(o.eB.angle(i,v)))}),C}function I(l,m,u,d,s){m.conformation.position(m.elements[u],O),d.conformation.position(d.elements[s],b),o.eB.sub(i,b,O);const C=[(0,o.eB)(),(0,o.eB)()];let a,S,h=0;if((0,r.LH)(l,m,u,(D,R)=>{h>1||"H"!==(0,r.$X)(D,R)&&(a=D,S=R,D.conformation.position(D.elements[R],_),o.eB.sub(C[h++],_,O))}),1===h&&a&&S&&(0,r.LH)(l,a,S,(D,R)=>{h>1||D===m&&R===u||"H"!==(0,r.$X)(D,R)&&(D.conformation.position(D.elements[R],_),o.eB.sub(C[h++],_,O))}),2===h)return o.eB.cross(v,C[0],C[1]),Math.abs(Math.PI/2-o.eB.angle(v,i))}},7767:(tn,Ue,n)=>{"use strict";n.d(Ue,{$X:()=>r,B8:()=>m,Hm:()=>O,IS:()=>b,LH:()=>u,M0:()=>t,nZ:()=>A,q9:()=>y,tZ:()=>c,z7:()=>I});var e=n(2434);function r(s,C){return s.model.atomicHierarchy.atoms.type_symbol.value(s.elements[C])}function t(s,C){return s.model.atomicHierarchy.atoms.pdbx_formal_charge.value(s.elements[C])}function A(s,C){return s.model.atomicHierarchy.atoms.label_atom_id.value(s.elements[C])}function y(s,C){return s.model.atomicHierarchy.atoms.label_alt_id.value(s.elements[C])}function c(s,C){return s.model.atomicHierarchy.atoms.label_comp_id.value(s.elements[C])}function O(s,C,h){return function i(s,C,h){let a=0;const S=s.interUnitBonds.getEdgeIndices(h,C.id);for(let D=0,R=S.length;D{r(D,R)===a&&(S+=1)}),S}function I(s,C,h,a,S){return C===a?function _(s,C,h){const{offset:a,b:S,edgeProps:{flags:D}}=s.bonds;for(let R=a[C],f=a[C+1];R{"use strict";n.d(Ue,{r:()=>c});var e=n(467),o=n(8277),r=n(9126),t=n(5439),A=n(1692);const y={...r.yB},c=t.S.createProvider({label:"Interactions",descriptor:(0,A.e)({name:"molstar_computed_interactions"}),type:"local",defaultParams:y,getParams:i=>y,isApplicable:i=>!i.isCoarseGrained,obtain:(i=(0,e.A)(function*(v,O,b){const _={...o.t.getDefaultValues(y),...b};return{value:yield(0,r.h3)(v,O,_)}}),function(O,b,_){return i.apply(this,arguments)})});var i},9469:(tn,Ue,n)=>{"use strict";n.d(Ue,{Ls:()=>y,Tg:()=>r,X8:()=>A,XH:()=>i,dE:()=>o,mO:()=>v,tA:()=>t,y9:()=>O});var o,e=n(481);(o||(o={})).createElementsIndex=function _(M,I,l){const m=new Int32Array(l+1),u=new Int32Array(l),d=new Int32Array(l),{members:s,offsets:C}=I;for(let S=0,D=2*M.edgeCount;Sf)){for(let p=C[R],E=C[R+1];pf)){for(let p=C[R],E=C[R+1];p{"use strict";n.d(Ue,{OG:()=>Go,yB:()=>Nn,h3:()=>Kn});var O,b,e=n(467),o=n(8277),r=n(9136),t=n(8382),A=n(5384),y=n(3543),c=n(9311),i=n(4369),v=n(9535);!function(ht){function Xt(rt,St){const vt=new Int32Array(St+1),mn=new Int32Array(St),zt=new Int32Array(St),{members:an,count:Vn,offsets:Fn}=rt;for(let tr=0,Tr=Fn[Vn];tron(St,zt)}},ht.createSubset=on,ht.Info=function En(rt,St,vt){const mn=c.F.get(rt).value;if(!mn||!mn.has(St.id))throw new Error("valence model required");return{unit:St,types:vt.types,feature:-1,x:vt.x,y:vt.y,z:vt.z,members:vt.members,offsets:vt.offsets,idealGeometry:mn.get(St.id).idealGeometry}},ht.position=function Tt(rt,St){return i.eB.set(rt,St.x[St.feature],St.y[St.feature],St.z[St.feature]),i.eB.transformMat4(rt,rt,St.unit.conformation.operator.matrix),rt};const Fe=(0,i.eB)(),He=(0,i.eB)();ht.distance=function Ye(rt,St){const mn=St.members[St.offsets[St.feature]];return rt.unit.conformation.position(rt.unit.elements[rt.members[rt.offsets[rt.feature]]],Fe),St.unit.conformation.position(St.unit.elements[mn],He),i.eB.distance(Fe,He)},ht.Provider=function ot(rt,St){return{types:new Set(rt),add:St}}}(O||(O={})),(b||(b={})).create=function pt(Xt=2048,fn=1024,on){const En=t.Gm.create(Float32Array,1,fn,on?on.x:Xt),Tt=t.Gm.create(Float32Array,1,fn,on?on.y:Xt),Fe=t.Gm.create(Float32Array,1,fn,on?on.z:Xt),He=t.Gm.create(Uint8Array,1,fn,on?on.types:Xt),Ye=t.Gm.create(Uint8Array,1,fn,on?on.groups:Xt),ot=t.Gm.create(Uint32Array,1,fn,on?on.offsets:Xt),rt=t.Gm.create(Uint32Array,1,fn,on?on.members:Xt),St={x:0,y:0,z:0,offset:0,count:0};return{startState:()=>{St.x=0,St.y=0,St.z=0,St.offset=rt.elementCount,St.count=0},pushMember:(vt,mn,zt,an)=>{t.Gm.add(rt,an),St.x+=vt,St.y+=mn,St.z+=zt,St.count+=1},finishState:(vt,mn)=>{const{count:zt}=St;0!==zt&&(t.Gm.add(He,vt),t.Gm.add(Ye,mn),t.Gm.add(En,St.x/zt),t.Gm.add(Tt,St.y/zt),t.Gm.add(Fe,St.z/zt),t.Gm.add(ot,St.offset))},add:(vt,mn,zt,an,Vn,Fn)=>{t.Gm.add(He,vt),t.Gm.add(Ye,mn),t.Gm.add(En,zt),t.Gm.add(Tt,an),t.Gm.add(Fe,Vn),t.Gm.add(ot,rt.elementCount),t.Gm.add(rt,Fn)},getFeatures:vt=>{t.Gm.add(ot,rt.elementCount);const mn=t.Gm.compact(En,!0),zt=t.Gm.compact(Tt,!0),an=t.Gm.compact(Fe,!0);return O.create(vt,{x:mn,y:zt,z:an,count:En.elementCount,types:t.Gm.compact(He,!0),groups:t.Gm.compact(Ye,!0),offsets:t.Gm.compact(ot,!0),members:t.Gm.compact(rt,!0)})}}};var l,m,_=n(9469),M=n(4506),I=n(481);(l||(l={})).create=function pt(Xt,fn){const on=[],En=[],Tt=[];return{add(Fe,He,Ye){on[on.length]=Fe,En[En.length]=He,Tt[Tt.length]=Ye},getContacts(){const Fe=new M.O.EdgeBuilder(Xt.count,on,En),He=new Int8Array(Fe.slotCount),Ye=new Int8Array(Fe.slotCount);for(let vt=0,mn=Fe.edgeCount;vtrt||(rt=_.dE.createElementsIndex(ot,Xt,fn))})}}},function(ht){ht.create=function pt(){const Xt=new I.Z.Builder;return{startUnitPair(fn,on){Xt.startUnitPair(fn.id,on.id)},finishUnitPair(){Xt.finishUnitPair()},add(fn,on,En){Xt.add(fn,on,{type:En,flag:_.tA.None})},getContacts:fn=>new _.Tg(Xt.getMap(),fn)}}}(m||(m={}));var u=n(2008),d=n(6871),s=n(7767);const C={lineOfSightDistFactor:o.t.Numeric(1,{min:0,max:3,step:.1})},h=3;function a(ht,pt,Xt){const fn=pt.members[pt.offsets[pt.feature]],on=Xt.members[Xt.offsets[Xt.feature]];if(fn===on&&pt.unit===Xt.unit)return!1;const En=(0,s.q9)(pt.unit,fn),Tt=(0,s.q9)(Xt.unit,on);return!(En&&Tt&&En!==Tt||pt.unit===Xt.unit&&pt.unit.model.atomicHierarchy.residueAtomSegments.count>1&&pt.unit.residueIndex[pt.unit.elements[fn]]===Xt.unit.residueIndex[Xt.unit.elements[on]]||(0,s.z7)(ht,pt.unit,fn,Xt.unit,on))}function S(ht,pt,Xt,fn){const on=(0,s.q9)(ht,pt),En=(0,s.q9)(Xt,fn);return on&&En&&on!==En}function D(ht,pt){const{feature:Xt,offsets:fn,members:on}=pt;for(let En=fn[Xt],Tt=fn[Xt+1];En{J.includes((0,s.$X)(rt,St))&&(ot=!0)}),ot&&Xt.add(7,_.mO.None,on[fn[Fe]],En[fn[Fe]],Tt[fn[Fe]],Fe)}}}),ee={name:"halogen-bonds",params:N,createTester:ht=>{const pt=function j(ht){return{angleMax:(0,U.pu)(ht.angleMax)}}(ht);return{maxDistance:ht.distanceMax,requiredFeatures:new Set([6,7]),getType:(Xt,fn,on)=>function Z(ht,pt,Xt,fn){const on=pt.types[pt.feature];if(!function te(ht,pt){return 7===ht&&6===pt||6===ht&&7===pt}(on,Xt.types[Xt.feature]))return;const[Tt,Fe]=6===on?[pt,Xt]:[Xt,pt],He=Tt.members[Tt.offsets[Tt.feature]],Ye=Fe.members[Fe.offsets[Fe.feature]],ot=(0,V.Ci)(ht,Tt.unit,He,Fe.unit,Ye);if(1!==ot.length||de-ot[0]>fn.angleMax)return;const rt=(0,V.Ci)(ht,Fe.unit,Ye,Tt.unit,He);return 0===rt.length||rt.some(St=>ye-St>fn.angleMax)?void 0:_.X8.HalogenBond}(Xt,fn,on,pt)}}};var g=n(2434);const _e={distanceMax:o.t.Numeric(3.5,{min:1,max:5,step:.1}),backbone:o.t.Boolean(!0,{description:"Include backbone-to-backbone hydrogen bonds"}),accAngleDevMax:o.t.Numeric(45,{min:0,max:180,step:1},{description:"Max deviation from ideal acceptor angle"}),donAngleDevMax:o.t.Numeric(45,{min:0,max:180,step:1},{description:"Max deviation from ideal donor angle"}),accOutOfPlaneAngleMax:o.t.Numeric(90,{min:0,max:180,step:1}),donOutOfPlaneAngleMax:o.t.Numeric(45,{min:0,max:180,step:1})},xe={..._e,water:o.t.Boolean(!1,{description:"Include water-to-water hydrogen bonds"}),sulfurDistanceMax:o.t.Numeric(4.1,{min:1,max:5,step:.1})},le={..._e};function Ae(ht,pt){const Xt=c.F.get(ht).value;if(!Xt)throw Error("expected valence model to be available");const fn=Xt.get(pt.id);if(!fn)throw Error("expected valence model for unit to be available");return fn}function Re(ht,pt){const{elementAromaticRingIndices:Xt,all:fn}=ht.rings,on=Xt.get(pt);if(void 0===on)return!1;for(let En=0,Tt=on.length;EnMath.abs(Fe-ot)>fn.maxDonAngleDev))return;if(pt.idealGeometry[on]===V.G0.Trigonal){const ot=(0,V.$Z)(ht,pt.unit,on,Xt.unit,En);if(void 0!==ot&&ot>fn.maxDonOutOfPlaneAngle)return}const He=(0,V.Ci)(ht,Xt.unit,En,pt.unit,on),Ye=V.UV.get(Xt.idealGeometry[En])||ue;if(!He.some(ot=>Ye-ot>fn.maxAccAngleDev)){if(Xt.idealGeometry[En]===V.G0.Trigonal){const ot=(0,V.$Z)(ht,Xt.unit,En,pt.unit,on);if(void 0!==ot&&ot>fn.maxAccOutOfPlaneAngle)return}return!0}}const se=O.Provider([4],function Be(ht,pt,Xt){const{totalH:fn}=Ae(ht,pt),{elements:on}=pt,{x:En,y:Tt,z:Fe}=pt.model.atomicConformation;for(let He=0,Ye=on.length;He0&&("N"===ot||"O"===ot||"S"===ot))&&Xt.add(4,_.mO.None,En[on[He]],Tt[on[He]],Fe[on[He]],He)}}),ae=O.Provider([9],function Ce(ht,pt,Xt){const{totalH:fn}=Ae(ht,pt),{elements:on}=pt,{x:En,y:Tt,z:Fe}=pt.model.atomicConformation;for(let He=0,Ye=on.length;He0&&((0,s.IS)(ht,pt,He,"N")>0||(0,s.IS)(ht,pt,He,"O")>0||Re(pt,He))&&Xt.add(9,_.mO.None,En[on[He]],Tt[on[He]],Fe[on[He]],He)}),ge=O.Provider([5],function ke(ht,pt,Xt){const{charge:fn,implicitH:on,idealGeometry:En}=Ae(ht,pt),{elements:Tt}=pt,{x:Fe,y:He,z:Ye}=pt.model.atomicConformation,ot=rt=>{Xt.add(5,_.mO.None,Fe[Tt[rt]],He[Tt[rt]],Ye[Tt[rt]],rt)};for(let rt=0,St=Tt.length;rt{const pt=Math.max(ht.distanceMax,ht.sulfurDistanceMax),Xt=function ie(ht){return{...Te(ht),includeWater:ht.water,maxSulfurDistSq:ht.sulfurDistanceMax*ht.sulfurDistanceMax,maxDistSq:ht.distanceMax*ht.distanceMax}}(ht);return{maxDistance:pt,requiredFeatures:new Set([4,5]),getType:(fn,on,En,Tt)=>function ve(ht,pt,Xt,fn,on){const Tt=Xt.types[Xt.feature];if(!function ne(ht,pt){return 5===ht&&4===pt||4===ht&&5===pt}(pt.types[pt.feature],Tt))return;const[Fe,He]=5===Tt?[pt,Xt]:[Xt,pt],Ye=Fe.members[Fe.offsets[Fe.feature]],ot=He.members[He.offsets[He.feature]];return fn>("S"===(0,s.$X)(Fe.unit,Ye)||"S"===(0,s.$X)(He.unit,ot)?on.maxSulfurDistSq:on.maxDistSq)||!on.includeWater&&function K(ht,pt,Xt,fn){return we(ht,pt)&&we(Xt,fn)}(Fe.unit,Ye,He.unit,ot)||!re(ht,Fe,He,on)?void 0:_.X8.HydrogenBond}(fn,on,En,Tt,Xt)}}},Le={name:"weak-hydrogen-bonds",params:le,createTester:ht=>{const pt=Te(ht);return{maxDistance:ht.distanceMax,requiredFeatures:new Set([9,5]),getType:(Xt,fn,on,En)=>function ce(ht,pt,Xt,fn,on){const Tt=Xt.types[Xt.feature];if(!function be(ht,pt){return 9===ht&&5===pt||5===ht&&9===pt}(pt.types[pt.feature],Tt))return;const[Fe,He]=5===Tt?[pt,Xt]:[Xt,pt];return re(ht,Fe,He,on)?_.X8.WeakHydrogenBond:void 0}(Xt,fn,on,0,pt)}}};var nt=n(6948);const je={distanceMax:o.t.Numeric(5,{min:0,max:8,step:.1})},Lt={distanceMax:o.t.Numeric(5.5,{min:1,max:8,step:.1}),offsetMax:o.t.Numeric(2,{min:0,max:4,step:.1}),angleDevMax:o.t.Numeric(30,{min:0,max:180,step:1})},Je={distanceMax:o.t.Numeric(6,{min:1,max:8,step:.1}),offsetMax:o.t.Numeric(2,{min:0,max:4,step:.1})},en=["ARG","HIS","LYS"],Bt=["GLU","ASP"];function pn(ht,pt){const Xt=c.F.get(ht).value;if(!Xt)throw Error("expected valence model to be available");const fn=Xt.get(pt.id);if(!fn)throw Error("expected valence model for unit to be available");return fn}const Kt=(0,i.eB)(),sn=(0,i.eB)(),yt=(0,i.eB)(),At=(0,i.eB)(),Gt=(0,i.eB)(),rn=(0,i.eB)();function tt(ht,pt){const{unit:Xt,feature:fn,offsets:on,members:En}=pt,{elements:Tt}=Xt,Fe=on[fn];return pt.unit.conformation.position(Tt[En[Fe]],yt),pt.unit.conformation.position(Tt[En[Fe+1]],At),pt.unit.conformation.position(Tt[En[Fe+2]],Gt),i.eB.triangleNormal(ht,yt,At,Gt)}const Mt=function(ht,pt,Xt){return O.position(yt,ht),O.position(At,pt),i.eB.sub(Gt,yt,At),i.eB.projectOnPlane(rn,Gt,Xt),i.eB.add(rn,rn,At),i.eB.distance(rn,At)},jt=(0,U.pu)(180),It=(0,U.pu)(90),Dt=(0,i.eB)(),Ct=(0,i.eB)();const yn=O.Provider([2],function mt(ht,pt,Xt){const{charge:fn}=pn(ht,pt),{elements:on}=pt,{x:En,y:Tt,z:Fe}=pt.model.atomicConformation,He=new Set,{label_comp_id:Ye}=pt.model.atomicHierarchy.atoms,ot=y.hT.transientSegments(pt.model.atomicHierarchy.residueAtomSegments,on);for(;ot.hasNext;){const{index:rt,start:St,end:vt}=ot.move(),mn=Ye.value(pt.model.atomicHierarchy.residueAtomSegments.offsets[rt]);if(Bt.includes(mn)){Xt.startState();for(let zt=St;zt{"O"===(0,s.$X)(pt,Vn)&&Xt.pushMember(En[on[Vn]],Tt[on[Vn]],Fe[on[Vn]],Vn)}),Xt.finishState(2,_.mO.Phosphate));else if(!g.px.has(mn)){for(let zt=St;zt{"O"===(0,s.$X)(pt,Fn)&&(He.add(Fn),Xt.pushMember(En[on[Fn]],Tt[on[Fn]],Fe[on[Fn]],Fn))}),Xt.finishState(2,an))}for(let zt=St;zt{"N"===(0,s.$X)(pt,Fn)&&(He.add(Fn),Xt.pushMember(En[on[Fn]],Tt[on[Fn]],Fe[on[Fn]],Fn))}),Xt.finishState(1,an))}for(let zt=St;zt0&&!He.has(zt)&&Xt.add(1,_.mO.None,En[on[zt]],Tt[on[zt]],Fe[on[zt]],zt)}}}),kt=O.Provider([3],function _t(ht,pt,Xt){const{elements:fn}=pt,{x:on,y:En,z:Tt}=pt.model.atomicConformation;for(const Fe of pt.rings.aromaticRings){const He=pt.rings.all[Fe];Xt.startState();for(let Ye=0,ot=He.length;Ye{const pt=function nn(ht){return{distanceMaxSq:ht.distanceMax*ht.distanceMax}}(ht);return{maxDistance:ht.distanceMax,requiredFeatures:new Set([2,1]),getType:(Xt,fn,on,En)=>function $t(ht,pt,Xt,fn,on){if(function Me(ht,pt){return 2===ht&&1===pt||1===ht&&2===pt}(pt.types[pt.feature],Xt.types[Xt.feature])&&function gt(ht,pt,Xt){const{feature:fn,offsets:on,members:En}=ht,{feature:Tt,offsets:Fe,members:He}=pt;for(let Ye=on[fn],ot=on[fn+1];Ye{const pt=function bn(ht){return{offsetMax:ht.offsetMax,angleDevMax:(0,U.pu)(ht.angleDevMax)}}(ht);return{maxDistance:ht.distanceMax,requiredFeatures:new Set([3]),getType:(Xt,fn,on,En)=>function Vt(ht,pt,Xt,fn,on){if(function Ke(ht,pt){return 3===ht&&3===pt}(pt.types[pt.feature],Xt.types[Xt.feature])){tt(Dt,pt),tt(Ct,Xt);const Fe=i.eB.angle(Dt,Ct);if(Math.min(Mt(pt,Xt,Ct),Mt(Xt,pt,Dt))<=on.offsetMax){if(Fe<=on.angleDevMax||Fe>=jt-on.angleDevMax)return _.X8.PiStacking;if(Fe<=on.angleDevMax+It&&Fe>=It-on.angleDevMax)return _.X8.PiStacking}}}(0,fn,on,0,pt)}}},jn={name:"cation-pi",params:Je,createTester:ht=>{const pt=function Dn(ht){return{offsetMax:ht.offsetMax}}(ht);return{maxDistance:ht.distanceMax,requiredFeatures:new Set([3,1]),getType:(Xt,fn,on,En)=>function Wt(ht,pt,Xt,fn,on){const En=pt.types[pt.feature];if(function ut(ht,pt){return 3===ht&&1===pt||1===ht&&3===pt}(En,Xt.types[Xt.feature])){const[Fe,He]=3===En?[pt,Xt]:[Xt,pt];if(tt(Dt,Fe),Mt(He,Fe,Dt)<=on.offsetMax)return _.X8.CationPi}}(0,fn,on,0,pt)}}},On={distanceMax:o.t.Numeric(4,{min:1,max:5,step:.1})},or=O.Provider([8],function fr(ht,pt,Xt){const{elements:fn}=pt,{x:on,y:En,z:Tt}=pt.model.atomicConformation;for(let Fe=0,He=fn.length;Fe{const vt=(0,s.$X)(rt,St);"C"!==vt&&"H"!==vt&&(ot=!1)})):"F"===Ye&&(ot=!0),ot&&Xt.add(8,_.mO.None,on[fn[Fe]],En[fn[Fe]],Tt[fn[Fe]],Fe)}}),Nr={name:"hydrophobic",params:On,createTester:ht=>({maxDistance:ht.distanceMax,requiredFeatures:new Set([8]),getType:(pt,Xt,fn,on)=>function Pr(ht,pt,Xt,fn){if(!function Dr(ht,pt){return 8===ht&&8===pt}(pt.types[pt.feature],Xt.types[Xt.feature]))return;const Fe=Xt.members[Xt.offsets[Xt.feature]];return"F"!==(0,s.$X)(pt.unit,pt.members[pt.offsets[pt.feature]])||"F"!==(0,s.$X)(Xt.unit,Fe)?_.X8.Hydrophobic:void 0}(0,Xt,fn)})};var Ir=n(9986),Or=n(7126);const Jr={distanceMax:o.t.Numeric(3,{min:1,max:5,step:.1})},To=["LI","NA","K","RB","CS","MG","CA","SR","BA","AL","GA","IN","TL","SC","SN","PB","BI","SB","HG"];function ct(ht){return!g.DB.has(ht)}function dt(ht){return g.DB.has(ht)}function Yt(ht){return g.HA.has(ht)}function xn(ht,pt){return 12===ht?11===pt||12===pt:13===ht?10===pt:void 0}const er=O.Provider([13,12],function un(ht,pt,Xt){const{elements:fn}=pt,{x:on,y:En,z:Tt}=pt.model.atomicConformation;for(let Fe=0,He=fn.length;Fe({maxDistance:ht.distanceMax,requiredFeatures:new Set([13,12,10,11]),getType:(pt,Xt,fn,on)=>function Rn(ht,pt,Xt,fn){const on=pt.types[pt.feature],En=Xt.types[Xt.feature];if(xn(on,En)||xn(En,on))return _.X8.MetalCoordination}(0,Xt,fn)})};function vr(ht,pt){const{contacts:Xt}=pt,fn=function(Ye,ot,rt,St,vt){const[mn,zt]=St.get(rt)||[1/0,-1];YeXt.edges[Ye].props.flag=_.tA.Filtered;let Fe,He;return{isApplicable:Ye=>Ye===_.X8.Hydrophobic,handleInterContact:(Ye,ot,rt)=>{on(Ye,ot,rt,En,Tt)},startUnit:(Ye,ot,rt)=>{Fe=new Map,He=St=>ot.edgeProps.flag[St]=_.tA.Filtered},handleIntraContact:(Ye,ot,rt)=>{on(Ye,ot,rt,Fe,He)}}}function Hr(ht,pt){const{contacts:Xt}=pt,fn=(on,En)=>{const Tt=9===on.types[on.feature]?En:on,Fe=Tt.members[Tt.offsets[Tt.feature]],{edgeProps:{type:He},elementsIndex:{offsets:Ye,indices:ot}}=pt.unitsContacts.get(Tt.unit.id);for(let St=Ye[Fe],vt=Ye[Fe+1];Ston===_.X8.WeakHydrogenBond,handleInterContact:(on,En,Tt)=>{fn(En,Tt)&&(Xt.edges[on].props.flag=_.tA.Filtered)},startUnit:()=>{},handleIntraContact:(on,En,Tt)=>{if(fn(En,Tt)){const{flag:Fe}=pt.unitsContacts.get(En.unit.id).edgeProps;Fe[on]=_.tA.Filtered}}}}function Mr(ht,pt,Xt,fn,on){const{offsets:En,feature:Tt}=Xt,{offsets:Fe,feature:He}=fn;for(let Ye=En[Tt],ot=En[Tt+1];Yefn===_.X8.Ionic,handleInterContact:(fn,on,En)=>{Mr([_.X8.HydrogenBond,_.X8.WeakHydrogenBond],fn,on,En,Xt)},startUnit:()=>{},handleIntraContact:(fn,on,En)=>{Fr([_.X8.HydrogenBond,_.X8.WeakHydrogenBond],fn,on,En,pt.unitsContacts.get(on.unit.id))}}}function Ur(ht,pt){const{contacts:Xt}=pt;return{isApplicable:fn=>fn===_.X8.Hydrophobic||fn===_.X8.CationPi,handleInterContact:(fn,on,En)=>{Mr([_.X8.PiStacking],fn,on,En,Xt)},startUnit:()=>{},handleIntraContact:(fn,on,En)=>{Fr([_.X8.PiStacking],fn,on,En,pt.unitsContacts.get(on.unit.id))}}}function Ro(ht,pt){const{contacts:Xt}=pt;return{isApplicable:fn=>fn===_.X8.Ionic,handleInterContact:(fn,on,En)=>{Mr([_.X8.MetalCoordination],fn,on,En,Xt)},startUnit:()=>{},handleIntraContact:(fn,on,En)=>{Fr([_.X8.MetalCoordination],fn,on,En,pt.unitsContacts.get(on.unit.id))}}}var Go,ro=n(364),po=n(6290),so=n(3246),ho=n(3917),Bo=n(1372);!function(ht){function on(ot,rt){const{unitA:St,indexA:vt,unitB:mn,indexB:zt}=rt,{contacts:an,unitsContacts:Vn}=ot;if(St===mn){const Fn=Vn.get(St.id),rr=Fn.getDirectedEdgeIndex(vt,zt);return(0,_.Ls)(Fn.edgeProps.type[rr])}{const Fn=an.getEdgeIndex(vt,St.id,zt,mn.id);return(0,_.Ls)(an.edges[Fn].props.type)}}function He(ot,rt,St){const{unitsFeatures:vt}=ot;return po.p.fromPairProvider(rt.length,(mn,zt,an)=>{const Vn=rt[mn];O.setPosition(zt,Vn.unitA,Vn.indexA,vt.get(Vn.unitA.id)),O.setPosition(an,Vn.unitB,Vn.indexB,vt.get(Vn.unitB.id))},St)}function Ye(ot,rt,St){const vt=St[0];if(void 0===vt)return"";const{unitA:mn,indexA:zt,unitB:an,indexB:Vn}=vt,{unitsFeatures:Fn}=rt,{members:rr,offsets:Vr}=Fn.get(mn.id),{members:tr,offsets:Tr}=Fn.get(an.id),oo={granularity:"element"};return(Vr[zt+1]-Vr[zt]>1||Tr[Vn+1]-Tr[Vn]>1)&&(oo.granularity="residue"),[on(rt,vt),(0,ho.CR)(r.gn.Location(ot,mn,rr[Vr[zt]],ot,an,tr[Tr[Vn]]),oo)].join("
")}ht.Location=function pt(ot,rt,St,vt,mn,zt){return(0,ro.cG)("interactions",{structure:rt,interactions:ot},{unitA:St,indexA:vt,unitB:mn,indexB:zt})},ht.isLocation=function Xt(ot){return!!ot&&"data-location"===ot.kind&&"interactions"===ot.tag},ht.areLocationsEqual=function fn(ot,rt){return ot.data.structure===rt.data.structure&&ot.data.interactions===rt.data.interactions&&ot.element.indexA===rt.element.indexA&&ot.element.indexB===rt.element.indexB&&ot.element.unitA===rt.element.unitA&&ot.element.unitB===rt.element.unitB},ht.locationLabel=function En(ot){return on(ot.data.interactions,ot.element)},ht.Loci=function Tt(ot,rt,St){return(0,so.g9)("interactions",{structure:ot,interactions:rt},St,vt=>He(rt,St,vt),()=>Ye(ot,rt,St))},ht.isLoci=function Fe(ot){return!!ot&&"data-loci"===ot.kind&&"interactions"===ot.tag},ht.getBoundingSphere=He,ht.getLabel=Ye}(Go||(Go={}));const Wo=[se,ae,ge,yn,Zt,kt,q,Y,or,er,ir],We={ionic:Ot,"pi-stacking":An,"cation-pi":jn,"halogen-bonds":ee,"hydrogen-bonds":Ie,"weak-hydrogen-bonds":Le,hydrophobic:Nr,"metal-coordination":Yn},Sn=function Pt(ht=[]){const pt=Object.create(null);return Object.keys(We).forEach(Xt=>{pt[Xt]=o.t.MappedStatic(ht.includes(Xt)?"on":"off",{on:o.t.Group(We[Xt].params),off:o.t.Group({})},{cycle:!0})}),pt}(["cation-pi","pi-stacking","hydrogen-bonds","halogen-bonds","metal-coordination"]),Nn={providers:o.t.Group(Sn,{isFlat:!0}),contacts:o.t.Group(C,{label:"Advanced Options"})};function Kn(ht,pt,Xt){return dr.apply(this,arguments)}function dr(){return dr=(0,e.A)(function*(ht,pt,Xt){const fn={...o.t.getDefaultValues(Nn),...Xt};yield c.F.attach(ht,pt);const on=[];(0,Bo.mX)(We).forEach(rt=>{const{name:St,params:vt}=fn.providers[rt];"on"===St&&on.push(We[rt].createTester(vt))});const En=new Set;on.forEach(rt=>Ir.M.add(En,rt.requiredFeatures));const Tt=Wo.filter(rt=>Ir.M.areIntersecting(En,rt.types)),Fe=y.Yz.Mutable(),He=y.Yz.Mutable();for(let rt=0,St=pt.unitSymmetryGroups.length;rt{const Fe=pt.get(En.id),He=pt.get(Tt.id);!function G(ht,pt,Xt,fn,on,En,Tt,Fe){const{count:He,x:Ye,y:ot,z:rt}=Xt,{lookup3d:St}=on,vt=i.$I.mul(Q,fn.conformation.operator.inverse,pt.conformation.operator.matrix),mn=!i.$I.isIdentity(vt),zt=(0,i.eB)(),an=Math.max(...Tt.map(oo=>oo.maxDistance)),{center:Vn,radius:Fn}=St.boundary.sphere,rr=(Fn+an)*(Fn+an),Vr=Fe.lineOfSightDistFactor,tr=O.Info(ht,pt,Xt),Tr=O.Info(ht,fn,on);En.startUnitPair(pt,fn);for(let oo=0;oorr)continue;const{indices:Gr,count:Ao,squaredDistances:yo}=St.find(zt[0],zt[1],zt[2],an);if(0!==Ao){tr.feature=oo;for(let vo=0;voEn.maxDistance)),validUnit:En=>r.Nf.isAtomic(En),validUnitPair:(En,Tt)=>r.oE.validUnitPair(ht,En,Tt)}),on.getContacts(pt)}(pt,Fe,on,fn.contacts),ot={unitsFeatures:Fe,unitsContacts:He,contacts:Ye};return function br(ht,pt){const{contacts:Xt,unitsContacts:fn,unitsFeatures:on}=pt,En=[vr(0,pt),Hr(0,pt),Sr(0,pt),Ur(0,pt),Ro(0,pt)];for(let Fe=0,He=Xt.edgeCount;Fe{"use strict";n.d(Ue,{MH:()=>ye});var e=n(8277),o=n(2443),r=n(1758),t=n(467),A=n(9136),y=n(4369),c=n(3246),i=n(3543),v=n(9283),O=n(6713),b=n(377),_=n(2741),M=n(1888),I=n(9126),l=n(9469),m=n(5384),u=n(2556),d=n(1372);const s={sizeFactor:e.t.Numeric(.3,{min:0,max:10,step:.01}),dashCount:e.t.Numeric(6,{min:1,max:10,step:1}),dashScale:e.t.Numeric(.4,{min:0,max:2,step:.1}),ignoreHydrogens:e.t.Boolean(!1),ignoreHydrogensVariant:e.t.Select("all",e.t.arrayToOptions(["all","non-polar"])),includeParent:e.t.Boolean(!1),parentDisplay:e.t.Select("stub",e.t.arrayToOptions(["stub","full","between"]),{description:'Only has an effect when "includeParent" is enabled. "Stub" shows just the child side of interactions to the parent. "Full" shows both sides of interactions to the parent. "Between" shows only interactions to the parent.'})};var C=n(7767);function h(j,Z,q,Y,ee,g){return a.apply(this,arguments)}function a(){return(a=(0,t.A)(function*(j,Z,q,Y,ee,g){if(!A.Nf.isAtomic(Z))return v.e.createEmpty(g);const{child:_e}=q,xe=_e?.unitMap.get(Z.id);if(_e&&!xe)return v.e.createEmpty(g);const le=A.iZ.Location.create(q,Z),Ae=O.r.get(q).value,Be=Ae.unitsFeatures.get(Z.id),Ce=Ae.unitsContacts.get(Z.id),{x:Re,y:ke,z:we,members:Oe,offsets:Se}=Be,{edgeCount:Ve,a:Ne,b:K,edgeProps:{flag:ne,type:be}}=Ce,{sizeFactor:Te,ignoreHydrogens:ie,ignoreHydrogensVariant:ue,parentDisplay:re}=ee;if(!Ve)return v.e.createEmpty(g);const{elements:ve,conformation:ce}=Z,se=(0,y.eB)(),ae=(0,y.eB)(),ge=(0,y.eB)(),Ie={linkCount:2*Ve,position:(je,Lt,Je)=>{const en=be[Je];if(ie&&"all"===ue||en!==l.X8.HydrogenBond&&en!==l.X8.WeakHydrogenBond)y.eB.set(je,Re[Ne[Je]],ke[Ne[Je]],we[Ne[Je]]),y.eB.set(Lt,Re[K[Je]],ke[K[Je]],we[K[Je]]);else{const Bt=Oe[Se[Ne[Je]]],pn=Oe[Se[K[Je]]];ce.invariantPosition(ve[Bt],ae),ce.invariantPosition(ve[pn],ge);let $e=y.eB.distance(ae,ge),mt=$e;y.eB.copy(je,ae),y.eB.copy(Lt,ge),(0,C.B8)(Z,Bt,(_t,Me)=>{if((0,u.v3)(q,Z,ve[Me],"polar")){ce.invariantPosition(ve[Me],se);const Ke=y.eB.distance(se,ge);Ke<$e&&($e=Ke,y.eB.copy(je,se))}}),(0,C.B8)(Z,pn,(_t,Me)=>{if((0,u.v3)(q,Z,ve[Me],"polar")){ce.invariantPosition(ve[Me],se);const Ke=y.eB.distance(se,ae);Ke1,radius:je=>{le.element=ve[Oe[Se[Ne[je]]]];const Lt=Y.size.size(le);le.element=ve[Oe[Se[K[je]]]];const Je=Y.size.size(le);return Math.min(Lt,Je)*Te},ignore:je=>{if(ne[je]===l.tA.Filtered)return!0;if(xe)if("stub"===re){const Lt=Ne[je];for(let Je=Se[Lt],en=Se[Lt+1];Je0){const je=m.f8.expand((0,m.f8)(),(xe??Z).boundary.sphere,1*Te);Le.setBoundingSphere(je)}return Le})).apply(this,arguments)}const S={..._.Te,...b.Lr,...s};function D(j){return(0,_.Pv)({defaultProps:e.t.getDefaultValues(S),createGeometry:h,createLocationIterator:E,getLoci:R,eachLocation:p,setUpdateState:(Z,q,Y,ee,g,_e,xe)=>{Z.createGeometry=q.sizeFactor!==Y.sizeFactor||q.dashCount!==Y.dashCount||q.dashScale!==Y.dashScale||q.dashCap!==Y.dashCap||q.radialSegments!==Y.radialSegments||q.ignoreHydrogens!==Y.ignoreHydrogens||q.ignoreHydrogensVariant!==Y.ignoreHydrogensVariant||q.parentDisplay!==Y.parentDisplay;const le=O.r.get(_e.structure).version;Z.info.interactionsHash!==le&&(Z.createGeometry=!0,Z.updateTransform=!0,Z.updateColor=!0,Z.info.interactionsHash=le)}},j)}function R(j,Z,q){const{objectId:Y,instanceId:ee,groupId:g}=j;if(q===Y){const{structure:_e,group:xe}=Z,le=_e.unitMap.get(xe.units[ee].id),Ae=O.r.get(_e).value,{a:Be,b:Ce}=Ae.unitsContacts.get(le.id);return I.OG.Loci(_e,Ae,[{unitA:le,indexA:Be[g],unitB:le,indexB:Ce[g]},{unitA:le,indexA:Ce[g],unitB:le,indexB:Be[g]}])}return c.BL}const f=new Set;function p(j,Z,q,Y){let ee=!1;if(I.OG.isLoci(j)){const{structure:g,group:_e}=Z;if(!A.oE.areEquivalent(j.data.structure,g))return!1;const xe=O.r.get(g).value;if(j.data.interactions!==xe)return!1;const Ae=xe.unitsContacts.get(_e.units[0].id),Be=2*Ae.edgeCount;for(const Ce of j.elements){if(Ce.unitA!==Ce.unitB)continue;const Re=_e.unitIndexMap.get(Ce.unitA.id);if(void 0!==Re){const ke=Ae.getDirectedEdgeIndex(Ce.indexA,Ce.indexB);-1!==ke&&q(i.IX.ofSingleton(Re*Be+ke))&&(ee=!0)}}}else if(A.iZ.Loci.is(j)){const{structure:g,group:_e}=Z;if(!A.oE.areEquivalent(j.structure,g))return!1;const xe=O.r.get(g).value;if(!xe)return!1;const le=_e.units[0],Ae=xe.unitsContacts.get(le.id),Be=xe.unitsFeatures.get(le.id),Ce=2*Ae.edgeCount,{offset:Re}=Ae,{offsets:ke,indices:we}=Be.elementsIndex,{members:Oe,offsets:Se}=Be;for(const Ve of j.elements){const Ne=_e.unitIndexMap.get(Ve.unit.id);void 0!==Ne&&(i.CD.forEach(Ve.indices,K=>{for(let ne=ke[K],be=ke[K+1];ne{if(Y){const ne=Ae.a[K];for(let Te=Se[ne],ie=Se[ne+1];Te{const ke=q.units[Re];return Ae.unitA=ke,Ae.indexA=g.a[Ce],Ae.unitB=ke,Ae.indexB=g.b[Ce],le})}var T=n(3892),L=n(8672);function w(j,Z,q,Y,ee){if(!Z.hasAtomic)return v.e.createEmpty(ee);const g=A.iZ.Location.create(Z),_e=O.r.get(Z).value,{contacts:xe,unitsFeatures:le}=_e,{edgeCount:Ae,edges:Be}=xe,{sizeFactor:Ce,ignoreHydrogens:Re,ignoreHydrogensVariant:ke,parentDisplay:we}=Y;if(!Ae)return v.e.createEmpty(ee);const{child:Oe}=Z,Se=(0,y.eB)(),Ve=(0,y.eB)(),Ne=(0,y.eB)(),K={linkCount:Ae,position:(Te,ie,ue)=>{const{unitA:re,indexA:ve,unitB:ce,indexB:se,props:{type:ae}}=Be[ue],ge=le.get(re),Ie=le.get(ce),Le=Z.unitMap.get(re),nt=Z.unitMap.get(ce);if(Re&&"all"===ke||ae!==l.X8.HydrogenBond&&ae!==l.X8.WeakHydrogenBond)y.eB.set(Te,ge.x[ve],ge.y[ve],ge.z[ve]),y.eB.transformMat4(Te,Te,Le.conformation.operator.matrix),y.eB.set(ie,Ie.x[se],Ie.y[se],Ie.z[se]),y.eB.transformMat4(ie,ie,nt.conformation.operator.matrix);else{const je=ge.members[ge.offsets[ve]],Lt=Ie.members[Ie.offsets[se]];Le.conformation.position(Le.elements[je],Ve),nt.conformation.position(nt.elements[Lt],Ne);let Je=y.eB.distance(Ve,Ne),en=Je;y.eB.copy(Te,Ve),y.eB.copy(ie,Ne),(0,C.LH)(Z,Le,je,(Bt,pn)=>{const $e=Bt.elements[pn];if((0,u.v3)(Z,Bt,$e,"polar")){Bt.conformation.position($e,Se);const mt=y.eB.distance(Se,Ne);mt{const $e=Bt.elements[pn];if((0,u.v3)(Z,Bt,$e,"polar")){Bt.conformation.position($e,Se);const mt=y.eB.distance(Se,Ve);mt1,radius:Te=>{const ie=Be[Te],ue=le.get(ie.unitA);g.unit=Z.unitMap.get(ie.unitA),g.element=g.unit.elements[ue.members[ue.offsets[ie.indexA]]];const re=q.size.size(g),ve=le.get(ie.unitB);g.unit=Z.unitMap.get(ie.unitB),g.element=g.unit.elements[ve.members[ve.offsets[ie.indexB]]];const ce=q.size.size(g);return Math.min(re,ce)*Ce},ignore:Te=>{if(Be[Te].props.flag===l.tA.Filtered)return!0;if(Oe){const ie=Be[Te];if("stub"===we){const ue=Oe.unitMap.get(ie.unitA);if(!ue)return!0;const re=Z.unitMap.get(ie.unitA),{offsets:ve,members:ce}=le.get(ie.unitA);for(let se=ve[ie.indexA],ae=ve[ie.indexA+1];se0){const{child:Te}=Z,ie=m.f8.expand((0,m.f8)(),(Te??Z).boundary.sphere,1*Ce);ne.setBoundingSphere(ie)}return ne}const Q={...T.EN,...b.Lr,...s};function G(j){return(0,T.wA)({defaultProps:e.t.getDefaultValues(Q),createGeometry:w,createLocationIterator:H,getLoci:V,eachLocation:k,setUpdateState:(Z,q,Y,ee,g,_e,xe)=>{Z.createGeometry=q.sizeFactor!==Y.sizeFactor||q.dashCount!==Y.dashCount||q.dashScale!==Y.dashScale||q.dashCap!==Y.dashCap||q.radialSegments!==Y.radialSegments||q.ignoreHydrogens!==Y.ignoreHydrogens||q.ignoreHydrogensVariant!==Y.ignoreHydrogensVariant||q.parentDisplay!==Y.parentDisplay;const le=O.r.get(_e).version;Z.info.interactionsHash!==le&&(Z.createGeometry=!0,Z.updateTransform=!0,Z.updateColor=!0,Z.info.interactionsHash=le)}},j)}function V(j,Z,q){const{objectId:Y,groupId:ee}=j;if(q===Y){const g=O.r.get(Z).value,_e=g.contacts.edges[ee],xe=Z.unitMap.get(_e.unitA),le=Z.unitMap.get(_e.unitB);return I.OG.Loci(Z,g,[{unitA:xe,indexA:_e.indexA,unitB:le,indexB:_e.indexB},{unitA:le,indexA:_e.indexB,unitB:xe,indexB:_e.indexA}])}return c.BL}const U=new Map,N=new Set;function k(j,Z,q,Y){let ee=!1;if(I.OG.isLoci(j)){if(!A.oE.areEquivalent(j.data.structure,Z))return!1;const g=O.r.get(Z).value;if(j.data.interactions!==g)return!1;const{contacts:_e}=g;for(const xe of j.elements){const le=_e.getEdgeIndex(xe.indexA,xe.unitA.id,xe.indexB,xe.unitB.id);-1!==le&&q(i.IX.ofSingleton(le))&&(ee=!0)}}else if(A.iZ.Loci.is(j)){if(!A.oE.areEquivalent(j.structure,Z)||Y&&1===j.elements.length)return!1;const g=O.r.get(Z).value;if(!g)return!1;const{contacts:_e,unitsFeatures:xe}=g;for(const le of j.elements)U.set(le.unit.id,le.indices);for(const le of j.elements){const{unit:Ae}=le;L.Nf.isAtomic(Ae)&&i.CD.forEach(le.indices,Be=>{for(const Ce of _e.getContactIndicesForElement(Be,Ae))N.add(Ce)})}N.forEach(le=>{if(Y){const{indexA:Ae,unitA:Be,indexB:Ce,unitB:Re}=_e.edges[le],ke=U.get(Be),we=U.get(Re);if(!ke||!we)return;const{offsets:Oe,members:Se}=xe.get(Be);for(let K=Oe[Ae],ne=Oe[Ae+1];K{const Ae=q.edges[le];return _e.unitA=j.unitMap.get(Ae.unitA),_e.indexA=Ae.indexA,_e.unitB=j.unitMap.get(Ae.unitB),_e.indexB=Ae.indexB,g},!0)}var $=n(5201);const J={"intra-unit":(j,Z)=>(0,r.TP)("Intra-unit interactions cylinder",j,Z,D),"inter-unit":(j,Z)=>(0,r.Kp)("Inter-unit interactions cylinder",j,Z,G)},W={...S,...Q,unitKinds:(0,$.R8)(["atomic"]),sizeFactor:e.t.Numeric(.2,{min:.01,max:1,step:.01}),visuals:e.t.MultiSelect(["intra-unit","inter-unit"],e.t.objectToOptions(J))},ye=(0,r.GT)({name:"interactions",label:"Non-covalent Interactions",description:"Displays non-covalent interactions as dashed cylinders.",factory:function de(j,Z){return o.YL.createMulti("Interactions",j,Z,r.J1,J)},getParams:function te(j,Z){return e.t.clone(W)},defaultValues:e.t.getDefaultValues(W),defaultColorTheme:{name:"interaction-type"},defaultSizeTheme:{name:"uniform"},isApplicable:j=>j.elementCount>0&&O.r.isApplicable(j),ensureCustomProperties:{attach:(j,Z)=>O.r.attach(j,Z,void 0,!0),detach:j=>O.r.ref(j,!1)},getData:(j,Z)=>Z.includeParent?j.asParent():j,mustRecreate:(j,Z)=>j.includeParent!==Z.includeParent})},8699:(tn,Ue,n)=>{"use strict";n.d(Ue,{v:()=>_e});var e=n(467),o=n(4743),r=n(2434),t=n(8277),A=n(4369),y=n(4490),i=n(4506);const v=9,O=-27.888,b=-.5,_=-9.9;function M(Ce,Re,ke,we){const Oe=A.eB.distance(Ce,we),Se=A.eB.distance(Re,we),Ve=A.eB.distance(Re,ke),Ne=A.eB.distance(Ce,ke),be=O/Oe-O/Se+(O/Ve-O/Ne);return be<_?_:be}var u,Ce,m=n(9909);(Ce=u||(u={})).is=m.NJ.has,Ce.create=m.NJ.create;class d{constructor(Re,ke,we){this.partner1=Math.min(Re,ke),this.partner2=Math.max(Re,ke),this.type=we}}function h(Ce,Re){if(Re.type!==Ce.type||Re.partner1!==Ce.firstEnd+1)return!1;if(0===Re.type){if(Re.partner2===Ce.secondEnd+1)return!0}else if(Re.partner2===Ce.secondStart-1)return!0;return!1}function a(Ce,Re){return Ce.type===Re.type&&Re.firstStart-Ce.firstEnd<6&&Ce.firstStart0&&(Re.secondStart-Ce.secondEnd<6&&Re.firstStart-Ce.firstEnd<3||Re.secondStart-Ce.secondEnd<3)}function f(Ce){return u.is(Ce,8)||u.is(Ce,1)||u.is(Ce,16)}var T=n(5384),L=n(3543),w=n(9535);const V={oldDefinition:t.t.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:t.t.Boolean(!0,{description:"Alpha-helices are preferred over 3-10 helices"})};function U(Ce,Re){return N.apply(this,arguments)}function N(){return N=(0,e.A)(function*(Ce,Re){const ke=function G(Ce){const{index:Re}=Ce.model.atomicHierarchy,{proteinElements:ke,residueIndex:we}=Ce,Oe=ke.length,Se=new Uint32Array(Oe),Ve=new Int32Array(Oe),Ne=new Int32Array(Oe),K=new Int32Array(Oe),ne=new Int32Array(Oe);for(let be=0;beb||(ie[ie.length]=Lt,ue[ue.length]=Me,re[re.length]=Kt)}}return function l(Ce,Re,ke,we){const Oe=new i.O.DirectedEdgeBuilder(Ce,Re,ke),Se=new Float32Array(Oe.slotCount);for(let Ve=0,Ne=Oe.edgeCount;Ve-1===Le?A.eB.setNaN(nt):Se.position(Le,nt);let be=(0,A.eB)(),Te=(0,A.eB)(),ie=(0,A.eB)(),ue=(0,A.eB)(),re=(0,A.eB)(),ve=(0,A.eB)();const ce=(0,A.eB)(),se=(0,A.eB)(),ae=(0,A.eB)();if(0===K)return{phi:new Float32Array(0),psi:new Float32Array(0)};const ge=new Float32Array(K-1),Ie=new Float32Array(K-1);ne(-1,be),ne(-1,Te),ne(-1,ie),ne(ke[0],ue),ne(Ne[Oe[0]],re),ne(we[0],ve),ne(ke[1],ce),ne(Ne[Oe[1]],se),ne(we[1],ae);for(let Le=0;Le-1===se?A.eB.setNaN(ae):Oe.position(se,ae),be=(0,A.eB)(),Te=(0,A.eB)(),ie=(0,A.eB)(),ue=(0,A.eB)(),re=(0,A.eB)(),ve=(0,A.eB)(),ce=(0,A.eB)();e:for(let se=2;se6.25)continue e}const nt=Se[Ve[se]],je=Se[Ve[se+2]];ne(Se[Ve[se-2]],be),ne(nt,Te),ne(je,ie),A.eB.sub(ve,be,Te),A.eB.sub(ce,Te,ie);const Lt=(0,y.H)(A.eB.angle(ve,ce));Lt&&Lt>70&&(ke[se]|=32)}}(ue),function R(Ce){const{proteinInfo:Re,hbonds:ke,flags:we,bridges:Oe}=Ce,{offset:Se,b:Ve}=ke;let Ne,K;for(let ne=0,be=Re.residueIndices.length;neue||(Ne=ne+1,K=ue,Ne!==K&&-1!==ke.getDirectedEdgeIndex(K,Ne+1)&&(we[Ne]|=2,we[K]|=2,Oe[Oe.length]=new d(Ne,K,0)),Ne=ne,K=ue-1,Ne!==K&&-1!==ke.getDirectedEdgeIndex(K-1,Ne)&&(we[Ne]|=2,we[K]|=2,Oe[Oe.length]=new d(K,Ne,0)),Ne=ne,K=ue,Ne!==K&&-1!==ke.getDirectedEdgeIndex(K,Ne)&&(we[Ne]|=2,we[K]|=2,Oe[Oe.length]=new d(K,Ne,1)),Ne=ne+1,K=ue-1,Ne!==K&&-1!==ke.getDirectedEdgeIndex(K-1,Ne+1)&&(we[Ne]|=2,we[K]|=2,Oe[Oe.length]=new d(K,Ne,1)))}Oe.sort((ne,be)=>ne.partner1>be.partner1?1:ne.partner1L.SortedArray.indexOf(we,ge))}),N.apply(this,arguments)}function k(Ce,Re,ke){return"helix"===Ce?{kind:"helix",flags:ke(Re)}:"sheet"===Ce?{kind:"sheet",flags:ke(Re)}:"turn"===Ce||"bend"===Ce?{kind:"turn",flags:ke(Re)}:{kind:"none"}}function H(Ce){return Ce===r.gG.SecondaryStructureDssp.H||Ce===r.gG.SecondaryStructureDssp.G||Ce===r.gG.SecondaryStructureDssp.I?"helix":Ce===r.gG.SecondaryStructureDssp.B||Ce===r.gG.SecondaryStructureDssp.E?"sheet":Ce===r.gG.SecondaryStructureDssp.T?"turn":Ce===r.gG.SecondaryStructureDssp.S?"bend":"none"}function $(Ce){return u.is(Ce,1)?r.gG.SecondaryStructureDssp.H:u.is(Ce,4)?r.gG.SecondaryStructureDssp.E:u.is(Ce,2)?r.gG.SecondaryStructureDssp.B:u.is(Ce,8)?r.gG.SecondaryStructureDssp.G:u.is(Ce,16)?r.gG.SecondaryStructureDssp.I:u.is(Ce,64)?r.gG.SecondaryStructureDssp.T:u.is(Ce,32)?r.gG.SecondaryStructureDssp.S:0}function J(Ce){return u.is(Ce,1)?"H":u.is(Ce,4)?"E":u.is(Ce,2)?"B":u.is(Ce,8)?"G":u.is(Ce,16)?"I":u.is(Ce,64)?"T":u.is(Ce,32)?"S":"-"}function W(Ce){return u.is(Ce,16)?r.gG.SecondaryStructureDssp.I:u.is(Ce,1)?r.gG.SecondaryStructureDssp.H:u.is(Ce,4)?r.gG.SecondaryStructureDssp.E:u.is(Ce,2)?r.gG.SecondaryStructureDssp.B:u.is(Ce,8)?r.gG.SecondaryStructureDssp.G:u.is(Ce,64)?r.gG.SecondaryStructureDssp.T:u.is(Ce,32)?r.gG.SecondaryStructureDssp.S:0}function te(Ce){return u.is(Ce,16)?"I":u.is(Ce,1)?"H":u.is(Ce,4)?"E":u.is(Ce,2)?"B":u.is(Ce,8)?"G":u.is(Ce,64)?"T":u.is(Ce,32)?"S":"-"}var ye=n(8672),j=n(5439),Z=n(6710),q=n(1692),Y=n(5644);function ee(Ce){let Re="model";if(Ce){Re="dssp";for(let ke=0,we=Ce.models.length;ke!0,obtain:function(){var Ce=(0,e.A)(function*(Re,ke,we){const Oe={...t.t.getDefaultValues(g),...we};switch(Oe.type.name){case"dssp":return{value:yield xe(ke,Oe.type.params)};case"model":return{value:yield Ae(ke)}}});return function(ke,we,Oe){return Ce.apply(this,arguments)}}()});function xe(Ce,Re){return le.apply(this,arguments)}function le(){return le=(0,e.A)(function*(Ce,Re){const ke=new Map;for(let we=0,Oe=Ce.unitSymmetryGroups.length;we{"use strict";n.d(Ue,{YU:()=>u});var e=n(190),o=n(8277),r=n(6713),t=n(274),A=n(9469),y=n(2293),c=n(9126),i=n(8382);const v=(0,e.Q1)(13421772),b=(0,e._j)({HydrogenBond:2851770,Hydrophobic:8421504,HalogenBond:4259775,Ionic:15779860,MetalCoordination:9191577,CationPi:16744448,PiStacking:9220966,WeakHydrogenBond:12967404}),_=[["Hydrogen Bond",b.HydrogenBond],["Hydrophobic",b.Hydrophobic],["Halogen Bond",b.HalogenBond],["Ionic",b.Ionic],["Metal Coordination",b.MetalCoordination],["Cation Pi",b.CationPi],["Pi Stacking",b.PiStacking],["Weak HydrogenBond",b.WeakHydrogenBond]];function M(d){switch(d){case A.X8.HydrogenBond:return b.HydrogenBond;case A.X8.Hydrophobic:return b.Hydrophobic;case A.X8.HalogenBond:return b.HalogenBond;case A.X8.Ionic:return b.Ionic;case A.X8.MetalCoordination:return b.MetalCoordination;case A.X8.CationPi:return b.CationPi;case A.X8.PiStacking:return b.PiStacking;case A.X8.WeakHydrogenBond:return b.WeakHydrogenBond;case A.X8.Unknown:return v}}const I={},u={name:"interaction-type",label:"Interaction Type",category:t.J.Category.Misc,factory:function m(d,s){let C;const h=d.structure?r.r.get(d.structure):void 0,a=h?(0,i.vb)(h.id,h.version):-1;return C=h&&h.value?S=>{if(c.OG.isLocation(S)){const{unitsContacts:D,contacts:R}=S.data.interactions,{unitA:f,unitB:p,indexA:E,indexB:T}=S.element;if(f===p){const L=D.get(f.id),w=L.getDirectedEdgeIndex(E,T);return M(L.edgeProps.type[w])}{const L=R.getEdgeIndex(E,f.id,T,p.id);return M(R.edges[L].props.type)}}return v}:()=>v,{factory:m,granularity:"group",color:C,props:s,contextHash:a,description:"Assigns colors according the interaction type of a link.",legend:(0,y.h)(_)}},getParams:function l(d){return I},defaultValues:o.t.getDefaultValues(I),isApplicable:d=>!!d.structure,ensureCustomProperties:{attach:(d,s)=>s.structure?r.r.attach(d,s.structure,void 0,!0):Promise.resolve(),detach:d=>d.structure&&r.r.ref(d.structure,!1)}}},9311:(tn,Ue,n)=>{"use strict";n.d(Ue,{F:()=>D});var e=n(467),o=n(8277),r=n(9136),t=n(7126),A=n(3024),y=n(7767),c=n(2629),i=n(3543),v=n(2434);const O=new r.gn.ElementBondIterator,b=new r.gn.ElementBondIterator,I=new r.gn.ElementBondIterator,l=new r.gn.ElementBondIterator;function m(R,f,p,E){const T=(0,y.IS)(R,f,p,"H"),L=(0,y.$X)(f,p);let w=(0,y.M0)(f,p);const Q="always"===E.assignCharge||"auto"===E.assignCharge&&0===w,G="always"===E.assignH||"auto"===E.assignH&&0===T,V=(0,y.Hm)(R,f,p),U=function M(R,f,p){let E=0;const{offset:T,edgeProps:{flags:L,order:w}}=f.bonds;for(let Q=T[p],G=T[p+1];Q{const G=R.interUnitBonds.edges[Q];v.I$.isCovalent(G.props.flag)&&(E+=G.props.order)}),E}(R,f,p),N=function _(R,f,p){const E=(0,y.$X)(f,p),T="O"===E||"N"===E;if(T&&4===(0,y.Hm)(R,f,p))return!1;for(O.setElement(R,f,p);O.hasNext;){const L=O.move();if(L.order>1)return!0;if(T){const w=(0,y.$X)(L.otherUnit,L.otherIndex);for(b.setElement(R,L.otherUnit,L.otherIndex);b.hasNext;){const Q=b.move();if(Q.order>1){if(("P"===w||"S"===w)&&"O"===(0,y.$X)(Q.otherUnit,Q.otherIndex))continue;return!0}}}}return!1}(R,f,p),k=U-V>0;let H=0,$=A.G0.Unknown;switch(L){case"H":Q&&(0===V?(w=1,$=A.G0.Spherical):1===V&&(w=0,$=A.G0.Terminal));break;case"C":Q&&(w=0),G&&(H=Math.max(0,4-U-Math.abs(w))),$=(0,A.kx)(V+H+Math.max(0,-w));break;case"N":if(Q)if(G)if(N&&U<4)w=V-T==1&&U-T==2?1:0;else for(I.setElement(R,f,p);I.hasNext;){const J=I.move(),W=(0,y.$X)(J.otherUnit,J.otherIndex);if("S"===W||(0,t.kV)(W)){w=0;break}w=1}else w=U-3;G&&(H=Math.max(0,3-U+w)),$=(0,A.kx)(N&&!k?V+H-w:V+H+1-w);break;case"O":if(Q&&(G||(w=U-2),1===U)){I.setElement(R,f,p);e:for(;I.hasNext;){const J=I.move();for(l.setElement(R,J.otherUnit,J.otherIndex);l.hasNext;){const W=l.move();if((W.otherUnit!==f||W.otherIndex!==p)&&"O"===(0,y.$X)(W.otherUnit,W.otherIndex)&&2===W.order){w=-1;break e}}}}G&&(H=Math.max(0,2-U+w)),$=(0,A.kx)(N&&!k?V+H-w+1:V+H-w+2);break;case"S":Q&&(G||(w=U<=3&&0===(0,y.IS)(R,f,p,"O")?U-2:0)),G&&U<2&&(H=Math.max(0,2-U+w)),U<=3&&($=(0,A.kx)(V+H-w+2));break;case"F":case"CL":case"BR":case"I":case"AT":Q&&(w=U-1);break;case"LI":case"NA":case"K":case"RB":case"CS":case"FR":Q&&(w=1-U);break;case"BE":case"MG":case"CA":case"SR":case"BA":case"RA":Q&&(w=2-U);break;default:c.Bb&&console.warn("Requested charge, protonation for an unhandled element",L)}return[w,H,H+T,$]}function u(R,f,p){const E=f.elements.length,T=new Int8Array(E),L=new Int8Array(E),w=new Int8Array(E),Q=new Int8Array(E),G=!!R.parent;let V;if(G){const U=R.root.unitMap.get(f.id);if(V=i.SortedArray.indicesOf(U.elements,f.elements),V.length!==f.elements.length)throw new Error("expected to find an index for every element");f=U,R=R.root}for(let U=0;US,isApplicable:R=>!0,obtain:(R=(0,e.A)(function*(f,p,E){const T={...o.t.getDefaultValues(S),...E};return{value:yield s(f.runtime,p,T)}}),function(p,E,T){return R.apply(this,arguments)})});var R},6220:(tn,Ue,n)=>{"use strict";n.d(Ue,{W:()=>A});var A,e=n(467),o=n(2524),r=n(1692),t=n(387);!function(y){var b;function c(b){if(!o.K4.is(b.sourceData))return!1;const{pdbx_sifts_xref_db_name:_,pdbx_sifts_xref_db_acc:M,pdbx_sifts_xref_db_num:I,pdbx_sifts_xref_db_res:l}=b.sourceData.data.db.atom_site;return _.isDefined&&M.isDefined&&I.isDefined&&l.isDefined}function O(b){if(!o.K4.is(b.sourceData))return;const{pdbx_sifts_xref_db_name:_,pdbx_sifts_xref_db_acc:M,pdbx_sifts_xref_db_num:I,pdbx_sifts_xref_db_res:l}=b.sourceData.data.db.atom_site;if(!(_.isDefined&&M.isDefined&&I.isDefined&&l.isDefined))return;const{atomSourceIndex:m}=b.atomicHierarchy,{count:u,offsets:d}=b.atomicHierarchy.residueAtomSegments,s=new Array(u),C=new Array(u),h=new Array(u),a=new Array(u);for(let S=0;S({}),isApplicable:b=>c(b),obtain:(b=(0,e.A)(function*(_,M){return{value:O(M)}}),function(M,I){return b.apply(this,arguments)})}),y.isAvailable=c,y.getKey=function i(b){const _=b.unit.model,M=y.Provider.get(_).value;return M?M.accession[_.atomicHierarchy.residueAtomSegments.index[b.element]]:""},y.getLabel=function v(b){const _=b.unit.model,M=y.Provider.get(_).value;if(!M)return;const I=_.atomicHierarchy.residueAtomSegments.index[b.element],l=M.dbName[I];return l?`${l} ${M.accession[I]} ${M.num[I]} ${M.residue[I]}`:void 0}}(A||(A={}))},1692:(tn,Ue,n)=>{"use strict";n.d(Ue,{e:()=>o,v:()=>r});var e=n(9909);function o(t){return t}(o||(o={})).getUUID=function A(y){return y.__key||(y.__key=e.kk.create22()),y.__key};class r{constructor(){this._list=[],this._set=new Set,this._refs=new Map,this._assets=new Map}get all(){return this._list}add(A){this._set.has(A)||(this._list.push(A),this._set.add(A))}reference(A,y){let c=this._refs.get(A)||0;c+=y?1:-1,this._refs.set(A,Math.max(c,0))}hasReference(A){return(this._refs.get(A)||0)>0}has(A){return this._set.has(A)}assets(A,y){const c=this._assets.get(A);if(c)for(const i of c)i.dispose();y?this._assets.set(A,y):this._assets.delete(A)}dispose(){this._assets.forEach(A=>{for(const y of A)y.dispose()})}}},364:(tn,Ue,n)=>{"use strict";n.d(Ue,{LU:()=>e,cG:()=>r});const e={kind:"null-location"};function r(A,y,c){return{kind:"data-location",tag:A,data:y,element:c}}},3246:(tn,Ue,n)=>{"use strict";n.d(Ue,{$M:()=>l,BL:()=>I,FE:()=>_,QN:()=>C,e4:()=>m,g9:()=>s,xc:()=>M});var e=n(9136),o=n(1739),r=n(3558),t=n(5384),A=n(4369),y=n(8672),c=n(8277),i=n(9909),v=n(7136),O=n(7785),b=n(3162);const _={kind:"every-loci"};function M(h){return!!h&&"every-loci"===h.kind}const I={kind:"empty-loci"};function l(h){return!!h&&"empty-loci"===h.kind}function m(h){return!!h&&"data-loci"===h.kind}function s(h,a,S,D,R){return{kind:"data-loci",tag:h,data:a,elements:S,getBoundingSphere:D,getLabel:R}}var C;!function(h){const a=new v.Z("98");function E(N,k){var H;if("every-loci"!==N.kind&&"empty-loci"!==N.kind){if(k||(k=(0,t.f8)()),"structure-loci"===N.kind)return t.f8.copy(k,N.structure.boundary.sphere);if("element-loci"===N.kind)return t.f8.copy(k,e.iZ.Loci.getBoundary(N).sphere);if("bond-loci"===N.kind)return o.gn.getBoundingSphere(N,k);if("shape-loci"===N.kind)return t.f8.copy(k,N.shape.geometry.boundingSphere);if("group-loci"===N.kind)return r.$.getBoundingSphere(N,k);if("data-loci"===N.kind)return null===(H=N.getBoundingSphere)||void 0===H?void 0:H.call(N,k);if("volume-loci"===N.kind)return b.f.getBoundingSphere(N.volume,k);if("isosurface-loci"===N.kind)return b.f.Isosurface.getBoundingSphere(N.volume,N.isoValue,k);if("cell-loci"===N.kind)return b.f.Cell.getBoundingSphere(N.volume,N.indices,k);if("segment-loci"===N.kind)return b.f.Segment.getBoundingSphere(N.volume,N.segments,k)}}h.getBundleBoundingSphere=function S(N){const k=N.loci.map(H=>E(H)).filter(H=>!!H);a.reset();for(const H of k)a.includePositionRadius(H.center,H.radius);a.finishedIncludeStep();for(const H of k)a.radiusPositionRadius(H.center,H.radius);return a.getSphere()},h.areEqual=function D(N,k){return!!(M(N)&&M(k)||l(N)&&l(k))||(m(N)&&m(k)?function u(h,a){if(!(0,i.bN)(h.data,a.data)||h.tag!==a.tag||h.elements.length!==a.elements.length)return!1;for(let S=0,D=h.elements.length;SN,residue:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToWholeResidues(N,!0):N,chain:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToWholeChains(N):N,entity:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToWholeEntities(N):N,model:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToWholeModels(N):N,operator:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToWholeOperators(N):N,structure:N=>e.iZ.Loci.is(N)?y.oE.toStructureElementLoci(N.structure):r.$.isLoci(N)?r.y.Loci(N.shape):b.f.Cell.isLoci(N)?b.f.Loci(N.volume):N,elementInstances:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToAllInstances(N):N,residueInstances:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToAllInstances(e.iZ.Loci.extendToWholeResidues(N,!0)):N,chainInstances:N=>e.iZ.Loci.is(N)?e.iZ.Loci.extendToAllInstances(e.iZ.Loci.extendToWholeChains(N)):N};function V(N,k){return Q[k](N)}h.GranularityOptions=c.t.objectToOptions(Q,N=>{switch(N){case"element":return"Atom/Coarse Element";case"elementInstances":return["Atom/Coarse Element Instances","With Symmetry"];case"structure":return"Structure/Shape";default:return N.indexOf("Instances")?[(0,O.Mk)(N),"With Symmetry"]:(0,O.Mk)(N)}}),h.simpleGranularity=function G(N){return N.replace("Instances","")},h.applyGranularity=V,h.normalize=function U(N,k,H=!1){return("element"!==k||H)&&o.gn.isLoci(N)&&(N=o.gn.toStructureElementLoci(N)),y.oE.isLoci(N)&&(N=y.oE.toStructureElementLoci(N.structure)),e.iZ.Loci.is(N)&&(N=e.iZ.Loci.remap(N,N.structure.root)),k&&(N=V(N,k)),N}}(C||(C={}))},4699:(tn,Ue,n)=>{"use strict";n.d(Ue,{g:()=>v});const e={HIS:"H",ARG:"R",LYS:"K",ILE:"I",PHE:"F",LEU:"L",TRP:"W",ALA:"A",MET:"M",PRO:"P",CYS:"C",ASN:"N",VAL:"V",GLY:"G",SER:"S",GLN:"Q",TYR:"Y",ASP:"D",GLU:"E",THR:"T",SEC:"U",PYL:"O",HSD:"H",HSE:"H",HSP:"H",LSN:"K",ASPP:"D",GLUP:"E",HID:"H",HIE:"H",HIP:"H",LYN:"K",ASH:"D",GLH:"E"},o={DA:"A",DC:"C",DG:"G",DT:"T",DU:"U"},r={A:"A",C:"C",G:"G",T:"T",U:"U"};function t(O){return e[O]||"X"}function A(O){return r[O]||"X"}function y(O){return o[O]||"X"}var v,c=n(6651),i=n(1372);!function(O){let b;var s;(s=b=O.Kind||(O.Kind={})).Protein="protein",s.RNA="RNA",s.DNA="DNA",s.Generic="generic",O.getSequenceString=function _(s){const C=s.code.toArray();return(C instanceof Array?C:Array.from(C)).join("")},O.ofResidueNames=function l(s,C){if(0===C.rowCount)throw new Error("cannot be empty");const h=function M(s){for(let C=0,h=Math.min(s.rowCount,10);C"X";break;default:(0,i.dr)(s)}return C&&C.size>0?a=>{const S=h(a);return"X"===S&&C.has(a)?h(C.get(a)):S}:h}(C),D=[],R=[],f=[],p=new Map;let E=0;const T=new Map;for(let w=0,Q=a.rowCount;w{const N=S(U);return"X"===N?U:N});L[w]=`(${V.join("|")})`}else L[w]="X"===D[w]?R[w]:D[w]}this.length=E,this.code=c.VP.ofStringArray(D),this.compId=c.VP.ofStringArray(R),this.seqId=c.VP.ofIntArray(f),this.label=c.VP.ofStringArray(L),this.microHet=p,this.indexMap=T}}O.ofSequenceRanges=function u(s,C){return new d(b.Generic,s,C)};class d{index(C){return C-this.minSeqId}constructor(C,h,a){this.kind=C,this.seqIdStart=h,this.seqIdEnd=a,this.microHet=new Map;let S=0,D=Number.MAX_SAFE_INTEGER;for(let f=0,p=this.seqIdStart.rowCount;ff+D+1,rowCount:R,schema:c.VP.Schema.int}),this.compId=c.VP.ofConst("",R,c.VP.Schema.str),this.length=R,this.minSeqId=D}}}(v||(v={}))},3558:(tn,Ue,n)=>{"use strict";n.d(Ue,{$:()=>e.$,y:()=>e.y});var e=n(528)},528:(tn,Ue,n)=>{"use strict";n.d(Ue,{$:()=>M,y:()=>_});var _,M,e=n(9909),o=n(3543),r=n(542),t=n(4369),A=n(5384),y=n(6290),c=n(350),i=n(2476),v=n(3596),O=n(8353),b=n(1888);!function(I){function m(D){return{color:(0,i.h2)({shape:D},{}),size:(0,c.$d)({shape:D},{})}}function u(D){const R=D.transforms.length,f=M.Location(D);return(0,b.iQ)(D.groupCount,R,1,(E,T)=>(f.group=E,f.instance=T,f))}function d(D,R,f,p,E){const T=E&&E.aTransform.ref.value.length>=16*D.length?E.aTransform.ref.value:new Float32Array(16*D.length);for(let L=0,w=D.length;L{for(let N=Q[U],k=Q[U+1];N{for(let N=Q[U],k=Q[U+1];N{const N=p.shape.getSize(U,V);T{"use strict";n.d(Ue,{P4:()=>y.P,gn:()=>t.gn,Kx:()=>r.Kx,RT:()=>A.RT,cY:()=>A.cY,oE:()=>t.oE,iZ:()=>t.iZ,StructureProperties:()=>t.StructureProperties,Oz:()=>A.Oz,cv:()=>A.cv,us:()=>t.us,vw:()=>r.vw,Nf:()=>t.Nf,X$:()=>t.X$}),n(1071),n(3346);var r=n(5644),t=n(8672),A=n(2516),y=n(7024)},1071:(tn,Ue,n)=>{"use strict";n.d(Ue,{E:()=>t,g:()=>r});var t,e=n(9909),o=n(6651);function r(A,y){return{value:A,unit:y}}!function(A){A.create=function y(M,I,l){const m=!!M[0].cell,u=!!M[0].velocities,d=!!M[0].forces;return{id:e.kk.create22(),frames:M,hasCell:m,hasVelocities:u,hasForces:d,deltaTime:I,timeOffset:l}},A.getAtomicConformation=function c(M,I,l){var m,u;let{x:d,y:s,z:C}=M;return M.xyzOrdering.frozen?l?M.xyzOrdering.isIdentity?(d=b(d,l),s=b(s,l),C=b(C,l)):(0,e.af)(M.xyzOrdering.index,l)||(d=O(d,M.xyzOrdering.index,l),s=O(s,M.xyzOrdering.index,l),C=O(C,M.xyzOrdering.index,l)):M.xyzOrdering.isIdentity||(d=_(d,M.xyzOrdering.index),s=_(s,M.xyzOrdering.index),C=_(C,M.xyzOrdering.index)):l&&(M.xyzOrdering.isIdentity?(M.xyzOrdering.isIdentity=!1,M.xyzOrdering.index=l,v(d,l),v(s,l),v(C,l)):(0,e.af)(M.xyzOrdering.index,l)||(d=O(d,M.xyzOrdering.index,l),s=O(s,M.xyzOrdering.index,l),C=O(C,M.xyzOrdering.index,l))),M.xyzOrdering.frozen=!0,{id:e.kk.create22(),atomId:I.atomId,occupancy:null!==(m=I.occupancy)&&void 0!==m?m:o.VP.ofConst(1,M.elementCount,o.VP.Schema.int),B_iso_or_equiv:null!==(u=I.B_iso_or_equiv)&&void 0!==u?u:o.VP.ofConst(0,M.elementCount,o.VP.Schema.float),xyzDefined:!0,x:d,y:s,z:C}};const i=[.123];function v(M,I){const l=i;for(let m=0,u=M.length;m{"use strict";n.d(Ue,{mQ:()=>c}),n(8672),n(3543);var r=n(7421),t=n(6651);const c={molstar_atom_site_operator_mapping:{label_asym_id:t.VP.Schema.Str(),auth_asym_id:t.VP.Schema.Str(),operator_name:t.VP.Schema.Str(),suffix:t.VP.Schema.Str(),assembly_id:t.VP.Schema.Str(),assembly_operator_id:t.VP.Schema.Int(),symmetry_operator_index:t.VP.Schema.Int(),symmetry_hkl:t.VP.Schema.Vector(3),ncs_id:t.VP.Schema.Int()}},i=(M,I)=>typeof I[M].operator.assembly>"u"?1:0,v=(M,I)=>-1===I[M].operator.spgrOp?1:0;r.c.fields().str("label_asym_id",(M,I)=>I[M].label_asym_id).str("auth_asym_id",(M,I)=>I[M].auth_asym_id).str("operator_name",(M,I)=>I[M].operator.name).str("suffix",(M,I)=>I[M].operator.suffix).str("assembly_id",(M,I)=>{var l;return(null===(l=I[M].operator.assembly)||void 0===l?void 0:l.id)||""},{valueKind:i}).int("assembly_operator_id",(M,I)=>{var l;return(null===(l=I[M].operator.assembly)||void 0===l?void 0:l.operId)||0},{valueKind:i}).int("symmetry_operator_index",(M,I)=>I[M].operator.spgrOp,{valueKind:v}).vec("symmetry_hkl",[(M,I)=>I[M].operator.hkl[0],(M,I)=>I[M].operator.hkl[1],(M,I)=>I[M].operator.hkl[2]],{valueKind:v}).int("ncs_id",(M,I)=>I[M].operator.ncsId,{valueKind:v}).getFields()},5644:(tn,Ue,n)=>{"use strict";n.d(Ue,{Kx:()=>e.K,vw:()=>r.v});var i,e=n(4632),r=(n(2434),n(9032)),A=(n(6144),n(8672)),y=n(3543),c=n(9909);function v(M){const I=new Map;for(let l=0,m=M.length;lD.atomicHierarchy.residueAtomSegments;M.fromResidueMap=function d(D){return new O("residue",D,u,0)},M.fromResidueArray=function s(D){return new O("residue",v(D),u,0)};const C=D=>D.atomicHierarchy.chainAtomSegments;M.fromChainMap=function h(D){return new O("chain",D,C,0)},M.fromChainArray=function a(D){return new O("chain",v(D),C,0)},M.fromEntityMap=function S(D){return new _(D)}}(i||(i={}));class O{has(I){return this.map.has(I)}get(I){return this.map.get(I)}getStructureElements(I){const l=I.models;if(1!==l.length)throw new Error("Only works on structures with a single model.");const m=new Set,u=I.unitSymmetryGroups,d=[],s=this.segmentGetter(l[0]);for(const C of u){const h=C.units[0];if(h.kind!==this.kind)continue;const a=y.hT.transientSegments(s,h.elements);for(;a.hasNext;){const S=a.move();!this.has(S.index)||m.has(S.index)||(m.add(S.index),d[d.length]=A.iZ.Location.create(I,h,h.elements[S.start]))}}return d.sort((C,h)=>C.element-h.element),d}getElements(I){const l=this.segmentGetter(I.model).index,m=this.getStructureElements(I);return{elements:m,property:u=>this.get(l[m[u].element])}}constructor(I,l,m,u){this.level=I,this.map=l,this.segmentGetter=m,this.id=c.kk.create22(),this.kind=u}}class b{has(I){return this.map.has(I)}get(I){return this.map.get(I)}getStructureElements(I){if(1!==I.models.length)throw new Error("Only works on structures with a single model.");const m=new Set,u=I.unitSymmetryGroups,d=[];for(const s of u){const C=s.units[0];if(C.kind!==this.kind)continue;const h=C.elements;for(let a=0,S=h.length;as.element-C.element),d}getElements(I){const l=this.getStructureElements(I);return{elements:l,property:m=>this.get(l[m].element)}}constructor(I){this.map=I,this.id=c.kk.create22(),this.level="atom",this.kind=0}}class _{has(I){return this.map.has(I)}get(I){return this.map.get(I)}getStructureElements(I){const l=I.models;if(1!==l.length)throw new Error("Only works on structures with a single model.");const m=l[0].atomicHierarchy.index,u=new Set,d=I.unitSymmetryGroups,s=[],C=l[0].atomicHierarchy.chainAtomSegments;for(const h of d){const a=h.units[0];if(a.kind!==this.kind)continue;const S=y.hT.transientSegments(C,a.elements);for(;S.hasNext;){const D=S.move(),R=m.getEntityFromChain(D.index);!this.has(R)||u.has(R)||(u.add(R),s[s.length]=A.iZ.Location.create(I,a,a.elements[D.start]))}}return s.sort((h,a)=>h.element-a.element),s}getElements(I){const l=this.getStructureElements(I),m=I.model.atomicHierarchy.chainAtomSegments.index,u=I.model.atomicHierarchy.index;return{elements:l,property:d=>this.get(u.getEntityFromChain(m[l[d].element]))}}constructor(I){this.map=I,this.id=c.kk.create22(),this.level="entity",this.kind=0}}},4632:(tn,Ue,n)=>{"use strict";n.d(Ue,{K:()=>d});var d,e=n(467),o=n(3559),r=n(1692),t=n(4369),A=n(6115),i=n(1071),v=n(4824),O=n(8334),b=n(2921),_=n(2524),M=n(9651),I=n(6651),l=n(387),m=n(7024),u=n(6710);!function(s){function C(_e,xe){const le=[],{frames:Ae}=xe,Be=_e.atomicHierarchy.atomSourceIndex,Re=I.VP.isIdentity(Be)?void 0:Be.toArray({array:Int32Array}),ke=V(_e),we=_e.atomicHierarchy.atoms._rowCount;for(let Oe=0,Se=Ae.length;Oe_e._dynamicPropertyData[E]||{index:0,size:1},set:(_e,xe)=>_e._dynamicPropertyData[E]=xe};const T="__AsymIdCount__";s.AsymIdCount={get(_e){if(_e._dynamicPropertyData[T])return _e._dynamicPropertyData[T];const xe=function c(s){const C=new Set,h=new Set;return s.properties.structAsymMap.forEach(({auth_id:a},S)=>{C.add(a),h.add(S)}),{auth:C.size,label:h.size}}(_e);return _e._dynamicPropertyData[T]=xe,xe}},s.AsymIdOffset=l._.createSimple("asym_id_offset","static"),s.Index=l._.createSimple("index","static"),s.MaxIndex=l._.createSimple("max_index","static"),s.getRoot=function L(_e){return _e.parent||_e},s.areHierarchiesEqual=function w(_e,xe){return _e.atomicHierarchy===xe.atomicHierarchy&&_e.coarseHierarchy===xe.coarseHierarchy};const Q="__CoordinatesHistory__";s.CoordinatesHistory={get:_e=>_e._staticPropertyData[Q],set:(_e,xe)=>_e._staticPropertyData[Q]=xe};const G="__CoarseGrained__";function V(_e){let xe=s.CoarseGrained.get(_e);if(void 0===xe){let le=0;const{polymerType:Ae}=_e.atomicHierarchy.derived.residue;for(let we=0;we_e._staticPropertyData[G],set:(_e,xe)=>_e._staticPropertyData[G]=xe},s.isCoarseGrained=V,s.hasCarbohydrate=function U(_e){return _e.properties.saccharideComponentMap.size>0},s.hasProtein=function N(_e){const{subtype:xe}=_e.entities;for(let le=0,Ae=xe.rowCount;le=0)return!0;return!1}function j(_e){if(!_.K4.is(_e.sourceData))return!1;const{db:xe}=_e.sourceData.data;for(let le=0;le=0)return!0;return!1}function q(_e){if(!_.K4.is(_e.sourceData)||!ye(_e))return!1;const{db:xe}=_e.sourceData.data,{status_code_sf:le}=xe.pdbx_database_status;return le.isDefined&&"REL"===le.value(0)}function Y(_e){if(!_.K4.is(_e.sourceData))return!1;const{db:xe}=_e.sourceData.data,{db_name:le,content_type:Ae}=xe.pdbx_database_related;for(let Be=0,Ce=xe.pdbx_database_related._rowCount;Be=0)return!0;return!1},s.hasXrayMap=q,s.hasEmMap=Y,s.hasDensityMap=ee,s.probablyHasDensityMap=function g(_e){if(!_.K4.is(_e.sourceData))return!1;const{db:xe}=_e.sourceData.data;return ee(_e)||$(_e)&&(!xe.exptl.method.isDefined||ye(_e)&&(!xe.pdbx_database_status.status_code_sf.isDefined||2===xe.pdbx_database_status.status_code_sf.valueKind(0))||j(_e)&&!xe.pdbx_database_related.db_name.isDefined)}}(d||(d={}))},2008:(tn,Ue,n)=>{"use strict";n.d(Ue,{A9:()=>o.A9,K9:()=>o.K9,PR:()=>o.PR,c1:()=>e.c1,sO:()=>o.sO,vE:()=>e.vE,wi:()=>e.wi,yA:()=>e.yA});var e=n(6724),o=n(5342)},5373:(tn,Ue,n)=>{"use strict";n.d(Ue,{e:()=>r,m:()=>A});var e=n(2434);const o=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 r(y,c,i){return[c,i]=ci&&([y,i]=[i,y],[c,v]=[v,c]),t.get(`${y}|${c}|${i}|${v}`)||1}},6724:(tn,Ue,n)=>{"use strict";n.d(Ue,{c1:()=>A,or:()=>y,vE:()=>c,wi:()=>r,yA:()=>t});var e=n(6651),o=n(7357);const r={type_symbol:e.VP.Schema.Aliased(o.r.atom_site.type_symbol),label_atom_id:o.r.atom_site.label_atom_id,auth_atom_id:o.r.atom_site.auth_atom_id,label_alt_id:o.r.atom_site.label_alt_id,label_comp_id:o.r.atom_site.label_comp_id,auth_comp_id:o.r.atom_site.auth_comp_id,pdbx_formal_charge:o.r.atom_site.pdbx_formal_charge},t={group_PDB:o.r.atom_site.group_PDB,label_seq_id:o.r.atom_site.label_seq_id,auth_seq_id:o.r.atom_site.auth_seq_id,pdbx_PDB_ins_code:o.r.atom_site.pdbx_PDB_ins_code},A={label_asym_id:o.r.atom_site.label_asym_id,auth_asym_id:o.r.atom_site.auth_asym_id,label_entity_id:o.r.atom_site.label_entity_id};var y,c;(y||(y={})).EmptyResidueKey=function v(){return{label_entity_id:"",label_asym_id:"",auth_seq_id:0,pdbx_PDB_ins_code:void 0}},function(i){function v(_,M){return _.residueAtomSegments.index[_.chainAtomSegments.offsets[M]]}function O(_,M){return _.residueAtomSegments.index[_.chainAtomSegments.offsets[M+1]-1]+1}i.chainStartResidueIndex=v,i.chainEndResidueIndexExcl=O,i.chainResidueCount=function b(_,M){return O(_,M)-v(_,M)}}(c||(c={}))},5342:(tn,Ue,n)=>{"use strict";n.d(Ue,{A9:()=>i,K9:()=>e,PR:()=>v,sO:()=>c});const e={H:1,D:1,T:1,HE:2,LI:3,BE:4,B:5,C:6,N:7,O:8,F:9,NE:10,NA:11,MG:12,AL:13,SI:14,P:15,S:16,CL:17,AR:18,K:19,CA:20,SC:21,TI:22,V:23,CR:24,MN:25,FE:26,CO:27,NI:28,CU:29,ZN:30,GA:31,GE:32,AS:33,SE:34,BR:35,KR:36,RB:37,SR:38,Y:39,ZR:40,NB:41,MO:42,TC:43,RU:44,RH:45,PD:46,AG:47,CD:48,IN:49,SN:50,SB:51,TE:52,I:53,XE:54,CS:55,BA:56,LA:57,CE:58,PR:59,ND:60,PM:61,SM:62,EU:63,GD:64,TB:65,DY:66,HO:67,ER:68,TM:69,YB:70,LU:71,HF:72,TA:73,W:74,RE:75,OS:76,IR:77,PT:78,AU:79,HG:80,TL:81,PB:82,BI:83,PO:84,AT:85,RN:86,FR:87,RA:88,AC:89,TH:90,PA:91,U:92,NP:93,PU:94,AM:95,CM:96,BK:97,CF:98,ES:99,FM:100,MD:101,NO:102,LR:103,RF:104,DB:105,SG:106,BH:107,HS:108,MT:109},o={1:1.1,2:1.4,3:1.81,4:1.53,5:1.92,6:1.7,7:1.55,8:1.52,9:1.47,10:1.54,11:2.27,12:1.73,13:1.84,14:2.1,15:1.8,16:1.8,17:1.75,18:1.88,19:2.75,20:2.31,21:2.3,22:2.15,23:2.05,24:2.05,25:2.05,26:2.05,27:2,28:2,29:2,30:2.1,31:1.87,32:2.11,33:1.85,34:1.9,35:1.83,36:2.02,37:3.03,38:2.49,39:2.4,40:2.3,41:2.15,42:2.1,43:2.05,44:2.05,45:2,46:2.05,47:2.1,48:2.2,49:2.2,50:1.93,51:2.17,52:2.06,53:1.98,54:2.16,55:3.43,56:2.68,57:2.5,58:2.48,59:2.47,60:2.45,61:2.43,62:2.42,63:2.4,64:2.38,65:2.37,66:2.35,67:2.33,68:2.32,69:2.3,70:2.28,71:2.27,72:2.25,73:2.2,74:2.1,75:2.05,76:2,77:2,78:2.05,79:2.1,80:2.05,81:1.96,82:2.02,83:2.07,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:2.4,91:2,92:2.3,93:2,94:2,95:2,96:2,97:2,98:2,99:2,100:2,101:2,102:2,103:2,104:2,105:2,106:2,107:2,108:2,109:2},r={1:1.008,2:4.0026,3:6.94,4:9.0122,5:10.81,6:10.81,7:14.007,8:15.999,9:18.998,10:20.18,11:22.99,12:24.305,13:26.982,14:28.085,15:30.974,16:32.06,17:35.45,18:39.948,19:39.098,20:40.078,21:44.956,22:47.867,23:50.942,24:51.996,25:54.938,26:55.845,27:58.933,28:58.693,29:63.546,30:65.38,31:69.723,32:72.63,33:74.922,34:78.971,35:79.904,36:83.798,37:85.468,38:87.62,39:88.906,40:91.224,41:92.906,42:95.95,43:96.906,44:101.07,45:102.91,46:106.42,47:107.87,48:112.41,49:114.82,50:118.71,51:121.76,52:127.6,53:127.6,54:131.29,55:132.91,56:137.33,57:138.91,58:140.12,59:140.91,60:144.24,61:144.912,62:150.36,63:151.96,64:157.25,65:158.93,66:162.5,67:164.93,68:167.26,69:168.93,70:173.05,71:174.97,72:178.49,73:180.95,74:183.84,75:186.21,76:190.23,77:192.22,78:195.08,79:196.97,80:200.59,81:204.38,82:207.2,83:208.98,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:232.04,91:231.04,92:238.03,93:237.048,94:244.064,95:243.061,96:247.07,97:247.07,98:251.079,99:252.083,100:257.095,101:258.098,102:259.101,103:262.11,104:267.122,105:270.131,106:271.134,107:270.133,108:270.134,109:278.156},t=1.7,A=10.81,y=0;function c(O){const b=e[O];return void 0===b?t:o[b]}function i(O){const b=e[O];return void 0===b?A:r[b]}function v(O){const b=e[O];return void 0===b?y:b}},7126:(tn,Ue,n)=>{"use strict";n.d(Ue,{Hx:()=>s,Z6:()=>o,kV:()=>a,lb:()=>d});var e=n(5342);const o={H:"Hydrogen",HE:"Helium",LI:"Lithium",BE:"Beryllium",B:"Boron",C:"Carbon",N:"Nitrogen",O:"Oxygen",F:"Fluorine",NE:"Neon",NA:"Sodium",MG:"Magnesium",AL:"Aluminum",SI:"Silicon",P:"Phosphorus",S:"Sulfur",CL:"Chlorine",AR:"Argon",K:"Potassium",CA:"Calcium",SC:"Scandium",TI:"Titanium",V:"Vanadium",CR:"Chromium",MN:"Manganese",FE:"Iron",CO:"Cobalt",NI:"Nickel",CU:"Copper",ZN:"Zinc",GA:"Gallium",GE:"Germanium",AS:"Arsenic",SE:"Selenium",BR:"Bromine",KR:"Krypton",RB:"Rubidium",SR:"Strontium",Y:"Yttrium",ZR:"Zirconium",NB:"Niobium",MO:"Molybdenum",TC:"Technetium",RU:"Ruthenium",RH:"Rhodium",PD:"Palladium",AG:"Silver",CD:"Cadmium",IN:"Indium",SN:"Tin",SB:"Antimony",TE:"Tellurium",I:"Iodine",XE:"Xenon",CS:"Cesium",BA:"Barium",LA:"Lanthanum",CE:"Cerium",PR:"Praseodymium",ND:"Neodymium",PM:"Promethium",SM:"Samarium",EU:"Europium",GD:"Gadolinium",TB:"Terbium",DY:"Dysprosium",HO:"Holmium",ER:"Erbium",TM:"Thulium",YB:"Ytterbium",LU:"Lutetium",HF:"Hafnium",TA:"Tantalum",W:"Wolfram",RE:"Rhenium",OS:"Osmium",IR:"Iridium",PT:"Platinum",AU:"Gold",HG:"Mercury",TL:"Thallium",PB:"Lead",BI:"Bismuth",PO:"Polonium",AT:"Astatine",RN:"Radon",FR:"Francium",RA:"Radium",AC:"Actinium",TH:"Thorium",PA:"Protactinium",U:"Uranium",NP:"Neptunium",PU:"Plutonium",AM:"Americium",CM:"Curium",BK:"Berkelium",CF:"Californium",ES:"Einsteinium",FM:"Fermium",MD:"Mendelevium",NO:"Nobelium",LR:"Lawrencium",RF:"Rutherfordium",DB:"Dubnium",SG:"Seaborgium",BH:"Bohrium",HS:"Hassium",MT:"Meitnerium",DS:"Darmstadtium",RG:"Roentgenium",CN:"Copernicium",NH:"Nihonium",FL:"Flerovium",MC:"Moscovium",LV:"Livermorium",TS:"Tennessine",OG:"Oganesson"},r=new Set(["LI","NA","K","RB","CS","FR"]),A=new Set(["BE","MG","CA","SR","BA","RA"]),M=new Set(["ZN","GA","CD","IN","SN","HG","TI","PB","BI","PO","CN"]),u=new Set(["F","CL","BR","I","AT"]);function d(D){return u.has(D)}function s(D){const R=(0,e.PR)(D);return R>=21&&R<=29||R>=39&&R<=47||R>=72&&R<=79||R>=104&&R<=108}function a(D){return function t(D){return r.has(D)}(D)||function y(D){return A.has(D)}(D)||function C(D){const R=(0,e.PR)(D);return R>=57&&R<=71}(D)||function h(D){const R=(0,e.PR)(D);return R>=89&&R<=103}(D)||s(D)||function I(D){return M.has(D)}(D)}},4811:(tn,Ue,n)=>{"use strict";n.d(Ue,{T:()=>c});var c,e=n(9207),o=n(1692),r=n(6651),t=n(7421),A=n(2524),y=n(7754);!function(i){const v="molstar_global_model_transform_info";function b(l){return i.Provider.get(l)}i.Schema={[v]:{matrix:r.VP.Schema.Matrix(4,4,r.VP.Schema.float)}},i.Descriptor=(0,o.e)({name:v,cifExport:{categories:[{name:v,instance(l){const m=b(l.firstModel);if(!m)return t.c.Category.Empty;const u=r.XI.ofRows(i.Schema.molstar_global_model_transform_info,[{matrix:m}]);return t.c.Category.ofTable(u)}}],prefix:"molstar"}}),i.Provider=e.q.create(i.Descriptor),i.attach=function O(l,m){l.customProperties.has(i.Descriptor)||l.customProperties.add(i.Descriptor),i.Provider.set(l,m)},i.get=b,i.fromMmCif=function _(l){if(!A.K4.is(l.sourceData))return;const m=l.sourceData.data.frame.categories[v];if(!m)return;const u=(0,y.MR)(i.Schema[v],m);return 0!==u._rowCount?u.matrix.value(0):void 0},i.hasData=function M(l){if(!A.K4.is(l.sourceData))return!1;const m=l.sourceData.data.frame.categories[v];return!!m&&m.rowCount>0},i.writeMmCif=function I(l,m){l.writeCategory({name:v,instance(){const u=r.XI.ofRows(i.Schema.molstar_global_model_transform_info,[{matrix:m}]);return t.c.Category.ofTable(u)}})}}(c||(c={}))},4743:(tn,Ue,n)=>{"use strict";function e(o,r,t,A){return{type:o,key:r,elements:t,getIndex:A}}n.d(Ue,{M:()=>e})},6144:(tn,Ue,n)=>{"use strict";n.d(Ue,{V:()=>r});var r,e=n(6651),o=n(4699);!function(t){const A={byEntityKey:{},sequences:[]};function y(...b){const _=[],M={};for(let I=0,l=b.length;I{"use strict";n.d(Ue,{N:()=>A,v:()=>y});var c,y,e=n(8382),o=n(5384),r=n(9651),t=n(4490);class A{get operatorGroups(){return this._operators||(this._operators=this.operatorsProvider()),this._operators}constructor(i,v,O){this.operatorsProvider=O,this.id=i,this.details=v}}(c=A||(A={})).create=function i(v,O,b){return new c(v,O,b)},function(c){c.Default={assemblies:[],spacegroup:o.is.ZeroP1,isNonStandardCrystalFrame:!1},c.findAssembly=function i(O,b){const _=b.toLocaleLowerCase(),M=r.i.Provider.get(O);return M?(0,e.L9)(M.assemblies,I=>I.id.toLowerCase()===_):void 0},c.getUnitcellLabel=function v(O){const{cell:b,name:_,num:M}=O.spacegroup,{size:I,anglesInRadians:l}=b,m=I[0].toFixed(2),u=I[1].toFixed(2),d=I[2].toFixed(2),s=(0,t.H)(l[0]).toFixed(2),C=(0,t.H)(l[1]).toFixed(2),h=(0,t.H)(l[2]).toFixed(2),a=[];return a.push(`Unit Cell ${_} #${M}`),a.push(`${m}\xd7${u}\xd7${d} \u212b`),a.push(`\u03b1=${s}\xb0 \u03b2=${C}\xb0 \u03b3=${h}\xb0`),a.join(" | ")}}(y||(y={}))},2434:(tn,Ue,n)=>{"use strict";n.d(Ue,{uA:()=>L,Ke:()=>E,ii:()=>k,I$:()=>le,K5:()=>w,DF:()=>G,F1:()=>c,HA:()=>M,px:()=>J,Pt:()=>b,DB:()=>_,Xk:()=>Ae,XQ:()=>Q,gG:()=>g,mw:()=>p,ut:()=>de,bM:()=>ye,FW:()=>v,UC:()=>Z,wZ:()=>j,RN:()=>W,nO:()=>te,OV:()=>Y,z7:()=>q,iu:()=>ee,VH:()=>H,qN:()=>$});var e=n(9455),o=n(442),r=n(9986);const t=new Set(["DAPC","DBPC","DFPC","DGPC","DIPC","DLPC","DNPC","DOPC","DPPC","DRPC","DTPC","DVPC","DXPC","DYPC","LPPC","PAPC","PEPC","PGPC","PIPC","POPC","PRPC","PUPC","DAPE","DBPE","DFPE","DGPE","DIPE","DLPE","DNPE","DOPE","DPPE","DRPE","DTPE","DUPE","DVPE","DXPE","DYPE","LPPE","PAPE","PGPE","PIPE","POPE","PQPE","PRPE","PUPE","DAPS","DBPS","DFPS","DGPS","DIPS","DLPS","DNPS","DOPS","DPPS","DRPS","DTPS","DUPS","DVPS","DXPS","DYPS","LPPS","PAPS","PGPS","PIPS","POPS","PQPS","PRPS","PUPS","DAPG","DBPG","DFPG","DGPG","DIPG","DLPG","DNPG","DOPG","DPPG","DRPG","DTPG","DVPG","DXPG","DYPG","LPPG","PAPG","PGPG","PIPG","POPG","PRPG","DAPA","DBPA","DFPA","DGPA","DIPA","DLPA","DNPA","DOPA","DPPA","DRPA","DTPA","DVPA","DXPA","DYPA","LPPA","PAPA","PGPA","PIPA","POPA","PRPA","PUPA","DPP","DPPI","PAPI","PIPI","POP","POPI","PUPI","PVP","PVPI","PADG","PIDG","PODG","PUDG","PVDG","APC","CPC","IPC","LPC","OPC","PPC","TPC","UPC","VPC","BNSM","DBSM","DPSM","DXSM","PGSM","PNSM","POSM","PVSM","XNSM","DPCE","DXCE","PNCE","XNCE","DMPC"]),A=new Set(["118","119","543","1AL","1CU","2FK","2HP","2OF","3CO","3MT","3NI","3OF","3P8","4MO","4PU","4TI","6MO","ACT","AG","AL","ALF","AM","ATH","AU","AU3","AUC","AZI","BA","BCT","BEF","BF4","BO4","BR","BS3","BSY","CA","CAC","CD","CD1","CD3","CD5","CE","CF","CHT","CL","CO","CO3","CO5","CON","CR","CS","CSB","CU","CU1","CU3","CUA","CUZ","CYN","DME","DMI","DSC","DTI","DY","E4N","EDR","EMC","ER3","EU","EU3","F","FE","FE2","FPO","GA","GD3","GEP","HAI","HG","HGC","IN","IOD","IR","IR3","IRI","IUM","K","KO4","LA","LCO","LCP","LI","LU","MAC","MG","MH2","MH3","MLI","MMC","MN","MN3","MN5","MN6","MO1","MO2","MO3","MO4","MO5","MO6","MOO","MOS","MOW","MW1","MW2","MW3","NA","NA2","NA5","NA6","NAO","NAW","ND","NET","NH4","NI","NI1","NI2","NI3","NO2","NO3","NRU","NT3","O4M","OAA","OC1","OC2","OC3","OC4","OC5","OC6","OC7","OC8","OCL","OCM","OCN","OCO","OF1","OF2","OF3","OH","OS","OS4","OXL","PB","PBM","PD","PDV","PER","PI","PO3","PO4","PR","PT","PT4","PTN","RB","RH3","RHD","RHF","RU","SB","SCN","SE4","SEK","SM","SMO","SO3","SO4","SR","T1A","TB","TBA","TCN","TEA","TH","THE","TL","TMA","TRA","UNX","V","VN3","VO4","W","WO5","Y1","YB","YB2","YH","YT3","ZCM","ZN","ZN2","ZN3","ZNO","ZO3","ZR","NCO","OHX"]),y=function(){const Ce=Object.create(null),Re=[];for(let ke=65;ke<=90;ke++)Re[Re.length]=String.fromCharCode(ke);for(let ke=97;ke<=122;ke++)Re[Re.length]=String.fromCharCode(ke);for(let ke=48;ke<=57;ke++)Re[Re.length]=String.fromCharCode(ke);for(const ke of Re){Ce[ke]=ke.toUpperCase();for(const we of Re){Ce[ke+we]=(ke+we).toUpperCase();for(const Oe of Re)Ce[ke+we+Oe]=(ke+we+Oe).toUpperCase()}}return Ce}();function c(Ce){return y[Ce]||Ce.toUpperCase()}const i=new Map([[1,"H"],[2,"He"],[3,"Li"],[4,"Be"],[5,"B"],[6,"C"],[7,"N"],[8,"O"],[9,"F"],[10,"Ne"],[11,"Na"],[12,"Mg"],[13,"Al"],[14,"Si"],[15,"P"],[16,"S"],[17,"Cl"],[18,"Ar"],[19,"K"],[20,"Ca"],[21,"Sc"],[22,"Ti"],[23,"V"],[24,"Cr"],[25,"Mn"],[26,"Fe"],[27,"Co"],[28,"Ni"],[29,"Cu"],[30,"Zn"],[31,"Ga"],[32,"Ge"],[33,"As"],[34,"Se"],[35,"Br"],[36,"Kr"],[37,"Rb"],[38,"Sr"],[39,"Y"],[40,"Zr"],[41,"Nb"],[42,"Mo"],[43,"Tc"],[44,"Ru"],[45,"Rh"],[46,"Pd"],[47,"Ag"],[48,"Cd"],[49,"In"],[50,"Sn"],[51,"Sb"],[52,"Te"],[53,"I"],[54,"Xe"],[55,"Cs"],[56,"Ba"],[57,"La"],[58,"Ce"],[59,"Pr"],[60,"Nd"],[61,"Pm"],[62,"Sm"],[63,"Eu"],[64,"Gd"],[65,"Tb"],[66,"Dy"],[67,"Ho"],[68,"Er"],[69,"Tm"],[70,"Yb"],[71,"Lu"],[72,"Hf"],[73,"Ta"],[74,"W"],[75,"Re"],[76,"Os"],[77,"Ir"],[78,"Pt"],[79,"Au"],[80,"Hg"],[81,"Tl"],[82,"Pb"],[83,"Bi"],[84,"Po"],[85,"At"],[86,"Rn"],[87,"Fr"],[88,"Ra"],[89,"Ac"],[90,"Th"],[91,"Pa"],[92,"U"],[93,"Np"],[94,"Pu"],[95,"Am"],[96,"Cm"],[97,"Bk"],[98,"Cf"],[99,"Es"],[100,"Fm"],[101,"Md"],[102,"No"],[103,"Lr"],[104,"Rf"],[105,"Db"],[106,"Sg"],[107,"Bh"],[108,"Hs"],[109,"Mt"],[110,"Ds"],[111,"Rg"],[112,"Cn"],[113,"Uut"],[114,"Fl"],[115,"Uup"],[116,"Lv"],[117,"Uus"],[118,"Uuo"]].map(Ce=>[Ce[0],c(Ce[1])]));function v(Ce){return i.has(Ce)?i.get(Ce):c("H")}const b={0:{trace:new Set,directionFrom:new Set,directionTo:new Set,backboneStart:new Set,backboneEnd:new Set,coarseBackbone:new Set},1:{trace:new Set(["CA"]),directionFrom:new Set(["C"]),directionTo:new Set(["O","OC1","O1","OX1","OXT","OT1"]),backboneStart:new Set(["N"]),backboneEnd:new Set(["C"]),coarseBackbone:new Set(["CA","BB","CA1"])},2:{trace:new Set(["CA"]),directionFrom:new Set(["C"]),directionTo:new Set(["O"]),backboneStart:new Set(["N"]),backboneEnd:new Set(["CD"]),coarseBackbone:new Set(["CA"])},3:{trace:new Set(["CA"]),directionFrom:new Set(["C"]),directionTo:new Set(["O"]),backboneStart:new Set(["N"]),backboneEnd:new Set(["CG"]),coarseBackbone:new Set(["CA"])},4:{trace:new Set(["O3'","O3*"]),directionFrom:new Set(["C4'","C4*"]),directionTo:new Set(["C3'","C3*"]),backboneStart:new Set(["P"]),backboneEnd:new Set(["O3'","O3*"]),coarseBackbone:new Set(["P"])},5:{trace:new Set(["O3'","O3*"]),directionFrom:new Set(["C3'","C3*"]),directionTo:new Set(["C1'","C1*"]),backboneStart:new Set(["P"]),backboneEnd:new Set(["O3'","O3*"]),coarseBackbone:new Set(["P"])},6:{trace:new Set(["N4'","N4*"]),directionFrom:new Set(["N4'","N4*"]),directionTo:new Set(["C7'","C7*"]),backboneStart:new Set(["N1'","N1*"]),backboneEnd:new Set(["C'","C*"]),coarseBackbone:new Set(["P"])}},_=new Set(["CA","C","N","O","O1","O2","OC1","OC2","OT1","OT2","OX1","OXT","H","H1","H2","H3","HA","HN","HXT","BB"]),M=new Set(["P","OP1","OP2","HOP2","HOP3","O2'","O3'","O4'","O5'","C1'","C2'","C3'","C4'","C5'","H1'","H2'","H2''","HO2'","H3'","H4'","H5'","H5''","HO3'","HO5'","O2*","O3*","O4*","O5*","C1*","C2*","C3*","C4*","C5*"]),I=new Set(["d-peptide linking","d-peptide nh3 amino terminus","d-peptide cooh carboxy terminus","d-gamma-peptide, c-delta linking","d-beta-peptide, c-gamma linking"]),l=new Set(["l-peptide linking","l-peptide nh3 amino terminus","l-peptide cooh carboxy terminus","l-gamma-peptide, c-delta linking","l-beta-peptide, c-gamma linking"]),m=new Set(["d-gamma-peptide, c-delta linking","l-gamma-peptide, c-delta linking"]),u=new Set(["d-beta-peptide, c-gamma linking","l-beta-peptide, c-gamma linking"]),d=new Set(["d-peptide nh3 amino terminus","d-peptide cooh carboxy terminus","l-peptide nh3 amino terminus","l-peptide cooh carboxy terminus"]),s=new Set(["peptide linking","peptide-like"]),C=r.M.unionMany(I,l,s),h=new Set(["dna linking","l-dna linking","dna oh 5 prime terminus","dna oh 3 prime terminus"]),a=new Set(["rna linking","l-rna linking","rna oh 5 prime terminus","rna oh 3 prime terminus"]),S=r.M.unionMany(new Set(["d-saccharide, beta linking","l-saccharide, beta linking","d-saccharide, alpha linking","l-saccharide, alpha linking","l-saccharide","d-saccharide","saccharide"]),new Set(["d-saccharide 1,4 and 1,4 linking","l-saccharide 1,4 and 1,4 linking","d-saccharide 1,4 and 1,6 linking","l-saccharide 1,4 and 1,6 linking"])),D=new Set(["non-polymer","other"]),R=new Set(["ion"]),f=new Set(["lipid"]),p=new Set(["SOL","WAT","HOH","H2O","W","DOD","D3O","TIP","TIP3","TIP4","SPC"]),E=new Set(["HIS","ARG","LYS","ILE","PHE","LEU","TRP","ALA","MET","PRO","CYS","ASN","VAL","GLY","SER","GLN","TYR","ASP","GLU","THR","SEC","PYL","UNK","MSE","SEP","TPO","PTR","PCA","HYP","HSD","HSE","HSP","LSN","ASPP","GLUP","HID","HIE","HIP","LYN","ASH","GLH"]),T=new Set(["DAL","DAR","DSG","DAS","DCY","DGL","DGN","DHI","DIL","DLE","DLY","MED","DPN","DPR","DSN","DTH","DTR","DTY","DVA","DNE"]),L=r.M.unionMany(E,T),w=new Set(["NME","ACE","NH2","FOR","FMT"]),Q=new Set(["A","C","T","G","I","U","N"]),G=new Set(["DA","DC","DT","DG","DI","DU","DN"]),V=new Set(["APN","CPN","TPN","GPN"]),U=new Set(["A","G","I","DA","DG","DI","APN","GPN"]),N=new Set(["C","T","U","DC","DT","DU","CPN","TPN"]),k=r.M.unionMany(Q,G,V),H=Ce=>U.has(Ce.toUpperCase()),$=Ce=>N.has(Ce.toUpperCase()),J=r.M.unionMany(L,k);function W(Ce,Re){return Re=Re.toUpperCase(),V.has(Re)?8:C.has(Ce)?5:a.has(Ce)?6:h.has(Ce)?7:S.has(Ce)?9:p.has(Re)?2:A.has(Re)?3:t.has(Re)?4:D.has(Ce)?o.yt.has(Re)?9:L.has(Re)?5:Q.has(Re)?6:G.has(Re)?7:1:0}function te(Ce,Re){return 5===Re?m.has(Ce)?2:u.has(Ce)?3:d.has(Ce)?0:1:6===Re?4:7===Re?5:8===Re?6:0}function de(Ce){return Ce=Ce.toUpperCase(),L.has(Ce)?"peptide linking":Q.has(Ce)?"rna linking":G.has(Ce)?"dna linking":o.yt.has(Ce)?"saccharide":"other"}function ye(Ce){return{formula:"",formula_weight:0,id:Ce,name:Ce,mon_nstd_flag:J.has(Ce)?"y":"n",pdbx_synonyms:[],type:de(Ce)}}function j(Ce){return Ce=Ce.toUpperCase(),p.has(Ce)?"water":J.has(Ce)?"polymer":o.yt.has(Ce)?"branched":"non-polymer"}function Z(Ce,Re){return Ce=Ce.toUpperCase(),l.has(Re)?"polypeptide(L)":I.has(Re)?"polypeptide(D)":a.has(Re)?"polyribonucleotide":h.has(Re)?"polydeoxyribonucleotide":S.has(Re)||o.yt.has(Ce)?"oligosaccharide":V.has(Ce)?"peptide nucleic acid":E.has(Ce)?"polypeptide(L)":T.has(Ce)?"polypeptide(D)":Q.has(Ce)?"polyribonucleotide":G.has(Ce)?"polydeoxyribonucleotide":R.has(Re)||A.has(Ce)?"ion":f.has(Re)||t.has(Ce)?"lipid":s.has(Re)?"peptide-like":"other"}function q(Ce){return Y(Ce)||ee(Ce)}function Y(Ce){return 7===Ce||6===Ce||8===Ce}function ee(Ce){return 5===Ce}var g,Ce,le;(Ce=g||(g={})).is=e.N.has,Ce.create=e.N.create,Ce.SecondaryStructureMmcif={helx_lh_27_p:1058,helx_lh_3t_p:2082,helx_lh_al_p:4130,helx_lh_a_n:524321,helx_lh_b_n:1048609,helx_lh_ga_p:8226,helx_lh_n:33,helx_lh_om_p:16418,helx_lh_ot_n:131105,helx_lh_ot_p:546,helx_lh_p:34,helx_lh_pi_p:32802,helx_lh_pp_p:65570,helx_lh_z_n:262177,helx_n:1,helx_ot_n:1,helx_ot_p:2,helx_p:2,helx_rh_27_p:1090,helx_rh_3t_p:2114,helx_rh_al_p:4162,helx_rh_a_n:524353,helx_rh_b_n:1048641,helx_rh_ga_p:8258,helx_rh_n:65,helx_rh_om_p:16450,helx_rh_ot_n:131137,helx_rh_ot_p:578,helx_rh_p:66,helx_rh_pi_p:32834,helx_rh_pp_p:65602,helx_rh_z_n:262209,strn:4194308,turn_ot_p:33554448,turn_p:16,turn_ty1p_p:67109136,turn_ty1_p:67109008,turn_ty2p_p:134218e3,turn_ty2_p:134217872,turn_ty3p_p:268435728,turn_ty3_p:268435600,bend:8,other:0},Ce.SecondaryStructurePdb={1:4162,2:16450,3:32834,4:8258,5:2114,6:4130,7:16418,8:8226,9:1026,10:65538},Ce.SecondaryStructureStride={H:4098,G:2050,I:32770,E:8388612,B:4194308,T:16,C:536870912},Ce.SecondaryStructureDssp={H:4098,B:4194308,E:8388612,G:2050,I:32770,T:16,S:8},function(Ce){function Se(Ne){switch(Ne){case"covalent":return 1;case"metal-coordination":return 2;case"hydrogen-bond":return 4;case"disulfide":return 8;case"aromatic":return 16;case"computed":return 32}}Ce.is=e.N.has,Ce.create=function Re(Ne){return e.N.create(Ne)},Ce.isCovalent=function ke(Ne){return!!(1&Ne)},Ce.isAll=function we(Ne){return Ne===Math.pow(2,6)-1},Ce.Names={covalent:1,"metal-coordination":2,"hydrogen-bond":4,disulfide:8,aromatic:16,computed:32},Ce.isName=function Oe(Ne){return Ne in Ce.Names},Ce.fromName=Se,Ce.fromNames=function Ve(Ne){let K=0;for(let ne=0,be=Ne.length;ne{"use strict";n.d(Ue,{RT:()=>sn,cY:()=>O,Oz:()=>_,cv:()=>y.c});var e={};n.r(e),n.d(e,{all:()=>C,atoms:()=>R,bondedAtomicPairs:()=>Q,chains:()=>a,none:()=>s,querySelection:()=>w,residues:()=>h,rings:()=>L});var o={};n.r(o),n.d(o,{exceptBy:()=>Ce,expandProperty:()=>ke,includeConnected:()=>we,includeSurroundings:()=>le,intersectBy:()=>Be,querySelection:()=>Ae,surroundingLigands:()=>Ve,union:()=>Re,wholeResidues:()=>Y});var r={};n.r(r),n.d(r,{areIntersectedBy:()=>je,first:()=>ge,getCurrentStructureProperties:()=>Ie,isConnectedTo:()=>$e,pick:()=>ae,withSameAtomProperties:()=>nt,within:()=>Lt});var t={};n.r(t),n.d(t,{intersect:()=>_t,merge:()=>mt});var A={};n.r(A),n.d(A,{atomCount:()=>Me,countQuery:()=>Ke,propertySet:()=>ut});var _,y=n(6424),c=n(8672),i=n(9854),v=n(5988);class O{pushCurrentElement(){return this.currentElementStack[this.currentElementStack.length]=this.element,this.element=c.iZ.Location.create(void 0),this.element}popCurrentElement(){this.element=this.currentElementStack.pop()}pushCurrentBond(){return this.atomicBond&&this.currentAtomicBondStack.push(this.atomicBond),this.atomicBond=new b,this.atomicBond}popCurrentBond(){this.atomicBond=this.currentAtomicBondStack.length>0?this.currentAtomicBondStack.pop():void 0}pushCurrentStructure(){this.currentStructure&&this.currentStructureStack.push(this.currentStructure)}popCurrentStructure(){this.currentStructure=this.currentStructureStack.length?this.currentStructureStack.pop():void 0}pushInputStructure(yt){this.inputStructureStack.push(this.inputStructure),this.inputStructure=yt}popInputStructure(){if(0===this.inputStructureStack.length)throw new Error("Must push before pop.");this.inputStructure=this.inputStructureStack.pop()}throwIfTimedOut(){if(0!==this.timeoutMs&&(0,i.t)()-this.timeCreated>this.timeoutMs)throw new Error(`The query took too long to execute (> ${this.timeoutMs/1e3}s).`)}tryGetCurrentSelection(){if(!this.currentSelection)throw new Error("The current selection is not assigned.");return this.currentSelection}constructor(yt,At){this.currentElementStack=[],this.currentAtomicBondStack=[],this.currentStructureStack=[],this.inputStructureStack=[],this.timeCreated=(0,i.t)(),this.element=c.iZ.Location.create(void 0),this.currentStructure=void 0,this.atomicBond=new b,this.currentSelection=void 0,this.inputStructure=yt,this.timeoutMs=At&&At.timeoutMs||0,this.currentSelection=At&&At.currentSelection}}class b{constructor(){this.a=c.iZ.Location.create(void 0),this.aIndex=0,this.b=c.iZ.Location.create(void 0),this.bIndex=0,this.type=0,this.order=0,this.key=-1,this.testFn=v.defaultBondTest}setStructure(yt){this.a.structure=yt,this.b.structure=yt}setTestFn(yt){this.testFn=yt||v.defaultBondTest}test(yt,At){return!!this.testFn(yt)||!!At&&(this.swap(),this.testFn(yt))}swap(){const yt=this.aIndex;this.aIndex=this.bIndex,this.bIndex=yt;const At=this.a.unit;this.a.unit=this.b.unit,this.b.unit=At;const Gt=this.a.element;this.a.element=this.b.element,this.b.element=Gt}get length(){return c.iZ.Location.distance(this.a,this.b)}}(_||(_={})).run=function yt(At,Gt,rn){return At(new O(Gt,rn))};var M=n(9677),I=n(3543),l=n(1969),m=n(3916);class u{add(yt){yt.elementCount&&(1!==yt.elementCount&&(this.allSingletons=!1),this.set.add(yt)&&(this.structures[this.structures.length]=yt))}getSelection(){return this.allSingletons?y.c.Singletons(this.source,(0,m.l6)(this.source,this.structures)):y.c.Sequence(this.source,this.structures)}constructor(yt){this.source=yt,this.set=(0,M.bw)(c.oE.hashCode,c.oE.areUnitIdsAndIndicesEqual),this.structures=[],this.allSingletons=!0}}class d{add(yt,At,Gt){let rn=this.builderMap.get(yt);rn||(rn=this.source.subsetBuilder(!0),this.builders[this.builders.length]=rn,this.builderMap.set(yt,rn)),rn.addToUnit(At,Gt)}allSingletons(){for(let yt=0,At=this.builders.length;yt1)return!1;return!0}singletonSelection(){const yt=this.source.subsetBuilder(!0),At=c.iZ.Location.create(this.source);for(let Gt=0,rn=this.builders.length;Gty.c.Sequence(gt.inputStructure,[]),C=gt=>y.c.Singletons(gt.inputStructure,gt.inputStructure);function h(gt){return R({...gt,groupBy:yt=>c.StructureProperties.residue.key(yt.element)})}function a(gt){return R({...gt,groupBy:yt=>c.StructureProperties.chain.key(yt.element)})}function S(gt){return!0}function D(gt){return 0}function R(gt){if(!gt||!(gt.atomTest||gt.residueTest||gt.chainTest||gt.entityTest||gt.unitTest||gt.groupBy))return C;if(gt.atomTest&&!gt.residueTest&&!gt.chainTest&&!gt.entityTest&&!gt.unitTest&&!gt.groupBy)return function f(gt){return function(At){const{inputStructure:Gt}=At,{units:rn}=Gt,tt=At.pushCurrentElement(),Mt=Gt.subsetBuilder(!0);tt.structure=Gt;for(const nn of rn){tt.unit=nn;const bn=nn.elements;Mt.beginUnit(nn.id);for(let Dn=0,jt=bn.length;Dn0?M.th.create():this.currentUnit}addElement(yt){M.th.add(this.currentUnit,yt,yt)&&this.elementCount++}commitUnit(){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)}getStructure(){if(this.isEmpty)return l.o.Empty;const yt=[];(0,G.eh)(this.ids);const At=V.u.UnitEquivalenceBuilder();for(let Gt=0,rn=this.ids.length;Gt1&&(0,G.eh)(nn);let Dn=Mt.getChild(I.SortedArray.ofSortedArray(nn));const jt=At.add(Dn.id,Dn);Dn!==jt&&(Dn=jt.applyOperator(Dn.id,Dn.conformation.operator,!0)),yt[yt.length]=Dn}return l.o.create(yt,{parent:this.parent})}get isEmpty(){return 0===this.elementCount}constructor(yt){this.parent=yt,this.ids=[],this.unitMap=I.Yz.Mutable(),this.parentId=-1,this.currentUnit=M.th.create(),this.elementCount=0}}var N=n(1541),k=n(2524),H=n(14);class ${add(yt){let At=this.index.get(yt.label_asym_id);At||(At=new Map,this.index.set(yt.label_asym_id,At));let Gt=At.get(yt.label_seq_id);return Gt||(Gt=[],At.set(yt.label_seq_id,Gt)),!this._find(yt,Gt)&&(Gt.push(yt),!0)}hasLabelAsymId(yt){return this.index.has(yt)}has(yt){var At,Gt;const rn=J(yt);if(!this.index.has(rn))return;const tt=this.index.get(rn),Mt=W(yt);if(!tt.has(Mt))return;const nn=tt.get(Mt),bn=te(yt),Dn=de(yt),jt=ye(yt),It=null!==(At=j(yt))&&void 0!==At?At:"1_555";for(const Dt of nn)if(Dt.label_comp_id===bn&&Dt.label_alt_id===Dn&&Dt.ins_code===jt&&(!this.checkOperator||(null!==(Gt=Dt.operator_name)&&void 0!==Gt?Gt:"1_555")===It))return Dt}static getLabel(yt,At=!1){var Gt;return`${yt.label_asym_id} ${yt.label_comp_id} ${yt.label_seq_id}:${yt.ins_code}:${yt.label_alt_id}${At?" "+(null!==(Gt=yt.operator_name)&&void 0!==Gt?Gt:"1_555"):""}`}static getEntryFromLocation(yt){var At;return{label_asym_id:J(yt),label_comp_id:te(yt),label_seq_id:W(yt),label_alt_id:de(yt),ins_code:ye(yt),operator_name:null!==(At=j(yt))&&void 0!==At?At:"1_555"}}_find(yt,At){var Gt,rn;for(const tt of At)if(tt.label_comp_id===yt.label_comp_id&&tt.label_alt_id===yt.label_alt_id&&tt.ins_code===yt.ins_code&&(!this.checkOperator||(null!==(Gt=tt.operator_name)&&void 0!==Gt?Gt:"1_555")===(null!==(rn=yt.operator_name)&&void 0!==rn?rn:"1_555")))return!0;return!1}constructor(yt){var At;this.index=new Map,this.checkOperator=!1,this.checkOperator=null!==(At=yt?.checkOperator)&&void 0!==At&&At}}const J=H.Z.chain.label_asym_id,W=H.Z.residue.label_seq_id,te=H.Z.atom.label_comp_id,de=H.Z.atom.label_alt_id,ye=H.Z.residue.pdbx_PDB_ins_code,j=H.Z.unit.operator_name;var Z=n(6115);function q(gt,yt,At){const Gt=yt.subsetBuilder(!0);for(const rn of At.units){if(0!==rn.kind){Gt.setUnit(rn.id,rn.elements);continue}const{residueAtomSegments:tt}=rn.model.atomicHierarchy,Mt=yt.unitMap.get(rn.id).elements,nn=rn.elements;Gt.beginUnit(rn.id);const bn=I.hT.transientSegments(tt,nn);for(;bn.hasNext;){const Dn=bn.move().index;for(let jt=tt.offsets[Dn],It=tt.offsets[Dn+1];jt(gt.element.structure=At.structure,gt.element.unit=At.unit,gt.element.element=At.element,yt(gt))}function xe(gt,yt){let At=0;gt.element.structure=gt.inputStructure;for(const Gt of gt.inputStructure.units){gt.element.unit=Gt;const rn=Gt.elements;for(let tt=0,Mt=rn.length;ttAt&&(At=bn)}}return gt.throwIfTimedOut(),At}function le(gt,yt){return function(Gt){const rn=gt(Gt);if(yt.elementRadius){const tt={...yt,elementRadius:yt.elementRadius,elementRadiusClosure:_e(Gt,yt.elementRadius),sourceMaxRadius:xe(Gt,yt.elementRadius)};if(y.c.isSingleton(rn)){const Mt=g(Gt,Gt.inputStructure,rn.structure,tt);return y.c.Singletons(Gt.inputStructure,Mt)}{const Mt=new u(Gt.inputStructure);for(const nn of rn.structures)Mt.add(g(Gt,Gt.inputStructure,nn,tt));return Mt.getSelection()}}if(y.c.isSingleton(rn)){const tt=ee(Gt,Gt.inputStructure,rn.structure,yt);return y.c.Singletons(Gt.inputStructure,tt)}{const tt=new u(Gt.inputStructure);for(const Mt of rn.structures)tt.add(ee(Gt,Gt.inputStructure,Mt,yt));return tt.getSelection()}}}function Ae(gt,yt){return function(Gt){const rn=gt(Gt);if(0===y.c.structureCount(rn))return rn;const tt=y.c.UniqueBuilder(Gt.inputStructure),Mt=nn=>tt.add(nn);return y.c.forEach(rn,(nn,bn)=>{Gt.pushInputStructure(nn),y.c.forEach(yt(Gt),Mt),Gt.popInputStructure(),bn%10==0&&Gt.throwIfTimedOut()}),tt.getSelection()}}function Be(gt,yt){return function(Gt){const rn=gt(Gt);if(0===y.c.structureCount(rn))return rn;const tt=yt(Gt);if(0===y.c.structureCount(tt))return y.c.Empty(Gt.inputStructure);const Mt=y.c.unionStructure(tt),nn=y.c.UniqueBuilder(Gt.inputStructure);return y.c.forEach(rn,(bn,Dn)=>{const jt=(0,m.jU)(Mt,bn);0!==jt.elementCount&&nn.add(jt),Dn%50==0&&Gt.throwIfTimedOut()}),nn.getSelection()}}function Ce(gt,yt){return function(Gt){const rn=gt(Gt);if(0===y.c.structureCount(rn))return rn;const tt=yt(Gt);if(0===y.c.structureCount(tt))return rn;const Mt=y.c.unionStructure(tt),nn=y.c.UniqueBuilder(Gt.inputStructure);return y.c.forEach(rn,(bn,Dn)=>{const jt=(0,m.Kt)(bn,Mt);0!==jt.elementCount&&nn.add(jt),Dn%50==0&&Gt.throwIfTimedOut()}),nn.getSelection()}}function Re(gt){return function(At){const Gt=y.c.LinearBuilder(At.inputStructure);return Gt.add(y.c.unionStructure(gt(At))),Gt.getSelection()}}function ke(gt,yt){return function(Gt){const rn=gt(Gt),tt=new Map,Mt=[];Gt.pushCurrentElement(),y.c.forEach(rn,(bn,Dn)=>{Gt.element.structure=bn;for(const jt of bn.units){Gt.element.unit=jt;const It=jt.elements;for(let Dt=0,Ct=It.length;Dt{let Dt=jt;if(rn)for(;;){const Ct=Dt.elementCount;if(Dt=Oe(nn,At,Dt),Dt.elementCount===Ct)break}else for(let Ct=0;Ct=0)Dt.addElementRange(Vt,Zt.start,Zt.end);else if(It.hasLabelAsymId(kt))for(yn.setSegment(Zt);yn.hasNext;){const An=yn.move();Dn.element=Vt[An.start],It.has(Dn)&&Dt.addElementRange(Vt,An.start,An.end)}}Dt.commitUnit(),rn.throwIfTimedOut()}const Ct=(0,m.l6)(rn.inputStructure,[Dt.getStructure(),tt]);if(At){const $t=new U(rn.inputStructure),Vt=rn.inputStructure.lookup3d;for(const Wt of Ct.units){const yn=Wt.conformation,Zt=Wt.elements;for(let kt=0,Ot=Zt.length;kt0;){const nn=Mt.pop();rn.add(nn);const bn=this.vertices.get(nn);for(const Dn of this.edges.get(nn)){if(rn.has(Dn)||(Mt.push(Dn),tt.has(Dn)))continue;tt.add(Dn);const jt=this.vertices.get(Dn);At.add(bn.operator_name===jt.operator_name?{...jt,operator_name:yt.operator_name}:jt)}}}}var ce,se,Kt,ie=n(9986),ue=n(4369);function ae(gt,yt){return At=>{const Gt=gt(At),rn=y.c.LinearBuilder(At.inputStructure);return At.pushCurrentElement(),y.c.forEach(Gt,(tt,Mt)=>{At.currentStructure=tt,yt(At)&&rn.add(tt),Mt%100&&At.throwIfTimedOut()}),At.popCurrentStructure(),rn.getSelection()}}function ge(gt){return yt=>{const At=gt(yt),Gt=y.c.LinearBuilder(yt.inputStructure);if("singletons"===At.kind){if(At.structure.elementCount>0){const rn=At.structure.units[0],tt=l.o.create([rn.getChild(I.SortedArray.ofSingleton(rn.elements[0]))],{parent:yt.inputStructure});Gt.add(tt)}}else At.structures.length>0&&Gt.add(At.structures[0]);return Gt.getSelection()}}function Ie(gt,yt,At){const{units:Gt}=gt.currentStructure,rn=gt.pushCurrentElement();rn.structure=gt.currentStructure;for(const tt of Gt){rn.unit=tt;const Mt=tt.elements,nn=yt;if(nn){for(let bn=0,Dn=Mt.length;bn{const rn=gt(Gt),tt=function Le(gt,yt,At){const Gt=new Set,rn=yt(gt);return gt.pushCurrentElement(),y.c.forEach(rn,(tt,Mt)=>{gt.currentStructure=tt,Ie(gt,At,Gt),Mt%10&>.throwIfTimedOut()}),gt.popCurrentElement(),Gt}(Gt,yt,At),Mt=y.c.LinearBuilder(Gt.inputStructure);return Gt.pushCurrentStructure(),y.c.forEach(rn,(nn,bn)=>{Gt.currentStructure=nn;const Dn=Ie(Gt,At,new Set);ie.M.isSuperset(tt,Dn)&&Mt.add(nn),bn%10&&Gt.throwIfTimedOut()}),Gt.popCurrentStructure(),Mt.getSelection()}}function je(gt,yt){return At=>{const Gt=y.c.unionStructure(yt(At)),rn=y.c.LinearBuilder(At.inputStructure);return y.c.forEach(gt(At),(tt,Mt)=>{(0,m.HK)(Gt,tt)&&rn.add(tt),Mt%10&&At.throwIfTimedOut()}),rn.getSelection()}}function Lt(gt){return yt=>{const At={queryCtx:yt,selection:gt.query(yt),target:gt.target(yt),maxRadius:gt.maxRadius,minRadius:gt.minRadius?Math.max(0,gt.minRadius):0,elementRadius:gt.elementRadius,invert:!!gt.invert};return 0===At.minRadius&&typeof gt.minRadius>"u"?function Je({queryCtx:gt,selection:yt,target:At,maxRadius:Gt,invert:rn}){const tt=y.c.unionStructure(At).lookup3d,Mt=y.c.LinearBuilder(gt.inputStructure),nn=ue.eB.zero();return y.c.forEach(yt,(bn,Dn)=>{const{units:jt}=bn;let It=!1;for(let Dt=0,Ct=jt.length;Dt{let jt=function ve(gt,yt,At,Gt,rn){return 0===yt.elementCount||0===At.elementCount||(yt.elementCount<=At.elementCount?se.check(gt,yt,At,Gt,rn):se.check(gt,At,yt,Gt,rn))}(gt,Mt,bn,Gt,tt);rn&&(jt=!jt),jt&&nn.add(bn),Dn%10==0&>.throwIfTimedOut()}),gt.popCurrentElement(),nn.getSelection()}(At):function Bt({queryCtx:gt,selection:yt,target:At,minRadius:Gt,maxRadius:rn,invert:tt,elementRadius:Mt}){const nn=y.c.unionStructure(At),bn=y.c.LinearBuilder(gt.inputStructure);return gt.pushCurrentElement(),y.c.forEach(yt,(Dn,jt)=>{let It=function re(gt,yt,At,Gt,rn,tt){return 0===yt.elementCount||0===At.elementCount||(yt.elementCount<=At.elementCount?ce.check(gt,yt,At,Gt,rn,tt):ce.check(gt,At,yt,Gt,rn,tt))}(gt,nn,Dn,Gt,rn,Mt);tt&&(It=!It),It&&bn.add(Dn),jt%10==0&>.throwIfTimedOut()}),gt.popCurrentElement(),bn.getSelection()}(At)}}function $e({query:gt,target:yt,disjunct:At,invert:Gt,bondTest:rn}){return tt=>{const Mt=yt(tt);if(y.c.isEmpty(Mt))return Mt;const nn=gt(tt);if(y.c.isEmpty(nn))return nn;const bn={queryCtx:tt,input:tt.inputStructure,disjunct:At,target:y.c.unionStructure(Mt)},Dn=y.c.LinearBuilder(tt.inputStructure);return tt.pushCurrentBond(),tt.atomicBond.setTestFn(rn),y.c.forEach(nn,(jt,It)=>{(function pn(gt,yt){const{queryCtx:At,input:Gt,target:rn,disjunct:tt}=gt,Mt=At.atomicBond,nn=Gt.interUnitBonds;Mt.setStructure(Gt);for(const bn of yt.units){if(!c.Nf.isAtomic(bn))continue;const Dn=Gt.unitMap.get(bn.id),{offset:jt,b:It,edgeProps:{flags:Dt,order:Ct,key:$t}}=Dn.bonds,Vt=nn.getConnectedUnits(bn.id),Wt=Vt.length,yn=bn.elements,Zt=Dn.elements;for(let kt=0,Ot=yn.length;kt{const At=y.c.UniqueBuilder(yt.inputStructure);for(let Gt=0;Gt{At.add(rn),Gt%100&&yt.throwIfTimedOut()});return At.getSelection()}}function _t(gt){return 0===gt.length?s:1===gt.length?gt[0]:yt=>{const At=[];for(let nn=0;nnnn.hashCode,c.oE.areUnitIdsAndIndicesEqual);y.c.forEach(At[Gt],nn=>tt.add(nn));const Mt=y.c.UniqueBuilder(yt.inputStructure);for(let nn=0;nn{tt.has(bn)&&Mt.add(bn)}),yt.throwIfTimedOut());return Mt.getSelection()}}function Me(gt){return gt.currentStructure.elementCount}function Ke(gt){return yt=>{const At=gt(yt);return y.c.structureCount(At)}}function ut(gt){return yt=>Ie(yt,gt,new Set)}!function(gt){const yt=(0,ue.eB)();function At(Mt,nn,bn,Dn,jt,It,Dt){const{elements:Ct,conformation:$t}=nn,Vt=yt;Mt.element.unit=nn;let Wt=!1;for(let yn=0,Zt=Ct.length;ynDt($t)===Ct},gt.lt=function Gt(Dt,Ct){return $t=>Dt($t)Dt($t)<=Ct},gt.gt=function tt(Dt,Ct){return $t=>Dt($t)>Ct},gt.gte=function Mt(Dt,Ct){return $t=>Dt($t)>=Ct},gt.inSet=function Dn(Dt,Ct){if(function yt(Dt){return!!Dt&&!!Dt.has}(Ct))return $t=>Ct.has(Dt($t));{if(0===Ct.length)return bn;const $t=new Set;for(let Vt=0;Vt$t.has(Dt(Vt))}},gt.and=function jt(...Dt){switch(Dt.length){case 0:return nn;case 1:return Dt[0];case 2:{const Ct=Dt[0],$t=Dt[1];return Vt=>Ct(Vt)&&$t(Vt)}case 3:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2];return Wt=>Ct(Wt)&&$t(Wt)&&Vt(Wt)}case 4:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2],Wt=Dt[3];return yn=>Ct(yn)&&$t(yn)&&Vt(yn)&&Wt(yn)}case 5:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2],Wt=Dt[3],yn=Dt[4];return Zt=>Ct(Zt)&&$t(Zt)&&Vt(Zt)&&Wt(Zt)&&yn(Zt)}case 6:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2],Wt=Dt[3],yn=Dt[4],Zt=Dt[5];return kt=>Ct(kt)&&$t(kt)&&Vt(kt)&&Wt(kt)&&yn(kt)&&Zt(kt)}default:{const Ct=Dt.length;return $t=>{for(let Vt=0;VtCt(Vt)||$t(Vt)}case 3:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2];return Wt=>Ct(Wt)||$t(Wt)||Vt(Wt)}case 4:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2],Wt=Dt[3];return yn=>Ct(yn)||$t(yn)||Vt(yn)||Wt(yn)}case 5:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2],Wt=Dt[3],yn=Dt[4];return Zt=>Ct(Zt)||$t(Zt)||Vt(Zt)||Wt(Zt)||yn(Zt)}case 6:{const Ct=Dt[0],$t=Dt[1],Vt=Dt[2],Wt=Dt[3],yn=Dt[4],Zt=Dt[5];return kt=>Ct(kt)||$t(kt)||Vt(kt)||Wt(kt)||yn(kt)||Zt(kt)}default:{const Ct=Dt.length;return $t=>{for(let Vt=0;Vt{"use strict";n.r(Ue),n.d(Ue,{atomicHet:()=>b,atomicSequence:()=>v,bundleElementImpl:()=>M,bundleGenerator:()=>I,defaultBondTest:()=>i,spheres:()=>_,water:()=>O});var e=n(3543),o=n(1541),r=n(8672),t=n(1969),A=n(6424),y=n(2434),c=n(7686);function i(l){return y.I$.isCovalent(l.atomicBond.type)}function v(){return function(m){const{inputStructure:u}=m,d=o.i.Location.create(u),s=[];for(const C of u.units){if(0!==C.kind)continue;d.unit=C;const h=C.elements;if(d.element=h[0],"polymer"!==r.StructureProperties.entity.type(d))continue;const a=e.hT.transientSegments(C.model.atomicHierarchy.residueAtomSegments,h);let S=0;for(;a.hasNext;)S++,a.move();S<8||s.push(C)}return A.c.Singletons(u,t.o.create(s,{parent:u}))}}function O(){return function(m){const{inputStructure:u}=m,d=o.i.Location.create(u),s=[];for(const C of u.units)0===C.kind&&(d.unit=C,d.element=C.elements[0],"water"===r.StructureProperties.entity.type(d)&&s.push(C));return A.c.Singletons(u,t.o.create(s,{parent:u}))}}function b(){return function(m){const{inputStructure:u}=m,d=o.i.Location.create(u),s=[];for(const C of u.units){if(0!==C.kind)continue;d.unit=C;const h=C.elements;if(d.element=h[0],"water"!==r.StructureProperties.entity.type(d)){if("polymer"===r.StructureProperties.entity.type(d)){const a=e.hT.transientSegments(C.model.atomicHierarchy.residueAtomSegments,h);let S=0;for(;a.hasNext;)S++,a.move();if(S>=8)continue}s.push(C)}}return A.c.Singletons(u,t.o.create(s,{parent:u}))}}function _(){return function(m){const{inputStructure:u}=m,d=[];for(const s of u.units)1===s.kind&&d.push(s);return A.c.Singletons(u,t.o.create(d,{parent:u}))}}function M(l,m,u){return{groupedUnits:l,ranges:m,set:u}}function I(l){return function(u){return A.c.Sequence(u.inputStructure,[c.N.toStructure({hash:u.inputStructure.hashCode,elements:l},u.inputStructure)])}}},6424:(tn,Ue,n)=>{"use strict";n.d(Ue,{c:()=>A});var A,e=n(9677),o=n(8672),r=n(3916),t=n(3543);!function(y){function c(S,D){return{kind:"singletons",source:S,structure:D}}function i(S,D){return{kind:"sequence",source:S,structures:D}}function v(S){return c(S,o.oE.Empty)}function O(S){return"singletons"===S.kind}function b(S){return O(S)?0===S.structure.units.length:0===S.structures.length}function M(S){return b(S)?o.oE.Empty:O(S)?S.structure:(0,r.l6)(S.source,S.structures)}function m(S,D,R){return 0===D.length?v(S):R?c(S,(0,r.l6)(S,D)):i(S,D)}y.Singletons=c,y.Sequence=i,y.Empty=v,y.isSingleton=O,y.isEmpty=b,y.structureCount=function _(S){return O(S)?S.structure.elementCount:S.structures.length},y.unionStructure=M,y.toLociWithCurrentUnits=function I(S){const D=[],{unitMap:R}=S.source;for(const f of M(S).units)D[D.length]=f===R.get(f.id)?{unit:f,indices:t.CD.ofBounds(0,f.elements.length)}:{unit:f,indices:t.CD.ofSortedArray(t.SortedArray.indicesOf(R.get(f.id).elements,f.elements))};return o.iZ.Loci(S.source,D)},y.toLociWithSourceUnits=function l(S){const D=[],{unitMap:R}=S.source;for(const f of M(S).units){const p=R.get(f.id);D[D.length]=p===f?{unit:p,indices:t.CD.ofBounds(0,p.elements.length)}:{unit:p,indices:t.CD.ofSortedArray(t.SortedArray.indicesOf(p.elements,f.elements))}}return o.iZ.Loci(S.source,D)};class u{add(D){const R=D.elementCount;0!==R&&(this.structures[this.structures.length]=D,1!==R&&(this.allSingletons=!1))}getSelection(){return m(this.source,this.structures,this.allSingletons)}constructor(D){this.source=D,this.structures=[],this.allSingletons=!0}}class d{add(D){const R=D.elementCount;0===R||!this.uniqueSets.add(D)||(this.structures[this.structures.length]=D,1!==R&&(this.allSingletons=!1))}getSelection(){return m(this.structure,this.structures,this.allSingletons)}constructor(D){this.structure=D,this.structures=[],this.allSingletons=!0,this.uniqueSets=(0,e.bw)(o.oE.hashCode,o.oE.areUnitIdsAndIndicesEqual)}}y.LinearBuilder=function s(S){return new u(S)},y.UniqueBuilder=function C(S){return new d(S)},y.forEach=function h(S,D){let R=0;if(y.isSingleton(S))for(const f of S.structure.units){const{elements:p}=f;for(let E=0,T=p.length;E{"use strict";n.d(Ue,{HK:()=>y,IP:()=>A,Kt:()=>i,jU:()=>c,l6:()=>r});var e=n(8672),o=n(3543);function r(v,O){if(0===O.length)return e.oE.Empty;if(1===O.length)return O[0];const b=new Map,_=new Set;for(const{units:I}of O)for(let l=0,m=I.length;l0&&(M[M.length]=m.getChild(d))}return e.oE.create(M,{parent:v.parent||O.parent})}},8672:(tn,Ue,n)=>{"use strict";n.d(Ue,{gn:()=>A.gn,oE:()=>o.o,iZ:()=>e.i,StructureProperties:()=>y.Z,us:()=>t.u,Nf:()=>r.N,X$:()=>c.X});var e=n(1541),o=n(1969),r=n(8960),t=n(5685),A=n(1739),y=n(14),c=n(4561),i=n(7421),v=n(2524);n(6220);n(3543),n(6710);var N=n(6651),H=(n(9986),n(9677)),$=n(8382);function W(ae,ge){if(v.K4.is(ae.sourceData))return ae.sourceData.data.db[ge]}function ye(ae){if(0===ae.length)return[];if(1===ae.length)return ae[0].entityIndices;const ge=H.th.create();for(const Ie of ae)for(const Le of Ie.entityIndices)H.th.add(ge,Le,Le);return(0,$.eh)(ge.array),ge.array}function j(ae,ge){return{name:ae,instance({structures:Ie}){if(ge&&!ge(Ie[0]))return i.c.Category.Empty;const Le=Ie[0].model;if(!v.K4.is(Le.sourceData))return i.c.Category.Empty;const nt=Le.sourceData.data.db[ae];return nt&&nt._rowCount?i.c.Category.ofTable(nt):i.c.Category.Empty}}}n(5165);var le=i.c.Category;Re("struct_asym"),Re("entity_poly"),Re("entity_poly_seq");function Re(ae){return{name:ae,instance:({structures:ge,cache:Ie})=>function ke(ae,ge,Ie){const Le=W(ae[0].model,ge);if(!Le)return le.Empty;const{entity_id:nt}=Le,je=Ie.uniqueEntityIds||(Ie.uniqueEntityIds=function de(ae){if(0===ae.length)return new Set;const ge=ae[0].model.entities.data.id;return new Set(ye(ae).map(Ie=>ge.value(Ie)))}(ae)),Lt=N.VP.indicesOf(nt,Je=>je.has(Je));return le.ofTable(Le,Lt)}(ge,ae,Ie)}}n(1692),n(1490);var Ve;(Ve||(Ve={})).create=function ge(Ie){const Le=Array.isArray(Ie)?Ie:[Ie];return{structures:Le,firstModel:Le[0].model,cache:Object.create(null)}};function K(ae){return ae.units.every(ge=>ge.conformation.operator.isIdentity)}function ne(ae){return K(ae)&&ae.units.every(ge=>!ge.conformation.operator.assembly&&!ge.conformation.operator.suffix)}var Te;j("entry"),j("exptl"),j("cell",K),j("symmetry",K),j("pdbx_struct_assembly",ne),j("pdbx_struct_assembly_gen",ne),j("pdbx_struct_oper_list",ne),j("pdbx_entity_branch"),j("pdbx_entity_branch_link"),j("pdbx_branch_scheme"),j("struct_conn"),j("atom_sites"),(Te||(Te={})).AtomSitePositionsFieldNames=new Set(["id","Cartn_x","Cartn_y","Cartn_z"])},442:(tn,Ue,n)=>{"use strict";n.d(Ue,{dV:()=>M,G7:()=>t,yt:()=>C,RP:()=>r,Dr:()=>_,xY:()=>O,N0:()=>v,GW:()=>s});var e=n(190);const o=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","9RN","9S7","9SG","9SJ","9SM","9SP","9T1","9T7","9VP","9WJ","9WN","9WZ","9YW","A0K","A1AIO","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","VDF","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"]);var r=function(h){return h[h.FilledSphere=0]="FilledSphere",h[h.FilledCube=1]="FilledCube",h[h.CrossedCube=2]="CrossedCube",h[h.DividedDiamond=3]="DividedDiamond",h[h.FilledCone=4]="FilledCone",h[h.DevidedCone=5]="DevidedCone",h[h.FlatBox=6]="FlatBox",h[h.FilledStar=7]="FilledStar",h[h.FilledDiamond=8]="FilledDiamond",h[h.FlatDiamond=9]="FlatDiamond",h[h.FlatHexagon=10]="FlatHexagon",h[h.Pentagon=11]="Pentagon",h[h.DiamondPrism=12]="DiamondPrism",h[h.PentagonalPrism=13]="PentagonalPrism",h[h.HexagonalPrism=14]="HexagonalPrism",h[h.HeptagonalPrism=15]="HeptagonalPrism",h}(r||{});const t=(0,e._j)({Blue:37052,Green:42577,Yellow:16765952,Orange:16021792,Pink:16162465,Purple:10830745,LightBlue:9424105,Brown:10582605,Red:15539236,Secondary:15854817});var A=function(h){return h[h.Hexose=0]="Hexose",h[h.HexNAc=1]="HexNAc",h[h.Hexosamine=2]="Hexosamine",h[h.Hexuronate=3]="Hexuronate",h[h.Deoxyhexose=4]="Deoxyhexose",h[h.DeoxyhexNAc=5]="DeoxyhexNAc",h[h.DiDeoxyhexose=6]="DiDeoxyhexose",h[h.Pentose=7]="Pentose",h[h.Deoxynonulosonate=8]="Deoxynonulosonate",h[h.DiDeoxynonulosonate=9]="DiDeoxynonulosonate",h[h.Unknown=10]="Unknown",h[h.Assigned=11]="Assigned",h}(A||{});const i={[A.Hexose]:r.FilledSphere,[A.HexNAc]:r.FilledCube,[A.Hexosamine]:r.CrossedCube,[A.Hexuronate]:r.DividedDiamond,[A.Deoxyhexose]:r.FilledCone,[A.DeoxyhexNAc]:r.DevidedCone,[A.DiDeoxyhexose]:r.FlatBox,[A.Pentose]:r.FilledStar,[A.Deoxynonulosonate]:r.FilledDiamond,[A.DiDeoxynonulosonate]:r.FlatDiamond,[A.Unknown]:r.FlatHexagon,[A.Assigned]:r.Pentagon};function v(h,a){return h===A.Unknown?4===a?r.DiamondPrism:5===a?r.PentagonalPrism:6===a?r.HexagonalPrism:7===a?r.HeptagonalPrism:r.FlatHexagon:i[h]}const O={abbr:"Unk",name:"Unknown",color:t.Secondary,type:A.Unknown},b=[{abbr:"Glc",name:"Glucose",color:t.Blue,type:A.Hexose},{abbr:"Man",name:"Mannose",color:t.Green,type:A.Hexose},{abbr:"Gal",name:"Galactose",color:t.Yellow,type:A.Hexose},{abbr:"Gul",name:"Gulose",color:t.Orange,type:A.Hexose},{abbr:"Alt",name:"Altrose",color:t.Pink,type:A.Hexose},{abbr:"All",name:"Allose",color:t.Purple,type:A.Hexose},{abbr:"Tal",name:"Talose",color:t.LightBlue,type:A.Hexose},{abbr:"Ido",name:"Idose",color:t.Brown,type:A.Hexose},{abbr:"GlcNAc",name:"N-Acetyl Glucosamine",color:t.Blue,type:A.HexNAc},{abbr:"ManNAc",name:"N-Acetyl Mannosamine",color:t.Green,type:A.HexNAc},{abbr:"GalNAc",name:"N-Acetyl Galactosamine",color:t.Yellow,type:A.HexNAc},{abbr:"GulNAc",name:"N-Acetyl Gulosamine",color:t.Orange,type:A.HexNAc},{abbr:"AltNAc",name:"N-Acetyl Altrosamine",color:t.Pink,type:A.HexNAc},{abbr:"AllNAc",name:"N-Acetyl Allosamine",color:t.Purple,type:A.HexNAc},{abbr:"TalNAc",name:"N-Acetyl Talosamine",color:t.LightBlue,type:A.HexNAc},{abbr:"IdoNAc",name:"N-Acetyl Idosamine",color:t.Brown,type:A.HexNAc},{abbr:"GlcN",name:"Glucosamine",color:t.Blue,type:A.Hexosamine},{abbr:"ManN",name:"Mannosamine",color:t.Green,type:A.Hexosamine},{abbr:"GalN",name:"Galactosamine",color:t.Yellow,type:A.Hexosamine},{abbr:"GulN",name:"Gulosamine",color:t.Orange,type:A.Hexosamine},{abbr:"AltN",name:"Altrosamine",color:t.Pink,type:A.Hexosamine},{abbr:"AllN",name:"Allosamine",color:t.Purple,type:A.Hexosamine},{abbr:"TalN",name:"Talosamine",color:t.LightBlue,type:A.Hexosamine},{abbr:"IdoN",name:"Idosamine",color:t.Brown,type:A.Hexosamine},{abbr:"GlcA",name:"Glucuronic Acid",color:t.Blue,type:A.Hexuronate},{abbr:"ManA",name:"Mannuronic Acid",color:t.Green,type:A.Hexuronate},{abbr:"GalA",name:"Galacturonic Acid",color:t.Yellow,type:A.Hexuronate},{abbr:"GulA",name:"Guluronic Acid",color:t.Orange,type:A.Hexuronate},{abbr:"AltA",name:"Altruronic Acid",color:t.Pink,type:A.Hexuronate},{abbr:"AllA",name:"Alluronic Acid",color:t.Purple,type:A.Hexuronate},{abbr:"TalA",name:"Taluronic Acid",color:t.LightBlue,type:A.Hexuronate},{abbr:"IdoA",name:"Iduronic Acid",color:t.Brown,type:A.Hexuronate},{abbr:"Qui",name:"Quinovose",color:t.Blue,type:A.Deoxyhexose},{abbr:"Rha",name:"Rhamnose",color:t.Green,type:A.Deoxyhexose},{abbr:"6dGul",name:"6-Deoxy Gulose",color:t.Orange,type:A.Deoxyhexose},{abbr:"6dAlt",name:"6-Deoxy Altrose",color:t.Pink,type:A.Deoxyhexose},{abbr:"6dTal",name:"6-Deoxy Talose",color:t.LightBlue,type:A.Deoxyhexose},{abbr:"Fuc",name:"Fucose",color:t.Red,type:A.Deoxyhexose},{abbr:"QuiNAc",name:"N-Acetyl Quinovosamine",color:t.Blue,type:A.DeoxyhexNAc},{abbr:"RhaNAc",name:"N-Acetyl Rhamnosamine",color:t.Green,type:A.DeoxyhexNAc},{abbr:"6dAltNAc",name:"N-Acetyl 6-Deoxy Altrosamine",color:t.Pink,type:A.DeoxyhexNAc},{abbr:"6dTalNAc",name:"N-Acetyl 6-Deoxy Talosamine",color:t.LightBlue,type:A.DeoxyhexNAc},{abbr:"FucNAc",name:"N-Acetyl Fucosamine",color:t.Red,type:A.DeoxyhexNAc},{abbr:"Oli",name:"Olivose",color:t.Blue,type:A.DiDeoxyhexose},{abbr:"Tyv",name:"Tyvelose",color:t.Green,type:A.DiDeoxyhexose},{abbr:"Abe",name:"Abequose",color:t.Orange,type:A.DiDeoxyhexose},{abbr:"Par",name:"Paratose",color:t.Pink,type:A.DiDeoxyhexose},{abbr:"Dig",name:"Digitoxose",color:t.Purple,type:A.DiDeoxyhexose},{abbr:"Col",name:"Colitose",color:t.LightBlue,type:A.DiDeoxyhexose},{abbr:"Ara",name:"Arabinose",color:t.Green,type:A.Pentose},{abbr:"Lyx",name:"Lyxose",color:t.Yellow,type:A.Pentose},{abbr:"Xyl",name:"Xylose",color:t.Orange,type:A.Pentose},{abbr:"Rib",name:"Ribose",color:t.Pink,type:A.Pentose},{abbr:"Kdn",name:"Keto-Deoxy Nonulonic Acid",color:t.Green,type:A.Deoxynonulosonate},{abbr:"Neu5Ac",name:"N-Acetyl Neuraminic Acid",color:t.Purple,type:A.Deoxynonulosonate},{abbr:"Neu5Gc",name:"N-Glycolyl Neuraminic Acid",color:t.LightBlue,type:A.Deoxynonulosonate},{abbr:"Neu",name:"Neuraminic Acid",color:t.Brown,type:A.Deoxynonulosonate},{abbr:"Sia",name:"Sialic acid",color:t.Red,type:A.Deoxynonulosonate},{abbr:"Pse",name:"Pseudaminic Acid",color:t.Green,type:A.DiDeoxynonulosonate},{abbr:"Leg",name:"Legionaminic Acid",color:t.Yellow,type:A.DiDeoxynonulosonate},{abbr:"Aci",name:"Acinetaminic Acid",color:t.Pink,type:A.DiDeoxynonulosonate},{abbr:"4eLeg",name:"4-Epilegionaminic Acid",color:t.LightBlue,type:A.DiDeoxynonulosonate},{abbr:"Bac",name:"Bacillosamine",color:t.Blue,type:A.Unknown},{abbr:"LDmanHep",name:"L-Glycero-D-Manno Heptose",color:t.Green,type:A.Unknown},{abbr:"Kdo",name:"Keto-Deoxy Octulonic Acid",color:t.Yellow,type:A.Unknown},{abbr:"Dha",name:"3-Deoxy Lyxo-Heptulosaric Acid",color:t.Orange,type:A.Unknown},{abbr:"DDmanHep",name:"D-Glycero-D-Manno-Heptose",color:t.Pink,type:A.Unknown},{abbr:"MurNAc",name:"N-Acetyl Muramic Acid",color:t.Purple,type:A.Unknown},{abbr:"MurNGc",name:"N-Glycolyl Muramic Acid",color:t.LightBlue,type:A.Unknown},{abbr:"Mur",name:"Muramic Acid",color:t.Brown,type:A.Unknown},{abbr:"Api",name:"Apicose",color:t.Green,type:A.Assigned},{abbr:"Fru",name:"Fructose",color:t.Green,type:A.Assigned},{abbr:"Tag",name:"Tagatose",color:t.Yellow,type:A.Assigned},{abbr:"Sor",name:"Sorbose",color:t.Orange,type:A.Assigned},{abbr:"Psi",name:"Psicose",color:t.Pink,type:A.Assigned}],_=function(){const h=new Map;for(let a=0,S=b.length;a{h.has(a)||h.set(a,O)}),h}(),d=function(){const h=new Map;for(let a=0,S=b.length;a{h.has(a)||h.set(a,O)}),h}();function s(h){C="default"===h?u:d}let C=u},1541:(tn,Ue,n)=>{"use strict";n.d(Ue,{i:()=>e});var e={};n.r(e),n.d(e,{Bundle:()=>t.N,Location:()=>o.a,Loci:()=>r.Q,Stats:()=>c,atomicProperty:()=>b,chainIndex:()=>I,coarseProperty:()=>_,entityIndex:()=>l,property:()=>v,residueIndex:()=>M});var c,o=n(1185),r=n(3931),t=n(7686),A=n(3543),y=n(8960);!function(m){function u(){return{elementCount:0,conformationCount:0,residueCount:0,chainCount:0,unitCount:0,structureCount:0,firstElementLoc:o.a.create(void 0),firstConformationLoc:o.a.create(void 0),firstResidueLoc:o.a.create(void 0),firstChainLoc:o.a.create(void 0),firstUnitLoc:o.a.create(void 0),firstStructureLoc:o.a.create(void 0)}}function d(D,R,f){const p=D.get(R)||0;D.set(R,p+f)}function s(D,R,f){const{indices:p,unit:E}=f,{elements:T}=E,L=A.CD.size(p),w=new Map,Q=new Map;if(L>0&&o.a.set(D.firstElementLoc,R,E,T[A.CD.start(p)]),L===T.length)D.unitCount+=1,1===D.unitCount&&o.a.set(D.firstUnitLoc,R,E,T[A.CD.start(p)]);else if(1===L){if(y.N.Traits.is(E.traits,y.N.Trait.MultiChain))return;D.elementCount+=1,1===D.elementCount&&o.a.set(D.firstElementLoc,R,E,T[A.CD.start(p)])}else if(y.N.isAtomic(E)){const{index:G,offsets:V}=E.model.atomicHierarchy.residueAtomSegments,{label_alt_id:U}=E.model.atomicHierarchy.atoms;let N=0;for(;N{if(Q.get(W)===J){if(""!==W&&(D.conformationCount+=1,1===D.conformationCount))for(let te=V[$],de=V[$+1];te{Q[N+1]-Q[N]===U&&(D.chainCount+=1,1===D.chainCount&&(V=N))}),!(V<0))for(let U=p;Uy.N.isAtomic(u.unit)?m(u):O("atomic")}function _(m){return u=>y.N.isCoarse(u.unit)?m(u):O("coarse")}function M(m){return y.N.isAtomic(m.unit)?m.unit.residueIndex[m.element]:-1}function I(m){return y.N.isAtomic(m.unit)?m.unit.chainIndex[m.element]:-1}function l(m){return i.Z.entity.key(m)}},7686:(tn,Ue,n)=>{"use strict";n.d(Ue,{N:()=>i});var i,e=n(3543),o=n(1969),r=n(8382),t=n(5734),A=n(3931),y=n(9767),c=n(2516);!function(v){function _(s){const C=[];for(const S of s.elements){const{unit:D,indices:R}=S;if(0===e.CD.size(R))continue;const f=[],p=[];if(e.CD.isInterval(R))1===e.CD.size(R)?p.push(e.IX.min(R)):f.push(e.IX.min(R),e.IX.max(R));else{let E=0;const T=R.length;for(;E2)f.push(R[L],R[w-1]);else for(let Q=L;Q{const D=[];S.groupedUnits.forEach(R=>D.push(e.SortedArray.ofUnsortedArray(R))),D.sort((R,f)=>R[0]-f[0]),a.push({groupedUnits:D,set:S.set,ranges:S.ranges})}),{hash:s.structure.hashCode,elements:a}}function M(s,C){const h=[];for(let a=0,S=s.length;ay.J.core.type.list(C))),ranges:y.J.core.type.list(s.ranges),set:y.J.core.type.list(s.set)})}v.Empty={hash:-1,elements:[]},v.fromSubStructure=function O(s,C){return _(c.cv.toLociWithSourceUnits(c.cv.Singletons(s,C)))},v.fromSelection=function b(s){return _(c.cv.toLociWithSourceUnits(s))},v.fromLoci=_,v.toLoci=function I(s,C){-1!==s.hash&&s.hash!==C.hashCode&&new Error("Bundle not compatible with given structure");const h=[];for(const a of s.elements)for(const S of a.groupedUnits){const D=M(S,C);if(0===D.length)continue;let R;if(0===a.ranges.length)R=a.set;else if(0===a.set.length)if(2===a.ranges.length)R=e.IX.ofRange(a.ranges[0],a.ranges[1]);else{const f=new Int32Array(t.m.size(a.ranges));t.m.forEach(a.ranges,(p,E)=>f[E]=p),R=e.SortedArray.ofSortedArray(f)}else{const f=t.m.size(a.ranges),p=new Int32Array(a.set.length+f);t.m.forEach(a.ranges,(E,T)=>p[T]=E),p.set(a.set,f),R=e.SortedArray.ofUnsortedArray(p)}for(const f of D)h.push({unit:f,indices:R})}return(0,A.Q)(C,h)},v.toStructure=function l(s,C){-1!==s.hash&&s.hash!==C.hashCode&&new Error("Bundle not compatible with given structure");const h=[];for(const a of s.elements)for(const S of a.groupedUnits){const D=M(S,C);if(0===D.length)continue;const R=D[0].elements,f=t.m.size(a.ranges),p=a.set.length,E=new Int32Array(p+f);let T;if(0===f){for(let L=0,w=p;LE[w]=R[L]),T=e.SortedArray.ofSortedArray(E);else if(e.SortedArray.min(a.set)>t.m.max(a.ranges)){t.m.forEach(a.ranges,(L,w)=>E[w]=R[L]);for(let L=0,w=p;Le.SortedArray.max(a.set)){for(let L=0,w=p;LE[w+p]=R[L]),T=e.SortedArray.ofSortedArray(E)}else{t.m.forEach(a.ranges,(L,w)=>E[w]=R[L]);for(let L=0,w=p;L{"use strict";n.d(Ue,{a:()=>o});var o,e=n(4369);!function(r){function t(m,u,d){return{kind:"element-location",structure:m,unit:u,element:d||0}}r.create=t,r.clone=function A(m){return t(m.structure,m.unit,m.element)},r.set=function y(m,u,d,s){return u&&(m.structure=u),d&&(m.unit=d),void 0!==s&&(m.element=s),m},r.copy=function c(m,u){return m.unit=u.unit,m.element=u.element,m},r.is=function i(m){return!!m&&"element-location"===m.kind},r.areEqual=function v(m,u){return m.unit===u.unit&&m.element===u.element};const O=(0,e.eB)(),b=(0,e.eB)();r.distance=function _(m,u){return m.unit.conformation.position(m.element,O),u.unit.conformation.position(u.element,b),e.eB.distance(O,b)},r.position=function M(m,u){return u.unit.conformation.position(u.element,m)},r.residueIndex=function I(m){return m.unit.model.atomicHierarchy.residueAtomSegments.index[m.element]},r.chainIndex=function l(m){return m.unit.model.atomicHierarchy.chainAtomSegments.index[m.element]}}(o||(o={}))},3931:(tn,Ue,n)=>{"use strict";n.d(Ue,{Q:()=>I});var e=n(9677),o=n(3543),r=n(4369),t=n(9767),A=n(1969),y=n(8960),c=n(8382),i=n(1185),v=n(8199),O=n(14),b=n(7136);const M=n(3370).U.diff;function I(l,m){return{kind:"element-loci",structure:l,elements:m}}!function(l){function d(we){for(const Oe of we.elements)if(o.CD.size(Oe.indices)>0)return!1;return!0}function C(we){let Oe=0;for(const{indices:Se}of we.elements)Oe+="number"==typeof Se?M(Se):Se.length;return Oe}function D(we){return d(we)?we:l(we.structure,[{unit:we.elements[0].unit,indices:o.CD.ofSingleton(o.CD.start(we.elements[0].indices))}])}function U(we){return we.length>3&&o.SortedArray.isRange(we)?o.IX.ofRange(we[0],we[we.length-1]):o.SortedArray.ofSortedArray(we)}function N(we,Oe){const Se=[],Ve=new Set;for(const Ne of we.elements)if(H(Ne))Se[Se.length]=Ne;else if(0===Ne.unit.kind){const K=Ne.unit.elements,ne=Ne.unit.model.atomicHierarchy,{label_alt_id:be}=Ne.unit.model.atomicHierarchy.atoms,{index:Te,offsets:ie}=ne.residueAtomSegments,ue=[],re=Ne.indices,ve=o.CD.size(re);let ce=0;for(;ce=0){const je=be.value(Ie);(!Oe||ge||!je||Ve.has(je))&&(ue[ue.length]=nt)}}}Se[Se.length]={unit:Ne.unit,indices:U(ue)}}else Se[Se.length]=Ne;return l(we.structure,Se)}function k(we){switch(we.kind){case 0:return we.model.atomicHierarchy.chainAtomSegments;case 1:return we.model.coarseHierarchy.spheres.chainElementSegments;case 2:return we.model.coarseHierarchy.gaussians.chainElementSegments}}function H(we){return we.unit.elements.length===o.CD.size(we.indices)}function $(we,Oe,Se){const{index:Ve}=k(we),Ne=we.elements;let K=0;for(let be=0,Te=Ne.length;be0&&(Se[Se.length]={unit:we,indices:U(ne)})}function J(we,Oe,Se,Ve,Ne){const{index:K}=k(we.elements[0].unit),ne=new Set;for(let be=Oe;be({unit:Oe,indices:o.CD.ofBounds(0,Oe.elements.length)})))},l.none=function a(we){return l(we,[])},l.getFirstLocation=function S(we,Oe){if(d(we))return;const Se=we.elements[0].unit,Ve=Se.elements[o.CD.getAt(we.elements[0].indices,0)];return Oe?(Oe.structure=we.structure,Oe.unit=we.elements[0].unit,Oe.element=Ve,Oe):i.a.create(we.structure,Se,Ve)},l.firstElement=D,l.firstResidue=function R(we){return d(we)?we:N(D(we))},l.firstChain=function f(we){return d(we)?we:W(D(we))},l.toStructure=function p(we){const Oe=[];for(const Se of we.elements){const{unit:Ve,indices:Ne}=Se,K=new Int32Array(o.CD.size(Ne));o.CD.forEach(Ne,(ne,be)=>K[be]=Ve.elements[ne]),Oe.push(Ve.getChild(o.SortedArray.ofSortedArray(K)))}return A.o.create(Oe,{parent:we.structure.parent})},l.forEachLocation=function E(we,Oe){if(l.isEmpty(we))return;const Se=i.a.create(we.structure);for(const Ve of we.elements){const{unit:Ne,indices:K}=Ve;Se.unit=Ne;const{elements:ne}=Ve.unit;for(let be=0,Te=o.CD.size(K);be{if(!Oe.unitMap.has(Ve.unit.id))return;const Ne=Oe.unitMap.get(Ve.unit.id),K=o.CD.indexedIntersect(Ve.indices,Ve.unit.elements,Ne.elements);o.CD.size(K)>0&&Se.push({unit:Ne,indices:K})}),l(Oe,Se)},l.union=function L(we,Oe){if(we.elements.length>Oe.elements.length)return L(Oe,we);if(l.isEmpty(we))return Oe;const Se=new Map;for(const Ne of we.elements)Se.set(Ne.unit.id,Ne.indices);const Ve=[];for(const Ne of Oe.elements)Se.has(Ne.unit.id)?(Ve[Ve.length]={unit:Ne.unit,indices:o.CD.union(Se.get(Ne.unit.id),Ne.indices)},Se.delete(Ne.unit.id)):Ve[Ve.length]=Ne;return Se.forEach((Ne,K)=>{Ve[Ve.length]={unit:we.structure.unitMap.get(K),indices:Ne}}),l(we.structure,Ve)},l.subtract=function w(we,Oe){const Se=new Map;for(const Ne of Oe.elements)Se.set(Ne.unit.id,Ne.indices);const Ve=[];for(const Ne of we.elements)if(Se.has(Ne.unit.id)){const K=o.CD.subtract(Ne.indices,Se.get(Ne.unit.id));if(0===o.CD.size(K))continue;Ve[Ve.length]={unit:Ne.unit,indices:K}}else Ve[Ve.length]=Ne;return l(we.structure,Ve)},l.intersect=function Q(we,Oe){const Se=new Map;for(const Ne of we.elements)Se.set(Ne.unit.id,Ne.indices);const Ve=[];for(const Ne of Oe.elements){if(!Se.has(Ne.unit.id))continue;const K=o.CD.intersect(Se.get(Ne.unit.id),Ne.indices);0!==o.CD.size(K)&&(Ve[Ve.length]={unit:Ne.unit,indices:K})}return l(we.structure,Ve)},l.areIntersecting=function G(we,Oe){if(we.elements.length>Oe.elements.length)return G(Oe,we);if(l.isEmpty(we))return l.isEmpty(Oe);const Se=new Map;for(const Ve of we.elements)Se.set(Ve.unit.id,Ve.indices);for(const Ve of Oe.elements)if(Se.has(Ve.unit.id)&&o.CD.areIntersecting(Se.get(Ve.unit.id),Ve.indices))return!0;return!1},l.isSubset=function V(we,Oe){if(l.isEmpty(we))return l.isEmpty(Oe);const Se=new Map;for(const Ne of we.elements)Se.set(Ne.unit.id,Ne.indices);let Ve=!1;for(const Ne of Oe.elements)if(Se.has(Ne.unit.id)){if(!o.CD.isSubset(Se.get(Ne.unit.id),Ne.indices))return!1;Ve=!0}return Ve},l.extendToWholeResidues=N,l.extendToWholeChains=W,l.extendToWholeEntities=function de(we){const Oe=[],Se=i.a.create(we.structure),Ve=new Set,{units:Ne}=we.structure;for(let K=0,ne=we.elements.length;K12)K[K.length]=Oe[ie],K[K.length]=Oe[ue-1];else for(let re=ie;re{Oe+=C(Ne)});const Se=new Float32Array(3*Oe);let Ve=0;return we.forEach(Ne=>{le(Ne,Se,Ve),Ve+=3*C(Ne)}),v.c.ofPositions(Se)},l.toExpression=function Re(we){if(l.isEmpty(we))return t.J.struct.generator.empty();const Oe=we.structure.models,Se=new Map;for(const be of we.elements){const{indices:Te}=be,{elements:ie}=be.unit,ue=be.unit.conformation.operator.name;let re;Se.has(ue)?re=Se.get(ue).xs:(re=e.th.create(),Se.set(ue,{modelLabel:be.unit.model.label,modelIndex:be.unit.model.modelNum,xs:re}));for(let ve=0,ce=o.CD.size(Te);ve1,Te.modelLabel,Te.modelIndex))}const K=new Map;for(let be=0,Te=Ve.length;be{const{ranges:Te,set:ie}=be.atom,{opName:ue}=be.chain,re=t.J.struct.atomProperty.core.operatorName(),ve=t.J.struct.atomProperty.core.sourceIndex(),ce=[];ie.length>0&&(ce[ce.length]=t.J.core.set.has([t.J.core.type.set(ie),ve]));for(let se=0,ae=Te.length/2;se1?t.J.core.logic.or(ce):ce[0],"chain-test":ue.length>1?t.J.core.set.has([t.J.core.type.set(ue),re]):t.J.core.rel.eq([re,ue[0]]),"entity-test":t.J.core.logic.and([t.J.core.rel.eq([t.J.struct.atomProperty.core.modelLabel(),se]),t.J.core.rel.eq([t.J.struct.atomProperty.core.modelIndex(),ae])])}))}else ne.push(t.J.struct.generator.atomGroups({"atom-test":ce.length>1?t.J.core.logic.or(ce):ce[0],"chain-test":ue.length>1?t.J.core.set.has([t.J.core.type.set(ue),re]):t.J.core.rel.eq([re,ue[0]])}))}),t.J.struct.modifier.union([1===ne.length?ne[0]:t.J.struct.combinator.merge(ne.map(be=>t.J.struct.modifier.union([be])))])}}(I||(I={}))},14:(tn,Ue,n)=>{"use strict";n.d(Ue,{Z:()=>h});var e=n(8960),o=n(2008),r=n(8699),t=n(5384);function c(){throw new Error("Property only available for atomic models.")}function i(a){throw a?new Error(`Property only available for coarse models (${a}).`):new Error("Property only available for coarse models.")}const v={key:a=>a.element,x:a=>a.unit.conformation.x(a.element),y:a=>a.unit.conformation.y(a.element),z:a=>a.unit.conformation.z(a.element),id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicConformation.atomId.value(a.element):c(),occupancy:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicConformation.occupancy.value(a.element):c(),B_iso_or_equiv:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicConformation.B_iso_or_equiv.value(a.element):c(),sourceIndex:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.atomSourceIndex.value(a.element):a.element,type_symbol:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.atoms.type_symbol.value(a.element):c(),label_atom_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.atoms.label_atom_id.value(a.element):c(),auth_atom_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.atoms.auth_atom_id.value(a.element):c(),label_alt_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.atoms.label_alt_id.value(a.element):c(),label_comp_id:O,auth_comp_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.atoms.auth_comp_id.value(a.element):c(),pdbx_formal_charge:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.atoms.pdbx_formal_charge.value(a.element):c(),vdw_radius:a=>e.N.isAtomic(a.unit)?(0,o.sO)(a.unit.model.atomicHierarchy.atoms.type_symbol.value(a.element)):c()};function O(a){return e.N.isAtomic(a.unit)||c(),a.unit.model.atomicHierarchy.atoms.label_comp_id.value(a.element)}function b(a){return e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.residues.label_seq_id.value(a.unit.residueIndex[a.element]):c()}function M(a){e.N.isAtomic(a.unit)||c();const S=a.unit.model.sequence.byEntityKey[u(a)];return S&&S.sequence.microHet.get(b(a))||[O(a)]}function u(a){switch(a.unit.kind){case 0:return a.unit.model.atomicHierarchy.index.getEntityFromChain(a.unit.chainIndex[a.element]);case 1:return a.unit.model.coarseHierarchy.spheres.entityKey[a.element];case 2:return a.unit.model.coarseHierarchy.gaussians.entityKey[a.element]}}const s=[],h={constant:{true:a=>!0,false:a=>!1,zero:a=>0},atom:v,residue:{key:a=>e.N.isAtomic(a.unit)?a.unit.residueIndex[a.element]:c(),group_PDB:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.residues.group_PDB.value(a.unit.residueIndex[a.element]):c(),label_seq_id:b,auth_seq_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.residues.auth_seq_id.value(a.unit.residueIndex[a.element]):c(),pdbx_PDB_ins_code:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.residues.pdbx_PDB_ins_code.value(a.unit.residueIndex[a.element]):c(),isNonStandard:a=>e.N.isAtomic(a.unit)?M(a).some(S=>"n"===a.unit.model.properties.chemicalComponentMap.get(S).mon_nstd_flag[0]):c(),hasMicroheterogeneity:function _(a){e.N.isAtomic(a.unit)||c();const S=a.unit.model.sequence.byEntityKey[u(a)];return S&&S.sequence.microHet.has(b(a))},microheterogeneityCompIds:M,secondary_structure_type:a=>{var S;e.N.isAtomic(a.unit)||c();const D=null===(S=r.v.get(a.structure).value)||void 0===S?void 0:S.get(a.unit.invariantId);return D?D.type[D.getIndex(a.unit.residueIndex[a.element])]:536870912},secondary_structure_key:a=>{var S;e.N.isAtomic(a.unit)||c();const D=null===(S=r.v.get(a.structure).value)||void 0===S?void 0:S.get(a.unit.invariantId);return D?D.key[D.getIndex(a.unit.residueIndex[a.element])]:-1},chem_comp_type:a=>e.N.isAtomic(a.unit)?a.unit.model.properties.chemicalComponentMap.get(O(a)).type:c()},chain:{key:a=>e.N.isAtomic(a.unit)?a.unit.chainIndex[a.element]:c(),label_asym_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.chains.label_asym_id.value(a.unit.chainIndex[a.element]):c(),auth_asym_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.chains.auth_asym_id.value(a.unit.chainIndex[a.element]):c(),label_entity_id:a=>e.N.isAtomic(a.unit)?a.unit.model.atomicHierarchy.chains.label_entity_id.value(a.unit.chainIndex[a.element]):c()},entity:{key:u,id:a=>a.unit.model.entities.data.id.value(u(a)),type:a=>a.unit.model.entities.data.type.value(u(a)),src_method:a=>a.unit.model.entities.data.src_method.value(u(a)),pdbx_description:a=>a.unit.model.entities.data.pdbx_description.value(u(a)),formula_weight:a=>a.unit.model.entities.data.formula_weight.value(u(a)),pdbx_number_of_molecules:a=>a.unit.model.entities.data.pdbx_number_of_molecules.value(u(a)),details:a=>a.unit.model.entities.data.details.value(u(a)),pdbx_mutation:a=>a.unit.model.entities.data.pdbx_mutation.value(u(a)),pdbx_fragment:a=>a.unit.model.entities.data.pdbx_fragment.value(u(a)),pdbx_ec:a=>a.unit.model.entities.data.pdbx_ec.value(u(a)),subtype:a=>a.unit.model.entities.subtype.value(u(a)),prd_id:a=>{var S,D;return null!==(D=null===(S=a.unit.model.entities.prd_id)||void 0===S?void 0:S.value(u(a)))&&void 0!==D?D:""}},unit:{id:a=>a.unit.id,chainGroupId:a=>a.unit.chainGroupId,multiChain:a=>e.N.Traits.is(a.unit.traits,e.N.Trait.MultiChain),object_primitive:a=>a.unit.objectPrimitive,operator_name:a=>a.unit.conformation.operator.name,operator_key:a=>a.unit.conformation.operator.key,model_index:a=>a.unit.model.modelNum,model_label:a=>a.unit.model.label,model_entry_id:a=>a.unit.model.entryId,hkl:a=>a.unit.conformation.operator.hkl,spgrOp:a=>a.unit.conformation.operator.spgrOp,model_num:a=>a.unit.model.modelNum,pdbx_struct_assembly_id:a=>{var S;return(null===(S=a.unit.conformation.operator.assembly)||void 0===S?void 0:S.id)||t.JX.DefaultName},pdbx_struct_oper_list_ids:a=>{var S;return(null===(S=a.unit.conformation.operator.assembly)||void 0===S?void 0:S.operList)||s},struct_ncs_oper_id:a=>a.unit.conformation.operator.ncsId},coarse:{key:v.key,entityKey:a=>e.N.isCoarse(a.unit)?a.unit.coarseElements.entityKey[a.element]:i(),x:v.x,y:v.y,z:v.z,asym_id:a=>e.N.isCoarse(a.unit)?a.unit.coarseElements.asym_id.value(a.element):i(),entity_id:a=>e.N.isCoarse(a.unit)?a.unit.coarseElements.entity_id.value(a.element):i(),seq_id_begin:a=>e.N.isCoarse(a.unit)?a.unit.coarseElements.seq_id_begin.value(a.element):i(),seq_id_end:a=>e.N.isCoarse(a.unit)?a.unit.coarseElements.seq_id_end.value(a.element):i(),sphere_radius:a=>e.N.isSpheres(a.unit)?a.unit.coarseConformation.radius[a.element]:i("spheres"),sphere_rmsf:a=>e.N.isSpheres(a.unit)?a.unit.coarseConformation.rmsf[a.element]:i("spheres"),gaussian_weight:a=>e.N.isGaussians(a.unit)?a.unit.coarseConformation.weight[a.element]:i("gaussians"),gaussian_covariance_matrix:a=>e.N.isGaussians(a.unit)?a.unit.coarseConformation.covariance_matrix[a.element]:i("gaussians")}}},1969:(tn,Ue,n)=>{"use strict";n.d(Ue,{o:()=>le});var e=n(467),o=n(3543),r=n(9677),t=n(7552),A=n(5644),y=n(8382),c=n(1541),i=n(8960),v=n(6871),O=n(5685);class b{addToUnit(Te,ie){const ue=this.unitMap.get(Te);ue?ue[ue.length]=ie:(this.unitMap.set(Te,[ie]),this.ids[this.ids.length]=Te),this.elementCount++}beginUnit(Te){this.parentId=Te,this.currentUnit=this.currentUnit.length>0?[]:this.currentUnit}addElement(Te){this.currentUnit[this.currentUnit.length]=Te,this.elementCount++}addElementRange(Te,ie,ue){for(let re=ie;re1&&(0,y.eh)(ae);let Le=se.getChild(o.SortedArray.ofSortedArray(ae));const nt=ue.add(Le.id,Le);Le!==nt&&(Le=nt.applyOperator(Le.id,Le.conformation.operator,!0)),ie[ie.length]=Le}return le.create(ie,{parent:this.parent})}getStructure(){return this._getStructure(!1)}getStructureDeduplicate(){return this._getStructure(!0)}setSingletonLocation(Te){const ie=this.ids[0];Te.unit=this.parent.unitMap.get(ie),Te.element=this.unitMap.get(ie)[0]}get isEmpty(){return 0===this.elementCount}constructor(Te,ie){this.parent=Te,this.isSorted=ie,this.ids=[],this.unitMap=o.Yz.Mutable(),this.parentId=-1,this.currentUnit=[],this.elementCount=0}}var _=n(1739),M=n(14);function I(be,Te){let ie=1;for(;Te--;)ie*=be--;return ie}class u{move(){if(this.hasNext){let Te=0,ie=0,ue=this.index;for(;ue;ue>>>=1,Te++)1&ue&&(this.value[ie++]=this.array[Te]);this.index=function m(be){const Te=be&-be,ie=be+Te;return ie|((ie&-ie)/Te>>1)-1}(this.index),this.hasNext=this.indexbe?0:I(be,Te)/I(Te,Te)}(Te.length,ie),this.maxIndex=1<0&&ie<=Te.length}}function d(be,Te){const ie=[],ue=new u(be,Te);for(;ue.hasNext;)ie.push(ue.move().slice());return ie}var s=n(4506),C=n(4369),h=n(8199),a=n(6115),S=n(2434),D=n(2789);const R=[],f={links:R,terminalLinks:R,elements:R,partialElements:R,getElementIndices:()=>R,getLinkIndices:()=>R,getTerminalLinkIndices:()=>R};var p=n(4561);const E=(0,S.F1)("C"),T=(0,S.F1)("O"),L=[p.X.elementFingerprint([E,E,E,T]),p.X.elementFingerprint([E,E,E,E,T]),p.X.elementFingerprint([E,E,E,E,E,T]),p.X.elementFingerprint([E,E,E,E,E,E,T])];function w(be,Te){let ie=-1,ue=-1,re=-1,ve=-1;const{elements:ce}=be,{type_symbol:se,label_atom_id:ae}=be.model.atomicHierarchy.atoms,{b:ge,offset:Ie}=be.bonds;for(let Le=0,nt=Te.length;Le0}get customPropertyDescriptors(){return this.state.customProps||(this.state.customProps=new W.v),this.state.customProps}get currentPropertyData(){return this.state.propertyData||(this.state.propertyData=Object.create(null)),this.state.propertyData}get inheritedPropertyData(){return this.parent?this.parent.currentPropertyData:this.currentPropertyData}get polymerResidueCount(){return-1===this.state.polymerResidueCount&&(this.state.polymerResidueCount=function Se(be){const{units:Te}=be;let ie=0;for(let ue=0,re=Te.length;ue0&&(ie+=1);return ie}(this)),this.state.polymerUnitCount}get uniqueElementCount(){return-1===this.state.uniqueElementCount&&(this.state.uniqueElementCount=function Oe(be){const{unitSymmetryGroups:Te}=be;let ie=0;for(let ue=0,re=Te.length;ueA.Kx.isCoarseGrained(Te))}get isEmpty(){return 0===this.units.length}get hashCode(){return-1!==this.state.hashCode?this.state.hashCode:this.computeHash()}get transformHash(){return-1!==this.state.transformHash||(this.state.transformHash=(0,y.TI)(this.units.map(Te=>Te.id))),this.state.transformHash}computeHash(){let Te=23;for(let ie=0,ue=this.units.length;ie500?ee:g}(Te.length);ie.reset();for(let ue=0,re=Te.length;uent+je.properties.saccharideComponentMap.size,0))return f;const Te=[],ie=[],ue=[],re=[],ve=new Map;function ce(nt,je,Lt){return`${nt}|${je}|${Lt}`}function se(nt,je){ve.has(nt)?ve.get(nt).push(je):ve.set(nt,[je])}function ae(nt,je){C.eB.sub(ue[nt].geometry.direction,ue[je].geometry.center,ue[nt].geometry.center),C.eB.normalize(ue[nt].geometry.direction,ue[nt].geometry.direction)}const ge=(0,C.eB)();function Ie(nt,je,Lt){const en=ue[nt].geometry;C.eB.sub(en.direction,Lt.conformation.position(Lt.elements[je],ge),en.center),C.eB.normalize(en.direction,en.direction)}for(let nt=0,je=be.units.length;nt{Je.connectedIndices.forEach(en=>{Je.getEdges(en).forEach(({props:Bt,indexB:pn})=>{if(!S.I$.isCovalent(Bt.flag))return;const $e=be.unitMap.get(Je.unitA),mt=be.unitMap.get(Je.unitB),_t=Le($e,en),Me=Le(mt,pn);if(_t.length>0&&Me.length>0){const Ke=_t.length,ut=Me.length;for(let Kt=0,sn=Math.max(Ke,ut);Ktre[ue.get(se.id)]+o.CD.indexOf(se.elements,ae)}}(this))}get model(){if(this.state.model)return this.state.model;if(this.state.representativeModel)return this.state.representativeModel;if(this.state.masterModel)return this.state.masterModel;const Te=this.models;if(Te.length>1)throw new Error("The structure is based on multiple models and has neither a master- nor a representative-model.");return this.state.model=Te[0],this.state.model}get masterModel(){return this.state.masterModel}get representativeModel(){return this.state.representativeModel}hasElement(Te){return!!this.unitMap.has(Te.unit.id)&&o.SortedArray.has(this.unitMap.get(Te.unit.id).elements,Te.element)}getModelIndex(Te){return this.models.indexOf(Te)}remapModel(Te){const{dynamicBonds:ie,interUnitBonds:ue,parent:re}=this.state,ve=[];for(const ce of this.unitSymmetryGroups){const se=ce.units[0].remapModel(Te,ie);ve.push(se);for(let ae=1,ge=ce.units.length;ae0?kt[0].id:0;for(let or=0,Nr=kt.length;or2e5||je(kt,or)?en(kt,To,Dr,Jr,Nr):Dr.addUnit(0,kt,Nr,To,Jr?i.N.Trait.MultiChain:i.N.Trait.None):Dr.addUnit(0,kt,Nr,To,Jr?i.N.Trait.MultiChain:i.N.Trait.None)}const Pr=kt.coarseHierarchy;return Pr.isDefined&&(Pr.spheres.count>0&&Bt(Dr,kt,kt.coarseHierarchy.spheres,1),Pr.gaussians.count>0&&Bt(Dr,kt,kt.coarseHierarchy.gaussians,2)),Dr.getStructure()}function je(kt,Ot){const An=kt.atomicHierarchy.index.getEntityFromChain(Ot);return"water"===kt.entities.data.type.value(An)}function Lt(kt,Ot){const An=kt.atomicHierarchy.index.getEntityFromChain(Ot);return"polymer"===kt.entities.data.type.value(An)}function Je(kt,Ot,An,jn,On){const{x:fr,y:Dr,z:Pr}=kt.atomicConformation,or={x:fr,y:Dr,z:Pr,indices:Ot},Nr=(0,J.Eh)(or,(0,ye.r)(or),8192),{offset:Ir,count:Or,array:Jr}=Nr.buckets,To=(jn?i.N.Trait.MultiChain:i.N.Trait.None)|(Ir.length>1?i.N.Trait.Partitioned:i.N.Trait.None);An.beginChainGroup();for(let un=0,ct=Ir.length;un1?i.N.Trait.Partitioned:i.N.Trait.None);An.beginChainGroup();for(let Rn=0,er=dt.length;Rni.N.conformationId(Ot)).join("|"))},be.areUnitIdsEqual=Ke,be.areUnitIdsAndIndicesEqual=function ut(kt,Ot){if(kt===Ot)return!0;if(!Ke(kt,Ot))return!1;for(let An=0,jn=kt.units.length;An=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,this.hasNext&&(this.elements=Ot.units[0].elements,this.maxIdx=this.elements.length-1,this.current.unit=Ot.units[0])}};const Gt=(0,C.eB)();function rn(kt,Ot,An){const{elements:jn,conformation:On}=kt,fr=Gt;let Dr=Number.MAX_VALUE;for(let Pr=0,or=jn.length;PrOt.units[0].polymerElements.length>0)}let Vt;var kt;be.distance=function nn(kt,Ot){if(0===kt.elementCount||0===Ot.elementCount)return 0;const{units:An}=kt;let jn=Number.MAX_VALUE;for(let On=0,fr=An.length;OnOn(or)))return;const Dr=kt.lookup3d,Pr=(0,C.eB)();for(const or of kt.units){if(!On(or))continue;const Nr=or.boundary.sphere;C.eB.transformMat4(Pr,Nr.center,or.conformation.operator.matrix);const Ir=Dr.findUnitIndices(Pr[0],Pr[1],Pr[2],Nr.radius+jn);for(let Or=0;Or=Jr.id||!On(Jr)||!fr(or,Jr)||(Jr.elements.length>=or.elements.length?Ot(or,Jr):Ot(Jr,or))}}},be.eachAtomicHierarchyElement=function It(kt,{chain:Ot,residue:An,atom:jn}){const On=c.i.Location.create(kt);for(const fr of kt.units){if(0!==fr.kind)continue;On.unit=fr;const{elements:Dr}=fr,Pr=o.hT.transientSegments(fr.model.atomicHierarchy.chainAtomSegments,Dr),or=o.hT.transientSegments(fr.model.atomicHierarchy.residueAtomSegments,Dr);for(;Pr.hasNext;){const Nr=Pr.move();if(Ot&&(On.element=Dr[Nr.start],Ot(On)),An||jn)for(or.setSegment(Nr);or.hasNext;){const Ir=or.move();if(An&&(On.element=Dr[Ir.start],An(On)),jn)for(let Or=Ir.start,Jr=Ir.end;Or=jn.largeResidueCount*An?function $t(kt,Ot){const An=Dt(kt);return An.length>=1&&An[0].units.length>Ot.highSymmetryUnitCount}(kt,jn)?Vt.Huge:Vt.Gigantic:function Ct(kt,Ot){const An=Dt(kt);return 1===An.length&&An[0].units.length>2&&An[0].units[0].polymerElements.length{"use strict";n.d(Ue,{u:()=>M});var M,e=n(467),o=n(3543),r=n(8382),t=n(5384),A=n(4369),y=n(4824),c=n(5644),i=n(2516),v=n(1969),O=n(8960),b=n(9651),_=n(14);function I(R){return i.RT.generators.atoms({chainTest:i.RT.pred.and(i.RT.pred.eq(f=>_.Z.unit.operator_name(f.element),t.JX.DefaultName),i.RT.pred.inSet(f=>_.Z.chain.label_asym_id(f.element),R))})}function l(R,f,p,E,T,L){const{spacegroup:w,ncsOperators:Q}=R,G=[],{toFractional:V}=w.cell,U=A.eB.transformMat4((0,A.eB)(),L,V),N=t.is.getSymmetryOperatorRef(w,f,p,E,T,U);if(Q&&Q.length)for(let k=0,H=Q.length;k=0&&f[1]<=0&&p[1]>=0&&f[2]<=0&&p[2]>=0&&(Q[0]=t.is.getSymmetryOperator(T,0,0,0,0));for(let G=0;Gfunction S(R,f,p){return D.apply(this,arguments)}(k,U,N))},R.buildSymmetryRange=function T(U,N,k){return y.YZ.create("Build Symmetry",H=>function h(R,f,p,E){return a.apply(this,arguments)}(H,U,N,k))},R.buildNcs=function L(U){return y.YZ.create("Build NCS",N=>function s(R,f){return C.apply(this,arguments)}(N,U))},R.areUnitsEquivalent=w,R.UnitEquivalenceBuilder=Q,R.computeTransformGroups=function G(U){const N=Q();for(const H of U.units)N.add(H.id,H);const k=[];for(const H of N.groups)k.push(O.N.SymmetryGroup(H.map($=>U.unitMap.get($))));return k},R.areTransformGroupsEquivalent=function V(U,N){if(U.length!==N.length)return!1;for(let k=0,H=U.length;k{"use strict";n.d(Ue,{N:()=>L});var e=n(7552),o=n(5644),r=n(5384),t=n(1739),A=n(9909),y=n(4561),c=n(3543),i=n(8382),v=n(9136),O=n(5734),b=n(2434),d=n(8199),s=n(4369);const C=(0,s.eB)();function a(w){const Q=function h(w){const{elements:Q,conformation:G}=w,V=new Float32Array(3*Q.length);for(let U=0,N=Q.length;U{const Z=$.length;$.push(p.X.ofUnsortedArray([de,ye,j])),J.set((0,i.bd)(de,ye),j),W.has(de)?W.get(de).push(Z):W.set(de,[Z])};for(let de=0;de=2){te(de,j[0],j[1]);for(let Z=1,q=j.length;ZJ.get((0,i.bd)(de,ye)),getTripletIndices:de=>W.get(de),triplets:$}}!function(w){let Q;var ne;function $(ne){const be=[];for(let Te=0,ie=ne.length;Tebe[Te]}(ne=Q=w.Kinds||(w.Kinds={}))[ne.Atomic=0]="Atomic",ne[ne.Spheres=1]="Spheres",ne[ne.Gaussians=2]="Gaussians",w.isAtomic=function G(ne){return 0===ne.kind},w.isCoarse=function V(ne){return 1===ne.kind||2===ne.kind},w.isSpheres=function U(ne){return 1===ne.kind},w.isGaussians=function N(ne){return 2===ne.kind},w.create=function k(ne,be,Te,ie,ue,re,ve,ce,se){switch(ue){case 0:return new Y(ne,be,Te,ie,re,ce,e.J.createMapping(ve,re.atomicConformation),se??{});case 1:return Be(ne,be,Te,ie,re,1,ce,e.J.createMapping(ve,re.coarseConformation.spheres,Z(re)),se??{});case 2:return Be(ne,be,Te,ie,re,2,ce,e.J.createMapping(ve,re.coarseConformation.gaussians,be=>0),se??{})}},w.SymmetryGroup=J,function(ne){ne.areInvariantElementsEqual=function be(ie,ue){return ie.hashCode===ue.hashCode&&c.SortedArray.areEqual(ie.elements,ue.elements)},ne.getUnitSymmetryGroupsIndexMap=function Te(ie){const ue=c.Yz.Mutable();for(let re=0,ve=ie.length;re0):this.conformation;return new g(this.id,this.invariantId,this.chainGroupId,this.traits,be,this.kind,this.elements,ve,ie)}get boundary(){if(this.props.boundary)return this.props.boundary;const{x:be,y:Te,z:ie}=this.getCoarseConformation();return this.props.boundary=ye.is(this.traits,de.FastBoundary)?(0,S.b)({x:be,y:Te,z:ie,indices:this.elements}):(0,S.r)({x:be,y:Te,z:ie,indices:this.elements}),this.props.boundary}get lookup3d(){if(this.props.lookup3d)return this.props.lookup3d;const{x:be,y:Te,z:ie}=this.getCoarseConformation();return this.props.lookup3d=(0,r.Eh)({x:be,y:Te,z:ie,indices:this.elements},this.boundary),this.props.lookup3d}get principalAxes(){return this.props.principalAxes||(this.props.principalAxes=a(this)),this.props.principalAxes}get polymerElements(){return this.props.polymerElements||(this.props.polymerElements=function M(w){const Q=[],{elements:G,model:V}=w,{spheres:U,gaussians:N}=V.coarseHierarchy,k=v.Nf.isSpheres(w)?U.polymerRanges:N.polymerRanges,H=O.m.transientSegments(k,G);for(;H.hasNext;){const{start:$,end:J}=H.move();for(let W=$;W{"use strict";n.d(Ue,{gn:()=>de,dZ:()=>v,kD:()=>W,MQ:()=>f});var i,e=n(8672),o=n(2434),r=n(3543),t=n(6290),A=n(4506),y=n(8960),c=n(481);(i||(i={})).Empty=A.O.create([],[],[],0,{flags:[],order:[],key:[]});class v extends c.Z{getBondFromLocation(j){return y.N.isAtomic(j.aUnit)&&y.N.isAtomic(j.bUnit)?this.getEdge(j.aIndex,j.aUnit.id,j.bIndex,j.bUnit.id):void 0}getBondIndexFromLocation(j){return y.N.isAtomic(j.aUnit)&&y.N.isAtomic(j.bUnit)?this.getEdgeIndex(j.aIndex,j.aUnit.id,j.bIndex,j.bUnit.id):-1}}(v||(v={})).UnitPairBonds=class j extends c.Z.UnitPairEdges{};var O=n(6066),b=n(5373),_=n(8334),M=n(9344),I=n(8737),l=n(4369),m=n(2028),u=n(4632);const d=l.eB.distance;function s(ye,j,Z,q,Y,ee,g){const _e=new A.O.EdgeBuilder(ee,ye,j),xe=new Uint16Array(_e.slotCount),le=new Int8Array(_e.slotCount),Ae=new Uint32Array(_e.slotCount);for(let Be=0,Ce=_e.edgeCount;Be=se)continue;const ae=r.SortedArray.indexOf(ye.elements,se);if(ae<0)continue;const ge=Ce[ve],Ie=Re[ve];if(ge>=0&&ge!==ne||Ie>=0&&Ie!==ne)continue;const Le=(0,O.Yd)(q.value(se)),nt=le[ve],je=a(ye,Te,se);let Lt=!1;nt>=0?Lt=(0,m.T)(je,nt,.3):ee>=0?Lt=je1&&(ae=!1)}}}return s(ne,be,ie,Te,ue,g,{canRemap:ce||se&&ae})}(ye,Z)}var p=n(1969),E=n(5644);const T=l.eB.distance,L=l.eB.set,w=l.eB.squaredDistance,Q=l.eB.transformMat4,G=(0,l.eB)(),V=(0,l.eB)();function U(ye,j,Z,q){return ye.conformation.position(j,G),Z.conformation.position(q,V),T(G,V)}const N=(0,l.$I)(),k=(0,l.eB)(),$={...O.kD,ignoreWater:!0,ignoreIon:!0};function W(ye,j){const Z={...$,...j};return function J(ye,j){const Z=new c.Z.Builder,q=ye.models.some(ee=>_.z.Provider.get(ee)),Y=ye.models.some(ee=>I.A.isExhaustive(ee));return j.noCompute||ye.isCoarseGrained&&!q&&!Y||p.o.eachUnitPair(ye,(ee,g)=>{!function H(ye,j,Z,q){const{maxRadius:Y}=Z,{elements:ee,residueIndex:g}=ye,{x:_e,y:xe,z:le}=ye.model.atomicConformation,{elements:Ae,residueIndex:Be}=j,Ce=ye.elements.length,{type_symbol:Re,label_alt_id:ke,label_atom_id:we,label_comp_id:Oe}=ye.model.atomicHierarchy.atoms,{type_symbol:Se,label_alt_id:Ve,label_atom_id:Ne,label_comp_id:K}=j.model.atomicHierarchy.atoms,{auth_seq_id:ne}=ye.model.atomicHierarchy.residues,{auth_seq_id:be}=j.model.atomicHierarchy.residues,{occupancy:Te}=ye.model.atomicConformation,{occupancy:ie}=j.model.atomicConformation,ue=Te.isDefined&&ie.isDefined,re=ye.model===j.model&&I.A.Provider.get(ye.model),ve=!Z.forceCompute&&ye.model===j.model&&_.z.Provider.get(ye.model),{atomSourceIndex:ce}=ye.model.atomicHierarchy,{invertedIndex:se}=ve?E.Kx.getInvertedAtomSourceIndex(j.model):{invertedIndex:void 0},ae=ye.model===j.model&&I.A.isExhaustive(ye.model),ge=l.$I.mul(N,j.conformation.operator.inverse,ye.conformation.operator.matrix),Ie=!l.$I.isIdentity(ge),{center:Le,radius:nt}=j.boundary.sphere,je=(nt+Y)*(nt+Y);q.startUnitPair(ye.id,j.id);const Lt=ye.conformation.operator.key,Je=j.conformation.operator.key;for(let en=0;enje)continue;if(!Z.forceCompute&&ve){const{maxDistance:rn}=ve,{offset:tt,b:Mt,edgeProps:{order:nn,distance:bn,flag:Dn,key:jt,operatorA:It,operatorB:Dt}}=ve.bonds,Ct=ce.value(Bt),$t=(0,O.Yd)(Re.value(Bt));for(let Vt=tt[Ct],Wt=tt[Ct+1];Vt=0&&Ot>=0&&(kt===Ot||kt!==Lt||Ot!==Je))continue;const An=(0,O.Yd)(Re.value(yn)),jn=bn[Vt],On=U(ye,Bt,j,yn);let fr=!1;jn>=0?fr=(0,m.T)(On,jn,.3):rn>=0?fr=OnY||(q.add(en,Dn,{order:tt.order,flag:tt.flags,key:tt.rowIndex}),rn=!0)}if(rn)continue}if(ae)continue;const $e=Te.value(Bt),{lookup3d:mt}=j,{indices:_t,count:Me,squaredDistances:Ke}=mt.find(k[0],k[1],k[2],Y);if(0===Me)continue;const ut=(0,O.Yd)(Re.value(Bt)),Kt=(0,O.v3)(ut),sn=(0,O.O6)(ut),gt=ke.value(Bt),yt=O.ZL.has(ut),At=we.value(Bt),Gt=Oe.value(g[Bt]);for(let rn=0;rnj.validUnit(ee),validUnitPair:(ee,g)=>j.validUnitPair(ye,ee,g)}),new v(Z.getMap())}(ye,{...Z,validUnit:j&&j.validUnit||(q=>y.N.isAtomic(q)),validUnitPair:j&&j.validUnitPair||((q,Y,ee)=>{if(!p.o.validUnitPair(q,Y,ee))return!1;const _e=Y.model.atomicHierarchy.derived.residue.moleculeType,xe=ee.model.atomicHierarchy.derived.residue.moleculeType,le=!(y.N.isAtomic(Y)&&2===_e[Y.residueIndex[Y.elements[0]]]||y.N.isAtomic(ee)&&2===xe[ee.residueIndex[ee.elements[0]]]),Ae=!y.N.isAtomic(Y)||3!==_e[Y.residueIndex[Y.elements[0]]],Be=!y.N.isAtomic(ee)||3!==xe[ee.residueIndex[ee.elements[0]]];return!(!le&&Z.ignoreWater||(!Ae||!Be)&&Z.ignoreIon)||function te(ye,j){if(ye.model!==j.model||!y.N.isAtomic(ye)||!y.N.isAtomic(j))return!1;const Z=I.A.Provider.get(ye.model);if(!Z)return!1;const q=ye.elements.length=j.elements.length?ye:j,{elements:ee}=q,{elements:g}=Y,{indexOf:_e}=r.SortedArray;for(let xe=0,le=ee.length;xe=0)return!0}return!1}(Y,ee)})})}var de;!function(ye){function j(Oe,Se,Ve,Ne,K,ne){return{kind:"bond-location",aStructure:Oe,aUnit:Se,aIndex:Ve,bStructure:Ne,bUnit:K,bIndex:ne}}function q(Oe,Se){return Oe.aStructure.label===Se.aStructure.label&&Oe.bStructure.label===Se.bStructure.label&&Oe.aIndex===Se.aIndex&&Oe.bIndex===Se.bIndex&&Oe.aUnit.id===Se.aUnit.id&&Oe.bUnit.id===Se.bUnit.id}function Y(Oe,Se){return{kind:"bond-loci",structure:Oe,bonds:Se}}ye.Location=j,ye.isLocation=function Z(Oe){return!!Oe&&"bond-location"===Oe.kind},ye.areLocationsEqual=q,ye.Loci=Y,ye.isLoci=function ee(Oe){return!!Oe&&"bond-loci"===Oe.kind},ye.areLociEqual=function g(Oe,Se){if(Oe.structure!==Se.structure||Oe.bonds.length!==Se.bonds.length)return!1;for(let Ve=0,Ne=Oe.bonds.length;Ve{const K=Se.unitMap.get(Ne.aUnit.id);if(!K)return;const ne=Se.unitMap.get(Ne.bUnit.id);if(!ne)return;const Te=r.SortedArray.indexOf(K.elements,Ne.aUnit.elements[Ne.aIndex]);if(-1===Te)return;const ue=r.SortedArray.indexOf(ne.elements,Ne.bUnit.elements[Ne.bIndex]);-1!==ue&&Ve.push(j(Oe.structure,K,Te,Oe.structure,ne,ue))}),Y(Se,Ve)},ye.toStructureElementLoci=function le(Oe){const Se=[],Ve=new Map;for(const Ne of Oe.bonds){const{aIndex:K,aUnit:ne,bIndex:be,bUnit:Te}=Ne;ne===Te?Ve.has(ne.id)?Ve.get(ne.id).push(K,be):Ve.set(ne.id,[K,be]):(Ve.has(ne.id)?Ve.get(ne.id).push(K):Ve.set(ne.id,[K]),Ve.has(Te.id)?Ve.get(Te.id).push(be):Ve.set(Te.id,[be]))}return Ve.forEach((Ne,K)=>{Se.push({unit:Oe.structure.unitMap.get(K),indices:r.SortedArray.deduplicate(r.SortedArray.ofUnsortedArray(Ne))})}),e.iZ.Loci(Oe.structure,Se)},ye.toFirstStructureElementLoci=function Ae(Oe){const{aUnit:Se,aIndex:Ve}=Oe.bonds[0];return e.iZ.Loci(Oe.structure,[{unit:Se,indices:r.CD.ofSingleton(Ve)}])},ye.getType=function Be(Oe,Se){if(Se.aUnit===Se.bUnit){const Ve=Se.aUnit.bonds,Ne=Ve.getEdgeIndex(Se.aIndex,Se.bIndex);return o.I$.create(Ne<0?0:Ve.edgeProps.flags[Ne])}{const Ve=Oe.interUnitBonds.getBondFromLocation(Se);return o.I$.create(Ve?Ve.props.flag:0)}},ye.getOrder=function Ce(Oe,Se){if(Se.aUnit===Se.bUnit){const Ve=Se.aUnit.bonds,Ne=Ve.getEdgeIndex(Se.aIndex,Se.bIndex);return Ne<0?0:Ve.edgeProps.order[Ne]}{const Ve=Oe.interUnitBonds.getBondFromLocation(Se);return Ve?Ve.props.order:0}},ye.getIntraUnitBondCount=function Re(Oe){let Se=0;for(let Ve=0,Ne=Oe.units.length;Ve{const{aUnit:ne,aIndex:be,bUnit:Te,bIndex:ie}=Oe.bonds[Ve];ne.conformation.position(ne.elements[be],Ne),Te.conformation.position(Te.elements[ie],K)},Se)}}(de||(de={}))},6066:(tn,Ue,n)=>{"use strict";n.d(Ue,{O6:()=>b,Yd:()=>v,ZL:()=>c,kD:()=>o,on:()=>_,v3:()=>I});const o={forceCompute:!1,noCompute:!1,maxRadius:4},r={H:0,h:0,D:0,d:0,T:0,t:0,He:2,HE:2,he:2,Li:3,LI:3,li:3,Be:4,BE:4,be:4,B:5,b:5,C:6,c:6,N:7,n:7,O:8,o:8,F:9,f:9,Ne:10,NE:10,ne:10,Na:11,NA:11,na:11,Mg:12,MG:12,mg:12,Al:13,AL:13,al:13,Si:14,SI:14,si:14,P:15,p:15,S:16,s:16,Cl:17,CL:17,cl:17,Ar:18,AR:18,ar:18,K:19,k:19,Ca:20,CA:20,ca:20,Sc:21,SC:21,sc:21,Ti:22,TI:22,ti:22,V:23,v:23,Cr:24,CR:24,cr:24,Mn:25,MN:25,mn:25,Fe:26,FE:26,fe:26,Co:27,CO:27,co:27,Ni:28,NI:28,ni:28,Cu:29,CU:29,cu:29,Zn:30,ZN:30,zn:30,Ga:31,GA:31,ga:31,Ge:32,GE:32,ge:32,As:33,AS:33,as:33,Se:34,SE:34,se:34,Br:35,BR:35,br:35,Kr:36,KR:36,kr:36,Rb:37,RB:37,rb:37,Sr:38,SR:38,sr:38,Y:39,y:39,Zr:40,ZR:40,zr:40,Nb:41,NB:41,nb:41,Mo:42,MO:42,mo:42,Tc:43,TC:43,tc:43,Ru:44,RU:44,ru:44,Rh:45,RH:45,rh:45,Pd:46,PD:46,pd:46,Ag:47,AG:47,ag:47,Cd:48,CD:48,cd:48,In:49,IN:49,in:49,Sn:50,SN:50,sn:50,Sb:51,SB:51,sb:51,Te:52,TE:52,te:52,I:53,i:53,Xe:54,XE:54,xe:54,Cs:55,CS:55,cs:55,Ba:56,BA:56,ba:56,La:57,LA:57,la:57,Ce:58,CE:58,ce:58,Pr:59,PR:59,pr:59,Nd:60,ND:60,nd:60,Pm:61,PM:61,pm:61,Sm:62,SM:62,sm:62,Eu:63,EU:63,eu:63,Gd:64,GD:64,gd:64,Tb:65,TB:65,tb:65,Dy:66,DY:66,dy:66,Ho:67,HO:67,ho:67,Er:68,ER:68,er:68,Tm:69,TM:69,tm:69,Yb:70,YB:70,yb:70,Lu:71,LU:71,lu:71,Hf:72,HF:72,hf:72,Ta:73,TA:73,ta:73,W:74,w:74,Re:75,RE:75,re:75,Os:76,OS:76,os:76,Ir:77,IR:77,ir:77,Pt:78,PT:78,pt:78,Au:79,AU:79,au:79,Hg:80,HG:80,hg:80,Tl:81,TL:81,tl:81,Pb:82,PB:82,pb:82,Bi:83,BI:83,bi:83,Po:84,PO:84,po:84,At:85,AT:85,at:85,Rn:86,RN:86,rn:86,Fr:87,FR:87,fr:87,Ra:88,RA:88,ra:88,Ac:89,AC:89,ac:89,Th:90,TH:90,th:90,Pa:91,PA:91,pa:91,U:92,u:92,Np:93,NP:93,np:93,Pu:94,PU:94,pu:94,Am:95,AM:95,am:95,Cm:96,CM:96,cm:96,Bk:97,BK:97,bk:97,Cf:98,CF:98,cf:98,Es:99,ES:99,es:99,Fm:100,FM:100,fm:100,Md:101,MD:101,md:101,No:102,NO:102,no:102,Lr:103,LR:103,lr:103,Rf:104,RF:104,rf:104,Db:105,DB:105,db:105,Sg:106,SG:106,sg:106,Bh:107,BH:107,bh:107,Hs:108,HS:108,hs:108,Mt:109,MT:109,mt:109},t={0:1.42,1:1.42,3:2.7,4:2.7,6:1.75,7:1.6,8:1.52,11:2.7,12:2.7,13:2.7,14:1.9,15:2,16:1.9,17:1.8,19:2.7,20:2.7,21:2.7,22:2.7,23:2.7,24:2.7,25:2.7,26:2.7,27:2.7,28:2.7,29:2.7,30:2.7,31:2.7,33:2.68,37:2.7,38:2.7,39:2.7,40:2.7,41:2.7,42:2.7,43:2.7,44:2.7,45:2.7,46:2.7,47:2.7,48:2.7,49:2.7,50:2.7,55:2.7,56:2.7,57:2.7,58:2.7,59:2.7,60:2.7,61:2.7,62:2.7,63:2.7,64:2.7,65:2.7,66:2.7,67:2.7,68:2.7,69:2.7,70:2.7,71:2.7,72:2.7,73:2.7,74:2.7,75:2.7,76:2.7,77:2.7,78:2.7,79:2.7,80:2.7,81:2.7,82:2.7,83:2.7,87:2.7,88:2.7,89:2.7,90:2.7,91:2.7,92:2.7,93:2.7,94:2.7,95:2.7,96:2.7,97:2.7,98:2.7,99:2.7,100:2.7,101:2.7,102:2.7,103:2.7,104:2.7,105:2.7,106:2.7,107:2.7,108:2.7,109:2.88},A={0:.8,20:1.31,27:1.2,35:1.15,44:1.1,54:1,60:1.84,72:1.88,84:1.75,85:1.56,86:1.76,98:1.6,99:1.68,100:1.63,112:1.6,113:1.59,114:1.36,129:1.45,135:1.47,144:1.6,152:1.45,170:1.4,180:1.55,202:2.4,222:2.24,224:1.91,225:1.98,243:2.02,269:2,293:1.9,316:1.8,420:2.37,480:2.3,512:2.3,544:2.3,612:2.1,629:1.54,665:1,813:2.6,854:2.27,894:1.93,896:2.1,937:2.05,938:2.06,981:1.62,1258:2.68,1309:2.33,1484:1,1763:2.14,1823:2.48,1882:2.1,1944:1.72,2380:2.34,3367:2.44,3733:2.11,3819:2.6,3821:2.36,4736:2.75,5724:2.73,5959:2.63,6519:2.84,6750:2.87,8991:2.81},y=2.001,c=function(){const l=["LI","NA","K","RB","CS","FR","BE","MG","CA","SR","BA","RA","AL","GA","IN","SN","TL","PB","BI","SC","TI","V","CR","MN","FE","CO","NI","CU","ZN","Y","ZR","NB","MO","TC","RU","RH","PD","AG","CD","LA","HF","TA","W","RE","OS","IR","PT","AU","HG","AC","RF","DB","SG","BH","HS","MT","CE","PR","ND","PM","SM","EU","GD","TB","DY","HO","ER","TM","YB","LU","TH","PA","U","NP","PU","AM","CM","BK","CF","ES","FM","MD","NO","LR"],m=new Set;for(const u of l)m.add(r[u]);return m}();function v(l){const m=r[l];return void 0===m?-1:m}function b(l){if(l<0)return y;const m=t[l];return void 0===m?y:m}function _(l,m,u,d){const s=function O(l,m){if(l<0||m<0)return-1;const u=A[function i(l,m){return l0?s:m<0?u:(u+d)/1.95}const M=r.H;function I(l){return l===M}},4561:(tn,Ue,n)=>{"use strict";n.d(Ue,{X:()=>S,g:()=>a});var e=n(3543),o=n(4506),r=n(2434),t=n(8382),A=n(6115);function i(E){E.count=E.endVertex-E.startVertex;const{isRingAtom:T,pred:L,color:w,depth:Q,marked:G}=E;for(let V=0;V=0;j--)de[ye++]=E.startVertex+U[j],w[U[j]]=1;(0,t.eh)(de);for(let j=0,Z=E.currentRings.length;jq.length&&e.SortedArray.isSubset(de,q))return!1}return E.currentRings.push(e.SortedArray.ofSortedArray(de)),!0}function I(E,T,L){const{bonds:w,startVertex:Q,endVertex:G,isRingAtom:V,marked:U,queue:N,pred:k,depth:H}=E,{elements:$}=E.unit,{b:J,edgeProps:{flags:W},offset:te}=w;U[T]=L,H[T]=0,N[0]=T;let de=0,ye=1;for(;de=G||!r.I$.isCovalent(W[g]))continue;if(E.hasAltLoc){const Ae=E.altLoc.value($[_e]);if(Ae&&E.currentAltLoc!==Ae)continue}const xe=_e-Q;if(U[xe]===L){if(k[xe]!==j&&k[j]!==xe&&M(E,j,xe,V))return L+1;continue}const le=Math.min(H[xe],Z+1);le>5||(H[xe]=le,U[xe]=L,N[ye++]=xe,k[xe]=j)}}return L+1}function m(E){const T=E.length,L=new Int32Array(2*T);for(let V=0;V=j||Q.addEdge(N,j)}}}const G=o.O.connectedComponents(Q.getGraph()),V=G.componentIndex,U=[];for(let N=0;N=0&&(L.has(U)?L.get(U).push(V):L.set(U,[V]))}}(function(E){function L(U){return function l(E){const T=E.length,L=new Array(T);for(let V=0;V0)return!1;const j=C.c.calculateMomentsAxes((0,s.Dt)(U,N));return h.eB.magnitude(j.dirC)<.05},E.getAltId=function V(U,N){const{label_alt_id:k}=U.model.atomicHierarchy.atoms,{elements:H}=U;for(let $=0,J=N.length;${"use strict";n.d(Ue,{Jq:()=>c,jM:()=>i});var y,v,e=n(5384),o=n(4369),r=n(3543),t=n(1541),A=n(8361);function c(){return{result:y.create(),closeUnitsResult:e.Q7.create(),unitGroupResult:e.Q7.create()}}(v=y||(y={})).add=function O(M,I,l,m){M.indices[M.count]=l,M.units[M.count]=I,M.squaredDistances[M.count]=m,M.count++},v.create=function b(){return{count:0,indices:[],units:[],squaredDistances:[]}},v.copy=function _(M,I){for(let l=0;l(d+=u[a].elements.length)>=M,I.closeUnitsResult);if(0===s.count)return l;let C=0,h=-Number.MAX_VALUE;for(let a=0,S=s.count;a=M&&hl||u.addElement(p[f.indices[E]])}u.commitUnit()}}check(O,b,_,M){const{units:I}=this.structure,l=this.unitLookup.find(O,b,_,M);if(0===l.count)return!1;for(let m=0,u=l.count;m{"use strict";n.d(Ue,{c:()=>o});var o,e=n(9909);(o||(o={})).create=function t(A,y,c,i){return{id:e.kk.create22(),label:A,basic:y,sourceData:i,bonds:c}}},7024:(tn,Ue,n)=>{"use strict";n.d(Ue,{P:()=>e});class e{getFrameAtIndex(r){return this.frames[r]}constructor(r){this.frames=r,this.frameCount=r.length,this.representative=r[0],this.duration=r.length}}},2789:(tn,Ue,n)=>{"use strict";n.d(Ue,{Dt:()=>v,HQ:()=>c,Ju:()=>t});var e=n(2434),o=n(4369);function t(O,b){switch(O.kind){case 0:return O.model.atomicHierarchy.derived.residue.moleculeType[O.residueIndex[b]];case 1:case 2:const _=function r(O,b){const M=O.model.sequence.byEntityKey[O.coarseElements.entityKey[b]].sequence,I=O.coarseElements.seq_id_begin.value(b);return M.compId.value(I-1)}(O,b),M=O.model.properties.chemicalComponentMap.get(_);if(M)return(0,e.RN)(M.type,_)}return 0}const y=new Set;function c(O,b){const _=e.Pt[O];if(void 0!==_){const M=_[b];if(void 0!==M)return M}return y}const i=o.eB.zero();function v(O,b){const _=O.conformation,M=new Float32Array(3*b.length),{elements:I}=O;for(let l=0,m=b.length;l{"use strict";n.d(Ue,{f:()=>e.f,x:()=>o.x});var e=n(3162),o=n(5879)},5879:(tn,Ue,n)=>{"use strict";n.d(Ue,{x:()=>y});var y,e=n(5384),o=n(4369),r=n(6115);function A(c,i,v,O){let b=(O-v)/i;0===b&&(b=1);const _=new Int32Array(i);for(let M=0,I=c.length;M=i?l=i-1:l<0&&(l=0),_[l]++}return{min:v,max:O,binWidth:b,counts:_}}!function(c){c.One={transform:{kind:"matrix",matrix:o.$I.identity()},cells:o.qY.create(o.qY.Space([1,1,1],[0,1,2]),o.qY.Data1([0])),stats:{min:0,max:0,mean:0,sigma:0}};const i=o.$I.zero(),v=o.$I.zero();c.getGridToCartesianTransform=function O(l){if("matrix"===l.transform.kind)return o.$I.copy((0,o.$I)(),l.transform.matrix);if("spacegroup"===l.transform.kind){const{cells:{space:m}}=l,u=o.$I.fromScaling(i,o.eB.div(o.eB.zero(),e.DJ.size(o.eB.zero(),l.transform.fractionalBox),o.eB.ofArray(m.dimensions))),d=o.$I.fromTranslation(v,l.transform.fractionalBox.min);return o.$I.mul3(o.$I.zero(),l.transform.cell.fromFractional,d,u)}return o.$I.identity()},c.areEquivalent=function b(l,m){return l===m},c.isEmpty=function _(l){return 0===l.cells.data.length},c.getBoundingSphere=function M(l,m){m||(m=(0,e.f8)());const u=l.cells.space.dimensions,d=c.getGridToCartesianTransform(l);return e.f8.fromDimensionsAndTransform(m,u,d)},c.getHistogram=function I(l,m){let u=l._historams;return u||(u=l._historams={}),u[m]||(u[m]=function t(c,i,v){if(v)return A(c,i,v.min,v.max);{const[O,b]=(0,r.em)(c);return A(c,i,O,b)}}(l.cells.data,m,{min:l.stats.min,max:l.stats.max})),u[m]}}(y||(y={}))},3162:(tn,Ue,n)=>{"use strict";n.d(Ue,{f:()=>_});var _,e=n(5879),o=n(3543),r=n(5384),t=n(4369),A=n(7136),y=n(3420),c=n(2028),i=n(1692),v=n(8277),O=n(229),b=n(4625);!function(M){let l;M.is=function I(L){var w,Q,G,V;return(null===(V=null===(G=null===(Q=null===(w=L?.grid)||void 0===w?void 0:w.cells)||void 0===Q?void 0:Q.space)||void 0===G?void 0:G.dimensions)||void 0===V?void 0:V.length)&&L?.sourceData&&L?.customProperties&&L?._propertyData},function(L){function N($,J){return"absolute"===$.kind?$:{kind:"absolute",absoluteValue:L.calcAbsolute(J,$.relativeValue)}}L.areSame=function w($,J,W){return(0,c.T)(N($,W).absoluteValue,N(J,W).absoluteValue,W.sigma/100)},L.absolute=function Q($){return{kind:"absolute",absoluteValue:$}},L.relative=function G($){return{kind:"relative",relativeValue:$}},L.calcAbsolute=function V($,J){return J*$.sigma+$.mean},L.calcRelative=function U($,J){return 0===$.sigma?0:(J-$.mean)/$.sigma},L.toAbsolute=N,L.toRelative=function k($,J){return"relative"===$.kind?$:{kind:"relative",relativeValue:L.calcRelative(J,$.absoluteValue)}},L.toString=function H($){return"relative"===$.kind?`${$.relativeValue.toFixed(2)} \u03c3`:`${$.absoluteValue.toPrecision(4)}`}}(l=M.IsoValue||(M.IsoValue={})),M.adjustedIsoValue=function m(L,w,Q){if("relative"===Q)return l.relative(w);const G=l.absolute(w);if(b.T.is(L.sourceData)){const V={min:L.sourceData.data.volume_data_3d_info.min_source.value(0),max:L.sourceData.data.volume_data_3d_info.max_source.value(0),mean:L.sourceData.data.volume_data_3d_info.mean_source.value(0),sigma:L.sourceData.data.volume_data_3d_info.sigma_source.value(0)};return M.IsoValue.toRelative(G,V)}return G};const u={min:-1,max:1,mean:0,sigma:.1};function d(L,w){const Q=w||u,{min:G,max:V,mean:U,sigma:N}=Q,k=(G-U)/N,H=(V-U)/N;let $=L;return"absolute"===L.kind?L.absoluteValueV&&($=M.IsoValue.absolute(V)):L.relativeValueH&&($=M.IsoValue.relative(H)),v.t.Conditioned($,{absolute:v.t.Converted(J=>M.IsoValue.toAbsolute(J,e.x.One.stats).absoluteValue,J=>M.IsoValue.absolute(J),v.t.Numeric(U,{min:G,max:V,step:(0,O.QX)(N/100,2)},{immediateUpdate:!0})),relative:v.t.Converted(J=>M.IsoValue.toRelative(J,e.x.One.stats).relativeValue,J=>M.IsoValue.relative(J),v.t.Numeric(Math.min(1,H),{min:k,max:H,step:(0,O.QX)(Math.round((V-G)/N)/100,2)},{immediateUpdate:!0}))},J=>"absolute"===J.kind?"absolute":"relative",(J,W)=>"absolute"===W?M.IsoValue.toAbsolute(J,Q):M.IsoValue.toRelative(J,Q),{isEssential:!0})}let p,E,T;M.createIsoValueParam=d,M.IsoValueParam=d(M.IsoValue.relative(2)),M.One={label:"",grid:e.x.One,sourceData:{kind:"",name:"",data:{}},customProperties:new i.v,_propertyData:Object.create(null)},M.areEquivalent=function s(L,w){return e.x.areEquivalent(L.grid,w.grid)},M.isEmpty=function C(L){return e.x.isEmpty(L.grid)},M.isOrbitals=function h(L){return!!y.f.is(L.sourceData)&&L.sourceData.data.header.orbitals},M.Loci=function a(L){return{kind:"volume-loci",volume:L}},M.isLoci=function S(L){return!!L&&"volume-loci"===L.kind},M.areLociEqual=function D(L,w){return L.volume===w.volume},M.isLociEmpty=function R(L){return e.x.isEmpty(L.volume.grid)},M.getBoundingSphere=function f(L,w){return e.x.getBoundingSphere(L.grid,w)},function(L){L.Loci=function w(k,H){return{kind:"isosurface-loci",volume:k,isoValue:H}},L.isLoci=function Q(k){return!!k&&"isosurface-loci"===k.kind},L.areLociEqual=function G(k,H){return k.volume===H.volume&&M.IsoValue.areSame(k.isoValue,H.isoValue,k.volume.grid.stats)},L.isLociEmpty=function V(k){return 0===k.volume.grid.cells.data.length};const U=(0,r.DJ)();L.getBoundingSphere=function N(k,H,$){const J=M.IsoValue.toAbsolute(H,k.grid.stats).absoluteValue,W=J<0,te=[0,0,0],de=k.grid.cells.space.getCoords,ye=k.grid.cells.data,[j,Z,q]=k.grid.cells.space.dimensions;let Y=j-1,ee=Z-1,g=q-1,_e=0,xe=0,le=0;for(let Be=0,Ce=ye.length;Be=J)&&(de(Be,te),te[0]_e&&(_e=te[0]),te[1]>xe&&(xe=te[1]),te[2]>le&&(le=te[2]));t.eB.set(U.min,Y-1,ee-1,g-1),t.eB.set(U.max,_e+1,xe+1,le+1);const Ae=e.x.getGridToCartesianTransform(k.grid);return r.DJ.transform(U,U,Ae),r.f8.fromBox3D($||(0,r.f8)(),U)}}(p=M.Isosurface||(M.Isosurface={})),function(L){L.Loci=function w(H,$){return{kind:"cell-loci",volume:H,indices:$}},L.isLoci=function Q(H){return!!H&&"cell-loci"===H.kind},L.areLociEqual=function G(H,$){return H.volume===$.volume&&o.CD.areEqual(H.indices,$.indices)},L.isLociEmpty=function V(H){return 0===o.CD.size(H.indices)};const U=new A.Z("98"),N=(0,t.eB)();L.getBoundingSphere=function k(H,$,J){U.reset();const W=e.x.getGridToCartesianTransform(H.grid),{getCoords:te}=H.grid.cells.space;for(let ye=0,j=o.CD.size($);yeL._propertyData.__segmentation__}}(_||(_={}))},6511:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{DownloadFile:()=>_,OpenFiles:()=>b});var e=n(467),o=n(1832),r=n(4824),t=n(1861),A=n(675),y=n(8277),c=n(6985),i=n(381);function v(M,I,l,m){return O.apply(this,arguments)}function O(){return(O=(0,e.A)(function*(M,I,l,m){var u,d,s,C;const h=(0,A.o)(null!==(d=null===(u=M.file)||void 0===u?void 0:u.name)&&void 0!==d?d:""),a=I.dataFormats.binaryExtensions.has(h.ext),{data:S}=yield I.builders.data.readFile({file:M,isBinary:a}),D="auto"===l?I.dataFormats.auto(h,null===(s=S.cell)||void 0===s?void 0:s.obj):I.dataFormats.get(l);if(!D)return I.log.warn(`OpenFiles: could not find data provider for '${h.ext}'`),void(yield I.state.data.build().delete(S).commit());const R=yield D.parse(I,S);m&&(yield null===(C=D.visuals)||void 0===C?void 0:C.call(D,I,R))})).apply(this,arguments)}const b=o.KW.build({display:{name:"Open Files",description:"Load one or more files and optionally create default visuals"},from:i.O.Root,params:(M,I)=>{const{extensions:l,options:m}=I.dataFormats;return{files:y.t.FileList({accept:Array.from(l.values()).map(u=>`.${u}`).join(",")+",.gz,.zip",multiple:!0}),format:y.t.MappedStatic("auto",{auto:y.t.EmptyGroup(),specific:y.t.Select(m[0][0],m)}),visuals:y.t.Boolean(!0,{description:"Add default visuals"})}}})(({params:M,state:I},l)=>r.YZ.create("Open Files",function(){var m=(0,e.A)(function*(u){l.behaviors.layout.leftPanelTabName.next("data"),yield I.transaction((0,e.A)(function*(){if(null!==M.files)for(const d of M.files)try{if(d.file&&d.name.toLowerCase().endsWith(".zip")){const s=yield(0,c.$1)(u,yield d.file.arrayBuffer());for(const[C,h]of Object.entries(s)){if(!(h instanceof Uint8Array)||0===h.length)continue;const a=t.V.File(new File([h],C));yield v(a,l,"auto",M.visuals)}}else{const s="auto"===M.format.name?"auto":M.format.params;yield v(d,l,s,M.visuals)}}catch(s){console.error(s),l.log.error(`Error opening file '${d.name}'`)}else l.log.error("No file(s) selected")})).runInContext(u)});return function(u){return m.apply(this,arguments)}}())),_=o.KW.build({display:{name:"Download File",description:"Load one or more file from an URL"},from:i.O.Root,params:(M,I)=>{const l=[...I.dataFormats.options,["zip","Zip"],["gzip","Gzip"]];return{url:y.t.Url(""),format:y.t.Select(l[0][0],l),isBinary:y.t.Boolean(!1),visuals:y.t.Boolean(!0,{description:"Add default visuals"})}}})(({params:M,state:I},l)=>r.YZ.create("Open Files",function(){var m=(0,e.A)(function*(u){l.behaviors.layout.leftPanelTabName.next("data"),yield I.transaction((0,e.A)(function*(){var d,s,C;try{if("zip"===M.format||"gzip"===M.format){const h=yield l.builders.data.download({url:M.url,isBinary:!0});if("zip"===M.format){const a=yield(0,c.$1)(u,(null===(d=h.obj)||void 0===d?void 0:d.data).buffer);for(const[S,D]of Object.entries(a)){if(!(D instanceof Uint8Array)||0===D.length)continue;const R=t.V.File(new File([D],S));yield v(R,l,"auto",M.visuals)}}else{const a=t.V.getUrl(M.url),S=(0,A.o)(a).name;yield v(t.V.File(new File([null===(s=h.obj)||void 0===s?void 0:s.data],S)),l,"auto",M.visuals)}}else{const h=l.dataFormats.get(M.format);if(!h)return void l.log.warn(`DownloadFile: could not find data provider for '${M.format}'`);const a=yield l.builders.data.download({url:M.url,isBinary:M.isBinary}),S=yield h.parse(l,a);M.visuals&&(yield null===(C=h.visuals)||void 0===C?void 0:C.call(h,l,S))}}catch(h){console.error(h),l.log.error(`Error downloading '${"string"==typeof M.url?M.url:M.url.url}'`)}})).runInContext(u)});return function(u){return m.apply(this,arguments)}}()))},1732:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{AddTrajectory:()=>w,DownloadStructure:()=>s,EnableModelCustomProps:()=>T,EnableStructureCustomProps:()=>L,LoadTrajectory:()=>Q,PdbDownloadProvider:()=>d,UpdateTrajectory:()=>E});var e=n(467),o=n(1832),r=n(4824),t=n(8277),A=n(9880),y=n(5953),c=n(1295),i=n(381),v=n(1073),O=n(1855),b=n(1861),_=n(237),M=n(675),I=n(1372),l=n(2945),m=n(1169);const d={rcsb:t.t.Group({encoding:t.t.Select("bcif",t.t.arrayToOptions(["cif","bcif"]))},{label:"RCSB PDB",isFlat:!0}),pdbe:t.t.Group({variant:t.t.Select("updated-bcif",[["updated-bcif","Updated (bcif)"],["updated","Updated"],["archival","Archival"]])},{label:"PDBe",isFlat:!0}),pdbj:t.t.EmptyGroup({label:"PDBj"})},s=o.KW.build({from:i.O.Root,display:{name:"Download Structure",description:"Load a structure from the provided source and create its representation."},params:(G,V)=>{const U=(G=>{const V=G.config.get(_.AB.Structure.DefaultRepresentationPreset)||A.Bj.auto.id;return t.t.Group({type:c.z.getParams(void 0,"auto").type,representation:t.t.Select(V,G.builders.structure.representation.getPresets().map(U=>[U.id,U.display.name,U.display.group]),{description:"Which representation preset to use."}),representationParams:t.t.Group(A.n9.CommonParams,{isHidden:!0}),asTrajectory:t.t.Optional(t.t.Boolean(!1,{description:"Load all entries into a single trajectory."}))},{isExpanded:!1})})(V),N=V.config.get(_.AB.Download.DefaultPdbProvider)||"pdbe";return{source:t.t.MappedStatic("pdb",{pdb:t.t.Group({provider:t.t.Group({id:t.t.Text("1tqn",{label:"PDB Id(s)",description:"One or more comma/space separated PDB ids."}),server:t.t.MappedStatic(N,d)},{pivot:"id"}),options:U},{isFlat:!0,label:"PDB"}),"pdb-dev":t.t.Group({provider:t.t.Group({id:t.t.Text("PDBDEV_00000001",{label:"PDB-Dev Id(s)",description:"One or more comma/space separated ids."}),encoding:t.t.Select("bcif",t.t.arrayToOptions(["cif","bcif"]))},{pivot:"id"}),options:U},{isFlat:!0,label:"PDB-Dev"}),swissmodel:t.t.Group({id:t.t.Text("Q9Y2I8",{label:"UniProtKB AC(s)",description:"One or more comma/space separated ACs."}),options:U},{isFlat:!0,label:"SWISS-MODEL",description:"Loads the best homology model or experimental structure"}),alphafolddb:t.t.Group({id:t.t.Text("Q8W3K0",{label:"UniProtKB AC(s)",description:"One or more comma/space separated ACs."}),options:U},{isFlat:!0,label:"AlphaFold DB",description:"Loads the predicted model if available"}),modelarchive:t.t.Group({id:t.t.Text("ma-bak-cepc-0003",{label:"Accession Code(s)",description:"One or more comma/space separated ACs."}),options:U},{isFlat:!0,label:"Model Archive"}),pubchem:t.t.Group({id:t.t.Text("2244,2245",{label:"PubChem ID",description:"One or more comma/space separated IDs."}),options:U},{isFlat:!0,label:"PubChem",description:"Loads 3D conformer from PubChem."}),url:t.t.Group({url:t.t.Url(""),format:t.t.Select("mmcif",t.t.arrayToOptions(y.HQ.map(k=>k[0]),k=>k)),isBinary:t.t.Boolean(!1),label:t.t.Optional(t.t.Text("")),options:U},{isFlat:!0,label:"URL"})})}}})(({params:G,state:V},U)=>r.YZ.create("Download Structure",function(){var N=(0,e.A)(function*(k){U.behaviors.layout.leftPanelTabName.next("data");const H=G.source;let $,J=!1,W="mmcif";switch(H.name){case"url":$=[{url:H.params.url,isBinary:H.params.isBinary,label:H.params.label||void 0}],W=H.params.format;break;case"pdb":$=yield"pdbe"===H.params.provider.server.name?function a(G){return S.apply(this,arguments)}(H):"pdbj"===H.params.provider.server.name?function D(G){return R.apply(this,arguments)}(H):"rcsb"===H.params.provider.server.name?function f(G){return p.apply(this,arguments)}(H):(0,I.dr)(H),J=!!H.params.options.asTrajectory;break;case"pdb-dev":$=yield C(H.params.provider.id,j=>{const Z=j.toUpperCase().startsWith("PDBDEV_")?j:`PDBDEV_${j.padStart(8,"0")}`;return"bcif"===H.params.provider.encoding?`https://pdb-dev.wwpdb.org/bcif/${Z.toUpperCase()}.bcif`:`https://pdb-dev.wwpdb.org/cif/${Z.toUpperCase()}.cif`},j=>j.toUpperCase().startsWith("PDBDEV_")?j:`PDBDEV_${j.padStart(8,"0")}`,"bcif"===H.params.provider.encoding),J=!!H.params.options.asTrajectory;break;case"swissmodel":$=yield C(H.params.id,j=>`https://swissmodel.expasy.org/repository/uniprot/${j.toUpperCase()}.pdb`,j=>`SWISS-MODEL: ${j}`,!1),J=!!H.params.options.asTrajectory,W="pdb";break;case"alphafolddb":$=yield C(H.params.id,function(){var j=(0,e.A)(function*(Z){const q=`https://www.alphafold.ebi.ac.uk/api/prediction/${Z.toUpperCase()}`,Y=yield U.runTask(U.fetch({url:q,type:"json"}));if(Array.isArray(Y)&&Y.length>0)return Y[0].cifUrl;throw new Error(`No AlphaFold DB entry for '${Z}'`)});return function(Z){return j.apply(this,arguments)}}(),j=>`AlphaFold DB: ${j}`,!1),J=!!H.params.options.asTrajectory,W="mmcif";break;case"modelarchive":$=yield C(H.params.id,j=>`https://www.modelarchive.org/doi/10.5452/${j.toLowerCase()}.cif`,j=>`Model Archive: ${j}`,!1),J=!!H.params.options.asTrajectory,W="mmcif";break;case"pubchem":$=yield C(H.params.id,j=>`https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/CID/${j.trim()}/record/SDF/?record_type=3d`,j=>`PubChem: ${j}`,!1),J=!!H.params.options.asTrajectory,W="mol";break;default:(0,I.dr)(H)}const te=G.source.params.options.representation||U.config.get(_.AB.Structure.DefaultRepresentationPreset)||A.Bj.auto.id,de=te!==A.Bj.empty.id,ye="auto"===H.params.options.type.name?void 0:H.params.options.type;yield V.transaction((0,e.A)(function*(){if($.length>0&&J){const j=yield U.builders.data.downloadBlob({sources:$.map((q,Y)=>({id:""+Y,url:q.url,isBinary:q.isBinary})),maxConcurrency:6},{state:{isGhost:!0}}),Z=yield U.builders.structure.parseTrajectory(j,{formats:$.map((q,Y)=>({id:""+Y,format:"cif"}))});yield U.builders.structure.hierarchy.applyPreset(Z,"default",{structure:ye,showUnitcell:de,representationPreset:te,representationPresetParams:G.source.params.options.representationParams})}else for(const j of $){const Z=yield U.builders.data.download(j,{state:{isGhost:!0}}),q=U.dataFormats.get(W);if(!q)throw new Error("unknown file format");const Y=yield U.builders.structure.parseTrajectory(Z,q);yield U.builders.structure.hierarchy.applyPreset(Y,"default",{structure:ye,showUnitcell:de,representationPreset:te,representationPresetParams:G.source.params.options.representationParams})}})).runInContext(k)});return function(k){return N.apply(this,arguments)}}()));function C(G,V,U,N){return h.apply(this,arguments)}function h(){return(h=(0,e.A)(function*(G,V,U,N){const k=G.split(/[,\s]/).map($=>$.trim()).filter($=>!!$&&($.length>=4||/^[1-9][0-9]*$/.test($))),H=[];for(const $ of k)H.push({url:b.V.Url(yield V($)),isBinary:N,label:U($)});return H})).apply(this,arguments)}function S(){return(S=(0,e.A)(function*(G){if("pdb"!==G.name||"pdbe"!==G.params.provider.server.name)throw new Error("expected pdbe");return"updated"===G.params.provider.server.params.variant?C(G.params.provider.id,V=>`https://www.ebi.ac.uk/pdbe/static/entry/${V.toLowerCase()}_updated.cif`,V=>`PDBe: ${V} (updated cif)`,!1):"updated-bcif"===G.params.provider.server.params.variant?C(G.params.provider.id,V=>`https://www.ebi.ac.uk/pdbe/entry-files/download/${V.toLowerCase()}.bcif`,V=>`PDBe: ${V} (updated cif)`,!0):C(G.params.provider.id,V=>`https://www.ebi.ac.uk/pdbe/static/entry/${V.toLowerCase()}.cif`,V=>`PDBe: ${V} (cif)`,!1)})).apply(this,arguments)}function R(){return(R=(0,e.A)(function*(G){if("pdb"!==G.name||"pdbj"!==G.params.provider.server.name)throw new Error("expected pdbj");return C(G.params.provider.id,V=>`https://data.pdbjbk1.pdbj.org/pub/pdb/data/structures/divided/mmCIF/${V.toLowerCase().substring(1,3)}/${V.toLowerCase()}.cif`,V=>`PDBj: ${V} (cif)`,!1)})).apply(this,arguments)}function p(){return(p=(0,e.A)(function*(G){if("pdb"!==G.name||"rcsb"!==G.params.provider.server.name)throw new Error("expected rcsb");return"cif"===G.params.provider.server.params.encoding?C(G.params.provider.id,V=>`https://files.rcsb.org/download/${V.toUpperCase()}.cif`,V=>`RCSB PDB: ${V} (cif)`,!1):C(G.params.provider.id,V=>`https://models.rcsb.org/${V.toUpperCase()}.bcif`,V=>`RCSB PDB: ${V} (bcif)`,!0)})).apply(this,arguments)}const E=o.KW.build({display:{name:"Update Trajectory"},params:{action:t.t.Select("advance",t.t.arrayToOptions(["advance","reset"])),by:t.t.Optional(t.t.Numeric(1,{min:-1,max:1,step:1}))}})(({params:G,state:V})=>{const U=V.selectQ(k=>k.ofTransformer(v.f.Model.ModelFromTrajectory)),N=V.build();if("reset"===G.action)for(const k of U)N.to(k).update({modelIndex:0});else for(const k of U){const H=o.QX.findAncestorOfType(V.tree,V.cells,k.transform.ref,i.O.Molecule.Trajectory);if(!H||!H.obj)continue;const $=H.obj;N.to(k).update(J=>{let W=(J.modelIndex+G.by)%$.data.frameCount;return W<0&&(W+=$.data.frameCount),{modelIndex:W}})}return V.updateTree(N)}),T=o.KW.build({display:{name:"Custom Model Properties",description:"Enable parameters for custom properties of the model."},from:i.O.Molecule.Model,params:(G,V)=>V.customModelProperties.getParams(G?.data),isApplicable:(G,V,U)=>V.transformer!==O.CustomModelProperties})(({ref:G,params:V},U)=>U.builders.structure.insertModelProperties(G,V)),L=o.KW.build({display:{name:"Custom Structure Properties",description:"Enable parameters for custom properties of the structure."},from:i.O.Molecule.Structure,params:(G,V)=>V.customStructureProperties.getParams(G?.data),isApplicable:(G,V,U)=>V.transformer!==O.CustomStructureProperties})(({ref:G,params:V},U)=>U.builders.structure.insertStructureProperties(G,V)),w=o.KW.build({display:{name:"Add Trajectory",description:"Add trajectory from existing model/topology and coordinates."},from:i.O.Root,params(G,V){const U=V.state.data,k=[...U.selectQ(J=>J.rootsOfType(i.O.Molecule.Model)),...U.selectQ(J=>J.rootsOfType(i.O.Molecule.Topology))].map(J=>[J.transform.ref,J.obj.label]),$=U.selectQ(J=>J.rootsOfType(i.O.Molecule.Coordinates)).map(J=>[J.transform.ref,J.obj.label]);return{model:t.t.Select(k.length?k[0][0]:"",k),coordinates:t.t.Select($.length?$[0][0]:"",$)}}})(({params:G,state:V},U)=>r.YZ.create("Add Trajectory",N=>V.transaction((0,e.A)(function*(){const k=[G.model,G.coordinates],H=V.build().toRoot().apply(O.TrajectoryFromModelAndCoordinates,{modelRef:G.model,coordinatesRef:G.coordinates},{dependsOn:k}).apply(v.f.Model.ModelFromTrajectory,{modelIndex:0});yield V.updateTree(H).runInContext(N);const $=yield U.builders.structure.createStructure(H.selector);yield U.builders.structure.representation.applyPreset($,"auto")})).runInContext(N))),Q=o.KW.build({display:{name:"Load Trajectory",description:"Load trajectory of model/topology and coordinates from URL or file."},from:i.O.Root,params(G,V){const{options:U}=V.dataFormats,N=U.filter(J=>J[2]===y.RB||J[2]===l.nE),k=U.filter(J=>J[2]===m.jM),H=[],$=[];for(const{provider:J}of V.dataFormats.list)J.category===y.RB||J.category===l.nE?(J.binaryExtensions&&H.push(...J.binaryExtensions),J.stringExtensions&&H.push(...J.stringExtensions)):J.category===m.jM&&(J.binaryExtensions&&$.push(...J.binaryExtensions),J.stringExtensions&&$.push(...J.stringExtensions));return{source:t.t.MappedStatic("file",{url:t.t.Group({model:t.t.Group({url:t.t.Url(""),format:t.t.Select(N[0][0],N),isBinary:t.t.Boolean(!1)},{isExpanded:!0}),coordinates:t.t.Group({url:t.t.Url(""),format:t.t.Select(k[0][0],k)},{isExpanded:!0})},{isFlat:!0}),file:t.t.Group({model:t.t.File({accept:H.map(J=>`.${J}`).join(","),label:"Model"}),coordinates:t.t.File({accept:$.map(J=>`.${J}`).join(","),label:"Coordinates"})},{isFlat:!0})},{options:[["url","URL"],["file","File"]]})}}})(({params:G,state:V},U)=>r.YZ.create("Load Trajectory",N=>V.transaction((0,e.A)(function*(){const k=G.source;if("file"===k.name&&(null===k.params.model||null===k.params.coordinates))return void U.log.error("No file(s) selected");if(!("url"!==k.name||k.params.model&&k.params.coordinates))return void U.log.error("No URL(s) given");const H=function(){var J=(0,e.A)(function*(W,te,de){const ye=yield U.builders.data.download({url:W,isBinary:de}),j=U.dataFormats.get(te);if(j)return j.parse(U,ye);U.log.warn(`LoadTrajectory: could not find data provider for '${te}'`)});return function(te,de,ye){return J.apply(this,arguments)}}(),$=function(){var J=(0,e.A)(function*(W){var te,de,ye;if(!W)throw new Error("No file selected");const j=(0,M.o)(null!==(de=null===(te=W.file)||void 0===te?void 0:te.name)&&void 0!==de?de:""),Z=U.dataFormats.binaryExtensions.has(j.ext),{data:q}=yield U.builders.data.readFile({file:W,isBinary:Z}),Y=U.dataFormats.auto(j,null===(ye=q.cell)||void 0===ye?void 0:ye.obj);return Y?Y.parse(U,q):(U.log.warn(`LoadTrajectory: could not find data provider for '${j.ext}'`),void(yield U.state.data.build().delete(q).commit()))});return function(te){return J.apply(this,arguments)}}();try{const J="url"===k.name?yield H(k.params.model.url,k.params.model.format,k.params.model.isBinary):yield $(k.params.model);let W;W="trajectory"in J?yield V.build().to(J.trajectory).apply(O.ModelFromTrajectory,{modelIndex:0}).commit():J.topology;const te="url"===k.name?yield H(k.params.coordinates.url,k.params.coordinates.format,!0):yield $(k.params.coordinates),de=[W.ref,te.ref],ye=V.build().toRoot().apply(O.TrajectoryFromModelAndCoordinates,{modelRef:W.ref,coordinatesRef:te.ref},{dependsOn:de}).apply(v.f.Model.ModelFromTrajectory,{modelIndex:0});yield V.updateTree(ye).runInContext(N);const j=yield U.builders.structure.createStructure(ye.selector);yield U.builders.structure.representation.applyPreset(j,"auto")}catch(J){console.error(J),U.log.error("Error loading trajectory")}})).runInContext(N)))},9880:(tn,Ue,n)=>{"use strict";n.d(Ue,{Bj:()=>Q,n9:()=>m});var e=n(467),o=n(8277),r=n(5019),t=n(9136),A=n(1832),y=n(9096),c=n(237),i=n(445),v=n(1893),O=n(8742),b=n(8103),_=n(8334),M=n(8737),I=n(1372),l=n(2086);function m(G){return G}!function(G){function V(H){return"chain-id"===H?{name:H,params:O.oy.defaultValues}:"operator-name"===H?{name:H,params:b.PO.defaultValues}:{name:H,params:{}}}G.CommonParams={ignoreHydrogens:o.t.Optional(o.t.Boolean(!1)),ignoreHydrogensVariant:o.t.Optional(o.t.Select("all",o.t.arrayToOptions(["all","non-polar"]))),ignoreLight:o.t.Optional(o.t.Boolean(!1)),quality:o.t.Optional(o.t.Select("auto",r.sF)),theme:o.t.Optional(o.t.Group({globalName:o.t.Optional(o.t.Text("")),globalColorParams:o.t.Optional(o.t.Value({},{isHidden:!0})),carbonColor:o.t.Optional(o.t.Select("chain-id",o.t.arrayToOptions(["chain-id","operator-name","element-symbol"]))),symmetryColor:o.t.Optional(o.t.Text("")),symmetryColorParams:o.t.Optional(o.t.Value({},{isHidden:!0})),focus:o.t.Optional(o.t.Group({name:o.t.Optional(o.t.Text("")),params:o.t.Optional(o.t.Value({}))}))}))},G.reprBuilder=function N(H,$,J){var W,te,de,ye,j,Z,q,Y,ee,g,_e,xe,le,Ae;const Be=H.state.data.build(),Ce=H.builders.structure.representation,Re=H.managers.structure.component.state.options.hydrogens,ke={quality:H.managers.structure.component.state.options.visualQuality,ignoreHydrogens:"all"!==Re,ignoreHydrogensVariant:"only-polar"===Re?"non-polar":"all",ignoreLight:H.managers.structure.component.state.options.ignoreLight};$.quality&&"auto"!==$.quality&&(ke.quality=$.quality),void 0!==$.ignoreHydrogens&&(ke.ignoreHydrogens=!!$.ignoreHydrogens),void 0!==$.ignoreHydrogensVariant&&(ke.ignoreHydrogensVariant=$.ignoreHydrogensVariant),void 0!==$.ignoreLight&&(ke.ignoreLight=!!$.ignoreLight);const we=null!==(W=$.theme)&&void 0!==W&&W.globalName?null===(te=$.theme)||void 0===te?void 0:te.globalName:void 0,Oe=void 0!==(null===(de=$.theme)||void 0===de?void 0:de.carbonColor)?{carbonColor:V(null===(ye=$.theme)||void 0===ye?void 0:ye.carbonColor),...null===(j=$.theme)||void 0===j?void 0:j.globalColorParams}:{...null===(Z=$.theme)||void 0===Z?void 0:Z.globalColorParams},Se=J&&null!==(q=$.theme)&&void 0!==q&&q.symmetryColor&&function U(H){return H.units.some($=>!$.conformation.operator.assembly&&$.conformation.operator.spgrOp>=0)}(J)?null===(Y=$.theme)||void 0===Y?void 0:Y.symmetryColor:we;return{update:Be,builder:Ce,color:we,symmetryColor:Se,symmetryColorParams:null!==(ee=$.theme)&&void 0!==ee&&ee.symmetryColorParams?{...null===(g=$.theme)||void 0===g?void 0:g.globalColorParams,...null===(_e=$.theme)||void 0===_e?void 0:_e.symmetryColorParams}:{...null===(xe=$.theme)||void 0===xe?void 0:xe.globalColorParams},globalColorParams:null!==(le=$.theme)&&void 0!==le&&le.globalColorParams?{...null===(Ae=$.theme)||void 0===Ae?void 0:Ae.globalColorParams}:void 0,typeParams:ke,ballAndStickColor:Oe}},G.updateFocusRepr=function k(H,$,J,W){if(H.state.hasBehavior(i.b))return H.state.updateBehavior(i.b,te=>{const de=(0,v.IZ)(H,$,"ball-and-stick",J||"element-symbol",W);te.surroundingsParams.colorTheme=de,te.targetParams.colorTheme=de})}}(m||(m={}));const u=m.CommonParams,d=m.reprBuilder,s=m.updateFocusRepr,C=m({id:"preset-structure-representation-auto",display:{name:"Automatic",description:"Show representations based on the size of the structure. Smaller structures are shown with more detail than larger ones, ranging from atomistic display to coarse surfaces."},params:()=>u,apply(G,V,U){var N,k;const H=null===(k=null===(N=A.so.resolveAndCheck(U.state.data,G))||void 0===N?void 0:N.obj)||void 0===k?void 0:k.data;if(!H)return{};const $=U.config.get(c.AB.Structure.SizeThresholds)||t.oE.DefaultSizeThresholds,J=t.oE.getSize(H,$),W=H.polymerResidueCount/H.polymerGapCount;switch(J){case t.oE.Size.Gigantic:case t.oE.Size.Huge:return R.apply(G,V,U);case t.oE.Size.Large:return f.apply(G,V,U);case t.oE.Size.Medium:if(W>3)return S.apply(G,V,U);case t.oE.Size.Small:return p.apply(G,{...V,showCarbohydrateSymbol:!0},U);default:(0,I.dr)(J)}}}),h=m({id:"preset-structure-representation-empty",display:{name:"Empty",description:"Removes all existing representations."},apply:(G,V,U)=>(0,e.A)(function*(){return{}})()}),a="Basic",S=m({id:"preset-structure-representation-polymer-and-ligand",display:{name:"Polymer & Ligand",group:a,description:"Shows polymers as Cartoon, ligands as Ball & Stick, carbohydrates as 3D-SNFG and water molecules semi-transparent."},params:()=>u,apply:(G,V,U)=>(0,e.A)(function*(){var N,k,H,$,J,W,te,de,ye,j;const Z=A.so.resolveAndCheck(U.state.data,G);if(!Z)return{};const q={polymer:yield L(U,Z,"polymer"),ligand:yield L(U,Z,"ligand"),nonStandard:yield L(U,Z,"non-standard"),branched:yield L(U,Z,"branched",{label:"Carbohydrate"}),water:yield L(U,Z,"water"),ion:yield L(U,Z,"ion"),lipid:yield L(U,Z,"lipid"),coarse:yield L(U,Z,"coarse")},Y=Z.obj.data,ee={sizeFactor:Y.isCoarseGrained?.8:.2},g=((null===(H=null===(k=null===(N=q.water)||void 0===N?void 0:N.obj)||void 0===k?void 0:k.data)||void 0===H?void 0:H.elementCount)||0)>5e4?"line":"ball-and-stick",_e=((null===(W=null===(J=null===($=q.lipid)||void 0===$?void 0:$.obj)||void 0===J?void 0:J.data)||void 0===W?void 0:W.elementCount)||0)>2e4?"line":"ball-and-stick",{update:xe,builder:le,typeParams:Ae,color:Be,symmetryColor:Ce,symmetryColorParams:Re,globalColorParams:ke,ballAndStickColor:we}=d(U,V,Y),Oe={polymer:le.buildRepresentation(xe,q.polymer,{type:"cartoon",typeParams:{...Ae,...ee},color:Ce,colorParams:Re},{tag:"polymer"}),ligand:le.buildRepresentation(xe,q.ligand,{type:"ball-and-stick",typeParams:Ae,color:Be,colorParams:we},{tag:"ligand"}),nonStandard:le.buildRepresentation(xe,q.nonStandard,{type:"ball-and-stick",typeParams:Ae,color:Be,colorParams:we},{tag:"non-standard"}),branchedBallAndStick:le.buildRepresentation(xe,q.branched,{type:"ball-and-stick",typeParams:{...Ae,alpha:.3},color:Be,colorParams:we},{tag:"branched-ball-and-stick"}),branchedSnfg3d:le.buildRepresentation(xe,q.branched,{type:"carbohydrate",typeParams:Ae,color:Be,colorParams:ke},{tag:"branched-snfg-3d"}),water:le.buildRepresentation(xe,q.water,{type:g,typeParams:{...Ae,alpha:.6,visuals:"line"===g?["intra-bond","element-point"]:void 0},color:Be,colorParams:{carbonColor:{name:"element-symbol",params:{}},...ke}},{tag:"water"}),ion:le.buildRepresentation(xe,q.ion,{type:"ball-and-stick",typeParams:Ae,color:Be,colorParams:{carbonColor:{name:"element-symbol",params:{}},...ke}},{tag:"ion"}),lipid:le.buildRepresentation(xe,q.lipid,{type:_e,typeParams:{...Ae,alpha:.6,visuals:"line"===_e?["intra-bond"]:void 0},color:Be,colorParams:{carbonColor:{name:"element-symbol",params:{}},...ke}},{tag:"lipid"}),coarse:le.buildRepresentation(xe,q.coarse,{type:"spacefill",typeParams:Ae,color:Be||"chain-id",colorParams:ke},{tag:"coarse"})};return yield xe.commit({revertOnError:!1}),yield s(U,Y,null===(de=null===(te=V.theme)||void 0===te?void 0:te.focus)||void 0===de?void 0:de.name,null===(j=null===(ye=V.theme)||void 0===ye?void 0:ye.focus)||void 0===j?void 0:j.params),{components:q,representations:Oe}})()}),D=m({id:"preset-structure-representation-protein-and-nucleic",display:{name:"Protein & Nucleic",group:a,description:"Shows proteins as Cartoon and RNA/DNA as Gaussian Surface."},params:()=>u,apply:(G,V,U)=>(0,e.A)(function*(){var N,k,H,$;const J=A.so.resolveAndCheck(U.state.data,G);if(!J)return{};const W={protein:yield w(U,J,"protein"),nucleic:yield w(U,J,"nucleic")},te=J.obj.data,de={sizeFactor:te.isCoarseGrained?.8:.2},ye={radiusOffset:te.isCoarseGrained?2:0,smoothness:te.isCoarseGrained?1:1.5},{update:j,builder:Z,typeParams:q,symmetryColor:Y,symmetryColorParams:ee}=d(U,V,te),g={protein:Z.buildRepresentation(j,W.protein,{type:"cartoon",typeParams:{...q,...de},color:Y,colorParams:ee},{tag:"protein"}),nucleic:Z.buildRepresentation(j,W.nucleic,{type:"gaussian-surface",typeParams:{...q,...ye},color:Y,colorParams:ee},{tag:"nucleic"})};return yield j.commit({revertOnError:!0}),yield s(U,te,null===(k=null===(N=V.theme)||void 0===N?void 0:N.focus)||void 0===k?void 0:k.name,null===($=null===(H=V.theme)||void 0===H?void 0:H.focus)||void 0===$?void 0:$.params),{components:W,representations:g}})()}),R=m({id:"preset-structure-representation-coarse-surface",display:{name:"Coarse Surface",group:a,description:"Shows polymers and lipids as coarse Gaussian Surface."},params:()=>u,apply:(G,V,U)=>(0,e.A)(function*(){var N,k,H,$;const J=A.so.resolveAndCheck(U.state.data,G);if(!J)return{};const W={polymer:yield L(U,J,"polymer"),lipid:yield L(U,J,"lipid")},te=J.obj.data,de=U.config.get(c.AB.Structure.SizeThresholds)||t.oE.DefaultSizeThresholds,ye=t.oE.getSize(te,de),j=Object.create(null);ye===t.oE.Size.Gigantic?Object.assign(j,{traceOnly:!te.isCoarseGrained,radiusOffset:2,smoothness:1,visuals:["structure-gaussian-surface-mesh"]}):ye===t.oE.Size.Huge?Object.assign(j,{radiusOffset:te.isCoarseGrained?2:0,smoothness:1}):te.isCoarseGrained&&Object.assign(j,{radiusOffset:2,smoothness:1});const{update:Z,builder:q,typeParams:Y,symmetryColor:ee,symmetryColorParams:g}=d(U,V,te),_e={polymer:q.buildRepresentation(Z,W.polymer,{type:"gaussian-surface",typeParams:{...Y,...j},color:ee,colorParams:g},{tag:"polymer"}),lipid:q.buildRepresentation(Z,W.lipid,{type:"gaussian-surface",typeParams:{...Y,...j},color:ee,colorParams:g},{tag:"lipid"})};return yield Z.commit({revertOnError:!0}),yield s(U,te,null===(k=null===(N=V.theme)||void 0===N?void 0:N.focus)||void 0===k?void 0:k.name,null===($=null===(H=V.theme)||void 0===H?void 0:H.focus)||void 0===$?void 0:$.params),{components:W,representations:_e}})()}),f=m({id:"preset-structure-representation-polymer-cartoon",display:{name:"Polymer Cartoon",group:a,description:"Shows polymers as Cartoon."},params:()=>u,apply:(G,V,U)=>(0,e.A)(function*(){var N,k,H,$;const J=A.so.resolveAndCheck(U.state.data,G);if(!J)return{};const W={polymer:yield L(U,J,"polymer")},te=J.obj.data,de={sizeFactor:te.isCoarseGrained?.8:.2},{update:ye,builder:j,typeParams:Z,symmetryColor:q,symmetryColorParams:Y}=d(U,V,te),ee={polymer:j.buildRepresentation(ye,W.polymer,{type:"cartoon",typeParams:{...Z,...de},color:q,colorParams:Y},{tag:"polymer"})};return yield ye.commit({revertOnError:!0}),yield s(U,te,null===(k=null===(N=V.theme)||void 0===N?void 0:N.focus)||void 0===k?void 0:k.name,null===($=null===(H=V.theme)||void 0===H?void 0:H.focus)||void 0===$?void 0:$.params),{components:W,representations:ee}})()}),p=m({id:"preset-structure-representation-atomic-detail",display:{name:"Atomic Detail",group:a,description:"Shows everything in atomic detail with Ball & Stick."},params:()=>({...u,showCarbohydrateSymbol:o.t.Boolean(!1)}),apply:(G,V,U)=>(0,e.A)(function*(){var N,k,H,$,J,W;const te=A.so.resolveAndCheck(U.state.data,G);if(!te)return{};const de={all:yield L(U,te,"all"),branched:void 0},ye=te.obj.data,j=ye.elementCount>1e5,Z=ye.atomicResidueCount&&ye.elementCount>1e3&&ye.atomicResidueCount/ye.elementCount<3,q=ye.models[0],Y=!!_.z.Provider.get(q)||M.A.isExhaustive(q);let ee="ball-and-stick";ye.isCoarseGrained?ee=ye.elementCount>1e6?"point":"spacefill":Z&&!Y?ee="spacefill":j&&(ee="line");const g=V.showCarbohydrateSymbol&&!j&&!Z;g&&Object.assign(de,{branched:yield L(U,te,"branched",{label:"Carbohydrate"})});const{update:_e,builder:xe,typeParams:le,color:Ae,ballAndStickColor:Be,globalColorParams:Ce}=d(U,V,ye),Re=Z&&!Y?{carbonColor:{name:"element-symbol",params:{}},...Ce}:Be,ke={all:xe.buildRepresentation(_e,de.all,{type:ee,typeParams:le,color:Ae,colorParams:Re},{tag:"all"})};return g&&Object.assign(ke,{snfg3d:xe.buildRepresentation(_e,de.branched,{type:"carbohydrate",typeParams:{...le,alpha:.4,visuals:["carbohydrate-symbol"]},color:Ae,colorParams:Ce},{tag:"snfg-3d"})}),yield _e.commit({revertOnError:!0}),yield s(U,ye,null!==(H=null===(k=null===(N=V.theme)||void 0===N?void 0:N.focus)||void 0===k?void 0:k.name)&&void 0!==H?H:Ae,null!==(W=null===(J=null===($=V.theme)||void 0===$?void 0:$.focus)||void 0===J?void 0:J.params)&&void 0!==W?W:Re),{components:de,representations:ke}})()}),E=m({id:"preset-structure-representation-illustrative",display:{name:"Illustrative",group:"Miscellaneous",description:"..."},params:()=>({...u,showCarbohydrateSymbol:o.t.Boolean(!1)}),apply:(G,V,U)=>(0,e.A)(function*(){var N,k,H,$,J;const W=A.so.resolveAndCheck(U.state.data,G);if(!W)return{};const te={all:yield L(U,W,"all"),branched:void 0},de=W.obj.data,{update:ye,builder:j,typeParams:Z,color:q}=d(U,V,de),Y={all:j.buildRepresentation(ye,te.all,{type:"spacefill",typeParams:{...Z,ignoreLight:!0},color:"illustrative"},{tag:"all"})};return yield ye.commit({revertOnError:!0}),yield s(U,de,null!==(H=null===(k=null===(N=V.theme)||void 0===N?void 0:N.focus)||void 0===k?void 0:k.name)&&void 0!==H?H:q,null===(J=null===($=V.theme)||void 0===$?void 0:$.focus)||void 0===J?void 0:J.params),{components:te,representations:Y}})()}),T=m({id:"preset-structure-representation-auto-lod",display:{name:"Automatic Detail",group:"Miscellaneous",description:"Shows more (or less) detailed representations automatically based on camera distance."},params:()=>u,apply:(G,V,U)=>(0,e.A)(function*(){var N,k,H,$;const J=A.so.resolveAndCheck(U.state.data,G);if(!J)return{};const W={all:yield L(U,J,"all")},te=J.obj.data,de={sizeFactor:te.isCoarseGrained?.8:.2},{update:ye,builder:j,typeParams:Z,color:q,symmetryColor:Y,symmetryColorParams:ee,ballAndStickColor:g}=d(U,V,te),_e={gaussianSurface:j.buildRepresentation(ye,W.all,{type:"gaussian-surface",typeParams:{...Z,lod:l.e.create(30,1e7,100)},color:Y,colorParams:ee},{tag:"gaussian-surface"}),cartoon:j.buildRepresentation(ye,W.all,{type:"cartoon",typeParams:{...Z,...de,lod:l.e.create(-20,300,100)},color:Y,colorParams:ee},{tag:"cartoon"}),ballAndStick:j.buildRepresentation(ye,W.all,{type:"ball-and-stick",typeParams:{...Z,lod:l.e.create(-20,40,20)},color:q,colorParams:g},{tag:"ball-and-stick"})};return yield ye.commit({revertOnError:!1}),yield s(U,te,null===(k=null===(N=V.theme)||void 0===N?void 0:N.focus)||void 0===k?void 0:k.name,null===($=null===(H=V.theme)||void 0===H?void 0:H.focus)||void 0===$?void 0:$.params),{components:W,representations:_e}})()});function L(G,V,U,N){return G.builders.structure.tryCreateComponentStatic(V,U,N)}function w(G,V,U,N){return G.builders.structure.tryCreateComponentFromSelection(V,y.Ou[U],`selection-${U}`,N)}const Q={empty:h,auto:C,"atomic-detail":p,"polymer-cartoon":f,"polymer-and-ligand":S,"protein-and-nucleic":D,"coarse-surface":R,illustrative:E,"auto-lod":T}},3182:(tn,Ue,n)=>{"use strict";n.d(Ue,{N:()=>t,e:()=>A});var e=n(9359),o=n(8956),r=n(6115);class t{constructor(){this.subs=void 0}subscribe(c,i){typeof this.subs>"u"&&(this.subs=[]);let v=c.subscribe(i);return this.subs.push(v),{unsubscribe:()=>{v&&this.subs&&(0,r.K3)(this.subs,v)&&(v.unsubscribe(),v=void 0)}}}get ev(){return this._ev||(this._ev=o.V.create())}dispose(){if(this._ev&&this._ev.dispose(),this.subs){for(const c of this.subs)c.unsubscribe();this.subs=void 0}}}class A extends t{updateState(...c){const i=this.state,v=(0,e.Wv)(i,c);return v!==i&&(this._state=v,!0)}get state(){return this._state}constructor(c){super(),this._state=c}}},1169:(tn,Ue,n)=>{"use strict";n.d(Ue,{VE:()=>i,jM:()=>r});var e=n(1073),o=n(1425);const r="Coordinates",i=[["dcd",(0,o.N)({label:"DCD",description:"DCD",category:r,binaryExtensions:["dcd"],parse:(v,O)=>v.state.data.build().to(O).apply(e.f.Model.CoordinatesFromDcd).commit()})],["xtc",(0,o.N)({label:"XTC",description:"XTC",category:r,binaryExtensions:["xtc"],parse:(v,O)=>v.state.data.build().to(O).apply(e.f.Model.CoordinatesFromXtc).commit()})],["trr",(0,o.N)({label:"TRR",description:"TRR",category:r,binaryExtensions:["trr"],parse:(v,O)=>v.state.data.build().to(O).apply(e.f.Model.CoordinatesFromTrr).commit()})],["nctraj",(0,o.N)({label:"NCTRAJ",description:"NCTRAJ",category:r,binaryExtensions:["nc","nctraj"],parse:(v,O)=>v.state.data.build().to(O).apply(e.f.Model.CoordinatesFromNctraj).commit()})]]},1425:(tn,Ue,n)=>{"use strict";n.d(Ue,{N:()=>o,v:()=>r});var e=n(5295);function o(t){return t}function r(t,A){if("bcif"===t.ext)try{const{encoder:y}=(0,e.J)(A);if(y.startsWith("VolumeServer"))return"dscif";if(y.startsWith("volseg-volume-server"))return"segcif"}catch(y){console.error(y)}else if("cif"===t.ext){const y=A;if(y.startsWith("data_SERVER\n#\n_density_server_result"))return"dscif";if(y.startsWith("data_SERVER\n#\ndata_SEGMENTATION_DATA"))return"segcif";if(y.includes("atom_site_fract_x")||y.includes("atom_site.fract_x"))return"coreCif"}return-1}},2945:(tn,Ue,n)=>{"use strict";n.d(Ue,{PO:()=>i,nE:()=>t});var e=n(467),o=n(1073),r=n(1425);const t="Topology",A=(0,r.N)({label:"PSF",description:"PSF",category:t,stringExtensions:["psf"],parse:(v=(0,e.A)(function*(O,b){const _=O.state.data.build().to(b).apply(o.f.Data.ParsePsf,{},{state:{isGhost:!0}}),M=_.apply(o.f.Model.TopologyFromPsf);return yield _.commit(),{format:_.selector,topology:M.selector}}),function(b,_){return v.apply(this,arguments)})}),y=(0,r.N)({label:"PRMTOP",description:"PRMTOP",category:t,stringExtensions:["prmtop","parm7"],parse:function(){var v=(0,e.A)(function*(O,b){const _=O.state.data.build().to(b).apply(o.f.Data.ParsePrmtop,{},{state:{isGhost:!0}}),M=_.apply(o.f.Model.TopologyFromPrmtop);return yield _.commit(),{format:_.selector,topology:M.selector}});return function(b,_){return v.apply(this,arguments)}}()}),c=(0,r.N)({label:"TOP",description:"TOP",category:t,stringExtensions:["top"],parse:function(){var v=(0,e.A)(function*(O,b){const _=O.state.data.build().to(b).apply(o.f.Data.ParseTop,{},{state:{isGhost:!0}}),M=_.apply(o.f.Model.TopologyFromTop);return yield _.commit(),{format:_.selector,topology:M.selector}});return function(b,_){return v.apply(this,arguments)}}()}),i=[["psf",A],["prmtop",y],["top",c]];var v},5953:(tn,Ue,n)=>{"use strict";n.d(Ue,{HQ:()=>m,RB:()=>t});var e=n(467),o=n(1073),r=n(1425);const t="Trajectory";function A(u,d){return u.builders.structure.hierarchy.applyPreset(d.trajectory,"default")}const y={label:"mmCIF",description:"mmCIF",category:t,stringExtensions:["cif","mmcif","mcif"],binaryExtensions:["bcif"],isApplicable:(u,d)=>"mmcif"===u.ext||"mcif"===u.ext||("cif"===u.ext||"bcif"===u.ext)&&-1===(0,r.v)(u,d),parse:(u=(0,e.A)(function*(d,s,C){var h,a;const D=d.state.data.build().to(s).apply(o.f.Data.ParseCif,void 0,{state:{isGhost:!0}}),R=yield D.apply(o.f.Model.TrajectoryFromMmCif,void 0,{tags:C?.trajectoryTags}).commit({revertOnError:!0});return((null===(a=null===(h=D.selector.cell)||void 0===h?void 0:h.obj)||void 0===a?void 0:a.data.blocks.length)||0)>1&&d.state.data.updateCellState(D.ref,{isGhost:!1}),{trajectory:R}}),function(s,C,h){return u.apply(this,arguments)}),visuals:A},c={label:"cifCore",description:"CIF Core",category:t,stringExtensions:["cif"],isApplicable:(u,d)=>"cif"===u.ext&&"coreCif"===(0,r.v)(u,d),parse:function(){var u=(0,e.A)(function*(d,s,C){var h,a;const D=d.state.data.build().to(s).apply(o.f.Data.ParseCif,void 0,{state:{isGhost:!0}}),R=yield D.apply(o.f.Model.TrajectoryFromCifCore,void 0,{tags:C?.trajectoryTags}).commit({revertOnError:!0});return((null===(a=null===(h=D.selector.cell)||void 0===h?void 0:h.obj)||void 0===a?void 0:a.data.blocks.length)||0)>1&&d.state.data.updateCellState(D.ref,{isGhost:!1}),{trajectory:R}});return function(s,C,h){return u.apply(this,arguments)}}(),visuals:A};var u;function i(u,d){return function(){var s=(0,e.A)(function*(C,h,a){return{trajectory:yield C.state.data.build().to(h).apply(u,d,{tags:a?.trajectoryTags}).commit({revertOnError:!0})}});return function(C,h,a){return s.apply(this,arguments)}}()}const v={label:"PDB",description:"PDB",category:t,stringExtensions:["pdb","ent"],parse:i(o.f.Model.TrajectoryFromPDB),visuals:A},O={label:"PDBQT",description:"PDBQT",category:t,stringExtensions:["pdbqt"],parse:i(o.f.Model.TrajectoryFromPDB,{isPdbqt:!0}),visuals:A},b={label:"XYZ",description:"XYZ",category:t,stringExtensions:["xyz"],parse:i(o.f.Model.TrajectoryFromXYZ),visuals:A},m=[["mmcif",y],["cifCore",c],["pdb",v],["pdbqt",O],["gro",{label:"GRO",description:"GRO",category:t,stringExtensions:["gro"],binaryExtensions:[],parse:i(o.f.Model.TrajectoryFromGRO),visuals:A}],["xyz",b],["mol",{label:"MOL",description:"MOL",category:t,stringExtensions:["mol"],parse:i(o.f.Model.TrajectoryFromMOL),visuals:A}],["sdf",{label:"SDF",description:"SDF",category:t,stringExtensions:["sdf","sd"],parse:i(o.f.Model.TrajectoryFromSDF),visuals:A}],["mol2",{label:"MOL2",description:"MOL2",category:t,stringExtensions:["mol2"],parse:i(o.f.Model.TrajectoryFromMOL2),visuals:A}]]},1295:(tn,Ue,n)=>{"use strict";n.d(Ue,{z:()=>_});var e=n(467),o=n(9136),r=n(7785),t=n(5384),A=n(8277),y=n(4369),c=n(9032),i=n(381),v=n(9651),O=n(1372);const b={dynamicBonds:A.t.Optional(A.t.Boolean(!1,{description:"Ensure bonds are recalculated upon model changes. Also enables calculation of inter-unit bonds in water molecules and ions."}))};var _;!function(M){function m(f,p,E,T,L){return u.apply(this,arguments)}function u(){return(u=(0,e.A)(function*(f,p,E,T,L){let w;const Q=v.i.Provider.get(E);!T&&Q&&0!==Q.assemblies.length&&(T=Q.assemblies[0].id),Q&&0!==Q.assemblies.length?(w=c.v.findAssembly(E,T||""),w||f.log.warn(`Model '${E.entryId}' has no assembly called '${T}', returning model structure.`)):f.log.warn(`Model '${E.entryId}' has no assembly, returning model structure.`);const G=o.oE.ofModel(E,L);if(!w){const N={label:"Model",description:o.oE.elementDescription(G)};return new i.O.Molecule.Structure(G,N)}T=w.id;const V=yield o.us.buildAssembly(G,T).runInContext(p),U={label:`Assembly ${T}`,description:o.oE.elementDescription(V)};return new i.O.Molecule.Structure(V,U)})).apply(this,arguments)}function s(){return(s=(0,e.A)(function*(f,p,E,T,L){const w=o.oE.ofModel(p,L),Q=yield o.us.buildSymmetryRange(w,E,T).runInContext(f),G={label:`Symmetry [${E}] to [${T}]`,description:o.oE.elementDescription(Q)};return new i.O.Molecule.Structure(Q,G)})).apply(this,arguments)}function h(){return(h=(0,e.A)(function*(f,p,E,T){const L=o.oE.ofModel(p,T),w=yield o.us.builderSymmetryMates(L,E).runInContext(f),Q={label:"Symmetry Mates",description:o.oE.elementDescription(w)};return new i.O.Molecule.Structure(w,Q)})).apply(this,arguments)}function S(){return(S=(0,e.A)(function*(f,p,E,T,L){const w=o.oE.ofModel(p,L),Q=yield o.us.buildSymmetryAssembly(w,E,T).runInContext(f),G={label:"Symmetry Assembly",description:o.oE.elementDescription(Q)};return new i.O.Molecule.Structure(Q,G)})).apply(this,arguments)}function R(){return R=(0,e.A)(function*(f,p,E,T){const L=T?.params,w=v.i.Provider.get(E);if(!w||!T||"model"===T.name){const Q=o.oE.ofModel(E,L);return new i.O.Molecule.Structure(Q,{label:"Model",description:o.oE.elementDescription(Q)})}if("auto"===T.name){if(0===w.assemblies.length){const Q=o.oE.ofModel(E,L);return new i.O.Molecule.Structure(Q,{label:"Model",description:o.oE.elementDescription(Q)})}return m(f,p,E,void 0,L)}return"assembly"===T.name?m(f,p,E,T.params.id,L):"symmetry"===T.name?function d(f,p,E,T,L){return s.apply(this,arguments)}(p,E,T.params.ijkMin,T.params.ijkMax,L):"symmetry-mates"===T.name?function C(f,p,E,T){return h.apply(this,arguments)}(p,E,T.params.radius,L):"symmetry-assembly"===T.name?function a(f,p,E,T,L){return S.apply(this,arguments)}(p,E,T.params.generators,w,L):void(0,O.dr)(T)}),R.apply(this,arguments)}M.getParams=function I(f,p){const E=f&&v.i.Provider.get(f),T=E?E.assemblies.map(U=>[U.id,`${U.id}: ${(0,r.Mk)(U.details)}`]):[],L=!E||!t.O8.isZero(E.spacegroup.cell),w=[];if(E){const{operators:U}=E.spacegroup;for(let N=0,k=U.length;N{Q.push([U.id,U.id===U.auth_id?U.id:`${U.id} [auth ${U.auth_id}]`])});const G={auto:A.t.Group(b),model:A.t.Group(b),assembly:A.t.Group({id:A.t.Optional(f?A.t.Select(T.length?T[0][0]:"",T,{label:"Asm Id",description:"Assembly Id"}):A.t.Text("",{label:"Asm Id",description:"Assembly Id (use empty for the 1st assembly)"})),...b},{isFlat:!0}),"symmetry-mates":A.t.Group({radius:A.t.Numeric(5,{min:0,max:50,step:1}),...b},{isFlat:!0}),symmetry:A.t.Group({ijkMin:A.t.Vec3(y.eB.create(-1,-1,-1),{step:1},{label:"Min IJK",fieldLabels:{x:"I",y:"J",z:"K"}}),ijkMax:A.t.Vec3(y.eB.create(1,1,1),{step:1},{label:"Max IJK",fieldLabels:{x:"I",y:"J",z:"K"}}),...b},{isFlat:!0}),"symmetry-assembly":A.t.Group({generators:A.t.ObjectList({operators:A.t.ObjectList({index:A.t.Select(0,w),shift:A.t.Vec3((0,y.eB)(),{step:1},{label:"IJK",fieldLabels:{x:"I",y:"J",z:"K"}})},U=>`${U.index+1}_${U.shift.map(N=>N+5).join("")}`,{defaultValue:[]}),asymIds:A.t.MultiSelect([],Q)},U=>`${U.asymIds.length} asym ids, ${U.operators.length} operators`,{defaultValue:[]}),...b},{isFlat:!0})},V=[];return"auto"===p&&V.push(["auto","Auto"]),V.push(["model","Model"]),T.length>0&&V.push(["assembly","Assembly"]),L&&(V.push(["symmetry-mates","Symmetry Mates"]),V.push(["symmetry","Symmetry (indices)"]),V.push(["symmetry-assembly","Symmetry (assembly)"])),{type:A.t.MappedStatic(p||"model",G,{options:V})}},M.canAutoUpdate=function l(f,p){return!("symmetry-assembly"===p.name||"symmetry"===p.name&&"symmetry"===f.name)},M.create=function D(f,p,E,T){return R.apply(this,arguments)}}(_||(_={}))},1893:(tn,Ue,n)=>{"use strict";n.d(Ue,{A8:()=>t,IZ:()=>A,eD:()=>y,pQ:()=>r});var e=n(9136),o=n(8277);function r(v,O,b={}){return"string"==typeof b.type||"string"==typeof b.color||"string"==typeof b.size?function c(v,O,b){const _=b.type&&v.representation.structure.registry.get(b.type)||v.representation.structure.registry.default.provider,M=b.color&&v.representation.structure.themes.colorThemeRegistry.get(b.color)||v.representation.structure.themes.colorThemeRegistry.get(_.defaultColorTheme.name),I=b.size&&v.representation.structure.themes.sizeThemeRegistry.get(b.size)||v.representation.structure.themes.sizeThemeRegistry.get(_.defaultSizeTheme.name);return i(v,O,{type:_,typeParams:b.typeParams,color:M,colorParams:b.colorParams,size:I,sizeParams:b.sizeParams})}(v,O||e.oE.Empty,b):i(v,O||e.oE.Empty,b)}function t(v,O){const{themes:b}=v.representation.structure;return O?b.colorThemeRegistry.getApplicableTypes({structure:O}):b.colorThemeRegistry.types}function A(v,O,b,_,M){const{registry:I,themes:l}=v.representation.structure,m=I.get(b||I.default.name),u=l.colorThemeRegistry.get(_||m.defaultColorTheme.name),d=o.t.getDefaultValues(u.getParams({structure:O||e.oE.Empty}));return u.name===m.defaultColorTheme.name&&Object.assign(d,m.defaultColorTheme.props),{name:u.name,params:Object.assign(d,M)}}function y(v,O,b,_,M){const{registry:I,themes:l}=v.representation.structure,m=I.get(b||I.default.name),u=l.sizeThemeRegistry.get(_||m.defaultSizeTheme.name),d=o.t.getDefaultValues(u.getParams({structure:O||e.oE.Empty}));return u.name===m.defaultSizeTheme.name&&Object.assign(d,m.defaultSizeTheme.props),{name:u.name,params:Object.assign(d,M)}}function i(v,O,b={}){const{themes:_}=v.representation.structure,M={structure:O},I=b.type||v.representation.structure.registry.default.provider,l=o.t.getDefaultValues(I.getParams(_,O)),m=Object.assign(l,b.typeParams),u=b.color||_.colorThemeRegistry.get(I.defaultColorTheme.name),d=o.t.getDefaultValues(u.getParams(M));u.name===I.defaultColorTheme.name&&Object.assign(d,I.defaultColorTheme.props);const s=Object.assign(d,b.colorParams),C=b.size||_.sizeThemeRegistry.get(I.defaultSizeTheme.name),h=o.t.getDefaultValues(C.getParams(M));C.name===I.defaultSizeTheme.name&&Object.assign(h,I.defaultSizeTheme.props);const a=Object.assign(h,b.sizeParams);return{type:{name:I.name,params:m},colorTheme:{name:u.name,params:s},sizeTheme:{name:C.name,params:a}}}},9096:(tn,Ue,n)=>{"use strict";n.d(Ue,{Ag:()=>ke,ET:()=>b,HU:()=>Ce,Mt:()=>Re,Ou:()=>Oe,g7:()=>O,lL:()=>Se});var e=n(467),o=n(9136),r=n(2434),t=n(9767),A=n(7291),y=n(9986),i=(n(1073),n(7126)),v=n(8699),O=function(Ve){return Ve.Type="Type",Ve.Structure="Structure Property",Ve.Atom="Atom Property",Ve.Bond="Bond Property",Ve.Residue="Residue Property",Ve.AminoAcid="Amino Acid",Ve.NucleicBase="Nucleic Base",Ve.Manipulate="Manipulate Selection",Ve.Validation="Validation",Ve.Misc="Miscellaneous",Ve.Internal="Internal",Ve}(O||{});function b(Ve,Ne,K={}){var ne;let be;return{label:Ve,expression:Ne,description:K.description||"",category:null!==(ne=K.category)&&void 0!==ne?ne:O.Misc,isHidden:!!K.isHidden,priority:K.priority||0,referencesCurrent:!!K.referencesCurrent,get query(){return be||(be=(0,A.wE)(Ne)),be},ensureCustomProperties:K.ensureCustomProperties,getSelection:(Te,ie,ue)=>(0,e.A)(function*(){const re=Te.managers.structure.selection.getStructure(ue),ve=re?o.cv.Sequence(ue,[re]):o.cv.Empty(ue);return K.ensureCustomProperties&&(yield K.ensureCustomProperties({runtime:ie,assetManager:Te.managers.asset},ue)),be||(be=(0,A.wE)(Ne)),be(new o.cY(ue,{currentSelection:ve}))})()}}const _=b("All",t.J.struct.generator.all(),{category:"",priority:1e3}),M=b("Current Selection",t.J.internal.generator.current(),{category:"",referencesCurrent:!0}),I=b("Polymer",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.logic.and([t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),t.J.core.str.match([t.J.re("(polypeptide|cyclic-pseudo-peptide|peptide-like|nucleotide|peptide nucleic acid)","i"),t.J.ammp("entitySubtype")])])})]),{category:O.Type}),l=b("Trace",t.J.struct.modifier.union([t.J.struct.combinator.merge([t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),"chain-test":t.J.core.set.has([t.J.set("sphere","gaussian"),t.J.ammp("objectPrimitive")])})]),t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"atom-test":t.J.core.set.has([t.J.set("CA","P"),t.J.ammp("label_atom_id")])})])])]),{category:O.Structure}),m=t.J.core.logic.and([t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),t.J.core.str.match([t.J.re("(polypeptide|cyclic-pseudo-peptide|peptide-like)","i"),t.J.ammp("entitySubtype")])]),u=t.J.core.logic.and([t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),t.J.core.str.match([t.J.re("(nucleotide|peptide nucleic acid)","i"),t.J.ammp("entitySubtype")])]),d=t.J.core.str.match([t.J.re("non-polymer|(amino|carboxy) terminus|peptide-like","i"),t.J.ammp("chemCompType")]),s=b("Backbone",t.J.struct.modifier.union([t.J.struct.combinator.merge([t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":m,"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.logic.not([d]),"atom-test":t.J.core.set.has([t.J.set(...y.M.toArray(r.DB)),t.J.ammp("label_atom_id")])})]),t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":u,"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.logic.not([d]),"atom-test":t.J.core.set.has([t.J.set(...y.M.toArray(r.HA)),t.J.ammp("label_atom_id")])})])])]),{category:O.Structure}),C=b("Sidechain",t.J.struct.modifier.union([t.J.struct.combinator.merge([t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":m,"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.logic.not([d]),"atom-test":t.J.core.logic.or([t.J.core.logic.not([t.J.core.set.has([t.J.set(...y.M.toArray(r.DB)),t.J.ammp("label_atom_id")])])])})]),t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":u,"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.logic.not([d]),"atom-test":t.J.core.logic.or([t.J.core.logic.not([t.J.core.set.has([t.J.set(...y.M.toArray(r.HA)),t.J.ammp("label_atom_id")])])])})])])]),{category:O.Structure}),h=b("Sidechain with Trace",t.J.struct.modifier.union([t.J.struct.combinator.merge([t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":m,"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.logic.not([d]),"atom-test":t.J.core.logic.or([t.J.core.logic.not([t.J.core.set.has([t.J.set(...y.M.toArray(r.DB)),t.J.ammp("label_atom_id")])]),t.J.core.rel.eq([t.J.ammp("label_atom_id"),"CA"]),t.J.core.logic.and([t.J.core.rel.eq([t.J.ammp("auth_comp_id"),"PRO"]),t.J.core.rel.eq([t.J.ammp("label_atom_id"),"N"])])])})]),t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":u,"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.logic.not([d]),"atom-test":t.J.core.logic.or([t.J.core.logic.not([t.J.core.set.has([t.J.set(...y.M.toArray(r.HA)),t.J.ammp("label_atom_id")])]),t.J.core.rel.eq([t.J.ammp("label_atom_id"),"P"])])})])])]),{category:O.Structure}),a=b("Protein",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":m})]),{category:O.Type}),S=b("Nucleic",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":u})]),{category:O.Type}),D=b("Helix",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":m,"residue-test":t.J.core.flags.hasAny([t.J.ammp("secondaryStructureFlags"),t.J.core.type.bitflags([2])])})]),{category:O.Structure,ensureCustomProperties:(Ve,Ne)=>v.v.attach(Ve,Ne)}),R=b("Beta Strand/Sheet",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":m,"residue-test":t.J.core.flags.hasAny([t.J.ammp("secondaryStructureFlags"),t.J.core.type.bitflags([4])])})]),{category:O.Structure,ensureCustomProperties:(Ve,Ne)=>v.v.attach(Ve,Ne)}),f=b("Water",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entityType"),"water"])})]),{category:O.Type}),p=b("Ion",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entitySubtype"),"ion"])})]),{category:O.Type}),E=b("Lipid",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entitySubtype"),"lipid"])})]),{category:O.Type}),T=b("Carbohydrate",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.logic.or([t.J.core.rel.eq([t.J.ammp("entityType"),"branched"]),t.J.core.logic.and([t.J.core.rel.eq([t.J.ammp("entityType"),"non-polymer"]),t.J.core.str.match([t.J.re("oligosaccharide","i"),t.J.ammp("entitySubtype")])])])})]),{category:O.Type}),L=b("Carbohydrate with Connected",t.J.struct.modifier.union([t.J.struct.modifier.includeConnected({0:T.expression,"layer-count":1,"as-whole-residues":!0})]),{category:O.Internal,isHidden:!0}),w=b("Connected to Carbohydrate",t.J.struct.modifier.union([t.J.struct.modifier.exceptBy({0:L.expression,by:T.expression})]),{category:O.Internal,isHidden:!0}),Q=b("Ligand",t.J.struct.modifier.union([t.J.struct.modifier.exceptBy({0:t.J.struct.modifier.union([t.J.struct.combinator.merge([t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.logic.and([t.J.core.logic.or([t.J.core.rel.eq([t.J.ammp("entityType"),"non-polymer"]),t.J.core.rel.neq([t.J.ammp("entityPrdId"),""])]),t.J.core.logic.not([t.J.core.str.match([t.J.re("(oligosaccharide|lipid|ion)","i"),t.J.ammp("entitySubtype")])])]),"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.logic.not([t.J.core.str.match([t.J.re("saccharide","i"),t.J.ammp("chemCompType")])])})]),t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":d})])])]),by:t.J.struct.combinator.merge([t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.set.has([t.J.set(...y.M.toArray(r.px)),t.J.ammp("label_comp_id")])})]),t.J.struct.generator.atomGroups({"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.core.set.has([t.J.set(...y.M.toArray(r.K5)),t.J.ammp("label_comp_id")])})])})]),{category:O.Type}),G=b("Ligand with Connected",t.J.struct.modifier.union([t.J.struct.modifier.exceptBy({0:t.J.struct.modifier.union([t.J.struct.modifier.includeConnected({0:Q.expression,"layer-count":1,"as-whole-residues":!0,"bond-test":t.J.core.flags.hasAny([t.J.struct.bondProperty.flags(),t.J.core.type.bitflags([3])])})]),by:T.expression})]),{category:O.Internal,isHidden:!0}),V=b("Connected to Ligand",t.J.struct.modifier.union([t.J.struct.modifier.exceptBy({0:G.expression,by:Q.expression})]),{category:O.Internal,isHidden:!0}),U=b("Connected to Ligand or Carbohydrate",t.J.struct.modifier.union([t.J.struct.combinator.merge([w.expression,V.expression])]),{category:O.Internal,isHidden:!0}),N=b("Disulfide Bridges",t.J.struct.modifier.union([t.J.struct.combinator.merge([t.J.struct.modifier.union([t.J.struct.modifier.wholeResidues([t.J.struct.filter.isConnectedTo({0:t.J.struct.generator.atomGroups({"residue-test":t.J.core.set.has([t.J.set("CYS"),t.J.ammp("auth_comp_id")]),"atom-test":t.J.core.set.has([t.J.set("SG"),t.J.ammp("label_atom_id")])}),target:t.J.struct.generator.atomGroups({"residue-test":t.J.core.set.has([t.J.set("CYS"),t.J.ammp("auth_comp_id")]),"atom-test":t.J.core.set.has([t.J.set("SG"),t.J.ammp("label_atom_id")])}),"bond-test":!0})])]),t.J.struct.modifier.union([t.J.struct.modifier.wholeResidues([t.J.struct.modifier.union([t.J.struct.generator.bondedAtomicPairs({0:t.J.core.flags.hasAny([t.J.struct.bondProperty.flags(),t.J.core.type.bitflags([8])])})])])])])]),{category:O.Bond}),k=b("NOS Bridges",t.J.struct.modifier.union([t.J.struct.modifier.wholeResidues([t.J.struct.filter.isConnectedTo({0:t.J.struct.generator.atomGroups({"residue-test":t.J.core.set.has([t.J.set("CSO","LYS"),t.J.ammp("auth_comp_id")]),"atom-test":t.J.core.set.has([t.J.set("OD","NZ"),t.J.ammp("label_atom_id")])}),target:t.J.struct.generator.atomGroups({"residue-test":t.J.core.set.has([t.J.set("CSO","LYS"),t.J.ammp("auth_comp_id")]),"atom-test":t.J.core.set.has([t.J.set("OD","NZ"),t.J.ammp("label_atom_id")])}),"bond-test":!0})])]),{category:O.Bond}),H=b("Non-standard Residues in Polymers",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.rel.eq([t.J.ammp("entityType"),"polymer"]),"chain-test":t.J.core.rel.eq([t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":t.J.ammp("isNonStandard")})]),{category:O.Residue}),$=b("Coarse Elements",t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"chain-test":t.J.core.set.has([t.J.set("sphere","gaussian"),t.J.ammp("objectPrimitive")])})]),{category:O.Type}),J=b("Rings in Residues",t.J.struct.modifier.union([t.J.struct.generator.rings()]),{category:O.Residue}),W=b("Aromatic Rings in Residues",t.J.struct.modifier.union([t.J.struct.generator.rings({"only-aromatic":!0})]),{category:O.Residue}),te=b("Surrounding Residues (5 \u212b) of Selection",t.J.struct.modifier.union([t.J.struct.modifier.exceptBy({0:t.J.struct.modifier.includeSurroundings({0:t.J.internal.generator.current(),radius:5,"as-whole-residues":!0}),by:t.J.internal.generator.current()})]),{description:"Select residues within 5 \u212b of the current selection.",category:O.Manipulate,referencesCurrent:!0}),de=b("Surrounding Ligands (5 \u212b) of Selection",t.J.struct.modifier.union([t.J.struct.modifier.surroundingLigands({0:t.J.internal.generator.current(),radius:5,"include-water":!0})]),{description:"Select ligand components within 5 \u212b of the current selection.",category:O.Manipulate,referencesCurrent:!0}),ye=b("Surrounding Atoms (5 \u212b) of Selection",t.J.struct.modifier.union([t.J.struct.modifier.exceptBy({0:t.J.struct.modifier.includeSurroundings({0:t.J.internal.generator.current(),radius:5,"as-whole-residues":!1}),by:t.J.internal.generator.current()})]),{description:"Select atoms within 5 \u212b of the current selection.",category:O.Manipulate,referencesCurrent:!0}),j=b("Inverse / Complement of Selection",t.J.struct.modifier.union([t.J.struct.modifier.exceptBy({0:t.J.struct.generator.all(),by:t.J.internal.generator.current()})]),{description:"Select everything not in the current selection.",category:O.Manipulate,referencesCurrent:!0}),Z=b("Residues Covalently Bonded to Selection",t.J.struct.modifier.union([t.J.struct.modifier.includeConnected({0:t.J.internal.generator.current(),"layer-count":1,"as-whole-residues":!0})]),{description:"Select residues covalently bonded to current selection.",category:O.Manipulate,referencesCurrent:!0}),q=b("Covalently Bonded Component",t.J.struct.modifier.union([t.J.struct.modifier.includeConnected({0:t.J.internal.generator.current(),"fixed-point":!0})]),{description:"Select covalently bonded component based on current selection.",category:O.Manipulate,referencesCurrent:!0}),Y=b("Residues with Cov. or Metallic Bond to Selection",t.J.struct.modifier.union([t.J.struct.modifier.includeConnected({0:t.J.internal.generator.current(),"layer-count":1,"as-whole-residues":!0,"bond-test":t.J.core.flags.hasAny([t.J.struct.bondProperty.flags(),t.J.core.type.bitflags([3])])})]),{description:"Select residues with covalent or metallic bond to current selection.",category:O.Manipulate,referencesCurrent:!0}),ee=b("Whole Residues of Selection",t.J.struct.modifier.union([t.J.struct.modifier.wholeResidues({0:t.J.internal.generator.current()})]),{description:"Expand current selection to whole residues.",category:O.Manipulate,referencesCurrent:!0}),g=[[["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((Ve,Ne)=>Ve[1]Ne[1]?1:0),_e=[[["A","DA"],"Adenosine"],[["C","DC"],"Cytidine"],[["T","DT"],"Thymidine"],[["G","DG"],"Guanosine"],[["I","DI"],"Inosine"],[["U","DU"],"Uridine"],[["N","DN"],"Unknown"]].sort((Ve,Ne)=>Ve[1]Ne[1]?1:0);function xe([Ve,Ne],K,ne=0){const be=1!==Ve.length||Be.has(Ve[0])?`${Ne} (${Ve.join(", ")})`:`[${Ve[0]}] ${Ne}`;return b(be,t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"residue-test":t.J.core.set.has([t.J.set(...Ve),t.J.ammp("auth_comp_id")])})]),{category:K,priority:ne,description:be})}const Be=y.M.unionMany(r.Ke,r.XQ,r.DF,r.mw);function Ce(Ve){const Ne=new Set;for(const ne of Ve)ne.uniqueElementSymbols.forEach(be=>Ne.add(be));const K=[];return Ne.forEach(ne=>{K.push(function le([Ve,Ne],K,ne){const be=`${Ne} (${Ve.join(", ")})`;return b(be,t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"atom-test":t.J.core.set.has([t.J.set(...Ve),t.J.acp("elementSymbol")])})]),{category:K,priority:ne,description:be})}([[ne],i.Z6[ne]||ne],"Element Symbol",0))}),K}function Re(Ve){const Ne=new Map,K=new Set;for(const be of Ve){be.uniqueResidueNames.forEach(Te=>K.add(Te));for(const Te of be.models)be.uniqueResidueNames.forEach(ie=>{const ue=Te.properties.chemicalComponentMap.get(ie);ue&&Ne.set(ie,ue.name)})}const ne=[];return y.M.difference(K,Be).forEach(be=>{const Te=Ne.get(be)||be;ne.push(xe([[be],Te],"Ligand/Non-standard Residue",200))}),ne}function ke(Ve){const Ne=new Map,K=o.iZ.Location.create();for(const be of Ve){K.structure=be;for(const Te of be.unitSymmetryGroups){K.unit=Te.units[0],K.element=Te.elements[0];const ie=o.StructureProperties.entity.type(K);if("polymer"===ie||"branched"===ie){const ue=o.StructureProperties.entity.pdbx_description(K);Ne.set(ue.join(", "),ue)}}}const ne=[];return Ne.forEach((be,Te)=>{ne.push(function Ae([Ve,Ne],K,ne){const be=`${Ne}`;return b(`${Ne}`,t.J.struct.modifier.union([t.J.struct.generator.atomGroups({"entity-test":t.J.core.list.equal([t.J.list(...Ve),t.J.ammp("entityDescription")])})]),{category:K,priority:ne,description:be})}([be,Te],"Polymer/Carbohydrate Entities",300))}),ne}const Oe={all:_,current:M,polymer:I,trace:l,backbone:s,sidechain:C,sidechainWithTrace:h,protein:a,nucleic:S,helix:D,beta:R,water:f,ion:p,lipid:E,branched:T,branchedPlusConnected:L,branchedConnectedOnly:w,ligand:Q,ligandPlusConnected:G,ligandConnectedOnly:V,connectedOnly:U,disulfideBridges:N,nosBridges:k,nonStandardPolymer:H,coarse:$,ring:J,aromaticRing:W,surroundings:te,surroundingLigands:de,surroundingAtoms:ye,complement:j,covalentlyBonded:Z,covalentlyOrMetallicBonded:Y,covalentlyBondedComponent:q,wholeResidues:ee};class Se{add(Ne){this.list.push(Ne),this.options.push([Ne,Ne.label,Ne.category]),this.version+=1}remove(Ne){const K=this.list.indexOf(Ne);-1!==K&&(this.list.splice(K,1),this.options.splice(K,1),this.version+=1)}constructor(){this.list=[],this.options=[],this.version=1,this.list.push(...Object.values(Oe),...g.map(Ne=>xe(Ne,O.AminoAcid)),..._e.map(Ne=>xe(Ne,O.NucleicBase))),this.options.push(...this.list.map(Ne=>[Ne,Ne.label,Ne.category]))}}},3442:(tn,Ue,n)=>{"use strict";n.d(Ue,{aK:()=>r});var e=n(6853),o=n(8277);function r(v,O,b={}){return"string"==typeof b.type||"string"==typeof b.color||"string"==typeof b.size?function c(v,O,b){const _=b.type&&v.representation.volume.registry.get(b.type)||v.representation.volume.registry.default.provider,M=b.color&&v.representation.volume.themes.colorThemeRegistry.get(b.color)||v.representation.volume.themes.colorThemeRegistry.get(_.defaultColorTheme.name),I=b.size&&v.representation.volume.themes.sizeThemeRegistry.get(b.size)||v.representation.volume.themes.sizeThemeRegistry.get(_.defaultSizeTheme.name);return i(v,O,{type:_,typeParams:b.typeParams,color:M,colorParams:b.colorParams,size:I,sizeParams:b.sizeParams})}(v,O||e.f.One,b):i(v,O||e.f.One,b)}function i(v,O,b={}){const{themes:_}=v.representation.volume,M={volume:O},I=b.type||v.representation.volume.registry.default.provider,l=o.t.getDefaultValues(I.getParams(_,O)),m=Object.assign(l,b.typeParams),u=b.color||_.colorThemeRegistry.get(I.defaultColorTheme.name),d=o.t.getDefaultValues(u.getParams(M));u.name===I.defaultColorTheme.name&&Object.assign(d,I.defaultColorTheme.props);const s=Object.assign(d,b.colorParams),C=b.size||_.sizeThemeRegistry.get(I.defaultSizeTheme.name),h=o.t.getDefaultValues(C.getParams(M));C.name===I.defaultSizeTheme.name&&Object.assign(h,I.defaultSizeTheme.props);const a=Object.assign(h,b.sizeParams);return{type:{name:I.name,params:m},colorTheme:{name:u.name,params:s},sizeTheme:{name:C.name,params:a}}}},4986:(tn,Ue,n)=>{"use strict";n.d(Ue,{d:()=>v});var e=n(3246),o=n(9136),r=n(2443),t=n(6825),A=n(9359),y=n(8277),c=n(3182);class v extends c.e{get props(){return{...this.state.props}}setProps(b){const M={...this.state.props,...b};(0,A.bN)(this.props,M)||(this.updateState({props:M}),this.lociSelects.setProps(M),this.lociHighlights.setProps(M),this.events.propsUpdated.next(void 0))}dispose(){super.dispose(),this.lociSelects.dispose(),this.lociHighlights.dispose()}constructor(b,_={}){super({props:{...y.t.getDefaultValues(v.Params),..._}}),this.plugin=b,this._props=y.t.getDefaultValues(v.Params),this.events={propsUpdated:this.ev()},this.lociSelects=new v.LociSelectManager(b,this._props),this.lociHighlights=new v.LociHighlightManager(b,this._props)}}!function(O){O.Params={granularity:y.t.Select("residue",e.QN.GranularityOptions,{label:"Picking Level",description:"Controls if selections are expanded upon picking to whole residues, chains, structures, instances, or left as atoms and coarse elements"})};class b{setProps(l){Object.assign(this.props,l)}addProvider(l){this.providers.push(l)}removeProvider(l){this.providers=this.providers.filter(m=>m!==l)}normalizedLoci(l,m,u=!1){const{loci:d,repr:s}=l;return{loci:e.QN.normalize(d,m?this.props.granularity:void 0,u),repr:s}}mark(l,m,u=!1){if(!e.QN.isEmpty(l.loci))for(const d of this.providers)d(l,m,u)}dispose(){this.providers.length=0,this.sel.dispose()}constructor(l,m={}){this.ctx=l,this.providers=[],this.props=y.t.getDefaultValues(O.Params),this.sel=l.managers.structure.selection,this.setProps(m)}}O.LociMarkManager=b,O.LociHighlightManager=class _ extends b{constructor(){super(...arguments),this.prev=[],this.clearHighlights=(l=!1)=>{for(const m of this.prev)this.mark(m,t.xi.RemoveHighlight,l);this.prev.length=0}}isHighlighted(l){for(const m of this.prev)if(r.YL.Loci.areEqual(m,l))return!0;return!1}addHighlight(l){this.mark(l,t.xi.Highlight),this.prev.push(l)}highlight(l,m=!0){const u=this.normalizedLoci(l,m);this.isHighlighted(u)||this.addHighlight(u)}highlightOnly(l,m=!0){const u=this.normalizedLoci(l,m);this.isHighlighted(u)||(e.QN.isEmpty(u.loci)?this.clearHighlights():(this.clearHighlights(!0),this.addHighlight(u)))}highlightOnlyExtend(l,m=!0){const u=this.normalizedLoci(l,m);if(o.iZ.Loci.is(u.loci)){const d={loci:this.sel.tryGetRange(u.loci)||u.loci,repr:u.repr};this.isHighlighted(d)||(e.QN.isEmpty(d.loci)?this.clearHighlights():(this.clearHighlights(!0),this.addHighlight(d)))}}dispose(){super.dispose(),this.prev.length=0}},O.LociSelectManager=class M extends b{toggle(l,m=!0){if(e.QN.isEmpty(l.loci))return;const u=this.normalizedLoci(l,m,!0);o.iZ.Loci.is(u.loci)?this.toggleSel(u):super.mark(u,t.xi.Toggle)}toggleExtend(l,m=!0){if(e.QN.isEmpty(l.loci))return;const u=this.normalizedLoci(l,m,!0);if(o.iZ.Loci.is(u.loci)){const d=this.sel.tryGetRange(u.loci)||u.loci;this.toggleSel({loci:d,repr:u.repr})}}select(l,m=!0){const u=this.normalizedLoci(l,m,!0);o.iZ.Loci.is(u.loci)&&this.sel.modify("add",u.loci),this.mark(u,t.xi.Select)}selectJoin(l,m=!0){const u=this.normalizedLoci(l,m,!0);o.iZ.Loci.is(u.loci)&&this.sel.modify("intersect",u.loci),this.mark(u,t.xi.Select)}selectOnly(l,m=!0){const u=this.normalizedLoci(l,m,!0);o.iZ.Loci.is(u.loci)&&(this.mark({loci:o.oE.Loci(u.loci.structure),repr:u.repr},t.xi.Deselect),this.sel.modify("set",u.loci)),this.mark(u,t.xi.Select)}deselect(l,m=!0){const u=this.normalizedLoci(l,m,!0);o.iZ.Loci.is(u.loci)&&this.sel.modify("remove",u.loci),this.mark(u,t.xi.Deselect)}deselectAll(){this.sel.clear(),this.mark({loci:e.FE},t.xi.Deselect)}deselectAllOnEmpty(l){(0,e.$M)(l.loci)&&this.deselectAll()}mark(l,m){const{loci:u}=l;if(!e.QN.isEmpty(u))if(o.iZ.Loci.is(u)){const d=this.sel.getLoci(u.structure);super.mark({loci:o.oE.Loci(u.structure)},t.xi.Deselect,!e.QN.isEmpty(d)),super.mark({loci:d},t.xi.Select)}else super.mark(l,m)}toggleSel(l){this.sel.has(l.loci)?(this.sel.modify("remove",l.loci),this.mark(l,t.xi.Deselect)):(this.sel.modify("add",l.loci),this.mark(l,t.xi.Select))}}}(v||(v={}))},856:(tn,Ue,n)=>{"use strict";n.d(Ue,{g:()=>b});var e=n(467),o=n(39),r=n(9909),t=n(3182),A=n(275),y=n(6985),c=n(3188),i=n(9359),v=n(6101),O=n(6345);let b=(()=>{class _ extends t.e{getIndex(I){return this.state.entries.indexOf(I)}getEntry(I){if(I)return this.entryMap.get(I)}remove(I){const l=this.entryMap.get(I);l&&(l?.image&&this.plugin.managers.asset.delete(l.image),this.entryMap.delete(I),this.updateState({current:this.state.current===I?void 0:this.state.current,entries:this.state.entries.delete(this.getIndex(l))}),this.events.changed.next(void 0))}add(I){this.entryMap.set(I.snapshot.id,I),this.updateState({current:I.snapshot.id,entries:this.state.entries.push(I)}),this.events.changed.next(void 0)}replace(I,l,m){var u,d,s;const C=this.getEntry(I);if(!C)return;this.defaultSnapshotId=void 0,C?.image&&this.plugin.managers.asset.delete(C.image);const h=this.getIndex(C),a=_.Entry(l,{key:null!==(u=m?.key)&&void 0!==u?u:C.key,name:null!==(d=m?.name)&&void 0!==d?d:C.name,description:null!==(s=m?.description)&&void 0!==s?s:C.description,image:m?.image});this.entryMap.set(l.id,a),this.updateState({current:a.snapshot.id,entries:this.state.entries.set(h,a)}),this.events.changed.next(void 0)}move(I,l){const m=this.state.entries.size;if(m<2)return;const u=this.getEntry(I);if(!u)return;const d=this.getIndex(u);let s=(d+l)%m;s<0&&(s+=m);const C=this.state.entries.get(s),h=this.state.entries.asMutable();h.set(s,u),h.set(d,C),this.updateState({current:u.snapshot.id,entries:h.asImmutable()}),this.events.changed.next(void 0)}update(I,l){var m,u,d;const s=this.getIndex(I);if(s<0)return;const C=this.state.entries.set(s,{...I,key:(null===(m=l.key)||void 0===m?void 0:m.trim())||void 0,name:(null===(u=l.name)||void 0===u?void 0:u.trim())||void 0,description:(null===(d=l.description)||void 0===d?void 0:d.trim())||void 0});this.updateState({entries:C}),this.entryMap.set(I.snapshot.id,this.state.entries.get(s)),this.events.changed.next(void 0)}clear(){0!==this.state.entries.size&&(this.entryMap.forEach(I=>{I?.image&&this.plugin.managers.asset.delete(I.image)}),this.entryMap.clear(),this.updateState({current:void 0,entries:(0,o.B8)()}),this.events.changed.next(void 0))}applyKey(I){const l=this.state.entries.find(m=>m.key===I);l&&(this.updateState({current:l.snapshot.id}),this.events.changed.next(void 0),this.plugin.state.setSnapshot(l.snapshot))}setCurrent(I){const l=this.getEntry(I);return l&&(this.updateState({current:I}),this.events.changed.next(void 0)),l&&l.snapshot}getNextId(I,l){const m=this.state.entries.size;if(!I){if(0===m)return;return this.state.entries.get(-1===l?m-1:0).snapshot.id}const u=this.getEntry(I);if(!u)return;let d=this.getIndex(u);return d<0?void 0:(d=(d+l)%m,d<0&&(d+=m),this.state.entries.get(d).snapshot.id)}setStateSnapshot(I){var l=this;return(0,e.A)(function*(){l.clear();const m=(0,o.B8)().asMutable();for(const C of I.entries)l.entryMap.set(C.snapshot.id,C),m.push(C);const u=I.current?I.current:I.entries.length>0?I.entries[0].snapshot.id:void 0;if(l.updateState({current:u,entries:m.asImmutable(),isPlaying:!1,nextSnapshotDelayInMs:I.playback?I.playback.nextSnapshotDelayInMs:_.DefaultNextSnapshotDelayInMs}),l.events.changed.next(void 0),!u)return;const d=l.getEntry(u),s=d&&d.snapshot;return s?(yield l.plugin.state.setSnapshot(s),I.playback&&I.playback.isPlaying&&l.play(!0),s):void 0})()}syncCurrent(I){var l=this;return(0,e.A)(function*(){var m,u;const d=0===l.state.entries.size,s=1===l.state.entries.size&&l.state.current&&l.state.current===l.defaultSnapshotId;if(!d&&!s)return;const C=l.plugin.state.getSnapshot(I?.params),h=(null!==(u=null===(m=I?.params)||void 0===m?void 0:m.image)&&void 0!==u?u:l.plugin.state.snapshotParams.value.image)?yield _.getCanvasImageAsset(l.plugin,`${C.id}-image.png`):void 0;if(d)l.add(_.Entry(C,{name:I?.name,description:I?.description,image:h}));else if(s){const a=l.getEntry(l.state.current);a?.image&&l.plugin.managers.asset.delete(a.image),l.replace(l.state.current,C,{image:h})}l.defaultSnapshotId=C.id})()}getStateSnapshot(I){var l=this;return(0,e.A)(function*(){return yield l.syncCurrent(I),{timestamp:+new Date,version:v.j,name:I&&I.name,description:I&&I.description,current:l.state.current,playback:{isPlaying:!(!I||!I.playOnLoad),nextSnapshotDelayInMs:l.state.nextSnapshotDelayInMs},entries:l.state.entries.valueSeq().toArray()}})()}serialize(I){var l=this;return(0,e.A)(function*(){const m=JSON.stringify(yield l.getStateSnapshot({params:I?.params}),null,2);if(!I?.type||"json"===I.type||"molj"===I.type)return new Blob([m],{type:"application/json;charset=utf-8"});{const u=new Uint8Array((0,A.VH)(m));(0,A.rj)(u,0,m);const d={"state.json":u},s=[];for(const{asset:h,file:a}of l.plugin.managers.asset.assets)s.push([h.id,h]),d[`assets/${h.id}`]=new Uint8Array(yield a.arrayBuffer());if(s.length>0){const h=JSON.stringify(s,null,2),a=new Uint8Array((0,A.VH)(h));(0,A.rj)(a,0,h),d["assets.json"]=a}const C=yield l.plugin.runTask((0,y.qQ)(d));return new Blob([C],{type:"application/zip"})}})()}open(I){var l=this;return(0,e.A)(function*(){try{const m=I.name.toLowerCase();if(m.endsWith("json")||m.endsWith("molj")){const u=yield l.plugin.runTask((0,c.dH)(I,"string")),d=JSON.parse(u);_.isStateSnapshot(d)?yield l.setStateSnapshot(d):_.isStateSnapshot(d.data)?yield l.setStateSnapshot(d.data):yield l.plugin.state.setSnapshot(d)}else{const u=yield l.plugin.runTask((0,c.dH)(I,"zip")),d=Object.create(null);(0,i.IF)(u,(a,S)=>{if("state.json"===S||"assets.json"===S)return;const D=S.substring(S.indexOf("/")+1);d[D]=a});const s=new File([u["state.json"]],"state.json"),C=yield l.plugin.runTask((0,c.dH)(s,"string"));if(u["assets.json"]){const a=new File([u["assets.json"]],"assets.json"),S=JSON.parse(yield l.plugin.runTask((0,c.dH)(a,"string")));for(const[D,R]of S)l.plugin.managers.asset.set(R,new File([d[D]],R.name))}const h=JSON.parse(C);yield l.setStateSnapshot(h)}l.events.opened.next(void 0)}catch(m){console.error(m),l.plugin.log.error("Error reading state")}})()}play(I=!1){if(this.updateState({isPlaying:!0}),I){const l=this.getEntry(this.state.current);if(!l)return void this.next();this.events.changed.next(void 0);const m=l.snapshot;this.timeoutHandle=setTimeout(this.next,typeof m.durationInMs<"u"?m.durationInMs:this.state.nextSnapshotDelayInMs)}else this.next()}stop(){this.updateState({isPlaying:!1}),typeof this.timeoutHandle<"u"&&clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0,this.events.changed.next(void 0)}togglePlay(){this.state.isPlaying?(this.stop(),this.plugin.managers.animation.stop()):this.play()}dispose(){super.dispose(),this.entryMap.clear()}constructor(I){var l;super({current:void 0,entries:(0,o.B8)(),isPlaying:!1,nextSnapshotDelayInMs:_.DefaultNextSnapshotDelayInMs}),l=this,this.plugin=I,this.entryMap=new Map,this.defaultSnapshotId=void 0,this.events={changed:this.ev(),opened:this.ev()},this.timeoutHandle=void 0,this.next=(0,e.A)(function*(){l.timeoutHandle=void 0;const m=l.getNextId(l.state.current,1);if(!m||m===l.state.current)return void l.stop();const u=l.setCurrent(m);yield l.plugin.state.setSnapshot(u),l.state.isPlaying&&(l.timeoutHandle=setTimeout(l.next,typeof u.durationInMs<"u"?u.durationInMs:l.state.nextSnapshotDelayInMs))})}}return _.DefaultNextSnapshotDelayInMs=1500,_})();!function(_){function m(){return(m=(0,e.A)(function*(u,d){if(!u.helpers.viewportScreenshot)return;const s=u.helpers.viewportScreenshot.getPreview(512);if(!s)return;const C=yield(0,O.PG)(s.canvas,"png"),h=new File([C],d),a={kind:"file",id:r.kk.create22(),name:d};return u.managers.asset.set(a,h),a})).apply(this,arguments)}_.Entry=function M(u,d){return{timestamp:+new Date,snapshot:u,...d}},_.isStateSnapshot=function I(u){return!!u&&!!u.timestamp&&!!u.entries},_.getCanvasImageAsset=function l(u,d){return m.apply(this,arguments)}}(b||(b={}))},9039:(tn,Ue,n)=>{"use strict";n.d(Ue,{C:()=>be});var e=n(467),o=n(5019),r=n(6713),t=n(9136),A=n(3916),y=n(1827),c=n(4824),i=n(9909),v=n(2745),O=n(9359),b=n(8277),_=n(3182),M=n(1073),I=n(1832),l=n(261),m=n(190),u=n(3246);const d="overpaint-controls";function s(Te,ie,ue,re,ve){return C.apply(this,arguments)}function C(){return C=(0,e.A)(function*(Te,ie,ue,re,ve){yield function S(Te,ie,ue){return D.apply(this,arguments)}(Te,ie,function(){var ce=(0,e.A)(function*(se,ae,ge){if(ve&&ve.length>0&&!ve.includes(ae.params.values.type.name))return;const Ie=ae.obj.data.sourceData,Le=yield re(Ie.root);if(u.QN.isEmpty(Le)||(0,u.$M)(Le))return;const nt={bundle:t.iZ.Bundle.fromLoci(Le),color:-1===ue?(0,m.Q1)(0):ue,clear:-1===ue};if(ge){const Lt=R([...ge.params.values.layers,nt],Ie);se.to(ge).update(l.l.toBundle(Lt))}else{const je=R([nt],Ie);se.to(ae.transform.ref).apply(M.f.Representation.OverpaintStructureRepresentation3DFromBundle,l.l.toBundle(je),{tags:d})}});return function(se,ae,ge){return ce.apply(this,arguments)}}())}),C.apply(this,arguments)}function D(){return(D=(0,e.A)(function*(Te,ie,ue){const re=Te.state.data,ve=re.build();for(const ce of ie)for(const se of ce.representations){const ae=re.select(I.QX.Generators.ofTransformer(M.f.Representation.OverpaintStructureRepresentation3DFromBundle,se.cell.transform.ref).withTag(d));yield ue(ve,se.cell,ae[0])}return ve.commit({doNotUpdateCurrent:!0})})).apply(this,arguments)}function R(Te,ie){const ue=l.l.ofBundle(Te,ie.root),re=l.l.merge(ue);return l.l.filter(re,ie)}var f=n(1893),p=n(9096),E=n(8010),T=n(7981);const L="clipping-controls";function w(Te,ie,ue,re,ve){return Q.apply(this,arguments)}function Q(){return Q=(0,e.A)(function*(Te,ie,ue,re,ve){yield function G(Te,ie,ue){return V.apply(this,arguments)}(Te,ie,function(){var ce=(0,e.A)(function*(se,ae,ge){if(ve&&ve.length>0&&!ve.includes(ae.params.values.type.name))return;const Ie=ae.obj.data.sourceData,Le=yield re(Ie.root);if(u.QN.isEmpty(Le)||(0,u.$M)(Le))return;const nt={bundle:t.iZ.Bundle.fromLoci(Le),groups:ue};if(ge){const Lt=U([...ge.params.values.layers,nt],Ie);se.to(ge).update(T.l.toBundle(Lt))}else{const je=U([nt],Ie);se.to(ae.transform.ref).apply(M.f.Representation.ClippingStructureRepresentation3DFromBundle,T.l.toBundle(je),{tags:L})}});return function(se,ae,ge){return ce.apply(this,arguments)}}())}),Q.apply(this,arguments)}function V(){return(V=(0,e.A)(function*(Te,ie,ue){const re=Te.state.data,ve=re.build();for(const ce of ie)for(const se of ce.representations){const ae=re.select(I.QX.Generators.ofTransformer(M.f.Representation.ClippingStructureRepresentation3DFromBundle,se.cell.transform.ref).withTag(L));yield ue(ve,se.cell,ae[0])}return ve.commit({doNotUpdateCurrent:!0})})).apply(this,arguments)}function U(Te,ie){const ue=T.l.ofBundle(Te,ie.root),re=T.l.merge(ue);return T.l.filter(re,ie)}var N=n(1965);const k="transparency-controls";function H(Te,ie,ue,re,ve){return $.apply(this,arguments)}function $(){return $=(0,e.A)(function*(Te,ie,ue,re,ve){yield function te(Te,ie,ue){return de.apply(this,arguments)}(Te,ie,function(){var ce=(0,e.A)(function*(se,ae,ge){if(ve&&ve.length>0&&!ve.includes(ae.params.values.type.name))return;const Ie=ae.obj.data.sourceData,Le=yield re(Ie.root);if(u.QN.isEmpty(Le)||(0,u.$M)(Le))return;const nt={bundle:t.iZ.Bundle.fromLoci(Le),value:ue};if(ge){const Lt=ye([...ge.params.values.layers,nt],Ie);se.to(ge).update(N.x.toBundle(Lt))}else{const je=ye([nt],Ie);se.to(ae.transform.ref).apply(M.f.Representation.TransparencyStructureRepresentation3DFromBundle,N.x.toBundle(je),{tags:k})}});return function(se,ae,ge){return ce.apply(this,arguments)}}())}),$.apply(this,arguments)}function de(){return(de=(0,e.A)(function*(Te,ie,ue){const re=Te.state.data,ve=re.build();for(const ce of ie)for(const se of ce.representations){const ae=re.select(I.QX.Generators.ofTransformer(M.f.Representation.TransparencyStructureRepresentation3DFromBundle,se.cell.transform.ref).withTag(k));yield ue(ve,se.cell,ae[0])}return ve.commit({doNotUpdateCurrent:!0})})).apply(this,arguments)}function ye(Te,ie){const ue=N.x.ofBundle(Te,ie.root),re=N.x.merge(ue);return N.x.filter(re,ie)}var j=n(445),Z=n(9213),q=n(6765);const Y="substance-controls";function ee(Te,ie,ue,re,ve){return g.apply(this,arguments)}function g(){return g=(0,e.A)(function*(Te,ie,ue,re,ve){yield function le(Te,ie,ue){return Ae.apply(this,arguments)}(Te,ie,function(){var ce=(0,e.A)(function*(se,ae,ge){if(ve&&ve.length>0&&!ve.includes(ae.params.values.type.name))return;const Ie=ae.obj.data.sourceData,Le=yield re(Ie.root);if(u.QN.isEmpty(Le)||(0,u.$M)(Le))return;const nt={bundle:t.iZ.Bundle.fromLoci(Le),material:ue??(0,q.i)(),clear:!ue};if(ge){const Lt=Be([...ge.params.values.layers,nt],Ie);se.to(ge).update(Z.l.toBundle(Lt))}else{const je=Be([nt],Ie);se.to(ae.transform.ref).apply(M.f.Representation.SubstanceStructureRepresentation3DFromBundle,Z.l.toBundle(je),{tags:Y})}});return function(se,ae,ge){return ce.apply(this,arguments)}}())}),g.apply(this,arguments)}function Ae(){return(Ae=(0,e.A)(function*(Te,ie,ue){const re=Te.state.data,ve=re.build();for(const ce of ie)for(const se of ce.representations){const ae=re.select(I.QX.Generators.ofTransformer(M.f.Representation.SubstanceStructureRepresentation3DFromBundle,se.cell.transform.ref).withTag(Y));yield ue(ve,se.cell,ae[0])}return ve.commit({doNotUpdateCurrent:!0})})).apply(this,arguments)}function Be(Te,ie){const ue=Z.l.ofBundle(Te,ie.root),re=Z.l.merge(ue);return Z.l.filter(re,ie)}var Ce=n(9390),Re=n(3488);const ke="emissive-controls";function we(Te,ie,ue,re,ve){return Oe.apply(this,arguments)}function Oe(){return Oe=(0,e.A)(function*(Te,ie,ue,re,ve){yield function Ne(Te,ie,ue){return K.apply(this,arguments)}(Te,ie,function(){var ce=(0,e.A)(function*(se,ae,ge){if(ve&&ve.length>0&&!ve.includes(ae.params.values.type.name))return;const Ie=ae.obj.data.sourceData,Le=yield re(Ie.root);if(u.QN.isEmpty(Le)||(0,u.$M)(Le))return;const nt={bundle:t.iZ.Bundle.fromLoci(Le),value:ue};if(ge){const Lt=ne([...ge.params.values.layers,nt],Ie);se.to(ge).update(Re.a.toBundle(Lt))}else{const je=ne([nt],Ie);se.to(ae.transform.ref).apply(M.f.Representation.EmissiveStructureRepresentation3DFromBundle,Re.a.toBundle(je),{tags:ke})}});return function(se,ae,ge){return ce.apply(this,arguments)}}())}),Oe.apply(this,arguments)}function K(){return(K=(0,e.A)(function*(Te,ie,ue){const re=Te.state.data,ve=re.build();for(const ce of ie)for(const se of ce.representations){const ae=re.select(I.QX.Generators.ofTransformer(M.f.Representation.EmissiveStructureRepresentation3DFromBundle,se.cell.transform.ref).withTag(ke));yield ue(ve,se.cell,ae[0])}return ve.commit({doNotUpdateCurrent:!0})})).apply(this,arguments)}function ne(Te,ie){const ue=Re.a.ofBundle(Te,ie.root),re=Re.a.merge(ue);return Re.a.filter(re,ie)}class be extends _.e{get currentStructures(){return this.plugin.managers.structure.hierarchy.selection.structures}get pivotStructure(){return this.currentStructures[0]}_setSnapshotState(ie){this.updateState({options:ie}),this.events.optionsUpdated.next(void 0)}setOptions(ie){var ue=this;return(0,e.A)(function*(){const re=ie.interactions!==ue.state.options.interactions;ue.updateState({options:ie}),ue.events.optionsUpdated.next(void 0);const ve=ue.dataState.build();for(const ce of ue.currentStructures)for(const se of ce.components)ue.updateReprParams(ve,se);return ue.plugin.dataTransaction((0,e.A)(function*(){yield ve.commit(),yield ue.plugin.state.updateBehavior(j.b,ce=>{ce.ignoreHydrogens="all"!==ie.hydrogens,ce.ignoreHydrogensVariant="only-polar"===ie.hydrogens?"non-polar":"all",ce.ignoreLight=ie.ignoreLight,ce.material=ie.materialStyle,ce.clip=ie.clipObjects}),re&&(yield ue.updateInterationProps())}))})()}updateReprParams(ie,ue){const{hydrogens:re,visualQuality:ve,ignoreLight:ce,materialStyle:se,clipObjects:ae}=this.state.options,ge="all"!==re,Ie="only-polar"===re?"non-polar":"all";for(const Le of ue.representations){if(Le.cell.transform.transformer!==E.StructureRepresentation3D)continue;const nt=Le.cell.transform.params;(!!nt.type.params.ignoreHydrogens!==ge||nt.type.params.ignoreHydrogensVariant!==Ie||nt.type.params.quality!==ve||nt.type.params.ignoreLight!==ce||!(0,i.bN)(nt.type.params.material,se)||!b.t.areEqual(Ce.B.Params,nt.type.params.clip,ae))&&ie.to(Le.cell).update(je=>{je.type.params.ignoreHydrogens=ge,je.type.params.ignoreHydrogensVariant=Ie,je.type.params.quality=ve,je.type.params.ignoreLight=ce,je.type.params.material=se,je.type.params.clip=ae})}}updateInterationProps(){var ie=this;return(0,e.A)(function*(){var ue,re,ve;for(const ce of ie.currentStructures){const se=r.r.getParams(null===(ue=ce.cell.obj)||void 0===ue?void 0:ue.data);if(ce.properties){const ae=null===(re=ce.properties.cell.transform.params)||void 0===re?void 0:re.properties[r.r.descriptor.name];if(b.t.areEqual(se,ae,ie.state.options.interactions))continue;yield ie.dataState.build().to(ce.properties.cell).update(ge=>{ge.properties[r.r.descriptor.name]=ie.state.options.interactions}).commit()}else{const ae=ie.plugin.customStructureProperties.getParams(null===(ve=ce.cell.obj)||void 0===ve?void 0:ve.data),ge=b.t.getDefaultValues(ae);if(b.t.areEqual(se,ge.properties[r.r.descriptor.name],ie.state.options.interactions))continue;ge.properties[r.r.descriptor.name]=ie.state.options.interactions,yield ie.plugin.builders.structure.insertStructureProperties(ce.cell,ge)}}})()}applyPreset(ie,ue,re){var ve=this;return this.plugin.dataTransaction((0,e.A)(function*(){for(const ce of ie){const se=yield ve.plugin.builders.structure.representation.applyPreset(ce.cell,ue,re);yield ve.syncPreset(ce,se)}}),{canUndo:"Preset"})}syncPreset(ie,ue){if(!ue||!ue.components)return this.clearComponents([ie]);const re=new Set;if((0,O.IF)(ue.components,ae=>{ae&&re.add(ae.ref)}),ue.representations&&(0,O.IF)(ue.representations,ae=>{ae&&re.add(ae.ref)}),0===re.size)return this.clearComponents([ie]);let ve=!1;const ce=this.dataState.build(),se=ae=>{re.has(ae.cell.transform.ref)||(ve=!0,ce.delete(ae.cell))};for(const ae of ie.components){se(ae);for(const ge of ae.representations)se(ge);if(ae.genericRepresentations)for(const ge of ae.genericRepresentations)se(ge)}if(ie.genericRepresentations)for(const ae of ie.genericRepresentations)se(ae);return ve?ce.commit():void 0}clear(ie){return this.clearComponents(ie)}selectThis(ie){var ue;const re=this.plugin.managers.structure.selection;re.clear();for(const ve of ie){const ce=t.oE.toSubStructureElementLoci(ve.structure.cell.obj.data,null===(ue=ve.cell.obj)||void 0===ue?void 0:ue.data);re.fromLoci("set",ce)}}canBeModified(ie){return this.plugin.builders.structure.isComponentTransform(ie.cell)}modifyByCurrentSelection(ie,ue){var re=this;return this.plugin.runTask(c.YZ.create("Modify Component",function(){var ve=(0,e.A)(function*(ce){const se=re.dataState.build();for(const ae of ie){if(!re.canBeModified(ae))continue;const ge=re.plugin.managers.structure.selection.getStructure(ae.structure.cell.obj.data);!ge||0===ge.elementCount||re.modifyComponent(se,ae,ge,ue)}yield re.dataState.updateTree(se,{canUndo:"Modify Selection"}).runInContext(ce)});return function(ce){return ve.apply(this,arguments)}}()))}toggleVisibility(ie,ue){if(0!==ie.length)if(ue){const re=ie[0].representations.indexOf(ue),ve=!ue.cell.state.isHidden;for(const ce of ie){const se=ce.representations[re];se&&(0,y.setSubtreeVisibility)(this.dataState,se.cell.transform.ref,ve)}}else{const re=!ie[0].cell.state.isHidden;for(const ve of ie)(0,y.setSubtreeVisibility)(this.dataState,ve.cell.transform.ref,re)}}removeRepresentations(ie,ue){if(0===ie.length)return;const re=[];if(ue){const ve=ie[0].representations.indexOf(ue);if(ve<0)return;for(const ce of ie)ce.representations[ve]&&re.push(ce.representations[ve])}else for(const ve of ie)for(const ce of ve.representations)re.push(ce);return this.plugin.managers.structure.hierarchy.remove(re,!0)}updateRepresentations(ie,ue,re){if(0===ie.length)return Promise.resolve();const ve=ie[0].representations.indexOf(ue);if(ve<0)return Promise.resolve();const ce=this.dataState.build();for(const se of ie){const ae=se.representations[ve];ae&&ae.cell.transform.transformer===ue.cell.transform.transformer&&ce.to(ae.cell).update(re)}return ce.commit({canUndo:"Update Representation"})}updateRepresentationsTheme(ie,ue){var re,ve,ce,se;if(0===ie.length)return;const ae=this.dataState.build();for(const ge of ie)for(const Ie of ge.representations){const Le=Ie.cell.transform.params,nt="function"==typeof ue?ue(ge,Ie):ue,je="default"===nt.color?(0,f.IZ)(this.plugin,null===(re=ge.structure.cell.obj)||void 0===re?void 0:re.data,Le?.type.name):nt.color?(0,f.IZ)(this.plugin,null===(ve=ge.structure.cell.obj)||void 0===ve?void 0:ve.data,Le?.type.name,nt.color,nt.colorParams):void 0,Lt="default"===nt.size?(0,f.eD)(this.plugin,null===(ce=ge.structure.cell.obj)||void 0===ce?void 0:ce.data,Le?.type.name):nt.color?(0,f.eD)(this.plugin,null===(se=ge.structure.cell.obj)||void 0===se?void 0:se.data,Le?.type.name,nt.size,nt.sizeParams):void 0;(je||Lt)&&ae.to(Ie.cell).update(Je=>{je&&(Je.colorTheme=je),Lt&&(Je.sizeTheme=Lt)})}return ae.commit({canUndo:"Update Theme"})}addRepresentation(ie,ue){var re=this;if(0===ie.length)return;const{hydrogens:ve,visualQuality:ce,ignoreLight:se,materialStyle:ae,clipObjects:ge}=this.state.options,nt={ignoreHydrogens:"all"!==ve,ignoreHydrogensVariant:"only-polar"===ve?"non-polar":"all",quality:ce,ignoreLight:se,material:ae,clip:ge};return this.plugin.dataTransaction((0,e.A)(function*(){for(const je of ie)yield re.plugin.builders.structure.representation.addRepresentation(je.cell,{type:re.plugin.representation.structure.registry.get(ue),typeParams:nt})}),{canUndo:"Add Representation"})}tryFindComponent(ie,ue){var re=this;if(0!==ie.components.length)return this.plugin.runTask(c.YZ.create("Find Component",function(){var ve=(0,e.A)(function*(ce){var se,ae;const ge=null===(se=ie.cell.obj)||void 0===se?void 0:se.data;if(!ge)return;const Ie=t.cv.unionStructure(yield ue.getSelection(re.plugin,ce,ge));for(const Le of ie.components){const nt=null===(ae=Le.cell.obj)||void 0===ae?void 0:ae.data;if(nt&&Le.cell.parent&&(0,A.IP)(Ie,nt))return Le.cell}});return function(ce){return ve.apply(this,arguments)}}()))}add(ie,ue){var re=this;return(0,e.A)(function*(){return re.plugin.dataTransaction((0,e.A)(function*(){const ve=ue||re.currentStructures;if(0===ve.length)return;const{hydrogens:ce,visualQuality:se,ignoreLight:ae,materialStyle:ge,clipObjects:Ie}=re.state.options,je={ignoreHydrogens:"all"!==ce,ignoreHydrogensVariant:"only-polar"===ce?"non-polar":"all",quality:se,ignoreLight:ae,material:ge,clip:Ie},Lt=i.kk.create22();for(const Je of ve){let en;ie.options.checkExisting&&(en=yield re.tryFindComponent(Je,ie.selection)),en||(en=yield re.plugin.builders.structure.tryCreateComponentFromSelection(Je.cell,ie.selection,Lt,{label:ie.options.label||(ie.selection===p.Ou.current?"Custom Selection":"")})),"none"!==ie.representation&&en&&(yield re.plugin.builders.structure.representation.addRepresentation(en,{type:re.plugin.representation.structure.registry.get(ie.representation),typeParams:je}))}}),{canUndo:"Add Selection"})})()}applyTheme(ie,ue){var re=this;return(0,e.A)(function*(){return re.plugin.dataTransaction(function(){var ve=(0,e.A)(function*(ce){const se=ue||re.currentStructures;if(0===se.length)return;const ae=function(){var ge=(0,e.A)(function*(Ie){return t.cv.toLociWithSourceUnits(yield ie.selection.getSelection(re.plugin,ce,Ie))});return function(Le){return ge.apply(this,arguments)}}();for(const ge of se)if("color"===ie.action.name){const Ie=ie.action.params;yield s(re.plugin,ge.components,Ie.color,ae,ie.representations)}else if("resetColor"===ie.action.name)yield s(re.plugin,ge.components,-1,ae,ie.representations);else if("transparency"===ie.action.name){const Ie=ie.action.params;yield H(re.plugin,ge.components,Ie.value,ae,ie.representations)}else if("emissive"===ie.action.name){const Ie=ie.action.params;yield we(re.plugin,ge.components,Ie.value,ae,ie.representations)}else if("material"===ie.action.name){const Ie=ie.action.params;yield ee(re.plugin,ge.components,Ie.material,ae,ie.representations)}else if("resetMaterial"===ie.action.name)yield ee(re.plugin,ge.components,void 0,ae,ie.representations);else if("clipping"===ie.action.name){const Ie=ie.action.params;yield w(re.plugin,ge.components,T.l.Groups.fromNames(Ie.excludeGroups),ae,ie.representations)}});return function(ce){return ve.apply(this,arguments)}}(),{canUndo:"Apply Theme"})})()}modifyComponent(ie,ue,re,ve){var ce,se,ae;const ge=null===(ce=ue.cell.obj)||void 0===ce?void 0:ce.data;if(!ge||("subtract"===ve||"intersect"===ve)&&!(0,A.HK)(ge,re))return;const Ie=null===(se=ue.structure.cell.obj)||void 0===se?void 0:se.data,Le="union"===ve?(0,A.l6)(Ie,[ge,re]):"intersect"===ve?(0,A.jU)(ge,re):(0,A.Kt)(ge,re);if(0===Le.elementCount)ie.delete(ue.cell.transform.ref);else{const je={type:{name:"bundle",params:t.iZ.Bundle.fromSubStructure(Ie,Le)},nullIfEmpty:!0,label:null===(ae=ue.cell.obj)||void 0===ae?void 0:ae.label};ie.to(ue.cell).update(je)}}updateLabel(ie,ue){var re,ve;const ce={type:null===(re=ie.cell.params)||void 0===re?void 0:re.values.type,nullIfEmpty:null===(ve=ie.cell.params)||void 0===ve?void 0:ve.values.nullIfEmpty,label:ue};this.dataState.build().to(ie.cell).update(ce).commit()}get dataState(){return this.plugin.state.data}clearComponents(ie){const ue=this.dataState.build();for(const re of ie)for(const ve of re.components)ue.delete(ve.cell.transform.ref);return ue.commit({canUndo:"Clear Selections"})}constructor(ie){super({options:b.t.getDefaultValues(be.OptionsParams)}),this.plugin=ie,this.events={optionsUpdated:this.ev()}}}!function(Te){function re(ce,se){var ae,ge;return null!==(ae=se?.cell.obj)&&void 0!==ae&&ae.data?ce.representation.structure.registry.getApplicableTypes(null===(ge=se.cell.obj)||void 0===ge?void 0:ge.data):ce.representation.structure.registry.types}function ve(ce,se,ae,ge){const Ie=[...ae,...re(ce,se)];return b.t.Select(Ie[0][0],Ie,{label:ge})}Te.OptionsParams={hydrogens:b.t.Select("all",[["all","Show All"],["hide-all","Hide All"],["only-polar","Only Polar"]],{description:"Determine display of hydrogen atoms in representations"}),visualQuality:b.t.Select("auto",o.sF,{description:"Control the visual/rendering quality of representations"}),ignoreLight:b.t.Boolean(!1,{description:"Ignore light for stylized rendering of representations"}),materialStyle:q.i.getParam(),clipObjects:b.t.Group(Ce.B.Params),interactions:b.t.Group(r.r.defaultParams,{label:"Non-covalent Interactions"})},Te.getAddParams=function ie(ce,se){const{options:ae}=ce.query.structure.registry;return se={pivot:ce.managers.structure.component.pivotStructure,allowNone:!0,hideSelection:!1,checkExisting:!1,...se},{selection:b.t.Select(ae[1][0],ae,{isHidden:se?.hideSelection}),representation:ve(ce,se?.pivot,se?.allowNone?[["none","< Create Later >"]]:[]),options:b.t.Group({label:b.t.Text(""),checkExisting:b.t.Boolean(!!se?.checkExisting,{help:()=>({description:"Checks if a selection with the specifield elements already exists to avoid creating duplicate components."})})})}},Te.getThemeParams=function ue(ce,se){const{options:ae}=ce.query.structure.registry;return{selection:b.t.Select(ae[1][0],ae,{isHidden:!1}),action:b.t.MappedStatic("color",{color:b.t.Group({color:b.t.Color(v.s.blue,{isExpanded:!0})},{isFlat:!0}),resetColor:b.t.EmptyGroup({label:"Reset Color"}),transparency:b.t.Group({value:b.t.Numeric(.5,{min:0,max:1,step:.01})},{isFlat:!0}),emissive:b.t.Group({value:b.t.Numeric(.5,{min:0,max:1,step:.01})},{isFlat:!0}),material:b.t.Group({material:q.i.getParam({isFlat:!0})},{isFlat:!0}),resetMaterial:b.t.EmptyGroup({label:"Reset Material"}),clipping:b.t.Group({excludeGroups:b.t.MultiSelect([],b.t.objectToOptions(T.l.Groups.Names))},{isFlat:!0})}),representations:b.t.MultiSelect([],re(ce,se),{emptyValue:"All"})}},Te.getRepresentationTypes=re}(be||(be={}))},2277:(tn,Ue,n)=>{"use strict";n.d(Ue,{G:()=>k});var e=n(467),o=n(1827),r=n(6763),t=n(1832),A=n(9986),y=n(3182),c=n(381),i=n(1073),v=n(6230);function b(){return{trajectories:[],models:[],structures:[],refs:new Map}}function _(H){return{kind:"trajectory",cell:H,version:H.transform.version,models:[]}}function M(H,$){return{kind:"model",cell:H,version:H.transform.version,trajectory:$,structures:[]}}function I(H,$){return{kind:"model-properties",cell:H,version:H.transform.version,model:$}}function l(H,$){return{kind:"model-unitcell",cell:H,version:H.transform.version,model:$}}function m(H,$){return{kind:"structure",cell:H,version:H.transform.version,model:$,components:[]}}function u(H,$){return{kind:"structure-properties",cell:H,version:H.transform.version,structure:$}}function d(H,$){return{kind:"structure-transform",cell:H,version:H.transform.version,structure:$}}function s(H,$){return{kind:"structure-volume-streaming",cell:H,version:H.transform.version,structure:$}}function C(H){return H.transform.tags?[...H.transform.tags].sort().join():H.transform.ref}function h(H,$){return{kind:"structure-component",cell:H,version:H.transform.version,structure:$,key:C(H),representations:[]}}function a(H,$){return{kind:"structure-representation",cell:H,version:H.transform.version,component:$}}function S(H,$){return{kind:"generic-representation",cell:H,version:H.transform.version,parent:$}}function R(H,$,J,W,...te){const de=W(...te);J.push(de),H.hierarchy.refs.set($.transform.ref,de);const ye=H.oldHierarchy.refs.get($.transform.ref);return ye?ye.version!==$.transform.version&&(H.changed=!0):(H.added.add(de.cell.transform.ref),H.changed=!0),de}function f(H,$,J,...W){const te=J(...W);H.hierarchy.refs.set($.transform.ref,te);const de=H.oldHierarchy.refs.get($.transform.ref);return de?de.version!==$.transform.version&&(H.changed=!0):(H.added.add(te.cell.transform.ref),H.changed=!0),te}function p(H){return $=>H.is($.obj)}function E(H,$){return(J,W)=>!$(W)&&H.is(J.obj)}function T(H){return $=>$.transform.transformer===H}function L(){}const w=[[p(c.O.Molecule.Trajectory),(H,$)=>{H.currentTrajectory=R(H,$,H.hierarchy.trajectories,_,$)},H=>H.currentTrajectory=void 0],[E(c.O.Molecule.Model,H=>H.currentModel),(H,$)=>{H.currentModel=H.currentTrajectory?R(H,$,H.currentTrajectory.models,M,$,H.currentTrajectory):f(H,$,M,$),H.hierarchy.models.push(H.currentModel)},H=>H.currentModel=void 0],[T(i.f.Model.CustomModelProperties),(H,$)=>{if(!H.currentModel)return!1;H.currentModel.properties=f(H,$,I,$,H.currentModel)},L],[T(i.f.Representation.ModelUnitcell3D),(H,$)=>{if(!H.currentModel)return!1;H.currentModel.unitcell=f(H,$,l,$,H.currentModel)},L],[E(c.O.Molecule.Structure,H=>H.currentStructure),(H,$)=>{H.currentStructure=H.currentModel?R(H,$,H.currentModel.structures,m,$,H.currentModel):f(H,$,m,$),H.hierarchy.structures.push(H.currentStructure)},H=>H.currentStructure=void 0],[T(i.f.Model.CustomStructureProperties),(H,$)=>{if(!H.currentStructure)return!1;H.currentStructure.properties=f(H,$,u,$,H.currentStructure)},L],[T(i.f.Model.TransformStructureConformation),(H,$)=>{if(!H.currentStructure)return!1;H.currentStructure.transform=f(H,$,d,$,H.currentStructure)},L],[p(v.h),(H,$)=>(H.currentStructure&&(H.currentStructure.volumeStreaming=f(H,$,s,$,H.currentStructure)),!1),L],[(H,$)=>!($.currentComponent||!$.currentStructure||H.transform.transformer.definition.isDecorator)&&c.O.Molecule.Structure.is(H.obj),(H,$)=>{H.currentStructure&&(H.currentComponent=R(H,$,H.currentStructure.components,h,$,H.currentStructure))},H=>H.currentComponent=void 0],[(H,$)=>!H.state.isGhost&&!!$.currentComponent&&c.O.Molecule.Structure.Representation3D.is(H.obj),(H,$)=>(H.currentComponent&&R(H,$,H.currentComponent.representations,a,$,H.currentComponent),!1),L],[H=>!H.state.isGhost&&c.O.isRepresentation3D(H.obj),(H,$)=>{const J=H.currentComponent||H.currentStructure||H.currentModel;J&&(J.genericRepresentations||(J.genericRepresentations=[]),R(H,$,J.genericRepresentations,S,$,J))},L]];function Q(H){if(!H||!H?.parent||!H.parent.cells.has(H.transform.ref))return!1;const{obj:$}=H;return!(!$||$===t.BM.Null||"ok"!==H.status&&"error"!==H.status)}function G(H){const{cell:$}=H;Q($)||(this.changed=!0)}function V(H){U(this,this.tree.transforms.get(H))}function U(H,$){const{state:J}=H,W=J.state.cells.get($.ref);if(!Q(W))return;let te,de=!1;for(const[j,Z,q]of w)if(j(W,J)){if(!1===Z(J,W)){de=!0;break}te=q;break}if(de)return;const ye=H.tree.children.get($.ref);ye&&ye.size&&ye.forEach(V,H),te&&te(J)}class k extends y.N{get dataState(){return this.plugin.state.data}get currentComponentGroups(){return this._currentComponentGroups||(this._currentComponentGroups=k.getComponentGroups(this.selection.structures)),this._currentComponentGroups}get seletionSet(){if(this._currentSelectionSet)return this._currentSelectionSet;this._currentSelectionSet=new Set;for(const $ of this.selection.trajectories)this._currentSelectionSet.add($.cell.transform.ref);for(const $ of this.selection.models)this._currentSelectionSet.add($.cell.transform.ref);for(const $ of this.selection.structures)this._currentSelectionSet.add($.cell.transform.ref);return this._currentSelectionSet}get current(){return this.sync(!1),this.state.hierarchy}get selection(){return this.sync(!1),this.state.selection}getStructuresWithSelection(){const $=this.plugin.managers.structure.hierarchy.current.structures,J=[];for(const W of $)this.plugin.managers.structure.selection.structureHasSelection(W)&&J.push(W);return J}findStructure($){if(!$)return;const J=this.plugin.helpers.substructureParent.get($);if(!J)return;const W=this.plugin.state.data.selectQ(te=>te.byValue(J).rootOfType(c.O.Molecule.Structure))[0];return W?this.behaviors.selection.value.structures.find(te=>te.cell===W):void 0}syncCurrent($,J){const W=this.seletionSet,te=[];for(const de of $){const ye=de.cell.transform.ref;(W.has(ye)||J.has(ye))&&te.push(de)}return 0===te.length?$.length>0?[$[0]]:[]:te}sync($){if(!$&&this.dataState.inUpdate)return;if(this.state.syncedTree===this.dataState.tree)return void($&&!this.state.notified&&(this.state.notified=!0,this.behaviors.selection.next({hierarchy:this.state.hierarchy,...this.state.selection})));this.state.syncedTree=this.dataState.tree;const J=function O(H,$){const J=function D(H,$){return{state:H,oldHierarchy:$,hierarchy:b(),changed:!1,added:new Set}}(H,$||b());return function N(H,$){U({tree:H,state:$},H.root)}(H.tree,J),$&&$.refs.forEach(G,J),{hierarchy:J.hierarchy,added:J.added,changed:J.changed}}(this.plugin.state.data,this.current);if(!J.changed)return;const{hierarchy:W}=J,te=this.syncCurrent(W.trajectories,J.added),de=this.syncCurrent(W.models,J.added),ye=this.syncCurrent(W.structures,J.added);this._currentComponentGroups=void 0,this._currentSelectionSet=void 0,this.state.hierarchy=W,this.state.selection.trajectories=te,this.state.selection.models=de,this.state.selection.structures=ye,$?(this.state.notified=!0,this.behaviors.selection.next({hierarchy:W,trajectories:te,models:de,structures:ye})):this.state.notified=!1}updateCurrent($,J){const W=this.current,te="add"===J?A.M.union(this.seletionSet,new Set($.map(Z=>Z.cell.transform.ref))):A.M.difference(this.seletionSet,new Set($.map(Z=>Z.cell.transform.ref))),de=[],ye=[],j=[];for(const Z of W.trajectories)te.has(Z.cell.transform.ref)&&de.push(Z);for(const Z of W.models)te.has(Z.cell.transform.ref)&&ye.push(Z);for(const Z of W.structures)te.has(Z.cell.transform.ref)&&j.push(Z);this._currentComponentGroups=void 0,this._currentSelectionSet=void 0,this.state.selection.trajectories=de,this.state.selection.models=ye,this.state.selection.structures=j,this.behaviors.selection.next({hierarchy:W,trajectories:de,models:ye,structures:j})}remove($,J){if(0===$.length)return;const W=this.plugin.state.data.build();for(const te of $)W.delete("string"==typeof te?te:te.cell.transform.ref);return W.commit({canUndo:!!J&&"Remove"})}toggleVisibility($,J){if(0===$.length)return;const W=void 0!==J?"show"!==J:!$[0].cell.state.isHidden;for(const te of $)(0,o.setSubtreeVisibility)(this.dataState,te.cell.transform.ref,W)}applyPreset($,J,W){var te=this;return this.plugin.dataTransaction((0,e.A)(function*(){for(const de of $)de.models.length>0&&(yield te.clearTrajectory(de)),yield te.plugin.builders.structure.hierarchy.applyPreset(de.cell,J,W)}))}updateStructure($,J){var W=this;return(0,e.A)(function*(){yield W.plugin.dataTransaction((0,e.A)(function*(){const te=t.uF.getDecoratorRoot(W.dataState.tree,$.cell.transform.ref),de=W.dataState.tree.children.get(te).toArray();yield W.remove(de,!1),yield W.plugin.state.updateTransform(W.plugin.state.data,$.cell.transform.ref,J,"Structure Type"),yield W.plugin.builders.structure.representation.applyPreset($.cell.transform.ref,"auto")}),{canUndo:"Structure Type"}),r.a.Camera.Reset(W.plugin)})()}clearTrajectory($){const J=this.dataState.build();for(const W of $.models)J.delete(W.cell);return J.commit()}constructor($){super(),this.plugin=$,this.state={syncedTree:this.dataState.tree,notified:!1,hierarchy:b(),selection:{trajectories:[],models:[],structures:[]}},this.behaviors={selection:this.ev.behavior({hierarchy:this.current,trajectories:this.selection.trajectories,models:this.selection.models,structures:this.selection.structures})},this._currentComponentGroups=void 0,this._currentSelectionSet=void 0,this.subscribe($.state.data.events.changed,J=>{J.inTransaction||$.behaviors.state.isAnimating.value||this.sync(!0)}),this.subscribe($.behaviors.state.isAnimating,J=>{!J&&!$.behaviors.state.isUpdating.value&&this.sync(!0)})}}var H;(H=k||(k={})).getComponentGroups=function $(W){if(!W.length)return[];if(1===W.length)return W[0].components.map(ye=>[ye]);const te=[],de=new Map;for(const ye of W)for(const j of ye.components){const Z=j.key;if(!Z)continue;let q=de.get(Z);q||(q=[],de.set(Z,q),te.push(q)),q.push(j)}return te},H.getSelectedStructuresDescription=function J(W){var te,de,ye,j,Z,q,Y,ee,g;const{structures:_e}=W.managers.structure.hierarchy.selection;if(0===_e.length)return"";if(1===_e.length){const Be=_e[0],Ce=null===(te=Be.cell.obj)||void 0===te?void 0:te.data;if(!Ce)return(null===(de=Be.cell.obj)||void 0===de?void 0:de.label)||"Structure";const Re=Ce.models[0]||Ce.representativeModel||Ce.masterModel;if(!Re)return(null===(ye=Be.cell.obj)||void 0===ye?void 0:ye.label)||"Structure";const ke=Re.entryId;return null!==(Z=null===(j=Be.model)||void 0===j?void 0:j.trajectory)&&void 0!==Z&&Z.models&&1===Be.model.trajectory.models.length?ke:Be.model?`${null===(q=Be.model.cell.obj)||void 0===q?void 0:q.label} | ${ke}`:ke}const xe=_e[0],le=null===(Y=xe?.model)||void 0===Y?void 0:Y.trajectory;let Ae=!0;for(const Be of _e)if((null===(ee=Be?.model)||void 0===ee?void 0:ee.trajectory)!==le){Ae=!1;break}return Ae&&le?`${null===(g=le.cell.obj)||void 0===g?void 0:g.label} | ${_e.length} structures`:`${_e.length} structures`}},5995:(tn,Ue,n)=>{"use strict";n.d(Ue,{$T:()=>m,Gu:()=>I});var e=n(467),o=n(9136),r=n(1832),t=n(1073),A=n(6763),y=n(6115),c=n(381),i=n(3182),v=n(8277),O=n(6600),b=n(190);const _="measurement-group",M="measurement-order-label",I={distanceUnitLabel:v.t.Text("\u212b",{isEssential:!0}),textColor:O.w.textColor},l=v.t.getDefaultValues(I);class m extends i.e{stateUpdated(){this.behaviors.state.next(this.state)}getGroup(){const s=r.QX.findTagInSubtree(this.plugin.state.data.tree,r.Cn.RootRef,_),C=this.plugin.state.data.build();return s?C.to(s):C.toRoot().group(t.f.Misc.CreateGroup,{label:"Measurements"},{tags:_})}setOptions(d){var s=this;return(0,e.A)(function*(){s.updateState({options:d})&&s.stateUpdated();const C=s.plugin.state.data.build();for(const h of s.state.distances)C.to(h).update(a=>{a.unitLabel=d.distanceUnitLabel,a.textColor=d.textColor});for(const h of s.state.labels)C.to(h).update(a=>{a.textColor=d.textColor});for(const h of s.state.angles)C.to(h).update(a=>{a.textColor=d.textColor});for(const h of s.state.dihedrals)C.to(h).update(a=>{a.textColor=d.textColor});0!==C.editInfo.count&&(yield A.a.State.Update(s.plugin,{state:s.plugin.state.data,tree:C,options:{doNotLogTiming:!0}}))})()}addDistance(d,s,C){var h=this;return(0,e.A)(function*(){const a=h.plugin.helpers.substructureParent.get(d.structure),S=h.plugin.helpers.substructureParent.get(s.structure);if(!a||!S)return;const D=[a.transform.ref];(0,y.Z2)(D,S.transform.ref);const f=h.getGroup().apply(t.f.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",groupId:"a",ref:a.transform.ref,expression:o.iZ.Loci.toExpression(d)},{key:"b",groupId:"b",ref:S.transform.ref,expression:o.iZ.Loci.toExpression(s)}],isTransitive:!0,label:"Distance"},{dependsOn:D,tags:C?.selectionTags}),p=f.apply(t.f.Representation.StructureSelectionsDistance3D,{customText:C?.customText||"",unitLabel:h.state.options.distanceUnitLabel,textColor:h.state.options.textColor,...C?.lineParams,...C?.labelParams,...C?.visualParams},{tags:C?.reprTags}),E=h.plugin.state.data;return yield A.a.State.Update(h.plugin,{state:E,tree:p,options:{doNotLogTiming:!0}}),{selection:f.selector,representation:p.selector}})()}addAngle(d,s,C,h){var a=this;return(0,e.A)(function*(){const S=a.plugin.helpers.substructureParent.get(d.structure),D=a.plugin.helpers.substructureParent.get(s.structure),R=a.plugin.helpers.substructureParent.get(C.structure);if(!S||!D||!R)return;const f=[S.transform.ref];(0,y.Z2)(f,D.transform.ref),(0,y.Z2)(f,R.transform.ref);const E=a.getGroup().apply(t.f.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",ref:S.transform.ref,expression:o.iZ.Loci.toExpression(d)},{key:"b",ref:D.transform.ref,expression:o.iZ.Loci.toExpression(s)},{key:"c",ref:R.transform.ref,expression:o.iZ.Loci.toExpression(C)}],isTransitive:!0,label:"Angle"},{dependsOn:f,tags:h?.selectionTags}),T=E.apply(t.f.Representation.StructureSelectionsAngle3D,{customText:h?.customText||"",textColor:a.state.options.textColor,...h?.lineParams,...h?.labelParams,...h?.visualParams},{tags:h?.reprTags}),L=a.plugin.state.data;return yield A.a.State.Update(a.plugin,{state:L,tree:T,options:{doNotLogTiming:!0}}),{selection:E.selector,representation:T.selector}})()}addDihedral(d,s,C,h,a){var S=this;return(0,e.A)(function*(){const D=S.plugin.helpers.substructureParent.get(d.structure),R=S.plugin.helpers.substructureParent.get(s.structure),f=S.plugin.helpers.substructureParent.get(C.structure),p=S.plugin.helpers.substructureParent.get(h.structure);if(!(D&&R&&f&&p))return;const E=[D.transform.ref];(0,y.Z2)(E,R.transform.ref),(0,y.Z2)(E,f.transform.ref),(0,y.Z2)(E,p.transform.ref);const L=S.getGroup().apply(t.f.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",ref:D.transform.ref,expression:o.iZ.Loci.toExpression(d)},{key:"b",ref:R.transform.ref,expression:o.iZ.Loci.toExpression(s)},{key:"c",ref:f.transform.ref,expression:o.iZ.Loci.toExpression(C)},{key:"d",ref:p.transform.ref,expression:o.iZ.Loci.toExpression(h)}],isTransitive:!0,label:"Dihedral"},{dependsOn:E,tags:a?.selectionTags}),w=L.apply(t.f.Representation.StructureSelectionsDihedral3D,{customText:a?.customText||"",textColor:S.state.options.textColor,...a?.lineParams,...a?.labelParams,...a?.visualParams},{tags:a?.reprTags}),Q=S.plugin.state.data;return yield A.a.State.Update(S.plugin,{state:Q,tree:w,options:{doNotLogTiming:!0}}),{selection:L.selector,representation:w.selector}})()}addLabel(d,s){var C=this;return(0,e.A)(function*(){const h=C.plugin.helpers.substructureParent.get(d.structure);if(!h)return;const a=[h.transform.ref],D=C.getGroup().apply(t.f.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",ref:h.transform.ref,expression:o.iZ.Loci.toExpression(d)}],isTransitive:!0,label:"Label"},{dependsOn:a,tags:s?.selectionTags}),R=D.apply(t.f.Representation.StructureSelectionsLabel3D,{textColor:C.state.options.textColor,...s?.labelParams,...s?.visualParams},{tags:s?.reprTags}),f=C.plugin.state.data;return yield A.a.State.Update(C.plugin,{state:f,tree:R,options:{doNotLogTiming:!0}}),{selection:D.selector,representation:R.selector}})()}addOrientation(d){var s=this;return(0,e.A)(function*(){const C=[],h=[];for(let f=0,p=d.length;f{s.inTransaction||d.behaviors.state.isAnimating.value||this.sync()}),d.behaviors.state.isAnimating.subscribe(s=>{!s&&!d.behaviors.state.isUpdating.value&&this.sync()})}}},9012:(tn,Ue,n)=>{"use strict";n.d(Ue,{L:()=>a});var e=n(1827),o=n(3182),r=n(381),t=n(1832);function y(){return{volumes:[],lazyVolumes:[],refs:new Map}}function c(S){return{kind:"volume",cell:S,version:S.transform.version,representations:[]}}function i(S){return{kind:"lazy-volume",cell:S,version:S.transform.version}}function v(S,D){return{kind:"volume-representation",cell:S,version:S.transform.version,volume:D}}function b(S,D,R,f,...p){const E=f(...p);R.push(E),S.hierarchy.refs.set(D.transform.ref,E);const T=S.oldHierarchy.refs.get(D.transform.ref);return T?T.version!==D.transform.version&&(S.changed=!0):(S.added.add(E.cell.transform.ref),S.changed=!0),E}function M(){}const I=[[function _(S,D){return(R,f)=>!D(f)&&S.is(R.obj)}(r.O.Volume.Data,S=>S.currentVolume),(S,D)=>{S.currentVolume=b(S,D,S.hierarchy.volumes,c,D)},S=>S.currentVolume=void 0],[S=>r.O.Volume.Lazy.is(S.obj),(S,D)=>{b(S,D,S.hierarchy.lazyVolumes,i,D)},M],[(S,D)=>!S.state.isGhost&&!!D.currentVolume&&r.O.Volume.Representation3D.is(S.obj),(S,D)=>(S.currentVolume&&b(S,D,S.currentVolume.representations,v,D,S.currentVolume),!1),M]];function l(S){if(!S||!S?.parent||!S.parent.cells.has(S.transform.ref))return!1;const{obj:D}=S;return!(!D||D===t.BM.Null||"ok"!==S.status&&"error"!==S.status)}function m(S){const{cell:D}=S;l(D)||(this.changed=!0)}function u(S){d(this,this.tree.transforms.get(S))}function d(S,D){const{state:R}=S,f=R.state.cells.get(D.ref);if(!l(f))return;let p,E=!1;for(const[L,w,Q]of I)if(L(f,R)){if(!1===w(R,f)){E=!0;break}p=Q;break}if(E)return;const T=S.tree.children.get(D.ref);T&&T.size&&T.forEach(u,S),p&&p(R)}var C=n(3442),h=n(1073);class a extends o.N{get dataState(){return this.plugin.state.data}get current(){return this.sync(!1),this.state.hierarchy}get selection(){return this.sync(!1),this.state.selection}sync(D){if(!D&&this.dataState.inUpdate)return;if(this.state.syncedTree===this.dataState.tree)return void(D&&!this.state.notified&&(this.state.notified=!0,this.behaviors.selection.next({hierarchy:this.state.hierarchy,volume:this.state.selection})));this.state.syncedTree=this.dataState.tree;const R=function A(S,D){const R=function O(S,D){return{state:S,oldHierarchy:D,hierarchy:y(),changed:!1,added:new Set}}(S,D||y());return function s(S,D){d({tree:S,state:D},S.root)}(S.tree,R),D&&D.refs.forEach(m,R),{hierarchy:R.hierarchy,added:R.added,changed:R.changed}}(this.plugin.state.data,this.current);if(!R.changed)return;const{hierarchy:f}=R;this.state.hierarchy=f,this.state.selection=this.state.selection&&f.refs.has(this.state.selection.cell.transform.ref)?f.refs.get(this.state.selection.cell.transform.ref):f.volumes[0],D?(this.state.notified=!0,this.behaviors.selection.next({hierarchy:f,volume:this.state.selection})):this.state.notified=!1}setCurrent(D){this.state.selection=D||this.state.hierarchy.volumes[0],this.behaviors.selection.next({hierarchy:this.state.hierarchy,volume:D||this.state.hierarchy.volumes[0]})}remove(D,R){if(0===D.length)return;const f=this.plugin.state.data.build();for(const p of D)f.delete("string"==typeof p?p:p.cell.transform.ref);return f.commit({canUndo:!!R&&"Remove"})}toggleVisibility(D,R){if(0===D.length)return;const f=void 0!==R?"show"!==R:!D[0].cell.state.isHidden;for(const p of D)(0,e.setSubtreeVisibility)(this.dataState,p.cell.transform.ref,f)}addRepresentation(D,R){var f;return this.dataState.build().to(D.cell).apply(h.f.Representation.VolumeRepresentation3D,(0,C.aK)(this.plugin,null===(f=D.cell.obj)||void 0===f?void 0:f.data,{type:R})).commit({canUndo:"Add Representation"})}constructor(D){super(),this.plugin=D,this.state={syncedTree:this.dataState.tree,notified:!1,hierarchy:y(),selection:void 0},this.behaviors={selection:this.ev.behavior({hierarchy:this.current,volume:this.selection})},this.subscribe(D.state.data.events.changed,R=>{R.inTransaction||D.behaviors.state.isAnimating.value||this.sync(!0)}),this.subscribe(D.behaviors.state.isAnimating,R=>{!R&&!D.behaviors.state.isUpdating.value&&this.sync(!0)})}}(a||(a={})).getRepresentationTypes=function D(R,f){var p,E;return null!==(p=f?.cell.obj)&&void 0!==p&&p.data?R.representation.volume.registry.getApplicableTypes(null===(E=f.cell.obj)||void 0===E?void 0:E.data):R.representation.volume.registry.types}},381:(tn,Ue,n)=>{"use strict";n.d(Ue,{H:()=>r,O:()=>o});var o,r,t,e=n(1832);!function(t){function c(m){return t.Create({...m,typeClass:"Representation3D"})}t.Create=e.BM.factory(),t.isRepresentation3D=function A(m){return!!m&&"Representation3D"===m.type.typeClass},t.isBehavior=function y(m){return!!m&&"Behavior"===m.type.typeClass},t.CreateRepresentation3D=c,t.CreateBehavior=function i(m){return t.Create({...m,typeClass:"Behavior"})};class v extends(t.Create({name:"Root",typeClass:"Root"})){}t.Root=v;class O extends(t.Create({name:"Group",typeClass:"Group"})){}let b,_,M,I,l;t.Group=O,function(m){class u extends(t.Create({name:"String Data",typeClass:"Data"})){}m.String=u;class d extends(t.Create({name:"Binary Data",typeClass:"Data"})){}m.Binary=d;class s extends(t.Create({name:"Data Blob",typeClass:"Data"})){}m.Blob=s}(b=t.Data||(t.Data={})),function(m){class u extends(t.Create({name:"JSON Data",typeClass:"Data"})){}m.Json=u;class d extends(t.Create({name:"CIF File",typeClass:"Data"})){}m.Cif=d;class s extends(t.Create({name:"Cube File",typeClass:"Data"})){}m.Cube=s;class C extends(t.Create({name:"PSF File",typeClass:"Data"})){}m.Psf=C;class h extends(t.Create({name:"PRMTOP File",typeClass:"Data"})){}m.Prmtop=h;class a extends(t.Create({name:"TOP File",typeClass:"Data"})){}m.Top=a;class S extends(t.Create({name:"PLY File",typeClass:"Data"})){}m.Ply=S;class D extends(t.Create({name:"CCP4/MRC/MAP File",typeClass:"Data"})){}m.Ccp4=D;class R extends(t.Create({name:"DSN6/BRIX File",typeClass:"Data"})){}m.Dsn6=R;class f extends(t.Create({name:"DX File",typeClass:"Data"})){}m.Dx=f;class p extends(t.Create({name:"Format Blob",typeClass:"Data"})){}m.Blob=p}(_=t.Format||(t.Format={})),function(m){class u extends(t.Create({name:"Coordinates",typeClass:"Object"})){}m.Coordinates=u;class d extends(t.Create({name:"Topology",typeClass:"Object"})){}m.Topology=d;class s extends(t.Create({name:"Model",typeClass:"Object"})){}m.Model=s;class C extends(t.Create({name:"Trajectory",typeClass:"Object"})){}m.Trajectory=C;class h extends(t.Create({name:"Structure",typeClass:"Object"})){}m.Structure=h,function(a){class S extends(c({name:"Structure 3D"})){}a.Representation3D=S;class D extends(t.Create({name:"Structure 3D State",typeClass:"Object"})){}a.Representation3DState=D;class R extends(t.Create({name:"Selections",typeClass:"Object"})){}a.Selections=R}(h=m.Structure||(m.Structure={}))}(M=t.Molecule||(t.Molecule={})),function(m){class u extends(t.Create({name:"Volume",typeClass:"Object"})){}m.Data=u;class d extends(t.Create({name:"Lazy Volume",typeClass:"Object"})){}m.Lazy=d;class s extends(c({name:"Volume 3D"})){}m.Representation3D=s}(I=t.Volume||(t.Volume={})),function(m){class u extends(t.Create({name:"Shape Provider",typeClass:"Object"})){}m.Provider=u;class d extends(c({name:"Shape 3D"})){}m.Representation3D=d}(l=t.Shape||(t.Shape={}))}(o||(o={})),(t=r||(r={})).CreateBuiltIn=e.xE.factory("ms-plugin"),t.BuiltIn=e.xE.builderFactory("ms-plugin")},1073:(tn,Ue,n)=>{"use strict";n.d(Ue,{f:()=>ye});var e={};n.r(e),n.d(e,{CreateGroup:()=>i});var o={};n.r(o),n.d(o,{AssignColorVolume:()=>J,VolumeFromCcp4:()=>V,VolumeFromCube:()=>N,VolumeFromDensityServerCif:()=>H,VolumeFromDsn6:()=>U,VolumeFromDx:()=>k,VolumeFromSegmentationCif:()=>$,VolumeTransform:()=>W});var r=n(6990),t=n(1832),A=n(9909),y=n(8277),c=n(381);const i=c.H.BuiltIn({name:"create-group",display:{name:"Group"},from:[],to:c.O.Group,params:{label:y.t.Text("Group"),description:y.t.Optional(y.t.Text(""))}})({apply:({params:j})=>new c.O.Group({},j),update:({oldParams:j,newParams:Z,b:q})=>(0,A.f8)(j,Z)?t.xE.UpdateResult.Unchanged:(q.label=Z.label,q.description=Z.description,t.xE.UpdateResult.Updated)});var S,j,v=n(1855),O=n(467),b=n(5165),_=n(4369),M=n(4824),I=n(5384),l=n(4490),m=n(5732),u=n(702),d=n(6115),s=n(1692);(j=S||(S={})).is=function Z(Y){return"ccp4"===Y?.kind},j.create=function q(Y){return{kind:"ccp4",name:Y.name,data:Y}};var f,D=n(4625);!function(j){j.is=function Z(Y){return"dsn6"===Y?.kind},j.create=function q(Y){return{kind:"dsn6",name:Y.name,data:Y}}}(f||(f={}));var T,p=n(3420);!function(j){j.is=function Z(Y){return"dx"===Y?.kind},j.create=function q(Y){return{kind:"dx",name:Y.name,data:Y}}}(T||(T={}));var G,L=n(6853),w=n(9359);!function(j){j.is=function Z(Y){return"segcif"===Y?.kind},j.create=function q(Y){return{kind:"segcif",name:Y._name,data:Y}}}(G||(G={}));const V=c.H.BuiltIn({name:"volume-from-ccp4",display:{name:"Volume from CCP4/MRC/MAP",description:"Create Volume from CCP4/MRC/MAP data"},from:c.O.Format.Ccp4,to:c.O.Volume.Data,params:j=>({voxelSize:y.t.Vec3(_.eB.create(1,1,1)),offset:y.t.Vec3(_.eB.create(0,0,0)),entryId:y.t.Text("")})})({apply:({a:j,params:Z})=>M.YZ.create("Create volume from CCP4/MRC/MAP",function(){var q=(0,O.A)(function*(Y){const ee=yield function a(j,Z){return M.YZ.create("Create Volume",function(){var q=(0,O.A)(function*(Y){const{header:ee,values:g}=j,_e=_.eB.create(ee.xLength,ee.yLength,ee.zLength);Z&&Z.voxelSize&&_.eB.mul(_e,_e,Z.voxelSize);const xe=_.eB.create((0,l.pu)(ee.alpha),(0,l.pu)(ee.beta),(0,l.pu)(ee.gamma)),Ae=I.O8.create((ee.ISPG>65536?0:ee.ISPG)||"P 1",_e,xe),Be=_.eB.create(ee.MAPC-1,ee.MAPR-1,ee.MAPS-1),Ce=_.qY.convertToCanonicalAxisIndicesFastToSlow(Be),Re=[ee.NX,ee.NY,ee.NZ],ke=Ce([ee.NC,ee.NR,ee.NS]),we=function C(j){return 0===j.originX&&0===j.originY&&0===j.originZ?_.eB.create(j.NCSTART,j.NRSTART,j.NSSTART):_.eB.create(j.originX/(j.xLength/j.NX),j.originY/(j.yLength/j.NY),j.originZ/(j.zLength/j.NZ))}(ee);Z?.offset&&_.eB.add(we,we,Z.offset);const Oe=Ce(we),Se=_.eB.create(Oe[0]/Re[0],Oe[1]/Re[1],Oe[2]/Re[2]),Ve=_.eB.create(ke[0]/Re[0],ke[1]/Re[1],ke[2]/Re[2]),Ne=_.qY.Space(ke,_.qY.invertAxisOrder(Be),function h(j){const Z=(0,m.q7)(j);switch(Z){case u.RW.Float32:return Float32Array;case u.RW.Int8:return Int8Array;case u.RW.Int16:return Int16Array;case u.RW.Uint16:return Uint16Array}throw Error(`${Z} is not a supported value format.`)}(ee)),K=_.qY.create(Ne,_.qY.Data1(g)),ne=0===ee.AMIN&&0===ee.AMAX&&0===ee.AMEAN&&0===ee.ARMS;return{label:Z?.label,entryId:Z?.entryId,grid:{transform:{kind:"spacegroup",cell:Ae,fractionalBox:I.DJ.create(Se,_.eB.add(_.eB.zero(),Se,Ve))},cells:K,stats:{min:isNaN(ee.AMIN)||ne?(0,d.GP)(g):ee.AMIN,max:isNaN(ee.AMAX)||ne?(0,d._M)(g):ee.AMAX,mean:isNaN(ee.AMEAN)||ne?(0,d.VR)(g):ee.AMEAN,sigma:isNaN(ee.ARMS)||0===ee.ARMS?(0,d.C2)(g):ee.ARMS}},sourceData:S.create(j),customProperties:new s.v,_propertyData:Object.create(null)}});return function(Y){return q.apply(this,arguments)}}())}(j.data,{...Z,label:j.data.name||j.label}).runInContext(Y);return new c.O.Volume.Data(ee,{label:ee.label||"Volume",description:`Volume ${j.data.header.NX}\xd7${j.data.header.NX}\xd7${j.data.header.NX}`})});return function(Y){return q.apply(this,arguments)}}()),dispose({b:j}){j?.data.customProperties.dispose()}}),U=c.H.BuiltIn({name:"volume-from-dsn6",display:{name:"Volume from DSN6/BRIX",description:"Create Volume from DSN6/BRIX data"},from:c.O.Format.Dsn6,to:c.O.Volume.Data,params:j=>({voxelSize:y.t.Vec3(_.eB.create(1,1,1)),entryId:y.t.Text("")})})({apply:({a:j,params:Z})=>M.YZ.create("Create volume from DSN6/BRIX",function(){var q=(0,O.A)(function*(Y){const ee=yield function R(j,Z){return M.YZ.create("Create Volume",function(){var q=(0,O.A)(function*(Y){const{header:ee,values:g}=j,_e=_.eB.create(ee.xlen,ee.ylen,ee.zlen);Z&&Z.voxelSize&&_.eB.mul(_e,_e,Z.voxelSize);const xe=_.eB.create((0,l.pu)(ee.alpha),(0,l.pu)(ee.beta),(0,l.pu)(ee.gamma)),le=I.O8.create("P 1",_e,xe),Ae=[ee.xRate,ee.yRate,ee.zRate],Be=[ee.xExtent,ee.yExtent,ee.zExtent],Ce=[ee.xStart,ee.yStart,ee.zStart],Re=_.eB.create(Ce[0]/Ae[0],Ce[1]/Ae[1],Ce[2]/Ae[2]),ke=_.eB.create(Be[0]/Ae[0],Be[1]/Ae[1],Be[2]/Ae[2]),we=_.qY.Space(Be,[0,1,2],Float32Array),Oe=_.qY.create(we,_.qY.Data1(g));return{label:Z?.label,entryId:Z?.entryId,grid:{transform:{kind:"spacegroup",cell:le,fractionalBox:I.DJ.create(Re,_.eB.add(_.eB.zero(),Re,ke))},cells:Oe,stats:{min:(0,d.GP)(g),max:(0,d._M)(g),mean:(0,d.VR)(g),sigma:void 0!==ee.sigma?ee.sigma:(0,d.C2)(g)}},sourceData:f.create(j),customProperties:new s.v,_propertyData:Object.create(null)}});return function(Y){return q.apply(this,arguments)}}())}(j.data,{...Z,label:j.data.name||j.label}).runInContext(Y);return new c.O.Volume.Data(ee,{label:ee.label||"Volume",description:`Volume ${j.data.header.xExtent}\xd7${j.data.header.yExtent}\xd7${j.data.header.zExtent}`})});return function(Y){return q.apply(this,arguments)}}()),dispose({b:j}){j?.data.customProperties.dispose()}}),N=c.H.BuiltIn({name:"volume-from-cube",display:{name:"Volume from Cube",description:"Create Volume from Cube data"},from:c.O.Format.Cube,to:c.O.Volume.Data,params:j=>({dataIndex:j?y.t.Select(0,j.data.header.dataSetIds.map((q,Y)=>[Y,`${q}`])):y.t.Numeric(0),entryId:y.t.Text("")})})({apply:({a:j,params:Z})=>M.YZ.create("Create volume from Cube",function(){var q=(0,O.A)(function*(Y){const ee=yield(0,p.C)(j.data,{...Z,label:j.data.name||j.label}).runInContext(Y);return new c.O.Volume.Data(ee,{label:ee.label||"Volume",description:`Volume ${j.data.header.dim[0]}\xd7${j.data.header.dim[1]}\xd7${j.data.header.dim[2]}`})});return function(Y){return q.apply(this,arguments)}}()),dispose({b:j}){j?.data.customProperties.dispose()}}),k=c.H.BuiltIn({name:"volume-from-dx",display:{name:"Parse DX",description:"Create volume from DX data."},from:c.O.Format.Dx,to:c.O.Volume.Data})({apply:({a:j})=>M.YZ.create("Parse DX",function(){var Z=(0,O.A)(function*(q){const Y=yield function E(j,Z){return M.YZ.create("Create Volume",(0,O.A)(function*(){const{header:q,values:Y}=j,ee=_.qY.Space(q.dim,[0,1,2],Float64Array),g=_.qY.create(ee,_.qY.Data1(Y)),_e=_.$I.fromTranslation((0,_.$I)(),q.min),xe=_.$I.fromScaling((0,_.$I)(),q.h);return _.$I.mul(_e,_e,xe),{label:Z?.label,entryId:Z?.entryId,grid:{transform:{kind:"matrix",matrix:_e},cells:g,stats:{min:(0,d.GP)(Y),max:(0,d._M)(Y),mean:(0,d.VR)(Y),sigma:(0,d.C2)(Y)}},sourceData:T.create(j),customProperties:new s.v,_propertyData:Object.create(null)}}))}(j.data,{label:j.data.name||j.label}).runInContext(q);return new c.O.Volume.Data(Y,{label:Y.label||"Volume",description:`Volume ${j.data.header.dim[0]}\xd7${j.data.header.dim[1]}\xd7${j.data.header.dim[2]}`})});return function(q){return Z.apply(this,arguments)}}()),dispose({b:j}){j?.data.customProperties.dispose()}}),H=c.H.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:c.O.Format.Cif,to:c.O.Volume.Data,params(j){if(!j)return{blockHeader:y.t.Optional(y.t.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),entryId:y.t.Text("")};const Z=j.data.blocks.slice(1);return{blockHeader:y.t.Optional(y.t.Select(Z[0]&&Z[0].header,Z.map(q=>[q.header,q.header]),{description:"Header of the block to parse"})),entryId:y.t.Text("")}}})({isApplicable:j=>j.data.blocks.length>0,apply:({a:j,params:Z})=>M.YZ.create("Parse density-server CIF",function(){var q=(0,O.A)(function*(Y){var ee;const g=Z.blockHeader||j.data.blocks[1].header,_e=j.data.blocks.find(ke=>ke.header===g);if(!_e)throw new Error(`Data block '${[g]}' not found.`);const xe=b.f$.schema.densityServer(_e),le=yield(0,D.G)(xe,{entryId:Z.entryId}).runInContext(Y),[Ae,Be,Ce]=le.grid.cells.space.dimensions,Re={label:null!==(ee=Z.entryId)&&void 0!==ee?ee:xe.volume_data_3d_info.name.value(0),description:`Volume ${Ae}\xd7${Be}\xd7${Ce}`};return new c.O.Volume.Data(le,Re)});return function(Y){return q.apply(this,arguments)}}()),dispose({b:j}){j?.data.customProperties.dispose()}}),$=c.H.BuiltIn({name:"volume-from-segmentation-cif",display:{name:"Volume from Segmentation CIF"},from:c.O.Format.Cif,to:c.O.Volume.Data,params(j){const Z=j?.data.blocks.slice(1);return{blockHeader:y.t.Optional(Z?y.t.Select(Z[0]&&Z[0].header,Z.map(Y=>[Y.header,Y.header]),{description:"Header of the block to parse"}):y.t.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),segmentLabels:y.t.ObjectList({id:y.t.Numeric(-1),label:y.t.Text("")},Y=>`${Y.id} = ${Y.label}`,{description:"Mapping of segment IDs to segment labels"}),ownerId:y.t.Text("",{isHidden:!0,description:"Reference to the object which manages this volume"})}}})({isApplicable:j=>j.data.blocks.length>0,apply:({a:j,params:Z})=>M.YZ.create("Parse segmentation CIF",function(){var q=(0,O.A)(function*(Y){const ee=Z.blockHeader||j.data.blocks[1].header,g=j.data.blocks.find(ke=>ke.header===ee);if(!g)throw new Error(`Data block '${[ee]}' not found.`);const _e=b.f$.schema.segmentation(g),xe={};for(const ke of Z.segmentLabels)xe[ke.id]=ke.label;const le=yield function Q(j,Z){return M.YZ.create("Create Segmentation Volume",function(){var q=(0,O.A)(function*(Y){var ee;const{volume_data_3d_info:g,segmentation_data_3d:_e}=j,xe=I.O8.create(g.spacegroup_number.value(0),_.eB.ofArray(g.spacegroup_cell_size.value(0)),_.eB.scale((0,_.eB)(),_.eB.ofArray(g.spacegroup_cell_angles.value(0)),Math.PI/180)),le=g.axis_order.value(0),Ae=_.qY.convertToCanonicalAxisIndicesFastToSlow(le),Be=Ae(g.sample_count.value(0)),Ce=_.qY.Space(Be,_.qY.invertAxisOrder(le),Float32Array),Re=_.qY.create(Ce,_.qY.Data1(_e.values.toArray({array:Float32Array}))),ke=_.eB.ofArray(Ae(g.origin.value(0))),we=_.eB.ofArray(Ae(g.dimensions.value(0))),Oe={label:Z?.label,entryId:void 0,grid:{transform:{kind:"spacegroup",cell:xe,fractionalBox:I.DJ.create(ke,_.eB.add((0,_.eB)(),ke,we))},cells:Re,stats:{min:0,max:1,mean:0,sigma:1}},sourceData:G.create(j),customProperties:new s.v,_propertyData:{ownerId:Z?.ownerId}};L.f.PickingGranularity.set(Oe,"object");const Se=new Map,Ve=new Map,{segment_id:Ne,set_id:K}=j.segmentation_data_table;for(let Ie=0,Le=Ne.rowCount;Ie{Ie.forEach(nt=>{Se.has(nt)||Se.set(nt,new Set),Se.get(nt).add(Le)})});const ne=[0,0,0],be=Re.space.getCoords,Te=Re.data,[ie,ue,re]=Oe.grid.cells.space.dimensions,ve=ie-1,ce=ue-1,se=re-1,ae={};Ve.forEach((Ie,Le)=>{ae[Le]=[ve,ce,se,-1,-1,-1]});for(let Ie=0,Le=Te.length;Ieje[3]&&(je[3]=ne[0]),ne[1]>je[4]&&(je[4]=ne[1]),ne[2]>je[5]&&(je[5]=ne[2])}const ge={};return Se.forEach((Ie,Le)=>{ge[Le]=I.DJ.create(_.eB.create(ve,ce,se),_.eB.create(-1,-1,-1))}),(0,w.IF)(ae,(Ie,Le)=>{Ve.get(parseInt(Le)).forEach(nt=>{const je=ge[nt];Ie[0]je.max[0]&&(je.max[0]=Ie[3]),Ie[4]>je.max[1]&&(je.max[1]=Ie[4]),Ie[5]>je.max[2]&&(je.max[2]=Ie[5])})}),L.f.Segmentation.set(Oe,{segments:Se,sets:Ve,bounds:ge,labels:null!==(ee=Z?.segmentLabels)&&void 0!==ee?ee:{}}),Oe});return function(Y){return q.apply(this,arguments)}}())}(_e,{segmentLabels:xe,ownerId:Z.ownerId}).runInContext(Y),[Ae,Be,Ce]=le.grid.cells.space.dimensions,Re={label:_e.volume_data_3d_info.name.value(0),description:`Segmentation ${Ae}\xd7${Be}\xd7${Ce}`};return new c.O.Volume.Data(le,Re)});return function(Y){return q.apply(this,arguments)}}()),dispose({b:j}){j?.data.customProperties.dispose()}}),J=c.H.BuiltIn({name:"assign-color-volume",display:{name:"Assign Color Volume",description:"Assigns another volume to be available for coloring."},from:c.O.Volume.Data,to:c.O.Volume.Data,isDecorator:!0,params(j,Z){if(!j)return{ref:y.t.Text()};const q=Z.state.data.select(t.QX.Generators.root.subtree().ofType(c.O.Volume.Data).filter(Y=>{var ee;return!(!Y.obj||null!==(ee=Y.obj)&&void 0!==ee&&ee.data.colorVolume||Y.obj===j)}));return 0===q.length?{ref:y.t.Text("",{isHidden:!0})}:{ref:y.t.Select(q[0].transform.ref,q.map(Y=>[Y.transform.ref,Y.obj.label]))}}})({apply:({a:j,params:Z,dependencies:q})=>M.YZ.create("Assign Color Volume",function(){var Y=(0,O.A)(function*(ee){if(!q||!q[Z.ref])throw new Error("Dependency not available.");const _e={...j.data,colorVolume:q[Z.ref].data};return new c.O.Volume.Data(_e,{label:j.label,description:"Volume + Colors"})});return function(ee){return Y.apply(this,arguments)}}())}),W=c.H.BuiltIn({name:"volume-transform",display:{name:"Transform Volume"},isDecorator:!0,from:c.O.Volume.Data,to:c.O.Volume.Data,params:{transform:y.t.MappedStatic("matrix",{matrix:y.t.Group({data:y.t.Mat4(_.$I.identity()),transpose:y.t.Boolean(!1)},{isFlat:!0})},{label:"Kind"})}})({canAutoUpdate:({newParams:j})=>"matrix"!==j.transform.name,apply({a:j,params:Z}){const q=(0,_.$I)();let Y={...j.data.grid.transform};_.$I.copy(q,Z.transform.params.data),Z.transform.params.transpose&&_.$I.transpose(q,q);const ee="matrix"===j.data.grid.transform.kind?j.data.grid.transform.matrix:L.x.getGridToCartesianTransform(j.data.grid);Y={kind:"matrix",matrix:_.$I.mul((0,_.$I)(),q,ee)};const g={...j.data,grid:{...j.data.grid,transform:Y}};return new c.O.Volume.Data(g,{label:j.label,description:`${j.description} [Transformed]`})}}),ye={Data:r,Misc:e,Model:v,Volume:o,Representation:n(8010),Shape:n(9646)}},6990:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{Download:()=>Vt,DownloadBlob:()=>Wt,ImportJson:()=>Or,ImportString:()=>Ir,LazyVolume:()=>To,ParseBlob:()=>kt,ParseCcp4:()=>Pr,ParseCif:()=>Ot,ParseCube:()=>An,ParseDsn6:()=>or,ParseDx:()=>Nr,ParseJson:()=>Jr,ParsePly:()=>Dr,ParsePrmtop:()=>On,ParsePsf:()=>jn,ParseTop:()=>fr,RawData:()=>yn,ReadFile:()=>Zt});var e=n(467),o=n(5732),r=n(5165),t=n(4824),A=n(355),y=n(1009),c=n(1241);const i=512;function v(un){return{xStart:parseInt(un.substr(10,5)),yStart:parseInt(un.substr(15,5)),zStart:parseInt(un.substr(20,5)),xExtent:parseInt(un.substr(32,5)),yExtent:parseInt(un.substr(38,5)),zExtent:parseInt(un.substr(42,5)),xRate:parseInt(un.substr(52,5)),yRate:parseInt(un.substr(58,5)),zRate:parseInt(un.substr(62,5)),xlen:parseFloat(un.substr(73,10)),ylen:parseFloat(un.substr(83,10)),zlen:parseFloat(un.substr(93,10)),alpha:parseFloat(un.substr(103,10)),beta:parseFloat(un.substr(113,10)),gamma:parseFloat(un.substr(123,10)),divisor:parseFloat(un.substr(138,12)),summand:parseInt(un.substr(155,8)),sigma:parseFloat(un.substr(170,12))}}function O(un,ct){const dt=ct?cn=>un.readInt16LE(2*cn):cn=>un.readInt16BE(2*cn),Yt=1/dt(17);return{xStart:dt(0),yStart:dt(1),zStart:dt(2),xExtent:dt(3),yExtent:dt(4),zExtent:dt(5),xRate:dt(6),yRate:dt(7),zRate:dt(8),xlen:dt(9)*Yt,ylen:dt(10)*Yt,zlen:dt(11)*Yt,alpha:dt(12)*Yt,beta:dt(13)*Yt,gamma:dt(14)*Yt,divisor:dt(15)/100,summand:dt(16),sigma:void 0}}function b(un){const{xExtent:ct,yExtent:dt,zExtent:Yt}=un;return{xBlocks:Math.ceil(ct/8),yBlocks:Math.ceil(dt/8),zBlocks:Math.ceil(Yt/8)}}function M(){return(M=(0,e.A)(function*(un){const{buffer:ct}=yield un.readBuffer(0,i),dt=String.fromCharCode.apply(null,ct),Yt=dt.startsWith(":-)"),cn=Yt||100===ct.readInt16LE(36);return{header:Yt?v(dt):O(ct,cn),littleEndian:cn}})).apply(this,arguments)}function l(){return(l=(0,e.A)(function*(un,ct,dt,Yt){Yt||c.N.flipByteOrderInPlace2(ct.buffer);const{divisor:cn,summand:xn,xExtent:Rn,yExtent:er,zExtent:ir}=un,{xBlocks:Yn,yBlocks:br,zBlocks:vr}=b(un);let Hr=0;for(let Mr=0;Mrbr.get(vr)})}function V(un,ct){const{elements:dt,tokenizer:Yt}=un,{count:cn,property:xn}=ct,Rn=R.tM.create(Yt.data,2*cn*3),er=new Uint32Array(cn+1);let ir=0;for(let vr=0,Hr=cn;vr{const Hr=er[vr]+1,Mr=br.value(Hr-1);for(let Fr=Hr,Sr=Hr+Mr;FrYt.get(cn)}}(Yt,cn.map(ir=>ir.name),xn);return A.H.success(er)})).apply(this,arguments)}const{readLine:H,skipWhitespace:$,eatValue:J,eatLine:W,markStart:te}=R._F,de=/\s+/,ye=/(^\*|REMARK)*/;function Z(un,ct){return q.apply(this,arguments)}function q(){return(q=(0,e.A)(function*(un,ct){const{tokenizer:dt}=un,Yt=R.tM.create(dt.data,2*ct),cn=R.tM.create(dt.data,2*ct),xn=R.tM.create(dt.data,2*ct),Rn=R.tM.create(dt.data,2*ct),er=R.tM.create(dt.data,2*ct),ir=R.tM.create(dt.data,2*ct),Yn=R.tM.create(dt.data,2*ct),br=R.tM.create(dt.data,2*ct),{position:vr}=dt,Hr=H(dt).trim();dt.position=vr;const Mr=7===Hr.split(de).length,Fr=Mr?6:8,{length:Sr}=dt;let Ur=0;return yield(0,t.yB)(un.runtimeCtx,1e5,void 0,Ro=>{const ro=Math.min(ct-Ur,Ro);for(let po=0;poRo.update({message:"Parsing...",current:dt.position,max:Sr})),{count:ct,atomId:(0,p.do)(Yt)(f.VP.Schema.int),segmentName:Mr?(0,p.do)(xn)(f.VP.Schema.str):(0,p.do)(cn)(f.VP.Schema.str),residueId:(0,p.do)(xn)(f.VP.Schema.int),residueName:Mr?(0,p.do)(xn)(f.VP.Schema.str):(0,p.do)(Rn)(f.VP.Schema.str),atomName:(0,p.do)(er)(f.VP.Schema.str),atomType:(0,p.do)(ir)(f.VP.Schema.str),charge:(0,p.do)(Yn)(f.VP.Schema.float),mass:(0,p.do)(br)(f.VP.Schema.float)}})).apply(this,arguments)}function Y(un,ct){return ee.apply(this,arguments)}function ee(){return(ee=(0,e.A)(function*(un,ct){const{tokenizer:dt}=un,Yt=R.tM.create(dt.data,2*ct),cn=R.tM.create(dt.data,2*ct),{length:xn}=dt;let Rn=0;return yield(0,t.yB)(un.runtimeCtx,10,void 0,er=>{const ir=Math.min(ct-Rn,er);for(let Yn=0;Yner.update({message:"Parsing...",current:dt.position,max:xn})),{count:ct,atomIdA:(0,p.do)(Yt)(f.VP.Schema.int),atomIdB:(0,p.do)(cn)(f.VP.Schema.int)}})).apply(this,arguments)}function g(un,ct){const dt=[];for(let Yt=0;Yt{const so=+ct[ro].trim().split(/\s+/g)[po];return Number.isNaN(so)?0:so},Yt=ro=>{const po=dt(ro+2,0),so=Se;return[Math.abs(po),we.eB.create(dt(ro+2,1)*so,dt(ro+2,2)*so,dt(ro+2,3)*so),po]},cn=ct[0].trim(),xn=ct[1].trim(),[Rn,er,ir]=Yt(0),[Yn,br]=Yt(1),[vr,Hr]=Yt(2),[Mr,Fr]=Yt(3),Sr=function Ne(un,ct,dt){const Yt=new Int32Array(ct),cn=new Float64Array(ct),xn=new Float32Array(ct),Rn=new Float32Array(ct),er=new Float32Array(ct);for(let ir=0;ir=0){let ro=dt(2,4);0===ro&&(ro=1);for(let po=0;po{const Yn=Math.min(Yt,Rn+er);for(let br=Rn;brer.update({current:Math.min(Yn,Yt),max:Yt}))}(Yt,cn,xn);return A.H.success({header:xn,atoms:Rn,values:er,name:ct})});return function(Yt){return dt.apply(this,arguments)}}())}var be=n(275);function Te(un){const ct={h:(0,we.eB)()};let dt=0,Yt=0;const cn=/\s+/g;for(;;){const xn=R._F.readLine(un);let Rn;if(xn.startsWith("object 1"))Rn=xn.split(cn),ct.dim=we.eB.create(parseInt(Rn[5]),parseInt(Rn[6]),parseInt(Rn[7]));else if(xn.startsWith("origin"))Rn=xn.split(cn),ct.min=we.eB.create(parseFloat(Rn[1]),parseFloat(Rn[2]),parseFloat(Rn[3]));else if(xn.startsWith("delta"))Rn=xn.split(cn),0===Yt?ct.h[0]=parseFloat(Rn[1]):1===Yt?ct.h[1]=parseFloat(Rn[2]):2===Yt&&(ct.h[2]=parseFloat(Rn[3])),Yt+=1;else if(xn.startsWith("object 3")){dt+=xn.length+1;break}dt+=xn.length+1}return{header:ct,headerByteCount:dt}}function re(){return(re=(0,e.A)(function*(un,ct,dt){yield un.update("Reading header...");const Yt=(0,R._F)(ct),{header:cn}=Te(Yt);yield un.update("Reading values...");const xn=yield function ie(un,ct,dt){const Yt=dt.dim[0]*dt.dim[1]*dt.dim[2],xn=new Float64Array(Yt);let Rn=0;return(0,t.yB)(un,1e6,xn,(er,ir)=>{const Yn=Math.min(Yt,Rn+er);for(let br=Rn;brer.update({current:Math.min(Yn,Yt),max:Yt}))}(un,Yt,cn);return A.H.success({header:cn,values:xn,name:dt})})).apply(this,arguments)}function ce(){return(ce=(0,e.A)(function*(un,ct,dt){yield un.update("Reading header...");const Yt=(0,be.ss)(ct,0,1e3),cn=(0,R._F)(Yt),{header:xn,headerByteCount:Rn}=Te(cn);yield un.update("Reading values...");const er=xn.dim[0]*xn.dim[1]*xn.dim[2],ir=new DataView(ct.buffer,ct.byteOffset+Rn),Yn=new Float64Array(er);for(let br=0;br{dt[cn]=0});let Yt=0;for(;ct.tokenEnd1e5&&ct.shouldUpdate&&(xn=dt.position,yield ct.update({current:dt.position,max:dt.length}));const Rn=nt(Yt.tokenizer).trim();if(Rn.startsWith("%VERSION"))cn.version=Rn.substring(8).trim();else if(Rn.startsWith("%FLAG")){const er=Rn.substring(5).trim();if(!nt(Yt.tokenizer).trim().startsWith("%FORMAT"))throw new Error("expected %FORMAT");if("TITLE"===er)cn.title=en(Yt);else if("POINTERS"===er)cn.pointers=Bt(Yt);else if("ATOM_NAME"===er){const Yn=pn(Yt,cn.pointers.NATOM,20,4);cn.atomName=(0,p.do)(Yn)(f.VP.Schema.str)}else if("CHARGE"===er){const Yn=pn(Yt,cn.pointers.NATOM,5,16);cn.charge=(0,p.do)(Yn)(f.VP.Schema.float)}else if("MASS"===er){const Yn=pn(Yt,cn.pointers.NATOM,5,16);cn.mass=(0,p.do)(Yn)(f.VP.Schema.float)}else if("RESIDUE_LABEL"===er){const Yn=pn(Yt,cn.pointers.NRES,20,4);cn.residueLabel=(0,p.do)(Yn)(f.VP.Schema.str)}else if("RESIDUE_POINTER"===er){const Yn=pn(Yt,cn.pointers.NRES,10,8);cn.residuePointer=(0,p.do)(Yn)(f.VP.Schema.int)}else if("BONDS_INC_HYDROGEN"===er){const Yn=pn(Yt,3*cn.pointers.NBONH,10,8);cn.bondsIncHydrogen=(0,p.do)(Yn)(f.VP.Schema.int)}else if("BONDS_WITHOUT_HYDROGEN"===er){const Yn=pn(Yt,3*cn.pointers.NBONA,10,8);cn.bondsWithoutHydrogen=(0,p.do)(Yn)(f.VP.Schema.int)}else if("RADII"===er){const Yn=pn(Yt,cn.pointers.NATOM,5,16);cn.radii=(0,p.do)(Yn)(f.VP.Schema.float)}else for(;dt.tokenEnd=ct.length));){const cn=ct.data[ct.position];if("["===cn)break;if(";"!==cn&&"*"!==cn){for(let xn=0;xn<2;++xn)switch(gt(ct),yt(ct),At(ct),xn){case 0:R.tM.add(dt,ct.tokenStart,ct.tokenEnd);break;case 1:R.tM.add(Yt,ct.tokenStart,ct.tokenEnd)}Gt(ct),yt(ct)}else sn(ct)}return f.XI.ofColumns(ut,{compound:(0,p.do)(dt)(f.VP.Schema.str),molCount:(0,p.do)(Yt)(f.VP.Schema.int)})}function Ct(){return(Ct=(0,e.A)(function*(un,ct){const dt=(0,R._F)(un),Yt=function rn(un,ct){return{tokenizer:un,runtimeCtx:ct}}(dt,ct),cn=Object.create(null);let xn=0;cn.compounds={};let Rn={},er="";function ir(){er&&Rn.atoms&&(cn.compounds[er]=Rn,Rn={},er="")}for(;dt.tokenEnd1e5&&ct.shouldUpdate&&(xn=dt.position,yield ct.update({current:dt.position,max:dt.length}));const Yn=Kt(Yt.tokenizer).trim();if(Yn&&"*"!==Yn[0]&&";"!==Yn[0]){if(Yn.startsWith("#include"))throw new Error("#include statements not allowed");if(Yn.startsWith("[")){const br=Yn.match(tt);if(null===br)throw new Error("expected field name");const vr=br[1];if("moleculetype"===vr)ir(),er=nn(Yt);else if("atoms"===vr)Rn.atoms=bn(Yt);else if("bonds"===vr)Rn.bonds=Dn(Yt);else if("system"===vr)cn.system=jt(Yt);else if("molecules"===vr)ir(),cn.molecules=It(Yt);else for(;dt.tokenEndt.YZ.create("Download",function(){var Yt=(0,e.A)(function*(cn){const xn=ke.V.getUrlAsset(dt.managers.asset,un.url),Rn=yield dt.managers.asset.resolve(xn,un.isBinary?"binary":"string").runInContext(cn);return ct.asset=Rn,un.isBinary?new Re.O.Data.Binary(Rn.data,{label:un.label?un.label:xn.url}):new Re.O.Data.String(Rn.data,{label:un.label?un.label:xn.url})});return function(cn){return Yt.apply(this,arguments)}}()),dispose({cache:un}){var ct;null===(ct=un?.asset)||void 0===ct||ct.dispose()},update:({oldParams:un,newParams:ct,b:dt})=>un.url!==ct.url||un.isBinary!==ct.isBinary?Ae.xE.UpdateResult.Recreate:un.label!==ct.label?(dt.label=ct.label||("string"==typeof ct.url?ct.url:ct.url.url),Ae.xE.UpdateResult.Updated):Ae.xE.UpdateResult.Unchanged}),Wt=Re.H.BuiltIn({name:"download-blob",display:{name:"Download Blob",description:"Download multiple string or binary data from the specified URLs."},from:Re.O.Root,to:Re.O.Data.Blob,params:{sources:Ce.t.ObjectList({id:Ce.t.Text("",{label:"Unique ID"}),url:Ce.t.Url("https://www.ebi.ac.uk/pdbe/static/entry/1cbs_updated.cif",{description:"Resource URL. Must be the same domain or support CORS."}),isBinary:Ce.t.Optional(Ce.t.Boolean(!1,{description:"If true, download data as binary (string otherwise)"})),canFail:Ce.t.Optional(Ce.t.Boolean(!1,{description:"Indicate whether the download can fail and not be included in the blob as a result."}))},un=>`${un.id}: ${un.url}`),maxConcurrency:Ce.t.Optional(Ce.t.Numeric(4,{min:1,max:12,step:1},{description:"The maximum number of concurrent downloads."}))}})({apply:({params:un,cache:ct},dt)=>t.YZ.create("Download Blob",function(){var Yt=(0,e.A)(function*(cn){const xn=[],Rn=yield(0,Be.Ui)(cn,dt.managers.asset,un.sources,un.maxConcurrency||4),er=[];for(let ir=0;irt.YZ.create("Raw Data",(0,e.A)(function*(){return"string"==typeof un.data?new Re.O.Data.String(un.data,{label:un.label?un.label:"String"}):Array.isArray(un.data)||un.data instanceof ArrayBuffer?new Re.O.Data.Binary(new Uint8Array(un.data),{label:un.label?un.label:"Binary"}):un.data instanceof Uint8Array?new Re.O.Data.Binary(un.data,{label:un.label?un.label:"Binary"}):void(0,ge.dr)(un.data)})),update:({oldParams:un,newParams:ct,b:dt})=>un.data!==ct.data?Ae.xE.UpdateResult.Recreate:un.label!==ct.label?(dt.label=ct.label||dt.label,Ae.xE.UpdateResult.Updated):Ae.xE.UpdateResult.Unchanged,customSerialization:{toJSON(un){if("string"==typeof un.data||Array.isArray(un.data))return un;if(un.data instanceof ArrayBuffer){const ct=new Uint8Array(un.data),dt=new Array(ct.length);for(let Yt=0,cn=ct.length;Ytun}}),Zt=Re.H.BuiltIn({name:"read-file",display:{name:"Read File",description:"Read string or binary data from the specified file"},from:Re.O.Root,to:[Re.O.Data.String,Re.O.Data.Binary],params:{file:Ce.t.File(),label:Ce.t.Optional(Ce.t.Text("")),isBinary:Ce.t.Optional(Ce.t.Boolean(!1,{description:"If true, open file as as binary (string otherwise)"}))}})({apply:({params:un,cache:ct},dt)=>t.YZ.create("Open File",function(){var Yt=(0,e.A)(function*(cn){if(null===un.file)return dt.log.error("No file(s) selected"),Ae.BM.Null;const xn=yield dt.managers.asset.resolve(un.file,un.isBinary?"binary":"string").runInContext(cn);return ct.asset=xn,un.isBinary?new Re.O.Data.Binary(xn.data,{label:un.label?un.label:un.file.name}):new Re.O.Data.String(xn.data,{label:un.label?un.label:un.file.name})});return function(cn){return Yt.apply(this,arguments)}}()),dispose({cache:un}){var ct;null===(ct=un?.asset)||void 0===ct||ct.dispose()},update({oldParams:un,newParams:ct,b:dt}){var Yt;return un.label!==ct.label?(dt.label=ct.label||(null===(Yt=un.file)||void 0===Yt?void 0:Yt.name)||"",Ae.xE.UpdateResult.Updated):Ae.xE.UpdateResult.Unchanged},isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user loaded files."})}),kt=Re.H.BuiltIn({name:"parse-blob",display:{name:"Parse Blob",description:"Parse multiple data enties"},from:Re.O.Data.Blob,to:Re.O.Format.Blob,params:{formats:Ce.t.ObjectList({id:Ce.t.Text("",{label:"Unique ID"}),format:Ce.t.Select("cif",[["cif","cif"]])},un=>`${un.id}: ${un.format}`)}})({apply:({a:un,params:ct},dt)=>t.YZ.create("Parse Blob",function(){var Yt=(0,e.A)(function*(cn){const xn=new Map;for(const er of ct.formats)xn.set(er.id,er.format);const Rn=[];for(const er of un.data){if(!xn.has(er.id))continue;const ir=yield("string"===er.kind?r.f$.parse(er.data):r.f$.parseBinary(er.data)).runInContext(cn);if(ir.isError)throw new Error(`${er.id}: ${ir.message}`);Rn.push({id:er.id,kind:"cif",data:ir.result})}return new Re.O.Format.Blob(Rn,{label:"Format Blob",description:`${Rn.length} ${1===Rn.length?"entry":"entries"}`})});return function(cn){return Yt.apply(this,arguments)}}())}),Ot=Re.H.BuiltIn({name:"parse-cif",display:{name:"Parse CIF",description:"Parse CIF from String or Binary data"},from:[Re.O.Data.String,Re.O.Data.Binary],to:Re.O.Format.Cif})({apply:({a:un})=>t.YZ.create("Parse CIF",function(){var ct=(0,e.A)(function*(dt){const Yt=yield("string"==typeof un.data?r.f$.parse(un.data):r.f$.parseBinary(un.data)).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return 0===Yt.result.blocks.length?Ae.BM.Null:new Re.O.Format.Cif(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),An=Re.H.BuiltIn({name:"parse-cube",display:{name:"Parse Cube",description:"Parse Cube from String data"},from:Re.O.Data.String,to:Re.O.Format.Cube})({apply:({a:un})=>t.YZ.create("Parse Cube",function(){var ct=(0,e.A)(function*(dt){const Yt=yield ne(un.data,un.label).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Cube(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),jn=Re.H.BuiltIn({name:"parse-psf",display:{name:"Parse PSF",description:"Parse PSF from String data"},from:[Re.O.Data.String],to:Re.O.Format.Psf})({apply:({a:un})=>t.YZ.create("Parse PSF",function(){var ct=(0,e.A)(function*(dt){const Yt=yield function le(un){return t.YZ.create("Parse PSF",function(){var ct=(0,e.A)(function*(dt){return yield function _e(un,ct){return xe.apply(this,arguments)}(un,dt)});return function(dt){return ct.apply(this,arguments)}}())}(un.data).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Psf(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),On=Re.H.BuiltIn({name:"parse-prmtop",display:{name:"Parse PRMTOP",description:"Parse PRMTOP from String data"},from:[Re.O.Data.String],to:Re.O.Format.Prmtop})({apply:({a:un})=>t.YZ.create("Parse PRMTOP",function(){var ct=(0,e.A)(function*(dt){const Yt=yield function _t(un){return t.YZ.create("Parse PRMTOP",function(){var ct=(0,e.A)(function*(dt){return yield function $e(un,ct){return mt.apply(this,arguments)}(un,dt)});return function(dt){return ct.apply(this,arguments)}}())}(un.data).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Prmtop(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),fr=Re.H.BuiltIn({name:"parse-top",display:{name:"Parse TOP",description:"Parse TOP from String data"},from:[Re.O.Data.String],to:Re.O.Format.Top})({apply:({a:un})=>t.YZ.create("Parse TOP",function(){var ct=(0,e.A)(function*(dt){const Yt=yield function $t(un){return t.YZ.create("Parse TOP",function(){var ct=(0,e.A)(function*(dt){return yield function Dt(un,ct){return Ct.apply(this,arguments)}(un,dt)});return function(dt){return ct.apply(this,arguments)}}())}(un.data).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Top(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),Dr=Re.H.BuiltIn({name:"parse-ply",display:{name:"Parse PLY",description:"Parse PLY from String data"},from:[Re.O.Data.String],to:Re.O.Format.Ply})({apply:({a:un})=>t.YZ.create("Parse PLY",function(){var ct=(0,e.A)(function*(dt){const Yt=yield function k(un){return t.YZ.create("Parse PLY",function(){var ct=(0,e.A)(function*(dt){return yield function U(un,ct){return N.apply(this,arguments)}(un,dt)});return function(dt){return ct.apply(this,arguments)}}())}(un.data).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Ply(Yt.result,{label:Yt.result.comments[0]||"PLY Data"})});return function(dt){return ct.apply(this,arguments)}}())}),Pr=Re.H.BuiltIn({name:"parse-ccp4",display:{name:"Parse CCP4/MRC/MAP",description:"Parse CCP4/MRC/MAP from Binary data"},from:[Re.O.Data.Binary],to:Re.O.Format.Ccp4})({apply:({a:un})=>t.YZ.create("Parse CCP4/MRC/MAP",function(){var ct=(0,e.A)(function*(dt){const Yt=yield o.qg(un.data,un.label).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Ccp4(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),or=Re.H.BuiltIn({name:"parse-dsn6",display:{name:"Parse DSN6/BRIX",description:"Parse CCP4/BRIX from Binary data"},from:[Re.O.Data.Binary],to:Re.O.Format.Dsn6})({apply:({a:un})=>t.YZ.create("Parse DSN6/BRIX",function(){var ct=(0,e.A)(function*(dt){const Yt=yield function C(un,ct){return function s(un,ct){return t.YZ.create("Parse DSN6/BRIX",function(){var dt=(0,e.A)(function*(Yt){try{return A.H.success(yield function u(un,ct,dt){return d.apply(this,arguments)}(un,ct,Yt))}catch(cn){return A.H.error(cn)}});return function(Yt){return dt.apply(this,arguments)}}())}(y.L.fromBuffer(c.N.fromUint8Array(un),ct),un.length)}(un.data,un.label).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Dsn6(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),Nr=Re.H.BuiltIn({name:"parse-dx",display:{name:"Parse DX",description:"Parse DX from Binary/String data"},from:[Re.O.Data.Binary,Re.O.Data.String],to:Re.O.Format.Dx})({apply:({a:un})=>t.YZ.create("Parse DX",function(){var ct=(0,e.A)(function*(dt){const Yt=yield function se(un,ct){return t.YZ.create("Parse DX",dt=>"string"==typeof un?function ue(un,ct,dt){return re.apply(this,arguments)}(dt,un,ct):function ve(un,ct,dt){return ce.apply(this,arguments)}(dt,un,ct))}(un.data,un.label).runInContext(dt);if(Yt.isError)throw new Error(Yt.message);return new Re.O.Format.Dx(Yt.result)});return function(dt){return ct.apply(this,arguments)}}())}),Ir=Re.H.BuiltIn({name:"import-string",display:{name:"Import String",description:"Import given data as a string"},from:Re.O.Root,to:Re.O.Data.String,params:{data:Ce.t.Value(""),label:Ce.t.Optional(Ce.t.Text(""))}})({apply:({params:{data:un,label:ct}})=>new Re.O.Data.String(un,{label:ct||""}),update:({oldParams:un,newParams:ct,b:dt})=>un.data!==ct.data?Ae.xE.UpdateResult.Recreate:un.label!==ct.label?(dt.label=ct.label||"",Ae.xE.UpdateResult.Updated):Ae.xE.UpdateResult.Unchanged,isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user imported strings."})}),Or=Re.H.BuiltIn({name:"import-json",display:{name:"Import JSON",description:"Import given data as a JSON"},from:Re.O.Root,to:Re.O.Format.Json,params:{data:Ce.t.Value({}),label:Ce.t.Optional(Ce.t.Text(""))}})({apply:({params:{data:un,label:ct}})=>new Re.O.Format.Json(un,{label:ct||""}),update:({oldParams:un,newParams:ct,b:dt})=>un.data!==ct.data?Ae.xE.UpdateResult.Recreate:un.label!==ct.label?(dt.label=ct.label||"",Ae.xE.UpdateResult.Updated):Ae.xE.UpdateResult.Unchanged,isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user imported JSON."})}),Jr=Re.H.BuiltIn({name:"parse-json",display:{name:"Parse JSON",description:"Parse JSON from String data"},from:[Re.O.Data.String],to:Re.O.Format.Json})({apply:({a:un})=>t.YZ.create("Parse JSON",function(){var ct=(0,e.A)(function*(dt){const Yt=yield new Response(un.data).json();return new Re.O.Format.Json(Yt)});return function(dt){return ct.apply(this,arguments)}}())}),To=Re.H.BuiltIn({name:"lazy-volume",display:{name:"Lazy Volume",description:"A placeholder for lazy loaded volume representation"},from:Re.O.Root,to:Re.O.Volume.Lazy,params:{url:Ce.t.Url(""),isBinary:Ce.t.Boolean(!1),format:Ce.t.Text("ccp4"),entryId:Ce.t.Value("",{isHidden:!0}),isovalues:Ce.t.ObjectList({type:Ce.t.Text("relative"),value:Ce.t.Numeric(0),color:Ce.t.Color(ae.s.black),alpha:Ce.t.Numeric(1,{min:0,max:1,step:.01}),volumeIndex:Ce.t.Numeric(0)},un=>`${un.type} ${un.value}`)}})({apply:({params:ct})=>t.YZ.create("Lazy Volume",function(){var dt=(0,e.A)(function*(Yt){const cn=Array.isArray(ct.entryId)?ct.entryId.join(", "):ct.entryId;return new Re.O.Volume.Lazy(ct,{label:`${cn||ct.url}`,description:"Lazy Volume"})});return function(Yt){return dt.apply(this,arguments)}}())})},1855:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{CoordinatesFromDcd:()=>Ht,CoordinatesFromNctraj:()=>kn,CoordinatesFromTrr:()=>ar,CoordinatesFromXtc:()=>Gn,CustomModelProperties:()=>ds,CustomStructureProperties:()=>ze,ModelFromTrajectory:()=>ri,MultiStructureSelectionFromExpression:()=>Wr,ShapeFromPly:()=>Rt,StructureComplexElement:()=>Ki,StructureComplexElementTypes:()=>Di,StructureComponent:()=>Mi,StructureFromModel:()=>Lo,StructureFromTrajectory:()=>fo,StructureSelectionFromBundle:()=>zo,StructureSelectionFromExpression:()=>hr,StructureSelectionFromScript:()=>no,TopologyFromPrmtop:()=>sr,TopologyFromPsf:()=>ur,TopologyFromTop:()=>Jn,TrajectoryFromBlob:()=>at,TrajectoryFromCifCore:()=>mo,TrajectoryFromCube:()=>Rr,TrajectoryFromGRO:()=>Cn,TrajectoryFromMOL:()=>vn,TrajectoryFromMOL2:()=>pr,TrajectoryFromMmCif:()=>Nt,TrajectoryFromModelAndCoordinates:()=>et,TrajectoryFromPDB:()=>qt,TrajectoryFromSDF:()=>nr,TrajectoryFromXYZ:()=>Un,TransformStructureConformation:()=>_o});var e=n(467),o=n(355),r=n(4824),t=n(3897);var c=n(6651),i=n(5555),v=n(2025);function M(X,pe){return{tokenizer:X,header:{title:"",timeInPs:0,hasVelocities:!1,precision:{position:0,velocity:0},box:[0,0,0]},numberOfAtoms:0,runtimeCtx:pe}}function I(X){const{tokenizer:pe,header:De}=X;let Ee=i._F.readLine(pe);0===Ee.trim().length&&(Ee=i._F.readLine(pe));const qe=Ee.lastIndexOf("t=");qe>=0?(De.timeInPs=parseFloat(Ee.substring(qe+2)),De.title=Ee.substring(0,qe).trim(),De.title&&","===De.title[De.title.length-1]&&(De.title=De.title.substring(0,De.title.length-1))):De.title=Ee}function l(X){const{tokenizer:pe}=X;i._F.markLine(pe);const De=i._F.getTokenString(pe);X.numberOfAtoms=parseInt(De)}function m(X){return u.apply(this,arguments)}function u(){return(u=(0,e.A)(function*(X){const{tokenizer:pe,numberOfAtoms:De}=X,Ee=yield i._F.readLinesAsync(pe,De,X.runtimeCtx,1e5),bt=pe.data.substring(Ee.indices[0],Ee.indices[1]).substring(20).match(/\.\d+/g),xt=6===bt.length;X.header.hasVelocities=xt,X.header.precision.position=bt[0].length-1,X.header.precision.velocity=xt?bt[3].length-1:0;const dn=X.header.precision.position+5,In=20+3*dn,Tn=X.header.precision.velocity+4,_n=function O(X){return function(pe,De,Ee){return function b(X,pe,De,Ee){const{data:qe,indices:bt,count:xt}=X,{valueType:hn}=Ee,dn="str"===hn?In=>{const Tn=bt[2*In]+pe,_n=bt[2*In+1];if(Tn>=_n)return"";let Wn=Tn+De;return Wn>_n&&(Wn=_n),(0,i.qk)(qe,Tn,Wn)}:"int"===hn?In=>{const Tn=bt[2*In]+pe;return Tn>bt[2*In+1]?0:(0,v.jj)(qe,Tn,Tn+De)}:In=>{const Tn=bt[2*In]+pe;return Tn>bt[2*In+1]?0:(0,v.Al)(qe,Tn,Tn+De)};return{schema:Ee,__array:void 0,isDefined:!0,rowCount:xt,value:dn,valueKind:In=>0,toArray:In=>c.iu.createAndFillArray(xt,dn,In),areValuesEqual:(In,Tn)=>dn(In)===dn(Tn)}}(X,pe,De,Ee)}}(Ee),Wn=c.VP.Undefined(X.numberOfAtoms,c.VP.Schema.float);return{count:X.numberOfAtoms,residueNumber:_n(0,5,c.VP.Schema.int),residueName:_n(5,5,c.VP.Schema.str),atomName:_n(10,5,c.VP.Schema.str),atomNumber:_n(15,5,c.VP.Schema.int),x:_n(20,dn,c.VP.Schema.float),y:_n(20+dn,dn,c.VP.Schema.float),z:_n(20+2*dn,dn,c.VP.Schema.float),vx:xt?_n(In,Tn,c.VP.Schema.float):Wn,vy:xt?_n(In+Tn,Tn,c.VP.Schema.float):Wn,vz:xt?_n(In+2*Tn,Tn,c.VP.Schema.float):Wn}})).apply(this,arguments)}function d(X){const{tokenizer:pe}=X,De=i._F.readLine(pe).trim().split(/\s+/g);X.header.box=[+De[0],+De[1],+De[2]]}function C(){return(C=(0,e.A)(function*(X,pe){const De=(0,i._F)(X);yield pe.update({message:"Parsing...",current:0,max:X.length});const Ee=[];for(;De.position{const Er="material"===qe?Xn:In[Xn];return D.Q1.fromRgb(bt.value(Er),xt.value(Er),hn.value(Er))},()=>1,Xn=>`${Tn} ${dn[Xn]}`,Wn)}function j(){let X,pe,De,Ee,qe,bt;return function(){var hn=(0,e.A)(function*(dn,In,Tn,_n){const Wn=In.source.getElement("vertex");if(!Wn)throw new Error("missing vertex element");const Xn=In.source.getElement("face");if(!Xn)throw new Error("missing face element");const Er=In.source.getElement("material");let $n=!1,mr=!1;return(!X||X!=X)&&($n=!0),(!pe||!L.t.isParamEqual(N.grouping,pe.grouping,Tn.grouping))&&($n=!0),(!pe||!L.t.isParamEqual(N.coloring,pe.coloring,Tn.coloring))&&(mr=!0),$n?(qe=de(Wn,Er,Tn),bt=function te(X,pe){const{grouping:De}=pe,{rowCount:Ee}=X,qe="vertex"===De.name?X.getProperty(De.params.group):void 0,bt="vertex"===De.name?(0,G.Mk)(De.params.group):"Vertex",xt=qe?qe.toArray({array:Uint32Array}):(0,T.WE)(new Uint32Array(Ee)),hn=qe?(0,T._M)(xt):Ee-1,dn=new Uint32Array(hn+1);for(let In=0,Tn=xt.length;In=Math.PI||_n>=Math.PI||Wn>=Math.PI?De():pe(S.eB.create(hn,dn,In),S.eB.create(Tn,_n,Wn))}}(ee||(ee={}));var g=n(2028);function le(X,pe,De,Ee){let qe=De,bt=Ee-1,xt=pe.charCodeAt(qe);for(;(32===xt||xt>=48&&xt<=57)&&qe<=bt;)xt=pe.charCodeAt(++qe);for(xt=pe.charCodeAt(bt);(32===xt||xt>=48&&xt<=57)&&bt>=qe;)xt=pe.charCodeAt(--bt);if(++bt,qe===bt||qe+1===bt)return i.tM.add(X,qe,bt);if(xt=pe.charCodeAt(qe),qe+2===bt){const hn=pe.charCodeAt(qe+1);if(!((78!==xt&&110!==xt||65!==hn&&97!==hn)&&(67!==xt&&99!==xt||76!==hn&&108!==hn)&&(70!==xt&&102!==xt||69!==hn&&101!==hn)&&(83!==xt&&115!==xt||73!==hn&&105!==hn)&&(66!==xt&&98!==xt||82!==hn&&114!==hn)&&(65!==xt&&97!==xt||83!==hn&&115!==hn)))return i.tM.add(X,qe,qe+2)}if(67===xt||99===xt||72===xt||104===xt||78===xt||110===xt||79===xt||111===xt||80===xt||112===xt||83===xt||115===xt)return i.tM.add(X,qe,qe+1);i.tM.add(X,qe,qe)}const Ae=new Set(["NA","CL","FE","SI","BR","AS","LI"]),Be=new Set(["C","H","N","O","P","S","F","B"]),Ce=/^[\s\d]+|[\s\d]+$/g;function Re(X,pe){const De=(X=X.replace(Ce,"").toUpperCase()).length;if(0===De||1===De||Ae.has(X))return X;if(3===De&&pe===X){if("SOD"===X)return"NA";if("POT"===X)return"K";if("CES"===X)return"CS";if("CAL"===X)return"CA";if("CLA"===X)return"CL"}return Be.has(X[0])?X[0]:""}var ke=n(2434),we=n(3671),Oe=n(1094);const Se="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ne=(0,Oe.E)(function Ve(X){let De=X,Ee=0,qe=Se[De%26];for(;De>=26;)De=Math.floor(De/26),qe+=Se[De%26],Ee+=1;return Ee>=5&&console.warn("getChainId overflow"),qe});var ue,X,K=n(3573),ne=n(2449),be=n(2921),Te=n(7024);function ie(X,pe){const De=X.atomName,Ee=X.residueName,qe=new Array(X.count),bt=new Array(X.count),xt=new Uint32Array(X.count),hn=new Uint32Array(X.count),dn=new Array(X.count),In=new K.V,Tn=new we.N(X.residueNumber,X.atomName);let _n="",Wn=0,Xn="",Er=0,$n=0,mr=-1;for(let Xr=0,io=X.count;Xr10*Xr,Float32Array)),Cartn_y:c.VP.ofFloatArray(c.VP.mapToArray(X.y,Xr=>10*Xr,Float32Array)),Cartn_z:c.VP.ofFloatArray(c.VP.mapToArray(X.z,Xr=>10*Xr,Float32Array)),id:c.VP.ofIntArray(hn),label_asym_id:gr,label_atom_id:De,label_comp_id:Ee,label_seq_id:c.VP.ofIntArray(xt),label_entity_id:c.VP.ofStringArray(qe),occupancy:c.VP.ofConst(1,X.count,c.VP.Schema.float),type_symbol:c.VP.ofStringArray(dn),pdbx_PDB_model_num:c.VP.ofConst(pe,X.count,c.VP.Schema.int)},X.count);return(0,ne.z)({entity:In.getEntityTable(),chem_comp:Tn.getChemCompTable(),atom_site:Ar})}(X=ue||(ue={})).is=function pe(Ee){return"gro"===Ee?.kind},X.fromGro=function De(Ee){return{kind:"gro",name:Ee.structures[0].header.title,data:Ee}};var ve=n(2524),ce=n(5165);function se(X,pe){const De=(bt,xt)=>(pe.substr(bt,xt)||"").trim(),Ee={entry_id:ce.RF.ofString(X),length_a:ce.RF.ofString(De(6,9)),length_b:ce.RF.ofString(De(15,9)),length_c:ce.RF.ofString(De(24,9)),angle_alpha:ce.RF.ofString(De(33,7)),angle_beta:ce.RF.ofString(De(40,7)),angle_gamma:ce.RF.ofString(De(47,7)),Z_PDB:ce.RF.ofString(De(66,4)),pdbx_unique_axis:ce.RF.ofString("?")},qe={entry_id:ce.RF.ofString(X),"space_group_name_H-M":ce.RF.ofString(De(55,11)),Int_Tables_number:ce.RF.ofString("?"),cell_setting:ce.RF.ofString("?"),space_group_name_Hall:ce.RF.ofString("?")};return[ce.xA.ofFields("cell",Ee),ce.xA.ofFields("symmetry",qe)]}function ae(X,pe){return{id:X,details:pe,groups:[]}}function ge(X,pe,De){const Ee=[];let qe,bt,xt,hn=1,dn=1;const In=$n=>X.data.substring(X.indices[2*$n],X.indices[2*$n+1]);for(let $n=pe;$n$n.id)),details:ce.RF.ofStrings(Ee.map($n=>$n.details))},_n=[];for(const $n of Ee)for(const mr of $n.groups)_n.push({assembly_id:$n.id,oper_expression:mr.operators.map(gr=>gr.id).join(","),asym_id_list:mr.chains.join(",")});const Wn={assembly_id:ce.RF.ofStrings(_n.map($n=>$n.assembly_id)),oper_expression:ce.RF.ofStrings(_n.map($n=>$n.oper_expression)),asym_id_list:ce.RF.ofStrings(_n.map($n=>$n.asym_id_list))},Xn=[];for(const $n of Ee)for(const mr of $n.groups)for(const gr of mr.operators){const Ar={id:""+gr.id,type:"?",name:"?",symmetry_operation:"?"};for(let Xr=0;Xr<3;Xr++){for(let io=0;io<3;io++)Ar[`matrix[${Xr+1}][${io+1}]`]=""+S.$I.getValue(gr.matrix,Xr,io);Ar[`vector[${Xr+1}]`]=""+S.$I.getValue(gr.matrix,Xr,3)}Xn.push(Ar)}const Er={id:ce.RF.ofStrings(Xn.map($n=>$n.id)),type:ce.RF.ofStrings(Xn.map($n=>$n.type)),name:ce.RF.ofStrings(Xn.map($n=>$n.name)),symmetry_operation:ce.RF.ofStrings(Xn.map($n=>$n.symmetry_operation))};for(let $n=0;$n<3;$n++){for(let gr=0;gr<3;gr++){const Ar=`matrix[${$n+1}][${gr+1}]`;Er[Ar]=ce.RF.ofStrings(Xn.map(Xr=>Xr[Ar]))}const mr=`vector[${$n+1}]`;Er[mr]=ce.RF.ofStrings(Xn.map(gr=>gr[mr]))}return[ce.xA.ofFields("pdbx_struct_assembly",Tn),ce.xA.ofFields("pdbx_struct_assembly_gen",Wn),ce.xA.ofFields("pdbx_struct_oper_list",Er)]}function Ie(X,pe,De){const Ee=[];let qe;const bt=In=>X.data.substring(X.indices[2*In],X.indices[2*In+1]);for(let In=pe;InIn.id)),code:ce.RF.ofStrings(xt.map(In=>In.code)),details:ce.RF.ofStrings(xt.map(In=>In.details))};for(let In=0;In<3;In++){for(let _n=0;_n<3;_n++){const Wn=`matrix[${In+1}][${_n+1}]`;dn[Wn]=ce.RF.ofStrings(xt.map(Xn=>Xn[Wn]))}const Tn=`vector[${In+1}]`;dn[Tn]=ce.RF.ofStrings(xt.map(_n=>_n[Tn]))}return[ce.xA.ofFields("struct_ncs_oper",dn)]}const Le={1:"helx_rh_al_p",2:"helx_rh_om_p",3:"helx_rh_pi_p",4:"helx_rh_ga_p",5:"helx_rh_3t_p",6:"helx_lh_al_p",7:"helx_lh_om_p",8:"helx_lh_ga_p",9:"helx_rh_27_p",10:"helx_rh_pp_p"};function je(X,pe,De){const Ee=[],qe=Tn=>X.data.substring(X.indices[2*Tn],X.indices[2*Tn+1]);for(let Tn=pe;TnTn.initChainID)),xt=ce.RF.ofStrings(Ee.map(Tn=>Tn.initResName)),hn=ce.RF.ofStrings(Ee.map(Tn=>Tn.endChainID)),dn=ce.RF.ofStrings(Ee.map(Tn=>Tn.endResName)),In={beg_label_asym_id:bt,beg_label_comp_id:xt,beg_label_seq_id:ce.RF.ofUndefined(Ee.length,c.VP.Schema.int),beg_auth_asym_id:bt,beg_auth_comp_id:xt,beg_auth_seq_id:ce.RF.ofStrings(Ee.map(Tn=>Tn.initSeqNum)),conf_type_id:ce.RF.ofStrings(Ee.map(Tn=>function nt(X){return Le[X]||"helx_p"}(Tn.helixClass))),details:ce.RF.ofStrings(Ee.map(Tn=>Tn.comment)),end_label_asym_id:hn,end_label_comp_id:dn,end_label_seq_id:ce.RF.ofUndefined(Ee.length,c.VP.Schema.int),end_auth_asym_id:hn,end_auth_comp_id:dn,end_auth_seq_id:ce.RF.ofStrings(Ee.map(Tn=>Tn.endSeqNum)),id:ce.RF.ofStrings(Ee.map(Tn=>Tn.serNum)),pdbx_beg_PDB_ins_code:ce.RF.ofStrings(Ee.map(Tn=>Tn.initICode)),pdbx_end_PDB_ins_code:ce.RF.ofStrings(Ee.map(Tn=>Tn.endICode)),pdbx_PDB_helix_class:ce.RF.ofStrings(Ee.map(Tn=>Tn.helixClass)),pdbx_PDB_helix_length:ce.RF.ofStrings(Ee.map(Tn=>Tn.length)),pdbx_PDB_helix_id:ce.RF.ofStrings(Ee.map(Tn=>Tn.helixID))};return ce.xA.ofFields("struct_conf",In)}function Lt(X,pe,De){const Ee=[],qe=Wn=>X.data.substring(X.indices[2*Wn],X.indices[2*Wn+1]);for(let Wn=pe;WnWn.initChainID)),xt=ce.RF.ofStrings(Ee.map(Wn=>Wn.initResName)),hn=ce.RF.ofStrings(Ee.map(Wn=>Wn.initSeqNum)),dn=ce.RF.ofStrings(Ee.map(Wn=>Wn.endChainID)),In=ce.RF.ofStrings(Ee.map(Wn=>Wn.endResName)),Tn=ce.RF.ofStrings(Ee.map(Wn=>Wn.endSeqNum)),_n={beg_label_asym_id:bt,beg_label_comp_id:xt,beg_label_seq_id:hn,beg_auth_asym_id:bt,beg_auth_comp_id:xt,beg_auth_seq_id:hn,end_label_asym_id:dn,end_label_comp_id:dn,end_label_seq_id:Tn,end_auth_asym_id:dn,end_auth_comp_id:In,end_auth_seq_id:Tn,id:ce.RF.ofStrings(Ee.map(Wn=>Wn.strand)),sheet_id:ce.RF.ofStrings(Ee.map(Wn=>Wn.sheetID)),pdbx_beg_PDB_ins_code:ce.RF.ofStrings(Ee.map(Wn=>Wn.initICode)),pdbx_end_PDB_ins_code:ce.RF.ofStrings(Ee.map(Wn=>Wn.endICode))};return ce.xA.ofFields("struct_sheet_range",_n)}const Je={MOL_ID:"",MOLECULE:"",CHAIN:"",FRAGMENT:"",SYNONYM:"",EC:"",ENGINEERED:"",MUTATION:"",OTHER_DETAILS:""};function en(X,pe,De){const Ee=dn=>X.data.substring(X.indices[2*dn],X.indices[2*dn+1]);let qe,bt={chains:[],description:""};const xt=[];for(let dn=pe;dnX.data.substring(X.indices[2*bt],X.indices[2*bt+1]),qe=new Map;for(let bt=pe;bt=66?i.tM.addToken(X.B_iso_or_equiv,i._F.trim(De,Ee+60,Ee+66)):i.tM.add(X.B_iso_or_equiv,0,0),bt&&i.tM.addToken(X.partial_charge,i._F.trim(De,Ee+70,Ee+76)),hn>=78&&!bt?(i._F.trim(De,Ee+76,Ee+78),De.tokenStart=78?(i._F.trim(De,Ee+76,Ee+78),De.tokenStarti.tM.create(X,2*pe);return{index:0,group_PDB:Ee(),id:[],auth_atom_id:Ee(),label_alt_id:Ee(),auth_comp_id:Ee(),auth_asym_id:Ee(),auth_seq_id:Ee(),pdbx_PDB_ins_code:Ee(),Cartn_x:Ee(),Cartn_y:Ee(),Cartn_z:Ee(),occupancy:Ee(),B_iso_or_equiv:Ee(),type_symbol:Ee(),pdbx_PDB_model_num:[],label_entity_id:[],partial_charge:Ee()}}(De,xt),Tn=function Me(X,pe){const Ee=()=>new Float32Array(pe),qe=()=>i.tM.create(X,2*pe);return{index:0,count:pe,id:[],type_symbol:qe(),pdbx_label_atom_id:qe(),pdbx_label_alt_id:qe(),pdbx_label_comp_id:qe(),pdbx_label_asym_id:qe(),pdbx_label_seq_id:qe(),pdbx_PDB_ins_code:qe(),"U[1][1]":Ee(),"U[2][2]":Ee(),"U[3][3]":Ee(),"U[1][2]":Ee(),"U[1][3]":Ee(),"U[2][3]":Ee(),pdbx_auth_seq_id:qe(),pdbx_auth_comp_id:qe(),pdbx_auth_asym_id:qe(),pdbx_auth_atom_id:qe()}}(De,hn),_n=new K.V,Wn=[],Xn=[];let mr,Er=0,$n="",gr=!1;const Ar=new Set;for(let yr=0,bo=pe.count;yrX.data.substring(X.indices[2*ko],X.indices[2*ko+1]),xt=[],hn=[],dn=[],In=[],Tn=[],_n=[],Wn=[],Xn=[],Er=[],$n=[],mr=[],gr=[],Ar=[],Xr=[],io=[11,16,21,26];let Mo=1;for(let ko=pe;ko_r||void 0===yr[_r]&&(xt.push(`covale${Mo}`),hn.push("covale"),dn.push(Ee.label_asym_id.str(uo)),In.push(Ee.label_seq_id.int(uo)),Tn.push(Ee.auth_seq_id.int(uo)),_n.push(Ee.label_atom_id.str(uo)),Wn.push(Ee.label_alt_id.str(uo)),Xn.push(Ee.pdbx_PDB_ins_code.str(uo)),Er.push(Ee.label_asym_id.str(_r)),$n.push(Ee.label_seq_id.int(_r)),mr.push(Ee.auth_seq_id.int(_r)),gr.push(Ee.label_atom_id.str(_r)),Ar.push(Ee.label_alt_id.str(_r)),Xr.push(Ee.pdbx_PDB_ins_code.str(_r)),Mo+=1))}}const Oo={id:ce.RF.ofStrings(xt),conn_type_id:ce.RF.ofStrings(hn),ptnr1_label_asym_id:ce.RF.ofStrings(dn),ptnr1_label_seq_id:ce.RF.ofNumbers(In),ptnr1_auth_seq_id:ce.RF.ofNumbers(Tn),ptnr1_label_atom_id:ce.RF.ofStrings(_n),pdbx_ptnr1_label_alt_id:ce.RF.ofStrings(Wn),pdbx_ptnr1_PDB_ins_code:ce.RF.ofStrings(Xn),ptnr2_label_asym_id:ce.RF.ofStrings(Er),ptnr2_label_seq_id:ce.RF.ofNumbers($n),ptnr2_auth_seq_id:ce.RF.ofNumbers(mr),ptnr2_label_atom_id:ce.RF.ofStrings(gr),pdbx_ptnr2_label_alt_id:ce.RF.ofStrings(Ar),pdbx_ptnr2_PDB_ins_code:ce.RF.ofStrings(Xr)};return ce.xA.ofFields("struct_conn",Oo)}(pe,mr[0],mr[1],Xo));const uo={entity:ce.xA.ofTable("entity",_n.getEntityTable()),chem_comp:ce.xA.ofTable("chem_comp",ko.getChemCompTable()),atom_site:ce.xA.ofFields("atom_site",Xo),atom_site_anisotrop:ce.xA.ofFields("atom_site_anisotrop",Ke(Tn))};for(const yr of Wn)uo[yr.name]=yr;return{header:X.id||"PDB",categoryNames:Object.keys(uo),categories:uo}}),At.apply(this,arguments)}var rn,Gt=n(4366);!function(X){X.is=function pe(Ee){return"pdb"===Ee?.kind},X.create=function De(Ee){return{kind:"pdb",name:Ee.id||"",data:Ee}}}(rn||(rn={}));var bn,Mt=n(3346);!function(X){X.is=function pe(Ee){return"psf"===Ee?.kind},X.fromPsf=function De(Ee){return{kind:"psf",name:Ee.id,data:Ee}}}(bn||(bn={}));var yn,jt=n(9136),It=n(9767),Dt=n(9498),Ct=n(1832),$t=n(9909),Vt=n(1295),Wt=n(7291);!function(X){function De(hn,dn){const In=Dt.e.is(dn)?dn:void 0,Tn=Dt.e.is(dn)?Dt.e.toExpression(dn):dn;return{script:In,expression:Tn,compiled:(0,Wt.wE)(Tn),originalStructure:hn,currentStructure:hn}}function Ee(hn,dn){return hn.compiled(new jt.cY(dn))}X.isUnchanged=function pe(hn,dn,In){return hn.currentStructure===In&&(Dt.e.is(dn)?!!hn.script&&Dt.e.areEqual(hn.script,dn):hn.expression===dn)},X.create=De,X.run=Ee,X.createAndRun=function qe(hn,dn){const In=De(hn,dn);return{entry:In,selection:Ee(In,hn)}},X.updateStructure=function bt(hn,dn){return hn.currentStructure=dn,hn.compiled(new jt.cY(dn))},X.updateStructureObject=function xt(hn,dn,In){const Tn=jt.cv.unionStructure(dn);hn.label=`${In||"Selection"}`,hn.description=jt.oE.elementDescription(Tn),hn.data=Tn}}(yn||(yn={}));var Zt=n(381),kt=n(9096),Ot=n(1372);function Dr(X){switch(X){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 ${X} is outside the 0-7 range, defaulting to 0.`),0}}function Pr(X,pe){const De=i.tM.create(X.data,2*pe),Ee=i.tM.create(X.data,2*pe),qe=i.tM.create(X.data,2*pe),bt=i.tM.create(X.data,2*pe),xt=i.tM.create(X.data,2*pe);for(let hn=0;hn0)for(let mr=0;mr0){const mr=c.VP.ofIntArray(c.VP.mapToArray(qe.atomIdxA,io=>io-1,Int32Array)),gr=c.VP.ofIntArray(c.VP.mapToArray(qe.atomIdxB,io=>io-1,Int32Array)),Ar=c.VP.asArrayColumn(qe.order,Int32Array),Xr=To.z.fromData({pairs:{indexA:mr,indexB:gr,order:Ar},count:Ee.count},{maxDistance:1/0});To.z.Provider.set($n.representative,Xr)}return $n}),ct.apply(this,arguments)}!function(X){X.is=function pe(Ee){return"mol"===Ee?.kind},X.create=function De(Ee){return{kind:"mol",name:Ee.title,data:Ee}}}(dt||(dt={}));var Mr,Ro,cn=n(5384),xn=n(9651),Rn=n(8593);function br(){return br=(0,e.A)(function*(X,pe,De){var Ee;const qe=X.atom_site._rowCount,bt=c.VP.ofConst("MOL",qe,c.VP.Schema.str),xt=c.VP.ofConst("A",qe,c.VP.Schema.str),hn=c.VP.ofConst(1,qe,c.VP.Schema.int),dn=function ir(X){const{cell:pe,space_group:De}=X,Ee=function er(X){const pe=X.it_number.value(0),De=X["name_h-m_full"].value(0).replace("-"," ");return X.it_number.isDefined?pe:De}(De),qe=cn.O8.create(Ee,S.eB.create(pe.length_a.value(0),pe.length_b.value(0),pe.length_c.value(0)),S.eB.scale((0,S.eB)(),S.eB.create(pe.angle_alpha.value(0),pe.angle_beta.value(0),pe.angle_gamma.value(0)),Math.PI/180));return{spacegroup:cn.is.create(qe),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}(X),In=dn.spacegroup.cell.fromFractional,{fract_x:Tn,fract_y:_n,fract_z:Wn}=X.atom_site,Xn=new Float32Array(qe),Er=new Float32Array(qe),$n=new Float32Array(qe),mr=(0,S.eB)();for(let bo=0;bo0){const bo=yr.representative;xn.i.Provider.set(bo,dn);const $r=X.geom_bond._rowCount;if($r>0){const _r={},{label:eo}=X.atom_site;for(let Es=0,ma=eo.rowCount;Es(0,ke.FW)(_n)),schema:c.VP.Schema.Aliased(c.VP.Schema.str)}),xt=c.VP.ofConst(1,De.count,c.VP.Schema.int),hn=c.XI.ofPartialColumns(ne.e.atom_site,{auth_asym_id:qe,auth_atom_id:bt,auth_comp_id:Ee,auth_seq_id:xt,Cartn_x:c.VP.asArrayColumn(De.x,Float32Array),Cartn_y:c.VP.asArrayColumn(De.y,Float32Array),Cartn_z:c.VP.asArrayColumn(De.z,Float32Array),id:c.VP.range(0,De.count-1),label_asym_id:qe,label_atom_id:bt,label_comp_id:Ee,label_seq_id:xt,label_entity_id:c.VP.ofConst("1",De.count,c.VP.Schema.str),occupancy:c.VP.ofConst(1,De.count,c.VP.Schema.float),type_symbol:bt,pdbx_PDB_model_num:c.VP.ofConst(1,De.count,c.VP.Schema.int)},De.count),dn=new K.V;dn.setNames([["MOL","Unknown Entity"]]),dn.getEntityId("MOL",0,"A");const In=new we.N(xt,bt);In.setNames([["MOL","Unknown Molecule"]]),In.add("MOL",0);const Tn=(0,ne.z)({entity:dn.getEntityTable(),chem_comp:In.getChemCompTable(),atom_site:hn});return yield(0,be.X)(Tn,Ro.create(X),pe)}),Ur.apply(this,arguments)}Rn._.Provider.formatRegistry.add("cifCore",function vr(X){if(!Mr.is(X.sourceData))return;const{atom_site:pe,atom_site_aniso:De}=X.sourceData.data.db;return{data:c.XI.ofPartialColumns(Rn._.Schema,{U:De.u},De._rowCount),elementToAnsiotrop:Rn._.getElementToAnsiotropFromLabel(pe.label,De.label)}},function Hr(X){return!!Mr.is(X.sourceData)&&X.sourceData.data.db.atom_site_aniso.u.isDefined}),function(X){X.is=function pe(Ee){return"cifCore"===Ee?.kind},X.fromFrame=function De(Ee,qe){return qe||(qe=ce.f$.schema.cifCore(Ee)),{kind:"cifCore",name:qe.database_code.depnum_ccdc_archive.value(0)||qe.database_code.depnum_ccdc_fiz.value(0)||qe.database_code.icsd.value(0)||qe.database_code.mdf.value(0)||qe.database_code.nbs.value(0)||qe.database_code.csd.value(0)||qe.database_code.cod.value(0)||qe._name,data:{db:qe,frame:Ee}}}}(Mr||(Mr={})),function(X){X.is=function pe(Ee){return"cube"===Ee?.kind},X.create=function De(Ee){return{kind:"cube",name:Ee.header.comment1,data:Ee}}}(Ro||(Ro={}));const{skipWhitespace:po,eatValue:so,markLine:ho,getTokenString:Bo,readLine:Go}=i._F;function We(X,pe){return{tokenizer:X,molecule:{mol_name:"",num_atoms:0,num_bonds:0,num_subst:0,num_feat:0,num_sets:0,mol_type:"",charge_type:"",status_bits:"",mol_comment:""},runtimeCtx:pe}}const Pt=/\s+/g;function Sn(X){const{tokenizer:pe,molecule:De}=X;for(;"@MOLECULE"!==Bo(pe)&&pe.position"))return;De.mol_type=qe,ho(pe);const bt=Bo(pe);if(bt.startsWith("@"))return;De.charge_type=bt,ho(pe);const xt=Bo(pe);if(xt.startsWith("@"))return;De.status_bits=xt,ho(pe);const hn=Bo(pe);hn.startsWith("@")||(De.mol_comment=hn)}function Nn(X){return Kn.apply(this,arguments)}function Kn(){return Kn=(0,e.A)(function*(X){const{tokenizer:pe,molecule:De}=X;for(;"@ATOM"!==Bo(pe)&&pe.position{const uo=Math.min(De.num_atoms-Oo,Xo);for(let yr=0;yrXo.update({message:"Parsing...",current:pe.position,max:Mo})),{count:De.num_atoms,atom_id:(0,pn.do)(dn)(c.VP.Schema.int),atom_name:(0,pn.do)(In)(c.VP.Schema.str),x:(0,pn.do)(Tn)(c.VP.Schema.float),y:(0,pn.do)(_n)(c.VP.Schema.float),z:(0,pn.do)(Wn)(c.VP.Schema.float),atom_type:hn>5?(0,pn.do)(Xn)(c.VP.Schema.str):io,subst_id:hn>6?(0,pn.do)(Er)(c.VP.Schema.int):Xr,subst_name:hn>7?(0,pn.do)($n)(c.VP.Schema.str):io,charge:hn>8?(0,pn.do)(mr)(c.VP.Schema.float):Ar,status_bit:hn>9?(0,pn.do)(gr)(c.VP.Schema.str):io}}),Kn.apply(this,arguments)}function dr(X){return xr.apply(this,arguments)}function xr(){return xr=(0,e.A)(function*(X){const{tokenizer:pe,molecule:De}=X;for(;"@BOND"!==Bo(pe)&&pe.position{const gr=Math.min(De.num_bonds-Er,mr);for(let Ar=0;Armr.update({message:"Parsing...",current:pe.position,max:Xn})),{count:De.num_bonds,bond_id:(0,pn.do)(dn)(c.VP.Schema.int),origin_atom_id:(0,pn.do)(In)(c.VP.Schema.int),target_atom_id:(0,pn.do)(Tn)(c.VP.Schema.int),bond_type:(0,pn.do)(_n)(c.VP.Schema.str),status_bits:hn>4?(0,pn.do)(Wn)(c.VP.Schema.str):c.VP.Undefined(De.num_bonds,c.VP.Schema.str)}}),xr.apply(this,arguments)}function Ft(X){const{tokenizer:pe}=X;for(;pe.positionMOLECULE"===Ee)return;if("@CRYSIN"===Ee)break;ho(pe)}if(pe.position>=pe.data.length)return;ho(pe);const De=Bo(pe).trim().split(Pt);return{a:parseFloat(De[0]),b:parseFloat(De[1]),c:parseFloat(De[2]),alpha:parseFloat(De[3]),beta:parseFloat(De[4]),gamma:parseFloat(De[5]),spaceGroup:parseInt(De[6],10),setting:parseInt(De[7],10)}}function ht(){return ht=(0,e.A)(function*(X,pe,De){const Ee=(0,i._F)(pe);X.update({message:"Parsing...",current:0,max:pe.length});const qe=[];for(;Ee.positionMOLECULE"!==Bo(Ee)&&Ee.position0){const gr=c.VP.ofIntArray(c.VP.mapToArray(hn.origin_atom_id,Xo=>Xo-1,Int32Array)),Ar=c.VP.ofIntArray(c.VP.mapToArray(hn.target_atom_id,Xo=>Xo-1,Int32Array)),Xr=hn.bond_id,io=c.VP.ofIntArray(c.VP.mapToArray(hn.bond_type,Xo=>{switch(Xo){case"ar":case"am":case"un":return 1;case"du":case"nc":return 0;default:return parseInt(Xo)}},Int8Array)),Mo=c.VP.ofIntArray(c.VP.mapToArray(hn.bond_type,Xo=>{switch(Xo){case"ar":case"am":return 17;case"du":case"nc":return 0;default:return 1}},Int8Array)),Oo=To.z.fromData({pairs:{key:Xr,indexA:gr,indexB:Ar,order:io,flag:Mo},count:xt.count},{maxDistance:dn?-1:1/0}),ko=mr.representative;if(To.z.Provider.set(ko,Oo),Gt.j.Provider.set(ko,{data:xt.charge,type:bt.charge_type}),dn){const Xo=on(dn);Xo&&xn.i.Provider.set(ko,Xo)}De.push(ko)}}return new jt.P4(De)}),fn.apply(this,arguments)}function on(X){if(1!==X.setting)return;const pe=cn.O8.create(X.spaceGroup,S.eB.create(X.a,X.b,X.c),S.eB.scale((0,S.eB)(),S.eB.create(X.alpha,X.beta,X.gamma),Math.PI/180));return{spacegroup:cn.is.create(pe),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}var En;!function(X){X.is=function pe(Ee){return"mol2"===Ee?.kind},X.create=function De(Ee){return{kind:"mol2",name:Ee.name,data:Ee}}}(En||(En={}));const Fe=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]),He=9;var Ye,rr;function ot(){throw new Error("(xdrfile error) Undefined error.")}function St(){return St=(0,e.A)(function*(X,pe){const De=new DataView(pe.buffer,pe.byteOffset),Ee={frames:[],boxes:[],times:[],timeOffset:0,deltaTime:0},qe=Ee.frames,bt=Ee.boxes,xt=Ee.times,hn=[0,0,0,0,0,0],dn=[0,0,0],In=[0,0,0],Tn=[0,0,0],_n=[.1,.1,.1],Wn=[.1,.1,.1];let Xn=0;const Er=Ye.buf;for(;;){let $n;const mr=De.getInt32(Xn+4);Xn+=12,xt.push(De.getFloat32(Xn)),Xn+=4;const gr=new Float32Array(9);for(let Ar=0;Ar<9;++Ar)gr[Ar]=10*De.getFloat32(Xn),Xn+=4;if(bt.push(gr),mr<=9){$n={count:mr/3,x:new Float32Array(mr/3),y:new Float32Array(mr/3),z:new Float32Array(mr/3)};for(let Ar=0;Ar16777215?(In[0]=Ye.sizeOfInt(dn[0]),In[1]=Ye.sizeOfInt(dn[1]),In[2]=Ye.sizeOfInt(dn[2]),Mo=0):Mo=Ye.sizeOfInts(3,dn);let Oo=De.getInt32(Xn);Xn+=4;let ko=Oo-1;ko=He>ko?He:ko;let Xo=Fe[ko]/2|0,uo=Fe[Oo]/2|0;Tn[0]=Tn[1]=Tn[2]=Fe[Oo];const yr=4*Math.ceil(De.getInt32(Xn)/4);Xn+=4;const bo=1/io;let $r=0,_r=0;for(_n[0]=_n[1]=_n[2]=0;_r0){_n[0]=_n[1]=_n[2]=0;for(let wi=0;wi<$r;wi+=3){if(Ye.decodeInts(pe,Xn,Oo,Tn,_n),_r++,_n[0]+=Wn[0]-uo,_n[1]+=Wn[1]-uo,_n[2]+=Wn[2]-uo,0===wi){let ui=_n[0];_n[0]=Wn[0],Wn[0]=ui,ui=_n[1],_n[1]=Wn[1],Wn[1]=ui,ui=_n[2],_n[2]=Wn[2],Wn[2]=ui,$n.x[Ar]=Wn[0]*bo,$n.y[Ar]=Wn[1]*bo,$n.z[Ar]=Wn[2]*bo,Ar++}else Wn[0]=_n[0],Wn[1]=_n[1],Wn[2]=_n[2];$n.x[Ar]=_n[0]*bo,$n.y[Ar]=_n[1]*bo,$n.z[Ar]=_n[2]*bo,Ar++}}else $n.x[Ar]=_n[0]*bo,$n.y[Ar]=_n[1]*bo,$n.z[Ar]=_n[2]*bo,Ar++;Oo+=Ho,Ho<0?(uo=Xo,Xo=Oo>He?Fe[Oo-1]/2|0:0):Ho>0&&(Xo=uo,uo=Fe[Oo]/2|0),Tn[0]=Tn[1]=Tn[2]=Fe[Oo],(0===Tn[0]||0===Tn[1]||0===Tn[2])&&ot()}Xn+=yr}for(let Ar=0;Ar=pe.length)break}return xt.length>=1&&(Ee.timeOffset=xt[0]),xt.length>=2&&(Ee.deltaTime=xt[1]-xt[0]),Ee}),St.apply(this,arguments)}function zt(X){let pe=X.position>=X.data.length-1?0:+i._F.readLine(X);isNaN(pe)&&(pe=0);const De=i._F.readLine(X),Ee=new Float64Array(pe),qe=new Float64Array(pe),bt=new Float64Array(pe),xt=new Array(pe);for(let hn=0;hn=_n&&Wn<32;)Wn++,_n<<=1;return Wn};const De=new Uint8Array(32);X.sizeOfInts=function Ee(Tn,_n){let Wn=1,Xn=0;De[0]=1;for(let $n=0;$n>=8;for(;0!==gr;)De[mr++]=255&gr,gr>>=8;Wn=mr}let Er=1;for(Wn--;De[Wn]>=Er;)Xn++,Er*=2;return Xn+8*Wn};const qe=new ArrayBuffer(24);X.buf=new Int32Array(qe);const bt=new Uint32Array(qe);function xt(Tn,_n,Wn){let Xn=Wn;const Er=(1<=8;)mr=mr<<8|Tn[_n+gr++],Ar|=mr>>$n<0&&($n>$n&(1<>bt[1]&255}X.decodeBits=xt;const dn=[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];X.decodeInts=function In(Tn,_n,Wn,Xn,Er){let $n=Wn,mr=0;for(dn[0]=0,dn[1]=0,dn[2]=0,dn[3]=0;$n>8;)dn[mr++]=hn(Tn,_n),$n-=8;$n>0&&(dn[mr++]=xt(Tn,_n,$n));for(let gr=2;gr>0;gr--){let Ar=0;const Xr=Xn[gr];for(let io=mr-1;io>=0;io--){Ar=Ar<<8|dn[io];const Mo=Ar/Xr|0;dn[io]=Mo,Ar-=Mo*Xr}Er[gr]=Ar}Er[0]=dn[0]|dn[1]<<8|dn[2]<<16|dn[3]<<24}}(Ye||(Ye={})),function(X){X.is=function pe(Ee){return"xyz"===Ee?.kind},X.create=function De(Ee){return{kind:"xyz",name:"xyz",data:Ee}}}(rr||(rr={}));const vo="$$$$";function lo(X){const pe=i._F.readLine(X).trim(),De=i._F.readLine(X).trim(),Ee=i._F.readLine(X).trim(),qe=i._F.readLine(X),bt=function tr(X){return X.trim().endsWith("V3000")}(qe),{atomCount:xt,bondCount:hn}=bt?function Tr(X){const pe=i.tM.create(X.data,1),De=i.tM.create(X.data,1);return i._F.eatLine(X),Ao(X),Ao(X),Ao(X),yo(X,pe),yo(X,De),i._F.eatLine(X),{atomCount:(0,pn.do)(pe)(c.VP.Schema.int).value(0),bondCount:(0,pn.do)(De)(c.VP.Schema.int).value(0)}}(X):function Do(X){return{atomCount:+X.substr(0,3),bondCount:+X.substr(3,3)}}(qe);if(Number.isNaN(xt)||Number.isNaN(hn)){for(;X.position ")){i.tM.add(pe,X.tokenStart+2,X.tokenEnd),i._F.markLine(X);const qe=X.tokenStart;let bt=X.tokenEnd,xt=!1;for(;X.position ")){i.tM.add(De,qe,bt),xt=!0;break}bt=X.tokenEnd}xt||i.tM.add(De,qe,bt)}}return{dataHeader:(0,pn.do)(pe)(c.VP.Schema.str),data:(0,pn.do)(De)(c.VP.Schema.str)}}(X);return{molFile:{title:pe,program:De,comment:Ee,atoms:In,bonds:Tn,formalCharges:_n},dataItems:Wn}}var Po;function Yr(X){return r.YZ.create("Parse SDF",pe=>un(X.molFile,Po.create(X),pe))}function Co(){return Co=(0,e.A)(function*(X){const pe=new DataView(X.buffer),De={frames:[],boxes:[],times:[],timeOffset:0,deltaTime:0},Ee=De.frames,qe=De.boxes,bt=De.times;let xt=0;for(;;){xt+=8;const hn=pe.getInt32(xt);xt+=4,xt+=hn;const dn=pe.getInt32(xt+8),In=pe.getInt32(xt+12),Tn=pe.getInt32(xt+16),_n=pe.getInt32(xt+28),Wn=pe.getInt32(xt+32),Xn=pe.getInt32(xt+36),Er=pe.getInt32(xt+40);xt+=52;const $n=dn/9,mr=3*Er;if(bt.push(8===$n?pe.getFloat64(xt):pe.getFloat32(xt)),xt+=2*$n,dn){const gr=new Float32Array(9);if(8===$n)for(let Ar=0;Ar<9;++Ar)gr[Ar]=10*pe.getFloat64(xt),xt+=8;else for(let Ar=0;Ar<9;++Ar)gr[Ar]=10*pe.getFloat32(xt),xt+=4;qe.push(gr)}if(xt+=In,xt+=Tn,_n){const gr=new Float32Array(Er),Ar=new Float32Array(Er),Xr=new Float32Array(Er);if(8===$n)for(let io=0;io>8&65280|ko>>24&255}const Mo=new Float32Array(X.buffer,xt,mr);for(let Oo=0;Oo=X.byteLength)break}return bt.length>=1&&(De.timeOffset=bt[0]),bt.length>=2&&(De.deltaTime=bt[1]-bt[0]),De}),Co.apply(this,arguments)}!function(X){X.is=function pe(Ee){return"sdf"===Ee?.kind},X.create=function De(Ee){return{kind:"sdf",name:Ee.molFile.title,data:Ee}}}(Po||(Po={}));const Yo=[];class ci{constructor(pe,De={}){this._mark=0,this._marks=[],this.offset=0,this.littleEndian=!0;let Ee=!1;void 0===pe&&(pe=8192),"number"==typeof pe?pe=new ArrayBuffer(pe):Ee=!0;const qe=De.offset?De.offset>>>0:0,bt=pe.byteLength-qe;let xt=qe;pe instanceof ArrayBuffer||(pe.byteLength!==pe.buffer.byteLength&&(xt=pe.byteOffset+qe),pe=pe.buffer),this._lastWrittenByte=Ee?bt:0,this.buffer=pe,this.length=bt,this.byteLength=bt,this.byteOffset=xt,this._data=new DataView(this.buffer,xt,bt)}available(pe=1){return this.offset+pe<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(pe){return void 0===pe&&(pe=1),this.offset+=pe,this}seek(pe){return this.offset=pe,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const pe=this._marks.pop();if(void 0===pe)throw new Error("Mark stack empty");return this.seek(pe),this}rewind(){return this.offset=0,this}ensureAvailable(pe){if(void 0===pe&&(pe=1),!this.available(pe)){const Ee=2*(this.offset+pe),qe=new Uint8Array(Ee);qe.set(new Uint8Array(this.buffer)),this.buffer=qe.buffer,this.length=this.byteLength=Ee,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(pe){void 0===pe&&(pe=1);const De=new Uint8Array(pe);for(let Ee=0;Eethis._lastWrittenByte&&(this._lastWrittenByte=this.offset)}}function Jo(X,pe){if(X)throw new TypeError("Not a valid NetCDF v3.x file: "+pe)}function Fi(X){X.offset%4!=0&&X.skip(4-X.offset%4)}function hi(X){const pe=X.readUint32(),De=X.readChars(pe);return Fi(X),De}const No={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function Ci(X){switch(Number(X)){case No.BYTE:return"byte";case No.CHAR:return"char";case No.SHORT:return"short";case No.INT:return"int";case No.FLOAT:return"float";case No.DOUBLE:return"double";default:return"undefined"}}function mi(X){switch(Number(X)){case No.BYTE:case No.CHAR:return 1;case No.SHORT:return 2;case No.INT:case No.FLOAT:return 4;case No.DOUBLE:return 8;default:return-1}}function qi(X){switch(String(X)){case"byte":return No.BYTE;case"char":return No.CHAR;case"short":return No.SHORT;case"int":return No.INT;case"float":return No.FLOAT;case"double":return No.DOUBLE;default:return-1}}function Oi(X,pe){if(1!==X){const De=new Array(X);for(let Ee=0;Ee6,"non valid type "+xt);const hn=X.readUint32(),dn=ti(X,xt,hn);Fi(X),pe[qe]={name:bt,type:Ci(xt),value:dn}}}return pe}class zr{constructor(pe){const De=new ci(pe);De.setBigEndian(),Jo("CDF"!==De.readChars(3),"should start with CDF");const Ee=De.readByte();Jo(Ee>2,"unknown version"),this.header=function Qi(X,pe){const De={recordDimension:{length:X.readUint32()}};De.version=pe;const Ee=function Hn(X){let pe,De,Ee;const qe=X.readUint32();if(qe===ni)return Jo(X.readUint32()!==ni,"wrong empty tag for list of dimensions"),[];{Jo(10!==qe,"wrong tag for list of dimensions");const bt=X.readUint32();pe=new Array(bt);for(let xt=0;xt6,"non valid type "+Wn);const Xn=X.readUint32();let Er=X.readUint32();2===De&&(Jo(Er>0,"offsets larger than 4GB not supported"),Er=X.readUint32()),Tn[0]===pe&&(qe+=Xn),bt[hn]={name:dn,dimensions:Tn,attributes:_n,type:Ci(Wn),size:Xn,offset:Er,record:Tn[0]===pe}}}return{variables:bt,recordStep:qe}}(X,Ee.recordId,pe);return De.variables=qe.variables,De.recordDimension.recordStep=qe.recordStep,De}(De,Ee),this.buffer=De}get version(){return 1===this.header.version?"classic format":"64-bit offset format"}get recordDimension(){return this.header.recordDimension}get dimensions(){return this.header.dimensions}get globalAttributes(){return this.header.globalAttributes}get variables(){return this.header.variables}hasDataVariable(pe){return this.header.variables&&-1!==this.header.variables.findIndex(De=>De.name===pe)}getDataVariable(pe){var De;let Ee;if(Ee="string"==typeof pe?null===(De=this.header.variables)||void 0===De?void 0:De.find(qe=>qe.name===pe):pe,void 0===Ee)throw new Error("variable not found");return this.buffer.seek(Ee.offset),Ee.record?function Pi(X,pe,De){const Ee=qi(pe.type),qe=pe.size?pe.size/mi(Ee):1,bt=De.length,xt=new Array(bt),hn=De.recordStep;for(let dn=0;dn=1&&(De.timeOffset=De.time[0]),De.time.length>=2&&(De.deltaTime=De.time[1]-De.time[0])),De}),kr.apply(this,arguments)}var Bi,Ei;!function(X){X.is=function pe(Ee){return"prmtop"===Ee?.kind},X.fromPrmtop=function De(Ee){return{kind:"prmtop",name:Ee.title.join(" ")||"PRMTOP",data:Ee}}}(Bi||(Bi={})),function(X){X.is=function pe(Ee){return"top"===Ee?.kind},X.fromTop=function De(Ee){return{kind:"top",name:Ee.system||"TOP",data:Ee}}}(Ei||(Ei={}));const Ht=Zt.H.BuiltIn({name:"coordinates-from-dcd",display:{name:"Parse DCD",description:"Parse DCD binary data."},from:[Zt.O.Data.Binary],to:Zt.O.Molecule.Coordinates})({apply:({a:X})=>r.YZ.create("Parse DCD",function(){var pe=(0,e.A)(function*(De){const Ee=yield function y(X){return r.YZ.create("Parse DCD",function(){var pe=(0,e.A)(function*(De){try{const Ee=function A(X){const pe=new DataView(X.buffer),De=Object.create(null),Ee=[];let qe=0;const bt=new Int32Array(X.buffer,0,23),xt=bt[0]!==pe.getInt32(0);if(84!==bt[0]){const $n=X.byteLength;for(let mr=0;mr<$n;mr+=4)pe.setFloat32(mr,pe.getFloat32(mr),!0)}if(84!==bt[0])throw new Error("dcd bad format, header block start");if("CORD"!==String.fromCharCode(pe.getUint8(4),pe.getUint8(5),pe.getUint8(6),pe.getUint8(7)))throw new Error("dcd bad format, format string");let dn=!1,In=!1,Tn=!1;if(0!==bt[22]&&(dn=!0,0!==bt[12]&&(In=!0),1===bt[13]&&(Tn=!0)),De.NSET=bt[2],De.ISTART=bt[3],De.NSAVC=bt[4],De.NAMNF=bt[10],De.DELTA=dn?pe.getFloat32(44,xt):pe.getFloat64(44,xt),84!==bt[22])throw new Error("dcd bad format, header block end");qe=qe+84+8;const _n=pe.getInt32(qe,xt),Wn=qe+1;if((_n-4)%80!=0)throw new Error("dcd bad format, title block start");if(De.TITLE=(0,t.$q)(X.subarray(Wn,_n)),pe.getInt32(Wn+_n+4-1,xt)!==_n)throw new Error("dcd bad format, title block end");if(qe=qe+_n+8,4!==pe.getInt32(qe,xt))throw new Error("dcd bad format, natom block start");if(De.NATOM=pe.getInt32(qe+4,xt),4!==pe.getInt32(qe+8,xt))throw new Error("dcd bad format, natom block end");if(qe=qe+4+8,De.NAMNF>0)throw new Error("dcd format with fixed atoms unsupported, aborting");const Xn=De.NATOM,Er=4*Xn;for(let $n=0,mr=De.NSET;$n=1?(Ee.ISTART-1)*qe.value:0,qe.unit),xt=[];for(let hn=0,dn=X.frames.length;hn=-1&&_n[1]<=1&&_n[3]>=-1&&_n[3]<=1&&_n[4]>=-1&&_n[4]<=1?ee.create(S.eB.create(_n[0],_n[2],_n[5]),S.eB.create((0,Y.pu)(90-90*Math.asin(_n[1])/Y.fC),(0,Y.pu)(90-90*Math.asin(_n[3])/Y.fC),(0,Y.pu)(90-90*Math.asin(_n[4])/Y.fC))):_n[0]<0||_n[1]<0||_n[2]<0||_n[3]<0||_n[4]<0||_n[5]<0||_n[3]>180||_n[4]>180||_n[5]>180?ee.fromBasis(S.eB.create(_n[0],_n[1],_n[3]),S.eB.create(_n[1],_n[2],_n[4]),S.eB.create(_n[3],_n[4],_n[5])):ee.create(S.eB.create(_n[0],_n[2],_n[5]),S.eB.create((0,Y.pu)((0,g.T)(_n[1],0,g.p)?90:_n[1]),(0,Y.pu)((0,g.T)(_n[3],0,g.p)?90:_n[3]),(0,Y.pu)((0,g.T)(_n[4],0,g.p)?90:_n[4])))}xt.push(Tn)}return q.E.create(xt,qe,bt)});return function(De){return pe.apply(this,arguments)}}())}(Ee.result).runInContext(De);return new Zt.O.Molecule.Coordinates(qe,{label:X.label,description:"Coordinates"})});return function(De){return pe.apply(this,arguments)}}())}),Gn=Zt.H.BuiltIn({name:"coordinates-from-xtc",display:{name:"Parse XTC",description:"Parse XTC binary data."},from:[Zt.O.Data.Binary],to:Zt.O.Molecule.Coordinates})({apply:({a:X})=>r.YZ.create("Parse XTC",function(){var pe=(0,e.A)(function*(De){const Ee=yield function vt(X){return r.YZ.create("Parse XTC",function(){var pe=(0,e.A)(function*(De){try{De.update({canAbort:!0,message:"Parsing trajectory..."});const Ee=yield function rt(X,pe){return St.apply(this,arguments)}(De,X);return o.H.success(Ee)}catch(Ee){return o.H.error(""+Ee)}});return function(De){return pe.apply(this,arguments)}}())}(X.data).runInContext(De);if(Ee.isError)throw new Error(Ee.message);const qe=yield function mn(X){return r.YZ.create("Parse XTC",function(){var pe=(0,e.A)(function*(De){yield De.update("Converting to coordinates");const Ee=(0,q.g)(X.deltaTime,"step"),qe=(0,q.g)(X.timeOffset,Ee.unit),bt=[];for(let xt=0,hn=X.frames.length;xtr.YZ.create("Parse TRR",function(){var pe=(0,e.A)(function*(De){const Ee=yield function Eo(X){return r.YZ.create("Parse TRR",function(){var pe=(0,e.A)(function*(De){try{De.update({canAbort:!0,message:"Parsing trajectory..."});const Ee=yield function jr(X){return Co.apply(this,arguments)}(X);return o.H.success(Ee)}catch(Ee){return o.H.error(""+Ee)}});return function(De){return pe.apply(this,arguments)}}())}(X.data).runInContext(De);if(Ee.isError)throw new Error(Ee.message);const qe=yield function Fo(X){return r.YZ.create("Parse TRR",function(){var pe=(0,e.A)(function*(De){yield De.update("Converting to coordinates");const Ee=(0,q.g)(X.deltaTime,"step"),qe=(0,q.g)(X.timeOffset,Ee.unit),bt=[];for(let xt=0,hn=X.frames.length;xtr.YZ.create("Parse NCTRAJ",function(){var pe=(0,e.A)(function*(De){const Ee=yield function Qr(X){return r.YZ.create("Parse NCTRAJ",function(){var pe=(0,e.A)(function*(De){try{De.update({canAbort:!0,message:"Parsing trajectory..."});const Ee=yield function lr(X){return kr.apply(this,arguments)}(X);return o.H.success(Ee)}catch(Ee){return o.H.error(""+Ee)}});return function(De){return pe.apply(this,arguments)}}())}(X.data).runInContext(De);if(Ee.isError)throw new Error(Ee.message);const qe=yield function vi(X){return r.YZ.create("Parse NCTRAJ",function(){var pe=(0,e.A)(function*(De){yield De.update("Converting to coordinates");const Ee=(0,q.g)(X.deltaTime,"step"),qe=(0,q.g)(X.timeOffset,Ee.unit),bt=[];for(let xt=0,hn=X.coordinates.length;xtr.YZ.create("Create Topology",function(){var pe=(0,e.A)(function*(De){const Ee=yield function Dn(X){return r.YZ.create("Parse PSF",function(){var pe=(0,e.A)(function*(De){const Ee=bn.fromPsf(X),qe=function nn(X){const pe=new Array(X.count),De=new Array(X.count),Ee=new Uint32Array(X.count),qe=new Uint32Array(X.count),bt=new Array(X.count),xt=new K.V,hn=new we.N(X.residueId,X.atomName);let dn="",In=0,Tn="",_n=0,Wn=X.segmentName.value(0),Xn=!1,Er=0,$n=-1;for(let gr=0,Ar=X.count;grbt.value(dn)-1,rowCount:bt.rowCount,schema:bt.schema}),indexB:c.VP.ofLambda({value:dn=>xt.value(dn)-1,rowCount:xt.rowCount,schema:xt.schema}),order:c.VP.ofConst(1,X.bonds.count,c.VP.Schema.int)};return Mt.c.create(X.id,qe,hn,Ee)});return function(De){return pe.apply(this,arguments)}}())}(X.data).runInContext(De);return new Zt.O.Molecule.Topology(Ee,{label:Ee.label||X.label,description:"Topology"})});return function(De){return pe.apply(this,arguments)}}())}),sr=Zt.H.BuiltIn({name:"topology-from-prmtop",display:{name:"PRMTOP Topology",description:"Create topology from PRMTOP."},from:[Zt.O.Format.Prmtop],to:Zt.O.Molecule.Topology})({apply:({a:X})=>r.YZ.create("Create Topology",function(){var pe=(0,e.A)(function*(De){const Ee=yield function Li(X){return r.YZ.create("Parse PRMTOP",function(){var pe=(0,e.A)(function*(De){const Ee=Bi.fromPrmtop(X),qe=function Ti(X){const{pointers:pe,residuePointer:De,residueLabel:Ee,atomName:qe}=X,bt=pe.NATOM,xt=pe.NRES,hn=new Uint32Array(bt),dn=[],In=(_r,eo,Ho)=>{const wi=Ee.value(_r);for(let ui=eo,Ss=Ho;ui_n_nr.YZ.create("Create Topology",function(){var pe=(0,e.A)(function*(De){const Ee=yield function ln(X){return r.YZ.create("Parse TOP",function(){var pe=(0,e.A)(function*(De){const Ee=Ei.fromTop(X),qe=function bi(X){const{molecules:pe,compounds:De}=X,Ee={};let qe=0;for(let _r=0,eo=pe._rowCount;_rr.YZ.create("Create trajectory from model/topology and coordinates",function(){var De=(0,e.A)(function*(Ee){const qe=pe[X.coordinatesRef].data,bt=yield function Br(X,pe,De){return st.apply(this,arguments)}(Ee,pe[X.modelRef],qe);return new Zt.O.Molecule.Trajectory(bt,{label:"Trajectory",description:`${bt.frameCount} model${1===bt.frameCount?"":"s"}`})});return function(Ee){return De.apply(this,arguments)}}())}),at=Zt.H.BuiltIn({name:"trajectory-from-blob",display:{name:"Parse Blob",description:"Parse format blob into a single trajectory."},from:Zt.O.Format.Blob,to:Zt.O.Molecule.Trajectory})({apply:({a:X})=>r.YZ.create("Parse Format Blob",function(){var pe=(0,e.A)(function*(De){const Ee=[];for(const bt of X.data){if("cif"!==bt.kind)continue;const xt=bt.data.blocks[0],hn=yield(0,ve.OQ)(xt).runInContext(De);if(0===hn.frameCount)throw new Error("No models found.");for(let dn=0;dn!0===Ee.loadAllBlocks})),blockIndex:L.t.Optional(L.t.Numeric(0,{min:0,step:1},{description:"Zero-based index of the block to parse. Only applies when Block Header parameter is not specified.",hideIf:Ee=>!0===Ee.loadAllBlocks||Ee.blockHeader}))};const{blocks:pe}=X.data,De=pe.map(Ee=>[Ee.header,Ee.header]);return De.push(["","[Use Block Index]"]),{loadAllBlocks:L.t.Optional(L.t.Boolean(!1,{description:"If True, ignore Block Header and Block Index parameters and parse all data blocks into a single trajectory."})),blockHeader:L.t.Optional(L.t.Select(pe[0]&&pe[0].header,De,{description:"Header of the block to parse. If not specifed, Block Index parameter applies.",hideIf:Ee=>!0===Ee.loadAllBlocks})),blockIndex:L.t.Optional(L.t.Numeric(0,{min:0,step:1,max:pe.length-1},{description:"Zero-based index of the block to parse. Only applies when Block Header parameter is not specified.",hideIf:Ee=>!0===Ee.loadAllBlocks||Ee.blockHeader}))}}})({isApplicable:X=>X.data.blocks.length>0,apply:({a:X,params:pe})=>r.YZ.create("Parse mmCIF",function(){var De=(0,e.A)(function*(Ee){var qe;let bt;if(pe.loadAllBlocks){const hn=[];for(const dn of X.data.blocks){Ee.shouldUpdate&&(yield Ee.update(`Parsing ${dn.header}...`));const In=yield(0,ve.OQ)(dn).runInContext(Ee);for(let Tn=0;TnTn.header===hn);if(!dn)throw new Error(`Data block '${[hn]}' not found.`);bt=!dn.categoryNames.includes("chem_comp_atom")||dn.categoryNames.includes("atom_site")||dn.categoryNames.includes("ihm_sphere_obj_site")||dn.categoryNames.includes("ihm_gaussian_obj_site")?yield(0,ve.OQ)(dn,X.data).runInContext(Ee):yield(0,ve.YG)(dn).runInContext(Ee)}if(0===bt.frameCount)throw new Error("No models found.");const xt=Et(bt);return new Zt.O.Molecule.Trajectory(bt,xt)});return function(Ee){return De.apply(this,arguments)}}())}),qt=Zt.H.BuiltIn({name:"trajectory-from-pdb",display:{name:"Parse PDB",description:"Parse PDB string and create trajectory."},from:[Zt.O.Data.String],to:Zt.O.Molecule.Trajectory,params:{isPdbqt:L.t.Boolean(!1)}})({apply:({a:X,params:pe})=>r.YZ.create("Parse PDB",function(){var De=(0,e.A)(function*(Ee){const qe=yield function a(X,pe,De=!1){return r.YZ.create("Parse PDB",function(){var Ee=(0,e.A)(function*(qe){return o.H.success({lines:yield i._F.readAllLinesAsync(X,qe),id:pe,isPdbqt:De})});return function(qe){return Ee.apply(this,arguments)}}())}(X.data,X.label,pe.isPdbqt).runInContext(Ee);if(qe.isError)throw new Error(qe.message);const bt=yield function tt(X){return r.YZ.create("Parse PDB",function(){var pe=(0,e.A)(function*(De){var Ee;yield De.update("Converting to mmCIF");const qe=yield function yt(X){return At.apply(this,arguments)}(X),bt=ve.K4.fromFrame(qe,void 0,rn.create(X)),xt=(0,ne.z)(bt.data.db,!0),hn=yield(0,be.X)(xt,bt,De),dn=null===(Ee=qe.categories.atom_site)||void 0===Ee?void 0:Ee.getField("partial_charge");if(dn&&1===hn.frameCount){const In=hn.representative,Tn=In.atomicHierarchy.atomSourceIndex,Wn=c.VP.isIdentity(Tn)?void 0:Tn.toArray({array:Int32Array}),Xn=dn.toFloatArray(),Er=c.VP.ofFloatArray(Wn?c.VP.mapToArray(Tn,$n=>Xn[$n],Float32Array):Xn);Gt.j.Provider.set(In,{data:Er,type:"GASTEIGER"})}return hn});return function(De){return pe.apply(this,arguments)}}())}(qe.result).runInContext(Ee),xt=Et(bt);return new Zt.O.Molecule.Trajectory(bt,xt)});return function(Ee){return De.apply(this,arguments)}}())}),Cn=Zt.H.BuiltIn({name:"trajectory-from-gro",display:{name:"Parse GRO",description:"Parse GRO string and create trajectory."},from:[Zt.O.Data.String],to:Zt.O.Molecule.Trajectory})({apply:({a:X})=>r.YZ.create("Parse GRO",function(){var pe=(0,e.A)(function*(De){const Ee=yield function h(X){return r.YZ.create("Parse GRO",function(){var pe=(0,e.A)(function*(De){return yield function s(X,pe){return C.apply(this,arguments)}(X,De)});return function(De){return pe.apply(this,arguments)}}())}(X.data).runInContext(De);if(Ee.isError)throw new Error(Ee.message);const qe=yield function re(X){return r.YZ.create("Parse GRO",function(){var pe=(0,e.A)(function*(De){const Ee=ue.fromGro(X),qe=[];for(let bt=0,xt=X.structures.length;btr.YZ.create("Parse XYZ",function(){var pe=(0,e.A)(function*(De){const Ee=yield function Vn(X){return r.YZ.create("Parse Mol",(0,e.A)(function*(){return function an(X){const pe=(0,i._F)(X),De=[];for(;;){const qe=zt(pe);if(0===qe.count)break;De.push(qe)}return o.H.success({molecules:De})}(X)}))}(X.data).runInContext(De);if(Ee.isError)throw new Error(Ee.message);const qe=yield function Vr(X){return r.YZ.create("Parse XYZ",pe=>function Fn(X,pe){const{molecules:De}=X;let Ee=0;for(const Xr of De)Ee+=Xr.count;const qe=new Array(Ee),bt=new Int32Array(Ee),xt=new Float32Array(Ee),hn=new Float32Array(Ee),dn=new Float32Array(Ee),In=new Int32Array(Ee);let Tn=0;for(let Xr=0;Xrr.YZ.create("Parse MOL",function(){var pe=(0,e.A)(function*(De){const Ee=yield function Jr(X){return r.YZ.create("Parse Mol",(0,e.A)(function*(){return function Or(X){const pe=(0,i._F)(X),De=i._F.readLine(pe).trim(),Ee=i._F.readLine(pe).trim(),qe=i._F.readLine(pe).trim(),bt=i._F.readLine(pe),xt=+bt.substr(0,3),hn=+bt.substr(3,3),dn=Pr(pe,xt),In=or(pe,hn),Tn=Ir(pe);return o.H.success({title:De,program:Ee,comment:qe,atoms:dn,bonds:In,formalCharges:Tn})}(X)}))}(X.data).runInContext(De);if(Ee.isError)throw new Error(Ee.message);const qe=yield function Yt(X){return r.YZ.create("Parse MOL",pe=>un(X,void 0,pe))}(Ee.result).runInContext(De),bt=Et(qe);return new Zt.O.Molecule.Trajectory(qe,bt)});return function(De){return pe.apply(this,arguments)}}())}),nr=Zt.H.BuiltIn({name:"trajectory-from-sdf",display:{name:"Parse SDF",description:"Parse SDF string and create trajectory."},from:[Zt.O.Data.String],to:Zt.O.Molecule.Trajectory})({apply:({a:X})=>r.YZ.create("Parse SDF",function(){var pe=(0,e.A)(function*(De){const Ee=yield function ao(X){return r.YZ.create("Parse Sdf",(0,e.A)(function*(){return function So(X){const pe=(0,i._F)(X),De=[];for(;pe.positionr.YZ.create("Parse MOL2",function(){var pe=(0,e.A)(function*(De){const Ee=yield function pt(X,pe){return r.YZ.create("Parse MOL2",function(){var De=(0,e.A)(function*(Ee){return yield function Qt(X,pe,De){return ht.apply(this,arguments)}(Ee,X,pe)});return function(Ee){return De.apply(this,arguments)}}())}(X.data,X.label).runInContext(De);if(Ee.isError)throw new Error(Ee.message);const qe=yield function Tt(X){return r.YZ.create("Parse MOL2",pe=>function Xt(X,pe){return fn.apply(this,arguments)}(X,pe))}(Ee.result).runInContext(De),bt=Et(qe);return new Zt.O.Molecule.Trajectory(qe,bt)});return function(De){return pe.apply(this,arguments)}}())}),Rr=Zt.H.BuiltIn({name:"trajectory-from-cube",display:{name:"Parse Cube",description:"Parse Cube file to create a trajectory."},from:Zt.O.Format.Cube,to:Zt.O.Molecule.Trajectory})({apply:({a:X})=>r.YZ.create("Parse MOL",function(){var pe=(0,e.A)(function*(De){const Ee=yield function ro(X){return r.YZ.create("Parse Cube",pe=>function Sr(X,pe){return Ur.apply(this,arguments)}(X,pe))}(X.data).runInContext(De),qe=Et(Ee);return new Zt.O.Molecule.Trajectory(Ee,qe)});return function(De){return pe.apply(this,arguments)}}())}),mo=Zt.H.BuiltIn({name:"trajectory-from-cif-core",display:{name:"Parse CIF Core",description:"Identify and create all separate models in the specified CIF data block"},from:Zt.O.Format.Cif,to:Zt.O.Molecule.Trajectory,params(X){if(!X)return{blockHeader:L.t.Optional(L.t.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."}))};const{blocks:pe}=X.data;return{blockHeader:L.t.Optional(L.t.Select(pe[0]&&pe[0].header,pe.map(De=>[De.header,De.header]),{description:"Header of the block to parse"}))}}})({apply:({a:X,params:pe})=>r.YZ.create("Parse CIF Core",function(){var De=(0,e.A)(function*(Ee){const qe=pe.blockHeader||X.data.blocks[0].header,bt=X.data.blocks.find(dn=>dn.header===qe);if(!bt)throw new Error(`Data block '${[qe]}' not found.`);const xt=yield function Fr(X){const pe=Mr.fromFrame(X);return r.YZ.create("Parse CIF Core",De=>function Yn(X,pe,De){return br.apply(this,arguments)}(pe.data.db,pe,De))}(bt).runInContext(Ee);if(0===xt.frameCount)throw new Error("No models found.");const hn=Et(xt);return new Zt.O.Molecule.Trajectory(xt,hn)});return function(Ee){return De.apply(this,arguments)}}())}),Uo=X=>X+1,qo=X=>X-1,ri=Zt.H.BuiltIn({name:"model-from-trajectory",display:{name:"Molecular Model",description:"Create a molecular model from specified index in a trajectory."},from:Zt.O.Molecule.Trajectory,to:Zt.O.Molecule.Model,params:X=>X?{modelIndex:L.t.Converted(Uo,qo,L.t.Numeric(1,{min:1,max:X.data.frameCount,step:1},{description:"Model Index",immediateUpdate:!0}))}:{modelIndex:L.t.Numeric(0,{},{description:"Zero-based index of the model",immediateUpdate:!0})}})({isApplicable:X=>X.data.frameCount>0,apply:({a:X,params:pe})=>r.YZ.create("Model from Trajectory",function(){var De=(0,e.A)(function*(Ee){let qe=pe.modelIndex%X.data.frameCount;qe<0&&(qe+=X.data.frameCount);const bt=yield r.YZ.resolveInContext(X.data.getFrameAtIndex(qe),Ee);return new Zt.O.Molecule.Model(bt,{label:`Model ${qe+1}`,description:1===X.data.frameCount?void 0:`of ${X.data.frameCount}`})});return function(Ee){return De.apply(this,arguments)}}()),interpolate:(X,pe,De)=>({modelIndex:De>=1?pe.modelIndex:X.modelIndex+Math.floor((pe.modelIndex-X.modelIndex+1)*De)}),dispose({b:X}){X?.data.customProperties.dispose()}}),fo=Zt.H.BuiltIn({name:"structure-from-trajectory",display:{name:"Structure from Trajectory",description:"Create a molecular structure from a trajectory."},from:Zt.O.Molecule.Trajectory,to:Zt.O.Molecule.Structure})({apply:({a:X})=>r.YZ.create("Build Structure",function(){var pe=(0,e.A)(function*(De){const Ee=yield jt.oE.ofTrajectory(X.data,De),qe={label:"Ensemble",description:jt.oE.elementDescription(Ee)};return new Zt.O.Molecule.Structure(Ee,qe)});return function(De){return pe.apply(this,arguments)}}()),dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),Lo=Zt.H.BuiltIn({name:"structure-from-model",display:{name:"Structure",description:"Create a molecular structure (model, assembly, or symmetry) from the specified model."},from:Zt.O.Molecule.Model,to:Zt.O.Molecule.Structure,params:X=>Vt.z.getParams(X&&X.data)})({canAutoUpdate:({oldParams:X,newParams:pe})=>Vt.z.canAutoUpdate(X.type,pe.type),apply:({a:X,params:pe},De)=>r.YZ.create("Build Structure",function(){var Ee=(0,e.A)(function*(qe){return Vt.z.create(De,qe,X.data,pe&&pe.type)});return function(qe){return Ee.apply(this,arguments)}}()),update:({a:X,b:pe,oldParams:De,newParams:Ee})=>(0,$t.bD)(De,Ee)?pe.data.model===X.data?Ct.xE.UpdateResult.Unchanged:jt.Kx.areHierarchiesEqual(X.data,pe.data.model)?(pe.data=pe.data.remapModel(X.data),Ct.xE.UpdateResult.Updated):Ct.xE.UpdateResult.Recreate:Ct.xE.UpdateResult.Recreate,dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),Ni=(0,S.eB)(),rs=(0,S.$I)(),Gi=(0,S.$I)(),_o=Zt.H.BuiltIn({name:"transform-structure-conformation",display:{name:"Transform Conformation"},isDecorator:!0,from:Zt.O.Molecule.Structure,to:Zt.O.Molecule.Structure,params:{transform:L.t.MappedStatic("components",{components:L.t.Group({axis:L.t.Vec3(S.eB.create(1,0,0)),angle:L.t.Numeric(0,{min:-180,max:180,step:.1}),translation:L.t.Vec3(S.eB.create(0,0,0))},{isFlat:!0}),matrix:L.t.Group({data:L.t.Mat4(S.$I.identity()),transpose:L.t.Boolean(!1)},{isFlat:!0})},{label:"Kind"})}})({canAutoUpdate:({newParams:X})=>"matrix"!==X.transform.name,apply({a:X,params:pe}){const De=(0,S.$I)();if("components"===pe.transform.name){const{axis:qe,angle:bt,translation:xt}=pe.transform.params,hn=X.data.boundary.sphere.center;S.$I.fromTranslation(rs,S.eB.negate(Ni,hn)),S.$I.fromTranslation(Gi,S.eB.add(Ni,hn,xt));const dn=S.$I.fromRotation((0,S.$I)(),Math.PI/180*bt,S.eB.normalize((0,S.eB)(),qe));S.$I.mul3(De,Gi,dn,rs)}else"matrix"===pe.transform.name&&(S.$I.copy(De,pe.transform.params.data),pe.transform.params.transpose&&S.$I.transpose(De,De));const Ee=jt.oE.transform(X.data,De);return new Zt.O.Molecule.Structure(Ee,{label:X.label,description:`${X.description} [Transformed]`})},dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),hr=Zt.H.BuiltIn({name:"structure-selection-from-expression",display:{name:"Selection",description:"Create a molecular structure from the specified expression."},from:Zt.O.Molecule.Structure,to:Zt.O.Molecule.Structure,params:()=>({expression:L.t.Value(It.J.struct.generator.all,{isHidden:!0}),label:L.t.Optional(L.t.Text("",{isHidden:!0}))})})({apply({a:X,params:pe,cache:De}){const{selection:Ee,entry:qe}=yn.createAndRun(X.data,pe.expression);if(De.entry=qe,jt.cv.isEmpty(Ee))return Ct.BM.Null;const bt=jt.cv.unionStructure(Ee),xt={label:`${pe.label||"Selection"}`,description:jt.oE.elementDescription(bt)};return new Zt.O.Molecule.Structure(bt,xt)},update:({a:X,b:pe,oldParams:De,newParams:Ee,cache:qe})=>{if(De.expression!==Ee.expression)return Ct.xE.UpdateResult.Recreate;const bt=qe.entry;if(bt.currentStructure===X.data)return Ct.xE.UpdateResult.Unchanged;const xt=yn.updateStructure(bt,X.data);return jt.cv.isEmpty(xt)?Ct.xE.UpdateResult.Null:(yn.updateStructureObject(pe,xt,Ee.label),Ct.xE.UpdateResult.Updated)},dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),Wr=Zt.H.BuiltIn({name:"structure-multi-selection-from-expression",display:{name:"Multi-structure Measurement Selection",description:"Create selection object from multiple structures."},from:Zt.O.Root,to:Zt.O.Molecule.Structure.Selections,params:()=>({selections:L.t.ObjectList({key:L.t.Text(void 0,{description:"A unique key."}),ref:L.t.Text(),groupId:L.t.Optional(L.t.Text()),expression:L.t.Value(It.J.struct.generator.empty)},X=>X.ref,{isHidden:!0}),isTransitive:L.t.Optional(L.t.Boolean(!1,{isHidden:!0,description:"Remap the selections from the original structure if structurally equivalent."})),label:L.t.Optional(L.t.Text("",{isHidden:!0}))})})({apply({params:X,cache:pe,dependencies:De}){const Ee=new Map,qe=[];let bt=0;for(const hn of X.selections){const{selection:dn,entry:In}=yn.createAndRun(De[hn.ref].data,hn.expression);Ee.set(hn.key,In);const Tn=jt.cv.toLociWithSourceUnits(dn);qe.push({key:hn.key,loci:Tn,groupId:hn.groupId}),bt+=jt.iZ.Loci.size(Tn)}return pe.entries=Ee,new Zt.O.Molecule.Structure.Selections(qe,{label:`${X.label||"Multi-selection"}`,description:`${X.selections.length} source(s), ${bt} element(s) total`})},update:({b:X,oldParams:pe,newParams:De,cache:Ee,dependencies:qe})=>{if(!!pe.isTransitive!=!!De.isTransitive)return Ct.xE.UpdateResult.Recreate;const bt=Ee.entries,xt=new Map,hn=new Map;for(const _n of X.data)hn.set(_n.key,_n);let dn=!1,In=0;const Tn=[];for(const _n of De.selections){const Wn=qe[_n.ref].data;let Xn=!1;if(bt.has(_n.key)){const Er=bt.get(_n.key);if(yn.isUnchanged(Er,_n.expression,Wn)&&hn.has(_n.key)){const $n=hn.get(_n.key);$n.groupId!==_n.groupId&&($n.groupId=_n.groupId,dn=!0),xt.set(_n.key,Er),Tn.push($n),In+=jt.iZ.Loci.size($n.loci);continue}if(Er.expression!==_n.expression)Xn=!0;else{let $n=!1;if(De.isTransitive)if(jt.oE.areUnitIdsAndIndicesEqual(Er.originalStructure,Wn)){const mr=yn.run(Er,Er.originalStructure);Er.currentStructure=Wn,xt.set(_n.key,Er);const gr=jt.iZ.Loci.remap(jt.cv.toLociWithSourceUnits(mr),Wn);Tn.push({key:_n.key,loci:gr,groupId:_n.groupId}),In+=jt.iZ.Loci.size(gr),dn=!0}else $n=!0;else $n=!0;if($n){dn=!0;const mr=yn.updateStructure(Er,Wn);xt.set(_n.key,Er);const gr=jt.cv.toLociWithSourceUnits(mr);Tn.push({key:_n.key,loci:gr,groupId:_n.groupId}),In+=jt.iZ.Loci.size(gr)}}}else Xn=!0;if(Xn){dn=!0;const{selection:Er,entry:$n}=yn.createAndRun(Wn,_n.expression);xt.set(_n.key,$n);const mr=jt.cv.toLociWithSourceUnits(Er);Tn.push({key:_n.key,loci:mr}),In+=jt.iZ.Loci.size(mr)}}return dn?(Ee.entries=xt,X.data=Tn,X.label=`${De.label||"Multi-selection"}`,X.description=`${Tn.length} source(s), ${In} element(s) total`,Ct.xE.UpdateResult.Updated):Ct.xE.UpdateResult.Unchanged}}),no=Zt.H.BuiltIn({name:"structure-selection-from-script",display:{name:"Selection",description:"Create a molecular structure from the specified script."},from:Zt.O.Molecule.Structure,to:Zt.O.Molecule.Structure,params:()=>({script:L.t.Script({language:"mol-script",expression:"(sel.atom.atom-groups :residue-test (= atom.resname ALA))"}),label:L.t.Optional(L.t.Text(""))})})({apply({a:X,params:pe,cache:De}){const{selection:Ee,entry:qe}=yn.createAndRun(X.data,pe.script);De.entry=qe;const bt=jt.cv.unionStructure(Ee),xt={label:`${pe.label||"Selection"}`,description:jt.oE.elementDescription(bt)};return new Zt.O.Molecule.Structure(bt,xt)},update:({a:X,b:pe,oldParams:De,newParams:Ee,cache:qe})=>{if(!Dt.e.areEqual(De.script,Ee.script))return Ct.xE.UpdateResult.Recreate;const bt=qe.entry;if(bt.currentStructure===X.data)return Ct.xE.UpdateResult.Unchanged;const xt=yn.updateStructure(bt,X.data);return yn.updateStructureObject(pe,xt,Ee.label),Ct.xE.UpdateResult.Updated},dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),zo=Zt.H.BuiltIn({name:"structure-selection-from-bundle",display:{name:"Selection",description:"Create a molecular structure from the specified structure-element bundle."},from:Zt.O.Molecule.Structure,to:Zt.O.Molecule.Structure,params:()=>({bundle:L.t.Value(jt.iZ.Bundle.Empty,{isHidden:!0}),label:L.t.Optional(L.t.Text("",{isHidden:!0}))})})({apply({a:X,params:pe,cache:De}){if(pe.bundle.hash!==X.data.hashCode)return Ct.BM.Null;De.source=X.data;const Ee=jt.iZ.Bundle.toStructure(pe.bundle,X.data);if(0===Ee.elementCount)return Ct.BM.Null;const qe={label:`${pe.label||"Selection"}`,description:jt.oE.elementDescription(Ee)};return new Zt.O.Molecule.Structure(Ee,qe)},update:({a:X,b:pe,oldParams:De,newParams:Ee,cache:qe})=>{if(!jt.iZ.Bundle.areEqual(De.bundle,Ee.bundle))return Ct.xE.UpdateResult.Recreate;if(Ee.bundle.hash!==X.data.hashCode)return Ct.xE.UpdateResult.Null;if(qe.source===X.data)return Ct.xE.UpdateResult.Unchanged;qe.source=X.data;const bt=jt.iZ.Bundle.toStructure(Ee.bundle,X.data);return 0===bt.elementCount?Ct.xE.UpdateResult.Null:(pe.label=`${Ee.label||"Selection"}`,pe.description=jt.oE.elementDescription(bt),pe.data=bt,Ct.xE.UpdateResult.Updated)},dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),Di={polymer:"polymer",protein:"protein",nucleic:"nucleic",water:"water",branched:"branched",ligand:"ligand","non-standard":"non-standard",coarse:"coarse","atomic-sequence":"atomic-sequence","atomic-het":"atomic-het",spheres:"spheres"},zi=L.t.objectToOptions(Di),Ki=Zt.H.BuiltIn({name:"structure-complex-element",display:{name:"Complex Element",description:"Create a molecular structure from the specified model."},from:Zt.O.Molecule.Structure,to:Zt.O.Molecule.Structure,params:{type:L.t.Select("atomic-sequence",zi,{isHidden:!0})}})({apply({a:X,params:pe}){let De,Ee;switch(pe.type){case"polymer":De=kt.Ou.polymer.query,Ee="Polymer";break;case"protein":De=kt.Ou.protein.query,Ee="Protein";break;case"nucleic":De=kt.Ou.nucleic.query,Ee="Nucleic";break;case"water":De=jt.RT.internal.water(),Ee="Water";break;case"branched":De=kt.Ou.branchedPlusConnected.query,Ee="Branched";break;case"ligand":De=kt.Ou.ligandPlusConnected.query,Ee="Ligand";break;case"non-standard":De=kt.Ou.nonStandardPolymer.query,Ee="Non-standard";break;case"coarse":De=kt.Ou.coarse.query,Ee="Coarse";break;case"atomic-sequence":De=jt.RT.internal.atomicSequence(),Ee="Sequence";break;case"atomic-het":De=jt.RT.internal.atomicHet(),Ee="HET Groups/Ligands";break;case"spheres":De=jt.RT.internal.spheres(),Ee="Coarse Spheres";break;default:(0,Ot.dr)(pe.type)}const qe=De(new jt.cY(X.data)),bt=jt.cv.unionStructure(qe);return 0===bt.elementCount?Ct.BM.Null:new Zt.O.Molecule.Structure(bt,{label:Ee,description:jt.oE.elementDescription(bt)})},dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),Mi=Zt.H.BuiltIn({name:"structure-component",display:{name:"Component",description:"A molecular structure component."},from:Zt.O.Molecule.Structure,to:Zt.O.Molecule.Structure,params:()=>({type:L.t.MappedStatic("static",{static:L.t.Text("polymer"),expression:L.t.Value(It.J.struct.generator.all),bundle:L.t.Value(jt.iZ.Bundle.Empty),script:L.t.Script({language:"mol-script",expression:"(sel.atom.all)"})},{isHidden:!0}),nullIfEmpty:L.t.Optional(L.t.Boolean(!0,{isHidden:!0})),label:L.t.Text("",{isHidden:!0})})})({apply:({a:X,params:pe,cache:De})=>function On(X,pe,De){De.source=X;let qe,Ee=jt.oE.Empty;switch(pe.type.name){case"static":{let xt;switch(pe.type.params){case"all":xt=kt.Ou.all.query,qe="All";break;case"polymer":xt=kt.Ou.polymer.query,qe="Polymer";break;case"protein":xt=kt.Ou.protein.query,qe="Protein";break;case"nucleic":xt=kt.Ou.nucleic.query,qe="Nucleic";break;case"water":xt=jt.RT.internal.water(),qe="Water";break;case"ion":xt=kt.Ou.ion.query,qe="Ion";break;case"lipid":xt=kt.Ou.lipid.query,qe="Lipid";break;case"branched":xt=kt.Ou.branchedPlusConnected.query,qe="Branched";break;case"ligand":xt=kt.Ou.ligandPlusConnected.query,qe="Ligand";break;case"non-standard":xt=kt.Ou.nonStandardPolymer.query,qe="Non-standard";break;case"coarse":xt=kt.Ou.coarse.query,qe="Coarse";break;default:(0,Ot.dr)(pe.type)}const hn=xt(new jt.cY(X));Ee=jt.cv.unionStructure(hn);break}case"script":case"expression":{const{selection:xt,entry:hn}=yn.createAndRun(X,pe.type.params);De.entry=hn,Ee=jt.cv.unionStructure(xt);break}case"bundle":if(pe.type.params.hash!==X.hashCode)break;Ee=jt.iZ.Bundle.toStructure(pe.type.params,X)}if(pe.nullIfEmpty&&0===Ee.elementCount)return Ct.BM.Null;const bt={label:`${pe.label||qe||"Component"}`,description:jt.oE.elementDescription(Ee)};return new Zt.O.Molecule.Structure(Ee,bt)}(X.data,pe,De),update:({a:X,b:pe,oldParams:De,newParams:Ee,cache:qe})=>function fr(X,pe,De,Ee,qe){if(De.type.name!==Ee.type.name)return Ct.xE.UpdateResult.Recreate;let bt=!1;switch(Ee.type.name){case"static":return De.type.params===Ee.type.params&&jt.oE.areEquivalent(X,qe.source)?pe.data.model===X.model?Ct.xE.UpdateResult.Unchanged:jt.Kx.areHierarchiesEqual(X.model,pe.data.model)?(pe.data=pe.data.remapModel(X.model),Ct.xE.UpdateResult.Updated):Ct.xE.UpdateResult.Recreate:Ct.xE.UpdateResult.Recreate;case"script":if(!Dt.e.areEqual(De.type.params,Ee.type.params))return Ct.xE.UpdateResult.Recreate;case"expression":{if(De.type.params!==Ee.type.params)return Ct.xE.UpdateResult.Recreate;if(X===qe.source)break;const hn=yn.updateStructure(qe.entry,X);qe.source=X,pe.data=jt.cv.unionStructure(hn),yn.updateStructureObject(pe,hn,Ee.label),bt=!0;break}case"bundle":if(X===qe.source&&jt.iZ.Bundle.areEqual(De.type.params,Ee.type.params))break;qe.source=X,Ee.type.params.hash!==X.hashCode?(bt=0!==pe.data.elementCount,pe.data=0===pe.data.elementCount?pe.data:jt.oE.Empty):(bt=!0,pe.data=jt.iZ.Bundle.toStructure(Ee.type.params,X))}if(bt){if(Ee.nullIfEmpty&&0===pe.data.elementCount)return Ct.xE.UpdateResult.Null;pe.description=jt.oE.elementDescription(pe.data)}return De.label!==Ee.label&&(bt=!0,pe.label=`${Ee.label||pe.label}`),bt?Ct.xE.UpdateResult.Updated:Ct.xE.UpdateResult.Unchanged}(X.data,pe,De,Ee,qe),dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}}),ds=Zt.H.BuiltIn({name:"custom-model-properties",display:{name:"Custom Model Properties"},isDecorator:!0,from:Zt.O.Molecule.Model,to:Zt.O.Molecule.Model,params:(X,pe)=>pe.customModelProperties.getParams(X?.data)})({apply:({a:X,params:pe},De)=>r.YZ.create("Custom Props",function(){var Ee=(0,e.A)(function*(qe){return yield he(X.data,De,qe,pe),new Zt.O.Molecule.Model(X.data,{label:X.label,description:X.description})});return function(qe){return Ee.apply(this,arguments)}}()),update:({a:X,b:pe,oldParams:De,newParams:Ee},qe)=>r.YZ.create("Custom Props",function(){var bt=(0,e.A)(function*(xt){pe.data=X.data,pe.label=X.label,pe.description=X.description;for(const hn of De.autoAttach){const dn=qe.customModelProperties.get(hn);dn&&X.data.customProperties.reference(dn.descriptor,!1)}return yield he(X.data,qe,xt,Ee),Ct.xE.UpdateResult.Updated});return function(xt){return bt.apply(this,arguments)}}()),dispose({b:X}){X?.data.customProperties.dispose()}});function he(X,pe,De,Ee){return fe.apply(this,arguments)}function fe(){return fe=(0,e.A)(function*(X,pe,De,Ee){const qe={runtime:De,assetManager:pe.managers.asset},{autoAttach:bt,properties:xt}=Ee;for(const hn of Object.keys(xt)){const dn=pe.customModelProperties.get(hn),In=xt[hn];if(bt.includes(hn)||dn.isHidden)try{yield dn.attach(qe,X,In,!0)}catch(Tn){pe.log.warn(`Error attaching model prop '${hn}': ${Tn}`)}else dn.set(X,In)}}),fe.apply(this,arguments)}const ze=Zt.H.BuiltIn({name:"custom-structure-properties",display:{name:"Custom Structure Properties"},isDecorator:!0,from:Zt.O.Molecule.Structure,to:Zt.O.Molecule.Structure,params:(X,pe)=>pe.customStructureProperties.getParams(X?.data.root)})({apply:({a:X,params:pe},De)=>r.YZ.create("Custom Props",function(){var Ee=(0,e.A)(function*(qe){return yield Ze(X.data.root,De,qe,pe),new Zt.O.Molecule.Structure(X.data,{label:X.label,description:X.description})});return function(qe){return Ee.apply(this,arguments)}}()),update:({a:X,b:pe,oldParams:De,newParams:Ee},qe)=>X.data!==pe.data?Ct.xE.UpdateResult.Recreate:r.YZ.create("Custom Props",function(){var bt=(0,e.A)(function*(xt){pe.data=X.data,pe.label=X.label,pe.description=X.description;for(const hn of De.autoAttach){const dn=qe.customStructureProperties.get(hn);dn&&X.data.customPropertyDescriptors.reference(dn.descriptor,!1)}return yield Ze(X.data.root,qe,xt,Ee),Ct.xE.UpdateResult.Updated});return function(xt){return bt.apply(this,arguments)}}()),dispose({b:X}){X?.data.customPropertyDescriptors.dispose()}});function Ze(X,pe,De,Ee){return it.apply(this,arguments)}function it(){return it=(0,e.A)(function*(X,pe,De,Ee){const qe={runtime:De,assetManager:pe.managers.asset},{autoAttach:bt,properties:xt}=Ee;for(const hn of Object.keys(xt)){const dn=pe.customStructureProperties.get(hn),In=xt[hn];if(bt.includes(hn)||dn.isHidden)try{yield dn.attach(qe,X,In,!0)}catch(Tn){pe.log.warn(`Error attaching structure prop '${hn}': ${Tn}`)}else dn.set(X,In)}}),it.apply(this,arguments)}const Rt=Zt.H.BuiltIn({name:"shape-from-ply",display:{name:"Shape from PLY",description:"Create Shape from PLY data"},from:Zt.O.Format.Ply,to:Zt.O.Shape.Provider,params:X=>({transforms:L.t.Optional(L.t.Value([],{isHidden:!0})),label:L.t.Optional(L.t.Text("",{isHidden:!0}))})})({apply:({a:X,params:pe})=>r.YZ.create("Create shape from PLY",function(){var De=(0,e.A)(function*(Ee){const qe=yield function Z(X,pe){return r.YZ.create("Shape Provider",function(){var De=(0,e.A)(function*(Ee){return{label:"Mesh",data:{source:X,transforms:pe?.transforms},params:U(X),getShape:j(),geometryUtils:f.e.Utils}});return function(Ee){return De.apply(this,arguments)}}())}(X.data,pe).runInContext(Ee);return new Zt.O.Shape.Provider(qe,{label:pe.label||"Shape"})});return function(Ee){return De.apply(this,arguments)}}())})},8010:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{ClippingStructureRepresentation3DFromBundle:()=>Li,ClippingStructureRepresentation3DFromScript:()=>Bi,EmissiveStructureRepresentation3DFromBundle:()=>Qr,EmissiveStructureRepresentation3DFromScript:()=>kr,ExplodeStructureRepresentation3D:()=>Qi,ModelUnitcell3D:()=>Ht,OverpaintStructureRepresentation3DFromBundle:()=>co,OverpaintStructureRepresentation3DFromScript:()=>qr,ShapeRepresentation3D:()=>ln,SpinStructureRepresentation3D:()=>Hn,StructureBoundingBox3D:()=>Gn,StructureRepresentation3D:()=>Wi,StructureSelectionsAngle3D:()=>kn,StructureSelectionsDihedral3D:()=>ur,StructureSelectionsDistance3D:()=>ar,StructureSelectionsLabel3D:()=>sr,StructureSelectionsOrientation3D:()=>Jn,StructureSelectionsPlane3D:()=>Br,SubstanceStructureRepresentation3DFromBundle:()=>Ti,SubstanceStructureRepresentation3DFromScript:()=>vi,ThemeStrengthRepresentation3D:()=>bi,TransparencyStructureRepresentation3DFromBundle:()=>lr,TransparencyStructureRepresentation3DFromScript:()=>zr,UnwindStructureAssemblyRepresentation3D:()=>Ri,VolumeRepresentation3D:()=>Ei,VolumeRepresentation3DHelpers:()=>Vi});var e=n(467),o=n(9136),r=n(6853),t=n(1832),A=n(4824),y=n(1930),c=n(8277),i=n(381),v=n(2745),O=n(542),b=n(2443),_=n(3558),M=n(1413),I=n(8353),l=n(5589),m=n(8013),u=n(6825),d=n(9909),s=n(2712),C=n(7684),h=n(3246),a=n(3543),S=n(5117),D=n(2629);function R(st,et,at={}){let Et=0;const Nt=new M.B,qt=b.YL.createState(),Cn=(0,I.Q0)(),Un=[];let vn,nr,pr=-1;const Rr=y.S.createEmpty();let qo,ri,mo=c.t.getDefaultValues(et.Params);at.modifyState&&b.YL.updateState(qt,at.modifyState(qt));const fo=l.rj.create();function Gi(_o,hr){return(0,h.xc)(_o)||_.y.isLoci(_o)&&_o.shape===nr?hr(a.IX.ofBounds(0,mo.instanceGranularity?nr.transforms.length:nr.groupCount*nr.transforms.length)):mo.instanceGranularity?function rs(_o,hr,Wr){let no=!1;if(!_.$.isLoci(_o)||_.$.isLociEmpty(_o)||_o.shape!==hr)return!1;for(const zo of _o.groups)Wr(a.IX.ofSingleton(zo.instance))&&(no=!0);return no}(_o,nr,hr):function f(st,et,at){if(!_.$.isLoci(st)||st.shape!==et)return!1;let Et=!1;const{groupCount:Nt}=et,{groups:qt}=st;for(const{ids:Cn,instance:Un}of qt)if(a.IX.is(Cn)){const vn=Un*Nt+a.IX.start(Cn),nr=Un*Nt+a.IX.end(Cn);at(a.IX.ofBounds(vn,nr))&&(Et=!0)}else for(let vn=0,nr=Cn.length;vn[_.y.Loci(nr)],eachLocation:_o=>{for(qo.reset();qo.hasNext;){const{location:hr,isSecondary:Wr}=qo.move();_o(hr,Wr)}},mark(_o,hr){if(!u.sY.is(qt.markerActions,hr))return!1;if(_.$.isLoci(_o)||_.y.isLoci(_o)){if(_o.shape!==nr)return!1}else if(!(0,h.xc)(_o))return!1;return S.b.mark(vn,_o,hr,Gi)},setState(_o){at.modifyState&&(_o=at.modifyState(_o)),vn&&(void 0!==_o.visible&&S.b.setVisibility(vn,_o.visible),void 0!==_o.alphaFactor&&S.b.setAlphaFactor(vn,_o.alphaFactor),void 0!==_o.pickable&&S.b.setPickable(vn,_o.pickable),void 0!==_o.colorOnly&&S.b.setColorOnly(vn,_o.colorOnly),void 0!==_o.overpaint&&S.b.setOverpaint(vn,_o.overpaint,Gi,!0),void 0!==_o.transparency&&S.b.setTransparency(vn,_o.transparency,Gi,!0),void 0!==_o.substance&&S.b.setSubstance(vn,_o.substance,Gi,!0),void 0!==_o.transform&&S.b.setTransform(vn,_o.transform)),b.YL.updateState(qt,_o)},setTheme(_o){D.Bb&&console.warn("The `ShapeRepresentation` theme is fixed to `ShapeGroupColorTheme` and `ShapeGroupSizeTheme`. Colors are taken from `Shape.getColor` and sizes from `Shape.getSize`")},destroy(){Un.length=0,vn&&(vn.state.disposed=!0,vn=void 0)}}}var p=n(4369),E=n(3596);const T=(0,p.$I)();class L{constructor(et){this.structure=et,this.groupUnitTransforms=[],this.unitOffsetMap=a.Yz.Mutable(),this.groupIndexMap=a.Yz.Mutable(),this._isIdentity=void 0,this.version=0,this.unitTransforms=new Float32Array(16*et.units.length),this.size=et.units.length,this.reset();let at=0;for(let Et=0,Nt=et.unitSymmetryGroups.length;EtR(Ne,ee.e.Utils)},Se={...we};function Ne(st,et,at,Et){const Nt=function Ve(st,et,at){const Et=g.P.createState(256,128,at),{fromFractional:Nt}=st.symmetry.spacegroup.cell;p.eB.copy(Be,st.ref),"center"===et.attachment?(p.eB.trunc(Be,Be),p.eB.subScalar(Be,Be,.5)):p.eB.floor(Be,Be),p.$I.fromTranslation(Ce,Be);const qt=(0,xe.b0)((0,xe.so)(Ae),Ce),Cn=Math.cbrt(st.symmetry.spacegroup.cell.volume)/300*et.cellScale;Et.currentGroup=1,g.P.addCage(Et,Nt,qt,Cn,2,20);const Un=w.f8.fromDimensionsAndTransform((0,w.f8)(),p.eB.unit,Nt);p.eB.transformMat4(Be,Be,Nt),w.f8.translate(Un,Un,Be),w.f8.expand(Un,Un,Cn);const vn=g.P.getMesh(Et);return vn.setBoundingSphere(Un),vn}(et,at,Et&&Et.geometry),qt=o.vw.getUnitcellLabel(et.symmetry);return _.y.create(qt,et,Nt,()=>at.cellColor,()=>1,()=>qt)}function K(st,et,at){const Et=(0,p.eB)();return"model"===at.ref&&p.eB.transformMat4(Et,o.Kx.getCenter(st),et.spacegroup.cell.toFractional),{symmetry:et,ref:Et}}var be=n(5315),Te=n(4255),ie=n(5821),ue=n(7377),re=n(3917),ve=n(6600);const ce={unitLabel:c.t.Text("\u212b",{isEssential:!0})},se={...be.q.Params,...ce,lineSizeAttenuation:c.t.Boolean(!0),linesColor:c.t.Color(v.s.lightgreen,{isEssential:!0}),linesSize:c.t.Numeric(.075,{min:.01,max:5,step:.01}),dashLength:c.t.Numeric(.2,{min:.01,max:.2,step:.01})},ae={...ve.$,...ce},ge={lines:(st,et)=>R(en,be.q.Utils,{modifyState:at=>({...at,markerActions:u.sY.Highlighting})}),text:(st,et)=>R(pn,Te.E.Utils,{modifyState:at=>({...at,markerActions:u.xi.None})})},Ie={...se,...ae,visuals:c.t.MultiSelect(["lines","text"],c.t.objectToOptions(ge))};function nt(st,et){const{sphereA:at,sphereB:Et,center:Nt}=et,[qt,Cn]=st.loci;return h.QN.getBoundingSphere(qt,at),h.QN.getBoundingSphere(Cn,Et),p.eB.add(Nt,at.center,Et.center),p.eB.scale(Nt,Nt,.5),et.distance=p.eB.distance(at.center,Et.center),et}const je=function Le(){return{sphereA:(0,w.f8)(),sphereB:(0,w.f8)(),center:(0,p.eB)(),distance:0}}();function Lt(st,et){return 1===st.pairs.length?`Distance ${(0,re.W8)(st.pairs[0],{unitLabel:et,measureOnly:!0})}`:`${st.pairs.length} Distances`}function en(st,et,at,Et){const Nt=function Je(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.pairs.length;Ntat.linesColor,()=>at.linesSize,Un=>(0,re.W8)(et.pairs[Un],at))}function pn(st,et,at,Et){const Nt=function Bt(st,et,at){const Et=ue.t.create(et,128,64,at);for(let Nt=0,qt=st.pairs.length;Ntat.textColor,()=>at.textSize,Un=>(0,re.W8)(et.pairs[Un],at))}function mt(st){return{pairs:[{loci:[st[0].loci,st[1].loci]}]}}function _t(st){return{triples:[{loci:[st[0].loci,st[1].loci,st[2].loci]}]}}function Me(st){return{quads:[{loci:[st[0].loci,st[1].loci,st[2].loci,st[3].loci]}]}}function Ke(st){return{infos:[{loci:st[0].loci}]}}function ut(st){return{locis:st.map(et=>et.loci)}}function Kt(st){return{locis:st.map(et=>et.loci)}}const sn={...ve.$},gt={text:(st,et)=>R(Mt,Te.E.Utils)},yt={...sn,scaleByRadius:c.t.Boolean(!0),visuals:c.t.MultiSelect(["text"],c.t.objectToOptions(gt)),snapshotKey:c.t.Text("",{isEssential:!0,disableInteractiveUpdates:!0,description:"Activate the snapshot with the provided key when clicking on the label"}),tooltip:c.t.Text("",{isEssential:!0,multiline:!0,disableInteractiveUpdates:!0,placeholder:"Tooltip",description:"Tooltip text to be displayed when hovering over the label"})},At=(0,w.f8)();function Gt(st,et=!1){return st.label||(0,re.YQ)(st.loci,{hidePrefix:!0,htmlStyling:!1,condensed:et})}function Mt(st,et,at,Et){var Nt,qt;const Cn=function tt(st,et,at){const Et=ue.t.create(et,128,64,at),Nt=et.customText.trim();for(let qt=0,Cn=st.infos.length;qtvn:nr?Rr=>nr:Rr=>Gt(et.infos[Rr]),_.y.create(Un,et,Cn,()=>at.textColor,()=>at.textSize,pr)}const bn=(0,p.eB)(),Dn=p.$I.identity(),jt=new Float32Array(18),It=new Uint8Array([0,1,2,3,4,5]);n(2802),n(4439),p.eB.zero(),p.eB.zero();const kt=(0,p.eB)(),Ot=(0,p.eB)(),An=(0,p.eB)(),jn=(0,p.eB)(),On=p.$I.identity(),fr=new Float32Array(24),Dr=new Uint8Array([0,1,0,3,0,6,1,2,1,7,2,3,2,4,3,5,4,5,4,7,5,6,6,7]);var or=n(4777);const Nr={color:c.t.Color(v.s.orange),scaleFactor:c.t.Numeric(1,{min:.1,max:10,step:.1}),radiusScale:c.t.Numeric(2,{min:.1,max:10,step:.1})},Ir={...ee.e.Params,...Nr},Or={...ee.e.Params,...Nr},Jr={...ee.e.Params,...Nr},To={axes:(st,et)=>R(Yt,ee.e.Utils),box:(st,et)=>R(Rn,ee.e.Utils),ellipsoid:(st,et)=>R(Yn,ee.e.Utils)},un={...Ir,...Or,...Jr,visuals:c.t.MultiSelect(["box"],c.t.objectToOptions(To))};function Yt(st,et,at,Et){const Nt=function dt(st,et,at){const Et=g.P.createState(256,128,at),Nt=o.iZ.Loci.getPrincipalAxesMany(st.locis);return w.n.scale(Nt.momentsAxes,Nt.momentsAxes,et.scaleFactor),Et.currentGroup=0,function Dt(st,et,at,Et,Nt){const{origin:qt,dirA:Cn,dirB:Un,dirC:vn}=et;p.eB.add(bn,qt,Cn),p.eB.toArray(p.eB.add(bn,qt,Cn),jt,0),p.eB.toArray(p.eB.sub(bn,qt,Cn),jt,3),p.eB.toArray(p.eB.add(bn,qt,Un),jt,6),p.eB.toArray(p.eB.sub(bn,qt,Un),jt,9),p.eB.toArray(p.eB.add(bn,qt,vn),jt,12),p.eB.toArray(p.eB.sub(bn,qt,vn),jt,15);const nr=(0,xe.L3)(jt,It),pr=w.n.volume(et),Rr=Math.cbrt(pr)/300*at;g.P.addCage(st,Dn,nr,Rr,Et,Nt)}(Et,Nt.momentsAxes,et.radiusScale,2,20),g.P.getMesh(Et)}(et,at,Et&&Et.geometry),qt=function ct(st){return`Principal Axes of ${(0,re.k7)(st,{countsOnly:!0})}`}(et.locis);return _.y.create(qt,et,Nt,()=>at.color,()=>1,()=>qt)}function Rn(st,et,at,Et){const Nt=function xn(st,et,at){const Et=g.P.createState(256,128,at),Nt=o.iZ.Loci.getPrincipalAxesMany(st.locis);return w.n.scale(Nt.boxAxes,Nt.boxAxes,et.scaleFactor),Et.currentGroup=0,function Pr(st,et,at,Et,Nt){const{origin:qt,dirA:Cn,dirB:Un,dirC:vn}=et,nr=p.eB.negate(Ot,Cn),pr=p.eB.negate(An,Un),Rr=p.eB.negate(jn,vn);let mo=0;const Uo=function(Lo,Ni,rs){p.eB.copy(kt,qt),p.eB.add(kt,kt,Lo),p.eB.add(kt,kt,Ni),p.eB.add(kt,kt,rs),p.eB.toArray(kt,fr,mo),mo+=3};Uo(Cn,Un,vn),Uo(Cn,Un,Rr),Uo(Cn,pr,Rr),Uo(Cn,pr,vn),Uo(nr,pr,Rr),Uo(nr,pr,vn),Uo(nr,Un,vn),Uo(nr,Un,Rr);const qo=(0,xe.L3)(fr,Dr),ri=w.n.volume(et),fo=Math.cbrt(ri)/300*at;g.P.addCage(st,On,qo,fo,Et,Nt)}(Et,Nt.boxAxes,et.radiusScale,2,20),g.P.getMesh(Et)}(et,at,Et&&Et.geometry),qt=function cn(st){return`Oriented Box of ${(0,re.k7)(st,{countsOnly:!0})}`}(et.locis);return _.y.create(qt,et,Nt,()=>at.color,()=>1,()=>qt)}function Yn(st,et,at,Et){const Nt=function ir(st,et,at){const Et=g.P.createState(256,128,at),qt=o.iZ.Loci.getPrincipalAxesMany(st.locis).boxAxes,{origin:Cn,dirA:Un,dirB:vn}=qt,nr=w.n.size((0,p.eB)(),qt);p.eB.scale(nr,nr,.5*et.scaleFactor);const pr=p.eB.create(nr[2],nr[1],nr[0]);return Et.currentGroup=0,(0,or.P)(Et,Cn,Un,vn,pr,2),g.P.getMesh(Et)}(et,at,Et&&Et.geometry),qt=function er(st){return`Oriented Ellipsoid of ${(0,re.k7)(st,{countsOnly:!0})}`}(et.locis);return _.y.create(qt,et,Nt,()=>at.color,()=>1,()=>qt)}var vr=n(4490);const Hr={radius:1,segments:36,thetaStart:0,thetaLength:2*Math.PI};function Mr(st){const{radius:et,segments:at,thetaStart:Et,thetaLength:Nt}={...Hr,...st},qt=Nt===2*Math.PI,Cn=qt?at+1:at+2,Un=new Float32Array(3*Cn),vn=new Float32Array(3*Cn),nr=new Uint32Array(3*at);Un[0]=0,Un[1]=0,Un[2]=0,vn[0]=0,vn[1]=1,vn[2]=0;for(let pr=0,Rr=3;prR(dr,be.q.Utils,{modifyState:at=>({...at,pickable:!1})}),arc:(st,et)=>R(Ft,be.q.Utils,{modifyState:at=>({...at,pickable:!1})}),sector:(st,et)=>R(ht,ee.e.Utils,{modifyProps:at=>({...at,alpha:at.sectorOpacity}),modifyState:at=>({...at,markerActions:u.sY.Highlighting})}),text:(st,et)=>R(Xt,Te.E.Utils,{modifyState:at=>({...at,markerActions:u.xi.None})})},ho={...Ro,...ro,...po,...ve.$,visuals:c.t.MultiSelect(["vectors","sector","text"],c.t.objectToOptions(so))},Go=(0,p.eB)(),Wo=(0,p.$I)();function We(st,et,at){const{sphereA:Et,sphereB:Nt,sphereC:qt}=et,{arcDirA:Cn,arcDirC:Un,arcNormal:vn}=et,[nr,pr,Rr]=st.loci;h.QN.getBoundingSphere(nr,Et),h.QN.getBoundingSphere(pr,Nt),h.QN.getBoundingSphere(Rr,qt),p.eB.sub(Cn,Et.center,Nt.center),p.eB.sub(Un,qt.center,Nt.center),p.eB.cross(vn,Cn,Un);const Uo=Math.min(p.eB.magnitude(Cn),p.eB.magnitude(Un))*at;return et.radius=Uo,et.angle=p.eB.angle(Cn,Un),et}function Pt(st,et){const{radius:at,angle:Et}=st,Nt=et?(0,vr.N7)(Et,at)/et:32;p.$I.targetTo(Wo,st.sphereB.center,st.sphereA.center,st.arcNormal),p.$I.setTranslation(Wo,st.sphereB.center),p.$I.mul(Wo,Wo,p.$I.rotY180);const qt=Mr({radius:at,thetaLength:Et,segments:Nt});return(0,Fr._2)(qt,Wo)}const Sn=function Bo(){return{sphereA:(0,w.f8)(),sphereB:(0,w.f8)(),sphereC:(0,w.f8)(),arcDirA:(0,p.eB)(),arcDirC:(0,p.eB)(),arcNormal:(0,p.eB)(),radius:0,angle:0}}();function Nn(st){return 1===st.triples.length?`Angle ${(0,re.k0)(st.triples[0],{measureOnly:!0})}`:`${st.triples.length} Angles`}function dr(st,et,at,Et){const Nt=function Kn(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.triples.length;Ntat.color,()=>at.linesSize,()=>"")}function Ft(st,et,at,Et){const Nt=function xr(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.triples.length;Ntat.color,()=>at.linesSize,()=>"")}function ht(st,et,at,Et){const Nt=function Qt(st,et,at){const Et=g.P.createState(128,64,at);for(let Nt=0,qt=st.triples.length;Ntat.color,()=>1,Un=>(0,re.k0)(et.triples[Un]))}function Xt(st,et,at,Et){const Nt=function pt(st,et,at){const Et=ue.t.create(et,128,64,at);for(let Nt=0,qt=st.triples.length;Ntat.textColor,()=>at.textSize,Un=>(0,re.k0)(et.triples[Un]))}const on={color:c.t.Color(v.s.lightgreen),arcScale:c.t.Numeric(.7,{min:.01,max:1,step:.01})},En={...be.q.Params,...on,lineSizeAttenuation:c.t.Boolean(!0),linesSize:c.t.Numeric(.04,{min:.01,max:5,step:.01}),dashLength:c.t.Numeric(.04,{min:.01,max:.2,step:.01})},Tt={...En},Fe={...En},He={...En},Ye={...En},ot={...ee.e.Params,...on,ignoreLight:c.t.Boolean(!0),sectorOpacity:c.t.Numeric(.75,{min:0,max:1,step:.01})},rt={vectors:(st,et)=>R(tr,be.q.Utils,{modifyState:at=>({...at,pickable:!1})}),extenders:(st,et)=>R(vo,be.q.Utils,{modifyState:at=>({...at,pickable:!1})}),connector:(st,et)=>R(oo,be.q.Utils,{modifyState:at=>({...at,pickable:!1})}),arms:(st,et)=>R(Ao,be.q.Utils,{modifyState:at=>({...at,pickable:!1})}),arc:(st,et)=>R(Do,be.q.Utils,{modifyState:at=>({...at,pickable:!1})}),sector:(st,et)=>R(So,ee.e.Utils,{modifyProps:at=>({...at,alpha:at.sectorOpacity}),modifyState:at=>({...at,markerActions:u.sY.Highlighting})}),text:(st,et)=>R(Po,Te.E.Utils,{modifyState:at=>({...at,markerActions:u.xi.None})})},St={...Tt,...Fe,...He,...Ye,...ot,...ve.$,visuals:c.t.MultiSelect(["extenders","arms","sector","text"],c.t.objectToOptions(rt))},mn=(0,p.eB)(),zt=(0,p.$I)();function an(st,et,at){const{sphereA:Et,sphereB:Nt,sphereC:qt,sphereD:Cn,dirBA:Un,dirCD:vn,projA:nr,projD:pr}=et,{arcPointA:Rr,arcPointD:mo,arcDirA:Uo,arcDirD:qo,arcCenter:ri,arcNormal:fo}=et,[Lo,Ni,rs,Gi]=st.loci;h.QN.getBoundingSphere(Lo,Et),h.QN.getBoundingSphere(Ni,Nt),h.QN.getBoundingSphere(rs,qt),h.QN.getBoundingSphere(Gi,Cn),p.eB.add(ri,Nt.center,qt.center),p.eB.scale(ri,ri,.5),p.eB.sub(Un,Et.center,Nt.center),p.eB.sub(vn,Cn.center,qt.center),p.eB.add(Rr,ri,Un),p.eB.add(mo,ri,vn),p.eB.sub(fo,qt.center,Nt.center),p.eB.orthogonalize(Uo,fo,Un),p.eB.orthogonalize(qo,fo,vn),p.eB.projectPointOnVector(nr,Rr,Uo,ri),p.eB.projectPointOnVector(pr,mo,qo,ri);const hr=Math.min(p.eB.distance(nr,ri),p.eB.distance(pr,ri))*at;p.eB.setMagnitude(Uo,Uo,hr),p.eB.setMagnitude(qo,qo,hr),p.eB.add(Rr,ri,Uo),p.eB.add(mo,ri,qo),et.radius=hr,et.angle=p.eB.dihedralAngle(Et.center,Nt.center,qt.center,Cn.center),p.eB.matchDirection(mn,fo,p.eB.sub(mn,Rr,Et.center));const Wr=p.eB.angle(Un,mn),no=hr/Math.cos(Wr-vr.fC);p.eB.add(nr,Nt.center,p.eB.setMagnitude(mn,Un,no)),p.eB.matchDirection(mn,fo,p.eB.sub(mn,mo,Cn.center));const zo=p.eB.angle(vn,mn),Di=hr/Math.cos(zo-vr.fC);return p.eB.add(pr,qt.center,p.eB.setMagnitude(mn,vn,Di)),et}function Vn(st,et){const{radius:at,angle:Et}=st,Nt=et?(0,vr.N7)(Et,at)/et:32;p.$I.targetTo(zt,st.arcCenter,Et<0?st.arcPointD:st.arcPointA,st.arcNormal),p.$I.setTranslation(zt,st.arcCenter),p.$I.mul(zt,zt,p.$I.rotY180);const qt=Mr({radius:at,thetaLength:Math.abs(Et),segments:Nt});return(0,Fr._2)(qt,zt)}const Fn=function vt(){return{sphereA:(0,w.f8)(),sphereB:(0,w.f8)(),sphereC:(0,w.f8)(),sphereD:(0,w.f8)(),dirBA:(0,p.eB)(),dirCD:(0,p.eB)(),projA:(0,p.eB)(),projD:(0,p.eB)(),arcPointA:(0,p.eB)(),arcPointD:(0,p.eB)(),arcDirA:(0,p.eB)(),arcDirD:(0,p.eB)(),arcCenter:(0,p.eB)(),arcNormal:(0,p.eB)(),radius:0,angle:0}}();function rr(st){return 1===st.quads.length?`Dihedral ${(0,re.kd)(st.quads[0],{measureOnly:!0})}`:`${st.quads.length} Dihedrals`}function tr(st,et,at,Et){const Nt=function Vr(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.quads.length;Ntat.color,()=>at.linesSize,()=>"")}function oo(st,et,at,Et){const Nt=function Tr(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.quads.length;Ntat.color,()=>at.linesSize,()=>"")}function Ao(st,et,at,Et){const Nt=function Gr(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.quads.length;Ntat.color,()=>at.linesSize,()=>"")}function vo(st,et,at,Et){const Nt=function yo(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.quads.length;Ntat.color,()=>at.linesSize,()=>"")}function Do(st,et,at,Et){const Nt=function Kr(st,et,at){const Et=ie.d.create(128,64,at);for(let Nt=0,qt=st.quads.length;Ntat.color,()=>at.linesSize,()=>"")}function So(st,et,at,Et){const Nt=function lo(st,et,at){const Et=g.P.createState(128,64,at);for(let Nt=0,qt=st.quads.length;Ntat.color,()=>1,Un=>(0,re.kd)(et.quads[Un]))}function Po(st,et,at,Et){const Nt=function ao(st,et,at){const Et=ue.t.create(et,128,64,at);for(let Nt=0,qt=st.quads.length;Ntat.textColor,()=>at.textSize,Un=>(0,re.kd)(et.quads[Un]))}var jr=n(9651),Co=n(7981),Eo=n(1372),Fo=n(9646);const ei={vertices:new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]),normals:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1]),indices:new Uint32Array([0,2,1,1,2,3])};new Uint32Array([0,1,2,3,3,1,2,0]);const Fi={...ee.e.Params,color:c.t.Color(v.s.orange),scaleFactor:c.t.Numeric(1,{min:.1,max:10,step:.1})},hi={plane:(st,et)=>R(ti,ee.e.Utils)},No={...Fi,visuals:c.t.MultiSelect(["plane"],c.t.objectToOptions(hi))},mi=(0,p.$I)(),qi=(0,p.eB)();function ti(st,et,at,Et){const Nt=function Oi(st,et,at){const Et=g.P.createState(256,128,at),qt=o.iZ.Loci.getPrincipalAxesMany(st.locis).boxAxes,Cn=function ci(){return ei}();return p.eB.add(qi,qt.origin,qt.dirC),p.$I.targetTo(mi,qi,qt.origin,qt.dirB),p.$I.scale(mi,mi,w.n.size(qi,qt)),p.$I.scaleUniformly(mi,mi,et.scaleFactor),p.$I.setTranslation(mi,qt.origin),Et.currentGroup=0,g.P.addPrimitive(Et,mi,Cn),g.P.addPrimitiveFlipped(Et,mi,Cn),g.P.getMesh(Et)}(et,at,Et&&Et.geometry),qt=function Ci(st){return`Best Fit Plane of ${(0,re.k7)(st,{countsOnly:!0})}`}(et.locis);return _.y.create(qt,et,Nt,()=>at.color,()=>1,()=>qt)}var Si=n(9213),Pi=n(6765),ni=n(127),gi=n(3488);const Wi=i.H.BuiltIn({name:"structure-representation-3d",display:"3D Representation",from:i.O.Molecule.Structure,to:i.O.Molecule.Structure.Representation3D,params:(st,et)=>{const{registry:at,themes:Et}=et.representation.structure,Nt=at.get(at.default.name);if(!st){const Un={help:vn=>{const{name:nr,params:pr}=vn,mo=Et.colorThemeRegistry.get(nr).factory({},pr);return{description:mo.description,legend:mo.legend}}};return{type:c.t.Mapped(at.default.name,at.types,vn=>c.t.Group(at.get(vn).getParams(Et,o.oE.Empty))),colorTheme:c.t.Mapped(Nt.defaultColorTheme.name,Et.colorThemeRegistry.types,vn=>c.t.Group(Et.colorThemeRegistry.get(vn).getParams({structure:o.oE.Empty})),Un),sizeTheme:c.t.Mapped(Nt.defaultSizeTheme.name,Et.sizeThemeRegistry.types,vn=>c.t.Group(Et.sizeThemeRegistry.get(vn).getParams({structure:o.oE.Empty})))}}const qt={structure:st.data},Cn={help:Un=>{const{name:vn,params:nr}=Un,Rr=Et.colorThemeRegistry.get(vn).factory(qt,nr);return{description:Rr.description,legend:Rr.legend}}};return{type:c.t.Mapped(at.default.name,at.getApplicableTypes(st.data),Un=>c.t.Group(at.get(Un).getParams(Et,st.data))),colorTheme:c.t.Mapped(Nt.defaultColorTheme.name,Et.colorThemeRegistry.getApplicableTypes(qt),Un=>c.t.Group(Et.colorThemeRegistry.get(Un).getParams(qt)),Cn),sizeTheme:c.t.Mapped(Nt.defaultSizeTheme.name,Et.sizeThemeRegistry.getApplicableTypes(qt),Un=>c.t.Group(Et.sizeThemeRegistry.get(Un).getParams(qt)))}}})({canAutoUpdate:({a:st,oldParams:et,newParams:at})=>st.data.elementCount<1e4||et.type.name===at.type.name&&"custom"!==at.type.params.quality,apply:({a:st,params:et},Et)=>A.YZ.create("Structure Representation",function(){var Nt=(0,e.A)(function*(qt){var Cn,Un;const vn={runtime:qt,assetManager:Et.managers.asset},nr=Et.representation.structure.registry.get(et.type.name),pr=(null===(Cn=nr.getData)||void 0===Cn?void 0:Cn.call(nr,st.data,et.type.params))||st.data;nr.ensureCustomProperties&&(yield nr.ensureCustomProperties.attach(vn,pr));const Rr=nr.factory({webgl:null===(Un=Et.canvas3d)||void 0===Un?void 0:Un.webgl,...Et.representation.structure.themes},nr.getParams);yield y.S.ensureDependencies(vn,Et.representation.structure.themes,{structure:pr},et),Rr.setTheme(y.S.create(Et.representation.structure.themes,{structure:pr},et));const mo=et.type.params||{};return yield Rr.createOrUpdate(mo,pr).runInContext(qt),new i.O.Molecule.Structure.Representation3D({repr:Rr,sourceData:st.data},{label:nr.label})});return function(qt){return Nt.apply(this,arguments)}}()),update:({a:st,b:et,oldParams:at,newParams:Et},qt)=>A.YZ.create("Structure Representation",function(){var Cn=(0,e.A)(function*(Un){var vn,nr;if(Et.type.name!==at.type.name)return t.xE.UpdateResult.Recreate;const pr=qt.representation.structure.registry.get(Et.type.name);if(null!==(vn=pr.mustRecreate)&&void 0!==vn&&vn.call(pr,at.type.params,Et.type.params))return t.xE.UpdateResult.Recreate;const Rr=(null===(nr=pr.getData)||void 0===nr?void 0:nr.call(pr,st.data,Et.type.params))||st.data,mo={runtime:Un,assetManager:qt.managers.asset};pr.ensureCustomProperties&&(yield pr.ensureCustomProperties.attach(mo,Rr)),y.S.releaseDependencies(qt.representation.structure.themes,{structure:et.data.sourceData},at),yield y.S.ensureDependencies(mo,qt.representation.structure.themes,{structure:Rr},Et),et.data.repr.setTheme(y.S.create(qt.representation.structure.themes,{structure:Rr},Et));const Uo={...et.data.repr.props,...Et.type.params};return yield et.data.repr.createOrUpdate(Uo,Rr).runInContext(Un),et.data.sourceData=st.data,t.xE.UpdateResult.Updated});return function(Un){return Cn.apply(this,arguments)}}()),dispose({b:st,params:et},at){if(!st||!et)return;const Et=st.data.sourceData,Nt=at.representation.structure.registry.get(et.type.name);Nt.ensureCustomProperties&&Nt.ensureCustomProperties.detach(Et),y.S.releaseDependencies(at.representation.structure.themes,{structure:Et},et)},interpolate(st,et,at){if("uniform"!==st.colorTheme.name||"uniform"!==et.colorTheme.name)return at<=.5?st:et;const qt=ye.Q1.interpolate(st.colorTheme.params.value,et.colorTheme.params.value,at);return{type:at<=.5?st.type:et.type,colorTheme:{name:"uniform",params:{value:qt}},sizeTheme:at<=.5?st.sizeTheme:et.sizeTheme}}}),Ri=i.H.BuiltIn({name:"unwind-structure-assembly-representation-3d",display:"Unwind Assembly 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:{t:c.t.Numeric(0,{min:0,max:1,step:.01})}})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=new L(at);return G(at,Et,et.t),new i.O.Molecule.Structure.Representation3DState({state:{unitTransforms:Et},initialState:{unitTransforms:new L(at)},info:at,repr:st.data.repr},{label:`Unwind T = ${et.t.toFixed(2)}`})},update({a:st,b:et,newParams:at,oldParams:Et}){const Nt=et.data.info;return st.data.sourceData!==Nt||st.data.repr!==et.data.repr?t.xE.UpdateResult.Recreate:Et.t===at.t?t.xE.UpdateResult.Unchanged:(G(Nt,et.data.state.unitTransforms,at.t),et.label=`Unwind T = ${at.t.toFixed(2)}`,et.data.repr=st.data.repr,t.xE.UpdateResult.Updated)}}),Qi=i.H.BuiltIn({name:"explode-structure-representation-3d",display:"Explode 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:{t:c.t.Numeric(0,{min:0,max:1,step:.01})}})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=new L(at);return k(at,Et,et.t,at.root.boundary.sphere),new i.O.Molecule.Structure.Representation3DState({state:{unitTransforms:Et},initialState:{unitTransforms:new L(at)},info:at,repr:st.data.repr},{label:`Explode T = ${et.t.toFixed(2)}`})},update({a:st,b:et,newParams:at,oldParams:Et}){const Nt=st.data.sourceData;return et.data.info!==Nt||st.data.repr!==et.data.repr?t.xE.UpdateResult.Recreate:Et.t===at.t?t.xE.UpdateResult.Unchanged:(k(Nt,et.data.state.unitTransforms,at.t,Nt.root.boundary.sphere),et.label=`Explode T = ${at.t.toFixed(2)}`,et.data.repr=st.data.repr,t.xE.UpdateResult.Updated)}}),Hn=i.H.BuiltIn({name:"spin-structure-representation-3d",display:"Spin 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:{t:c.t.Numeric(0,{min:0,max:1,step:.01}),...H}})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=new L(at),{axis:Nt,origin:qt}=$(at.root,et);return de(at,Et,et.t,Nt,qt),new i.O.Molecule.Structure.Representation3DState({state:{unitTransforms:Et},initialState:{unitTransforms:new L(at)},info:at,repr:st.data.repr},{label:`Spin T = ${et.t.toFixed(2)}`})},update({a:st,b:et,newParams:at,oldParams:Et}){const Nt=st.data.sourceData;if(et.data.info!==Nt||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;if(Et.t===at.t&&Et.axis===at.axis&&Et.origin===at.origin)return t.xE.UpdateResult.Unchanged;const qt=et.data.state.unitTransforms,{axis:Cn,origin:Un}=$(Nt.root,at);return de(Nt,qt,at.t,Cn,Un),et.label=`Spin T = ${at.t.toFixed(2)}`,et.data.repr=st.data.repr,t.xE.UpdateResult.Updated}}),qr=i.H.BuiltIn({name:"overpaint-structure-representation-3d-from-script",display:"Overpaint 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({script:c.t.Script((0,Y.e)("(sel.atom.all)","mol-script")),color:c.t.Color(v.s.blueviolet),clear:c.t.Boolean(!1)},st=>`${st.clear?"Clear":ye.Q1.toRgbString(st.color)}`,{defaultValue:[{script:(0,Y.e)("(sel.atom.all)","mol-script"),color:v.s.blueviolet,clear:!1}]})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=j.l.ofScript(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{overpaint:Nt},initialState:{overpaint:j.l.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Overpaint (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.overpaint,vn=j.l.ofScript(at.layers,qt);return j.l.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.overpaint=vn,et.data.repr=st.data.repr,et.label=`Overpaint (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),co=i.H.BuiltIn({name:"overpaint-structure-representation-3d-from-bundle",display:"Overpaint 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({bundle:c.t.Value(o.iZ.Bundle.Empty),color:c.t.Color(v.s.blueviolet),clear:c.t.Boolean(!1)},st=>`${st.clear?"Clear":ye.Q1.toRgbString(st.color)}`,{defaultValue:[{bundle:o.iZ.Bundle.Empty,color:v.s.blueviolet,clear:!1}],isHidden:!0})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=j.l.ofBundle(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{overpaint:Nt},initialState:{overpaint:j.l.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Overpaint (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.overpaint,vn=j.l.ofBundle(at.layers,qt);return j.l.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.overpaint=vn,et.data.repr=st.data.repr,et.label=`Overpaint (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),zr=i.H.BuiltIn({name:"transparency-structure-representation-3d-from-script",display:"Transparency 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({script:c.t.Script((0,Y.e)("(sel.atom.all)","mol-script")),value:c.t.Numeric(.5,{min:0,max:1,step:.01},{label:"Transparency"})},st=>`Transparency (${st.value})`,{defaultValue:[{script:(0,Y.e)("(sel.atom.all)","mol-script"),value:.5}]})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=Z.x.ofScript(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{transparency:Nt},initialState:{transparency:Z.x.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Transparency (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.transparency,vn=Z.x.ofScript(at.layers,qt);return Z.x.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.transparency=vn,et.data.repr=st.data.repr,et.label=`Transparency (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),lr=i.H.BuiltIn({name:"transparency-structure-representation-3d-from-bundle",display:"Transparency 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({bundle:c.t.Value(o.iZ.Bundle.Empty),value:c.t.Numeric(.5,{min:0,max:1,step:.01},{label:"Transparency"})},st=>`Transparency (${st.value})`,{defaultValue:[{bundle:o.iZ.Bundle.Empty,value:.5}],isHidden:!0})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=Z.x.ofBundle(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{transparency:Nt},initialState:{transparency:Z.x.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Transparency (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.transparency,vn=Z.x.ofBundle(at.layers,qt);return Z.x.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.transparency=vn,et.data.repr=st.data.repr,et.label=`Transparency (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),kr=i.H.BuiltIn({name:"emissive-structure-representation-3d-from-script",display:"Emissive 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({script:c.t.Script((0,Y.e)("(sel.atom.all)","mol-script")),value:c.t.Numeric(.5,{min:0,max:1,step:.01},{label:"Emissive"})},st=>`Emissive (${st.value})`,{defaultValue:[{script:(0,Y.e)("(sel.atom.all)","mol-script"),value:.5}]})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=gi.a.ofScript(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{emissive:Nt},initialState:{emissive:gi.a.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Emissive (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.emissive,vn=gi.a.ofScript(at.layers,qt);return gi.a.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.emissive=vn,et.data.repr=st.data.repr,et.label=`Emissive (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),Qr=i.H.BuiltIn({name:"emissive-structure-representation-3d-from-bundle",display:"Emissive 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({bundle:c.t.Value(o.iZ.Bundle.Empty),value:c.t.Numeric(.5,{min:0,max:1,step:.01},{label:"Emissive"})},st=>`Emissive (${st.value})`,{defaultValue:[{bundle:o.iZ.Bundle.Empty,value:.5}],isHidden:!0})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=gi.a.ofBundle(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{emissive:Nt},initialState:{emissive:gi.a.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Emissive (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.emissive,vn=gi.a.ofBundle(at.layers,qt);return gi.a.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.emissive=vn,et.data.repr=st.data.repr,et.label=`Emissive (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),vi=i.H.BuiltIn({name:"substance-structure-representation-3d-from-script",display:"Substance 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({script:c.t.Script((0,Y.e)("(sel.atom.all)","mol-script")),material:Pi.i.getParam(),clear:c.t.Boolean(!1)},st=>`${st.clear?"Clear":Pi.i.toString(st.material)}`,{defaultValue:[{script:(0,Y.e)("(sel.atom.all)","mol-script"),material:(0,Pi.i)({roughness:1}),clear:!1}]})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=Si.l.ofScript(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{substance:Nt},initialState:{substance:Si.l.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Substance (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.substance,vn=Si.l.ofScript(at.layers,qt);return Si.l.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.substance=vn,et.data.repr=st.data.repr,et.label=`Substance (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),Ti=i.H.BuiltIn({name:"substance-structure-representation-3d-from-bundle",display:"Substance 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({bundle:c.t.Value(o.iZ.Bundle.Empty),material:Pi.i.getParam(),clear:c.t.Boolean(!1)},st=>`${st.clear?"Clear":Pi.i.toString(st.material)}`,{defaultValue:[{bundle:o.iZ.Bundle.Empty,material:(0,Pi.i)({roughness:1}),clear:!1}],isHidden:!0})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=st.data.repr.geometryVersion,Nt=Si.l.ofBundle(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{substance:Nt},initialState:{substance:Si.l.Empty},info:{structure:at,geometryVersion:Et},repr:st.data.repr},{label:`Substance (${Nt.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info,qt=st.data.sourceData;if(qt!==Nt.structure||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const Cn=st.data.repr.geometryVersion;if(Cn!==Nt.geometryVersion&&(0,q.jH)(st.data.repr.props))return t.xE.UpdateResult.Recreate;const Un=et.data.state.substance,vn=Si.l.ofBundle(at.layers,qt);return Si.l.areEqual(Un,vn)?t.xE.UpdateResult.Unchanged:(Nt.geometryVersion=Cn,et.data.state.substance=vn,et.data.repr=st.data.repr,et.label=`Substance (${vn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),Bi=i.H.BuiltIn({name:"clipping-structure-representation-3d-from-script",display:"Clipping 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({script:c.t.Script((0,Y.e)("(sel.atom.all)","mol-script")),groups:c.t.Converted(st=>Co.l.Groups.toNames(st),st=>Co.l.Groups.fromNames(st),c.t.MultiSelect((0,Eo.mX)(Co.l.Groups.Names),c.t.objectToOptions(Co.l.Groups.Names)))},st=>`${Co.l.Groups.toNames(st.groups).length} group(s)`,{defaultValue:[{script:(0,Y.e)("(sel.atom.all)","mol-script"),groups:Co.l.Groups.Flag.None}]})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=Co.l.ofScript(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{clipping:Et},initialState:{clipping:Co.l.Empty},info:at,repr:st.data.repr},{label:`Clipping (${Et.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info;if(st.data.sourceData!==Nt||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const qt=et.data.state.clipping,Cn=Co.l.ofScript(at.layers,Nt);return Co.l.areEqual(qt,Cn)?t.xE.UpdateResult.Unchanged:(et.data.state.clipping=Cn,et.data.repr=st.data.repr,et.label=`Clipping (${Cn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),Li=i.H.BuiltIn({name:"clipping-structure-representation-3d-from-bundle",display:"Clipping 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({layers:c.t.ObjectList({bundle:c.t.Value(o.iZ.Bundle.Empty),groups:c.t.Converted(st=>Co.l.Groups.toNames(st),st=>Co.l.Groups.fromNames(st),c.t.MultiSelect((0,Eo.mX)(Co.l.Groups.Names),c.t.objectToOptions(Co.l.Groups.Names)))},st=>`${Co.l.Groups.toNames(st.groups).length} group(s)`,{defaultValue:[{bundle:o.iZ.Bundle.Empty,groups:Co.l.Groups.Flag.None}],isHidden:!0})})})({canAutoUpdate:()=>!0,apply({a:st,params:et}){const at=st.data.sourceData,Et=Co.l.ofBundle(et.layers,at);return new i.O.Molecule.Structure.Representation3DState({state:{clipping:Et},initialState:{clipping:Co.l.Empty},info:at,repr:st.data.repr},{label:`Clipping (${Et.layers.length} Layers)`})},update({a:st,b:et,newParams:at}){const Nt=et.data.info;if(st.data.sourceData!==Nt||st.data.repr!==et.data.repr)return t.xE.UpdateResult.Recreate;const qt=et.data.state.clipping,Cn=Co.l.ofBundle(at.layers,Nt);return Co.l.areEqual(qt,Cn)?t.xE.UpdateResult.Unchanged:(et.data.state.clipping=Cn,et.data.repr=st.data.repr,et.label=`Clipping (${Cn.layers.length} Layers)`,t.xE.UpdateResult.Updated)}}),bi=i.H.BuiltIn({name:"theme-strength-representation-3d",display:"Theme Strength 3D Representation",from:i.O.Molecule.Structure.Representation3D,to:i.O.Molecule.Structure.Representation3DState,params:()=>({overpaintStrength:c.t.Numeric(1,{min:0,max:1,step:.01}),transparencyStrength:c.t.Numeric(1,{min:0,max:1,step:.01}),emissiveStrength:c.t.Numeric(1,{min:0,max:1,step:.01}),substanceStrength:c.t.Numeric(1,{min:0,max:1,step:.01})})})({canAutoUpdate:()=>!0,apply:({a:st,params:et})=>new i.O.Molecule.Structure.Representation3DState({state:{themeStrength:{overpaint:et.overpaintStrength,transparency:et.transparencyStrength,emissive:et.emissiveStrength,substance:et.substanceStrength}},initialState:{themeStrength:{overpaint:1,transparency:1,emissive:1,substance:1}},info:{},repr:st.data.repr},{label:"Theme Strength",description:`${et.overpaintStrength.toFixed(2)}, ${et.transparencyStrength.toFixed(2)}, ${et.emissiveStrength.toFixed(2)}, ${et.substanceStrength.toFixed(2)}`}),update({a:st,b:et,newParams:at}){var Nt,qt,Cn,Un;return at.overpaintStrength===(null===(Nt=et.data.state.themeStrength)||void 0===Nt?void 0:Nt.overpaint)&&at.transparencyStrength===(null===(qt=et.data.state.themeStrength)||void 0===qt?void 0:qt.transparency)&&at.emissiveStrength===(null===(Cn=et.data.state.themeStrength)||void 0===Cn?void 0:Cn.emissive)&&at.substanceStrength===(null===(Un=et.data.state.themeStrength)||void 0===Un?void 0:Un.substance)?t.xE.UpdateResult.Unchanged:(et.data.state.themeStrength={overpaint:at.overpaintStrength,transparency:at.transparencyStrength,emissive:at.emissiveStrength,substance:at.substanceStrength},et.data.repr=st.data.repr,et.label="Theme Strength",et.description=`${at.overpaintStrength.toFixed(2)}, ${at.transparencyStrength.toFixed(2)}, ${at.emissiveStrength.toFixed(2)}, ${at.substanceStrength.toFixed(2)}`,t.xE.UpdateResult.Updated)},interpolate:(st,et,at)=>({overpaintStrength:(0,ni.Cc)(st.overpaintStrength,et.overpaintStrength,at),transparencyStrength:(0,ni.Cc)(st.transparencyStrength,et.transparencyStrength,at),emissiveStrength:(0,ni.Cc)(st.emissiveStrength,et.emissiveStrength,at),substanceStrength:(0,ni.Cc)(st.substanceStrength,et.substanceStrength,at)})});var Vi,st;(st=Vi||(Vi={})).getDefaultParams=function et(Nt,qt,Cn,Un,vn,nr,pr,Rr){const mo=Nt.representation.volume.registry.get(qt),Uo=Nt.representation.volume.themes.colorThemeRegistry.get(vn||mo.defaultColorTheme.name),qo=Nt.representation.volume.themes.sizeThemeRegistry.get(pr||mo.defaultSizeTheme.name),ri=c.t.getDefaultValues(mo.getParams(Nt.representation.volume.themes,Cn));return{type:{name:qt,params:Un?{...ri,...Un}:ri},colorTheme:{name:Uo.name,params:nr?{...Uo.defaultValues,...nr}:Uo.defaultValues},sizeTheme:{name:qo.name,params:Rr?{...qo.defaultValues,...Rr}:qo.defaultValues}}},st.getDefaultParamsStatic=function at(Nt,qt,Cn,Un,vn,nr,pr){const Rr=Nt.representation.volume.registry.get(qt),mo=Nt.representation.volume.themes.colorThemeRegistry.get(Un||Rr.defaultColorTheme.name),Uo=Nt.representation.volume.themes.sizeThemeRegistry.get(nr||Rr.defaultSizeTheme.name);return{type:{name:qt,params:Cn?{...Rr.defaultValues,...Cn}:Rr.defaultValues},colorTheme:{name:Rr.defaultColorTheme.name,params:vn?{...mo.defaultValues,...vn}:mo.defaultValues},sizeTheme:{name:Rr.defaultSizeTheme.name,params:pr?{...Uo.defaultValues,...pr}:Uo.defaultValues}}},st.getDescription=function Et(Nt){var qt,Cn,Un,vn;return Nt.isoValue?r.f.IsoValue.toString(Nt.isoValue):null!==(Cn=null===(qt=Nt.renderMode)||void 0===qt?void 0:qt.params)&&void 0!==Cn&&Cn.isoValue?r.f.IsoValue.toString(null===(vn=null===(Un=Nt.renderMode)||void 0===Un?void 0:Un.params)||void 0===vn?void 0:vn.isoValue):void 0};const Ei=i.H.BuiltIn({name:"volume-representation-3d",display:"3D Representation",from:i.O.Volume.Data,to:i.O.Volume.Representation3D,params:(st,et)=>{const{registry:at,themes:Et}=et.representation.volume,Nt=at.get(at.default.name);if(!st)return{type:c.t.Mapped(at.default.name,at.types,Cn=>c.t.Group(at.get(Cn).getParams(Et,r.f.One))),colorTheme:c.t.Mapped(Nt.defaultColorTheme.name,Et.colorThemeRegistry.types,Cn=>c.t.Group(Et.colorThemeRegistry.get(Cn).getParams({volume:r.f.One}))),sizeTheme:c.t.Mapped(Nt.defaultSizeTheme.name,Et.sizeThemeRegistry.types,Cn=>c.t.Group(Et.sizeThemeRegistry.get(Cn).getParams({volume:r.f.One})))};const qt={volume:st.data};return{type:c.t.Mapped(at.default.name,at.types,Cn=>c.t.Group(at.get(Cn).getParams(Et,st.data))),colorTheme:c.t.Mapped(Nt.defaultColorTheme.name,Et.colorThemeRegistry.getApplicableTypes(qt),Cn=>c.t.Group(Et.colorThemeRegistry.get(Cn).getParams(qt))),sizeTheme:c.t.Mapped(Nt.defaultSizeTheme.name,Et.sizeThemeRegistry.getApplicableTypes(qt),Cn=>c.t.Group(Et.sizeThemeRegistry.get(Cn).getParams(qt)))}}})({canAutoUpdate:({oldParams:st,newParams:et})=>st.type.name===et.type.name,apply:({a:st,params:et},at)=>A.YZ.create("Volume Representation",function(){var Et=(0,e.A)(function*(Nt){var qt;const Cn={runtime:Nt,assetManager:at.managers.asset},Un=at.representation.volume.registry.get(et.type.name);Un.ensureCustomProperties&&(yield Un.ensureCustomProperties.attach(Cn,st.data));const vn=Un.factory({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.volume.themes},Un.getParams);vn.setTheme(y.S.create(at.representation.volume.themes,{volume:st.data},et));const nr=et.type.params||{};return yield vn.createOrUpdate(nr,st.data).runInContext(Nt),new i.O.Volume.Representation3D({repr:vn,sourceData:st.data},{label:Un.label,description:Vi.getDescription(nr)})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,oldParams:at,newParams:Et},Nt)=>A.YZ.create("Volume Representation",function(){var qt=(0,e.A)(function*(Cn){var Un;if(Et.type.name!==at.type.name)return null===(Un=Nt.representation.volume.registry.get(at.type.name).ensureCustomProperties)||void 0===Un||Un.detach(st.data),t.xE.UpdateResult.Recreate;const vn={...et.data.repr.props,...Et.type.params};return et.data.repr.setTheme(y.S.create(Nt.representation.volume.themes,{volume:st.data},Et)),yield et.data.repr.createOrUpdate(vn,st.data).runInContext(Cn),et.data.sourceData=st.data,et.description=Vi.getDescription(vn),t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),ln=i.H.BuiltIn({name:"shape-representation-3d",display:"3D Representation",from:i.O.Shape.Provider,to:i.O.Shape.Representation3D,params:(st,et)=>st?st.data.params:q.iy.Params})({canAutoUpdate:()=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Shape Representation",function(){var Et=(0,e.A)(function*(Nt){const qt={...c.t.getDefaultValues(st.data.params),...et},Cn=R(st.data.getShape,st.data.geometryUtils);return yield Cn.createOrUpdate(qt,st.data.data).runInContext(Nt),new i.O.Shape.Representation3D({repr:Cn,sourceData:st.data},{label:st.data.label})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Shape Representation",function(){var qt=(0,e.A)(function*(Cn){const Un={...et.data.repr.props,...Et};return yield et.data.repr.createOrUpdate(Un,st.data.data).runInContext(Cn),et.data.sourceData=st.data,t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),Ht=i.H.BuiltIn({name:"model-unitcell-3d",display:"Model Unit Cell",from:i.O.Molecule.Model,to:i.O.Shape.Representation3D,params:()=>({...Se})})({isApplicable:st=>!!jr.i.Provider.get(st.data),canAutoUpdate:({})=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Model Unit Cell",function(){var Et=(0,e.A)(function*(Nt){var qt;const Cn=jr.i.Provider.get(st.data);if(!Cn)return t.BM.Null;const Un=K(st.data,Cn,et),vn=function ne(st,et){return b.YL.createMulti("Unit Cell",st,et,b.YL.StateBuilder,Oe)}({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.structure.themes},()=>Se);return yield vn.createOrUpdate(et,Un).runInContext(Nt),new i.O.Shape.Representation3D({repr:vn,sourceData:Un},{label:"Unit Cell",description:Cn.spacegroup.name})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:at})=>A.YZ.create("Model Unit Cell",function(){var Et=(0,e.A)(function*(Nt){const qt=jr.i.Provider.get(st.data);if(!qt)return t.xE.UpdateResult.Null;const Cn={...et.data.repr.props,...at},Un=K(st.data,qt,Cn);return yield et.data.repr.createOrUpdate(Cn,Un).runInContext(Nt),et.data.sourceData=Un,t.xE.UpdateResult.Updated});return function(Nt){return Et.apply(this,arguments)}}())}),Gn=i.H.BuiltIn({name:"structure-bounding-box-3d",display:"Bounding Box",from:i.O.Molecule.Structure,to:i.O.Shape.Representation3D,params:{radius:c.t.Numeric(.05,{min:.01,max:4,step:.01},{isEssential:!0}),color:c.t.Color(v.s.red,{isEssential:!0}),...ee.e.Params}})({canAutoUpdate:()=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Bounding Box",function(){var Et=(0,e.A)(function*(Nt){const qt=R((Cn,Un,vn,nr)=>{const pr=(0,Fo.getBoxMesh)(Un.box,Un.radius,nr?.geometry);return _.y.create("Bouding Box",Un,pr,()=>Un.color,()=>1,()=>"Bounding Box")},ee.e.Utils);return yield qt.createOrUpdate(et,{box:st.data.boundary.box,radius:et.radius,color:et.color}).runInContext(Nt),new i.O.Shape.Representation3D({repr:qt,sourceData:st.data},{label:"Bounding Box"})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Bounding Box",function(){var qt=(0,e.A)(function*(Cn){return yield et.data.repr.createOrUpdate(Et,{box:st.data.boundary.box,radius:Et.radius,color:Et.color}).runInContext(Cn),et.data.sourceData=st.data,t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),ar=i.H.BuiltIn({name:"structure-selections-distance-3d",display:"3D Distance",from:i.O.Molecule.Structure.Selections,to:i.O.Shape.Representation3D,params:()=>({...Ie})})({canAutoUpdate:({})=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Structure Distance",function(){var Et=(0,e.A)(function*(Nt){var qt;const Cn=mt(st.data),Un=function $e(st,et){return b.YL.createMulti("Distance",st,et,b.YL.StateBuilder,ge)}({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.structure.themes},()=>Ie);return yield Un.createOrUpdate(et,Cn).runInContext(Nt),new i.O.Shape.Representation3D({repr:Un,sourceData:Cn},{label:"Distance"})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Structure Distance",function(){var qt=(0,e.A)(function*(Cn){const Un={...et.data.repr.props,...Et},vn=mt(st.data);return yield et.data.repr.createOrUpdate(Un,vn).runInContext(Cn),et.data.sourceData=vn,t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),kn=i.H.BuiltIn({name:"structure-selections-angle-3d",display:"3D Angle",from:i.O.Molecule.Structure.Selections,to:i.O.Shape.Representation3D,params:()=>({...ho})})({canAutoUpdate:({})=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Structure Angle",function(){var Et=(0,e.A)(function*(Nt){var qt;const Cn=_t(st.data),Un=function fn(st,et){return b.YL.createMulti("Angle",st,et,b.YL.StateBuilder,so)}({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.structure.themes},()=>ho);return yield Un.createOrUpdate(et,Cn).runInContext(Nt),new i.O.Shape.Representation3D({repr:Un,sourceData:Cn},{label:"Angle"})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Structure Angle",function(){var qt=(0,e.A)(function*(Cn){const Un={...et.data.repr.props,...Et},vn=_t(st.data);return yield et.data.repr.createOrUpdate(Un,vn).runInContext(Cn),et.data.sourceData=vn,t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),ur=i.H.BuiltIn({name:"structure-selections-dihedral-3d",display:"3D Dihedral",from:i.O.Molecule.Structure.Selections,to:i.O.Shape.Representation3D,params:()=>({...St})})({canAutoUpdate:({})=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Structure Dihedral",function(){var Et=(0,e.A)(function*(Nt){var qt;const Cn=Me(st.data),Un=function Yr(st,et){return b.YL.createMulti("Dihedral",st,et,b.YL.StateBuilder,rt)}({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.structure.themes},()=>St);return yield Un.createOrUpdate(et,Cn).runInContext(Nt),new i.O.Shape.Representation3D({repr:Un,sourceData:Cn},{label:"Dihedral"})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Structure Dihedral",function(){var qt=(0,e.A)(function*(Cn){const Un={...et.data.repr.props,...Et},vn=Me(st.data);return yield et.data.repr.createOrUpdate(Un,vn).runInContext(Cn),et.data.sourceData=vn,t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),sr=i.H.BuiltIn({name:"structure-selections-label-3d",display:"3D Label",from:i.O.Molecule.Structure.Selections,to:i.O.Shape.Representation3D,params:()=>({...yt})})({canAutoUpdate:({})=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Structure Label",function(){var Et=(0,e.A)(function*(Nt){var qt,Cn,Un;const vn=Ke(st.data),nr=function nn(st,et){return b.YL.createMulti("Label",st,et,b.YL.StateBuilder,gt)}({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.structure.themes},()=>yt);yield nr.createOrUpdate(et,vn).runInContext(Nt);const pr=!!(null!==(Cn=et.snapshotKey)&&void 0!==Cn&&Cn.trim()||null!==(Un=et.tooltip)&&void 0!==Un&&Un.trim());return nr.setState({pickable:pr,markerActions:pr?u.sY.Highlighting:u.xi.None}),new i.O.Shape.Representation3D({repr:nr,sourceData:vn},{label:"Label"})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Structure Label",function(){var qt=(0,e.A)(function*(Cn){var Un,vn;const nr={...et.data.repr.props,...Et},pr=Ke(st.data);yield et.data.repr.createOrUpdate(nr,pr).runInContext(Cn),et.data.sourceData=pr;const Rr=!!(null!==(Un=Et.snapshotKey)&&void 0!==Un&&Un.trim()||null!==(vn=Et.tooltip)&&void 0!==vn&&vn.trim());return et.data.repr.setState({pickable:Rr,markerActions:Rr?u.sY.Highlighting:u.xi.None}),t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),Jn=i.H.BuiltIn({name:"structure-selections-orientation-3d",display:"3D Orientation",from:i.O.Molecule.Structure.Selections,to:i.O.Shape.Representation3D,params:()=>({...un})})({canAutoUpdate:({})=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Structure Orientation",function(){var Et=(0,e.A)(function*(Nt){var qt;const Cn=ut(st.data),Un=function br(st,et){const at=b.YL.createMulti("Orientation",st,et,b.YL.StateBuilder,To);return at.setState({markerActions:u.sY.Highlighting}),at}({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.structure.themes},()=>un);return yield Un.createOrUpdate(et,Cn).runInContext(Nt),new i.O.Shape.Representation3D({repr:Un,sourceData:Cn},{label:"Orientation"})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Structure Orientation",function(){var qt=(0,e.A)(function*(Cn){const Un={...et.data.repr.props,...Et},vn=ut(st.data);return yield et.data.repr.createOrUpdate(Un,vn).runInContext(Cn),et.data.sourceData=vn,t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())}),Br=i.H.BuiltIn({name:"structure-selections-plane-3d",display:"3D Plane",from:i.O.Molecule.Structure.Selections,to:i.O.Shape.Representation3D,params:()=>({...No})})({canAutoUpdate:({})=>!0,apply:({a:st,params:et},at)=>A.YZ.create("Structure Plane",function(){var Et=(0,e.A)(function*(Nt){var qt;const Cn=Kt(st.data),Un=function es(st,et){const at=b.YL.createMulti("Plane",st,et,b.YL.StateBuilder,hi);return at.setState({markerActions:u.sY.Highlighting}),at}({webgl:null===(qt=at.canvas3d)||void 0===qt?void 0:qt.webgl,...at.representation.structure.themes},()=>No);return yield Un.createOrUpdate(et,Cn).runInContext(Nt),new i.O.Shape.Representation3D({repr:Un,sourceData:Cn},{label:"Plane"})});return function(Nt){return Et.apply(this,arguments)}}()),update:({a:st,b:et,newParams:Et},Nt)=>A.YZ.create("Structure Plane",function(){var qt=(0,e.A)(function*(Cn){const Un={...et.data.repr.props,...Et},vn=Kt(st.data);return yield et.data.repr.createOrUpdate(Un,vn).runInContext(Cn),et.data.sourceData=vn,t.xE.UpdateResult.Updated});return function(Cn){return qt.apply(this,arguments)}}())})},9646:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{BoxShape3D:()=>_,getBoxMesh:()=>M});var e=n(467),o=n(9283),r=n(573),t=n(3280),A=n(5384),y=n(4369),c=n(3558),i=n(4824),v=n(2745),O=n(8277),b=n(381);const _=b.H.BuiltIn({name:"box-shape-3d",display:"Box Shape",from:b.O.Root,to:b.O.Shape.Provider,params:{bottomLeft:O.t.Vec3((0,y.eB)()),topRight:O.t.Vec3(y.eB.create(1,1,1)),radius:O.t.Numeric(.15,{min:.01,max:4,step:.01}),color:O.t.Color(v.s.red)}})({canAutoUpdate:()=>!0,apply:({params:I})=>i.YZ.create("Shape Representation",function(){var l=(0,e.A)(function*(m){return new b.O.Shape.Provider({label:"Box",data:I,params:o.e.Params,getShape:(u,d)=>{const s=M(A.DJ.create(I.bottomLeft,I.topRight),I.radius);return c.y.create("Box",d,s,()=>d.color,()=>1,()=>"Box")},geometryUtils:o.e.Utils},{label:"Box"})});return function(m){return l.apply(this,arguments)}}())});function M(I,l,m){const u=y.eB.sub((0,y.eB)(),I.max,I.min),d=y.$I.fromTranslation((0,y.$I)(),y.eB.create(.5,.5,.5)),s=y.$I.fromScaling((0,y.$I)(),u),C=y.$I.fromTranslation((0,y.$I)(),I.min),h=y.$I.mul3((0,y.$I)(),C,s,d),a=r.P.createState(256,128,m);a.currentGroup=1,r.P.addCage(a,h,(0,t.UC)(),l,2,20);const S=r.P.getMesh(a),D=y.eB.scaleAndAdd((0,y.eB)(),I.min,u,.5),R=y.eB.distance(I.min,D);return S.setBoundingSphere(A.f8.create(D,R)),S}},1133:(tn,Ue,n)=>{"use strict";n.d(Ue,{VK:()=>i,aU:()=>A,dL:()=>y,jB:()=>c});var e=n(9619),o=n(1395),r=n(3584),t=n(9611);const A=o.createContext(void 0);let y=(()=>{class v extends o.Component{subscribe(b,_){typeof this.subs>"u"&&(this.subs=[]),this.subs.push(b.subscribe(_))}componentWillUnmount(){if(this.subs){for(const b of this.subs)b.unsubscribe();this.subs=void 0}}constructor(b,_){super(b),this.subs=void 0,this.plugin=_,this.init&&this.init()}}return v.contextType=A,v})(),c=(()=>{class v extends o.PureComponent{subscribe(b,_){typeof this.subs>"u"&&(this.subs=[]),this.subs.push(b.subscribe(_))}componentWillUnmount(){if(this.subs){for(const b of this.subs)b.unsubscribe();this.subs=void 0}}constructor(b,_){super(b,_),this.subs=void 0,this.plugin=_,this.init&&this.init()}}return v.contextType=A,v})();class i extends y{componentDidUpdate(O){void 0!==this.props.initiallyCollapsed&&O.initiallyCollapsed!==this.props.initiallyCollapsed&&this.setState({isCollapsed:this.props.initiallyCollapsed})}render(){var O;return this.state.isHidden?null:(0,e.jsxs)("div",{className:this.state.isCollapsed?"msp-transform-wrapper msp-transform-wrapper-collapsed":"msp-transform-wrapper",children:[(0,e.jsx)("div",{className:"msp-transform-header",children:(0,e.jsxs)(r.$n,{icon:this.state.brand?void 0:this.state.isCollapsed?t.Cp:t.DM,noOverflow:!0,onClick:this.toggleCollapsed,className:this.state.brand?`msp-transform-header-brand msp-transform-header-brand-${this.state.brand.accent}`:void 0,title:"Click to "+(this.state.isCollapsed?"expand":"collapse"),children:[(0,e.jsx)(t.In,{svg:null===(O=this.state.brand)||void 0===O?void 0:O.svg,inline:!0}),this.state.header,(0,e.jsx)("small",{style:{margin:"0 6px"},children:this.state.isCollapsed?"":this.state.description})]})}),!this.state.isCollapsed&&this.renderControls()]})}constructor(O,b){super(O,b),this.toggleCollapsed=()=>{this.setState({isCollapsed:!this.state.isCollapsed})};const _=this.defaultState();void 0!==O.initiallyCollapsed&&(_.isCollapsed=O.initiallyCollapsed),void 0!==O.header&&(_.header=O.header),this.state=_}}},8791:(tn,Ue,n)=>{"use strict";n.d(Ue,{W:()=>A});var e=n(9619),o=n(1395),r=n(3584),t=n(9611);class A extends o.PureComponent{constructor(){super(...arguments),this.hide=()=>this.props.onSelect(void 0)}render(){const M=this.props,I=(0,e.jsx)(y,{items:M.items,onSelect:M.onSelect,current:M.current,multiselect:this.props.multiselect,noOffset:this.props.noOffset,noAccent:this.props.noAccent});return(0,e.jsxs)("div",{className:"msp-action-menu-options"+(M.header?"":" msp-action-menu-options-no-header"),children:[M.header&&(0,e.jsx)(r.tW,{header:M.header,title:M.title,initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.hide,topRightIcon:t.X6,children:I}),!M.header&&I]})}}!function(_){function l(h,a){const{label:S,value:D,category:R,selected:f,icon:p,addOn:E,description:T}=a||{};let L;const w=[];for(let Q=0;Qh[0],label:h=>h[1],category:h=>h[2]};_.createItemsFromSelectOptions=function u(h,a){return l(h,a?{...m,...a}:m)},_.hasSelectedItem=function d(h){if(O(h))return!1;if(v(h))return!!h.selected;for(const a of h)if(d(a))return!0;return!1},_.findItem=function s(h,a){if(!O(h)){if(v(h))return h.value===a?h:void 0;for(const S of h){const D=s(S,a);if(D)return D}}},_.getFirstItem=function C(h){if(!O(h)){if(v(h))return h;for(const a of h){const S=C(a);if(S)return S}}}}(A||(A={}));class y extends o.PureComponent{constructor(){super(...arguments),this.state=y.createState(this.props),this.toggleExpanded=M=>{this.setState({isExpanded:!this.state.isExpanded}),M.currentTarget.blur()},this.selectAll=()=>{const M=b(this.props.items,[]).filter(I=>!I.selected);this.props.onSelect(M)},this.selectNone=()=>{const M=b(this.props.items,[]).filter(I=>!!I.selected);this.props.onSelect(M)}}static createState(M,I){const l=i(M.items)&&O(M.items[0])?M.items[0]:void 0,m=!l?.isIndependent&&(M.multiselect?A.hasSelectedItem(M.items):!!M.current&&!!A.findItem(M.items,M.current.value)||A.hasSelectedItem(M.items));return{header:l,hasCurrent:m,isExpanded:m||(I??!!l?.initiallyExpanded)}}componentDidUpdate(M){if(this.props.items!==M.items||this.props.current!==M.current){const I=i(this.props.items)&&i(M.items)&&O(this.props.items[0])&&O(M.items[0])&&this.props.items[0].label===M.items[0].label?this.state.isExpanded:void 0;this.setState(y.createState(this.props,I))}}get multiselectHeader(){const{header:M,hasCurrent:I}=this.state;return(0,e.jsxs)("div",{className:"msp-flex-row msp-control-group-header",children:[(0,e.jsx)(r.$n,{icon:this.state.isExpanded?t.DM:t.Cp,flex:!0,noOverflow:!0,onClick:this.toggleExpanded,title:`Click to ${this.state.isExpanded?"collapse":"expand"}.${M?.description?` ${M?.description}`:""}`,children:I?(0,e.jsx)("b",{children:M?.label}):M?.label}),(0,e.jsx)(r.$n,{icon:t.Xq,flex:!0,onClick:this.selectAll,style:{flex:"0 0 50px",textAlign:"right"},children:"All"}),(0,e.jsx)(r.$n,{icon:t.X6,flex:!0,onClick:this.selectNone,style:{flex:"0 0 50px",textAlign:"right"},children:"None"})]})}get basicHeader(){const{header:M,hasCurrent:I}=this.state;return(0,e.jsx)("div",{className:"msp-control-group-header",style:{marginTop:"1px"},children:(0,e.jsx)(r.$n,{noOverflow:!0,icon:this.state.isExpanded?t.DM:t.Cp,onClick:this.toggleExpanded,title:`Click to ${this.state.isExpanded?"collapse":"expand"}. ${M?.description?M?.description:""}`,children:I?(0,e.jsx)("b",{children:M?.label}):M?.label})})}render(){const{items:M,onSelect:I,current:l}=this.props;if(O(M))return null;if(v(M))return(0,e.jsx)(c,{item:M,onSelect:I,current:l,multiselect:this.props.multiselect});const{header:m}=this.state;return(0,e.jsxs)(e.Fragment,{children:[m&&(this.props.multiselect&&this.state.isExpanded?this.multiselectHeader:this.basicHeader),(0,e.jsx)("div",{className:this.props.noOffset?void 0:this.props.noAccent?"msp-control-offset":"msp-accent-offset",children:(!m||this.state.isExpanded)&&M.map((u,d)=>O(u)?null:v(u)?(0,e.jsx)(c,{item:u,onSelect:I,current:l,multiselect:this.props.multiselect},d):(0,e.jsx)(y,{items:u,onSelect:I,current:l,multiselect:this.props.multiselect,noAccent:!0},d))})]})}}const c=({item:_,onSelect:M,current:I,multiselect:l})=>(0,e.jsxs)(r.$n,{icon:_.icon,noOverflow:!0,className:"msp-action-menu-button",onClick:d=>M(l?[_]:_,d),disabled:_.disabled,style:_.addOn?{position:"relative"}:void 0,title:_.description,children:[I===_||_.selected?(0,e.jsx)("b",{children:_.label}):_.label,_.addOn]});function i(_){return!!_&&Array.isArray(_)}function v(_){return _&&"item"===_.kind}function O(_){return _&&"header"===_.kind}function b(_,M){if(O(_))return M;if(v(_))return M.push(_),M;for(const I of _)b(I,M);return M}},22:(tn,Ue,n)=>{"use strict";n.d(Ue,{y$:()=>O,WC:()=>_,cq:()=>i});var e=n(9619),o=n(190),r=n(7785),t=n(1395),A=n(3584);const c=(0,n(3057).qM)([["black",0],["gray",8421504],["white",16777215],["red",13840661],["orange",14840576],["yellow",16565248],["green",6863872],["cyan",1484197],["blue",40160],["purple",8086783],["magenta",16394495],["violet",8200583]]);class i extends t.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!!this.props.param.isExpanded||!!this.props.hideNameRow,lightness:0},this.toggleExpanded=I=>{this.setState({isExpanded:!this.state.isExpanded}),I.currentTarget.blur()},this.onClickSwatch=I=>{const l=o.Q1.fromHexString(I.currentTarget.getAttribute("data-color")||"0");l!==this.props.value&&(this.props.param.isExpanded||this.setState({isExpanded:!1}),this.update(l))},this.onR=I=>{const[,l,m]=o.Q1.toRgb(this.props.value),u=o.Q1.fromRgb(I,l,m);u!==this.props.value&&this.update(u)},this.onG=I=>{const[l,,m]=o.Q1.toRgb(this.props.value),u=o.Q1.fromRgb(l,I,m);u!==this.props.value&&this.update(u)},this.onB=I=>{const[l,m]=o.Q1.toRgb(this.props.value),u=o.Q1.fromRgb(l,m,I);u!==this.props.value&&this.update(u)},this.onRGB=I=>{const l=o.Q1.fromHexStyle(I.currentTarget.value||"0");l!==this.props.value&&this.update(l)},this.onLighten=()=>{this.update(o.Q1.lighten(this.props.value,.1))},this.onDarken=()=>{this.update(o.Q1.darken(this.props.value,.1))}}update(I){this.props.onChange({param:this.props.param,name:this.props.name,value:I})}swatch(){return(0,e.jsx)("div",{className:"msp-combined-color-swatch",children:c.map(I=>(0,e.jsx)(A.$n,{inline:!0,"data-color":I[1],onClick:this.onClickSwatch,style:{background:o.Q1.toStyle(I[1])}},I[1]))})}render(){const I=this.props.param.label||(0,r.Hh)(this.props.name),[l,m,u]=o.Q1.toRgb(this.props.value),d=(0,e.jsxs)(e.Fragment,{children:[this.swatch(),(0,e.jsx)(A.eJ,{label:"RGB",className:"msp-control-label-short",control:(0,e.jsxs)("div",{style:{display:"flex",textAlignLast:"center",left:"80px"},children:[(0,e.jsx)(A.ks,{onChange:this.onR,numeric:!0,value:l,delayMs:250,style:{order:1,flex:"1 1 auto",minWidth:0},className:"msp-form-control",onEnter:this.props.onEnter,blurOnEnter:!0,blurOnEscape:!0}),(0,e.jsx)(A.ks,{onChange:this.onG,numeric:!0,value:m,delayMs:250,style:{order:2,flex:"1 1 auto",minWidth:0},className:"msp-form-control",onEnter:this.props.onEnter,blurOnEnter:!0,blurOnEscape:!0}),(0,e.jsx)(A.ks,{onChange:this.onB,numeric:!0,value:u,delayMs:250,style:{order:3,flex:"1 1 auto",minWidth:0},className:"msp-form-control",onEnter:this.props.onEnter,blurOnEnter:!0,blurOnEscape:!0}),(0,e.jsx)("input",{onInput:this.onRGB,type:"color",value:o.Q1.toHexStyle(this.props.value),style:{order:4,flex:"1 1 auto",minWidth:"32px",width:"32px",height:"32px",padding:"0 2px 0 2px",background:"none",border:"none",cursor:"pointer"}})]})}),(0,e.jsxs)("div",{style:{display:"flex",textAlignLast:"center"},children:[(0,e.jsx)(A.$n,{onClick:this.onLighten,style:{order:1,flex:"1 1 auto",minWidth:0},className:"msp-form-control",children:"Lighten"}),(0,e.jsx)(A.$n,{onClick:this.onDarken,style:{order:1,flex:"1 1 auto",minWidth:0},className:"msp-form-control",children:"Darken"})]})]});return this.props.hideNameRow?d:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(A.eJ,{title:this.props.param.description,label:I,control:(0,e.jsx)(A.$n,{onClick:this.toggleExpanded,inline:!0,className:"msp-combined-color-button",style:{background:o.Q1.toStyle(this.props.value)}})}),this.state.isExpanded&&(0,e.jsx)("div",{className:"msp-control-offset",children:d})]})}}let v;function O(){return v||(v=(0,e.jsx)(e.Fragment,{children:c.map(M=>(0,e.jsx)("option",{value:M[1],style:{background:`${o.Q1.toStyle(M[1])}`},children:(0,r.Mk)(M[0])},M[1]))}),v)}const b=function(){const M=new Map;for(const I of c)M.set(I[1],I[0]);return M}();function _(M){return b.has(M)?null:(0,e.jsx)("option",{value:M,style:{background:`${o.Q1.toStyle(M)}`},children:o.Q1.toRgbString(M)},o.Q1.toHexString(M))}},3584:(tn,Ue,n)=>{"use strict";n.d(Ue,{$n:()=>O,K0:()=>b,U2:()=>i,X3:()=>v,Yj:()=>M,eJ:()=>I,ff:()=>_,ks:()=>c,tW:()=>A});var e=n(9619),o=n(1395),r=n(190),t=n(9611);class A extends o.Component{constructor(){super(...arguments),this.state={isExpanded:!!this.props.initialExpanded},this.headerClicked=()=>{this.props.onHeaderClick?this.props.onHeaderClick():this.setState({isExpanded:!this.state.isExpanded})}}render(){let m=this.props.hideOffset?"msp-control-group-children":"msp-control-group-children msp-control-offset";return this.props.childrenClassName&&(m+=" "+this.props.childrenClassName),(0,e.jsxs)("div",{className:"msp-control-group-wrapper",style:{position:"relative",marginTop:this.props.noTopMargin?0:void 0},children:[(0,e.jsx)("div",{className:"msp-control-group-header",style:{marginLeft:this.props.headerLeftMargin},title:this.props.title,children:(0,e.jsxs)(O,{onClick:this.headerClicked,children:[!this.props.hideExpander&&(0,e.jsx)(t.In,{svg:this.state.isExpanded?t.Cp:t.DM}),this.props.topRightIcon&&(0,e.jsx)(t.In,{svg:this.props.topRightIcon,style:{position:"absolute",right:"2px",top:0}}),(0,e.jsx)("b",{children:this.props.header})]})}),this.state.isExpanded&&(0,e.jsx)("div",{className:m,style:{display:this.state.isExpanded?"block":"none",maxHeight:this.props.maxHeight,overflow:"hidden",overflowY:"auto"},children:this.props.children})]})}}function y(l){return l}class c extends o.PureComponent{constructor(){super(...arguments),this.input=o.createRef(),this.delayHandle=void 0,this.pendingValue=void 0,this.state={originalValue:"",value:""},this.onBlur=()=>{this.setState({value:""+this.state.originalValue}),this.props.onBlur&&this.props.onBlur()},this.raiseOnChange=()=>{void 0!==this.pendingValue&&(this.props.onChange(this.pendingValue),this.pendingValue=void 0)},this.onChange=m=>{const u=m.target.value;if(this.props.isValid&&!this.props.isValid(u)||this.props.numeric&&Number.isNaN(+u))return this.clearTimeout(),void this.setState({value:u});if(this.props.numeric)this.setState({value:u},()=>this.triggerChanged(u,+u));else{const s=(this.props.toValue||y)(u),C=(this.props.fromValue||y)(s);this.setState({value:C},()=>this.triggerChanged(C,s))}},this.onKeyUp=m=>{(27===m.charCode||27===m.keyCode||"Escape"===m.key)&&this.props.blurOnEscape&&this.input.current&&this.input.current.blur()},this.onKeyPress=m=>{(13===m.keyCode||13===m.charCode||"Enter"===m.key)&&(this.isPending&&(this.clearTimeout(),this.raiseOnChange()),this.props.blurOnEnter&&this.input.current&&this.input.current.blur(),this.props.onEnter&&this.props.onEnter()),m.stopPropagation()}}get isPending(){return typeof this.delayHandle<"u"}clearTimeout(){this.isPending&&(clearTimeout(this.delayHandle),this.delayHandle=void 0)}triggerChanged(m,u){this.clearTimeout(),m!==this.state.originalValue&&(this.props.delayMs?(this.pendingValue=u,this.delayHandle=setTimeout(this.raiseOnChange,this.props.delayMs)):this.props.onChange(u))}static getDerivedStateFromProps(m,u){const d=m.fromValue?m.fromValue(m.value):m.value;return d===u.originalValue?null:{originalValue:d,value:d}}render(){return(0,e.jsx)("input",{type:"text",className:this.props.className,style:this.props.style,ref:this.input,onBlur:this.onBlur,value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onKeyPress:this.props.onEnter||this.props.blurOnEnter||this.props.blurOnEscape?this.onKeyPress:void 0,onKeyDown:this.props.blurOnEscape?this.onKeyUp:void 0,disabled:!!this.props.isDisabled})}}class i extends o.Component{constructor(){super(...arguments),this.state={isExpanded:!1},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){const{label:m,pivot:u,controls:d}=this.props;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I,{label:(0,e.jsxs)(e.Fragment,{children:[m,(0,e.jsx)("button",{className:"msp-btn-link msp-btn-icon msp-control-group-expander",onClick:this.toggleExpanded,title:(this.state.isExpanded?"Less":"More")+" options",style:{background:"transparent",textAlign:"left",padding:"0"},children:(0,e.jsx)(t.In,{svg:this.state.isExpanded?t.$j:t.CR,style:{display:"inline-block"}})})]}),control:u,children:this.props.colorStripe&&(0,e.jsx)("div",{className:"msp-expandable-group-color-stripe",style:{backgroundColor:r.Q1.toStyle(this.props.colorStripe)}})}),this.state.isExpanded&&(0,e.jsx)("div",{className:"msp-control-offset",children:d})]})}}function v(l){return(0,e.jsxs)("div",{className:"msp-section-header"+(l.accent?" msp-transform-header-brand-"+l.accent:""),children:[l.icon&&(0,e.jsx)(t.In,{svg:l.icon}),l.title," ",(0,e.jsx)("small",{children:l.desc})]})}function O(l){let u,m="msp-btn";return l.inline||(m+=" msp-btn-block"),l.noOverflow&&(m+=" msp-no-overflow"),l.flex&&(m+=" msp-flex-item"),("on"===l.commit||l.commit)&&(m+=" msp-btn-commit msp-btn-commit-on"),"off"===l.commit&&(m+=" msp-btn-commit msp-btn-commit-off"),l.children||(m+=" msp-btn-childless"),l.className&&(m+=" "+l.className),l.flex&&("number"==typeof l.flex?u={flex:`0 0 ${l.flex}px`,padding:0,maxWidth:`${l.flex}px`}:"string"==typeof l.flex&&(u={flex:`0 0 ${l.flex}`,padding:0,maxWidth:l.flex})),l.style&&(u?Object.assign(u,l.style):u=l.style),(0,e.jsxs)("button",{onClick:l.onClick,title:l.title,disabled:l.disabled,style:u,className:m,"data-id":l["data-id"],"data-color":l["data-color"],onContextMenu:l.onContextMenu,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,children:[l.icon&&(0,e.jsx)(t.In,{svg:l.icon}),l.children]})}function b(l){let u,m=`msp-btn msp-btn-icon${l.small?"-small":""}${l.className?" "+l.className:""}`;return typeof l.toggleState<"u"&&(m+=" msp-btn-link-toggle-"+(l.toggleState?"on":"off")),l.transparent&&(m+=" msp-transparent-bg"),l.flex&&(u="boolean"==typeof l.flex?{flex:"0 0 32px",padding:0}:"number"==typeof l.flex?{flex:`0 0 ${l.flex}px`,padding:0,maxWidth:`${l.flex}px`}:{flex:`0 0 ${l.flex}`,padding:0,maxWidth:l.flex}),l.style&&(u?Object.assign(u,l.style):u=l.style),(0,e.jsxs)("button",{className:m,onClick:l.onClick,title:l.title,disabled:l.disabled,"data-id":l["data-id"],style:u,children:[l.svg&&(0,e.jsx)(t.In,{svg:l.svg}),l.extraContent]})}class _ extends o.PureComponent{constructor(){super(...arguments),this.onClick=m=>{m.currentTarget.blur(),this.props.toggle()}}render(){const m=this.props,u=m.label;return(0,e.jsx)(O,{icon:this.props.icon,onClick:this.onClick,title:this.props.title,inline:this.props.inline,disabled:m.disabled,style:m.style,className:m.isSelected?`${m.className||""} msp-control-current`:m.className,children:u&&this.props.isSelected?(0,e.jsx)("b",{children:u}):u})}}class M extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!!this.props.initiallyExpanded},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"msp-control-group-header",style:{marginTop:void 0!==this.props.marginTop?this.props.marginTop:"1px",marginLeft:this.props.headerLeftMargin},children:(0,e.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleExpanded,style:this.props.headerStyle,children:[(0,e.jsx)(t.In,{svg:this.state.isExpanded?t.DM:t.Cp}),this.props.header]})}),this.state.isExpanded&&(this.props.noOffset?this.props.children:(0,e.jsx)("div",{className:this.props.accent?"msp-accent-offset":"msp-control-offset",children:this.props.children}))]})}}function I(l){let m="msp-control-row";return l.className&&(m+=" "+l.className),(0,e.jsxs)("div",{className:m,children:[(0,e.jsx)("span",{className:"msp-control-row-label",title:l.title,children:l.label}),(0,e.jsx)("div",{className:"msp-control-row-ctrl",children:l.control}),l.children]})}},9611:(tn,Ue,n)=>{"use strict";n.d(Ue,{$8:()=>ho,$j:()=>Dr,B7:()=>_,Bw:()=>Me,C$:()=>Ce,CQ:()=>ie,CR:()=>V,Cp:()=>J,DM:()=>H,E2:()=>yt,FJ:()=>nt,FP:()=>ye,Fi:()=>Z,Hk:()=>br,ID:()=>Q,In:()=>o,L3:()=>or,M6:()=>An,Mm:()=>ae,NT:()=>Rn,OY:()=>ke,QM:()=>y,RZ:()=>Ae,Rf:()=>Ur,Rm:()=>I,U3:()=>Gt,VH:()=>Ve,X6:()=>re,XD:()=>Oe,XI:()=>ce,Xq:()=>be,_c:()=>E,c3:()=>m,cv:()=>Ct,d6:()=>Vt,e:()=>Ir,fL:()=>Lt,fe:()=>g,fl:()=>xe,ij:()=>On,je:()=>dt,l8:()=>en,lj:()=>Bo,mf:()=>pn,ml:()=>tt,p8:()=>te,qF:()=>Hr,qp:()=>N,sM:()=>Y,sd:()=>kt,sx:()=>O,sy:()=>ir,tk:()=>i,vC:()=>K,xY:()=>cn,xf:()=>yn,y5:()=>Ie,yF:()=>L,yG:()=>po,yf:()=>nn,z7:()=>so,zs:()=>Fr});var e=n(9619);function o(Go){return Go.svg?(0,e.jsx)("span",{className:"msp-icon msp-material-icon"+(Go.inline?" msp-icon-inline":""),title:Go.title,style:Go.style,children:(0,e.jsx)(Go.svg,{})}):null}const r=(0,e.jsx)("circle",{r:"6px",id:"circle-left",cy:"12px",cx:"8px",strokeWidth:"1px"}),t=(0,e.jsx)("circle",{r:"6px",id:"circle-right",cy:"12px",cx:"16px",strokeWidth:"1px"}),A=(0,e.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,e.jsxs)("defs",{children:[r,t]}),(0,e.jsxs)("g",{children:[(0,e.jsx)("use",{href:"#circle-left",className:"msp-shape-filled"}),(0,e.jsx)("use",{href:"#circle-right",className:"msp-shape-filled"}),(0,e.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"})]})]});function y(){return A}const c=(0,e.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,e.jsxs)("defs",{children:[r,t,(0,e.jsxs)("mask",{id:"mask-left",children:[(0,e.jsx)("use",{href:"#circle-left",fill:"white",stroke:"white"}),(0,e.jsx)("use",{href:"#circle-right",fill:"black",strokeWidth:"0px",stroke:"white"})]})]}),(0,e.jsxs)("g",{children:[(0,e.jsx)("use",{href:"#circle-left",className:"msp-shape-filled",mask:"url(#mask-left)"}),(0,e.jsx)("use",{href:"#circle-right",className:"msp-shape-empty"})]})]});function i(){return c}const v=(0,e.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,e.jsxs)("defs",{children:[r,t,(0,e.jsx)("clipPath",{id:"clip-left",children:(0,e.jsx)("use",{href:"#circle-right"})})]}),(0,e.jsxs)("g",{children:[(0,e.jsx)("use",{href:"#circle-left",className:"msp-shape-filled",clipPath:"url(#clip-left)"}),(0,e.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"}),(0,e.jsx)("use",{href:"#circle-right",className:"msp-shape-empty"})]})]});function O(){return v}const b=(0,e.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,e.jsxs)("defs",{children:[r,t]}),(0,e.jsxs)("g",{children:[(0,e.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"}),(0,e.jsx)("use",{href:"#circle-right",className:"msp-shape-filled"})]})]});function _(){return b}const M=(0,e.jsx)("svg",{width:"17px",height:"17px",viewBox:"0 0 299.463 299.463",strokeWidth:"6px",children:(0,e.jsx)("g",{children:(0,e.jsx)("path",{d:"M256.851,173.832v-48.201c22.916-4.918,34.151-30.668,22.556-50.771c-11.547-20.004-39.486-23.251-55.242-5.844 l-41.746-24.106C189.618,22.603,172.861,0,149.734,0c-23.132,0-39.881,22.609-32.685,44.911L75.305,69.016 C59.522,51.586,31.597,54.88,20.061,74.863c-11.63,20.163-0.298,45.862,22.557,50.769v48.2 c-22.821,4.898-34.195,30.591-22.556,50.771c11.529,19.972,39.454,23.285,55.242,5.845l41.746,24.106 c-7.199,22.308,9.559,44.911,32.685,44.911c23.132,0,39.88-22.609,32.685-44.911l41.745-24.106 c15.817,17.469,43.73,14.099,55.242-5.844c0,0,0-0.001,0.001-0.002c4.587-7.953,5.805-17.213,3.431-26.076 C279.392,185.657,269.129,176.461,256.851,173.832z M249.62,72.088c20.568,0,27.428,27.191,10.008,37.239 c-0.003,0.002-0.006,0.003-0.009,0.005c-10.04,5.81-22.85,1.762-27.877-8.475C225.206,87.548,234.938,72.088,249.62,72.088z M149.734,14.4c11.005,0,19.958,8.954,19.958,19.959c0,11.127-9.077,19.958-19.958,19.958c-10.95,0-19.958-8.9-19.958-19.958 C129.776,23.354,138.729,14.4,149.734,14.4z M39.84,109.328c-17.451-10.067-10.534-37.24,10.01-37.24 c15.311,0,24.922,16.653,17.251,29.942C61.681,111.397,49.517,114.925,39.84,109.328z M59.802,224.702 c-9.535,5.503-21.768,2.229-27.268-7.298c-7.639-13.242,1.887-29.945,17.236-29.945c0.013,0,0.027,0,0.04,0 C70.07,187.48,77.49,214.469,59.802,224.702z M149.734,285.062c-11.005,0-19.958-8.954-19.958-19.958 c0-11.127,9.077-19.958,19.958-19.958c10.954,0,19.958,8.903,19.958,19.958C169.693,276.109,160.74,285.062,149.734,285.062z M216.953,217.982l-41.727,24.095c-13.778-15.22-37.459-14.94-50.983,0l-41.728-24.096c6.196-19.289-5.541-39.835-25.498-44.149 V125.63c19.752-4.268,31.762-24.65,25.498-44.149l41.727-24.095c13.629,15.055,37.32,15.093,50.983,0l41.728,24.096 c-6.196,19.29,5.534,39.835,25.498,44.149v48.202C222.61,178.123,210.721,198.581,216.953,217.982z M266.935,217.404 c-5.501,9.528-17.732,12.802-27.261,7.302c-17.682-10.23-10.301-37.247,10.032-37.247 C264.984,187.459,274.602,204.112,266.935,217.404z"})})});function I(){return M}const l=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{d:"M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L6.04,7.5L12,10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z"})});function m(){return l}(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{d:"M17,22V20H20V17H22V20.5C22,20.89 21.84,21.24 21.54,21.54C21.24,21.84 20.89,22 20.5,22H17M7,22H3.5C3.11,22 2.76,21.84 2.46,21.54C2.16,21.24 2,20.89 2,20.5V17H4V20H7V22M17,2H20.5C20.89,2 21.24,2.16 21.54,2.46C21.84,2.76 22,3.11 22,3.5V7H20V4H17V2M7,2V4H4V7H2V3.5C2,3.11 2.16,2.76 2.46,2.46C2.76,2.16 3.11,2 3.5,2H7M13,17.25L17,14.95V10.36L13,12.66V17.25M12,10.92L16,8.63L12,6.28L8,8.63L12,10.92M7,14.95L11,17.25V12.66L7,10.36V14.95M18.23,7.59C18.73,7.91 19,8.34 19,8.91V15.23C19,15.8 18.73,16.23 18.23,16.55L12.75,19.73C12.25,20.05 11.75,20.05 11.25,19.73L5.77,16.55C5.27,16.23 5,15.8 5,15.23V8.91C5,8.34 5.27,7.91 5.77,7.59L11.25,4.41C11.5,4.28 11.75,4.22 12,4.22C12.25,4.22 12.5,4.28 12.75,4.41L18.23,7.59Z"})}),(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{d:"M16,4L9,8.04V15.96L16,20L23,15.96V8.04M16,6.31L19.8,8.5L16,10.69L12.21,8.5M0,7V9H7V7M11,10.11L15,12.42V17.11L11,14.81M21,10.11V14.81L17,17.11V12.42M2,11V13H7V11M4,15V17H7V15"})});const h=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"})});(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{fill:"currentColor",d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"})}),(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{fill:"currentColor",d:"M20,11H23V13H20V11M1,11H4V13H1V11M13,1V4H11V1H13M4.92,3.5L7.05,5.64L5.63,7.05L3.5,4.93L4.92,3.5M16.95,5.63L19.07,3.5L20.5,4.93L18.37,7.05L16.95,5.63M12,6A6,6 0 0,1 18,12C18,14.22 16.79,16.16 15,17.2V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V17.2C7.21,16.16 6,14.22 6,12A6,6 0 0,1 12,6M14,21V22A1,1 0 0,1 13,23H11A1,1 0 0,1 10,22V21H14M11,18H13V15.87C14.73,15.43 16,13.86 16,12A4,4 0 0,0 12,8A4,4 0 0,0 8,12C8,13.86 9.27,15.43 11,15.87V18Z"})});const p=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{fill:"currentColor",d:"M7.5,5.6L5,7L6.4,4.5L5,2L7.5,3.4L10,2L8.6,4.5L10,7L7.5,5.6M19.5,15.4L22,14L20.6,16.5L22,19L19.5,17.6L17,19L18.4,16.5L17,14L19.5,15.4M22,2L20.6,4.5L22,7L19.5,5.6L17,7L18.4,4.5L17,2L19.5,3.4L22,2M13.34,12.78L15.78,10.34L13.66,8.22L11.22,10.66L13.34,12.78M14.37,7.29L16.71,9.63C17.1,10 17.1,10.65 16.71,11.04L5.04,22.71C4.65,23.1 4,23.1 3.63,22.71L1.29,20.37C0.9,20 0.9,19.35 1.29,18.96L12.96,7.29C13.35,6.9 14,6.9 14.37,7.29Z"})});function E(){return p}const T=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{d:"M3 17.25V21H6.75L17.81 9.93L14.06 6.18L3 17.25M22.61 18.36L18.36 22.61L13.16 17.41L14.93 15.64L15.93 16.64L18.4 14.16L19.82 15.58L18.36 17L19.42 18L20.84 16.6L22.61 18.36M6.61 10.83L1.39 5.64L5.64 1.39L7.4 3.16L4.93 5.64L6 6.7L8.46 4.22L9.88 5.64L8.46 7.05L9.46 8.05L6.61 10.83M20.71 7C21.1 6.61 21.1 6 20.71 5.59L18.37 3.29C18 2.9 17.35 2.9 16.96 3.29L15.12 5.12L18.87 8.87L20.71 7Z"})});function L(){return T}const w=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3h7zM7 9H4V5h3v4zm10 6h3v4h-3v-4zm0-10h3v4h-3V5z"})});function Q(){return w}const G=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})});function V(){return G}const U=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})});function N(){return U}const k=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M7 10l5 5 5-5z"})});function H(){return k}const $=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M10 17l5-5-5-5v10z"})});function J(){return $}const W=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})});function te(){return W}const de=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"})});function ye(){return de}const j=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M6 13c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-3 .5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM6 5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm15 5.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zM14 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0-3.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zm-11 10c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm7 7c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm0-17c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zM10 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0 5.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm8 .5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm3 8.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM14 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 3.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm-4-12c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0 8.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm4-4.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-4c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"})});function Z(){return j}const q=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M15 7v12.97l-4.21-1.81-.79-.34-.79.34L5 19.97V7h10m4-6H8.99C7.89 1 7 1.9 7 3h10c1.1 0 2 .9 2 2v13l2 1V3c0-1.1-.9-2-2-2zm-4 4H5c-1.1 0-2 .9-2 2v16l7-3 7 3V7c0-1.1-.9-2-2-2z"})});function Y(){return q}const ee=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37l-1.34-1.34a.9959.9959 0 00-1.41 0L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41z"})});function g(){return ee}const _e=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M22.61 18.99l-9.08-9.08c.93-2.34.45-5.1-1.44-7C9.79.61 6.21.4 3.66 2.26L7.5 6.11 6.08 7.52 2.25 3.69C.39 6.23.6 9.82 2.9 12.11c1.86 1.86 4.57 2.35 6.89 1.48l9.11 9.11c.39.39 1.02.39 1.41 0l2.3-2.3c.4-.38.4-1.01 0-1.41zm-3 1.6l-9.46-9.46c-.61.45-1.29.72-2 .82-1.36.2-2.79-.21-3.83-1.25C3.37 9.76 2.93 8.5 3 7.26l3.09 3.09 4.24-4.24-3.09-3.09c1.24-.07 2.49.37 3.44 1.31 1.08 1.08 1.49 2.57 1.24 3.96-.12.71-.42 1.37-.88 1.96l9.45 9.45-.88.89z"})});function xe(){return _e}const le=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"})});function Ae(){return le}const Be=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M14.25 2.26l-.08-.04-.01.02C13.46 2.09 12.74 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-4.75-3.31-8.72-7.75-9.74zM19.41 9h-7.99l2.71-4.7c2.4.66 4.35 2.42 5.28 4.7zM13.1 4.08L10.27 9l-1.15 2L6.4 6.3C7.84 4.88 9.82 4 12 4c.37 0 .74.03 1.1.08zM5.7 7.09L8.54 12l1.15 2H4.26C4.1 13.36 4 12.69 4 12c0-1.85.64-3.55 1.7-4.91zM4.59 15h7.98l-2.71 4.7c-2.4-.67-4.34-2.42-5.27-4.7zm6.31 4.91L14.89 13l2.72 4.7C16.16 19.12 14.18 20 12 20c-.38 0-.74-.04-1.1-.09zm7.4-3l-4-6.91h5.43c.17.64.27 1.31.27 2 0 1.85-.64 3.55-1.7 4.91z"})});function Ce(){return Be}const Re=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M9.4 10.5l4.77-8.26C13.47 2.09 12.75 2 12 2c-2.4 0-4.6.85-6.32 2.25l3.66 6.35.06-.1zM21.54 9c-.92-2.92-3.15-5.26-6-6.34L11.88 9h9.66zm.26 1h-7.49l.29.5 4.76 8.25C21 16.97 22 14.61 22 12c0-.69-.07-1.35-.2-2zM8.54 12l-3.9-6.75C3.01 7.03 2 9.39 2 12c0 .69.07 1.35.2 2h7.49l-1.15-2zm-6.08 3c.92 2.92 3.15 5.26 6 6.34L12.12 15H2.46zm11.27 0l-3.9 6.76c.7.15 1.42.24 2.17.24 2.4 0 4.6-.85 6.32-2.25l-3.66-6.35-.93 1.6z"})});function ke(){return Re}const we=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"})});function Oe(){return we}const Se=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"})});function Ve(){return Se}const Ne=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-7 7H3v4c0 1.1.9 2 2 2h4v-2H5v-4zM5 5h4V3H5c-1.1 0-2 .9-2 2v4h2V5zm14-2h-4v2h4v4h2V5c0-1.1-.9-2-2-2zm0 16h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4z"})});function K(){return Ne}const ne=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})});function be(){return ne}const Te=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})});function ie(){return Te}const ue=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})});function re(){return ue}const ve=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"})});function ce(){return ve}const se=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})});function ae(){return se}const ge=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"})});function Ie(){return ge}const Le=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"})});function nt(){return Le}const je=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"})});function Lt(){return je}const Je=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-5.04-6.71l-2.75 3.54-1.96-2.36L6.5 17h11l-3.54-4.71z"})});function en(){return Je}const Bt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})});function pn(){return Bt}(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})});const _t=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})});function Me(){return _t}(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"})});const Kt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{d:"M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"})}),gt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})});function yt(){return gt}const At=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})});function Gt(){return At}const rn=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"})});function tt(){return rn}const Mt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z"})});function nn(){return Mt}(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"})});const jt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19.5 9.5c-1.03 0-1.9.62-2.29 1.5h-2.92c-.39-.88-1.26-1.5-2.29-1.5s-1.9.62-2.29 1.5H6.79c-.39-.88-1.26-1.5-2.29-1.5C3.12 9.5 2 10.62 2 12s1.12 2.5 2.5 2.5c1.03 0 1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5s1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5z"})}),Dt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})});function Ct(){return Dt}const $t=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})});function Vt(){return $t}const Wt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})});function yn(){return Wt}const Zt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z"})});function kt(){return Zt}const Ot=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M8 5v14l11-7z"})});function An(){return Ot}const jn=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})});function On(){return jn}const fr=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M19 13H5v-2h14v2z"})});function Dr(){return fr}const Pr=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})});function or(){return Pr}const Nr=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,e.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm2 16H5V5h11.17L19 7.83V19zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zM6 6h9v4H6z"})});function Ir(){return Nr}const Or=(0,e.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,e.jsx)("circle",{cx:"7",cy:"14",r:"3"}),(0,e.jsx)("circle",{cx:"11",cy:"6",r:"3"}),(0,e.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"})]});(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})});const ct=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M6 6h2v12H6zm3.5 6l8.5 6V6z"})});function dt(){return ct}const Yt=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M6 6h12v12H6z"})});function cn(){return Yt}const xn=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M4 6h16v2H4zm2-4h12v2H6zm14 8H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm0 10H4v-8h16v8zm-10-7.27v6.53L16 16z"})});function Rn(){return xn}const er=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z"})});function ir(){return er}const Yn=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"})});function br(){return Yn}const vr=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53z"})});function Hr(){return vr}const Mr=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"})});function Fr(){return Mr}const Sr=(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})});function Ur(){return Sr}(0,e.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M 9.64 7.64 c 0.23 -0.5 0.36 -1.05 0.36 -1.64 c 0 -2.21 -1.79 -4 -4 -4 S 2 3.79 2 6 s 1.79 4 4 4 c 0.59 0 1.14 -0.13 1.64 -0.36 L 10 12 l -2.36 2.36 C 7.14 14.13 6.59 14 6 14 c -2.21 0 -4 1.79 -4 4 s 1.79 4 4 4 s 4 -1.79 4 -4 c 0 -0.59 -0.13 -1.14 -0.36 -1.64 L 12 14 l 7 7 h 3 v -1 L 9.64 7.64 Z M 6 8 c -1.1 0 -2 -0.89 -2 -2 s 0.9 -2 2 -2 s 2 0.89 2 2 s -0.9 2 -2 2 Z m 0 12 c -1.1 0 -2 -0.89 -2 -2 s 0.9 -2 2 -2 s 2 0.89 2 2 s -0.9 2 -2 2 Z m 6 -7.5 c -0.28 0 -0.5 -0.22 -0.5 -0.5 s 0.22 -0.5 0.5 -0.5 s 0.5 0.22 0.5 0.5 s -0.22 0.5 -0.5 0.5 Z M 19 3 l -6 6 l 2 2 l 7 -7 V 3 Z"})});const po=function a(){return h},so=function Jr(){return Or},ho=function It(){return jt},Bo=function sn(){return Kt}},7561:(tn,Ue,n)=>{"use strict";n.d(Ue,{jH:()=>T,y1:()=>R,dr:()=>f,UT:()=>$,Z4:()=>w});var e=n(9619),o=n(1395),r=n(4369),t=n(9498),A=n(1861),y=n(190),c=n(1907),i=n(1094),v=n(229),O=n(8277),b=n(7785),_=n(1133),M=n(8791),I=n(22),l=n(3584),m=n(9611);class d extends o.PureComponent{render(){const{legend:re}=this.props,ve=re.colors.map(ce=>Array.isArray(ce)?`${y.Q1.toStyle(ce[0])} ${100*ce[1]}%`:y.Q1.toStyle(ce)).join(", ");return(0,e.jsx)("div",{className:"msp-scale-legend",children:(0,e.jsxs)("div",{style:{background:`linear-gradient(to right, ${ve})`},children:[(0,e.jsx)("span",{style:{float:"left"},children:re.minLabel}),(0,e.jsx)("span",{style:{float:"right"},children:re.maxLabel})]})})}}class s extends o.PureComponent{render(){const{legend:re}=this.props;return(0,e.jsx)("div",{className:"msp-table-legend",children:re.table.map((ve,ce)=>{const[se,ae]=ve;return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"msp-table-legend-color",style:{backgroundColor:y.Q1.toStyle(ae)}}),(0,e.jsx)("div",{className:"msp-table-legend-text",children:se})]},ce)})})}}class C extends o.Component{constructor(re){super(re),this.state={show:!1},this.handleHover=this.handleHover.bind(this),this.handleHoverOff=this.handleHoverOff.bind(this),this.deletePoint=this.deletePoint.bind(this)}handleHover(){this.setState({show:!0});const re=r.ZY.create(this.props.nX,this.props.nY);this.props.onmouseover(re)}handleHoverOff(){this.setState({show:!1}),this.props.onmouseover(void 0)}deletePoint(){this.props.delete(this.props.id)}render(){return[(0,e.jsx)("circle",{r:"10",id:`${this.props.id}`,cx:this.props.x,cy:this.props.y,onClick:this.props.onclick,onDoubleClick:this.props.delete(this.props.id),onMouseEnter:this.handleHover,onMouseLeave:this.handleHoverOff,onMouseDown:this.props.onmousedown,fill:"black"},`${this.props.id}circle`)]}}var h=n(6853),a=n(6115);class S extends o.Component{constructor(re){super(re),this.handleKeyDown=ve=>{},this.handleKeyUp=ve=>{},this.handleClick=ve=>ce=>{},this.handleMouseDown=ve=>ce=>{if(0===ve||ve===this.state.points.length-1||this.state.canSelectMultiple)return;const se=this.normalizePoint(r.ZY.create(this.state.points[ve][0],this.state.points[ve][1]));this.ghostPoints.push(document.createElementNS(this.namespace,"circle")),this.ghostPoints[0].setAttribute("r","10"),this.ghostPoints[0].setAttribute("fill","orange"),this.ghostPoints[0].setAttribute("cx",`${se[0]}`),this.ghostPoints[0].setAttribute("cy",`${se[1]}`),this.ghostPoints[0].setAttribute("style","display: none"),this.gElement.appendChild(this.ghostPoints[0]),this.updatedX=se[0],this.updatedY=se[1],this.selected=[ve]},this.deletePoint=ve=>ce=>{if(0===ve||ve===this.state.points.length-1)return;const se=this.state.points.filter((ae,ge)=>ge!==ve);se.sort((ae,ge)=>ae[0]===ge[0]?0===ae[0]?ae[1]-ge[1]:1===ae[1]?ge[1]-ae[1]:ae[1]-ge[1]:ae[0]-ge[0]),this.setState({points:se}),this.change(se),ce.stopPropagation()},this.myRef=o.createRef(),this.state={points:[r.ZY.create(0,0),r.ZY.create(1,0)],copyPoint:void 0,canSelectMultiple:!1},this.height=400,this.width=600,this.padding=70,this.selected=void 0,this.ghostPoints=[],this.namespace="http://www.w3.org/2000/svg";for(const ve of this.props.data)this.state.points.push(ve);this.state.points.sort((ve,ce)=>ve[0]===ce[0]?0===ve[0]?ve[1]-ce[1]:1===ve[1]?ce[1]-ve[1]:ve[1]-ce[1]:ve[0]-ce[0]),this.handleDrag=this.handleDrag.bind(this),this.handleMultipleDrag=this.handleMultipleDrag.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.refCallBack=this.refCallBack.bind(this),this.handlePointUpdate=this.handlePointUpdate.bind(this),this.change=this.change.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleLeave=this.handleLeave.bind(this),this.handleEnter=this.handleEnter.bind(this)}render(){const re=this.renderPoints(),ve=this.renderLines(),ce=this.renderHistogram();return[(0,e.jsx)("div",{children:(0,e.jsxs)("svg",{className:"msp-canvas",ref:this.refCallBack,viewBox:`0 0 ${this.width+this.padding} ${this.height+this.padding}`,onMouseMove:this.handleDrag,onMouseUp:this.handlePointUpdate,onMouseLeave:this.handleLeave,onMouseEnter:this.handleEnter,tabIndex:0,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onDoubleClick:this.handleDoubleClick,children:[(0,e.jsxs)("g",{stroke:"black",fill:"black",children:[ce,ve,re]}),(0,e.jsx)("g",{className:"ghost-points",stroke:"black",fill:"black"})]})},"LineGraph"),(0,e.jsx)("div",{id:"modal-root"},"modal")]}componentDidMount(){this.gElement=document.getElementsByClassName("ghost-points")[0]}change(re){const ve=re.slice();ve.shift(),ve.pop(),this.props.onChange(ve)}handleDrag(re){if(void 0===this.selected)return;const ve=this.myRef.createSVGPoint();let ce;const se=this.padding/2;ve.x=re.clientX,ve.y=re.clientY;const ae=ve.matrixTransform(this.myRef.getScreenCTM().inverse());ce=r.ZY.create(ae.x,ae.y),ce=(ae.xthis.width+se)&&(ae.y>this.height+se||ae.ythis.width+se?r.ZY.create(this.width+se,ae.y):r.ZY.create(ae.x,ae.y>this.height+se?this.height+se:ae.yge!==ve[0]);se.push(ce),se.sort((ae,ge)=>ae[0]===ge[0]?0===ae[0]?ae[1]-ge[1]:1===ae[1]?ge[1]-ae[1]:ae[1]-ge[1]:ae[0]-ge[0]),this.setState({points:se}),this.change(se),this.gElement.innerHTML="",this.ghostPoints=[],document.removeEventListener("mousemove",this.handleDrag,!0),document.removeEventListener("mouseup",this.handlePointUpdate,!0)}handleDoubleClick(re){const ve=this.myRef.createSVGPoint();ve.x=re.clientX,ve.y=re.clientY;const ce=ve.matrixTransform(this.myRef.getScreenCTM().inverse()),se=this.state.points,ae=this.padding/2;if(ce.xthis.width+ae||ce.y>this.height+ae||ce.yIe[0]===Le[0]?0===Ie[0]?Ie[1]-Le[1]:1===Ie[1]?Le[1]-Ie[1]:Ie[1]-Le[1]:Ie[0]-Le[0]),this.setState({points:se}),this.change(se)}handleLeave(){void 0!==this.selected&&(document.addEventListener("mousemove",this.handleDrag,!0),document.addEventListener("mouseup",this.handlePointUpdate,!0))}handleEnter(){document.removeEventListener("mousemove",this.handleDrag,!0),document.removeEventListener("mouseup",this.handlePointUpdate,!0)}normalizePoint(re){const ve=this.padding/2;return r.ZY.create(re[0]*(this.width+ve-ve)+ve,this.height+this.padding-(re[1]*(this.height+ve-ve)+ve))}unNormalizePoint(re){const ve=this.padding/2;return r.ZY.create((re[0]-ve)/(this.width+ve-ve),(this.height+this.padding-re[1]-ve)/(this.height+ve-ve))}refCallBack(re){re&&(this.myRef=re)}renderHistogram(){if(!this.props.volume)return null;const re=h.x.getHistogram(this.props.volume.grid,40),ve=[],ce=re.counts.length,se=this.width/ce,ae=this.padding/2,ge=(0,a._M)(re.counts)||1;for(let Ie=0;Ie{var ve,ce;if(null===(ce=(ve=this.props).onChange)||void 0===ce||ce.call(ve,re,this.props.values),this.props.onChangeValues){const se={...this.props.values,[re.name]:re.value};this.props.onChangeValues(se,this.props.values)}},this.paramGroups=(0,i._)(re=>function p(ue){function re(ge,Ie,Le){const nt=E(Ie);if(nt)if(Ie.category){Le.map||(Le.map=new Map);let je=Le.map.get(Ie.category);je||(je=[],Le.map.set(Ie.category,je),Le.params.push(je)),je.push([ge,Ie,nt])}else Le.params[0].push([ge,Ie,nt])}function ve(ge,Ie){const Le=ge[0],nt=Ie[0];return Le&&Le[1].category?nt&&nt[1].category&&Le[1].category{const ce={...ve,[re.name]:re.value},se=this.props.mapping.update(ce,this.plugin);this.props.mapping.apply(se,this.plugin)}}componentDidMount(){this.subscribe(this.plugin.state.data.behaviors.isUpdating,re=>{this.setState({isDisabled:re})})}render(){const re=this.props.mapping.getTarget(this.plugin),ve=this.props.mapping.getValues(re,this.plugin),ce=this.props.mapping.params(this.plugin);return(0,e.jsx)(R,{params:ce,values:ve,onChange:this.setSettings,isDisabled:this.state.isDisabled})}}function E(ue){switch(ue.type){case"value":case"data-ref":return;case"boolean":return G;case"number":return typeof ue.min<"u"&&typeof ue.max<"u"?N:U;case"converted":return Te;case"conditioned":return be;case"multi-select":return Oe;case"color":return I.cq;case"color-list":return ue.offsets?Ae:le;case"vec3":return Be;case"mat4":return Ce;case"url":return Re;case"file":return ke;case"file-list":return we;case"select":return J;case"value-ref":return W;case"text":return k;case"interval":return typeof ue.min<"u"&&typeof ue.max<"u"?de:te;case"group":return Se;case"mapped":return Ve;case"line-graph":return V;case"script":return ie;case"object-list":return ne;default:return void console.warn(`${ue} has no associated UI component`)}}class T extends o.PureComponent{render(){const{legend:re,description:ve}=this.props,ce=re&&function u(ue){switch(ue.kind){case"scale-legend":return d;case"table-legend":return s;default:return void console.warn(`${ue} has no associated UI component`)}}(re);return(0,e.jsx)("div",{className:"msp-help-text",children:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"msp-help-description",children:[(0,e.jsx)(m.In,{svg:m.ml,inline:!0}),ve]}),ce&&(0,e.jsx)("div",{className:"msp-help-legend",children:(0,e.jsx)(ce,{legend:re})})]})})}}function L(ue){const{props:re,state:ve,control:ce,toggleHelp:se,addOn:ae}=ue,ge=[];re.param.shortLabel&&ge.push("msp-control-label-short"),re.param.twoColumns&&ge.push("msp-control-col-2"),re.param.multiline&&ge.push("msp-control-twoline");const Ie=ge.join(" "),Le=re.param.label||(0,b.Hh)(re.name),nt=re.param.help?re.param.help(re.value):{description:re.param.description,legend:re.param.legend},je=nt.description||nt.legend,Lt=Le+(je?". Click for help.":"");return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.eJ,{className:Ie,title:Lt,label:(0,e.jsxs)(e.Fragment,{children:[Le,je&&(0,e.jsx)(w,{show:ve.showHelp,toggle:se,title:Lt})]}),control:ce}),je&&ve.showHelp&&(0,e.jsx)("div",{className:"msp-control-offset",children:(0,e.jsx)(T,{legend:nt.legend,description:nt.description})}),ae]})}function w({show:ue,toggle:re,title:ve}){return(0,e.jsx)("button",{className:"msp-help msp-btn-link msp-btn-icon msp-control-group-expander",onClick:re,title:ve||(ue?"Hide":"Show")+" help",style:{background:"transparent",textAlign:"left",padding:"0"},children:(0,e.jsx)(m.In,{svg:m.ml})})}class Q extends o.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}update(re){this.props.onChange({param:this.props.param,name:this.props.name,value:re})}renderAddOn(){return null}render(){return L({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderAddOn()})}}class G extends Q{constructor(){super(...arguments),this.onClick=re=>{this.update(!this.props.value),re.currentTarget.blur()}}renderControl(){return(0,e.jsxs)("button",{onClick:this.onClick,disabled:this.props.isDisabled,children:[(0,e.jsx)(m.In,{svg:this.props.value?m.Xq:m.CQ}),this.props.value?"On":"Off"]})}}class V extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1,isOverPoint:!1,message:`${this.props.param.defaultValue.length} points`},this.onHover=re=>{this.setState({isOverPoint:!this.state.isOverPoint}),this.setState(re?{message:this.pointToLabel(re)}:{message:`${this.props.value.length} points`})},this.onDrag=re=>{this.setState({message:this.pointToLabel(re)})},this.onChange=re=>{this.props.onChange({name:this.props.name,param:this.props.param,value:re})},this.toggleExpanded=re=>{this.setState({isExpanded:!this.state.isExpanded}),re.currentTarget.blur()}}pointToLabel(re){var ve,ce;if(!re)return"";const se=null===(ce=(ve=this.props.param).getVolume)||void 0===ce?void 0:ce.call(ve);if(se){const{min:ae,max:ge,mean:Ie,sigma:Le}=se.grid.stats,nt=ae+(ge-ae)*re[0],je=(nt-Ie)/Le;return`(${nt.toFixed(2)} | ${je.toFixed(2)}\u03c3, ${re[1].toFixed(2)})`}return`(${re[0].toFixed(2)}, ${re[1].toFixed(2)})`}render(){var re,ve;const ce=this.props.param.label||(0,b.Hh)(this.props.name);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.eJ,{label:ce,control:(0,e.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:`${this.state.message}`})}),(0,e.jsx)("div",{className:"msp-control-offset",style:{display:this.state.isExpanded?"block":"none",marginTop:1},children:(0,e.jsx)(S,{data:this.props.value,volume:null===(ve=(re=this.props.param).getVolume)||void 0===ve?void 0:ve.call(re),onChange:this.onChange,onHover:this.onHover,onDrag:this.onDrag})})]})}}class U extends o.PureComponent{constructor(){super(...arguments),this.state={value:"0"},this.update=re=>{const ve=(0,v.XV)(this.props.param.step||.01);re=parseFloat(re.toFixed(ve)),this.props.onChange({param:this.props.param,name:this.props.name,value:re})}}render(){const re=this.props.param.label||(0,b.Hh)(this.props.name),ve=this.props.param.label||(0,b.Hh)(this.props.name),ce=(0,v.XV)(this.props.param.step||.01);return(0,e.jsx)(l.eJ,{title:this.props.param.description,label:ve,control:(0,e.jsx)(l.ks,{numeric:!0,value:parseFloat(this.props.value.toFixed(ce)),onEnter:this.props.onEnter,placeholder:re,isDisabled:this.props.isDisabled,onChange:this.update})})}}class N extends Q{constructor(){super(...arguments),this.onChange=re=>{this.update(re)}}renderControl(){return(0,e.jsx)(D.Ap,{value:typeof this.props.value>"u"?this.props.param.defaultValue:this.props.value,min:this.props.param.min,max:this.props.param.max,step:this.props.param.step,onChange:this.onChange,onChangeImmediate:this.props.param.immediateUpdate?this.onChange:void 0,disabled:this.props.isDisabled,onEnter:this.props.onEnter})}}class k extends Q{constructor(){super(...arguments),this.updateValue=re=>{re!==this.props.value&&this.update(re)}}renderControl(){const re=this.props.param.placeholder||this.props.param.label||(0,b.Hh)(this.props.name);return(0,e.jsx)(H,{props:this.props,placeholder:re,update:this.updateValue})}}function H({props:ue,placeholder:re,update:ve}){const[ce,se]=o.useState(ue.value);return o.useEffect(()=>se(ue.value),[ue.value]),ue.param.multiline?(0,e.jsx)("div",{className:"msp-control-text-area-wrapper",children:(0,e.jsx)("textarea",{value:ue.param.disableInteractiveUpdates?ce||"":ue.value,placeholder:re,onChange:ae=>{ue.param.disableInteractiveUpdates?se(ae.target.value):ve(ae.target.value)},onBlur:ae=>{ue.param.disableInteractiveUpdates&&ve(ae.target.value)},onKeyDown:ae=>{"Enter"===ae.key&&(ae.shiftKey||ae.ctrlKey||ae.metaKey)&&ae.currentTarget.blur()},disabled:ue.isDisabled})}):(0,e.jsx)("input",{type:"text",value:ue.param.disableInteractiveUpdates?ce||"":ue.value,placeholder:re,onChange:ae=>{ue.param.disableInteractiveUpdates?se(ae.target.value):ve(ae.target.value)},onBlur:ae=>{ue.param.disableInteractiveUpdates&&ve(ae.target.value)},disabled:ue.isDisabled,onKeyDown:ae=>{"Enter"===ae.key&&(ue.onEnter?(ae.stopPropagation(),ue.onEnter()):"Enter"===ae.key&&(ae.shiftKey||ae.ctrlKey||ae.metaKey)?ae.currentTarget.blur():ue.param.disableInteractiveUpdates&&ve(ce))}})}class $ extends o.PureComponent{constructor(){super(...arguments),this.onChange=re=>{this.update("number"==typeof this.props.param.defaultValue?parseInt(re.target.value,10):re.target.value)}}update(re){this.props.onChange({param:this.props.param,name:this.props.name,value:re})}render(){const re=void 0!==this.props.value&&!this.props.param.options.some(ve=>ve[0]===this.props.value);return(0,e.jsxs)("select",{className:"msp-form-control",title:this.props.title,value:void 0!==this.props.value?this.props.value:this.props.param.defaultValue,onChange:this.onChange,disabled:this.props.isDisabled,children:[re&&(0,e.jsx)("option",{value:this.props.value,children:`[Invalid] ${this.props.value}`},this.props.value),this.props.param.options.map(([ve,ce])=>(0,e.jsx)("option",{value:ve,children:ce},ve))]})}}class J extends o.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,showOptions:!1},this.onSelect=re=>{re&&re.value!==this.props.value?this.setState({showOptions:!1},()=>{this.props.onChange({param:this.props.param,name:this.props.name,value:re.value})}):this.setState({showOptions:!1})},this.toggle=()=>this.setState({showOptions:!this.state.showOptions}),this.cycle=()=>{const{options:re}=this.props.param,ve=re.findIndex(se=>se[0]===this.props.value);this.props.onChange({param:this.props.param,name:this.props.name,value:re[ve===re.length-1?0:ve+1][0]})},this.items=(0,i._)(re=>M.W.createItemsFromSelectOptions(re.options)),this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}renderControl(){var re;const ve=this.items(this.props.param),ce=void 0!==this.props.value?M.W.findItem(ve,this.props.value):void 0,se=ce?ce.label:typeof this.props.value>"u"?`${(null===(re=M.W.getFirstItem(ve))||void 0===re?void 0:re.label)||""} [Default]`:`[Invalid] ${this.props.value}`;return(0,e.jsx)(l.ff,{disabled:this.props.isDisabled,style:{textAlign:this.props.param.cycle?"center":"left",overflow:"hidden",textOverflow:"ellipsis"},label:se,title:se,icon:this.props.param.cycle?"on"===this.props.value?m.Xq:"off"===this.props.value?m.CQ:void 0:void 0,toggle:this.props.param.cycle?this.cycle:this.toggle,isSelected:this.state.showOptions})}renderAddOn(){if(!this.state.showOptions)return null;const re=this.items(this.props.param),ve=M.W.findItem(re,this.props.value);return(0,e.jsx)(M.W,{items:re,current:ve,onSelect:this.onSelect})}render(){return L({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderAddOn()})}}let W=(()=>{class ue extends o.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,showOptions:!1},this.onSelect=ve=>{ve&&ve.value!==this.props.value?this.setState({showOptions:!1},()=>{this.props.onChange({param:this.props.param,name:this.props.name,value:{ref:ve.value}})}):this.setState({showOptions:!1})},this.toggle=()=>this.setState({showOptions:!this.state.showOptions}),this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}get items(){return M.W.createItemsFromSelectOptions(this.props.param.getOptions(this.context))}renderControl(){var ve;const se=this.props.value.ref?M.W.findItem(this.items,this.props.value.ref):void 0,ae=se?se.label:`[Ref] ${null!==(ve=this.props.value.ref)&&void 0!==ve?ve:""}`;return(0,e.jsx)(l.ff,{disabled:this.props.isDisabled,style:{textAlign:"left",overflow:"hidden",textOverflow:"ellipsis"},label:ae,title:ae,toggle:this.toggle,isSelected:this.state.showOptions})}renderAddOn(){if(!this.state.showOptions)return null;const ve=this.items,ce=M.W.findItem(ve,this.props.value.ref);return(0,e.jsx)(M.W,{items:ve,current:ce,onSelect:this.onSelect})}render(){return L({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderAddOn()})}}return ue.contextType=_.aU,ue})();class te extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.components={0:O.t.Numeric(0,{step:this.props.param.step},{label:"Min"}),1:O.t.Numeric(0,{step:this.props.param.step},{label:"Max"})},this.componentChange=({name:re,value:ve})=>{const ce=[...this.props.value];ce[+re]=ve,this.change(ce)},this.toggleExpanded=re=>{this.setState({isExpanded:!this.state.isExpanded}),re.currentTarget.blur()}}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}render(){const re=this.props.value,ve=this.props.param.label||(0,b.Hh)(this.props.name),ce=(0,v.XV)(this.props.param.step||.01),se=`[${re[0].toFixed(ce)}, ${re[1].toFixed(ce)}]`;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.eJ,{label:ve,control:(0,e.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:se})}),this.state.isExpanded&&(0,e.jsx)("div",{className:"msp-control-offset",children:(0,e.jsx)(R,{params:this.components,values:re,onChange:this.componentChange,onEnter:this.props.onEnter})})]})}}class de extends Q{constructor(){super(...arguments),this.onChange=re=>{this.update(re)}}renderControl(){return(0,e.jsx)(D.Mm,{value:this.props.value,min:this.props.param.min,max:this.props.param.max,step:this.props.param.step,onChange:this.onChange,disabled:this.props.isDisabled,onEnter:this.props.onEnter})}}function j(ue,re=!1){return Array.isArray(ue)?re?`${y.Q1.toStyle(ue[0])} ${(100*ue[1]).toFixed(2)}%`:y.Q1.toStyle(ue[0]):y.Q1.toStyle(ue)}const Z=(0,i.E)(ue=>`linear-gradient(to right, ${ue.map(ve=>j(ve,!0)).join(", ")})`),q=(0,i.E)(ue=>{const re=ue.length,ve=[`${j(ue[0])} ${1/re*100}%`];for(let ce=1,se=re-1;ce{const ve=(0,c.JA)(re[0]);return(0,e.jsx)("div",{style:Y({kind:"qualitative"!==ve.type?"interpolate":"set",colors:ve.list})})};return{ColorPresets:{all:M.W.createItemsFromSelectOptions(c.CL,{addOn:ue}),scale:M.W.createItemsFromSelectOptions(c.Qx,{addOn:ue}),set:M.W.createItemsFromSelectOptions(c.cG,{addOn:ue})},ColorsParam:O.t.ObjectList({color:O.t.Color(0)},({color:re})=>y.Q1.toHexString(re).toUpperCase()),OffsetColorsParam:O.t.ObjectList({color:O.t.Color(0),offset:O.t.Numeric(0,{min:0,max:1,step:.01})},({color:re,offset:ve})=>`${y.Q1.toHexString(re).toUpperCase()} [${ve.toFixed(2)}]`),IsInterpolatedParam:O.t.Boolean(!1,{label:"Interpolated"})}}(),_e)}class le extends o.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,show:void 0},this.toggleEdit=()=>this.setState({show:"edit"===this.state.show?void 0:"edit"}),this.togglePresets=()=>this.setState({show:"presets"===this.state.show?void 0:"presets"}),this.selectPreset=re=>{if(!re)return;this.setState({show:void 0});const ve=(0,c.JA)(re.value);this.update({kind:"qualitative"!==ve.type?"interpolate":"set",colors:ve.list})},this.colorsChanged=({value:re})=>{this.update({kind:this.props.value.kind,colors:re.map(ve=>ve.color)})},this.isInterpolatedChanged=({value:re})=>{this.update({kind:re?"interpolate":"set",colors:this.props.value.colors})},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}update(re){this.props.onChange({param:this.props.param,name:this.props.name,value:re})}renderControl(){const{value:re}=this.props;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{onClick:this.toggleEdit,style:{position:"relative",paddingRight:"33px"},children:[1===re.colors.length?"1 color":`${re.colors.length} colors`,(0,e.jsx)("div",{style:Y(re,"33px")})]}),(0,e.jsx)(l.K0,{svg:m.sM,onClick:this.togglePresets,toggleState:"presets"===this.state.show,title:"Color Presets",style:{padding:0,position:"absolute",right:0,top:0,width:"32px"}})]})}renderColors(){if(!this.state.show)return null;const{ColorPresets:re,ColorsParam:ve,IsInterpolatedParam:ce}=xe();if("presets"===this.state.show)return(0,e.jsx)(M.W,{items:re[this.props.param.presetKind],onSelect:this.selectPreset});const ae=this.props.value.colors.map(ge=>({color:ge}));return(0,e.jsxs)("div",{className:"msp-control-offset",children:[(0,e.jsx)(ne,{name:"colors",param:ve,value:ae,onChange:this.colorsChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter}),(0,e.jsx)(G,{name:"isInterpolated",param:ce,value:"interpolate"===this.props.value.kind,onChange:this.isInterpolatedChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter})]})}render(){return L({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderColors()})}}class Ae extends o.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,show:void 0},this.toggleEdit=()=>this.setState({show:"edit"===this.state.show?void 0:"edit"}),this.togglePresets=()=>this.setState({show:"presets"===this.state.show?void 0:"presets"}),this.selectPreset=re=>{if(!re)return;this.setState({show:void 0});const ve=(0,c.JA)(re.value);this.update({kind:"qualitative"!==ve.type?"interpolate":"set",colors:ve.list})},this.colorsChanged=({value:re})=>{const ve=re.map(ce=>[ce.color,ce.offset]);ve.sort((ce,se)=>ce[1]-se[1]),this.update({kind:this.props.value.kind,colors:ve})},this.isInterpolatedChanged=({value:re})=>{this.update({kind:re?"interpolate":"set",colors:this.props.value.colors})},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}update(re){this.props.onChange({param:this.props.param,name:this.props.name,value:re})}renderControl(){const{value:re}=this.props;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{onClick:this.toggleEdit,style:{position:"relative",paddingRight:"33px"},children:[1===re.colors.length?"1 color":`${re.colors.length} colors`,(0,e.jsx)("div",{style:Y(re,"33px")})]}),(0,e.jsx)(l.K0,{svg:m.sM,onClick:this.togglePresets,toggleState:"presets"===this.state.show,title:"Color Presets",style:{padding:0,position:"absolute",right:0,top:0,width:"32px"}})]})}renderColors(){if(!this.state.show)return null;const{ColorPresets:re,OffsetColorsParam:ve,IsInterpolatedParam:ce}=xe();if("presets"===this.state.show)return(0,e.jsx)(M.W,{items:re[this.props.param.presetKind],onSelect:this.selectPreset});const ae=this.props.value.colors,ge=ae.map((Ie,Le)=>Array.isArray(Ie)?{color:Ie[0],offset:Ie[1]}:{color:Ie,offset:Le/ae.length});return ge.sort((Ie,Le)=>Ie.offset-Le.offset),(0,e.jsxs)("div",{className:"msp-control-offset",children:[(0,e.jsx)(ne,{name:"colors",param:ve,value:ge,onChange:this.colorsChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter}),(0,e.jsx)(G,{name:"isInterpolated",param:ce,value:"interpolate"===this.props.value.kind,onChange:this.isInterpolatedChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter})]})}render(){return L({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderColors()})}}class Be extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.components={0:O.t.Numeric(0,{step:this.props.param.step},{label:this.props.param.fieldLabels&&this.props.param.fieldLabels.x||"X"}),1:O.t.Numeric(0,{step:this.props.param.step},{label:this.props.param.fieldLabels&&this.props.param.fieldLabels.y||"Y"}),2:O.t.Numeric(0,{step:this.props.param.step},{label:this.props.param.fieldLabels&&this.props.param.fieldLabels.z||"Z"})},this.componentChange=({name:re,value:ve})=>{const ce=r.eB.copy(r.eB.zero(),this.props.value);ce[+re]=ve,this.change(ce)},this.toggleExpanded=re=>{this.setState({isExpanded:!this.state.isExpanded}),re.currentTarget.blur()}}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}render(){const re=this.props.value,ve=this.props.param.label||(0,b.Hh)(this.props.name),ce=(0,v.XV)(this.props.param.step||.01),se=`[${re[0].toFixed(ce)}, ${re[1].toFixed(ce)}, ${re[2].toFixed(ce)}]`;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.eJ,{label:ve,control:(0,e.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:se})}),this.state.isExpanded&&(0,e.jsx)("div",{className:"msp-control-offset",children:(0,e.jsx)(R,{params:this.components,values:re,onChange:this.componentChange,onEnter:this.props.onEnter})})]})}}class Ce extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.components={json:O.t.Text(JSON.stringify((0,r.$I)()),{description:"JSON array with 4x4 matrix in a column major (j * 4 + i indexing) format"})},this.componentChange=({name:re,value:ve})=>{const ce=r.$I.copy((0,r.$I)(),this.props.value);"json"===re?r.$I.copy(ce,JSON.parse(ve)):ce[+re]=ve,this.change(ce)},this.toggleExpanded=re=>{this.setState({isExpanded:!this.state.isExpanded}),re.currentTarget.blur()}}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}changeValue(re){return ve=>{const ce=r.$I.copy((0,r.$I)(),this.props.value);ce[re]=ve,this.change(ce)}}get grid(){const re=this.props.value,ve=[];for(let ce=0;ce<4;ce++){const se=[];for(let ae=0;ae<4;ae++)se.push((0,e.jsx)(l.ks,{numeric:!0,delayMs:50,value:r.$I.getValue(re,ce,ae),onChange:this.changeValue(4*ae+ce),className:"msp-form-control",blurOnEnter:!0,isDisabled:this.props.isDisabled},ae));ve.push((0,e.jsx)("div",{className:"msp-flex-row",children:se},ce))}return(0,e.jsx)("div",{className:"msp-parameter-matrix",children:ve})}render(){const re={json:JSON.stringify(this.props.value)},ve=this.props.param.label||(0,b.Hh)(this.props.name);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.eJ,{label:ve,control:(0,e.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:"4\xd74 Matrix"})}),this.state.isExpanded&&(0,e.jsxs)("div",{className:"msp-control-offset",children:[this.grid,(0,e.jsx)(R,{params:this.components,values:re,onChange:this.componentChange,onEnter:this.props.onEnter})]})]})}}class Re extends Q{constructor(){super(...arguments),this.onChange=re=>{const ve=re.target.value;ve!==A.V.getUrl(this.props.value||"")&&this.update(A.V.Url(ve))},this.onKeyPress=re=>{(13===re.keyCode||13===re.charCode||"Enter"===re.key)&&this.props.onEnter&&this.props.onEnter(),re.stopPropagation()}}renderControl(){const re=this.props.param.label||(0,b.Hh)(this.props.name);return(0,e.jsx)("input",{type:"text",value:A.V.getUrl(this.props.value||""),placeholder:re,onChange:this.onChange,onKeyPress:this.props.onEnter?this.onKeyPress:void 0,disabled:this.props.isDisabled})}}class ke extends o.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1},this.onChangeFile=re=>{this.change(re.target.files[0])},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:A.V.File(re)})}renderControl(){const re=this.props.value;return(0,e.jsxs)("div",{className:"msp-btn msp-btn-block msp-btn-action msp-loader-msp-btn-file",style:{marginTop:"1px"},children:[re?re.name:"Select a file..."," ",(0,e.jsx)("input",{disabled:this.props.isDisabled,onChange:this.onChangeFile,type:"file",multiple:!1,accept:this.props.param.accept})]})}render(){return this.props.param.label?L({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:null}):this.renderControl()}}class we extends o.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1},this.onChangeFileList=re=>{this.change(re.target.files)},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}change(re){const ve=[];if(re)for(let ce=0,se=re.length;ce{this.setState({isExpanded:!this.state.isExpanded}),re.currentTarget.blur()}}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}toggle(re){return ve=>{this.props.value.indexOf(re)<0?this.change(this.props.value.concat(re)):this.change(this.props.value.filter(ce=>ce!==re)),ve.currentTarget.blur()}}render(){const re=this.props.value,ve=this.props.param.emptyValue,ce=this.props.param.label||(0,b.Hh)(this.props.name);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.eJ,{label:ce,control:(0,e.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:0===re.length&&ve?ve:`${re.length} of ${this.props.param.options.length}`})}),this.state.isExpanded&&(0,e.jsx)("div",{className:"msp-control-offset",children:this.props.param.options.map(([se,ae])=>{const ge=re.indexOf(se)>=0;return(0,e.jsx)(l.$n,{onClick:this.toggle(se),disabled:this.props.isDisabled,style:{marginTop:"1px"},children:(0,e.jsx)("span",{style:{float:ge?"left":"right"},children:ge?`\u2713 ${ae}`:`${ae} \u2717`})},se)})})]})}}class Se extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!!this.props.param.isExpanded,showPresets:!1,showHelp:!1},this.onChangeParam=re=>{this.change({...this.props.value,[re.name]:re.value})},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded}),this.toggleShowPresets=()=>this.setState({showPresets:!this.state.showPresets}),this.presetItems=(0,i._)(re=>{var ve;return M.W.createItemsFromSelectOptions(null!==(ve=re.presets)&&void 0!==ve?ve:[])}),this.onSelectPreset=re=>{this.setState({showPresets:!1}),this.change(re?.value)}}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}pivotedPresets(){if(!this.props.param.presets)return null;const re=this.props.param.label||(0,b.Hh)(this.props.name);return(0,e.jsxs)("div",{className:"msp-control-group-wrapper",children:[(0,e.jsx)("div",{className:"msp-control-group-header",children:(0,e.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleShowPresets,children:[(0,e.jsx)(m.In,{svg:m.sM}),re," Presets"]})}),this.state.showPresets&&(0,e.jsx)(M.W,{items:this.presetItems(this.props.param),onSelect:this.onSelectPreset})]})}presets(){return this.props.param.presets?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"msp-control-group-presets-wrapper",children:(0,e.jsx)("div",{className:"msp-control-group-header",children:(0,e.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleShowPresets,children:[(0,e.jsx)(m.In,{svg:m.sM}),"Presets"]})})}),this.state.showPresets&&(0,e.jsx)(M.W,{items:this.presetItems(this.props.param),onSelect:this.onSelectPreset})]}):null}pivoted(){const re=this.props.param.pivot,ve=this.props.param.params,ce=ve[re],se=E(ce),ae=(0,e.jsx)(se,{name:re,param:ce,value:this.props.value[re],onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled});if(!this.state.isExpanded)return(0,e.jsxs)("div",{className:"msp-mapped-parameter-group",children:[ae,(0,e.jsx)(l.K0,{svg:m.cv,onClick:this.toggleExpanded,toggleState:this.state.isExpanded,title:"More Options"})]});const ge=Object.create(null);for(const Ie of Object.keys(ve))Ie!==re&&(ge[Ie]=ve[Ie]);return(0,e.jsxs)("div",{className:"msp-mapped-parameter-group",children:[ae,(0,e.jsx)(l.K0,{svg:m.cv,onClick:this.toggleExpanded,toggleState:this.state.isExpanded,title:"More Options"}),(0,e.jsxs)("div",{className:"msp-control-offset",children:[this.pivotedPresets(),(0,e.jsx)(R,{params:ge,onEnter:this.props.onEnter,values:this.props.value,onChange:this.onChangeParam,isDisabled:this.props.isDisabled})]})]})}render(){const re=this.props.param.params;if(0===Object.keys(re).length)return null;if(this.props.param.pivot)return this.pivoted();const ve=this.props.param.label||(0,b.Hh)(this.props.name),ce=(0,e.jsx)(R,{params:re,onChange:this.onChangeParam,values:this.props.value,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled});return this.props.inMapped?(0,e.jsx)("div",{className:"msp-control-offset",children:ce}):this.props.param.isFlat?ce:(0,e.jsxs)("div",{className:"msp-control-group-wrapper",style:{position:"relative"},children:[(0,e.jsx)("div",{className:"msp-control-group-header",children:(0,e.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleExpanded,children:[(0,e.jsx)(m.In,{svg:this.state.isExpanded?m.DM:m.Cp}),ve]})}),this.presets(),this.state.isExpanded&&(0,e.jsx)("div",{className:"msp-control-offset",children:ce})]})}}class Ve extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.valuesCache={},this.onChangeName=re=>{this.change({name:re.value,params:this.getValues(re.value)})},this.onChangeParam=re=>{this.setValues(this.props.value.name,re.value),this.change({name:this.props.value.name,params:re.value})},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}setValues(re,ve){this.valuesCache[re]=ve}getValues(re){return re in this.valuesCache?this.valuesCache[re]:this.props.param.map(re).defaultValue}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}areParamsEmpty(re){for(const ve of Object.keys(re))if(!re[ve].isHidden)return!1;return!0}render(){const re=this.props.value||this.props.param.defaultValue,ve=this.props.param.map(re.name),ce=this.props.param.label||(0,b.Hh)(this.props.name),se=E(ve),ae=this.props.param.help,ge=ae?{...this.props.param.select,help:Le=>ae({name:Le,params:this.getValues(Le)})}:this.props.param.select,Ie=(0,e.jsx)(J,{param:ge,isDisabled:this.props.isDisabled,onChange:this.onChangeName,onEnter:this.props.onEnter,name:ce,value:re.name});return se?"group"!==ve.type||ve.isFlat?(0,e.jsxs)(e.Fragment,{children:[Ie,(0,e.jsx)(se,{param:ve,value:re.params,name:re.name,onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled})]}):this.areParamsEmpty(ve.params)?Ie:(0,e.jsxs)("div",{className:"msp-mapped-parameter-group",children:[Ie,(0,e.jsx)(l.K0,{svg:m.cv,onClick:this.toggleExpanded,toggleState:this.state.isExpanded,title:`${ce} Properties`}),this.state.isExpanded&&(0,e.jsx)(Se,{inMapped:!0,param:ve,value:re.params,name:re.name,onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled})]}):Ie}}class Ne extends o.PureComponent{constructor(){super(...arguments),this.state={current:this.props.value},this.onChangeParam=re=>{this.setState({current:{...this.state.current,[re.name]:re.value}})},this.apply=()=>{this.props.apply(this.state.current)}}componentDidUpdate(re){(this.props.params!==re.params||this.props.value!==re.value)&&this.setState({current:this.props.value})}render(){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(R,{params:this.props.params,onChange:this.onChangeParam,values:this.state.current,onEnter:this.apply,isDisabled:this.props.isDisabled}),(0,e.jsx)("button",{className:"msp-btn msp-btn-block msp-form-control msp-control-top-offset",onClick:this.apply,disabled:this.props.isDisabled,children:this.props.isUpdate?"Update":"Add"})]})}}class K extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.update=re=>{this.props.actions.update(re,this.props.index)},this.moveUp=()=>{this.props.actions.move(this.props.index,-1)},this.moveDown=()=>{this.props.actions.move(this.props.index,1)},this.remove=()=>{this.setState({isExpanded:!1}),this.props.actions.remove(this.props.index)},this.toggleExpanded=re=>{this.setState({isExpanded:!this.state.isExpanded}),re.currentTarget.blur()}}render(){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"msp-param-object-list-item",children:[(0,e.jsxs)("button",{className:"msp-btn msp-btn-block msp-form-control",onClick:this.toggleExpanded,children:[(0,e.jsx)("span",{children:`${this.props.index+1}: `}),this.props.param.getLabel(this.props.value)]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(l.K0,{svg:m.qp,title:"Move Up",onClick:this.moveUp,small:!0}),(0,e.jsx)(l.K0,{svg:m.p8,title:"Move Down",onClick:this.moveDown,small:!0}),(0,e.jsx)(l.K0,{svg:m.mf,title:"Remove",onClick:this.remove,small:!0})]})]}),this.state.isExpanded&&(0,e.jsx)("div",{className:"msp-control-offset",children:(0,e.jsx)(Ne,{params:this.props.param.element,apply:this.update,value:this.props.value,isUpdate:!0,isDisabled:this.props.isDisabled})})]})}}class ne extends o.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.add=re=>{this.change([...this.props.value,re])},this.actions={update:(re,ve)=>{const ce=this.props.value.slice(0);ce[ve]=re,this.change(ce)},move:(re,ve)=>{let ce=this.props.value;if(1===ce.length)return;let se=(re+ve)%ce.length;se<0&&(se+=ce.length),ce=ce.slice(0);const ae=ce[re];ce[re]=ce[se],ce[se]=ae,this.change(ce)},remove:re=>{const ve=this.props.value,ce=[];for(let se=0;se{this.setState({isExpanded:!this.state.isExpanded}),re.currentTarget.blur()}}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}render(){const re=this.props.value,ve=this.props.param.label||(0,b.Hh)(this.props.name);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.eJ,{label:ve,control:(0,e.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:`${re.length} item${1!==re.length?"s":""}`})}),this.state.isExpanded&&(0,e.jsxs)("div",{className:"msp-control-offset",children:[this.props.value.map((se,ae)=>(0,e.jsx)(K,{param:this.props.param,value:se,index:ae,actions:this.actions,isDisabled:this.props.isDisabled},ae)),(0,e.jsx)(l.tW,{header:"New Item",children:(0,e.jsx)(Ne,{params:this.props.param.element,apply:this.add,value:this.props.param.ctor(),isDisabled:this.props.isDisabled})})]})]})}}class be extends o.PureComponent{constructor(){super(...arguments),this.onChangeCondition=re=>{this.change(this.props.param.conditionedValue(this.props.value,re.value))},this.onChangeParam=re=>{this.change(re.value)}}change(re){this.props.onChange({name:this.props.name,param:this.props.param,value:re})}render(){const re=this.props.value,ve=this.props.param.conditionForValue(re),ce=this.props.param.conditionParams[ve],se=this.props.param.label||(0,b.Hh)(this.props.name),ae=E(ce),ge=(0,e.jsx)(J,{param:this.props.param.select,isDisabled:this.props.isDisabled,onChange:this.onChangeCondition,onEnter:this.props.onEnter,name:`${se} Kind`,value:ve});return ae?(0,e.jsxs)(e.Fragment,{children:[ge,(0,e.jsx)(ae,{param:ce,value:re,name:se,onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled})]}):ge}}class Te extends o.PureComponent{constructor(){super(...arguments),this.onChange=re=>{this.props.onChange({name:this.props.name,param:this.props.param,value:this.props.param.toValue(re.value)})}}render(){const re=this.props.param.fromValue(this.props.value),ve=E(this.props.param.converted);return ve?(0,e.jsx)(ve,{param:this.props.param.converted,value:re,name:this.props.name,onChange:this.onChange,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled}):null}}class ie extends o.PureComponent{constructor(){super(...arguments),this.onChange=({name:re,value:ve})=>{ve!==this.props.value[re]&&this.props.onChange({param:this.props.param,name:this.props.name,value:{...this.props.value,[re]:ve}})}}render(){const re={defaultValue:this.props.value.language,options:O.t.objectToOptions(t.e.Info),type:"select"},ve=(0,e.jsx)(J,{param:re,isDisabled:this.props.isDisabled,onChange:this.onChange,onEnter:this.props.onEnter,name:"language",value:this.props.value.language}),se=(0,e.jsx)(k,{param:{defaultValue:this.props.value.language,type:"text"},isDisabled:this.props.isDisabled,onChange:this.onChange,name:"expression",value:this.props.value.expression});return(0,e.jsxs)(e.Fragment,{children:[ve,"mol-script"!==this.props.value.language&&(0,e.jsxs)("div",{className:"msp-help-text",style:{padding:"10px"},children:[(0,e.jsx)(m.In,{svg:m.Rf})," Support for PyMOL, VMD, and Jmol selections is an experimental feature and may not always work as intended."]}),se]})}}},7788:(tn,Ue,n)=>{"use strict";n.d(Ue,{Ap:()=>A,Mm:()=>y});var e=n(9619),o=n(1395),r=n(3584),t=n(9909);class A extends o.Component{constructor(){super(...arguments),this.state={isChanging:!1,current:0},this.begin=()=>{this.setState({isChanging:!0})},this.end=m=>{this.setState({isChanging:!1}),this.props.onChange(m)},this.updateCurrent=m=>{var u,d;this.setState({current:m}),null===(d=(u=this.props).onChangeImmediate)||void 0===d||d.call(u,m)},this.updateManually=m=>{this.setState({isChanging:!0});let u=m;1===this.props.step&&(u=Math.round(u)),uthis.props.max&&(u=this.props.max),this.setState({current:u,isChanging:!0})},this.onManualBlur=()=>{this.setState({isChanging:!1}),this.props.onChange(this.state.current)}}static getDerivedStateFromProps(m,u){return u.isChanging||m.value===u.current?null:{current:m.value}}render(){let m=this.props.step;return void 0===m&&(m=1),(0,e.jsxs)("div",{className:"msp-slider",children:[(0,e.jsx)("div",{children:(0,e.jsx)(I,{min:this.props.min,max:this.props.max,step:m,value:this.state.current,disabled:this.props.disabled,onBeforeChange:this.begin,onChange:this.updateCurrent,onAfterChange:this.end})}),(0,e.jsx)("div",{children:(0,e.jsx)(r.ks,{numeric:!0,delayMs:50,value:this.state.current,blurOnEnter:!0,onBlur:this.onManualBlur,isDisabled:this.props.disabled,onChange:this.updateManually})})]})}}class y extends o.Component{constructor(){super(...arguments),this.state={isChanging:!1,current:[0,1]},this.begin=()=>{this.setState({isChanging:!0})},this.end=m=>{this.setState({isChanging:!1}),this.props.onChange(m)},this.updateCurrent=m=>{this.setState({current:m})},this.updateMax=m=>{let u=m;1===this.props.step&&(u=Math.round(u)),uthis.props.max&&(u=this.props.max),this.props.onChange([this.state.current[0],u])},this.updateMin=m=>{let u=m;1===this.props.step&&(u=Math.round(u)),uthis.state.current[1]?u=this.state.current[1]:u>this.props.max&&(u=this.props.max),this.props.onChange([u,this.state.current[1]])}}static getDerivedStateFromProps(m,u){return u.isChanging||m.value[0]===u.current[0]&&m.value[1]===u.current[1]?null:{current:m.value}}render(){let m=this.props.step;return void 0===m&&(m=1),(0,e.jsxs)("div",{className:"msp-slider2",children:[(0,e.jsx)("div",{children:(0,e.jsx)(r.ks,{numeric:!0,delayMs:50,value:this.state.current[0],onEnter:this.props.onEnter,blurOnEnter:!0,isDisabled:this.props.disabled,onChange:this.updateMin})}),(0,e.jsx)("div",{children:(0,e.jsx)(I,{min:this.props.min,max:this.props.max,step:m,value:this.state.current,disabled:this.props.disabled,onBeforeChange:this.begin,onChange:this.updateCurrent,onAfterChange:this.end,range:!0,allowCross:!0})}),(0,e.jsx)("div",{children:(0,e.jsx)(r.ks,{numeric:!0,delayMs:50,value:this.state.current[1],onEnter:this.props.onEnter,blurOnEnter:!0,isDisabled:this.props.disabled,onChange:this.updateMax})})]})}}function c(l){const m=[],u={}.hasOwnProperty;for(let d=0;d1||"touchend"===l.type.toLowerCase()&&l.touches.length>0}function v(l,m){return l?m.touches[0].clientY:m.touches[0].pageX}function O(l,m){return l?m.clientY:m.pageX}function b(l,m){const u=m.getBoundingClientRect();return l?u.top+.5*u.height:u.left+.5*u.width}function _(l){l.stopPropagation(),l.preventDefault()}class I extends o.Component{constructor(m){super(m),this.sliderElement=o.createRef(),this.handleElements=[],this.dragOffset=0,this.startPosition=0,this.startValue=0,this._getPointsCache=void 0,this.onMouseDown=R=>{if(0!==R.button)return;let f=O(this.props.vertical,R);if(this.isEventFromHandle(R)){const p=b(this.props.vertical,R.target);this.dragOffset=f-p,f=p}else this.dragOffset=0;this.onStart(f),this.addDocumentEvents("mouse"),_(R)},this.onTouchMove=R=>{if(i(R))return void this.end("touch");const f=v(this.props.vertical,R);this.onMove(R,f-this.dragOffset)},this.onTouchStart=R=>{if(i(R))return;let f=v(this.props.vertical,R);if(this.isEventFromHandle(R)){const p=b(this.props.vertical,R.target);this.dragOffset=f-p,f=p}else this.dragOffset=0;this.onStart(f),this.addDocumentEvents("touch"),_(R)},this.eventHandlers={touchmove:R=>this.onTouchMove(R),touchend:R=>this.end("touch"),mousemove:R=>this.onMouseMove(R),mouseup:R=>this.end("mouse")},this.calcOffset=R=>{const{min:f,max:p}=this.props;return(R-f)/(p-f)*100};const{range:u,min:d,max:s}=m,C=u?Array.apply(null,Array(+u+1)).map(()=>d):d,a=void 0!==m.value?m.value:"defaultValue"in m?m.defaultValue:C,S=(u?a:[d,a]).map(R=>this.trimAlignValue(R));let D;D=u&&S[0]===S[S.length-1]&&S[0]===s?0:S.length-1,this.state={handle:null,recent:D,bounds:S}}componentDidUpdate(m){if(!("value"in this.props||"min"in this.props||"max"in this.props))return;const{bounds:u}=this.state;if(m.range){const s=(this.props.value||u).map(C=>this.trimAlignValue(C,this.props));if(s.every((C,h)=>C===u[h]))return;this.setState({bounds:s}),u.some(C=>this.isValueOutOfBounds(C,this.props))&&this.props.onChange(s)}else{const s=this.trimAlignValue(void 0!==this.props.value?this.props.value:u[1],this.props);if(s===u[1]&&u[0]===m.min)return;this.setState({bounds:[m.min,s]}),this.isValueOutOfBounds(u[1],this.props)&&this.props.onChange(s)}}onChange(m){const u=this.props;"value"in u?void 0!==m.handle&&this.setState({handle:m.handle}):this.setState(m);const s={...this.state,...m};u.onChange(u.range?s.bounds:s.bounds[1])}onMouseMove(m){const u=O(this.props.vertical,m);this.onMove(m,u-this.dragOffset)}onMove(m,u){_(m);const d=this.props,s=this.state;let C=u-this.startPosition;C=this.props.vertical?-C:C;const h=C/this.getSliderLength()*(d.max-d.min),a=this.trimAlignValue(this.startValue+h);if(a===s.bounds[s.handle])return;const D=[...s.bounds];D[s.handle]=a;let R=s.handle;d.pushable?this.pushSurroundingHandles(D,R,s.bounds[R]):d.allowCross&&(D.sort((f,p)=>f-p),R=D.indexOf(a)),this.onChange({handle:R,bounds:D})}onStart(m){this.props.onBeforeChange(this.getValue());const d=this.calcValueByPos(m);this.startValue=d,this.startPosition=m;const s=this.state,{bounds:C}=s;let h=1;if(this.props.range){let D=0;for(let f=1;fC[f]&&(D=f);Math.abs(C[D+1]-d)S-D),this._getPointsCache={marks:m,step:u,points:a}}return this._getPointsCache.points}getPrecision(m){const u=m.toString();let d=0;return u.indexOf(".")>=0&&(d=u.length-u.indexOf(".")-1),d}getSliderLength(){const m=this.sliderElement.current;return m?this.props.vertical?m.clientHeight:m.clientWidth:0}getSliderStart(){const u=this.sliderElement.current.getBoundingClientRect();return this.props.vertical?u.top:u.left}getValue(){const{bounds:m}=this.state;return this.props.range?m:m[1]}addDocumentEvents(m){"touch"===m?(document.addEventListener("touchmove",this.eventHandlers.touchmove),document.addEventListener("touchend",this.eventHandlers.touchend)):"mouse"===m&&(document.addEventListener("mousemove",this.eventHandlers.mousemove),document.addEventListener("mouseup",this.eventHandlers.mouseup))}calcValue(m){const{vertical:u,min:d,max:s}=this.props,C=Math.abs(m/this.getSliderLength());return u?(1-C)*(s-d)+d:C*(s-d)+d}calcValueByPos(m){const u=m-this.getSliderStart();return this.trimAlignValue(this.calcValue(u))}end(m){this.removeEvents(m),this.props.onAfterChange(this.getValue()),this.setState({handle:null})}isEventFromHandle(m){for(const u of this.handleElements)if(u.current===m.target)return!0;return!1}isValueOutOfBounds(m,u){return mu.max}pushHandle(m,u,d,s){const C=m[u];let h=m[u];for(;d*(h-C)=s.length||h<0)return!1;const a=u+d,S=s[h],{pushable:D}=this.props;return!!this.pushHandle(m,a,d,+D-d*(m[a]-S))&&(m[u]=S,!0)}pushSurroundingHandles(m,u,d){const{pushable:s}=this.props,C=m[u];let h=0;if(m[u+1]-C<+s?h=1:C-m[u-1]<+s&&(h=-1),0===h)return;const a=u+h;this.pushHandle(m,a,h,+s-h*(m[a]-C))||(m[u]=d)}removeEvents(m){"touch"===m?(document.removeEventListener("touchmove",this.eventHandlers.touchmove),document.removeEventListener("touchend",this.eventHandlers.touchend)):"mouse"===m&&(document.removeEventListener("mousemove",this.eventHandlers.mousemove),document.removeEventListener("mouseup",this.eventHandlers.mouseup))}trimAlignValue(m,u){const{handle:d,bounds:s}=this.state||{},{marks:C,step:h,min:a,max:S,allowCross:D}={...this.props,...u||{}};let R=m;R<=a&&(R=a),R>=S&&(R=S),!D&&null!=d&&d>0&&R<=s[d-1]&&(R=s[d-1]),!D&&null!=d&&d=s[d+1]&&(R=s[d+1]);const f=Object.keys(C).map(parseFloat);if(null!==h){const T=Math.round((R-a)/h)*h+a;f.push(T)}const p=f.map(T=>Math.abs(R-T)),E=f[p.indexOf(Math.min.apply(Math,p))];return null!==h?parseFloat(E.toFixed(this.getPrecision(h))):E}render(){const{handle:m,bounds:u}=this.state,{className:d,prefixCls:s,disabled:C,vertical:h,range:a,step:S,marks:D,tipFormatter:R}=this.props,f=this.props.handle,p=u.map(this.calcOffset),E=`${s}-handle`,T=u.map((V,U)=>c({[E]:!0,[`${E}-${U+1}`]:!0,[`${E}-lower`]:0===U,[`${E}-upper`]:U===u.length-1})),w={prefixCls:s,noTip:null===S||null===R,tipFormatter:R,vertical:h};if(this.handleElements.length!==u.length){this.handleElements=[];for(let V=0;Vo.cloneElement(f,{...w,className:T[U],value:V,offset:p[U],dragging:m===U,index:U,key:U,ref:this.handleElements[U]}));a||Q.shift();const G=c({[s]:!0,[`${s}-with-marks`]:Object.keys(D).length,[`${s}-disabled`]:C,[`${s}-vertical`]:this.props.vertical,[d]:!!d});return(0,e.jsxs)("div",{ref:this.sliderElement,className:G,onTouchStart:C?t.lQ:this.onTouchStart,onMouseDown:C?t.lQ:this.onMouseDown,children:[(0,e.jsx)("div",{className:`${s}-rail`}),Q]})}}I.defaultProps={prefixCls:"msp-slider-base",className:"",min:0,max:100,step:1,marks:{},handle:(0,e.jsx)(class M extends o.Component{render(){const{className:m,tipFormatter:u,vertical:d,offset:s,value:C,index:h}=this.props;return(0,e.jsx)("div",{className:m,style:d?{bottom:`${s}%`}:{left:`${s}%`},title:u(C,h)})}},{className:"",vertical:!1,offset:0,tipFormatter:l=>l,value:0,index:0}),onBeforeChange:t.lQ,onChange:t.lQ,onAfterChange:t.lQ,tipFormatter:(l,m)=>l,disabled:!1,range:!1,vertical:!1,allowCross:!0,pushable:!1}},4987:(tn,Ue,n)=>{"use strict";n.d(Ue,{U0:()=>dr,AF:()=>y.A,Zw:()=>xr});var e={};n.r(e),n.d(e,{SyncRepresentationToCanvas:()=>O,SyncStructureRepresentation3DState:()=>b,UpdateRepresentationVisibility:()=>_,registerDefault:()=>v});var o={};n.r(o),n.d(o,{Focus:()=>d,OrientAxes:()=>s,Reset:()=>m,ResetAxes:()=>C,SetSnapshot:()=>u,registerDefault:()=>l});var r={};n.r(r),n.d(r,{Canvas3DSetSettings:()=>S,registerDefault:()=>a});var t={};n.r(t),n.d(t,{CameraAxisHelper:()=>J,CameraControls:()=>de,DefaultClickResetCameraOnEmpty:()=>U,DefaultClickResetCameraOnEmptySelectMode:()=>N,DefaultFocusLociBindings:()=>k,FocusLoci:()=>$});var A={};n.r(A),n.d(A,{AccessibleSurfaceArea:()=>Me,BestDatabaseSequenceMapping:()=>kt,CrossLinkRestraint:()=>Nn,Interactions:()=>rn,SecondaryStructure:()=>Mt,StructureInfo:()=>Z,ValenceModel:()=>Dn});var y=n(1164),c=n(1827),i=n(381);function v(Ft){O(Ft),b(Ft),_(Ft)}function O(Ft){const Qt=Ft.state.data.events;Qt.object.created.subscribe(ht=>{var pt;i.O.isRepresentation3D(ht.obj)&&(M(ht.state.cells.get(ht.ref),ht.obj.data.repr),ht.obj.data.repr.setState({syncManually:!0}),null===(pt=Ft.canvas3d)||void 0===pt||pt.add(ht.obj.data.repr))}),Qt.object.updated.subscribe(ht=>{var pt,Xt;ht.oldObj&&i.O.isRepresentation3D(ht.oldObj)&&(null===(pt=Ft.canvas3d)||void 0===pt||pt.remove(ht.oldObj.data.repr),ht.oldObj.data.repr.destroy()),i.O.isRepresentation3D(ht.obj)&&(M(ht.state.cells.get(ht.ref),ht.obj.data.repr),"recreate"===ht.action&&ht.obj.data.repr.setState({syncManually:!0}),null===(Xt=Ft.canvas3d)||void 0===Xt||Xt.add(ht.obj.data.repr))}),Qt.object.removed.subscribe(ht=>{var pt;i.O.isRepresentation3D(ht.obj)&&(null===(pt=Ft.canvas3d)||void 0===pt||pt.remove(ht.obj.data.repr),ht.obj.data.repr.destroy())})}function b(Ft){const Qt=Ft.state.data.events;Qt.object.created.subscribe(ht=>{var pt;if(!i.O.Molecule.Structure.Representation3DState.is(ht.obj))return;const Xt=ht.obj.data;Xt.repr.setState(Xt.state),null===(pt=Ft.canvas3d)||void 0===pt||pt.update(Xt.repr)}),Qt.object.updated.subscribe(ht=>{var pt;if(!i.O.Molecule.Structure.Representation3DState.is(ht.obj))return;const Xt=ht.obj.data;Xt.repr.setState(Xt.state),null===(pt=Ft.canvas3d)||void 0===pt||pt.update(Xt.repr)}),Qt.object.removed.subscribe(ht=>{var pt;if(!i.O.Molecule.Structure.Representation3DState.is(ht.obj))return;const Xt=ht.obj.data;Xt.repr.setState(Xt.initialState),null===(pt=Ft.canvas3d)||void 0===pt||pt.update(Xt.repr)})}function _(Ft){Ft.state.data.events.cell.stateUpdated.subscribe(Qt=>{var ht;const pt=Qt.state.cells.get(Qt.ref);i.O.isRepresentation3D(pt.obj)&&M(pt,pt.obj.data.repr)&&(null===(ht=Ft.canvas3d)||void 0===ht||ht.syncVisibility())})}function M(Ft,Qt){return Qt.state.visible===!!Ft.state.isHidden&&(Qt.setState({visible:!Ft.state.isHidden}),!0)}var I=n(6763);function l(Ft){m(Ft),d(Ft),u(Ft),s(Ft),C(Ft)}function m(Ft){I.a.Camera.Reset.subscribe(Ft,Qt=>{Ft.managers.camera.reset(Qt?.snapshot,Qt?.durationMs)})}function u(Ft){I.a.Camera.SetSnapshot.subscribe(Ft,({snapshot:Qt,durationMs:ht})=>{Ft.managers.camera.setSnapshot(Qt,ht)})}function d(Ft){I.a.Camera.Focus.subscribe(Ft,({center:Qt,radius:ht,durationMs:pt})=>{Ft.managers.camera.focusSphere({center:Qt,radius:ht},{durationMs:pt}),Ft.events.canvas3d.settingsUpdated.next(void 0)})}function s(Ft){I.a.Camera.OrientAxes.subscribe(Ft,({structures:Qt,durationMs:ht})=>{Ft.managers.camera.orientAxes(Qt,ht)})}function C(Ft){I.a.Camera.ResetAxes.subscribe(Ft,({durationMs:Qt})=>{Ft.managers.camera.resetAxes(Qt)})}var h=n(3177);function a(Ft){S(Ft)}function S(Ft){I.a.Canvas3D.ResetSettings.subscribe(Ft,()=>{var Qt;null===(Qt=Ft.canvas3d)||void 0===Qt||Qt.setProps(h.FN),Ft.events.canvas3d.settingsUpdated.next(void 0)}),I.a.Canvas3D.SetSettings.subscribe(Ft,Qt=>{var ht;Ft.canvas3d&&(null===(ht=Ft.canvas3d)||void 0===ht||ht.setProps(Qt.settings),Ft.events.canvas3d.settingsUpdated.next(void 0))})}var D=n(1937),R=n(3246),f=n(8277),p=n(4080),E=n(4123),T=n(7028),L=n(4369);const w=p.qt,Q=p.Fs,G=E.O.Trigger,V=E.O.TriggerKey,U=(0,E.O)([G(w.Flag.Primary,Q.create()),G(w.Flag.Secondary,Q.create()),G(w.Flag.Primary,Q.create({control:!0}))],"Reset camera focus","Click on nothing using ${triggers}"),N=(0,E.O)([G(w.Flag.Secondary,Q.create()),G(w.Flag.Primary,Q.create({control:!0}))],"Reset camera focus","Click on nothing using ${triggers}"),k={clickCenterFocus:(0,E.O)([G(w.Flag.Primary,Q.create()),G(w.Flag.Secondary,Q.create()),G(w.Flag.Primary,Q.create({control:!0}))],"Camera center and focus","Click element using ${triggers}"),clickCenterFocusSelectMode:(0,E.O)([G(w.Flag.Secondary,Q.create()),G(w.Flag.Primary,Q.create({control:!0}))],"Camera center and focus","Click element using ${triggers}"),clickResetCameraOnEmpty:U,clickResetCameraOnEmptySelectMode:N},H={minRadius:f.t.Numeric(8,{min:1,max:50,step:1}),extraRadius:f.t.Numeric(4,{min:1,max:50,step:1},{description:"Value added to the bounding-sphere radius of the Loci"}),durationMs:f.t.Numeric(250,{min:0,max:1e3,step:1},{description:"Camera transition duration"}),bindings:f.t.Value(k,{isHidden:!0})},$=y.A.create({name:"camera-focus-loci",category:"interaction",ctor:class extends y.A.Handler{register(){this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:Ft,button:Qt,modifiers:ht})=>{var pt,Xt;if(!this.ctx.canvas3d)return;const fn=this.ctx.selectionMode?this.params.bindings.clickCenterFocusSelectMode:this.params.bindings.clickCenterFocus,on=this.ctx.selectionMode?null!==(pt=this.params.bindings.clickResetCameraOnEmptySelectMode)&&void 0!==pt?pt:N:null!==(Xt=this.params.bindings.clickResetCameraOnEmpty)&&void 0!==Xt?Xt:U;if(R.QN.isEmpty(Ft.loci)&&E.O.match(on,Qt,ht))I.a.Camera.Reset(this.ctx,{});else if(E.O.match(fn,Qt,ht)){const En=R.QN.normalize(Ft.loci,this.ctx.managers.interactivity.props.granularity);this.ctx.managers.camera.focusLoci(En,this.params)}})}},params:()=>H,display:{name:"Camera Focus Loci on Canvas"}}),J=y.A.create({name:"camera-axis-helper",category:"interaction",ctor:class extends y.A.Handler{register(){let Ft=T.Nz.None,Qt=0;this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:ht})=>{if(!this.ctx.canvas3d||!(0,T.E2)(ht.loci))return;const pt=ht.loci.elements[0].groupId;if(pt===T.Nz.None)return Ft=T.Nz.None,void(Qt=0);const{camera:Xt}=this.ctx.canvas3d;let fn,on;if(pt>=T.Nz.X&&pt<=T.Nz.Z){Ft=T.Nz.None,Qt=0;const En=L.eB.sub((0,L.eB)(),Xt.target,Xt.position),Tt=L.eB.cross((0,L.eB)(),En,Xt.up);on=(0,L.eB)(),on[pt-1]=1,fn=L.eB.cross((0,L.eB)(),on,Tt),0===L.eB.magnitude(fn)&&(fn=En)}else Ft===pt?Qt=(Qt+1)%2:(Ft=pt,Qt=0),pt===T.Nz.XY?(on=Qt?L.eB.unitX:L.eB.unitY,fn=L.eB.negUnitZ):pt===T.Nz.XZ?(on=Qt?L.eB.unitX:L.eB.unitZ,fn=L.eB.negUnitY):(on=Qt?L.eB.unitY:L.eB.unitZ,fn=L.eB.negUnitX);this.ctx.canvas3d.requestCameraReset({snapshot:(En,Tt)=>Tt.getInvariantFocus(En.boundingSphereVisible.center,En.boundingSphereVisible.radius,on,fn)})})}},params:()=>({}),display:{name:"Camera Axis Helper"}}),W={keySpinAnimation:(0,E.O)([V("I")],"Spin Animation","Press ${triggers}"),keyRockAnimation:(0,E.O)([V("O")],"Rock Animation","Press ${triggers}"),keyToggleFlyMode:(0,E.O)([V("Space",Q.create({shift:!0}))],"Toggle Fly Mode","Press ${triggers}"),keyResetView:(0,E.O)([V("T")],"Reset View","Press ${triggers}")},te={bindings:f.t.Value(W,{isHidden:!0})},de=y.A.create({name:"camera-controls",category:"interaction",ctor:class extends y.A.Handler{register(){this.subscribeObservable(this.ctx.behaviors.interaction.key,({code:Ft,key:Qt,modifiers:ht})=>{var pt;if(!this.ctx.canvas3d)return;const Xt={...W,...this.params.bindings},fn=this.ctx.canvas3d.props.trackball;if(E.O.matchKey(Xt.keySpinAnimation,Ft,ht,Qt)){const on="spin"!==fn.animate.name?"spin":"off";this.ctx.canvas3d.setProps("off"===on?{trackball:{animate:{name:on,params:{}}}}:{trackball:{animate:{name:on,params:{speed:1}}}})}if(E.O.matchKey(Xt.keyRockAnimation,Ft,ht,Qt)){const on="rock"!==fn.animate.name?"rock":"off";this.ctx.canvas3d.setProps("off"===on?{trackball:{animate:{name:on,params:{}}}}:{trackball:{animate:{name:on,params:{speed:.3,angle:10}}}})}if(E.O.matchKey(Xt.keyToggleFlyMode,Ft,ht,Qt)){const on=!fn.flyMode;this.ctx.canvas3d.setProps({trackball:{flyMode:on}}),null!==(pt=this.ctx.canvas3dContext)&&void 0!==pt&&pt.canvas&&(this.ctx.canvas3dContext.canvas.style.cursor=on?"crosshair":"unset")}E.O.matchKey(Xt.keyResetView,Ft,ht,Qt)&&I.a.Camera.Reset(this.ctx,{})})}},params:()=>te,display:{name:"Camera Controls on Canvas"}});var ye=n(9136),j=n(1832);const Z=y.A.create({name:"structure-info-prop",category:"custom-props",display:{name:"Structure Info"},ctor:class extends y.A.Handler{get maxModelIndex(){var Ft,Qt;let ht=-1;const pt=this.ctx.state.data.select(j.QX.Generators.rootsOfType(i.O.Molecule.Model));for(const Xt of pt){const fn=(null===(Ft=Xt.obj)||void 0===Ft?void 0:Ft.data)&&ye.Kx.Index.get(null===(Qt=Xt.obj)||void 0===Qt?void 0:Qt.data).value;void 0!==fn&&fn>ht&&(ht=fn)}return ht}get maxStructureIndex(){var Ft,Qt;let ht=-1;const pt=this.ctx.state.data.select(j.QX.Generators.rootsOfType(i.O.Molecule.Structure));for(const Xt of pt){const fn=(null===(Ft=Xt.obj)||void 0===Ft?void 0:Ft.data)&&ye.oE.Index.get(null===(Qt=Xt.obj)||void 0===Qt?void 0:Qt.data).value;void 0!==fn&&fn>ht&&(ht=fn)}return ht}get asymIdOffset(){var Ft;let Qt=0,ht=0;const pt=this.ctx.state.data.select(j.QX.Generators.rootsOfType(i.O.Molecule.Model));for(const Xt of pt){const fn=null===(Ft=Xt.obj)||void 0===Ft?void 0:Ft.data;if(fn){const on=ye.Kx.AsymIdCount.get(fn),En=ye.Kx.AsymIdOffset.get(fn).value;void 0!==on&&void 0!==En&&(Qt=Math.max(Qt,En.auth+on.auth),ht=Math.max(ht,En.label+on.label))}}return{auth:Qt,label:ht}}setModelMaxIndex(){var Ft;const Qt=this.maxModelIndex,ht=this.ctx.state.data.select(j.QX.Generators.rootsOfType(i.O.Molecule.Model));for(const pt of ht){const Xt=null===(Ft=pt.obj)||void 0===Ft?void 0:Ft.data;Xt&&ye.Kx.MaxIndex.get(Xt).value!==Qt&&ye.Kx.MaxIndex.set(Xt,{value:Qt},Qt)}}setStructureMaxIndex(){var Ft;const Qt=this.maxModelIndex,ht=this.ctx.state.data.select(j.QX.Generators.rootsOfType(i.O.Molecule.Structure));for(const pt of ht){const Xt=null===(Ft=pt.obj)||void 0===Ft?void 0:Ft.data;Xt&&ye.oE.MaxIndex.get(Xt).value!==Qt&&ye.oE.MaxIndex.set(Xt,{value:Qt},Qt)}}handleModel(Ft,Qt){if(void 0===ye.Kx.Index.get(Ft).value){const pt=(Qt&&ye.Kx.Index.get(Qt).value)??this.maxModelIndex+1;ye.Kx.Index.set(Ft,{value:pt},pt)}if(void 0===ye.Kx.AsymIdOffset.get(Ft).value){const pt=(Qt&&ye.Kx.AsymIdOffset.get(Qt).value)??{...this.asymIdOffset};ye.Kx.AsymIdOffset.set(Ft,{value:pt},pt)}}handleStructure(Ft,Qt){if(void 0!==Ft.parent||void 0!==ye.oE.Index.get(Ft).value)return;const pt=(Qt&&ye.oE.Index.get(Qt).value)??this.maxStructureIndex+1;ye.oE.Index.set(Ft,{value:pt},pt)}handle(Ft,Qt,ht){i.O.Molecule.Structure.is(Qt)?!this.ctx.state.data.tree.transforms.get(Ft).transformer.definition.isDecorator&&void 0===Qt.data.parent&&this.handleStructure(Qt.data,ht?.data):i.O.Molecule.Model.is(Qt)&&(this.ctx.state.data.tree.transforms.get(Ft).transformer.definition.isDecorator||this.handleModel(Qt.data,ht?.data))}register(){this.ctx.customModelProperties.register(ye.Kx.AsymIdOffset,!0),this.ctx.customModelProperties.register(ye.Kx.Index,!0),this.ctx.customModelProperties.register(ye.Kx.MaxIndex,!0),this.ctx.customStructureProperties.register(ye.oE.Index,!0),this.ctx.customStructureProperties.register(ye.oE.MaxIndex,!0),this.subscribeObservable(this.ctx.state.data.events.object.created,Ft=>{this.handle(Ft.ref,Ft.obj),this.setModelMaxIndex(),this.setStructureMaxIndex()}),this.subscribeObservable(this.ctx.state.data.events.object.updated,Ft=>{this.handle(Ft.ref,Ft.obj,Ft.oldObj)})}unregister(){this.ctx.customModelProperties.unregister(ye.Kx.AsymIdOffset.descriptor.name),this.ctx.customModelProperties.unregister(ye.Kx.Index.descriptor.name),this.ctx.customModelProperties.unregister(ye.Kx.MaxIndex.descriptor.name),this.ctx.customStructureProperties.unregister(ye.oE.Index.descriptor.name),this.ctx.customStructureProperties.unregister(ye.oE.MaxIndex.descriptor.name)}}});var q=n(467),Y=n(4824);const ee=[-1,1.76,1.87,1.65,1.5,1.4,1.85,1.8,1.6,1.4],g={ALA:121,ARG:265,ASN:187,ASP:187,CYS:148,GLU:214,GLN:214,GLY:97,HIS:216,ILE:195,LEU:191,LYS:230,MET:203,PHE:228,PRO:154,SER:143,THR:163,TRP:264,TYR:255,VAL:165};var xe=n(6066),le=n(2434),Ae=n(2008),Be=n(8672),Ce=n(2789);function ke(Ft,Qt,ht){switch(Qt){case"O":return 5;case"S":return 6;case"N":return"NZ"===Ft?4:3;case"C":switch(Ft){case"C":case"CE1":case"CE2":case"CE3":case"CH2":case"CZ":case"CZ2":case"CZ3":return 1;case"CA":case"CB":case"CE":case"CG1":case"CG2":return 2;default:switch(ht){case"PHE":case"TRP":case"TYR":case"HIS":case"ASP":case"ASN":return 1;case"PRO":case"LYS":case"ARG":case"MET":case"ILE":case"LEU":return 2;case"GLU":case"GLN":return"CD"===Ft?1:2}}}return Oe(Qt)}function we(Ft,Qt,ht){switch(Qt){case"C":return 7;case"N":return 8;case"P":return 9;case"O":return 5}return Oe(Qt)}function Oe(Ft){const Qt=(0,Ae.sO)(Ft);let ht=ee.indexOf(Qt);return-1===ht&&(ht=ee.length,ee[ht]=Qt),ht}function Ne(){return(Ne=(0,q.A)(function*(Ft,Qt){const{atomRadiusType:ht}=Qt;for(let pt=0;ptSo[0]-ao[0]);let lo=0;e:for(let So=0;SoCo)continue e}++lo}on[fn[an]]+=Tt*lo*vo*vo}}var ne=n(3543);const be={numberOfSpherePoints:f.t.Numeric(92,{min:12,max:360,step:1},{description:"Number of sphere points to sample per atom: 92 (original paper), 960 (BioJava), 3000 (EPPIC) - see Shrake A, Rupley JA: Environment and exposure to solvent of protein atoms. Lysozyme and insulin. J Mol Biol 1973."}),probeSize:f.t.Numeric(1.4,{min:.1,max:4,step:.01},{description:"Corresponds to the size of a water molecule: 1.4 (original paper), 1.5 (occassionally used)"}),nonPolymer:f.t.Boolean(!1,{description:"Include non-polymer atoms as occluders."}),traceOnly:f.t.Boolean(!1,{description:"Compute only using alpha-carbons, if true increase probeSize accordingly (e.g., 4 A). Considers only canonical amino acids."})};var Te;!function(Ft){function pt(){return pt=(0,q.A)(function*(He,Ye,ot){const rt=function Xt(He,Ye){const{elementCount:ot,atomicResidueCount:rt}=He,{probeSize:St,nonPolymer:vt,traceOnly:mn,numberOfSpherePoints:zt}=Ye;return{structure:He,probeSize:St,nonPolymer:vt,traceOnly:mn,spherePoints:fn(zt),scalingConstant:4*Math.PI/zt,maxLookupRadius:2*Ye.probeSize+2*ee[2],atomRadiusType:new Int8Array(ot),serialResidueIndex:new Int32Array(ot),area:new Float32Array(rt)}}(Ye,ot);(function Re(Ft){const{key:Qt}=Be.StructureProperties.residue,{type_symbol:ht,label_atom_id:pt,label_comp_id:Xt}=Be.StructureProperties.atom,{structure:fn,atomRadiusType:on,serialResidueIndex:En}=Ft,Tt=Be.iZ.Location.create(fn);let Fe=0,He=0,Ye=-1;Tt.structure=fn;for(let ot=0,rt=0,St=fn.units.length;ot{if(!ye.Nf.isAtomic(Ft.element.unit))return!1;const Qt=ge.get(Ft.element.structure).value;return!!Qt&&1===Te.getFlag(Ft.element,Qt)}),isAccessible:ue.Bg.Dynamic((0,re.vy)("computed","accessible-surface-area.is-accessible",ve.Z.Bool),Ft=>{if(!ye.Nf.isAtomic(Ft.element.unit))return!1;const Qt=ge.get(Ft.element.structure).value;return!!Qt&&2===Te.getFlag(Ft.element,Qt)})},ge=ie.S.createProvider({label:"Accessible Surface Area",descriptor:(0,ce.e)({name:"molstar_accessible_surface_area",symbols:ae}),type:"root",defaultParams:se,getParams:Ft=>se,isApplicable:Ft=>!0,obtain:(Ft=(0,q.A)(function*(Qt,ht,pt){const Xt={...f.t.getDefaultValues(se),...pt};return{value:yield Te.compute(ht,Xt).runInContext(Qt.runtime)}}),function(ht,pt,Xt){return Ft.apply(this,arguments)})});var Ft,Ie=n(190),Le=n(274),nt=n(8382);const je=(0,Ie.Q1)(16448250),Je={list:f.t.ColorList("rainbow",{presetKind:"scale"})},pn={name:"accessible-surface-area",label:"Accessible Surface Area",category:Le.J.Category.Residue,factory:function Bt(Ft,Qt){let ht;const pt=Ie.wC.create({listOrName:Qt.list.colors,minLabel:"buried",maxLabel:"exposed",domain:[0,1]}),Xt=Ft.structure&&ge.get(Ft.structure),fn=Xt?(0,nt.vb)(Xt.id,Xt.version):-1;if(Xt?.value&&Ft.structure){const on=ye.iZ.Location.create(Ft.structure),En=Xt.value,Tt=Fe=>{const He=Te.getNormalizedValue(Fe,En);return-1===He?je:pt.color(He)};ht=Fe=>ye.iZ.Location.is(Fe)&&ye.Nf.isAtomic(Fe.unit)?Tt(Fe):ye.gn.isLocation(Fe)?(on.unit=Fe.aUnit,on.element=Fe.aUnit.elements[Fe.aIndex],Tt(on)):je}else ht=()=>je;return{factory:Bt,granularity:"group",preferSmoothing:!0,color:ht,props:Qt,contextHash:fn,description:"Assigns a color based on the relative accessible surface area of a residue.",legend:pt?pt.legend:void 0}},getParams:function en(Ft){return Je},defaultValues:f.t.getDefaultValues(Je),isApplicable:Ft=>!!Ft.structure,ensureCustomProperties:{attach:(Ft,Qt)=>Qt.structure?ge.attach(Ft,Qt.structure,void 0,!0):Promise.resolve(),detach:Ft=>Ft.structure&&ge.ref(Ft.structure,!1)}};var $e=n(6115),mt=n(9096),_t=n(9767);const Me=y.A.create({name:"computed-accessible-surface-area-prop",category:"custom-props",display:{name:"Accessible Surface Area"},ctor:class extends y.A.Handler{constructor(){super(...arguments),this.provider=ge,this.labelProvider={label:Ft=>{if(this.params.showTooltip)return function Ke(Ft){if("element-loci"===Ft.kind){if(0===Ft.elements.length)return;const Qt=ge.get(Ft.structure).value;if(!Qt||Ft.structure.customPropertyDescriptors.hasReference(ge.descriptor))return;const{getSerialIndex:ht}=Ft.structure.root.serialMapping,{area:pt,serialResidueIndex:Xt}=Qt,fn=new Set;let on=0;for(const{indices:Tt,unit:Fe}of Ft.elements){const{elements:He}=Fe;ne.CD.forEach(Tt,Ye=>{const ot=Xt[ht(Fe,He[Ye])];-1!==ot&&!fn.has(ot)&&(on+=pt[ot],fn.add(ot))})}return 0===fn.size?void 0:`Accessible Surface Area (${fn.size} ${fn.size>1?"Residues sum":"Residue"}): ${on.toFixed(2)} \u212b2`}if("structure-loci"===Ft.kind){const Qt=ge.get(Ft.structure).value;return!Qt||Ft.structure.customPropertyDescriptors.hasReference(ge.descriptor)?void 0:`Accessible Surface Area (Whole Structure): ${(0,$e.jJ)(Qt.area).toFixed(2)} \u212b2`}}(Ft)}}}update(Ft){const Qt=this.params.autoAttach!==Ft.autoAttach||this.params.showTooltip!==Ft.showTooltip;return this.params.autoAttach=Ft.autoAttach,this.params.showTooltip=Ft.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),Qt}register(){ue.oY.addCustomProp(this.provider.descriptor),this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach),this.ctx.representation.structure.themes.colorThemeRegistry.add(pn),this.ctx.managers.lociLabels.addProvider(this.labelProvider),this.ctx.query.structure.registry.add(ut),this.ctx.query.structure.registry.add(Kt)}unregister(){ue.oY.removeCustomProp(this.provider.descriptor),this.ctx.customStructureProperties.unregister(this.provider.descriptor.name),this.ctx.representation.structure.themes.colorThemeRegistry.remove(pn),this.ctx.managers.lociLabels.removeProvider(this.labelProvider),this.ctx.query.structure.registry.remove(ut),this.ctx.query.structure.registry.remove(Kt)}},params:()=>({autoAttach:f.t.Boolean(!1),showTooltip:f.t.Boolean(!0)})}),ut=(0,mt.ET)("Buried Protein Residues",_t.J.struct.modifier.union([_t.J.struct.modifier.wholeResidues([_t.J.struct.modifier.union([_t.J.struct.generator.atomGroups({"chain-test":_t.J.core.rel.eq([_t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":ae.isBuried.symbol()})])])]),{description:"Select buried protein residues.",category:mt.g7.Residue,ensureCustomProperties:(Ft,Qt)=>ge.attach(Ft,Qt)}),Kt=(0,mt.ET)("Accessible Protein Residues",_t.J.struct.modifier.union([_t.J.struct.modifier.wholeResidues([_t.J.struct.modifier.union([_t.J.struct.generator.atomGroups({"chain-test":_t.J.core.rel.eq([_t.J.ammp("objectPrimitive"),"atomistic"]),"residue-test":ae.isAccessible.symbol()})])])]),{description:"Select accessible protein residues.",category:mt.g7.Residue,ensureCustomProperties:(Ft,Qt)=>ge.attach(Ft,Qt)});var sn=n(6713),gt=n(1541),yt=n(9469),At=n(9778),Gt=n(2361);const rn=y.A.create({name:"computed-interactions-prop",category:"custom-props",display:{name:"Interactions"},ctor:class extends y.A.Handler{constructor(){super(...arguments),this.provider=sn.r,this.labelProvider={label:Ft=>{if(this.params.showTooltip&&"element-loci"===Ft.kind){if(0===Ft.elements.length)return;const Qt=[],ht=this.getStructures(Ft.structure);for(const pt of ht){const Xt=this.provider.get(pt).value;if(!Xt)continue;const fn=gt.i.Loci.remap(Ft,pt);if(1!==fn.elements.length)continue;const on=fn.elements[0];if(1!==ne.CD.size(on.indices))continue;const En=Xt.unitsFeatures.get(on.unit.id);if(!En)continue;const Tt=[],Fe=[],He=[],Ye=ne.CD.start(on.indices),{types:ot,groups:rt,elementsIndex:{indices:St,offsets:vt}}=En;for(let mn=vt[Ye],zt=vt[Ye+1];mnTypes ${Tt.join(", ")}`),Fe.length&&He.push(`Groups ${Fe.join(", ")}`),He.length&&Qt.push(`Interaction Feature: ${He.join(" | ")}`)}return Qt.length?Qt.join("
"):void 0}}}}getStructures(Ft){const Qt=[],ht=this.ctx.helpers.substructureParent.get(Ft);if(ht){const Xt=this.ctx.state.data.select(j.QX.Generators.ofType(i.O.Molecule.Structure,ht.transform.ref));for(const fn of Xt)fn.obj&&(0,$e.Z2)(Qt,fn.obj.data)}return Qt}update(Ft){const Qt=this.params.autoAttach!==Ft.autoAttach||this.params.showTooltip!==Ft.showTooltip;return this.params.autoAttach=Ft.autoAttach,this.params.showTooltip=Ft.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),Qt}register(){this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach),this.ctx.representation.structure.themes.colorThemeRegistry.add(At.YU),this.ctx.managers.lociLabels.addProvider(this.labelProvider),this.ctx.representation.structure.registry.add(Gt.MH)}unregister(){this.ctx.customStructureProperties.unregister(this.provider.descriptor.name),this.ctx.representation.structure.themes.colorThemeRegistry.remove(At.YU),this.ctx.managers.lociLabels.removeProvider(this.labelProvider),this.ctx.representation.structure.registry.remove(Gt.MH)}},params:()=>({autoAttach:f.t.Boolean(!1),showTooltip:f.t.Boolean(!0)})});var tt=n(8699);const Mt=y.A.create({name:"computed-secondary-structure-prop",category:"custom-props",display:{name:"Secondary Structure"},ctor:class extends y.A.Handler{constructor(){super(...arguments),this.provider=tt.v}update(Ft){const Qt=this.params.autoAttach!==Ft.autoAttach;return this.params.autoAttach=Ft.autoAttach,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),Qt}register(){this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach)}unregister(){this.ctx.customStructureProperties.unregister(this.provider.descriptor.name)}},params:()=>({autoAttach:f.t.Boolean(!1)})});var nn=n(9311),bn=n(3024);const Dn=y.A.create({name:"computed-valence-model-prop",category:"custom-props",display:{name:"Valence Model"},ctor:class extends y.A.Handler{constructor(){super(...arguments),this.provider=nn.F,this.labelProvider={label:Ft=>{if(this.params.showTooltip&&"element-loci"===Ft.kind){if(0===Ft.elements.length)return;const Qt=[],ht=this.getStructures(Ft.structure);for(const pt of ht){const Xt=this.provider.get(pt).value;if(!Xt)continue;const fn=ye.iZ.Loci.remap(Ft,pt);if(1!==fn.elements.length)continue;const on=fn.elements[0];if(1!==ne.CD.size(on.indices))continue;const En=Xt.get(on.unit.id);if(!En)continue;const Tt=ne.CD.start(on.indices),Ye=En.implicitH[Tt],ot=En.totalH[Tt];Qt.push(`Valence Model: Charge ${En.charge[Tt]} | Ideal Geometry ${(0,bn.Fc)(En.idealGeometry[Tt])} | Implicit H ${Ye} | Total H ${ot}`)}return Qt.length?Qt.join("
"):void 0}}}}getStructures(Ft){const Qt=[],ht=this.ctx.helpers.substructureParent.get(Ft);if(ht){const Xt=this.ctx.state.data.select(j.QX.Generators.ofType(i.O.Molecule.Structure,ht.transform.ref));for(const fn of Xt)fn.obj&&(0,$e.Z2)(Qt,fn.obj.data)}return Qt}update(Ft){const Qt=this.params.autoAttach!==Ft.autoAttach||this.params.showTooltip!==Ft.showTooltip;return this.params.autoAttach=Ft.autoAttach,this.params.showTooltip=Ft.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),Qt}register(){this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach),this.ctx.managers.lociLabels.addProvider(this.labelProvider)}unregister(){this.ctx.customStructureProperties.unregister(this.provider.descriptor.name),this.ctx.managers.lociLabels.removeProvider(this.labelProvider)}},params:()=>({autoAttach:f.t.Boolean(!1),showTooltip:f.t.Boolean(!0)})});var jt=n(6220),It=n(7809);const Dt=(0,Ie.Q1)(16448250),$t=new Map,Vt={...(0,It.U)({type:"colors",colorList:"set-1"})},Zt={name:"sifts-mapping",label:"SIFTS Mapping",category:Le.J.Category.Residue,factory:function yn(Ft,Qt){let ht;if(Ft.structure){for(const En of Ft.structure.models){const Tt=jt.W.Provider.get(En).value;if(Tt)for(const Fe of Tt.accession)!Fe||$t.has(Fe)||$t.set(Fe,$t.size)}const pt=ye.iZ.Location.create(Ft.structure),Xt=(0,It.S)($t.size+1,Qt,{valueLabel:En=>`${En}`}),fn=new Map,on=En=>{const Tt=jt.W.getKey(En);if(!Tt)return Dt;if(fn.has(Tt))return fn.get(Tt);const Fe=Xt.color($t.get(Tt));return fn.set(Tt,Fe),Fe};ht=En=>ye.iZ.Location.is(En)&&ye.Nf.isAtomic(En.unit)?on(En):ye.gn.isLocation(En)?(pt.unit=En.aUnit,pt.element=En.aUnit.elements[En.aIndex],on(pt)):Dt}else ht=()=>Dt;return{factory:yn,granularity:"group",preferSmoothing:!0,color:ht,props:Qt,description:"Assigns a color based on SIFTS mapping."}},getParams:function Wt(Ft){return Vt},defaultValues:f.t.getDefaultValues(Vt),isApplicable:Ft=>{var Qt;return!(null===(Qt=Ft.structure)||void 0===Qt||!Qt.models.some(ht=>jt.W.Provider.isApplicable(ht)))},ensureCustomProperties:{attach:function(){var Ft=(0,q.A)(function*(Qt,ht){if(ht.structure)for(const pt of ht.structure.models)yield jt.W.Provider.attach(Qt,pt,void 0,!0)});return function(ht,pt){return Ft.apply(this,arguments)}}(),detach:Ft=>{if(Ft.structure)for(const Qt of Ft.structure.models)jt.W.Provider.ref(Qt,!1)}}},kt=y.A.create({name:"sifts-mapping-prop",category:"custom-props",display:{name:"SIFTS Mapping"},ctor:class extends y.A.Handler{constructor(){super(...arguments),this.provider=jt.W.Provider,this.labelProvider={label:Ft=>{if(this.params.showTooltip)return function Ot(Ft){if("element-loci"===Ft.kind){if(0===Ft.elements.length)return;const Qt=Ft.elements[0],ht=Qt.unit,pt=ye.iZ.Location.create(Ft.structure,ht,ht.elements[ne.CD.getAt(Qt.indices,0)]);return jt.W.getLabel(pt)}}(Ft)}}}update(Ft){const Qt=this.params.autoAttach!==Ft.autoAttach||this.params.showTooltip!==Ft.showTooltip;return this.params.autoAttach=Ft.autoAttach,this.params.showTooltip=Ft.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),Qt}register(){this.ctx.customModelProperties.register(this.provider,this.params.autoAttach),this.ctx.representation.structure.themes.colorThemeRegistry.add(Zt),this.ctx.managers.lociLabels.addProvider(this.labelProvider)}unregister(){this.ctx.customModelProperties.unregister(this.provider.descriptor.name),this.ctx.representation.structure.themes.colorThemeRegistry.remove(Zt),this.ctx.managers.lociLabels.removeProvider(this.labelProvider)}},params:()=>({autoAttach:f.t.Boolean(!0),showTooltip:f.t.Boolean(!0)})});var jn,An=n(9207);!function(Ft){Ft.Descriptor={name:"ihm_cross_link_restraint"},Ft.Provider=An.q.create(Ft.Descriptor),Ft.fromTable=function Qt(ht,pt){const Xt={entity_id:ht.entity_id_1,asym_id:ht.asym_id_1,seq_id:ht.seq_id_1,atom_id:ht.atom_id_1},fn={entity_id:ht.entity_id_2,asym_id:ht.asym_id_2,seq_id:ht.seq_id_2,atom_id:ht.atom_id_2};function on(rt,St,vt){const mn=rt.get(St);mn?mn.push(vt):rt.set(St,[vt])}function En(rt,St){const vt=St.entity_id.value(rt),mn=St.asym_id.value(rt),zt=St.seq_id.value(rt);if("by-atom"===ht.model_granularity.value(rt)){const an=pt.atomicHierarchy.index.findAtom({auth_seq_id:zt,label_asym_id:mn,label_atom_id:St.atom_id.value(rt),label_entity_id:vt});an>=0&&on(Fe,an,rt)}else if(pt.coarseHierarchy.isDefined){const an=pt.coarseHierarchy.spheres.findSequenceKey(vt,mn,zt);if(an>=0)on(He,an,rt);else{const Vn=pt.coarseHierarchy.gaussians.findSequenceKey(vt,mn,zt);Vn>=0&&on(Ye,Vn,rt)}}}const Fe=new Map,He=new Map,Ye=new Map,ot=[];for(let rt=0;rt{const mn=function Tt(rt){switch(rt){case 0:return Fe;case 1:return He;case 2:return Ye}}(St).get(rt);return void 0!==mn?mn:ot},data:ht}}}(jn||(jn={}));var On=n(2524),fr=n(2443),Dr=n(9283),Pr=n(1888),or=n(377),Nr=n(3892),Ir=n(1758);const Or=[];function Jr(Ft,Qt,ht,pt){return`${Ft}|${Qt.id}|${ht}|${pt.id}`}class To{getPairIndices(Qt,ht,pt,Xt){const fn=Jr(Qt,ht,pt,Xt);return this.pairKeyIndices.get(fn)||Or}getPairs(Qt,ht,pt,Xt){return this.getPairIndices(Qt,ht,pt,Xt).map(on=>this.pairs[on])}constructor(Qt){this.pairs=Qt;const ht=new Map;this.pairs.forEach((pt,Xt)=>{const fn=Jr(pt.indexA,pt.unitA,pt.indexB,pt.unitB),on=ht.get(fn);on?on.push(Xt):ht.set(fn,[Xt])}),this.count=Qt.length,this.pairKeyIndices=ht}}var un=n(364),ct=n(6290),dt=n(3917);const Yt=ie.S.createProvider({label:"Cross Link Restraint",descriptor:(0,ce.e)({name:"integrative-cross-link-restraint"}),type:"local",defaultParams:{},getParams:Ft=>({}),isApplicable:Ft=>Ft.models.some(Qt=>!!jn.Provider.get(Qt)),obtain:function(){var Ft=(0,q.A)(function*(Qt,ht,pt){return{value:Yn(ht)}});return function(ht,pt,Xt){return Ft.apply(this,arguments)}}()});var cn;function xn(Ft,Qt,ht){const{elements:pt}=Qt,Xt=pt.length,fn=Qt.kind;for(let on=0;onFt.set(Tt,on))}function Rn(Ft,Qt,ht){if(Qt.model!==ht.model||"mmCIF"!==Qt.model.sourceData.kind)return;const pt=jn.Provider.get(Qt.model);if(!pt)return;const Xt=new Map,fn=new Map;xn(Xt,Qt,pt),xn(fn,ht,pt),Xt.forEach((on,En)=>{const Tt=fn.get(En);void 0!==Tt&&Ft.push(ir(Qt,on,ht,Tt,pt,En),ir(ht,Tt,Qt,on,pt,En))})}function er(Ft,Qt){if("mmCIF"!==Qt.model.sourceData.kind)return;const ht=jn.Provider.get(Qt.model);if(!ht)return;const{elements:pt}=Qt,Xt=pt.length,fn=Qt.kind,on=new Map;for(let En=0;En{const He=on.get(Fe);He?He.push(En):on.set(Fe,[En])});on.forEach((En,Tt)=>{if(En.length<2)return;const[Fe,He]=En;Ft.push(ir(Qt,Fe,Qt,He,ht,Tt),ir(Qt,He,Qt,Fe,ht,Tt))})}function ir(Ft,Qt,ht,pt,Xt,fn){return{unitA:Ft,indexA:Qt,unitB:ht,indexB:pt,restraintType:Xt.data.restraint_type.value(fn),distanceThreshold:Xt.data.distance_threshold.value(fn),psi:Xt.data.psi.value(fn),sigma1:Xt.data.sigma_1.value(fn),sigma2:Xt.data.sigma_2.value(fn)}}function Yn(Ft){const Qt=[];if(!Ft.models.some(pt=>jn.Provider.get(pt)))return new To(Qt);const ht=Ft.units.length;for(let pt=0;pt!!jn.Provider.get(mn))};const pt=(0,L.eB)(),Xt=(0,L.eB)();function fn(vt){return vt.unitA.conformation.position(vt.unitA.elements[vt.indexA],pt),vt.unitB.conformation.position(vt.unitB.elements[vt.indexB],Xt),L.eB.distance(pt,Xt)}function Fe(vt,mn){const zt=vt.pairs[mn];return`Cross Link Restraint | Type: ${zt.restraintType} | Threshold: ${zt.distanceThreshold} \u212b | Psi: ${zt.psi} | Sigma 1: ${zt.sigma1} | Sigma 2: ${zt.sigma2} | Distance: ${fn(zt).toFixed(2)} \u212b`}function rt(vt,mn,zt){return ct.p.fromPairProvider(mn.length,(an,Vn,Fn)=>{const rr=vt.pairs[mn[an]];rr.unitA.conformation.position(rr.unitA.elements[rr.indexA],Vn),rr.unitB.conformation.position(rr.unitB.elements[rr.indexB],Fn)},zt)}function St(vt,mn,zt){const an=zt[0];if(void 0===an)return"";const Vn=mn.pairs[an];return[Fe(mn,an),(0,dt.CR)(ye.gn.Location(vt,Vn.unitA,Vn.indexA,vt,Vn.unitB,Vn.indexB))].join("
")}Ft.distance=fn,Ft.Location=function on(vt,mn,zt){return(0,un.cG)("cross-link-restraints",{structure:mn,crossLinkRestraints:vt},zt)},Ft.isLocation=function En(vt){return!!vt&&"data-location"===vt.kind&&"cross-link-restraints"===vt.tag},Ft.areLocationsEqual=function Tt(vt,mn){return vt.data.structure===mn.data.structure&&vt.data.crossLinkRestraints===mn.data.crossLinkRestraints&&vt.element===mn.element},Ft.locationLabel=function He(vt){return Fe(vt.data.crossLinkRestraints,vt.element)},Ft.Loci=function Ye(vt,mn,zt){return(0,R.g9)("cross-link-restraints",{structure:vt,crossLinkRestraints:mn},zt,an=>rt(mn,zt,an),()=>St(vt,mn,zt))},Ft.isLoci=function ot(vt){return!!vt&&"data-loci"===vt.kind&&"interactions"===vt.tag},Ft.getBoundingSphere=rt,Ft.getLabel=St}(cn||(cn={}));var br=n(5384);function vr(Ft,Qt,ht,pt,Xt){const fn=Yt.get(Qt).value;if(!fn.count)return Dr.e.createEmpty(Xt);const{sizeFactor:on}=pt,En=ye.iZ.Location.create(Qt),Tt={linkCount:fn.count,position:(Ye,ot,rt)=>{const St=fn.pairs[rt],vt=St.unitA,mn=St.unitB;vt.conformation.position(vt.elements[St.indexA],Ye),mn.conformation.position(mn.elements[St.indexB],ot)},radius:Ye=>{const ot=fn.pairs[Ye];return En.unit=ot.unitA,En.element=ot.unitA.elements[ot.indexA],ht.size.size(En)*on}},{mesh:Fe,boundingSphere:He}=(0,or.C1)(Ft,Tt,pt,Xt);if(He)Fe.setBoundingSphere(He);else if(Fe.triangleCount>0){const Ye=br.f8.expand((0,br.f8)(),Qt.boundary.sphere,1*on);Fe.setBoundingSphere(Ye)}return Fe}const Hr={...Nr.EN,...or.Lr,sizeFactor:f.t.Numeric(.5,{min:0,max:10,step:.1})};function Mr(Ft){return(0,Nr.wA)({defaultProps:f.t.getDefaultValues(Hr),createGeometry:vr,createLocationIterator:Fr,getLoci:Sr,eachLocation:Ur,setUpdateState:(Qt,ht,pt)=>{Qt.createGeometry=ht.sizeFactor!==pt.sizeFactor||ht.radialSegments!==pt.radialSegments||ht.linkCap!==pt.linkCap}},Ft)}function Fr(Ft){const Qt=Yt.get(Ft).value,{pairs:ht}=Qt,pt=ht.length,fn=cn.Location(Qt,Ft);return(0,Pr.iQ)(pt,1,1,En=>(fn.element=En,fn),!0)}function Sr(Ft,Qt,ht){const{objectId:pt,groupId:Xt}=Ft;if(ht===pt){const fn=Yt.get(Qt).value;if(fn.pairs[Xt])return cn.Loci(Qt,fn,[Xt])}return R.BL}function Ur(Ft,Qt,ht){let pt=!1;if(cn.isLoci(Ft)){if(!ye.oE.areEquivalent(Ft.data.structure,Qt))return!1;const Xt=Yt.get(Qt).value;if(Ft.data.crossLinkRestraints!==Xt)return!1;for(const fn of Ft.elements)ht(ne.IX.ofSingleton(fn))&&(pt=!0)}return pt}const Ro={"cross-link-restraint":(Ft,Qt)=>(0,Ir.Kp)("Cross-link restraint",Ft,Qt,Mr)},ro={...Hr},ho=(0,Ir.GT)({name:cn.Tag.CrossLinkRestraint,label:"Cross Link Restraint",description:"Displays cross-link restraints.",factory:function so(Ft,Qt){return fr.YL.createMulti("CrossLinkRestraint",Ft,Qt,Ir.J1,Ro)},getParams:function po(Ft,Qt){return f.t.clone(ro)},defaultValues:f.t.getDefaultValues(ro),defaultColorTheme:{name:cn.Tag.CrossLinkRestraint},defaultSizeTheme:{name:"uniform"},isApplicable:Ft=>cn.isApplicable(Ft),ensureCustomProperties:{attach:(Ft,Qt)=>Yt.attach(Ft,Qt,void 0,!0),detach:Ft=>Yt.ref(Ft,!1)}}),Bo=(0,Ie.Q1)(13421772),Wo={domain:f.t.Interval([.5,1.5],{step:.01}),list:f.t.ColorList("red-grey",{presetKind:"scale"})},Sn={name:"cross-link",label:"Cross Link",category:Le.J.Category.Misc,factory:function Pt(Ft,Qt){let ht,pt;const Xt=Ft.structure&&Yt.get(Ft.structure).value;if(Xt){pt=Ie.wC.create({domain:Qt.domain,listOrName:Qt.list.colors});const fn=pt.color;ht=on=>{if(cn.isLocation(on)){const En=Xt.pairs[on.element];if(En)return fn(cn.distance(En)/En.distanceThreshold)}return Bo}}else ht=()=>Bo;return{factory:Pt,granularity:"group",color:ht,props:Qt,description:"Colors cross-links by the deviation of the observed distance versus the modeled distance (e.g. modeled / `ihm_cross_link_restraint.distance_threshold`).",legend:pt?pt.legend:void 0}},getParams:function We(Ft){return Wo},defaultValues:f.t.getDefaultValues(Wo),isApplicable:Ft=>!!Ft.structure&&cn.isApplicable(Ft.structure),ensureCustomProperties:{attach:(Ft,Qt)=>Qt.structure?Yt.attach(Ft,Qt.structure,void 0,!0):Promise.resolve(),detach:Ft=>Ft.structure&&Yt.ref(Ft.structure,!1)}},Nn=y.A.create({name:"integrative-cross-link-restraint",category:"custom-props",display:{name:"Cross Link Restraint"},ctor:class extends y.A.Handler{constructor(){super(...arguments),this.provider=jn.Provider}register(){this.provider.formatRegistry.add("mmCIF",Kn),this.ctx.representation.structure.themes.colorThemeRegistry.add(Sn),this.ctx.representation.structure.registry.add(ho)}unregister(){this.provider.formatRegistry.remove("mmCIF"),this.ctx.representation.structure.themes.colorThemeRegistry.remove(Sn),this.ctx.representation.structure.registry.remove(ho)}}});function Kn(Ft){if(!On.K4.is(Ft.sourceData))return;const{ihm_cross_link_restraint:Qt}=Ft.sourceData.data.db;return 0!==Qt._rowCount?jn.fromTable(Qt,Ft):void 0}const dr={State:c,Representation:e,Camera:o,Misc:r},xr={Representation:D,Camera:t,CustomProps:A}},1164:(tn,Ue,n)=>{"use strict";n.d(Ue,{A:()=>c});var c,e=n(467),o=n(381),r=n(1832),t=n(4824),A=n(8277),y=n(9909);!function(i){class v extends(o.O.Create({name:"Root",typeClass:"Root"})){}i.Root=v;class O extends(o.O.Create({name:"Category",typeClass:"Object"})){}i.Category=O;class b extends(o.O.CreateBehavior({name:"Behavior"})){}i.Behavior=b,i.Categories={common:"Common",representation:"Representation",interaction:"Interaction","custom-props":"Custom Properties",misc:"Miscellaneous"},i.CreateCategory=o.H.BuiltIn({name:"create-behavior-category",display:{name:"Behavior Category"},from:v,to:O,params:{label:A.t.Text("",{isHidden:!0})}})({apply:({params:d})=>new O({},{label:d.label})});const _=new Map;i.getCategoryId=function M(d){return _.get(d.id)},i.create=function I(d){const s=o.H.CreateBuiltIn({name:d.name,display:d.display,from:[v],to:[b],params:d.params,apply({params:C},h){const a=d.label?d.label(C):{label:d.display.name,description:d.display.description};return new b(new d.ctor(h,C),a)},update:({b:C,newParams:h})=>t.YZ.create("Update Behavior",(0,e.A)(function*(){return C.data.update&&(yield C.data.update(h))?r.xE.UpdateResult.Updated:r.xE.UpdateResult.Unchanged})),canAutoUpdate:d.canAutoUpdate});return _.set(s.id,d.category),s},i.simpleCommandHandler=function l(d,s){return class{register(){this.sub=d.subscribe(this.ctx,C=>s(C,this.ctx))}dispose(){this.sub&&this.sub.unsubscribe(),this.sub=void 0}constructor(C){this.ctx=C,this.sub=void 0}}},i.Handler=class m{subscribeCommand(s,C){this.subs.push(s.subscribe(this.ctx,C))}subscribeObservable(s,C){this.subs.push(s.subscribe(C))}track(s){this.subs.push(s)}dispose(){for(const s of this.subs)s.unsubscribe();this.subs=[]}update(s){return!(0,y.f8)(s,this.params)&&(this.params=s,!0)}constructor(s,C){this.ctx=s,this.params=C,this.subs=[]}},i.WithSubscribers=class u{subscribeCommand(s,C){this.subs.push(s.subscribe(this.plugin,C))}subscribeObservable(s,C){const h=s.subscribe(C);return this.subs.push(h),{unsubscribe:()=>{const a=this.subs.indexOf(h);a>=0&&(this.subs.splice(a,1),h.unsubscribe())}}}dispose(){for(const s of this.subs)s.unsubscribe();this.subs=[]}constructor(s,C){this.plugin=s,this.params=C,this.subs=[]}}}(c||(c={}))},1937:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{DefaultFocusLociBindings:()=>S,DefaultLociLabelProvider:()=>a,DefaultSelectLociBindings:()=>s,FocusLoci:()=>R,HighlightLoci:()=>d,SelectLoci:()=>h});var e=n(6825),o=n(381),r=n(3917),t=n(1164),A=n(6323),y=n(1832),c=n(4080),i=n(4123),v=n(8277),O=n(3246),b=n(9136),_=n(6115);const M=c.qt,I=c.Fs,l=i.O.Trigger,m={hoverHighlightOnly:(0,i.O)([l(M.Flag.None)],"Highlight","Hover element using ${triggers}"),hoverHighlightOnlyExtend:(0,i.O)([l(M.Flag.None,I.create({shift:!0}))],"Extend highlight","From selected to hovered element along polymer using ${triggers}")},u={bindings:v.t.Value(m,{isHidden:!0}),ignore:v.t.Value([],{isHidden:!0}),preferAtoms:v.t.Boolean(!1,{description:"Always prefer atoms over bonds"}),mark:v.t.Boolean(!0)},d=t.A.create({name:"representation-highlight-loci",category:"interaction",ctor:class extends t.A.Handler{constructor(){super(...arguments),this.lociMarkProvider=(f,p)=>{!this.ctx.canvas3d||!this.params.mark||this.ctx.canvas3d.mark(f,p)}}getLoci(f){return this.params.preferAtoms&&b.gn.isLoci(f)&&2===f.bonds.length?b.gn.toFirstStructureElementLoci(f):f}register(){this.subscribeObservable(this.ctx.behaviors.interaction.hover,({current:f,buttons:p,modifiers:E})=>{if(!this.ctx.canvas3d||this.ctx.isBusy)return;const T=this.getLoci(f.loci);if(this.params.ignore.includes(T.kind))return void this.ctx.managers.interactivity.lociHighlights.highlightOnly({repr:f.repr,loci:O.BL});let L=!1;i.O.match(this.params.bindings.hoverHighlightOnly,p,E)&&(this.ctx.managers.interactivity.lociHighlights.highlightOnly({loci:T}),L=!0),i.O.match(this.params.bindings.hoverHighlightOnlyExtend,p,E)&&(this.ctx.managers.interactivity.lociHighlights.highlightOnlyExtend({loci:T}),L=!0),L||this.ctx.managers.interactivity.lociHighlights.highlightOnly({repr:f.repr,loci:O.BL})}),this.ctx.managers.interactivity.lociHighlights.addProvider(this.lociMarkProvider)}unregister(){this.ctx.managers.interactivity.lociHighlights.removeProvider(this.lociMarkProvider)}},params:()=>u,display:{name:"Highlight Loci on Canvas"}}),s={clickSelect:i.O.Empty,clickToggleExtend:(0,i.O)([l(M.Flag.Primary,I.create({shift:!0}))],"Toggle extended selection","Click on element using ${triggers} to extend selection along polymer"),clickSelectOnly:i.O.Empty,clickToggle:(0,i.O)([l(M.Flag.Primary,I.create())],"Toggle selection","Click on element using ${triggers}"),clickDeselect:i.O.Empty,clickDeselectAllOnEmpty:(0,i.O)([l(M.Flag.Primary,I.create())],"Deselect all","Click on nothing using ${triggers}")},C={bindings:v.t.Value(s,{isHidden:!0}),ignore:v.t.Value([],{isHidden:!0}),preferAtoms:v.t.Boolean(!1,{description:"Always prefer atoms over bonds"}),mark:v.t.Boolean(!0)},h=t.A.create({name:"representation-select-loci",category:"interaction",ctor:class extends t.A.Handler{getLoci(f){return this.params.preferAtoms&&b.gn.isLoci(f)&&2===f.bonds.length?b.gn.toFirstStructureElementLoci(f):f}applySelectMark(f,p){const E=this.ctx.state.data.cells.get(f);if(E&&o.O.isRepresentation3D(E.obj)){this.spine.current=E;const T=this.spine.getRootOfType(o.O.Molecule.Structure);if(T){p&&this.lociMarkProvider({loci:b.oE.Loci(T.data)},e.xi.Deselect);const L=this.ctx.managers.structure.selection.getLoci(T.data);this.lociMarkProvider({loci:L},e.xi.Select)}}}register(){const p=T=>!O.QN.isEmpty(T),E=[["clickSelect",T=>this.ctx.managers.interactivity.lociSelects.select(T),p],["clickToggle",T=>this.ctx.managers.interactivity.lociSelects.toggle(T),p],["clickToggleExtend",T=>this.ctx.managers.interactivity.lociSelects.toggleExtend(T),p],["clickSelectOnly",T=>this.ctx.managers.interactivity.lociSelects.selectOnly(T),p],["clickDeselect",T=>this.ctx.managers.interactivity.lociSelects.deselect(T),p],["clickDeselectAllOnEmpty",()=>this.ctx.managers.interactivity.lociSelects.deselectAll(),T=>O.QN.isEmpty(T)]];E.sort((T,L)=>{const w=this.params.bindings[T[0]],Q=this.params.bindings[L[0]],G=0===w.triggers.length?0:(0,_._M)(w.triggers.map(U=>I.size(U.modifiers)));return(0===Q.triggers.length?0:(0,_._M)(Q.triggers.map(U=>I.size(U.modifiers))))-G}),this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:T,button:L,modifiers:w})=>{if(!this.ctx.canvas3d||this.ctx.isBusy||!this.ctx.selectionMode)return;const Q=this.getLoci(T.loci);if(!this.params.ignore.includes(Q.kind))for(const[G,V,U]of E)if(i.O.match(this.params.bindings[G],L,w)&&(!U||U(Q))){V({repr:T.repr,loci:Q});break}}),this.ctx.managers.interactivity.lociSelects.addProvider(this.lociMarkProvider),this.subscribeObservable(this.ctx.state.events.object.created,({ref:T})=>this.applySelectMark(T)),this.subscribeObservable(this.ctx.state.events.object.updated,({ref:T,obj:L,oldObj:w,oldData:Q,action:G})=>{const V=this.ctx.state.data.cells.get(T);if(V&&o.O.Molecule.Structure.is(V.obj)){const U=L.data,N="recreate"===G?w?.data:"in-place"===G?Q:void 0;if(N&&b.oE.areEquivalent(U,N)&&b.oE.areHierarchiesEqual(U,N))return;const k=this.ctx.state.data.select(y.QX.children(T).ofType(o.O.Molecule.Structure.Representation3D));for(const H of k)this.applySelectMark(H.transform.ref,!0)}})}unregister(){this.ctx.managers.interactivity.lociSelects.removeProvider(this.lociMarkProvider)}constructor(f,p){super(f,p),this.lociMarkProvider=(E,T)=>{!this.ctx.canvas3d||!this.params.mark||this.ctx.canvas3d.mark({loci:E.loci},T)},this.spine=new A.P.Impl(f.state.data.cells)}},params:()=>C,display:{name:"Select Loci on Canvas"}}),a=t.A.create({name:"default-loci-label-provider",category:"interaction",ctor:class{register(){this.ctx.managers.lociLabels.addProvider(this.f)}unregister(){this.ctx.managers.lociLabels.removeProvider(this.f)}constructor(f){this.ctx=f,this.f={label:p=>{const E=[];if(b.iZ.Loci.is(p)){const T=new Set;for(const{unit:L}of p.elements){const w=b.iZ.Location.create(p.structure,L,L.elements[0]),Q=b.StructureProperties.entity.pdbx_description(w).join(", ");T.add(Q)}1===T.size&&T.forEach(L=>E.push(L))}return E.push((0,r.YQ)(p)),E.filter(T=>!!T).join("
")},group:p=>p.toString().replace(/Model [0-9]+/g,"Models"),priority:100}}},display:{name:"Provide Default Loci Label"}}),S={clickFocus:(0,i.O)([l(M.Flag.Primary,I.create())],"Representation Focus","Click element using ${triggers}"),clickFocusAdd:(0,i.O)([l(M.Flag.Primary,I.create({shift:!0}))],"Representation Focus Add","Click element using ${triggers}"),clickFocusSelectMode:(0,i.O)([],"Representation Focus","Click element using ${triggers}"),clickFocusAddSelectMode:(0,i.O)([],"Representation Focus Add","Click element using ${triggers}")},D={bindings:v.t.Value(S,{isHidden:!0})},R=t.A.create({name:"representation-focus-loci",category:"interaction",ctor:class extends t.A.Handler{register(){this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:f,button:p,modifiers:E})=>{var T,L,w,Q,G;const{clickFocus:V,clickFocusAdd:U,clickFocusSelectMode:N,clickFocusAddSelectMode:k}=this.params.bindings,$=i.O.match(this.ctx.selectionMode?N:V,p,E),J=null!==(Q=null===(w=null===(L=null===(T=f.repr)||void 0===T?void 0:T.props)||void 0===L?void 0:L.snapshotKey)||void 0===w?void 0:w.trim())&&void 0!==Q?Q:"";if(!this.ctx.selectionMode&&$&&J)return void this.ctx.managers.snapshot.applyKey(J);const{granularity:W}=this.ctx.managers.interactivity.props;if("residue"!==W&&"element"!==W)return;const de=i.O.match(this.ctx.selectionMode?k:U,p,E);if(!$&&!de)return;const ye=O.QN.normalize(f.loci,"residue"),j=this.ctx.managers.structure.focus.current;if(j&&O.QN.areEqual(j.loci,ye))this.ctx.managers.structure.focus.clear();else if($)this.ctx.managers.structure.focus.setFromLoci(ye);else{this.ctx.managers.structure.focus.addFromLoci(ye);const Z=null===(G=this.ctx.managers.structure.focus.current)||void 0===G?void 0:G.loci;Z&&this.ctx.managers.camera.focusLoci(Z)}})}},params:()=>D,display:{name:"Representation Focus Loci on Canvas"}})},445:(tn,Ue,n)=>{"use strict";n.d(Ue,{b:()=>C});var e=n(467),o=n(2361),r=n(9778),t=n(9136),A=n(1893),y=n(1073),c=n(4987),i=n(9767),v=n(1832),O=n(2832),b=n(8277),_=n(6763),M=n(6765),I=n(9390);const m=["target","surroundings","interactions"];var u=function(h){return h.TargetSel="structure-focus-target-sel",h.TargetRepr="structure-focus-target-repr",h.SurrSel="structure-focus-surr-sel",h.SurrRepr="structure-focus-surr-repr",h.SurrNciRepr="structure-focus-surr-nci-repr",h}(u||{});const d=new Set([u.TargetSel,u.TargetRepr,u.SurrSel,u.SurrRepr,u.SurrNciRepr]),C=c.AF.create({name:"create-structure-focus-representation",display:{name:"Structure Focus Representation"},category:"interaction",ctor:class s extends c.AF.WithSubscribers{constructor(){super(...arguments),this.currentSource=void 0}get surrLabel(){return`[Focus] Surroundings (${this.params.expandRadius} \xc5)`}getReprParams(a){return{...a,type:{name:a.type.name,params:{...a.type.params,ignoreHydrogens:this.params.ignoreHydrogens,ignoreHydrogensVariant:this.params.ignoreHydrogensVariant,ignoreLight:this.params.ignoreLight,material:this.params.material,clip:this.params.clip}}}}ensureShape(a){var S;const D=this.plugin.state.data,R=D.tree,f=D.build(),p=v.QX.findUniqueTagsInSubtree(R,a.transform.ref,d);p[u.TargetSel]||(p[u.TargetSel]=f.to(a).apply(y.f.Model.StructureSelectionFromBundle,{bundle:t.iZ.Bundle.Empty,label:"[Focus] Target"},{tags:u.TargetSel}).ref),p[u.SurrSel]||(p[u.SurrSel]=f.to(a).apply(y.f.Model.StructureSelectionFromExpression,{expression:i.J.struct.generator.empty(),label:this.surrLabel},{tags:u.SurrSel}).ref);const E=this.params.components;return E.indexOf("target")>=0&&!p[u.TargetRepr]&&(p[u.TargetRepr]=f.to(p[u.TargetSel]).apply(y.f.Representation.StructureRepresentation3D,this.getReprParams(this.params.targetParams),{tags:u.TargetRepr}).ref),E.indexOf("surroundings")>=0&&!p[u.SurrRepr]&&(p[u.SurrRepr]=f.to(p[u.SurrSel]).apply(y.f.Representation.StructureRepresentation3D,this.getReprParams(this.params.surroundingsParams),{tags:u.SurrRepr}).ref),E.indexOf("interactions")>=0&&!p[u.SurrNciRepr]&&a.obj&&o.MH.isApplicable(null===(S=a.obj)||void 0===S?void 0:S.data)&&(p[u.SurrNciRepr]=f.to(p[u.SurrSel]).apply(y.f.Representation.StructureRepresentation3D,this.getReprParams(this.params.nciParams),{tags:u.SurrNciRepr}).ref),{state:D,builder:f,refs:p}}clear(a){const S=this.plugin.state.data;this.currentSource=void 0;const D=S.select(v.QX.Generators.byRef(a).subtree().withTag(u.TargetSel)),R=S.select(v.QX.Generators.byRef(a).subtree().withTag(u.SurrSel));if(0===D.length&&0===R.length)return;const f=S.build(),p=t.iZ.Bundle.Empty;for(const T of D)f.to(T).update(y.f.Model.StructureSelectionFromBundle,L=>({...L,bundle:p}));const E=i.J.struct.generator.empty();for(const T of R)f.to(T).update(y.f.Model.StructureSelectionFromExpression,L=>({...L,expression:E}));return _.a.State.Update(this.plugin,{state:S,tree:f,options:{doNotLogTiming:!0,doNotUpdateCurrent:!0}})}focus(a){var S=this;return(0,e.A)(function*(){const D=S.plugin.helpers.substructureParent.get(a.structure);if(!D||!D.obj)return;S.currentSource=a;const R=t.iZ.Loci.remap(a,D.obj.data),f=t.iZ.Loci.extendToWholeResidues(R),p=t.iZ.Bundle.fromLoci(f),E=t.iZ.Bundle.toExpression(p);let T=i.J.struct.modifier.includeSurroundings({0:E,radius:S.params.expandRadius,"as-whole-residues":!0});S.params.excludeTargetFromSurroundings&&(T=i.J.struct.modifier.exceptBy({0:T,by:E}));const{state:L,builder:w,refs:Q}=S.ensureShape(D);w.to(Q[u.TargetSel]).update(y.f.Model.StructureSelectionFromBundle,G=>({...G,bundle:p})),w.to(Q[u.SurrSel]).update(y.f.Model.StructureSelectionFromExpression,G=>({...G,expression:T,label:S.surrLabel})),yield _.a.State.Update(S.plugin,{state:L,tree:w,options:{doNotLogTiming:!0,doNotUpdateCurrent:!0}})})()}register(a){this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current,S=>{S?this.focus(S.loci):this.clear(v.Cn.RootRef)})}update(a){var S=this;return(0,e.A)(function*(){const D=S.params;if(S.params=a,D.excludeTargetFromSurroundings!==a.excludeTargetFromSurroundings)return S.currentSource&&S.focus(S.currentSource),!0;const R=S.plugin.state.data,f=R.build(),p=v.QX.Generators.root.subtree(),E=S.params.components;let T=E.indexOf("target")>=0;for(const L of R.select(p.withTag(u.TargetRepr)))T?f.to(L).update(S.getReprParams(S.params.targetParams)):f.delete(L.transform.ref);T=E.indexOf("surroundings")>=0;for(const L of R.select(p.withTag(u.SurrRepr)))T?f.to(L).update(S.getReprParams(S.params.surroundingsParams)):f.delete(L.transform.ref);T=E.indexOf("interactions")>=0;for(const L of R.select(p.withTag(u.SurrNciRepr)))T?f.to(L).update(S.getReprParams(S.params.nciParams)):f.delete(L.transform.ref);return yield _.a.State.Update(S.plugin,{state:R,tree:f,options:{doNotLogTiming:!0,doNotUpdateCurrent:!0}}),a.expandRadius!==D.expandRadius&&S.currentSource&&S.focus(S.currentSource),!0})()}},params:(h,a)=>(h=>{const a=y.f.Representation.StructureRepresentation3D.definition.params(void 0,h);return{expandRadius:b.t.Numeric(5,{min:1,max:10,step:1}),targetParams:b.t.Group(a,{label:"Target",customDefault:(0,A.pQ)(h,void 0,{type:"ball-and-stick",size:"physical",typeParams:{sizeFactor:.22,sizeAspectRatio:.73,adjustCylinderLength:!0,xrayShaded:!0,aromaticBonds:!1,multipleBonds:"off",excludeTypes:["hydrogen-bond","metal-coordination"]}})}),surroundingsParams:b.t.Group(a,{label:"Surroundings",customDefault:(0,A.pQ)(h,void 0,{type:"ball-and-stick",size:"physical",typeParams:{sizeFactor:.16,excludeTypes:["hydrogen-bond","metal-coordination"]}})}),nciParams:b.t.Group(a,{label:"Non-covalent Int.",customDefault:(0,A.pQ)(h,void 0,{type:o.MH,color:r.YU,size:O.F.BuiltIn.uniform})}),components:b.t.MultiSelect(m,b.t.arrayToOptions(m)),excludeTargetFromSurroundings:b.t.Boolean(!1,{label:"Exclude Target",description:'Exclude the focus "target" from the surroudings component.'}),ignoreHydrogens:b.t.Boolean(!1),ignoreHydrogensVariant:b.t.Select("all",b.t.arrayToOptions(["all","non-polar"])),ignoreLight:b.t.Boolean(!1),material:M.i.getParam(),clip:b.t.Group(I.B.Params)}})(a)})},6230:(tn,Ue,n)=>{"use strict";n.d(Ue,{h:()=>R});var O,f,e=n(467),o=n(8277),r=n(381),t=n(6853),A=n(5384),y=n(4369),c=n(190),i=n(1164),v=n(9677);(f=O||(O={})).create=function E(Q){return{entries:(0,v.wl)(),capacity:Math.max(1,Q)}},f.get=function T(Q,G){for(let V=Q.entries.first;V;V=V.next)if(V.value.key===G)return Q.entries.remove(V),Q.entries.addLast(V.value),V.value.data},f.set=function L(Q,G,V){let U;if(Q.entries.count>=Q.capacity){const N=Q.entries.first;U=N.value.data,Q.entries.remove(N)}return Q.entries.addLast(function p(Q,G){return{key:Q,data:G}}(G,V)),U},f.remove=function w(Q,G){for(let V=Q.entries.first;V;V=V.next)if(V.value.key===G){Q.entries.remove(V);break}};var b=n(5091),_=n(5165),M=n(4625),I=n(6763),l=n(1832),m=n(9136),u=n(3246),d=n(1861),s=n(4811),C=n(3386),h=n(6354),a=n(3294),S=n(5964);class D{constructor(p=!1){this.isRunning=!1,this.queue=[],this.counter=0,this.log=p}enqueue(p){this.log&&console.log("SingleAsyncQueue enqueue",this.counter),this.queue[0]={id:this.counter,func:p},this.counter++,this.run()}run(){var p=this;return(0,e.A)(function*(){if(p.isRunning)return;const E=p.queue.pop();if(E){p.isRunning=!0;try{p.log&&console.log("SingleAsyncQueue run",E.id),yield E.func(),p.log&&console.log("SingleAsyncQueue complete",E.id)}finally{p.isRunning=!1,p.run()}}})()}}class R extends(r.O.CreateBehavior({name:"Volume Streaming"})){}!function(f){function p(V,U,N,k,H={}){var $,J,W,te;return o.t.Group({isoValue:t.f.createIsoValueParam(null!==($=H.isoValue)&&void 0!==$?$:N,k),color:o.t.Color(null!==(J=H.color)&&void 0!==J?J:U),wireframe:o.t.Boolean(null!==(W=H.wireframe)&&void 0!==W&&W),opacity:o.t.Numeric(null!==(te=H.opacity)&&void 0!==te?te:.3,{min:0,max:1,step:.01})},{label:V,isExpanded:!0})}f.RootTag="volume-streaming-info";const E={byteOffset:0,rate:1,sampleCount:[1,1,1],valuesInfo:[{mean:0,min:-1,max:1,sigma:.1},{mean:0,min:-1,max:1,sigma:.1}]};function L(V){const{entryData:U,defaultView:N,structure:k,channelParams:H={}}=V,$=U||{kind:"em",header:{sampling:[E],availablePrecisions:[{precision:0,maxVoxels:0}]},emDefaultContourLevel:t.f.IsoValue.relative(0)},J=k&&k.boundary.box||(0,A.DJ)();return{view:o.t.MappedStatic(N||("em"===$.kind?"auto":"selection-box"),{off:o.t.Group({}),box:o.t.Group({bottomLeft:o.t.Vec3(J.min),topRight:o.t.Vec3(J.max)},{description:"Static box defined by cartesian coords.",isFlat:!0}),"selection-box":o.t.Group({radius:o.t.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212b within which the volume is shown."}),bottomLeft:o.t.Vec3(y.eB.create(0,0,0),{},{isHidden:!0}),topRight:o.t.Vec3(y.eB.create(0,0,0),{},{isHidden:!0})},{description:"Box around focused element.",isFlat:!0}),"camera-target":o.t.Group({radius:o.t.Numeric(.5,{min:0,max:1,step:.05},{description:"Radius within which the volume is shown (relative to the field of view)."}),dynamicDetailLevel:w($.header.availablePrecisions,0,{label:"Dynamic Detail"}),bottomLeft:o.t.Vec3(y.eB.create(0,0,0),{},{isHidden:!0}),topRight:o.t.Vec3(y.eB.create(0,0,0),{},{isHidden:!0})},{description:"Box around camera target.",isFlat:!0}),cell:o.t.Group({}),auto:o.t.Group({radius:o.t.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212b within which the volume is shown."}),selectionDetailLevel:w($.header.availablePrecisions,6,{label:"Selection Detail"}),isSelection:o.t.Boolean(!1,{isHidden:!0}),bottomLeft:o.t.Vec3(J.min,{},{isHidden:!0}),topRight:o.t.Vec3(J.max,{},{isHidden:!0})},{description:"Box around focused element.",isFlat:!0})},{options:f.ViewTypeOptions,description:'Controls what of the volume is displayed. "Off" hides the volume alltogether. "Bounded box" shows the volume inside the given box. "Around Interaction" shows the volume around the focused element/atom. "Whole Structure" shows the volume for the whole structure.'}),detailLevel:w($.header.availablePrecisions,3),channels:o.t.Group("em"===$.kind?{em:p("EM",(0,c.Q1)(6524815),$.emDefaultContourLevel||t.f.IsoValue.relative(1),$.header.sampling[0].valuesInfo[0],H.em)}:{"2fo-fc":p("2Fo-Fc",(0,c.Q1)(3367602),t.f.IsoValue.relative(1.5),$.header.sampling[0].valuesInfo[0],H["2fo-fc"]),"fo-fc(+ve)":p("Fo-Fc(+ve)",(0,c.Q1)(3390259),t.f.IsoValue.relative(3),$.header.sampling[0].valuesInfo[1],H["fo-fc(+ve)"]),"fo-fc(-ve)":p("Fo-Fc(-ve)",(0,c.Q1)(12268339),t.f.IsoValue.relative(-3),$.header.sampling[0].valuesInfo[1],H["fo-fc(-ve)"])},{isFlat:!0})}}function w(V,U,N){return o.t.Select(Math.min(U,V.length-1),V.map((k,H)=>[H,`${H+1} [ ${0|Math.pow(k.maxVoxels,1/3)}^3 cells ]`]),{description:"Determines the maximum number of voxels. Depending on the size of the volume options are in the range from 1 (0.52M voxels) to 7 (25.17M voxels).",...N})}function Q(V){return{entry:{name:V.entry.name,params:{detailLevel:V.entry.params.detailLevel,channels:V.entry.params.channels,view:{name:V.entry.params.view.name,params:{...V.entry.params.view.params}}}}}}f.createParams=function T(V={}){const{data:U,defaultView:N,channelParams:k}=V,H=new Map;U&&U.entries.forEach(W=>H.set(W.dataId,W));const $=U?U.entries.map(W=>[W.dataId,W.dataId]):[];return{entry:o.t.Mapped(U?U.entries[0].dataId:"",$,W=>o.t.Group(L({entryData:H.get(W),defaultView:N,structure:U&&U.structure,channelParams:k})))}},f.createEntryParams=L,f.copyParams=Q,f.ViewTypeOptions=[["off","Off"],["box","Bounded Box"],["selection-box","Around Focus"],["camera-target","Around Camera"],["cell","Whole Structure"],["auto","Auto"]],f.ChannelTypeOptions=[["em","em"],["2fo-fc","2fo-fc"],["fo-fc(+ve)","fo-fc(+ve)"],["fo-fc(-ve)","fo-fc(-ve)"]],f.Behavior=class G extends i.A.WithSubscribers{get info(){return this.infoMap.get(this.params.entry.name)}queryData(U){var N=this;return(0,e.A)(function*(){let k=(0,b.r)(N.data.serverUrl,`${N.info.kind}/${N.info.dataId.toLowerCase()}`);if(U){const{min:ye,max:j}=U;k+=`/box/${ye.map(Z=>Math.round(1e3*Z)/1e3).join(",")}/${j.map(Z=>Math.round(1e3*Z)/1e3).join(",")}`}else k+="/cell";let H=N.params.entry.params.detailLevel;"auto"===N.params.entry.params.view.name&&N.params.entry.params.view.params.isSelection&&(H=N.params.entry.params.view.params.selectionDetailLevel),"camera-target"===N.params.entry.params.view.name&&U&&(H=N.decideDetail(U,N.params.entry.params.view.params.dynamicDetailLevel)),k+=`?detail=${H}`;const $=O.get(N.cache,k);if($)return $.data;const J=d.V.getUrlAsset(N.plugin.managers.asset,k),W=yield N.plugin.runTask(N.plugin.managers.asset.resolve(J,"binary")),te=yield N.parseCif(W.data);if(!te)return;const de=O.set(N.cache,k,{data:te,asset:W});return de&&de.asset.dispose(),te})()}parseCif(U){var N=this;return(0,e.A)(function*(){const k=yield N.plugin.runTask(_.f$.parseBinary(U));if(k.isError)return void N.plugin.log.error("VolumeStreaming, parsing CIF: "+k.toString());if(k.result.blocks.length<2)return void N.plugin.log.error("VolumeStreaming: Invalid data.");const H={};for(let $=1;${!r.O.Molecule.Structure.is(N.obj)||!m.iZ.Loci.is(this.lastLoci)||this.lastLoci.structure===N.obj.data&&(this.lastLoci=u.BL)}),this.subscribeObservable(this.plugin.state.events.object.updated,N=>{!r.O.Molecule.Structure.is(N.oldObj)||!m.iZ.Loci.is(this.lastLoci)||this.lastLoci.structure===N.oldObj.data&&(this.lastLoci=u.BL)}),this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current,N=>{if(!this.plugin.state.data.tree.children.has(this.ref))return;const k=N?N.loci:u.BL;switch(this.params.entry.params.view.name){case"auto":this.updateAuto(k);break;case"selection-box":this.updateSelectionBox(k);break;default:this.lastLoci=k}})}unregister(){let U=this.cache.entries.first;for(;U;)U.value.data.asset.dispose(),U=U.next}isCameraTargetSame(U,N){if(!U||!N)return!1;const k=y.eB.equals(U.target,N.target),H=y.eB.squaredDistance(U.target,U.position),$=y.eB.squaredDistance(N.target,N.position),J=Math.abs(H-$)/H<.001;return k&&J}cameraTargetDistance(U){return y.eB.distance(U.target,U.position)}getBoxFromLoci(U){var N,k,H;if(u.QN.isEmpty(U)||(0,u.$M)(U))return(0,A.DJ)();const $=this.plugin.helpers.substructureParent.get(U.structure,!0);if(!$)return(0,A.DJ)();const J=this.getStructureRoot();if(!J||(null===(N=J.obj)||void 0===N?void 0:N.data)!==(null===(k=$.obj)||void 0===k?void 0:k.data))return(0,A.DJ)();const W=s.T.get(null===(H=J.obj)||void 0===H?void 0:H.data.models[0]);W&&y.$I.invert(this._invTransform,W);const te=m.iZ.Loci.extendToWholeResidues(U),de=m.iZ.Loci.getBoundary(te,W&&!Number.isNaN(this._invTransform[0])?this._invTransform:void 0).box;return 1===m.iZ.Loci.size(te)&&A.DJ.expand(de,de,y.eB.create(1,1,1)),de}updateAuto(U){var N=this;this.updateQueue.enqueue((0,e.A)(function*(){N.lastLoci=U,(0,u.$M)(U)?yield N.updateParams("x-ray"===N.info.kind?N.data.structure.boundary.box:void 0,!1):yield N.updateParams(N.getBoxFromLoci(U),!0)}))}updateSelectionBox(U){var N=this;this.updateQueue.enqueue((0,e.A)(function*(){N.lastLoci=u.QN.areEqual(N.lastLoci,U)?u.BL:U;const k=N.getBoxFromLoci(N.lastLoci);yield N.updateParams(k)}))}updateCameraTarget(U){var N=this;this.updateQueue.enqueue((0,e.A)(function*(){var k,H,$;const J=null===(k=N.plugin.canvas3d)||void 0===k?void 0:k.props.camera.manualReset;try{J||null===(H=N.plugin.canvas3d)||void 0===H||H.setProps({camera:{manualReset:!0}});const W=N.boxFromCameraTarget(U,!0);yield N.updateParams(W)}finally{J||null===($=N.plugin.canvas3d)||void 0===$||$.setProps({camera:{manualReset:J}})}}))}boxFromCameraTarget(U,N){var k;const H=U.target,$=this.cameraTargetDistance(U);let W=Math.tan(.5*U.fov)*$;const te=null===(k=this.plugin.canvas3d)||void 0===k?void 0:k.camera.viewport;let ye,j,Z;if(te&&te.width>te.height&&(W*=te.width/te.height),W*="camera-target"===this.params.entry.params.view.name?this.params.entry.params.view.params.radius:.5,N){const q=y.eB.zero();A.DJ.size(q,this.data.structure.boundary.box),ye=Math.min(W,.5*q[0]),j=Math.min(W,.5*q[1]),Z=Math.min(W,.5*q[2])}else ye=j=Z=W;return A.DJ.create(y.eB.create(H[0]-ye,H[1]-j,H[2]-Z),y.eB.create(H[0]+ye,H[1]+j,H[2]+Z))}decideDetail(U,N){const k="x-ray"===this.info.kind?A.DJ.volume(this.data.structure.boundary.box):this.info.header.spacegroup.size.reduce((te,de)=>te*de,1);let $=A.DJ.volume(U)/k;const J=this.info.header.availablePrecisions.length-1;let W=N;for(;$<=.5&&WN.updateCameraTarget(te))),H=N.boxFromCameraTarget(N.plugin.canvas3d.camera.getSnapshot(),!0);break;case"cell":H="x-ray"===N.info.kind?N.data.structure.boundary.box:void 0;break;case"auto":if(H=U.entry.params.view.params.isSelection||"x-ray"===N.info.kind?A.DJ.create(y.eB.clone(U.entry.params.view.params.bottomLeft),y.eB.clone(U.entry.params.view.params.topRight)):void 0,H&&($=A.DJ.volume(H)<1e-4,U.entry.params.view.params.isSelection)){const te=U.entry.params.view.params.radius;A.DJ.expand(H,H,y.eB.create(te,te,te))}}const J=$?{}:yield N.queryData(H);if(!J)return!1;const W=U.entry.params.channels;return"x-ray"===N.info.kind?(N.channels["2fo-fc"]=N.createChannel(J["2FO-FC"]||t.f.One,W["2fo-fc"],N.info.header.sampling[0].valuesInfo[0]),N.channels["fo-fc(+ve)"]=N.createChannel(J["FO-FC"]||t.f.One,W["fo-fc(+ve)"],N.info.header.sampling[0].valuesInfo[1]),N.channels["fo-fc(-ve)"]=N.createChannel(J["FO-FC"]||t.f.One,W["fo-fc(-ve)"],N.info.header.sampling[0].valuesInfo[1])):N.channels.em=N.createChannel(J.EM||t.f.One,W.em,N.info.header.sampling[0].valuesInfo[0]),!0})()}createChannel(U,N,k){return{data:U,color:N.color,wireframe:N.wireframe,opacity:N.opacity,isoValue:"relative"===N.isoValue.kind?N.isoValue:t.f.IsoValue.toRelative(N.isoValue,k)}}getDescription(){return"selection-box"===this.params.entry.params.view.name?"Selection":"camera-target"===this.params.entry.params.view.name?"Camera":"box"===this.params.entry.params.view.name?"Static Box":"cell"===this.params.entry.params.view.name?"Cell":""}constructor(U,N){super(U,{}),this.plugin=U,this.data=N,this.cache=O.create(25),this.params={},this.lastLoci=u.BL,this.ref="",this.cameraTargetObservable=this.plugin.canvas3d.didDraw.pipe((0,C.c)(500,void 0,{leading:!0,trailing:!0}),(0,h.T)(()=>{var k;return null===(k=this.plugin.canvas3d)||void 0===k?void 0:k.camera.getSnapshot()}),(0,a.F)((k,H)=>this.isCameraTargetSame(k,H)),(0,S.p)(k=>void 0!==k)),this.cameraTargetSubscription=void 0,this.channels={},this._invTransform=(0,y.$I)(),this.infoMap=new Map,this.data.entries.forEach(k=>this.infoMap.set(k.dataId,k)),this.updateQueue=new D}}}(R||(R={}))},958:(tn,Ue,n)=>{"use strict";n.d(Ue,{Cd:()=>a,N$:()=>R,p3:()=>h});var t,e=n(467),o=n(381);class r extends(o.O.Create({name:"Volume Streaming",typeClass:"Object"})){}!function(E){let T;var L;(L=T=E.ValueType||(E.ValueType={})).Float32="float32",L.Int8="int8"}(t||(t={}));var A=n(8277),y=n(4824),c=n(5091),i=n(6853),v=n(1832),O=n(6570),b=n(6230),_=n(8010),M=n(3866),I=n(1930),l=n(5384),m=n(4369),u=n(237),d=n(9136),s=n(4811);function C(E,T,L,w){E.push({source:"em"===T?{name:"em",params:{isoValue:i.f.IsoValue.absolute(w||0)}}:{name:"x-ray",params:{}},dataId:L})}const h=v.KW.build({display:{name:"Volume Streaming"},from:o.O.Molecule.Structure,params(E,T){const L=(0,O.AR)(E&&E.data),w=(0,O.rO)(L,E&&E.data);return{method:A.t.Select(L,[["em","EM"],["x-ray","X-Ray"]]),entries:A.t.ObjectList({id:A.t.Text(w[0]||"")},({id:Q})=>Q,{defaultValue:w.map(Q=>({id:Q}))}),defaultView:A.t.Select("em"===L?"auto":"selection-box",b.h.ViewTypeOptions),options:A.t.Group({serverUrl:A.t.Text(T.config.get(u.AB.VolumeStreaming.DefaultServer)||"https://ds.litemol.org"),behaviorRef:A.t.Text("",{isHidden:!0}),emContourProvider:A.t.Select("emdb",[["emdb","EMDB"],["pdbe","PDBe"]],{isHidden:!0}),channelParams:A.t.Value({},{isHidden:!0})})}},isApplicable:(E,T,L)=>{const w=L.config.get(u.AB.VolumeStreaming.CanStream);return w?w(E.data,L):1===E.data.models.length&&d.Kx.probablyHasDensityMap(E.data.models[0])}})(({ref:E,state:T,params:L},w)=>y.YZ.create("Volume Streaming",function(){var Q=(0,e.A)(function*(G){const V=[];for(let J=0,W=L.entries.length;J0&&(yield w.managers.structure.hierarchy.remove(k?.toArray()));const H=N.cell.obj,$=T.build().to(U.ref).apply(R,A.t.getDefaultValues(b.h.createParams({data:H.data,defaultView:L.defaultView,channelParams:L.options.channelParams})),{ref:L.options.behaviorRef?L.options.behaviorRef:void 0});"em"===L.method?$.apply(f,{channel:"em"},{state:{isGhost:!0},tags:"em"}):($.apply(f,{channel:"2fo-fc"},{state:{isGhost:!0},tags:"2fo-fc"}),$.apply(f,{channel:"fo-fc(+ve)"},{state:{isGhost:!0},tags:"fo-fc(+ve)"}),$.apply(f,{channel:"fo-fc(-ve)"},{state:{isGhost:!0},tags:"fo-fc(-ve)"})),yield T.updateTree($).runInContext(G)});return function(G){return Q.apply(this,arguments)}}())),a=v.KW.build({display:{name:"Boxify Volume Streaming",description:"Make the current box permanent."},from:b.h,isApplicable:E=>"selection-box"===E.data.params.entry.params.view.name})(({a:E,ref:T,state:L},w)=>{const Q=E.data.params;if("selection-box"!==Q.entry.params.view.name)return;const G=l.DJ.create(m.eB.clone(Q.entry.params.view.params.bottomLeft),m.eB.clone(Q.entry.params.view.params.topRight)),V=Q.entry.params.view.params.radius;l.DJ.expand(G,G,m.eB.create(V,V,V));const U={...Q,entry:{name:Q.entry.name,params:{...Q.entry.params,view:{name:"box",params:{bottomLeft:G.min,topRight:G.max}}}}};return L.updateTree(L.build().to(T).update(U))}),S={dataId:A.t.Text(""),source:A.t.MappedStatic("x-ray",{em:A.t.Group({isoValue:i.f.createIsoValueParam(i.f.IsoValue.relative(1))}),"x-ray":A.t.Group({})})},D=o.H.BuiltIn({name:"create-volume-streaming-info",display:{name:"Volume Streaming Info"},from:o.O.Molecule.Structure,to:r,params:E=>({serverUrl:A.t.Text("https://ds.litemol.org"),entries:A.t.ObjectList(S,({dataId:T})=>T,{defaultValue:[{dataId:"",source:{name:"x-ray",params:{}}}]})})})({apply:({a:E,params:T},L)=>y.YZ.create("",function(){var w=(0,e.A)(function*(Q){const G=[];for(let U=0,N=T.entries.length;UU.dataId).join(", ")}`})});return function(Q){return w.apply(this,arguments)}}())}),R=o.H.BuiltIn({name:"create-volume-streaming-behavior",display:{name:"Volume Streaming Behavior"},from:r,to:b.h,params:E=>b.h.createParams({data:E&&E.data})})({canAutoUpdate:({oldParams:E,newParams:T})=>E.entry.params.view===T.entry.params.view||"selection-box"===T.entry.params.view.name||"camera-target"===T.entry.params.view.name||"off"===T.entry.params.view.name,apply:({a:E,params:T},L)=>y.YZ.create("Volume streaming",function(){var w=(0,e.A)(function*(Q){const G=new b.h.Behavior(L,E.data);return yield G.update(T),new b.h(G,{label:"Volume Streaming",description:G.getDescription()})});return function(Q){return w.apply(this,arguments)}}()),update:({b:T,oldParams:L,newParams:w})=>y.YZ.create("Update Volume Streaming",function(){var Q=(0,e.A)(function*(G){if(L.entry.name!==w.entry.name&&"em"in w.entry.params.channels){const{emDefaultContourLevel:U}=T.data.infoMap.get(w.entry.name);U&&(w.entry.params.channels.em.isoValue=U)}const V=(yield T.data.update(w))?v.xE.UpdateResult.Updated:v.xE.UpdateResult.Unchanged;return T.description=T.data.getDescription(),V});return function(G){return Q.apply(this,arguments)}}())}),f=o.H.BuiltIn({name:"create-volume-streaming-visual",display:{name:"Volume Streaming Visual"},from:b.h,to:o.O.Volume.Representation3D,params:{channel:A.t.Select("em",b.h.ChannelTypeOptions,{isHidden:!0})}})({apply:({a:E,params:T,spine:L},w)=>y.YZ.create("Volume Representation",function(){var Q=(0,e.A)(function*(G){var V,U;const N=E.data.channels[T.channel];if(!N)return v.BM.Null;const k=p(E.data,T.channel),H=M.H.BuiltIn.isosurface,$=k.type.params||{},J=H.factory({webgl:null===(V=w.canvas3d)||void 0===V?void 0:V.webgl,...w.representation.volume.themes},H.getParams);J.setTheme(I.S.create(w.representation.volume.themes,{volume:N.data},k));const W=null===(U=L.getAncestorOfType(o.O.Molecule.Structure))||void 0===U?void 0:U.data,te=0===W?.models.length?void 0:s.T.get(W?.models[0]);return yield J.createOrUpdate($,N.data).runInContext(G),te&&J.setState({transform:te}),new o.O.Volume.Representation3D({repr:J,sourceData:N.data},{label:`${Math.round(100*N.isoValue.relativeValue)/100} \u03c3 [${T.channel}]`})});return function(G){return Q.apply(this,arguments)}}()),update:({a:E,b:T,newParams:L},Q)=>y.YZ.create("Volume Representation",function(){var G=(0,e.A)(function*(V){const U=E.data.channels[L.channel];if(!U)return v.xE.UpdateResult.Unchanged;const N=T.data.repr.state.visible,k=p(E.data,L.channel),H={...T.data.repr.props,...k.type.params};return T.data.repr.setTheme(I.S.create(Q.representation.volume.themes,{volume:U.data},k)),yield T.data.repr.createOrUpdate(H,U.data).runInContext(V),T.data.repr.setState({visible:N}),T.data.sourceData=U.data,v.xE.UpdateResult.Updated});return function(V){return G.apply(this,arguments)}}())});function p(E,T){const L=E.channels[T];return _.VolumeRepresentation3DHelpers.getDefaultParamsStatic(E.plugin,"isosurface",{isoValue:L.isoValue,alpha:L.opacity,visuals:L.wireframe?["wireframe"]:["solid"]},"uniform",{value:L.color})}},6570:(tn,Ue,n)=>{"use strict";n.d(Ue,{$A:()=>b,AR:()=>A,lL:()=>v,rO:()=>i,t9:()=>u});var e=n(467),o=n(9136),r=n(2524),t=n(237);function A(s,C="x-ray"){if(!s)return C;const h=s.models[0];return r.K4.is(h.sourceData)?o.Kx.hasEmMap(h)?"em":o.Kx.hasXrayMap(h)?"x-ray":o.Kx.isFromEm(h)?"em":o.Kx.isFromXray(h)?"x-ray":C:C}function i(s,C){if(!C||!C.models.length)return[];const h=C.models[0];switch(s){case"em":return function y(s){const C=[];if(!r.K4.is(s.sourceData))return[s.entryId];const{db_id:h,db_name:a,content_type:S}=s.sourceData.data.db.pdbx_database_related;if(!a.isDefined)return[s.entryId];for(let D=0,R=a.rowCount;DE.primary))||void 0===D?void 0:D.level)&&void 0!==R?R:p[0].level:function l(s,C,h){return m.apply(this,arguments)}(s,C,h)}),I.apply(this,arguments)}function m(){return(m=(0,e.A)(function*(s,C,h){var a,S,D;h=h.toUpperCase();const R=yield s.fetch({url:`https://www.ebi.ac.uk/pdbe/api/emdb/entry/map/${h}`,type:"json"}).runInContext(C),f=R?.[h];let p;return void 0!==(null===(D=null===(S=null===(a=f?.[0])||void 0===a?void 0:a.map)||void 0===S?void 0:S.contour_level)||void 0===D?void 0:D.value)&&(p=+f[0].map.contour_level.value),p})).apply(this,arguments)}function u(s,C,h){return d.apply(this,arguments)}function d(){return(d=(0,e.A)(function*(s,C,h){var a;const S=yield s.fetch({url:`https://www.ebi.ac.uk/pdbe/api/pdb/entry/summary/${h}`,type:"json"}).runInContext(C),D=S?.[h],R=[];if(null===(a=D?.[0])||void 0===a||!a.related_structures)throw new Error(`No related EMDB entry found for '${h}'.`);{const f=D[0].related_structures.filter(p=>"EMDB"===p.resource&&"associated EM volume"===p.relationship);if(!f.length)throw new Error(`No related EMDB entry found for '${h}'.`);R.push(...f.map(p=>p.accession))}return R})).apply(this,arguments)}},1827:(tn,Ue,n)=>{"use strict";n.r(Ue),n.d(Ue,{ApplyAction:()=>m,ClearHighlights:()=>S,Highlight:()=>a,RemoveObject:()=>u,SetCurrentObject:()=>I,Snapshots:()=>D,SyncBehaviors:()=>M,ToggleExpanded:()=>d,ToggleVisibility:()=>s,Update:()=>l,registerDefault:()=>_,setSubtreeVisibility:()=>C});var e=n(467),o=n(9136),r=n(856),t=n(381),A=n(1832),i=n(2732),v=n(5091),O=n(6763),b=n(237);function _(R){M(R),I(R),l(R),m(R),u(R),d(R),s(R),a(R),S(R),D(R)}function M(R){R.state.events.object.created.subscribe(f=>{t.O.isBehavior(f.obj)&&f.obj.data.register(f.ref)}),R.state.events.object.removed.subscribe(f=>{var p,E,T,L;t.O.isBehavior(f.obj)&&(null===(E=(p=f.obj.data).unregister)||void 0===E||E.call(p),null===(L=(T=f.obj.data).dispose)||void 0===L||L.call(T))}),R.state.events.object.updated.subscribe(f=>{var p,E,T,L;"recreate"===f.action&&(f.oldObj&&t.O.isBehavior(f.oldObj)&&(null===(E=(p=f.oldObj.data).unregister)||void 0===E||E.call(p),null===(L=(T=f.oldObj.data).dispose)||void 0===L||L.call(T)),f.obj&&t.O.isBehavior(f.obj)&&f.obj.data.register(f.ref))})}function I(R){O.a.State.SetCurrentObject.subscribe(R,({state:f,ref:p})=>f.setCurrent(p))}function l(R){O.a.State.Update.subscribe(R,({state:f,tree:p,options:E})=>R.runTask(f.updateTree(p,E)))}function m(R){O.a.State.ApplyAction.subscribe(R,({state:f,action:p,ref:E})=>R.runTask(f.applyAction(p.action,p.params,E)))}function u(R){function f(p,E){const T=p.build().delete(E);return R.runTask(p.updateTree(T))}O.a.State.RemoveObject.subscribe(R,({state:p,ref:E,removeParentGhosts:T})=>{if(!T)return f(p,E);{const L=p.tree;let w=L.transforms.get(E);if(w.parent===E)return f(p,E);for(;;){const Q=L.children.get(w.parent);if(w.parent===w.ref||Q.size>1)return f(p,w.ref);const G=L.transforms.get(w.parent);if(!G.state.isGhost)return f(p,w.ref);w=G}}})}function d(R){O.a.State.ToggleExpanded.subscribe(R,({state:f,ref:p})=>f.updateCellState(p,({isCollapsed:E})=>({isCollapsed:!E})))}function s(R){O.a.State.ToggleVisibility.subscribe(R,({state:f,ref:p})=>C(f,p,!f.cells.get(p).state.isHidden))}function C(R,f,p){A.uF.doPreOrder(R.tree,R.transforms.get(f),{state:R,value:p},h)}function h(R,f,p){p.state.updateCellState(R.ref,{isHidden:p.value})}function a(R){O.a.Interactivity.Object.Highlight.subscribe(R,({state:f,ref:p})=>{if(!R.canvas3d||R.isBusy)return;R.managers.interactivity.lociHighlights.clearHighlights();const E="string"==typeof p?[p]:p;for(const T of E){const L=f.cells.get(T);if(L)if(t.O.Molecule.Structure.is(L.obj))R.managers.interactivity.lociHighlights.highlight({loci:o.oE.Loci(L.obj.data)},!1);else if(L&&t.O.isRepresentation3D(L.obj)){const{repr:w}=L.obj.data;for(const Q of w.getAllLoci())R.managers.interactivity.lociHighlights.highlight({loci:Q,repr:w},!1)}else if(t.O.Molecule.Structure.Selections.is(L.obj))for(const w of L.obj.data)R.managers.interactivity.lociHighlights.highlight({loci:w.loci},!1)}})}function S(R){O.a.Interactivity.ClearHighlights.subscribe(R,()=>{R.managers.interactivity.lociHighlights.clearHighlights()})}function D(R){R.config.set(b.AB.State.CurrentServer,R.config.get(b.AB.State.DefaultServer)),O.a.State.Snapshots.Clear.subscribe(R,()=>{R.managers.snapshot.clear()}),O.a.State.Snapshots.Remove.subscribe(R,({id:f})=>{R.managers.snapshot.remove(f)}),O.a.State.Snapshots.Add.subscribe(R,function(){var f=(0,e.A)(function*({key:p,name:E,description:T,params:L}){var w;const Q=R.state.getSnapshot(L),G=(null!==(w=L?.image)&&void 0!==w?w:R.state.snapshotParams.value.image)?yield r.g.getCanvasImageAsset(R,`${Q.id}-image.png`):void 0,V=r.g.Entry(Q,{key:p,name:E,description:T,image:G});R.managers.snapshot.add(V)});return function(p){return f.apply(this,arguments)}}()),O.a.State.Snapshots.Replace.subscribe(R,function(){var f=(0,e.A)(function*({id:p,params:E}){var T;const L=R.state.getSnapshot(E),w=(null!==(T=E?.image)&&void 0!==T?T:R.state.snapshotParams.value.image)?yield r.g.getCanvasImageAsset(R,`${L.id}-image.png`):void 0;R.managers.snapshot.replace(p,R.state.getSnapshot(E),{image:w})});return function(p){return f.apply(this,arguments)}}()),O.a.State.Snapshots.Move.subscribe(R,({id:f,dir:p})=>{R.managers.snapshot.move(f,p)}),O.a.State.Snapshots.Apply.subscribe(R,({id:f})=>{const p=R.managers.snapshot.setCurrent(f);if(p)return R.state.setSnapshot(p)}),O.a.State.Snapshots.Upload.subscribe(R,function(){var f=(0,e.A)(function*({name:p,description:E,playOnLoad:T,serverUrl:L}){return fetch((0,v.r)(L,`set?name=${encodeURIComponent(p||"")}&description=${encodeURIComponent(E||"")}`),{method:"POST",mode:"cors",referrer:"no-referrer",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(yield R.managers.snapshot.getStateSnapshot({name:p,description:E,playOnLoad:T}))})});return function(p){return f.apply(this,arguments)}}()),O.a.State.Snapshots.Fetch.subscribe(R,function(){var f=(0,e.A)(function*({url:p}){const E=yield R.runTask(R.fetch({url:p,type:"json"}));yield R.managers.snapshot.setStateSnapshot(E.data)});return function(p){return f.apply(this,arguments)}}()),O.a.State.Snapshots.DownloadToFile.subscribe(R,function(){var f=(0,e.A)(function*({name:p,type:E,params:T}){const L=`mol-star_state_${p||function c(){const R=new Date;return R.getFullYear()+"-"+(R.getMonth()+1)+"-"+R.getDate()+"-"+R.getHours()+"-"+R.getMinutes()+"-"+R.getSeconds()}()}.${"json"===E?"molj":"molx"}`,w=yield R.managers.snapshot.serialize({type:E,params:T});(0,i.R)(w,`${L}`)});return function(p){return f.apply(this,arguments)}}()),O.a.State.Snapshots.OpenFile.subscribe(R,({file:f})=>R.managers.snapshot.open(f)),O.a.State.Snapshots.OpenUrl.subscribe(R,function(){var f=(0,e.A)(function*({url:p,type:E}){const T=yield R.runTask(R.fetch({url:p,type:"binary"}));return R.managers.snapshot.open(new File([T],`state.${E}`))});return function(p){return f.apply(this,arguments)}}())}},6852:(tn,Ue,n)=>{"use strict";n.d(Ue,{K:()=>t,j:()=>r});var e=n(467),o=n(9909);function r(){const A=(y,c)=>y.commands.dispatch(A,c||{});return A.subscribe=(y,c)=>y.commands.subscribe(A,c),A.id=o.kk.create22(),A}class t{constructor(){this.subs=new Map,this.disposing=!1}subscribe(y,c){let i=this.subs.get(y.id);return i||(i=[],this.subs.set(y.id,i)),i.push(c),{unsubscribe:()=>{const v=this.subs.get(y.id);if(!v)return;const O=v.indexOf(c);if(!(O<0)){for(let b=O+1;b{this.disposing?v("disposed"):this.subs.get(y.id)?this.resolve({cmd:y,params:c,resolve:i,reject:v}):i()})}dispose(){this.subs.clear()}resolve(y){var c=this;return(0,e.A)(function*(){const i=c.subs.get(y.cmd.id);if(i)try{for(const v of i)yield v(y.params);y.resolve()}catch(v){y.reject(v)}else y.resolve()})()}}},6763:(tn,Ue,n)=>{"use strict";n.d(Ue,{a:()=>o});var e=n(6852);const o={State:{SetCurrentObject:(0,e.j)(),ApplyAction:(0,e.j)(),Update:(0,e.j)(),RemoveObject:(0,e.j)(),ToggleExpanded:(0,e.j)(),ToggleVisibility:(0,e.j)(),Snapshots:{Add:(0,e.j)(),Replace:(0,e.j)(),Move:(0,e.j)(),Remove:(0,e.j)(),Apply:(0,e.j)(),Clear:(0,e.j)(),Upload:(0,e.j)(),Fetch:(0,e.j)(),DownloadToFile:(0,e.j)(),OpenFile:(0,e.j)(),OpenUrl:(0,e.j)()}},Interactivity:{Object:{Highlight:(0,e.j)()},Structure:{Highlight:(0,e.j)(),Select:(0,e.j)()},ClearHighlights:(0,e.j)()},Layout:{Update:(0,e.j)()},Toast:{Show:(0,e.j)(),Hide:(0,e.j)()},Camera:{Reset:(0,e.j)(),SetSnapshot:(0,e.j)(),Focus:(0,e.j)(),OrientAxes:(0,e.j)(),ResetAxes:(0,e.j)()},Canvas3D:{SetSettings:(0,e.j)(),ResetSettings:(0,e.j)()}}},237:(tn,Ue,n)=>{"use strict";n.d(Ue,{AB:()=>A,tf:()=>y});var e=n(9136);const o={get preferWebGl1(){if(typeof navigator>"u"||typeof window>"u")return!1;if(["Version/15.1 Safari","Version/15.2 Safari","Version/15.3 Safari"].some(b=>navigator.userAgent.indexOf(b)>0))return!0;const i=/iPad|iPhone|iPod/.test(navigator.userAgent),v=navigator.userAgent.includes("Macintosh"),O=navigator.maxTouchPoints>=4;return!window.MSStream&&(i||v&&O)}};class r{toString(){return this.key}valueOf(){return this.key}constructor(i,v){this.key=i,this.defaultValue=v}}function t(c,i){return new r(c,i)}const A={item:t,General:{IsBusyTimeoutMs:t("plugin-config.is-busy-timeout",750),DisableAntialiasing:t("plugin-config.disable-antialiasing",!1),DisablePreserveDrawingBuffer:t("plugin-config.disable-preserve-drawing-buffer",!1),PixelScale:t("plugin-config.pixel-scale",1),PickScale:t("plugin-config.pick-scale",.25),Transparency:t("plugin-config.transparency","wboit"),PreferWebGl1:t("plugin-config.prefer-webgl1",o.preferWebGl1),AllowMajorPerformanceCaveat:t("plugin-config.allow-major-performance-caveat",!1),PowerPreference:t("plugin-config.power-preference","high-performance")},State:{DefaultServer:t("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),CurrentServer:t("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),HistoryCapacity:t("history-capacity.server",5)},VolumeStreaming:{Enabled:t("volume-streaming.enabled",!0),DefaultServer:t("volume-streaming.server","https://ds.litemol.org"),CanStream:t("volume-streaming.can-stream",(c,i)=>1===c.models.length&&e.Kx.probablyHasDensityMap(c.models[0])),EmdbHeaderServer:t("volume-streaming.emdb-header-server","https://files.wwpdb.org/pub/emdb/structures")},Viewport:{ShowExpand:t("viewer.show-expand-button",!0),ShowControls:t("viewer.show-controls-button",!0),ShowSettings:t("viewer.show-settings-button",!0),ShowSelectionMode:t("viewer.show-selection-model-button",!0),ShowAnimation:t("viewer.show-animation-button",!0),ShowTrajectoryControls:t("viewer.show-trajectory-controls",!0)},Download:{DefaultPdbProvider:t("download.default-pdb-provider","pdbe"),DefaultEmdbProvider:t("download.default-emdb-provider","pdbe")},Structure:{SizeThresholds:t("structure.size-thresholds",e.oE.DefaultSizeThresholds),DefaultRepresentationPreset:t("structure.default-representation-preset","auto"),DefaultRepresentationPresetParams:t("structure.default-representation-preset-params",{}),SaccharideCompIdMapType:t("structure.saccharide-comp-id-map-type","default")},Background:{Styles:t("background.styles",[])}};class y{get(i){return this._config.has(i)?this._config.get(i):i.defaultValue}set(i,v){this._config.set(i,v)}delete(i){this._config.delete(i)}constructor(i){this._config=new Map,i&&i.forEach(([v,O])=>this._config.set(v,O))}}},2768:(tn,Ue,n)=>{"use strict";n.d(Ue,{p:()=>M});var I,e=n(467),o=n(1832),r=n(381),t=n(4987),A=n(3177),y=n(6763),c=n(8277),i=n(9909),v=n(1025),O=n(7786),b=n(3182),_=n(237);class M extends b.N{get animation(){return this.plugin.managers.animation}getSnapshot(l){var m,u,d;const s={...this.snapshotParams.value,...l};return{id:i.kk.create22(),data:s.data?this.data.getSnapshot():void 0,behaviour:s.behavior?this.behaviors.getSnapshot():void 0,animation:s.animation?this.animation.getSnapshot():void 0,startAnimation:s.startAnimation?!!s.startAnimation:void 0,camera:s.camera?{current:this.plugin.canvas3d.camera.getSnapshot(),transitionStyle:s.cameraTransition.name,transitionDurationInMs:"animate"===(null===(m=s?.cameraTransition)||void 0===m?void 0:m.name)?s.cameraTransition.params.durationInMs:void 0}:void 0,canvas3dContext:s.canvas3dContext?{props:null===(u=this.plugin.canvas3dContext)||void 0===u?void 0:u.props}:void 0,canvas3d:s.canvas3d?{props:null===(d=this.plugin.canvas3d)||void 0===d?void 0:d.props}:void 0,interactivity:s.interactivity?{props:this.plugin.managers.interactivity.props}:void 0,structureFocus:this.plugin.managers.structure.focus.getSnapshot(),structureSelection:s.structureSelection?this.plugin.managers.structure.selection.getSnapshot():void 0,structureComponentManager:s.componentManager?{options:this.plugin.managers.structure.component.state.options}:void 0,durationInMs:s?.durationInMs}}setSnapshot(l){var m=this;return(0,e.A)(function*(){var u,d,s,C,h;if(yield m.animation.stop(),!(null===(u=l.structureComponentManager)||void 0===u)&&u.options&&m.plugin.managers.structure.component._setSnapshotState(null===(d=l.structureComponentManager)||void 0===d?void 0:d.options),l.behaviour&&(yield m.plugin.runTask(m.behaviors.setSnapshot(l.behaviour))),l.data&&(yield m.plugin.runTask(m.data.setSnapshot(l.data))),null!==(s=l.canvas3d)&&void 0!==s&&s.props){const a=c.t.normalizeParams(A._i,l.canvas3d.props,"children");yield y.a.Canvas3D.SetSettings(m.plugin,{settings:a})}if(null!==(C=l.canvas3dContext)&&void 0!==C&&C.props){const a=c.t.normalizeParams(A.H7.Params,l.canvas3dContext.props,"children");null===(h=m.plugin.canvas3dContext)||void 0===h||h.setProps(a)}l.interactivity&&l.interactivity.props&&m.plugin.managers.interactivity.setProps(l.interactivity.props),l.structureFocus&&m.plugin.managers.structure.focus.setSnapshot(l.structureFocus),l.structureSelection&&m.plugin.managers.structure.selection.setSnapshot(l.structureSelection),l.animation&&m.animation.setSnapshot(l.animation),l.camera&&y.a.Camera.Reset(m.plugin,{snapshot:l.camera.current,durationMs:"animate"===l.camera.transitionStyle?l.camera.transitionDurationInMs:void 0}),l.startAnimation&&m.animation.start()})()}updateTransform(l,m,u,d){const s=l.build().to(m).update(u);return y.a.State.Update(this.plugin,{state:l,tree:s,options:{canUndo:d}})}hasBehavior(l){return this.behaviors.tree.transforms.has(l.id)}updateBehavior(l,m){const u=this.behaviors.build();if(this.behaviors.tree.transforms.has(l.id))u.to(l.id).update(m);else{const d=l.createDefaultParams(void 0,this.plugin);u.to(t.AF.getCategoryId(l)).apply(l,(0,v.jM)(d,m),{ref:l.id})}return this.plugin.runTask(this.behaviors.updateTree(u))}dispose(){this.behaviors.cells.forEach(l=>{var m,u,d,s;t.AF.Behavior.is(l.obj)&&(null===(u=(m=l.obj.data).unregister)||void 0===u||u.call(m),null===(s=(d=l.obj.data).dispose)||void 0===s||s.call(d))}),super.dispose(),this.data.dispose(),this.behaviors.dispose(),this.animation.dispose()}constructor(l){super(),this.plugin=l,this.data=o.Uw.create(new r.O.Root({}),{runTask:this.plugin.runTask,globalContext:this.plugin,historyCapacity:this.plugin.config.get(_.AB.State.HistoryCapacity)}),this.behaviors=o.Uw.create(new t.AF.Root({}),{runTask:this.plugin.runTask,globalContext:this.plugin,rootState:{isLocked:!0}}),this.events={cell:{stateUpdated:(0,O.h)(this.data.events.cell.stateUpdated,this.behaviors.events.cell.stateUpdated),created:(0,O.h)(this.data.events.cell.created,this.behaviors.events.cell.created),removed:(0,O.h)(this.data.events.cell.removed,this.behaviors.events.cell.removed)},object:{created:(0,O.h)(this.data.events.object.created,this.behaviors.events.object.created),removed:(0,O.h)(this.data.events.object.removed,this.behaviors.events.object.removed),updated:(0,O.h)(this.data.events.object.updated,this.behaviors.events.object.updated)}},this.snapshotParams=this.ev.behavior(M.DefaultSnapshotParams),this.setSnapshotParams=m=>{this.snapshotParams.next({...M.DefaultSnapshotParams,...m})}}}(I=M||(M={})).SnapshotParams={durationInMs:c.t.Numeric(1500,{min:100,max:15e3,step:100},{label:"Duration in ms"}),data:c.t.Boolean(!0),behavior:c.t.Boolean(!1),structureSelection:c.t.Boolean(!1),componentManager:c.t.Boolean(!0),animation:c.t.Boolean(!0),startAnimation:c.t.Boolean(!1),canvas3d:c.t.Boolean(!0),canvas3dContext:c.t.Boolean(!0),interactivity:c.t.Boolean(!0),camera:c.t.Boolean(!0),cameraTransition:c.t.MappedStatic("animate",{animate:c.t.Group({durationInMs:c.t.Numeric(250,{min:100,max:5e3,step:500},{label:"Duration in ms"})}),instant:c.t.Group({})},{options:[["animate","Animate"],["instant","Instant"]]}),image:c.t.Boolean(!1)},I.DefaultSnapshotParams=c.t.getDefaultValues(I.SnapshotParams)},6101:(tn,Ue,n)=>{"use strict";n.d(Ue,{j:()=>e,s:()=>o});var e="4.3.0",o=new Date(typeof __MOLSTAR_DEBUG_TIMESTAMP__<"u"?__MOLSTAR_DEBUG_TIMESTAMP__:1716707835175)},2443:(tn,Ue,n)=>{"use strict";n.d(Ue,{YL:()=>R,lN:()=>D});var h,e=n(467),o=n(8277),r=n(274),t=n(2832),A=n(1930),y=n(1413),c=n(4824),i=n(6825),v=n(3246),O=n(261),b=n(1965),_=n(4369),M=n(5589),I=n(5019),l=n(5117),m=n(7981),u=n(9986),d=n(8382),s=n(9213),C=n(3488);(h||(h={})).getDetaultParams=function p(E,T,L){return o.t.getDefaultValues(E.getParams(T,L))};const a={name:"",label:"",description:"",factory:()=>R.Empty,getParams:()=>({}),defaultValues:{},defaultColorTheme:r.J.EmptyProvider,defaultSizeTheme:t.F.EmptyProvider,isApplicable:()=>!0};function S(f){return f.map(p=>[p.name,p.provider.label])}class D{get default(){return this._list[0]}get types(){return S(this._list)}constructor(){this._list=[],this._map=new Map,this._name=new Map}add(p){if(this._map.has(p.name))throw new Error(`${p.name} already registered.`);this._list.push({name:p.name,provider:p}),this._map.set(p.name,p),this._name.set(p,p.name)}getName(p){if(!this._name.has(p))throw new Error(`'${p.label}' is not a registered represenatation provider.`);return this._name.get(p)}remove(p){const E=p.name;this._list.splice(this._list.findIndex(L=>L.name===E),1);const T=this._map.get(E);T&&(this._map.delete(E),this._name.delete(T))}get(p){return this._map.get(p)||a}get list(){return this._list}getApplicableList(p){return this._list.filter(E=>E.provider.isApplicable(p))}getApplicableTypes(p){return S(this.getApplicableList(p))}clear(){this._list.length=0,this._map.clear(),this._name.clear()}}var R;!function(f){let p;var G;function E(){return{visible:!0,alphaFactor:1,pickable:!0,colorOnly:!1,syncManually:!1,transform:_.$I.identity(),overpaint:O.l.Empty,transparency:b.x.Empty,emissive:C.a.Empty,substance:s.l.Empty,clipping:m.l.Empty,themeStrength:{overpaint:1,transparency:1,emissive:1,substance:1},markerActions:i.sY.All}}function T(G,V){void 0!==V.visible&&(G.visible=V.visible),void 0!==V.alphaFactor&&(G.alphaFactor=V.alphaFactor),void 0!==V.pickable&&(G.pickable=V.pickable),void 0!==V.colorOnly&&(G.colorOnly=V.colorOnly),void 0!==V.overpaint&&(G.overpaint=V.overpaint),void 0!==V.transparency&&(G.transparency=V.transparency),void 0!==V.emissive&&(G.emissive=V.emissive),void 0!==V.substance&&(G.substance=V.substance),void 0!==V.clipping&&(G.clipping=V.clipping),void 0!==V.themeStrength&&(G.themeStrength=V.themeStrength),void 0!==V.syncManually&&(G.syncManually=V.syncManually),void 0!==V.transform&&_.$I.copy(G.transform,V.transform),void 0!==V.markerActions&&(G.markerActions=V.markerActions)}(G=p=f.Loci||(f.Loci={})).areEqual=function V(N,k){return N.repr===k.repr&&v.QN.areEqual(N.loci,k.loci)},G.isEmpty=function U(N){return v.QN.isEmpty(N.loci)},G.Empty={loci:v.BL},f.createState=E,f.updateState=T,f.StateBuilder={create:E,update:T},f.Empty={label:"",groupCount:0,renderObjects:[],geometryVersion:-1,props:{},params:{},updated:new y.B,state:E(),theme:A.S.createEmpty(),createOrUpdate:()=>c.YZ.constant("",void 0),setState:()=>{},setTheme:()=>{},getLoci:()=>v.BL,getAllLoci:()=>[],eachLocation:()=>{},mark:()=>!1,destroy:()=>{}};class L{constructor(){this.curr=new Set,this.next=new Set,this._version=-1}get version(){return this._version}add(V,U){this.next.add((0,d.m1)(V,U))}snapshot(){u.M.areEqual(this.curr,this.next)||(this._version+=1),[this.curr,this.next]=[this.next,this.curr],this.next.clear()}}f.GeometryState=L,f.createMulti=function w(G,V,U,N,k){let H=0;const $=new y.B,J=new L,W=N.create();let de,ye,j,te=A.S.createEmpty();const Z={},q=Object.keys(k).map((Y,ee)=>{Z[ee]=Y;const g=k[Y](V,U);return g.setState(W),g});return{label:G,updated:$,get groupCount(){let Y=0;if(ye){const{visuals:ee}=ye;for(let g=0,_e=q.length;g<_e;++g)(!ee||ee.includes(Z[g]))&&(Y+=q[g].groupCount)}return Y},get renderObjects(){const Y=[];if(ye){const{visuals:ee}=ye;for(let g=0,_e=q.length;g<_e;++g)(!ee||ee.includes(Z[g]))&&Y.push(...q[g].renderObjects)}return Y},get geometryVersion(){return J.version},get props(){return ye},get params(){return de},createOrUpdate:(Y={},ee)=>{ee&&ee!==j&&(de=U(V,ee),j=ee,ye||(ye=o.t.getDefaultValues(de)));const g=(0,M.m$)(Object.assign({},ye,Y),j);Object.assign(ye,Y,g);const{visuals:_e}=ye;return c.YZ.create(`Creating or updating '${G}' representation`,function(){var xe=(0,e.A)(function*(le){for(let Ae=0,Be=q.length;Ae{const{visuals:ee}=ye;for(let g=0,_e=q.length;g<_e;++g)if(!ee||ee.includes(Z[g])){const xe=q[g].getLoci(Y);if(!(0,v.$M)(xe))return xe}return v.BL},getAllLoci:()=>{const Y=[],{visuals:ee}=ye;for(let g=0,_e=q.length;g<_e;++g)(!ee||ee.includes(Z[g]))&&Y.push(...q[g].getAllLoci());return Y},eachLocation:Y=>{const{visuals:ee}=ye;for(let g=0,_e=q.length;g<_e;++g)(!ee||ee.includes(Z[g]))&&q[g].eachLocation(Y)},mark:(Y,ee)=>{let g=!1;for(let _e=0,xe=q.length;_e{N.update(W,Y);for(let ee=0,g=q.length;ee{te=Y;for(let ee=0,g=q.length;ee{const de=(0,M.m$)(Object.assign({},W,te));return Object.assign(W,te,de),c.YZ.create(`Updating '${G}' representation`,function(){var ye=(0,e.A)(function*(j){k.add(0,V.id),k.snapshot(),N.next(U++)});return function(j){return ye.apply(this,arguments)}}())},get state(){return H},get theme(){return $},getLoci:()=>v.BL,getAllLoci:()=>[],eachLocation:()=>{},mark:(te,de)=>!1,setState:te=>{void 0!==te.visible&&l.b.setVisibility(V,te.visible),void 0!==te.alphaFactor&&l.b.setAlphaFactor(V,te.alphaFactor),void 0!==te.pickable&&l.b.setPickable(V,te.pickable),void 0!==te.colorOnly&&l.b.setColorOnly(V,te.colorOnly),void 0!==te.themeStrength&&l.b.setThemeStrength(V,te.themeStrength),void 0!==te.transform&&l.b.setTransform(V,te.transform),f.updateState(H,te)},setTheme:()=>{},destroy(){}}}}(R||(R={}))},6600:(tn,Ue,n)=>{"use strict";n.d(Ue,{$:()=>A,w:()=>t});var e=n(8277),o=n(2745),r=n(4255);const t={customText:e.t.Text("",{label:"Text",description:"Override the label with custom value.",isEssential:!0}),textColor:e.t.Color(o.s.black,{isEssential:!0}),textSize:e.t.Numeric(.5,{min:.1,max:10,step:.1},{isEssential:!0})},A={...r.E.Params,...t,borderWidth:e.t.Numeric(.2,{min:0,max:.5,step:.01})}},1137:(tn,Ue,n)=>{"use strict";n.d(Ue,{K:()=>u});var e=n(467),o=n(8277),r=n(1758),t=n(2443),A=n(9136),y=n(1413),c=n(8353),i=n(1930),v=n(4824),O=n(3246),b=n(6825),_=n(261),M=n(7981),I=n(1965),l=n(9213),m=n(3488);function u(d,s,C,h){let a=0;const{webgl:S}=s,D=new y.B,R=new t.YL.GeometryState,f=(0,c.Q0)(),p=[],E=r.J1.create();let T,L,w,Q,G=i.S.createEmpty();function $(te){if(r.J1.update(E,te),void 0!==te.visible&&T&&T.setVisibility(te.visible&&(null===E.unitTransforms||E.unitTransforms.isIdentity)),void 0!==te.alphaFactor&&T&&T.setAlphaFactor(te.alphaFactor),void 0!==te.pickable&&T&&T.setPickable(te.pickable),void 0!==te.overpaint&&T){const de=_.l.remap(te.overpaint,L);T.setOverpaint(de,S)}if(void 0!==te.transparency&&T){const de=I.x.remap(te.transparency,L);T.setTransparency(de,S)}if(void 0!==te.emissive&&T){const de=m.a.remap(te.emissive,L);T.setEmissive(de,S)}if(void 0!==te.substance&&T){const de=l.l.remap(te.substance,L);T.setSubstance(de,S)}if(void 0!==te.clipping&&T){const de=M.l.remap(te.clipping,L);T.setClipping(de)}void 0!==te.themeStrength&&T&&T.setThemeStrength(te.themeStrength),void 0!==te.transform&&T&&T.setTransform(te.transform),void 0!==te.unitTransforms&&T&&T.setVisibility(E.visible&&(null===te.unitTransforms||te.unitTransforms.isIdentity))}return{label:d,get groupCount(){return T?T.groupCount:0},get props(){return Q},get params(){return w},get state(){return E},get theme(){return G},get geometryVersion(){return R.version},renderObjects:p,updated:D,createOrUpdate:function V(te={},de){return de&&de!==L&&(w=C(s,de),L=de,Q||(Q=o.t.getDefaultValues(w))),Q=Object.assign({},Q,te),v.YZ.create("Creating or updating ComplexRepresentation",function(){var ye=(0,e.A)(function*(j){var Z;let q=!1;T?null!==(Z=T.mustRecreate)&&void 0!==Z&&Z.call(T,L,Q,S)&&(T.destroy(),T=h(f,L,Q,S),q=!0):(T=h(f,L,Q,S),q=!0);const Y=T.createOrUpdate({webgl:S,runtime:j},G,Q,de);Y&&(yield Y),q&&$(E),p.length=0,T&&T.renderObject&&(p.push(T.renderObject),R.add(T.renderObject.id,T.geometryVersion)),R.snapshot(),a+=1,D.next(a)});return function(j){return ye.apply(this,arguments)}}())},setState:$,setTheme:function J(te){G=te},getLoci:function U(te){return T?T.getLoci(te):O.BL},getAllLoci:function N(){var te;return[A.oE.Loci(null!==(te=L.child)&&void 0!==te?te:L)]},eachLocation:function k(te){T?.eachLocation(te)},mark:function H(te,de){if(!L||!b.sY.is(E.markerActions,de))return!1;if(A.oE.isLoci(te)||A.iZ.Loci.is(te)||A.gn.isLoci(te)){if(!A.oE.areRootsEquivalent(te.structure,L))return!1;te=O.QN.remap(te,L),(A.oE.isLoci(te)||A.iZ.Loci.is(te)&&A.iZ.Loci.isWholeStructure(te))&&(te=O.FE)}else if(!(0,O.xc)(te)&&!(0,O.e4)(te))return!1;return!O.QN.isEmpty(te)&&!!T&&T.mark(te,de)},destroy:function W(){T&&T.destroy()}}}},3892:(tn,Ue,n)=>{"use strict";n.d(Ue,{EN:()=>E,Go:()=>k,Hj:()=>J,I:()=>H,KE:()=>Q,T9:()=>L,UM:()=>G,YD:()=>V,Yl:()=>$,hJ:()=>W,ip:()=>N,wA:()=>T,yd:()=>U,zo:()=>w});var e=n(5117),o=n(9136),r=n(542),t=n(1930),A=n(3596),y=n(8353),c=n(3246),i=n(3543),v=n(5589),O=n(274),b=n(9909),_=n(7684),M=n(2712),I=n(6825),l=n(9283),m=n(283),u=n(5315),d=n(4255),s=n(2832),C=n(9928),h=n(8013),a=n(5201),S=n(799),D=n(1372),R=n(8231);function p(te,de){const{defaultProps:ye,createGeometry:j,createLocationIterator:Z,getLoci:q,eachLocation:Y,setUpdateState:ee,mustRecreate:g,processValues:_e,dispose:xe}=te,{updateValues:le,updateBoundingSphere:Ae,updateRenderableState:Be,createPositionIterator:Ce}=te.geometryUtils,Re=v.rj.create(),ke={loci:c.BL,action:I.xi.None,status:-1};let we,Oe,Se,Ve,ne,be,ie,ue,Ne=Object.assign({},ye),K=t.S.createEmpty(),Te=-1;function ve(Ie){if(Re.createNew){if(ie=Z(Ve,Oe),!Ie)throw new Error("expected geometry to be given");we=function f(te,de,ye,j,Z,q){const{createValues:Y,createRenderableState:ee}=r.V.getUtils(de),_e=Y(de,(0,A.Zk)(),ye,j,Z),xe=ee(Z);return(0,y.o)(de.kind,_e,xe,q)}(0,Ie,ie,Se,Oe,de),ue=Ce(Ie,we.values)}else{if(!we)throw new Error("expected renderObject to be available");if(Re.updateTransform){ie=Z(Ve,Oe);const{instanceCount:Le,groupCount:nt}=ie;Oe.instanceGranularity?(0,h.Km)(Le,"instance",we.values):(0,h.Km)(Le*nt,"groupInstance",we.values)}if(Re.createGeometry){if(!Ie)throw new Error("expected geometry to be given");b.IQ.updateIfChanged(we.values.drawCount,r.V.getDrawCount(Ie)),b.IQ.updateIfChanged(we.values.uVertexCount,r.V.getVertexCount(Ie)),b.IQ.updateIfChanged(we.values.uGroupCount,r.V.getGroupCount(Ie))}(Re.updateTransform||Re.createGeometry)&&(Ae(we.values,Ie||be),ue=Ce(be,we.values)),Re.updateSize&&"uSize"in we.values&&(0,_.v3)(ie,Se.size,we.values),Re.updateColor&&(0,M.D1)(ie,ue,Se.color,we.values),le(we.values,Oe),Be(we.state,Oe)}Ne=Oe,K=Se,ne=Ve,Ie&&(be=Ie,Te+=1)}function ae(Ie,Le,nt){return function ce(Ie){return!!((0,c.xc)(Ie)||o.oE.isLoci(Ie)&&o.oE.areRootsEquivalent(Ie.structure,ne)||o.iZ.Loci.is(Ie)&&o.oE.areRootsEquivalent(Ie.structure,ne)&&o.iZ.Loci.isWholeStructure(Ie))}(Ie)?Le(i.IX.ofBounds(0,Ne.instanceGranularity?ie.instanceCount:ie.groupCount*ie.instanceCount)):Ne.instanceGranularity?function se(Ie,Le,nt){let je=!1;return!(!o.iZ.Loci.is(Ie)&&!o.gn.isLoci(Ie)||!o.oE.areEquivalent(Ie.structure,Le))&&(nt(i.IX.ofSingleton(0))&&(je=!0),je)}(Ie,ne,Le):Y(Ie,ne,Le,nt)}function ge(Ie){we&&_e?.(we.values,be,Ne,K,Ie.webgl)}return{get groupCount(){return ie?ie.count:0},get renderObject(){return ie&&ie.count?we:void 0},get geometryVersion(){return Te},createOrUpdate(Ie,Le,nt={},je){if(function re(Ie,Le,nt){if(!nt&&!ne)throw new Error("missing structure");if(Oe=Object.assign({},Ne,Le),Se=Ie,Ve=nt,v.rj.reset(Re),!we||!ne)return Re.createNew=!0,void(Re.createGeometry=!0);ee(Re,Oe,Ne,Se,K,Ve,ne),o.oE.areEquivalent(Ve,ne)||(Re.createGeometry=!0),o.oE.areHierarchiesEqual(Ve,ne)||(Re.updateTransform=!0,Re.createGeometry=!0),O.J.areEqual(Ie.color,K.color)||(Re.updateColor=!0),(0,b.bD)(Oe.unitKinds,Ne.unitKinds)||(Re.createGeometry=!0),ne.child!==Ve.child&&(Re.createGeometry=!0),Oe.instanceGranularity!==Ne.instanceGranularity&&(Re.updateTransform=!0),Re.updateSize&&!("uSize"in we.values)&&(Re.createGeometry=!0),Re.createGeometry&&(Re.updateColor=!0,Re.updateSize=!0)}(Le,nt,je||ne),Re.createGeometry){const Lt=j(Ie,Ve,Se,Oe,be);if((0,D.$X)(Lt))return Lt.then(Je=>{ve(Je),ge(Ie)});ve(Lt)}else ve();ge(Ie)},getLoci:Ie=>we?q(Ie,ne,we.id):c.BL,eachLocation(Ie){for(ie.reset();ie.hasNext;){const{location:Le,isSecondary:nt}=ie.move();Ie(Le,nt)}},mark:(Ie,Le)=>e.b.mark(we,Ie,Le,ae,ke),setVisibility(Ie){e.b.setVisibility(we,Ie)},setAlphaFactor(Ie){e.b.setAlphaFactor(we,Ie)},setPickable(Ie){e.b.setPickable(we,Ie)},setColorOnly(Ie){e.b.setColorOnly(we,Ie)},setTransform(Ie,Le){e.b.setTransform(we,Ie,Le)},setOverpaint(Ie,Le){e.b.setOverpaint(we,Ie,ae,!0,{geometry:be,props:Ne,webgl:Le})},setTransparency(Ie,Le){e.b.setTransparency(we,Ie,ae,!0,{geometry:be,props:Ne,webgl:Le})},setEmissive(Ie,Le){e.b.setEmissive(we,Ie,ae,!0,{geometry:be,props:Ne,webgl:Le})},setSubstance(Ie,Le){e.b.setSubstance(we,Ie,ae,!0,{geometry:be,props:Ne,webgl:Le})},setClipping(Ie){e.b.setClipping(we,Ie,ae,!0)},setThemeStrength(Ie){e.b.setThemeStrength(we,Ie)},destroy(){xe?.(be),we&&(we.state.disposed=!0,we=void 0)},mustRecreate:g}}const E={...a.nF,...a.a2};function T(te,de){return p({...te,setUpdateState:(ye,j,Z,q,Y,ee,g)=>{te.setUpdateState(ye,j,Z,q,Y,ee,g),s.F.areEqual(q.size,Y.size)||(ye.createGeometry=!0)},geometryUtils:l.e.Utils},de)}const L={...a.Op,...a.a2};function w(te,de){return p({...te,setUpdateState:(ye,j,Z,q,Y,ee,g)=>{te.setUpdateState(ye,j,Z,q,Y,ee,g),s.F.areEqual(q.size,Y.size)||(ye.updateSize=!0)},geometryUtils:R.v.Utils},de)}const Q={...a.DG,...a.a2};function G(te,de){return p({...te,setUpdateState:(ye,j,Z,q,Y,ee,g)=>{te.setUpdateState(ye,j,Z,q,Y,ee,g),s.F.areEqual(q.size,Y.size)||(ye.updateSize=!0)},geometryUtils:m.S.Utils},de)}const V={...a.Rb,...a.a2};function U(te,de){return p({...te,setUpdateState:(ye,j,Z,q,Y,ee,g)=>{te.setUpdateState(ye,j,Z,q,Y,ee,g),s.F.areEqual(q.size,Y.size)||(ye.updateSize=!0)},geometryUtils:u.q.Utils},de)}const N={...a.xl,...a.a2};function k(te,de){return p({...te,setUpdateState:(ye,j,Z,q,Y,ee,g)=>{te.setUpdateState(ye,j,Z,q,Y,ee,g),s.F.areEqual(q.size,Y.size)||(ye.updateSize=!0),j.background!==Z.background&&(ye.createGeometry=!0),j.backgroundMargin!==Z.backgroundMargin&&(ye.createGeometry=!0),j.tether!==Z.tether&&(ye.createGeometry=!0),j.tetherLength!==Z.tetherLength&&(ye.createGeometry=!0),j.tetherBaseWidth!==Z.tetherBaseWidth&&(ye.createGeometry=!0),j.attachment!==Z.attachment&&(ye.createGeometry=!0),j.fontFamily!==Z.fontFamily&&(ye.createGeometry=!0),j.fontQuality!==Z.fontQuality&&(ye.createGeometry=!0),j.fontStyle!==Z.fontStyle&&(ye.createGeometry=!0),j.fontVariant!==Z.fontVariant&&(ye.createGeometry=!0),j.fontWeight!==Z.fontWeight&&(ye.createGeometry=!0)},geometryUtils:d.E.Utils},de)}const H={...a.Vv,...a.a2};function $(te,de){return p({...te,setUpdateState:(ye,j,Z,q,Y,ee,g)=>{te.setUpdateState(ye,j,Z,q,Y,ee,g),s.F.areEqual(q.size,Y.size)||(ye.createGeometry=!0)},geometryUtils:C.E.Utils},de)}const J={...a.MQ,...a.a2};function W(te,de){return p({...te,setUpdateState:(ye,j,Z,q,Y,ee,g)=>{te.setUpdateState(ye,j,Z,q,Y,ee,g),s.F.areEqual(q.size,Y.size)||(ye.createGeometry=!0)},geometryUtils:S.X.Utils},de)}},5201:(tn,Ue,n)=>{"use strict";n.d(Ue,{DG:()=>l,MQ:()=>C,Op:()=>I,R8:()=>b,Rb:()=>u,Vv:()=>s,a2:()=>_,fy:()=>m,nF:()=>M,xl:()=>d});var e=n(9928),o=n(5315),r=n(9283),t=n(5299),A=n(8231),y=n(283),c=n(4255),i=n(799),v=n(8277),O=n(2556);function b(h){return v.t.MultiSelect(h,O.hi,{description:"For which kinds of units/chains to show the representation visuals."})}const _={unitKinds:b(["atomic","spheres"]),includeParent:v.t.Boolean(!1,{isHidden:!0})},M={...r.e.Params},I={...A.v.Params},l={...y.S.Params},m={...t.O.Params},u={...o.q.Params},d={...c.E.Params},s={...e.E.Params},C={...i.X.Params}},1758:(tn,Ue,n)=>{"use strict";n.d(Ue,{GT:()=>c,J1:()=>y,Kp:()=>o.K,TP:()=>t.T});var e=n(2443),o=n(1137),t=(n(3892),n(8688));n(2741);const y={create:()=>({...e.YL.createState(),unitTransforms:null,unitTransformsVersion:-1}),update:(i,v)=>{e.YL.updateState(i,v),void 0!==v.unitTransforms&&(i.unitTransforms=v.unitTransforms)}};function c(i){return i}},8688:(tn,Ue,n)=>{"use strict";n.d(Ue,{T:()=>s});var e=n(467),o=n(8277),r=n(1758),t=n(2443),A=n(9136),y=n(1413),c=n(8353),i=n(1930),v=n(4824),O=n(3246),b=n(6825),_=n(261),M=n(1965),I=n(4369),l=n(3543),m=n(7981),u=n(9213),d=n(3488);function s(C,h,a,S){let D=0;const{webgl:R}=h,f=new y.B,p=(0,c.Q0)(),E=[],T=new t.YL.GeometryState,L=r.J1.create();let Q,G,V,U,w=new Map,N=i.S.createEmpty();function te(Z,q,Y){const{visible:ee,alphaFactor:g,pickable:_e,overpaint:xe,transparency:le,emissive:Ae,substance:Be,clipping:Ce,themeStrength:Re,transform:ke,unitTransforms:we}=Y;void 0!==ee&&Z.setVisibility(ee),void 0!==g&&Z.setAlphaFactor(g),void 0!==_e&&Z.setPickable(_e),void 0!==xe&&Z.setOverpaint(xe,R),void 0!==le&&Z.setTransparency(le,R),void 0!==Ae&&Z.setEmissive(Ae,R),void 0!==Be&&Z.setSubstance(Be,R),void 0!==Ce&&Z.setClipping(Ce),void 0!==Re&&Z.setThemeStrength(Re),void 0!==ke&&(ke!==L.transform||!I.$I.areEqual(ke,L.transform,I.p8))&&Z.setTransform(ke),void 0!==we&&(we?Z.setTransform(void 0,we.getSymmetryGroupTransforms(q)):we!==L.unitTransforms&&Z.setTransform(void 0,null))}return{label:C,get groupCount(){let Z=0;return w.forEach(({visual:q})=>{q.renderObject&&(Z+=q.groupCount)}),Z},get geometryVersion(){return T.version},get props(){return U},get params(){return V},get state(){return L},get theme(){return N},renderObjects:E,updated:f,createOrUpdate:function k(Z={},q){return q&&q!==Q&&(V=a(h,q),U||(U=o.t.getDefaultValues(V))),U=Object.assign({},U,Z),v.YZ.create("Creating or updating UnitsRepresentation",function(){var Y=(0,e.A)(function*(ee){var g,_e,xe;if(!Q&&!q)throw new Error("missing structure");if(q&&!Q){G=q.unitSymmetryGroups;for(let le=0;lele.push(Ae));for(let Ae=0,Be=le.length;Ae{Ae.destroy()})}E.length=0,w.forEach(({visual:le})=>{le.renderObject&&(E.push(le.renderObject),T.add(le.renderObject.id,le.geometryVersion))}),T.snapshot(),q&&(Q=q),f.next(D++)});return function(ee){return Y.apply(this,arguments)}}())},setState:function de(Z){const{visible:q,alphaFactor:Y,pickable:ee,overpaint:g,transparency:_e,emissive:xe,substance:le,clipping:Ae,themeStrength:Be,transform:Ce,unitTransforms:Re,syncManually:ke,markerActions:we}=Z,Oe={};void 0!==q&&(Oe.visible=q),void 0!==Y&&(Oe.alphaFactor=Y),void 0!==ee&&(Oe.pickable=ee),void 0!==g&&Q&&(Oe.overpaint=_.l.remap(g,Q)),void 0!==_e&&Q&&(Oe.transparency=M.x.remap(_e,Q)),void 0!==xe&&Q&&(Oe.emissive=d.a.remap(xe,Q)),void 0!==le&&Q&&(Oe.substance=u.l.remap(le,Q)),void 0!==Ae&&Q&&(Oe.clipping=m.l.remap(Ae,Q)),void 0!==Be&&(Oe.themeStrength=Be),void 0!==Ce&&!I.$I.areEqual(Ce,L.transform,I.p8)&&(Oe.transform=Ce),(Re!==L.unitTransforms||Re?.version!==L.unitTransformsVersion)&&(Oe.unitTransforms=Re,L.unitTransformsVersion=Re?Re?.version:-1),void 0!==ke&&(Oe.syncManually=ke),void 0!==we&&(Oe.markerActions=we),w.forEach(({visual:Se,group:Ve})=>te(Se,Ve,Oe)),r.J1.update(L,Oe)},setTheme:function ye(Z){N=Z},getLoci:function H(Z){let q=O.BL;return w.forEach(({visual:Y})=>{const ee=Y.getLoci(Z);(0,O.$M)(ee)||(q=ee)}),q},getAllLoci:function J(){var Z;return[A.oE.Loci(null!==(Z=Q.child)&&void 0!==Z?Z:Q)]},eachLocation:function $(Z){w.forEach(({visual:q})=>{q.eachLocation(Z)})},mark:function W(Z,q){if(!Q||!b.sY.is(L.markerActions,q))return!1;if(A.oE.isLoci(Z)||A.iZ.Loci.is(Z)||A.gn.isLoci(Z)){if(!A.oE.areRootsEquivalent(Z.structure,Q))return!1;Z=O.QN.remap(Z,Q),(A.oE.isLoci(Z)||A.iZ.Loci.is(Z)&&A.iZ.Loci.isWholeStructure(Z))&&(Z=O.FE)}else if(!(0,O.xc)(Z)&&!(0,O.e4)(Z))return!1;if(O.QN.isEmpty(Z))return!1;let Y=!1;return w.forEach(({visual:ee})=>{Y=ee.mark(Z,q)||Y}),Y},destroy:function j(){w.forEach(({visual:Z})=>Z.destroy()),w.clear()}}}},2741:(tn,Ue,n)=>{"use strict";n.d(Ue,{Ny:()=>W,O$:()=>ye,PJ:()=>U,Pi:()=>te,Pv:()=>L,Te:()=>T,Vb:()=>V,fm:()=>N,ii:()=>de,lm:()=>G,qg:()=>w,uF:()=>Q,zK:()=>H,zj:()=>k});var e=n(9136),o=n(5117),r=n(542),t=n(1930),A=n(2556),y=n(8353),c=n(3246),i=n(3543),v=n(5589),O=n(274),b=n(8013),_=n(6825),M=n(9909),I=n(7684),l=n(2712),m=n(9283),u=n(2832),d=n(8231),s=n(283),C=n(5299),h=n(5315),S=(n(4255),n(9928)),D=n(799),R=n(5201),f=n(1372);function E(j,Z){const{defaultProps:q,createGeometry:Y,createLocationIterator:ee,getLoci:g,eachLocation:_e,setUpdateState:xe,mustRecreate:le,processValues:Ae,dispose:Be}=j,{createEmpty:Ce,updateValues:Re,updateBoundingSphere:ke,updateRenderableState:we,createPositionIterator:Oe}=j.geometryUtils,Se=v.rj.create(),Ve={loci:c.BL,action:_.xi.None,status:-1};let Ne,be,Te,ie,ue,re,ce,se,K=Object.assign({},q),ne=t.S.createEmpty(),ve=-1;function ge(Je){if(Se.createNew){if(ce=ee(be,K),!Je)throw new Error("expected geometry to be given");Ne=function p(j,Z,q,Y,ee,g){const{createValues:_e,createRenderableState:xe}=r.V.getUtils(Z),Ae=_e(Z,(0,A.yS)(j,ee.includeParent,Z.boundingSphere,ee.cellSize,ee.batchSize),q,Y,ee),Be=xe(ee);return(0,y.o)(Z.kind,Ae,Be,g)}(be,Je,ce,ne,K,Z),se=Oe(Je,Ne.values)}else{if(!Ne)throw new Error("expected renderObject to be available");if(Se.updateTransform){ce=ee(be,K);const{instanceCount:en,groupCount:Bt}=ce;K.instanceGranularity?(0,b.Km)(en,"instance",Ne.values):(0,b.Km)(en*Bt,"groupInstance",Ne.values)}if(Se.updateMatrix&&((0,A.yS)(be,K.includeParent,Ne.values.invariantBoundingSphere.ref.value,K.cellSize,K.batchSize,Ne.values),"lodLevels"in Ne.values&&M.IQ.update(Ne.values.lodLevels,Ne.values.lodLevels.ref.value)),Se.createGeometry){if(!Je)throw new Error("expected geometry to be given");M.IQ.updateIfChanged(Ne.values.drawCount,r.V.getDrawCount(Je)),M.IQ.updateIfChanged(Ne.values.uVertexCount,r.V.getVertexCount(Je)),M.IQ.updateIfChanged(Ne.values.uGroupCount,r.V.getGroupCount(Je))}(Se.updateTransform||Se.createGeometry)&&(ke(Ne.values,Je||re),se=Oe(Je||re,Ne.values)),Se.updateSize&&"uSize"in Ne.values&&(0,I.v3)(ce,ne.size,Ne.values),Se.updateColor&&(0,l.D1)(ce,se,ne.color,Ne.values),Re(Ne.values,K),we(Ne.state,K)}Te=K,ie=ne,ue=be,Je&&(re=Je,ve+=1)}function je(Je,en,Bt){return function Le(Je){return!!((0,c.xc)(Je)||e.oE.isLoci(Je)&&e.oE.areRootsEquivalent(Je.structure,ue.structure)||e.iZ.Loci.is(Je)&&e.oE.areRootsEquivalent(Je.structure,ue.structure)&&e.iZ.Loci.isWholeStructure(Je))}(Je)?en(i.IX.ofBounds(0,Te.instanceGranularity?ce.instanceCount:ce.groupCount*ce.instanceCount)):Te.instanceGranularity?function nt(Je,en,Bt){let pn=!1;if(e.gn.isLoci(Je)){const{structure:$e,group:mt}=en;if(!e.oE.areEquivalent(Je.structure,$e))return!1;for(const _t of Je.bonds){if(_t.aUnit!==_t.bUnit)continue;const Me=mt.unitIndexMap.get(_t.aUnit.id);void 0!==Me&&Bt(i.IX.ofSingleton(Me))&&(pn=!0)}}else if(e.iZ.Loci.is(Je)){const{structure:$e,group:mt}=en;if(!e.oE.areEquivalent(Je.structure,$e))return!1;for(const _t of Je.elements){const Me=mt.unitIndexMap.get(_t.unit.id);void 0!==Me&&Bt(i.IX.ofSingleton(Me))&&(pn=!0)}}return pn}(Je,ue,en):_e(Je,ue,en,Bt)}function Lt(Je){Ne&&Ae?.(Ne.values,re,Te,ie,Je.webgl)}return{get groupCount(){return ce?ce.count:0},get renderObject(){return ce&&ce.count?Ne:void 0},get geometryVersion(){return ve},createOrUpdate(Je,en,Bt,pn){if(function ae(Je,en,Bt){if(!Bt&&!ue)throw new Error("missing structureGroup");if(K=en,ne=Je,be=Bt,v.rj.reset(Se),!Ne||!ue)return Se.createNew=!0,void(Se.createGeometry=!0);xe(Se,K,Te,ne,ie,be,ue),e.oE.areHierarchiesEqual(ue.structure,be.structure)||(Se.updateTransform=!0,Se.updateColor=!0,Se.updateSize=!0),O.J.areEqual(ne.color,ie.color)||(Se.updateColor=!0),ue.structure.child!==be.structure.child&&(Se.createGeometry=!0),(K.instanceGranularity!==Te.instanceGranularity||K.cellSize!==Te.cellSize||K.batchSize!==Te.batchSize)&&(Se.updateTransform=!0),(0,M.bD)(K.unitKinds,Te.unitKinds)||(Se.createGeometry=!0),be.group.transformHash!==ue.group.transformHash&&(be.group.units.length!==ue.group.units.length||Se.updateColor?Se.updateTransform=!0:Se.updateMatrix=!0);const pn=be.group.units[0],$e=ue.group.units[0];e.Nf.areOperatorsEqual(pn,$e)||(Se.updateTransform=!0),e.Nf.areConformationsEqual(pn,$e)||(Se.createGeometry=!0),Se.updateTransform&&(Se.updateMatrix=!0),Se.updateSize&&!("uSize"in Ne.values)&&(Se.createGeometry=!0),(Se.createGeometry||Se.updateTransform)&&(ue.structure.hashCode!==be.structure.hashCode&&(Se.updateColor=!0,Se.updateSize=!0),(ne.color.granularity.startsWith("vertex")||Ne.values.dColorType.ref.value.startsWith("vertex")||ne.color.granularity.startsWith("volume")||Ne.values.dColorType.ref.value.startsWith("volume"))&&(Se.updateColor=!0))}(en,Bt,pn||ue),Se.createGeometry){const $e=function Ie(Je,en,Bt,pn,$e,mt){return(0,A.AR)($e.unitKinds,en)?Y(Je,en,Bt,pn,$e,mt):Ce(mt)}(Je,be.group.units[0],be.structure,ne,K,re);if((0,f.$X)($e))return $e.then(mt=>{ge(mt),Lt(Je)});ge($e)}else ge();Lt(Je)},getLoci:Je=>Ne?g(Je,ue,Ne.id):c.BL,eachLocation(Je){for(ce.reset();ce.hasNext;){const{location:en,isSecondary:Bt}=ce.move();Je(en,Bt)}},mark(Je,en){let Bt=!0;if(e.iZ.Loci.is(Je)){Bt=!1;const{invariantId:pn}=ue.group.units[0];for(const $e of Je.elements)if($e.unit.invariantId===pn){Bt=!0;break}}return!!Bt&&o.b.mark(Ne,Je,en,je,Ve)},setVisibility(Je){o.b.setVisibility(Ne,Je)},setAlphaFactor(Je){o.b.setAlphaFactor(Ne,Je)},setPickable(Je){o.b.setPickable(Ne,Je)},setColorOnly(Je){o.b.setColorOnly(Ne,Je)},setTransform(Je,en){o.b.setTransform(Ne,Je,en)},setOverpaint(Je,en){o.b.setOverpaint(Ne,Je,je,!0,{geometry:re,props:Te,webgl:en})},setTransparency(Je,en){o.b.setTransparency(Ne,Je,je,!0,{geometry:re,props:Te,webgl:en})},setEmissive(Je,en){o.b.setEmissive(Ne,Je,je,!0,{geometry:re,props:Te,webgl:en})},setSubstance(Je,en){o.b.setSubstance(Ne,Je,je,!0,{geometry:re,props:Te,webgl:en})},setClipping(Je){o.b.setClipping(Ne,Je,je,!0)},setThemeStrength(Je){o.b.setThemeStrength(Ne,Je)},destroy(){Be?.(re),Ne&&(Ne.state.disposed=!0,Ne=void 0)},mustRecreate:le}}const T={...R.nF,...R.a2};function L(j,Z){return E({...j,setUpdateState:(q,Y,ee,g,_e,xe,le)=>{j.setUpdateState(q,Y,ee,g,_e,xe,le),u.F.areEqual(g.size,_e.size)||(q.createGeometry=!0)},geometryUtils:m.e.Utils},Z)}const w={...R.Op,...R.a2};function Q(j,Z){return E({...j,setUpdateState:(q,Y,ee,g,_e,xe,le)=>{j.setUpdateState(q,Y,ee,g,_e,xe,le),u.F.areEqual(g.size,_e.size)||(q.updateSize=!0)},geometryUtils:d.v.Utils},Z)}const G={...R.DG,...R.a2};function V(j,Z){return E({...j,setUpdateState:(q,Y,ee,g,_e,xe,le)=>{j.setUpdateState(q,Y,ee,g,_e,xe,le),u.F.areEqual(g.size,_e.size)||(q.updateSize=!0)},geometryUtils:s.S.Utils},Z)}const U={...R.fy,...R.a2};function N(j,Z){return E({...j,setUpdateState:(q,Y,ee,g,_e,xe,le)=>{j.setUpdateState(q,Y,ee,g,_e,xe,le),u.F.areEqual(g.size,_e.size)||(q.updateSize=!0)},geometryUtils:C.O.Utils},Z)}const k={...R.Rb,...R.a2};function H(j,Z){return E({...j,setUpdateState:(q,Y,ee,g,_e,xe,le)=>{j.setUpdateState(q,Y,ee,g,_e,xe,le),u.F.areEqual(g.size,_e.size)||(q.updateSize=!0)},geometryUtils:h.q.Utils},Z)}const W={...R.Vv,...R.a2};function te(j,Z){return E({...j,setUpdateState:(q,Y,ee,g,_e,xe,le)=>{j.setUpdateState(q,Y,ee,g,_e,xe,le),u.F.areEqual(g.size,_e.size)||(q.createGeometry=!0)},geometryUtils:S.E.Utils},Z)}const de={...R.MQ,...R.a2};function ye(j,Z){return E({...j,setUpdateState:(q,Y,ee,g,_e,xe,le)=>{j.setUpdateState(q,Y,ee,g,_e,xe,le),u.F.areEqual(g.size,_e.size)||(q.createGeometry=!0)},geometryUtils:D.X.Utils},Z)}},2556:(tn,Ue,n)=>{"use strict";n.d(Ue,{$J:()=>D,AR:()=>s,Dt:()=>h,FC:()=>a,LT:()=>T,R$:()=>G,UQ:()=>V,hi:()=>d,nR:()=>M,oc:()=>L,rS:()=>l,uh:()=>I,v3:()=>Q,yS:()=>m});var e=n(9136),o=n(4369),r=n(3596),t=n(3543),A=n(3246),y=n(2008),c=n(6115),i=n(8277),v=n(9535),O=n(5384),b=n(6948);const _=o.$I.toArray;function M(U,N,k){const{elements:H,model:$}=N;if(-1!==t.CD.indexOf(H,k)){const{index:J,offsets:W}=$.atomicHierarchy.residueAtomSegments,te=J[k],de=[];for(let j=W[te],Z=W[te+1];jW.unitMap.has(Z.id)):U.group.units,de=te.length,ye=16*de,j=J&&J.aTransform.ref.value.length>=ye?J.aTransform.ref.value:new Float32Array(ye);for(let Z=0;Zde-te);const $=Math.floor(Math.cbrt(k)*Math.cbrt(k)),J=H[0]*H[1];return{area:J,areaCells:Math.ceil(J/(N*N)),maxAreaCells:$}}function a(U,N,k=C){const{area:H,areaCells:$,maxAreaCells:J}=h(U,N.resolution,k),W=$>J?Math.sqrt(H/J):N.resolution;return{...N,resolution:W}}const D={ignoreHydrogens:i.t.Boolean(!1,{description:"Whether or not to include hydrogen atoms in the surface calculation."}),ignoreHydrogensVariant:i.t.Select("all",i.t.arrayToOptions(["all","non-polar"])),traceOnly:i.t.Boolean(!1,{description:"Whether or not to only use trace atoms in the surface calculation."}),includeParent:i.t.Boolean(!1,{description:"Include elements of the parent structure in surface calculation to get a surface patch of the current structure."})},f=(i.t.getDefaultValues(D),(0,o.eB)());function p(U,N,k,H){return o.eB.squaredDistance(o.eB.set(f,U,N,k),H)}function T(U,N,k,H){const{ignoreHydrogens:$,ignoreHydrogensVariant:J,traceOnly:W,includeParent:te}=H,de=te?U.root.unitMap.get(N.id):N,ye=te&&de!==N,{x:j,y:Z,z:q}=function S(U){switch(U.kind){case 0:return U.model.atomicConformation;case 1:return U.model.coarseConformation.spheres;case 2:return U.model.coarseConformation.gaussians}}(de),{elements:Y}=de,{center:ee,radius:g}=N.boundary.sphere,xe=(g+11)*(g+11);let le,Ae;if($||W||ye){const we=[],Oe=[];for(let Se=0,Ve=Y.length;Sexe||(we.push(Ne),Oe.push(Se))}le=t.SortedArray.ofSortedArray(we),Ae=Oe}else le=Y,Ae=(0,c.WE)(new Int32Array(le.length));te&&de!==N&&function E(U,N,k){let H=0;const $=N.length;for(let J=0,W=k.length;J(Re.element=we,k.size(Re))}}function L(U,N,k){const{ignoreHydrogens:H,ignoreHydrogensVariant:$,traceOnly:J,includeParent:W}=k,te=W&&!!U.parent,de=e.iZ.Location.create(U.root),{center:ye,radius:j}=U.boundary.sphere,q=(j+11)*(j+11);let Y,ee,g,_e,xe,le;if(H||J||te){const{getSerialIndex:Re}=U.serialMapping,ke=te?U.root.units:U.units,we=[],Oe=[],Se=[],Ve=[],Ne=[];for(let K=0,ne=ke.length;Kq||(we.push(se),Oe.push(ae),Se.push(ge),de.element=ce,Ve.push(N.size(de)),te?-1===(ue?t.SortedArray.indexOf(ue.elements,ce):-1)?Ne.push(-2):Ne.push(Re(ue,ce)):Ne.push(Re(be,ce)))}}Y=we,ee=Oe,g=Se,_e=Ve,xe=Ne,le=t.CD.ofRange(0,xe.length)}else{const{elementCount:Re}=U,ke=new Float32Array(Re),we=new Float32Array(Re),Oe=new Float32Array(Re),Se=new Float32Array(Re);for(let Ve=0,Ne=0,K=U.units.length;Ve_e[Re]}}const w=y.K9.H;function Q(U,N,k,H){if(e.Nf.isCoarse(N)||N.model.atomicHierarchy.derived.atom.atomicNumber[k]!==w)return!1;if("all"===H)return!0;const $=(0,b.GE)(U,N,t.SortedArray.indexOf(N.elements,k));return!!($&&"polar"===H||!$&&"non-polar"===H)}function G(U,N){return U[N]===w}function V(U,N){if(e.Nf.isCoarse(U))return!0;const k=U.model.atomicHierarchy.atoms.label_atom_id.value(N);return"CA"===k||"BB"===k||"P"===k}},377:(tn,Ue,n)=>{"use strict";n.d(Ue,{C1:()=>f,Lr:()=>_,T9:()=>I,Yz:()=>E,rm:()=>p});var e=n(4369),o=n(8277),r=n(9283),t=n(573),A=n(2802),y=n(5019),c=n(5315),i=n(5821),v=n(283),O=n(1989),b=n(8184);const _={linkScale:o.t.Numeric(.45,{min:0,max:1,step:.01}),linkSpacing:o.t.Numeric(1,{min:0,max:2,step:.01}),linkCap:o.t.Boolean(!1),aromaticScale:o.t.Numeric(.3,{min:0,max:1,step:.01}),aromaticSpacing:o.t.Numeric(1.5,{min:0,max:3,step:.01}),aromaticDashCount:o.t.Numeric(2,{min:1,max:6,step:1}),dashCount:o.t.Numeric(4,{min:0,max:10,step:1}),dashScale:o.t.Numeric(.8,{min:0,max:2,step:.1}),dashCap:o.t.Boolean(!0),stubCap:o.t.Boolean(!0),radialSegments:o.t.Numeric(16,{min:2,max:56,step:2},y.iy.CustomQualityParamInfo),colorMode:o.t.Select("default",o.t.arrayToOptions(["default","interpolate"]),y.iy.ShadingCategory)},I=(o.t.getDefaultValues(_),{linkScale:o.t.Numeric(.5,{min:0,max:1,step:.1}),linkSpacing:o.t.Numeric(.1,{min:0,max:2,step:.01}),aromaticDashCount:o.t.Numeric(2,{min:1,max:6,step:1}),dashCount:o.t.Numeric(4,{min:0,max:10,step:1})}),m=(o.t.getDefaultValues(I),(0,e.eB)()),u=(0,e.eB)(),d=(0,e.eB)(),s=e.eB.create(0,1,0);function C(T,L,w,Q){e.eB.normalize(u,e.eB.sub(u,L,w)),null!==Q?e.eB.sub(d,L,Q):e.eB.copy(d,L),e.eB.normalize(d,d);let G=e.eB.dot(u,d);return 1-Math.abs(G)<1e-5&&(e.eB.set(d,1,0,0),G=e.eB.dot(u,d),1-Math.abs(G)<1e-5&&(e.eB.set(d,0,1,0),G=e.eB.dot(u,d))),e.eB.setMagnitude(u,u,G),e.eB.sub(d,d,u),e.eB.normalize(T,d)}const h=e.eB.scale,a=e.eB.add,S=e.eB.sub,D=e.eB.setMagnitude,R=e.eB.dot;function f(T,L,w,Q){const{linkCount:G,referencePosition:V,position:U,style:N,radius:k,ignore:H,stub:$}=L;if(!G)return{mesh:r.e.createEmpty(Q)};const{linkScale:J,linkSpacing:W,radialSegments:te,linkCap:de,aromaticScale:ye,aromaticSpacing:j,aromaticDashCount:Z,dashCount:q,dashScale:Y,dashCap:ee,stubCap:g}=w,_e=2*te*G*2,xe=t.P.createState(_e,_e/4,Q),le=(0,e.eB)(),Ae=(0,e.eB)(),Be=(0,e.eB)(),Ce=(0,e.eB)();let Re=0;const ke={radiusTop:1,radiusBottom:1,radialSegments:te,topCap:de,bottomCap:de};for(let Se=0,Ve=G;Se0,K=k(Se),ne=N?N(Se):0,be=g&&!!$&&$(Se),[Te,ie]=Ne?[be,de]:[de,be];if(xe.currentGroup=Se,0===ne)ke.radiusTop=ke.radiusBottom=K,ke.topCap=Te,ke.bottomCap=ie,(0,A.y9)(xe,le,Ae,.5,ke);else if(1===ne)ke.radiusTop=ke.radiusBottom=K*Y,ke.topCap=ke.bottomCap=ee,(0,A.GH)(xe,le,Ae,.5,q,be,ke);else if(2===ne||3===ne||4===ne||5===ne||7===ne||8===ne){const ue=2===ne||3===ne?2:4===ne||5===ne?3:1.5,re=K*(J/(.5*ue)),ve=(K-re)*W;if(C(Be,le,Ae,V?V(Se):null),ke.topCap=Te,ke.bottomCap=ie,7===ne||8===ne){ke.radiusTop=ke.radiusBottom=K,(0,A.y9)(xe,le,Ae,.5,ke);const ce=K+ye*K+ye*K*j;D(m,S(m,Ae,le),.5*K),a(le,le,m),S(Ae,Ae,m),ke.radiusTop=ke.radiusBottom=K*ye,ke.topCap=ke.bottomCap=ee,D(Be,Be,ce),S(le,le,Be),S(Ae,Ae,Be),(0,A.GH)(xe,le,Ae,.5,Z,be,ke),8===ne&&(D(Be,Be,2*ce),a(le,le,Be),a(Ae,Ae,Be),(0,A.GH)(xe,le,Ae,.5,Z,be,ke))}else if(3===ne||5===ne){const ce=K+re+J*K*W;D(Be,Be,ce),ke.radiusTop=ke.radiusBottom=K,(0,A.y9)(xe,le,Ae,.5,ke),h(m,m,W*J*.2),a(le,le,m),S(Ae,Ae,m),ke.radiusTop=ke.radiusBottom=re,ke.topCap=Ne?be:ee,ke.bottomCap=Ne?ee:be,D(Be,Be,ce),S(le,le,Be),S(Ae,Ae,Be),(0,A.y9)(xe,le,Ae,.5,ke),3===ue&&(D(Be,Be,2*ce),a(le,le,Be),a(Ae,Ae,Be),(0,A.y9)(xe,le,Ae,.5,ke))}else D(Be,Be,ve),ke.radiusTop=ke.radiusBottom=re,3===ue&&(0,A.y9)(xe,le,Ae,.5,ke),(0,A.Jz)(xe,le,Ae,.5,Be,ke)}else 6===ne&&(h(m,m,.475),a(le,le,m),S(Ae,Ae,m),ke.radiusTop=ke.radiusBottom=K,ke.topCap=Te,ke.bottomCap=ie,(0,A.y9)(xe,le,Ae,.5,ke))}const we=Q?b.f.clone(Q.boundingSphere):void 0,Oe=t.P.getMesh(xe);return 0===Re?{mesh:Oe}:(e.eB.scale(Ce,Ce,1/Re),we&&e.eB.distance(Ce,we.center)/we.radius<.1?{mesh:Oe,boundingSphere:we}:{mesh:Oe})}function p(T,L,w,Q){const{linkCount:G,referencePosition:V,position:U,style:N,radius:k,ignore:H,stub:$}=L;if(!G)return{cylinders:v.S.createEmpty(Q)};const{linkScale:J,linkSpacing:W,linkCap:te,aromaticScale:de,aromaticSpacing:ye,aromaticDashCount:j,dashCount:Z,dashScale:q,dashCap:Y,stubCap:ee,colorMode:g}=w,_e="interpolate"===g,xe=!0===_e?3:2,le=2*G,Ae=O.h.create(le,le/4,Q),Be=(0,e.eB)(),Ce=(0,e.eB)(),Re=(0,e.eB)(),ke=(0,e.eB)(),we=(0,e.eB)();let Oe=0;for(let Ne=0,K=G;Ne{"use strict";n.d(Ue,{V8:()=>i,m$:()=>O,rj:()=>y});var y,b,e=n(9909),o=n(9136),r=n(5384),t=n(9651),A=n(6853);(b=y||(y={})).create=function _(){return{updateTransform:!1,updateMatrix:!1,updateColor:!1,updateSize:!1,createGeometry:!1,createNew:!1,info:{}}},b.reset=function M(I){I.updateTransform=!1,I.updateMatrix=!1,I.updateColor=!1,I.updateSize=!1,I.createGeometry=!1,I.createNew=!1};const c={lowestElementCount:1e6,lowerElementCount:5e5,lowElementCount:1e5,mediumElementCount:2e4,highElementCount:2e3,coarseGrainedFactor:10,elementCountFactor:1};function i(b,_={}){const M={...c,..._};let I=b.elementCount*M.elementCountFactor;return(b.isCoarseGrained||b.isCoarse)&&(I*=M.coarseGrainedFactor),I>M.lowestElementCount?"lowest":I>M.lowerElementCount?"lower":I>M.lowElementCount?"low":I>M.mediumElementCount?"medium":I>M.highElementCount?"high":"higher"}function O(b,_){let M=(0,e.NT)(b.quality,"auto"),I=(0,e.NT)(b.detail,1),l=(0,e.NT)(b.radialSegments,12),m=(0,e.NT)(b.linearSegments,8),u=(0,e.NT)(b.resolution,2),d=(0,e.NT)(b.probePositions,12),s=(0,e.NT)(b.doubleSided,!0),C=0;if("auto"===M)if(_ instanceof o.oE)M=i(_.root),C=function v(b){if(1===b.root.models.length){const _=t.i.Provider.get(b.root.model);if(_&&"P 1"===_.spacegroup.name&&!r.O8.isZero(_.spacegroup.cell))return _.spacegroup.cell.volume}return r.DJ.volume(b.root.boundary.box)}(_);else if(A.f.is(_)){const[h,a,S]=_.grid.cells.space.dimensions;C=h*a*S,M=C<1e7?"medium":"low"}switch(M){case"highest":I=3,l=36,m=18,u=.1,d=72,s=!0;break;case"higher":I=3,l=28,m=14,u=.3,d=48,s=!0;break;case"high":I=2,l=20,m=10,u=.5,d=36,s=!0;break;case"medium":I=1,l=12,m=8,u=.8,d=24,s=!0;break;case"low":I=0,l=8,m=3,u=1.3,d=24,s=!1;break;case"lower":I=0,l=4,m=2,u=3,d=12,s=!1;break;case"lowest":I=0,l=2,m=1,u=8,d=12,s=!1}return u=Math.max(u,C/5e8),u=Math.min(u,20),"off"===b.transparentBackfaces&&(void 0!==b.alpha&&b.alpha<1||b.xrayShaded)&&(s=!1),{detail:I,radialSegments:l,linearSegments:m,resolution:u,probePositions:d,doubleSided:s}}},5117:(tn,Ue,n)=>{"use strict";n.d(Ue,{b:()=>u});var u,d,e=n(3246),o=n(6825),r=n(4369),t=n(3596),A=n(3784),y=n(9909),c=n(2075),i=n(3543),v=n(9197),O=n(5077),b=n(8013),_=n(5019),M=n(4992),I=n(6280),l=n(8307),m=n(6022);(d=u||(u={})).setVisibility=function s(w,Q){w&&(w.state.visible=Q)},d.setAlphaFactor=function C(w,Q){w&&(w.state.alphaFactor=Q)},d.setPickable=function h(w,Q){w&&(w.state.pickable=Q)},d.setColorOnly=function a(w,Q){w&&(w.state.colorOnly=Q)},d.mark=function S(w,Q,G,V,U){if(!w||(0,e.$M)(Q))return!1;const{tMarker:N,uMarker:k,markerAverage:H,markerStatus:$,uGroupCount:J,instanceCount:W,instanceGranularity:te}=w.values,de=te.ref.value?W.ref.value:J.ref.value*W.ref.value,{array:ye}=N.ref.value,j=$.ref.value;if(!(0,e.xc)(Q)){let ee=0;if(V(Q,g=>(ee+=i.IX.size(g),!0),!0),0===ee)return!1;ee===de&&(Q=e.FE)}let Z=!1,q=-1,Y=-1;if((0,e.xc)(Q)){const ee=(0,o.Ro)(G,j);-1!==ee.status?(Z=j!==ee.status,Z&&(0,o.uP)(ye,ee.status,de)):Z=(0,o.BH)(ye,i.IX.ofLength(de),G),q=ee.average,Y=ee.status}else Z=V(Q,ee=>(0,o.BH)(ye,ee,G),!0),Z&&(q=(0,o.HX)(G,j),U&&-1!==U.status&&-1===q&&o.sY.isReverse(U.action,G)&&e.QN.areEqual(Q,U.loci)&&(Y=U.status,q=0===Y?0:.5));return Z&&(-1===q&&(q=(0,b.Xl)(ye,de),0===q&&(Y=0)),U&&(U.action=G,U.loci=Q,U.status=j),y.IQ.updateIfChanged(k,Y),-1===Y&&y.IQ.update(N,N.ref.value),y.IQ.updateIfChanged(H,q),y.IQ.updateIfChanged($,Y)),Z},d.setOverpaint=function D(w,Q,G,V,U){if(!w)return;const{tOverpaint:N,dOverpaintType:k,dOverpaint:H,uGroupCount:$,instanceCount:J,instanceGranularity:W}=w.values,te=W.ref.value?J.ref.value:$.ref.value*J.ref.value,de=W.ref.value?"instance":"groupInstance";(0,c.zj)(Q.layers.length?te:0,de,w.values);const{array:ye}=N.ref.value;V&&(0,c.MD)(ye,0,te);for(let j=0,Z=Q.layers.length;j{const xe=i.IX.start(_e),le=i.IX.end(_e);return ee?(0,c.MD)(ye,xe,le):(0,c.qp)(ye,xe,le,Y)},!1)}if(y.IQ.update(N,N.ref.value),y.IQ.updateIfChanged(k,de),y.IQ.updateIfChanged(H,Q.layers.length>0),0!==Q.layers.length&&"instance"!==de&&U&&(0,_.jH)(U.props)){const{geometry:j,props:Z,webgl:q}=U;if("mesh"===j.kind){const{resolution:Y,overpaintTexture:ee}=j.meta,g=(0,_.Y0)(Z.smoothColors,!0,Y);g&&((0,M.WT)(w.values,g.resolution,g.stride,q,ee),j.meta.overpaintTexture=w.values.tOverpaintGrid.ref.value)}else if(q&&"texture-mesh"===j.kind){const{resolution:Y,overpaintTexture:ee}=j.meta,g=(0,_.Y0)(Z.smoothColors,!0,Y);g&&((0,I.FB)(w.values,g.resolution,g.stride,q,ee),j.meta.overpaintTexture=w.values.tOverpaintGrid.ref.value)}}},d.setTransparency=function R(w,Q,G,V,U){if(!w)return;const{tTransparency:N,dTransparencyType:k,transparencyAverage:H,dTransparency:$,uGroupCount:J,instanceCount:W,instanceGranularity:te}=w.values,de=te.ref.value?W.ref.value:J.ref.value*W.ref.value,ye=te.ref.value?"instance":"groupInstance";(0,v.Ti)(Q.layers.length?de:0,ye,w.values);const{array:j}=N.ref.value;V&&(0,v.m6)(j,0,de);for(let Z=0,q=Q.layers.length;Z{const xe=i.IX.start(_e),le=i.IX.end(_e);return(0,v.UG)(j,xe,le,ee)},!1)}if(y.IQ.update(N,N.ref.value),y.IQ.updateIfChanged(H,(0,v.Gg)(j,de)),y.IQ.updateIfChanged(k,ye),y.IQ.updateIfChanged($,Q.layers.length>0),0!==Q.layers.length&&"instance"!==ye&&U&&(0,_.jH)(U.props)){const{geometry:Z,props:q,webgl:Y}=U;if("mesh"===Z.kind){const{resolution:ee,transparencyTexture:g}=Z.meta,_e=(0,_.Y0)(q.smoothColors,!0,ee);_e&&((0,M._j)(w.values,_e.resolution,_e.stride,Y,g),Z.meta.transparencyTexture=w.values.tTransparencyGrid.ref.value)}else if(Y&&"texture-mesh"===Z.kind){const{resolution:ee,transparencyTexture:g}=Z.meta,_e=(0,_.Y0)(q.smoothColors,!0,ee);_e&&((0,I.NQ)(w.values,_e.resolution,_e.stride,Y,g),Z.meta.transparencyTexture=w.values.tTransparencyGrid.ref.value)}}},d.setEmissive=function f(w,Q,G,V,U){if(!w)return;const{tEmissive:N,dEmissiveType:k,emissiveAverage:H,dEmissive:$,uGroupCount:J,instanceCount:W,instanceGranularity:te}=w.values,de=te.ref.value?W.ref.value:J.ref.value*W.ref.value,ye=te.ref.value?"instance":"groupInstance";(0,m.Sj)(Q.layers.length?de:0,ye,w.values);const{array:j}=N.ref.value;V&&(0,m.dQ)(j,0,de);for(let Z=0,q=Q.layers.length;Z{const xe=i.IX.start(_e),le=i.IX.end(_e);return(0,m.Ns)(j,xe,le,ee)},!1)}if(y.IQ.update(N,N.ref.value),y.IQ.updateIfChanged(H,(0,m.bO)(j,de)),y.IQ.updateIfChanged(k,ye),y.IQ.updateIfChanged($,Q.layers.length>0),0!==Q.layers.length&&"instance"!==ye&&U&&(0,_.jH)(U.props)){const{geometry:Z,props:q,webgl:Y}=U;if("mesh"===Z.kind){const{resolution:ee,emissiveTexture:g}=Z.meta,_e=(0,_.Y0)(q.smoothColors,!0,ee);_e&&((0,M.bj)(w.values,_e.resolution,_e.stride,Y,g),Z.meta.emissiveTexture=w.values.tEmissiveGrid.ref.value)}else if(Y&&"texture-mesh"===Z.kind){const{resolution:ee,emissiveTexture:g}=Z.meta,_e=(0,_.Y0)(q.smoothColors,!0,ee);_e&&((0,I.ij)(w.values,_e.resolution,_e.stride,Y,g),Z.meta.emissiveTexture=w.values.tEmissiveGrid.ref.value)}}},d.setSubstance=function p(w,Q,G,V,U){if(!w)return;const{tSubstance:N,dSubstanceType:k,dSubstance:H,uGroupCount:$,instanceCount:J,instanceGranularity:W}=w.values,te=W.ref.value?J.ref.value:$.ref.value*J.ref.value,de=W.ref.value?"instance":"groupInstance";(0,l.fZ)(Q.layers.length?te:0,de,w.values);const{array:ye}=N.ref.value;V&&(0,l.C2)(ye,0,te);for(let j=0,Z=Q.layers.length;j{const xe=i.IX.start(_e),le=i.IX.end(_e);return ee?(0,l.C2)(ye,xe,le):(0,l.mx)(ye,xe,le,Y)},!1)}if(y.IQ.update(N,N.ref.value),y.IQ.updateIfChanged(k,de),y.IQ.updateIfChanged(H,Q.layers.length>0),0!==Q.layers.length&&"instance"!==de&&U&&(0,_.jH)(U.props)){const{geometry:j,props:Z,webgl:q}=U;if("mesh"===j.kind){const{resolution:Y,substanceTexture:ee}=j.meta,g=(0,_.Y0)(Z.smoothColors,!0,Y);g&&((0,M.Cn)(w.values,g.resolution,g.stride,q,ee),j.meta.substanceTexture=w.values.tSubstanceGrid.ref.value)}else if(q&&"texture-mesh"===j.kind){const{resolution:Y,substanceTexture:ee}=j.meta,g=(0,_.Y0)(Z.smoothColors,!0,Y);g&&((0,I.DG)(w.values,g.resolution,g.stride,q,ee),j.meta.substanceTexture=w.values.tSubstanceGrid.ref.value)}}},d.setClipping=function E(w,Q,G,V){if(!w)return;const{tClipping:U,dClippingType:N,dClipping:k,uGroupCount:H,instanceCount:$,instanceGranularity:J}=w.values,W=J.ref.value?$.ref.value:H.ref.value*$.ref.value,{layers:te}=Q,de=J.ref.value?"instance":"groupInstance";(0,O.$G)(te.length?W:0,de,w.values);const{array:ye}=U.ref.value;V&&(0,O.eO)(ye,0,W);for(let j=0,Z=Q.layers.length;j{const _e=i.IX.start(g),xe=i.IX.end(g);return(0,O.HB)(ye,_e,xe,Y)},!1)}y.IQ.update(U,U.ref.value),y.IQ.updateIfChanged(N,de),y.IQ.updateIfChanged(k,Q.layers.length>0)},d.setThemeStrength=function T(w,Q){w&&(y.IQ.updateIfChanged(w.values.uOverpaintStrength,Q.overpaint),y.IQ.updateIfChanged(w.values.uTransparencyStrength,Q.transparency),y.IQ.updateIfChanged(w.values.uEmissiveStrength,Q.emissive),y.IQ.updateIfChanged(w.values.uSubstanceStrength,Q.substance))},d.setTransform=function L(w,Q,G){if(!w||!Q&&!G)return;const{values:V}=w;Q&&(r.$I.copy(V.matrix.ref.value,Q),y.IQ.update(V.matrix,V.matrix.ref.value)),G?(V.extraTransform.ref.value.set(G),y.IQ.update(V.extraTransform,V.extraTransform.ref.value)):null===G&&((0,t.ES)(V.extraTransform.ref.value,V.instanceCount.ref.value),y.IQ.update(V.extraTransform,V.extraTransform.ref.value)),(0,t.CY)(V,V.invariantBoundingSphere.ref.value,V.instanceGrid.ref.value.cellSize,V.instanceGrid.ref.value.batchSize);const U=(0,A.Ax)(V.invariantBoundingSphere.ref.value,V.transform.ref.value,V.instanceCount.ref.value,0);y.IQ.update(V.boundingSphere,U)}},3866:(tn,Ue,n)=>{"use strict";n.d(Ue,{H:()=>un});var e=n(2443),o=n(467),r=n(8277),t=n(6853),A=n(9283),y=n(6165),c=n(5117),i=n(542),v=n(1930),O=n(3596),b=n(8353),_=n(3246),M=n(3543),I=n(5589),l=n(274),m=n(9909),u=n(7684),d=n(2712),s=n(4369),C=n(5019),h=n(1413),a=n(4824),S=n(1372),D=n(8013);function f(ct,dt){const{defaultProps:Yt,createGeometry:cn,createLocationIterator:xn,getLoci:Rn,eachLocation:er,setUpdateState:ir,mustRecreate:Yn,dispose:br}=ct,{updateValues:vr,updateBoundingSphere:Hr,updateRenderableState:Mr,createPositionIterator:Fr}=ct.geometryUtils,Sr=I.rj.create();let Ur,Ro,ro,po,so,Go,Wo,We,Sn,Nn,ho=Object.assign({},Yt),Bo=v.S.createEmpty(),Pt=-1;function dr(Qt){if(Sr.createNew){if(Sn=xn(po,so),!Qt)throw new Error("expected geometry to be given");Ur=function R(ct,dt,Yt,cn,xn,Rn){const{createValues:er,createRenderableState:ir}=i.V.getUtils(dt),br=er(dt,(0,O.Zk)(),Yt,cn,xn),vr=ir(xn);return(0,b.o)(dt.kind,br,vr,Rn)}(0,Qt,Sn,ro,Ro,dt),Nn=Fr(Qt,Ur.values)}else{if(!Ur)throw new Error("expected renderObject to be available");if(Sr.updateTransform){Sn=xn(po,so);const{instanceCount:ht,groupCount:pt}=Sn;Ro.instanceGranularity?(0,D.Km)(ht,"instance",Ur.values):(0,D.Km)(ht*pt,"groupInstance",Ur.values)}else Sn.reset();if(Sr.createGeometry){if(!Qt)throw new Error("expected geometry to be given");m.IQ.updateIfChanged(Ur.values.drawCount,i.V.getDrawCount(Qt)),m.IQ.updateIfChanged(Ur.values.uVertexCount,i.V.getVertexCount(Qt)),m.IQ.updateIfChanged(Ur.values.uGroupCount,i.V.getGroupCount(Qt))}(Sr.updateTransform||Sr.createGeometry)&&(Hr(Ur.values,Qt||We),Nn=Fr(Qt||We,Ur.values)),Sr.updateSize&&"uSize"in Ur.values&&(0,u.v3)(Sn,ro.size,Ur.values),Sr.updateColor&&(0,d.D1)(Sn,Nn,ro.color,Ur.values),vr(Ur.values,Ro),Mr(Ur.state,Ro)}ho=Ro,Bo=ro,Go=po,Wo=so,Qt&&(We=Qt,Pt+=1)}function Ft(Qt,ht){return(0,_.xc)(Qt)?ht(M.IX.ofBounds(0,ho.instanceGranularity?Sn.instanceCount:Sn.groupCount*Sn.instanceCount)):ho.instanceGranularity?function xr(Qt,ht,pt,Xt){let fn=!1;if(t.f.Cell.isLoci(Qt)){if(t.f.Cell.isLociEmpty(Qt)||!t.f.areEquivalent(Qt.volume,ht))return!1;Xt(M.IX.ofSingleton(0))&&(fn=!0)}else if(t.f.Segment.isLoci(Qt)){if(t.f.Segment.isLociEmpty(Qt)||!t.f.areEquivalent(Qt.volume,ht)||!M.SortedArray.has(Qt.segments,pt))return!1;Xt(M.IX.ofSingleton(0))&&(fn=!0)}return fn}(Qt,Go,Wo,ht):er(Qt,Go,Wo,ho,ht)}return{get groupCount(){return Sn?Sn.count:0},get renderObject(){return Ur},get geometryVersion(){return Pt},createOrUpdate:(Qt,ht,pt={},Xt)=>(0,o.A)(function*(){if(function Kn(Qt,ht,pt,Xt){if(!pt&&!Go)throw new Error("missing volume");Ro=Object.assign({},ho,ht),ro=Qt,po=pt,so=Xt,I.rj.reset(Sr),Ur?(!t.f.areEquivalent(po,Go)||so!==Wo)&&(Sr.createNew=!0):Sr.createNew=!0,Sr.createNew?Sr.createGeometry=!0:(ir(Sr,pt,Ro,ho,ro,Bo),l.J.areEqual(Qt.color,Bo.color)||(Sr.updateColor=!0),Sr.createGeometry&&(Sr.updateColor=!0),Ro.instanceGranularity!==ho.instanceGranularity&&(Sr.updateTransform=!0))}(ht,pt,Xt?.volume||Go,Xt?.key||Wo),Sr.createGeometry){const fn=cn(Qt,po,so,ro,Ro,We);return(0,S.$X)(fn)?fn.then(dr):dr(fn)}dr()})(),getLoci:Qt=>Ur?Rn(Qt,Go,Wo,ho,Ur.id):_.BL,eachLocation(Qt){for(Sn.reset();Sn.hasNext;){const{location:ht,isSecondary:pt}=Sn.move();Qt(ht,pt)}},mark:(Qt,ht)=>c.b.mark(Ur,Qt,ht,Ft),setVisibility(Qt){c.b.setVisibility(Ur,Qt)},setAlphaFactor(Qt){c.b.setAlphaFactor(Ur,Qt)},setPickable(Qt){c.b.setPickable(Ur,Qt)},setColorOnly(Qt){c.b.setColorOnly(Ur,Qt)},setTransform(Qt,ht){c.b.setTransform(Ur,Qt,ht)},setOverpaint:Qt=>c.b.setOverpaint(Ur,Qt,Ft,!0),setTransparency:Qt=>c.b.setTransparency(Ur,Qt,Ft,!0),setEmissive:Qt=>c.b.setEmissive(Ur,Qt,Ft,!0),setSubstance:Qt=>c.b.setSubstance(Ur,Qt,Ft,!0),setClipping:Qt=>c.b.setClipping(Ur,Qt,Ft,!0),setThemeStrength(Qt){c.b.setThemeStrength(Ur,Qt)},destroy(){br?.(We),Ur&&(Ur.state.disposed=!0,Ur=void 0)},mustRecreate:Yn}}function T(ct,dt,Yt,cn,xn,Rn=(()=>[-1])){let er=0;const{webgl:ir}=dt,Yn=new h.B,br=new e.YL.GeometryState,vr=(0,b.Q0)(),Hr=[],Mr=e.YL.createState(),Fr=new Map;let Sr,Ur,Ro,ro,po=v.S.createEmpty();function so(Nn,Kn){return ho.apply(this,arguments)}function ho(){return(ho=(0,o.A)(function*(Nn,Kn){var dr;let xr=Fr.get(Kn);return xr?!(null===(dr=xr.mustRecreate)||void 0===dr)&&dr.call(xr,{volume:Sr,key:Kn},ro,ir)&&(xr.destroy(),xr=cn(vr,Sr,Kn,ro,ir),Fr.set(Kn,xr)):(xr=cn(vr,Sr,Kn,ro,ir),Fr.set(Kn,xr)),xr.createOrUpdate({webgl:ir,runtime:Nn},po,ro,{volume:Sr,key:Kn})})).apply(this,arguments)}return{label:ct,get groupCount(){let Nn=0;return Fr.forEach(Kn=>{Kn.renderObject&&(Nn+=Kn.groupCount)}),Nn},get props(){return ro},get params(){return Ro},get state(){return Mr},get theme(){return po},get geometryVersion(){return br.version},renderObjects:Hr,updated:Yn,createOrUpdate:function Bo(Nn={},Kn){Kn&&Kn!==Sr&&(Ro=Yt(dt,Kn),Sr=Kn,ro||(ro=r.t.getDefaultValues(Ro)));const dr=(0,I.m$)(Object.assign({},ro,Nn),Sr);return Object.assign(ro,Nn,dr),Ur=Rn(ro),a.YZ.create("Creating or updating VolumeRepresentation",function(){var xr=(0,o.A)(function*(Ft){const Qt=new Set(Fr.keys());for(let ht=0,pt=Ur.length;ht{var pt;null===(pt=Fr.get(ht))||void 0===pt||pt.destroy(),Fr.delete(ht)}),Hr.length=0,Fr.forEach(ht=>{ht.renderObject&&(Hr.push(ht.renderObject),br.add(ht.renderObject.id,ht.geometryVersion))}),br.snapshot(),Yn.next(er++)});return function(Ft){return xr.apply(this,arguments)}}())},setState:function We(Nn){const{visible:Kn,alphaFactor:dr,pickable:xr,overpaint:Ft,transparency:Qt,emissive:ht,substance:pt,clipping:Xt,transform:fn,themeStrength:on,syncManually:En,markerActions:Tt}=Nn,Fe={};void 0!==Kn&&(Fe.visible=Kn),void 0!==dr&&(Fe.alphaFactor=dr),void 0!==xr&&(Fe.pickable=xr),void 0!==Ft&&(Fe.overpaint=Ft),void 0!==Qt&&(Fe.transparency=Qt),void 0!==ht&&(Fe.emissive=ht),void 0!==pt&&(Fe.substance=pt),void 0!==Xt&&(Fe.clipping=Xt),void 0!==on&&(Fe.themeStrength=on),void 0!==fn&&!s.$I.areEqual(fn,Mr.transform,s.p8)&&(Fe.transform=fn),void 0!==En&&(Fe.syncManually=En),void 0!==Tt&&(Fe.markerActions=Tt),Fr.forEach(He=>function Wo(Nn,Kn){void 0!==Kn.visible&&Nn&&Nn.setVisibility(Kn.visible),void 0!==Kn.alphaFactor&&Nn&&Nn.setAlphaFactor(Kn.alphaFactor),void 0!==Kn.pickable&&Nn&&Nn.setPickable(Kn.pickable),void 0!==Kn.overpaint&&Nn&&Nn.setOverpaint(Kn.overpaint),void 0!==Kn.transparency&&Nn&&Nn.setTransparency(Kn.transparency),void 0!==Kn.emissive&&Nn&&Nn.setEmissive(Kn.emissive),void 0!==Kn.substance&&Nn&&Nn.setSubstance(Kn.substance),void 0!==Kn.clipping&&Nn&&Nn.setClipping(Kn.clipping),void 0!==Kn.transform&&Nn&&Nn.setTransform(Kn.transform),void 0!==Kn.themeStrength&&Nn&&Nn.setThemeStrength(Kn.themeStrength)}(He,Fe)),e.YL.updateState(Mr,Nn)},setTheme:function Pt(Nn){po=Nn},getLoci:Nn=>{let Kn=_.BL;return Fr.forEach(dr=>{const xr=dr.getLoci(Nn);(0,_.$M)(xr)||(Kn=xr)}),Kn},getAllLoci:()=>[xn(Sr,ro)],eachLocation:Nn=>{Fr.forEach(Kn=>{Kn.eachLocation(Nn)})},mark:function Go(Nn,Kn){let dr=!1;return Fr.forEach(xr=>{dr=xr.mark(Nn,Kn)||dr}),dr},destroy:function Sn(){Fr.forEach(Nn=>Nn.destroy()),Fr.clear()}}}var L=n(1888),w=n(364),Q=n(5315),G=n(6115),V=n(4178),U=n(799),N=n(8187),k=n(1692),H=n(7187);const $={isoValue:t.f.IsoValueParam},W=1;function te(ct,dt){if(ct.grid.cells.data.length(0,L.iQ)(dt.grid.cells.data.length,1,1,()=>w.LU),getLoci:j,eachLocation:Z,setUpdateState:(dt,Yt,cn,xn)=>{t.f.IsoValue.areSame(cn.isoValue,xn.isoValue,Yt.grid.stats)||(dt.createGeometry=!0)},geometryUtils:U.X.Utils,mustRecreate:(dt,Yt,cn)=>!Yt.tryUseGpu||!cn||!te(dt.volume,cn),dispose:dt=>{dt.vertexTexture.ref.value.destroy(),dt.groupTexture.ref.value.destroy(),dt.normalTexture.ref.value.destroy(),dt.doubleBuffer.destroy()}},ct)}(ct):function g(ct){return f({defaultProps:r.t.getDefaultValues(ee),createGeometry:q,createLocationIterator:dt=>(0,L.iQ)(dt.grid.cells.data.length,1,1,()=>w.LU),getLoci:j,eachLocation:Z,setUpdateState:(dt,Yt,cn,xn)=>{t.f.IsoValue.areSame(cn.isoValue,xn.isoValue,Yt.grid.stats)||(dt.createGeometry=!0)},geometryUtils:A.e.Utils,mustRecreate:(dt,Yt,cn)=>Yt.tryUseGpu&&!!cn&&te(dt.volume,cn)},ct)}(ct)}function ye(ct,dt){return t.f.Isosurface.Loci(ct,dt.isoValue)}function j(ct,dt,Yt,cn,xn){const{objectId:Rn,groupId:er}=ct;if(xn===Rn){const ir=t.f.PickingGranularity.get(dt);return"volume"===ir?t.f.Loci(dt):"object"===ir?t.f.Isosurface.Loci(dt,cn.isoValue):t.f.Cell.Loci(dt,M.IX.ofSingleton(er))}return _.BL}function Z(ct,dt,Yt,cn,xn){return(0,V.bk)(ct,dt,{isoValue:cn.isoValue},xn)}function q(ct,dt,Yt,cn,xn,Rn){return Y.apply(this,arguments)}function Y(){return(Y=(0,o.A)(function*(ct,dt,Yt,cn,xn,Rn){ct.runtime.update({message:"Marching cubes..."});const er=(0,G.WE)(new Int32Array(dt.grid.cells.data.length)),ir=yield(0,y.O)({isoLevel:t.f.IsoValue.toAbsolute(xn.isoValue,dt.grid.stats).absoluteValue,scalarField:dt.grid.cells,idField:s.qY.create(dt.grid.cells.space,s.qY.Data1(er))},Rn).runAsChild(ct.runtime),Yn=t.x.getGridToCartesianTransform(dt.grid);return A.e.transform(ir,Yn),ct.webgl&&!ct.webgl.isWebGL2?(A.e.uniformTriangleGroup(ir,!1),H.IQ.updateIfChanged(ir.varyingGroup,!1)):H.IQ.updateIfChanged(ir.varyingGroup,!0),ir.setBoundingSphere(t.f.Isosurface.getBoundingSphere(dt,xn.isoValue)),ir})).apply(this,arguments)}const ee={...A.e.Params,...U.X.Params,...$,quality:{...A.e.Params.quality,isEssential:!1},tryUseGpu:r.t.Boolean(!0)};var _e;function xe(ct,dt,Yt,cn,xn,Rn){return le.apply(this,arguments)}function le(){return(le=(0,o.A)(function*(ct,dt,Yt,cn,xn,Rn){if(!ct.webgl)throw new Error("webgl context required to create volume isosurface texture-mesh");if(dt.grid.cells.data.length<=1)return U.X.createEmpty(Rn);const{max:er,min:ir}=dt.grid.stats,Yn=er-ir,br=t.f.IsoValue.toAbsolute(xn.isoValue,dt.grid.stats).absoluteValue,vr=(br-ir)/Yn,{texture:Hr,gridDimension:Mr,gridTexDim:Fr,gridTexScale:Sr,transform:Ur}=_e.get(dt,ct.webgl),Ro=dt.grid.cells.space.axisOrderSlowToFast,ro=Rn?.doubleBuffer.get(),po=(0,N._)(ct.webgl,Hr,Mr,Fr,Sr,Ur,vr,br<0,!1,Ro,!0,ro?.vertex,ro?.group,ro?.normal),so=dt.grid.cells.data.length,ho=t.f.getBoundingSphere(dt),Bo=U.X.create(po.vertexCount,so,po.vertexTexture,po.groupTexture,po.normalTexture,ho,Rn);return Bo.meta.webgl=ct.webgl,Bo})).apply(this,arguments)}function Be(ct,dt,Yt,cn,xn,Rn){return Ce.apply(this,arguments)}function Ce(){return(Ce=(0,o.A)(function*(ct,dt,Yt,cn,xn,Rn){ct.runtime.update({message:"Marching cubes..."});const er=(0,G.WE)(new Int32Array(dt.grid.cells.data.length)),ir=yield(0,y.e)({isoLevel:t.f.IsoValue.toAbsolute(xn.isoValue,dt.grid.stats).absoluteValue,scalarField:dt.grid.cells,idField:s.qY.create(dt.grid.cells.space,s.qY.Data1(er))},Rn).runAsChild(ct.runtime),Yn=t.x.getGridToCartesianTransform(dt.grid);return Q.q.transform(ir,Yn),ir.setBoundingSphere(t.f.Isosurface.getBoundingSphere(dt,xn.isoValue)),ir})).apply(this,arguments)}!function(ct){const dt="volume-isosurface-texture";ct.descriptor=(0,k.e)({name:dt}),ct.get=function Yt(cn,xn){const{resources:Rn}=xn,er=t.x.getGridToCartesianTransform(cn.grid),ir=s.eB.clone(cn.grid.cells.space.dimensions),{width:Yn,height:br,powerOfTwoSize:vr}=(0,V.Ud)(ir,W),Hr=s.eB.create(Yn,br,0),Mr=s.ZY.create(Yn/vr,br/vr);if(vr>xn.maxTextureSize/2)throw new Error("volume too large for gpu isosurface extraction");if(!cn._propertyData[dt]){cn._propertyData[dt]=Rn.texture("image-uint8","alpha","ubyte","linear");const Fr=cn._propertyData[dt];Fr.define(vr,vr),Fr.load((0,V.sz)(cn,"data",W),!0),cn.customProperties.add(ct.descriptor),cn.customProperties.assets(ct.descriptor,[{dispose:()=>Fr.destroy()}])}return ir[0]+=W,ir[1]+=W,{texture:cn._propertyData[dt],transform:er,gridDimension:ir,gridTexDim:Hr,gridTexScale:Mr}}}(_e||(_e={}));const Re={...Q.q.Params,...$,quality:{...Q.q.Params.quality,isEssential:!1},sizeFactor:r.t.Numeric(3,{min:0,max:10,step:.1})};function ke(ct){return f({defaultProps:r.t.getDefaultValues(Re),createGeometry:Be,createLocationIterator:dt=>(0,L.iQ)(dt.grid.cells.data.length,1,1,()=>w.LU),getLoci:j,eachLocation:Z,setUpdateState:(dt,Yt,cn,xn)=>{t.f.IsoValue.areSame(cn.isoValue,xn.isoValue,Yt.grid.stats)||(dt.createGeometry=!0)},geometryUtils:Q.q.Utils},ct)}const we={solid:(ct,dt)=>T("Isosurface mesh",ct,dt,de,ye),wireframe:(ct,dt)=>T("Isosurface wireframe",ct,dt,ke,ye)},Oe={...ee,...Re,visuals:r.t.MultiSelect(["solid"],r.t.objectToOptions(we)),bumpFrequency:r.t.Numeric(1,{min:0,max:10,step:.1},C.iy.ShadingCategory)},Ne={name:"isosurface",label:"Isosurface",description:"Displays a triangulated isosurface of volumetric data.",factory:function Ve(ct,dt){return e.YL.createMulti("Isosurface",ct,dt,e.YL.StateBuilder,we)},getParams:function Se(ct,dt){const Yt=r.t.clone(Oe);return Yt.isoValue=t.f.createIsoValueParam(t.f.IsoValue.relative(2),dt.grid.stats),Yt},defaultValues:r.t.getDefaultValues(Oe),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"uniform"},isApplicable:ct=>!t.f.isEmpty(ct)&&!t.f.Segmentation.get(ct)};var K=n(9359),ne=n(7135),be=n(4559),Te=n(190),ie=n(4951);function ue(ct,dt,Yt,cn,xn,Rn){return re.apply(this,arguments)}function re(){return(re=(0,o.A)(function*(ct,dt,Yt,cn,xn,Rn){const{dimension:{name:er},isoValue:ir}=xn,{space:Yn,data:br}=dt.grid.cells,{min:vr,max:Hr}=dt.grid.stats,Mr=t.f.IsoValue.toAbsolute(ir,dt.grid.stats).absoluteValue,Fr="color"in cn.color?cn.color.color(w.LU,!1):(0,Te.Q1)(16777215),[Sr,Ur,Ro]=Te.Q1.toRgbNormalized(Fr),{width:ro,height:po,x:so,y:ho,z:Bo,x0:Go,y0:Wo,z0:We,nx:Pt,ny:Sn,nz:Nn}=ve(dt.grid,xn),Kn=new Float32Array("x"===er?[so,0,0,so,ho,0,so,0,Bo,so,ho,Bo]:"y"===er?[0,ho,0,so,ho,0,0,ho,Bo,so,ho,Bo]:[0,0,Bo,0,ho,Bo,so,0,Bo,so,ho,Bo]),dr=new Uint8Array(ro*po*4),xr=function ce(ct,dt){const{space:Yt}=ct.cells,{width:cn,height:xn,x0:Rn,y0:er,z0:ir,nx:Yn,ny:br,nz:vr}=ve(ct,dt),Hr=new Uint8Array(cn*xn*4);let Mr=0;for(let Fr=er;Fr=Mr?255:0,Ft+=4}const Qt={width:ro,height:po,array:dr,flipY:!0},ht={width:ro,height:po,array:xr,flipY:!0},pt=t.x.getGridToCartesianTransform(dt.grid);return(0,be.pi)(pt,Kn,0,4),ne._V.create(Qt,Kn,ht,Rn)})).apply(this,arguments)}function ve(ct,dt){const{dimension:{name:Yt,params:cn}}=dt,{space:xn}=ct.cells;let Rn,er,ir,Yn,br,vr=0,Hr=0,Mr=0,[Fr,Sr,Ur]=xn.dimensions;return"x"===Yt?(ir=cn,Yn=Sr-1,br=Ur-1,Rn=Ur,er=Sr,vr=ir,Fr=vr+1):"y"===Yt?(ir=Fr-1,Yn=cn,br=Ur-1,Rn=Ur,er=Fr,Hr=Yn,Sr=Hr+1):(ir=Fr-1,Yn=Sr-1,br=cn,Rn=Fr,er=Sr,Mr=br,Ur=Mr+1),{width:Rn,height:er,x:ir,y:Yn,z:br,x0:vr,y0:Hr,z0:Mr,nx:Fr,ny:Sr,nz:Ur}}function ae(ct,dt){const Yt=function se(ct,dt){const{space:Yt}=ct.cells,{width:cn,height:xn,x0:Rn,y0:er,z0:ir,nx:Yn,ny:br,nz:vr}=ve(ct,dt),Hr=new Uint32Array(cn*xn);let Mr=0;for(let Fr=er;Fr(0,L.iQ)(dt.grid.cells.data.length,1,1,()=>w.LU),getLoci:ge,eachLocation:Ie,setUpdateState:(dt,Yt,cn,xn,Rn,er)=>{dt.createGeometry=cn.dimension.name!==xn.dimension.name||cn.dimension.params!==xn.dimension.params||!t.f.IsoValue.areSame(cn.isoValue,xn.isoValue,Yt.grid.stats)||!l.J.areEqual(Rn.color,er.color)},geometryUtils:{...ne._V.Utils,createRenderableState:dt=>{const Yt=ne._V.Utils.createRenderableState(dt);return Lt(Yt,dt),Yt},updateRenderableState:Lt}},ct)}function Lt(ct,dt){ne._V.Utils.updateRenderableState(ct,dt),ct.opaque=!1,ct.writeDepth=!0}const en={name:"slice",label:"Slice",description:"Slice of volume rendered as image with interpolation.",factory:function Je(ct,dt){return T("Slice",ct,dt,je,ae)},getParams:function nt(ct,dt){const Yt=r.t.clone(Le),cn=dt.grid.cells.space.dimensions;return Yt.dimension=r.t.MappedStatic("x",{x:r.t.Numeric(0,{min:0,max:cn[0]-1,step:1}),y:r.t.Numeric(0,{min:0,max:cn[1]-1,step:1}),z:r.t.Numeric(0,{min:0,max:cn[2]-1,step:1})},{isEssential:!0}),Yt.isoValue=t.f.createIsoValueParam(t.f.IsoValue.absolute(dt.grid.stats.min),dt.grid.stats),Yt},defaultValues:r.t.getDefaultValues(Le),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"uniform"},isApplicable:ct=>!t.f.isEmpty(ct)&&!t.f.Segmentation.get(ct)};var Bt=n(5384),pn=n(9928);function $e(ct,dt){const Yt=(0,Bt.DJ)();return Bt.DJ.add(Yt,ct),Bt.DJ.transform(Yt,Yt,dt),Yt}function _t(ct){if("matrix"===ct.transform.kind)return{unitToCartn:s.$I.mul((0,s.$I)(),ct.transform.matrix,s.$I.fromScaling((0,s.$I)(),ct.cells.space.dimensions)),cellDim:s.$I.getScaling((0,s.eB)(),ct.transform.matrix)};const dt=ct.transform.fractionalBox,Yt=Bt.DJ.size((0,s.eB)(),dt);return{unitToCartn:s.$I.mul3((0,s.$I)(),ct.transform.cell.fromFractional,s.$I.fromTranslation((0,s.$I)(),dt.min),s.$I.fromScaling((0,s.$I)(),Yt)),cellDim:s.eB.div((0,s.eB)(),ct.transform.cell.size,ct.cells.space.dimensions)}}function Ke(ct,dt,Yt,cn,xn,Rn){return ut.apply(this,arguments)}function ut(){return(ut=(0,o.A)(function*(ct,dt,Yt,cn,xn,Rn){const{webgl:ir}=ct;if(void 0===ir)throw new Error("DirectVolumeVisual requires `webgl` in props");return ir.isWebGL2?function Me(ct,dt,Yt,cn){const xn=Yt.grid.cells.space.dimensions;if(Math.max(...xn)>dt.max3dTextureSize/2)throw new Error("volume too large for direct-volume rendering");const Rn=(0,V.tO)(Yt),er=t.x.getGridToCartesianTransform(Yt.grid),ir=$e(xn,er),Yn=cn?cn.gridTexture.ref.value:dt.resources.texture("volume-uint8","rgba","ubyte","linear");Yn.load(Rn);const{unitToCartn:br,cellDim:vr}=_t(Yt.grid);return pn.E.create(ir,xn,er,br,vr,Yn,Yt.grid.stats,!1,Yt.grid.cells.space.axisOrderSlowToFast,cn)}(0,ir,dt,Rn):function mt(ct,dt,Yt,cn){const xn=Yt.grid.cells.space.dimensions,{width:Rn,height:er}=(0,V.Ud)(xn);if(Math.max(Rn,er)>dt.maxTextureSize/2)throw new Error("volume too large for direct-volume rendering");const ir=(0,V.sz)(Yt,"normals"),Yn=t.x.getGridToCartesianTransform(Yt.grid),br=$e(xn,Yn),vr=cn?cn.gridTexture.ref.value:dt.resources.texture("image-uint8","rgba","ubyte","linear");vr.load(ir);const{unitToCartn:Hr,cellDim:Mr}=_t(Yt.grid);return pn.E.create(br,xn,Yn,Hr,Mr,vr,Yt.grid.stats,!1,Yt.grid.cells.space.axisOrderSlowToFast,cn)}(0,ir,dt,Rn)})).apply(this,arguments)}function Kt(ct,dt){return t.f.Loci(ct)}function sn(ct,dt,Yt,cn,xn){const{objectId:Rn,groupId:er}=ct;return xn===Rn?t.f.Cell.Loci(dt,M.IX.ofSingleton(er)):_.BL}function gt(ct,dt,Yt,cn,xn){return(0,V.bk)(ct,dt,void 0,xn)}const yt={...pn.E.Params,quality:{...pn.E.Params.quality,isEssential:!1}};function Gt(ct){return f({defaultProps:r.t.getDefaultValues(yt),createGeometry:Ke,createLocationIterator:dt=>(0,L.iQ)(dt.grid.cells.data.length,1,1,()=>w.LU),getLoci:sn,eachLocation:gt,setUpdateState:(dt,Yt,cn,xn)=>{},geometryUtils:pn.E.Utils,dispose:dt=>{dt.gridTexture.ref.value.destroy()}},ct)}const tt={name:"direct-volume",label:"Direct Volume",description:"Direct rendering of volumetric data.",factory:function rn(ct,dt){return T("Direct Volume",ct,dt,Gt,Kt)},getParams:function At(ct,dt){const Yt=r.t.clone(yt);return Yt.controlPoints.getVolume=()=>dt,Yt},defaultValues:r.t.getDefaultValues(yt),defaultColorTheme:{name:"volume-value"},defaultSizeTheme:{name:"uniform"},isApplicable:ct=>!t.f.isEmpty(ct)&&!t.f.Segmentation.get(ct)};var Mt=n(6642);const nn={segments:r.t.Converted(ct=>ct.map(dt=>`${dt}`),ct=>ct.map(dt=>parseInt(dt)),r.t.MultiSelect(["0"],r.t.arrayToOptions(["0"]),{isEssential:!0}))},Dn=1;function jt(ct,dt){if(ct.grid.cells.data.length{const cn=t.f.Segment.Location(dt,Yt);return(0,L.iQ)(dt.grid.cells.data.length,1,1,()=>cn)},getLoci:Vt,eachLocation:Wt,setUpdateState:(dt,Yt,cn,xn)=>{},geometryUtils:U.X.Utils,mustRecreate:(dt,Yt,cn)=>!Yt.tryUseGpu||!cn||!jt(dt.volume,cn),dispose:dt=>{dt.vertexTexture.ref.value.destroy(),dt.groupTexture.ref.value.destroy(),dt.normalTexture.ref.value.destroy(),dt.doubleBuffer.destroy()}},ct)}(ct):function An(ct){return f({defaultProps:r.t.getDefaultValues(Ot),createGeometry:Zt,createLocationIterator:(dt,Yt)=>{const cn=t.f.Segment.Location(dt,Yt);return(0,L.iQ)(dt.grid.cells.data.length,1,1,()=>cn)},getLoci:Vt,eachLocation:Wt,setUpdateState:(dt,Yt,cn,xn)=>{},geometryUtils:A.e.Utils,mustRecreate:(dt,Yt,cn)=>Yt.tryUseGpu&&!!cn&&jt(dt.volume,cn)},ct)}(ct)}function $t(ct,dt){return t.f.Segment.Loci(ct,dt.segments)}function Vt(ct,dt,Yt,cn,xn){const{objectId:Rn,groupId:er}=ct;if(xn===Rn){const ir=t.f.PickingGranularity.get(dt);return"volume"===ir?t.f.Loci(dt):"object"===ir?t.f.Segment.Loci(dt,[Yt]):t.f.Cell.Loci(dt,M.IX.ofSingleton(er))}return _.BL}function Wt(ct,dt,Yt,cn,xn){const Rn=M.SortedArray.ofSingleton(Yt);return(0,V.bk)(ct,dt,{segments:Rn},xn)}function Zt(ct,dt,Yt,cn,xn,Rn){return kt.apply(this,arguments)}function kt(){return(kt=(0,o.A)(function*(ct,dt,Yt,cn,xn,Rn){const er=t.f.Segmentation.get(dt);if(!er)throw new Error("missing volume segmentation");ct.runtime.update({message:"Marching cubes..."});const ir=Mt.D.clone(er.bounds[Yt]);Mt.D.expand(ir,ir,s.eB.create(2,2,2));const br=function yn(ct,dt,Yt){const cn=Yt.data,xn=Yt.space.dataOffset,Rn=Mt.D.size((0,s.eB)(),dt),[er,ir,Yn]=Rn,br=er-1,vr=ir-1,Hr=Yn-1,[Mr,Fr,Sr]=dt.min,[Ur,Ro,ro]=dt.max,po=[...Yt.space.axisOrderSlowToFast],so=s.qY.Space(Rn,po,Uint8Array),ho=s.qY.create(so,so.create()),Bo=ho.data,Go=so.set;for(let Wo=0;WoYt.maxTextureSize/2)throw new Error("volume too large for gpu segment extraction");Yt.namedTextures[jn]||(Yt.namedTextures[jn]=xn.texture("image-uint8","alpha","ubyte","linear"));const Fr=Yt.namedTextures[jn];Fr.define(vr,vr);const Sr=Array.from(cn.segments.get(dt).values());return Fr.load((0,V.td)(ct,Sr,Rn,Dn),!0),ir[0]+=Dn,ir[1]+=Dn,{texture:Fr,transform:er,gridDimension:ir,gridTexDim:Hr,gridTexScale:Mr}}(dt,Yt,ct.webgl),Hr=dt.grid.cells.space.axisOrderSlowToFast,Mr=Rn?.doubleBuffer.get(),Fr=(0,N._)(ct.webgl,er,ir,Yn,br,vr,.5,!1,!1,Hr,!0,Mr?.vertex,Mr?.group,Mr?.normal);return U.X.create(Fr.vertexCount,dt.grid.cells.data.length,Fr.vertexTexture,Fr.groupTexture,Fr.normalTexture,t.f.Segment.getBoundingSphere(dt,[Yt]),Rn)})).apply(this,arguments)}function or(ct){return M.SortedArray.ofUnsortedArray(ct.segments)}const Nr={segment:(ct,dt)=>T("Segment mesh",ct,dt,Ct,$t,or)},Ir={...Ot,visuals:r.t.MultiSelect(["segment"],r.t.objectToOptions(Nr)),bumpFrequency:r.t.Numeric(1,{min:0,max:10,step:.1},C.iy.ShadingCategory)},To={name:"segment",label:"Segment",description:"Displays a triangulated segment of volumetric data.",factory:function Jr(ct,dt){return e.YL.createMulti("Segment",ct,dt,e.YL.StateBuilder,Nr)},getParams:function Or(ct,dt){const Yt=r.t.clone(Ir),cn=t.f.Segmentation.get(dt);if(cn){const xn=Array.from(cn.segments.keys());Yt.segments=r.t.Converted(Rn=>Rn.map(er=>`${er}`),Rn=>Rn.map(er=>parseInt(er)),r.t.MultiSelect(xn.map(Rn=>`${Rn}`),r.t.arrayToOptions(xn.map(Rn=>`${Rn}`)),{isEssential:!0}))}return Yt},defaultValues:r.t.getDefaultValues(Ir),defaultColorTheme:{name:"volume-segment"},defaultSizeTheme:{name:"uniform"},isApplicable:ct=>!t.f.isEmpty(ct)&&!!t.f.Segmentation.get(ct)};class un extends e.lN{constructor(){super(),(0,K.IF)(un.BuiltIn,(dt,Yt)=>{if(dt.name!==Yt)throw new Error(`Fix BuiltInVolumeRepresentations to have matching names. ${dt.name} ${Yt}`);this.add(dt)})}}(un||(un={})).BuiltIn={isosurface:Ne,slice:en,"direct-volume":tt,segment:To}},4178:(tn,Ue,n)=>{"use strict";n.d(Ue,{Ud:()=>l,bk:()=>I,sz:()=>m,tO:()=>u,td:()=>d});var e=n(6853),o=n(3543),r=n(2028),t=n(2086),A=n(4951),y=n(9986),c=n(5384);const i=t.e.set,v=t.e.normalize,O=t.e.sub,b=t.e.addScalar,_=t.e.scale,M=t.e.toArray;function I(s,C,h,a){let S=!1;if(e.f.isLoci(s)){if(!e.f.areEquivalent(s.volume,C))return!1;a(o.IX.ofLength(C.grid.cells.data.length))&&(S=!0)}else if(e.f.Isosurface.isLoci(s)){if(!e.f.areEquivalent(s.volume,C))return!1;if(h?.isoValue){if(!e.f.IsoValue.areSame(s.isoValue,h.isoValue,C.grid.stats))return!1;a(o.IX.ofLength(C.grid.cells.data.length))&&(S=!0)}else{const{stats:D,cells:{data:R}}=C.grid,f=D.sigma,p=e.f.IsoValue.toAbsolute(s.isoValue,D).absoluteValue;for(let E=0,T=R.length;E{a(o.IX.ofSingleton(D))&&(S=!0)})}else if(e.f.Segment.isLoci(s)){if(!e.f.areEquivalent(s.volume,C))return!1;if(h?.segments){if(!o.SortedArray.areIntersecting(s.segments,h.segments))return!1;a(o.IX.ofLength(C.grid.cells.data.length))&&(S=!0)}else{const D=e.f.Segmentation.get(C);if(D){const R=new Set;for(let E=0,T=s.segments.length;E{"use strict";n.d(Ue,{J:()=>o});var o,e=n(643);!function(r){r.core=e.AN.core,r.struct=e.AN.structureQuery,r.internal=e.AN.internal,r.atomName=function t(h){return r.struct.type.atomName([h])},r.es=function A(h){return r.struct.type.elementSymbol([h])},r.list=function y(...h){return r.core.type.list(h)},r.set=function c(...h){return r.core.type.set(h)},r.re=function i(h,a){return r.core.type.regex([h,a])},r.fn=function v(h){return r.core.ctrl.fn([h])},r.evaluate=function O(h){return r.core.ctrl.eval([h])};const b=r.struct.atomProperty.core,_=r.struct.atomProperty.macromolecular,M=r.struct.atomProperty.topology;function I(h){return b[h]()}function l(h){return M[h]()}function m(h){return _[h]()}r.acp=I,r.atp=l,r.ammp=m;const u=r.struct.atomSet.propertySet;r.acpSet=function d(h){return u([I(h)])},r.atpSet=function s(h){return u([l(h)])},r.ammpSet=function C(h){return u([m(h)])}}(o||(o={}))},9920:(tn,Ue,n)=>{"use strict";var e;n.d(Ue,{r:()=>e}),function(o){function i(O){return!!O&&!!O.head&&"object"==typeof O}function v(O){return!!O&&"string"==typeof O.name}o.Symbol=function r(O){return{name:O}},o.Apply=function t(O,b){return b?{head:O,args:b}:{head:O}},o.isArgumentsArray=function A(O){return!!O&&Array.isArray(O)},o.isArgumentsMap=function y(O){return!!O&&!Array.isArray(O)},o.isLiteral=function c(O){return!i(O)&&!v(O)},o.isApply=i,o.isSymbol=v}(e||(e={}))},685:(tn,Ue,n)=>{"use strict";n.d(Ue,{HR:()=>o,br:()=>t,ec:()=>r});var e=n(3170);function o(i,v,O){return(0,e.EX)("",i,v,O)}function r(i){y("","",i)}function t(i){const v=[];return c(i,v),v}function A(i){const v=/([a-z])([A-Z])([a-z]|$)/g;return i.replace(v,(O,b,_,M)=>`${b}-${_.toLocaleLowerCase()}${M}`).replace(v,(O,b,_,M)=>`${b}-${_.toLocaleLowerCase()}${M}`)}function y(i,v,O){if((0,e.Bm)(O))return O.info.namespace=i,O.info.name=O.info.name||A(v),void(O.id=`${O.info.namespace}.${O.info.name}`);const b=`${O["@namespace"]||A(v)}`,_=i?`${i}.${b}`:b;for(const M of Object.keys(O))"object"!=typeof O[M]&&!(0,e.Bm)(O[M])||y(_,M,O[M])}function c(i,v){if((0,e.Bm)(i))v.push(i);else for(const O of Object.keys(i))"object"!=typeof i[O]&&!(0,e.Bm)(i[O])||c(i[O],v)}},643:(tn,Ue,n)=>{"use strict";n.d(Ue,{AN:()=>i});var e=n(2513),o=n(6452),r=n(6430),t=n(3170),A=n(685);const c={"@header":"Internal Queries",generator:{"@header":"Generators",bundleElement:(0,A.HR)(t.d3.Dictionary({groupedUnits:(0,t.ef)(r.Z.Any),set:(0,t.ef)(r.Z.Any),ranges:(0,t.ef)(r.Z.Any)}),r.Z.Any),bundle:(0,A.HR)(t.d3.Dictionary({elements:(0,t.ef)(r.Z.Any)}),o.O.ElementSelectionQuery,"A selection with single structure containing represented by the bundle."),current:(0,A.HR)(t.d3.None,o.O.ElementSelectionQuery,"Current selection provided by the query context. Avoid using this in State Transforms.")}},i={core:e.I8,structureQuery:o.q,internal:c};(0,A.ec)(i);const v=(0,A.br)(i);!function(){const b=Object.create(null);for(const _ of v)b[_.id]=_}()},2513:(tn,Ue,n)=>{"use strict";n.d(Ue,{I8:()=>d,Or:()=>t});var t,h,e=n(6430),o=n(3170),r=n(685);function A(h,a){return(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(h)}),h,a)}function y(h,a){return(0,r.HR)(o.d3.List(h,{nonEmpty:!0}),h,a)}function c(h,a,S){return(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(h),1:(0,o.ef)(h)}),a,S)}(h=t||(t={})).AnyVar=e.Z.Variable("a",e.Z.Any),h.AnyValueVar=e.Z.Variable("a",e.Z.Any),h.ConstrainedVar=e.Z.Variable("a",e.Z.Any,!0),h.Regex=e.Z.Value("Core","Regex"),h.Set=a=>e.Z.Container("Core","Set",a||h.AnyValueVar),h.List=a=>e.Z.Container("Core","List",a||h.AnyVar),h.Fn=(a,S)=>e.Z.Container("Core","Fn",a||h.AnyVar,S),h.Flags=(a,S)=>e.Z.Container("Core","Flags",a,S),h.BitFlags=h.Flags(e.Z.Num,"BitFlags"),o.d3.Dictionary({0:(0,o.ef)(e.Z.Num),1:(0,o.ef)(e.Z.Num)});const d={"@header":"Language Primitives",type:{"@header":"Types",bool:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.AnyValue)}),e.Z.Bool,"Convert a value to boolean."),num:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.AnyValue)}),e.Z.Num,"Convert a value to number."),str:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.AnyValue)}),e.Z.Str,"Convert a value to string."),regex:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.Str,{description:"Expression"}),1:(0,o.ef)(e.Z.Str,{isOptional:!0,description:"Flags, e.g. 'i' for ignore case"})}),t.Regex,"Creates a regular expression from a string using the ECMAscript syntax."),list:(0,r.HR)(o.d3.List(t.AnyVar),t.List()),set:(0,r.HR)(o.d3.List(t.AnyValueVar),t.Set()),bitflags:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.Num)}),t.BitFlags,"Interpret a number as bitflags."),compositeKey:(0,r.HR)(o.d3.List(e.Z.AnyValue),e.Z.AnyValue)},logic:{"@header":"Logic",not:A(e.Z.Bool),and:y(e.Z.Bool),or:y(e.Z.Bool)},ctrl:{"@header":"Control",eval:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.Fn(t.AnyVar))}),t.AnyVar,"Evaluate a function."),fn:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.AnyVar)}),t.Fn(t.AnyVar),'Wrap an expression to a "lazy" function.'),if:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.Bool,{description:"Condition"}),1:(0,o.ef)(e.Z.Variable("a",e.Z.Any),{description:"If true"}),2:(0,o.ef)(e.Z.Variable("b",e.Z.Any),{description:"If false"})}),e.Z.Union([e.Z.Variable("a",e.Z.Any),e.Z.Variable("b",e.Z.Any)])),assoc:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.Str,{description:"Name"}),1:(0,o.ef)(e.Z.Variable("a",e.Z.Any),{description:"Value to assign"})}),e.Z.Variable("a",e.Z.Any))},rel:{"@header":"Relational",eq:c(e.Z.Variable("a",e.Z.AnyValue,!0),e.Z.Bool),neq:c(e.Z.Variable("a",e.Z.AnyValue,!0),e.Z.Bool),lt:c(e.Z.Num,e.Z.Bool),lte:c(e.Z.Num,e.Z.Bool),gr:c(e.Z.Num,e.Z.Bool),gre:c(e.Z.Num,e.Z.Bool),inRange:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.Num,{description:"Value to test"}),1:(0,o.ef)(e.Z.Num,{description:"Minimum value"}),2:(0,o.ef)(e.Z.Num,{description:"Maximum value"})}),e.Z.Bool,"Check if the value of the 1st argument is >= 2nd and <= 3rd.")},math:{"@header":"Math",add:y(e.Z.Num),sub:y(e.Z.Num),mult:y(e.Z.Num),div:c(e.Z.Num,e.Z.Num),pow:c(e.Z.Num,e.Z.Num),mod:c(e.Z.Num,e.Z.Num),min:y(e.Z.Num),max:y(e.Z.Num),cantorPairing:c(e.Z.Num,e.Z.Num),sortedCantorPairing:c(e.Z.Num,e.Z.Num),invertCantorPairing:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(e.Z.Num)}),t.List(e.Z.Num)),floor:A(e.Z.Num),ceil:A(e.Z.Num),roundInt:A(e.Z.Num),trunc:A(e.Z.Num),abs:A(e.Z.Num),sign:A(e.Z.Num),sqrt:A(e.Z.Num),cbrt:A(e.Z.Num),sin:A(e.Z.Num),cos:A(e.Z.Num),tan:A(e.Z.Num),asin:A(e.Z.Num),acos:A(e.Z.Num),atan:A(e.Z.Num),sinh:A(e.Z.Num),cosh:A(e.Z.Num),tanh:A(e.Z.Num),exp:A(e.Z.Num),log:A(e.Z.Num),log10:A(e.Z.Num),atan2:c(e.Z.Num,e.Z.Num)},str:{"@header":"Strings",concat:y(e.Z.Str),match:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.Regex),1:(0,o.ef)(e.Z.Str)}),e.Z.Bool)},list:{"@header":"Lists",getAt:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.List()),1:(0,o.ef)(e.Z.Num)}),t.AnyVar),equal:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.List()),1:(0,o.ef)(t.List())}),e.Z.Bool)},set:{"@header":"Sets",has:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.Set(t.ConstrainedVar)),1:(0,o.ef)(t.ConstrainedVar)}),e.Z.Bool,"Check if the the 1st argument includes the value of the 2nd."),isSubset:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.Set(t.ConstrainedVar)),1:(0,o.ef)(t.Set(t.ConstrainedVar))}),e.Z.Bool,"Check if the the 1st argument is a subset of the 2nd.")},flags:{"@header":"Flags",hasAny:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.Flags(t.ConstrainedVar)),1:(0,o.ef)(t.Flags(t.ConstrainedVar))}),e.Z.Bool,"Check if the the 1st argument has at least one of the 2nd one's flags."),hasAll:(0,r.HR)(o.d3.Dictionary({0:(0,o.ef)(t.Flags(t.ConstrainedVar)),1:(0,o.ef)(t.Flags(t.ConstrainedVar))}),e.Z.Bool,"Check if the the 1st argument has all 2nd one's flags.")}};(0,r.ec)(d);const s=(0,r.br)(d);!function(){const h=Object.create(null);for(const a of s)h[a.id]=a}()},6452:(tn,Ue,n)=>{"use strict";n.d(Ue,{O:()=>A,q:()=>u});var A,d,e=n(6430),o=n(2513),r=n(3170),t=n(685);function l(d,s){return(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementReference,{isOptional:!0,defaultValue:"slot.current-atom"})}),d,s)}function m(d,s){return(0,t.HR)(r.d3.None,d,s)}(d=A||(A={})).ElementSymbol=e.Z.Value("Structure","ElementSymbol"),d.AtomName=e.Z.Value("Structure","AtomName"),d.BondFlag=e.Z.OneOf("Structure","BondFlag",e.Z.Str,["covalent","metallic","ion","hydrogen","sulfide","computed","aromatic"]),d.BondFlags=o.Or.Flags(d.BondFlag,"BondFlags"),d.SecondaryStructureFlag=e.Z.OneOf("Structure","SecondaryStructureFlag",e.Z.Str,["alpha","beta","3-10","pi","sheet","strand","helix","turn","none"]),d.SecondaryStructureFlags=o.Or.Flags(d.SecondaryStructureFlag,"SecondaryStructureFlag"),d.RingFingerprint=e.Z.Value("Structure","RingFingerprint"),d.EntityType=e.Z.OneOf("Structure","EntityType",e.Z.Str,["polymer","non-polymer","water","branched"]),d.EntitySubtype=e.Z.OneOf("Structure","EntitySubtype",e.Z.Str,["other","polypeptide(D)","polypeptide(L)","polydeoxyribonucleotide","polyribonucleotide","polydeoxyribonucleotide/polyribonucleotide hybrid","cyclic-pseudo-peptide","peptide nucleic acid","oligosaccharide"]),d.ObjectPrimitive=e.Z.OneOf("Structure","ObjectPrimitive",e.Z.Str,["atomistic","sphere","gaussian","other"]),d.ResidueId=e.Z.Value("Structure","ResidueId"),d.ElementSet=e.Z.Value("Structure","ElementSet"),d.ElementSelection=e.Z.Value("Structure","ElementSelection"),d.ElementReference=e.Z.Value("Structure","ElementReference"),d.ElementSelectionQuery=o.Or.Fn(d.ElementSelection,"ElementSelectionQuery");const u={"@header":"Structure Queries",type:{"@header":"Types",elementSymbol:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(e.Z.Str)}),A.ElementSymbol,"Create element symbol representation from a string value."),atomName:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(e.Z.AnyValue)}),A.AtomName,"Convert a value to an atom name."),entityType:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.EntityType)}),A.EntityType,`Create normalized representation of entity type: ${e.Z.oneOfValues(A.EntityType).join(", ")}.`),bondFlags:(0,t.HR)(r.d3.List(A.BondFlag),A.BondFlags,`Create bond flags representation from a list of strings. Allowed flags: ${e.Z.oneOfValues(A.BondFlag).join(", ")}.`),ringFingerprint:(0,t.HR)(r.d3.List(A.ElementSymbol,{nonEmpty:!0}),A.RingFingerprint,"Create ring fingerprint from the supplied atom element list."),secondaryStructureFlags:(0,t.HR)(r.d3.List(A.SecondaryStructureFlag),A.SecondaryStructureFlags,`Create secondary structure flags representation from a list of strings. Allowed flags: ${e.Z.oneOfValues(A.SecondaryStructureFlag).join(", ")}.`),authResidueId:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(e.Z.Str,{description:"auth_asym_id"}),1:(0,r.ef)(e.Z.Num,{description:"auth_seq_id"}),2:(0,r.ef)(e.Z.Str,{description:"pdbx_PDB_ins_code",isOptional:!0})}),A.ResidueId,'Residue identifier based on "auth_" annotation.'),labelResidueId:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(e.Z.Str,{description:"label_entity_id"}),1:(0,r.ef)(e.Z.Str,{description:"label_asym_id"}),2:(0,r.ef)(e.Z.Num,{description:"label_seq_id"}),3:(0,r.ef)(e.Z.Str,{description:"pdbx_PDB_ins_code",isOptional:!0})}),A.ResidueId,'Residue identifier based on mmCIF\'s "label_" annotation.')},slot:{"@header":"Iteration Slots",element:(0,t.HR)(r.d3.None,A.ElementReference,"A reference to the current element."),elementSetReduce:(0,t.HR)(r.d3.None,e.Z.Variable("a",e.Z.AnyValue,!0),"Current value of the element set reducer.")},generator:{"@header":"Generators",all:(0,t.HR)(r.d3.None,A.ElementSelectionQuery,"The entire structure."),atomGroups:(0,t.HR)(r.d3.Dictionary({"entity-test":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!0,description:"Test for the 1st atom of every entity"}),"chain-test":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!0,description:"Test for the 1st atom of every chain"}),"residue-test":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!0,description:"Test for the 1st atom every residue"}),"atom-test":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!0}),"group-by":(0,r.ef)(e.Z.Any,{isOptional:!0,defaultValue:"atom-key",description:"Group atoms to sets based on this property. Default: each atom has its own set"})}),A.ElementSelectionQuery,"Return all atoms for which the tests are satisfied, grouped into sets."),bondedAtomicPairs:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:"true for covalent bonds",description:"Test each bond with this predicate. Each bond is visited twice with swapped atom order."})}),A.ElementSelectionQuery,"Return all pairs of atoms for which the test is satisfied."),rings:(0,t.HR)(r.d3.Dictionary({fingerprint:(0,r.ef)(A.RingFingerprint,{isOptional:!0}),"only-aromatic":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!1})}),A.ElementSelectionQuery,"Return all rings or those with the specified fingerprint and/or only aromatic rings."),queryInSelection:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),query:(0,r.ef)(A.ElementSelectionQuery),"in-complement":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!1})}),A.ElementSelectionQuery,"Executes query only on atoms that are in the source selection."),empty:(0,t.HR)(r.d3.None,A.ElementSelectionQuery,"Nada.")},modifier:{"@header":"Selection Modifications",queryEach:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),query:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"Query every atom set in the input selection separately."),intersectBy:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),by:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"Intersect each atom set from the first sequence from atoms in the second one."),exceptBy:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),by:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"Remove all atoms from 'selection' that occur in 'by'."),unionBy:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),by:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"For each atom set A in the orginal sequence, combine all atoms sets in the target selection that intersect with A."),union:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"Collects all atom sets in the sequence into a single atom set."),cluster:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),"min-distance":(0,r.ef)(e.Z.Num,{isOptional:!0,defaultValue:0}),"max-distance":(0,r.ef)(e.Z.Num),"min-size":(0,r.ef)(e.Z.Num,{description:"Minimal number of sets to merge, must be at least 2",isOptional:!0,defaultValue:2}),"max-size":(0,r.ef)(e.Z.Num,{description:"Maximal number of sets to merge, if not set, no limit",isOptional:!0})}),A.ElementSelectionQuery,"Combines atom sets that have mutual distance in the interval [min-radius, max-radius]. Minimum/maximum size determines how many atom sets can be combined."),includeSurroundings:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),radius:(0,r.ef)(e.Z.Num),"atom-radius":(0,r.ef)(e.Z.Num,{isOptional:!0,defaultValue:0,description:"Value added to each atom before the distance check, for example VDW radius. Using this argument is computationally demanding."}),"as-whole-residues":(0,r.ef)(e.Z.Bool,{isOptional:!0})}),A.ElementSelectionQuery,"For each atom set in the selection, include all surrouding atoms/residues that are within the specified radius."),surroundingLigands:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),radius:(0,r.ef)(e.Z.Num),"include-water":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!0})}),A.ElementSelectionQuery,"Find all ligands components around the source query."),includeConnected:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),"bond-test":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:"true for covalent bonds"}),"layer-count":(0,r.ef)(e.Z.Num,{isOptional:!0,defaultValue:1,description:"Number of bonded layers to include."}),"fixed-point":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!1,description:"Continue adding layers as long as new connections exist."}),"as-whole-residues":(0,r.ef)(e.Z.Bool,{isOptional:!0})}),A.ElementSelectionQuery,"Pick all atom sets that are connected to the target."),wholeResidues:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"Expand the selection to whole residues."),expandProperty:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),property:(0,r.ef)(e.Z.AnyValue)}),A.ElementSelectionQuery,"To each atom set in the selection, add all atoms that have the same property value that was already present in the set.")},filter:{"@header":"Selection Filters",pick:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),test:(0,r.ef)(e.Z.Bool)}),A.ElementSelectionQuery,"Pick all atom sets that satisfy the test."),first:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"Take the 1st atom set in the sequence."),withSameAtomProperties:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),source:(0,r.ef)(A.ElementSelectionQuery),property:(0,r.ef)(e.Z.Any)}),A.ElementSelectionQuery,"Pick all atom sets for which the set of given atom properties is a subset of the source properties."),intersectedBy:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),by:(0,r.ef)(A.ElementSelectionQuery)}),A.ElementSelectionQuery,"Pick all atom sets that have non-zero intersection with the target."),within:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),target:(0,r.ef)(A.ElementSelectionQuery),"min-radius":(0,r.ef)(e.Z.Num,{isOptional:!0,defaultValue:0}),"max-radius":(0,r.ef)(e.Z.Num),"atom-radius":(0,r.ef)(e.Z.Num,{isOptional:!0,defaultValue:0,description:"Value added to each atom before the distance check, for example VDW radius. Using this argument is computationally demanding."}),invert:(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!1,description:"If true, pick only atom sets that are further than the specified radius."})}),A.ElementSelectionQuery,"Pick all atom sets from selection that have any atom within the radius of any atom from target."),isConnectedTo:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery),target:(0,r.ef)(A.ElementSelectionQuery),"bond-test":(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:"true for covalent bonds"}),disjunct:(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!0,description:"If true, there must exist a bond to an atom that lies outside the given atom set to pass test."}),invert:(0,r.ef)(e.Z.Bool,{isOptional:!0,defaultValue:!1,description:"If true, return atom sets that are not connected."})}),A.ElementSelectionQuery,"Pick all atom sets that are connected to the target.")},combinator:{"@header":"Selection Combinators",intersect:(0,t.HR)(r.d3.List(A.ElementSelectionQuery),A.ElementSelectionQuery,"Return all unique atom sets that appear in all of the source selections."),merge:(0,t.HR)(r.d3.List(A.ElementSelectionQuery),A.ElementSelectionQuery,"Merges multiple selections into a single one. Only unique atom sets are kept."),distanceCluster:(0,t.HR)(r.d3.Dictionary({matrix:(0,r.ef)(o.Or.List(o.Or.List(e.Z.Num)),{description:"Distance matrix, represented as list of rows (num[][])). Lower triangle is min distance, upper triangle is max distance."}),selections:(0,r.ef)(o.Or.List(A.ElementSelectionQuery),{description:"A list of held selections."})}),A.ElementSelectionQuery,"Pick combinations of atom sets from the source sequences that are mutually within distances specified by a matrix.")},atomSet:{"@header":"Atom Sets",atomCount:(0,t.HR)(r.d3.None,e.Z.Num),countQuery:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementSelectionQuery)}),e.Z.Num,"Counts the number of occurences of a specific query inside the current atom set."),reduce:(0,t.HR)(r.d3.Dictionary({initial:(0,r.ef)(e.Z.Variable("a",e.Z.AnyValue,!0),{description:"Initial value assigned to slot.atom-set-reduce. Current atom is set to the 1st atom of the current set for this."}),value:(0,r.ef)(e.Z.Variable("a",e.Z.AnyValue,!0),{description:"Expression executed for each atom in the set"})}),e.Z.Variable("a",e.Z.AnyValue,!0),"Execute the value expression for each atom in the current atom set and return the result. Works the same way as Array.reduce in JavaScript (``result = value(value(...value(initial)))``)"),propertySet:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(o.Or.ConstrainedVar)}),o.Or.Set(o.Or.ConstrainedVar),"Returns a set with all values of the given property in the current atom set.")},atomProperty:{"@header":"Atom Properties",core:{"@header":"Core Properties",elementSymbol:l(A.ElementSymbol),vdw:l(e.Z.Num,"Van der Waals radius"),mass:l(e.Z.Num,"Atomic weight"),atomicNumber:l(e.Z.Num,"Atomic number"),x:l(e.Z.Num,"Cartesian X coordinate"),y:l(e.Z.Num,"Cartesian Y coordinate"),z:l(e.Z.Num,"Cartesian Z coordinate"),atomKey:l(e.Z.AnyValue,"Unique value for each atom. Main use case is grouping of atoms."),bondCount:(0,t.HR)(r.d3.Dictionary({0:(0,r.ef)(A.ElementReference,{isOptional:!0,defaultValue:"slot.current-atom"}),flags:(0,r.ef)(A.BondFlags,{isOptional:!0,defaultValue:"covalent"})}),e.Z.Num,"Number of bonds (by default only covalent bonds are counted)."),sourceIndex:l(e.Z.Num,"Index of the atom/element in the input file."),operatorName:l(e.Z.Str,"Name of the symmetry operator applied to this element."),operatorKey:l(e.Z.Num,"Key of the symmetry operator applied to this element."),modelIndex:l(e.Z.Num,"Index of the model in the input file."),modelLabel:l(e.Z.Str,"Label/header of the model in the input file.")},topology:{connectedComponentKey:l(e.Z.AnyValue,"Unique value for each connected component.")},macromolecular:{"@header":"Macromolecular Properties (derived from the mmCIF format)",authResidueId:l(A.ResidueId,"type.auth-residue-id symbol executed on current atom's residue"),labelResidueId:l(A.ResidueId,"type.label-residue-id symbol executed on current atom's residue"),residueKey:l(e.Z.AnyValue,"Unique value for each tuple ``(label_entity_id,auth_asym_id, auth_seq_id, pdbx_PDB_ins_code)``, main use case is grouping of atoms"),chainKey:l(e.Z.AnyValue,"Unique value for each tuple ``(label_entity_id, auth_asym_id)``, main use case is grouping of atoms"),entityKey:l(e.Z.AnyValue,"Unique value for each tuple ``label_entity_id``, main use case is grouping of atoms"),isHet:l(e.Z.Bool,"Equivalent to atom_site.group_PDB !== ATOM"),id:l(e.Z.Num,"_atom_site.id"),label_atom_id:l(A.AtomName),label_alt_id:l(e.Z.Str),label_comp_id:l(e.Z.Str),label_asym_id:l(e.Z.Str),label_entity_id:l(e.Z.Str),label_seq_id:l(e.Z.Num),auth_atom_id:l(A.AtomName),auth_comp_id:l(e.Z.Str),auth_asym_id:l(e.Z.Str),auth_seq_id:l(e.Z.Num),pdbx_PDB_ins_code:l(e.Z.Str),pdbx_formal_charge:l(e.Z.Num),occupancy:l(e.Z.Num),B_iso_or_equiv:l(e.Z.Num),entityType:l(A.EntityType,"Type of the entity as defined in mmCIF (polymer, non-polymer, branched, water)"),entitySubtype:l(A.EntitySubtype,"Subtype of the entity as defined in mmCIF _entity_poly.type and _pdbx_entity_branch.type (other, polypeptide(D), polypeptide(L), polydeoxyribonucleotide, polyribonucleotide, polydeoxyribonucleotide/polyribonucleotide hybrid, cyclic-pseudo-peptide, peptide nucleic acid, oligosaccharide)"),entityPrdId:l(e.Z.Str,"The PRD ID of the entity."),entityDescription:l(o.Or.List(e.Z.Str)),objectPrimitive:l(A.ObjectPrimitive,"Type of the primitive object used to model this segment as defined in mmCIF/IHM (atomistic, sphere, gaussian, other)"),secondaryStructureKey:l(e.Z.AnyValue,"Unique value for each secondary structure element."),secondaryStructureFlags:l(A.SecondaryStructureFlags),isModified:l(e.Z.Bool,"True if the atom belongs to modification of a standard residue."),modifiedParentName:l(e.Z.Str,"'3-letter' code of the modifed parent residue."),isNonStandard:l(e.Z.Bool,"True if this is a non-standard residue."),chemCompType:l(e.Z.Str,"Type of the chemical component as defined in mmCIF.")}},bondProperty:{"@header":"Bond Properties",flags:m(A.BondFlags),order:m(e.Z.Num),key:m(e.Z.Num),length:m(e.Z.Num),atomA:m(A.ElementReference),atomB:m(A.ElementReference)}}},3170:(tn,Ue,n)=>{"use strict";n.d(Ue,{Bm:()=>y,EX:()=>t,d3:()=>r,ef:()=>o,vy:()=>A});var r,e=n(9920);function o(c,i){const{description:v,isOptional:O=!1,isRest:b=!1,defaultValue:_}=i||{};return{type:c,isOptional:O,isRest:b,defaultValue:_,description:v}}function t(c,i,v,O){const b=function(_){return e.r.Apply(e.r.Symbol(b.id),_)};return b.info={namespace:"",name:c,description:O},b.id="",b.args=i,b.type=v,b}function A(c,i,v,O){const b=function(_){return e.r.Apply(e.r.Symbol(b.id),_)};return b.info={namespace:c,name:i,description:O},b.id=`${c}.${i}`,b.args=r.None,b.type=v,b}function y(c){return"function"==typeof c&&!!c.info&&!!c.args&&"string"==typeof c.info.namespace&&!!c.type}!function(c){function i(O){return{kind:"dictionary",map:O,"@type":0}}c.None=i({}),c.Dictionary=i,c.List=function v(O,b){const{nonEmpty:_=!1}=b||{};return{kind:"list",type:O,nonEmpty:_,"@type":0}}}(r||(r={}))},6430:(tn,Ue,n)=>{"use strict";var e;n.d(Ue,{Z:()=>e}),function(o){function t(v,O,b){return{kind:"value",namespace:v,name:O,parent:b}}function c(v,O,b,_){const M=Object.create(null);for(const I of _)M[I]=!0;return{kind:"oneof",namespace:v,name:O,type:b,values:M}}o.Variable=function r(v,O,b){return{kind:"variable",name:v,type:O,isConstraint:b}},o.Value=t,o.Container=function A(v,O,b,_){return{kind:"container",namespace:v,name:O,child:b,alias:_}},o.Union=function y(v){return{kind:"union",types:v}},o.OneOf=c,o.Any={kind:"any"},o.AnyValue={kind:"any-value"},o.Num=t("","Number"),o.Str=t("","String"),o.Bool=c("","Bool",o.Str,["true","false"]),o.oneOfValues=function i({values:v}){return Object.keys(v).sort()}}(e||(e={}))},7232:(tn,Ue,n)=>{"use strict";n.d(Ue,{Bg:()=>v,TO:()=>i,oY:()=>t,wE:()=>M});var e=n(9920),o=n(9136);const t=new class r{constructor(){this.map=new Map}removeSymbol(l){this.map.delete(l.symbol.id)}addSymbol(l){this.map.has(l.symbol.id)&&console.warn(`Symbol '${l.symbol.id}' already added. Call removeSymbol/removeCustomProps re-adding the symbol.`),this.map.set(l.symbol.id,l)}addCustomProp(l){if(l.symbols)for(const m of Object.keys(l.symbols))this.addSymbol(l.symbols[m])}removeCustomProp(l){if(l.symbols)for(const m of Object.keys(l.symbols))this.removeSymbol(l.symbols[m])}getRuntime(l){return this.map.get(l)}};class A{constructor(l){this.table=l,this.constQueryContext=new o.cY(o.oE.Empty)}}var y,I,c,i,v;(I=y||(y={})).Const=function l(u){return{kind:"const",value:u}},I.Dynamic=function m(u){return{kind:"dynamic",runtime:u}},function(I){I.Const=function l(u){return{isConst:!0,fn:function(s){return u}}},I.Dynamic=function m(u){return{isConst:!1,fn:u}}}(c||(c={})),function(I){I.forEachEval=function l(m,u,d,s){if("number"==typeof m.length)for(let C=0,h=m.length;C{"use strict";n.d(Ue,{oY:()=>e.oY,Bg:()=>e.Bg,wE:()=>e.wE});var e=n(7232),o=n(643),r=n(9136),t=n(2434),A=n(9986),y=n(7785),c=n(2008),i=n(8382),v=n(5988),O=n(6115);const b=e.Bg.Const,_=e.Bg.Dynamic,M=[b(o.AN.core.type.bool,function(s,C){return!!C[0](s)}),b(o.AN.core.type.num,function(s,C){return+C[0](s)}),b(o.AN.core.type.str,function(s,C){return""+C[0](s)}),b(o.AN.core.type.list,function(s,C){return e.TO.forEachEval(C,s,(h,a,S)=>S[a]=h,[])}),b(o.AN.core.type.set,function(s,C){return e.TO.forEachEval(C,s,function(a,S,D){return D.add(a)},new Set)}),b(o.AN.core.type.regex,function(s,C){return new RegExp(C[0](s),C[1]&&C[1](s)||"")}),b(o.AN.core.type.bitflags,function(s,C){return+C[0](s)}),b(o.AN.core.type.compositeKey,function(s,C){return e.TO.forEachEval(C,s,(h,a,S)=>S[a]=""+h,[]).join("-")}),b(o.AN.core.logic.not,(d,s)=>!s[0](d)),b(o.AN.core.logic.and,(d,s)=>{if("number"==typeof s.length){for(let C=0,h=s.length;C{if("number"==typeof s.length){for(let C=0,h=s.length;Cs[0](d)===s[1](d)),b(o.AN.core.rel.neq,(d,s)=>s[0](d)!==s[1](d)),b(o.AN.core.rel.lt,(d,s)=>s[0](d)s[0](d)<=s[1](d)),b(o.AN.core.rel.gr,(d,s)=>s[0](d)>s[1](d)),b(o.AN.core.rel.gre,(d,s)=>s[0](d)>=s[1](d)),b(o.AN.core.rel.inRange,(d,s)=>{const C=s[0](d);return C>=s[1](d)&&C<=s[2](d)}),b(o.AN.core.math.add,(d,s)=>{let C=0;if("number"==typeof s.length)for(let h=0,a=s.length;h{let C=0;if("number"==typeof s.length){if(1===s.length)return-s[0](d);C=s[0](d)||0;for(let h=1,a=s.length;h{let C=1;if("number"==typeof s.length)for(let h=0,a=s.length;hs[0](d)/s[1](d)),b(o.AN.core.math.pow,(d,s)=>Math.pow(s[0](d),s[1](d))),b(o.AN.core.math.mod,(d,s)=>s[0](d)%s[1](d)),b(o.AN.core.math.min,(d,s)=>{let C=Number.POSITIVE_INFINITY;if("number"==typeof s.length)for(let h=0,a=s.length;h{let C=Number.NEGATIVE_INFINITY;if("number"==typeof s.length)for(let h=0,a=s.length;h(0,i.m1)(s[0](d),s[1](d))),b(o.AN.core.math.sortedCantorPairing,(d,s)=>(0,i.bd)(s[0](d),s[1](d))),b(o.AN.core.math.invertCantorPairing,(d,s)=>(0,i.Ao)([0,0],s[0](d))),b(o.AN.core.math.floor,(d,s)=>Math.floor(s[0](d))),b(o.AN.core.math.ceil,(d,s)=>Math.ceil(s[0](d))),b(o.AN.core.math.roundInt,(d,s)=>Math.round(s[0](d))),b(o.AN.core.math.trunc,(d,s)=>Math.trunc(s[0](d))),b(o.AN.core.math.abs,(d,s)=>Math.abs(s[0](d))),b(o.AN.core.math.sign,(d,s)=>Math.sign(s[0](d))),b(o.AN.core.math.sqrt,(d,s)=>Math.sqrt(s[0](d))),b(o.AN.core.math.cbrt,(d,s)=>Math.cbrt(s[0](d))),b(o.AN.core.math.sin,(d,s)=>Math.sin(s[0](d))),b(o.AN.core.math.cos,(d,s)=>Math.cos(s[0](d))),b(o.AN.core.math.tan,(d,s)=>Math.tan(s[0](d))),b(o.AN.core.math.asin,(d,s)=>Math.asin(s[0](d))),b(o.AN.core.math.acos,(d,s)=>Math.acos(s[0](d))),b(o.AN.core.math.atan,(d,s)=>Math.atan(s[0](d))),b(o.AN.core.math.sinh,(d,s)=>Math.sinh(s[0](d))),b(o.AN.core.math.cosh,(d,s)=>Math.cosh(s[0](d))),b(o.AN.core.math.tanh,(d,s)=>Math.tanh(s[0](d))),b(o.AN.core.math.exp,(d,s)=>Math.exp(s[0](d))),b(o.AN.core.math.log,(d,s)=>Math.log(s[0](d))),b(o.AN.core.math.log10,(d,s)=>Math.log10(s[0](d))),b(o.AN.core.math.atan2,(d,s)=>Math.atan2(s[0](d),s[1](d))),b(o.AN.core.str.match,(d,s)=>s[0](d).test(s[1](d))),b(o.AN.core.str.concat,(d,s)=>{const C=[];if("number"==typeof s.length)for(let h=0,a=s.length;hs[0](d)[s[1](d)]),b(o.AN.core.list.equal,(d,s)=>(0,O.af)(s[0](d),s[1](d))),b(o.AN.core.set.has,function(s,C){return C[0](s).has(C[1](s))}),b(o.AN.core.set.isSubset,function(s,C){return A.M.isSuperset(C[1](s),C[0](s))}),b(o.AN.core.flags.hasAny,(d,s)=>{const C=s[1](d),h=s[0](d);return C?!!(h&C):!!h}),b(o.AN.core.flags.hasAll,(d,s)=>{const C=s[1](d),h=s[0](d);return C?(h&C)===C:!h}),b(o.AN.structureQuery.type.elementSymbol,(d,s)=>(0,t.F1)(s[0](d))),b(o.AN.structureQuery.type.atomName,(d,s)=>(0,y.r4)(s[0](d))),b(o.AN.structureQuery.type.bondFlags,(d,s)=>{let C=0;if("number"==typeof s.length)for(let h=0,a=s.length;hr.X$.elementFingerprint(function u(d,s){const C=[];if(!s)return C;if("number"==typeof s.length)for(let h=0,a=s.length;h{let C=0;if("number"==typeof s.length)for(let h=0,a=s.length;hr.RT.filters.pick(s[0],s.test)(d)),_(o.AN.structureQuery.filter.first,(d,s)=>r.RT.filters.first(s[0])(d)),_(o.AN.structureQuery.filter.withSameAtomProperties,(d,s)=>r.RT.filters.withSameAtomProperties(s[0],s.source,s.property)(d)),_(o.AN.structureQuery.filter.intersectedBy,(d,s)=>r.RT.filters.areIntersectedBy(s[0],s.by)(d)),_(o.AN.structureQuery.filter.within,(d,s)=>{var C,h,a;return r.RT.filters.within({query:s[0],target:s.target,minRadius:null===(C=s["min-radius"])||void 0===C?void 0:C.call(s,d),maxRadius:null===(h=s["max-radius"])||void 0===h?void 0:h.call(s,d),elementRadius:s["atom-radius"],invert:null===(a=s.invert)||void 0===a?void 0:a.call(s,d)})(d)}),_(o.AN.structureQuery.filter.isConnectedTo,(d,s)=>{var C,h;return r.RT.filters.isConnectedTo({query:s[0],target:s.target,disjunct:null===(C=s.disjunct)||void 0===C?void 0:C.call(s,d),invert:null===(h=s.invert)||void 0===h?void 0:h.call(s,d),bondTest:s["bond-test"]})(d)}),_(o.AN.structureQuery.generator.atomGroups,function(s,C){return r.RT.generators.atoms({entityTest:C["entity-test"],chainTest:C["chain-test"],residueTest:C["residue-test"],atomTest:C["atom-test"],groupBy:C["group-by"]})(s)}),_(o.AN.structureQuery.generator.all,function(s){return r.RT.generators.all(s)}),_(o.AN.structureQuery.generator.empty,function(s){return r.RT.generators.none(s)}),_(o.AN.structureQuery.generator.bondedAtomicPairs,function(s,C){return r.RT.generators.bondedAtomicPairs(C&&C[0])(s)}),_(o.AN.structureQuery.generator.rings,function(s,C){var h,a;return r.RT.generators.rings(null===(h=C?.fingerprint)||void 0===h?void 0:h.call(C,s),null===(a=C?.["only-aromatic"])||void 0===a?void 0:a.call(C,s))(s)}),_(o.AN.structureQuery.generator.queryInSelection,function(s,C){var h;return r.RT.generators.querySelection(C[0],C.query,null===(h=C["in-complement"])||void 0===h?void 0:h.call(C,s))(s)}),_(o.AN.structureQuery.modifier.includeSurroundings,function(s,C){return r.RT.modifiers.includeSurroundings(C[0],{radius:C.radius(s),wholeResidues:!(!C["as-whole-residues"]||!C["as-whole-residues"](s)),elementRadius:C["atom-radius"]})(s)}),_(o.AN.structureQuery.modifier.surroundingLigands,function(s,C){return r.RT.modifiers.surroundingLigands({query:C[0],radius:C.radius(s),includeWater:!(!C["include-water"]||!C["include-water"](s))})(s)}),_(o.AN.structureQuery.modifier.wholeResidues,function(s,C){return r.RT.modifiers.wholeResidues(C[0])(s)}),_(o.AN.structureQuery.modifier.union,function(s,C){return r.RT.modifiers.union(C[0])(s)}),_(o.AN.structureQuery.modifier.expandProperty,function(s,C){return r.RT.modifiers.expandProperty(C[0],C.property)(s)}),_(o.AN.structureQuery.modifier.exceptBy,function(s,C){return r.RT.modifiers.exceptBy(C[0],C.by)(s)}),_(o.AN.structureQuery.modifier.includeConnected,function(s,C){var h,a;return r.RT.modifiers.includeConnected({query:C[0],bondTest:C["bond-test"],wholeResidues:!(!C["as-whole-residues"]||!C["as-whole-residues"](s)),layerCount:C["layer-count"]&&C["layer-count"](s)||1,fixedPoint:null!==(a=null===(h=C["fixed-point"])||void 0===h?void 0:h.call(C,s))&&void 0!==a&&a})(s)}),_(o.AN.structureQuery.modifier.intersectBy,function(s,C){return r.RT.modifiers.intersectBy(C[0],C.by)(s)}),_(o.AN.structureQuery.combinator.merge,(d,s)=>r.RT.combinators.merge(s)(d)),_(o.AN.structureQuery.atomProperty.core.elementSymbol,I(r.StructureProperties.atom.type_symbol)),_(o.AN.structureQuery.atomProperty.core.vdw,(d,s)=>(0,c.sO)(r.StructureProperties.atom.type_symbol(s&&s[0]&&s[0](d)||d.element))),_(o.AN.structureQuery.atomProperty.core.mass,(d,s)=>(0,c.A9)(r.StructureProperties.atom.type_symbol(s&&s[0]&&s[0](d)||d.element))),_(o.AN.structureQuery.atomProperty.core.atomicNumber,(d,s)=>(0,c.PR)(r.StructureProperties.atom.type_symbol(s&&s[0]&&s[0](d)||d.element))),_(o.AN.structureQuery.atomProperty.core.x,I(r.StructureProperties.atom.x)),_(o.AN.structureQuery.atomProperty.core.y,I(r.StructureProperties.atom.y)),_(o.AN.structureQuery.atomProperty.core.z,I(r.StructureProperties.atom.z)),_(o.AN.structureQuery.atomProperty.core.sourceIndex,I(r.StructureProperties.atom.sourceIndex)),_(o.AN.structureQuery.atomProperty.core.operatorName,I(r.StructureProperties.unit.operator_name)),_(o.AN.structureQuery.atomProperty.core.operatorKey,I(r.StructureProperties.unit.operator_key)),_(o.AN.structureQuery.atomProperty.core.modelIndex,I(r.StructureProperties.unit.model_index)),_(o.AN.structureQuery.atomProperty.core.modelLabel,I(r.StructureProperties.unit.model_label)),_(o.AN.structureQuery.atomProperty.core.atomKey,(d,s)=>{const C=s&&s[0]&&s[0](d)||d.element;return(0,i.m1)(C.unit.id,C.element)}),_(o.AN.structureQuery.atomProperty.macromolecular.residueKey,(d,s)=>r.iZ.residueIndex(s&&s[0]&&s[0](d)||d.element)),_(o.AN.structureQuery.atomProperty.macromolecular.chainKey,(d,s)=>r.iZ.chainIndex(s&&s[0]&&s[0](d)||d.element)),_(o.AN.structureQuery.atomProperty.macromolecular.entityKey,(d,s)=>r.iZ.entityIndex(s&&s[0]&&s[0](d)||d.element)),_(o.AN.structureQuery.atomProperty.macromolecular.id,I(r.StructureProperties.atom.id)),_(o.AN.structureQuery.atomProperty.macromolecular.isHet,(d,s)=>"ATOM"!==r.StructureProperties.residue.group_PDB(s&&s[0]&&s[0](d)||d.element)),_(o.AN.structureQuery.atomProperty.macromolecular.label_atom_id,I(r.StructureProperties.atom.label_atom_id)),_(o.AN.structureQuery.atomProperty.macromolecular.label_alt_id,I(r.StructureProperties.atom.label_alt_id)),_(o.AN.structureQuery.atomProperty.macromolecular.label_comp_id,I(r.StructureProperties.atom.label_comp_id)),_(o.AN.structureQuery.atomProperty.macromolecular.label_seq_id,I(r.StructureProperties.residue.label_seq_id)),_(o.AN.structureQuery.atomProperty.macromolecular.label_asym_id,I(r.StructureProperties.chain.label_asym_id)),_(o.AN.structureQuery.atomProperty.macromolecular.label_entity_id,I(r.StructureProperties.entity.id)),_(o.AN.structureQuery.atomProperty.macromolecular.auth_atom_id,I(r.StructureProperties.atom.auth_atom_id)),_(o.AN.structureQuery.atomProperty.macromolecular.auth_comp_id,I(r.StructureProperties.atom.auth_comp_id)),_(o.AN.structureQuery.atomProperty.macromolecular.auth_seq_id,I(r.StructureProperties.residue.auth_seq_id)),_(o.AN.structureQuery.atomProperty.macromolecular.auth_asym_id,I(r.StructureProperties.chain.auth_asym_id)),_(o.AN.structureQuery.atomProperty.macromolecular.pdbx_PDB_ins_code,I(r.StructureProperties.residue.pdbx_PDB_ins_code)),_(o.AN.structureQuery.atomProperty.macromolecular.pdbx_formal_charge,I(r.StructureProperties.atom.pdbx_formal_charge)),_(o.AN.structureQuery.atomProperty.macromolecular.occupancy,I(r.StructureProperties.atom.occupancy)),_(o.AN.structureQuery.atomProperty.macromolecular.B_iso_or_equiv,I(r.StructureProperties.atom.B_iso_or_equiv)),_(o.AN.structureQuery.atomProperty.macromolecular.entityType,I(r.StructureProperties.entity.type)),_(o.AN.structureQuery.atomProperty.macromolecular.entitySubtype,I(r.StructureProperties.entity.subtype)),_(o.AN.structureQuery.atomProperty.macromolecular.entityPrdId,I(r.StructureProperties.entity.prd_id)),_(o.AN.structureQuery.atomProperty.macromolecular.entityDescription,I(r.StructureProperties.entity.pdbx_description)),_(o.AN.structureQuery.atomProperty.macromolecular.objectPrimitive,I(r.StructureProperties.unit.object_primitive)),_(o.AN.structureQuery.atomProperty.macromolecular.isNonStandard,I(r.StructureProperties.residue.isNonStandard)),_(o.AN.structureQuery.atomProperty.macromolecular.secondaryStructureKey,I(r.StructureProperties.residue.secondary_structure_key)),_(o.AN.structureQuery.atomProperty.macromolecular.secondaryStructureFlags,I(r.StructureProperties.residue.secondary_structure_type)),_(o.AN.structureQuery.atomProperty.macromolecular.chemCompType,I(r.StructureProperties.residue.chem_comp_type)),_(o.AN.structureQuery.atomSet.atomCount,function(s,C){return r.RT.atomset.atomCount(s)}),_(o.AN.structureQuery.atomSet.countQuery,function(s,C){return r.RT.atomset.countQuery(C[0])(s)}),_(o.AN.structureQuery.atomSet.propertySet,function(s,C){return r.RT.atomset.propertySet(C[0])(s)}),_(o.AN.structureQuery.bondProperty.order,(d,s)=>d.atomicBond.order),_(o.AN.structureQuery.bondProperty.flags,(d,s)=>d.atomicBond.type),_(o.AN.structureQuery.bondProperty.key,(d,s)=>d.atomicBond.key),_(o.AN.structureQuery.bondProperty.atomA,(d,s)=>d.atomicBond.a),_(o.AN.structureQuery.bondProperty.atomB,(d,s)=>d.atomicBond.b),_(o.AN.structureQuery.bondProperty.length,(d,s)=>d.atomicBond.length),_(o.AN.internal.generator.bundleElement,function(s,C){return(0,v.bundleElementImpl)(C.groupedUnits(s),C.ranges(s),C.set(s))}),_(o.AN.internal.generator.bundle,function(s,C){return(0,v.bundleGenerator)(C.elements(s))(s)}),_(o.AN.internal.generator.current,function(s,C){return s.tryGetCurrentSelection()})];function I(d){return(s,C)=>d(C&&C[0]&&C[0](s)||s.element)}function l(d,s){return d|(t.I$.isName(s)?t.I$.fromName(s):0)}function m(d,s){switch(s.toLowerCase()){case"helix":return 2|d;case"alpha":return 4098|d;case"pi":return 32770|d;case"310":return 2050|d;case"beta":return 4|d;case"strand":return 4194308|d;case"sheet":return 8388612|d;case"turn":return 16|d;case"bend":return 8|d;case"coil":return 536870912|d;default:return d}}!function(){for(const d of M)e.oY.addSymbol(d)}()},9498:(tn,Ue,n)=>{"use strict";n.d(Ue,{e:()=>Wo});var e=n(9677),o=n(9920),r=n(3170),t=n(643),A=n(6430),y=n(6452),c=n(9767);function i(We){return Object.keys(We).filter(Pt=>!isNaN(Pt)).map(Pt=>+Pt).sort((Pt,Sn)=>Pt-Sn).map(Pt=>We[Pt])}function v(We,Pt,Sn){return We&&void 0!==We[Pt]?We[Pt]:Sn}function _(We,...Pt){return{kind:"alias",aliases:Pt,symbol:We}}function M(We,Pt,...Sn){return We.info.namespace="molscript-macro",We.id=`molscript-macro.${We.info.name}`,{kind:"macro",symbol:We,translate:Pt,aliases:[We.info.name,...Sn]}}function I(We){return"alias"===We.kind||"macro"===We.kind}const l=[["Core symbols",_(t.AN.core.type.bool,"bool"),_(t.AN.core.type.num,"num"),_(t.AN.core.type.str,"str"),_(t.AN.core.type.regex,"regex"),_(t.AN.core.type.list,"list"),_(t.AN.core.type.set,"set"),_(t.AN.core.type.compositeKey,"composite-key"),_(t.AN.core.logic.not,"not"),_(t.AN.core.logic.and,"and"),_(t.AN.core.logic.or,"or"),_(t.AN.core.ctrl.if,"if"),_(t.AN.core.ctrl.fn,"fn"),_(t.AN.core.ctrl.eval,"eval"),_(t.AN.core.math.add,"add","+"),_(t.AN.core.math.sub,"sub","-"),_(t.AN.core.math.mult,"mult","*"),_(t.AN.core.math.div,"div","/"),_(t.AN.core.math.pow,"pow","**"),_(t.AN.core.math.mod,"mod"),_(t.AN.core.math.min,"min"),_(t.AN.core.math.max,"max"),_(t.AN.core.math.cantorPairing,"cantor-pairing"),_(t.AN.core.math.sortedCantorPairing,"sorted-cantor-pairing"),_(t.AN.core.math.invertCantorPairing,"invert-cantor-pairing"),_(t.AN.core.math.floor,"floor"),_(t.AN.core.math.ceil,"ceil"),_(t.AN.core.math.roundInt,"round"),_(t.AN.core.math.trunc,"trunc"),_(t.AN.core.math.abs,"abs"),_(t.AN.core.math.sign,"sign"),_(t.AN.core.math.sqrt,"sqrt"),_(t.AN.core.math.cbrt,"cbrt"),_(t.AN.core.math.sin,"sin"),_(t.AN.core.math.cos,"cos"),_(t.AN.core.math.tan,"tan"),_(t.AN.core.math.asin,"asin"),_(t.AN.core.math.acos,"acos"),_(t.AN.core.math.atan,"atan"),_(t.AN.core.math.sinh,"sinh"),_(t.AN.core.math.cosh,"cosh"),_(t.AN.core.math.tanh,"tanh"),_(t.AN.core.math.exp,"exp"),_(t.AN.core.math.log,"log"),_(t.AN.core.math.log10,"log10"),_(t.AN.core.math.atan2,"atan2"),_(t.AN.core.rel.eq,"eq","="),_(t.AN.core.rel.neq,"neq","!="),_(t.AN.core.rel.lt,"lt","<"),_(t.AN.core.rel.lte,"lte","<="),_(t.AN.core.rel.gr,"gr",">"),_(t.AN.core.rel.gre,"gre",">="),_(t.AN.core.rel.inRange,"in-range"),_(t.AN.core.str.concat,"concat"),_(t.AN.core.str.match,"regex.match"),_(t.AN.core.list.getAt,"list.get"),_(t.AN.core.set.has,"set.has"),_(t.AN.core.set.isSubset,"set.subset")],["Structure",["Types",_(t.AN.structureQuery.type.entityType,"ent-type"),_(t.AN.structureQuery.type.authResidueId,"auth-resid"),_(t.AN.structureQuery.type.labelResidueId,"label-resid"),_(t.AN.structureQuery.type.ringFingerprint,"ringfp"),_(t.AN.structureQuery.type.bondFlags,"bond-flags")],["Slots",_(t.AN.structureQuery.slot.elementSetReduce,"atom.set.reduce.value")],["Generators",_(t.AN.structureQuery.generator.atomGroups,"sel.atom.atom-groups"),_(t.AN.structureQuery.generator.queryInSelection,"sel.atom.query-in-selection"),_(t.AN.structureQuery.generator.rings,"sel.atom.rings"),_(t.AN.structureQuery.generator.empty,"sel.atom.empty"),_(t.AN.structureQuery.generator.all,"sel.atom.all"),_(t.AN.structureQuery.generator.bondedAtomicPairs,"sel.atom.bonded-pairs"),M((0,r.EX)("sel.atom.atoms",r.d3.Dictionary({0:(0,r.ef)(A.Z.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to each atom."})}),y.O.ElementSelection,"A selection of singleton atom sets."),We=>c.J.struct.generator.atomGroups({"atom-test":v(We,0,!0)})),M((0,r.EX)("sel.atom.res",r.d3.Dictionary({0:(0,r.ef)(A.Z.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each residue."})}),y.O.ElementSelection,"A selection of atom sets grouped by residue."),We=>c.J.struct.generator.atomGroups({"residue-test":v(We,0,!0),"group-by":c.J.ammp("residueKey")})),M((0,r.EX)("sel.atom.chains",r.d3.Dictionary({0:(0,r.ef)(A.Z.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each chain."})}),y.O.ElementSelection,"A selection of atom sets grouped by chain."),We=>c.J.struct.generator.atomGroups({"chain-test":v(We,0,!0),"group-by":c.J.ammp("chainKey")}))],["Modifiers",_(t.AN.structureQuery.modifier.queryEach,"sel.atom.query-each"),_(t.AN.structureQuery.modifier.intersectBy,"sel.atom.intersect-by"),_(t.AN.structureQuery.modifier.exceptBy,"sel.atom.except-by"),_(t.AN.structureQuery.modifier.unionBy,"sel.atom.union-by"),_(t.AN.structureQuery.modifier.union,"sel.atom.union"),_(t.AN.structureQuery.modifier.cluster,"sel.atom.cluster"),_(t.AN.structureQuery.modifier.includeSurroundings,"sel.atom.include-surroundings"),_(t.AN.structureQuery.modifier.surroundingLigands,"sel.atom.surrounding-ligands"),_(t.AN.structureQuery.modifier.includeConnected,"sel.atom.include-connected"),_(t.AN.structureQuery.modifier.expandProperty,"sel.atom.expand-property")],["Filters",_(t.AN.structureQuery.filter.pick,"sel.atom.pick"),_(t.AN.structureQuery.filter.first,"sel.atom.first"),_(t.AN.structureQuery.filter.withSameAtomProperties,"sel.atom.with-same-atom-properties"),_(t.AN.structureQuery.filter.intersectedBy,"sel.atom.intersected-by"),_(t.AN.structureQuery.filter.within,"sel.atom.within"),_(t.AN.structureQuery.filter.isConnectedTo,"sel.atom.is-connected-to")],["Combinators",_(t.AN.structureQuery.combinator.intersect,"sel.atom.intersect"),_(t.AN.structureQuery.combinator.merge,"sel.atom.merge"),_(t.AN.structureQuery.combinator.distanceCluster,"sel.atom.dist-cluster")],["Atom Set Properties",_(t.AN.structureQuery.atomSet.atomCount,"atom.set.atom-count"),_(t.AN.structureQuery.atomSet.countQuery,"atom.set.count-query"),_(t.AN.structureQuery.atomSet.reduce,"atom.set.reduce"),_(t.AN.structureQuery.atomSet.propertySet,"atom.set.property")],["Atom Properties",_(t.AN.structureQuery.atomProperty.core.elementSymbol,"atom.el"),_(t.AN.structureQuery.atomProperty.core.vdw,"atom.vdw"),_(t.AN.structureQuery.atomProperty.core.mass,"atom.mass"),_(t.AN.structureQuery.atomProperty.core.atomicNumber,"atom.atomic-number"),_(t.AN.structureQuery.atomProperty.core.x,"atom.x"),_(t.AN.structureQuery.atomProperty.core.y,"atom.y"),_(t.AN.structureQuery.atomProperty.core.z,"atom.z"),_(t.AN.structureQuery.atomProperty.core.sourceIndex,"atom.src-index"),_(t.AN.structureQuery.atomProperty.core.operatorName,"atom.op-name"),_(t.AN.structureQuery.atomProperty.core.operatorKey,"atom.op-key"),_(t.AN.structureQuery.atomProperty.core.modelIndex,"atom.model-index"),_(t.AN.structureQuery.atomProperty.core.modelLabel,"atom.model-label"),_(t.AN.structureQuery.atomProperty.core.atomKey,"atom.key"),_(t.AN.structureQuery.atomProperty.core.bondCount,"atom.bond-count"),_(t.AN.structureQuery.atomProperty.topology.connectedComponentKey,"atom.key.molecule"),_(t.AN.structureQuery.atomProperty.macromolecular.authResidueId,"atom.auth-resid"),_(t.AN.structureQuery.atomProperty.macromolecular.labelResidueId,"atom.label-resid"),_(t.AN.structureQuery.atomProperty.macromolecular.residueKey,"atom.key.res"),_(t.AN.structureQuery.atomProperty.macromolecular.chainKey,"atom.key.chain"),_(t.AN.structureQuery.atomProperty.macromolecular.entityKey,"atom.key.entity"),_(t.AN.structureQuery.atomProperty.macromolecular.isHet,"atom.is-het"),_(t.AN.structureQuery.atomProperty.macromolecular.id,"atom.id"),_(t.AN.structureQuery.atomProperty.macromolecular.label_atom_id,"atom.label_atom_id"),_(t.AN.structureQuery.atomProperty.macromolecular.label_alt_id,"atom.label_alt_id","atom.altloc"),_(t.AN.structureQuery.atomProperty.macromolecular.label_comp_id,"atom.label_comp_id"),_(t.AN.structureQuery.atomProperty.macromolecular.label_asym_id,"atom.label_asym_id"),_(t.AN.structureQuery.atomProperty.macromolecular.label_entity_id,"atom.label_entity_id"),_(t.AN.structureQuery.atomProperty.macromolecular.label_seq_id,"atom.label_seq_id"),_(t.AN.structureQuery.atomProperty.macromolecular.auth_atom_id,"atom.auth_atom_id","atom.name"),_(t.AN.structureQuery.atomProperty.macromolecular.auth_comp_id,"atom.auth_comp_id","atom.resname"),_(t.AN.structureQuery.atomProperty.macromolecular.auth_asym_id,"atom.auth_asym_id","atom.chain"),_(t.AN.structureQuery.atomProperty.macromolecular.auth_seq_id,"atom.auth_seq_id","atom.resno"),_(t.AN.structureQuery.atomProperty.macromolecular.pdbx_PDB_ins_code,"atom.pdbx_PDB_ins_code","atom.inscode"),_(t.AN.structureQuery.atomProperty.macromolecular.pdbx_formal_charge,"atom.pdbx_formal_charge"),_(t.AN.structureQuery.atomProperty.macromolecular.occupancy,"atom.occupancy"),_(t.AN.structureQuery.atomProperty.macromolecular.B_iso_or_equiv,"atom.B_iso_or_equiv","atom.bfactor"),_(t.AN.structureQuery.atomProperty.macromolecular.entityType,"atom.entity-type"),_(t.AN.structureQuery.atomProperty.macromolecular.entitySubtype,"atom.entity-subtype"),_(t.AN.structureQuery.atomProperty.macromolecular.entityPrdId,"atom.entity-prd-id"),_(t.AN.structureQuery.atomProperty.macromolecular.entityDescription,"atom.entity-description"),_(t.AN.structureQuery.atomProperty.macromolecular.objectPrimitive,"atom.object-primitive"),_(t.AN.structureQuery.atomProperty.macromolecular.chemCompType,"atom.chem-comp-type"),_(t.AN.structureQuery.atomProperty.macromolecular.secondaryStructureKey,"atom.key.sec-struct"),_(t.AN.structureQuery.atomProperty.macromolecular.isModified,"atom.is-modified"),_(t.AN.structureQuery.atomProperty.macromolecular.modifiedParentName,"atom.modified-parent")],["Bond Properties",_(t.AN.structureQuery.bondProperty.order,"bond.order"),_(t.AN.structureQuery.bondProperty.length,"bond.length"),_(t.AN.structureQuery.bondProperty.key,"bond.key"),_(t.AN.structureQuery.bondProperty.atomA,"bond.atom-a"),_(t.AN.structureQuery.bondProperty.atomB,"bond.atom-b"),M((0,r.EX)("bond.is",r.d3.List(y.O.BondFlag),A.Z.Bool,`Test if the current bond has at least one (or all if partial = false) of the specified flags: ${A.Z.oneOfValues(y.O.BondFlag).join(", ")}`),We=>c.J.core.flags.hasAny([c.J.struct.bondProperty.flags(),c.J.struct.type.bondFlags(i(We))]))]]],m=[];!function u(We){for(const Pt of We)I(Pt)?m.push(Pt):Pt instanceof Array&&u(Pt)}(l);const a=function(){const We=[],Pt=Object.create(null),Sn=e.th.create(),Nn=e.th.create();for(const Kn of m){for(const xr of Kn.aliases){if(We.push([xr,Kn]),Pt[xr])throw new Error(`Alias '${xr}' already in use.`);Pt[xr]=Kn}const dr=Kn.symbol.args;if("dictionary"===dr.kind)for(const xr of Object.keys(dr.map)){isNaN(xr)&&e.th.add(Sn,xr,xr);const Ft=dr.map[xr];"oneof"===Ft.type.kind&&A.Z.oneOfValues(Ft.type).forEach(Qt=>e.th.add(Nn,Qt,Qt))}else"oneof"===dr.type.kind&&A.Z.oneOfValues(dr.type).forEach(xr=>e.th.add(Nn,xr,xr))}return{symbolList:We,symbolMap:Pt,namedArgs:Sn.array,constants:Nn.array}}().symbolMap;function D(We){if(o.r.isLiteral(We))return We;if(o.r.isSymbol(We)){if(!a[We.name])return We;const xr=a[We.name];if("alias"===xr.kind)return o.r.Symbol(a[We.name].symbol.id);throw xr.translate([])}const Pt=o.r.isSymbol(We.head)&&!!a[We.head.name]&&"macro"===a[We.head.name].kind,Sn=Pt?We.head:D(We.head),Nn=Sn!==We.head;if(!We.args)return Pt?D(We.head):Nn?o.r.Apply(Sn):We;let dr,Kn=!1;if(o.r.isArgumentsArray(We.args)){dr=[];for(let xr=0,Ft=We.args.length;xr12?"...'":"'";return` at line ${Sn.line} column ${Sn.column}, got ${Nn>0?"'...":"'"}${We.slice(Nn,Nn+12)}${dr}`}(We,Pt)}`}(Pt,Sn);throw new Error(Nn)}}or(Pt){return f.alt(this,Pt)}trim(Pt){return this.wrap(Pt,Pt)}wrap(Pt,Sn){return p(1,"string"==typeof Pt?f.string(Pt):Pt,this,"string"==typeof Sn?f.string(Sn):Sn)}thru(Pt){return Pt(this)}then(Pt){return p(1,this,Pt)}many(){return new f((Pt,Sn)=>{const Nn=[];let Kn;for(;;){if(Kn=L(this._(Pt,Sn),Kn),!Kn.status)return L(E(Sn,Nn),Kn);if(Sn===Kn.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");Sn=Kn.index,Nn.push(Kn.value)}})}times(Pt,Sn){const Nn=typeof Sn>"u"?Pt:Sn;return new f((Kn,dr)=>{const xr=[];let Ft,Qt,ht;for(ht=0;htPt)}atMost(Pt){return this.times(0,Pt)}atLeast(Pt){return f.seq(this.times(Pt),this.many()).map(Sn=>[...Sn[0],...Sn[1]])}map(Pt){return new f((Sn,Nn)=>{const Kn=this._(Sn,Nn);return Kn.status?L(E(Kn.index,Pt(Kn.value)),Kn):Kn})}skip(Pt){return p(0,this,Pt)}mark(){return f.seq(f.index,this,f.index).map(Pt=>({start:Pt[0],value:Pt[1],end:Pt[2]}))}node(Pt){return f.seq(f.index,this,f.index).map(Sn=>({name:Pt,start:Sn[0],value:Sn[1],end:Sn[2]}))}sepBy(Pt){return f.sepBy(this,Pt)}sepBy1(Pt){return f.sepBy1(this,Pt)}lookahead(Pt){return this.skip(f.lookahead(Pt))}notFollowedBy(Pt){return this.skip(f.notFollowedBy(Pt))}desc(Pt){return new f((Sn,Nn)=>{const Kn=this._(Sn,Nn);return Kn.status||(Kn.expected=[Pt]),Kn})}fallback(Pt){return this.or(f.succeed(Pt))}ap(Pt){return f.seq(Pt,this).map(([Sn,Nn])=>Sn(Nn))}chain(Pt){return new f((Sn,Nn)=>{const Kn=this._(Sn,Nn);return Kn.status?L(Pt(Kn.value)._(Sn,Kn.index),Kn):Kn})}}function p(We,...Pt){const Sn=Pt.length;return new f((Nn,Kn)=>{let dr,xr,Ft=Kn;for(let Qt=0;QtPt.furthest)return We;const Sn=We.furthest===Pt.furthest?function U(We,Pt){const Sn=We.length,Nn=Pt.length;if(0===Sn)return Pt;if(0===Nn)return We;const Kn=new Set,dr=[];for(let xr=0;xr{let rr;const Vr=new Array(an);let tr=Fn;for(let Tr=0;Tr{let rr;for(let Vr=0;Vr[Fn[0],...Fn[1]])}function Ft(zt){const an=`'${zt}'`;if(1===zt.length){const Vn=zt.charCodeAt(0);return new We((Fn,rr)=>Fn.charCodeAt(rr)===Vn?E(rr+1,zt):T(rr,an))}return new We((Vn,Fn)=>{const rr=Fn+zt.length;return Vn.slice(Fn,rr)===zt?E(rr,zt):T(Fn,an)})}function pt(zt,an=0){const Vn=function ht(zt){return RegExp("^(?:"+zt.source+")",function Qt(zt){const an=""+zt;return an.slice(an.lastIndexOf("/")+1)}(zt))}(zt),Fn=""+zt;return new We((rr,Vr)=>{const tr=Vn.exec(rr.slice(Vr));return tr?0<=an&&an<=tr.length?E(Vr+tr[0].length,tr[an]):T(Vr,`invalid match group (0 to ${tr.length}) in ${Fn}`):T(Vr,Fn)})}function Xt(zt){return new We((an,Vn)=>E(Vn,zt))}function fn(zt){return new We((an,Vn)=>T(Vn,zt))}function Tt(zt){return new We((an,Vn)=>{const Fn=an.charAt(Vn);return Vn{const rr=zt()._;return an._=rr,rr(Vn,Fn)});return an}We.seqMap=function Pt(zt,an,Vn){const Fn=[].slice.call(arguments);if(0===Fn.length)throw new Error("seqMap needs at least one argument");const rr=Fn.pop();return function k(We){if("function"!=typeof We)throw new Error("not a function: "+We)}(rr),Nn.apply(null,Fn).map(function(Vr){return rr.apply(null,Vr)})},We.createLanguage=function Sn(zt){const an={};for(const Vn of Object.keys(zt))!function(Fn){an[Fn]=rt(()=>zt[Fn](an))}(Vn);return an},We.seq=Nn,We.alt=Kn,We.sepBy=function dr(zt,an){return xr(zt,an).or(Xt([]))},We.sepBy1=xr,We.string=Ft,We.regexp=pt,We.succeed=Xt,We.fail=fn,We.lookahead=function on(zt){if(function N(We){return We instanceof f}(zt))return new We((an,Vn)=>{const Fn=zt._(an,Vn);return Fn.status&&(Fn.index=Vn,Fn.value=null),Fn});if("string"==typeof zt)return on(Ft(zt));if(zt instanceof RegExp)return on(pt(zt));throw new Error("not a string, regexp, or parser: "+zt)},We.notFollowedBy=function En(zt){return new We((an,Vn)=>{const Fn=zt._(an,Vn);return Fn.status?T(Vn,'not "'+an.slice(Vn,Fn.index)+'"'):E(Vn,null)})},We.test=Tt,We.oneOf=function Fe(zt){return Tt(an=>zt.indexOf(an)>=0)},We.noneOf=function He(zt){return Tt(an=>zt.indexOf(an)<0)},We.range=function Ye(zt,an){return Tt(Vn=>zt<=Vn&&Vn<=an).desc(zt+"-"+an)},We.takeWhile=function ot(zt){return new We((an,Vn)=>{let Fn=Vn;for(;Fnan>=zt.length?T(an,"any character"):E(an+1,zt.charAt(an))),We.all=new We(function(zt,an){return E(zt.length,zt.slice(an))}),We.eof=new We(function(zt,an){return anf.alt(Kn,Xt,dr,xr).trim(Sn)),Kn=f.takeWhile(rt=>"`"!==rt).trim("`").map(Pt.str),dr=f.regexp(/[^()\[\]{};`,\n\r\s]+/).map(Pt.symb),xr=f.regexp(/\s*;+([^\n\r]*)\n/,1).map(Pt.comment),Ft=Nn.many(),Qt=Ft.wrap("(",")").map(rt=>Pt.list("(",rt)),ht=Ft.wrap("[","]").map(rt=>Pt.list("[",rt)),pt=Ft.wrap("{","}").map(rt=>Pt.list("{",rt)),Xt=f.alt(Qt,ht,pt),fn=Nn.many();function En(rt){switch(rt.kind){case"string":return rt.value;case"symbol":{const St=rt.value;if(St.length>1)switch(St.charAt(0)){case".":return c.J.atomName(St.substr(1));case"_":return c.J.struct.type.elementSymbol([St.substr(1)])}return"true"===St||"false"!==St&&(function Ye(rt){return/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/.test(rt)&&!isNaN(+rt)}(St)?+St:o.r.Symbol(St))}case"list":switch(rt.bracket){case"[":return c.J.core.type.list(He(rt.nodes).map(En));case"{":return c.J.core.type.set(He(rt.nodes).map(En));case"(":{if("comment"===rt.nodes[0].kind)throw new Error("Invalid expression");const St=En(rt.nodes[0]);return o.r.Apply(St,function Tt(rt){if(rt.length<=1)return;if(!function Fe(rt){for(let St=1,vt=rt.length;St1&&":"===mn.value.charAt(0))return!0}return!1}(rt)){const zt=[];for(let an=1,Vn=rt.length;an1&&":"===Vn.value.charAt(0)){const Fn=Vn.value.substr(1);for(++zt;zt=an)throw new Error(`There must be a value foolowed a named arg ':${Fn}'.`);if("comment"===rt[zt].kind)throw new Error("Invalid expression");St[Fn]=En(rt[zt]),isNaN(+Fn)&&(vt=!1)}else St[mn++]=En(Vn)}if(vt){const zt=Object.keys(St).map(Vn=>+Vn).sort((Vn,Fn)=>Vn-Fn);let an=!0;for(let Vn=0,Fn=zt.length;Vn"comment"!==vt.kind):rt}We.parse=function ot(rt){const St=function on(rt){return fn.tryParse(rt)}(rt),vt=[];for(const mn of St)"comment"!==mn.kind&&(vt[vt.length]=En(mn));return vt}}(J||(J={}));var W=n(7785);const te=c.J;function de(We,Pt,Sn){const Nn=f.lazy(()=>f.seq(We,Nn).map(Kn=>Sn(...Kn)).or(Pt));return Nn}function ye(We,Pt,Sn){return f.seqMap(Pt,We.many(),(Nn,Kn)=>Kn.reduce((dr,xr)=>Sn(xr,dr),Nn))}function Z(We,Pt,Sn){return f.seqMap(Pt,f.seq(We,Pt).many(),(Nn,Kn)=>Kn.reduce((dr,xr)=>{const[Ft,Qt]=xr;return Sn(Ft,dr,Qt)},Nn))}function q(We,Pt){return We.reduce((Nn,Kn)=>{const dr=Kn.isUnsupported?xe(`operator '${Kn.name}' not supported`):Kn.map;return Kn.type(Kn.rule,Nn,dr)},Pt)}function Y(We,Pt=0){return f.optWhitespace.then(f.regexp(We,Pt).skip(f.optWhitespace))}function ee(We,Pt=0){return f.regexp(We,Pt).skip(f.optWhitespace)}function g(We,Pt=0){return f.optWhitespace.then(f.regexp(We,Pt))}function _e(We,Pt){const Sn=Pt?`${We}|${(0,W.Nt)(Pt)}`:We;return Y(RegExp(`(${Sn})\\s+([-+]?[0-9]*\\.?[0-9]+)\\s+OF`,"i"),2).map(parseFloat)}function xe(We){return function(){throw new Error(We)}}function le(We){return 1===We.length?We[0]:We.length>1?te.core.logic.and(We):void 0}function Be(We,Pt){if(!Pt||void 0===Pt.op||void 0===Pt.val)return Pt&&void 0!==Pt.flags?te.core.flags.hasAny([We,Pt.flags]):Pt&&void 0!==Pt.min&&void 0!==Pt.max?te.core.rel.inRange([We,Pt.min,Pt.max]):Array.isArray(Pt)?Pt.length>1?te.core.set.has([te.core.type.set(Pt),We]):te.core.rel.eq([We,Pt[0]]):te.core.rel.eq([We,Pt]);{const Sn=[We,Pt.val];switch(Pt.op){case"=":return te.core.rel.eq(Sn);case"!=":return te.core.rel.neq(Sn);case">":return te.core.rel.gr(Sn);case"<":return te.core.rel.lt(Sn);case">=":return te.core.rel.gre(Sn);case"<=":return te.core.rel.lte(Sn);default:throw new Error(`operator '${Pt.op}' not supported`)}}}function Ce(We){return te.struct.generator.queryInSelection({0:We,query:te.struct.generator.all(),"in-complement":!0})}function Re(We,Pt){return We.length{const Nn=We[Sn],Kn=xe(`property '${Sn}' not supported`),dr=f.regexp(Nn.regex).map(Qt=>(Nn.isUnsupported&&Kn(),Be(Nn.property,Nn.map(Qt)))),xr=f.regexp(ke(Sn,Nn.abbr)).trim(f.optWhitespace),Ft=Qt=>te.struct.generator.atomGroups({[Nn.level]:Qt});Pt.push(Nn.isNumeric?xr.then(f.seq(f.regexp(/>=|<=|=|!=|>|(Nn.isUnsupported&&Kn(),Be(Nn.property,{op:Qt[0],val:Qt[1]}))).map(Ft):xr.then(dr).map(Ft))}),Pt}function Se(We){const Pt=[];return Object.keys(We).sort(Re).forEach(Sn=>{const Nn=We[Sn],Kn=Nn.map?Nn.map:xe(`keyword '${Sn}' not supported`),dr=f.regexp(ke(Sn,Nn.abbr)).map(Kn);Pt.push(dr)}),Pt}function Ne(We,Pt){const Sn=[];return Object.keys(We).sort(Re).forEach(Nn=>{const Kn=We[Nn],dr=xe(`property '${Nn}' not supported`),xr=f.regexp(ke(Nn,Kn.abbr)).lookahead(Pt).map(()=>(Kn.isUnsupported&&dr(),Kn.property));Sn.push(xr)}),Sn}function K(We,Pt,Sn,Nn){const Kn=[];for(const dr in We)Kn.push(dr),We[dr].abbr&&Kn.push(...We[dr].abbr);for(const dr in Pt)Kn.push(dr),Pt[dr].abbr&&Kn.push(...Pt[dr].abbr);return Sn.forEach(dr=>{Kn.push(dr.name),dr.abbr&&Kn.push(...dr.abbr)}),Kn}function ne(We){return te.core.type.set(We.map(te.atomName))}function be(We){return te.struct.generator.queryInSelection({0:We,query:te.struct.generator.all()})}function Te(We,Pt,Sn){switch(We.head.name){case"structure-query.atom-property.macromolecular.label_atom_id":return te.atomName(Pt);case"structure-query.atom-property.core.element-symbol":return te.es(Pt);case"structure-query.atom-property.macromolecular.secondary-structure-flags":return Sn&&(Pt=[Sn[Pt.toUpperCase()]||"none"]),te.struct.type.secondaryStructureFlags([Pt]);default:return Pt}}const ue=["entityKey","label_entity_id","entityType"],re=["chainKey","label_asym_id","label_entity_id","auth_asym_id","entityType"],ve=["residueKey","label_comp_id","label_seq_id","auth_comp_id","auth_seq_id","pdbx_formal_charge","secondaryStructureKey","secondaryStructureFlags","isModified","modifiedParentName"];function ce(We){if(We.head.name.startsWith("structure-query.atom-property.macromolecular.")){const Pt=We.head.name.substr(45);if(ue.includes(Pt))return"entity-test";if(re.includes(Pt))return"chain-test";if(ve.includes(Pt))return"residue-test"}return"atom-test"}const se=["structure-query.atom-property.macromolecular.secondary-structure-flags"];function ge(We){return te.struct.generator.atomGroups({"residue-test":te.core.set.has([te.core.type.set(We),te.ammp("label_comp_id")])})}const Ie=c.J,Le=/[-+]?[0-9]*\.?[0-9]+/,nt=/[0-9]+/;function je(We){return We}const Lt={none:"none",turn:"turn",sheet:"beta",helix:"helix",dna:"dna",rna:"rna",carbohydrate:"carbohydrate",helix310:"3-10",helixalpha:"alpha",helixpi:"pi",0:"none",1:"turn",2:"beta",3:"helix",4:"dna",5:"rna",6:"carbohydrate",7:"3-10",8:"alpha",9:"pi"};function Je(We){if(We.head){if(We.head.name&&"core.type.regex"===We.head.name&&(We=We.args[0].replace(/^\^|\$$/g,"")),We=Lt[We.toString().toLowerCase()]||"none",-1!==["dna","rna","carbohydrate"].indexOf(We))throw new Error("values 'dna', 'rna', 'carbohydrate' not yet supported for 'structure' property");return Ie.struct.type.secondaryStructureFlags([We])}}const en={adpmax:{"@desc":"the maximum anisotropic displacement parameter for the selected atom","@examples":[""],isUnsupported:!0,regex:Le,map:We=>parseFloat(We),level:"atom-test"},adpmin:{"@desc":"the minimum anisotropic displacement parameter for the selected atom","@examples":[""],isUnsupported:!0,regex:Le,map:We=>parseFloat(We),level:"atom-test"},altloc:{"@desc":"PDB alternate location identifier","@examples":["altloc = A"],regex:/[a-zA-Z0-9]/,map:je,level:"atom-test",property:Ie.ammp("label_alt_id")},altname:{"@desc":"an alternative name given to atoms by some file readers (for example, P2N)","@examples":[""],isUnsupported:!0,regex:/[a-zA-Z0-9]/,map:je,level:"atom-test"},atomID:{"@desc":"special atom IDs for PDB atoms assigned by Jmol","@examples":[""],isUnsupported:!0,regex:nt,map:We=>parseInt(We),level:"atom-test"},atomIndex:{"@desc":"atom 0-based index; a unique number for each atom regardless of the number of models loaded","@examples":[""],isUnsupported:!0,regex:nt,map:We=>parseInt(We),level:"atom-test"},atomName:{"@desc":"atom name","@examples":["atomName = CA"],regex:/[a-zA-Z0-9]+/,map:We=>Ie.atomName(We),level:"atom-test",property:Ie.ammp("label_atom_id")},atomno:{"@desc":'sequential number; you can use "@" instead of "atomno=" -- for example, select @33 or Var x = @33 or @35',"@examples":[""],isUnsupported:!0,regex:nt,map:We=>parseInt(We),level:"atom-test"},atomType:{"@desc":"atom type (mol2, AMBER files) or atom name (other file types)","@examples":["atomType = OH"],regex:/[a-zA-Z0-9]+/,map:We=>Ie.atomName(We),level:"atom-test",property:Ie.ammp("label_atom_id")},atomX:{"@desc":"Cartesian X coordinate (or just X)","@examples":["x = 4.2"],abbr:["X"],isNumeric:!0,regex:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.acp("x")},atomY:{"@desc":"Cartesian Y coordinate (or just Y)","@examples":["y < 42"],abbr:["Y"],isNumeric:!0,regex:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.acp("y")},atomZ:{"@desc":"Cartesian Z coordinate (or just Z)","@examples":["Z > 10"],abbr:["Z"],isNumeric:!0,regex:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.acp("z")},bondcount:{"@desc":"covalent bond count","@examples":["bondcount = 0"],isNumeric:!0,regex:nt,map:We=>parseInt(We),level:"atom-test",property:Ie.acp("bondCount")},bondingRadius:{"@desc":"radius used for auto bonding; synonymous with ionic and ionicRadius","@examples":[""],abbr:["ionic","ionicRadius"],isUnsupported:!0,regex:Le,map:We=>parseFloat(We),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:je,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:nt,map:We=>parseInt(We),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:je,level:"chain-test",property:Ie.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:je,level:"atom-test"},color:{"@desc":"the atom color","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,level:"atom-test"},cs:{"@desc":"chemical shift calculated using computational results that include magnetic shielding tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:We=>Ie.es(We),level:"atom-test",property:Ie.acp("elementSymbol")},elemno:{"@desc":"atomic element number","@examples":["elemno=8"],regex:/[0-9\s{}-]+/,map:We=>parseInt(We),level:"atom-test",property:Ie.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:je,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:je,level:"atom-test"},file:{"@desc":"file number containing this atom","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},formalCharge:{"@desc":"formal charge","@examples":["formalCharge=1"],regex:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.ammp("pdbx_formal_charge")},format:{"@desc":"format (label) of the atom.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fXyz:{"@desc":"fractional XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fX:{"@desc":"fractional X coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fY:{"@desc":"fractional Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fZ:{"@desc":"fractional Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fuxyz:{"@desc":"fractional XYZ coordinates in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fux:{"@desc":"fractional X coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fuy:{"@desc":"fractional Y coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},fuz:{"@desc":"fractional Z coordinate in the unit cell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},group:{"@desc":"3-letter residue code","@examples":["group = ALA"],regex:/[a-zA-Z0-9]{1,3}/,map:je,level:"residue-test",property:Ie.ammp("label_comp_id")},group1:{"@desc":"single-letter residue code (amino acids only)","@examples":["group1 = G"],regex:/[a-zA-Z]/,map:je,level:"residue-test",property:Ie.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:je,level:"atom-test"},groupindex:{"@desc":"overall group index","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,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:je,level:"atom-test"},insertion:{"@desc":"protein residue insertion code","@examples":["insertion=A"],regex:/[a-zA-Z0-9]/,map:je,level:"atom-test",property:Ie.ammp("pdbx_PDB_ins_code")},label:{"@desc":"current atom label (same as format)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},mass:{"@desc":"atomic mass -- especially useful with appended .max or .sum","@examples":["mass > 13"],regex:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.acp("mass")},model:{"@desc":"model number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,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:je,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:je,level:"atom-test"},molecule:{"@desc":"molecule number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,level:"atom-test"},ms:{"@desc":"magnetic shielding calculated from file-loaded tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.ammp("occupancy")},partialCharge:{"@desc":"partial charge","@examples":[""],isUnsupported:!0,regex:Le,map:We=>parseFloat(We),level:"atom-test"},phi:{"@desc":"protein group PHI angle for atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},polymer:{"@desc":"sequential polymer number in a model, starting with 1.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},polymerLength:{"@desc":"polymer length","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},property_xx:{"@desc":"a property created using the DATA command","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},psi:{"@desc":"protein group PSI angle for the atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,level:"atom-test"},resno:{"@desc":"PDB residue number, not including insertion code (see also seqcode, below)","@examples":["resno = 100"],regex:/-?[0-9]+/,map:We=>parseInt(We),level:"residue-test",property:Ie.ammp("auth_seq_id")},selected:{"@desc":"1.0 if atom is selected; 0.0 if not","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,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:je,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:je,level:"atom-test"},shape:{"@desc":'hybridization geometry such as "tetrahedral"',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},site:{"@desc":"crystallographic site number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},spacefill:{"@desc":"currently displayed radius","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,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:je,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:je,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:je,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:je,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:je,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:je,level:"atom-test"},temperature:{"@desc":"yes yes temperature factor (B-factor)","@examples":["temperature >= 20"],regex:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.ammp("B_iso_or_equiv")},unitXyz:{"@desc":"unit cell XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},uX:{"@desc":"unit cell X coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},uY:{"@desc":"unit cell Y coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},uZ:{"@desc":"unit cell Z coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,level:"atom-test"},vanderwaals:{"@desc":"van der Waals radius","@examples":["vanderwaals >2"],regex:Le,map:We=>parseFloat(We),level:"atom-test",property:Ie.acp("vdw")},vectorScale:{"@desc":"vibration vector scale","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,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:je,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:je,level:"atom-test"},vY:{"@desc":"vibration vector Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,level:"atom-test"},vZ:{"@desc":"vibration vector Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:je,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:je,level:"atom-test"}},Bt=c.J,pn=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not ARG"],name:"not",type:de,rule:f.alt(f.regex(/NOT/i).skip(f.whitespace),f.string("!").skip(f.optWhitespace)),map:(We,Pt)=>Ce(Pt)},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["ASP and .CA"],name:"and",type:Z,rule:Y(/AND|&/i),map:(We,Pt,Sn)=>Bt.struct.modifier.intersectBy({0:Pt,by:Sn})},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["ASP or GLU"],name:"or",type:Z,rule:Y(/OR|\||,/i),map:(We,Pt,Sn)=>Bt.struct.combinator.merge([Pt,Sn])}],$e=c.J,mt={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"]},_t_nucleic=["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],_t_protein=["C","N","CA"];function Me(){return $e.struct.combinator.merge([$e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.set(...mt.nucleic),$e.ammp("label_comp_id")])}),$e.struct.filter.pick({0:$e.struct.generator.atomGroups({"group-by":$e.ammp("residueKey")}),test:$e.core.logic.and([$e.core.rel.eq([$e.struct.atomSet.atomCount(),1]),$e.core.rel.eq([$e.ammp("label_atom_id"),$e.atomName("P")])])}),$e.struct.filter.pick({0:$e.struct.generator.atomGroups({"group-by":$e.ammp("residueKey")}),test:$e.core.logic.or([$e.core.set.isSubset([ne(["C1'","C2'","O3'","C3'","C4'","C5'","O5'"]),$e.ammpSet("label_atom_id")]),$e.core.set.isSubset([ne(["C1*","C2*","O3*","C3*","C4*","C5*","O5*"]),$e.ammpSet("label_atom_id")])])})])}const Kt={all:{"@desc":"all atoms; same as *",abbr:["*"],map:()=>$e.struct.generator.all()},bonded:{"@desc":"covalently bonded",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.rel.gr([$e.struct.atomProperty.core.bondCount({flags:$e.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:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.rel.gr([$e.struct.atomProperty.core.bondCount({flags:$e.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:()=>$e.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:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.set.has([$e.set(...["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map($e.es)),$e.acp("elementSymbol")])})},metal:{"@desc":"!nonmetal",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.logic.not([$e.core.set.has([$e.set(...["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map($e.es)),$e.acp("elementSymbol")])])})},alkaliMetal:{"@desc":"_Li,_Na,_K,_Rb,_Cs,_Fr",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.set.has([$e.set(...["Li","Na","K","Rb","Cs","Fr"].map($e.es)),$e.acp("elementSymbol")])})},alkalineEarth:{"@desc":"_Be,_Mg,_Ca,_Sr,_Ba,_Ra",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.set.has([$e.set(...["Be","Mg","Ca","Sr","Ba","Ra"].map($e.es)),$e.acp("elementSymbol")])})},nobleGas:{"@desc":"_He,_Ne,_Ar,_Kr,_Xe,_Rn",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.set.has([$e.set(...["He","Ne","Ar","Kr","Xe","Rn"].map($e.es)),$e.acp("elementSymbol")])})},metalloid:{"@desc":"_B,_Si,_Ge,_As,_Sb,_Te",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.set.has([$e.set(...["B","Si","Ge","As","Sb","Te"].map($e.es)),$e.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:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.logic.or([$e.core.rel.inRange([$e.acp("atomicNumber"),21,30]),$e.core.rel.inRange([$e.acp("atomicNumber"),39,48]),$e.core.rel.inRange([$e.acp("atomicNumber"),72,80]),$e.core.rel.inRange([$e.acp("atomicNumber"),104,112]),$e.core.set.has([$e.set(57,89),$e.acp("atomicNumber")])])})},lanthanide:{"@desc":"(does not include La) elemno>57 and elemno<=71",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.rel.inRange([$e.acp("atomicNumber"),57,71])})},actinide:{"@desc":"(does not include Ac) elemno>89 and elemno<=103",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.rel.inRange([$e.acp("atomicNumber"),89,103])})},isaromatic:{"@desc":"atoms connected with the AROMATIC, AROMATICSINGLE, or AROMATICDOUBLE bond types",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.rel.gr([$e.struct.atomProperty.core.bondCount({flags:$e.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:()=>Me()},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:()=>$e.struct.modifier.intersectBy({0:Me(),by:$e.struct.combinator.merge([$e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.set("A","G","I","DA","DG","DI","+A","+G","+I"),$e.ammp("label_comp_id")])}),$e.struct.filter.pick({0:$e.struct.generator.atomGroups({"group-by":$e.ammp("residueKey")}),test:$e.core.set.isSubset([ne(["N7","C8","N9"]),$e.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:()=>$e.struct.modifier.intersectBy({0:Me(),by:$e.struct.combinator.merge([$e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.set("C","T","U","DC","DT","DU","+C","+T","+U"),$e.ammp("label_comp_id")])}),$e.struct.filter.pick({0:$e.struct.generator.atomGroups({"group-by":$e.ammp("residueKey")}),test:$e.core.logic.or([$e.core.set.has([$e.ammpSet("label_atom_id"),$e.atomName("O2*")]),$e.core.set.has([$e.ammpSet("label_atom_id"),$e.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:()=>$e.struct.modifier.intersectBy({0:Me(),by:$e.struct.combinator.merge([$e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.set("DG","DC","DA","DT","DU","DI","T","+G","+C","+A","+T"),$e.ammp("label_comp_id")])}),$e.struct.filter.pick({0:$e.struct.generator.atomGroups({"group-by":$e.ammp("residueKey")}),test:$e.core.logic.not([$e.core.logic.or([$e.core.set.has([$e.ammpSet("label_atom_id"),$e.atomName("O2*")]),$e.core.set.has([$e.ammpSet("label_atom_id"),$e.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:()=>$e.struct.modifier.intersectBy({0:Me(),by:$e.struct.combinator.merge([$e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.set("G","C","A","U","I","+U","+I"),$e.ammp("label_comp_id")])}),$e.struct.filter.pick({0:$e.struct.generator.atomGroups({"group-by":$e.ammp("residueKey")}),test:$e.core.logic.or([$e.core.set.has([$e.ammpSet("label_atom_id"),$e.atomName("O2*")]),$e.core.set.has([$e.ammpSet("label_atom_id"),$e.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 Ke(){return $e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.set(...mt.amino),$e.ammp("label_comp_id")])})}()},acidic:{"@desc":"ASP GLU",map:()=>ge(mt.acidic)},acyclic:{"@desc":"amino and not cyclic",map:()=>$e.struct.modifier.intersectBy({0:ge(mt.amino),by:Ce(ge(mt.cyclic))})},aliphatic:{"@desc":"ALA GLY ILE LEU VAL",map:()=>ge(mt.aliphatic)},amino:{"@desc":"all twenty standard amino acids, plus ASX, GLX, UNK",map:()=>ge(mt.amino)},aromatic:{"@desc":'HIS PHE TRP TYR (see also "isaromatic" for aromatic bonds)',map:()=>ge(mt.aromatic)},basic:{"@desc":"ARG HIS LYS",map:()=>ge(mt.basic)},buried:{"@desc":"ALA CYS ILE LEU MET PHE TRP VAL",map:()=>ge(mt.buried)},charged:{"@desc":"same as acidic or basic -- ASP GLU, ARG HIS LYS",map:()=>ge(mt.acidic.concat(mt.basic))},cyclic:{"@desc":"HIS PHE PRO TRP TYR",map:()=>ge(mt.cyclic)},helix:{"@desc":"secondary structure-related.",map:()=>$e.struct.generator.atomGroups({"residue-test":$e.core.flags.hasAny([$e.struct.type.secondaryStructureFlags(["helix"]),$e.ammp("secondaryStructureFlags")])})},helixalpha:{"@desc":"secondary structure-related.",map:()=>$e.struct.generator.atomGroups({"residue-test":$e.core.flags.hasAny([$e.struct.type.secondaryStructureFlags(["alpha"]),$e.ammp("secondaryStructureFlags")])})},helix310:{"@desc":"secondary structure-related.",map:()=>$e.struct.generator.atomGroups({"residue-test":$e.core.flags.hasAny([$e.struct.type.secondaryStructureFlags(["3-10"]),$e.ammp("secondaryStructureFlags")])})},helixpi:{"@desc":"secondary structure-related.",map:()=>$e.struct.generator.atomGroups({"residue-test":$e.core.flags.hasAny([$e.struct.type.secondaryStructureFlags(["pi"]),$e.ammp("secondaryStructureFlags")])})},hetero:{"@desc":"PDB atoms designated as HETATM",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.ammp("isHet")})},hydrophobic:{"@desc":"ALA GLY ILE LEU MET PHE PRO TRP TYR VAL",map:()=>ge(mt.hydrophobic)},large:{"@desc":"ARG GLU GLN HIS ILE LEU LYS MET PHE TRP TYR",map:()=>ge(mt.large)},medium:{"@desc":"ASN ASP CYS PRO THR VAL",map:()=>ge(mt.medium)},negative:{"@desc":"same as acidic -- ASP GLU",map:()=>ge(mt.acidic)},neutral:{"@desc":"amino and not (acidic or basic)",map:()=>$e.struct.modifier.intersectBy({0:ge(mt.amino),by:Ce(ge(mt.acidic.concat(mt.basic)))})},polar:{"@desc":"amino and not hydrophobic",map:()=>$e.struct.modifier.intersectBy({0:ge(mt.amino),by:Ce(ge(mt.hydrophobic))})},positive:{"@desc":"same as basic -- ARG HIS LYS",map:()=>ge(mt.basic)},sheet:{"@desc":"secondary structure-related",map:()=>$e.struct.generator.atomGroups({"residue-test":$e.core.flags.hasAny([$e.struct.type.secondaryStructureFlags(["sheet"]),$e.ammp("secondaryStructureFlags")])})},small:{"@desc":"ALA GLY SER",map:()=>ge(mt.small)},surface:{"@desc":"amino and not buried",map:()=>$e.struct.modifier.intersectBy({0:ge(mt.amino),by:Ce(ge(mt.buried))})},turn:{"@desc":"secondary structure-related",map:()=>$e.struct.generator.atomGroups({"residue-test":$e.core.flags.hasAny([$e.struct.type.secondaryStructureFlags(["turn"]),$e.ammp("secondaryStructureFlags")])})},alpha:{"@desc":"(*.CA)",map:()=>$e.struct.generator.atomGroups({"atom-test":$e.core.rel.eq([$e.atomName("CA"),$e.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 ut(){return $e.struct.combinator.merge([$e.struct.modifier.intersectBy({0:$e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.core.type.set(mt.amino),$e.ammp("label_comp_id")])}),by:$e.struct.generator.atomGroups({"atom-test":$e.core.set.has([$e.core.type.set(_t_protein),$e.ammp("label_atom_id")])})}),$e.struct.modifier.intersectBy({0:$e.struct.generator.atomGroups({"residue-test":$e.core.set.has([$e.core.type.set(mt.nucleic),$e.ammp("label_comp_id")])}),by:$e.struct.generator.atomGroups({"atom-test":$e.core.set.has([$e.core.type.set(_t_nucleic),$e.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'}},sn=c.J,gt=[{"@desc":"value comparisons","@examples":[],name:"=",abbr:["=="],type:Z,rule:f.regexp(/\s*(LIKE|>=|<=|=|!=|>|<)\s*/i,1),map:(We,Pt,Sn)=>{let Nn;if("structure"===Pt?Nn=sn.core.flags.hasAny([sn.ammp("secondaryStructureFlags"),Je(Sn)]):"structure"===Sn?Nn=sn.core.flags.hasAny([sn.ammp("secondaryStructureFlags"),Je(Pt)]):void 0!==Pt.head?"core.type.regex"===Pt.head.name&&(Nn=sn.core.str.match([Pt,sn.core.type.str([Sn])])):void 0!==Sn.head?"core.type.regex"===Sn.head.name&&(Nn=sn.core.str.match([Sn,sn.core.type.str([Pt])])):"LIKE"===We.toUpperCase()&&(Nn=sn.core.str.match(Pt.head?[sn.core.type.regex([`^${Sn}$`,"i"]),sn.core.type.str([Pt])]:[sn.core.type.regex([`^${Pt}$`,"i"]),sn.core.type.str([Sn])])),!Nn)switch(Pt.head&&(Sn=Te(Pt,Sn)),Sn.head&&(Pt=Te(Sn,Pt)),We){case"=":Nn=sn.core.rel.eq([Pt,Sn]);break;case"!=":Nn=sn.core.rel.neq([Pt,Sn]);break;case">":Nn=sn.core.rel.gr([Pt,Sn]);break;case"<":Nn=sn.core.rel.lt([Pt,Sn]);break;case">=":Nn=sn.core.rel.gre([Pt,Sn]);break;case"<=":Nn=sn.core.rel.lte([Pt,Sn]);break;default:throw new Error(`value operator '${We}' not supported`)}return sn.struct.generator.atomGroups({"atom-test":Nn})}}];function yt(We){const[Pt,Sn,Nn,Kn,dr,xr,Ft]=We[1],Qt={};dr&&(Qt["chain-test"]=sn.core.rel.eq([sn.ammp("auth_asym_id"),dr]));const ht=[];Pt&&ht.push(sn.core.rel.eq([sn.ammp("label_comp_id"),Pt])),Sn&&ht.push(sn.core.logic.and([sn.core.rel.gre([sn.ammp("auth_seq_id"),Sn[0]]),sn.core.rel.lte([sn.ammp("auth_seq_id"),Sn[1]])])),Nn&&ht.push(sn.core.rel.eq([sn.ammp("auth_seq_id"),Nn])),Kn&&ht.push(sn.core.rel.eq([sn.ammp("pdbx_PDB_ins_code"),Kn])),ht.length&&(Qt["residue-test"]=le(ht));const pt=[];return xr&&pt.push(sn.core.rel.eq([sn.ammp("auth_atom_id"),xr])),Ft&&pt.push(sn.core.rel.eq([sn.ammp("label_alt_id"),Ft])),pt.length&&(Qt["atom-test"]=le(pt)),sn.struct.generator.atomGroups(Qt)}const At=f.createLanguage({Integer:()=>f.regexp(/-?[0-9]+/).map(Number).desc("integer"),Parens:function(We){return f.alt(We.Parens,We.Operator,We.Expression).wrap(f.regexp(/\(\s*/),f.regexp(/\s*\)/))},Expression:function(We){return f.alt(We.Keywords,We.AtomExpression.map(yt),We.Within.map(Pt=>sn.struct.modifier.includeSurroundings({0:Pt[1],radius:Pt[0]})),We.ValueQuery,We.Element.map(Pt=>sn.struct.generator.atomGroups({"atom-test":sn.core.rel.eq([sn.acp("elementSymbol"),sn.struct.type.elementSymbol(Pt)])})),We.Resname.map(Pt=>sn.struct.generator.atomGroups({"residue-test":sn.core.rel.eq([sn.ammp("label_comp_id"),Pt])})))},Operator:function(We){return q(pn,f.alt(We.Parens,We.Expression))},AtomExpression:function(We){return f.seq(f.lookahead(We.AtomPrefix),f.seq(We.BracketedResname.or(f.of(null)),We.ResnoRange.or(f.of(null)),We.Resno.or(f.of(null)),We.Inscode.or(f.of(null)),We.Chainname.or(f.of(null)),We.Atomname.or(f.of(null)),We.Altloc.or(f.of(null)),We.Model.or(f.of(null)))).desc("expression")},AtomPrefix:()=>f.regexp(/[\[0-9:^%/.-]/).desc("atom-prefix"),Chainname:()=>f.regexp(/:([A-Za-z]{1,3})/,1).desc("chainname"),Model:()=>f.regexp(/\/([0-9]+)/,1).map(Number).desc("model"),Element:()=>f.regexp(/_([A-Za-z]{1,3})/,1).desc("element"),Atomname:()=>f.regexp(/\.([a-zA-Z0-9]{1,4})/,1).map(sn.atomName).desc("atomname"),Resname:()=>f.regexp(/[a-zA-Z0-9]{1,4}/).desc("resname"),Resno:We=>We.Integer.desc("resno"),Altloc:()=>f.regexp(/%([a-zA-Z0-9])/,1).desc("altloc"),Inscode:()=>f.regexp(/\^([a-zA-Z0-9])/,1).desc("inscode"),BracketedResname:()=>f.regexp(/\[([a-zA-Z0-9]{1,4})\]/,1).desc("bracketed-resname"),ResnoRange:We=>f.seq(We.Integer.skip(f.seq(f.optWhitespace,f.string("-"),f.optWhitespace)),We.Integer).desc("resno-range"),Within:We=>f.regexp(/within/i).skip(f.regexp(/\s*\(\s*/)).then(f.seq(We.Integer.skip(f.regexp(/\s*,\s*/)),We.Query)).skip(f.regexp(/\)/)),Keywords:()=>f.alt(...Se(Kt)).desc("keyword"),Query:function(We){return f.alt(We.Operator,We.Parens,We.Expression).trim(f.optWhitespace)},Number:function(){return f.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){const We=K(en,Kt,pn).sort(Re).map(W.Nt).join("|");return f.alt(f.regexp(new RegExp(`(?!(${We}))[A-Z0-9_]+`,"i")),f.regexp(/'((?:[^"\\]|\\.)*)'/,1),f.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(Pt=>sn.core.type.regex([`^${Pt}$`,"i"]))).desc("string")},Value:function(We){return f.alt(We.Number,We.String)},ValueParens:function(We){return f.alt(We.ValueParens,We.ValueOperator,We.ValueExpressions).wrap(f.string("("),f.string(")"))},ValuePropertyNames:function(){return f.alt(...Ne(en,/LIKE|>=|<=|=|!=|>|<|\)|\s/i))},ValueOperator:function(We){return q(gt,f.alt(We.ValueParens,We.ValueExpressions))},ValueExpressions:function(We){return f.alt(We.Value,We.ValuePropertyNames)},ValueQuery:function(We){return f.alt(We.ValueOperator.map(Pt=>{if(Pt.head){if(Pt.head.name.startsWith("structure-query.generator"))return Pt}else if("string"==typeof Pt&&Pt.length<=4)return sn.struct.generator.atomGroups({"residue-test":sn.core.rel.eq([sn.ammp("label_comp_id"),Pt])});throw new Error(`values must be part of an comparison, value '${Pt}'`)}))}}),rn=c.J,tt=/[-+]?[0-9]*\.?[0-9]+/;function nn(We){return We.split("+").map(Pt=>Pt.replace(/^["']|["']$/g,""))}function bn(We){if(We.includes("-")&&We.includes("+")){const Pt=We.split("+").map(Nn=>Nn.replace(/^["']|["']$/g,"")),Sn=[];return Pt.forEach(Nn=>{if(Nn.includes("-")&&!Nn.startsWith("-")){const[Kn,dr]=Nn.split("-").map(xr=>parseInt(xr));for(let xr=Kn;xr<=dr;xr++)Sn.push(xr)}else if(Nn.includes("-")&&Nn.startsWith("-")&&Nn.match(/[0-9]+-[-0-9]+/)){const Kn=-parseInt(Nn.split("-")[1]);let dr;dr=Nn.includes("--")?-parseInt(Nn.split("-")[3]):parseInt(Nn.split("-")[2]);for(let xr=Kn;xr<=dr;xr++)Sn.push(xr)}else Nn.includes("-")&&Nn.startsWith("-")&&Nn.match(/[0-9]+-[-0-9]+/),Sn.push(parseInt(Nn))}),Sn}if(We.includes("-")&&!We.includes("+")){const Pt=[];if(We.startsWith("-"))if(We.startsWith("-")&&We.match(/[0-9]+-[-0-9]+/)){const Sn=-parseInt(We.split("-")[1]);let Nn;Nn=We.includes("--")?-parseInt(We.split("-")[3]):parseInt(We.split("-")[2]);for(let Kn=Sn;Kn<=Nn;Kn++)Pt.push(Kn)}else We.startsWith("-")&&We.match(/[0-9]+-[-0-9]+/),Pt.push(parseInt(We));else{const[Sn,Nn]=We.split("-").map(Kn=>parseInt(Kn));for(let Kn=Sn;Kn<=Nn;Kn++)Pt.push(Kn)}return Pt}return!We.includes("-")&&We.includes("+")?nn(We).map(Pt=>parseInt(Pt)):[parseInt(We)]}const jt={H:"helix",S:"beta",L:"none"},Dt={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 Dn(We){return We.split("+").map(rn.struct.type.elementSymbol)},level:"atom-test",property:rn.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 Mt(We){return We.split("+").map(rn.atomName)},level:"atom-test",property:rn.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:nn,level:"residue-test",property:rn.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:bn,level:"residue-test",property:rn.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:nn,level:"atom-test",property:rn.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:nn,level:"chain-test",property:rn.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:nn,level:"chain-test",property:rn.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:We=>parseInt(We),level:"atom-test"},numeric_type:{"@desc":"type-number a single integer","@examples":["nt. 5"],isUnsupported:!0,abbr:["nt."],regex:/[0-9]+/,map:We=>parseInt(We),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:nn,level:"atom-test"},id:{"@desc":"external-index-number a single integer","@examples":["id 23"],regex:/[0-9+-]+/,map:bn,level:"atom-test",property:rn.ammp("id")},index:{"@desc":"internal-index-number a single integer","@examples":["index 11"],regex:/[0-9+-]+/,map:bn,level:"atom-test",property:rn.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 It(We){return{flags:rn.struct.type.secondaryStructureFlags(We.toUpperCase().split("+").map(Pt=>jt[Pt]||"none"))}},level:"residue-test",property:rn.ammp("secondaryStructureFlags")},b:{"@desc":"comparison-operator b-factor-value a real number","@examples":["b > 10"],isNumeric:!0,abbr:[],regex:tt,map:We=>parseFloat(We),level:"atom-test",property:rn.ammp("B_iso_or_equiv")},q:{"@desc":"comparison-operator occupancy-value a real number","@examples":["q <0.50"],isNumeric:!0,abbr:[],regex:tt,map:We=>parseFloat(We),level:"atom-test",property:rn.ammp("occupancy")},formal_charge:{"@desc":"comparison-operator formal charge-value an integer","@examples":["fc. = -1"],isNumeric:!0,abbr:["fc."],regex:tt,map:We=>parseFloat(We),level:"atom-test",property:rn.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:tt,map:We=>parseFloat(We),level:"atom-test"},elem:{"@desc":'str atomic element symbol string ("X" if undefined)',"@examples":["elem N"],regex:/[a-zA-Z0-9]{1,3}/,map:We=>rn.es(We),level:"atom-test",property:rn.acp("elementSymbol")}},Ct=c.J,$t=[{"@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:de,rule:f.alt(f.regexp(/NOT/i).skip(f.whitespace),f.string("!").skip(f.optWhitespace)),map:(We,Pt)=>Ce(Pt)},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["chain A AND name CA"],name:"and",type:Z,rule:Y(/AND|&/i),map:(We,Pt,Sn)=>Ct.struct.modifier.intersectBy({0:Pt,by:Sn})},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["chain A OR chain B"],name:"or",type:Z,rule:Y(/OR|\|/i),map:(We,Pt,Sn)=>Ct.struct.combinator.merge([Pt,Sn])},{"@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:Z,rule:Y(/IN/i),map:(We,Pt,Sn)=>Ct.struct.filter.withSameAtomProperties({0:Pt,source:Sn,property:Ct.core.type.compositeKey([Ct.ammp("label_atom_id"),Ct.ammp("label_seq_id"),Ct.ammp("label_comp_id"),Ct.ammp("auth_asym_id"),Ct.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:Z,rule:Y(/LIKE|l\./i),map:(We,Pt,Sn)=>Ct.struct.filter.withSameAtomProperties({0:Pt,source:Sn,property:Ct.core.type.compositeKey([Ct.ammp("label_atom_id"),Ct.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:ye,rule:g(/GAP\s+([-+]?[0-9]*\.?[0-9]+)/i,1).map(We=>parseFloat(We)),map:(We,Pt)=>Ct.struct.filter.within({0:Ct.struct.generator.all(),target:Pt,"atom-radius":Ct.acp("vdw"),"max-radius":We,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:ye,rule:g(/(AROUND|a\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(We=>parseFloat(We)),map:(We,Pt)=>Ct.struct.modifier.exceptBy({0:Ct.struct.filter.within({0:Ct.struct.generator.all(),target:Pt,"max-radius":We}),by:Pt})},{"@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:ye,rule:g(/(EXPAND|x\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(We=>parseFloat(We)),map:(We,Pt)=>Ct.struct.modifier.includeSurroundings({0:Pt,radius:We})},{"@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:Z,rule:_e("WITHIN","w."),map:(We,Pt,Sn)=>Ct.struct.filter.within({0:Pt,target:Sn,"max-radius":We})},{"@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:Z,rule:_e("NEAR_TO","nto."),map:(We,Pt,Sn)=>Ct.struct.modifier.exceptBy({0:Ct.struct.filter.within({0:Pt,target:Sn,"max-radius":We}),by:Sn})},{"@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:Z,rule:_e("BEYOND","be."),map:(We,Pt,Sn)=>Ct.struct.modifier.exceptBy({0:Ct.struct.filter.within({0:Pt,target:Sn,"max-radius":We,invert:!0}),by:Sn})},{"@desc":"Expands selection to complete residues.","@examples":["BYRESIDUE name N"],name:"byresidue",abbr:["byresi","byres","br."],type:de,rule:ee(/BYRESIDUE|byresi|byres|br\./i),map:(We,Pt)=>be(Ct.struct.modifier.expandProperty({0:Ct.struct.modifier.union({0:Pt}),property:Ct.ammp("residueKey")}))},{"@desc":"Completely selects all alpha carbons in all residues covered by a selection.","@examples":["BYCALPHA chain A"],name:"bycalpha",abbr:["bca."],type:de,rule:ee(/BYCALPHA|bca\./i),map:(We,Pt)=>Ct.struct.generator.queryInSelection({0:Ct.struct.modifier.expandProperty({0:Ct.struct.modifier.union({0:Pt}),property:Ct.ammp("residueKey")}),query:Ct.struct.generator.atomGroups({"atom-test":Ct.core.rel.eq([Ct.atomName("CA"),Ct.ammp("label_atom_id")])})})},{"@desc":"Expands selection to complete molecules.","@examples":["BYMOLECULE resi 20-30"],name:"bymolecule",isUnsupported:!0,abbr:["bymol","bm."],type:de,rule:ee(/BYMOLECULE|bymol|bm\./i),map:(We,Pt)=>be(Ct.struct.modifier.expandProperty({0:Ct.struct.modifier.union({0:Pt}),property:Ct.atp("connectedComponentKey")}))},{"@desc":"Expands selection to complete fragments.","@examples":["BYFRAGMENT resi 10"],name:"byfragment",abbr:["byfrag","bf."],isUnsupported:!0,type:de,rule:ee(/BYFRAGMENT|byfrag|bf\./i),map:(We,Pt)=>[We,Pt]},{"@desc":"Expands selection to complete segments.","@examples":["BYSEGMENT resn CYS"],name:"bysegment",abbr:["bysegi","byseg","bs."],type:de,rule:ee(/BYSEGMENT|bysegi|byseg|bs\./i),map:(We,Pt)=>be(Ct.struct.modifier.expandProperty({0:Ct.struct.modifier.union({0:Pt}),property:Ct.ammp("chainKey")}))},{"@desc":"Expands selection to complete objects.","@examples":["BYOBJECT chain A"],name:"byobject",abbr:["byobj","bo."],isUnsupported:!0,type:de,rule:ee(/BYOBJECT|byobj|bo\./i),map:(We,Pt)=>[We,Pt]},{"@desc":"Expands selection to unit cell.","@examples":["BYCELL chain A"],name:"bycell",isUnsupported:!0,type:de,rule:ee(/BYCELL/i),map:(We,Pt)=>[We,Pt]},{"@desc":"All rings of size \u2264 7 which have at least one atom in s1.","@examples":["BYRING resn HEM"],name:"byring",type:de,rule:ee(/BYRING/i),map:(We,Pt)=>be(Ct.struct.modifier.intersectBy({0:Ct.struct.filter.pick({0:Ct.struct.generator.rings(),test:Ct.core.logic.and([Ct.core.rel.lte([Ct.struct.atomSet.atomCount(),7]),Ct.core.rel.gr([Ct.struct.atomSet.countQuery([Pt]),1])])}),by:Pt}))},{"@desc":"Selects atoms directly bonded to s1, excludes s1.","@examples":["NEIGHBOR resn CYS"],name:"neighbor",type:de,abbr:["nbr."],rule:ee(/NEIGHBOR|nbr\./i),map:(We,Pt)=>Ct.struct.modifier.exceptBy({0:be(Ct.struct.modifier.includeConnected({0:Ct.struct.modifier.union({0:Pt}),"bond-test":!0})),by:Pt})},{"@desc":"Selects atoms directly bonded to s1, may include s1.","@examples":["BOUND_TO name CA"],name:"bound_to",abbr:["bto."],type:de,rule:ee(/BOUND_TO|bto\./i),map:(We,Pt)=>be(Ct.struct.modifier.includeConnected({0:Ct.struct.modifier.union({0:Pt})}))},{"@desc":"Extends s1 by X bonds connected to atoms in s1.","@examples":["resname LIG EXTEND 3"],name:"extend",abbr:["xt."],type:ye,rule:g(/(EXTEND|xt\.)\s+([0-9]+)/i,2).map(We=>parseInt(We)),map:(We,Pt)=>be(Ct.struct.modifier.includeConnected({0:Ct.struct.modifier.union({0:Pt}),"bond-test":!0,"layer-count":We}))}],Vt=c.J,Wt={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"]},yn_nucleic=["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],yn_protein=["C","N","CA","O"];function Zt(){return Vt.struct.combinator.merge([Vt.struct.modifier.intersectBy({0:Vt.struct.generator.atomGroups({"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.protein),Vt.ammp("label_comp_id")])}),by:Vt.struct.generator.atomGroups({"atom-test":Vt.core.set.has([Vt.core.type.set(yn_protein),Vt.ammp("label_atom_id")])})}),Vt.struct.modifier.intersectBy({0:Vt.struct.generator.atomGroups({"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.nucleic),Vt.ammp("label_comp_id")])}),by:Vt.struct.generator.atomGroups({"atom-test":Vt.core.set.has([Vt.core.type.set(yn_nucleic),Vt.ammp("label_atom_id")])})})])}const kt={all:{"@desc":"All atoms currently loaded into PyMOL",abbr:["*"],map:()=>Vt.struct.generator.all()},none:{"@desc":"No atoms (empty selection)",map:()=>Vt.struct.generator.empty()},hydrogens:{"@desc":"All hydrogen atoms currently loaded into PyMOL",abbr:["hydro","h."],map:()=>Vt.struct.generator.atomGroups({"atom-test":Vt.core.rel.eq([Vt.acp("elementSymbol"),Vt.es("H")])})},hetatm:{"@desc":"All atoms loaded from Protein Data Bank HETATM records",abbr:["het"],map:()=>Vt.struct.generator.atomGroups({"atom-test":Vt.core.rel.eq([Vt.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:()=>Vt.struct.generator.atomGroups({"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.nucleic.concat(Wt.protein)),Vt.ammp("label_comp_id")])})},sidechain:{"@desc":"Polymer non-backbone atoms (new in PyMOL 1.6.1)",abbr:["sc."],map:()=>Vt.struct.modifier.exceptBy({0:Vt.struct.generator.atomGroups({"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.nucleic.concat(Wt.protein)),Vt.ammp("label_comp_id")])}),by:Zt()})},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:()=>Vt.struct.generator.atomGroups({"atom-test":Vt.core.rel.gr([Vt.struct.atomProperty.core.bondCount({flags:Vt.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:()=>be(Vt.struct.modifier.expandProperty({0:Vt.struct.modifier.union([Vt.struct.generator.queryInSelection({0:Vt.struct.generator.atomGroups({"residue-test":Vt.core.logic.not([Vt.core.set.has([Vt.core.type.set(Wt.nucleic.concat(Wt.protein)),Vt.ammp("label_comp_id")])])}),query:Vt.struct.generator.atomGroups({"atom-test":Vt.core.rel.eq([Vt.es("C"),Vt.acp("elementSymbol")])})})]),property:Vt.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:()=>be(Vt.struct.modifier.expandProperty({0:Vt.struct.modifier.union([Vt.struct.filter.pick({0:Vt.struct.generator.atomGroups({"residue-test":Vt.core.logic.not([Vt.core.set.has([Vt.core.type.set(Wt.nucleic.concat(Wt.protein).concat(Wt.solvent)),Vt.ammp("label_comp_id")])]),"group-by":Vt.ammp("residueKey")}),test:Vt.core.logic.not([Vt.core.set.has([Vt.struct.atomSet.propertySet([Vt.acp("elementSymbol")]),Vt.es("C")])])})]),property:Vt.ammp("residueKey")}))},solvent:{"@desc":"All water molecules. The hardcoded solvent residue identifiers are currently: HOH, WAT, H20, TIP, SOL.",abbr:["sol."],map:()=>Vt.struct.generator.atomGroups({"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.solvent),Vt.ammp("label_comp_id")])})},guide:{"@desc":"All protein CA and nucleic acid C4*/C4",map:()=>Vt.struct.combinator.merge([Vt.struct.generator.atomGroups({"atom-test":Vt.core.rel.eq([Vt.atomName("CA"),Vt.ammp("label_atom_id")]),"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.protein),Vt.ammp("label_comp_id")])}),Vt.struct.generator.atomGroups({"atom-test":Vt.core.set.has([ne(["C4*","C4'"]),Vt.ammp("label_atom_id")]),"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.nucleic),Vt.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:()=>Zt()},"polymer.protein":{"@desc":"Protein (New in PyMOL 2.1)",abbr:["polymer.protein"],map:()=>Vt.struct.generator.atomGroups({"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.protein),Vt.ammp("label_comp_id")])})},"polymer.nucleic":{"@desc":"Nucleic Acid (New in PyMOL 2.1)",abbr:["polymer.nucleic"],map:()=>Vt.struct.generator.atomGroups({"residue-test":Vt.core.set.has([Vt.core.type.set(Wt.nucleic),Vt.ammp("label_comp_id")])})}},Ot=c.J,An=function we(We){const Pt={};return Object.keys(We).sort(Re).forEach(Sn=>{const Nn=We[Sn],Kn=xe(`property '${Sn}' not supported`),dr=f.regexp(Nn.regex).map(xr=>(Nn.isUnsupported&&Kn(),Be(Nn.property,Nn.map(xr))));Nn.isNumeric||(Pt[Sn]=dr)}),Pt}(Dt),jn=f.string("/");function On(We){return We.or(f.of(null))}function fr(We){const Pt={},Sn={};for(const Nn in We){const Kn=Dt[Nn];if(!Kn)throw new Error(`property '${Nn}' not supported, value '${We[Nn]}'`);null!==We[Nn]&&(Sn[Kn.level]||(Sn[Kn.level]=[]),Sn[Kn.level].push(We[Nn]))}for(const Nn in Sn)Pt[Nn]=le(Sn[Nn]);return Ot.struct.generator.atomGroups(Pt)}const Dr=f.createLanguage({Parens:function(We){return f.alt(We.Parens,We.Operator,We.Expression).wrap(f.string("("),f.string(")"))},Expression:function(We){return f.alt(We.Keywords,We.AtomSelectionMacro.map(fr),We.NamedAtomProperties,We.Pepseq,We.Rep,We.Object)},AtomSelectionMacro:function(We){return f.alt(jn.then(f.alt(f.seq(On(We.ObjectProperty).skip(jn),On(An.segi).skip(jn),On(An.chain).skip(jn),On(An.resi).skip(jn),On(An.name)).map(Pt=>({object:Pt[0],segi:Pt[1],chain:Pt[2],resi:Pt[3],name:Pt[4]})),f.seq(On(We.ObjectProperty).skip(jn),On(An.segi).skip(jn),On(An.chain).skip(jn),On(An.resi)).map(Pt=>({object:Pt[0],segi:Pt[1],chain:Pt[2],resi:Pt[3]})),f.seq(On(We.ObjectProperty).skip(jn),On(An.segi).skip(jn),On(An.chain)).map(Pt=>({object:Pt[0],segi:Pt[1],chain:Pt[2]})),f.seq(On(We.ObjectProperty).skip(jn),On(An.segi)).map(Pt=>({object:Pt[0],segi:Pt[1]})),f.seq(On(We.ObjectProperty)).map(Pt=>({object:Pt[0]})))),f.alt(f.seq(On(We.ObjectProperty).skip(jn),On(An.segi).skip(jn),On(An.chain).skip(jn),On(An.resi).skip(jn),On(An.name)).map(Pt=>({object:Pt[0],segi:Pt[1],chain:Pt[2],resi:Pt[3],name:Pt[4]})),f.seq(On(An.segi).skip(jn),On(An.chain).skip(jn),On(An.resi).skip(jn),On(An.name)).map(Pt=>({segi:Pt[0],chain:Pt[1],resi:Pt[2],name:Pt[3]})),f.seq(On(An.chain).skip(jn),On(An.resi).skip(jn),On(An.name)).map(Pt=>({chain:Pt[0],resi:Pt[1],name:Pt[2]})),f.seq(On(An.resi).skip(jn),On(An.name)).map(Pt=>({resi:Pt[0],name:Pt[1]}))))},NamedAtomProperties:function(){return f.alt(...Oe(Dt))},Keywords:()=>f.alt(...Se(kt)),ObjectProperty:()=>{const We=K(Dt,kt,$t).sort(Re).map(W.Nt).join("|");return f.regexp(new RegExp(`(?!(${We}))[A-Z0-9_]+`,"i"))},Object:We=>We.ObjectProperty.notFollowedBy(jn).map(Pt=>{throw new Error(`property 'object' not supported, value '${Pt}'`)}),Pepseq:()=>f.regexp(/(PEPSEQ|ps\.)\s+([a-z]+)/i,2).map(xe("operator 'pepseq' not supported")),Rep:()=>f.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(xe("operator 'rep' not supported")),Operator:function(We){return q($t,f.alt(We.Parens,We.Expression,We.Operator))},Query:function(We){return f.alt(We.Operator,We.Parens,We.Expression).trim(f.optWhitespace)}}),or=c.J,Nr=/[-+]?[0-9]*\.?[0-9]+/,Ir=/[+]?[0-9]+/,Or=/[-+]?[0-9]+/;function Jr(We){return We}const To={T:"turn",E:"sheet",B:"strand",H:"alpha",G:"3-10",I:"pi",C:"none"};function un(We){return or.struct.type.secondaryStructureFlags([To[We.toUpperCase()]||"none"])}const ct={name:{"@desc":"str atom name","@examples":["name CA"],regex:/[a-zA-Z0-9]+/,map:or.atomName,level:"atom-test",property:or.ammp("label_atom_id")},type:{"@desc":"str atom type","@examples":["type C3"],isUnsupported:!0,regex:/[a-zA-Z0-9]+/,map:Jr,level:"atom-test"},index:{"@desc":"num the atom number, starting at 0","@examples":["index 10"],isNumeric:!0,regex:Ir,map:We=>parseInt(We)-1,level:"atom-test",property:or.ammp("id")},serial:{"@desc":"num the atom number, starting at 1","@examples":["serial 11"],isNumeric:!0,regex:Ir,map:We=>parseInt(We),level:"atom-test",property:or.ammp("id")},atomicnumber:{"@desc":"num atomic number (0 if undefined)","@examples":["atomicnumber 13"],isNumeric:!0,regex:Ir,map:We=>parseInt(We),level:"atom-test",property:or.acp("atomicNumber")},element:{"@desc":'str atomic element symbol string ("X" if undefined)',"@examples":["element N"],regex:/[a-zA-Z0-9]{1,3}/,map:We=>or.es(We),level:"atom-test",property:or.acp("elementSymbol")},altloc:{"@desc":"str alternate location/conformation identifier","@examples":["altloc C"],regex:/[a-zA-Z0-9]+/,map:Jr,level:"atom-test",property:or.ammp("label_alt_id")},chain:{"@desc":"str the one-character chain identifier","@examples":["chain A"],regex:/[a-zA-Z0-9]+/,map:Jr,level:"residue-test",property:or.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:Or,map:We=>parseInt(We),level:"residue-test",property:or.ammp("auth_seq_id")},fragment:{"@desc":"num a set of connected residues","@examples":["fragment 42"],isUnsupported:!0,isNumeric:!0,regex:Or,map:We=>parseInt(We),level:"residue-test"},pfrag:{"@desc":"num a set of connected protein residues","@examples":["pfrag 42"],isUnsupported:!0,isNumeric:!0,regex:Or,map:We=>parseInt(We),level:"residue-test"},nfrag:{"@desc":"num a set of connected nucleic residues","@examples":["nfrag 42"],isUnsupported:!0,isNumeric:!0,regex:Or,map:We=>parseInt(We),level:"residue-test"},sequence:{"@desc":"str a sequence given by one letter names","@examples":["sequence PGATTACA"],isUnsupported:!0,regex:/[a-zA-Z0-9]+/,map:Jr,level:"residue-test"},numbonds:{"@desc":"num number of bonds","@examples":["numbonds = 2","numbonds >= 3"],isNumeric:!0,regex:Ir,map:We=>parseInt(We),level:"atom-test",property:or.acp("bondCount")},resname:{"@desc":"str residue name","@examples":["resname ALA"],regex:/[a-zA-Z0-9]+/,map:Jr,level:"residue-test",property:or.ammp("auth_comp_id")},resid:{"@desc":"num residue id","@examples":["resid 42"],isNumeric:!0,regex:Or,map:We=>parseInt(We),level:"residue-test",property:or.ammp("auth_seq_id")},segname:{"@desc":"str segment name","@examples":["segname B"],regex:/[a-zA-Z0-9]+/,map:Jr,level:"residue-test",property:or.ammp("label_asym_id")},x:{"@desc":"float x coordinate","@examples":["x 42"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.acp("x")},y:{"@desc":"float y coordinate","@examples":["y > 1.7"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.acp("y")},z:{"@desc":"float z coordinate","@examples":["z < 11","z > -21"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.acp("z")},radius:{"@desc":"float atomic radius","@examples":["radius > 1.3"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.acp("vdw")},mass:{"@desc":"float atomic mass","@examples":["mass > 2"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.acp("mass")},charge:{"@desc":"float atomic charge","@examples":["charge > 0","charge 1"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.ammp("pdbx_formal_charge")},beta:{"@desc":"float temperature factor","@examples":["beta < 20","beta > 35"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.ammp("B_iso_or_equiv")},occupancy:{"@desc":"float occupancy","@examples":["occupancy 1","occupancy < 1"],isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test",property:or.ammp("occupancy")},user:{"@desc":"float time-varying user-specified value","@examples":["user < 0.1"],isUnsupported:!0,isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"atom-test"},rasmol:{"@desc":"str translates Rasmol selection string to VMD","@examples":["rasmol 'all'"],isUnsupported:!0,regex:/[^']*/,map:Jr,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:un,level:"atom-test",property:or.ammp("secondaryStructureFlags")},phi:{"@desc":"float phi backbone conformational angles","@examples":["phi < 160"],isUnsupported:!0,isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"residue-test"},psi:{"@desc":"float psi backbone conformational angles","@examples":["psi < 160"],isUnsupported:!0,isNumeric:!0,regex:Nr,map:We=>parseFloat(We),level:"residue-test"},ufx:{"@desc":"num force to apply in the x coordinate","@examples":["ufx 1"],isUnsupported:!0,isNumeric:!0,regex:Nr,map:We=>parseInt(We),level:"atom-test"},ufy:{"@desc":"num force to apply in the y coordinate","@examples":["ufy 1"],isUnsupported:!0,isNumeric:!0,regex:Nr,map:We=>parseInt(We),level:"atom-test"},ufz:{"@desc":"num force to apply in the z coordinate","@examples":["ufz 1"],isUnsupported:!0,isNumeric:!0,regex:Nr,map:We=>parseInt(We),level:"atom-test"}},dt=c.J,Yt=Object.keys(ct).sort(Re).filter(We=>!ct[We].isUnsupported).join("|"),cn=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not protein"],name:"not",type:de,rule:f.regexp(/NOT/i).skip(f.whitespace),map:(We,Pt)=>Ce(Pt)},{"@desc":"Selects atoms within a specified distance of a selection","@examples":["within 5 of name FE"],name:"within",type:de,rule:ee(/WITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(We=>parseFloat(We)),map:(We,Pt)=>dt.struct.modifier.includeSurroundings({0:Pt,radius:We})},{"@desc":"Exclusive within, equivalent to (within 3 of X) and not X","@examples":["exwithin 10 of resname HEM"],name:"exwithin",type:de,rule:ee(/EXWITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(We=>parseFloat(We)),map:(We,Pt)=>dt.struct.modifier.exceptBy({0:dt.struct.modifier.includeSurroundings({0:Pt,radius:We}),by:Pt})},{"@desc":"Selects atoms which have the same keyword as the atoms in a given selection","@examples":["same resid as name FE"],name:"same",type:de,rule:ee(new RegExp(`SAME\\s+(${Yt})\\s+AS`,"i"),1).map(We=>ct[We].property),map:(We,Pt)=>dt.struct.filter.withSameAtomProperties({0:dt.struct.generator.all(),source:Pt,property:We})},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["backbone and protein"],name:"and",type:Z,rule:f.alt(Y(/AND/i),f.whitespace),map:(We,Pt,Sn)=>dt.struct.modifier.intersectBy({0:Pt,by:Sn})},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["water or protein"],name:"or",type:Z,rule:Y(/OR/i),map:(We,Pt,Sn)=>dt.struct.combinator.merge([Pt,Sn])}],xn=c.J;function Rn(){return xn.struct.filter.pick({0:xn.struct.generator.atomGroups({"group-by":xn.ammp("residueKey")}),test:xn.core.set.isSubset([ne(["C","N","CA","O"]),xn.ammpSet("label_atom_id")])})}function er(){return xn.struct.filter.pick({0:xn.struct.generator.atomGroups({"group-by":xn.ammp("residueKey")}),test:xn.core.logic.and([xn.core.set.isSubset([ne(["P"]),xn.ammpSet("label_atom_id")]),xn.core.logic.or([xn.core.set.isSubset([ne(["O3'","C3'","C4'","C5'","O5'"]),xn.ammpSet("label_atom_id")]),xn.core.set.isSubset([ne(["O3*","C3*","C4*","C5*","O5*"]),xn.ammpSet("label_atom_id")])])])})}function ir(){return xn.struct.combinator.merge([xn.struct.generator.queryInSelection({0:Rn(),query:xn.struct.generator.atomGroups({"atom-test":xn.core.set.has([ne(br.protein),xn.ammp("label_atom_id")])})}),xn.struct.generator.queryInSelection({0:er(),query:xn.struct.generator.atomGroups({"atom-test":xn.core.set.has([ne(br.nucleic),xn.ammp("label_atom_id")])})})])}function Yn(We){return xn.struct.generator.atomGroups({"residue-test":xn.core.flags.hasAll([xn.ammp("secondaryStructureFlags"),xn.struct.type.secondaryStructureFlags(We)])})}const br={nucleic:["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*"],protein:["C","N","CA","O"]},vr={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"]},Hr={all:{"@desc":"everything",map:()=>xn.struct.generator.all()},none:{"@desc":"nothing",map:()=>xn.struct.generator.empty()},protein:{"@desc":"a residue with atoms named C, N, CA, and O",map:()=>Rn()},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:()=>er()},backbone:{"@desc":"the C, N, CA, and O atoms of a protein and the equivalent atoms in a nucleic acid.",map:()=>ir()},sidechain:{"@desc":"non-backbone atoms and bonds",map:()=>Ce(ir())},water:{"@desc":"all atoms with the resname H2O, HH0, OHH, HOH, OH2, SOL, WAT, TIP, TIP2, TIP3 or TIP4",abbr:["waters"],map:()=>ge(vr.water)},at:{"@desc":"residues named ADA A THY T",map:()=>ge(vr.at)},acidic:{"@desc":"residues named ASP GLU",map:()=>ge(vr.acidic)},acyclic:{"@desc":'"protein and not cyclic"',map:()=>xn.struct.modifier.intersectBy({0:Rn(),by:Ce(ge(vr.cyclic))})},aliphatic:{"@desc":"residues named ALA GLY ILE LEU VAL",map:()=>ge(vr.aliphatic)},alpha:{"@desc":"atom's residue is an alpha helix",map:()=>Yn(["alpha"])},amino:{"@desc":"a residue with atoms named C, N, CA, and O",map:()=>Rn()},aromatic:{"@desc":"residues named HIS PHE TRP TYR",map:()=>ge(vr.aromatic)},basic:{"@desc":"residues named ARG HIS LYS",map:()=>ge(vr.basic)},bonded:{"@desc":"atoms for which numbonds > 0",map:()=>be(xn.struct.filter.pick({0:xn.struct.modifier.includeConnected({0:xn.struct.generator.all(),"bond-test":xn.core.flags.hasAny([xn.struct.bondProperty.flags(),xn.struct.type.bondFlags(["covalent","metallic","sulfide"])])}),test:xn.core.rel.gr([xn.struct.atomSet.atomCount(),1])}))},buried:{"@desc":"residues named ALA LEU VAL ILE PHE CYS MET TRP",map:()=>ge(vr.buried)},cg:{"@desc":"residues named CYT C GUA G",map:()=>ge(vr.cg)},charged:{"@desc":'"basic or acidic"',map:()=>ge(vr.basic.concat(vr.acidic))},cyclic:{"@desc":"residues named HIS PHE PRO TRP TYR",map:()=>ge(vr.cyclic)},hetero:{"@desc":'"not (protein or nucleic)"',map:()=>Ce(xn.struct.combinator.merge([Rn(),er()]))},hydrogen:{"@desc":'name "[0-9]?H.*"',map:()=>xn.struct.generator.atomGroups({"atom-test":xn.core.str.match([xn.core.type.regex(["^[0-9]?[H].*$","i"]),xn.core.type.str([xn.ammp("label_atom_id")])])})},large:{"@desc":'"protein and not (small or medium)"',map:()=>xn.struct.modifier.intersectBy({0:Rn(),by:Ce(ge(vr.small.concat(vr.medium)))})},medium:{"@desc":"residues named VAL THR ASP ASN PRO CYS ASX PCA HYP",map:()=>ge(vr.medium)},neutral:{"@desc":"residues named VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP",map:()=>ge(vr.neutral)},hydrophobic:{"@desc":"hydrophobic resname ALA LEU VAL ILE PRO PHE MET TRP",map:()=>ge(vr.hydrophobic)},polar:{"@desc":'"protein and not hydrophobic"',map:()=>xn.struct.modifier.intersectBy({0:Rn(),by:Ce(ge(vr.hydrophobic))})},purine:{"@desc":"residues named ADE A GUA G",map:()=>ge(vr.purine)},pyrimidine:{"@desc":"residues named CYT C THY T URI U",map:()=>ge(vr.pyrimidine)},small:{"@desc":"residues named ALA GLY SER",map:()=>ge(vr.small)},surface:{"@desc":'"protein and not buried"',map:()=>xn.struct.modifier.intersectBy({0:Rn(),by:Ce(ge(vr.buried))})},alpha_helix:{"@desc":"atom's residue is in an alpha helix",map:()=>Yn(["alpha"])},pi_helix:{"@desc":"atom's residue is in a pi helix",map:()=>Yn(["pi"])},helix_3_10:{"@desc":"atom's residue is in a 3-10 helix",map:()=>Yn(["3-10"])},helix:{"@desc":"atom's residue is in an alpha or pi or 3-10 helix",map:()=>Yn(["helix"])},extended_beta:{"@desc":"atom's residue is a beta sheet",map:()=>Yn(["sheet"])},bridge_beta:{"@desc":"atom's residue is a beta sheet",map:()=>Yn(["strand"])},sheet:{"@desc":"atom's residue is a beta sheet",map:()=>Yn(["beta"])},turn:{"@desc":"atom's residue is in a turn conformation",map:()=>Yn(["turn"])},coil:{"@desc":"atom's residue is in a coil conformation",map:()=>xn.struct.modifier.intersectBy({0:Rn(),by:Yn(["none"])})}},Mr=c.J,Fr={sqr:{"@desc":"square of x","@examples":["sqr(2)"],map:We=>Mr.core.math.pow([We,2])},sqrt:{"@desc":"square root of x","@examples":["sqrt(2)"],map:We=>Mr.core.math.sqrt([We])},abs:{"@desc":"absolute value of x","@examples":["abs(2)"],map:We=>Mr.core.math.abs([We])},floor:{"@desc":"largest integer not greater than x","@examples":["floor(2)"],map:We=>Mr.core.math.floor([We])},ceil:{"@desc":"smallest integer not less than x","@examples":["ceil(2)"],map:We=>Mr.core.math.ceil([We])},sin:{"@desc":"sine of x","@examples":["sin(2)"],map:We=>Mr.core.math.sin([We])},cos:{"@desc":"cosine of x","@examples":["cos(2)"],map:We=>Mr.core.math.cos([We])},tan:{"@desc":"tangent of x","@examples":["tan(2)"],map:We=>Mr.core.math.tan([We])},atan:{"@desc":"arctangent of x","@examples":["atan(2)"],map:We=>Mr.core.math.atan([We])},asin:{"@desc":"arcsin of x","@examples":["asin(2)"],map:We=>Mr.core.math.asin([We])},acos:{"@desc":"arccos of x","@examples":["acos(2)"],map:We=>Mr.core.math.acos([We])},sinh:{"@desc":"hyperbolic sine of x","@examples":["sinh(2)"],map:We=>Mr.core.math.sinh([We])},cosh:{"@desc":"hyperbolic cosine of x","@examples":["cosh(2)"],map:We=>Mr.core.math.cosh([We])},tanh:{"@desc":"hyperbolic tangent of x","@examples":["tanh(2)"],map:We=>Mr.core.math.tanh([We])},exp:{"@desc":"e to the power x","@examples":["exp(2)"],map:We=>Mr.core.math.exp([We])},log:{"@desc":"natural log of x","@examples":["log(2)"],map:We=>Mr.core.math.log([We])},log10:{"@desc":"log base 10 of x","@examples":["log10(2)"],map:We=>Mr.core.math.log10([We])}},Sr=c.J,Ur=[{"@desc":"multiplication, division","@examples":[],name:"mul-div",type:Z,rule:f.regexp(/\s*(\*|\/)\s*/,1),map:(We,Pt,Sn)=>{switch(We){case"*":return Sr.core.math.mult([Pt,Sn]);case"/":return Sr.core.math.div([Pt,Sn]);default:throw new Error(`value operator '${We}' not supported`)}}},{"@desc":"addition, substraction","@examples":[],name:"add-sub",type:Z,rule:f.regexp(/\s*(-|\+)\s*/,1),map:(We,Pt,Sn)=>{switch(We){case"-":return Sr.core.math.sub([Pt,Sn]);case"+":return Sr.core.math.add([Pt,Sn]);default:throw new Error(`value operator '${We}' not supported`)}}},{"@desc":"value comparisons","@examples":[],name:"comparison",type:Z,rule:f.alt(f.regexp(/\s*(=~|==|>=|<=|=|!=|>|<)\s*/,1),f.whitespace.result("=")),map:(We,Pt,Sn)=>{let Nn;if(void 0!==Pt.head?("structure-query.atom-property.macromolecular.secondary-structure-flags"===Pt.head.name&&(Nn=Sr.core.flags.hasAny([Pt,un(Sn)])),"core.type.regex"===Pt.head.name&&(Nn=Sr.core.str.match([Pt,Sr.core.type.str([Sn])]))):void 0!==Sn.head?("structure-query.atom-property.macromolecular.secondary-structure-flags"===Sn.head.name&&(Nn=Sr.core.flags.hasAny([Sn,un(Pt)])),"core.type.regex"===Sn.head.name&&(Nn=Sr.core.str.match([Sn,Sr.core.type.str([Pt])]))):"=~"===We&&(Nn=Sr.core.str.match(Pt.head?[Sr.core.type.regex([`^${Sn}$`,"i"]),Sr.core.type.str([Pt])]:[Sr.core.type.regex([`^${Pt}$`,"i"]),Sr.core.type.str([Sn])])),!Nn)switch(Pt.head&&(Sn=Te(Pt,Sn)),Sn.head&&(Pt=Te(Sn,Pt)),We){case"=":case"==":Nn=Sr.core.rel.eq([Pt,Sn]);break;case"!=":Nn=Sr.core.rel.neq([Pt,Sn]);break;case">":Nn=Sr.core.rel.gr([Pt,Sn]);break;case"<":Nn=Sr.core.rel.lt([Pt,Sn]);break;case">=":Nn=Sr.core.rel.gre([Pt,Sn]);break;case"<=":Nn=Sr.core.rel.lte([Pt,Sn]);break;default:throw new Error(`value operator '${We}' not supported`)}return Sr.struct.generator.atomGroups({"atom-test":Nn})}}],Ro=f.createLanguage({Parens:function(We){return f.alt(We.Parens,We.Operator,We.Expression).wrap(f.string("("),f.string(")"))},Expression:function(We){return f.alt(We.RangeListProperty,We.ValueQuery,We.Keywords)},NamedAtomProperties:function(){return f.alt(...Oe(ct))},Keywords:()=>f.alt(...Se(Hr)),ValueRange:function(We){return f.seq(We.Value.skip(f.regexp(/\s+TO\s+/i)),We.Value).map(Pt=>({range:Pt}))},RangeListProperty:function(We){return f.seq(f.alt(...Ne(ct,/\s/)).skip(f.whitespace),f.alt(We.ValueRange,We.Value).sepBy1(f.whitespace)).map(Pt=>{const[Sn,Nn]=Pt,Kn=[],dr=[];Nn.forEach(ht=>{ht.range?dr.push(Sr.core.rel.inRange([Sn,ht.range[0],ht.range[1]])):Kn.push(Te(Sn,ht,To))});const xr=function Ae(We){return 1===We.length?We[0]:We.length>1?te.core.logic.or(We):void 0}(dr),Ft=function ae(We,Pt){if(se.includes(We.head.name)){const Sn=Pt[0].head,Nn=[];return Pt.forEach(Kn=>Nn.push(...Kn.args[0])),te.core.flags.hasAny([We,{head:Sn,args:Nn}])}return 1===Pt.length?te.core.rel.eq([We,Pt[0]]):Pt.length>1?te.core.set.has([te.core.type.set(Pt),We]):void 0}(Sn,Kn);let Qt;return Qt=xr&&Ft?Sr.core.logic.or([xr,Ft]):xr||Ft,Sr.struct.generator.atomGroups({[ce(Sn)]:Qt})})},Operator:function(We){return q(cn,f.alt(We.Parens,We.Expression,We.ValueQuery))},Query:function(We){return f.alt(We.Operator,We.Parens,We.Expression).trim(f.optWhitespace)},Number:function(){return f.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){const We=K(ct,Hr,cn).sort(Re).map(W.Nt).join("|");return f.alt(f.regexp(new RegExp(`(?!(${We}))[A-Z0-9_]+`,"i")),f.regexp(/'((?:[^"\\]|\\.)*)'/,1),f.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(Pt=>Sr.core.type.regex([`^${Pt}$`,"i"]))).desc("string")},Value:function(We){return f.alt(We.Number,We.String)},ValueParens:function(We){return f.alt(We.ValueParens,We.ValueOperator,We.ValueExpressions).wrap(f.string("("),f.string(")"))},ValuePropertyNames:function(){return f.alt(...Ne(ct,/=~|==|>=|<=|=|!=|>|<|\)|\s|\+|-|\*|\//i))},ValueOperator:function(We){return q(Ur,f.alt(We.ValueParens,We.ValueExpressions))},ValueExpressions:function(We){return f.alt(We.ValueFunctions,We.Value,We.ValuePropertyNames)},ValueFunctions:function(We){return f.alt(...function Ve(We,Pt){const Sn=[],Nn=f.regexp(/\(\s*/),Kn=f.regexp(/\s*\)/);return Object.keys(We).sort(Re).forEach(dr=>{const xr=We[dr],Ft=xr.map?xr.map:xe(`function '${dr}' not supported`),Qt=f.regexp(new RegExp(dr,"i")).skip(Nn).then(Pt).skip(Kn).map(Ft);Sn.push(Qt)}),Sn}(Fr,We.ValueOperator))},ValueQuery:function(We){return f.alt(We.ValueOperator.map(Pt=>{if(!Pt.head.name||!Pt.head.name.startsWith("structure-query.generator"))throw new Error(`values must be part of an comparison, value '${Pt}'`);return Pt}))}}),so={pymol:We=>Dr.Query.tryParse(We),vmd:We=>Ro.Query.tryParse(We),jmol:We=>At.Query.tryParse(We)};var Bo=n(9136),Go=n(7291);function Wo(We,Pt){return{expression:We,language:Pt}}!function(We){function Nn(Ft){switch(Ft.language){case"mol-script":const Qt=function $(We){return J.parse(We)}(Ft.expression);if(0===Qt.length)throw new Error("No query");return R(Qt[0]);case"pymol":case"jmol":case"vmd":return function ho(We,Pt){try{return so[We](Pt)}catch(Sn){throw console.error(Sn.message),Sn}}(Ft.language,Ft.expression);default:(0,H.dr)(Ft.language)}}function Kn(Ft){const Qt=Nn(Ft);return(0,Go.wE)(Qt)}We.Info={"mol-script":"Mol-Script",pymol:"PyMOL",vmd:"VMD",jmol:"Jmol"},We.is=function Pt(Ft){return!!Ft&&"string"==typeof Ft.expression&&!!Ft.language},We.areEqual=function Sn(Ft,Qt){return Ft.language===Qt.language&&Ft.expression===Qt.expression},We.toExpression=Nn,We.toQuery=Kn,We.toLoci=function dr(Ft,Qt){const pt=Kn(Ft)(new Bo.cY(Qt));return Bo.cv.toLociWithSourceUnits(pt)},We.getStructureSelection=function xr(Ft,Qt,ht){const pt="function"==typeof Ft?Ft(c.J):Ft;return(0,Go.wE)(pt)(new Bo.cY(Qt,ht))}}(Wo||(Wo={}))},4829:(tn,Ue,n)=>{"use strict";n.d(Ue,{K:()=>r});var r,e=n(9909),o=n(8277);!function(t){function A(i){const v={create:O=>({action:v,params:O}),id:e.kk.create22(),definition:i,createDefaultParams:(O,b)=>i.params?o.t.getDefaultValues(i.params(O,b)):{}};return v}let c;t.create=A,t.fromTransformer=function y(i){const v=i.definition;return A({from:v.from,display:v.display,params:v.params,isApplicable:i.definition.isApplicable?(O,b,_)=>i.definition.isApplicable(O,_):void 0,run({cell:O,state:b,params:_}){const M=b.build().to(O.transform.ref).apply(i,_);return b.updateTree(M)}})},(c=t.Builder||(t.Builder={})).build=O=>function v(O){return b=>A({from:O.from instanceof Array?O.from:O.from?[O.from]:[],display:"string"==typeof O.display?{name:O.display}:O.display?O.display:{name:"Unnamed State Action"},params:"object"==typeof O.params?()=>O.params:O.params?O.params:void 0,isApplicable:O.isApplicable,..."function"==typeof b?{run:b}:b})}(O),t.build=c.build}(r||(r={}))},1832:(tn,Ue,n)=>{"use strict";n.d(Ue,{Uw:()=>V,KW:()=>Te.K,BM:()=>o,so:()=>y,QX:()=>h,Cn:()=>i.C,xE:()=>s.x,uF:()=>u});var o,r,ie,y,e=n(9909);!function(ie){function re(ce){var se;return(se=class{static is(ge){return!!ge&&ce===ge.type}constructor(ge,Ie){this.data=ge,this.id=e.kk.create22(),this.type=ce,this.label=Ie&&Ie.label||ce.name,this.description=Ie&&Ie.description}}).type=ce,se}ie.factory=function ue(){return ce=>re(ce)},ie.create=re,ie.hasTag=function ve(ce,se){if(!ce.tags)return!1;for(const ae of ce.tags)if(ae===se)return!0;return!1},ie.Null={id:e.kk.create22(),type:{name:"Null",typeClass:"Null"},data:void 0,label:"Null"}}(o||(o={})),(ie=r||(r={})).is=function ue(ve){return!!(ve&&ve.transform&&ve.parent&&ve.status)},ie.resolve=function re(ve,ce){const se="string"==typeof ce?ce:ie.is(ce)?ce.transform.ref:ce.ref;return ve.cells.get(se)};class A{get cell(){var ue;return null===(ue=this.state)||void 0===ue?void 0:ue.cells.get(this.ref)}get obj(){var ue,re;return null===(re=null===(ue=this.state)||void 0===ue?void 0:ue.cells.get(this.ref))||void 0===re?void 0:re.obj}get data(){var ue;return null===(ue=this.obj)||void 0===ue?void 0:ue.data}update(ue,re){if(!this.state)throw new Error("To use update() from StateObjectSelector, 'state' must be defined.");return re||(re=this.state.build()),(re||this.state.build()).to(this).update(ue),re}checkValid(){if(!this.state)throw new Error("Unassigned State.");const ue=this.cell;if(!ue)throw new Error("Not created at all. Did you await/then the corresponding state update?");if("ok"===ue.status)return!0;throw"error"===ue.status?new Error(ue.errorText):ue.obj===o.Null?new Error("The object is Null."):new Error("Unresolved. Did you await/then the corresponding state update?")}get isOk(){const ue=this.cell;return ue&&"ok"===ue.status&&ue.obj!==o.Null}constructor(ue,re){this.ref=ue,this.state=re}}!function(ie){function re(ce,se){if(se)return r.is(se)?se:"string"==typeof se?ce.cells.get(se):se.cell}ie.resolveRef=function ue(ce){var se;if(ce)return"string"==typeof ce?ce:r.is(ce)?ce.transform.ref:null===(se=ce.cell)||void 0===se?void 0:se.transform.ref},ie.resolve=re,ie.resolveAndCheck=function ve(ce,se){const ae=re(ce,se);if(ae&&ae.obj&&"ok"===ae.status)return ae}}(y||(y={}));var u,c=n(39),i=n(2907),v=n(9359),O=n(6115);class b{get childMutations(){return this._childMutations||(this._childMutations=new Map),this._childMutations}get dependencyMutations(){return this._dependencyMutations||(this._dependencyMutations=new Map),this._dependencyMutations}changeNodes(){this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable())}changeChildren(){this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable())}changeDependencies(){this.changedDependencies||(this.changedDependencies=!0,this.dependencies=this.dependencies.asMutable())}get root(){return this.transforms.get(i.C.RootRef)}asTransient(){return this.asImmutable().asTransient()}addChild(ue,re){if(this.changeChildren(),this.childMutations.has(ue))this.childMutations.get(ue).add(re);else{const ve=this.children.get(ue).asMutable();ve.add(re),this.children.set(ue,ve),this.childMutations.set(ue,ve)}}removeChild(ue,re){if(this.changeChildren(),this.childMutations.has(ue))this.childMutations.get(ue).remove(re);else{const ve=this.children.get(ue).asMutable();ve.remove(re),this.children.set(ue,ve),this.childMutations.set(ue,ve)}}clearRoot(){const ue=i.C.RootRef;if(0===this.children.get(ue).size)return;this.changeChildren();const re=(0,c.CD)();this.children.set(ue,re),this.childMutations.set(ue,re)}mutateDependency(ue,re,ve){let ce=this.dependencyMutations.get(ue);if(!ce){const se=this.dependencies.get(ue);if(!se&&"remove"===ve)return;this.changeDependencies(),ce=se?se.asMutable():(0,c.CD)().asMutable(),this.dependencyMutations.set(ue,ce),this.dependencies.set(ue,ce)}"add"===ve?ce.add(re):ce.remove(re)}changeParent(ue,re){m(this.transforms,ue);const ve=this.transforms.get(ue);this.removeChild(ve.parent,ue),this.addChild(re,ue),this.changeNodes(),this.transforms.set(ue,i.C.withParent(ve,re))}add(ue){const re=ue.ref;this.transforms.has(ue.ref)&&this.transforms.get(ue.ref).parent!==ue.parent&&function I(ie){throw new Error(`Transform '${ie}' is already present in the tree.`)}(ue.ref);const ve=this.children.get(ue.parent);if(ve||function l(ie){throw new Error(`Parent '${ie}' must be present in the tree.`)}(ue.parent),ve.has(ue.ref)||this.addChild(ue.parent,ue.ref),this.children.has(ue.ref)||(this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable()),this.children.set(ue.ref,(0,c.CD)())),this.changeNodes(),this.transforms.set(re,ue),ue.dependsOn)for(const ce of ue.dependsOn)this.mutateDependency(ce,re,"add");return this}setParams(ue,re){m(this.transforms,ue);const ve=this.transforms.get(ue);return!(0,v.bN)(ve.params,re)&&(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(ve.ref,i.C.withParams(ve,re)),!0)}setTags(ue,re){m(this.transforms,ue);const ve=this.transforms.get(ue),ce=i.C.withParams(ve,re);return!(0,O.af)(ve.tags,ce.tags)&&(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(ve.ref,ce),!0)}assignState(ue,re){m(this.transforms,ue);const ve=this.transforms.get(ue);if(this._stateUpdates&&this._stateUpdates.has(ue))return i.C.assignState(ve.state,re),ve;{this._stateUpdates||(this._stateUpdates=new Set),this._stateUpdates.add(ve.ref),this.changeNodes();const ce=i.C.withState(ve,re);return this.transforms.set(ue,ce),ce}}remove(ue){const re=this.transforms.get(ue);if(!re)return[];const ve=u.subtreePostOrder(this,re);if(ue===i.C.RootRef){if(ve.pop(),0===ve.length)return ve;this.clearRoot()}else{if(0===ve.length)return ve;this.removeChild(re.parent,re.ref)}this.changeNodes(),this.changeChildren();for(const se of ve)this.transforms.delete(se.ref),this.children.delete(se.ref),this._childMutations&&this._childMutations.delete(se.ref);const ce=[];for(const se of ve){if(se.dependsOn)for(const ae of se.dependsOn)this.transforms.has(ae)&&this.mutateDependency(ae,se.ref,"remove");if(this.dependencies.has(se.ref)){const ae=this.dependencies.get(se.ref).toArray();this.changeDependencies(),this.dependencies.delete(se.ref),this._dependencyMutations&&this._dependencyMutations.delete(se.ref);for(const ge of ae)if(this.transforms.has(ge))for(const Ie of this.remove(ge))ce[ce.length]=Ie}}for(const se of ce)ve[ve.length]=se;return ve}asImmutable(){return this.changedNodes||this.changedChildren||this._childMutations?(this._childMutations&&this._childMutations.forEach(_,this.children),this._dependencyMutations&&this._dependencyMutations.forEach(M,this.dependencies),u.create(this.changedNodes?this.transforms.asImmutable():this.transforms,this.changedChildren?this.children.asImmutable():this.children,this.changedDependencies?this.dependencies.asImmutable():this.dependencies)):this.tree}constructor(ue){this.tree=ue,this.transforms=this.tree.transforms,this.children=this.tree.children,this.dependencies=this.tree.dependencies,this.changedNodes=!1,this.changedChildren=!1,this.changedDependencies=!1,this._childMutations=void 0,this._dependencyMutations=void 0,this._stateUpdates=void 0}}function _(ie,ue){this.set(ue,ie.asImmutable())}function M(ie,ue){0===ie.size?this.delete(ue):this.set(ue,ie.asImmutable())}function m(ie,ue){if(!ie.has(ue))throw new Error(`Node '${ue}' is not present in the tree.`)}!function(ie){class ue{get root(){return this.transforms.get(i.C.RootRef)}asTransient(){return new b(this)}constructor(Me,Ke,ut){this.transforms=Me,this.children=Ke,this.dependencies=ut}}function ve(_t,Me,Ke){return new ue(_t,Me,Ke)}function ce(_t){se(this,this.tree.transforms.get(_t))}function se(_t,Me){const Ke=_t.tree.children.get(Me.ref);Ke&&Ke.size&&Ke.forEach(ce,_t),_t.f(Me,_t.tree,_t.state)}function ae(_t,Me,Ke,ut){const Kt={tree:_t,state:Ke,f:ut};return se(Kt,Me),Kt.state}function ge(_t){Ie(this,this.tree.transforms.get(_t))}function Ie(_t,Me){const Ke=_t.f(Me,_t.tree,_t.state);if("boolean"==typeof Ke&&!Ke)return;const ut=_t.tree.children.get(Me.ref);ut&&ut.size&&ut.forEach(ge,_t)}function Le(_t,Me,Ke,ut){const Kt={tree:_t,state:Ke,f:ut};return Ie(Kt,Me),Kt.state}function nt(_t,Me,Ke){Ke.push(_t)}function Lt(_t,Me,Ke){Ke.push(i.C.toJSON(_t))}function pn(_t,Me,Ke){if(Me===Ke)return!0;const Kt=_t.children.get(Me).values();for(;;){const sn=Kt.next();if(sn.done)return!1;if(pn(_t,sn.value,Ke))return!0}}ie.createEmpty=function re(_t){const Me=_t||i.C.createRoot();return ve((0,c.T5)([[Me.ref,Me]]),(0,c.T5)([[Me.ref,(0,c.CD)()]]),(0,c.T5)())},ie.create=ve,ie.doPostOrder=ae,ie.doPreOrder=Le,ie.subtreePostOrder=function je(_t,Me){return ae(_t,Me,[],nt)},ie.toJSON=function Je(_t){const Me=[];return Le(_t,_t.root,Me,Lt),{transforms:Me}},ie.fromJSON=function en(_t){const Me=(0,c.T5)().asMutable(),Ke=(0,c.T5)().asMutable(),ut=(0,c.T5)().asMutable();for(const sn of _t.transforms){const gt=i.C.fromJSON(sn);Me.set(gt.ref,gt),Ke.has(gt.ref)||Ke.set(gt.ref,(0,c.CD)().asMutable()),gt.ref!==gt.parent&&Ke.get(gt.parent).add(gt.ref)}const Kt=new Set;for(const sn of _t.transforms){const gt=sn.ref;if(Ke.set(gt,Ke.get(gt).asImmutable()),sn.dependsOn)for(const yt of sn.dependsOn)Kt.add(yt),ut.has(yt)?ut.get(yt).add(gt):ut.set(yt,(0,c.CD)([gt]).asMutable())}return Kt.forEach(sn=>{ut.set(sn,ut.get(sn).asImmutable())}),ve(Me.asImmutable(),Ke.asImmutable(),ut.asImmutable())},ie.dump=function Bt(_t){console.log({tr:_t.transforms.keySeq().toArray(),tr1:_t.transforms.valueSeq().toArray().map(Me=>Me.ref),ch:_t.children.keySeq().toArray()})},ie.subtreeHasRef=function $e(_t,Me,Ke){return!(!_t.transforms.has(Me)||!_t.transforms.has(Ke))&&pn(_t,Me,Ke)},ie.getDecoratorRoot=function mt(_t,Me){const Ke=_t.children.get(Me);if(1!==Ke.size)return Me;const ut=_t.transforms.get(Ke.first());return ut.transformer.definition.isDecorator?mt(_t,ut.ref):Me}}(u||(u={}));var h,d=n(467),s=n(8384),C=n(4824);!function(ie){function ue(Wt,yn){return re(Wt)(yn)}function re(Wt){const yn=Wt||Le.root;let Zt;return Zt=function ce(Wt){return void 0!==Wt.compile}(yn)?yn.compile():function ve(Wt){return void 0!==Wt.transform&&void 0!==Wt.status}(yn)?Le.byValue(yn).compile():function se(Wt){return"function"==typeof Wt}(yn)?yn:Le.byRef(yn).compile(),Zt}ie.select=ue,ie.compile=re;const ae={select(Wt){return ue(this,Wt||this.state)}};function ge(Wt,yn){ae[Wt]=function(...Zt){return yn.call(void 0,this,...Zt)}}function Ie(Wt){return Object.create(ae,{compile:{writable:!1,configurable:!1,value:Wt}})}let Le;function nt(Wt,yn){const Zt=re(Wt);return Ie(()=>kt=>{const Ot=[];for(const An of Zt(kt))for(const jn of yn(An,kt))Ot.push(jn);return Ot})}function je(Wt,yn){const Zt=re(Wt);return Ie(()=>kt=>{const Ot=[];for(const An of Zt(kt)){const jn=yn(An,kt);jn&&Ot.push(jn)}return Ot})}function Lt(Wt){const yn=re(Wt);return Ie(()=>Zt=>{const kt=new Set,Ot=[];for(const An of yn(Zt))An&&(kt.has(An.transform.ref)||(kt.add(An.transform.ref),Ot.push(An)));return Ot})}function Je(Wt){const yn=re(Wt);return Ie(()=>Zt=>{const kt=yn(Zt);return kt.length?[kt[0]]:[]})}function en(Wt,yn){return nt(Wt,Zt=>yn(Zt)?[Zt]:[])}function Bt(Wt,yn){return en(Wt,Zt=>Zt.status===yn)}function pn(Wt,yn){return en(Wt,Zt=>!!Zt.transform.tags&&Zt.transform.tags.indexOf(yn)>=0)}function $e(Wt){return nt(Wt,(yn,Zt)=>{const kt=[];return u.doPreOrder(Zt.tree,Zt.tree.transforms.get(yn.transform.ref),kt,(Ot,An,jn)=>{jn.push(Ot.ref)}),kt.map(Ot=>Zt.cells.get(Ot))})}function mt(Wt){return nt(Wt,(yn,Zt)=>{const kt=[];return Zt.tree.children.get(yn.transform.ref).forEach(Ot=>kt.push(Zt.cells.get(Ot))),kt})}function _t(Wt,yn){return en(Wt,Zt=>!!Zt.obj&&Zt.obj.type===yn.type)}function Me(Wt,yn){return Lt(je(Wt,(Zt,kt)=>Gt(kt.tree,kt.cells,Zt.transform.ref,yn)))}function Ke(Wt,yn){return Lt(je(Wt,(Zt,kt)=>Mt(kt.tree,kt.cells,Zt.transform.ref,yn)))}function ut(Wt,yn){return Lt(je(Wt,(Zt,kt)=>tt(kt.tree,kt.cells,Zt.transform.ref,yn)))}function Kt(Wt,yn){return en(Wt,Zt=>Zt.transform.transformer===yn)}function sn(Wt,yn){return Lt(je(Wt,(Zt,kt)=>rn(kt.tree,kt.cells,Zt.transform.ref,yn)))}function gt(Wt,yn){return Lt(je(Wt,(Zt,kt)=>nn(kt.tree,kt.cells,Zt.transform.ref,yn)))}function yt(Wt){return Lt(je(Wt,(yn,Zt)=>Zt.cells.get(Zt.tree.transforms.get(yn.transform.ref).parent)))}function At(Wt,yn,Zt,kt,Ot){let jn,An=Wt.transforms.get(Zt);for(;;){An=Wt.transforms.get(An.parent);const On=yn.get(An.ref);if(On.obj&&kt(On)&&(jn=On,Ot)||An.ref===i.C.RootRef)return jn}}function Gt(Wt,yn,Zt,kt){return At(Wt,yn,Zt,kt,!0)}function rn(Wt,yn,Zt,kt){return At(Wt,yn,Zt,kt,!1)}function tt(Wt,yn,Zt,kt){return Gt(Wt,yn,Zt,Array.isArray(kt)?Ot=>kt.indexOf(Ot.transform.transformer)>=0:Ot=>Ot.transform.transformer===kt)}function Mt(Wt,yn,Zt,kt){return Gt(Wt,yn,Zt,bn(kt))}function nn(Wt,yn,Zt,kt){return rn(Wt,yn,Zt,bn(kt))}function bn(Wt){return Array.isArray(Wt)?yn=>{for(const Zt of Wt)if(Zt.type===yn.obj.type)return!0}:yn=>yn.obj.type===Wt.type}function jt(Wt,yn,Zt){if(Wt.tags)for(const kt of Wt.tags)if(Zt.tags.has(kt)){Zt.refs[kt]=Wt.ref;break}return!0}function Dt(Wt,yn,Zt){return!(Wt.tags&&Wt.tags.indexOf(Zt.tag)>=0&&(Zt.ref=Wt.ref,1))}function $t(Wt,yn,Zt){if(Wt.tags){const kt=Zt.tags.size;let Ot=0;for(const An of Wt.tags)if(Zt.tags.has(An)&&(Ot++,Ot===kt)){Zt.refs.push(Wt);break}}else 0===Zt.tags.size&&Zt.refs.push(Wt)}(function(Wt){function On(or,Nr,Ir){const Or=Ir.cells.get(or.ref);return!Or||!Or.obj||Or.obj.type!==Ir.type||(Ir.roots.push(Or),!1)}function fr(or,Nr,Ir){const Or=Ir.cells.get(or.ref);return Or&&Or.obj&&Or.obj.type===Ir.type&&Ir.ret.push(Or),!0}function Dr(or,Nr,Ir){const Or=Ir.cells.get(or.ref);return Or&&Or.obj&&Or.transform.transformer===Ir.t&&Ir.ret.push(Or),!0}function Pr(or,Nr,Ir){const Or=Ir.cells.get(or.ref);return Or&&"error"===Or.status&&Or.transform.transformer===Ir.t&&Ir.ret.push(Or),!0}Wt.root=Ie(()=>or=>[or.cells.get(or.tree.root.ref)]),Wt.byRef=function yn(...or){return Ie(()=>Nr=>{const Ir=[];for(const Or of or){const Jr=Nr.cells.get(Or);Jr&&Ir.push(Jr)}return Ir})},Wt.byValue=function Zt(...or){return Ie(()=>Nr=>or)},Wt.rootsOfType=function kt(or,Nr=i.C.RootRef){return Ie(()=>Ir=>{const Or={roots:[],cells:Ir.cells,type:or.type};return u.doPreOrder(Ir.tree,Ir.tree.transforms.get(Nr),Or,On),Or.roots})},Wt.ofType=function Ot(or,Nr=i.C.RootRef){return Ie(()=>Ir=>{const Or={ret:[],cells:Ir.cells,type:or.type};return u.doPreOrder(Ir.tree,Ir.tree.transforms.get(Nr),Or,fr),Or.ret})},Wt.ofTransformer=function An(or,Nr=i.C.RootRef){return Ie(()=>Ir=>{const Or={ret:[],cells:Ir.cells,t:or};return u.doPreOrder(Ir.tree,Ir.tree.transforms.get(Nr),Or,Dr),Or.ret})},Wt.ofTransformerWithError=function jn(or,Nr=i.C.RootRef){return Ie(()=>Ir=>{const Or={ret:[],cells:Ir.cells,t:or};return u.doPreOrder(Ir.tree,Ir.tree.transforms.get(Nr),Or,Pr),Or.ret})}})(Le=ie.Generators||(ie.Generators={})),ge("flatMap",nt),ie.flatMap=nt,ge("mapObject",je),ie.mapObject=je,ge("unique",Lt),ie.unique=Lt,ge("first",Je),ie.first=Je,ge("filter",en),ie.filter=en,ge("withStatus",Bt),ie.withStatus=Bt,ge("withTag",pn),ie.withTag=pn,ge("subtree",$e),ie.subtree=$e,ge("children",mt),ie.children=mt,ge("ofType",_t),ie.ofType=_t,ge("ancestor",Me),ie.ancestor=Me,ge("ancestorOfType",Ke),ie.ancestorOfType=Ke,ge("ancestorWithTransformer",ut),ie.ancestorWithTransformer=ut,ge("withTransformer",Kt),ie.withTransformer=Kt,ge("root",sn),ie.root=sn,ge("rootOfType",gt),ie.rootOfType=gt,ge("parent",yt),ie.parent=yt,ie.findAncestor=Gt,ie.findRoot=rn,ie.findAncestorWithTransformer=tt,ie.findAncestorOfType=Mt,ie.findRootOfType=nn,ie.findUniqueTagsInSubtree=function Dn(Wt,yn,Zt){return u.doPreOrder(Wt,Wt.transforms.get(yn),{refs:{},tags:Zt},jt).refs},ie.findTagInSubtree=function It(Wt,yn,Zt){return u.doPreOrder(Wt,Wt.transforms.get(yn),{ref:void 0,tag:Zt},Dt).ref},ie.findWithAllTags=function Ct(Wt,yn,Zt){return u.doPreOrder(Wt,Wt.transforms.get(yn),{refs:[],tags:Zt},$t).refs},ie.tryFindDecorator=function Vt(Wt,yn,Zt){if(Wt.transforms.get(yn).transformer===Zt)return Wt.cells.get(yn);const Ot=Wt.tree.children.get(yn);if(1!==Ot.size)return;const An=Ot.first();return Wt.transforms.get(An).transformer.definition.isDecorator?Vt(Wt,An,Zt):void 0}}(h||(h={}));var D,a=n(8956),S=n(1025);function R(...ie){let ue;const re=[];for(const ve of ie)if(ve)if(ue||(ue=new Set),"string"==typeof ve){if(ue.has(ve))continue;ue.add(ve),re.push(ve)}else for(const ce of ve)ue.has(ce)||(ue.add(ce),re.push(ce));return re}!function(ie){function ue(ae){if(!ae.state||ae.state.tree===ae.editInfo.sourceTree)return ae.tree.asImmutable();const ge=ae.state.tree.asTransient();for(const Ie of ae.actions)switch(Ie.kind){case"add":ge.add(Ie.transform);break;case"update":ge.setParams(Ie.ref,Ie.params);break;case"delete":ge.remove(Ie.ref);break;case"insert":{const Le=ge.children.get(Ie.ref).toArray();ge.add(Ie.transform);for(const nt of Le)ge.changeParent(nt,Ie.transform.ref);break}}return ae.editInfo.sourceTree=ae.tree,ge.asImmutable()}ie.is=function re(ae){return!!ae&&"function"==typeof ae.getTree},ie.isTo=function ve(ae){return!!ae&&"function"==typeof ae.getTree&&"string"==typeof ae.ref},ie.Root=class ce{get editInfo(){return this.state.editInfo}get currentTree(){return this.state.tree}to(ge){const Ie="string"==typeof ge?ge:r.is(ge)?ge.transform.ref:ge.ref;return new se(this.state,Ie,this)}toRoot(){return new se(this.state,this.state.tree.root.ref,this)}delete(ge){const Ie=y.resolveRef(ge);return Ie&&this.state.tree.transforms.has(Ie)?(this.editInfo.count++,this.state.tree.remove(Ie),this.state.actions.push({kind:"delete",ref:Ie}),this):this}getTree(){return ue(this.state)}commit(ge){if(!this.state.state)throw new Error("Cannot commit template tree");return this.state.state.runTask(this.state.state.updateTree(this,ge))}constructor(ge,Ie){this.state={state:Ie,tree:ge.asTransient(),actions:[],editInfo:{applied:!1,sourceTree:ge,count:0,lastUpdate:void 0}}}};class se{get editInfo(){return this.state.editInfo}get selector(){return new A(this.ref,this.state.state)}getApplyRoot(){return u.getDecoratorRoot(this.state.tree,this.ref)}apply(ge,Ie,Le){if(ge.definition.isDecorator)return this.insert(ge,Ie,Le);const nt=this.getApplyRoot(),je=ge.apply(nt,Ie,Le);return this.state.tree.add(je),this.editInfo.count++,this.editInfo.lastUpdate=je.ref,this.state.actions.push({kind:"add",transform:je}),new se(this.state,je.ref,this.root)}applyOrUpdate(ge,Ie,Le,nt){if(this.state.tree.transforms.has(ge)){const je=this.to(ge);return Le&&je.update(Le),je}return this.apply(Ie,Le,{...nt,ref:ge})}applyOrUpdateTagged(ge,Ie,Le,nt){if(Ie.definition.isDecorator)throw new Error("Can't use applyOrUpdateTagged on decorator transformers.");const je=this.getApplyRoot(),Lt=this.state.tree.children.get(je).values();for(;;){const en=Lt.next();if(en.done)break;const Bt=this.state.tree.transforms.get(en.value);if(Bt&&i.C.hasTags(Bt,ge)){const pn=this.to(en.value);return pn.updateTagged(Le,R(Bt.tags,ge,nt&&nt.tags)),pn}}const Je=Ie.apply(je,Le,{...nt,tags:R(ge,nt&&nt.tags)});return this.state.tree.add(Je),this.editInfo.count++,this.editInfo.lastUpdate=Je.ref,this.state.actions.push({kind:"add",transform:Je}),new se(this.state,Je.ref,this.root)}group(ge,Ie,Le){return this.apply(ge,Ie,Le)}insert(ge,Ie,Le){const nt=this.state.tree.children.get(this.ref).toArray(),je=ge.apply(this.ref,Ie,Le);this.state.tree.add(je);for(const Lt of nt)this.state.tree.changeParent(Lt,je.ref);return this.editInfo.count++,this.editInfo.lastUpdate=je.ref,this.state.actions.push({kind:"insert",ref:this.ref,transform:je}),new se(this.state,je.ref,this.root)}updateTagged(ge,Ie){(this.state.tree.setParams(this.ref,ge)||this.state.tree.setTags(this.ref,Ie))&&(this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.push({kind:"update",ref:this.ref,params:ge}))}update(ge,Ie){let Le;if(Ie){const nt=this.state.tree.transforms.get(this.ref);Le=(0,S.jM)(nt.params,Ie)}else Le="function"==typeof ge?(0,S.jM)(this.state.tree.transforms.get(this.ref).params,ge):ge;return this.state.tree.setParams(this.ref,Le)&&(this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.push({kind:"update",ref:this.ref,params:Le})),this.root}to(ge){return this.root.to(ge)}toRoot(){return this.root.toRoot()}delete(ge){return this.root.delete(ge)}getTree(){return ue(this.state)}commit(ge){if(!this.state.state)throw new Error("Cannot commit template tree");return this.state.state.runTask(this.state.state.updateTree(this,ge))}constructor(ge,Ie,Le){if(this.state=ge,this.root=Le,this.ref=Ie,!this.state.tree.transforms.has(Ie))throw new Error(`Could not find node '${Ie}'.`)}}ie.To=se}(D||(D={}));class f{constructor(){this.ev=a.V.create(),this.actions=new Map,this.fromTypeIndex=new Map,this.events={added:this.ev(),removed:this.ev()}}add(ue){const re=s.x.is(ue)?ue.toAction():ue;if(this.actions.has(re.id))return this;this.actions.set(re.id,re);for(const ve of re.definition.from)this.fromTypeIndex.has(ve.type)?this.fromTypeIndex.get(ve.type).push(re):this.fromTypeIndex.set(ve.type,[re]);return this.events.added.next(void 0),this}remove(ue){const re=s.x.is(ue)?ue.toAction().id:e.kk.is(ue)?ue:ue.id,ve=this.actions.get(re);if(!ve)return this;this.actions.delete(re);for(const ce of ve.definition.from){const se=this.fromTypeIndex.get(ce.type);se&&((0,O.K3)(se,ve),0===se.length&&this.fromTypeIndex.delete(ce.type))}return this.events.removed.next(void 0),this}fromCell(ue,re){const ve=ue.obj;if(!ve)return[];const ce=this.fromTypeIndex.get(ve.type);if(!ce)return[];let se=!1;for(const ge of ce)if(ge.definition.isApplicable){se=!0;break}if(!se)return ce;const ae=[];for(const ge of ce)ge.definition.isApplicable?ge.definition.isApplicable(ve,ue.transform,re)&&ae.push(ge):ae.push(ge);return ae}dispose(){this.ev.dispose()}}var p=n(2229),E=n(9854),T=n(8277),L=n(6323),w=n(1413);class Q{constructor(){this.queue=[],this.signal=new w.B}get length(){return this.queue.length}enqueue(ue){return this.queue.push(ue),1===this.queue.length||this.waitFor(ue)}handled(ue){(0,O.mO)(this.queue,ue),this.queue.length>0&&this.signal.next({v:this.queue[0],stillPresent:!0})}remove(ue){const re=(0,O.mO)(this.queue,ue);return re&&this.signal.next({v:ue,stillPresent:!1}),re}waitFor(ue){return new Promise(re=>{const ve=this.signal.subscribe(({v:ce,stillPresent:se})=>{ce===ue&&(ve.unsubscribe(),re(se))})})}}var G=n(9677);class V{get tree(){return this._tree}get transforms(){return this._tree.transforms}get current(){return this.behaviors.currentObject.value.ref}get root(){return this.cells.get(this._tree.root.ref)}build(){return new D.Root(this.tree,this)}addHistory(ue,re){0!==this.historyCapacity&&(this.history.unshift([ue,re||"Update"]),this.history.length>this.historyCapacity&&this.history.pop(),this.events.historyUpdated.next({state:this}))}clearHistory(){0!==this.history.length&&(this.history=[],this.events.historyUpdated.next({state:this}))}get latestUndoLabel(){return this.history.length>0?this.history[0][1]:void 0}get canUndo(){return this.history.length>0}undo(){var ue=this;return C.YZ.create("Undo",function(){var re=(0,d.A)(function*(ve){const ce=ue.history.shift();if(ce){ue.events.historyUpdated.next({state:ue}),ue.undoingHistory=!0;try{yield ue.updateTree(ce[0],{canUndo:!1}).runInContext(ve)}finally{ue.undoingHistory=!1}}});return function(ve){return re.apply(this,arguments)}}())}getSnapshot(){return{tree:u.toJSON(this._tree)}}setSnapshot(ue){const re=u.fromJSON(ue.tree);return this.updateTree(re)}setCurrent(ue){this.behaviors.currentObject.next({state:this,ref:ue})}updateCellState(ue,re){const ve=this.cells.get(ue);if(!ve)return;const ce="function"==typeof re?re(ve.state):re;i.C.assignState(ve.state,ce)&&(ve.transform=this._tree.assignState(ve.transform.ref,ce),this.events.cell.stateUpdated.next({state:this,ref:ue,cell:ve}))}dispose(){this.ev.dispose(),this.actions.dispose()}select(ue){return h.select(ue,this)}selectQ(ue){return h.select("string"==typeof ue?ue:ue(h.Generators),this)}applyAction(ue,re,ve=i.C.RootRef){return C.YZ.create("Apply Action",ce=>{const se=this.cells.get(ve);if(!se)throw new Error(`'${ve}' does not exist.`);if("ok"!==se.status)throw new Error(`Action cannot be applied to a cell with status '${se.status}'`);return Ve(ue.definition.run({ref:ve,cell:se,a:se.obj,params:re,state:this},this.globalContext),ce)})}transaction(ue,re){var ve=this;return C.YZ.create("State Transaction",function(){var ce=(0,d.A)(function*(se){const ae=ve.inTransaction,ge=ve._tree.asImmutable();let Ie=!1;try{ae||ve.behaviors.isUpdating.next(!0),ve.inTransaction=!0,ve.inTransactionError=!1,yield ue(se),ve.inTransactionError&&(Ie=!0,yield ve.updateTree(ge).runInContext(se))}catch(Le){if(Ie||(Ie=!0,yield ve.updateTree(ge).runInContext(se),ve.events.log.next(p.x.error("Error during state transaction, reverting"))),ae)throw ve.inTransactionError=!0,Le;if(re?.rethrowErrors)throw Le;console.error(Le)}finally{ae||(ve.inTransaction=!1,ve.events.changed.next({state:ve,inTransaction:!1}),ve.behaviors.isUpdating.next(!1),Ie||(re?.canUndo?ve.addHistory(ge,"string"==typeof re.canUndo?re.canUndo:void 0):ve.clearHistory()))}});return function(se){return ce.apply(this,arguments)}}())}get inUpdate(){return this._inUpdate}updateTree(ue,re){var ve=this;const ce={tree:ue,options:re};return C.YZ.create("Update Tree",function(){var se=(0,d.A)(function*(ae){if(!(yield ve.updateQueue.enqueue(ce)))return;ve._inUpdate=!0;const Ie=re?.canUndo?ve._tree.asImmutable():void 0;let Le=!1;ve.inTransaction||ve.behaviors.isUpdating.next(!0);try{if(D.is(ue)){if(ue.editInfo.applied)throw new Error("This builder has already been applied. Create a new builder for further state updates");ue.editInfo.applied=!0}ve.reverted=!1;const nt=re&&(re.revertIfAborted||re.revertOnError)?yield ve._revertibleTreeUpdate(ae,ce,re):yield ve._updateTree(ae,ce);return Le=ve.reverted,nt.ctx.hadError&&(ve.inTransactionError=!0),nt.cell?new A(nt.cell.transform.ref,ve):void 0}finally{ve._inUpdate=!1,ve.updateQueue.handled(ce),ve.inTransaction||(ve.behaviors.isUpdating.next(!1),re?.canUndo?Le||ve.addHistory(Ie,"string"==typeof re.canUndo?re.canUndo:void 0):ve.undoingHistory||ve.clearHistory())}});return function(ae){return se.apply(this,arguments)}}(),()=>{this.updateQueue.remove(ce)})}_revertibleTreeUpdate(ue,re,ve){var ce=this;return(0,d.A)(function*(){const se=ce.tree,ae=yield ce._updateTree(ue,re);return(ae.ctx.hadError||ae.ctx.wasAborted)&&ve.revertOnError||ae.ctx.wasAborted&&ve.revertIfAborted?(ce.reverted=!0,yield ce._updateTree(ue,{tree:se,options:re.options})):ae})()}_updateTree(ue,re){var ve=this;return(0,d.A)(function*(){let ce=!1;const se=ve.updateTreeAndCreateCtx(re.tree,ue,re.options);try{return ce=yield function N(ie){return k.apply(this,arguments)}(se),D.isTo(re.tree)?{ctx:se,cell:ve.select(re.tree.ref)[0]}:{ctx:se}}finally{ve.spine.current=void 0,ce&&ve.events.changed.next({state:ve,inTransaction:ve.inTransaction})}})()}updateTreeAndCreateCtx(ue,re,ve){const ce=(D.is(ue)?ue.getTree():ue).asTransient(),se=this._tree;this._tree=ce;const ae=this.cells,ge={parent:this,editInfo:D.is(ue)?ue.editInfo:void 0,errorFree:this.errorFree,taskCtx:re,oldTree:se,tree:ce,cells:this.cells,spine:this.spine,results:[],options:{...U,...ve},changed:!1,hadError:!1,wasAborted:!1,newCurrent:void 0,getCellData:Ie=>{var Le;return null===(Le=ae.get(Ie).obj)||void 0===Le?void 0:Le.data}};return this.errorFree=!0,ge}constructor(ue,re){this.errorFree=!0,this.ev=a.V.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:i.C.RootRef}),isUpdating:this.ev.behavior(!1)},this.actions=new f,this.cells=new Map,this.spine=new L.P.Impl(this.cells),this.tryGetCellData=se=>{var ae,ge;const Ie=null===(ge=null===(ae=this.cells.get(se))||void 0===ae?void 0:ae.obj)||void 0===ge?void 0:ge.data;if(void 0===Ie)throw new Error(`Cell '${se}' data undefined.`);return Ie},this.historyCapacity=5,this.history=[],this.undoingHistory=!1,this.inTransaction=!1,this.inTransactionError=!1,this._inUpdate=!1,this.reverted=!1,this.updateQueue=new Q,this._tree=u.createEmpty(i.C.createRoot(re&&re.rootState)).asTransient();const ce=this._tree.root;this.runTask=re.runTask,void 0!==re?.historyCapacity&&(this.historyCapacity=re.historyCapacity),this.cells.set(ce.ref,{parent:this,transform:ce,sourceRef:void 0,obj:ue,status:"ok",state:{...ce.state},errorText:void 0,params:{definition:{},values:{}},paramsNormalizedVersion:ce.version,dependencies:{dependentBy:[],dependsOn:[]},cache:{}}),this.globalContext=re&&re.globalContext}}!function(ie){let re;ie.create=function ue(ve,ce){return new ie(ve,ce)},(re=ie.ObjectEvent||(ie.ObjectEvent={})).isCell=function ce(se,ae){return!!ae&&se.ref===ae.transform.ref&&se.state===ae.parent}}(V||(V={}));const U={doNotLogTiming:!1,doNotUpdateCurrent:!0,revertIfAborted:!1,revertOnError:!1,canUndo:!1};function k(){return k=(0,d.A)(function*(ie){let re,ce,ve=[];if(ie.editInfo&&1===ie.editInfo.count&&ie.editInfo.lastUpdate&&ie.editInfo.sourceTree===ie.oldTree)re=[],ce=[ie.editInfo.lastUpdate];else{re=function W(ie){const ue={newTree:ie.tree,cells:ie.cells,deletes:[]};return u.doPostOrder(ie.oldTree,ie.oldTree.root,ue,J),ue.deletes}(ie);const ge=ie.parent.current;let Ie=!1;for(const Le of re)if(Le===ge){Ie=!0;break}if(Ie){const Le=_e(ie.oldTree,ge,re,ie.cells);ie.parent.setCurrent(Le)}for(let Le=re.length-1;Le>=0;Le--){const nt=ie.cells.get(re[Le]);nt&&Oe(nt.transform,nt.obj,nt?.transform.params,nt.cache,ie.parent.globalContext)}for(const Le of re){const nt=ie.cells.get(Le);nt&&(nt.parent=void 0,q(nt));const je=nt&&nt.obj;ie.cells.delete(Le),ve.push(je)}ce=function H(ie,ue){const re={roots:[],cells:ie};return u.doPreOrder(ue,ue.root,re,$),re.roots}(ie.cells,ie.tree)}const se=function g(ie,ue){const re={ctx:ie,visited:new Set,added:[]};for(const ce of ue)u.doPreOrder(ie.tree,ie.tree.transforms.get(ce),re,Y);for(const ce of re.added)ee(ce,ie);let ve;return re.visited.forEach(ce=>{const se=ie.cells.get(ce);for(const ae of se.dependencies.dependentBy)re.visited.has(ae.transform.ref)||(ve||(ve=G.th.create()),G.th.add(ve,ae.transform.ref,ae))}),{added:re.added,dependent:ve?ve.array:void 0}}(ie,ce);for(const ge of se.added)ie.parent.events.cell.created.next({state:ie.parent,ref:ge.transform.ref,cell:ge});for(let ge=0;ge0||ce.length>0||ie.changed}),k.apply(this,arguments)}function $(ie,ue,re){const ve=re.cells.get(ie.ref);return ve&&ve.transform.version===ie.version?!("error"===ve.status||ve&&ve.obj===o.Null):(re.roots.push(ie.ref),!1)}function J(ie,ue,re){!re.newTree.transforms.has(ie.ref)&&re.cells.has(ie.ref)&&re.deletes.push(ie.ref)}function te(ie,ue,re){const ve=re.cells.get(ie.ref);!ve||!i.C.syncState(ve.state,ie.state)||re.parent.events.cell.stateUpdated.next({state:re.parent,ref:ie.ref,cell:ve})}function ye(ie,ue,re,ve){const ce=ie.cells.get(ue),se=ce.status!==re;ce.status=re,ce.errorText=ve,se&&ie.parent.events.cell.stateUpdated.next({state:ie.parent,ref:ue,cell:ce})}function j(ie,ue,re){re.cells.get(ie.ref).transform=ie,ye(re,ie.ref,"pending")}function q(ie){for(const ue of ie.dependencies.dependsOn)(0,O.K3)(ue.dependencies.dependentBy,ie)}function Y(ie,ue,{ctx:re,added:ve,visited:ce}){if(ce.add(ie.ref),re.cells.has(ie.ref))return;const se={parent:re.parent,transform:ie,sourceRef:void 0,status:"pending",state:{...ie.state},errorText:void 0,params:void 0,paramsNormalizedVersion:"",dependencies:{dependentBy:[],dependsOn:[]},cache:void 0};re.cells.set(ie.ref,se),ve.push(se)}function ee(ie,ue){if(ie.transform.dependsOn)for(const re of ie.transform.dependsOn){if(!ue.tree.transforms.get(re))throw new Error("Cannot depend on a non-existent transform.");const ce=ue.cells.get(re);(0,O.Z2)(ie.dependencies.dependsOn,ce),(0,O.Z2)(ce.dependencies.dependentBy,ie)}}function _e(ie,ue,re,ve){return xe(ie,ue,new Set(re),ve)}function xe(ie,ue,re,ve){if(ue===i.C.RootRef)return ue;const ce=ie.transforms.get(ue),se=ie.children.get(ce.parent).values();let ae,ge=!1;for(;;){const Ie=se.next();if(Ie.done)break;if(re.has(Ie.value))continue;const Le=ve.get(Ie.value);if(!Le||"error"===Le.status||Le.obj===o.Null)continue;const nt=ie.transforms.get(Ie.value);if(!nt.state.isGhost){if(Ie.value===ue){ge=!0,re.has(ue)||(ae=ue);continue}if(ge)return nt.ref;ae=nt.ref}}return ae||xe(ie,ce.parent,re,ve)}function le(ie,ue,re,ve){ve||(ie.hadError=!0,ie.parent.errorFree=!1);const ce=ie.cells.get(ue);if(re){ie.wasAborted=ie.wasAborted||C.YZ.isAbort(re);const ae=""+re;ye(ie,ue,"error",ae),ve||ie.parent.events.log.next({type:"error",timestamp:new Date,message:ae})}else ce.params=void 0;if(ce.obj){const ae=ce.obj;ce.obj=void 0,ce.cache=void 0,ie.parent.events.object.removed.next({state:ie.parent,ref:ue,obj:ae})}const se=ie.tree.children.get(ue).values();for(;;){const ae=se.next();if(ae.done)return;le(ie,ae.value,void 0,ve)}}const Ae="Parent is null";function Be(ie,ue){return Ce.apply(this,arguments)}function Ce(){return Ce=(0,d.A)(function*(ie,ue){ye(ie,ue,"processing");let re=!1;try{const ce=(0,E.t)(),se=yield function ke(ie,ue){return we.apply(this,arguments)}(ie,ue),ae=(0,E.t)()-ce;"none"!==se.action&&(ie.changed=!0),ye(ie,ue,"ok"),ie.results.push(se),"created"===se.action?(re=se.obj===o.Null,!re&&!ie.options.doNotLogTiming&&ie.parent.events.log.next(p.x.info(`Created ${se.obj.label} in ${(0,E.H)(ae)}.`))):("updated"===se.action||"replaced"===se.action)&&(re=se.obj===o.Null,!re&&!ie.options.doNotLogTiming&&ie.parent.events.log.next(p.x.info(`Updated ${se.obj.label} in ${(0,E.H)(ae)}.`)))}catch(ce){return ie.changed=!0,ie.hadError||(ie.newCurrent=ue),le(ie,ue,ce,!1),void console.error(ce)}const ve=ie.tree.children.get(ue).values();for(;;){const ce=ve.next();if(ce.done)return;re?le(ie,ce.value,void 0,!0):yield Be(ie,ce.value)}}),Ce.apply(this,arguments)}function we(){return we=(0,d.A)(function*(ie,ue){var re;const{oldTree:ve,tree:ce}=ie,se=ie.cells.get(ue),ae=se.transform;if(se.transform.ref===i.C.RootRef)return{action:"none"};const ge=ie.cells.get(se.transform.parent);if(ge?.obj===o.Null)return se.sourceRef=ge.transform.ref,ve.transforms.has(ue)&&se.params?(Oe(ae,se.obj,se.params.values,se.cache,ie.parent.globalContext),se.params=void 0,se.obj=o.Null,{ref:ue,action:"updated",obj:se.obj}):(se.params=void 0,{ref:ue,action:"created",obj:o.Null});const Le=0===ae.transformer.definition.from.length?ge:h.findAncestorOfType(ce,ie.cells,ue,ae.transformer.definition.from);if(!Le)throw new Error(`No suitable parent found for '${ue}'`);ie.spine.current=se;const nt=Le.obj;se.sourceRef=Le.transform.ref;const je=function Re(ie,ue,re,ve){const ce=ue.transformer.definition.params,se=ce?ce(re,ie.parent.globalContext):{};if(ve.paramsNormalizedVersion!==ue.version)ue.params=T.t.normalizeParams(se,ue.params,"all"),ve.paramsNormalizedVersion=ue.version;else{const ae=T.t.getDefaultValues(se);ue.params=ue.params?(0,v.JW)(ue.params,ae):ae}return T.t.resolveRefs(se,ue.params,ie.getCellData),{definition:se,values:ue.params}}(ie,ae,nt,se);if(!ve.transforms.has(ue)||!se.params){se.params=je;const Lt=yield K(ie,se,ae.transformer,nt,je.values);return Se(Lt,ae),se.obj=Lt,{ref:ue,action:"created",obj:Lt}}{const Lt=se.params.values,Je=se.cache,en=null===(re=se.obj)||void 0===re?void 0:re.data,Bt=je.values;switch(se.params=je,se.obj&&se.obj!==o.Null?yield function ne(ie,ue,re,ve,ce,se,ae){return be.apply(this,arguments)}(ie,se,ae.transformer,nt,se.obj,Lt,Bt):s.x.UpdateResult.Recreate){case s.x.UpdateResult.Recreate:{const $e=se.obj;Oe(ae,$e,Lt,Je,ie.parent.globalContext);const mt=yield K(ie,se,ae.transformer,nt,Bt);return Se(mt,ae),se.obj=mt,{ref:ue,action:"replaced",oldObj:$e,obj:mt}}case s.x.UpdateResult.Updated:return Se(se.obj,ae),{ref:ue,action:"updated",oldData:en,obj:se.obj};case s.x.UpdateResult.Null:return Oe(ae,se.obj,Lt,Je,ie.parent.globalContext),se.obj=o.Null,{ref:ue,action:"updated",obj:se.obj};default:return{action:"none"}}}}),we.apply(this,arguments)}function Oe(ie,ue,re,ve,ce){var se,ae;null===(ae=(se=ie.transformer.definition).dispose)||void 0===ae||ae.call(se,{b:ue!==o.Null?ue:void 0,params:re,cache:ve},ce)}function Se(ie,ue){!ie||ie===o.Null||(ie.tags=ue.tags)}function Ve(ie,ue){return"function"==typeof ie.runInContext?ie.runInContext(ue):ie}function Ne(ie){if(0===ie.dependencies.dependsOn.length)return;const ue=Object.create(null);for(const re of ie.dependencies.dependsOn){if(!re.obj)throw new Error("Unresolved dependency.");ue[re.transform.ref]=re.obj}return ue}function K(ie,ue,re,ve,ce){return ue.cache||(ue.cache=Object.create(null)),Ve(re.definition.apply({a:ve,params:ce,cache:ue.cache,spine:ie.spine,dependencies:Ne(ue)},ie.parent.globalContext),ie.taskCtx)}function be(){return be=(0,d.A)(function*(ie,ue,re,ve,ce,se,ae){return re.definition.update?(ue.cache||(ue.cache=Object.create(null)),Ve(re.definition.update({a:ve,oldParams:se,b:ce,newParams:ae,cache:ue.cache,spine:ie.spine,dependencies:Ne(ue)},ie.parent.globalContext),ie.taskCtx)):s.x.UpdateResult.Recreate}),be.apply(this,arguments)}var Te=n(4829)},2907:(tn,Ue,n)=>{"use strict";n.d(Ue,{C:()=>r});var r,e=n(8384),o=n(9909);!function(t){function v(C,h,a,S){const D=S&&S.ref?S.ref:o.kk.create22();let R;return S&&S.tags&&(R="string"==typeof S.tags?[S.tags]:S.tags,0===R.length?R=void 0:R.sort()),{parent:C,transformer:h,state:S?.state||{},tags:R,ref:D,dependsOn:S&&S.dependsOn,params:a,version:o.kk.create22()}}function l(C,h){return!!C.tags&&C.tags.indexOf(h)>=0}function u(C){return C}t.RootRef="-=root=-",t.areStatesEqual=function A(C,h){return!!C.isHidden!=!!h.isHidden||!!C.isCollapsed!=!!h.isCollapsed||!!C.isGhost!=!!h.isGhost||!!C.isLocked!=!!h.isLocked},t.isStateChange=function y(C,h){return!!h&&(typeof h.isCollapsed<"u"&&C.isCollapsed!==h.isCollapsed||typeof h.isHidden<"u"&&C.isHidden!==h.isHidden||typeof h.isGhost<"u"&&C.isGhost!==h.isGhost||typeof h.isLocked<"u"&&C.isLocked!==h.isLocked)},t.assignState=function c(C,h){if(!h)return!1;let a=!1;for(const S of Object.keys(h)){const D=h[S];!!D!=!!C[S]&&(a=!0,C[S]=D)}return a},t.syncState=function i(C,h){if(!h)return!1;let a=!1;for(const S of Object.keys(h)){const D=h[S];!!D!=!!C[S]&&(a=!0,void 0!==D?C[S]=D:delete C[S])}for(const S of Object.keys(C)){const D=h[S];!!D!=!!C[S]&&(a=!0,void 0!==D?C[S]=D:delete C[S])}return a},t.create=v,t.withParams=function O(C,h){return{...C,params:h,version:o.kk.create22()}},t.withState=function b(C,h){return h?{...C,state:{...C.state,...h}}:C},t.withTags=function _(C,h){let a;return h&&(a="string"==typeof h?[h]:h,0===a.length?a=void 0:a.sort()),{...C,tags:a,version:o.kk.create22()}},t.withParent=function M(C,h){return{...C,parent:h,version:o.kk.create22()}},t.createRoot=function I(C){return v(t.RootRef,e.x.ROOT,{},{ref:t.RootRef,state:C})},t.hasTag=l,t.hasTags=function m(C,h){if(!C.tags)return"string"!=typeof h&&0===h.length;if("string"==typeof h)return l(C,h);for(const a of h)if(C.tags.indexOf(a)<0)return!1;return!0},t.toJSON=function d(C){const h=C.transformer.definition.customSerialization?C.transformer.definition.customSerialization.toJSON:u;let a;for(const S of Object.keys(C.state))C.state[S]&&(a||(a={}),a[S]=!0);return{parent:C.parent,transformer:C.transformer.id,params:C.params?h(C.params):void 0,state:a,tags:C.tags,ref:C.ref,dependsOn:C.dependsOn,version:C.version}},t.fromJSON=function s(C){const h=e.x.get(C.transformer);return{parent:C.parent,transformer:h,params:C.params?(h.definition.customSerialization?h.definition.customSerialization.fromJSON:u)(C.params):void 0,state:C.state||{},tags:C.tags,ref:C.ref,dependsOn:C.dependsOn,version:C.version}}}(r||(r={}))},8384:(tn,Ue,n)=>{"use strict";n.d(Ue,{x:()=>A});var A,e=n(2907),o=n(8277),r=n(4829),t=n(7785);!function(y){let v;var h;y.getParamDefinition=function c(h,a,S){return h.definition.params?h.definition.params(a,S):{}},y.is=function i(h){return!!h&&"function"==typeof h.toAction&&"function"==typeof h.apply},(h=v=y.UpdateResult||(y.UpdateResult={}))[h.Unchanged=0]="Unchanged",h[h.Updated=1]="Updated",h[h.Recreate=2]="Recreate",h[h.Null=3]="Null";const O=new Map,b=new Map;function m(h,a){const{name:S}=a,D=`${h}.${S}`;if(O.has(D))throw new Error(`A transform with id '${S}' is already registered. Please pick a unique identifier for your transforms and/or register them only once. This is to ensure that transforms can be serialized and replayed.`);const R={apply:(f,p,E)=>e.C.create(f,R,p,E),toAction:()=>r.K.fromTransformer(R),namespace:h,id:D,definition:a,createDefaultParams:(f,p)=>a.params?o.t.getDefaultValues(a.params(f,p)):{}};return O.set(D,R),function _(h){for(const a of h.definition.from)b.has(a.type)?b.get(a.type).push(h):b.set(a.type,[h])}(R),R}let s;y.getAll=function M(){return Array.from(O.values())},y.get=function I(h){const a=O.get(h);if(!a)throw new Error(`A transformer with signature '${h}' is not registered.`);return a},y.fromType=function l(h){return b.get(h)||[]},y.create=m,y.factory=function u(h){return a=>m(h,a)},y.builderFactory=function d(h){return s.build(h)},function(h){h.build=function S(D){return R=>function a(D,R){return f=>m(D,{name:R.name,from:R.from instanceof Array?R.from:[R.from],to:R.to instanceof Array?R.to:[R.to],display:"string"==typeof R.display?{name:R.display}:R.display?R.display:{name:(0,t.ZH)(R.name.replace(/[-]/g," "))},params:"object"==typeof R.params?()=>R.params:R.params?R.params:void 0,isDecorator:R.isDecorator,...f})}(D,R)}}(s=y.Builder||(y.Builder={})),y.build=function C(h){return s.build(h)},y.ROOT=m("build-in",{name:"root",from:[],to:[],display:{name:"Root",description:"For internal use."},apply(){throw new Error("should never be applied")},update:()=>v.Unchanged})}(A||(A={}))},6323:(tn,Ue,n)=>{"use strict";n.d(Ue,{P:()=>o});var o,r,e=n(2907);(r=o||(o={})).Impl=class t{get current(){return this._current}set current(i){this._current=i}getAncestorOfType(i){if(!this._current)return;let v=this._current;for(;;){if(v=this.cells.get(v.transform.parent),!v.obj)return;if(v.obj.type===i.type)return v.obj;if(v.transform.ref===e.C.RootRef)return}}getRootOfType(i){if(!this._current)return;let O,v=this._current;for(;;){if(!v.obj)return;if(v.obj.type===i.type&&(O=v),v.transform.ref===e.C.RootRef)return O?O.obj:void 0;v=this.cells.get(v.transform.parent)}}constructor(i){this.cells=i,this._current=void 0}},r.getDecoratorChain=function A(c,i){const v=c.cells;let O=v.get(i);const b=[O];for(;O?.transform.transformer.definition.isDecorator;)O=v.get(O.transform.parent),b.push(O);return b},r.getRootOfType=function y(c,i,v){let O,b=c.cells.get(v);if(b)for(;;){if(!b.obj)return;if(b.obj.type===i.type&&(O=b),b.transform.ref===e.C.RootRef)return O?O.obj:void 0;b=c.cells.get(b.transform.parent)}}},6241:(tn,Ue,n)=>{"use strict";n.d(Ue,{pm:()=>O,yR:()=>b,hM:()=>v,Vs:()=>_});var e=n(467),o=n(5398),r=n(9854),t=n(5385),A=n(2629);const c=typeof performance<"u"&&!!performance.mark&&performance.measure&&A.g$;var i;function v(R,f,p=250){const E=I(R,f,p);return s(R,new D(E,E.root))}function O(R,f,p=250){const E=I(R,f,p);return new D(E,E.root)}function b(R,f){return s(f,R)}function _(R,f,p){return R.runChild(f,p)}function M(R){return{taskId:R.id,taskName:R.name,message:"",startedTime:0,canAbort:!0,isIndeterminate:!0,current:0,max:0}}function I(R,f,p){const E={abortRequested:!1,treeAborted:!1,reason:""};return{updateRateMs:p,lastNotified:(0,r.t)(),observer:f,abortToken:E,taskId:R.id,root:{progress:M(R),children:[]},tryAbort:l(E)}}function l(R){return f=>{R.abortRequested=!0,R.reason=f||R.reason}}function m(R){return{progress:{...R.progress},children:R.children.map(m)}}function u(R){return R.progress.canAbort&&R.children.every(u)}function s(R,f){return C.apply(this,arguments)}function C(){return(C=(0,e.A)(function*(R,f){i.markStart(R),f.node.progress.startedTime=(0,r.t)();try{const p=yield R.f(f);return i.markEnd(R),i.measure(R),f.info.abortToken.abortRequested&&h(f.info),p}catch(p){throw o.Y.isAbort(p)&&(f.isAborted=!0,f.node.children.length>0&&(yield new Promise(E=>{f.onChildrenFinished=E})),R.onAbort&&R.onAbort()),p}})).apply(this,arguments)}function h(R){throw R.abortToken.treeAborted||(R.abortToken.treeAborted=!0,a(R.root),S(R,(0,r.t)())),o.Y.Aborted(R.abortToken.reason)}function a(R){const f=R.progress;f.isIndeterminate=!0,f.canAbort=!1,f.message="Aborting...";for(const p of R.children)a(p)}function S(R,f){R.lastNotified=f;const p=function d(R){return{root:m(R.root),canAbort:u(R.root),requestAbort:R.tryAbort}}(R);R.observer(p)}!function(R){function f(w){return`startTask${w.id}`}function p(w){return`endTask${w.id}`}R.markStart=function E(w){c&&performance.mark(f(w))},R.markEnd=function T(w){c&&performance.mark(p(w))},R.measure=function L(w){c&&performance.measure(`\u2733\ufe0f ${w.name}`,f(w),p(w))}}(i||(i={}));class D{checkAborted(){this.info.abortToken.abortRequested&&(this.isAborted=!0,h(this.info))}get shouldUpdate(){return this.checkAborted(),(0,r.t)()-this.lastUpdatedTime>this.info.updateRateMs}updateProgress(f){if(this.checkAborted(),!f)return;const p=this.node.progress;"string"==typeof f?(p.message=f,p.isIndeterminate=!0):(typeof f.canAbort<"u"&&(p.canAbort=f.canAbort),typeof f.message<"u"&&(p.message=f.message),typeof f.current<"u"&&(p.current=f.current),typeof f.max<"u"&&(p.max=f.max),p.isIndeterminate=typeof p.current>"u"||typeof p.max>"u",typeof f.isIndeterminate<"u"&&(p.isIndeterminate=f.isIndeterminate))}update(f,p){if(this.lastUpdatedTime=(0,r.t)(),this.updateProgress(f),!p)return S(this.info,this.lastUpdatedTime),this.checkAborted(),t._.immediatePromise()}runChild(f,p){var E=this;return(0,e.A)(function*(){E.updateProgress(p);const T={progress:M(f),children:[]},L=E.node.children;L.push(T);const w=new D(E.info,T);try{return yield s(f,w)}catch(Q){if(o.Y.isAbort(Q)&&E.isAborted)return;throw Q}finally{const Q=L.indexOf(T);if(Q>=0){for(let G=Q,V=L.length-1;G{"use strict";n.d(Ue,{f:()=>o});const o=new class e{constructor(){this.shouldUpdate=!1,this.isSynchronous=!0}update(t,A){}}},4824:(tn,Ue,n)=>{"use strict";n.d(Ue,{_F:()=>A._,YZ:()=>e.Y,yB:()=>v});var t,e=n(5398);n(6095),function(b){function _(I,l=""){const m=I.progress;if(!I.children.length)return m.isIndeterminate?`${l}${m.taskName}: ${m.message}`:`${l}${m.taskName}: [${m.current}/${m.max}] ${m.message}`;const u=l+" |_ ",d=I.children.map(s=>_(s,u));return m.isIndeterminate?`${l}${m.taskName}: ${m.message}\n${d.join("\n")}`:`${l}${m.taskName}: [${m.current}/${m.max}] ${m.message}\n${d.join("\n")}`}b.format=function M(I){return _(I.root)}}(t||(t={}));var A=n(5385),c=n(467),i=n(9854);function v(b,_,M,I,l){return O.apply(this,arguments)}function O(){return(O=(0,c.A)(function*(b,_,M,I,l){let m=Math.max(_,0),u=0,d=0;if(b.isSynchronous)return I(Number.MAX_SAFE_INTEGER,M),M;let s=(0,i.t)(),C=0,h=0;for(;(C=I(m,M))>0;){u+=C;const a=(0,i.t)()-s;h+=a,d+=a,b.shouldUpdate&&(yield l(b,M,u),m=Math.round(h*u/d)+1,s=(0,i.t)(),h=0)}return b.shouldUpdate&&(yield l(b,M,u)),M})).apply(this,arguments)}},5398:(tn,Ue,n)=>{"use strict";n.d(Ue,{Y:()=>A});var A,e=n(467),o=n(6241),r=n(6095),t=n(7778);!function(y){class c{run(d,s=250){return d?(0,o.hM)(this,d,s):this.f(r.f)}runAsChild(d,s){return d.isSynchronous?this.f(r.f):(0,o.Vs)(d,this,s)}runInContext(d){return d.isSynchronous?this.f(r.f):(0,o.yR)(d,this)}constructor(d,s,C){this.name=d,this.f=s,this.onAbort=C,this.id=m()}}function i(u){return!!u&&"number"==typeof u.id&&"string"==typeof u.name&&!!u.run}function b(u,d,s){return new c(u,d,s)}y.is=i,y.isAbort=function v(u){return!!u&&!!u.isAborted},y.Aborted=function O(u){return{isAborted:!0,reason:u,toString:()=>"Aborted"+(u?": "+u:"")}},y.create=b,y.constant=function _(u,d){return b(u,function(){var s=(0,e.A)(function*(C){return d});return function(C){return s.apply(this,arguments)}}())},y.empty=function M(){return b("",function(){var u=(0,e.A)(function*(d){});return function(d){return u.apply(this,arguments)}}())},y.fail=function I(u,d){return b(u,function(){var s=(0,e.A)(function*(C){throw new Error(d)});return function(C){return s.apply(this,arguments)}}())},y.resolveInContext=function l(u,d){return i(u)?d?u.runInContext(d):u.run():u};const m=(0,t.q)(0,1073741823)}(A||(A={}))},5385:(tn,Ue,n)=>{"use strict";n.d(Ue,{_:()=>t});const o=typeof setImmediate<"u"?typeof window<"u"?{setImmediate:(A,...y)=>window.setImmediate(A,...y),clearImmediate:A=>window.clearImmediate(A)}:{setImmediate,clearImmediate}:function e(){const A=function(){const C=typeof window<"u"&&window,h=typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self;return C||typeof global<"u"&&global||h}(),y={},c=typeof document<"u"?document:void 0;let v,i=1;function b(C){delete y[C]}function M(C){const h=y[C];b(C),function _(C){const h=C.callback,a=C.args;switch(a.length){case 0:h();break;case 1:h(a[0]);break;case 2:h(a[0],a[1]);break;case 3:h(a[0],a[1],a[2]);break;default:h.apply(void 0,a)}}(h)}return typeof process<"u"&&"[object process]"==={}.toString.call(process)?function I(){v=function(C){process.nextTick(function(){M(C)})}}():function l(){if(A&&A.postMessage&&!A.importScripts){let C=!0;const h=A.onmessage;return A.onmessage=function(){C=!1},A.postMessage("","*"),A.onmessage=h,C}}()?function m(){const C="setImmediate$"+Math.random()+"$",h=function(a){a.source===A&&"string"==typeof a.data&&0===a.data.indexOf(C)&&M(+a.data.slice(C.length))};window.addEventListener?window.addEventListener("message",h,!1):window.attachEvent("onmessage",h),v=function(a){window.postMessage(C+a,"*")}}():typeof MessageChannel<"u"?function u(){const C=new MessageChannel;C.port1.onmessage=function(h){M(h.data)},v=function(h){C.port2.postMessage(h)}}():c&&"onreadystatechange"in c.createElement("script")?function d(){const C=c.documentElement;v=function(h){let a=c.createElement("script");a.onreadystatechange=function(){M(h),a.onreadystatechange=null,C.removeChild(a),a=null},C.appendChild(a)}}():function s(){v=function(C){setTimeout(M,0,C)}}(),{setImmediate:function O(C,...h){return"function"!=typeof C&&(C=new Function(""+C)),y[i]={callback:C,args:h},v(i),i++},clearImmediate:b}}();function r(A){o.setImmediate(A)}const t={setImmediate:o.setImmediate,clearImmediate:o.clearImmediate,immediatePromise:()=>new Promise(r),delay:(A,y=void 0)=>new Promise(c=>setTimeout(c,A,y))}},7981:(tn,Ue,n)=>{"use strict";n.d(Ue,{l:()=>A});var e=n(3246),o=n(9136),r=n(9498),t=n(9455);function A(y,c){return{kind:y,layers:c}}!function(y){let c;function v(m){return 0===m.layers.length}y.Empty={kind:"empty-loci",layers:[]},function(m){let u;var S;function C(S){switch(S){case"one":return u.One;case"two":return u.Two;case"three":return u.Three;case"four":return u.Four;case"five":return u.Five;case"six":return u.Six}}m.is=t.N.has,(S=u=m.Flag||(m.Flag={}))[S.None=0]="None",S[S.One=1]="One",S[S.Two=2]="Two",S[S.Three=4]="Three",S[S.Four=8]="Four",S[S.Five=16]="Five",S[S.Six=32]="Six",m.create=function d(S){return t.N.create(S)},m.Names={one:u.One,two:u.Two,three:u.Three,four:u.Four,five:u.Five,six:u.Six},m.isName=function s(S){return S in m.Names},m.fromName=C,m.fromNames=function h(S){let D=u.None;for(let R=0,f=S.length;R{C.push({loci:h,groups:a})}),{kind:"element-loci",layers:C}}return m},y.filter=function _(m,u){if(v(m))return m;if("element-loci"===m.kind){const{structure:d}=m.layers[0].loci,s=[];for(const C of m.layers){let{loci:h,groups:a}=C;const S=o.iZ.Loci.remap(h,u);h=o.iZ.Loci.remap(S,d),o.iZ.Loci.isEmpty(h)||s.push({loci:h,groups:a})}return{kind:"element-loci",layers:s}}return m},y.ofScript=function M(m,u){const d=[];for(let s=0,C=m.length;s{"use strict";n.d(Ue,{J:()=>Vi});var e=n(190),o=n(9136),r=n(442),t=n(8277),A=n(2293),y=n(9983);const c=(0,e.Q1)(13421772),v={},_={name:"carbohydrate-symbol",label:"Carbohydrate Symbol",category:y.N.Residue,factory:function b(ln,Ht){let Gn;if(ln.structure){const{elements:ar,getElementIndices:kn}=ln.structure.carbohydrates,ur=(sr,Jn)=>{if(!o.Nf.isAtomic(sr))return c;const Br=kn(sr,Jn);return Br.length>0?ar[Br[0]].component.color:c};Gn=(sr,Jn)=>Jn?r.G7.Secondary:o.iZ.Location.is(sr)?ur(sr.unit,sr.element):o.gn.isLocation(sr)?ur(sr.aUnit,sr.aUnit.elements[sr.aIndex]):c}else Gn=()=>c;return{factory:b,granularity:"group",color:Gn,props:Ht,description:"Assigns colors according to the Symbol Nomenclature for Glycans (SNFG).",legend:(0,A.h)(r.dV)}},getParams:function O(ln){return v},defaultValues:t.t.getDefaultValues(v),isApplicable:ln=>!!ln.structure&&ln.structure.models.some(Ht=>o.Kx.hasCarbohydrate(Ht))};var M=n(9347),I=n(9909),l=n(1930),m=n(8742),u=n(3543),d=n(7809);const s=(0,e.Q1)(13421772),h={...(0,d.U)({type:"colors",colorList:"red-yellow-blue"})},D={name:"element-index",label:"Element Index",category:y.N.Atom,factory:function S(ln,Ht){let Gn,ar;if(ln.structure){const{units:kn}=ln.structure.root,ur=kn.length,sr=new Map,Jn=new Map;let Br=0;for(let et=0;et{if(o.iZ.Location.is(et)){const at=Jn.get(et.unit.id),Et=u.CD.findPredecessorIndex(kn[at].elements,et.element);return st.color(sr.get(at)+Et)}if(o.gn.isLocation(et)){const at=Jn.get(et.aUnit.id),Et=u.CD.findPredecessorIndex(kn[at].elements,et.aUnit.elements[et.aIndex]);return st.color(sr.get(at)+Et)}return s}}else Gn=()=>s;return{factory:S,granularity:"groupInstance",preferSmoothing:!0,color:Gn,props:Ht,description:"Gives every element (atom or coarse sphere/gaussian) a unique color based on the position (index) of the element in the list of elements in the structure.",legend:ar}},getParams:function a(ln){return h},defaultValues:t.t.getDefaultValues(h),isApplicable:ln=>!!ln.structure};var R=n(3057),f=n(9359);function p(ln){const Ht={};return(0,f.IF)(ln,(Gn,ar)=>{Ht[ar]=t.t.Color(ln[ar])}),Ht}var E=n(8103);const L=(0,e.Q1)(16448250),w="Gives every chain a color based on its `label_entity_id` value.",Q={...(0,d.U)({type:"colors",colorList:"many-distinct"})};function V(ln,Ht){return`${ln}|${Ht}`}function N(ln){switch(ln.unit.kind){case 0:return o.StructureProperties.chain.label_entity_id(ln);case 1:case 2:return o.StructureProperties.coarse.entity_id(ln)}}function k(ln,Ht){let Gn,ar;if(ln.structure){const kn=o.iZ.Location.create(ln.structure.root),ur=function U(ln){const Ht=new Map;for(let Gn=0,ar=ln.models.length;Gnsr[st]});ar=Br.legend,Gn=st=>{let et;if(o.iZ.Location.is(st)){const Nt=V(N(st),st.structure.models.indexOf(st.unit.model));et=ur.get(Nt)}else if(o.gn.isLocation(st)){kn.unit=st.aUnit,kn.element=st.aUnit.elements[st.aIndex];const Nt=V(N(kn),kn.structure.models.indexOf(kn.unit.model));et=ur.get(Nt)}return void 0===et?L:Br.color(et)}}else Gn=()=>L;return{factory:k,granularity:"group",color:Gn,props:Ht,description:w,legend:ar}}const H={name:"entity-id",label:"Entity Id",category:y.N.Chain,factory:k,getParams:function G(ln){return t.t.clone(Q)},defaultValues:t.t.getDefaultValues(Q),isApplicable:ln=>!!ln.structure};var $=n(1372),J=n(229),W=n(1907),te=n(2524);const de="dark-2",ye=(0,e.Q1)(16448250),j="Gives ranges of a polymer chain a color based on the entity source it originates from (e.g. gene, plasmid, organism).",Z={...(0,d.U)({type:"colors",colorList:de})};function Y(ln,Ht){return`${ln}|${Ht}`}function ee(ln,Ht,Gn,ar,kn,ur){return`${ln}|${Ht}|${Gn}|${ur||kn||ar}`}function g(ln,Ht,Gn,ar,kn,ur,sr,Jn){const{entity_id:Br,pdbx_src_id:st,pdbx_beg_seq_num:et,pdbx_end_seq_num:at}=kn;for(let Et=0,Nt=kn._rowCount;Et{const ar=Gn.split("|"),kn=ar[2];return`${(0,J.Fq)(ar[3])?"Unnamed "+ ++Ht:ar[3]}${kn?` (${kn})`:""}`})}(Jn),et=(0,d.S)(Jn.size,Ht,{valueLabel:Et=>Br[Et]});ar=et.legend;const at=Et=>{const Cn=Y(ur.indexOf(Et.unit.model),o.StructureProperties.entity.id(Et)),Un=sr.get(Cn);if(Un){const vn=Un[o.StructureProperties.residue.label_seq_id(Et)-1]-1;return-1===vn?ye:et.color(vn)}return ye};Gn=Et=>o.iZ.Location.is(Et)?at(Et):o.gn.isLocation(Et)?(kn.unit=Et.aUnit,kn.element=Et.aUnit.elements[Et.aIndex],at(kn)):ye}else Gn=()=>ye;return{factory:le,granularity:"group",color:Gn,props:Ht,description:j,legend:ar}}const Ae={name:"entity-source",label:"Entity Source",category:y.N.Chain,factory:le,getParams:function q(ln){const Ht=t.t.clone(Z);return ln.structure&&_e(ln.structure.root.models).srcKeySerialMap.size>W.VI[de].list.length&&(Ht.palette.defaultValue.name="colors",Ht.palette.defaultValue.params={...Ht.palette.defaultValue.params,list:{kind:"interpolate",colors:(0,W.JA)(de).list}}),Ht},defaultValues:t.t.getDefaultValues(Z),isApplicable:ln=>!!ln.structure},Be=(0,e.Q1)(13421772),Ce="Gives every model a unique color based on its index.",Re={...(0,d.U)({type:"colors",colorList:"many-distinct"})};function we(ln,Ht){var Gn;let ar,kn;if(ln.structure){const ur=(null!==(Gn=o.Kx.MaxIndex.get(ln.structure.models[0]).value)&&void 0!==Gn?Gn:-1)+1,sr=(0,d.S)(ur,Ht);kn=sr.legend,ar=Jn=>o.iZ.Location.is(Jn)?sr.color(o.Kx.Index.get(Jn.unit.model).value||0):o.gn.isLocation(Jn)?sr.color(o.Kx.Index.get(Jn.aUnit.model).value||0):Be}else ar=()=>Be;return{factory:we,granularity:"instance",color:ar,props:Ht,description:Ce,legend:kn}}const Oe={name:"model-index",label:"Model Index",category:y.N.Chain,factory:we,getParams:function ke(ln){return t.t.clone(Re)},defaultValues:t.t.getDefaultValues(Re),isApplicable:ln=>!!ln.structure&&ln.structure.elementCount>0},Se=(0,e.Q1)(13421772),Ve="Gives every structure a unique color based on its index.",Ne={...(0,d.U)({type:"colors",colorList:"many-distinct"})};function ne(ln,Ht){var Gn;let ar,kn;if(ln.structure){const ur=(null!==(Gn=o.oE.MaxIndex.get(ln.structure).value)&&void 0!==Gn?Gn:-1)+1,sr=(0,d.S)(ur,Ht);kn=sr.legend,ar=Jn=>o.iZ.Location.is(Jn)?sr.color(o.oE.Index.get(Jn.structure).value||0):o.gn.isLocation(Jn)?sr.color(o.oE.Index.get(Jn.aStructure).value||0):Se}else ar=()=>Se;return{factory:ne,granularity:"instance",color:ar,props:Ht,description:Ve,legend:kn}}const be={name:"structure-index",label:"Structure Index",category:y.N.Chain,factory:ne,getParams:function K(ln){return t.t.clone(Ne)},defaultValues:t.t.getDefaultValues(Ne),isApplicable:ln=>!!ln.structure&&ln.structure.elementCount>0},Te="dark-2",ie=(0,e.Q1)(13421772),ue="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.",re={...(0,d.U)({type:"colors",colorList:Te})};function ce(ln,Ht){let Gn,ar;if(ln.structure){const{units:kn}=ln.structure.root,ur=(0,d.S)(kn.length,Ht);ar=ur.legend;const sr=new Map;for(let Jn=0,Br=kn.length;Jno.iZ.Location.is(Jn)?sr.get(Jn.unit.id):o.gn.isLocation(Jn)?sr.get(Jn.aUnit.id):ie}else Gn=()=>ie;return{factory:ce,granularity:"instance",color:Gn,props:Ht,description:ue,legend:ar}}const se={name:"unit-index",label:"Chain Instance",category:y.N.Chain,factory:ce,getParams:function ve(ln){const Ht=t.t.clone(re);return ln.structure&&ln.structure.root.units.length>W.VI[Te].list.length&&(Ht.palette.defaultValue.name="colors",Ht.palette.defaultValue.params={...Ht.palette.defaultValue.params,list:{kind:"interpolate",colors:(0,W.JA)(Te).list}}),Ht},defaultValues:t.t.getDefaultValues(re),isApplicable:ln=>!!ln.structure},ae=(0,e._j)({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}),ge=(0,e.Q1)(16777215),Le={carbonColor:t.t.MappedStatic("chain-id",{"chain-id":t.t.Group(m.t4),"unit-index":t.t.Group(re,{label:"Chain Instance"}),"entity-id":t.t.Group(Q),"entity-source":t.t.Group(Z),"operator-name":t.t.Group(E.qg),"model-index":t.t.Group(Re),"structure-index":t.t.Group(Ne),uniform:t.t.Group(M.vz),"element-symbol":t.t.EmptyGroup()},{description:"Use chain-id coloring for carbon atoms."}),saturation:t.t.Numeric(0,{min:-6,max:6,step:.1}),lightness:t.t.Numeric(.2,{min:-6,max:6,step:.1}),colors:t.t.MappedStatic("default",{default:t.t.EmptyGroup(),custom:t.t.Group(p(ae))})};function Je(ln,Ht){var Gn;const ar=(0,R.Ak)("default"===Ht.colors.name?ae:Ht.colors.params,Ht.saturation,Ht.lightness),kn=null===(Gn=function Lt(ln,Ht){switch(Ht.name){case"chain-id":return(0,m.Zv)(ln,Ht.params);case"unit-index":return ce(ln,Ht.params);case"entity-id":return k(ln,Ht.params);case"entity-source":return le(ln,Ht.params);case"operator-name":return(0,E.ci)(ln,Ht.params);case"model-index":return we(ln,Ht.params);case"structure-index":return ne(ln,Ht.params);case"uniform":return(0,M.TA)(ln,Ht.params);case"element-symbol":return;default:(0,$.dr)(Ht)}}(ln,Ht.carbonColor))||void 0===Gn?void 0:Gn.color;function ur(Br,st){return kn&&"C"===Br?kn(st,!1):function je(ln,Ht){const Gn=ln[Ht];return void 0===Gn?ge:Gn}(ar,Br)}return{factory:Je,granularity:"operator-name"===Ht.carbonColor.name||"unit-index"===Ht.carbonColor.name?"groupInstance":"group",preferSmoothing:!0,color:function sr(Br){if(o.iZ.Location.is(Br)){if(o.Nf.isAtomic(Br.unit)){const{type_symbol:st}=Br.unit.model.atomicHierarchy.atoms;return ur(st.value(Br.element),Br)}}else if(o.gn.isLocation(Br)&&o.Nf.isAtomic(Br.aUnit)){const{type_symbol:st}=Br.aUnit.model.atomicHierarchy.atoms;return ur(st.value(Br.aUnit.elements[Br.aIndex]),Br)}return ge},props:Ht,description:"Assigns a color to every atom according to its chemical element.",legend:(0,A.h)(Object.keys(ar).map(Br=>[Br,ar[Br]]))}}const en={name:"element-symbol",label:"Element Symbol",category:y.N.Atom,factory:Je,getParams:function nt(ln){return t.t.clone(Le)},defaultValues:t.t.getDefaultValues(Le),isApplicable:ln=>!!ln.structure};var Bt=n(2789);const pn=(0,e._j)({water:3697840,ion:15729279,protein:12496596,RNA:16629894,DNA:12540695,PNA:4367514,saccharide:8374655}),$e=(0,e.Q1)(16777113),_t={saturation:t.t.Numeric(0,{min:-6,max:6,step:.1}),lightness:t.t.Numeric(0,{min:-6,max:6,step:.1}),colors:t.t.MappedStatic("default",{default:t.t.EmptyGroup(),custom:t.t.Group(p(pn))})};function Ke(ln,Ht,Gn){switch((0,Bt.Ju)(Ht,Gn)){case 2:return ln.water;case 3:return ln.ion;case 5:return ln.protein;case 6:return ln.RNA;case 7:return ln.DNA;case 8:return ln.PNA;case 9:return ln.saccharide}return $e}function ut(ln,Ht){const Gn=(0,R.Ak)("default"===Ht.colors.name?pn:Ht.colors.params,Ht.saturation,Ht.lightness);return{factory:ut,granularity:"group",color:function ar(kn){return o.iZ.Location.is(kn)?Ke(Gn,kn.unit,kn.element):o.gn.isLocation(kn)?Ke(Gn,kn.aUnit,kn.aUnit.elements[kn.aIndex]):$e},props:Ht,description:"Assigns a color based on the molecule type of a residue.",legend:(0,A.h)(Object.keys(Gn).map(kn=>[kn,Gn[kn]]).concat([["Other/unknown",$e]]))}}const Kt={name:"molecule-type",label:"Molecule Type",category:y.N.Residue,factory:ut,getParams:function Me(ln){return _t},defaultValues:t.t.getDefaultValues(_t),isApplicable:ln=>!!ln.structure},sn="dark-2",gt=(0,e.Q1)(16448250),At={...(0,d.U)({type:"colors",colorList:sn})};function rn(ln){switch(ln.kind){case 0:return o.StructureProperties.chain.label_asym_id;case 1:case 2:return o.StructureProperties.coarse.asym_id}}function tt(ln){const Ht=new Map;for(let Gn=0,ar=ln.unitSymmetryGroups.length;Gnsr[st]});ar=Br.legend,Gn=st=>{let et;if(o.iZ.Location.is(st)){const at=rn(st.unit);et=ur.get(at(st))}else if(o.gn.isLocation(st)){const at=rn(st.aUnit);kn.unit=st.aUnit,kn.element=st.aUnit.elements[st.aIndex],et=ur.get(at(kn))}return void 0===et?gt:Br.color(et)}}else Gn=()=>gt;return{factory:Mt,granularity:"group",color:Gn,props:Ht,description:"Gives every polymer chain a color based on its `asym_id` value.",legend:ar}},getParams:function Gt(ln){const Ht=t.t.clone(At);return ln.structure&&tt(ln.structure.root).size>W.VI[sn].list.length&&(Ht.palette.defaultValue.name="colors",Ht.palette.defaultValue.params={...Ht.palette.defaultValue.params,list:{kind:"interpolate",colors:(0,W.JA)(sn).list}}),Ht},defaultValues:t.t.getDefaultValues(At),isApplicable:ln=>!!ln.structure},bn="dark-2",Dn=(0,e.Q1)(13421772),It={...(0,d.U)({type:"colors",colorList:bn})};function Ct(ln){let Ht=0;const{units:Gn}=ln;for(let ar=0,kn=Gn.length;ar0&&++Ht;return Ht}const Vt={name:"polymer-index",label:"Polymer Chain Instance",category:y.N.Chain,factory:function $t(ln,Ht){let Gn,ar;if(ln.structure){const kn=(0,d.S)(Ct(ln.structure.root),Ht);ar=kn.legend;const{units:ur}=ln.structure.root,sr=new Map;for(let Jn=0,Br=0,st=ur.length;Jn0&&(sr.set(ur[Jn].id,kn.color(Br)),++Br);Gn=Jn=>{let Br;return o.iZ.Location.is(Jn)?Br=sr.get(Jn.unit.id):o.gn.isLocation(Jn)&&(Br=sr.get(Jn.aUnit.id)),void 0!==Br?Br:Dn}}else Gn=()=>Dn;return{factory:$t,granularity:"instance",color:Gn,props:Ht,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:ar}},getParams:function Dt(ln){const Ht=t.t.clone(It);return ln.structure&&Ct(ln.structure.root)>W.VI[bn].list.length&&(Ht.palette.defaultValue.name="colors",Ht.palette.defaultValue.params={...Ht.palette.defaultValue.params,list:{kind:"interpolate",colors:(0,W.JA)(bn).list}}),Ht},defaultValues:t.t.getDefaultValues(It),isApplicable:ln=>!!ln.structure},Wt=(0,e._j)({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}),yn=(0,e.Q1)(16711935),kt={saturation:t.t.Numeric(0,{min:-6,max:6,step:.1}),lightness:t.t.Numeric(1,{min:-6,max:6,step:.1}),colors:t.t.MappedStatic("default",{default:t.t.EmptyGroup(),custom:t.t.Group(p(Wt))})};function An(ln,Ht){return ln.model.atomicHierarchy.atoms.label_comp_id.value(Ht)}function jn(ln,Ht){const Gn=ln.coarseElements.seq_id_begin.value(Ht);if(Gn===ln.coarseElements.seq_id_end.value(Ht))return ln.model.sequence.byEntityKey[ln.coarseElements.entityKey[Ht]].sequence.compId.value(Gn-1)}function On(ln,Ht){const Gn=ln[Ht];return void 0===Gn?yn:Gn}function fr(ln,Ht){const Gn=(0,R.Ak)("default"===Ht.colors.name?Wt:Ht.colors.params,Ht.saturation,Ht.lightness);return{factory:fr,granularity:"group",preferSmoothing:!0,color:function ar(kn){if(o.iZ.Location.is(kn)){if(o.Nf.isAtomic(kn.unit)){const ur=An(kn.unit,kn.element);return On(Gn,ur)}{const ur=jn(kn.unit,kn.element);if(ur)return On(Gn,ur)}}else if(o.gn.isLocation(kn)){if(o.Nf.isAtomic(kn.aUnit)){const ur=An(kn.aUnit,kn.aUnit.elements[kn.aIndex]);return On(Gn,ur)}{const ur=jn(kn.aUnit,kn.aUnit.elements[kn.aIndex]);if(ur)return On(Gn,ur)}}return yn},props:Ht,description:"Assigns a color to every residue according to its name.",legend:(0,A.h)(Object.keys(Gn).map(kn=>[kn,Gn[kn]]).concat([["Unknown",yn]]))}}const Dr={name:"residue-name",label:"Residue Name",category:y.N.Residue,factory:fr,getParams:function Ot(ln){return kt},defaultValues:t.t.getDefaultValues(kt),isApplicable:ln=>!!ln.structure};var Pr=n(2434),or=n(8699),Nr=n(8382);const Ir=(0,e._j)({alphaHelix:16711808,threeTenHelix:10485888,piHelix:6291584,betaTurn:6324479,betaStrand:16762880,coil:16777215,bend:6740169,turn:45670,dna:11403518,rna:16580962,carbohydrate:10921722}),Or=(0,e.Q1)(8421504),To={saturation:t.t.Numeric(-1,{min:-6,max:6,step:.1}),lightness:t.t.Numeric(0,{min:-6,max:6,step:.1}),colors:t.t.MappedStatic("default",{default:t.t.EmptyGroup(),custom:t.t.Group(p(Ir))})};function ct(ln,Ht,Gn,ar){let kn=Pr.gG.create(0);if(ar&&o.Nf.isAtomic(Ht)){const ur=ar.get(Ht.invariantId);ur&&(kn=ur.type[ur.getIndex(Ht.residueIndex[Gn])])}if(Pr.gG.is(kn,2))return Pr.gG.is(kn,2048)?ln.threeTenHelix:Pr.gG.is(kn,32768)?ln.piHelix:ln.alphaHelix;if(Pr.gG.is(kn,4))return ln.betaStrand;if(Pr.gG.is(kn,8))return ln.bend;if(Pr.gG.is(kn,16))return ln.turn;{const ur=(0,Bt.Ju)(Ht,Gn);if(7===ur)return ln.dna;if(6===ur)return ln.rna;if(9===ur)return ln.carbohydrate;if(5===ur)return ln.coil}return Or}function dt(ln,Ht){const Gn=ln.structure&&or.v.get(ln.structure),ar=Gn?(0,Nr.vb)(Gn.id,Gn.version):-1,kn=(0,R.Ak)("default"===Ht.colors.name?Ir:Ht.colors.params,Ht.saturation,Ht.lightness);return{factory:dt,granularity:"group",preferSmoothing:!0,color:function ur(sr){return o.iZ.Location.is(sr)?ct(kn,sr.unit,sr.element,Gn?.value):o.gn.isLocation(sr)?ct(kn,sr.aUnit,sr.aUnit.elements[sr.aIndex],Gn?.value):Or},props:Ht,contextHash:ar,description:"Assigns a color based on the type of secondary structure and basic molecule type.",legend:(0,A.h)(Object.keys(kn).map(sr=>[sr,kn[sr]]).concat([["Other",Or]]))}}const Yt={name:"secondary-structure",label:"Secondary Structure",category:y.N.Residue,factory:dt,getParams:function un(ln){return To},defaultValues:t.t.getDefaultValues(To),isApplicable:ln=>!!ln.structure,ensureCustomProperties:{attach:(ln,Ht)=>Ht.structure?or.v.attach(ln,Ht.structure,void 0,!0):Promise.resolve(),detach:ln=>ln.structure&&or.v.ref(ln.structure,!1)}},cn=(0,e.Q1)(13421772),Rn={list:t.t.ColorList("turbo",{presetKind:"scale"})};function ir(ln,Ht){const{model:Gn}=ln;switch(ln.kind){case 0:return Gn.atomicHierarchy.residues.label_seq_id.value(Gn.atomicHierarchy.residueAtomSegments.index[Ht]);case 1:return Math.round((Gn.coarseHierarchy.spheres.seq_id_begin.value(Ht)+Gn.coarseHierarchy.spheres.seq_id_end.value(Ht))/2);case 2:return Math.round((Gn.coarseHierarchy.gaussians.seq_id_begin.value(Ht)+Gn.coarseHierarchy.gaussians.seq_id_end.value(Ht))/2)}}function Yn(ln,Ht){const{model:Gn}=ln;let ar="";switch(ln.kind){case 0:ar=Gn.atomicHierarchy.chains.label_entity_id.value(Gn.atomicHierarchy.chainAtomSegments.index[Ht]);break;case 1:ar=Gn.coarseHierarchy.spheres.entity_id.value(Ht);break;case 2:ar=Gn.coarseHierarchy.gaussians.entity_id.value(Ht)}if(""===ar)return 0;const kn=Gn.entities.getEntityIndex(ar);if(-1===kn)return 0;const ur=Gn.sequence.byEntityKey[kn];return void 0===ur?0:ur.sequence.length}const vr={name:"sequence-id",label:"Sequence Id",category:y.N.Residue,factory:function br(ln,Ht){const Gn=e.wC.create({listOrName:Ht.list.colors,minLabel:"Start",maxLabel:"End"});return{factory:br,granularity:"group",preferSmoothing:!0,color:kn=>{if(o.iZ.Location.is(kn)){const{unit:ur,element:sr}=kn,Jn=ir(ur,sr);if(Jn>0){const Br=Yn(ur,sr);if(Br)return Gn.setDomain(0,Br-1),Gn.color(Jn)}}else if(o.gn.isLocation(kn)){const{aUnit:ur,aIndex:sr}=kn,Jn=ir(ur,ur.elements[sr]);if(Jn>0){const Br=Yn(ur,ur.elements[sr]);if(Br)return Gn.setDomain(0,Br-1),Gn.color(Jn)}}return cn},props:Ht,description:"Gives every polymer residue a color based on its `seq_id` value.",legend:Gn?Gn.legend:void 0}},getParams:function er(ln){return Rn},defaultValues:t.t.getDefaultValues(Rn),isApplicable:ln=>!!ln.structure};var Hr=n(2476);const Mr=(0,e.Q1)(16777113),Sr={domain:t.t.Interval([0,100]),list:t.t.ColorList("red-white-blue",{presetKind:"scale"})};function Ro(ln,Ht){return o.Nf.isAtomic(ln)?ln.model.atomicConformation.B_iso_or_equiv.value(Ht):o.Nf.isSpheres(ln)?ln.model.coarseConformation.spheres.rmsf[Ht]:0}const po={name:"uncertainty",label:"Uncertainty/Disorder",category:y.N.Atom,factory:function ro(ln,Ht){const Gn=e.wC.create({reverse:!0,domain:Ht.domain,listOrName:Ht.list.colors});return{factory:ro,granularity:"group",preferSmoothing:!0,color:function ar(kn){return o.iZ.Location.is(kn)?Gn.color(Ro(kn.unit,kn.element)):o.gn.isLocation(kn)?Gn.color(Ro(kn.aUnit,kn.aUnit.elements[kn.aIndex])):Mr},props:Ht,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:Gn?Gn.legend:void 0}},getParams:function Ur(ln){return Sr},defaultValues:t.t.getDefaultValues(Sr),isApplicable:ln=>!!ln.structure&&ln.structure.models.some(Ht=>Ht.atomicConformation.B_iso_or_equiv.isDefined||Ht.coarseHierarchy.isDefined)},so=(0,e.Q1)(15658734),Bo={style:t.t.MappedStatic("entity-id",{uniform:t.t.Group(M.vz),"chain-id":t.t.Group(m.t4),"entity-id":t.t.Group(Q),"entity-source":t.t.Group(Z),"molecule-type":t.t.Group(_t),"model-index":t.t.Group(Re),"structure-index":t.t.Group(Ne)}),carbonLightness:t.t.Numeric(.8,{min:-6,max:6,step:.1})},Pt={name:"illustrative",label:"Illustrative",category:y.N.Misc,factory:function We(ln,Ht){const{color:Gn,legend:ar}=function Wo(ln,Ht){switch(Ht.name){case"uniform":return(0,M.TA)(ln,Ht.params);case"chain-id":return(0,m.Zv)(ln,Ht.params);case"entity-id":return k(ln,Ht.params);case"entity-source":return le(ln,Ht.params);case"molecule-type":return ut(0,Ht.params);case"model-index":return we(ln,Ht.params);case"structure-index":return ne(ln,Ht.params);default:(0,$.dr)(Ht)}}(ln,Ht.style);function kn(sr,Jn){const Br=Gn(sr,!1);return"C"===Jn?e.Q1.lighten(Br,Ht.carbonLightness):Br}return{factory:We,granularity:"group",preferSmoothing:!0,color:function ur(sr){if(o.iZ.Location.is(sr)&&o.Nf.isAtomic(sr.unit)){const Jn=sr.unit.model.atomicHierarchy.atoms.type_symbol.value(sr.element);return kn(sr,Jn)}if(o.gn.isLocation(sr)&&o.Nf.isAtomic(sr.aUnit)){const Br=sr.aUnit.model.atomicHierarchy.atoms.type_symbol.value(sr.aUnit.elements[sr.aIndex]);return kn(sr,Br)}return so},props:Ht,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:ar}},getParams:function Go(ln){return t.t.clone(Bo)},defaultValues:t.t.getDefaultValues(Bo),isApplicable:ln=>!!ln.structure},Nn={list:t.t.ColorList("red-yellow-green",{presetKind:"scale"}),scale:t.t.Select("DGwif",[["DGwif","DG water-membrane"],["DGwoct","DG water-octanol"],["Oct-IF","DG difference"]])},dr={DGwif:0,DGwoct:1,"Oct-IF":2};function Ft(ln,Ht){return ln.model.atomicHierarchy.atoms.label_comp_id.value(Ht)}function Qt(ln,Ht){const Gn=ln.coarseElements.seq_id_begin.value(Ht);if(Gn===ln.coarseElements.seq_id_end.value(Ht))return ln.model.sequence.byEntityKey[ln.coarseElements.entityKey[Ht]].sequence.compId.value(Gn-1)}const pt={name:"hydrophobicity",label:"Hydrophobicity",category:y.N.Residue,factory:function ht(ln,Ht){const Gn=dr[Ht.scale];let ar=1/0,kn=-1/0;for(const Jn in Pr.Xk){const Br=Pr.Xk[Jn][Gn];ar=Math.min(ar,Br),kn=Math.max(kn,Br)}const ur=e.wC.create({listOrName:Ht.list.colors,domain:[kn,ar],minLabel:"Hydrophilic",maxLabel:"Hydrophobic"});return{factory:ht,granularity:"group",preferSmoothing:!0,color:function sr(Jn){let Br;return o.iZ.Location.is(Jn)?Br=o.Nf.isAtomic(Jn.unit)?Ft(Jn.unit,Jn.element):Qt(Jn.unit,Jn.element):o.gn.isLocation(Jn)&&(Br=o.Nf.isAtomic(Jn.aUnit)?Ft(Jn.aUnit,Jn.aUnit.elements[Jn.aIndex]):Qt(Jn.aUnit,Jn.aUnit.elements[Jn.aIndex])),ur.color(Br?function xr(ln,Ht){const Gn=Pr.Xk[ln];return void 0===Gn?0:Gn[Ht]}(Br,Gn):0)},props:Ht,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:ur?ur.legend:void 0}},getParams:function Kn(ln){return Nn},defaultValues:t.t.getDefaultValues(Nn),isApplicable:ln=>!!ln.structure},Xt=(0,e.Q1)(13421772),on={...(0,d.U)({type:"colors",colorList:"purples"})},Fe={name:"trajectory-index",label:"Trajectory Index",category:y.N.Chain,factory:function Tt(ln,Ht){var Gn,ar;let kn,ur;if(ln.structure){const{models:sr}=ln.structure.root;let Jn=0;for(const et of sr)Jn=Math.max(Jn,(null===(Gn=o.Kx.TrajectoryInfo.get(et))||void 0===Gn?void 0:Gn.size)||0);const Br=(0,d.S)(Jn,Ht);ur=Br.legend;const st=new Map;for(let et=0,at=sr.length;eto.iZ.Location.is(et)?st.get(o.Kx.TrajectoryInfo.get(et.unit.model).index):o.gn.isLocation(et)?st.get(o.Kx.TrajectoryInfo.get(et.aUnit.model).index):Xt}else kn=()=>Xt;return{factory:Tt,granularity:"instance",color:kn,props:Ht,description:"Gives every model (frame) a unique color based on the index in its trajectory.",legend:ur}},getParams:function En(ln){return t.t.clone(on)},defaultValues:t.t.getDefaultValues(on),isApplicable:ln=>!!ln.structure&&ln.structure.elementCount>0&&o.Kx.TrajectoryInfo.get(ln.structure.models[0]).size>1},He=(0,e.Q1)(13421772),ot={domain:t.t.Interval([0,1]),list:t.t.ColorList("purples",{presetKind:"scale"})};function St(ln,Ht){return o.Nf.isAtomic(ln)?ln.model.atomicConformation.occupancy.value(Ht):0}const mn={name:"occupancy",label:"Occupancy",category:y.N.Atom,factory:function vt(ln,Ht){const Gn=e.wC.create({reverse:!1,domain:Ht.domain,listOrName:Ht.list.colors});return{factory:vt,granularity:"group",preferSmoothing:!0,color:function ar(kn){return o.iZ.Location.is(kn)?Gn.color(St(kn.unit,kn.element)):o.gn.isLocation(kn)?Gn.color(St(kn.aUnit,kn.aUnit.elements[kn.aIndex])):He},props:Ht,description:"Assigns a color based on the occupancy of an atom.",legend:Gn?Gn.legend:void 0}},getParams:function rt(ln){return ot},defaultValues:t.t.getDefaultValues(ot),isApplicable:ln=>!!ln.structure&&ln.structure.models.some(Ht=>Ht.atomicConformation.occupancy.isDefined)};var zt=n(4369);const an="dark-2",Vn=(0,e.Q1)(13421772),rr={...(0,d.U)({type:"colors",colorList:an})},tr=1e4;function Tr(ln){return ln.map(Ht=>`${Ht+tr}`.padStart(5,"0")).join("")}function oo(ln){const Ht=(0,J.bL)(tr,0),Gn=parseInt(ln.substr(0,Ht)),ar=parseInt(ln.substr(Ht,Ht)),kn=parseInt(ln.substr(Ht+Ht,Ht));return zt.eB.create(Gn-tr,ar-tr,kn-tr)}function Gr(ln){return ln.map(Ht=>Ht+5).join("")}function Ao(ln){const Ht=new Map,Gn=new Set;for(let sr=0,Jn=ln.units.length;srHt.set(sr,Ht.size)),{min:oo(ar[0]),max:oo(ar[ar.length-1]),map:Ht}}const vo={name:"operator-hkl",label:"Operator HKL",category:y.N.Symmetry,factory:function yo(ln,Ht){let Gn,ar;if(ln.structure){const{min:kn,max:ur,map:sr}=Ao(ln.structure.root),Jn=[];sr.forEach((et,at)=>{const Et=et%sr.size,Nt=Gr(oo(at));void 0===Jn[Et]?Jn[Et]=Nt:Jn[Et]+=`, ${Nt}`});const Br={minLabel:Gr(kn),maxLabel:Gr(ur),valueLabel:et=>Jn[et]},st=(0,d.S)(sr.size,Ht,Br);ar=st.legend,Gn=et=>{let at;if(o.iZ.Location.is(et)){const Et=Tr(et.unit.conformation.operator.hkl);at=sr.get(Et)}else if(o.gn.isLocation(et)){const Et=Tr(et.aUnit.conformation.operator.hkl);at=sr.get(Et)}return void 0===at?Vn:st.color(at)}}else Gn=()=>Vn;return{factory:yo,granularity:"instance",color:Gn,props:Ht,description:"Assigns a color based on the operator HKL value of a transformed chain.",legend:ar}},getParams:function Vr(ln){const Ht=t.t.clone(rr);return ln.structure&&Ao(ln.structure.root).map.size>W.VI[an].list.length&&(Ht.palette.defaultValue.name="colors",Ht.palette.defaultValue.params={...Ht.palette.defaultValue.params,list:{kind:"interpolate",colors:(0,W.JA)(an).list}}),Ht},defaultValues:t.t.getDefaultValues(rr),isApplicable:ln=>!!ln.structure};var Kr=n(4366);const Do=(0,e.Q1)(16777113),So={domain:t.t.Interval([-1,1]),list:t.t.ColorList("red-white-blue",{presetKind:"scale"})};function Po(ln,Ht){var Gn;return null===(Gn=Kr.j.Provider.get(ln.model))||void 0===Gn?void 0:Gn.data.value(Ht)}const jr={name:"partial-charge",label:"Partial Charge",category:y.N.Atom,factory:function Yr(ln,Ht){const Gn=e.wC.create({domain:Ht.domain,listOrName:Ht.list.colors});return{factory:Yr,granularity:"group",preferSmoothing:!0,color:function ar(kn){if(o.iZ.Location.is(kn)){const ur=Po(kn.unit,kn.element);return void 0!==ur?Gn.color(ur):Do}if(o.gn.isLocation(kn)){const ur=Po(kn.aUnit,kn.aUnit.elements[kn.aIndex]);return void 0!==ur?Gn.color(ur):Do}return Do},props:Ht,description:"Assigns a color based on the partial charge of an atom.",legend:Gn?Gn.legend:void 0}},getParams:function ao(ln){return So},defaultValues:t.t.getDefaultValues(So),isApplicable:ln=>!!ln.structure&&ln.structure.models.some(Ht=>void 0!==Kr.j.Provider.get(Ht))},Eo=(0,e.Q1)(16448250),ei={...(0,d.U)({type:"colors",colorList:"many-distinct"})},Fi={name:"atom-id",label:"Atom Id",category:y.N.Atom,factory:function Jo(ln,Ht){let Gn,ar;if(ln.structure){const kn=o.iZ.Location.create(ln.structure.root),ur=function ci(ln){const Ht=new Map;for(const Gn of ln.models){const{label_atom_id:ar}=Gn.atomicHierarchy.atoms;for(let kn=0,ur=ar.rowCount;knsr[st]});ar=Br.legend,Gn=st=>{let et;if(o.iZ.Location.is(st)){const at=o.StructureProperties.atom.label_atom_id(st);et=ur.get(at)}else if(o.gn.isLocation(st)){kn.unit=st.aUnit,kn.element=st.aUnit.elements[st.aIndex];const at=o.StructureProperties.atom.label_atom_id(kn);et=ur.get(at)}return void 0===et?Eo:Br.color(et)}}else Gn=()=>Eo;return{factory:Jo,granularity:"group",preferSmoothing:!0,color:Gn,props:Ht,description:"Gives every atom a color based on its `label_atom_id` value.",legend:ar}},getParams:function Yo(ln){return t.t.clone(ei)},defaultValues:t.t.getDefaultValues(ei),isApplicable:ln=>!!ln.structure};var hi=n(2745),No=n(3162);const mi={colorList:t.t.ColorList({kind:"interpolate",colors:[[hi.s.white,0],[hi.s.red,.25],[hi.s.white,.5],[hi.s.blue,.75],[hi.s.white,1]]},{offsets:!0,isEssential:!0})},ti={name:"volume-value",label:"Volume Value",category:y.N.Misc,factory:function Oi(ln,Ht){const Gn=e.wC.create({domain:[0,1],listOrName:Ht.colorList.colors}),ar=[];for(let ur=0;ur<256;++ur)ar[ur]=Gn.color(ur/255);return{factory:Oi,granularity:"direct",props:Ht,description:"Assign color based on the given value of a volume cell.",legend:Gn.legend,palette:{colors:ar,filter:"linear"}}},getParams:function qi(ln){return mi},defaultValues:t.t.getDefaultValues(mi),isApplicable:ln=>!!ln.volume&&!No.f.Segmentation.get(ln.volume)},es=(0,e.Q1)(13421772),Pi={...(0,d.U)({type:"colors",colorList:"many-distinct"})},Wi={name:"volume-segment",label:"Volume Segment",category:y.N.Misc,factory:function gi(ln,Ht){let Gn,ar;const kn=ln.volume&&No.f.Segmentation.get(ln.volume);if(kn){const ur=kn.segments.size,sr=Array.from(kn.segments.keys()),Jn=(0,d.S)(ur,Ht);ar=Jn.legend,Gn=Br=>No.f.Segment.isLocation(Br)?Jn.color(sr.indexOf(Br.segment)):es}else Gn=()=>es;return{factory:gi,granularity:"instance",color:Gn,props:Ht,description:"Gives every volume segment a unique color.",legend:ar}},getParams:function ni(ln){return t.t.clone(Pi)},defaultValues:t.t.getDefaultValues(Pi),isApplicable:ln=>!!ln.volume&&!!No.f.Segmentation.get(ln.volume)};var Ri=n(6853),Qi=n(1888),Hn=n(127);const co={volume:t.t.ValueRef(ln=>ln.state.data.selectQ(Gn=>Gn.root.subtree().filter(ar=>{var kn;return Ri.f.is(null===(kn=ar.obj)||void 0===kn?void 0:kn.data)})).map(Gn=>{var ar,kn;return[Gn.transform.ref,null!==(kn=null===(ar=Gn.obj)||void 0===ar?void 0:ar.label)&&void 0!==kn?kn:""]}),(ln,Ht)=>Ht(ln)),coloring:t.t.MappedStatic("absolute-value",{"absolute-value":t.t.Group({domain:t.t.MappedStatic("auto",{custom:t.t.Interval([-1,1]),auto:t.t.Group({symmetric:t.t.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:t.t.ColorList("red-white-blue",{presetKind:"scale"})}),"relative-value":t.t.Group({domain:t.t.MappedStatic("auto",{custom:t.t.Interval([-1,1]),auto:t.t.Group({symmetric:t.t.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:t.t.ColorList("red-white-blue",{presetKind:"scale"})})}),defaultColor:t.t.Color((0,e.Q1)(13421772)),normalOffset:t.t.Numeric(0,{min:0,max:20,step:.1},{description:"Offset vertex position along its normal by given amount."})},lr={name:"external-volume",label:"External Volume",category:y.N.Misc,factory:function zr(ln,Ht){let Gn,ar;try{Gn=Ht.volume.getValue()}catch{}if(Gn){const kn=Ht.coloring.params,{stats:ur}=Gn.grid,sr="custom"===kn.domain.name?kn.domain.params:[ur.min,ur.max],Jn="relative-value"===Ht.coloring.name;if("auto"===kn.domain.name&&Jn&&(sr[0]=(sr[0]-ur.mean)/ur.sigma,sr[1]=(sr[1]-ur.mean)/ur.sigma),"auto"===Ht.coloring.params.domain.name&&Ht.coloring.params.domain.params.symmetric){const vn=Math.max(Math.abs(sr[0]),Math.abs(sr[1]));sr[0]=-vn,sr[1]=vn}const Br=e.wC.create({domain:sr,listOrName:kn.list.colors}),st=Ri.x.getGridToCartesianTransform(Gn.grid);zt.$I.invert(st,st);const et=(0,zt.eB)(),{dimensions:at,get:Et}=Gn.grid.cells.space,Nt=Gn.grid.cells.data,[qt,Cn,Un]=at;ar=vn=>{if(!(0,Qi.ZC)(vn))return Ht.defaultColor;zt.eB.copy(et,vn.position),Ht.normalOffset>0&&zt.eB.scaleAndAdd(et,et,vn.normal,Ht.normalOffset),zt.eB.transformMat4(et,et,st);const nr=Math.floor(et[0]),pr=Math.floor(et[1]),Rr=Math.floor(et[2]);if(nr<0||nr>=qt||pr<0||pr>=Cn||Rr<0||Rr>=Un)return Ht.defaultColor;const mo=et[0]-nr,Uo=et[1]-pr,qo=et[2]-Rr,ri=Math.min(nr+1,qt-1),fo=Math.min(pr+1,Cn-1),Lo=Math.min(Rr+1,Un-1);let Ni=Et(Nt,nr,pr,Rr),rs=Et(Nt,ri,pr,Rr),Gi=Et(Nt,nr,fo,Rr),_o=Et(Nt,ri,fo,Rr);const hr=(0,Hn.Cc)((0,Hn.Cc)(Ni,rs,mo),(0,Hn.Cc)(Gi,_o,mo),Uo);Ni=Et(Nt,nr,pr,Lo),rs=Et(Nt,ri,pr,Lo),Gi=Et(Nt,nr,fo,Lo),_o=Et(Nt,ri,fo,Lo);const Wr=(0,Hn.Cc)((0,Hn.Cc)(Ni,rs,mo),(0,Hn.Cc)(Gi,_o,mo),Uo);let no=(0,Hn.Cc)(hr,Wr,qo);return Jn&&(no=(no-ur.mean)/ur.sigma),Br.color(no)}}else ar=()=>Ht.defaultColor;return{factory:zr,granularity:"vertex",preferSmoothing:!0,color:ar,props:Ht,description:"Assigns a color based on volume value at a given vertex."}},getParams:()=>co,defaultValues:t.t.getDefaultValues(co),isApplicable:ln=>!0},Qr={mainchain:t.t.MappedStatic("molecule-type",{uniform:t.t.Group(M.vz),"chain-id":t.t.Group(m.t4),"entity-id":t.t.Group(Q),"entity-source":t.t.Group(Z),"molecule-type":t.t.Group(_t),"model-index":t.t.Group(Re),"structure-index":t.t.Group(Ne),"secondary-structure":t.t.Group(To)}),sidechain:t.t.MappedStatic("residue-name",{uniform:t.t.Group(M.vz),"residue-name":t.t.Group(kt),"element-symbol":t.t.Group(Le)})},bi={name:"cartoon",label:"Cartoon",category:y.N.Misc,factory:function Li(ln,Ht){var Gn,ar;const kn=function Ti(ln,Ht){switch(Ht.name){case"uniform":return(0,M.TA)(ln,Ht.params);case"chain-id":return(0,m.Zv)(ln,Ht.params);case"entity-id":return k(ln,Ht.params);case"entity-source":return le(ln,Ht.params);case"molecule-type":return ut(0,Ht.params);case"model-index":return we(ln,Ht.params);case"structure-index":return ne(ln,Ht.params);case"secondary-structure":return dt(ln,Ht.params);default:(0,$.dr)(Ht)}}(ln,Ht.mainchain),ur=function Bi(ln,Ht){switch(Ht.name){case"uniform":return(0,M.TA)(ln,Ht.params);case"residue-name":return fr(0,Ht.params);case"element-symbol":return Je(ln,Ht.params);default:(0,$.dr)(Ht)}}(ln,Ht.sidechain);let Jn=kn.legend;return"table-legend"===(null===(Gn=kn.legend)||void 0===Gn?void 0:Gn.kind)&&"table-legend"===(null===(ar=ur.legend)||void 0===ar?void 0:ar.kind)&&(Jn={kind:"table-legend",table:[...kn.legend.table,...ur.legend.table]}),{factory:Li,granularity:"group",preferSmoothing:!1,color:function sr(Br,st){return st?kn.color(Br,!1):ur.color(Br,!1)},props:Ht,description:"Uses separate themes for coloring mainchain and sidechain visuals.",legend:Jn}},getParams:function vi(ln){return t.t.clone(Qr)},defaultValues:t.t.getDefaultValues(Qr),isApplicable:ln=>!!ln.structure};var Vi;!function(ln){ln.Category=y.N,ln.PaletteScale=16777215,ln.EmptyFactory=()=>ln.Empty;const Ht=(0,e.Q1)(13421772);ln.Empty={factory:ln.EmptyFactory,granularity:"uniform",color:()=>Ht,props:{}},ln.areEqual=function Gn(kn,ur){return kn.contextHash===ur.contextHash&&kn.factory===ur.factory&&(0,I.bD)(kn.props,ur.props)},ln.EmptyProvider={name:"",label:"",category:"",factory:ln.EmptyFactory,getParams:()=>({}),defaultValues:{},isApplicable:()=>!0},ln.createRegistry=function ar(){return new l.D(ln.BuiltIn,ln.EmptyProvider)},ln.BuiltIn={"atom-id":Fi,"carbohydrate-symbol":_,cartoon:bi,"chain-id":m.oy,"element-index":D,"element-symbol":en,"entity-id":H,"entity-source":Ae,hydrophobicity:pt,illustrative:Pt,"model-index":Oe,"molecule-type":Kt,occupancy:mn,"operator-hkl":vo,"operator-name":E.PO,"partial-charge":jr,"polymer-id":nn,"polymer-index":Vt,"residue-name":Dr,"secondary-structure":Yt,"sequence-id":vr,"shape-group":Hr.AX,"structure-index":be,"trajectory-index":Fe,uncertainty:po,"unit-index":se,uniform:M.Wr,"volume-segment":Wi,"volume-value":ti,"external-volume":lr}}(Vi||(Vi={}))},9983:(tn,Ue,n)=>{"use strict";n.d(Ue,{N:()=>e});const e={Atom:"Atom Property",Chain:"Chain Property",Residue:"Residue Property",Symmetry:"Symmetry",Validation:"Validation",Misc:"Miscellaneous"}},8742:(tn,Ue,n)=>{"use strict";n.d(Ue,{Zv:()=>l,oy:()=>m,t4:()=>v});var e=n(9136),o=n(190),r=n(8277),t=n(7809),A=n(9983);const c=(0,o.Q1)(16448250),i="Gives every chain a color based on its `asym_id` value.",v={asymId:r.t.Select("auth",r.t.arrayToOptions(["auth","label"])),...(0,t.U)({type:"colors",colorList:"many-distinct"})};function _(u,d){const s=function b(u,d){switch(u.kind){case 0:return"auth"===d?e.StructureProperties.chain.auth_asym_id:e.StructureProperties.chain.label_asym_id;case 1:case 2:return e.StructureProperties.coarse.asym_id}}(u.unit,d)(u);return u.structure.root.models.length>1?M(u.unit.model,s):s}function M(u,d){return`${d}|${(e.Kx.Index.get(u).value||0)+1}`}function l(u,d){let s,C;if(u.structure){const h=e.iZ.Location.create(u.structure.root),a=function I(u,d){const s=new Map;for(const C of u.models){const h=e.Kx.AsymIdOffset.get(C).value,a=("auth"===d?h?.auth:h?.label)||0;let S=0;C.properties.structAsymMap.forEach(({auth_id:D},R)=>{const f="auth"===d?D:R,p=u.models.length>1?M(C,f):f;s.has(p)||(s.set(p,S+a),++S)})}return s}(u.structure.root,d.asymId),S=Array.from(a.keys()),R=(0,t.S)(a.size,d,{valueLabel:f=>S[f]});C=R.legend,s=f=>{let p;if(e.iZ.Location.is(f)){const E=_(f,d.asymId);p=a.get(E)}else if(e.gn.isLocation(f)){h.unit=f.aUnit,h.element=f.aUnit.elements[f.aIndex];const E=_(h,d.asymId);p=a.get(E)}return void 0===p?c:R.color(p)}}else s=()=>c;return{factory:l,granularity:"group",color:s,props:d,description:i,legend:C}}const m={name:"chain-id",label:"Chain Id",category:A.N.Chain,factory:l,getParams:function O(u){var d;const s=r.t.clone(v);return!(null===(d=u.structure)||void 0===d)&&d.models.some(C=>C.coarseHierarchy.isDefined)&&(s.asymId.defaultValue="label"),s},defaultValues:r.t.getDefaultValues(v),isApplicable:u=>!!u.structure}},8103:(tn,Ue,n)=>{"use strict";n.d(Ue,{PO:()=>M,ci:()=>_,qg:()=>v});var e=n(190),o=n(9136),r=n(8277),t=n(7809),A=n(9983);const c=(0,e.Q1)(13421772),i="Assigns a color based on the operator name of a transformed chain.",v={...(0,t.U)({type:"colors",colorList:"many-distinct"})};function _(I,l){let m,u;if(I.structure){const d=function b(I){const l=new Map;for(let m=0,u=I.units.length;ms[a]});u=h.legend,m=a=>{let S;return o.iZ.Location.is(a)?S=d.get(a.unit.conformation.operator.name):o.gn.isLocation(a)&&(S=d.get(a.aUnit.conformation.operator.name)),void 0===S?c:h.color(S)}}else m=()=>c;return{factory:_,granularity:"instance",color:m,props:l,description:i,legend:u}}const M={name:"operator-name",label:"Operator Name",category:A.N.Symmetry,factory:_,getParams:function O(I){return r.t.clone(v)},defaultValues:r.t.getDefaultValues(v),isApplicable:I=>!!I.structure}},2476:(tn,Ue,n)=>{"use strict";n.d(Ue,{AX:()=>O,h2:()=>v});var e=n(190),o=n(3558),r=n(8277),t=n(9983);const A=(0,e.Q1)(13421772),y="Assigns colors as defined by the shape object.",c={};function v(b,_){return{factory:v,granularity:"groupInstance",color:M=>o.$.isLocation(M)?M.shape.getColor(M.group,M.instance):A,props:_,description:y}}const O={name:"shape-group",label:"Shape Group",category:t.N.Misc,factory:v,getParams:function i(b){return c},defaultValues:r.t.getDefaultValues(c),isApplicable:b=>!!b.shape}},9347:(tn,Ue,n)=>{"use strict";n.d(Ue,{TA:()=>O,Wr:()=>b,vz:()=>i});var e=n(190),o=n(8277),r=n(2293),t=n(9909),A=n(9983);const y=(0,e.Q1)(13421772),c="Gives everything the same, uniform color.",i={value:o.t.Color(y),saturation:o.t.Numeric(0,{min:-6,max:6,step:.1}),lightness:o.t.Numeric(0,{min:-6,max:6,step:.1})};function O(_,M){let I=(0,t.NT)(M.value,y);return I=e.Q1.saturate(I,M.saturation),I=e.Q1.lighten(I,M.lightness),{factory:O,granularity:"uniform",color:()=>I,props:M,description:c,legend:(0,r.h)([["uniform",I]])}}const b={name:"uniform",label:"Uniform",category:A.N.Misc,factory:O,getParams:function v(_){return i},defaultValues:o.t.getDefaultValues(i),isApplicable:_=>!0}},3488:(tn,Ue,n)=>{"use strict";n.d(Ue,{a:()=>t});var e=n(3246),o=n(9136),r=n(9498);function t(A,y){return{kind:A,layers:y}}!function(A){function c(I){return 0===I.layers.length}A.Empty={kind:"empty-loci",layers:[]},A.areEqual=function y(I,l){if(0===I.layers.length&&0===l.layers.length)return!0;if(I.layers.length!==l.layers.length)return!1;for(let m=0,u=I.layers.length;m{d.push({loci:s,value:C})}),{kind:"element-loci",layers:d}}return I},A.filter=function O(I,l){if(c(I))return I;if("element-loci"===I.kind){const{structure:m}=I.layers[0].loci,u=[];for(const d of I.layers){let{loci:s,value:C}=d;const h=o.iZ.Loci.remap(s,l);s=o.iZ.Loci.remap(h,m),o.iZ.Loci.isEmpty(s)||u.push({loci:s,value:C})}return{kind:"element-loci",layers:u}}return I},A.ofScript=function b(I,l){const m=[];for(let u=0,d=I.length;u{"use strict";n.d(Ue,{BB:()=>s,CR:()=>m,W8:()=>S,YQ:()=>v,d_:()=>M,k0:()=>D,k7:()=>I,kd:()=>R});var e=n(9136),o=n(3246),r=n(3543),t=n(7785),A=n(4369),y=n(4490),c=n(6853);const i={granularity:"element",condensed:!1,reverse:!1,countsOnly:!1,hidePrefix:!1,htmlStyling:!0};function v(f,p={}){var E;switch(f.kind){case"structure-loci":return f.structure.models.map(k=>k.entry).filter(k=>!!k).join(", ");case"element-loci":return M(e.iZ.Stats.ofLoci(f),p);case"bond-loci":const T=f.bonds[0];return T?m(T,p):"";case"shape-loci":return f.shape.name;case"group-loci":const L=f.groups[0];return L?f.shape.getLabel(r.CD.start(L.ids),L.instance):"";case"every-loci":return"Everything";case"empty-loci":return"Nothing";case"data-loci":return f.getLabel();case"volume-loci":return f.volume.label||"Volume";case"isosurface-loci":return[`${f.volume.label||"Volume"}`,`Isosurface at ${c.f.IsoValue.toString(f.isoValue)}`].join(" | ");case"cell-loci":const w=r.CD.size(f.indices),Q=r.CD.start(f.indices),G=c.f.IsoValue.absolute(f.volume.grid.cells.data[Q]),V=c.f.IsoValue.toRelative(G,f.volume.grid.stats),U=[`${f.volume.label||"Volume"}`,1===w?`Cell #${Q}`:`${w} Cells`];return 1===w&&U.push(`${c.f.IsoValue.toString(G)} (${c.f.IsoValue.toString(V)})`),U.join(" | ");case"segment-loci":const N=null===(E=c.f.Segmentation.get(f.volume))||void 0===E?void 0:E.labels;if(N&&1===f.segments.length){const k=N[f.segments[0]];if(k)return k}return[`${f.volume.label||"Volume"}`,1===f.segments.length?`Segment ${f.segments[0]}`:`${f.segments.length} Segments`].join(" | ")}}function O(f,p){return 1===f?`1 ${p}`:`${f} ${p}s`}function b(f,p,E,T,L,w){return`${s(p,{granularity:E,hidePrefix:T,reverse:L,condensed:w})} [+ ${O(f-1,`other ${(0,t.ZH)(E)}`)}]`}function M(f,p={}){const E={...i,...p},T=function l(f,p=!1,E=!1,T=!1,L=!1){const{structureCount:w,chainCount:Q,residueCount:G,conformationCount:V,elementCount:U}=f;if(!p&&1===U&&0===G&&0===Q)return s(f.firstElementLoc,{hidePrefix:E,condensed:T,granularity:"element",reverse:L});if(!p&&0===U&&1===G&&0===Q)return s(f.firstResidueLoc,{hidePrefix:E,condensed:T,granularity:"residue",reverse:L});if(p||0!==U||0!==G||1!==Q){if(p){const N=[];return w>0&&N.push(O(w,"Structure")),Q>0&&N.push(O(Q,"Chain")),G>0&&N.push(O(G,"Residue")),V>0&&N.push(O(V,"Conformation")),U>0&&N.push(O(U,"Element")),N.join(" + ")}{const N=[];return w>0&&N.push(1===w?s(f.firstStructureLoc,{hidePrefix:E,condensed:T,granularity:"structure",reverse:L}):b(w,f.firstStructureLoc,"structure",E,L,T)),Q>0&&(N.push(1===Q?s(f.firstChainLoc,{condensed:T,granularity:"chain",hidePrefix:E,reverse:L}):b(Q,f.firstChainLoc,"chain",E,L,T)),E=!0),G>0&&(N.push(1===G?s(f.firstResidueLoc,{condensed:T,granularity:"residue",hidePrefix:E,reverse:L}):b(G,f.firstResidueLoc,"residue",E,L,T)),E=!0),V>0&&(N.push(1===V?s(f.firstConformationLoc,{condensed:T,granularity:"conformation",hidePrefix:E,reverse:L}):b(V,f.firstConformationLoc,"conformation",E,L,T)),E=!0),U>0&&N.push(1===U?s(f.firstElementLoc,{condensed:T,granularity:"element",hidePrefix:E,reverse:L}):b(U,f.firstElementLoc,"element",E,L,T)),N.join(" + ")}}{const{unit:N}=f.firstChainLoc,k=e.Nf.isAtomic(N)&&1===function _(f){const{elements:p,model:E}=f,{chainAtomSegments:T,residueAtomSegments:L}=E.atomicHierarchy;return L.index[T.offsets[T.index[p[p.length-1]]+1]-1]-L.index[T.offsets[T.index[p[0]]]]+1}(N)||e.Nf.Traits.is(N.traits,e.Nf.Trait.MultiChain)?"residue":"chain";return s(f.firstChainLoc,{hidePrefix:E,condensed:T,granularity:k,reverse:L})}}(f,E.countsOnly,E.hidePrefix,E.condensed,E.reverse);return E.htmlStyling?T:(0,t.Kq)(T)}function I(f,p={}){const E=e.iZ.Stats.create();for(const T of f)e.iZ.Stats.add(E,E,e.iZ.Stats.ofLoci(T));return M(E,p)}function m(f,p={}){return u({loci:[e.iZ.Loci(f.aStructure,[{unit:f.aUnit,indices:r.CD.ofSingleton(f.aIndex)}]),e.iZ.Loci(f.bStructure,[{unit:f.bUnit,indices:r.CD.ofSingleton(f.bIndex)}])]},p)}function u(f,p={}){const E={...i,...p},T=function d(f,p){const{granularity:E,hidePrefix:T,reverse:L,condensed:w}=p;let Q=!0;for(const G of f.loci)if(!e.iZ.Loci.is(G)||1!==e.iZ.Loci.size(G)){Q=!1;break}if(Q){const V=f.loci.map(N=>{const{unit:k,indices:H}=N.elements[0];return e.iZ.Location.create(N.structure,k,k.elements[r.CD.start(H)])}).map(N=>C(N,E,T,L||w));if(w)return V.map(N=>N[0].replace(/\[.*\]/g,"").trim()).filter(N=>!!N).join(" \u2014 ");let U=0;for(let N=0,k=Math.min(...V.map(H=>H.length))-1;N0){const N=[V[0].join(" | ")];for(let k=1,H=V.length;k!!$).join(" | "));return N.join(" \u2014 ")}return V.map(N=>N.filter(k=>!!k).join(" | ")).filter(N=>!!N).join("
")}return f.loci.map(V=>v(V,p)).filter(V=>!!V).join(w?" \u2014 ":"
")}(f,E);return E.htmlStyling?T:(0,t.Kq)(T)}function s(f,p={}){var E,T;const L={...i,...p},w=C(f,L.granularity,L.hidePrefix,L.reverse||L.condensed),Q=L.condensed?null!==(T=null===(E=w[0])||void 0===E?void 0:E.replace(/\[.*\]/g,"").trim())&&void 0!==T?T:"":w.filter(G=>!!G).join(" | ");return L.htmlStyling?Q:(0,t.Kq)(Q)}function C(f,p="element",E=!1,T=!1){const L=[];if(!E){let w=f.unit.model.entry;w.length>30&&(w=w.substr(0,27)+"\u2026"),L.push(`${w}`),"structure"!==p&&(L.push(`Model ${f.unit.model.modelNum}`),L.push(`Instance ${f.unit.conformation.operator.name}`))}return e.Nf.isAtomic(f.unit)?L.push(...function h(f,p,E=!1){const T=e.iZ.Location.residueIndex(f),L=e.StructureProperties.chain.label_asym_id(f),w=e.StructureProperties.chain.auth_asym_id(f),Q=0===f.unit.model.atomicHierarchy.residues.label_seq_id.valueKind(T),G=e.StructureProperties.residue.label_seq_id(f),V=e.StructureProperties.residue.auth_seq_id(f),U=e.StructureProperties.residue.pdbx_PDB_ins_code(f),N=e.StructureProperties.atom.label_comp_id(f),k=e.StructureProperties.atom.label_atom_id(f),H=e.StructureProperties.atom.label_alt_id(f),$=e.StructureProperties.atom.occupancy(f),J=e.StructureProperties.residue.microheterogeneityCompIds(f),W="residue"===p&&J.length>1?`(${J.join("|")})`:N,te=[];switch(p){case"element":te.push(`${k}${H?`%${H}`:""}`);case"conformation":"conformation"===p&&H&&te.push(`Conformation ${H}`);case"residue":const de=G!==V&&Q?G:V;te.push(`${W} ${de}${de!==V?` [auth ${V}]`:""}${U||""}`);case"chain":L===w?te.push(`${L}`):"chain"===p&&e.Nf.Traits.is(f.unit.traits,e.Nf.Trait.MultiChain)?te.push(`[auth ${w}]`):te.push(`${L} [auth ${w}]`)}return te.length>0&&1!==$&&!E&&(te[0]=`${te[0]} [occupancy ${Math.round(100*$)/100}]`),te.reverse()}(f,p,T)):e.Nf.isCoarse(f.unit)?L.push(...function a(f,p){const E=e.StructureProperties.coarse.asym_id(f),T=e.StructureProperties.coarse.seq_id_begin(f),L=e.StructureProperties.coarse.seq_id_end(f),w=[];switch(p){case"element":case"conformation":case"residue":if(T===L){const Q=e.StructureProperties.coarse.entityKey(f),V=f.unit.model.sequence.byEntityKey[Q].sequence.compId.value(T-1);w.push(`${V} ${T}`)}else w.push(`${T}-${L}`);case"chain":w.push(`${E}`)}return w.reverse()}(f,p)):L.push("Unknown"),T?L.reverse():L}function S(f,p={}){const E={...i,measureOnly:!1,unitLabel:"\u212b",...p},[T,L]=f.loci.map(G=>o.QN.getCenter(G)),w=`${A.eB.distance(T,L).toFixed(2)} ${E.unitLabel}`;if(E.measureOnly)return w;const Q=u(f,E);return E.condensed?`${w} | ${Q}`:`Distance ${w}
${Q}`}function D(f,p={}){const E={...i,measureOnly:!1,...p},[T,L,w]=f.loci.map(N=>o.QN.getCenter(N)),Q=A.eB.sub((0,A.eB)(),T,L),G=A.eB.sub((0,A.eB)(),w,L),V=`${(0,y.H)(A.eB.angle(Q,G)).toFixed(2)}\xb0`;if(E.measureOnly)return V;const U=u(f,E);return E.condensed?`${V} | ${U}`:`Angle ${V}
${U}`}function R(f,p={}){const E={...i,measureOnly:!1,...p},[T,L,w,Q]=f.loci.map(U=>o.QN.getCenter(U)),G=`${(0,y.H)(A.eB.dihedralAngle(T,L,w,Q)).toFixed(2)}\xb0`;if(E.measureOnly)return G;const V=u(f,E);return E.condensed?`${G} | ${V}`:`Dihedral ${G}
${V}`}},261:(tn,Ue,n)=>{"use strict";n.d(Ue,{l:()=>A});var e=n(3246),o=n(190),r=n(9136),t=n(9498);function A(y,c){return{kind:y,layers:c}}!function(y){function i(l){return 0===l.layers.length}y.Empty={kind:"empty-loci",layers:[]},y.areEqual=function c(l,m){if(0===l.layers.length&&0===m.layers.length)return!0;if(l.layers.length!==m.layers.length)return!1;for(let u=0,d=l.layers.length;u{const a=-1===h,S=a?(0,o.Q1)(0):h;s.push({loci:C,color:S,clear:a})}),{kind:"element-loci",layers:s}}return l},y.filter=function b(l,m){if(i(l))return l;if("element-loci"===l.kind){const{structure:u}=l.layers[0].loci,d=[];for(const s of l.layers){let{loci:C,color:h,clear:a}=s;const S=r.iZ.Loci.remap(C,m);C=r.iZ.Loci.remap(S,u),r.iZ.Loci.isEmpty(C)||d.push({loci:C,color:h,clear:a})}return{kind:"element-loci",layers:d}}return l},y.ofScript=function _(l,m){const u=[];for(let d=0,s=l.length;d{"use strict";n.d(Ue,{F:()=>h});var e=n(5013),o=n(1930),r=n(9136),t=n(2008),A=n(8277);const i={scale:A.t.Numeric(1,{min:.1,max:5,step:.1})};function O(a,S){return r.Nf.isAtomic(a)?(0,t.sO)(a.model.atomicHierarchy.atoms.type_symbol.value(S)):r.Nf.isSpheres(a)?a.model.coarseConformation.spheres.radius[S]:0}const _={name:"physical",label:"Physical",category:"",factory:function b(a,S){const D=void 0===S.scale?1:S.scale;return{factory:b,granularity:"group",size:function R(f){let p;return p=r.iZ.Location.is(f)?D*O(f.unit,f.element):r.gn.isLocation(f)?D*Math.min(O(f.aUnit,f.aUnit.elements[f.aIndex]),O(f.bUnit,f.bUnit.elements[f.bIndex])):1*D,p},props:S,description:"Assigns a physical size, i.e. vdW radius for atoms or given radius for coarse spheres."}},getParams:function v(a){return i},defaultValues:A.t.getDefaultValues(i),isApplicable:a=>!!a.structure};var M=n(9909),I=n(350);const m={bfactorFactor:A.t.Numeric(.1,{min:0,max:1,step:.01}),rmsfFactor:A.t.Numeric(.05,{min:0,max:1,step:.01}),baseSize:A.t.Numeric(.2,{min:0,max:2,step:.1})};function d(a,S,D){return r.Nf.isAtomic(a)?a.model.atomicConformation.B_iso_or_equiv.value(S)*D.bfactorFactor:r.Nf.isSpheres(a)?a.model.coarseConformation.spheres.rmsf[S]*D.rmsfFactor:0}const C={name:"uncertainty",label:"Uncertainty/Disorder",category:"",factory:function s(a,S){return{factory:s,granularity:"group",size:function D(R){let f=S.baseSize;return r.iZ.Location.is(R)?f+=d(R.unit,R.element,S):r.gn.isLocation(R)&&(f+=d(R.aUnit,R.aUnit.elements[R.aIndex],S)),f},props:S,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 u(a){return m},defaultValues:A.t.getDefaultValues(m),isApplicable:a=>!!a.structure&&a.structure.models.some(S=>S.atomicConformation.B_iso_or_equiv.isDefined||S.coarseHierarchy.isDefined)};var h,a;(a=h||(h={})).EmptyFactory=()=>a.Empty,a.Empty={factory:a.EmptyFactory,granularity:"uniform",size:()=>1,props:{}},a.areEqual=function S(R,f){return R.contextHash===f.contextHash&&R.factory===f.factory&&(0,M.bD)(R.props,f.props)},a.EmptyProvider={name:"",label:"",category:"",factory:a.EmptyFactory,getParams:()=>({}),defaultValues:{},isApplicable:()=>!0},a.createRegistry=function D(){return new o.D(a.BuiltIn,a.EmptyProvider)},a.BuiltIn={physical:_,"shape-group":I.Ev,uncertainty:C,uniform:e.kk}},350:(tn,Ue,n)=>{"use strict";n.d(Ue,{$d:()=>c,Ev:()=>i});var e=n(3558),o=n(8277);const r=1,t="Assigns sizes as defined by the shape object.",A={};function c(v,O){return{factory:c,granularity:"groupInstance",size:b=>e.$.isLocation(b)?b.shape.getSize(b.group,b.instance):r,props:O,description:t}}const i={name:"shape-group",label:"Shape Group",category:"",factory:c,getParams:function y(v){return A},defaultValues:o.t.getDefaultValues(A),isApplicable:v=>!!v.shape}},5013:(tn,Ue,n)=>{"use strict";n.d(Ue,{kk:()=>y,ru:()=>A});var e=n(8277);const o="Gives everything the same, uniform size.",r={value:e.t.Numeric(1,{min:0,max:20,step:.1})};function A(c,i){const v=i.value;return{factory:A,granularity:"uniform",size:()=>v,props:i,description:o}}const y={name:"uniform",label:"Uniform",category:"",factory:A,getParams:function t(c){return r},defaultValues:e.t.getDefaultValues(r),isApplicable:c=>!0}},9213:(tn,Ue,n)=>{"use strict";n.d(Ue,{l:()=>y});var e=n(3246),o=n(9136),r=n(9498),t=n(6765),A=n(9359);function y(c,i){return{kind:c,layers:i}}!function(c){function v(m){return 0===m.layers.length}c.Empty={kind:"empty-loci",layers:[]},c.areEqual=function i(m,u){if(0===m.layers.length&&0===u.layers.length)return!0;if(m.layers.length!==u.layers.length)return!1;for(let d=0,s=m.layers.length;d{h.push({loci:a,material:S,clear:!1})}),{kind:"element-loci",layers:h}}return m},c.filter=function _(m,u){if(v(m))return m;if("element-loci"===m.kind){const{structure:d}=m.layers[0].loci,s=[];for(const C of m.layers){let{loci:h,material:a,clear:S}=C;const D=o.iZ.Loci.remap(h,u);h=o.iZ.Loci.remap(D,d),o.iZ.Loci.isEmpty(h)||s.push({loci:h,material:a,clear:S})}return{kind:"element-loci",layers:s}}return m},c.ofScript=function M(m,u){const d=[];for(let s=0,C=m.length;s{"use strict";n.d(Ue,{D:()=>i,S:()=>y});var y,e=n(467),o=n(274),r=n(2832),t=n(8277),A=n(9359);function c(v){return v.map(O=>[O.name,O.provider.label,O.provider.category])}!function(v){function b(){return{color:o.J.Empty,size:r.F.Empty}}function M(){return(M=(0,e.A)(function*(l,m,u,d){var s,C;yield null===(s=m.colorThemeRegistry.get(d.colorTheme.name).ensureCustomProperties)||void 0===s?void 0:s.attach(l,u),yield null===(C=m.sizeThemeRegistry.get(d.sizeTheme.name).ensureCustomProperties)||void 0===C?void 0:C.attach(l,u)})).apply(this,arguments)}v.create=function O(l,m,u,d){d=d||b();const s=u.colorTheme,C=u.sizeTheme;return d.color=l.colorThemeRegistry.create(s.name,m,s.params),d.size=l.sizeThemeRegistry.create(C.name,m,C.params),d},v.createEmpty=b,v.ensureDependencies=function _(l,m,u,d){return M.apply(this,arguments)},v.releaseDependencies=function I(l,m,u){var d,s;null===(d=l.colorThemeRegistry.get(u.colorTheme.name).ensureCustomProperties)||void 0===d||d.detach(m),null===(s=l.sizeThemeRegistry.get(u.sizeTheme.name).ensureCustomProperties)||void 0===s||s.detach(m)}}(y||(y={}));class i{get default(){return this._list[0]}get list(){return this._list}get types(){return c(this._list)}constructor(O,b){this.emptyProvider=b,this._list=[],this._map=new Map,this._name=new Map,(0,A.IF)(O,(_,M)=>{if(_.name!==M)throw new Error(`Fix build in themes to have matching names. ${_.name} ${M}`);this.add(_)})}sort(){this._list.sort((O,b)=>O.provider.category===b.provider.category?O.provider.labelb.provider.label?1:0:O.provider.category_.name===O.name),1);const b=this._map.get(O.name);b&&(this._map.delete(O.name),this._name.delete(b))}has(O){return this._map.has(O.name)}get(O){return this._map.get(O)||this.emptyProvider}getName(O){if(!this._name.has(O))throw new Error(`'${O.label}' is not a registered theme provider.`);return this._name.get(O)}create(O,b,_={}){const M=this.get(O);return M.factory(b,{...t.t.getDefaultValues(M.getParams(b)),..._})}getApplicableList(O){return this._list.filter(b=>b.provider.isApplicable(O))}getApplicableTypes(O){return c(this.getApplicableList(O))}clear(){this._list.length=0,this._map.clear(),this._name.clear()}}},1965:(tn,Ue,n)=>{"use strict";n.d(Ue,{x:()=>t});var e=n(3246),o=n(9136),r=n(9498);function t(A,y){return{kind:A,layers:y}}!function(A){function c(I){return 0===I.layers.length}A.Empty={kind:"empty-loci",layers:[]},A.areEqual=function y(I,l){if(0===I.layers.length&&0===l.layers.length)return!0;if(I.layers.length!==l.layers.length)return!1;for(let m=0,u=I.layers.length;m{d.push({loci:s,value:C})}),{kind:"element-loci",layers:d}}return I},A.filter=function O(I,l){if(c(I))return I;if("element-loci"===I.kind){const{structure:m}=I.layers[0].loci,u=[];for(const d of I.layers){let{loci:s,value:C}=d;const h=o.iZ.Loci.remap(s,l);s=o.iZ.Loci.remap(h,m),o.iZ.Loci.isEmpty(s)||u.push({loci:s,value:C})}return{kind:"element-loci",layers:u}}return I},A.ofScript=function b(I,l){const m=[];for(let u=0,d=I.length;u{"use strict";function A(p){let E=-1/0;for(let T=0,L=p.length;TE&&(E=p[T]);return E}function y(p){let E=1/0;for(let T=0,L=p.length;TT&&(T=p[L]);return[E,T]}function i(p,E=1,T=0){const L=p.length;let w=0;for(let Q=T;Q=0||(p.push(E),0))}function l(p,E){const T=p.indexOf(E);if(T<0)return!1;for(let L=T,w=p.length-1;Ld,u$:()=>u,qW:()=>s,$6:()=>C,_M:()=>A,VR:()=>v,GP:()=>y,em:()=>c,P6:()=>M,mO:()=>_,C2:()=>O,Z2:()=>I,K3:()=>l,jJ:()=>i,WE:()=>b}),n(9359)},1861:(tn,Ue,n)=>{"use strict";n.d(Ue,{E:()=>i,V:()=>c});var c,e=n(467),o=n(3559),r=n(8382),t=n(3188),A=n(4824),y=n(8484);!function(v){function O(u,d){return{kind:"url",id:o.k.create22(),url:u,...d}}v.Url=O,v.File=function b(u){return{kind:"file",id:o.k.create22(),name:u.name,file:u}},v.isUrl=function _(u){return"url"===u?.kind},v.isFile=function M(u){return"file"===u?.kind},v.Wrapper=function I(u,d,s){return{data:u,dispose:()=>{s.release(d)}}},v.getUrl=function l(u){return"string"==typeof u?u:u.url},v.getUrlAsset=function m(u,d,s){return"string"==typeof d?u.tryFindUrl(d,s)||O(d,{body:s}):d}}(c||(c={}));class i{constructor(){this._assets=new Map}get assets(){return(0,r.ZR)(this._assets.values())}tryFindUrl(O,b){const _=this.assets.values();for(;;){const M=_.next();if(M.done)return;const I=M.value.asset;if(c.isUrl(I)&&I.url===O&&(I.body||"")===(b||""))return I}}set(O,b){this._assets.set(O.id,{asset:O,file:b,refCount:0})}get(O){return this._assets.get(O.id)}delete(O){return this._assets.delete(O.id)}has(O){return this._assets.has(O.id)}resolve(O,b,_=!0){var M=this;return c.isUrl(O)?A.YZ.create(`Download ${O.title||O.url}`,function(){var I=(0,e.A)(function*(l){if(M._assets.has(O.id)){const d=M._assets.get(O.id);return d.refCount++,c.Wrapper(yield(0,t.dH)(d.file,b).runInContext(l),O,M)}if(!_)return c.Wrapper(yield(0,t.hW)({...O,type:b}).runInContext(l),O,M);const m=yield(0,t.hW)({...O,type:"binary"}).runInContext(l),u=new y.em([m],"raw-data");return M._assets.set(O.id,{asset:O,file:u,refCount:1}),c.Wrapper(yield(0,t.dH)(u,b).runInContext(l),O,M)});return function(l){return I.apply(this,arguments)}}()):A.YZ.create(`Read ${O.name}`,function(){var I=(0,e.A)(function*(l){if(M._assets.has(O.id)){const m=M._assets.get(O.id);return m.refCount++,c.Wrapper(yield(0,t.dH)(m.file,b).runInContext(l),O,M)}if(!(O.file instanceof y.em))throw new Error(`Cannot resolve file asset '${O.name}' (${O.id})`);return _&&M._assets.set(O.id,{asset:O,file:O.file,refCount:1}),c.Wrapper(yield(0,t.dH)(O.file,b).runInContext(l),O,M)});return function(l){return I.apply(this,arguments)}}())}release(O){const b=this._assets.get(O.id);b&&(b.refCount--,b.refCount<=0&&this._assets.delete(O.id))}clear(){this._assets.clear()}dispose(){this.clear()}}},4123:(tn,Ue,n)=>{"use strict";n.d(Ue,{O:()=>r});var e=n(4080),o=n(7785);function r(i,v="",O=""){return r.create(i,v,O)}!function(i){function I(d){return d.triggers.map(m.format).join(" or ")}function m(d,s){return m.create(d,s)}var d;i.create=function v(d,s="",C=""){return{triggers:d,action:s,description:C}},i.isBinding=function O(d){return!!d&&Array.isArray(d.triggers)&&"string"==typeof d.action},i.Empty={triggers:[],action:"",description:""},i.isEmpty=function b(d){return 0===d.triggers.length||d.triggers.every(s=>void 0===s.buttons&&void 0===s.modifiers&&!s.code)},i.match=function _(d,s,C){return d.triggers.some(h=>m.match(h,s,C))},i.matchKey=function M(d,s,C,h){return d.triggers.some(a=>m.matchKey(a,s,C,h))},i.formatTriggers=I,i.format=function l(d,s=""){const C=d.description||(0,o.Mk)(s);return(0,o.GW)(C,{triggers:""+I(d)+""})},i.Trigger=m,i.TriggerKey=function u(d,s){return m.create(void 0,s,d)},(d=m=i.Trigger||(i.Trigger={})).create=function s(S,D,R){return{buttons:S,modifiers:D,code:R}},d.Empty={},d.match=function C(S,D,R){const{buttons:f,modifiers:p}=S;return void 0!==f&&(f===D||e.qt.has(f,D))&&(!p||e.Fs.areEqual(p,R))},d.matchKey=function h(S,D,R,f){const{modifiers:p,code:E}=S;return void 0!==E&&(E===D||1===E.length&&4===D.length&&D.startsWith("Key")&&!!f&&1===f.length&&f.toUpperCase()===E.toUpperCase())&&(!p||e.Fs.areEqual(p,R))},d.format=function a(S){const D=[],R=function A(i,v){const O=[];return void 0!==i||v?0===i?O.push("mouse hover"):void 0!==i&&(t.has(i,t.Flag.Primary)&&O.push("left mouse button"),t.has(i,t.Flag.Secondary)&&O.push("right mouse button"),t.has(i,t.Flag.Auxilary)&&O.push("wheel/middle mouse button"),t.has(i,t.Flag.Forth)&&O.push("three fingers")):O.push("any mouse button"),O.join(" + ")}(S.buttons,S.code);R&&D.push(R);const f=function c(i){return i?.startsWith("Key")&&(i=i.substring(3)),i&&(0,o.Hh)(i).toLowerCase()}(S.code);f&&D.push(f);const p=function y(i,v){const O=[];return i?(i.alt&&O.push("alt key"),i.control&&O.push("control key"),i.meta&&O.push("meta/command key"),i.shift&&O.push("shift key"),v&&0===O.length&&O.push("no key")):v&&O.push("any key"),O.join(" + ")}(S.modifiers);return p&&D.push(p),D.join(" + ")}}(r||(r={}));const t=e.qt},9455:(tn,Ue,n)=>{"use strict";var e,o;n.d(Ue,{N:()=>e}),(o=e||(e={})).create=function r(y){return y},o.has=function t(y,c){return!!(y&c)},o.hasAll=function A(y,c){return!!c&&(y&c)===c}},9390:(tn,Ue,n)=>{"use strict";n.d(Ue,{B:()=>A});var e=n(4369),o=n(4490),r=n(8277),t=n(7785);function A(){}!function(y){y.Type={none:0,plane:1,sphere:2,cube:3,cylinder:4,infiniteCone:5},y.Params={variant:r.t.Select("pixel",r.t.arrayToOptions(["instance","pixel"])),objects:r.t.ObjectList({type:r.t.Select("plane",r.t.objectToOptions(y.Type,I=>(0,t.Mk)(I))),invert:r.t.Boolean(!1),position:r.t.Vec3((0,e.eB)()),rotation:r.t.Group({axis:r.t.Vec3(e.eB.create(1,0,0)),angle:r.t.Numeric(0,{min:-180,max:180,step:1},{description:"Angle in Degrees"})},{isExpanded:!0}),scale:r.t.Vec3(e.eB.create(1,1,1))},I=>(0,t.Mk)(I.type))};const i=(0,e.k)(),v=(0,e.k)(),O=(0,e.eB)(),b=(0,e.eB)();y.getClip=function _(I,l){const m=I.objects.length,{type:u,invert:d,position:s,rotation:C,scale:h}=l?.objects||function c(I){return{count:0,type:new Array(I).fill(1),invert:new Array(I).fill(!1),position:new Array(3*I).fill(0),rotation:new Array(4*I).fill(0),scale:new Array(3*I).fill(1)}}(m);for(let a=0;a{"use strict";n.d(Ue,{Ak:()=>c,Q1:()=>r,Q5:()=>t,_j:()=>y,qM:()=>i});var e=n(7551),o=n(9083);function r(v){return v}function t(v,O,b,_){return{label:v,description:b,list:_,type:O}}function y(v){return v}function c(v,O,b){const _={};for(const M in v){let I=v[M];I=r.saturate(I,O),I=r.darken(I,-b),_[M]=I}return _}function i(v){return v}!function(v){function d(W,te,de){return W<<16|te<<8|de}function s(W,te,de){return 255*W<<16|255*te<<8|255*de}function p(W){const te=W>>16&255;return te!==(W>>8&255)||te!==(255&W)}v.toStyle=function O(W){return`rgb(${W>>16&255}, ${W>>8&255}, ${255&W})`},v.toHexStyle=function b(W){return"#"+("000000"+W.toString(16)).slice(-6)},v.toHexString=function _(W){return"0x"+("000000"+W.toString(16)).slice(-6)},v.toRgbString=function M(W){return`RGB: ${v.toRgb(W).join(", ")}`},v.toRgb=function I(W){return[W>>16&255,W>>8&255,255&W]},v.toRgbNormalized=function l(W){return[(W>>16&255)/255,(W>>8&255)/255,(255&W)/255]},v.fromHexStyle=function m(W){return parseInt(W.replace("#","0x"))},v.fromHexString=function u(W){return parseInt(W)},v.fromRgb=d,v.fromNormalizedRgb=s,v.fromArray=function C(W,te){return d(W[te],W[te+1],W[te+2])},v.fromNormalizedArray=function h(W,te){return s(W[te],W[te+1],W[te+2])},v.toArray=function a(W,te,de){return te[de]=W>>16&255,te[de+1]=W>>8&255,te[de+2]=255&W,te},v.toArrayNormalized=function S(W,te,de){return te[de]=(W>>16&255)/255,te[de+1]=(W>>8&255)/255,te[de+2]=(255&W)/255,te},v.toVec3=function D(W,te){return W[0]=te>>16&255,W[1]=te>>8&255,W[2]=255&te,W},v.toVec3Normalized=function R(W,te){return W[0]=(te>>16&255)/255,W[1]=(te>>8&255)/255,W[2]=(255&te)/255,W},v.interpolate=function f(W,te,de){const ye=W>>16&255,j=W>>8&255,Z=255&W;return ye+((te>>16&255)-ye)*de<<16|j+((te>>8&255)-j)*de<<8|Z+((255&te)-Z)*de},v.hasHue=p;const E=[0,0,0];function T(W,te){return p(W)?(e.G.fromColor(E,W),e.G.toColor(e.G.saturate(E,E,te))):W}v.saturate=T,v.desaturate=function L(W,te){return T(W,-te)};const w=[0,0,0];function Q(W,te){return o.E.fromColor(w,W),o.E.toColor(o.E.darken(w,w,te))}function V(W){return W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4)}function U(W){return.2126*V((W>>16&255)/255)+.7152*V((W>>8&255)/255)+.0722*V((255&W)/255)}function k(W){return W<.04045?.0773993808*W:Math.pow(.9478672986*W+.0521327014,2.4)}function $(W){return W<.0031308?12.92*W:1.055*Math.pow(W,.41666)-.055}v.darken=Q,v.lighten=function G(W,te){return Q(W,-te)},v.luminance=U,v.contrast=function N(W,te){const de=U(W),ye=U(te);return de>ye?(de+.05)/(ye+.05):(ye+.05)/(de+.05)},v.sRGBToLinear=function H(W){return s(k((W>>16&255)/255),k((W>>8&255)/255),k((255&W)/255))},v.linearToSRGB=function J(W){return s($((W>>16&255)/255),$((W>>8&255)/255),$((255&W)/255))}}(r||(r={}))},190:(tn,Ue,n)=>{"use strict";n.d(Ue,{Q1:()=>e.Q1,_j:()=>e._j,wC:()=>o.w});var e=n(3057),o=n(6412)},1907:(tn,Ue,n)=>{"use strict";n.d(Ue,{CL:()=>A,JA:()=>i,Qx:()=>y,VI:()=>r,cG:()=>c});var e=n(3057),o=n(7785);const r={"orange-red":(0,e.Q5)("Orange-Red","sequential","Orange-Red, sequential color scheme from ColorBrewer 2.0",[16775148,16705736,16635038,16628612,16551257,15689032,14102559,11730944,8323072]),"purple-blue":(0,e.Q5)("Purple-Blue","sequential","Purple-Blue, sequential color scheme from ColorBrewer 2.0",[16775163,15525874,13685222,10927579,7645647,3576e3,356528,285325,145496]),"blue-purple":(0,e.Q5)("Blue-Purple","sequential","Blue-Purple, sequential color scheme from ColorBrewer 2.0",[16252157,14740724,12571622,10403034,9213638,9202609,8929693,8458108,5046347]),oranges:(0,e.Q5)("Oranges","sequential","",[16774635,16705230,16634018,16625259,16616764,15821075,14239745,10892803,8333060]),"blue-green":(0,e.Q5)("Blue-Green","sequential","",[16252157,15070713,13429990,10082505,6734500,4304502,2329413,27948,17435]),"yellow-orange-brown":(0,e.Q5)("Yellow-Orange-Brown","sequential","",[16777189,16775100,16704401,16696399,16685353,15495188,13388802,10040324,6694150]),"yellow-green":(0,e.Q5)("Yellow-Green","sequential","",[16777189,16252089,14282915,11394446,7915129,4303709,2327619,26679,17705]),reds:(0,e.Q5)("Reds","sequential","",[16774640,16703698,16563105,16552562,16476746,15678252,13309981,10817301,6750221]),"red-purple":(0,e.Q5)("Red-Purple","sequential","",[16775155,16638173,16565696,16424885,16214177,14496919,11403646,7995767,4784234]),greens:(0,e.Q5)("Greens","sequential","",[16252149,15070688,13101504,10607003,7652470,4303709,2329413,27948,17435]),"yellow-green-blue":(0,e.Q5)("Yellow-Green-Blue","sequential","",[16777177,15595697,13101492,8375739,4306628,1937856,2252456,2438292,531800]),purples:(0,e.Q5)("Purples","sequential","",[16579581,15724021,14342891,12369372,10394312,8420794,6967715,5515151,4128893]),"green-blue":(0,e.Q5)("Green-Blue","sequential","",[16252144,14742491,13429701,11066805,8113348,5157843,2854078,551084,540801]),greys:(0,e.Q5)("Greys","sequential","",[16777215,15790320,14277081,12434877,9868950,7566195,5395026,2434341,0]),"yellow-orange-red":(0,e.Q5)("Yellow-Orange-Red","sequential","",[16777164,16772512,16701814,16691788,16616764,16535082,14883356,12386342,8388646]),"purple-red":(0,e.Q5)("Purple-Red","sequential","",[16250105,15196655,13941210,13210823,14640560,15149450,13505110,9961539,6750239]),blues:(0,e.Q5)("Blues","sequential","",[16251903,14609399,13032431,10406625,7057110,4362950,2191797,545180,536683]),"purple-blue-green":(0,e.Q5)("Purple-Blue-Green","sequential","",[16775163,15524592,13685222,10927579,6793679,3576e3,164234,93273,83510]),spectral:(0,e.Q5)("Spectral","diverging","",[10355010,13975119,16018755,16625249,16703627,16777151,15136152,11263396,6734501,3311805,6180770]),"red-yellow-green":(0,e.Q5)("Red-Yellow-Green","diverging","",[10813478,14102567,16018755,16625249,16703627,16777151,14282635,10934634,6733155,1742928,26679]),"red-blue":(0,e.Q5)("Red-Blue","diverging","",[6750239,11671595,14049357,16033154,16636871,16250871,13755888,9618910,4428739,2188972,340065]),"pink-yellow-green":(0,e.Q5)("Pink-Yellow-Green","diverging","",[9306450,12917629,14579630,15840986,16638191,16250871,15136208,12116358,8371265,5083681,2581529]),"purple-green":(0,e.Q5)("Purple-Green","diverging","",[4194379,7744131,10055851,12756431,15193320,16250871,14282963,10935200,5942881,1800247,17435]),"red-yellow-blue":(0,e.Q5)("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":(0,e.Q5)("Brown-White-Green","diverging","",[5517317,9195786,12550445,14664317,16181443,16119285,13101797,8441281,3512207,91742,15408]),"red-grey":(0,e.Q5)("Red-Grey","diverging","",[6750239,11671595,14049357,16033154,16636871,16777215,14737632,12237498,8882055,5066061,1710618]),"orange-purple":(0,e.Q5)("Orange-Purple","diverging","",[8338184,11753478,14713364,16627811,16703670,16250871,14211819,11709394,8418220,5515144,2949195]),"set-2":(0,e.Q5)("Set-2","qualitative","",[6734501,16551266,9281739,15174339,10934356,16767279,15058068,11776947]),accent:(0,e.Q5)("Accent","qualitative","",[8374655,12496596,16629894,16777113,3697840,15729279,12540695,6710886]),"set-1":(0,e.Q5)("Set-1","qualitative","",[14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607,10066329]),"set-3":(0,e.Q5)("Set-3","qualitative","",[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081,12353725,13429701,16772463]),"dark-2":(0,e.Q5)("Dark-2","qualitative","",[1810039,14245634,7696563,15149450,6727198,15117058,10909213,6710886]),paired:(0,e.Q5)("Paired","qualitative","",[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054,6962586,16777113,11622696]),"pastel-2":(0,e.Q5)("Pastel-2","qualitative","",[11789005,16633260,13358568,16042724,15136201,16773806,15852236,13421772]),"pastel-1":(0,e.Q5)("Pastel-1","qualitative","",[16495790,11783651,13429701,14601188,16701862,16777164,15063229,16636652,15921906]),"many-distinct":(0,e.Q5)("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:(0,e.Q5)("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:(0,e.Q5)("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:(0,e.Q5)("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:(0,e.Q5)("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:(0,e.Q5)("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:(0,e.Q5)("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:(0,e.Q5)("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:(0,e.Q5)("Rainbow","sequential","",[3367393,3516485,16383744,15501073,12526114]),"red-white-blue":(0,e.Q5)("Red-White-Blue","diverging","",[12526114,16777215,3367393])},A=Object.keys(r).map(v=>[v,r[v].label,(0,o.ZH)(r[v].type)]),y=A.filter(v=>"diverging"===r[v[0]].type||"sequential"===r[v[0]].type),c=A.filter(v=>"qualitative"===r[v[0]].type);function i(v){return v in r?r[v]:(console.warn(`unknown color list named '${v}'`),r["red-yellow-blue"])}},2745:(tn,Ue,n)=>{"use strict";n.d(Ue,{s:()=>o});const o=(0,n(3057)._j)({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflower:6591981,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,laserlemon:16777044,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrod:16448210,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,maroon2:8323072,maroon3:11546720,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,purple2:8323199,purple3:10494192,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});!function(){const t=new Map;Object.keys(o).forEach(A=>{t.set(o[A],A)})}()},7809:(tn,Ue,n)=>{"use strict";n.d(Ue,{S:()=>S,U:()=>C});var e=n(2293),o=n(8277),r=n(9083),t=n(7551),A=n(9359),y=n(9909),c=n(2745);const i={hue:o.t.Interval([1,360],{min:0,max:360,step:1}),chroma:o.t.Interval([40,70],{min:0,max:100,step:1}),luminance:o.t.Interval([15,85],{min:0,max:100,step:1}),sort:o.t.Select("contrast",o.t.arrayToOptions(["none","contrast"]),{description:"no sorting leaves colors approximately ordered by hue"}),clusteringStepCount:o.t.Numeric(50,{min:10,max:200,step:1},{isHidden:!0}),minSampleCount:o.t.Numeric(800,{min:100,max:5e3,step:100},{isHidden:!0}),sampleCountFactor:o.t.Numeric(5,{min:1,max:100,step:1},{isHidden:!0})},v=2,O=[0,0,0],b=[0,0,0];function _(D,R){return r.E.toHcl(O,D),r.E.fromColor(b,r.E.toColor(D)),O[0]>=R.hue[0]&&O[0]<=R.hue[1]&&O[1]>=R.chroma[0]&&O[1]<=R.chroma[1]&&O[2]>=R.luminance[0]&&O[2]<=R.luminance[1]&&b[0]>=D[0]-v&&b[0]<=D[0]+v&&b[1]>=D[1]-v&&b[1]<=D[1]+v&&b[2]>=D[2]-v&&b[2]<=D[2]+v}function l(D,R){let f=1/0,p=0;for(let E=0;E`${D+1}`,minLabel:"Start",maxLabel:"End"};function S(D,R,f={}){var p;let E,T;if("colors"===R.palette.name&&"interpolate"===R.palette.params.list.kind){const{list:L}=R.palette.params,w=[0,D-1],{minLabel:Q,maxLabel:G}={...a,...f};let V=L.colors;0===V.length&&(V=(0,u.JA)(s.colorList).list);const U=d.w.create({listOrName:V,domain:w,minLabel:Q,maxLabel:G});T=U.legend,E=U.color}else{let L;"colors"===R.palette.name?(L=R.palette.params.list.colors.map(V=>Array.isArray(V)?V[0]:V),0===L.length&&(L=(0,u.JA)("dark-2").list.map(V=>Array.isArray(V)?V[0]:V))):(D=Math.min(D,R.palette.params.maxCount),L=function m(D,R={}){const f={...o.t.getDefaultValues(i),...R};if(D<=0)return[];const p=function I(D,R){const f=new Map,p=Math.ceil(Math.cbrt(D)),E=(0,t.G)(),T=Math.max((R.hue[1]-R.hue[0])/p,1),L=Math.max((R.chroma[1]-R.chroma[0])/p,1),w=Math.max((R.luminance[1]-R.luminance[0])/p,1);for(let Q=R.hue[0]+T/2;Q<=R.hue[1];Q+=T)for(let G=R.chroma[0]+L/2;G<=R.chroma[1];G+=L)for(let V=R.luminance[0]+w/2;V<=R.luminance[1];V+=w){const U=r.E.fromHcl((0,r.E)(),t.G.set(E,Q,G,V));_(U,R)&&f.set(r.E.toColor(U),U)}return Array.from(f.values())}(Math.max(f.minSampleCount,D*f.sampleCountFactor),f);if(p.length=D));Q+=L);for(let Q=1;Q<=f.clusteringStepCount;++Q){const G=(0,A.Go)(T),V=(0,A.Go)(p);for(let N=0;N0;){const p=f[f.length-1];let E=0,T=Number.NEGATIVE_INFINITY;for(let L=0;LT&&(T=w,E=L)}f.push(R.splice(E,1)[0])}return f}(E):E).map(Q=>r.E.toColor(Q))}(D,R.palette.params));const w=null!==(p=f.valueLabel)&&void 0!==p?p:a.valueLabel,Q=L.length,G=[];for(let V=0;VL[V%Q]}return{color:E,legend:T}}},6412:(tn,Ue,n)=>{"use strict";n.d(Ue,{w:()=>i});var e=n(3057),o=n(1907),r=n(9909),t=n(2293),A=n(3543),y=n(127);const c={domain:[0,1],reverse:!1,listOrName:"red-yellow-blue",minLabel:"",maxLabel:""};var i;(i||(i={})).create=function O(b){const{domain:_,reverse:M,listOrName:I}={...c,...b},l="string"==typeof I?(0,o.JA)(I).list:I,m=M?l.slice().reverse():l,u=m.length-1;let d=0,s=0,C=0;function h(f,p){s=f,C=p,d=C-s||1}h(_[0],_[1]);const a=(0,r.NT)(b.minLabel,s.toString()),S=(0,r.NT)(b.maxLabel,C.toString());let D;if(m.every(f=>Array.isArray(f))){const f=[...m];f.sort((L,w)=>L[1]-w[1]);const p=f.map(L=>L[0]),E=A.SortedArray.ofSortedArray(f.map(L=>L[1])),T=p.length-1;D=L=>{const w=(0,y.qE)((L-s)/d,0,1),Q=A.SortedArray.findPredecessorIndex(E,w);if(0===Q)return p[s];if(Q>T)return p[T];const G=E[Q-1],U=(0,y.qE)((w-G)/(E[Q]-G),0,1);return e.Q1.interpolate(p[Q-1],p[Q],U)}}else D=f=>{const p=Math.min(m.length-1,Math.max(0,(f-s)/d*u)),E=Math.floor(p),T=m[E],L=m[Math.ceil(p)];return e.Q1.interpolate(T,L,p-E)};return{color:D,colorToArray:(f,p,E)=>{e.Q1.toArray(D(f),p,E)},normalizedColorToArray:(f,p,E)=>{e.Q1.toArrayNormalized(D(f),p,E)},setDomain:h,get legend(){return(0,t.A)(a,S,m)}}}},7551:(tn,Ue,n)=>{"use strict";n.d(Ue,{G:()=>r});var e=n(4490),o=n(9083);function r(){return r.zero()}!function(t){function A(){const a=[.1,0,0];return a[0]=0,a}t.zero=A,t.create=function y(a,S,D){const R=A();return R[0]=a,R[1]=S,R[2]=D,R},t.set=function c(a,S,D,R){return a[0]=S,a[1]=D,a[2]=R,a},t.hasHue=function i(a){return!isNaN(a[0])};const v=[0,0,0];t.fromColor=function O(a,S){return o.E.toHcl(a,o.E.fromColor(v,S))},t.fromLab=function b(a,S){return o.E.toHcl(a,S)};const _=[0,0,0];function I(a,S){let[D,R,f]=S;return isNaN(D)&&(D=0),D=(0,e.pu)(D),a[0]=f,a[1]=Math.cos(D)*R,a[2]=Math.sin(D)*R,a}function m(a,S,D){return a[0]=S[0],a[1]=Math.max(0,S[1]+h*D),a[2]=S[2],a}t.toColor=function M(a){return o.E.toColor(I(_,a))},t.toLab=I,t.copy=function l(a,S){return a[0]=S[0],a[1]=S[1],a[2]=S[2],a},t.saturate=m,t.desaturate=function u(a,S,D){return m(a,S,-D)};const d=[0,0,0];function s(a,S,D){return I(d,S),o.E.toHcl(a,o.E.darken(d,d,D))}t.darken=s,t.lighten=function C(a,S,D){return s(a,S,-D)};const h=18}(r||(r={}))},9083:(tn,Ue,n)=>{"use strict";n.d(Ue,{E:()=>A});var e=n(3057),o=n(7551),r=n(4490),t=n(127);function A(){return A.zero()}!function(y){function c(){const V=[.1,0,0];return V[0]=0,V}function I(V,U){const[N,k,H]=U,$=Math.sqrt(k*k+H*H);let J=((0,r.H)(Math.atan2(H,k))+360)%360;return 0===Math.round(1e4*$)&&(J=Number.NaN),V[0]=J,V[1]=$,V[2]=N,V}function m(V,U,N){return V[0]=U[0]-h*N,V[1]=U[1],V[2]=U[2],V}y.zero=c,y.create=function i(V,U,N){const k=c();return k[0]=V,k[1]=U,k[2]=N,k},y.set=function v(V,U,N,k){return V[0]=U,V[1]=N,V[2]=k,V},y.distance=function O(V,U){const N=U[0]-V[0],k=U[1]-V[1],H=U[2]-V[2];return Math.sqrt(N*N+k*k+H*H)},y.fromColor=function b(V,U){const[N,k,H]=e.Q1.toRgb(U),[$,J,W]=function G(V,U,N){return[Q((.4124564*(V=w(V))+.3575761*(U=w(U))+.1804375*(N=w(N)))/a),Q((.2126729*V+.7151522*U+.072175*N)/S),Q((.0193339*V+.119192*U+.9503041*N)/D)]}(N,k,H),te=116*J-16;return V[0]=te<0?0:te,V[1]=500*($-J),V[2]=200*(J-W),V},y.fromHcl=function _(V,U){return o.G.toLab(V,U)},y.toColor=function M(V){let U=(V[0]+16)/116,N=isNaN(V[1])?U:U+V[1]/500,k=isNaN(V[2])?U:U-V[2]/200;U=S*L(U),N=a*L(N),k=D*L(k);const H=T(3.2404542*N-1.5371385*U-.4985314*k),$=T(-.969266*N+1.8760108*U+.041556*k),J=T(.0556434*N-.2040259*U+1.0572252*k);return e.Q1.fromRgb(Math.round((0,t.qE)(H,0,255)),Math.round((0,t.qE)($,0,255)),Math.round((0,t.qE)(J,0,255)))},y.toHcl=I,y.copy=function l(V,U){return V[0]=U[0],V[1]=U[1],V[2]=U[2],V},y.darken=m,y.lighten=function u(V,U,N){return m(V,U,-N)};const d=[0,0,0];function s(V,U,N){return I(d,U),o.G.toLab(V,o.G.saturate(d,d,N))}y.saturate=s,y.desaturate=function C(V,U,N){return s(V,U,-N)};const h=18,a=.95047,S=1,D=1.08883,R=.137931034,f=.206896552,p=.12841855,E=.008856452;function T(V){return 255*(V<=.00304?12.92*V:1.055*Math.pow(V,1/2.4)-.055)}function L(V){return V>f?V*V*V:p*(V-R)}function w(V){return(V/=255)<=.04045?V/12.92:Math.pow((V+.055)/1.055,2.4)}function Q(V){return V>E?Math.pow(V,1/3):V/p+R}}(A||(A={}))},3188:(tn,Ue,n)=>{"use strict";n.d(Ue,{Ui:()=>w,dH:()=>O,hW:()=>b});var e=n(467),o=n(275),r=n(4824),t=n(1861),A=n(8484),y=n(6985),c=function(N){return N[N.None=0]="None",N[N.Gzip=1]="Gzip",N[N.Zip=2]="Zip",N}(c||{});function O(N,k){return function h(N,k){if(A.K0)return function a(N,k){return r.YZ.create("Read File",function(){var H=(0,e.A)(function*($){const J="zip"===k?c.None:l(N.name);let W;return yield $.update({message:"Opening file...",canAbort:!1}),W="binary"===k||"zip"===k||J!==c.None?yield N.arrayBuffer():yield N.text(),yield $.update({message:"Processing file...",canAbort:!1}),yield s($,W,k,J)});return function($){return H.apply(this,arguments)}}())}(N,k);let H;return r.YZ.create("Read File",function(){var $=(0,e.A)(function*(J){try{H=new FileReader;const W="zip"===k?c.None:l(N.name);"binary"===k||"zip"===k||W!==c.None?H.readAsArrayBuffer(N):H.readAsText(N),yield J.update({message:"Opening file...",canAbort:!0});const te=yield I(J,"Reading...",H);return yield J.update({message:"Processing file...",canAbort:!1}),yield s(J,te.result,k,W)}finally{H=void 0}});return function(J){return $.apply(this,arguments)}}(),()=>{H&&H.abort()})}(N,k)}function b(N){return"string"==typeof N?f(N,N,"string"):f(N.title,N.url,N.type||"string",N.body,N.headers)}function M(N){return N?"Failed to download data. Possible reasons: Resource is not available, or CORS is not allowed on the server.":"Failed to open file."}function I(N,k,H){return new Promise(($,J)=>{if(function _(N){if(!A.K0&&N instanceof FileReader)return N.readyState===FileReader.DONE;if(N instanceof A.En)return N.readyState===A.En.DONE;throw new Error("unknown data type")}(H)){const{error:te}=H;return void(null!=te?J(te??M(H instanceof A.En)):$(H))}let W=!1;H.onerror=te=>{if(W)return;const{error:de}=te.target;J(de??M(H instanceof A.En))},H.onprogress=te=>{if(N.shouldUpdate&&!W)try{N.update(te.lengthComputable?{message:k,isIndeterminate:!1,current:te.loaded,max:te.total}:{message:`${k} ${(te.loaded/1024/1024).toFixed(2)} MB`,isIndeterminate:!0})}catch(de){W=!0,J(de)}},H.onload=te=>{$(H)}})}function l(N){return/\.gz$/i.test(N)?c.Gzip:/\.zip$/i.test(N)?c.Zip:c.None}const m=/^(__MACOSX|.DS_Store)/;function d(){return(d=(0,e.A)(function*(N,k,H){switch(H){case c.None:return k;case c.Gzip:return(0,y.Aq)(N,k);case c.Zip:const $=yield(0,y.$1)(N,k.buffer),J=Object.keys($).filter(W=>!m.test(W));if(1!==J.length)throw new Error("can only decompress zip files with a single entry");return $[J[0]]}})).apply(this,arguments)}function s(N,k,H,$){return C.apply(this,arguments)}function C(){return C=(0,e.A)(function*(N,k,H,$){let J=k instanceof ArrayBuffer?new Uint8Array(k):k;if(null===J)throw new Error("no data given");if($!==c.None){if(!(J instanceof Uint8Array))throw new Error("need Uint8Array for decompression");const W=yield function u(N,k,H){return d.apply(this,arguments)}(N,J,$);"string"===H?(yield N.update({message:"Decoding text..."}),J=(0,o.ss)(W,0,W.length)):J=W}if("binary"===H&&J instanceof Uint8Array)return J;if("zip"===H&&J instanceof Uint8Array)return yield(0,y.$1)(N,J.buffer);if("string"===H&&"string"==typeof J)return J;if("xml"===H&&"string"==typeof J)return(new DOMParser).parseFromString(J,"application/xml");if("json"===H&&"string"==typeof J)return JSON.parse(J);throw new Error(`could not get requested response data '${H}'`)}),C.apply(this,arguments)}let p,S=(()=>{class N{static get(){return this.pool.length?this.pool.pop():new A.En}static emptyFunc(){}static deposit(H){this.pool.length=200&&N.status<400){const{response:H}=N;if(S.deposit(N),("binary"===k||"zip"===k)&&H instanceof ArrayBuffer)return new Uint8Array(H);if("string"===k&&"string"==typeof H)return H;if("xml"===k&&H instanceof XMLDocument)return H;if("json"===k&&"object"==typeof H)return H;throw new Error(`could not get requested response data '${k}'`)}throw S.deposit(N),new Error(`Download failed with status code ${N.status}`)}(ye,H)});return function(de){return te.apply(this,arguments)}}(),()=>{W&&(W.abort(),W=void 0)})}function w(N,k,H,$){return Q.apply(this,arguments)}function Q(){return(Q=(0,e.A)(function*(N,k,H,$){const J=H.length,W=new Array(H.length);yield N.update({message:"Downloading...",current:0,max:J});let te=[],de=[],ye=0;for(let Z=Math.min(J,$);ye0;){const Z=yield Promise.race(te),q=H[Z.index],Y=de.indexOf(Z.index);if(j++,"error"===Z.kind&&!q.canFail)throw new Error(`${q.url}: ${Z.error}`);if(N.shouldUpdate&&(yield N.update({message:"Downloading...",current:j,max:J})),W[Z.index]=Z,te=te.filter(G,Y),de=de.filter(G,Y),ye{"use strict";n.d(Ue,{Bb:()=>o,EF:()=>v,Zq:()=>e,fv:()=>i,g$:()=>r});let e=function(){try{return!0}catch{return!1}}(),o=function(){try{const _=process.env.DEBUG;return"*"===_||"molstar"===_}catch{return!1}}(),r=!1;const c=[];function i(b){c.includes(b)||c.push(b)}function v(b){const _=c.indexOf(b);-1!==_&&c.splice(_,1)}},2732:(tn,Ue,n)=>{"use strict";function o(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{const y=document.createEvent("MouseEvents");y.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(y)}}function r(t,A="download"){if(t)if("download"in HTMLAnchorElement.prototype){const y=document.createElement("a");y.download=A,y.rel="noopener","string"==typeof t?(y.href=t,o(y)):(y.href=URL.createObjectURL(t),setTimeout(()=>URL.revokeObjectURL(y.href),4e4),setTimeout(()=>o(y)))}else if(typeof navigator<"u"&&navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(t,A);else{const y=window.navigator.userAgent,c=/Safari/i.test(y),i=/CriOS\/[\d]+/.test(y),v=O=>{!function e(t){window.open(t,"_blank")||(window.location.href=t)}(i?O:O.replace(/^data:[^;]*;/,"data:attachment/file;"))};if((c||i)&&FileReader)if(t instanceof Blob){const O=new FileReader;O.onloadend=()=>v(O.result),O.readAsDataURL(t)}else v(t);else{const O=URL.createObjectURL("string"==typeof t?new Blob([t]):t);location.href=O,setTimeout(()=>URL.revokeObjectURL(O),4e4)}}}n.d(Ue,{R:()=>r})},8361:(tn,Ue,n)=>{"use strict";n.d(Ue,{h:()=>t});class e{constructor(y,c){this.parent=null,this.child=null,this.degree=0,this.isMarked=!1,this.key=y,this.value=c,this.prev=this,this.next=this}}const r=new class o{constructor(y){if(this._index=-1,this._items=[],this._len=0,y){let c=y,i=0;do{this._items[i++]=c,c=c.next}while(y!==c);this._len=i}}hasNext(){return this._index0)throw new Error("New key is larger than old key");y.key=c;const i=y.parent;i&&this._compare(y,i)<0&&(this._cut(y,i,this._minNode),this._cascadingCut(i,this._minNode)),this._compare(y,this._minNode)<0&&(this._minNode=y)}delete(y){const c=y.parent;c&&(this._cut(y,c,this._minNode),this._cascadingCut(c,this._minNode)),this._minNode=y,this.extractMinimum()}extractMinimum(){const y=this._minNode;if(y){if(y.child){let i=y.child;do{i.parent=null,i=i.next}while(i!==y.child)}let c=null;y.next!==y&&(c=y.next),this._removeNodeFromList(y),this._nodeCount--,this._minNode=this._mergeLists(c,y.child),this._minNode&&(this._minNode=this._consolidate(this._minNode))}return y}findMinimum(){return this._minNode}insert(y,c){const i=new e(y,c);return this._minNode=this._mergeLists(this._minNode,i),this._nodeCount++,i}isEmpty(){return null===this._minNode}size(){return null===this._minNode?0:this._getNodeListSize(this._minNode)}union(y){this._minNode=this._mergeLists(this._minNode,y._minNode),this._nodeCount+=y._nodeCount}_defaultCompare(y,c){return y.key>c.key?1:y.key0){const b=v;v=O,O=b}this._linkHeaps(O,v),c[v.degree]=null,v.degree++,O=c[v.degree]}c[v.degree]=v}let i=null;for(let v=0;v{"use strict";n.d(Ue,{o:()=>o});const e=["gz","zip"];function o(r){let t=r,A="";const y=t.lastIndexOf("?"),c=-1!==y?t.substring(y):"";t=t.substring(0,-1===y?t.length:y);const i=t.replace(/^.*[\\/]/,"");let v=i.substring(0,i.lastIndexOf("."));const O=i.split(".");let b=O.length>1?(O.pop()||"").toLowerCase():"";const _=t.match(/^(.+):\/\/(.+)$/);_&&(A=_[1].toLowerCase(),t=_[2]||"");const M=t.substring(0,t.lastIndexOf("/")+1);return e.includes(b)&&(b=(t.substr(0,t.length-b.length-1).split(".").pop()||"").toLowerCase(),v=v.substr(0,v.length-b.length-1)),{path:t,name:i,ext:b,base:v,dir:M,protocol:A,query:c}}},7778:(tn,Ue,n)=>{"use strict";function e(o=0,r=Number.MAX_SAFE_INTEGER){let t=o;return()=>{const A=t;return t=(t+1)%r,A}}n.d(Ue,{q:()=>e})},2775:(tn,Ue,n)=>{"use strict";var e,o;n.d(Ue,{N:()=>e}),(o=e||(e={})).create=function r(y,c,i){return{array:y,width:c,height:i}},o.flipY=function t(y){const{array:c,width:i,height:v}=y,b=i*(c.length/(i*v));for(let _=0,M=v/2;_{"use strict";n.d(Ue,{NJ:()=>e.N,fe:()=>o.f,kk:()=>r.k,xv:()=>c.xv,IQ:()=>c.IQ,af:()=>O,bD:()=>_,NT:()=>m,fU:()=>R,lQ:()=>i,bN:()=>M,f8:()=>I});var y,e=n(9455),o=n(9115),r=n(3559);function t(E,T){return E-T}!function(E){class T{has(te){return!1}forEach(te,de){return de}constructor(){this.size=0}}class L{has(te){return te===this.idx}forEach(te,de){return te(this.idx,de),de}constructor(te){this.idx=te,this.size=1}}class w{has(te){return tete[de++]=ye),function A(E){Array.prototype.sort.call(E,t)}(te),this._flat=te,this._flat}forEach(te,de){return this._forEach(te,de),de}constructor(te){this.set=te,this._flat=void 0,this.size=te.size}}function U(W){return new G(W)}function H(W,te){return new w(W,te)}E.always=function V(W){return new Q(W)},E.never=new T,E.ofSet=U,E.singleton=function N(W){return new L(W)},E.ofUniqueIndices=function k(W){const te=W.length;if(0===te)return new T;if(1===te)return new L(W[0]);let de=0;for(const Z of W)Z>de&&(de=Z);if(te===de)return new Q(te);if(te/de<1/12){const Z=new Set;for(const q of W)Z.add(q);return new G(Z)}const j=new Int8Array(de+1);for(const Z of W)j[Z]=1;return new w(j,W.length)},E.ofMask=H,E.hasAny=function $(W,te){for(const de of te)if(W.has(de))return!0;return!1},E.complement=function J(W,te){let de=0,ye=0;if(te.forEach(j=>{W.has(j)||(de++,j>ye&&(ye=j))}),de/ye<1/12){const j=new Set;return te.forEach(Z=>{W.has(Z)||j.add(Z)}),U(j)}{const j=new Uint8Array(ye+1);return te.forEach(Z=>{W.has(Z)||(j[Z]=1)}),H(j,de)}}}(y||(y={}));var c=n(7187);const i=function(){};function O(E,T){const L=E.length;if(L!==T.length)return!1;for(let w=0;w{"use strict";n.d(Ue,{Fs:()=>v,RN:()=>c,Vl:()=>b,Y7:()=>A,bP:()=>l,qt:()=>O,vq:()=>y});var e=n(1413),o=n(7361),r=n(4369),t=n(9909);function A(u){if("object"==typeof u){if("buttons"in u)return u.buttons;if("which"in u){const d=u.which;if(2===d)return 4;if(3===d)return 2;if(d>0)return 1<=0)return 1<!0,pixelScale:1};var v,O;!function(u){function d(a,S){return a.shift===S.shift&&a.alt===S.alt&&a.control===S.control&&a.meta===S.meta}function h(a={}){return{shift:!!a.shift,alt:!!a.alt,control:!!a.control,meta:!!a.meta}}u.None=h(),u.areEqual=d,u.areNone=function s(a){return d(a,u.None)},u.size=function C(a){if(!a)return 0;let S=0;return a.shift&&S++,a.alt&&S++,a.control&&S++,a.meta&&S++,S},u.create=h}(v||(v={})),function(u){let d;var s;u.has=t.NJ.has,u.create=t.NJ.create,(s=d=u.Flag||(u.Flag={}))[s.None=0]="None",s[s.Primary=1]="Primary",s[s.Secondary=2]="Secondary",s[s.Auxilary=4]="Auxilary",s[s.Forth=8]="Forth",s[s.Five=16]="Five"}(O||(O={}));const b={key:"",code:"",modifiers:v.None,x:-1,y:-1,pageX:-1,pageY:-1,preventDefault:t.lQ};var _=function(u){return u[u.Stopped=0]="Stopped",u[u.Started=1]="Started",u[u.Moving=2]="Moving",u}(_||{});function M(){return{drag:new e.B,interactionEnd:new e.B,click:new e.B,move:new e.B,wheel:new e.B,pinch:new e.B,gesture:new e.B,resize:new e.B,leave:new e.B,enter:new e.B,modifiers:new e.B,key:new e.B,keyUp:new e.B,keyDown:new e.B,lock:new e.B}}const I=["Backspace","Delete"];var l,u;(u=l||(l={})).create=function d(C={}){const{noScroll:h,noContextMenu:a}={...i,...C};return{noScroll:h,noContextMenu:a,pointerLock:!1,width:0,height:0,pixelRatio:1,...M(),setPixelScale:t.lQ,requestPointerLock:t.lQ,exitPointerLock:t.lQ,dispose:t.lQ}},u.fromElement=function s(C,h={}){let{noScroll:a,noContextMenu:D,noPinchZoom:R,noTextSelect:f,mask:p,pixelScale:E,preventGestures:T}={...i,...h},L=C.clientWidth*de(),w=C.clientHeight*de(),Q=!1,G=(0,o.LM)(),V=0,U=0;const N=(0,r.ZY)(),k=(0,r.ZY)(),H=(0,r.ZY)(),$=(0,r.ZY)(),J=(0,r.ZY)(),W={shift:!1,alt:!1,control:!1,meta:!1},te={x:-1,y:-1,pageX:-1,pageY:-1};function de(){return window.devicePixelRatio*E}function ye(){return{...W}}function j(Ot){return Ot.target===document.body||Ot.target===C}let xe,Z=_.Stopped,q=!1,Y=O.create(O.Flag.None),ee=O.Flag.None,g=!1,_e=!1;typeof window.ResizeObserver<"u"&&(xe=new window.ResizeObserver(It));const le=M(),{drag:Ae,interactionEnd:Be,wheel:Ce,pinch:Re,gesture:ke,click:we,move:Oe,leave:Se,enter:Ve,resize:Ne,modifiers:K,key:ne,keyUp:be,keyDown:Te,lock:ie}=le;function ve(){Q=C.ownerDocument.pointerLockElement===C,kt(Q),ie.next(Q)}function ce(){console.error("Unable to use Pointer Lock API"),Q=!1,kt(Q),ie.next(Q)}function se(Ot){p(Ot.clientX,Ot.clientY)&&D&&Ot.preventDefault()}function ae(Ot){W.alt=Ot.altKey,W.shift=Ot.shiftKey,W.control=Ot.ctrlKey,W.meta=Ot.metaKey}function ge(){(Y||W.shift||W.alt||W.meta||W.control)&&(Y=0,W.shift=W.alt=W.control=W.meta=!1)}function Ie(Ot){let An=!1;!W.alt&&Ot.altKey&&(An=!0,W.alt=!0),!W.shift&&Ot.shiftKey&&(An=!0,W.shift=!0),!W.control&&Ot.ctrlKey&&(An=!0,W.control=!0),!W.meta&&Ot.metaKey&&(An=!0,W.meta=!0),An&&g&&K.next(ye()),j(Ot)&&g&&Te.next({key:Ot.key,code:Ot.code,modifiers:ye(),...te,preventDefault:()=>Ot.preventDefault()})}function Le(Ot){let An=!1;W.alt&&!Ot.altKey&&(An=!0,W.alt=!1),W.shift&&!Ot.shiftKey&&(An=!0,W.shift=!1),W.control&&!Ot.ctrlKey&&(An=!0,W.control=!1),W.meta&&!Ot.metaKey&&(An=!0,W.meta=!1),An&&g&&K.next(ye()),I.includes(Ot.key)&&nt(Ot),j(Ot)&&g&&be.next({key:Ot.key,code:Ot.code,modifiers:ye(),...te,preventDefault:()=>Ot.preventDefault()})}function nt(Ot){!j(Ot)||!g||ne.next({key:Ot.key,code:Ot.code,modifiers:ye(),...te,preventDefault:()=>Ot.preventDefault()})}function je(Ot){const An=Ot.touches[0],jn=Ot.touches[1];return{clientX:(An.clientX+jn.clientX)/2,clientY:(An.clientY+jn.clientY)/2,pageX:(An.pageX+jn.pageX)/2,pageY:(An.pageY+jn.pageY)/2,target:Ot.target}}function Lt(Ot){const An=Ot.touches[0].pageX-Ot.touches[1].pageX,jn=Ot.touches[0].pageY-Ot.touches[1].pageY;return Math.sqrt(An*An+jn*jn)}!function ue(){C.addEventListener("contextmenu",se,!1),C.addEventListener("wheel",Gt,!1),C.addEventListener("mousedown",Ke,!1),window.addEventListener("mousemove",ut,!1),window.addEventListener("mouseup",Kt,!1),C.addEventListener("touchstart",mt,!1),C.addEventListener("touchmove",Me,!1),C.addEventListener("touchend",_t,!1),C.addEventListener("gesturechange",Dn,!1),C.addEventListener("gesturestart",nn,!1),C.addEventListener("gestureend",jt,!1),window.addEventListener("blur",ge),window.addEventListener("keyup",Le,!1),window.addEventListener("keydown",Ie,!1),window.addEventListener("keypress",nt,!1),document.addEventListener("pointerlockchange",ve,!1),document.addEventListener("pointerlockerror",ce,!1),null!=xe?xe.observe(C.parentElement):window.addEventListener("resize",It,!1)}();let en,Je=-1;const Bt=(0,r.ZY)(),pn=(0,r.ZY)();function mt(Ot){if(Ot.preventDefault(),en=void 0,Je=-1,1===Ot.touches.length)Je=0,r.ZY.set(Bt,Ot.touches[0].pageX,Ot.touches[0].pageY),en=Ot.touches[0],Y=ee=O.Flag.Primary,gt(Ot.touches[0]);else if(2===Ot.touches.length){Y=O.Flag.Secondary&O.Flag.Auxilary,ee=O.Flag.Secondary,gt(je(Ot));const An=Lt(Ot);V=An,Re.next({distance:An,fraction:1,fractionDelta:0,delta:0,isStart:!0,buttons:Y,button:ee,modifiers:ye()})}else 3===Ot.touches.length&&(Y=ee=O.Flag.Forth,gt(je(Ot)))}function _t(Ot){if(sn(),en&&Je<=4){const An=en;if(!p(An.clientX,An.clientY))return;$t(pn,An);const{pageX:jn,pageY:On}=Vt(An),[fr,Dr]=pn;we.next({x:fr,y:Dr,pageX:jn,pageY:On,buttons:Y,button:ee,modifiers:ye()})}en=void 0}function Me(Ot){if(ee=O.Flag.None,R&&(Ot.preventDefault(),Ot.stopPropagation(),Ot.originalEvent&&(Ot.originalEvent.preventDefault(),Ot.originalEvent.stopPropagation())),en=void 0,1===Ot.touches.length)Y=O.Flag.Primary,en=Ot.touches[0],function $e(Ot){Je<0||(r.ZY.set(pn,Ot.touches[0].pageX,Ot.touches[0].pageY),Je+=r.ZY.distance(Bt,pn),r.ZY.copy(Bt,pn))}(Ot),At(Ot.touches[0]);else if(2===Ot.touches.length){const An=Lt(Ot),jn=V-An;if(Math.abs(jn)<4)Y=O.Flag.Secondary,At(je(Ot));else{Y=O.Flag.Auxilary,ae(Ot);const On=V/An;Re.next({delta:jn,fraction:On,fractionDelta:U-On,distance:An,isStart:!1,buttons:Y,button:ee,modifiers:ye()}),U=On}V=An}else 3===Ot.touches.length&&(Y=O.Flag.Forth,At(je(Ot)))}function Ke(Ot){ae(Ot),Y=A(Ot),ee=y(Ot),gt(Ot)}function ut(Ot){ae(Ot),Y=A(Ot),ee=O.Flag.None,At(Ot)}function Kt(Ot){ae(Ot),Y=A(Ot),ee=y(Ot),function yt(Ot){if(Z=_.Stopped,p(Ot.clientX,Ot.clientY)){if($t(H,Ot),!_e&&r.ZY.distance(H,N)<4){const{pageX:An,pageY:jn}=Vt(Ot),[On,fr]=H;we.next({x:On,y:fr,pageX:An,pageY:jn,buttons:Y,button:ee,modifiers:ye()})}_e=!1}}(Ot),sn()}function sn(){Be.next(void 0)}function gt(Ot){p(Ot.clientX,Ot.clientY)&&($t(k,Ot),r.ZY.copy(N,k),Dt(k)&&(Z=_.Started))}function At(Ot){var An;$t(H,Ot);const{pageX:jn,pageY:On}=Vt(Ot),[fr,Dr]=H,{movementX:Pr,movementY:or}=Ot,Nr=Dt(H)&&p(Ot.clientX,Ot.clientY);if(g&&!Nr?Se.next(void 0):!g&&Nr&&Ve.next(void 0),g=Nr,te.x=fr,te.y=Dr,te.pageX=jn,te.pageY=On,Oe.next({x:fr,y:Dr,pageX:jn,pageY:On,movementX:Pr,movementY:or,buttons:Y,button:ee,modifiers:ye(),inside:Nr,onElement:Ot.target===C}),Z===_.Stopped||(f&&(null===(An=Ot.preventDefault)||void 0===An||An.call(Ot)),r.ZY.div($,r.ZY.sub($,H,k),function Ct(Ot){return Ot[0]=C.clientWidth,Ot[1]=C.clientHeight,Ot}(J)),r.ZY.magnitude($)=4&&(_e=!0);const[Or,Jr]=$;Ae.next({x:fr,y:Dr,dx:Or,dy:Jr,pageX:jn,pageY:On,buttons:Y,button:ee,modifiers:ye(),isStart:Ir}),r.ZY.copy(k,H),Z=_.Moving}function Gt(Ot){if(!p(Ot.clientX,Ot.clientY))return;$t(H,Ot);const{pageX:An,pageY:jn}=Vt(Ot),[On,fr]=H;a&&Ot.preventDefault();const Dr=function m(u){let h=0,a=0,S=0,D=0,R=0;return"detail"in u&&(a=u.detail),"wheelDelta"in u&&(a=-u.wheelDelta/120),"wheelDeltaY"in u&&(a=-u.wheelDeltaY/120),"wheelDeltaX"in u&&(h=-u.wheelDeltaX/120),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(h=a,a=0),S=10*h,D=10*a,"deltaY"in u&&(D=u.deltaY),"deltaX"in u&&(S=u.deltaX),"deltaZ"in u&&(R=u.deltaZ),(S||D||R)&&u.deltaMode&&(1===u.deltaMode?(S*=40,D*=40,R*=40):(S*=800,D*=800,R*=800)),S&&!h&&(h=S<1?-1:1),D&&!a&&(a=D<1?-1:1),{spinX:h,spinY:a,dx:S,dy:D,dz:R}}(Ot);Y=ee=O.Flag.Auxilary,(Dr.dx||Dr.dy||Dr.dz)&&Ce.next({x:On,y:fr,pageX:An,pageY:jn,...Dr,buttons:Y,button:ee,modifiers:ye()})}function rn(Ot){var An,jn;T&&(Ot.preventDefault(),null===(An=Ot.stopImmediatePropagation)||void 0===An||An.call(Ot),null===(jn=Ot.stopPropagation)||void 0===jn||jn.call(Ot))}let tt=0,Mt=0;function nn(Ot){rn(Ot),tt=Ot.scale,Mt=Ot.rotation,ke.next({scale:Ot.scale,rotation:Ot.rotation,deltaRotation:0,deltaScale:0,isStart:!0})}function bn(Ot,An){ke.next({scale:Ot.scale,rotation:Ot.rotation,deltaRotation:Mt-Ot.rotation,deltaScale:tt-Ot.scale,isEnd:An}),Mt=Ot.rotation,tt=Ot.scale}function Dn(Ot){rn(Ot),bn(Ot)}function jt(Ot){rn(Ot),bn(Ot,!0)}function It(){L=C.clientWidth*de(),w=C.clientHeight*de(),Ne.next({})}function Dt(Ot){if(C instanceof Window||C instanceof Document||C===document.body)return!0;{const An=C.getBoundingClientRect();return Ot[0]>=0&&Ot[1]>=0&&Ot[0]{E=Ot,L=C.clientWidth*de(),w=C.clientHeight*de()},requestPointerLock:Ot=>{G=Ot,Q||C.requestPointerLock()},exitPointerLock:()=>{Q&&C.ownerDocument.exitPointerLock()},dispose:function re(){q||(q=!0,C.removeEventListener("contextmenu",se,!1),C.removeEventListener("wheel",Gt,!1),C.removeEventListener("mousedown",Ke,!1),window.removeEventListener("mousemove",ut,!1),window.removeEventListener("mouseup",Kt,!1),C.removeEventListener("touchstart",mt,!1),C.removeEventListener("touchmove",Me,!1),C.removeEventListener("touchend",_t,!1),C.removeEventListener("gesturechange",Dn,!1),C.removeEventListener("gesturestart",nn,!1),C.removeEventListener("gestureend",jt,!1),window.removeEventListener("blur",ge),window.removeEventListener("keyup",Le,!1),window.removeEventListener("keydown",Ie,!1),window.removeEventListener("keypress",nt,!1),document.removeEventListener("pointerlockchange",ve,!1),document.removeEventListener("pointerlockerror",ce,!1),yn.remove(),null!=xe?(xe.unobserve(C.parentElement),xe.disconnect()):window.removeEventListener("resize",It,!1))}}}},2293:(tn,Ue,n)=>{"use strict";function e(r){return{kind:"table-legend",table:r}}function o(r,t,A){return{kind:"scale-legend",minLabel:r,maxLabel:t,colors:A}}n.d(Ue,{A:()=>o,h:()=>e})},2229:(tn,Ue,n)=>{"use strict";var e,o;n.d(Ue,{x:()=>e}),(o=e||(e={})).message=function r(c){return{type:"message",timestamp:new Date,message:c}},o.error=function t(c){return{type:"error",timestamp:new Date,message:c}},o.warning=function A(c){return{type:"warning",timestamp:new Date,message:c}},o.info=function y(c){return{type:"info",timestamp:new Date,message:c}}},6825:(tn,Ue,n)=>{"use strict";n.d(Ue,{BH:()=>i,HX:()=>O,Ro:()=>v,ly:()=>c,sY:()=>A,uP:()=>y,xi:()=>t});var A,b,e=n(3543),o=n(9455),r=n(1372),t=function(b){return b[b.None=0]="None",b[b.Highlight=1]="Highlight",b[b.RemoveHighlight=2]="RemoveHighlight",b[b.Select=4]="Select",b[b.Deselect=8]="Deselect",b[b.Toggle=16]="Toggle",b[b.Clear=32]="Clear",b}(t||{});function y(b,_,M){b.fill(_,0,M)}function c(b,_,M){switch(M){case t.Highlight:b[_]|=1;break;case t.RemoveHighlight:b[_]&=-2;break;case t.Select:b[_]|=2;break;case t.Deselect:b[_]&=-3;break;case t.Toggle:b[_]^=2;break;case t.Clear:b[_]=0}}function i(b,_,M){if(M===t.None)return!1;if(e.IX.is(_)){const I=e.IX.start(_),l=e.IX.end(_),m=I+3>>2,u=m+(l-4*m>>2);if(u<=m){for(let S=I;S>2),s=I,C=Math.min(4*m,l),h=Math.max(I,4*u),a=l;switch(M){case t.Highlight:for(let S=m;S{"use strict";n.d(Ue,{i:()=>o});var r,e=n(8277);function o(r){return{...o.Zero,...r}}(r=o||(o={})).Zero={metalness:0,roughness:0,bumpiness:0},r.toArray=function t(c,i,v){return i[v]=255*c.metalness,i[v+1]=255*c.roughness,i[v+2]=255*c.bumpiness,i},r.toString=function A({metalness:c,roughness:i,bumpiness:v}){return`M ${c.toFixed(2)} | R ${i.toFixed(2)} | B ${v.toFixed(2)}`},r.getParam=function y(c){return e.t.Group({metalness:e.t.Numeric(0,{min:0,max:1,step:.01}),roughness:e.t.Numeric(1,{min:0,max:1,step:.01}),bumpiness:e.t.Numeric(0,{min:0,max:1,step:.01})},{...c,presets:[[{metalness:0,roughness:1,bumpiness:0},"Matte"],[{metalness:0,roughness:.2,bumpiness:0},"Plastic"],[{metalness:0,roughness:.6,bumpiness:0},"Glossy"],[{metalness:1,roughness:.6,bumpiness:0},"Metallic"]]})}},1094:(tn,Ue,n)=>{"use strict";function e(r){let t,A;return(...y)=>{if(!t||t.length!==y.length)return t=y,A=r.apply(void 0,y),A;for(let c=0,i=y.length;c{if(t.has(A))return t.get(A);const y=r(A);return t.set(A,y),y}}n.d(Ue,{E:()=>o,_:()=>e})},8484:(tn,Ue,n)=>{"use strict";n.d(Ue,{En:()=>o,K0:()=>e,em:()=>r});const e=typeof process<"u"&&null!=process.versions&&null!=process.versions.node,o=function t(){return typeof XMLHttpRequest>"u"||e?n(2684):XMLHttpRequest}(),r=function A(){if(typeof File>"u"||e){class y{arrayBuffer(){return this.blob.arrayBuffer()}slice(i,v,O){return this.blob.slice(i,v,O)}stream(){return this.blob.stream()}text(){return this.blob.text()}constructor(i,v,O){var b;this.blob=new Blob(i,O),this.size=this.blob.size,this.type=this.blob.type,this.name=v,this.lastModified=null!==(b=O?.lastModified)&&void 0!==b?b:0,this.webkitRelativePath=""}}return y}return File}()},9854:(tn,Ue,n)=>{"use strict";n.d(Ue,{H:()=>o,t:()=>e});const e=function(){if(typeof window<"u"&&window.performance){const r=window.performance;return()=>r.now()}return typeof process<"u"&&"undefined"!==process.hrtime&&"function"==typeof process.hrtime?()=>{const r=process.hrtime();return 1e3*r[0]+r[1]/1e6}:Date.now?()=>Date.now():()=>+new Date}();function o(r,t=!0){if(isNaN(r))return"n/a";const A=Math.floor(r/36e5),y=Math.floor(r/6e4%60),c=Math.floor(r/1e3%60);let i=Math.floor(r%1e3).toString();for(;i.length<3;)i="0"+i;for(;!t&&i.length>1&&"0"===i[i.length-1];)i=i.substr(0,i.length-1);return A>0?`${A}h${y}m${c}.${i}s`:y>0?`${y}m${c}.${i}s`:c>0?`${c}.${i}s`:`${r.toFixed(0)}ms`}},4951:(tn,Ue,n)=>{"use strict";n.d(Ue,{FO:()=>v,Gu:()=>r,OK:()=>t});var e=n(127),o=n(4369);function r(O,b,_){return O=(0,e.qE)(Math.round(O),0,16777215)+1,b[_+2]=O%256,O=Math.floor(O/256),b[_+1]=O%256,O=Math.floor(O/256),b[_]=O%256,b}function t(O,b,_){return 256*Math.floor(O)*256+256*Math.floor(b)+Math.floor(_)-1}const A=255/256,y=o.eB.create(16777216,65536,256),c=o.Zb.create(A/y[0],A/y[1],A/y[2],A/1),i=(0,o.Zb)();function v(O,b,_,M){return o.Zb.set(i,O/255,b/255,_/255,M/255),o.Zb.dot(i,c)}},229:(tn,Ue,n)=>{"use strict";function e(i,v,O){let _,b=1;for(_=0;_=0){const m=e(i[M],v,O);m<0?b=-1:m>b&&(b=m)}const l=Math.abs(i[M]);if(l>O){const m=Math.floor(Math.log10(Math.abs(l)))+1;m>_&&(_=m)}}return{mantissaDigits:b,integerDigits:_}}function t(i){i=i.trim();const v=parseInt(i,10);return!isNaN(v)&&v.toString()===i}function A(i){if(!isFinite(i))return 0;let v=1,O=0;for(;Math.round(i*v)/v!==i;)v*=10,++O;return O}function y(i,v){return parseFloat(i.toPrecision(v))}n.d(Ue,{Fq:()=>t,In:()=>r,QX:()=>y,XV:()=>A,bL:()=>o})},9359:(tn,Ue,n)=>{"use strict";n.d(Ue,{Go:()=>c,IF:()=>O,JW:()=>o,Wv:()=>y,bN:()=>t});const e=Object.prototype.hasOwnProperty;function o(u,d){for(const s of Object.keys(d))e.call(d,s)&&typeof u[s]>"u"&&(u[s]=d[s]);return u}function r(u,d){let s=!1;for(const C of Object.keys(d))if(e.call(d,C)&&d[C]!==u[C]){s=!0;break}return s?Object.assign({},u,d):u}function t(u,d){if(!u)return!d;if(!d)return!1;const s=Object.keys(u);if(Object.keys(d).length!==s.length)return!1;for(const C of s)if(!e.call(u,C)||u[C]!==d[C])return!1;return!0}function y(u,d){let s=u;for(let C=0;C{"use strict";n.d(Ue,{t:()=>c});var c,e=n(9909),o=n(4369),r=n(9359),t=n(7785),A=n(1907),y=n(1861);!function(i){function v(Oe,Se){return Se&&(Se.label&&(Oe.label=Se.label),Se.description&&(Oe.description=Se.description),Se.legend&&(Oe.legend=Se.legend),Se.fieldLabels&&(Oe.fieldLabels=Se.fieldLabels),Se.isHidden&&(Oe.isHidden=Se.isHidden),Se.shortLabel&&(Oe.shortLabel=Se.shortLabel),Se.twoColumns&&(Oe.twoColumns=Se.twoColumns),Se.isEssential&&(Oe.isEssential=Se.isEssential),Se.category&&(Oe.category=Se.category),Se.hideIf&&(Oe.hideIf=Se.hideIf),Se.help&&(Oe.help=Se.help)),Oe}function _(Oe,Se,Ve){return v({type:"select",defaultValue:we(Oe,Se),options:Se,cycle:Ve?.cycle},Ve)}function S(Oe,Se){return Se&&(typeof Se.min<"u"&&(Oe.min=Se.min),typeof Se.max<"u"&&(Oe.max=Se.max),typeof Se.step<"u"&&(Oe.step=Se.step)),Oe}function p(Oe,Se){const Ve=v({type:"group",defaultValue:Se?.customDefault||J(Oe),params:Oe},Se);return Se?.presets&&(Ve.presets=Se.presets),Se?.isExpanded&&(Ve.isExpanded=Se.isExpanded),Se?.isFlat&&(Ve.isFlat=Se.isFlat),Se?.pivot&&(Ve.pivot=Se.pivot),Ve}function Q(){return J(this.element)}function G(){throw new Error("getValue not set. Fix runtime.")}function J(Oe){const Se={};for(const Ve of Object.keys(Oe))Oe[Ve].isOptional||(Se[Ve]=Oe[Ve].defaultValue);return Se}function W(Oe,Se,Ve){return()=>Oe(Se,Ve)}function te(Oe,Se,Ve){if(Se)if("value-ref"===Oe.type){Se.getValue=Se.ref?W(Oe.resolveRef,Se.ref,Ve):()=>{throw new Error("Unset ref in ValueRef value.")}}else if("data-ref"===Oe.type){Se.getValue=Se.ref?W(Ve,Se.ref,Ve):()=>{throw new Error("Unset ref in ValueRef value.")}}else if("group"===Oe.type)j(Oe.params,Se,Ve);else if("mapped"===Oe.type){const Ne=Se;te(Oe.map(Ne.name),Ne.params,Ve)}else if("object-list"===Oe.type){if(!ye(Oe.element))return;for(const Ne of Se)j(Oe.element,Ne,Ve)}}function de(Oe){if("value-ref"===Oe.type||"data-ref"===Oe.type)return!0;if("group"===Oe.type){if(ye(Oe.params))return!0}else if("mapped"===Oe.type){for(const[Se]of Oe.select.options)if(de(Oe.map(Se)))return!0}else if("object-list"===Oe.type)return ye(Oe.element);return!1}function ye(Oe){for(const Se of Object.keys(Oe))if(de(Oe[Se]))return!0;return!1}function j(Oe,Se,Ve){for(const Ne of Object.keys(Oe))te(Oe[Ne],Se?.[Ne],Ve)}function ee(Oe,Se,Ve){if(Se===Ve)return!0;if("object"!=typeof Se||"object"!=typeof Ve)return!1;for(const Ne of Object.keys(Oe))if(!g(Oe[Ne],Se[Ne],Ve[Ne]))return!1;return!0}function g(Oe,Se,Ve){if(Se===Ve)return!0;if("group"===Oe.type)return ee(Oe.params,Se,Ve);if("mapped"===Oe.type){const Ne=Se,K=Ve;return Ne.name===K.name&&g(Oe.map(Ne.name),Ne.params,K.params)}if("multi-select"===Oe.type){const Ne=Se,K=Ve;if(Ne.length!==K.length)return!1;if(Ne.length<10){for(let ne=0,be=Ne.length;ne"u")return Ve?Oe.defaultValue:void 0;if(!le(Oe.select,Ne.name))return Oe.defaultValue;const K=Oe.map(Ne.name);return{name:Ne.name,params:Ae(K,Ne.params,Ve)}}if("select"===Oe.type)return le(Oe,Se)?Se:Oe.defaultValue;if("multi-select"===Oe.type){if(!Array.isArray(Se))return Oe.defaultValue;const Ne=Se.filter(function(K){return le(this,K)},Oe);return Se.length>0&&0===Ne.length?Oe.defaultValue:Ne}return"object-list"===Oe.type?Array.isArray(Se)?Se.map(Ne=>Be(Oe.element,Ne,Ve?"all":"skip")):Oe.defaultValue:Se}function Be(Oe,Se,Ve){if("object"!=typeof Se||null===Se)return Ve?J(Oe):Se;const Ne=Object.create(null);for(const K of Object.keys(Oe)){const ne=Oe[K];void 0===Se[K]?"all"===Ve&&(Ne[K]=ne.defaultValue):Ne[K]=Ae(ne,Se[K],"skip"!==Ve)}return Ne}function we(Oe,Se){for(const Ve of Se)if(Ve[0]===Oe)return Oe;return Se.length>0?Se[0][0]:void 0}i.Essential={isEssential:!0},i.Optional=function O(Oe){const Se={...Oe};return Se.isOptional=!0,Se},i.Value=function b(Oe,Se){return v({type:"value",defaultValue:Oe},Se)},i.Select=_,i.MultiSelect=function M(Oe,Se,Ve){const Ne=v({type:"multi-select",defaultValue:Oe,options:Se},Ve);return Ve?.emptyValue&&(Ne.emptyValue=Ve.emptyValue),Ne},i.Boolean=function I(Oe,Se){return v({type:"boolean",defaultValue:Oe},Se)},i.Text=function l(Oe="",Se){return v({type:"text",defaultValue:Oe,multiline:Se?.multiline,placeholder:Se?.placeholder,disableInteractiveUpdates:Se?.disableInteractiveUpdates},Se)},i.Color=function m(Oe,Se){const Ve=v({type:"color",defaultValue:Oe},Se);return Se?.isExpanded&&(Ve.isExpanded=Se.isExpanded),Ve},i.ColorList=function u(Oe,Se){let Ve;if("string"==typeof Oe){const Ne=(0,A.JA)(Oe);Ve={kind:"qualitative"!==Ne.type?"interpolate":"set",colors:Ne.list}}else Ve=Oe;return v({type:"color-list",presetKind:Se?.presetKind||"all",defaultValue:Ve,offsets:!!Se?.offsets},Se)},i.Vec3=function d(Oe,Se,Ve){return v(S({type:"vec3",defaultValue:Oe},Se),Ve)},i.Mat4=function s(Oe,Se){return v({type:"mat4",defaultValue:Oe},Se)},i.Url=function C(Oe,Se){return v({type:"url",defaultValue:"string"==typeof Oe?y.V.Url(Oe):y.V.Url(Oe.url,{body:Oe.body})},Se)},i.File=function h(Oe){const Se=v({type:"file",defaultValue:null},Oe);return Oe?.accept&&(Se.accept=Oe.accept),Se},i.FileList=function a(Oe){const Se=v({type:"file-list",defaultValue:null},Oe);return Oe?.accept&&(Se.accept=Oe.accept),Se},i.Numeric=function D(Oe,Se,Ve){const Ne=v(S({type:"number",defaultValue:Oe},Se),Ve);return Ve?.immediateUpdate&&(Ne.immediateUpdate=!0),Ne},i.Interval=function R(Oe,Se,Ve){return v(S({type:"interval",defaultValue:Oe},Se),Ve)},i.LineGraph=function f(Oe,Se){const Ve=v({type:"line-graph",defaultValue:Oe},Se);return Se?.getVolume&&(Ve.getVolume=Se.getVolume),Ve},i.Group=p,i.EmptyGroup=function E(Oe){return p({},Oe)},i.Mapped=function T(Oe,Se,Ve,Ne){const K=we(Oe,Se);return v({type:"mapped",defaultValue:{name:K,params:Ve(K).defaultValue},select:_(K,Se,Ne),map:Ve},Ne)},i.MappedStatic=function L(Oe,Se,Ve){const Ne=Ve?.options?Ve.options:Object.keys(Se).map(ne=>[ne,Se[ne].label||(0,t.Mk)(ne)]),K=we(Oe,Ne);return v({type:"mapped",defaultValue:{name:K,params:Se[K].defaultValue},select:_(K,Ne,Ve),map:ne=>Se[ne]},Ve)},i.ObjectList=function w(Oe,Se,Ve){return v({type:"object-list",element:Oe,getLabel:Se,ctor:Q,defaultValue:Ve?.defaultValue||[]},Ve)},i.ValueRef=function V(Oe,Se,Ve){var Ne;return v({type:"value-ref",defaultValue:{ref:null!==(Ne=Ve?.defaultRef)&&void 0!==Ne?Ne:"",getValue:G},getOptions:Oe,resolveRef:Se},Ve)},i.DataRef=function U(Oe){var Se;return v({type:"data-ref",defaultValue:{ref:null!==(Se=Oe?.defaultRef)&&void 0!==Se?Se:"",getValue:G}},Oe)},i.Converted=function N(Oe,Se,Ve){return v({type:"converted",defaultValue:Se(Ve.defaultValue),converted:Ve,fromValue:Oe,toValue:Se},Ve)},i.Conditioned=function k(Oe,Se,Ve,Ne,K){const ne=Object.keys(Se).map(be=>[be,be]);return v({type:"conditioned",select:_(Ve(Oe),ne,K),defaultValue:Oe,conditionParams:Se,conditionForValue:Ve,conditionedValue:Ne},K)},i.Script=function H(Oe,Se){return v({type:"script",defaultValue:Oe},Se)},i.For=function $(Oe){return 0},i.getDefaultValues=J,i.resolveRefs=j,i.setDefaultValues=function Z(Oe,Se){for(const Ve of Object.keys(Oe))Oe[Ve].isOptional||(Oe[Ve].defaultValue=Se[Ve])},i.clone=function q(Oe){return(0,r.Go)(Oe)},i.validate=function Y(Oe,Se){},i.areEqual=ee,i.isParamEqual=g,i.merge=_e,i.mergeParam=xe,i.normalizeParams=Be,i.objectToOptions=function Ce(Oe,Se){const Ve=[];for(const Ne of Object.keys(Oe))if(Se){const K=Se(Ne,Oe[Ne]);Ve.push("string"==typeof K?[Ne,K]:[Ne,K[0],K[1]])}else Ve.push("string"==typeof Oe[Ne]?[Ne,Oe[Ne]]:[Ne,null===Se?Ne:(0,t.Mk)(Ne)]);return Ve},i.arrayToOptions=function Re(Oe,Se){const Ve=[];for(const Ne of Oe)Ve.push(Se?[Ne,Se(Ne)]:[Ne,null===Se?Ne:(0,t.Mk)(Ne)]);return Ve},i.optionLabel=function ke(Oe,Se){for(const Ve of Oe.options)if(Ve[0]===Se)return Ve[1];return""}}(c||(c={}))},8956:(tn,Ue,n)=>{"use strict";n.d(Ue,{V:()=>r});var r,e=n(1413),o=n(4412);(r||(r={})).create=function y(){const c=new t,i=()=>c.create();return i.dispose=()=>c.dispose(),i.behavior=v=>c.behavior(v),i};class t{constructor(){this._eventList=[],this._disposed=!1}create(){const y=new e.B;return this._eventList.push(y),y}behavior(y){const c=new o.t(y);return this._eventList.push(c),c}dispose(){if(!this._disposed){for(const y of this._eventList)y.complete();this._disposed=!0}}}},9986:(tn,Ue,n)=>{"use strict";var e,o;n.d(Ue,{M:()=>e}),(o=e||(e={})).toArray=function r(l){return Array.from(l.values())},o.isSuperset=function t(l,m){if(l===m)return!0;if(l.size0;l.size{"use strict";var e;n.d(Ue,{f:()=>e}),function(o){o.create=function r(a=512){return{current:[],offset:0,capacity:a,chunks:[]}},o.getString=function t(a){return a.chunks.length?(a.offset>0&&(a.chunks[a.chunks.length]=a.current.length===a.offset?a.current.join(""):a.current.slice(0,a.offset).join("")),a.chunks.join("")):a.current.length===a.offset?a.current.join(""):a.current.splice(0,a.offset).join("")},o.getSize=function A(a){let S=0;for(const D of a.chunks)S+=D.length;for(let D=0;D0&&(a.chunks[a.chunks.length]=a.current.length===a.offset?a.current.join(""):a.current.slice(0,a.offset).join(""),a.offset=0),a.chunks};const c=[];function v(a,S){S>0&&_(a,c[S])}function _(a,S){a.offset===a.capacity&&(a.chunks[a.chunks.length]=a.current.join(""),a.offset=0),a.current[a.offset++]=S}!function(){let a="";for(let S=0;S<512;S++)c[S]=a,a+=" "}(),o.newline=function i(a){_(a,"\n")},o.whitespace=v,o.whitespace1=function O(a){_(a," ")},o.write=function b(a,S){S&&(a.offset===a.capacity&&(a.chunks[a.chunks.length]=a.current.join(""),a.offset=0),a.current[a.offset++]=S)},o.writeSafe=_,o.writePadLeft=function M(a,S,D){S?(v(a,D-S.length),_(a,S)):v(a,D)},o.writePadRight=function I(a,S,D){if(!S)return void v(a,D);const R=D-S.length;_(a,S),v(a,R)},o.writeInteger=function l(a,S){_(a,""+S)},o.writeIntegerAndSpace=function m(a,S){_(a,S+" ")},o.writeIntegerPadLeft=function u(a,S,D){const R=""+S;v(a,D-R.length),_(a,R)},o.writeIntegerPadRight=function d(a,S,D){const R=""+S,f=D-R.length;_(a,R),v(a,f)},o.writeFloat=function s(a,S,D){_(a,""+Math.round(D*S)/D)},o.writeFloatPadLeft=function C(a,S,D,R){const f=""+Math.round(D*S)/D;v(a,R-f.length),_(a,f)},o.writeFloatPadRight=function h(a,S,D,R){const f=""+Math.round(D*S)/D,p=R-f.length;_(a,f),v(a,p)}}(e||(e={}))},7785:(tn,Ue,n)=>{"use strict";function r(h,a=" "){return h.replace(/([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g,`$1${a}$2`)}function t(h){return i(r(h))}n.d(Ue,{GW:()=>l,Hh:()=>t,Kq:()=>s,LX:()=>I,Mk:()=>M,Nt:()=>C,ZH:()=>i,r4:()=>c});const y=h=>h.toUpperCase();function c(h){return h?"string"==typeof h?h.toUpperCase():`${h}`.toUpperCase():""}function i(h){return h.toLowerCase().replace(/^\w|\s\w/g,y)}function M(h){return i(r(function v(h){return h.replace(/_/g," ")}(function b(h){return h.replace(/-/g," ")}(h))))}function I(h,a,S,D){const R=D.length;if(R>S-a)return!1;for(let f=0;f]+>/g,"")}function C(h){return h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},1372:(tn,Ue,n)=>{"use strict";function e(t){return Object.keys(t)}function o(t){throw new Error("unreachable")}function r(t){return"function"==typeof t?.then}n.d(Ue,{$X:()=>r,dr:()=>o,mX:()=>e})},5091:(tn,Ue,n)=>{"use strict";function o(r,t){return`${r}${"/"===r[r.length-1]||"/"===t[0]?"":"/"}${t}`}n.d(Ue,{r:()=>o})},3559:(tn,Ue,n)=>{"use strict";n.d(Ue,{k:()=>o});var o,e=n(9854);!function(r){const t=typeof btoa<"u"?btoa:v=>Buffer.from(v).toString("base64"),A=[];r.create22=function y(){let v=+new Date+(0,e.t)();for(let O=0;O<16;O++)A[O]=String.fromCharCode((v+255*Math.random())%255|0),v=Math.floor(v/255);return t(A.join("")).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22)},r.createv4=function c(){let v=+new Date+(0,e.t)();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){const _=(v+16*Math.random())%16|0;return v=Math.floor(v/16),("x"===b?_:3&_|8).toString(16)})},r.is=function i(v){return"string"==typeof v}}(o||(o={}))},7187:(tn,Ue,n)=>{"use strict";n.d(Ue,{IQ:()=>A,xv:()=>t});var o,y,e=n(7778);(y=o||(o={})).create=function c(v){return{ref:v}},y.set=function i(v,O){return v.ref=O,v};const r=(0,e.q)(0,2147483647);var t,A;!function(y){y.create=function c(v,O){return{id:r(),version:0,value:v,metadata:O}},y.withValue=function i(v,O){return{id:v.id,version:v.version+1,value:O,metadata:v.metadata}}}(t||(t={})),function(y){function i(b,_){return o.set(b,t.withValue(b.ref,_))}y.create=function c(b,_){return o.create(t.create(b,_))},y.update=i,y.set=function v(b,_){return o.set(b,_)},y.updateIfChanged=function O(b,_){return b.ref.value!==_?i(b,_):b}}(A||(A={}))},6985:(tn,Ue,n)=>{"use strict";n.d(Ue,{qQ:()=>ie,Aq:()=>Ve,$1:()=>Be});var e=n(467);function t(se,ae){return se[ae]|se[ae+1]<<8}function A(se,ae,ge){se[ae]=255&ge,se[ae+1]=ge>>8&255}function y(se,ae){return 16777216*se[ae+3]+(se[ae+2]<<16|se[ae+1]<<8|se[ae])}function c(se,ae,ge){se[ae]=255&ge,se[ae+1]=ge>>8&255,se[ae+2]=ge>>16&255,se[ae+3]=ge>>24&255}function v(se){return se.length<2?"0"+se:se}function _(se){const ae=se.length;let ge=0;for(let Ie=0;Ie>>1:ge>>>=1;se[ae]=ge}return se}();function l(se,ae,ge){return 4294967295^function I(se,ae,ge,Ie){for(let Le=0;Le>>8;return se}(4294967295,se,ae,ge)}const u=function(){const se=Uint16Array,ae=Uint32Array;return{next_code:new se(16),bl_count:new se(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 se(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 ae(32),flmap:new se(512),fltree:[],fdmap:new se(32),fdtree:[],lmap:new se(32768),ltree:[],ttree:[],dmap:new se(32768),dtree:[],imap:new se(512),itree:[],rev15:new se(32768),lhst:new ae(286),dhst:new ae(30),ihst:new ae(19),lits:new ae(15e3),strt:new se(65536),prev:new se(32768)}}();function d(se,ae,ge){const Ie=se.length,Le=u.rev15;for(let nt=0;nt>1<<4|Lt,en=ae-Lt;let Bt=se[nt]<>>15-ae]=Je,Bt++}}function s(se,ae){const ge=se.length,Ie=u.bl_count;for(let je=0;je<=ae;je++)Ie[je]=0;for(let je=1;je>>Ie}function a(se,ae){const{data:ge,noBuf:Ie}=se;let{buf:Le,BFINAL:nt,off:je,pos:Lt}=se,Je=0;for(;0===nt&&Jeut&&(ut=yt)}Lt+=3*Ke,s(u.itree,ut),d(u.itree,ut,u.imap),en=u.lmap,Bt=u.dmap,Lt=f(u.imap,(1<>>4;if(Me>>>8){if(256===Me)break;{let Ke=je+Me-254;if(Me>264){const yt=u.ldef[Me-257];Ke=je+(yt>>>3)+E(ge,Lt,7&yt),Lt+=7&yt}const ut=Bt[L(ge,Lt)&$e];Lt+=15&ut;const sn=u.ddef[ut>>>4],gt=(sn>>>4)+T(ge,Lt,15&sn);for(Lt+=15&sn,Ie&&(Le=R(Le,je+(1<<17)));je>>3),Me=ge[_t-4]|ge[_t-3]<<8;Ie&&(Le=R(Le,je+Me)),Le.set(new Uint8Array(ge.buffer,ge.byteOffset+_t,Me),je),Lt=_t+Me<<3,je+=Me}}se.buf=Le,se.BFINAL=nt,se.off=je,se.pos=Lt}function D(){return(D=(0,e.A)(function*(se,ae,ge){if(3===ae[0]&&0===ae[1])return ge||new Uint8Array(0);const Ie=function h(se,ae){const ge=void 0===ae;return void 0===ae&&(ae=new Uint8Array(se.length>>>2<<3)),{data:se,buf:ae,noBuf:ge,BFINAL:0,off:0,pos:0}}(ae,ge);for(;0===Ie.BFINAL;)se.shouldUpdate&&(yield se.update({message:"Inflating blocks...",current:Ie.pos,max:ae.length})),a(Ie,100);return Ie.buf.length===Ie.off?Ie.buf:Ie.buf.slice(0,Ie.off)})).apply(this,arguments)}function R(se,ae){const ge=se.length;if(ae<=ge)return se;const Ie=new Uint8Array(Math.max(ge<<1,ae));return Ie.set(se,0),Ie}function f(se,ae,ge,Ie,Le,nt){let je=0;for(;je>>4;if(Je<=15)nt[je]=Je,je++;else{let en=0,Bt=0;16===Je?(Bt=3+E(Ie,Le,2),Le+=2,en=nt[je-1]):17===Je?(Bt=3+E(Ie,Le,3),Le+=3):18===Je&&(Bt=11+E(Ie,Le,7),Le+=7);const pn=je+Bt;for(;je>>1;for(;ntLe&&(Le=Lt),nt++}for(;nt>>3]|se[1+(ae>>>3)]<<8)>>>(7&ae)&(1<>>3]|se[1+(ae>>>3)]<<8|se[2+(ae>>>3)]<<16)>>>(7&ae)&(1<>>3]|se[1+(ae>>>3)]<<8|se[2+(ae>>>3)]<<16)>>>(7&ae)}!function(){for(let ge=0;ge<32768;ge++){let Ie=ge;Ie=(2863311530&Ie)>>>1|(1431655765&Ie)<<1,Ie=(3435973836&Ie)>>>2|(858993459&Ie)<<2,Ie=(4042322160&Ie)>>>4|(252645135&Ie)<<4,Ie=(4278255360&Ie)>>>8|(16711935&Ie)<<8,u.rev15[ge]=(Ie>>>16|Ie<<16)>>>17}function ae(ge,Ie,Le){for(;0!=Ie--;)ge.push(0,Le)}for(let ge=0;ge<32;ge++)u.ldef[ge]=u.of0[ge]<<3|u.exb[ge],u.ddef[ge]=u.df0[ge]<<4|u.dxb[ge];ae(u.fltree,144,8),ae(u.fltree,112,9),ae(u.fltree,24,7),ae(u.fltree,8,8),s(u.fltree,9),d(u.fltree,9,u.flmap),C(u.fltree,9),ae(u.fdtree,32,5),s(u.fdtree,5),d(u.fdtree,5,u.fdmap),C(u.fdtree,5),ae(u.itree,19,0),ae(u.ltree,286,0),ae(u.dtree,30,0),ae(u.ttree,320,0)}();var w=n(1372);function Q(se,ae,ge){const Ie=[],Le=se.length,nt=ae.length;for(let _t=0;_tge&&(function V(se,ae,ge){let Ie=0,Le=0;const nt=1<ae;Ie++){const je=se[Ie].d;se[Ie].d=ae,Le+=nt-(1<>>=ge-ae;Le>0;){const je=se[Ie].d;je=0;Ie--)se[Ie].d===ae&&Le<0&&(se[Ie].d--,Le++);0!==Le&&console.log("debt left")}(Lt,ge,mt),mt=ge);for(let _t=0;_t14e3||Bt>26697)&&Ie-je>100&&(Je>>16,yt=65535&sn,At=ee(gt,u.of0);u.lhst[257+At]++;const Gt=ee(yt,u.df0);u.dhst[Gt]++,$e+=u.exb[At]+u.dxb[Gt],Me[en]=gt<<23|je-Je,Me[en+1]=yt<<16|At<<8|Gt,en+=2,Je=je+gt}else u.lhst[ge[je]]++;Bt++}}se.i=je,se.pos=Lt,se.cvrd=Je,se.li=en,se.lc=Bt,se.bs=pn,se.ebits=$e,se.c=mt,se.nc=_t}const k=[[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 $(){return($=(0,e.A)(function*(se,ae,ge,Ie,Le){const nt=function U(se,ae,ge,Ie){const{lits:Le,strt:nt,prev:je}=u;return{data:se,out:ae,opt:k[Ie],i:0,pos:ge<<3,cvrd:0,dlen:se.length,li:0,lc:0,bs:0,ebits:0,c:0,nc:0,lits:Le,strt:nt,prev:je}}(ae,ge,Ie,Le),{dlen:je}=nt;if(0===Le){let{i:_t,pos:Me}=nt;for(;_t>>3}for(je>2&&(nt.nc=te(ae,0),nt.strt[nt.nc]=0);nt.i>>3})).apply(this,arguments)}function J(se,ae,ge,Ie,Le,nt){let je=32767&ae,Lt=ge[je],Je=je-Lt+32768&32767;if(Lt===je||Ie!==te(se,ae-Je))return 0;let en=0,Bt=0;const pn=Math.min(32767,ae);for(;Je<=pn&&0!=--nt&&Lt!==je;){if(0===en||se[ae+en]===se[ae+en-Je]){let $e=W(se,ae,Je);if($e>en){if(en=$e,Bt=Je,en>=Le)break;Je+2<$e&&($e=Je+2);let mt=0;for(let _t=0;_t<$e-2;_t++){const Me=ae-Je+_t+32768&32767,ut=Me-ge[Me]+32768&32767;ut>mt&&(mt=ut,Lt=Me)}}}je=Lt,Lt=ge[je],Je+=je-Lt+32768&32767}return en<<16|Bt}function W(se,ae,ge){if(se[ae]!==se[ae-ge]||se[ae+1]!==se[ae+1-ge]||se[ae+2]!==se[ae+2-ge])return 0;const Ie=ae,Le=Math.min(se.length,ae+258);for(ae+=3;ae4&&0===u.itree[1+(u.ordr[Lt-1]<<1)];)Lt--;return[se,ae,je,Ie,nt,Lt,ge,Le]}(),ut=32+(Je+3&7?8-(Je+3&7):0)+(je<<3),Kt=Ie+Z(u.fltree,u.lhst)+Z(u.fdtree,u.dhst);let sn=Ie+Z(u.ltree,u.lhst)+Z(u.dtree,u.dhst);sn+=14+3*_t+Z(u.itree,u.ihst)+(2*u.ihst[16]+3*u.ihst[17]+7*u.ihst[18]);for(let yt=0;yt<286;yt++)u.lhst[yt]=0;for(let yt=0;yt<30;yt++)u.dhst[yt]=0;for(let yt=0;yt<19;yt++)u.ihst[yt]=0;const gt=ut>>23,nn=Gt+(8388607&tt);for(;Gt>16,jt=bn>>8&255,It=255&bn;_e(Lt,Je=g(257+jt,yt,Lt,Je),Mt-u.of0[jt]),xe(Lt,Je=g(It,At,Lt,Je+=u.exb[jt]),Dn-u.df0[It]),Je+=u.dxb[It],Gt+=Mt}}Je=g(256,yt,Lt,Je)}return Je}function ye(se,ae,ge,Ie,Le){let nt=Le>>>3;return Ie[nt]=ge,Ie[nt+1]=ge>>>8,Ie[nt+2]=255-Ie[nt],Ie[nt+3]=255-Ie[nt+1],nt+=4,Ie.set(new Uint8Array(se.buffer,ae,ge),nt),Le+(ge+4<<3)}function Z(se,ae){let ge=0;for(let Ie=0;Ie15&&(_e(ge,Ie,je),Ie+=Lt)}return Ie}function Y(se,ae){let ge=se.length;for(;2!==ge&&0===se[ge-1];)ge-=2;for(let Ie=0;Ie>>1,138);en<11?ae.push(17,en-3):ae.push(18,en-11),Ie+=2*en-2}else if(Le===Lt&&nt===Le&&je===Le){let Je=Ie+5;for(;Je+2>>1,6);ae.push(16,en-3),Ie+=2*en-2}else ae.push(Le,0)}return ge>>>1}function ee(se,ae){let ge=0;return ae[16|ge]<=se&&(ge|=16),ae[8|ge]<=se&&(ge|=8),ae[4|ge]<=se&&(ge|=4),ae[2|ge]<=se&&(ge|=2),ae[1|ge]<=se&&(ge|=1),ge}function g(se,ae,ge,Ie){return xe(ge,Ie,ae[se<<1]),Ie+ae[1+(se<<1)]}function _e(se,ae,ge){const Ie=ae>>>3;se[Ie]|=ge<<=7&ae,se[Ie+1]|=ge>>>8}function xe(se,ae,ge){const Ie=ae>>>3;se[Ie]|=ge<<=7&ae,se[Ie+1]|=ge>>>8,se[Ie+2]|=ge>>>16}var le=n(4824);function Be(se,ae){return Ce.apply(this,arguments)}function Ce(){return(Ce=(0,e.A)(function*(se,ae,ge=!1){const Ie=Object.create(null),Le=new Uint8Array(ae);if(19280!==t(Le,0))throw new Error('Invalid ZIP file. A valid ZIP file must start with two magic bytes \\x50\\x4b ("PK" in ASCII).');let nt=Le.length-4;for(;101010256!==y(Le,nt);)nt--;let je=nt;je+=4,je+=4;const Lt=t(Le,je);je+=2,je+=2,je+=4;const Je=y(Le,je);je+=4,je=Je;for(let en=0;enfunction ue(se,ae){return re.apply(this,arguments)}(ge,se,ae))}function re(){return(re=(0,e.A)(function*(se,ae,ge=!1){let Ie=0;const Le={};for(const pn in ae){const $e=!ve(pn)&&!ge,mt=ae[pn],_t=l(mt,0,mt.length);Le[pn]={cpr:$e,usize:mt.length,crc:_t,file:$e?yield be(se,mt):mt}}for(const pn in Le)Ie+=Le[pn].file.length+30+46+2*_(pn);Ie+=22;const nt=new Uint8Array(Ie);let je=0;const Lt=[];for(const pn in Le){const $e=Le[pn];Lt.push(je),je=ce(nt,je,pn,$e,0)}let Je=0;const en=je;for(const pn in Le){const $e=Le[pn];Lt.push(je),je=ce(nt,je,pn,$e,1,Lt[Je++])}const Bt=je-en;return c(nt,je,101010256),je+=4,je+=4,A(nt,je,Je),je+=2,A(nt,je,Je),je+=2,c(nt,je,Bt),je+=4,c(nt,je,en),je+=4,je+=2,nt.buffer})).apply(this,arguments)}function ve(se){const ae=se.split(".").pop().toLowerCase();return-1!=="png,jpg,jpeg,zip".indexOf(ae)}function ce(se,ae,ge,Ie,Le,nt=0){const je=Ie.file;c(se,ae,0===Le?67324752:33639248),ae+=4,1===Le&&(ae+=2),A(se,ae,20),A(se,ae+=2,0),A(se,ae+=2,Ie.cpr?8:0),c(se,ae+=2,0),c(se,ae+=4,Ie.crc),c(se,ae+=4,je.length),c(se,ae+=4,Ie.usize),A(se,ae+=4,_(ge)),A(se,ae+=2,0),ae+=2,1===Le&&(ae+=2,ae+=2,c(se,ae+=6,nt),ae+=4);const Lt=function b(se,ae,ge){const Ie=ge.length;let Le=0;for(let nt=0;nt>18,se[ae+Le+1]=128|je>>12&63,se[ae+Le+2]=128|je>>6&63,se[ae+Le+3]=128|63&je,Le+=4}else se[ae+Le]=224|je>>12,se[ae+Le+1]=128|je>>6&63,se[ae+Le+2]=128|63&je,Le+=3;else se[ae+Le]=192|je>>6,se[ae+Le+1]=128|63&je,Le+=2;else se[ae+Le]=je,Le++}return Le}(se,ae,ge);return ae+=Lt,0===Le&&(se.set(je,ae),ae+=je.length),ae}},2209:(tn,Ue,n)=>{"use strict";var e=n(1395),o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function c(i,v,O){var b,_={},M=null,I=null;for(b in void 0!==O&&(M=""+O),void 0!==v.key&&(M=""+v.key),void 0!==v.ref&&(I=v.ref),v)t.call(v,b)&&!y.hasOwnProperty(b)&&(_[b]=v[b]);if(i&&i.defaultProps)for(b in v=i.defaultProps)void 0===_[b]&&(_[b]=v[b]);return{$$typeof:o,type:i,key:M,ref:I,props:_,_owner:A.current}}Ue.Fragment=r,Ue.jsx=c,Ue.jsxs=c},330:(tn,Ue)=>{"use strict";var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),y=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),b=Symbol.iterator,M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,l={};function m(k,H,$){this.props=k,this.context=H,this.refs=l,this.updater=$||M}function u(){}function d(k,H,$){this.props=k,this.context=H,this.refs=l,this.updater=$||M}m.prototype.isReactComponent={},m.prototype.setState=function(k,H){if("object"!=typeof k&&"function"!=typeof k&&null!=k)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,H,"setState")},m.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")},u.prototype=m.prototype;var s=d.prototype=new u;s.constructor=d,I(s,m.prototype),s.isPureReactComponent=!0;var C=Array.isArray,h=Object.prototype.hasOwnProperty,a={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function D(k,H,$){var J,W={},te=null,de=null;if(null!=H)for(J in void 0!==H.ref&&(de=H.ref),void 0!==H.key&&(te=""+H.key),H)h.call(H,J)&&!S.hasOwnProperty(J)&&(W[J]=H[J]);var ye=arguments.length-2;if(1===ye)W.children=$;else if(1{"use strict";tn.exports=n(330)},9619:(tn,Ue,n)=>{"use strict";tn.exports=n(2209)},2771:(tn,Ue,n)=>{"use strict";n.d(Ue,{m:()=>r});var e=n(1413),o=n(6129);class r extends e.B{constructor(A=1/0,y=1/0,c=o.U){super(),this._bufferSize=A,this._windowTime=y,this._timestampProvider=c,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=y===1/0,this._bufferSize=Math.max(1,A),this._windowTime=Math.max(1,y)}next(A){const{isStopped:y,_buffer:c,_infiniteTimeWindow:i,_timestampProvider:v,_windowTime:O}=this;y||(c.push(A),!i&&c.push(v.now()+O)),this._trimBuffer(),super.next(A)}_subscribe(A){this._throwIfClosed(),this._trimBuffer();const y=this._innerSubscribe(A),{_infiniteTimeWindow:c,_buffer:i}=this,v=i.slice();for(let O=0;O{"use strict";n.d(Ue,{h:()=>y});var e=n(6365),o=n(8750),r=n(983),t=n(9326),A=n(6648);function y(...c){const i=(0,t.lI)(c),v=(0,t.R0)(c,1/0),O=c;return O.length?1===O.length?(0,o.Tg)(O[0]):(0,e.U)(v)((0,A.H)(O,i)):r.w}},1584:(tn,Ue,n)=>{"use strict";n.d(Ue,{O:()=>A});var e=n(1985),o=n(8839),r=n(9470);function A(y=0,c,i=o.b){let v=-1;return null!=c&&((0,r.m)(c)?i=c:v=c),new e.c(O=>{let b=function t(y){return y instanceof Date&&!isNaN(y)}(y)?+y-i.now():y;b<0&&(b=0);let _=0;return i.schedule(function(){O.closed||(O.next(_++),0<=v?this.schedule(void 0,v):O.complete())},b)})}},140:(tn,Ue,n)=>{"use strict";n.d(Ue,{v:()=>i});var e=n(1983),o=n(9974),r=n(2326),t=n(6450),A=n(1203),y=n(9326);function c(...v){const O=(0,y.ms)(v);return O?(0,A.F)(c(...v),(0,t.I)(O)):(0,o.N)((b,_)=>{(0,e.P)([b,...(0,r.K)(v)])(_)})}function i(...v){return c(...v)}},152:(tn,Ue,n)=>{"use strict";n.d(Ue,{B:()=>t});var e=n(8839),o=n(9974),r=n(4360);function t(A,y=e.E){return(0,o.N)((c,i)=>{let v=null,O=null,b=null;const _=()=>{if(v){v.unsubscribe(),v=null;const I=O;O=null,i.next(I)}};function M(){const I=b+A,l=y.now();if(l{O=I,b=y.now(),v||(v=y.schedule(M,A),i.add(v))},()=>{_(),i.complete()},void 0,()=>{O=v=null}))})}},3294:(tn,Ue,n)=>{"use strict";n.d(Ue,{F:()=>t});var e=n(3669),o=n(9974),r=n(4360);function t(y,c=e.D){return y=y??A,(0,o.N)((i,v)=>{let O,b=!0;i.subscribe((0,r._)(v,_=>{const M=c(_);(b||!y(O,M))&&(b=!1,O=M,v.next(_))}))})}function A(y,c){return y===c}},9568:(tn,Ue,n)=>{"use strict";n.d(Ue,{t:()=>i});var e=n(2771),o=n(8750),r=n(1413),t=n(7707),A=n(9974);function c(v,O,...b){if(!0===O)return void v();if(!1===O)return;const _=new t.Ms({next:()=>{_.unsubscribe(),v()}});return(0,o.Tg)(O(...b)).subscribe(_)}function i(v,O,b){let _,M=!1;return v&&"object"==typeof v?({bufferSize:_=1/0,windowTime:O=1/0,refCount:M=!1,scheduler:b}=v):_=v??1/0,function y(v={}){const{connector:O=(()=>new r.B),resetOnError:b=!0,resetOnComplete:_=!0,resetOnRefCountZero:M=!0}=v;return I=>{let l,m,u,d=0,s=!1,C=!1;const h=()=>{m?.unsubscribe(),m=void 0},a=()=>{h(),l=u=void 0,s=C=!1},S=()=>{const D=l;a(),D?.unsubscribe()};return(0,A.N)((D,R)=>{d++,!C&&!s&&h();const f=u=u??O();R.add(()=>{d--,0===d&&!C&&!s&&(m=c(S,M))}),f.subscribe(R),!l&&d>0&&(l=new t.Ms({next:p=>f.next(p),error:p=>{C=!0,h(),m=c(a,b,p),f.error(p)},complete:()=>{s=!0,h(),m=c(a,_),f.complete()}}),(0,o.Tg)(D).subscribe(l))})(I)}}({connector:()=>new e.m(_,O,b),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:M})}},3386:(tn,Ue,n)=>{"use strict";n.d(Ue,{c:()=>c});var e=n(8839),o=n(9974),r=n(4360),t=n(8750),y=n(1584);function c(i,v=e.E,O){const b=(0,y.O)(i,v);return function A(i,v){return(0,o.N)((O,b)=>{const{leading:_=!0,trailing:M=!1}=v??{};let I=!1,l=null,m=null,u=!1;const d=()=>{m?.unsubscribe(),m=null,M&&(h(),u&&b.complete())},s=()=>{m=null,u&&b.complete()},C=a=>m=(0,t.Tg)(i(a)).subscribe((0,r._)(b,d,s)),h=()=>{if(I){I=!1;const a=l;l=null,b.next(a),!u&&C(a)}};O.subscribe((0,r._)(b,a=>{I=!0,l=a,(!m||m.closed)&&(_?h():C(a))},()=>{u=!0,(!(M&&I&&m)||m.closed)&&b.complete()}))})}(()=>b,O)}},8839:(tn,Ue,n)=>{"use strict";n.d(Ue,{b:()=>O,E:()=>v});var e=n(8359);class o extends e.yU{constructor(_,M){super()}schedule(_,M=0){return this}}const r={setInterval(b,_,...M){const{delegate:I}=r;return I?.setInterval?I.setInterval(b,_,...M):setInterval(b,_,...M)},clearInterval(b){const{delegate:_}=r;return(_?.clearInterval||clearInterval)(b)},delegate:void 0};var t=n(7908),y=n(6129);class c{constructor(_,M=c.now){this.schedulerActionCtor=_,this.now=M}schedule(_,M=0,I){return new this.schedulerActionCtor(this,_).schedule(I,M)}}c.now=y.U.now;const v=new class i extends c{constructor(_,M=c.now){super(_,M),this.actions=[],this._active=!1}flush(_){const{actions:M}=this;if(this._active)return void M.push(_);let I;this._active=!0;do{if(I=_.execute(_.state,_.delay))break}while(_=M.shift());if(this._active=!1,I){for(;_=M.shift();)_.unsubscribe();throw I}}}(class A extends o{constructor(_,M){super(_,M),this.scheduler=_,this.work=M,this.pending=!1}schedule(_,M=0){var I;if(this.closed)return this;this.state=_;const l=this.id,m=this.scheduler;return null!=l&&(this.id=this.recycleAsyncId(m,l,M)),this.pending=!0,this.delay=M,this.id=null!==(I=this.id)&&void 0!==I?I:this.requestAsyncId(m,this.id,M),this}requestAsyncId(_,M,I=0){return r.setInterval(_.flush.bind(_,this),I)}recycleAsyncId(_,M,I=0){if(null!=I&&this.delay===I&&!1===this.pending)return M;null!=M&&r.clearInterval(M)}execute(_,M){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const I=this._execute(_,M);if(I)return I;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(_,M){let l,I=!1;try{this.work(_)}catch(m){I=!0,l=m||new Error("Scheduled action threw falsy error")}if(I)return this.unsubscribe(),l}unsubscribe(){if(!this.closed){const{id:_,scheduler:M}=this,{actions:I}=M;this.work=this.state=this.scheduler=null,this.pending=!1,(0,t.o)(I,this),null!=_&&(this.id=this.recycleAsyncId(M,_,null)),this.delay=null,super.unsubscribe()}}}),O=v},6129:(tn,Ue,n)=>{"use strict";n.d(Ue,{U:()=>e});const e={now:()=>(e.delegate||Date).now(),delegate:void 0}},2326:(tn,Ue,n)=>{"use strict";n.d(Ue,{K:()=>o});const{isArray:e}=Array;function o(r){return 1===r.length&&e(r[0])?r[0]:r}},2684:tn=>{tn.exports=XMLHttpRequest},1025:(tn,Ue,n)=>{"use strict";n.d(Ue,{ht:()=>Re,jM:()=>Be});var e=Symbol.for("immer-nothing"),o=Symbol.for("immer-draftable"),r=Symbol.for("immer-state");function A(K,...ne){throw new Error(`[Immer] minified error nr: ${K}. Full error at: https://bit.ly/3cXEKWf`)}var y=Object.getPrototypeOf;function c(K){return!!K&&!!K[r]}function i(K){return!!K&&(O(K)||Array.isArray(K)||!!K[o]||!!K.constructor?.[o]||d(K)||s(K))}var v=Object.prototype.constructor.toString();function O(K){if(!K||"object"!=typeof K)return!1;const ne=y(K);if(null===ne)return!0;const be=Object.hasOwnProperty.call(ne,"constructor")&&ne.constructor;return be===Object||"function"==typeof be&&Function.toString.call(be)===v}function _(K,ne){0===M(K)?Reflect.ownKeys(K).forEach(be=>{ne(be,K[be],K)}):K.forEach((be,Te)=>ne(Te,be,K))}function M(K){const ne=K[r];return ne?ne.type_:Array.isArray(K)?1:d(K)?2:s(K)?3:0}function I(K,ne){return 2===M(K)?K.has(ne):Object.prototype.hasOwnProperty.call(K,ne)}function m(K,ne,be){const Te=M(K);2===Te?K.set(ne,be):3===Te?K.add(be):K[ne]=be}function d(K){return K instanceof Map}function s(K){return K instanceof Set}function C(K){return K.copy_||K.base_}function h(K,ne){if(d(K))return new Map(K);if(s(K))return new Set(K);if(Array.isArray(K))return Array.prototype.slice.call(K);const be=O(K);if(!0===ne||"class_only"===ne&&!be){const Te=Object.getOwnPropertyDescriptors(K);delete Te[r];let ie=Reflect.ownKeys(Te);for(let ue=0;ue1&&(K.set=K.add=K.clear=K.delete=S),Object.freeze(K),ne&&Object.entries(K).forEach(([be,Te])=>a(Te,!0))),K}function S(){A(2)}function D(K){return Object.isFrozen(K)}var E,R={};function f(K){const ne=R[K];return ne||A(0),ne}function T(){return E}function w(K,ne){ne&&(f("Patches"),K.patches_=[],K.inversePatches_=[],K.patchListener_=ne)}function Q(K){G(K),K.drafts_.forEach(U),K.drafts_=null}function G(K){K===E&&(E=K.parent_)}function V(K){return E=function L(K,ne){return{drafts_:[],parent_:K,immer_:ne,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(E,K)}function U(K){const ne=K[r];0===ne.type_||1===ne.type_?ne.revoke_():ne.revoked_=!0}function N(K,ne){ne.unfinalizedDrafts_=ne.drafts_.length;const be=ne.drafts_[0];return void 0!==K&&K!==be?(be[r].modified_&&(Q(ne),A(4)),i(K)&&(K=k(ne,K),ne.parent_||$(ne,K)),ne.patches_&&f("Patches").generateReplacementPatches_(be[r].base_,K,ne.patches_,ne.inversePatches_)):K=k(ne,be,[]),Q(ne),ne.patches_&&ne.patchListener_(ne.patches_,ne.inversePatches_),K!==e?K:void 0}function k(K,ne,be){if(D(ne))return ne;const Te=ne[r];if(!Te)return _(ne,(ie,ue)=>H(K,Te,ne,ie,ue,be)),ne;if(Te.scope_!==K)return ne;if(!Te.modified_)return $(K,Te.base_,!0),Te.base_;if(!Te.finalized_){Te.finalized_=!0,Te.scope_.unfinalizedDrafts_--;const ie=Te.copy_;let ue=ie,re=!1;3===Te.type_&&(ue=new Set(ie),ie.clear(),re=!0),_(ue,(ve,ce)=>H(K,Te,ie,ve,ce,be,re)),$(K,ie,!1),be&&K.patches_&&f("Patches").generatePatches_(Te,be,K.patches_,K.inversePatches_)}return Te.copy_}function H(K,ne,be,Te,ie,ue,re){if(c(ie)){const ce=k(K,ie,ue&&ne&&3!==ne.type_&&!I(ne.assigned_,Te)?ue.concat(Te):void 0);if(m(be,Te,ce),!c(ce))return;K.canAutoFreeze_=!1}else re&&be.add(ie);if(i(ie)&&!D(ie)){if(!K.immer_.autoFreeze_&&K.unfinalizedDrafts_<1)return;k(K,ie),(!ne||!ne.scope_.parent_)&&"symbol"!=typeof Te&&Object.prototype.propertyIsEnumerable.call(be,Te)&&$(K,ie)}}function $(K,ne,be=!1){!K.parent_&&K.immer_.autoFreeze_&&K.canAutoFreeze_&&a(ne,be)}var W={get(K,ne){if(ne===r)return K;const be=C(K);if(!I(be,ne))return function ye(K,ne,be){const Te=j(ne,be);return Te?"value"in Te?Te.value:Te.get?.call(K.draft_):void 0}(K,be,ne);const Te=be[ne];return K.finalized_||!i(Te)?Te:Te===de(K.base_,ne)?(q(K),K.copy_[ne]=ee(Te,K)):Te},has:(K,ne)=>ne in C(K),ownKeys:K=>Reflect.ownKeys(C(K)),set(K,ne,be){const Te=j(C(K),ne);if(Te?.set)return Te.set.call(K.draft_,be),!0;if(!K.modified_){const ie=de(C(K),ne),ue=ie?.[r];if(ue&&ue.base_===be)return K.copy_[ne]=be,K.assigned_[ne]=!1,!0;if(function u(K,ne){return K===ne?0!==K||1/K==1/ne:K!=K&&ne!=ne}(be,ie)&&(void 0!==be||I(K.base_,ne)))return!0;q(K),Z(K)}return K.copy_[ne]===be&&(void 0!==be||ne in K.copy_)||Number.isNaN(be)&&Number.isNaN(K.copy_[ne])||(K.copy_[ne]=be,K.assigned_[ne]=!0),!0},deleteProperty:(K,ne)=>(void 0!==de(K.base_,ne)||ne in K.base_?(K.assigned_[ne]=!1,q(K),Z(K)):delete K.assigned_[ne],K.copy_&&delete K.copy_[ne],!0),getOwnPropertyDescriptor(K,ne){const be=C(K),Te=Reflect.getOwnPropertyDescriptor(be,ne);return Te&&{writable:!0,configurable:1!==K.type_||"length"!==ne,enumerable:Te.enumerable,value:be[ne]}},defineProperty(){A(11)},getPrototypeOf:K=>y(K.base_),setPrototypeOf(){A(12)}},te={};function de(K,ne){const be=K[r];return(be?C(be):K)[ne]}function j(K,ne){if(!(ne in K))return;let be=y(K);for(;be;){const Te=Object.getOwnPropertyDescriptor(be,ne);if(Te)return Te;be=y(be)}}function Z(K){K.modified_||(K.modified_=!0,K.parent_&&Z(K.parent_))}function q(K){K.copy_||(K.copy_=h(K.base_,K.scope_.immer_.useStrictShallowCopy_))}function ee(K,ne){const be=d(K)?f("MapSet").proxyMap_(K,ne):s(K)?f("MapSet").proxySet_(K,ne):function J(K,ne){const be=Array.isArray(K),Te={type_:be?1:0,scope_:ne?ne.scope_:T(),modified_:!1,finalized_:!1,assigned_:{},parent_:ne,base_:K,draft_:null,copy_:null,revoke_:null,isManual_:!1};let ie=Te,ue=W;be&&(ie=[Te],ue=te);const{revoke:re,proxy:ve}=Proxy.revocable(ie,ue);return Te.draft_=ve,Te.revoke_=re,ve}(K,ne);return(ne?ne.scope_:T()).drafts_.push(be),be}function _e(K){if(!i(K)||D(K))return K;const ne=K[r];let be;if(ne){if(!ne.modified_)return ne.base_;ne.finalized_=!0,be=h(K,ne.scope_.immer_.useStrictShallowCopy_)}else be=h(K,!0);return _(be,(Te,ie)=>{m(be,Te,_e(ie))}),ne&&(ne.finalized_=!1),be}_(W,(K,ne)=>{te[K]=function(){return arguments[0]=arguments[0][0],ne.apply(this,arguments)}}),te.deleteProperty=function(K,ne){return te.set.call(this,K,ne,void 0)},te.set=function(K,ne,be){return W.set.call(this,K[0],ne,be,K[0])};var Ae=new class{constructor(K){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(ne,be,Te)=>{if("function"==typeof ne&&"function"!=typeof be){const ue=be;be=ne;const re=this;return function(ce=ue,...se){return re.produce(ce,ae=>be.call(this,ae,...se))}}let ie;if("function"!=typeof be&&A(6),void 0!==Te&&"function"!=typeof Te&&A(7),i(ne)){const ue=V(this),re=ee(ne,void 0);let ve=!0;try{ie=be(re),ve=!1}finally{ve?Q(ue):G(ue)}return w(ue,Te),N(ie,ue)}if(!ne||"object"!=typeof ne){if(ie=be(ne),void 0===ie&&(ie=ne),ie===e&&(ie=void 0),this.autoFreeze_&&a(ie,!0),Te){const ue=[],re=[];f("Patches").generateReplacementPatches_(ne,ie,ue,re),Te(ue,re)}return ie}A(1)},this.produceWithPatches=(ne,be)=>{if("function"==typeof ne)return(re,...ve)=>this.produceWithPatches(re,ce=>ne(ce,...ve));let Te,ie;return[this.produce(ne,be,(re,ve)=>{Te=re,ie=ve}),Te,ie]},"boolean"==typeof K?.autoFreeze&&this.setAutoFreeze(K.autoFreeze),"boolean"==typeof K?.useStrictShallowCopy&&this.setUseStrictShallowCopy(K.useStrictShallowCopy)}createDraft(K){i(K)||A(8),c(K)&&(K=function g(K){return c(K)||A(10),_e(K)}(K));const ne=V(this),be=ee(K,void 0);return be[r].isManual_=!0,G(ne),be}finishDraft(K,ne){const be=K&&K[r];(!be||!be.isManual_)&&A(9);const{scope_:Te}=be;return w(Te,ne),N(void 0,Te)}setAutoFreeze(K){this.autoFreeze_=K}setUseStrictShallowCopy(K){this.useStrictShallowCopy_=K}applyPatches(K,ne){let be;for(be=ne.length-1;be>=0;be--){const ie=ne[be];if(0===ie.path.length&&"replace"===ie.op){K=ie.value;break}}be>-1&&(ne=ne.slice(be+1));const Te=f("Patches").applyPatches_;return c(K)?Te(K,ne):this.produce(K,ie=>Te(ie,ne))}},Be=Ae.produce,Re=(Ae.produceWithPatches.bind(Ae),Ae.setAutoFreeze.bind(Ae));Ae.setUseStrictShallowCopy.bind(Ae),Ae.applyPatches.bind(Ae),Ae.createDraft.bind(Ae),Ae.finishDraft.bind(Ae)}}]); \ No newline at end of file diff --git a/docs/772.0440337245892f34.js b/docs/772.0440337245892f34.js deleted file mode 100644 index 342e256..0000000 --- a/docs/772.0440337245892f34.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[772],{9772:(bt,de,j)=>{j.r(de),j.d(de,{PageFeaturesViewerComponent:()=>Gb});var g=j(4438);let me=(()=>{class e{constructor(n){this.templateRef=n}static#e=this.\u0275fac=function(i){return new(i||e)(g.rXU(g.C4Q))};static#t=this.\u0275dir=g.FsC({type:e,selectors:[["","ngx-features-viewer-label",""]],standalone:!0})}return e})();var le=j(5558),Q=j(8141),B=j(177),X=j(2771),P=j(6354),ne=j(9568);function H(e){return e}function ze(e){return"translate("+e+",0)"}function we(e){return"translate(0,"+e+")"}function Ae(e){return t=>+e(t)}function Fe(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Re(){return!this.__axis}function ye(e,t){var n=[],i=null,o=null,r=6,f=6,c=3,b=typeof window<"u"&&window.devicePixelRatio>1?0:.5,a=1===e||4===e?-1:1,l=4===e||2===e?"x":"y",s=1===e||3===e?ze:we;function u(d){var A=i??(t.ticks?t.ticks.apply(t,n):t.domain()),C=o??(t.tickFormat?t.tickFormat.apply(t,n):H),w=Math.max(r,0)+c,m=t.range(),_=+m[0]+b,y=+m[m.length-1]+b,q=(t.bandwidth?Fe:Ae)(t.copy(),b),M=d.selection?d.selection():d,R=M.selectAll(".domain").data([null]),I=M.selectAll(".tick").data(A,t).order(),V=I.exit(),Y=I.enter().append("g").attr("class","tick"),D=I.select("line"),S=I.select("text");R=R.merge(R.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),I=I.merge(Y),D=D.merge(Y.append("line").attr("stroke","currentColor").attr(l+"2",a*r)),S=S.merge(Y.append("text").attr("fill","currentColor").attr(l,a*w).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),d!==M&&(R=R.transition(d),I=I.transition(d),D=D.transition(d),S=S.transition(d),V=V.transition(d).attr("opacity",1e-6).attr("transform",function(L){return isFinite(L=q(L))?s(L+b):this.getAttribute("transform")}),Y.attr("opacity",1e-6).attr("transform",function(L){var F=this.parentNode.__axis;return s((F&&isFinite(F=F(L))?F:q(L))+b)})),V.remove(),R.attr("d",4===e||2===e?f?"M"+a*f+","+_+"H"+b+"V"+y+"H"+a*f:"M"+b+","+_+"V"+y:f?"M"+_+","+a*f+"V"+b+"H"+y+"V"+a*f:"M"+_+","+b+"H"+y),I.attr("opacity",1).attr("transform",function(L){return s(q(L)+b)}),D.attr(l+"2",a*r),S.attr(l,a*w).text(C),M.filter(Re).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),M.each(function(){this.__axis=q})}return u.scale=function(d){return arguments.length?(t=d,u):t},u.ticks=function(){return n=Array.from(arguments),u},u.tickArguments=function(d){return arguments.length?(n=null==d?[]:Array.from(d),u):n.slice()},u.tickValues=function(d){return arguments.length?(i=null==d?null:Array.from(d),u):i&&i.slice()},u.tickFormat=function(d){return arguments.length?(o=d,u):o},u.tickSize=function(d){return arguments.length?(r=f=+d,u):r},u.tickSizeInner=function(d){return arguments.length?(r=+d,u):r},u.tickSizeOuter=function(d){return arguments.length?(f=+d,u):f},u.tickPadding=function(d){return arguments.length?(c=+d,u):c},u.offset=function(d){return arguments.length?(b=+d,u):b},u}function st(){}function Me(e){return null==e?st:function(){return this.querySelector(e)}}function io(){return[]}function kn(e){return null==e?io:function(){return this.querySelectorAll(e)}}function Mn(e){return function(){return this.matches(e)}}function Sn(e){return function(t){return t.matches(e)}}var fo=Array.prototype.find;function bo(){return this.firstElementChild}var lo=Array.prototype.filter;function so(){return Array.from(this.children)}function zn(e){return new Array(e.length)}function ut(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function wo(e,t,n,i,o,r){for(var c,f=0,b=t.length,a=r.length;ft?1:e>=t?0:NaN}ut.prototype={constructor:ut,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var Lt="http://www.w3.org/1999/xhtml";const An={svg:"http://www.w3.org/2000/svg",xhtml:Lt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ht(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),An.hasOwnProperty(t)?{space:An[t],local:e}:e}function Fo(e){return function(){this.removeAttribute(e)}}function Ro(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Do(e,t){return function(){this.setAttribute(e,t)}}function Io(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Vo(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function jo(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function qn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Oo(e){return function(){this.style.removeProperty(e)}}function Xo(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ho(e,t,n){return function(){var i=t.apply(this,arguments);null==i?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function Ve(e,t){return e.style.getPropertyValue(t)||qn(e).getComputedStyle(e,null).getPropertyValue(t)}function Yo(e){return function(){delete this[e]}}function Bo(e,t){return function(){this[e]=t}}function Ko(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function En(e){return e.trim().split(/^|\s+/)}function Ot(e){return e.classList||new Tn(e)}function Tn(e){this._node=e,this._names=En(e.getAttribute("class")||"")}function $n(e,t){for(var n=Ot(e),i=-1,o=t.length;++i=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Pn=[null];function ae(e,t){this._groups=e,this._parents=t}function Fn(){return new ae([[document.documentElement]],Pn)}ae.prototype=Fn.prototype={constructor:ae,select:function Ie(e){"function"!=typeof e&&(e=Me(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o=y&&(y=_+1);!(M=w[y])&&++y=0;)(f=i[o])&&(r&&4^f.compareDocumentPosition(r)&&r.parentNode.insertBefore(f,r),r=f);return this},sort:function Ao(e){function t(s,u){return s&&u?e(s.__data__,u.__data__):!s-!u}e||(e=qo);for(var n=this._groups,i=n.length,o=new Array(i),r=0;r1?this.each((null==t?Oo:"function"==typeof t?Ho:Xo)(e,t,n??"")):Ve(this.node(),e)},property:function Uo(e,t){return arguments.length>1?this.each((null==t?Yo:"function"==typeof t?Ko:Bo)(e,t)):this.node()[e]},classed:function Jo(e,t){var n=En(e+"");if(arguments.length<2){for(var i=Ot(this.node()),o=-1,r=n.length;++o=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}(e+""),r=i.length;if(!(arguments.length<2)){for(c=t?zr:Sr,o=0;o{}};function Rn(){for(var i,e=0,t=arguments.length,n={};e=0&&(i=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}(e+"",n),r=-1,f=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++r0)for(var o,r,n=new Array(o),i=0;i=0&&e._call.call(void 0,t),e=e._next;--je}()}finally{je=0,function Vr(){for(var e,n,t=pt,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:pt=n);Ze=e,Gt(i)}(),qe=0}}function Ir(){var e=Je.now(),t=e-gt;t>Vn&&(mt-=t,gt=e)}function Gt(e){je||(We&&(We=clearTimeout(We)),e-qe>24?(e<1/0&&(We=setTimeout(On,e-Je.now()-mt)),Qe&&(Qe=clearInterval(Qe))):(Qe||(gt=Je.now(),Qe=setInterval(Ir,Vn)),je=1,jn(On)))}function Xn(e,t,n){var i=new wt;return i.restart(o=>{i.stop(),e(o+t)},t=null==t?0:+t,n),i}wt.prototype=Ln.prototype={constructor:wt,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Ht():+n)+(null==t?0:+t),!this._next&&Ze!==this&&(Ze?Ze._next=this:pt=this,Ze=this),this._call=e,this._time=n,Gt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gt())}};var jr=In("start","end","cancel","interrupt"),Lr=[],Hn=0,Yt=2,yt=3,Bt=5,vt=6;function xt(e,t,n,i,o,r){var f=e.__transition;if(f){if(n in f)return}else e.__transition={};!function Or(e,t,n){var o,i=e.__transition;function f(a){var l,s,u,d;if(1!==n.state)return b();for(l in i)if((d=i[l]).name===n.name){if(d.state===yt)return Xn(f);4===d.state?(d.state=vt,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[l]):+lHn)throw new Error("too late; already scheduled");return n}function pe(e,t){var n=se(e,t);if(n.state>yt)throw new Error("too late; already running");return n}function se(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function _t(e,t){var i,o,f,n=e.__transition,r=!0;if(n){for(f in t=null==t?null:t+"",n)(i=n[f]).name===t?(o=i.state>Yt&&i.state180?l+=360:l-a>180&&(a+=360),u.push({i:s.push(o(s)+"rotate(",null,i)-2,x:ue(a,l)})):l&&s.push(o(s)+"rotate("+l+i)}(a.rotate,l.rotate,s,u),function c(a,l,s,u){a!==l?u.push({i:s.push(o(s)+"skewX(",null,i)-2,x:ue(a,l)}):l&&s.push(o(s)+"skewX("+l+i)}(a.skewX,l.skewX,s,u),function b(a,l,s,u,d,A){if(a!==s||l!==u){var C=d.push(o(d)+"scale(",null,",",null,")");A.push({i:C-4,x:ue(a,s)},{i:C-2,x:ue(l,u)})}else(1!==s||1!==u)&&d.push(o(d)+"scale("+s+","+u+")")}(a.scaleX,a.scaleY,l.scaleX,l.scaleY,s,u),a=l=null,function(d){for(var w,A=-1,C=u.length;++A>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?St(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?St(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Zr.exec(e))?new re(t[1],t[2],t[3],1):(t=Jr.exec(e))?new re(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ef.exec(e))?St(t[1],t[2],t[3],t[4]):(t=tf.exec(e))?St(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=nf.exec(e))?ii(t[1],t[2]/100,t[3]/100,1):(t=of.exec(e))?ii(t[1],t[2]/100,t[3]/100,t[4]):Qn.hasOwnProperty(e)?ei(Qn[e]):"transparent"===e?new re(NaN,NaN,NaN,0):null}function ei(e){return new re(e>>16&255,e>>8&255,255&e,1)}function St(e,t,n,i){return i<=0&&(e=t=n=NaN),new re(e,t,n,i)}function zt(e,t,n,i){return 1===arguments.length?function cf(e){return e instanceof et||(e=Ee(e)),e?new re((e=e.rgb()).r,e.g,e.b,e.opacity):new re}(e):new re(e,t,n,i??1)}function re(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function ti(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}`}function ni(){const e=At(this.opacity);return`${1===e?"rgb(":"rgba("}${Te(this.r)}, ${Te(this.g)}, ${Te(this.b)}${1===e?")":`, ${e})`}`}function At(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Te(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $e(e){return((e=Te(e))<16?"0":"")+e.toString(16)}function ii(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new he(e,t,n,i)}function oi(e){if(e instanceof he)return new he(e.h,e.s,e.l,e.opacity);if(e instanceof et||(e=Ee(e)),!e)return new he;if(e instanceof he)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),r=Math.max(t,n,i),f=NaN,c=r-o,b=(r+o)/2;return c?(f=t===r?(n-i)/c+6*(n0&&b<1?0:f,new he(f,c,b,e.opacity)}function he(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function ri(e){return(e=(e||0)%360)<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function Zt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function fi(e,t,n,i,o){var r=e*e,f=r*e;return((1-3*e+3*r-f)*t+(4-6*r+3*f)*n+(1+3*e+3*r-3*f)*i+f*o)/6}Qt(et,Ee,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zn,formatHex:Zn,formatHex8:function rf(){return this.rgb().formatHex8()},formatHsl:function ff(){return oi(this).formatHsl()},formatRgb:Jn,toString:Jn}),Qt(re,zt,Wn(et,{brighter(e){return e=null==e?Mt:Math.pow(Mt,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new re(Te(this.r),Te(this.g),Te(this.b),At(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ti,formatHex:ti,formatHex8:function bf(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}${$e(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ni,toString:ni})),Qt(he,function af(e,t,n,i){return 1===arguments.length?oi(e):new he(e,t,n,i??1)},Wn(et,{brighter(e){return e=null==e?Mt:Math.pow(Mt,e),new he(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new he(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new re(Zt(e>=240?e-240:e+120,o,i),Zt(e,o,i),Zt(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new he(ri(this.h),qt(this.s),qt(this.l),At(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=At(this.opacity);return`${1===e?"hsl(":"hsla("}${ri(this.h)}, ${100*qt(this.s)}%, ${100*qt(this.l)}%${1===e?")":`, ${e})`}`}}));const Jt=e=>()=>e;function bi(e,t){var n=t-e;return n?function ci(e,t){return function(n){return e+n*t}}(e,n):Jt(isNaN(e)?t:e)}const Et=function e(t){var n=function hf(e){return 1==(e=+e)?bi:function(t,n){return n-t?function uf(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Jt(isNaN(t)?n:t)}}(t);function i(o,r){var f=n((o=zt(o)).r,(r=zt(r)).r),c=n(o.g,r.g),b=n(o.b,r.b),a=bi(o.opacity,r.opacity);return function(l){return o.r=f(l),o.g=c(l),o.b=b(l),o.opacity=a(l),o+""}}return i.gamma=e,i}(1);function ai(e){return function(t){var f,c,n=t.length,i=new Array(n),o=new Array(n),r=new Array(n);for(f=0;f=1?(n=1,t-1):Math.floor(n*t),o=e[i],r=e[i+1];return fi((n-i/t)*t,i>0?e[i-1]:2*o-r,o,r,in&&(r=t.slice(n,r),c[f]?c[f]+=r:c[++f]=r),(i=i[0])===(o=o[0])?c[f]?c[f]+=o:c[++f]=o:(c[++f]=null,b.push({i:f,x:ue(i,o)})),n=tn.lastIndex;return n=0&&(t=t.slice(0,n)),!t||"start"===t})}(t)?Kt:pe;return function(){var f=r(this,e),c=f.on;c!==i&&(o=(i=c).copy()).on(t,n),f.on=o}}(n,e,t))},attr:function _f(e,t){var n=ht(e),i="transform"===n?Br:si;return this.attrTween(e,"function"==typeof t?(n.local?xf:vf)(n,i,Wt(this,"attr."+e,t)):null==t?(n.local?mf:gf)(n):(n.local?yf:wf)(n,i,t))},attrTween:function Af(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var i=ht(e);return this.tween(n,(i.local?Sf:zf)(i,t))},style:function Jf(e,t,n){var i="transform"==(e+="")?Yr:si;return null==t?this.styleTween(e,function Uf(e,t){var n,i,o;return function(){var r=Ve(this,e),f=(this.style.removeProperty(e),Ve(this,e));return r===f?null:r===n&&f===i?o:o=t(n=r,i=f)}}(e,i)).on("end.style."+e,ui(e)):"function"==typeof t?this.styleTween(e,function Qf(e,t,n){var i,o,r;return function(){var f=Ve(this,e),c=n(this),b=c+"";return null==c&&(this.style.removeProperty(e),b=c=Ve(this,e)),f===b?null:f===i&&b===o?r:(o=b,r=t(i=f,c))}}(e,i,Wt(this,"style."+e,t))).each(function Zf(e,t){var n,i,o,c,r="style."+t,f="end."+r;return function(){var b=pe(this,e),a=b.on,l=null==b.value[r]?c||(c=ui(t)):void 0;(a!==n||o!==l)&&(i=(n=a).copy()).on(f,o=l),b.on=i}}(this._id,e)):this.styleTween(e,function Wf(e,t,n){var i,r,o=n+"";return function(){var f=Ve(this,e);return f===o?null:f===i?r:r=t(i=f,n)}}(e,i,t),n).on("end.style."+e,null)},styleTween:function nc(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw new Error;return this.tween(i,function tc(e,t,n){var i,o;function r(){var f=t.apply(this,arguments);return f!==o&&(i=(o=f)&&function ec(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}(e,f,n)),i}return r._value=t,r}(e,t,n??""))},text:function rc(e){return this.tween("text","function"==typeof e?function oc(e){return function(){var t=e(this);this.textContent=t??""}}(Wt(this,"text",e)):function ic(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function bc(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function cc(e){var t,n;function i(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function fc(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return i._value=e,i}(e))},remove:function Hf(){return this.on("end.remove",function Xf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function Wr(e,t){var n=this._id;if(e+="",arguments.length<2){for(var f,i=se(this.node(),n).tween,o=0,r=i.length;o1?i[0]+i.slice(2):i,+e.slice(n+1)]}function He(e){return(e=Nt(Math.abs(e)))?e[1]:NaN}["w","e"].map(it),["n","s"].map(it),["n","w","e","s","nw","ne","sw","se"].map(it);var yi,Ac=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ct(e){if(!(t=Ac.exec(e)))throw new Error("invalid format: "+e);var t;return new cn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function cn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function vi(e,t){var n=Nt(e,t);if(!n)return e+"";var i=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}Ct.prototype=cn.prototype,cn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const xi={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function Mc(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vi(100*e,t),r:vi,s:function Ec(e,t){var n=Nt(e,t);if(!n)return e+"";var i=n[0],o=n[1],r=o-(yi=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,f=i.length;return r===f?i:r>f?i+new Array(r-f+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Nt(e,Math.max(0,t+r-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function _i(e){return e}var Pt,bn,Si,ki=Array.prototype.map,Mi=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];!function $c(e){Pt=function Tc(e){var t=void 0===e.grouping||void 0===e.thousands?_i:function Sc(e,t){return function(n,i){for(var o=n.length,r=[],f=0,c=e[0],b=0;o>0&&c>0&&(b+c+1>i&&(c=Math.max(1,i-b)),r.push(n.substring(o-=c,o+c)),!((b+=c+1)>i));)c=e[f=(f+1)%e.length];return r.reverse().join(t)}}(ki.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",r=void 0===e.numerals?_i:function zc(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}(ki.call(e.numerals,String)),f=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"\u2212":e.minus+"",b=void 0===e.nan?"NaN":e.nan+"";function a(s){var u=(s=Ct(s)).fill,d=s.align,A=s.sign,C=s.symbol,w=s.zero,m=s.width,_=s.comma,y=s.precision,q=s.trim,M=s.type;"n"===M?(_=!0,M="g"):xi[M]||(void 0===y&&(y=12),q=!0,M="g"),(w||"0"===u&&"="===d)&&(w=!0,u="0",d="=");var R="$"===C?n:"#"===C&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",I="$"===C?i:/[%p]/.test(M)?f:"",V=xi[M],Y=/[defgprs%]/.test(M);function D(S){var h,x,p,L=R,F=I;if("c"===M)F=V(S)+F,S="";else{var v=(S=+S)<0||1/S<0;if(S=isNaN(S)?b:V(Math.abs(S),y),q&&(S=function qc(e){e:for(var o,t=e.length,n=1,i=-1;n0&&(i=0)}return i>0?e.slice(0,i)+e.slice(o+1):e}(S)),v&&0==+S&&"+"!==A&&(v=!1),L=(v?"("===A?A:c:"-"===A||"("===A?"":A)+L,F=("s"===M?Mi[8+yi/3]:"")+F+(v&&"("===A?")":""),Y)for(h=-1,x=S.length;++h(p=S.charCodeAt(h))||p>57){F=(46===p?o+S.slice(h+1):S.slice(h))+F,S=S.slice(0,h);break}}_&&!w&&(S=t(S,1/0));var z=L.length+S.length+F.length,k=z>1)+L+S+F+k.slice(z);break;default:S=k+L+S+F}return r(S)}return y=void 0===y?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),D.toString=function(){return s+""},D}return{format:a,formatPrefix:function l(s,u){var d=a(((s=Ct(s)).type="f",s)),A=3*Math.max(-8,Math.min(8,Math.floor(He(u)/3))),C=Math.pow(10,-A),w=Mi[8+A/3];return function(m){return d(C*m)+w}}}}(e),bn=Pt.format,Si=Pt.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Nc=Math.sqrt(50),Cc=Math.sqrt(10),Pc=Math.sqrt(2);function Ft(e,t,n){const i=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(i)),r=i/Math.pow(10,o),f=r>=Nc?10:r>=Cc?5:r>=Pc?2:1;let c,b,a;return o<0?(a=Math.pow(10,-o)/f,c=Math.round(e*a),b=Math.round(t*a),c/at&&--b,a=-a):(a=Math.pow(10,o)*f,c=Math.round(e/a),b=Math.round(t/a),c*at&&--b),bt?1:e>=t?0:NaN}function Dc(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function zi(e){let t,n,i;function o(c,b,a=0,l=c.length){if(a>>1;n(c[s],b)<0?a=s+1:l=s}while(aRt(e(c),b),i=(c,b)=>e(c)-b):(t=e===Rt||e===Dc?e:Ic,n=e,i=e),{left:o,center:function f(c,b,a=0,l=c.length){const s=o(c,b,a,l-1);return s>a&&i(c[s-1],b)>-i(c[s],b)?s-1:s},right:function r(c,b,a=0,l=c.length){if(a>>1;n(c[s],b)<=0?a=s+1:l=s}while(a0))return[];if((e=+e)==(t=+t))return[e];const i=t=o))return[];const c=r-o+1,b=new Array(c);if(i)if(f<0)for(let a=0;a0;){if((a=an(f,c,n))===b)return i[o]=f,i[r]=c,t(i);if(a>0)f=Math.floor(f/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;f=Math.ceil(f*a)/a,c=Math.floor(c*a)/a}b=a}return e},e}function $i(){var e=function eb(){return function Jc(){var i,o,r,c,b,a,e=Ei,t=Ei,n=ln,f=Ge;function l(){var u=Math.min(e.length,t.length);return f!==Ge&&(f=function Uc(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}(e[0],e[u-1])),c=u>2?Qc:Wc,b=a=null,s}function s(u){return null==u||isNaN(u=+u)?r:(b||(b=c(e.map(i),t,n)))(i(f(u)))}return s.invert=function(u){return f(o((a||(a=c(t,e.map(i),ue)))(u)))},s.domain=function(u){return arguments.length?(e=Array.from(u,Kc),l()):e.slice()},s.range=function(u){return arguments.length?(t=Array.from(u),l()):t.slice()},s.rangeRound=function(u){return t=Array.from(u),n=Yc,l()},s.clamp=function(u){return arguments.length?(f=!!u||Ge,l()):f!==Ge},s.interpolate=function(u){return arguments.length?(n=u,l()):n},s.unknown=function(u){return arguments.length?(r=u,s):r},function(u,d){return i=u,o=d,l()}}()(Ge,Ge)}();return e.copy=function(){return function Zc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}(e,$i())},Ti.apply(e,arguments),rb(e)}class Ni extends Map{constructor(t,n=Fi){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const[i,o]of t)this.set(i,o)}get(t){return super.get(un(this,t))}has(t){return super.has(un(this,t))}set(t,n){return super.set(function Ci({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,t),n)}delete(t){return super.delete(function Pi({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}(this,t))}}function un({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Fi(e){return null!==e&&"object"==typeof e?e.valueOf():e}Set;const Ri=Symbol("implicit");function Di(){var e=new Ni,t=[],n=[],i=Ri;function o(r){let f=e.get(r);if(void 0===f){if(i!==Ri)return i;e.set(r,f=t.push(r)-1)}return n[f%n.length]}return o.domain=function(r){if(!arguments.length)return t.slice();t=[],e=new Ni;for(const f of r)e.has(f)||e.set(f,t.push(f)-1);return o},o.range=function(r){return arguments.length?(n=Array.from(r),o):n.slice()},o.unknown=function(r){return arguments.length?(i=r,o):i},o.copy=function(){return Di(t,n).unknown(i)},Ti.apply(o,arguments),o}function ie(e){return"string"==typeof e?new ae([[document.querySelector(e)]],[document.documentElement]):new ae([[e]],Pn)}function Ye(e){return function(){return e}}function Ii(e){this._context=e}function bb(e){return new Ii(e)}Ii.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};const hn=Math.PI,dn=2*hn,Ne=1e-6,ab=dn-Ne;function Vi(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Vi;const n=10**t;return function(i){this._+=i[0];for(let o=1,r=i.length;oNe)if(Math.abs(s*b-a*l)>Ne&&r){let d=i-f,A=o-c,C=b*b+a*a,w=d*d+A*A,m=Math.sqrt(C),_=Math.sqrt(u),y=r*Math.tan((hn-Math.acos((C+u-w)/(2*m*_)))/2),q=y/_,M=y/m;Math.abs(q-1)>Ne&&this._append`L${t+q*l},${n+q*s}`,this._append`A${r},${r},0,0,${+(s*d>l*A)},${this._x1=t+M*b},${this._y1=n+M*a}`}else this._append`L${this._x1=t},${this._y1=n}`}arc(t,n,i,o,r,f){if(t=+t,n=+n,f=!!f,(i=+i)<0)throw new Error(`negative radius: ${i}`);let c=i*Math.cos(o),b=i*Math.sin(o),a=t+c,l=n+b,s=1^f,u=f?o-r:r-o;null===this._x1?this._append`M${a},${l}`:(Math.abs(this._x1-a)>Ne||Math.abs(this._y1-l)>Ne)&&this._append`L${a},${l}`,i&&(u<0&&(u=u%dn+dn),u>ab?this._append`A${i},${i},0,1,${s},${t-c},${n-b}A${i},${i},0,1,${s},${this._x1=a},${this._y1=l}`:u>Ne&&this._append`A${i},${i},0,${+(u>=hn)},${s},${this._x1=t+i*Math.cos(r)},${this._y1=n+i*Math.sin(r)}`)}rect(t,n,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function hb(e){return e[0]}function db(e){return e[1]}function ji(e){return e<0?-1:1}function Li(e,t,n){var i=e._x1-e._x0,o=t-e._x1,r=(e._y1-e._y0)/(i||o<0&&-0),f=(n-e._y1)/(o||i<0&&-0),c=(r*o+f*i)/(i+o);return(ji(r)+ji(f))*Math.min(Math.abs(r),Math.abs(f),.5*Math.abs(c))||0}function Oi(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function pn(e,t,n){var i=e._x0,r=e._x1,f=e._y1,c=(r-i)/3;e._context.bezierCurveTo(i+c,e._y0+c*t,r-c,f-c*n,r,f)}function It(e){this._context=e}function Hi(e){this._context=e}function gb(e){return new It(e)}It.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pn(this,this._t0,Oi(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,pn(this,Oi(this,n=Li(this,e,t)),n);break;default:pn(this,this._t0,n=Li(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(function Xi(e){this._context=new Hi(e)}.prototype=Object.create(It.prototype)).point=function(e,t){It.prototype.point.call(this,t,e)},Hi.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,o,r){this._context.bezierCurveTo(t,e,i,n,r,o)}};const gn={capture:!0,passive:!1};function mn(e){e.preventDefault(),e.stopImmediatePropagation()}function Gi(e){return((e=Math.exp(e))+1/e)/2}const _b=function e(t,n,i){function o(r,f){var w,m,c=r[0],b=r[1],a=r[2],u=f[2],d=f[0]-c,A=f[1]-b,C=d*d+A*A;if(C<1e-12)m=Math.log(u/a)/t,w=function(I){return[c+I*d,b+I*A,a*Math.exp(t*I*m)]};else{var _=Math.sqrt(C),y=(u*u-a*a+i*C)/(2*a*n*_),q=(u*u-a*a-i*C)/(2*u*n*_),M=Math.log(Math.sqrt(y*y+1)-y),R=Math.log(Math.sqrt(q*q+1)-q);m=(R-M)/t,w=function(I){var V=I*m,Y=Gi(M),D=a/(n*_)*(Y*function xb(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*V+M)-function vb(e){return((e=Math.exp(e))-1/e)/2}(M));return[c+D*d,b+D*A,a*Y/Gi(t*V+M)]}}return w.duration=1e3*m*t/Math.SQRT2,w}return o.rho=function(r){var f=Math.max(.001,+r),c=f*f;return e(f,c,c*c)},o}(Math.SQRT2,2,4);function Ce(e,t){if(e=function kb(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Vt=e=>()=>e;function Mb(e,{sourceEvent:t,target:n,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function ke(e,t,n){this.k=e,this.x=t,this.y=n}ke.prototype={constructor:ke,scale:function(e){return 1===e?this:new ke(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new ke(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wn=new ke(1,0,0);function yn(e){e.stopImmediatePropagation()}function ot(e){e.preventDefault(),e.stopImmediatePropagation()}function zb(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Ab(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Yi(){return this.__zoom||wn}function qb(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Eb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tb(e,t,n){var i=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],f=e.invertY(t[1][1])-n[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),f>r?(r+f)/2:Math.min(0,r)||Math.max(0,f))}let rt=(()=>{class e{get div(){return this.root.nativeElement}get width(){return this.div.offsetWidth}get margin(){const{"margin-top":n,"margin-right":i,"margin-bottom":o,"margin-left":r}=this.settings;return{top:n,right:i,bottom:o,left:r}}constructor(){this.initialize$=new X.m(1),this.initialized$=this.initialize$.pipe((0,Q.M)(n=>this.root=n),(0,P.T)(()=>{const n=function fb(e){return ie(Xt(e).call(document.documentElement))}("svg"),i=n.node();if(!i)throw new Error("Could not create SVG node");return this.div.append(i),n}),(0,Q.M)(n=>this.svg=n),(0,Q.M)(n=>{this.clip=n.append("defs").append("clipPath").attr("id","clip").append("rect");const i=n.append("g").attr("class","focus");this.draw=i.append("g").attr("class","features").attr("clip-path","url(#clip)"),this.zoom=function $b(){var l,s,u,e=zb,t=Ab,n=Tb,i=qb,o=Eb,r=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],c=250,b=_b,a=In("start","zoom","end"),d=500,A=150,C=0,w=10;function m(h){h.property("__zoom",Yi).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",Y).on("dblclick.zoom",D).filter(o).on("touchstart.zoom",S).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(h,x){return(x=Math.max(r[0],Math.min(r[1],x)))===h.k?h:new ke(x,h.x,h.y)}function y(h,x,p){var v=x[0]-p[0]*h.k,z=x[1]-p[1]*h.k;return v===h.x&&z===h.y?h:new ke(h.k,v,z)}function q(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function M(h,x,p,v){h.on("start.zoom",function(){R(this,arguments).event(v).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(v).end()}).tween("zoom",function(){var z=this,k=arguments,E=R(z,k).event(v),T=t.apply(z,k),$=null==p?q(T):"function"==typeof p?p.apply(z,k):p,fe=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),K=z.__zoom,te="function"==typeof x?x.apply(z,k):x,ce=b(K.invert($).concat(fe/K.k),te.invert($).concat(fe/te.k));return function(O){if(1===O)O=te;else{var oe=ce(O),Be=fe/oe[2];O=new ke(Be,$[0]-oe[0]*Be,$[1]-oe[1]*Be)}E.zoom(null,O)}})}function R(h,x,p){return!p&&h.__zooming||new I(h,x)}function I(h,x){this.that=h,this.args=x,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,x),this.taps=0}function V(h,...x){if(e.apply(this,arguments)){var p=R(this,x).event(h),v=this.__zoom,z=Math.max(r[0],Math.min(r[1],v.k*Math.pow(2,i.apply(this,arguments)))),k=Ce(h);if(p.wheel)(p.mouse[0][0]!==k[0]||p.mouse[0][1]!==k[1])&&(p.mouse[1]=v.invert(p.mouse[0]=k)),clearTimeout(p.wheel);else{if(v.k===z)return;p.mouse=[k,v.invert(k)],_t(this),p.start()}ot(h),p.wheel=setTimeout(function E(){p.wheel=null,p.end()},A),p.zoom("mouse",n(y(_(v,z),p.mouse[0],p.mouse[1]),p.extent,f))}}function Y(h,...x){if(!u&&e.apply(this,arguments)){var p=h.currentTarget,v=R(this,x,!0).event(h),z=ie(h.view).on("mousemove.zoom",function $(K){if(ot(K),!v.moved){var te=K.clientX-E,ce=K.clientY-T;v.moved=te*te+ce*ce>C}v.event(K).zoom("mouse",n(y(v.that.__zoom,v.mouse[0]=Ce(K,p),v.mouse[1]),v.extent,f))},!0).on("mouseup.zoom",function fe(K){z.on("mousemove.zoom mouseup.zoom",null),function wb(e,t){var n=e.document.documentElement,i=ie(e).on("dragstart.drag",null);t&&(i.on("click.drag",mn,gn),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(K.view,v.moved),ot(K),v.event(K).end()},!0),k=Ce(h,p),E=h.clientX,T=h.clientY;(function mb(e){var t=e.document.documentElement,n=ie(e).on("dragstart.drag",mn,gn);"onselectstart"in t?n.on("selectstart.drag",mn,gn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")})(h.view),yn(h),v.mouse=[k,this.__zoom.invert(k)],_t(this),v.start()}}function D(h,...x){if(e.apply(this,arguments)){var p=this.__zoom,v=Ce(h.changedTouches?h.changedTouches[0]:h,this),z=p.invert(v),E=n(y(_(p,p.k*(h.shiftKey?.5:2)),v,z),t.apply(this,x),f);ot(h),c>0?ie(this).transition().duration(c).call(M,E,v,h):ie(this).call(m.transform,E,v,h)}}function S(h,...x){if(e.apply(this,arguments)){var k,E,T,$,p=h.touches,v=p.length,z=R(this,x,h.changedTouches.length===v).event(h);for(yn(h),E=0;E{const i=n.append("g").attr("class","x axis"),o=n.append("g").attr("class","y axis");this.axes={x:i,y:o}}),(0,Q.M)(()=>this.scale={x:$i(),y:Di()}),(0,ne.t)(1))}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=g.jDH({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})(),vn=(()=>{class e{constructor(){this._traces=new Map,this._parent=new Map,this._children=new Map}set hierarchy(n){this.setHierarchy(n)}get traces(){return this._traces}get features(){const n=this.traces,i=new Map;for(const o of n.values())for(const[r,f]of Object.entries(o.values))i.set(`trace-${o.id}-feature-${r}`,f);return i}setHierarchy(n){let i=0,o=[...n];for(;o.length>0;){const[r]=o.splice(0,1),f=r.nested||[],c=new Array;for(const l of[r,...f]){const s="trace"===l.type?l:{type:"trace",values:[l],label:l.label,id:void 0,expanded:void 0};s.values=s.values.sort((u,d)=>"continuous"!==u.type?-1:"continuous"!==d.type?1:0),s.id=void 0!==s.id?s.id:i++,s.expanded=!1!==s.expanded,this._traces.set(s.id,s),c.push(s)}const b=c[0],a=c.slice(1);a.forEach(l=>this._parent.set(l,b.id)),this._children.set(b,a.map(l=>l.id)),o=[...c.slice(1),...o]}}getTrace(n){return this.traces.get(n)}getParent(n){const i=this._parent.get(n);return i&&this._traces.get(i)}getBranch(n){const i=[],o=[n];for(;o.length>0;){const r=o.pop();i.push(r);const f=this.getChildren(r);o.push(...f)}return i}getChildren(n){return(this._children.get(n)||[]).map(o=>this._traces.get(o))}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=g.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var Nb=j(3294),Bi=j(9172);function Ki(e,t,n){e.attr("height",t.height).attr("width",t.width).attr("y",n.top).attr("x",n.left)}let Ui=(()=>{class e{get svg(){return this.initializeService.svg}get div(){return this.initializeService.div}get height(){return this.div.offsetHeight}get width(){return this.div.offsetWidth}get margin(){return this.initializeService.margin}get scale(){return this.initializeService.scale}get axes(){return this.initializeService.axes}constructor(n){this.initializeService=n,this.resize$=new X.m(1);const i=this.resize$.pipe((0,P.T)(()=>({width:this.width,height:this.height})),(0,Nb.F)((o,r)=>o.width===r.width),(0,P.T)(()=>{}),(0,Bi.Z)(void 0));this.resized$=i.pipe((0,P.T)(()=>this.updateRoot()),(0,P.T)(()=>this.updateDraw()),(0,P.T)(()=>this.updateAxes()),(0,P.T)(()=>this.updateRangeX()),(0,P.T)(()=>this.updateRangeY()))}updateRoot(){const{y:n}=this.scale,o=n.range().at(-1)+this.margin.bottom,r=this.width;this.svg.attr("height",o).attr("width",r)}updateDraw(){const n={width:0,height:0};n.height=this.height-this.margin.top-this.margin.bottom,n.width=this.width-this.margin.left-this.margin.right,Ki(this.initializeService.clip,n,this.margin),Ki(this.initializeService.events,n,this.margin)}updateAxes(){const{x:n,y:i}=this.axes;n.attr("transform",`translate(0, ${this.height-this.margin.top})`),i.attr("transform",`translate(${this.margin.left}, 0)`)}updateRangeX(){const n=this.scale.x,i=this.width,{left:o,right:r}=this.margin;n.range([o,i-r])}updateRangeY(){}static#e=this.\u0275fac=function(i){return new(i||e)(g.KVO(rt))};static#t=this.\u0275prov=g.jDH({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})(),Wi=(()=>{class e{constructor(n){this.initService=n,this.zoom$=new X.m(1);const o=this.initService.initialized$.pipe((0,P.T)(()=>this._scale={x:this.initService.scale.x.copy(),y:this.initService.scale.y.copy()}),(0,ne.t)(1)).pipe((0,le.n)(()=>this.zoom$),(0,P.T)(r=>{const{x:f}=this._scale,{x:c}=this.initService.scale,b=r.transform.rescaleX(f),[a,l]=b.domain();return c.domain([a,l]),this.initService.scale}),(0,Bi.Z)(this.initService.scale));this.zoomed$=o.pipe((0,P.T)(()=>{const r=this.initService.axes,f=this.initService.scale,c=f.x.ticks().filter(a=>Number.isInteger(a)).slice(1,-1),b=function jt(e){return ye(3,e)}(f.x).tickValues(c).tickFormat(bn(".0f"));r.x.call(b)}))}static#e=this.\u0275fac=function(i){return new(i||e)(g.KVO(rt))};static#t=this.\u0275prov=g.jDH({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const Qi={H:"blue",K:"blue",R:"blue",D:"red",E:"red",S:"green",T:"green",N:"green",Q:"green",A:"white",V:"white",L:"white",I:"white",M:"white",F:"magenta",W:"magenta",Y:"magenta",P:"brown",G:"brown",C:"yellow",B:"grey",Z:"grey",X:"grey","-":"grey"},xn=(parseFloat(getComputedStyle(document.documentElement).fontSize),e=>e.id),_n=(e,t)=>t;let Zi=(()=>{class e{constructor(n,i){this.initializeService=n,this.featuresService=i,this.traces$=new X.m(1),this.sequence$=new X.m(1),this["char.width"]=0,this.draw$=this.sequence$.pipe((0,Q.M)(o=>{this.initializeService.scale.x.domain([0,o.length+1])}),(0,P.T)(o=>this.createSequence(o)),(0,Q.M)(()=>{const r=this.initializeService.settings["content-size"]/3;this.tooltip=ie(this.initializeService.div).append("div").attr("class","tooltip").style("position","absolute").style("display","none").style("opacity",1).style("color","black").style("padding",".25rem").style("background-color","white").style("border","solid").style("border-width","1px").style("border-radius",r+"px")}),(0,ne.t)(1),(0,le.n)(()=>this.traces$),(0,Q.M)(o=>this.updateScale(o)),(0,Q.M)(o=>this.createLabels(o)),(0,Q.M)(o=>this.createGrid(o)),(0,Q.M)(o=>this.createTraces(o)),(0,ne.t)(1)),this.drawn$=this.draw$.pipe((0,P.T)(()=>this.updateSequence()),(0,P.T)(()=>this.updateGrid()),(0,P.T)(()=>this.updateLabels()),(0,P.T)(()=>this.updateTraces()))}updateScale(n){const i=this.initializeService.scale.y,o=["sequence",...n.map(({id:f})=>f+"")],r=o.reduce((f,c,b)=>{if(0===b&&"sequence"===c){const s=this.initializeService.settings["margin-top"];return[s,s+this.initializeService.settings["line-height"]]}const a=this.featuresService.getTrace(+c);if(a){const l=f.at(-1);let s=a["line-height"]||this.initializeService.settings["line-height"];return"dodge"===a.position&&(s=a.values.reduce((u,d)=>u+(d["line-height"]||this.initializeService.settings["line-height"]),0)),[...f,l+s]}throw new Error("Trace not found")},[]);i.domain(o).range(r)}createSequence(n){const o=this.initializeService.draw.selectAll("g.sequence").data([n]).join("g").attr("class","sequence");this["group.residues"]=o.selectAll("g.residue").data(n).join("g").attr("id",(f,c)=>`residue-${c+1}`).attr("class","residue"),this["group.residues"].append("rect").attr("class","color").attr("fill",f=>(f=>Qi[f]||Qi.X)(f)).attr("fill-opacity",.1);let r=0;this["group.residues"].append("text").attr("class","name").text(f=>""+f).each(function(){r=Math.max(r,this.getBBox().width)}),this["char.width"]=r}updateSequence(){const n=this.initializeService.margin,{x:i,y:o}=this.initializeService.scale,{"line-height":r}=this.initializeService.settings,f=i(1)-i(0),c=this["char.width"],{"group.residues":b}=this;b.select("rect.color").attr("x",(a,l)=>i(l+.5)).attr("y",n.top).attr("width",()=>f).attr("height","100%"),b.select("text.name").attr("x",(a,l)=>i(l+1)).attr("y",o("sequence")+r/2).attr("width",()=>f).attr("height",r).attr("dominant-baseline","central").style("text-anchor","middle").attr("fill",this.initializeService.settings["text-color"]).attr("opacity",()=>c>f?0:1)}createLabels(n){const{y:i}=this.initializeService.scale,o=this.initializeService.settings,{left:r}=this.initializeService.margin,f=this.initializeService.svg.selectAll("g.labels").data([n],_n).join("g").attr("class","labels");this["group.labels"]=f.selectAll("g.label").data([{id:"sequence",label:"Sequence",expanded:!0},...n],xn).join(c=>{const b=c.append("g").attr("id",a=>"label-"+a.id).attr("class","label");return b.each(a=>{const l=""+a.id,s=this.initializeService.div.querySelector("div#label-"+l);s&&(s.style.position="absolute",s.style.left="0px",s.style.overflow="hidden",s.style.top=i(l)+"px",s.style.height=(a["line-height"]||o["line-height"])+"px",s.style.width=r+"px")}),b},c=>c,c=>(c.each(b=>{const l=this.initializeService.div.querySelector("div#label-"+b.id);l&&(l.style.display="none")}),c)),this["group.labels"].each(c=>{const b=""+c.id,a=this.initializeService.div.querySelector("div#label-"+b);a&&(a.style.position="absolute",a.style.overflow="hidden",a.style.left="0px",a.style.top=i(b)+"px",a.style.display="block",a.style.height=(c["line-height"]||o["line-height"])+"px",a.style.width=r+"px")}),this["group.labels"].selectAll("rect").data(c=>[c],_n).join("rect").attr("height",c=>c["line-height"]||o["line-height"]).attr("width",()=>r).attr("fill","none")}updateLabels(){const n=this.initializeService.scale.y,i=this.initializeService.settings;this["group.labels"].select("rect").attr("y",o=>n(String(o.id))).attr("x",0),this["group.labels"].select("text").attr("y",o=>n(String(o.id))+(o["line-height"]||i["line-height"])/2).attr("x",0).attr("dominant-baseline","central").attr("fill",o=>o["text-color"]||i["text-color"])}createGrid(n){const i=this.initializeService.svg.selectAll("g.grid").data([n],_n).join("g").attr("class","grid").lower();this["group.grid"]=i.selectAll("rect.grid-line").data(n,xn).join("rect").attr("id",o=>"grid-"+o.id).attr("class","grid-line")}updateGrid(){const n=this.initializeService.scale.y,i=this.initializeService.width,o=this.initializeService.margin,r=this.initializeService.settings;this["group.grid"].attr("x",o.left).attr("y",f=>{const c=f.values[f.values.length-1],b=n(""+f.id),a=c["line-height"]||f["line-height"]||r["line-height"];return"continuous"!==c.type?b+a/2-.5:b+a/2-(c["content-size"]||f["content-size"]||r["content-size"])/2}).attr("width",i-o.left-o.right).attr("height",f=>{const c=f.values[f.values.length-1];return"continuous"===c.type?c["content-size"]||f["content-size"]||r["content-size"]:1}).attr("fill",this.initializeService.settings["grid-color"])}createTraces(n){const i=this.initializeService.settings,o=this.tooltip;this["group.traces"]=this.initializeService.draw.selectAll("g.trace").data(n,xn).join("g").attr("id",r=>"trace-"+r.id).attr("class","trace"),this["group.traces"].each(function(r){const c=ie(this).selectAll("g.feature").data(r.values);c.enter().append("g").attr("class",b=>"feature "+b.type).attr("id",(b,a)=>`trace-${r.id}-feature-${a}`).each(function(b,a){"loci"===b.type&&b.values.forEach((l,s)=>{const u=(b["content-size"]||r["content-size"]||i["content-size"])/3,d=ie(this).append("rect").attr("stroke",b["trace-color"]||r["trace-color"]||i["trace-color"]).attr("stroke-opacity",1).attr("stroke-width",1).attr("fill",b["trace-color"]||r["trace-color"]||i["trace-color"]).attr("fill-opacity",.5).attr("rx",u).attr("ry",u);d.data([l]),d.on("mouseover",A=>function Cb(e,t,n,i,o,r){t.style("display","block"),t.style("opacity",1)}(0,o)),d.on("mousemove",A=>function Pb(e,t,n,i,o,r){"loci"===i.type&&t.html(`Trace: ${n.id}
Feature: ${i.index}
Index: ${o}
Value: ${r.start!==r.end?r.start+"-"+r.end:r.start}`),"continuous"===i.type&&t.html(`Trace: ${n.id}
Feature: ${i.index}
Index: ${o}
Value: ${r}`),t.style("left",e.offsetX+10+"px").style("top",e.offsetY+10+"px")}(A,o,r,{...b,index:a},s,l)),d.on("mouseleave",A=>function Fb(e,t,n,i,o,r){t.style("opacity",0),t.style("display","none")}(0,o))}),"continuous"===b.type&&ie(this).append("path").attr("stroke",b["trace-color"]||r["trace-color"]||i["trace-color"]).attr("stroke-opacity",1).attr("stroke-width",2).attr("fill","none").data([b.values])}),c.exit().remove()})}updateTraces(){const n=this.initializeService.scale,i=this.initializeService.settings;this["group.traces"].each(function(o){ie(this).selectAll("g.feature").each(function(c){const b=n.y(""+o.id),a=c["line-height"]||o["line-height"]||i["line-height"],l=c["line-height"]||o["content-size"]||i["content-size"];if("loci"===c.type){const s=n.x(1)-n.x(0);ie(this).selectAll("rect").attr("x",u=>n.x(u.start-.5)).attr("y",b+a/2-l/2).attr("height",l).attr("width",u=>s*(u.end-u.start+1))}if("continuous"===c.type){const s=c.values,u=void 0!==c.min?c.min:Math.min(...c.values),d=void 0!==c.max?c.max:Math.max(...c.values),A=s.map((w,m)=>[m+1,1-(w-u)/(d-u)]),C=function pb(e,t){var n=Ye(!0),i=null,o=bb,r=null,f=function ub(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new Dt(t)}(c);function c(b){var a,s,d,l=(b=function cb(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(b)).length,u=!1;for(null==i&&(r=o(d=f())),a=0;a<=l;++a)!(an.x(w)).y(([,w])=>b+a/2-(l-2)/2+(l-2)*w);ie(this).select("path").attr("d",C(A))}})})}onLabelClick(n){n.expanded=!1===n.expanded;const i=Array.from(this.featuresService.traces.values()),o=[];for(const f of i){const{expanded:c}={expanded:!0,...f};if(!0!==c){const b=this.featuresService.getBranch(f).slice(1);o.push(...b)}}const r=i.filter(f=>!o.includes(f));this.traces$.next(r),console.log("Trace",n)}static#e=this.\u0275fac=function(i){return new(i||e)(g.KVO(rt),g.KVO(vn))};static#t=this.\u0275prov=g.jDH({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const Rb=["root"],Db=e=>({trace:e});function Ib(e,t){if(1&e){const n=g.RV6();g.j41(0,"div",3),g.bIt("click",function(){const o=g.eBV(n).$implicit,r=g.XpG(2);return g.Njj(r.drawService.onLabelClick(o.value))})("keyup",function(){const o=g.eBV(n).$implicit,r=g.XpG(2);return g.Njj(r.drawService.onLabelClick(o.value))}),g.eu8(1,4),g.k0s()}if(2&e){const n=t.$implicit,i=g.XpG(2);g.Y8G("id","label-"+n.key),g.R7$(),g.Y8G("ngTemplateOutlet",i.label.templateRef)("ngTemplateOutletContext",g.eq3(3,Db,n.value))}}function Vb(e,t){if(1&e&&(g.Z7z(0,Ib,2,5,"div",2,g.Vm6),g.nI1(2,"keyvalue")),2&e){const n=g.XpG();g.Dyx(g.bMT(2,0,n.featuresService.traces))}}let jb=(()=>{class e{set settings(n){this.initService.settings=n}set features(n){this.featuresService.hierarchy=n;const i=Array.from(this.featuresService.traces.values());this.traces$.next(i)}constructor(n,i,o,r,f){this.featuresService=n,this.initService=i,this.resizeService=o,this.zoomService=r,this.drawService=f,this.traces$=this.drawService.traces$,this.sequence$=this.drawService.sequence$,this.update$=this.initService.initialized$.pipe((0,le.n)(()=>this.drawService.draw$),(0,le.n)(()=>this.resizeService.resized$),(0,Q.M)(()=>{const{left:c,right:b,bottom:a}=this.resizeService.margin,l=this.resizeService.height,s=this.resizeService.width,u=this.sequence.length+1;this.initService.zoom.translateExtent([[c,0],[s-b,l-a]]).scaleExtent([1,u/5]).extent([[c,0],[s-b,l-a]]).on("zoom",d=>{this.zoomService.zoom$.next(d)})}),(0,le.n)(()=>this.zoomService.zoomed$),(0,le.n)(()=>this.drawService.drawn$)),this._update=this.update$.subscribe()}ngOnChanges(n){n&&n.sequence&&this.sequence$.next(this.sequence)}ngAfterViewInit(){this.initService.initialize$.next(this._root)}ngOnDestroy(){this._update.unsubscribe()}onResize(n){this.resizeService.resize$.next(n)}static#e=this.\u0275fac=function(i){return new(i||e)(g.rXU(vn),g.rXU(rt),g.rXU(Ui),g.rXU(Wi),g.rXU(Zi))};static#t=this.\u0275cmp=g.VBU({type:e,selectors:[["ngx-features-viewer"]],contentQueries:function(i,o,r){if(1&i&&g.wni(r,me,5),2&i){let f;g.mGM(f=g.lsd())&&(o.label=f.first)}},viewQuery:function(i,o){if(1&i&&g.GBs(Rb,5),2&i){let r;g.mGM(r=g.lsd())&&(o._root=r.first)}},hostBindings:function(i,o){1&i&&g.bIt("resize",function(f){return o.onResize(f)},!1,g.tSv)},inputs:{settings:"settings",features:"features",sequence:"sequence"},standalone:!0,features:[g.Jv_([rt,vn,Ui,Zi,Wi]),g.OA$,g.aNF],decls:3,vars:1,consts:[["root",""],[2,"position","relative","display","block","width","100%","height","100%"],["tabindex","0",3,"id"],["tabindex","0",3,"click","keyup","id"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(i,o){1&i&&(g.j41(0,"div",1,0),g.DNE(2,Vb,3,2),g.k0s()),2&i&&(g.R7$(2),g.vxM(2,o.label?2:-1))},dependencies:[B.MD,B.T3,B.lG],styles:['@charset "UTF-8";.labels #label-sequence .parent div{cursor:default}.labels #label-sequence .parent div i{display:none}.labels .label .children-0>i{visibility:hidden}.labels .label i:before{transition:transform .4s}.labels .label.active i:before{transform:roate(0deg)}.labels .label:not(.active) i:before{transform:rotate(-90deg)}.labels .label div{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;align-items:center;box-sizing:border-box;height:100%;width:100%;cursor:pointer}.labels .label div span{text-wrap:wrap;line-break:anywhere;flex-shrink:1;flex-grow:1}.labels .label div i{flex-shrink:0;flex-grow:0}.labels div.depth-0{width:100%;padding:0 .25rem 0 .75rem}.labels div.depth-1{width:100%;padding:0 .25rem 0 1.5rem}.labels div.depth-2{width:100%;padding:0 .25rem 0 2.25rem}.labels div.depth-3{width:100%;padding:0 .25rem 0 3rem}.labels div.depth-4{width:100%;padding:0 .25rem 0 3.75rem}.labels div.depth-5{width:100%;padding:0 .25rem 0 4.5rem}/*!\n * Bootstrap Icons v1.11.3 (https://icons.getbootstrap.com/)\n * Copyright 2019-2024 The Bootstrap Authors\n * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE)\n */@font-face{font-display:block;font-family:bootstrap-icons;src:url(bootstrap-icons.bfa90bda92a84a6a.woff2) format("woff2"),url(bootstrap-icons.70a9dee9e5ab72aa.woff) format("woff")}.bi:before,[class^=bi-]:before,[class*=" bi-"]:before{display:inline-block;font-family:bootstrap-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;line-height:1;vertical-align:-.125em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bi-123:before{content:"\\f67f"}.bi-alarm-fill:before{content:"\\f101"}.bi-alarm:before{content:"\\f102"}.bi-align-bottom:before{content:"\\f103"}.bi-align-center:before{content:"\\f104"}.bi-align-end:before{content:"\\f105"}.bi-align-middle:before{content:"\\f106"}.bi-align-start:before{content:"\\f107"}.bi-align-top:before{content:"\\f108"}.bi-alt:before{content:"\\f109"}.bi-app-indicator:before{content:"\\f10a"}.bi-app:before{content:"\\f10b"}.bi-archive-fill:before{content:"\\f10c"}.bi-archive:before{content:"\\f10d"}.bi-arrow-90deg-down:before{content:"\\f10e"}.bi-arrow-90deg-left:before{content:"\\f10f"}.bi-arrow-90deg-right:before{content:"\\f110"}.bi-arrow-90deg-up:before{content:"\\f111"}.bi-arrow-bar-down:before{content:"\\f112"}.bi-arrow-bar-left:before{content:"\\f113"}.bi-arrow-bar-right:before{content:"\\f114"}.bi-arrow-bar-up:before{content:"\\f115"}.bi-arrow-clockwise:before{content:"\\f116"}.bi-arrow-counterclockwise:before{content:"\\f117"}.bi-arrow-down-circle-fill:before{content:"\\f118"}.bi-arrow-down-circle:before{content:"\\f119"}.bi-arrow-down-left-circle-fill:before{content:"\\f11a"}.bi-arrow-down-left-circle:before{content:"\\f11b"}.bi-arrow-down-left-square-fill:before{content:"\\f11c"}.bi-arrow-down-left-square:before{content:"\\f11d"}.bi-arrow-down-left:before{content:"\\f11e"}.bi-arrow-down-right-circle-fill:before{content:"\\f11f"}.bi-arrow-down-right-circle:before{content:"\\f120"}.bi-arrow-down-right-square-fill:before{content:"\\f121"}.bi-arrow-down-right-square:before{content:"\\f122"}.bi-arrow-down-right:before{content:"\\f123"}.bi-arrow-down-short:before{content:"\\f124"}.bi-arrow-down-square-fill:before{content:"\\f125"}.bi-arrow-down-square:before{content:"\\f126"}.bi-arrow-down-up:before{content:"\\f127"}.bi-arrow-down:before{content:"\\f128"}.bi-arrow-left-circle-fill:before{content:"\\f129"}.bi-arrow-left-circle:before{content:"\\f12a"}.bi-arrow-left-right:before{content:"\\f12b"}.bi-arrow-left-short:before{content:"\\f12c"}.bi-arrow-left-square-fill:before{content:"\\f12d"}.bi-arrow-left-square:before{content:"\\f12e"}.bi-arrow-left:before{content:"\\f12f"}.bi-arrow-repeat:before{content:"\\f130"}.bi-arrow-return-left:before{content:"\\f131"}.bi-arrow-return-right:before{content:"\\f132"}.bi-arrow-right-circle-fill:before{content:"\\f133"}.bi-arrow-right-circle:before{content:"\\f134"}.bi-arrow-right-short:before{content:"\\f135"}.bi-arrow-right-square-fill:before{content:"\\f136"}.bi-arrow-right-square:before{content:"\\f137"}.bi-arrow-right:before{content:"\\f138"}.bi-arrow-up-circle-fill:before{content:"\\f139"}.bi-arrow-up-circle:before{content:"\\f13a"}.bi-arrow-up-left-circle-fill:before{content:"\\f13b"}.bi-arrow-up-left-circle:before{content:"\\f13c"}.bi-arrow-up-left-square-fill:before{content:"\\f13d"}.bi-arrow-up-left-square:before{content:"\\f13e"}.bi-arrow-up-left:before{content:"\\f13f"}.bi-arrow-up-right-circle-fill:before{content:"\\f140"}.bi-arrow-up-right-circle:before{content:"\\f141"}.bi-arrow-up-right-square-fill:before{content:"\\f142"}.bi-arrow-up-right-square:before{content:"\\f143"}.bi-arrow-up-right:before{content:"\\f144"}.bi-arrow-up-short:before{content:"\\f145"}.bi-arrow-up-square-fill:before{content:"\\f146"}.bi-arrow-up-square:before{content:"\\f147"}.bi-arrow-up:before{content:"\\f148"}.bi-arrows-angle-contract:before{content:"\\f149"}.bi-arrows-angle-expand:before{content:"\\f14a"}.bi-arrows-collapse:before{content:"\\f14b"}.bi-arrows-expand:before{content:"\\f14c"}.bi-arrows-fullscreen:before{content:"\\f14d"}.bi-arrows-move:before{content:"\\f14e"}.bi-aspect-ratio-fill:before{content:"\\f14f"}.bi-aspect-ratio:before{content:"\\f150"}.bi-asterisk:before{content:"\\f151"}.bi-at:before{content:"\\f152"}.bi-award-fill:before{content:"\\f153"}.bi-award:before{content:"\\f154"}.bi-back:before{content:"\\f155"}.bi-backspace-fill:before{content:"\\f156"}.bi-backspace-reverse-fill:before{content:"\\f157"}.bi-backspace-reverse:before{content:"\\f158"}.bi-backspace:before{content:"\\f159"}.bi-badge-3d-fill:before{content:"\\f15a"}.bi-badge-3d:before{content:"\\f15b"}.bi-badge-4k-fill:before{content:"\\f15c"}.bi-badge-4k:before{content:"\\f15d"}.bi-badge-8k-fill:before{content:"\\f15e"}.bi-badge-8k:before{content:"\\f15f"}.bi-badge-ad-fill:before{content:"\\f160"}.bi-badge-ad:before{content:"\\f161"}.bi-badge-ar-fill:before{content:"\\f162"}.bi-badge-ar:before{content:"\\f163"}.bi-badge-cc-fill:before{content:"\\f164"}.bi-badge-cc:before{content:"\\f165"}.bi-badge-hd-fill:before{content:"\\f166"}.bi-badge-hd:before{content:"\\f167"}.bi-badge-tm-fill:before{content:"\\f168"}.bi-badge-tm:before{content:"\\f169"}.bi-badge-vo-fill:before{content:"\\f16a"}.bi-badge-vo:before{content:"\\f16b"}.bi-badge-vr-fill:before{content:"\\f16c"}.bi-badge-vr:before{content:"\\f16d"}.bi-badge-wc-fill:before{content:"\\f16e"}.bi-badge-wc:before{content:"\\f16f"}.bi-bag-check-fill:before{content:"\\f170"}.bi-bag-check:before{content:"\\f171"}.bi-bag-dash-fill:before{content:"\\f172"}.bi-bag-dash:before{content:"\\f173"}.bi-bag-fill:before{content:"\\f174"}.bi-bag-plus-fill:before{content:"\\f175"}.bi-bag-plus:before{content:"\\f176"}.bi-bag-x-fill:before{content:"\\f177"}.bi-bag-x:before{content:"\\f178"}.bi-bag:before{content:"\\f179"}.bi-bar-chart-fill:before{content:"\\f17a"}.bi-bar-chart-line-fill:before{content:"\\f17b"}.bi-bar-chart-line:before{content:"\\f17c"}.bi-bar-chart-steps:before{content:"\\f17d"}.bi-bar-chart:before{content:"\\f17e"}.bi-basket-fill:before{content:"\\f17f"}.bi-basket:before{content:"\\f180"}.bi-basket2-fill:before{content:"\\f181"}.bi-basket2:before{content:"\\f182"}.bi-basket3-fill:before{content:"\\f183"}.bi-basket3:before{content:"\\f184"}.bi-battery-charging:before{content:"\\f185"}.bi-battery-full:before{content:"\\f186"}.bi-battery-half:before{content:"\\f187"}.bi-battery:before{content:"\\f188"}.bi-bell-fill:before{content:"\\f189"}.bi-bell:before{content:"\\f18a"}.bi-bezier:before{content:"\\f18b"}.bi-bezier2:before{content:"\\f18c"}.bi-bicycle:before{content:"\\f18d"}.bi-binoculars-fill:before{content:"\\f18e"}.bi-binoculars:before{content:"\\f18f"}.bi-blockquote-left:before{content:"\\f190"}.bi-blockquote-right:before{content:"\\f191"}.bi-book-fill:before{content:"\\f192"}.bi-book-half:before{content:"\\f193"}.bi-book:before{content:"\\f194"}.bi-bookmark-check-fill:before{content:"\\f195"}.bi-bookmark-check:before{content:"\\f196"}.bi-bookmark-dash-fill:before{content:"\\f197"}.bi-bookmark-dash:before{content:"\\f198"}.bi-bookmark-fill:before{content:"\\f199"}.bi-bookmark-heart-fill:before{content:"\\f19a"}.bi-bookmark-heart:before{content:"\\f19b"}.bi-bookmark-plus-fill:before{content:"\\f19c"}.bi-bookmark-plus:before{content:"\\f19d"}.bi-bookmark-star-fill:before{content:"\\f19e"}.bi-bookmark-star:before{content:"\\f19f"}.bi-bookmark-x-fill:before{content:"\\f1a0"}.bi-bookmark-x:before{content:"\\f1a1"}.bi-bookmark:before{content:"\\f1a2"}.bi-bookmarks-fill:before{content:"\\f1a3"}.bi-bookmarks:before{content:"\\f1a4"}.bi-bookshelf:before{content:"\\f1a5"}.bi-bootstrap-fill:before{content:"\\f1a6"}.bi-bootstrap-reboot:before{content:"\\f1a7"}.bi-bootstrap:before{content:"\\f1a8"}.bi-border-all:before{content:"\\f1a9"}.bi-border-bottom:before{content:"\\f1aa"}.bi-border-center:before{content:"\\f1ab"}.bi-border-inner:before{content:"\\f1ac"}.bi-border-left:before{content:"\\f1ad"}.bi-border-middle:before{content:"\\f1ae"}.bi-border-outer:before{content:"\\f1af"}.bi-border-right:before{content:"\\f1b0"}.bi-border-style:before{content:"\\f1b1"}.bi-border-top:before{content:"\\f1b2"}.bi-border-width:before{content:"\\f1b3"}.bi-border:before{content:"\\f1b4"}.bi-bounding-box-circles:before{content:"\\f1b5"}.bi-bounding-box:before{content:"\\f1b6"}.bi-box-arrow-down-left:before{content:"\\f1b7"}.bi-box-arrow-down-right:before{content:"\\f1b8"}.bi-box-arrow-down:before{content:"\\f1b9"}.bi-box-arrow-in-down-left:before{content:"\\f1ba"}.bi-box-arrow-in-down-right:before{content:"\\f1bb"}.bi-box-arrow-in-down:before{content:"\\f1bc"}.bi-box-arrow-in-left:before{content:"\\f1bd"}.bi-box-arrow-in-right:before{content:"\\f1be"}.bi-box-arrow-in-up-left:before{content:"\\f1bf"}.bi-box-arrow-in-up-right:before{content:"\\f1c0"}.bi-box-arrow-in-up:before{content:"\\f1c1"}.bi-box-arrow-left:before{content:"\\f1c2"}.bi-box-arrow-right:before{content:"\\f1c3"}.bi-box-arrow-up-left:before{content:"\\f1c4"}.bi-box-arrow-up-right:before{content:"\\f1c5"}.bi-box-arrow-up:before{content:"\\f1c6"}.bi-box-seam:before{content:"\\f1c7"}.bi-box:before{content:"\\f1c8"}.bi-braces:before{content:"\\f1c9"}.bi-bricks:before{content:"\\f1ca"}.bi-briefcase-fill:before{content:"\\f1cb"}.bi-briefcase:before{content:"\\f1cc"}.bi-brightness-alt-high-fill:before{content:"\\f1cd"}.bi-brightness-alt-high:before{content:"\\f1ce"}.bi-brightness-alt-low-fill:before{content:"\\f1cf"}.bi-brightness-alt-low:before{content:"\\f1d0"}.bi-brightness-high-fill:before{content:"\\f1d1"}.bi-brightness-high:before{content:"\\f1d2"}.bi-brightness-low-fill:before{content:"\\f1d3"}.bi-brightness-low:before{content:"\\f1d4"}.bi-broadcast-pin:before{content:"\\f1d5"}.bi-broadcast:before{content:"\\f1d6"}.bi-brush-fill:before{content:"\\f1d7"}.bi-brush:before{content:"\\f1d8"}.bi-bucket-fill:before{content:"\\f1d9"}.bi-bucket:before{content:"\\f1da"}.bi-bug-fill:before{content:"\\f1db"}.bi-bug:before{content:"\\f1dc"}.bi-building:before{content:"\\f1dd"}.bi-bullseye:before{content:"\\f1de"}.bi-calculator-fill:before{content:"\\f1df"}.bi-calculator:before{content:"\\f1e0"}.bi-calendar-check-fill:before{content:"\\f1e1"}.bi-calendar-check:before{content:"\\f1e2"}.bi-calendar-date-fill:before{content:"\\f1e3"}.bi-calendar-date:before{content:"\\f1e4"}.bi-calendar-day-fill:before{content:"\\f1e5"}.bi-calendar-day:before{content:"\\f1e6"}.bi-calendar-event-fill:before{content:"\\f1e7"}.bi-calendar-event:before{content:"\\f1e8"}.bi-calendar-fill:before{content:"\\f1e9"}.bi-calendar-minus-fill:before{content:"\\f1ea"}.bi-calendar-minus:before{content:"\\f1eb"}.bi-calendar-month-fill:before{content:"\\f1ec"}.bi-calendar-month:before{content:"\\f1ed"}.bi-calendar-plus-fill:before{content:"\\f1ee"}.bi-calendar-plus:before{content:"\\f1ef"}.bi-calendar-range-fill:before{content:"\\f1f0"}.bi-calendar-range:before{content:"\\f1f1"}.bi-calendar-week-fill:before{content:"\\f1f2"}.bi-calendar-week:before{content:"\\f1f3"}.bi-calendar-x-fill:before{content:"\\f1f4"}.bi-calendar-x:before{content:"\\f1f5"}.bi-calendar:before{content:"\\f1f6"}.bi-calendar2-check-fill:before{content:"\\f1f7"}.bi-calendar2-check:before{content:"\\f1f8"}.bi-calendar2-date-fill:before{content:"\\f1f9"}.bi-calendar2-date:before{content:"\\f1fa"}.bi-calendar2-day-fill:before{content:"\\f1fb"}.bi-calendar2-day:before{content:"\\f1fc"}.bi-calendar2-event-fill:before{content:"\\f1fd"}.bi-calendar2-event:before{content:"\\f1fe"}.bi-calendar2-fill:before{content:"\\f1ff"}.bi-calendar2-minus-fill:before{content:"\\f200"}.bi-calendar2-minus:before{content:"\\f201"}.bi-calendar2-month-fill:before{content:"\\f202"}.bi-calendar2-month:before{content:"\\f203"}.bi-calendar2-plus-fill:before{content:"\\f204"}.bi-calendar2-plus:before{content:"\\f205"}.bi-calendar2-range-fill:before{content:"\\f206"}.bi-calendar2-range:before{content:"\\f207"}.bi-calendar2-week-fill:before{content:"\\f208"}.bi-calendar2-week:before{content:"\\f209"}.bi-calendar2-x-fill:before{content:"\\f20a"}.bi-calendar2-x:before{content:"\\f20b"}.bi-calendar2:before{content:"\\f20c"}.bi-calendar3-event-fill:before{content:"\\f20d"}.bi-calendar3-event:before{content:"\\f20e"}.bi-calendar3-fill:before{content:"\\f20f"}.bi-calendar3-range-fill:before{content:"\\f210"}.bi-calendar3-range:before{content:"\\f211"}.bi-calendar3-week-fill:before{content:"\\f212"}.bi-calendar3-week:before{content:"\\f213"}.bi-calendar3:before{content:"\\f214"}.bi-calendar4-event:before{content:"\\f215"}.bi-calendar4-range:before{content:"\\f216"}.bi-calendar4-week:before{content:"\\f217"}.bi-calendar4:before{content:"\\f218"}.bi-camera-fill:before{content:"\\f219"}.bi-camera-reels-fill:before{content:"\\f21a"}.bi-camera-reels:before{content:"\\f21b"}.bi-camera-video-fill:before{content:"\\f21c"}.bi-camera-video-off-fill:before{content:"\\f21d"}.bi-camera-video-off:before{content:"\\f21e"}.bi-camera-video:before{content:"\\f21f"}.bi-camera:before{content:"\\f220"}.bi-camera2:before{content:"\\f221"}.bi-capslock-fill:before{content:"\\f222"}.bi-capslock:before{content:"\\f223"}.bi-card-checklist:before{content:"\\f224"}.bi-card-heading:before{content:"\\f225"}.bi-card-image:before{content:"\\f226"}.bi-card-list:before{content:"\\f227"}.bi-card-text:before{content:"\\f228"}.bi-caret-down-fill:before{content:"\\f229"}.bi-caret-down-square-fill:before{content:"\\f22a"}.bi-caret-down-square:before{content:"\\f22b"}.bi-caret-down:before{content:"\\f22c"}.bi-caret-left-fill:before{content:"\\f22d"}.bi-caret-left-square-fill:before{content:"\\f22e"}.bi-caret-left-square:before{content:"\\f22f"}.bi-caret-left:before{content:"\\f230"}.bi-caret-right-fill:before{content:"\\f231"}.bi-caret-right-square-fill:before{content:"\\f232"}.bi-caret-right-square:before{content:"\\f233"}.bi-caret-right:before{content:"\\f234"}.bi-caret-up-fill:before{content:"\\f235"}.bi-caret-up-square-fill:before{content:"\\f236"}.bi-caret-up-square:before{content:"\\f237"}.bi-caret-up:before{content:"\\f238"}.bi-cart-check-fill:before{content:"\\f239"}.bi-cart-check:before{content:"\\f23a"}.bi-cart-dash-fill:before{content:"\\f23b"}.bi-cart-dash:before{content:"\\f23c"}.bi-cart-fill:before{content:"\\f23d"}.bi-cart-plus-fill:before{content:"\\f23e"}.bi-cart-plus:before{content:"\\f23f"}.bi-cart-x-fill:before{content:"\\f240"}.bi-cart-x:before{content:"\\f241"}.bi-cart:before{content:"\\f242"}.bi-cart2:before{content:"\\f243"}.bi-cart3:before{content:"\\f244"}.bi-cart4:before{content:"\\f245"}.bi-cash-stack:before{content:"\\f246"}.bi-cash:before{content:"\\f247"}.bi-cast:before{content:"\\f248"}.bi-chat-dots-fill:before{content:"\\f249"}.bi-chat-dots:before{content:"\\f24a"}.bi-chat-fill:before{content:"\\f24b"}.bi-chat-left-dots-fill:before{content:"\\f24c"}.bi-chat-left-dots:before{content:"\\f24d"}.bi-chat-left-fill:before{content:"\\f24e"}.bi-chat-left-quote-fill:before{content:"\\f24f"}.bi-chat-left-quote:before{content:"\\f250"}.bi-chat-left-text-fill:before{content:"\\f251"}.bi-chat-left-text:before{content:"\\f252"}.bi-chat-left:before{content:"\\f253"}.bi-chat-quote-fill:before{content:"\\f254"}.bi-chat-quote:before{content:"\\f255"}.bi-chat-right-dots-fill:before{content:"\\f256"}.bi-chat-right-dots:before{content:"\\f257"}.bi-chat-right-fill:before{content:"\\f258"}.bi-chat-right-quote-fill:before{content:"\\f259"}.bi-chat-right-quote:before{content:"\\f25a"}.bi-chat-right-text-fill:before{content:"\\f25b"}.bi-chat-right-text:before{content:"\\f25c"}.bi-chat-right:before{content:"\\f25d"}.bi-chat-square-dots-fill:before{content:"\\f25e"}.bi-chat-square-dots:before{content:"\\f25f"}.bi-chat-square-fill:before{content:"\\f260"}.bi-chat-square-quote-fill:before{content:"\\f261"}.bi-chat-square-quote:before{content:"\\f262"}.bi-chat-square-text-fill:before{content:"\\f263"}.bi-chat-square-text:before{content:"\\f264"}.bi-chat-square:before{content:"\\f265"}.bi-chat-text-fill:before{content:"\\f266"}.bi-chat-text:before{content:"\\f267"}.bi-chat:before{content:"\\f268"}.bi-check-all:before{content:"\\f269"}.bi-check-circle-fill:before{content:"\\f26a"}.bi-check-circle:before{content:"\\f26b"}.bi-check-square-fill:before{content:"\\f26c"}.bi-check-square:before{content:"\\f26d"}.bi-check:before{content:"\\f26e"}.bi-check2-all:before{content:"\\f26f"}.bi-check2-circle:before{content:"\\f270"}.bi-check2-square:before{content:"\\f271"}.bi-check2:before{content:"\\f272"}.bi-chevron-bar-contract:before{content:"\\f273"}.bi-chevron-bar-down:before{content:"\\f274"}.bi-chevron-bar-expand:before{content:"\\f275"}.bi-chevron-bar-left:before{content:"\\f276"}.bi-chevron-bar-right:before{content:"\\f277"}.bi-chevron-bar-up:before{content:"\\f278"}.bi-chevron-compact-down:before{content:"\\f279"}.bi-chevron-compact-left:before{content:"\\f27a"}.bi-chevron-compact-right:before{content:"\\f27b"}.bi-chevron-compact-up:before{content:"\\f27c"}.bi-chevron-contract:before{content:"\\f27d"}.bi-chevron-double-down:before{content:"\\f27e"}.bi-chevron-double-left:before{content:"\\f27f"}.bi-chevron-double-right:before{content:"\\f280"}.bi-chevron-double-up:before{content:"\\f281"}.bi-chevron-down:before{content:"\\f282"}.bi-chevron-expand:before{content:"\\f283"}.bi-chevron-left:before{content:"\\f284"}.bi-chevron-right:before{content:"\\f285"}.bi-chevron-up:before{content:"\\f286"}.bi-circle-fill:before{content:"\\f287"}.bi-circle-half:before{content:"\\f288"}.bi-circle-square:before{content:"\\f289"}.bi-circle:before{content:"\\f28a"}.bi-clipboard-check:before{content:"\\f28b"}.bi-clipboard-data:before{content:"\\f28c"}.bi-clipboard-minus:before{content:"\\f28d"}.bi-clipboard-plus:before{content:"\\f28e"}.bi-clipboard-x:before{content:"\\f28f"}.bi-clipboard:before{content:"\\f290"}.bi-clock-fill:before{content:"\\f291"}.bi-clock-history:before{content:"\\f292"}.bi-clock:before{content:"\\f293"}.bi-cloud-arrow-down-fill:before{content:"\\f294"}.bi-cloud-arrow-down:before{content:"\\f295"}.bi-cloud-arrow-up-fill:before{content:"\\f296"}.bi-cloud-arrow-up:before{content:"\\f297"}.bi-cloud-check-fill:before{content:"\\f298"}.bi-cloud-check:before{content:"\\f299"}.bi-cloud-download-fill:before{content:"\\f29a"}.bi-cloud-download:before{content:"\\f29b"}.bi-cloud-drizzle-fill:before{content:"\\f29c"}.bi-cloud-drizzle:before{content:"\\f29d"}.bi-cloud-fill:before{content:"\\f29e"}.bi-cloud-fog-fill:before{content:"\\f29f"}.bi-cloud-fog:before{content:"\\f2a0"}.bi-cloud-fog2-fill:before{content:"\\f2a1"}.bi-cloud-fog2:before{content:"\\f2a2"}.bi-cloud-hail-fill:before{content:"\\f2a3"}.bi-cloud-hail:before{content:"\\f2a4"}.bi-cloud-haze-fill:before{content:"\\f2a6"}.bi-cloud-haze:before{content:"\\f2a7"}.bi-cloud-haze2-fill:before{content:"\\f2a8"}.bi-cloud-lightning-fill:before{content:"\\f2a9"}.bi-cloud-lightning-rain-fill:before{content:"\\f2aa"}.bi-cloud-lightning-rain:before{content:"\\f2ab"}.bi-cloud-lightning:before{content:"\\f2ac"}.bi-cloud-minus-fill:before{content:"\\f2ad"}.bi-cloud-minus:before{content:"\\f2ae"}.bi-cloud-moon-fill:before{content:"\\f2af"}.bi-cloud-moon:before{content:"\\f2b0"}.bi-cloud-plus-fill:before{content:"\\f2b1"}.bi-cloud-plus:before{content:"\\f2b2"}.bi-cloud-rain-fill:before{content:"\\f2b3"}.bi-cloud-rain-heavy-fill:before{content:"\\f2b4"}.bi-cloud-rain-heavy:before{content:"\\f2b5"}.bi-cloud-rain:before{content:"\\f2b6"}.bi-cloud-slash-fill:before{content:"\\f2b7"}.bi-cloud-slash:before{content:"\\f2b8"}.bi-cloud-sleet-fill:before{content:"\\f2b9"}.bi-cloud-sleet:before{content:"\\f2ba"}.bi-cloud-snow-fill:before{content:"\\f2bb"}.bi-cloud-snow:before{content:"\\f2bc"}.bi-cloud-sun-fill:before{content:"\\f2bd"}.bi-cloud-sun:before{content:"\\f2be"}.bi-cloud-upload-fill:before{content:"\\f2bf"}.bi-cloud-upload:before{content:"\\f2c0"}.bi-cloud:before{content:"\\f2c1"}.bi-clouds-fill:before{content:"\\f2c2"}.bi-clouds:before{content:"\\f2c3"}.bi-cloudy-fill:before{content:"\\f2c4"}.bi-cloudy:before{content:"\\f2c5"}.bi-code-slash:before{content:"\\f2c6"}.bi-code-square:before{content:"\\f2c7"}.bi-code:before{content:"\\f2c8"}.bi-collection-fill:before{content:"\\f2c9"}.bi-collection-play-fill:before{content:"\\f2ca"}.bi-collection-play:before{content:"\\f2cb"}.bi-collection:before{content:"\\f2cc"}.bi-columns-gap:before{content:"\\f2cd"}.bi-columns:before{content:"\\f2ce"}.bi-command:before{content:"\\f2cf"}.bi-compass-fill:before{content:"\\f2d0"}.bi-compass:before{content:"\\f2d1"}.bi-cone-striped:before{content:"\\f2d2"}.bi-cone:before{content:"\\f2d3"}.bi-controller:before{content:"\\f2d4"}.bi-cpu-fill:before{content:"\\f2d5"}.bi-cpu:before{content:"\\f2d6"}.bi-credit-card-2-back-fill:before{content:"\\f2d7"}.bi-credit-card-2-back:before{content:"\\f2d8"}.bi-credit-card-2-front-fill:before{content:"\\f2d9"}.bi-credit-card-2-front:before{content:"\\f2da"}.bi-credit-card-fill:before{content:"\\f2db"}.bi-credit-card:before{content:"\\f2dc"}.bi-crop:before{content:"\\f2dd"}.bi-cup-fill:before{content:"\\f2de"}.bi-cup-straw:before{content:"\\f2df"}.bi-cup:before{content:"\\f2e0"}.bi-cursor-fill:before{content:"\\f2e1"}.bi-cursor-text:before{content:"\\f2e2"}.bi-cursor:before{content:"\\f2e3"}.bi-dash-circle-dotted:before{content:"\\f2e4"}.bi-dash-circle-fill:before{content:"\\f2e5"}.bi-dash-circle:before{content:"\\f2e6"}.bi-dash-square-dotted:before{content:"\\f2e7"}.bi-dash-square-fill:before{content:"\\f2e8"}.bi-dash-square:before{content:"\\f2e9"}.bi-dash:before{content:"\\f2ea"}.bi-diagram-2-fill:before{content:"\\f2eb"}.bi-diagram-2:before{content:"\\f2ec"}.bi-diagram-3-fill:before{content:"\\f2ed"}.bi-diagram-3:before{content:"\\f2ee"}.bi-diamond-fill:before{content:"\\f2ef"}.bi-diamond-half:before{content:"\\f2f0"}.bi-diamond:before{content:"\\f2f1"}.bi-dice-1-fill:before{content:"\\f2f2"}.bi-dice-1:before{content:"\\f2f3"}.bi-dice-2-fill:before{content:"\\f2f4"}.bi-dice-2:before{content:"\\f2f5"}.bi-dice-3-fill:before{content:"\\f2f6"}.bi-dice-3:before{content:"\\f2f7"}.bi-dice-4-fill:before{content:"\\f2f8"}.bi-dice-4:before{content:"\\f2f9"}.bi-dice-5-fill:before{content:"\\f2fa"}.bi-dice-5:before{content:"\\f2fb"}.bi-dice-6-fill:before{content:"\\f2fc"}.bi-dice-6:before{content:"\\f2fd"}.bi-disc-fill:before{content:"\\f2fe"}.bi-disc:before{content:"\\f2ff"}.bi-discord:before{content:"\\f300"}.bi-display-fill:before{content:"\\f301"}.bi-display:before{content:"\\f302"}.bi-distribute-horizontal:before{content:"\\f303"}.bi-distribute-vertical:before{content:"\\f304"}.bi-door-closed-fill:before{content:"\\f305"}.bi-door-closed:before{content:"\\f306"}.bi-door-open-fill:before{content:"\\f307"}.bi-door-open:before{content:"\\f308"}.bi-dot:before{content:"\\f309"}.bi-download:before{content:"\\f30a"}.bi-droplet-fill:before{content:"\\f30b"}.bi-droplet-half:before{content:"\\f30c"}.bi-droplet:before{content:"\\f30d"}.bi-earbuds:before{content:"\\f30e"}.bi-easel-fill:before{content:"\\f30f"}.bi-easel:before{content:"\\f310"}.bi-egg-fill:before{content:"\\f311"}.bi-egg-fried:before{content:"\\f312"}.bi-egg:before{content:"\\f313"}.bi-eject-fill:before{content:"\\f314"}.bi-eject:before{content:"\\f315"}.bi-emoji-angry-fill:before{content:"\\f316"}.bi-emoji-angry:before{content:"\\f317"}.bi-emoji-dizzy-fill:before{content:"\\f318"}.bi-emoji-dizzy:before{content:"\\f319"}.bi-emoji-expressionless-fill:before{content:"\\f31a"}.bi-emoji-expressionless:before{content:"\\f31b"}.bi-emoji-frown-fill:before{content:"\\f31c"}.bi-emoji-frown:before{content:"\\f31d"}.bi-emoji-heart-eyes-fill:before{content:"\\f31e"}.bi-emoji-heart-eyes:before{content:"\\f31f"}.bi-emoji-laughing-fill:before{content:"\\f320"}.bi-emoji-laughing:before{content:"\\f321"}.bi-emoji-neutral-fill:before{content:"\\f322"}.bi-emoji-neutral:before{content:"\\f323"}.bi-emoji-smile-fill:before{content:"\\f324"}.bi-emoji-smile-upside-down-fill:before{content:"\\f325"}.bi-emoji-smile-upside-down:before{content:"\\f326"}.bi-emoji-smile:before{content:"\\f327"}.bi-emoji-sunglasses-fill:before{content:"\\f328"}.bi-emoji-sunglasses:before{content:"\\f329"}.bi-emoji-wink-fill:before{content:"\\f32a"}.bi-emoji-wink:before{content:"\\f32b"}.bi-envelope-fill:before{content:"\\f32c"}.bi-envelope-open-fill:before{content:"\\f32d"}.bi-envelope-open:before{content:"\\f32e"}.bi-envelope:before{content:"\\f32f"}.bi-eraser-fill:before{content:"\\f330"}.bi-eraser:before{content:"\\f331"}.bi-exclamation-circle-fill:before{content:"\\f332"}.bi-exclamation-circle:before{content:"\\f333"}.bi-exclamation-diamond-fill:before{content:"\\f334"}.bi-exclamation-diamond:before{content:"\\f335"}.bi-exclamation-octagon-fill:before{content:"\\f336"}.bi-exclamation-octagon:before{content:"\\f337"}.bi-exclamation-square-fill:before{content:"\\f338"}.bi-exclamation-square:before{content:"\\f339"}.bi-exclamation-triangle-fill:before{content:"\\f33a"}.bi-exclamation-triangle:before{content:"\\f33b"}.bi-exclamation:before{content:"\\f33c"}.bi-exclude:before{content:"\\f33d"}.bi-eye-fill:before{content:"\\f33e"}.bi-eye-slash-fill:before{content:"\\f33f"}.bi-eye-slash:before{content:"\\f340"}.bi-eye:before{content:"\\f341"}.bi-eyedropper:before{content:"\\f342"}.bi-eyeglasses:before{content:"\\f343"}.bi-facebook:before{content:"\\f344"}.bi-file-arrow-down-fill:before{content:"\\f345"}.bi-file-arrow-down:before{content:"\\f346"}.bi-file-arrow-up-fill:before{content:"\\f347"}.bi-file-arrow-up:before{content:"\\f348"}.bi-file-bar-graph-fill:before{content:"\\f349"}.bi-file-bar-graph:before{content:"\\f34a"}.bi-file-binary-fill:before{content:"\\f34b"}.bi-file-binary:before{content:"\\f34c"}.bi-file-break-fill:before{content:"\\f34d"}.bi-file-break:before{content:"\\f34e"}.bi-file-check-fill:before{content:"\\f34f"}.bi-file-check:before{content:"\\f350"}.bi-file-code-fill:before{content:"\\f351"}.bi-file-code:before{content:"\\f352"}.bi-file-diff-fill:before{content:"\\f353"}.bi-file-diff:before{content:"\\f354"}.bi-file-earmark-arrow-down-fill:before{content:"\\f355"}.bi-file-earmark-arrow-down:before{content:"\\f356"}.bi-file-earmark-arrow-up-fill:before{content:"\\f357"}.bi-file-earmark-arrow-up:before{content:"\\f358"}.bi-file-earmark-bar-graph-fill:before{content:"\\f359"}.bi-file-earmark-bar-graph:before{content:"\\f35a"}.bi-file-earmark-binary-fill:before{content:"\\f35b"}.bi-file-earmark-binary:before{content:"\\f35c"}.bi-file-earmark-break-fill:before{content:"\\f35d"}.bi-file-earmark-break:before{content:"\\f35e"}.bi-file-earmark-check-fill:before{content:"\\f35f"}.bi-file-earmark-check:before{content:"\\f360"}.bi-file-earmark-code-fill:before{content:"\\f361"}.bi-file-earmark-code:before{content:"\\f362"}.bi-file-earmark-diff-fill:before{content:"\\f363"}.bi-file-earmark-diff:before{content:"\\f364"}.bi-file-earmark-easel-fill:before{content:"\\f365"}.bi-file-earmark-easel:before{content:"\\f366"}.bi-file-earmark-excel-fill:before{content:"\\f367"}.bi-file-earmark-excel:before{content:"\\f368"}.bi-file-earmark-fill:before{content:"\\f369"}.bi-file-earmark-font-fill:before{content:"\\f36a"}.bi-file-earmark-font:before{content:"\\f36b"}.bi-file-earmark-image-fill:before{content:"\\f36c"}.bi-file-earmark-image:before{content:"\\f36d"}.bi-file-earmark-lock-fill:before{content:"\\f36e"}.bi-file-earmark-lock:before{content:"\\f36f"}.bi-file-earmark-lock2-fill:before{content:"\\f370"}.bi-file-earmark-lock2:before{content:"\\f371"}.bi-file-earmark-medical-fill:before{content:"\\f372"}.bi-file-earmark-medical:before{content:"\\f373"}.bi-file-earmark-minus-fill:before{content:"\\f374"}.bi-file-earmark-minus:before{content:"\\f375"}.bi-file-earmark-music-fill:before{content:"\\f376"}.bi-file-earmark-music:before{content:"\\f377"}.bi-file-earmark-person-fill:before{content:"\\f378"}.bi-file-earmark-person:before{content:"\\f379"}.bi-file-earmark-play-fill:before{content:"\\f37a"}.bi-file-earmark-play:before{content:"\\f37b"}.bi-file-earmark-plus-fill:before{content:"\\f37c"}.bi-file-earmark-plus:before{content:"\\f37d"}.bi-file-earmark-post-fill:before{content:"\\f37e"}.bi-file-earmark-post:before{content:"\\f37f"}.bi-file-earmark-ppt-fill:before{content:"\\f380"}.bi-file-earmark-ppt:before{content:"\\f381"}.bi-file-earmark-richtext-fill:before{content:"\\f382"}.bi-file-earmark-richtext:before{content:"\\f383"}.bi-file-earmark-ruled-fill:before{content:"\\f384"}.bi-file-earmark-ruled:before{content:"\\f385"}.bi-file-earmark-slides-fill:before{content:"\\f386"}.bi-file-earmark-slides:before{content:"\\f387"}.bi-file-earmark-spreadsheet-fill:before{content:"\\f388"}.bi-file-earmark-spreadsheet:before{content:"\\f389"}.bi-file-earmark-text-fill:before{content:"\\f38a"}.bi-file-earmark-text:before{content:"\\f38b"}.bi-file-earmark-word-fill:before{content:"\\f38c"}.bi-file-earmark-word:before{content:"\\f38d"}.bi-file-earmark-x-fill:before{content:"\\f38e"}.bi-file-earmark-x:before{content:"\\f38f"}.bi-file-earmark-zip-fill:before{content:"\\f390"}.bi-file-earmark-zip:before{content:"\\f391"}.bi-file-earmark:before{content:"\\f392"}.bi-file-easel-fill:before{content:"\\f393"}.bi-file-easel:before{content:"\\f394"}.bi-file-excel-fill:before{content:"\\f395"}.bi-file-excel:before{content:"\\f396"}.bi-file-fill:before{content:"\\f397"}.bi-file-font-fill:before{content:"\\f398"}.bi-file-font:before{content:"\\f399"}.bi-file-image-fill:before{content:"\\f39a"}.bi-file-image:before{content:"\\f39b"}.bi-file-lock-fill:before{content:"\\f39c"}.bi-file-lock:before{content:"\\f39d"}.bi-file-lock2-fill:before{content:"\\f39e"}.bi-file-lock2:before{content:"\\f39f"}.bi-file-medical-fill:before{content:"\\f3a0"}.bi-file-medical:before{content:"\\f3a1"}.bi-file-minus-fill:before{content:"\\f3a2"}.bi-file-minus:before{content:"\\f3a3"}.bi-file-music-fill:before{content:"\\f3a4"}.bi-file-music:before{content:"\\f3a5"}.bi-file-person-fill:before{content:"\\f3a6"}.bi-file-person:before{content:"\\f3a7"}.bi-file-play-fill:before{content:"\\f3a8"}.bi-file-play:before{content:"\\f3a9"}.bi-file-plus-fill:before{content:"\\f3aa"}.bi-file-plus:before{content:"\\f3ab"}.bi-file-post-fill:before{content:"\\f3ac"}.bi-file-post:before{content:"\\f3ad"}.bi-file-ppt-fill:before{content:"\\f3ae"}.bi-file-ppt:before{content:"\\f3af"}.bi-file-richtext-fill:before{content:"\\f3b0"}.bi-file-richtext:before{content:"\\f3b1"}.bi-file-ruled-fill:before{content:"\\f3b2"}.bi-file-ruled:before{content:"\\f3b3"}.bi-file-slides-fill:before{content:"\\f3b4"}.bi-file-slides:before{content:"\\f3b5"}.bi-file-spreadsheet-fill:before{content:"\\f3b6"}.bi-file-spreadsheet:before{content:"\\f3b7"}.bi-file-text-fill:before{content:"\\f3b8"}.bi-file-text:before{content:"\\f3b9"}.bi-file-word-fill:before{content:"\\f3ba"}.bi-file-word:before{content:"\\f3bb"}.bi-file-x-fill:before{content:"\\f3bc"}.bi-file-x:before{content:"\\f3bd"}.bi-file-zip-fill:before{content:"\\f3be"}.bi-file-zip:before{content:"\\f3bf"}.bi-file:before{content:"\\f3c0"}.bi-files-alt:before{content:"\\f3c1"}.bi-files:before{content:"\\f3c2"}.bi-film:before{content:"\\f3c3"}.bi-filter-circle-fill:before{content:"\\f3c4"}.bi-filter-circle:before{content:"\\f3c5"}.bi-filter-left:before{content:"\\f3c6"}.bi-filter-right:before{content:"\\f3c7"}.bi-filter-square-fill:before{content:"\\f3c8"}.bi-filter-square:before{content:"\\f3c9"}.bi-filter:before{content:"\\f3ca"}.bi-flag-fill:before{content:"\\f3cb"}.bi-flag:before{content:"\\f3cc"}.bi-flower1:before{content:"\\f3cd"}.bi-flower2:before{content:"\\f3ce"}.bi-flower3:before{content:"\\f3cf"}.bi-folder-check:before{content:"\\f3d0"}.bi-folder-fill:before{content:"\\f3d1"}.bi-folder-minus:before{content:"\\f3d2"}.bi-folder-plus:before{content:"\\f3d3"}.bi-folder-symlink-fill:before{content:"\\f3d4"}.bi-folder-symlink:before{content:"\\f3d5"}.bi-folder-x:before{content:"\\f3d6"}.bi-folder:before{content:"\\f3d7"}.bi-folder2-open:before{content:"\\f3d8"}.bi-folder2:before{content:"\\f3d9"}.bi-fonts:before{content:"\\f3da"}.bi-forward-fill:before{content:"\\f3db"}.bi-forward:before{content:"\\f3dc"}.bi-front:before{content:"\\f3dd"}.bi-fullscreen-exit:before{content:"\\f3de"}.bi-fullscreen:before{content:"\\f3df"}.bi-funnel-fill:before{content:"\\f3e0"}.bi-funnel:before{content:"\\f3e1"}.bi-gear-fill:before{content:"\\f3e2"}.bi-gear-wide-connected:before{content:"\\f3e3"}.bi-gear-wide:before{content:"\\f3e4"}.bi-gear:before{content:"\\f3e5"}.bi-gem:before{content:"\\f3e6"}.bi-geo-alt-fill:before{content:"\\f3e7"}.bi-geo-alt:before{content:"\\f3e8"}.bi-geo-fill:before{content:"\\f3e9"}.bi-geo:before{content:"\\f3ea"}.bi-gift-fill:before{content:"\\f3eb"}.bi-gift:before{content:"\\f3ec"}.bi-github:before{content:"\\f3ed"}.bi-globe:before{content:"\\f3ee"}.bi-globe2:before{content:"\\f3ef"}.bi-google:before{content:"\\f3f0"}.bi-graph-down:before{content:"\\f3f1"}.bi-graph-up:before{content:"\\f3f2"}.bi-grid-1x2-fill:before{content:"\\f3f3"}.bi-grid-1x2:before{content:"\\f3f4"}.bi-grid-3x2-gap-fill:before{content:"\\f3f5"}.bi-grid-3x2-gap:before{content:"\\f3f6"}.bi-grid-3x2:before{content:"\\f3f7"}.bi-grid-3x3-gap-fill:before{content:"\\f3f8"}.bi-grid-3x3-gap:before{content:"\\f3f9"}.bi-grid-3x3:before{content:"\\f3fa"}.bi-grid-fill:before{content:"\\f3fb"}.bi-grid:before{content:"\\f3fc"}.bi-grip-horizontal:before{content:"\\f3fd"}.bi-grip-vertical:before{content:"\\f3fe"}.bi-hammer:before{content:"\\f3ff"}.bi-hand-index-fill:before{content:"\\f400"}.bi-hand-index-thumb-fill:before{content:"\\f401"}.bi-hand-index-thumb:before{content:"\\f402"}.bi-hand-index:before{content:"\\f403"}.bi-hand-thumbs-down-fill:before{content:"\\f404"}.bi-hand-thumbs-down:before{content:"\\f405"}.bi-hand-thumbs-up-fill:before{content:"\\f406"}.bi-hand-thumbs-up:before{content:"\\f407"}.bi-handbag-fill:before{content:"\\f408"}.bi-handbag:before{content:"\\f409"}.bi-hash:before{content:"\\f40a"}.bi-hdd-fill:before{content:"\\f40b"}.bi-hdd-network-fill:before{content:"\\f40c"}.bi-hdd-network:before{content:"\\f40d"}.bi-hdd-rack-fill:before{content:"\\f40e"}.bi-hdd-rack:before{content:"\\f40f"}.bi-hdd-stack-fill:before{content:"\\f410"}.bi-hdd-stack:before{content:"\\f411"}.bi-hdd:before{content:"\\f412"}.bi-headphones:before{content:"\\f413"}.bi-headset:before{content:"\\f414"}.bi-heart-fill:before{content:"\\f415"}.bi-heart-half:before{content:"\\f416"}.bi-heart:before{content:"\\f417"}.bi-heptagon-fill:before{content:"\\f418"}.bi-heptagon-half:before{content:"\\f419"}.bi-heptagon:before{content:"\\f41a"}.bi-hexagon-fill:before{content:"\\f41b"}.bi-hexagon-half:before{content:"\\f41c"}.bi-hexagon:before{content:"\\f41d"}.bi-hourglass-bottom:before{content:"\\f41e"}.bi-hourglass-split:before{content:"\\f41f"}.bi-hourglass-top:before{content:"\\f420"}.bi-hourglass:before{content:"\\f421"}.bi-house-door-fill:before{content:"\\f422"}.bi-house-door:before{content:"\\f423"}.bi-house-fill:before{content:"\\f424"}.bi-house:before{content:"\\f425"}.bi-hr:before{content:"\\f426"}.bi-hurricane:before{content:"\\f427"}.bi-image-alt:before{content:"\\f428"}.bi-image-fill:before{content:"\\f429"}.bi-image:before{content:"\\f42a"}.bi-images:before{content:"\\f42b"}.bi-inbox-fill:before{content:"\\f42c"}.bi-inbox:before{content:"\\f42d"}.bi-inboxes-fill:before{content:"\\f42e"}.bi-inboxes:before{content:"\\f42f"}.bi-info-circle-fill:before{content:"\\f430"}.bi-info-circle:before{content:"\\f431"}.bi-info-square-fill:before{content:"\\f432"}.bi-info-square:before{content:"\\f433"}.bi-info:before{content:"\\f434"}.bi-input-cursor-text:before{content:"\\f435"}.bi-input-cursor:before{content:"\\f436"}.bi-instagram:before{content:"\\f437"}.bi-intersect:before{content:"\\f438"}.bi-journal-album:before{content:"\\f439"}.bi-journal-arrow-down:before{content:"\\f43a"}.bi-journal-arrow-up:before{content:"\\f43b"}.bi-journal-bookmark-fill:before{content:"\\f43c"}.bi-journal-bookmark:before{content:"\\f43d"}.bi-journal-check:before{content:"\\f43e"}.bi-journal-code:before{content:"\\f43f"}.bi-journal-medical:before{content:"\\f440"}.bi-journal-minus:before{content:"\\f441"}.bi-journal-plus:before{content:"\\f442"}.bi-journal-richtext:before{content:"\\f443"}.bi-journal-text:before{content:"\\f444"}.bi-journal-x:before{content:"\\f445"}.bi-journal:before{content:"\\f446"}.bi-journals:before{content:"\\f447"}.bi-joystick:before{content:"\\f448"}.bi-justify-left:before{content:"\\f449"}.bi-justify-right:before{content:"\\f44a"}.bi-justify:before{content:"\\f44b"}.bi-kanban-fill:before{content:"\\f44c"}.bi-kanban:before{content:"\\f44d"}.bi-key-fill:before{content:"\\f44e"}.bi-key:before{content:"\\f44f"}.bi-keyboard-fill:before{content:"\\f450"}.bi-keyboard:before{content:"\\f451"}.bi-ladder:before{content:"\\f452"}.bi-lamp-fill:before{content:"\\f453"}.bi-lamp:before{content:"\\f454"}.bi-laptop-fill:before{content:"\\f455"}.bi-laptop:before{content:"\\f456"}.bi-layer-backward:before{content:"\\f457"}.bi-layer-forward:before{content:"\\f458"}.bi-layers-fill:before{content:"\\f459"}.bi-layers-half:before{content:"\\f45a"}.bi-layers:before{content:"\\f45b"}.bi-layout-sidebar-inset-reverse:before{content:"\\f45c"}.bi-layout-sidebar-inset:before{content:"\\f45d"}.bi-layout-sidebar-reverse:before{content:"\\f45e"}.bi-layout-sidebar:before{content:"\\f45f"}.bi-layout-split:before{content:"\\f460"}.bi-layout-text-sidebar-reverse:before{content:"\\f461"}.bi-layout-text-sidebar:before{content:"\\f462"}.bi-layout-text-window-reverse:before{content:"\\f463"}.bi-layout-text-window:before{content:"\\f464"}.bi-layout-three-columns:before{content:"\\f465"}.bi-layout-wtf:before{content:"\\f466"}.bi-life-preserver:before{content:"\\f467"}.bi-lightbulb-fill:before{content:"\\f468"}.bi-lightbulb-off-fill:before{content:"\\f469"}.bi-lightbulb-off:before{content:"\\f46a"}.bi-lightbulb:before{content:"\\f46b"}.bi-lightning-charge-fill:before{content:"\\f46c"}.bi-lightning-charge:before{content:"\\f46d"}.bi-lightning-fill:before{content:"\\f46e"}.bi-lightning:before{content:"\\f46f"}.bi-link-45deg:before{content:"\\f470"}.bi-link:before{content:"\\f471"}.bi-linkedin:before{content:"\\f472"}.bi-list-check:before{content:"\\f473"}.bi-list-nested:before{content:"\\f474"}.bi-list-ol:before{content:"\\f475"}.bi-list-stars:before{content:"\\f476"}.bi-list-task:before{content:"\\f477"}.bi-list-ul:before{content:"\\f478"}.bi-list:before{content:"\\f479"}.bi-lock-fill:before{content:"\\f47a"}.bi-lock:before{content:"\\f47b"}.bi-mailbox:before{content:"\\f47c"}.bi-mailbox2:before{content:"\\f47d"}.bi-map-fill:before{content:"\\f47e"}.bi-map:before{content:"\\f47f"}.bi-markdown-fill:before{content:"\\f480"}.bi-markdown:before{content:"\\f481"}.bi-mask:before{content:"\\f482"}.bi-megaphone-fill:before{content:"\\f483"}.bi-megaphone:before{content:"\\f484"}.bi-menu-app-fill:before{content:"\\f485"}.bi-menu-app:before{content:"\\f486"}.bi-menu-button-fill:before{content:"\\f487"}.bi-menu-button-wide-fill:before{content:"\\f488"}.bi-menu-button-wide:before{content:"\\f489"}.bi-menu-button:before{content:"\\f48a"}.bi-menu-down:before{content:"\\f48b"}.bi-menu-up:before{content:"\\f48c"}.bi-mic-fill:before{content:"\\f48d"}.bi-mic-mute-fill:before{content:"\\f48e"}.bi-mic-mute:before{content:"\\f48f"}.bi-mic:before{content:"\\f490"}.bi-minecart-loaded:before{content:"\\f491"}.bi-minecart:before{content:"\\f492"}.bi-moisture:before{content:"\\f493"}.bi-moon-fill:before{content:"\\f494"}.bi-moon-stars-fill:before{content:"\\f495"}.bi-moon-stars:before{content:"\\f496"}.bi-moon:before{content:"\\f497"}.bi-mouse-fill:before{content:"\\f498"}.bi-mouse:before{content:"\\f499"}.bi-mouse2-fill:before{content:"\\f49a"}.bi-mouse2:before{content:"\\f49b"}.bi-mouse3-fill:before{content:"\\f49c"}.bi-mouse3:before{content:"\\f49d"}.bi-music-note-beamed:before{content:"\\f49e"}.bi-music-note-list:before{content:"\\f49f"}.bi-music-note:before{content:"\\f4a0"}.bi-music-player-fill:before{content:"\\f4a1"}.bi-music-player:before{content:"\\f4a2"}.bi-newspaper:before{content:"\\f4a3"}.bi-node-minus-fill:before{content:"\\f4a4"}.bi-node-minus:before{content:"\\f4a5"}.bi-node-plus-fill:before{content:"\\f4a6"}.bi-node-plus:before{content:"\\f4a7"}.bi-nut-fill:before{content:"\\f4a8"}.bi-nut:before{content:"\\f4a9"}.bi-octagon-fill:before{content:"\\f4aa"}.bi-octagon-half:before{content:"\\f4ab"}.bi-octagon:before{content:"\\f4ac"}.bi-option:before{content:"\\f4ad"}.bi-outlet:before{content:"\\f4ae"}.bi-paint-bucket:before{content:"\\f4af"}.bi-palette-fill:before{content:"\\f4b0"}.bi-palette:before{content:"\\f4b1"}.bi-palette2:before{content:"\\f4b2"}.bi-paperclip:before{content:"\\f4b3"}.bi-paragraph:before{content:"\\f4b4"}.bi-patch-check-fill:before{content:"\\f4b5"}.bi-patch-check:before{content:"\\f4b6"}.bi-patch-exclamation-fill:before{content:"\\f4b7"}.bi-patch-exclamation:before{content:"\\f4b8"}.bi-patch-minus-fill:before{content:"\\f4b9"}.bi-patch-minus:before{content:"\\f4ba"}.bi-patch-plus-fill:before{content:"\\f4bb"}.bi-patch-plus:before{content:"\\f4bc"}.bi-patch-question-fill:before{content:"\\f4bd"}.bi-patch-question:before{content:"\\f4be"}.bi-pause-btn-fill:before{content:"\\f4bf"}.bi-pause-btn:before{content:"\\f4c0"}.bi-pause-circle-fill:before{content:"\\f4c1"}.bi-pause-circle:before{content:"\\f4c2"}.bi-pause-fill:before{content:"\\f4c3"}.bi-pause:before{content:"\\f4c4"}.bi-peace-fill:before{content:"\\f4c5"}.bi-peace:before{content:"\\f4c6"}.bi-pen-fill:before{content:"\\f4c7"}.bi-pen:before{content:"\\f4c8"}.bi-pencil-fill:before{content:"\\f4c9"}.bi-pencil-square:before{content:"\\f4ca"}.bi-pencil:before{content:"\\f4cb"}.bi-pentagon-fill:before{content:"\\f4cc"}.bi-pentagon-half:before{content:"\\f4cd"}.bi-pentagon:before{content:"\\f4ce"}.bi-people-fill:before{content:"\\f4cf"}.bi-people:before{content:"\\f4d0"}.bi-percent:before{content:"\\f4d1"}.bi-person-badge-fill:before{content:"\\f4d2"}.bi-person-badge:before{content:"\\f4d3"}.bi-person-bounding-box:before{content:"\\f4d4"}.bi-person-check-fill:before{content:"\\f4d5"}.bi-person-check:before{content:"\\f4d6"}.bi-person-circle:before{content:"\\f4d7"}.bi-person-dash-fill:before{content:"\\f4d8"}.bi-person-dash:before{content:"\\f4d9"}.bi-person-fill:before{content:"\\f4da"}.bi-person-lines-fill:before{content:"\\f4db"}.bi-person-plus-fill:before{content:"\\f4dc"}.bi-person-plus:before{content:"\\f4dd"}.bi-person-square:before{content:"\\f4de"}.bi-person-x-fill:before{content:"\\f4df"}.bi-person-x:before{content:"\\f4e0"}.bi-person:before{content:"\\f4e1"}.bi-phone-fill:before{content:"\\f4e2"}.bi-phone-landscape-fill:before{content:"\\f4e3"}.bi-phone-landscape:before{content:"\\f4e4"}.bi-phone-vibrate-fill:before{content:"\\f4e5"}.bi-phone-vibrate:before{content:"\\f4e6"}.bi-phone:before{content:"\\f4e7"}.bi-pie-chart-fill:before{content:"\\f4e8"}.bi-pie-chart:before{content:"\\f4e9"}.bi-pin-angle-fill:before{content:"\\f4ea"}.bi-pin-angle:before{content:"\\f4eb"}.bi-pin-fill:before{content:"\\f4ec"}.bi-pin:before{content:"\\f4ed"}.bi-pip-fill:before{content:"\\f4ee"}.bi-pip:before{content:"\\f4ef"}.bi-play-btn-fill:before{content:"\\f4f0"}.bi-play-btn:before{content:"\\f4f1"}.bi-play-circle-fill:before{content:"\\f4f2"}.bi-play-circle:before{content:"\\f4f3"}.bi-play-fill:before{content:"\\f4f4"}.bi-play:before{content:"\\f4f5"}.bi-plug-fill:before{content:"\\f4f6"}.bi-plug:before{content:"\\f4f7"}.bi-plus-circle-dotted:before{content:"\\f4f8"}.bi-plus-circle-fill:before{content:"\\f4f9"}.bi-plus-circle:before{content:"\\f4fa"}.bi-plus-square-dotted:before{content:"\\f4fb"}.bi-plus-square-fill:before{content:"\\f4fc"}.bi-plus-square:before{content:"\\f4fd"}.bi-plus:before{content:"\\f4fe"}.bi-power:before{content:"\\f4ff"}.bi-printer-fill:before{content:"\\f500"}.bi-printer:before{content:"\\f501"}.bi-puzzle-fill:before{content:"\\f502"}.bi-puzzle:before{content:"\\f503"}.bi-question-circle-fill:before{content:"\\f504"}.bi-question-circle:before{content:"\\f505"}.bi-question-diamond-fill:before{content:"\\f506"}.bi-question-diamond:before{content:"\\f507"}.bi-question-octagon-fill:before{content:"\\f508"}.bi-question-octagon:before{content:"\\f509"}.bi-question-square-fill:before{content:"\\f50a"}.bi-question-square:before{content:"\\f50b"}.bi-question:before{content:"\\f50c"}.bi-rainbow:before{content:"\\f50d"}.bi-receipt-cutoff:before{content:"\\f50e"}.bi-receipt:before{content:"\\f50f"}.bi-reception-0:before{content:"\\f510"}.bi-reception-1:before{content:"\\f511"}.bi-reception-2:before{content:"\\f512"}.bi-reception-3:before{content:"\\f513"}.bi-reception-4:before{content:"\\f514"}.bi-record-btn-fill:before{content:"\\f515"}.bi-record-btn:before{content:"\\f516"}.bi-record-circle-fill:before{content:"\\f517"}.bi-record-circle:before{content:"\\f518"}.bi-record-fill:before{content:"\\f519"}.bi-record:before{content:"\\f51a"}.bi-record2-fill:before{content:"\\f51b"}.bi-record2:before{content:"\\f51c"}.bi-reply-all-fill:before{content:"\\f51d"}.bi-reply-all:before{content:"\\f51e"}.bi-reply-fill:before{content:"\\f51f"}.bi-reply:before{content:"\\f520"}.bi-rss-fill:before{content:"\\f521"}.bi-rss:before{content:"\\f522"}.bi-rulers:before{content:"\\f523"}.bi-save-fill:before{content:"\\f524"}.bi-save:before{content:"\\f525"}.bi-save2-fill:before{content:"\\f526"}.bi-save2:before{content:"\\f527"}.bi-scissors:before{content:"\\f528"}.bi-screwdriver:before{content:"\\f529"}.bi-search:before{content:"\\f52a"}.bi-segmented-nav:before{content:"\\f52b"}.bi-server:before{content:"\\f52c"}.bi-share-fill:before{content:"\\f52d"}.bi-share:before{content:"\\f52e"}.bi-shield-check:before{content:"\\f52f"}.bi-shield-exclamation:before{content:"\\f530"}.bi-shield-fill-check:before{content:"\\f531"}.bi-shield-fill-exclamation:before{content:"\\f532"}.bi-shield-fill-minus:before{content:"\\f533"}.bi-shield-fill-plus:before{content:"\\f534"}.bi-shield-fill-x:before{content:"\\f535"}.bi-shield-fill:before{content:"\\f536"}.bi-shield-lock-fill:before{content:"\\f537"}.bi-shield-lock:before{content:"\\f538"}.bi-shield-minus:before{content:"\\f539"}.bi-shield-plus:before{content:"\\f53a"}.bi-shield-shaded:before{content:"\\f53b"}.bi-shield-slash-fill:before{content:"\\f53c"}.bi-shield-slash:before{content:"\\f53d"}.bi-shield-x:before{content:"\\f53e"}.bi-shield:before{content:"\\f53f"}.bi-shift-fill:before{content:"\\f540"}.bi-shift:before{content:"\\f541"}.bi-shop-window:before{content:"\\f542"}.bi-shop:before{content:"\\f543"}.bi-shuffle:before{content:"\\f544"}.bi-signpost-2-fill:before{content:"\\f545"}.bi-signpost-2:before{content:"\\f546"}.bi-signpost-fill:before{content:"\\f547"}.bi-signpost-split-fill:before{content:"\\f548"}.bi-signpost-split:before{content:"\\f549"}.bi-signpost:before{content:"\\f54a"}.bi-sim-fill:before{content:"\\f54b"}.bi-sim:before{content:"\\f54c"}.bi-skip-backward-btn-fill:before{content:"\\f54d"}.bi-skip-backward-btn:before{content:"\\f54e"}.bi-skip-backward-circle-fill:before{content:"\\f54f"}.bi-skip-backward-circle:before{content:"\\f550"}.bi-skip-backward-fill:before{content:"\\f551"}.bi-skip-backward:before{content:"\\f552"}.bi-skip-end-btn-fill:before{content:"\\f553"}.bi-skip-end-btn:before{content:"\\f554"}.bi-skip-end-circle-fill:before{content:"\\f555"}.bi-skip-end-circle:before{content:"\\f556"}.bi-skip-end-fill:before{content:"\\f557"}.bi-skip-end:before{content:"\\f558"}.bi-skip-forward-btn-fill:before{content:"\\f559"}.bi-skip-forward-btn:before{content:"\\f55a"}.bi-skip-forward-circle-fill:before{content:"\\f55b"}.bi-skip-forward-circle:before{content:"\\f55c"}.bi-skip-forward-fill:before{content:"\\f55d"}.bi-skip-forward:before{content:"\\f55e"}.bi-skip-start-btn-fill:before{content:"\\f55f"}.bi-skip-start-btn:before{content:"\\f560"}.bi-skip-start-circle-fill:before{content:"\\f561"}.bi-skip-start-circle:before{content:"\\f562"}.bi-skip-start-fill:before{content:"\\f563"}.bi-skip-start:before{content:"\\f564"}.bi-slack:before{content:"\\f565"}.bi-slash-circle-fill:before{content:"\\f566"}.bi-slash-circle:before{content:"\\f567"}.bi-slash-square-fill:before{content:"\\f568"}.bi-slash-square:before{content:"\\f569"}.bi-slash:before{content:"\\f56a"}.bi-sliders:before{content:"\\f56b"}.bi-smartwatch:before{content:"\\f56c"}.bi-snow:before{content:"\\f56d"}.bi-snow2:before{content:"\\f56e"}.bi-snow3:before{content:"\\f56f"}.bi-sort-alpha-down-alt:before{content:"\\f570"}.bi-sort-alpha-down:before{content:"\\f571"}.bi-sort-alpha-up-alt:before{content:"\\f572"}.bi-sort-alpha-up:before{content:"\\f573"}.bi-sort-down-alt:before{content:"\\f574"}.bi-sort-down:before{content:"\\f575"}.bi-sort-numeric-down-alt:before{content:"\\f576"}.bi-sort-numeric-down:before{content:"\\f577"}.bi-sort-numeric-up-alt:before{content:"\\f578"}.bi-sort-numeric-up:before{content:"\\f579"}.bi-sort-up-alt:before{content:"\\f57a"}.bi-sort-up:before{content:"\\f57b"}.bi-soundwave:before{content:"\\f57c"}.bi-speaker-fill:before{content:"\\f57d"}.bi-speaker:before{content:"\\f57e"}.bi-speedometer:before{content:"\\f57f"}.bi-speedometer2:before{content:"\\f580"}.bi-spellcheck:before{content:"\\f581"}.bi-square-fill:before{content:"\\f582"}.bi-square-half:before{content:"\\f583"}.bi-square:before{content:"\\f584"}.bi-stack:before{content:"\\f585"}.bi-star-fill:before{content:"\\f586"}.bi-star-half:before{content:"\\f587"}.bi-star:before{content:"\\f588"}.bi-stars:before{content:"\\f589"}.bi-stickies-fill:before{content:"\\f58a"}.bi-stickies:before{content:"\\f58b"}.bi-sticky-fill:before{content:"\\f58c"}.bi-sticky:before{content:"\\f58d"}.bi-stop-btn-fill:before{content:"\\f58e"}.bi-stop-btn:before{content:"\\f58f"}.bi-stop-circle-fill:before{content:"\\f590"}.bi-stop-circle:before{content:"\\f591"}.bi-stop-fill:before{content:"\\f592"}.bi-stop:before{content:"\\f593"}.bi-stoplights-fill:before{content:"\\f594"}.bi-stoplights:before{content:"\\f595"}.bi-stopwatch-fill:before{content:"\\f596"}.bi-stopwatch:before{content:"\\f597"}.bi-subtract:before{content:"\\f598"}.bi-suit-club-fill:before{content:"\\f599"}.bi-suit-club:before{content:"\\f59a"}.bi-suit-diamond-fill:before{content:"\\f59b"}.bi-suit-diamond:before{content:"\\f59c"}.bi-suit-heart-fill:before{content:"\\f59d"}.bi-suit-heart:before{content:"\\f59e"}.bi-suit-spade-fill:before{content:"\\f59f"}.bi-suit-spade:before{content:"\\f5a0"}.bi-sun-fill:before{content:"\\f5a1"}.bi-sun:before{content:"\\f5a2"}.bi-sunglasses:before{content:"\\f5a3"}.bi-sunrise-fill:before{content:"\\f5a4"}.bi-sunrise:before{content:"\\f5a5"}.bi-sunset-fill:before{content:"\\f5a6"}.bi-sunset:before{content:"\\f5a7"}.bi-symmetry-horizontal:before{content:"\\f5a8"}.bi-symmetry-vertical:before{content:"\\f5a9"}.bi-table:before{content:"\\f5aa"}.bi-tablet-fill:before{content:"\\f5ab"}.bi-tablet-landscape-fill:before{content:"\\f5ac"}.bi-tablet-landscape:before{content:"\\f5ad"}.bi-tablet:before{content:"\\f5ae"}.bi-tag-fill:before{content:"\\f5af"}.bi-tag:before{content:"\\f5b0"}.bi-tags-fill:before{content:"\\f5b1"}.bi-tags:before{content:"\\f5b2"}.bi-telegram:before{content:"\\f5b3"}.bi-telephone-fill:before{content:"\\f5b4"}.bi-telephone-forward-fill:before{content:"\\f5b5"}.bi-telephone-forward:before{content:"\\f5b6"}.bi-telephone-inbound-fill:before{content:"\\f5b7"}.bi-telephone-inbound:before{content:"\\f5b8"}.bi-telephone-minus-fill:before{content:"\\f5b9"}.bi-telephone-minus:before{content:"\\f5ba"}.bi-telephone-outbound-fill:before{content:"\\f5bb"}.bi-telephone-outbound:before{content:"\\f5bc"}.bi-telephone-plus-fill:before{content:"\\f5bd"}.bi-telephone-plus:before{content:"\\f5be"}.bi-telephone-x-fill:before{content:"\\f5bf"}.bi-telephone-x:before{content:"\\f5c0"}.bi-telephone:before{content:"\\f5c1"}.bi-terminal-fill:before{content:"\\f5c2"}.bi-terminal:before{content:"\\f5c3"}.bi-text-center:before{content:"\\f5c4"}.bi-text-indent-left:before{content:"\\f5c5"}.bi-text-indent-right:before{content:"\\f5c6"}.bi-text-left:before{content:"\\f5c7"}.bi-text-paragraph:before{content:"\\f5c8"}.bi-text-right:before{content:"\\f5c9"}.bi-textarea-resize:before{content:"\\f5ca"}.bi-textarea-t:before{content:"\\f5cb"}.bi-textarea:before{content:"\\f5cc"}.bi-thermometer-half:before{content:"\\f5cd"}.bi-thermometer-high:before{content:"\\f5ce"}.bi-thermometer-low:before{content:"\\f5cf"}.bi-thermometer-snow:before{content:"\\f5d0"}.bi-thermometer-sun:before{content:"\\f5d1"}.bi-thermometer:before{content:"\\f5d2"}.bi-three-dots-vertical:before{content:"\\f5d3"}.bi-three-dots:before{content:"\\f5d4"}.bi-toggle-off:before{content:"\\f5d5"}.bi-toggle-on:before{content:"\\f5d6"}.bi-toggle2-off:before{content:"\\f5d7"}.bi-toggle2-on:before{content:"\\f5d8"}.bi-toggles:before{content:"\\f5d9"}.bi-toggles2:before{content:"\\f5da"}.bi-tools:before{content:"\\f5db"}.bi-tornado:before{content:"\\f5dc"}.bi-trash-fill:before{content:"\\f5dd"}.bi-trash:before{content:"\\f5de"}.bi-trash2-fill:before{content:"\\f5df"}.bi-trash2:before{content:"\\f5e0"}.bi-tree-fill:before{content:"\\f5e1"}.bi-tree:before{content:"\\f5e2"}.bi-triangle-fill:before{content:"\\f5e3"}.bi-triangle-half:before{content:"\\f5e4"}.bi-triangle:before{content:"\\f5e5"}.bi-trophy-fill:before{content:"\\f5e6"}.bi-trophy:before{content:"\\f5e7"}.bi-tropical-storm:before{content:"\\f5e8"}.bi-truck-flatbed:before{content:"\\f5e9"}.bi-truck:before{content:"\\f5ea"}.bi-tsunami:before{content:"\\f5eb"}.bi-tv-fill:before{content:"\\f5ec"}.bi-tv:before{content:"\\f5ed"}.bi-twitch:before{content:"\\f5ee"}.bi-twitter:before{content:"\\f5ef"}.bi-type-bold:before{content:"\\f5f0"}.bi-type-h1:before{content:"\\f5f1"}.bi-type-h2:before{content:"\\f5f2"}.bi-type-h3:before{content:"\\f5f3"}.bi-type-italic:before{content:"\\f5f4"}.bi-type-strikethrough:before{content:"\\f5f5"}.bi-type-underline:before{content:"\\f5f6"}.bi-type:before{content:"\\f5f7"}.bi-ui-checks-grid:before{content:"\\f5f8"}.bi-ui-checks:before{content:"\\f5f9"}.bi-ui-radios-grid:before{content:"\\f5fa"}.bi-ui-radios:before{content:"\\f5fb"}.bi-umbrella-fill:before{content:"\\f5fc"}.bi-umbrella:before{content:"\\f5fd"}.bi-union:before{content:"\\f5fe"}.bi-unlock-fill:before{content:"\\f5ff"}.bi-unlock:before{content:"\\f600"}.bi-upc-scan:before{content:"\\f601"}.bi-upc:before{content:"\\f602"}.bi-upload:before{content:"\\f603"}.bi-vector-pen:before{content:"\\f604"}.bi-view-list:before{content:"\\f605"}.bi-view-stacked:before{content:"\\f606"}.bi-vinyl-fill:before{content:"\\f607"}.bi-vinyl:before{content:"\\f608"}.bi-voicemail:before{content:"\\f609"}.bi-volume-down-fill:before{content:"\\f60a"}.bi-volume-down:before{content:"\\f60b"}.bi-volume-mute-fill:before{content:"\\f60c"}.bi-volume-mute:before{content:"\\f60d"}.bi-volume-off-fill:before{content:"\\f60e"}.bi-volume-off:before{content:"\\f60f"}.bi-volume-up-fill:before{content:"\\f610"}.bi-volume-up:before{content:"\\f611"}.bi-vr:before{content:"\\f612"}.bi-wallet-fill:before{content:"\\f613"}.bi-wallet:before{content:"\\f614"}.bi-wallet2:before{content:"\\f615"}.bi-watch:before{content:"\\f616"}.bi-water:before{content:"\\f617"}.bi-whatsapp:before{content:"\\f618"}.bi-wifi-1:before{content:"\\f619"}.bi-wifi-2:before{content:"\\f61a"}.bi-wifi-off:before{content:"\\f61b"}.bi-wifi:before{content:"\\f61c"}.bi-wind:before{content:"\\f61d"}.bi-window-dock:before{content:"\\f61e"}.bi-window-sidebar:before{content:"\\f61f"}.bi-window:before{content:"\\f620"}.bi-wrench:before{content:"\\f621"}.bi-x-circle-fill:before{content:"\\f622"}.bi-x-circle:before{content:"\\f623"}.bi-x-diamond-fill:before{content:"\\f624"}.bi-x-diamond:before{content:"\\f625"}.bi-x-octagon-fill:before{content:"\\f626"}.bi-x-octagon:before{content:"\\f627"}.bi-x-square-fill:before{content:"\\f628"}.bi-x-square:before{content:"\\f629"}.bi-x:before{content:"\\f62a"}.bi-youtube:before{content:"\\f62b"}.bi-zoom-in:before{content:"\\f62c"}.bi-zoom-out:before{content:"\\f62d"}.bi-bank:before{content:"\\f62e"}.bi-bank2:before{content:"\\f62f"}.bi-bell-slash-fill:before{content:"\\f630"}.bi-bell-slash:before{content:"\\f631"}.bi-cash-coin:before{content:"\\f632"}.bi-check-lg:before{content:"\\f633"}.bi-coin:before{content:"\\f634"}.bi-currency-bitcoin:before{content:"\\f635"}.bi-currency-dollar:before{content:"\\f636"}.bi-currency-euro:before{content:"\\f637"}.bi-currency-exchange:before{content:"\\f638"}.bi-currency-pound:before{content:"\\f639"}.bi-currency-yen:before{content:"\\f63a"}.bi-dash-lg:before{content:"\\f63b"}.bi-exclamation-lg:before{content:"\\f63c"}.bi-file-earmark-pdf-fill:before{content:"\\f63d"}.bi-file-earmark-pdf:before{content:"\\f63e"}.bi-file-pdf-fill:before{content:"\\f63f"}.bi-file-pdf:before{content:"\\f640"}.bi-gender-ambiguous:before{content:"\\f641"}.bi-gender-female:before{content:"\\f642"}.bi-gender-male:before{content:"\\f643"}.bi-gender-trans:before{content:"\\f644"}.bi-headset-vr:before{content:"\\f645"}.bi-info-lg:before{content:"\\f646"}.bi-mastodon:before{content:"\\f647"}.bi-messenger:before{content:"\\f648"}.bi-piggy-bank-fill:before{content:"\\f649"}.bi-piggy-bank:before{content:"\\f64a"}.bi-pin-map-fill:before{content:"\\f64b"}.bi-pin-map:before{content:"\\f64c"}.bi-plus-lg:before{content:"\\f64d"}.bi-question-lg:before{content:"\\f64e"}.bi-recycle:before{content:"\\f64f"}.bi-reddit:before{content:"\\f650"}.bi-safe-fill:before{content:"\\f651"}.bi-safe2-fill:before{content:"\\f652"}.bi-safe2:before{content:"\\f653"}.bi-sd-card-fill:before{content:"\\f654"}.bi-sd-card:before{content:"\\f655"}.bi-skype:before{content:"\\f656"}.bi-slash-lg:before{content:"\\f657"}.bi-translate:before{content:"\\f658"}.bi-x-lg:before{content:"\\f659"}.bi-safe:before{content:"\\f65a"}.bi-apple:before{content:"\\f65b"}.bi-microsoft:before{content:"\\f65d"}.bi-windows:before{content:"\\f65e"}.bi-behance:before{content:"\\f65c"}.bi-dribbble:before{content:"\\f65f"}.bi-line:before{content:"\\f660"}.bi-medium:before{content:"\\f661"}.bi-paypal:before{content:"\\f662"}.bi-pinterest:before{content:"\\f663"}.bi-signal:before{content:"\\f664"}.bi-snapchat:before{content:"\\f665"}.bi-spotify:before{content:"\\f666"}.bi-stack-overflow:before{content:"\\f667"}.bi-strava:before{content:"\\f668"}.bi-wordpress:before{content:"\\f669"}.bi-vimeo:before{content:"\\f66a"}.bi-activity:before{content:"\\f66b"}.bi-easel2-fill:before{content:"\\f66c"}.bi-easel2:before{content:"\\f66d"}.bi-easel3-fill:before{content:"\\f66e"}.bi-easel3:before{content:"\\f66f"}.bi-fan:before{content:"\\f670"}.bi-fingerprint:before{content:"\\f671"}.bi-graph-down-arrow:before{content:"\\f672"}.bi-graph-up-arrow:before{content:"\\f673"}.bi-hypnotize:before{content:"\\f674"}.bi-magic:before{content:"\\f675"}.bi-person-rolodex:before{content:"\\f676"}.bi-person-video:before{content:"\\f677"}.bi-person-video2:before{content:"\\f678"}.bi-person-video3:before{content:"\\f679"}.bi-person-workspace:before{content:"\\f67a"}.bi-radioactive:before{content:"\\f67b"}.bi-webcam-fill:before{content:"\\f67c"}.bi-webcam:before{content:"\\f67d"}.bi-yin-yang:before{content:"\\f67e"}.bi-bandaid-fill:before{content:"\\f680"}.bi-bandaid:before{content:"\\f681"}.bi-bluetooth:before{content:"\\f682"}.bi-body-text:before{content:"\\f683"}.bi-boombox:before{content:"\\f684"}.bi-boxes:before{content:"\\f685"}.bi-dpad-fill:before{content:"\\f686"}.bi-dpad:before{content:"\\f687"}.bi-ear-fill:before{content:"\\f688"}.bi-ear:before{content:"\\f689"}.bi-envelope-check-fill:before{content:"\\f68b"}.bi-envelope-check:before{content:"\\f68c"}.bi-envelope-dash-fill:before{content:"\\f68e"}.bi-envelope-dash:before{content:"\\f68f"}.bi-envelope-exclamation-fill:before{content:"\\f691"}.bi-envelope-exclamation:before{content:"\\f692"}.bi-envelope-plus-fill:before{content:"\\f693"}.bi-envelope-plus:before{content:"\\f694"}.bi-envelope-slash-fill:before{content:"\\f696"}.bi-envelope-slash:before{content:"\\f697"}.bi-envelope-x-fill:before{content:"\\f699"}.bi-envelope-x:before{content:"\\f69a"}.bi-explicit-fill:before{content:"\\f69b"}.bi-explicit:before{content:"\\f69c"}.bi-git:before{content:"\\f69d"}.bi-infinity:before{content:"\\f69e"}.bi-list-columns-reverse:before{content:"\\f69f"}.bi-list-columns:before{content:"\\f6a0"}.bi-meta:before{content:"\\f6a1"}.bi-nintendo-switch:before{content:"\\f6a4"}.bi-pc-display-horizontal:before{content:"\\f6a5"}.bi-pc-display:before{content:"\\f6a6"}.bi-pc-horizontal:before{content:"\\f6a7"}.bi-pc:before{content:"\\f6a8"}.bi-playstation:before{content:"\\f6a9"}.bi-plus-slash-minus:before{content:"\\f6aa"}.bi-projector-fill:before{content:"\\f6ab"}.bi-projector:before{content:"\\f6ac"}.bi-qr-code-scan:before{content:"\\f6ad"}.bi-qr-code:before{content:"\\f6ae"}.bi-quora:before{content:"\\f6af"}.bi-quote:before{content:"\\f6b0"}.bi-robot:before{content:"\\f6b1"}.bi-send-check-fill:before{content:"\\f6b2"}.bi-send-check:before{content:"\\f6b3"}.bi-send-dash-fill:before{content:"\\f6b4"}.bi-send-dash:before{content:"\\f6b5"}.bi-send-exclamation-fill:before{content:"\\f6b7"}.bi-send-exclamation:before{content:"\\f6b8"}.bi-send-fill:before{content:"\\f6b9"}.bi-send-plus-fill:before{content:"\\f6ba"}.bi-send-plus:before{content:"\\f6bb"}.bi-send-slash-fill:before{content:"\\f6bc"}.bi-send-slash:before{content:"\\f6bd"}.bi-send-x-fill:before{content:"\\f6be"}.bi-send-x:before{content:"\\f6bf"}.bi-send:before{content:"\\f6c0"}.bi-steam:before{content:"\\f6c1"}.bi-terminal-dash:before{content:"\\f6c3"}.bi-terminal-plus:before{content:"\\f6c4"}.bi-terminal-split:before{content:"\\f6c5"}.bi-ticket-detailed-fill:before{content:"\\f6c6"}.bi-ticket-detailed:before{content:"\\f6c7"}.bi-ticket-fill:before{content:"\\f6c8"}.bi-ticket-perforated-fill:before{content:"\\f6c9"}.bi-ticket-perforated:before{content:"\\f6ca"}.bi-ticket:before{content:"\\f6cb"}.bi-tiktok:before{content:"\\f6cc"}.bi-window-dash:before{content:"\\f6cd"}.bi-window-desktop:before{content:"\\f6ce"}.bi-window-fullscreen:before{content:"\\f6cf"}.bi-window-plus:before{content:"\\f6d0"}.bi-window-split:before{content:"\\f6d1"}.bi-window-stack:before{content:"\\f6d2"}.bi-window-x:before{content:"\\f6d3"}.bi-xbox:before{content:"\\f6d4"}.bi-ethernet:before{content:"\\f6d5"}.bi-hdmi-fill:before{content:"\\f6d6"}.bi-hdmi:before{content:"\\f6d7"}.bi-usb-c-fill:before{content:"\\f6d8"}.bi-usb-c:before{content:"\\f6d9"}.bi-usb-fill:before{content:"\\f6da"}.bi-usb-plug-fill:before{content:"\\f6db"}.bi-usb-plug:before{content:"\\f6dc"}.bi-usb-symbol:before{content:"\\f6dd"}.bi-usb:before{content:"\\f6de"}.bi-boombox-fill:before{content:"\\f6df"}.bi-displayport:before{content:"\\f6e1"}.bi-gpu-card:before{content:"\\f6e2"}.bi-memory:before{content:"\\f6e3"}.bi-modem-fill:before{content:"\\f6e4"}.bi-modem:before{content:"\\f6e5"}.bi-motherboard-fill:before{content:"\\f6e6"}.bi-motherboard:before{content:"\\f6e7"}.bi-optical-audio-fill:before{content:"\\f6e8"}.bi-optical-audio:before{content:"\\f6e9"}.bi-pci-card:before{content:"\\f6ea"}.bi-router-fill:before{content:"\\f6eb"}.bi-router:before{content:"\\f6ec"}.bi-thunderbolt-fill:before{content:"\\f6ef"}.bi-thunderbolt:before{content:"\\f6f0"}.bi-usb-drive-fill:before{content:"\\f6f1"}.bi-usb-drive:before{content:"\\f6f2"}.bi-usb-micro-fill:before{content:"\\f6f3"}.bi-usb-micro:before{content:"\\f6f4"}.bi-usb-mini-fill:before{content:"\\f6f5"}.bi-usb-mini:before{content:"\\f6f6"}.bi-cloud-haze2:before{content:"\\f6f7"}.bi-device-hdd-fill:before{content:"\\f6f8"}.bi-device-hdd:before{content:"\\f6f9"}.bi-device-ssd-fill:before{content:"\\f6fa"}.bi-device-ssd:before{content:"\\f6fb"}.bi-displayport-fill:before{content:"\\f6fc"}.bi-mortarboard-fill:before{content:"\\f6fd"}.bi-mortarboard:before{content:"\\f6fe"}.bi-terminal-x:before{content:"\\f6ff"}.bi-arrow-through-heart-fill:before{content:"\\f700"}.bi-arrow-through-heart:before{content:"\\f701"}.bi-badge-sd-fill:before{content:"\\f702"}.bi-badge-sd:before{content:"\\f703"}.bi-bag-heart-fill:before{content:"\\f704"}.bi-bag-heart:before{content:"\\f705"}.bi-balloon-fill:before{content:"\\f706"}.bi-balloon-heart-fill:before{content:"\\f707"}.bi-balloon-heart:before{content:"\\f708"}.bi-balloon:before{content:"\\f709"}.bi-box2-fill:before{content:"\\f70a"}.bi-box2-heart-fill:before{content:"\\f70b"}.bi-box2-heart:before{content:"\\f70c"}.bi-box2:before{content:"\\f70d"}.bi-braces-asterisk:before{content:"\\f70e"}.bi-calendar-heart-fill:before{content:"\\f70f"}.bi-calendar-heart:before{content:"\\f710"}.bi-calendar2-heart-fill:before{content:"\\f711"}.bi-calendar2-heart:before{content:"\\f712"}.bi-chat-heart-fill:before{content:"\\f713"}.bi-chat-heart:before{content:"\\f714"}.bi-chat-left-heart-fill:before{content:"\\f715"}.bi-chat-left-heart:before{content:"\\f716"}.bi-chat-right-heart-fill:before{content:"\\f717"}.bi-chat-right-heart:before{content:"\\f718"}.bi-chat-square-heart-fill:before{content:"\\f719"}.bi-chat-square-heart:before{content:"\\f71a"}.bi-clipboard-check-fill:before{content:"\\f71b"}.bi-clipboard-data-fill:before{content:"\\f71c"}.bi-clipboard-fill:before{content:"\\f71d"}.bi-clipboard-heart-fill:before{content:"\\f71e"}.bi-clipboard-heart:before{content:"\\f71f"}.bi-clipboard-minus-fill:before{content:"\\f720"}.bi-clipboard-plus-fill:before{content:"\\f721"}.bi-clipboard-pulse:before{content:"\\f722"}.bi-clipboard-x-fill:before{content:"\\f723"}.bi-clipboard2-check-fill:before{content:"\\f724"}.bi-clipboard2-check:before{content:"\\f725"}.bi-clipboard2-data-fill:before{content:"\\f726"}.bi-clipboard2-data:before{content:"\\f727"}.bi-clipboard2-fill:before{content:"\\f728"}.bi-clipboard2-heart-fill:before{content:"\\f729"}.bi-clipboard2-heart:before{content:"\\f72a"}.bi-clipboard2-minus-fill:before{content:"\\f72b"}.bi-clipboard2-minus:before{content:"\\f72c"}.bi-clipboard2-plus-fill:before{content:"\\f72d"}.bi-clipboard2-plus:before{content:"\\f72e"}.bi-clipboard2-pulse-fill:before{content:"\\f72f"}.bi-clipboard2-pulse:before{content:"\\f730"}.bi-clipboard2-x-fill:before{content:"\\f731"}.bi-clipboard2-x:before{content:"\\f732"}.bi-clipboard2:before{content:"\\f733"}.bi-emoji-kiss-fill:before{content:"\\f734"}.bi-emoji-kiss:before{content:"\\f735"}.bi-envelope-heart-fill:before{content:"\\f736"}.bi-envelope-heart:before{content:"\\f737"}.bi-envelope-open-heart-fill:before{content:"\\f738"}.bi-envelope-open-heart:before{content:"\\f739"}.bi-envelope-paper-fill:before{content:"\\f73a"}.bi-envelope-paper-heart-fill:before{content:"\\f73b"}.bi-envelope-paper-heart:before{content:"\\f73c"}.bi-envelope-paper:before{content:"\\f73d"}.bi-filetype-aac:before{content:"\\f73e"}.bi-filetype-ai:before{content:"\\f73f"}.bi-filetype-bmp:before{content:"\\f740"}.bi-filetype-cs:before{content:"\\f741"}.bi-filetype-css:before{content:"\\f742"}.bi-filetype-csv:before{content:"\\f743"}.bi-filetype-doc:before{content:"\\f744"}.bi-filetype-docx:before{content:"\\f745"}.bi-filetype-exe:before{content:"\\f746"}.bi-filetype-gif:before{content:"\\f747"}.bi-filetype-heic:before{content:"\\f748"}.bi-filetype-html:before{content:"\\f749"}.bi-filetype-java:before{content:"\\f74a"}.bi-filetype-jpg:before{content:"\\f74b"}.bi-filetype-js:before{content:"\\f74c"}.bi-filetype-jsx:before{content:"\\f74d"}.bi-filetype-key:before{content:"\\f74e"}.bi-filetype-m4p:before{content:"\\f74f"}.bi-filetype-md:before{content:"\\f750"}.bi-filetype-mdx:before{content:"\\f751"}.bi-filetype-mov:before{content:"\\f752"}.bi-filetype-mp3:before{content:"\\f753"}.bi-filetype-mp4:before{content:"\\f754"}.bi-filetype-otf:before{content:"\\f755"}.bi-filetype-pdf:before{content:"\\f756"}.bi-filetype-php:before{content:"\\f757"}.bi-filetype-png:before{content:"\\f758"}.bi-filetype-ppt:before{content:"\\f75a"}.bi-filetype-psd:before{content:"\\f75b"}.bi-filetype-py:before{content:"\\f75c"}.bi-filetype-raw:before{content:"\\f75d"}.bi-filetype-rb:before{content:"\\f75e"}.bi-filetype-sass:before{content:"\\f75f"}.bi-filetype-scss:before{content:"\\f760"}.bi-filetype-sh:before{content:"\\f761"}.bi-filetype-svg:before{content:"\\f762"}.bi-filetype-tiff:before{content:"\\f763"}.bi-filetype-tsx:before{content:"\\f764"}.bi-filetype-ttf:before{content:"\\f765"}.bi-filetype-txt:before{content:"\\f766"}.bi-filetype-wav:before{content:"\\f767"}.bi-filetype-woff:before{content:"\\f768"}.bi-filetype-xls:before{content:"\\f76a"}.bi-filetype-xml:before{content:"\\f76b"}.bi-filetype-yml:before{content:"\\f76c"}.bi-heart-arrow:before{content:"\\f76d"}.bi-heart-pulse-fill:before{content:"\\f76e"}.bi-heart-pulse:before{content:"\\f76f"}.bi-heartbreak-fill:before{content:"\\f770"}.bi-heartbreak:before{content:"\\f771"}.bi-hearts:before{content:"\\f772"}.bi-hospital-fill:before{content:"\\f773"}.bi-hospital:before{content:"\\f774"}.bi-house-heart-fill:before{content:"\\f775"}.bi-house-heart:before{content:"\\f776"}.bi-incognito:before{content:"\\f777"}.bi-magnet-fill:before{content:"\\f778"}.bi-magnet:before{content:"\\f779"}.bi-person-heart:before{content:"\\f77a"}.bi-person-hearts:before{content:"\\f77b"}.bi-phone-flip:before{content:"\\f77c"}.bi-plugin:before{content:"\\f77d"}.bi-postage-fill:before{content:"\\f77e"}.bi-postage-heart-fill:before{content:"\\f77f"}.bi-postage-heart:before{content:"\\f780"}.bi-postage:before{content:"\\f781"}.bi-postcard-fill:before{content:"\\f782"}.bi-postcard-heart-fill:before{content:"\\f783"}.bi-postcard-heart:before{content:"\\f784"}.bi-postcard:before{content:"\\f785"}.bi-search-heart-fill:before{content:"\\f786"}.bi-search-heart:before{content:"\\f787"}.bi-sliders2-vertical:before{content:"\\f788"}.bi-sliders2:before{content:"\\f789"}.bi-trash3-fill:before{content:"\\f78a"}.bi-trash3:before{content:"\\f78b"}.bi-valentine:before{content:"\\f78c"}.bi-valentine2:before{content:"\\f78d"}.bi-wrench-adjustable-circle-fill:before{content:"\\f78e"}.bi-wrench-adjustable-circle:before{content:"\\f78f"}.bi-wrench-adjustable:before{content:"\\f790"}.bi-filetype-json:before{content:"\\f791"}.bi-filetype-pptx:before{content:"\\f792"}.bi-filetype-xlsx:before{content:"\\f793"}.bi-1-circle-fill:before{content:"\\f796"}.bi-1-circle:before{content:"\\f797"}.bi-1-square-fill:before{content:"\\f798"}.bi-1-square:before{content:"\\f799"}.bi-2-circle-fill:before{content:"\\f79c"}.bi-2-circle:before{content:"\\f79d"}.bi-2-square-fill:before{content:"\\f79e"}.bi-2-square:before{content:"\\f79f"}.bi-3-circle-fill:before{content:"\\f7a2"}.bi-3-circle:before{content:"\\f7a3"}.bi-3-square-fill:before{content:"\\f7a4"}.bi-3-square:before{content:"\\f7a5"}.bi-4-circle-fill:before{content:"\\f7a8"}.bi-4-circle:before{content:"\\f7a9"}.bi-4-square-fill:before{content:"\\f7aa"}.bi-4-square:before{content:"\\f7ab"}.bi-5-circle-fill:before{content:"\\f7ae"}.bi-5-circle:before{content:"\\f7af"}.bi-5-square-fill:before{content:"\\f7b0"}.bi-5-square:before{content:"\\f7b1"}.bi-6-circle-fill:before{content:"\\f7b4"}.bi-6-circle:before{content:"\\f7b5"}.bi-6-square-fill:before{content:"\\f7b6"}.bi-6-square:before{content:"\\f7b7"}.bi-7-circle-fill:before{content:"\\f7ba"}.bi-7-circle:before{content:"\\f7bb"}.bi-7-square-fill:before{content:"\\f7bc"}.bi-7-square:before{content:"\\f7bd"}.bi-8-circle-fill:before{content:"\\f7c0"}.bi-8-circle:before{content:"\\f7c1"}.bi-8-square-fill:before{content:"\\f7c2"}.bi-8-square:before{content:"\\f7c3"}.bi-9-circle-fill:before{content:"\\f7c6"}.bi-9-circle:before{content:"\\f7c7"}.bi-9-square-fill:before{content:"\\f7c8"}.bi-9-square:before{content:"\\f7c9"}.bi-airplane-engines-fill:before{content:"\\f7ca"}.bi-airplane-engines:before{content:"\\f7cb"}.bi-airplane-fill:before{content:"\\f7cc"}.bi-airplane:before{content:"\\f7cd"}.bi-alexa:before{content:"\\f7ce"}.bi-alipay:before{content:"\\f7cf"}.bi-android:before{content:"\\f7d0"}.bi-android2:before{content:"\\f7d1"}.bi-box-fill:before{content:"\\f7d2"}.bi-box-seam-fill:before{content:"\\f7d3"}.bi-browser-chrome:before{content:"\\f7d4"}.bi-browser-edge:before{content:"\\f7d5"}.bi-browser-firefox:before{content:"\\f7d6"}.bi-browser-safari:before{content:"\\f7d7"}.bi-c-circle-fill:before{content:"\\f7da"}.bi-c-circle:before{content:"\\f7db"}.bi-c-square-fill:before{content:"\\f7dc"}.bi-c-square:before{content:"\\f7dd"}.bi-capsule-pill:before{content:"\\f7de"}.bi-capsule:before{content:"\\f7df"}.bi-car-front-fill:before{content:"\\f7e0"}.bi-car-front:before{content:"\\f7e1"}.bi-cassette-fill:before{content:"\\f7e2"}.bi-cassette:before{content:"\\f7e3"}.bi-cc-circle-fill:before{content:"\\f7e6"}.bi-cc-circle:before{content:"\\f7e7"}.bi-cc-square-fill:before{content:"\\f7e8"}.bi-cc-square:before{content:"\\f7e9"}.bi-cup-hot-fill:before{content:"\\f7ea"}.bi-cup-hot:before{content:"\\f7eb"}.bi-currency-rupee:before{content:"\\f7ec"}.bi-dropbox:before{content:"\\f7ed"}.bi-escape:before{content:"\\f7ee"}.bi-fast-forward-btn-fill:before{content:"\\f7ef"}.bi-fast-forward-btn:before{content:"\\f7f0"}.bi-fast-forward-circle-fill:before{content:"\\f7f1"}.bi-fast-forward-circle:before{content:"\\f7f2"}.bi-fast-forward-fill:before{content:"\\f7f3"}.bi-fast-forward:before{content:"\\f7f4"}.bi-filetype-sql:before{content:"\\f7f5"}.bi-fire:before{content:"\\f7f6"}.bi-google-play:before{content:"\\f7f7"}.bi-h-circle-fill:before{content:"\\f7fa"}.bi-h-circle:before{content:"\\f7fb"}.bi-h-square-fill:before{content:"\\f7fc"}.bi-h-square:before{content:"\\f7fd"}.bi-indent:before{content:"\\f7fe"}.bi-lungs-fill:before{content:"\\f7ff"}.bi-lungs:before{content:"\\f800"}.bi-microsoft-teams:before{content:"\\f801"}.bi-p-circle-fill:before{content:"\\f804"}.bi-p-circle:before{content:"\\f805"}.bi-p-square-fill:before{content:"\\f806"}.bi-p-square:before{content:"\\f807"}.bi-pass-fill:before{content:"\\f808"}.bi-pass:before{content:"\\f809"}.bi-prescription:before{content:"\\f80a"}.bi-prescription2:before{content:"\\f80b"}.bi-r-circle-fill:before{content:"\\f80e"}.bi-r-circle:before{content:"\\f80f"}.bi-r-square-fill:before{content:"\\f810"}.bi-r-square:before{content:"\\f811"}.bi-repeat-1:before{content:"\\f812"}.bi-repeat:before{content:"\\f813"}.bi-rewind-btn-fill:before{content:"\\f814"}.bi-rewind-btn:before{content:"\\f815"}.bi-rewind-circle-fill:before{content:"\\f816"}.bi-rewind-circle:before{content:"\\f817"}.bi-rewind-fill:before{content:"\\f818"}.bi-rewind:before{content:"\\f819"}.bi-train-freight-front-fill:before{content:"\\f81a"}.bi-train-freight-front:before{content:"\\f81b"}.bi-train-front-fill:before{content:"\\f81c"}.bi-train-front:before{content:"\\f81d"}.bi-train-lightrail-front-fill:before{content:"\\f81e"}.bi-train-lightrail-front:before{content:"\\f81f"}.bi-truck-front-fill:before{content:"\\f820"}.bi-truck-front:before{content:"\\f821"}.bi-ubuntu:before{content:"\\f822"}.bi-unindent:before{content:"\\f823"}.bi-unity:before{content:"\\f824"}.bi-universal-access-circle:before{content:"\\f825"}.bi-universal-access:before{content:"\\f826"}.bi-virus:before{content:"\\f827"}.bi-virus2:before{content:"\\f828"}.bi-wechat:before{content:"\\f829"}.bi-yelp:before{content:"\\f82a"}.bi-sign-stop-fill:before{content:"\\f82b"}.bi-sign-stop-lights-fill:before{content:"\\f82c"}.bi-sign-stop-lights:before{content:"\\f82d"}.bi-sign-stop:before{content:"\\f82e"}.bi-sign-turn-left-fill:before{content:"\\f82f"}.bi-sign-turn-left:before{content:"\\f830"}.bi-sign-turn-right-fill:before{content:"\\f831"}.bi-sign-turn-right:before{content:"\\f832"}.bi-sign-turn-slight-left-fill:before{content:"\\f833"}.bi-sign-turn-slight-left:before{content:"\\f834"}.bi-sign-turn-slight-right-fill:before{content:"\\f835"}.bi-sign-turn-slight-right:before{content:"\\f836"}.bi-sign-yield-fill:before{content:"\\f837"}.bi-sign-yield:before{content:"\\f838"}.bi-ev-station-fill:before{content:"\\f839"}.bi-ev-station:before{content:"\\f83a"}.bi-fuel-pump-diesel-fill:before{content:"\\f83b"}.bi-fuel-pump-diesel:before{content:"\\f83c"}.bi-fuel-pump-fill:before{content:"\\f83d"}.bi-fuel-pump:before{content:"\\f83e"}.bi-0-circle-fill:before{content:"\\f83f"}.bi-0-circle:before{content:"\\f840"}.bi-0-square-fill:before{content:"\\f841"}.bi-0-square:before{content:"\\f842"}.bi-rocket-fill:before{content:"\\f843"}.bi-rocket-takeoff-fill:before{content:"\\f844"}.bi-rocket-takeoff:before{content:"\\f845"}.bi-rocket:before{content:"\\f846"}.bi-stripe:before{content:"\\f847"}.bi-subscript:before{content:"\\f848"}.bi-superscript:before{content:"\\f849"}.bi-trello:before{content:"\\f84a"}.bi-envelope-at-fill:before{content:"\\f84b"}.bi-envelope-at:before{content:"\\f84c"}.bi-regex:before{content:"\\f84d"}.bi-text-wrap:before{content:"\\f84e"}.bi-sign-dead-end-fill:before{content:"\\f84f"}.bi-sign-dead-end:before{content:"\\f850"}.bi-sign-do-not-enter-fill:before{content:"\\f851"}.bi-sign-do-not-enter:before{content:"\\f852"}.bi-sign-intersection-fill:before{content:"\\f853"}.bi-sign-intersection-side-fill:before{content:"\\f854"}.bi-sign-intersection-side:before{content:"\\f855"}.bi-sign-intersection-t-fill:before{content:"\\f856"}.bi-sign-intersection-t:before{content:"\\f857"}.bi-sign-intersection-y-fill:before{content:"\\f858"}.bi-sign-intersection-y:before{content:"\\f859"}.bi-sign-intersection:before{content:"\\f85a"}.bi-sign-merge-left-fill:before{content:"\\f85b"}.bi-sign-merge-left:before{content:"\\f85c"}.bi-sign-merge-right-fill:before{content:"\\f85d"}.bi-sign-merge-right:before{content:"\\f85e"}.bi-sign-no-left-turn-fill:before{content:"\\f85f"}.bi-sign-no-left-turn:before{content:"\\f860"}.bi-sign-no-parking-fill:before{content:"\\f861"}.bi-sign-no-parking:before{content:"\\f862"}.bi-sign-no-right-turn-fill:before{content:"\\f863"}.bi-sign-no-right-turn:before{content:"\\f864"}.bi-sign-railroad-fill:before{content:"\\f865"}.bi-sign-railroad:before{content:"\\f866"}.bi-building-add:before{content:"\\f867"}.bi-building-check:before{content:"\\f868"}.bi-building-dash:before{content:"\\f869"}.bi-building-down:before{content:"\\f86a"}.bi-building-exclamation:before{content:"\\f86b"}.bi-building-fill-add:before{content:"\\f86c"}.bi-building-fill-check:before{content:"\\f86d"}.bi-building-fill-dash:before{content:"\\f86e"}.bi-building-fill-down:before{content:"\\f86f"}.bi-building-fill-exclamation:before{content:"\\f870"}.bi-building-fill-gear:before{content:"\\f871"}.bi-building-fill-lock:before{content:"\\f872"}.bi-building-fill-slash:before{content:"\\f873"}.bi-building-fill-up:before{content:"\\f874"}.bi-building-fill-x:before{content:"\\f875"}.bi-building-fill:before{content:"\\f876"}.bi-building-gear:before{content:"\\f877"}.bi-building-lock:before{content:"\\f878"}.bi-building-slash:before{content:"\\f879"}.bi-building-up:before{content:"\\f87a"}.bi-building-x:before{content:"\\f87b"}.bi-buildings-fill:before{content:"\\f87c"}.bi-buildings:before{content:"\\f87d"}.bi-bus-front-fill:before{content:"\\f87e"}.bi-bus-front:before{content:"\\f87f"}.bi-ev-front-fill:before{content:"\\f880"}.bi-ev-front:before{content:"\\f881"}.bi-globe-americas:before{content:"\\f882"}.bi-globe-asia-australia:before{content:"\\f883"}.bi-globe-central-south-asia:before{content:"\\f884"}.bi-globe-europe-africa:before{content:"\\f885"}.bi-house-add-fill:before{content:"\\f886"}.bi-house-add:before{content:"\\f887"}.bi-house-check-fill:before{content:"\\f888"}.bi-house-check:before{content:"\\f889"}.bi-house-dash-fill:before{content:"\\f88a"}.bi-house-dash:before{content:"\\f88b"}.bi-house-down-fill:before{content:"\\f88c"}.bi-house-down:before{content:"\\f88d"}.bi-house-exclamation-fill:before{content:"\\f88e"}.bi-house-exclamation:before{content:"\\f88f"}.bi-house-gear-fill:before{content:"\\f890"}.bi-house-gear:before{content:"\\f891"}.bi-house-lock-fill:before{content:"\\f892"}.bi-house-lock:before{content:"\\f893"}.bi-house-slash-fill:before{content:"\\f894"}.bi-house-slash:before{content:"\\f895"}.bi-house-up-fill:before{content:"\\f896"}.bi-house-up:before{content:"\\f897"}.bi-house-x-fill:before{content:"\\f898"}.bi-house-x:before{content:"\\f899"}.bi-person-add:before{content:"\\f89a"}.bi-person-down:before{content:"\\f89b"}.bi-person-exclamation:before{content:"\\f89c"}.bi-person-fill-add:before{content:"\\f89d"}.bi-person-fill-check:before{content:"\\f89e"}.bi-person-fill-dash:before{content:"\\f89f"}.bi-person-fill-down:before{content:"\\f8a0"}.bi-person-fill-exclamation:before{content:"\\f8a1"}.bi-person-fill-gear:before{content:"\\f8a2"}.bi-person-fill-lock:before{content:"\\f8a3"}.bi-person-fill-slash:before{content:"\\f8a4"}.bi-person-fill-up:before{content:"\\f8a5"}.bi-person-fill-x:before{content:"\\f8a6"}.bi-person-gear:before{content:"\\f8a7"}.bi-person-lock:before{content:"\\f8a8"}.bi-person-slash:before{content:"\\f8a9"}.bi-person-up:before{content:"\\f8aa"}.bi-scooter:before{content:"\\f8ab"}.bi-taxi-front-fill:before{content:"\\f8ac"}.bi-taxi-front:before{content:"\\f8ad"}.bi-amd:before{content:"\\f8ae"}.bi-database-add:before{content:"\\f8af"}.bi-database-check:before{content:"\\f8b0"}.bi-database-dash:before{content:"\\f8b1"}.bi-database-down:before{content:"\\f8b2"}.bi-database-exclamation:before{content:"\\f8b3"}.bi-database-fill-add:before{content:"\\f8b4"}.bi-database-fill-check:before{content:"\\f8b5"}.bi-database-fill-dash:before{content:"\\f8b6"}.bi-database-fill-down:before{content:"\\f8b7"}.bi-database-fill-exclamation:before{content:"\\f8b8"}.bi-database-fill-gear:before{content:"\\f8b9"}.bi-database-fill-lock:before{content:"\\f8ba"}.bi-database-fill-slash:before{content:"\\f8bb"}.bi-database-fill-up:before{content:"\\f8bc"}.bi-database-fill-x:before{content:"\\f8bd"}.bi-database-fill:before{content:"\\f8be"}.bi-database-gear:before{content:"\\f8bf"}.bi-database-lock:before{content:"\\f8c0"}.bi-database-slash:before{content:"\\f8c1"}.bi-database-up:before{content:"\\f8c2"}.bi-database-x:before{content:"\\f8c3"}.bi-database:before{content:"\\f8c4"}.bi-houses-fill:before{content:"\\f8c5"}.bi-houses:before{content:"\\f8c6"}.bi-nvidia:before{content:"\\f8c7"}.bi-person-vcard-fill:before{content:"\\f8c8"}.bi-person-vcard:before{content:"\\f8c9"}.bi-sina-weibo:before{content:"\\f8ca"}.bi-tencent-qq:before{content:"\\f8cb"}.bi-wikipedia:before{content:"\\f8cc"}.bi-alphabet-uppercase:before{content:"\\f2a5"}.bi-alphabet:before{content:"\\f68a"}.bi-amazon:before{content:"\\f68d"}.bi-arrows-collapse-vertical:before{content:"\\f690"}.bi-arrows-expand-vertical:before{content:"\\f695"}.bi-arrows-vertical:before{content:"\\f698"}.bi-arrows:before{content:"\\f6a2"}.bi-ban-fill:before{content:"\\f6a3"}.bi-ban:before{content:"\\f6b6"}.bi-bing:before{content:"\\f6c2"}.bi-cake:before{content:"\\f6e0"}.bi-cake2:before{content:"\\f6ed"}.bi-cookie:before{content:"\\f6ee"}.bi-copy:before{content:"\\f759"}.bi-crosshair:before{content:"\\f769"}.bi-crosshair2:before{content:"\\f794"}.bi-emoji-astonished-fill:before{content:"\\f795"}.bi-emoji-astonished:before{content:"\\f79a"}.bi-emoji-grimace-fill:before{content:"\\f79b"}.bi-emoji-grimace:before{content:"\\f7a0"}.bi-emoji-grin-fill:before{content:"\\f7a1"}.bi-emoji-grin:before{content:"\\f7a6"}.bi-emoji-surprise-fill:before{content:"\\f7a7"}.bi-emoji-surprise:before{content:"\\f7ac"}.bi-emoji-tear-fill:before{content:"\\f7ad"}.bi-emoji-tear:before{content:"\\f7b2"}.bi-envelope-arrow-down-fill:before{content:"\\f7b3"}.bi-envelope-arrow-down:before{content:"\\f7b8"}.bi-envelope-arrow-up-fill:before{content:"\\f7b9"}.bi-envelope-arrow-up:before{content:"\\f7be"}.bi-feather:before{content:"\\f7bf"}.bi-feather2:before{content:"\\f7c4"}.bi-floppy-fill:before{content:"\\f7c5"}.bi-floppy:before{content:"\\f7d8"}.bi-floppy2-fill:before{content:"\\f7d9"}.bi-floppy2:before{content:"\\f7e4"}.bi-gitlab:before{content:"\\f7e5"}.bi-highlighter:before{content:"\\f7f8"}.bi-marker-tip:before{content:"\\f802"}.bi-nvme-fill:before{content:"\\f803"}.bi-nvme:before{content:"\\f80c"}.bi-opencollective:before{content:"\\f80d"}.bi-pci-card-network:before{content:"\\f8cd"}.bi-pci-card-sound:before{content:"\\f8ce"}.bi-radar:before{content:"\\f8cf"}.bi-send-arrow-down-fill:before{content:"\\f8d0"}.bi-send-arrow-down:before{content:"\\f8d1"}.bi-send-arrow-up-fill:before{content:"\\f8d2"}.bi-send-arrow-up:before{content:"\\f8d3"}.bi-sim-slash-fill:before{content:"\\f8d4"}.bi-sim-slash:before{content:"\\f8d5"}.bi-sourceforge:before{content:"\\f8d6"}.bi-substack:before{content:"\\f8d7"}.bi-threads-fill:before{content:"\\f8d8"}.bi-threads:before{content:"\\f8d9"}.bi-transparency:before{content:"\\f8da"}.bi-twitter-x:before{content:"\\f8db"}.bi-type-h4:before{content:"\\f8dc"}.bi-type-h5:before{content:"\\f8dd"}.bi-type-h6:before{content:"\\f8de"}.bi-backpack-fill:before{content:"\\f8df"}.bi-backpack:before{content:"\\f8e0"}.bi-backpack2-fill:before{content:"\\f8e1"}.bi-backpack2:before{content:"\\f8e2"}.bi-backpack3-fill:before{content:"\\f8e3"}.bi-backpack3:before{content:"\\f8e4"}.bi-backpack4-fill:before{content:"\\f8e5"}.bi-backpack4:before{content:"\\f8e6"}.bi-brilliance:before{content:"\\f8e7"}.bi-cake-fill:before{content:"\\f8e8"}.bi-cake2-fill:before{content:"\\f8e9"}.bi-duffle-fill:before{content:"\\f8ea"}.bi-duffle:before{content:"\\f8eb"}.bi-exposure:before{content:"\\f8ec"}.bi-gender-neuter:before{content:"\\f8ed"}.bi-highlights:before{content:"\\f8ee"}.bi-luggage-fill:before{content:"\\f8ef"}.bi-luggage:before{content:"\\f8f0"}.bi-mailbox-flag:before{content:"\\f8f1"}.bi-mailbox2-flag:before{content:"\\f8f2"}.bi-noise-reduction:before{content:"\\f8f3"}.bi-passport-fill:before{content:"\\f8f4"}.bi-passport:before{content:"\\f8f5"}.bi-person-arms-up:before{content:"\\f8f6"}.bi-person-raised-hand:before{content:"\\f8f7"}.bi-person-standing-dress:before{content:"\\f8f8"}.bi-person-standing:before{content:"\\f8f9"}.bi-person-walking:before{content:"\\f8fa"}.bi-person-wheelchair:before{content:"\\f8fb"}.bi-shadows:before{content:"\\f8fc"}.bi-suitcase-fill:before{content:"\\f8fd"}.bi-suitcase-lg-fill:before{content:"\\f8fe"}.bi-suitcase-lg:before{content:"\\f8ff"}.bi-suitcase:before{content:"\\f900"}.bi-suitcase2-fill:before{content:"\\f901"}.bi-suitcase2:before{content:"\\f902"}.bi-vignette:before{content:"\\f903"}foreignObject.loci{box-sizing:border-box;border-radius:.375rem;position:relative;display:block}foreignObject.loci div.foreground{position:relative;display:flex;height:100%;width:100%;justify-content:center;align-items:center;box-sizing:inherit;border-radius:inherit;border-width:1px;border-style:solid;opacity:1}foreignObject.loci div.background{position:absolute;left:0;top:0;display:block;height:100%;width:100%;opacity:.3}foreignObject.pins div.foreground{position:relative;display:flex;height:100%;width:100%;justify-content:center;align-items:flex-end;box-sizing:border-box}foreignObject.dssp div.foreground{position:relative;display:flex;height:100%;width:100%;justify-content:center;align-items:flex-end;box-sizing:border-box}foreignObject.dssp i[class^=dssp]{position:relative;visibility:hidden;display:flex;height:100%;width:100%}foreignObject.dssp i.dssp-helix{visibility:visible;background-color:inherit;-webkit-mask-image:url(dssp-helix.74d0a47e4d7ed27e.svg);mask-image:url(dssp-helix.74d0a47e4d7ed27e.svg);-webkit-mask-position:0 center;mask-position:0 center;-webkit-mask-size:auto 100%;mask-size:auto 100%}foreignObject.dssp i.dssp-strand{display:flex;visibility:hidden}foreignObject.dssp i.dssp-strand:before{visibility:visible;background-color:inherit;-webkit-mask-image:url(dssp-strand-tail.783864b28823e2c7.svg);mask-image:url(dssp-strand-tail.783864b28823e2c7.svg);-webkit-mask-position:0 center;mask-position:0 center;-webkit-mask-size:auto 100%;mask-size:auto 100%;flex-shrink:1;flex-grow:1;content:""}foreignObject.dssp i.dssp-strand:after{visibility:visible;background-color:inherit;-webkit-mask-image:url(dssp-strand-head.85a295955fb4c220.svg);mask-image:url(dssp-strand-head.85a295955fb4c220.svg);-webkit-mask-position:0 center;mask-position:0 center;-webkit-mask-size:auto 100%;mask-size:auto 100%;flex-shrink:0;flex-grow:0;content:"";width:31px}.axis-grid line{stroke-opacity:.3;stroke:gray}.axis-grid line:nth-child(1){stroke-dasharray:2}.y.axis .tick text{display:none}\n'],encapsulation:2,changeDetection:0})}return e})();function Lb(e,t){1&e&&g.nrm(0,"i",10)}function Ob(e,t){1&e&&g.nrm(0,"i",11)}function Xb(e,t){if(1&e&&(g.j41(0,"div"),g.EFF(1),g.DNE(2,Lb,1,0,"i",10)(3,Ob,1,0),g.k0s()),2&e){const n=t.trace;g.AVh("text-muted",!n.expanded),g.R7$(),g.SpI(" ",n.label,"\xa0 "),g.R7$(),g.vxM(2,n.expanded?2:3)}}let Gb=(()=>{class e{constructor(){this.settings={"line-height":24,"content-size":16,"background-color":"transparent","trace-color":"cyan","grid-color":"rgba(222, 226, 230, 0.5)","text-color":"white","margin-top":24,"margin-right":24,"margin-bottom":24,"margin-left":128},this.sequence=Array.from("MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDIEQWFTEDPGPDEAPRMPEAAPPVAPAPAAPTPAAPAPAPSWPLSSSVPSQKTYQGSYGFRLGFLHSGTAKSVTCTYSPALNKMFCQLAKTCPVQLWVDSTPPPGTRVRAMAIYKQSQHMTEVVRRCPHHERCSDSDGLAPPQHLIRVEGNLRVEYLDDRNTFRHSVVVPYEPPEVGSDCTTIHYNYMCNSSCMGGMNRRPILTIITLEDSSGNLLGRNSFEVRVCACPGRDRRTEEENLRKKGEPHHELPPGSTKRALPNNTSSSPQPKKKPLDGEYFTLQIRGRERFEMFRELNEALELKDAQAGKEPGGSRAHSSHLKSKKGQSTSRHKKLMFKTEGPDSD".slice(0,100)),this.features=[{label:"Feature #1",type:"continuous",values:Array.from({length:70},()=>Math.floor(100*Math.random())+1)},{label:"Feature #2",type:"loci","trace-color":"red",values:[{start:1,end:50},{start:30,end:60}]},{label:"Feature #3",type:"trace",position:"overlap",values:[{type:"loci",values:[{start:1,end:10}],"trace-color":"blue"},{type:"loci",values:[{start:20,end:40}],"trace-color":"red"},{type:"loci",values:[{start:60,end:100}],"trace-color":"yellow"},{type:"continuous",values:Array.from({length:70},()=>Math.floor(100*Math.random())+1),"trace-color":"yellow"}],"background-color":"transparent"},{label:"Feature #4",type:"loci",values:[{start:27,end:56},{start:61,end:72}],nested:[{label:"Feature #5",type:"trace",values:[{type:"loci",values:[{start:1,end:5},{start:6,end:10}]},{type:"loci",values:[{start:10,end:27}]}]},{label:"Feature #6",type:"continuous",values:Array.from({length:70},()=>Math.floor(100*Math.random())+1)}]},{label:"Feature #7",type:"loci",values:[{start:81,end:81},{start:82,end:82}],nested:[{label:"Feature #8",type:"trace",values:[{type:"loci",values:[{start:81,end:81}]},{type:"loci",values:[{start:82,end:82}]}]},{label:"Feature #9",type:"continuous","trace-color":"greenyellow",values:Array.from({length:70},()=>Math.floor(100*Math.random())+1)}]}]}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275cmp=g.VBU({type:e,selectors:[["page-features-viewer"]],standalone:!0,features:[g.aNF],decls:25,vars:3,consts:[[1,"container","pt-3"],[1,"mb-3"],[1,"d-flex","flex-row","gap-3","mb-3"],[2,"display","block","width","1rem","height","1rem","background","black","font-size","1rem","line-height","1rem"],[2,"display","block","width","1rem","height","auto","background","black","color","white","font-size","1rem","line-height",".5rem"],[2,"display","block","width","auto","height","1rem","background","black","color","white","font-size","1rem","line-height","1rem"],[1,"d-block","mb-3"],[2,"display","block","height","auto","width","100%"],[3,"sequence","features","settings"],[3,"ngx-features-viewer-label"],[1,"bi","bi-caret-down-fill"],[1,"bi","bi-caret-right"]],template:function(i,o){1&i&&(g.j41(0,"div",0)(1,"div",1)(2,"h1"),g.EFF(3,"Feature viewer"),g.k0s(),g.j41(4,"p"),g.EFF(5," The feature viewer allows you to represent features on a reference seqeunce... "),g.k0s()(),g.j41(6,"div",2),g.nrm(7,"div",3),g.j41(8,"div",4),g.EFF(9," W"),g.k0s(),g.j41(10,"div",5),g.EFF(11," W"),g.k0s()(),g.j41(12,"div",6)(13,"p"),g.EFF(14," Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras congue velit in sem sodales pretium. Vivamus sit amet enim malesuada, efficitur quam quis, semper metus. Aenean commodo tellus eu viverra lacinia. Nam sed lectus non tellus suscipit pellentesque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse lacus diam, laoreet eget nisl et, dictum dictum elit. Vivamus sit amet fringilla elit, vitae pulvinar nisl. Donec mattis magna lacus, id congue risus aliquet a. "),g.k0s(),g.j41(15,"p"),g.EFF(16," Cras nec malesuada risus. Integer a tincidunt ante. Vivamus eu mauris placerat, dictum diam vitae, laoreet eros. Integer porttitor neque vel lectus ullamcorper commodo. Aliquam erat volutpat. Morbi convallis fermentum mauris, quis aliquet tellus posuere non. Nunc aliquet mattis tellus et ultrices. "),g.k0s()(),g.j41(17,"div",7)(18,"ngx-features-viewer",8),g.DNE(19,Xb,4,4,"ng-template",9),g.k0s()(),g.j41(20,"div")(21,"p"),g.EFF(22," Morbi convallis ipsum sit amet felis faucibus mollis. Duis nec viverra nisl, nec maximus nisl. Proin non malesuada massa, sit amet auctor elit. Sed condimentum, urna id commodo semper, nisi lorem lobortis velit, eu auctor ante magna eu nibh. Aliquam mattis pulvinar sapien vitae rhoncus. Sed lacinia ex a ultrices finibus. Phasellus eu erat eu sapien laoreet dapibus ac vitae mauris. "),g.k0s(),g.j41(23,"p"),g.EFF(24," Vestibulum elementum sem vel lorem suscipit varius. Mauris malesuada porta sapien blandit facilisis. Aliquam pretium erat nec lorem molestie, et feugiat turpis semper. Donec tempus posuere nibh, maximus hendrerit odio eleifend vitae. Praesent consequat felis leo, at ullamcorper nisl dictum sed. Morbi erat dui, sollicitudin id interdum convallis, elementum laoreet lorem. Duis leo massa, commodo id tempor sed, semper ut dui. Proin faucibus feugiat sapien, et cursus nunc. Duis eu mattis ipsum, ac facilisis quam. Donec a sapien non lectus iaculis luctus. Nulla lobortis turpis id nisi consectetur aliquet. Aliquam dignissim aliquam erat, at egestas nulla ullamcorper a. Duis porta interdum venenatis. Praesent a lorem at velit egestas efficitur eu et lectus. Suspendisse potenti. Duis imperdiet aliquam hendrerit. "),g.k0s()()()),2&i&&(g.R7$(18),g.Y8G("sequence",o.sequence)("features",o.features)("settings",o.settings))},dependencies:[me,jb,B.MD],changeDetection:0})}return e})()},2771:(bt,de,j)=>{j.d(de,{m:()=>le});var g=j(1413),me=j(6129);class le extends g.B{constructor(B=1/0,X=1/0,P=me.U){super(),this._bufferSize=B,this._windowTime=X,this._timestampProvider=P,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=X===1/0,this._bufferSize=Math.max(1,B),this._windowTime=Math.max(1,X)}next(B){const{isStopped:X,_buffer:P,_infiniteTimeWindow:ne,_timestampProvider:H,_windowTime:G}=this;X||(P.push(B),!ne&&P.push(H.now()+G)),this._trimBuffer(),super.next(B)}_subscribe(B){this._throwIfClosed(),this._trimBuffer();const X=this._innerSubscribe(B),{_infiniteTimeWindow:P,_buffer:ne}=this,H=ne.slice();for(let G=0;G{j.d(de,{F:()=>Q});var g=j(3669),me=j(9974),le=j(4360);function Q(X,P=g.D){return X=X??B,(0,me.N)((ne,H)=>{let G,Z=!0;ne.subscribe((0,le._)(H,U=>{const be=P(U);(Z||!X(G,be))&&(Z=!1,G=be,H.next(U))}))})}function B(X,P){return X===P}},9568:(bt,de,j)=>{j.d(de,{t:()=>ne});var g=j(2771),me=j(8750),le=j(1413),Q=j(7707),B=j(9974);function P(H,G,...Z){if(!0===G)return void H();if(!1===G)return;const U=new Q.Ms({next:()=>{U.unsubscribe(),H()}});return(0,me.Tg)(G(...Z)).subscribe(U)}function ne(H,G,Z){let U,be=!1;return H&&"object"==typeof H?({bufferSize:U=1/0,windowTime:G=1/0,refCount:be=!1,scheduler:Z}=H):U=H??1/0,function X(H={}){const{connector:G=(()=>new le.B),resetOnError:Z=!0,resetOnComplete:U=!0,resetOnRefCountZero:be=!0}=H;return at=>{let ze,we,Ae,Fe=0,Re=!1,ye=!1;const Ke=()=>{we?.unsubscribe(),we=void 0},lt=()=>{Ke(),ze=Ae=void 0,Re=ye=!1},jt=()=>{const De=ze;lt(),De?.unsubscribe()};return(0,B.N)((De,st)=>{Fe++,!ye&&!Re&&Ke();const Me=Ae=Ae??G();st.add(()=>{Fe--,0===Fe&&!ye&&!Re&&(we=P(jt,be))}),Me.subscribe(st),!ze&&Fe>0&&(ze=new Q.Ms({next:Ie=>Me.next(Ie),error:Ie=>{ye=!0,Ke(),we=P(lt,Z,Ie),Me.error(Ie)},complete:()=>{Re=!0,Ke(),we=P(lt,U),Me.complete()}}),(0,me.Tg)(De).subscribe(ze))})(at)}}({connector:()=>new g.m(U,G,Z),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:be})}},6129:(bt,de,j)=>{j.d(de,{U:()=>g});const g={now:()=>(g.delegate||Date).now(),delegate:void 0}}}]); \ No newline at end of file diff --git a/docs/876.ad26e918280ccdc0.js b/docs/876.ad26e918280ccdc0.js deleted file mode 100644 index 009ad49..0000000 --- a/docs/876.ad26e918280ccdc0.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[876],{9876:(Zn,be,F)=>{"use strict";F.r(be),F.d(be,{PageStructureViewerComponent:()=>uh});var Le={};F.r(Le),F.d(Le,{boolean:()=>ge,booleanish:()=>gt,commaOrSpaceSeparated:()=>Wt,commaSeparated:()=>gi,number:()=>$,overloadedBoolean:()=>yl,spaceSeparated:()=>Qe});var Lt={};F.r(Lt),F.d(Lt,{attentionMarkers:()=>oa,contentInitial:()=>oc,disable:()=>la,document:()=>Er,flow:()=>Gp,flowInitial:()=>Qp,insideSpan:()=>So,string:()=>lc,text:()=>wo});var He=F(177),R=F(467),Nt=F(2771),mt=F(5964),Ue=F(9974),fe=F(4360),Te=F(8750),Ne=F(3669),Me=F(5343),qt=F(9326),xe=F(5558),xt=F(6648),Dt=F(9568),Pe=F(140),je=F(6354),z=F(9136),De=F(9767),jt=F(1073),ft=F(261),bt=F(4369),fn=F(9498),wt=F(190);function on(r){let e;return r=r.replace(/^#/,""),[e,r]=[r.slice(6,8),r.slice(0,6)],[wt.Q1.fromHexStyle("#"+r),1-+("0x"+(e||"ff"))/255]}var Xn=F(2802),jn=F(573),we=F(381),Q=F(8277),St=F(8384),Jn=F(2086),ee=F(9283),de=F(528);const Je=St.x.builderFactory("interactions")({name:"interactions",from:we.O.Root,to:we.O.Shape.Provider,params:{data:Q.t.Value(void 0,{isHidden:!1})}})({apply:({params:r})=>new we.O.Shape.Provider({label:"",data:r.data,params:ee.e.Params,geometryUtils:ee.e.Utils,getShape:(e,i)=>function Se(r){const e=jn.P.createState(512,512);for(let i=0;ir[i].color,()=>1,i=>r[i].label)}(i)},{label:""})});var W=F(4438),Zt=F(3286);let gn=(()=>{class r{constructor(){this.settings$=new Nt.m}set settings(i){this.settings$.next(this._settings=i)}get settings(){return this._settings}static#e=this.\u0275fac=function(s){return new(s||r)};static#t=this.\u0275prov=W.jDH({token:r,factory:r.\u0275fac,providedIn:"platform"})}return r})();var _t=F(5621),p=F(9619),he=F(1395),Zr=F(9909),Z=F(1133);const fl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gs={};function Zs(r,e){return((e||Gs).jsx?wu:fl).test(r)}const Su=/[ \t\n\f\r]/g;function gl(r){return""===r.replace(Su,"")}class ur{constructor(e,i,s){this.property=e,this.normal=i,s&&(this.space=s)}}function Xs(r,e){const i={},s={};let l=-1;for(;++l"xlink:"+e.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),xl=Hi({space:"xml",transform:(r,e)=>"xml:"+e.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function bl(r,e){return e in r?r[e]:e}function wl(r,e){return bl(r,e.toLowerCase())}const Js=Hi({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:wl,properties:{xmlns:null,xmlnsXLink:null}}),Sl=Hi({transform:(r,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:gt,ariaAutoComplete:null,ariaBusy:gt,ariaChecked:gt,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:Qe,ariaCurrent:null,ariaDescribedBy:Qe,ariaDetails:null,ariaDisabled:gt,ariaDropEffect:Qe,ariaErrorMessage:null,ariaExpanded:gt,ariaFlowTo:Qe,ariaGrabbed:gt,ariaHasPopup:null,ariaHidden:gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qe,ariaLevel:$,ariaLive:null,ariaModal:gt,ariaMultiLine:gt,ariaMultiSelectable:gt,ariaOrientation:null,ariaOwns:Qe,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:gt,ariaReadOnly:gt,ariaRelevant:null,ariaRequired:gt,ariaRoleDescription:Qe,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:gt,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null}}),ns=Hi({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:wl,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gi,acceptCharset:Qe,accessKey:Qe,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:Qe,autoFocus:ge,autoPlay:ge,blocking:Qe,capture:null,charSet:null,checked:ge,cite:null,className:Qe,cols:$,colSpan:null,content:null,contentEditable:gt,controls:ge,controlsList:Qe,coords:$|gi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:yl,draggable:gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:Qe,height:$,hidden:ge,high:$,href:null,hrefLang:null,htmlFor:Qe,httpEquiv:Qe,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:Qe,itemRef:Qe,itemScope:ge,itemType:Qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ge,optimum:$,pattern:null,ping:Qe,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:Qe,required:ge,reversed:ge,rows:$,rowSpan:$,sandbox:Qe,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:gt,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qe,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:gt,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:$,security:null,unselectable:null}}),kl=Hi({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:bl,properties:{about:Wt,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:Qe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gi,g2:gi,glyphName:gi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:Wt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wt,rev:Wt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wt,requiredFeatures:Wt,requiredFonts:Wt,requiredFormats:Wt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:Wt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wt,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),is=Xs([xl,vl,Js,Sl,ns],"html"),Cl=Xs([xl,vl,Js,Sl,kl],"svg"),rs=/^data[-\w.:]+$/i,ss=/-[a-z]/g,eo=/[A-Z]/g;function sp(r){return"-"+r.toLowerCase()}function op(r){return r.charAt(1).toUpperCase()}const lp={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var El=F(5390);const ap=El.default||El,Al=Il("end"),to=Il("start");function Il(r){return function e(i){const s=i&&i.position&&i.position[r]||{};if("number"==typeof s.line&&s.line>0&&"number"==typeof s.column&&s.column>0)return{line:s.line,column:s.column,offset:"number"==typeof s.offset&&s.offset>-1?s.offset:void 0}}}function os(r){return r&&"object"==typeof r?"position"in r||"type"in r?at(r.position):"start"in r||"end"in r?at(r):"line"in r||"column"in r?Tl(r):"":""}function Tl(r){return Eu(r&&r.line)+":"+Eu(r&&r.column)}function at(r){return Tl(r&&r.start)+"-"+Tl(r&&r.end)}function Eu(r){return r&&"number"==typeof r?r:1}class Et extends Error{constructor(e,i,s){super(),"string"==typeof i&&(s=i,i=void 0);let l="",u={},c=!1;if(i&&(u="line"in i&&"column"in i||"start"in i&&"end"in i?{place:i}:"type"in i?{ancestors:[i],place:i.position}:{...i}),"string"==typeof e?l=e:!u.cause&&e&&(c=!0,l=e.message,u.cause=e),!u.ruleId&&!u.source&&"string"==typeof s){const f=s.indexOf(":");-1===f?u.ruleId=s:(u.source=s.slice(0,f),u.ruleId=s.slice(f+1))}if(!u.place&&u.ancestors&&u.ancestors){const f=u.ancestors[u.ancestors.length-1];f&&(u.place=f.position)}const h=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.message=l,this.line=h?h.line:void 0,this.name=os(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&"string"==typeof u.cause.stack?u.cause.stack:""}}Et.prototype.file="",Et.prototype.name="",Et.prototype.reason="",Et.prototype.message="",Et.prototype.stack="",Et.prototype.column=void 0,Et.prototype.line=void 0,Et.prototype.ancestors=void 0,Et.prototype.cause=void 0,Et.prototype.fatal=void 0,Et.prototype.place=void 0,Et.prototype.ruleId=void 0,Et.prototype.source=void 0;const no={}.hasOwnProperty,io=new Map,up=/[A-Z]/g,Au=/-([a-z])/g,ro=new Set(["table","tbody","thead","tfoot","tr"]),Un=new Set(["td","th"]),Iu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Tu(r,e,i){return"element"===e.type?function cp(r,e,i){const s=r.schema;let l=s;"svg"===e.tagName.toLowerCase()&&"html"===s.space&&(l=Cl,r.schema=l),r.ancestors.push(e);const u=zl(r,e.tagName,!1),c=function Nl(r,e){const i={};let s,l;for(l in e.properties)if("children"!==l&&no.call(e.properties,l)){const u=Dl(r,l,e.properties[l]);if(u){const[c,h]=u;r.tableCellAlignToStyle&&"align"===c&&"string"==typeof h&&Un.has(e.tagName)?s=h:i[c]=h}}return s&&((i.style||(i.style={}))["css"===r.stylePropertyNameCase?"text-align":"textAlign"]=s),i}(r,e);let h=Ml(r,e);return ro.has(e.tagName)&&(h=h.filter(function(f){return"string"!=typeof f||!function ku(r){return"object"==typeof r?"text"===r.type&&gl(r.value):gl(r)}(f)})),Pu(r,c,u,e),Pl(c,h),r.ancestors.pop(),r.schema=s,r.create(e,u,c,i)}(r,e,i):"mdxFlowExpression"===e.type||"mdxTextExpression"===e.type?function pp(r,e){if(e.data&&e.data.estree&&r.evaluater){return r.evaluater.evaluateExpression(e.data.estree.body[0].expression)}hr(r,e.position)}(r,e):"mdxJsxFlowElement"===e.type||"mdxJsxTextElement"===e.type?function oo(r,e,i){const s=r.schema;let l=s;"svg"===e.name&&"html"===s.space&&(l=Cl,r.schema=l),r.ancestors.push(e);const u=null===e.name?r.Fragment:zl(r,e.name,!0),c=function as(r,e){const i={};for(const s of e.attributes)if("mdxJsxExpressionAttribute"===s.type)if(s.data&&s.data.estree&&r.evaluater){Object.assign(i,r.evaluater.evaluateExpression(s.data.estree.body[0].expression.properties[0].argument))}else hr(r,e.position);else{const l=s.name;let u;if(s.value&&"object"==typeof s.value)if(s.value.data&&s.value.data.estree&&r.evaluater){u=r.evaluater.evaluateExpression(s.value.data.estree.body[0].expression)}else hr(r,e.position);else u=null===s.value||s.value;i[l]=u}return i}(r,e),h=Ml(r,e);return Pu(r,c,u,e),Pl(c,h),r.ancestors.pop(),r.schema=s,r.create(e,u,c,i)}(r,e,i):"mdxjsEsm"===e.type?function so(r,e){if(e.data&&e.data.estree&&r.evaluater)return r.evaluater.evaluateProgram(e.data.estree);hr(r,e.position)}(r,e):"root"===e.type?function ls(r,e,i){const s={};return Pl(s,Ml(r,e)),r.create(e,r.Fragment,s,i)}(r,e,i):"text"===e.type?function lo(r,e){return e.value}(0,e):void 0}function Pu(r,e,i,s){"string"!=typeof i&&i!==r.Fragment&&r.passNode&&(e.node=s)}function Pl(r,e){if(e.length>0){const i=e.length>1?e:e[0];i&&(r.children=i)}}function Ml(r,e){const i=[];let s=-1;const l=r.passKeys?new Map:io;for(;++s4&&"data"===i.slice(0,4)&&rs.test(e)){if("-"===e.charAt(4)){const u=e.slice(5).replace(ss,op);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=e.slice(4);if(!ss.test(u)){let c=u.replace(eo,sp);"-"!==c.charAt(0)&&(c="-"+c),e="data"+c}}l=ts}return new l(s,e)}(r.schema,e);if(!(null==i||"number"==typeof i&&Number.isNaN(i))){if(Array.isArray(i)&&(i=s.commaSeparated?function Qs(r,e){const i=e||{};return(""===r[r.length-1]?[...r,""]:r).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()}(i):function Cu(r){return r.join(" ").trim()}(i)),"style"===s.property){let l="object"==typeof i?i:function Ve(r,e){const i={};try{ap(e,function s(l,u){let c=l;"--"!==c.slice(0,2)&&("-ms-"===c.slice(0,4)&&(c="ms-"+c.slice(4)),c=c.replace(Au,Mu)),i[c]=u})}catch(l){if(!r.ignoreInvalidStyle){const c=new Et("Cannot parse `style` attribute",{ancestors:r.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw c.file=r.filePath||void 0,c.url=Iu+"#cannot-parse-style-attribute",c}}return i}(r,String(i));return"css"===r.stylePropertyNameCase&&(l=function Ol(r){const e={};let i;for(i in r)no.call(r,i)&&(e[Nu(i)]=r[i]);return e}(l)),["style",l]}return["react"===r.elementAttributeNameCase&&s.space?lp[s.property]||s.property:s.attribute,i]}}function zl(r,e,i){let s;if(i)if(e.includes(".")){const l=e.split(".");let c,u=-1;for(;++ul?0:l+e:e>l?l:e,i=i>0?i:0,s.length<1e4)c=Array.from(s),c.unshift(e,i),r.splice(...c);else for(i&&r.splice(e,i);u0?(an(r,r.length,0,e),r):e}class dp{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(e,i,s){const l=i||0;this.setCursor(Math.trunc(e));const u=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&mr(this.left,s),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),mr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),mr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e-1&&r.test(String.fromCharCode(i))}}function We(r,e,i,s){const l=s?s-1:Number.POSITIVE_INFINITY;let u=0;return function c(f){return ze(f)?(r.enter(i),h(f)):e(f)};function h(f){return ze(f)&&u++c))return;const ve=e.events.length;let Ae,Ze,Fe=ve;for(;Fe--;)if("exit"===e.events[Fe][0]&&"chunkFlow"===e.events[Fe][1].type){if(Ae){Ze=e.events[Fe][1].end;break}Ae=!0}for(D(s),H=ve;HB;){const ae=i[X];e.containerState=ae[1],ae[0].exit.call(e,r)}i.length=B}function O(){l.write([null]),u=void 0,l=void 0,e.containerState._closeFlow=void 0}}},br={tokenize:function Bl(r,e,i){return We(r,r.attempt(this.parser.constructs.document,e,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},wr={tokenize:function hs(r,e,i){return function s(u){return ze(u)?We(r,l,"linePrefix")(u):l(u)};function l(u){return null===u||le(u)?e(u):i(u)}},partial:!0},po={tokenize:function vp(r,e){let i;return function s(h){return r.enter("content"),i=r.enter("chunkContent",{contentType:"content"}),l(h)};function l(h){return null===h?u(h):le(h)?r.check(Bu,c,u)(h):(r.consume(h),l)}function u(h){return r.exit("chunkContent"),r.exit("content"),e(h)}function c(h){return r.consume(h),r.exit("chunkContent"),i.next=r.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,l}},resolve:function yp(r){return fr(r),r}},Bu={tokenize:function xp(r,e,i){const s=this;return function l(c){return r.exit("chunkContent"),r.enter("lineEnding"),r.consume(c),r.exit("lineEnding"),We(r,u,"linePrefix")};function u(c){if(null===c||le(c))return i(c);const h=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&h&&"linePrefix"===h[1].type&&h[2].sliceSerialize(h[1],!0).length>=4?e(c):r.interrupt(s.parser.constructs.flow,i,e)(c)}},partial:!0},Hl={tokenize:function bp(r){const e=this,i=r.attempt(wr,function s(u){if(null!==u)return r.enter("lineEndingBlank"),r.consume(u),r.exit("lineEndingBlank"),e.currentConstruct=void 0,i;r.consume(u)},r.attempt(this.parser.constructs.flowInitial,l,We(r,r.attempt(this.parser.constructs.flow,l,r.attempt(po,l)),"linePrefix")));return i;function l(u){if(null!==u)return r.enter("lineEnding"),r.consume(u),r.exit("lineEnding"),e.currentConstruct=void 0,i;r.consume(u)}}},wp={resolveAll:Ul()},Sp=Hu("string"),kp=Hu("text");function Hu(r){return{tokenize:function e(i){const s=this,l=this.parser.constructs[r],u=i.attempt(l,c,h);return c;function c(g){return y(g)?u(g):h(g)}function h(g){if(null!==g)return i.enter("data"),i.consume(g),f;i.consume(g)}function f(g){return y(g)?(i.exit("data"),u(g)):(i.consume(g),f)}function y(g){if(null===g)return!0;const x=l[g];let w=-1;if(x)for(;++w=3&&(null===y||le(y))?(r.exit("thematicBreak"),e(y)):i(y)}function f(y){return y===l?(r.consume(y),s++,f):(r.exit("thematicBreakSequence"),ze(y)?We(r,h,"whitespace")(y):h(y))}}},Xt={name:"list",tokenize:function Tp(r,e,i){const s=this,l=s.events[s.events.length-1];let u=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,c=0;return function h(b){const C=s.containerState.type||(42===b||43===b||45===b?"listUnordered":"listOrdered");if("listUnordered"===C?!s.containerState.marker||b===s.containerState.marker:vr(b)){if(s.containerState.type||(s.containerState.type=C,r.enter(C,{_container:!0})),"listUnordered"===C)return r.enter("listItemPrefix"),42===b||45===b?r.check(ho,i,y)(b):y(b);if(!s.interrupt||49===b)return r.enter("listItemPrefix"),r.enter("listItemValue"),f(b)}return i(b)};function f(b){return vr(b)&&++c<10?(r.consume(b),f):(!s.interrupt||c<2)&&(s.containerState.marker?b===s.containerState.marker:41===b||46===b)?(r.exit("listItemValue"),y(b)):i(b)}function y(b){return r.enter("listItemMarker"),r.consume(b),r.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||b,r.check(wr,s.interrupt?i:g,r.attempt(Uu,w,x))}function g(b){return s.containerState.initialBlankLine=!0,u++,w(b)}function x(b){return ze(b)?(r.enter("listItemPrefixWhitespace"),r.consume(b),r.exit("listItemPrefixWhitespace"),w):i(b)}function w(b){return s.containerState.size=u+s.sliceSerialize(r.exit("listItemPrefix"),!0).length,e(b)}},continuation:{tokenize:function Pp(r,e,i){const s=this;return s.containerState._closeFlow=void 0,r.check(wr,function l(h){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,We(r,e,"listItemIndent",s.containerState.size+1)(h)},function u(h){return s.containerState.furtherBlankLines||!ze(h)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(h)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,r.attempt(Ip,e,c)(h))});function c(h){return s.containerState._closeFlow=!0,s.interrupt=void 0,We(r,r.attempt(Xt,e,i),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}},exit:function Np(r){r.exit(this.containerState.type)}},Uu={tokenize:function Mp(r,e,i){const s=this;return We(r,function l(u){const c=s.events[s.events.length-1];return!ze(u)&&c&&"listItemPrefixWhitespace"===c[1].type?e(u):i(u)},"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},Ip={tokenize:function Lp(r,e,i){const s=this;return We(r,function l(u){const c=s.events[s.events.length-1];return c&&"listItemIndent"===c[1].type&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?e(u):i(u)},"listItemIndent",s.containerState.size+1)},partial:!0},Vu={name:"blockQuote",tokenize:function _l(r,e,i){const s=this;return function l(c){if(62===c){const h=s.containerState;return h.open||(r.enter("blockQuote",{_container:!0}),h.open=!0),r.enter("blockQuotePrefix"),r.enter("blockQuoteMarker"),r.consume(c),r.exit("blockQuoteMarker"),u}return i(c)};function u(c){return ze(c)?(r.enter("blockQuotePrefixWhitespace"),r.consume(c),r.exit("blockQuotePrefixWhitespace"),r.exit("blockQuotePrefix"),e):(r.exit("blockQuotePrefix"),e(c))}},continuation:{tokenize:function ms(r,e,i){const s=this;return function l(c){return ze(c)?We(r,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)};function u(c){return r.attempt(Vu,e,i)(c)}}},exit:function Dp(r){r.exit("blockQuote")}};function Wl(r,e,i,s,l,u,c,h,f){const y=f||Number.POSITIVE_INFINITY;let g=0;return function x(D){return 60===D?(r.enter(s),r.enter(l),r.enter(u),r.consume(D),r.exit(u),w):null===D||32===D||41===D||ds(D)?i(D):(r.enter(s),r.enter(c),r.enter(h),r.enter("chunkString",{contentType:"string"}),N(D))};function w(D){return 62===D?(r.enter(u),r.consume(D),r.exit(u),r.exit(l),r.exit(s),e):(r.enter(h),r.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return 62===D?(r.exit("chunkString"),r.exit(h),w(D)):null===D||60===D||le(D)?i(D):(r.consume(D),92===D?C:b)}function C(D){return 60===D||62===D||92===D?(r.consume(D),b):b(D)}function N(D){return g||null!==D&&41!==D&&!Rt(D)?g999||null===b||91===b||93===b&&!f||94===b&&!h&&"_hiddenFootnoteSupport"in c.parser.constructs?i(b):93===b?(r.exit(u),r.enter(l),r.consume(b),r.exit(l),r.exit(s),e):le(b)?(r.enter("lineEnding"),r.consume(b),r.exit("lineEnding"),g):(r.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return null===b||91===b||93===b||le(b)||h++>999?(r.exit("chunkString"),g(b)):(r.consume(b),f||(f=!ze(b)),92===b?w:x)}function w(b){return 91===b||92===b||93===b?(r.consume(b),h++,x):x(b)}}function $l(r,e,i,s,l,u){let c;return function h(w){return 34===w||39===w||40===w?(r.enter(s),r.enter(l),r.consume(w),r.exit(l),c=40===w?41:w,f):i(w)};function f(w){return w===c?(r.enter(l),r.consume(w),r.exit(l),r.exit(s),e):(r.enter(u),y(w))}function y(w){return w===c?(r.exit(u),f(c)):null===w?i(w):le(w)?(r.enter("lineEnding"),r.consume(w),r.exit("lineEnding"),We(r,y,"linePrefix")):(r.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===c||null===w||le(w)?(r.exit("chunkString"),y(w)):(r.consume(w),92===w?x:g)}function x(w){return w===c||92===w?(r.consume(w),g):g(w)}}function Sr(r,e){let i;return function s(l){return le(l)?(r.enter("lineEnding"),r.consume(l),r.exit("lineEnding"),i=!0,s):ze(l)?We(r,s,i?"linePrefix":"lineSuffix")(l):e(l)}}function Ui(r){return r.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kr={name:"definition",tokenize:function Op(r,e,i){const s=this;let l;return function u(b){return r.enter("definition"),function c(b){return Kl.call(s,r,h,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}(b)};function h(b){return l=Ui(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),58===b?(r.enter("definitionMarker"),r.consume(b),r.exit("definitionMarker"),f):i(b)}function f(b){return Rt(b)?Sr(r,y)(b):y(b)}function y(b){return Wl(r,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return r.attempt(zp,x,x)(b)}function x(b){return ze(b)?We(r,w,"whitespace")(b):w(b)}function w(b){return null===b||le(b)?(r.exit("definition"),s.parser.defined.push(l),e(b)):i(b)}}},zp={tokenize:function Rp(r,e,i){return function s(h){return Rt(h)?Sr(r,l)(h):i(h)};function l(h){return $l(r,u,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function u(h){return ze(h)?We(r,c,"whitespace")(h):c(h)}function c(h){return null===h||le(h)?e(h):i(h)}},partial:!0},mo={name:"codeIndented",tokenize:function fs(r,e,i){const s=this;return function l(y){return r.enter("codeIndented"),We(r,u,"linePrefix",5)(y)};function u(y){const g=s.events[s.events.length-1];return g&&"linePrefix"===g[1].type&&g[2].sliceSerialize(g[1],!0).length>=4?c(y):i(y)}function c(y){return null===y?f(y):le(y)?r.attempt(qu,c,f)(y):(r.enter("codeFlowValue"),h(y))}function h(y){return null===y||le(y)?(r.exit("codeFlowValue"),c(y)):(r.consume(y),h)}function f(y){return r.exit("codeIndented"),e(y)}}},qu={tokenize:function gs(r,e,i){const s=this;return l;function l(c){return s.parser.lazy[s.now().line]?i(c):le(c)?(r.enter("lineEnding"),r.consume(c),r.exit("lineEnding"),l):We(r,u,"linePrefix",5)(c)}function u(c){const h=s.events[s.events.length-1];return h&&"linePrefix"===h[1].type&&h[2].sliceSerialize(h[1],!0).length>=4?e(c):le(c)?l(c):i(c)}},partial:!0},Fp={name:"headingAtx",tokenize:function Bp(r,e,i){let s=0;return function l(g){return r.enter("atxHeading"),function u(g){return r.enter("atxHeadingSequence"),c(g)}(g)};function c(g){return 35===g&&s++<6?(r.consume(g),c):null===g||Rt(g)?(r.exit("atxHeadingSequence"),h(g)):i(g)}function h(g){return 35===g?(r.enter("atxHeadingSequence"),f(g)):null===g||le(g)?(r.exit("atxHeading"),e(g)):ze(g)?We(r,h,"whitespace")(g):(r.enter("atxHeadingText"),y(g))}function f(g){return 35===g?(r.consume(g),f):(r.exit("atxHeadingSequence"),h(g))}function y(g){return null===g||35===g||Rt(g)?(r.exit("atxHeadingText"),h(g)):(r.consume(g),y)}},resolve:function fo(r,e){let l,u,i=r.length-2,s=3;return"whitespace"===r[s][1].type&&(s+=2),i-2>s&&"whitespace"===r[i][1].type&&(i-=2),"atxHeadingSequence"===r[i][1].type&&(s===i-1||i-4>s&&"whitespace"===r[i-2][1].type)&&(i-=s+1===i?2:4),i>s&&(l={type:"atxHeadingText",start:r[s][1].start,end:r[i][1].end},u={type:"chunkText",start:r[s][1].start,end:r[i][1].end,contentType:"text"},an(r,s,i-s+1,[["enter",l,e],["enter",u,e],["exit",u,e],["exit",l,e]])),r}},Ql={name:"setextUnderline",tokenize:function Yl(r,e,i){const s=this;let l;return function u(y){let x,g=s.events.length;for(;g--;)if("lineEnding"!==s.events[g][1].type&&"linePrefix"!==s.events[g][1].type&&"content"!==s.events[g][1].type){x="paragraph"===s.events[g][1].type;break}return s.parser.lazy[s.now().line]||!s.interrupt&&!x?i(y):(r.enter("setextHeadingLine"),l=y,function c(y){return r.enter("setextHeadingLineSequence"),h(y)}(y))};function h(y){return y===l?(r.consume(y),h):(r.exit("setextHeadingLineSequence"),ze(y)?We(r,f,"lineSuffix")(y):f(y))}function f(y){return null===y||le(y)?(r.exit("setextHeadingLine"),e(y)):i(y)}},resolveTo:function Gl(r,e){let s,l,u,i=r.length;for(;i--;)if("enter"===r[i][0]){if("content"===r[i][1].type){s=i;break}"paragraph"===r[i][1].type&&(l=i)}else"content"===r[i][1].type&&r.splice(i,1),!u&&"definition"===r[i][1].type&&(u=i);const c={type:"setextHeading",start:Object.assign({},r[l][1].start),end:Object.assign({},r[r.length-1][1].end)};return r[l][1].type="setextHeadingText",u?(r.splice(l,0,["enter",c,e]),r.splice(u+1,0,["exit",r[s][1],e]),r[s][1].end=Object.assign({},r[u][1].end)):r[s][1]=c,r.push(["exit",c,e]),r}},_u=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zl=["pre","script","style","textarea"],Wu={name:"htmlFlow",tokenize:function qp(r,e,i){const s=this;let l,u,c,h,f;return function y(E){return function g(E){return r.enter("htmlFlow"),r.enter("htmlFlowData"),r.consume(E),x}(E)};function x(E){return 33===E?(r.consume(E),w):47===E?(r.consume(E),u=!0,N):63===E?(r.consume(E),l=3,s.interrupt?e:j):un(E)?(r.consume(E),c=String.fromCharCode(E),V):i(E)}function w(E){return 45===E?(r.consume(E),l=2,b):91===E?(r.consume(E),l=5,h=0,C):un(E)?(r.consume(E),l=4,s.interrupt?e:j):i(E)}function b(E){return 45===E?(r.consume(E),s.interrupt?e:j):i(E)}function C(E){return E==="CDATA[".charCodeAt(h++)?(r.consume(E),6===h?s.interrupt?e:_e:C):i(E)}function N(E){return un(E)?(r.consume(E),c=String.fromCharCode(E),V):i(E)}function V(E){if(null===E||47===E||62===E||Rt(E)){const Bn=47===E,Ws=c.toLowerCase();return Bn||u||!Zl.includes(Ws)?_u.includes(c.toLowerCase())?(l=6,Bn?(r.consume(E),D):s.interrupt?e(E):_e(E)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?i(E):u?O(E):B(E)):(l=1,s.interrupt?e(E):_e(E))}return 45===E||cn(E)?(r.consume(E),c+=String.fromCharCode(E),V):i(E)}function D(E){return 62===E?(r.consume(E),s.interrupt?e:_e):i(E)}function O(E){return ze(E)?(r.consume(E),O):Ze(E)}function B(E){return 47===E?(r.consume(E),Ze):58===E||95===E||un(E)?(r.consume(E),X):ze(E)?(r.consume(E),B):Ze(E)}function X(E){return 45===E||46===E||58===E||95===E||cn(E)?(r.consume(E),X):ae(E)}function ae(E){return 61===E?(r.consume(E),H):ze(E)?(r.consume(E),ae):B(E)}function H(E){return null===E||60===E||61===E||62===E||96===E?i(E):34===E||39===E?(r.consume(E),f=E,ve):ze(E)?(r.consume(E),H):Fe(E)}function ve(E){return E===f?(r.consume(E),f=null,Ae):null===E||le(E)?i(E):(r.consume(E),ve)}function Fe(E){return null===E||34===E||39===E||47===E||60===E||61===E||62===E||96===E||Rt(E)?ae(E):(r.consume(E),Fe)}function Ae(E){return 47===E||62===E||ze(E)?B(E):i(E)}function Ze(E){return 62===E?(r.consume(E),mn):i(E)}function mn(E){return null===E||le(E)?_e(E):ze(E)?(r.consume(E),mn):i(E)}function _e(E){return 45===E&&2===l?(r.consume(E),qe):60===E&&1===l?(r.consume(E),ye):62===E&&4===l?(r.consume(E),Yn):63===E&&3===l?(r.consume(E),j):93===E&&5===l?(r.consume(E),Fn):!le(E)||6!==l&&7!==l?null===E||le(E)?(r.exit("htmlFlowData"),oe(E)):(r.consume(E),_e):(r.exit("htmlFlowData"),r.check(Hp,sr,oe)(E))}function oe(E){return r.check(Up,te,sr)(E)}function te(E){return r.enter("lineEnding"),r.consume(E),r.exit("lineEnding"),Ie}function Ie(E){return null===E||le(E)?oe(E):(r.enter("htmlFlowData"),_e(E))}function qe(E){return 45===E?(r.consume(E),j):_e(E)}function ye(E){return 47===E?(r.consume(E),c="",ht):_e(E)}function ht(E){if(62===E){const Bn=c.toLowerCase();return Zl.includes(Bn)?(r.consume(E),Yn):_e(E)}return un(E)&&c.length<8?(r.consume(E),c+=String.fromCharCode(E),ht):_e(E)}function Fn(E){return 93===E?(r.consume(E),j):_e(E)}function j(E){return 62===E?(r.consume(E),Yn):45===E&&2===l?(r.consume(E),j):_e(E)}function Yn(E){return null===E||le(E)?(r.exit("htmlFlowData"),sr(E)):(r.consume(E),Yn)}function sr(E){return r.exit("htmlFlow"),e(E)}},resolveTo:function Vp(r){let e=r.length;for(;e--&&("enter"!==r[e][0]||"htmlFlow"!==r[e][1].type););return e>1&&"linePrefix"===r[e-2][1].type&&(r[e][1].start=r[e-2][1].start,r[e+1][1].start=r[e-2][1].start,r.splice(e-2,2)),r},concrete:!0},Hp={tokenize:function In(r,e,i){return function s(l){return r.enter("lineEnding"),r.consume(l),r.exit("lineEnding"),r.attempt(wr,e,i)}},partial:!0},Up={tokenize:function _p(r,e,i){const s=this;return function l(c){return le(c)?(r.enter("lineEnding"),r.consume(c),r.exit("lineEnding"),u):i(c)};function u(c){return s.parser.lazy[s.now().line]?i(c):e(c)}},partial:!0},Cr={tokenize:function $u(r,e,i){const s=this;return function l(c){return null===c?i(c):(r.enter("lineEnding"),r.consume(c),r.exit("lineEnding"),u)};function u(c){return s.parser.lazy[s.now().line]?i(c):e(c)}},partial:!0},Xl={name:"codeFenced",tokenize:function Ku(r,e,i){const s=this,l={tokenize:function ae(H,ve,Fe){let Ae=0;return function Ze(Ie){return H.enter("lineEnding"),H.consume(Ie),H.exit("lineEnding"),mn};function mn(Ie){return H.enter("codeFencedFence"),ze(Ie)?We(H,_e,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ie):_e(Ie)}function _e(Ie){return Ie===h?(H.enter("codeFencedFenceSequence"),oe(Ie)):Fe(Ie)}function oe(Ie){return Ie===h?(Ae++,H.consume(Ie),oe):Ae>=c?(H.exit("codeFencedFenceSequence"),ze(Ie)?We(H,te,"whitespace")(Ie):te(Ie)):Fe(Ie)}function te(Ie){return null===Ie||le(Ie)?(H.exit("codeFencedFence"),ve(Ie)):Fe(Ie)}},partial:!0};let h,u=0,c=0;return function f(H){return function y(H){const ve=s.events[s.events.length-1];return u=ve&&"linePrefix"===ve[1].type?ve[2].sliceSerialize(ve[1],!0).length:0,h=H,r.enter("codeFenced"),r.enter("codeFencedFence"),r.enter("codeFencedFenceSequence"),g(H)}(H)};function g(H){return H===h?(c++,r.consume(H),g):c<3?i(H):(r.exit("codeFencedFenceSequence"),ze(H)?We(r,x,"whitespace")(H):x(H))}function x(H){return null===H||le(H)?(r.exit("codeFencedFence"),s.interrupt?e(H):r.check(Cr,N,X)(H)):(r.enter("codeFencedFenceInfo"),r.enter("chunkString",{contentType:"string"}),w(H))}function w(H){return null===H||le(H)?(r.exit("chunkString"),r.exit("codeFencedFenceInfo"),x(H)):ze(H)?(r.exit("chunkString"),r.exit("codeFencedFenceInfo"),We(r,b,"whitespace")(H)):96===H&&H===h?i(H):(r.consume(H),w)}function b(H){return null===H||le(H)?x(H):(r.enter("codeFencedFenceMeta"),r.enter("chunkString",{contentType:"string"}),C(H))}function C(H){return null===H||le(H)?(r.exit("chunkString"),r.exit("codeFencedFenceMeta"),x(H)):96===H&&H===h?i(H):(r.consume(H),C)}function N(H){return r.attempt(l,X,V)(H)}function V(H){return r.enter("lineEnding"),r.consume(H),r.exit("lineEnding"),D}function D(H){return u>0&&ze(H)?We(r,O,"linePrefix",u+1)(H):O(H)}function O(H){return null===H||le(H)?r.check(Cr,N,X)(H):(r.enter("codeFlowValue"),B(H))}function B(H){return null===H||le(H)?(r.exit("codeFlowValue"),O(H)):(r.consume(H),B)}function X(H){return r.exit("codeFenced"),e(H)}},concrete:!0},Jl=document.createElement("i");function ys(r){const e="&"+r+";";Jl.innerHTML=e;const i=Jl.textContent;return(59!==i.charCodeAt(i.length-1)||"semi"===r)&&i!==e&&i}const Qu={name:"characterReference",tokenize:function Wp(r,e,i){const s=this;let u,c,l=0;return function h(x){return r.enter("characterReference"),r.enter("characterReferenceMarker"),r.consume(x),r.exit("characterReferenceMarker"),f};function f(x){return 35===x?(r.enter("characterReferenceMarkerNumeric"),r.consume(x),r.exit("characterReferenceMarkerNumeric"),y):(r.enter("characterReferenceValue"),u=31,c=cn,g(x))}function y(x){return 88===x||120===x?(r.enter("characterReferenceMarkerHexadecimal"),r.consume(x),r.exit("characterReferenceMarkerHexadecimal"),r.enter("characterReferenceValue"),u=6,c=Rl,g):(r.enter("characterReferenceValue"),u=7,c=vr,g(x))}function g(x){if(59===x&&l){const w=r.exit("characterReferenceValue");return c!==cn||ys(s.sliceSerialize(w))?(r.enter("characterReferenceMarker"),r.consume(x),r.exit("characterReferenceMarker"),r.exit("characterReference"),e):i(x)}return c(x)&&l++1&&r[i][1].end.offset-r[i][1].start.offset>1?2:1;const x=Object.assign({},r[s][1].end),w=Object.assign({},r[i][1].start);nc(x,-f),nc(w,f),c={type:f>1?"strongSequence":"emphasisSequence",start:x,end:Object.assign({},r[s][1].end)},h={type:f>1?"strongSequence":"emphasisSequence",start:Object.assign({},r[i][1].start),end:w},u={type:f>1?"strongText":"emphasisText",start:Object.assign({},r[s][1].end),end:Object.assign({},r[i][1].start)},l={type:f>1?"strong":"emphasis",start:Object.assign({},c.start),end:Object.assign({},h.end)},r[s][1].end=Object.assign({},c.start),r[i][1].start=Object.assign({},h.end),y=[],r[s][1].end.offset-r[s][1].start.offset&&(y=kt(y,[["enter",r[s][1],e],["exit",r[s][1],e]])),y=kt(y,[["enter",l,e],["enter",c,e],["exit",c,e],["enter",u,e]]),y=kt(y,Vl(e.parser.constructs.insideSpan.null,r.slice(s+1,i),e)),y=kt(y,[["exit",u,e],["enter",h,e],["exit",h,e],["exit",l,e]]),r[i][1].end.offset-r[i][1].start.offset?(g=2,y=kt(y,[["enter",r[i][1],e],["exit",r[i][1],e]])):g=0,an(r,s-1,i-s+3,y),i=s+y.length-g-2;break}for(i=-1;++i-1){const h=c[0];"string"==typeof h?c[0]=h.slice(s):c.shift()}u>0&&c.push(r[l].slice(0,u))}return c}(c,oe)}function V(){const{line:oe,column:te,offset:Ie,_index:qe,_bufferIndex:ye}=s;return{line:oe,column:te,offset:Ie,_index:qe,_bufferIndex:ye}}function B(oe){f=void 0,w=oe,x=x(oe)}function Fe(oe,te){te.restore()}function Ae(oe,te){return function Ie(qe,ye,ht){let Fn,j,Yn,sr;return Array.isArray(qe)?Bn(qe):"tokenize"in qe?Bn([qe]):function E(Yt){return function gu(or){const Ks=null!==or&&Yt[or],pl=null!==or&&Yt.null;return Bn([...Array.isArray(Ks)?Ks:Ks?[Ks]:[],...Array.isArray(pl)?pl:pl?[pl]:[]])(or)}}(qe);function Bn(Yt){return Fn=Yt,j=0,0===Yt.length?ht:Ws(Yt[j])}function Ws(Yt){return function gu(or){return sr=function mn(){const oe=V(),te=g.previous,Ie=g.currentConstruct,qe=g.events.length,ye=Array.from(h);return{restore:function ht(){s=oe,g.previous=te,g.currentConstruct=Ie,g.events.length=qe,h=ye,_e()},from:qe}}(),Yn=Yt,Yt.partial||(g.currentConstruct=Yt),Yt.name&&g.parser.constructs.disable.null.includes(Yt.name)?np():Yt.tokenize.call(te?Object.assign(Object.create(g),te):g,y,bd,np)(or)}}function bd(Yt){return f=!0,oe(Yn,sr),ye}function np(Yt){return f=!0,sr.restore(),++j13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||!(65535&~i)||65534==(65535&i)||i>1114111?"\ufffd":String.fromCodePoint(i)}const Zp=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ca(r,e,i){if(e)return e;if(35===i.charCodeAt(0)){const l=i.charCodeAt(1),u=120===l||88===l;return ua(i.slice(u?2:1),u?16:10)}return ys(i)||r}const ri={}.hasOwnProperty;function ac(r,e,i){return"string"!=typeof e&&(i=e,e=void 0),function Ar(r){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Pd),autolinkProtocol:Ae,autolinkEmail:Ae,atxHeading:u(Ad),blockQuote:u(function or(){return{type:"blockquote",children:[]}}),characterEscape:Ae,characterReference:Ae,codeFenced:u(Ks),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(Ks,c),codeText:u(function pl(){return{type:"inlineCode",value:""}},c),codeTextData:Ae,data:Ae,codeFlowValue:Ae,definition:u(function wd(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(function ch(){return{type:"emphasis",children:[]}}),hardBreakEscape:u(Id),hardBreakTrailing:u(Id),htmlFlow:u(Td,c),htmlFlowData:Ae,htmlText:u(Td,c),htmlTextData:Ae,image:u(function ph(){return{type:"image",title:null,url:"",alt:null}}),label:c,link:u(Pd),listItem:u(function dh(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}),listItemValue:function w(U){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:u(Ld,function x(){this.data.expectingFirstListItemValue=!0}),listUnordered:u(Ld),paragraph:u(function hh(){return{type:"paragraph",children:[]}}),reference:function E(){this.data.referenceType="collapsed"},referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u(Ad),strong:u(function mh(){return{type:"strong",children:[]}}),thematicBreak:u(function gh(){return{type:"thematicBreak"}})},exit:{atxHeading:f(),atxHeadingSequence:function ae(U){const Y=this.stack[this.stack.length-1];if(!Y.depth){const ke=this.sliceSerialize(U).length;Y.depth=ke}},autolink:f(),autolinkEmail:function gu(U){Ze.call(this,U),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(U)},autolinkProtocol:function Yt(U){Ze.call(this,U),this.stack[this.stack.length-1].url=this.sliceSerialize(U)},blockQuote:f(),characterEscapeValue:Ze,characterReferenceMarkerHexadecimal:Ws,characterReferenceMarkerNumeric:Ws,characterReferenceValue:function bd(U){const Y=this.sliceSerialize(U),ke=this.data.characterReferenceType;let Be;ke?(Be=ua(Y,"characterReferenceMarkerNumeric"===ke?10:16),this.data.characterReferenceType=void 0):Be=ys(Y),this.stack[this.stack.length-1].value+=Be},characterReference:function np(U){this.stack.pop().position.end=zt(U.end)},codeFenced:f(function V(){const U=this.resume();this.stack[this.stack.length-1].value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function b(){const U=this.resume();this.stack[this.stack.length-1].lang=U},codeFencedFenceMeta:function C(){const U=this.resume();this.stack[this.stack.length-1].meta=U},codeFlowValue:Ze,codeIndented:f(function D(){const U=this.resume();this.stack[this.stack.length-1].value=U.replace(/(\r?\n|\r)$/g,"")}),codeText:f(function Ie(){const U=this.resume();this.stack[this.stack.length-1].value=U}),codeTextData:Ze,data:Ze,definition:f(),definitionDestinationString:function X(){const U=this.resume();this.stack[this.stack.length-1].url=U},definitionLabelString:function O(U){const Y=this.resume(),ke=this.stack[this.stack.length-1];ke.label=Y,ke.identifier=Ui(this.sliceSerialize(U)).toLowerCase()},definitionTitleString:function B(){const U=this.resume();this.stack[this.stack.length-1].title=U},emphasis:f(),hardBreakEscape:f(_e),hardBreakTrailing:f(_e),htmlFlow:f(function oe(){const U=this.resume();this.stack[this.stack.length-1].value=U}),htmlFlowData:Ze,htmlText:f(function te(){const U=this.resume();this.stack[this.stack.length-1].value=U}),htmlTextData:Ze,image:f(function ye(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=Y,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}),label:function Fn(){const U=this.stack[this.stack.length-1],Y=this.resume(),ke=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===ke.type?ke.children=U.children:ke.alt=Y},labelText:function ht(U){const Y=this.sliceSerialize(U),ke=this.stack[this.stack.length-2];ke.label=function Xp(r){return r.replace(Zp,ca)}(Y),ke.identifier=Ui(Y).toLowerCase()},lineEnding:function mn(U){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak)return Y.children[Y.children.length-1].position.end=zt(U.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Y.type)&&(Ae.call(this,U),Ze.call(this,U))},link:f(function qe(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=Y,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:function Bn(U){const Y=this.resume(),ke=this.stack[this.stack.length-1];ke.label=Y,ke.identifier=Ui(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function j(){const U=this.resume();this.stack[this.stack.length-1].url=U},resourceTitleString:function Yn(){const U=this.resume();this.stack[this.stack.length-1].title=U},resource:function sr(){this.data.inReference=void 0},setextHeading:f(function Fe(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function ve(U){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(U).codePointAt(0)?1:2},setextHeadingText:function H(){this.data.setextHeadingSlurpLineEnding=!0},strong:f(),thematicBreak:f()}};Ir(e,(r||{}).mdastExtensions||[]);const i={};return function s(U){let Y={type:"root",children:[]};const ke={stack:[Y],tokenStack:[],config:e,enter:h,exit:y,buffer:c,resume:g,data:i},Be=[];let Xe=-1;for(;++Xe0){const fi=ke.tokenStack[ke.tokenStack.length-1];(fi[1]||Co).call(ke,void 0,fi[0])}for(Y.position={start:zt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:zt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe((r,e)=>{const i=(l,u)=>(r.set(u,l),l),s=l=>{if(r.has(l))return r.get(l);const[u,c]=e[l];switch(u){case 0:case-1:return i(c,l);case 1:{const h=i([],l);for(const f of c)h.push(s(f));return h}case 2:{const h=i({},l);for(const[f,y]of c)h[s(f)]=s(y);return h}case 3:return i(new Date(c),l);case 4:{const{source:h,flags:f}=c;return i(new RegExp(h,f),l)}case 5:{const h=i(new Map,l);for(const[f,y]of c)h.set(s(f),s(y));return h}case 6:{const h=i(new Set,l);for(const f of c)h.add(s(f));return h}case 7:{const{name:h,message:f}=c;return i(new li[h](f),l)}case 8:return i(BigInt(c),l);case"BigInt":return i(Object(BigInt(c)),l)}return i(new li[u](c),l)};return s})(new Map,r)(0),{toString:Pr}={},{keys:Jt}=Object,bi=r=>{const e=typeof r;if("object"!==e||!r)return[0,e];const i=Pr.call(r).slice(8,-1);switch(i){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""]}return i.includes("Array")?[1,i]:i.includes("Error")?[7,i]:[2,i]},ks=([r,e])=>0===r&&("function"===e||"symbol"===e),Cs=(r,{json:e,lossy:i}={})=>{const s=[];return((r,e,i,s)=>{const l=(c,h)=>{const f=s.push(c)-1;return i.set(h,f),f},u=c=>{if(i.has(c))return i.get(c);let[h,f]=bi(c);switch(h){case 0:{let g=c;switch(f){case"bigint":h=8,g=c.toString();break;case"function":case"symbol":if(r)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return l([-1],c)}return l([h,g],c)}case 1:{if(f)return l([f,[...c]],c);const g=[],x=l([h,g],c);for(const w of c)g.push(u(w));return x}case 2:{if(f)switch(f){case"BigInt":return l([f,c.toString()],c);case"Boolean":case"Number":case"String":return l([f,c.valueOf()],c)}if(e&&"toJSON"in c)return u(c.toJSON());const g=[],x=l([h,g],c);for(const w of Jt(c))(r||!ks(bi(c[w])))&&g.push([u(w),u(c[w])]);return x}case 3:return l([h,c.toISOString()],c);case 4:{const{source:g,flags:x}=c;return l([h,{source:g,flags:x}],c)}case 5:{const g=[],x=l([h,g],c);for(const[w,b]of c)(r||!ks(bi(w))&&!ks(bi(b)))&&g.push([u(w),u(b)]);return x}case 6:{const g=[],x=l([h,g],c);for(const w of c)(r||!ks(bi(w)))&&g.push(u(w));return x}}const{message:y}=c;return l([h,{name:f,message:y}],c)};return u})(!(e||i),!!e,new Map,s)(r),s},js="function"==typeof structuredClone?(r,e)=>e&&("json"in e||"lossy"in e)?Kt(Cs(r,e)):structuredClone(r):(r,e)=>Kt(Cs(r,e));function _n(r){const e=[];let i=-1,s=0,l=0;for(;++i55295&&u<57344){const h=r.charCodeAt(i+1);u<56320&&h>56319&&h<57344?(c=String.fromCharCode(u,h),l=1):c="\ufffd"}else c=String.fromCharCode(u);c&&(e.push(r.slice(s,i),encodeURIComponent(c)),s=i+l+1,c=""),l&&(i+=l,l=0)}return e.join("")+r.slice(s)}function pa(r,e){const i=[{type:"text",value:"\u21a9"}];return e>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),i}function pc(r,e){return"Back to reference "+(r+1)+(e>1?"-"+e:"")}const ki=function(r){if(null==r)return vn;if("function"==typeof r)return $t(r);if("object"==typeof r)return Array.isArray(r)?function Lr(r){const e=[];let i=-1;for(;++i":"")+")"})}return w;function w(){let C,N,V,b=Wn;if((!e||u(f,y,g[g.length-1]||void 0))&&(b=function dn(r){return Array.isArray(r)?r:"number"==typeof r?[_i,r]:null==r?Wn:[r]}(i(f,g)),b[0]===da))return b;if("children"in f&&f.children){const D=f;if(D.children&&b[0]!==ha)for(N=(s?D.children.length:-1)+c,V=g.concat(D);N>-1&&N1}const Lo=9,Ki=32;function xn(r){const e=String(r),i=/\r?\n|\r/g;let s=i.exec(e),l=0;const u=[];for(;s;)u.push(Ei(e.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=i.exec(e);return u.push(Ei(e.slice(l),l>0,!1)),u.join("")}function Ei(r,e,i){let s=0,l=r.length;if(e){let u=r.codePointAt(s);for(;u===Lo||u===Ki;)s++,u=r.codePointAt(s)}if(i){let u=r.codePointAt(l-1);for(;u===Lo||u===Ki;)l--,u=r.codePointAt(l-1)}return l>s?r.slice(s,l):""}const ai={blockquote:function et(r,e){const i={type:"element",tagName:"blockquote",properties:{},children:r.wrap(r.all(e),!0)};return r.patch(e,i),r.applyData(e,i)},break:function Tn(r,e){const i={type:"element",tagName:"br",properties:{},children:[]};return r.patch(e,i),[r.applyData(e,i),{type:"text",value:"\n"}]},code:function dc(r,e){const i=e.value?e.value+"\n":"",s={};e.lang&&(s.className=["language-"+e.lang]);let l={type:"element",tagName:"code",properties:s,children:[{type:"text",value:i}]};return e.meta&&(l.data={meta:e.meta}),r.patch(e,l),l=r.applyData(e,l),l={type:"element",tagName:"pre",properties:{},children:[l]},r.patch(e,l),l},delete:function hc(r,e){const i={type:"element",tagName:"del",properties:{},children:r.all(e)};return r.patch(e,i),r.applyData(e,i)},emphasis:function fa(r,e){const i={type:"element",tagName:"em",properties:{},children:r.all(e)};return r.patch(e,i),r.applyData(e,i)},footnoteReference:function ga(r,e){const i="string"==typeof r.options.clobberPrefix?r.options.clobberPrefix:"user-content-",s=String(e.identifier).toUpperCase(),l=_n(s.toLowerCase()),u=r.footnoteOrder.indexOf(s);let c,h=r.footnoteCounts.get(s);void 0===h?(h=0,r.footnoteOrder.push(s),c=r.footnoteOrder.length):c=u+1,h+=1,r.footnoteCounts.set(s,h);const f={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+l,id:i+"fnref-"+l+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};r.patch(e,f);const y={type:"element",tagName:"sup",properties:{},children:[f]};return r.patch(e,y),r.applyData(e,y)},heading:function mc(r,e){const i={type:"element",tagName:"h"+e.depth,properties:{},children:r.all(e)};return r.patch(e,i),r.applyData(e,i)},html:function Ao(r,e){if(r.options.allowDangerousHtml){const i={type:"raw",value:e.value};return r.patch(e,i),r.applyData(e,i)}},imageReference:function Nr(r,e){const i=String(e.identifier).toUpperCase(),s=r.definitionById.get(i);if(!s)return ya(r,e);const l={src:_n(s.url||""),alt:e.alt};null!=s.title&&(l.title=s.title);const u={type:"element",tagName:"img",properties:l,children:[]};return r.patch(e,u),r.applyData(e,u)},image:function va(r,e){const i={src:_n(e.url)};null!=e.alt&&(i.alt=e.alt),null!=e.title&&(i.title=e.title);const s={type:"element",tagName:"img",properties:i,children:[]};return r.patch(e,s),r.applyData(e,s)},inlineCode:function td(r,e){const i={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};r.patch(e,i);const s={type:"element",tagName:"code",properties:{},children:[i]};return r.patch(e,s),r.applyData(e,s)},linkReference:function Es(r,e){const i=String(e.identifier).toUpperCase(),s=r.definitionById.get(i);if(!s)return ya(r,e);const l={href:_n(s.url||"")};null!=s.title&&(l.title=s.title);const u={type:"element",tagName:"a",properties:l,children:r.all(e)};return r.patch(e,u),r.applyData(e,u)},link:function Io(r,e){const i={href:_n(e.url)};null!=e.title&&(i.title=e.title);const s={type:"element",tagName:"a",properties:i,children:r.all(e)};return r.patch(e,s),r.applyData(e,s)},listItem:function fc(r,e,i){const s=r.all(e),l=i?function gc(r){let e=!1;if("list"===r.type){e=r.spread||!1;const i=r.children;let s=-1;for(;!e&&++s0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let h=-1;for(;++h0){const c={type:"element",tagName:"tbody",properties:{},children:r.wrap(i,!0)},h=to(e.children[1]),f=Al(e.children[e.children.length-1]);h&&f&&(c.position={start:h,end:f}),l.push(c)}const u={type:"element",tagName:"table",properties:{},children:r.wrap(l,!0)};return r.patch(e,u),r.applyData(e,u)},tableCell:function wa(r,e){const i={type:"element",tagName:"td",properties:{},children:r.all(e)};return r.patch(e,i),r.applyData(e,i)},tableRow:function ba(r,e,i){const s=i?i.children:void 0,u=0===(s?s.indexOf(e):1)?"th":"td",c=i&&"table"===i.type?i.align:void 0,h=c?c.length:e.children.length;let f=-1;const y=[];for(;++f0&&i.push({type:"text",value:"\n"}),i}function ka(r){let e=0,i=r.charCodeAt(e);for(;9===i||32===i;)e++,i=r.charCodeAt(e);return r.slice(e)}function Dr(r,e){const i=ui(r,e),s=i.one(r,void 0),l=function ed(r){const e="string"==typeof r.options.clobberPrefix?r.options.clobberPrefix:"user-content-",i=r.options.footnoteBackContent||pa,s=r.options.footnoteBackLabel||pc,l=r.options.footnoteLabel||"Footnotes",u=r.options.footnoteLabelTagName||"h2",c=r.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let f=-1;for(;++f0&&C.push({type:"text",value:" "});let O="string"==typeof i?i:i(f,b);"string"==typeof O&&(O={type:"text",value:O}),C.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+w+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof s?s:s(f,b),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const V=g[g.length-1];if(V&&"element"===V.type&&"p"===V.tagName){const O=V.children[V.children.length-1];O&&"text"===O.type?O.value+=" ":V.children.push({type:"text",value:" "}),V.children.push(...C)}else g.push(...C);const D={type:"element",tagName:"li",properties:{id:e+"fn-"+w},children:r.wrap(g,!0)};r.patch(y,D),h.push(D)}if(0!==h.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...js(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:r.wrap(h,!0)},{type:"text",value:"\n"}]}}(i),u=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&u.children.push({type:"text",value:"\n"},l),u}function Kn(r,e){return r&&"run"in r?function(){var i=(0,R.A)(function*(s,l){const u=Dr(s,{file:l,...e});yield r.run(u,l)});return function(s,l){return i.apply(this,arguments)}}():function(i,s){return Dr(i,{file:s,...e||r})}}function zr(r){if(r)throw r}var $i=F(6216);function ci(r){if("object"!=typeof r||null===r)return!1;const e=Object.getPrototypeOf(r);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in r||Symbol.iterator in r)}const Ln_basename=function ja(r,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');Qi(r);let u,i=0,s=-1,l=r.length;if(void 0===e||0===e.length||e.length>r.length){for(;l--;)if(47===r.codePointAt(l)){if(u){i=l+1;break}}else s<0&&(u=!0,s=l+1);return s<0?"":r.slice(i,s)}if(e===r)return"";let c=-1,h=e.length-1;for(;l--;)if(47===r.codePointAt(l)){if(u){i=l+1;break}}else c<0&&(u=!0,c=l+1),h>-1&&(r.codePointAt(l)===e.codePointAt(h--)?h<0&&(s=l):(h=-1,s=c));return i===s?s=c:s<0&&(s=r.length),r.slice(i,s)},Ln_dirname=function st(r){if(Qi(r),0===r.length)return".";let s,e=-1,i=r.length;for(;--i;)if(47===r.codePointAt(i)){if(s){e=i;break}}else s||(s=!0);return e<0?47===r.codePointAt(0)?"/":".":1===e&&47===r.codePointAt(0)?"//":r.slice(0,e)},Ln_extname=function Do(r){Qi(r);let c,e=r.length,i=-1,s=0,l=-1,u=0;for(;e--;){const h=r.codePointAt(e);if(47!==h)i<0&&(c=!0,i=e+1),46===h?l<0?l=e:1!==u&&(u=1):l>-1&&(u=-1);else if(c){s=e+1;break}}return l<0||i<0||0===u||1===u&&l===i-1&&l===s+1?"":r.slice(l,i)},Ln_join=function Ea(...r){let i,e=-1;for(;++e2){if(f=i.lastIndexOf("/"),f!==i.length-1){f<0?(i="",s=0):(i=i.slice(0,f),s=i.length-1-i.lastIndexOf("/")),l=c,u=0;continue}}else if(i.length>0){i="",s=0,l=c,u=0;continue}e&&(i=i.length>0?i+"/..":"..",s=2)}else i.length>0?i+="/"+r.slice(l+1,c):i=r.slice(l+1,c),s=c-l-1;l=c,u=0}else 46===h&&u>-1?u++:u=-1}return i}(r,!e);return 0===i.length&&!e&&(i="."),i.length>0&&47===r.codePointAt(r.length-1)&&(i+="/"),e?"/"+i:i}(i)},Ln_sep="/";function Qi(r){if("string"!=typeof r)throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}const Gi_cwd=function ot(){return"/"};function pt(r){return!!(null!==r&&"object"==typeof r&&"href"in r&&r.href&&"protocol"in r&&r.protocol&&void 0===r.auth)}const Yi=["history","path","basename","stem","extname","dirname"];class Rr{constructor(e){let i;i=e?pt(e)?{path:e}:"string"==typeof e||function Ta(r){return!!(r&&"object"==typeof r&&"byteLength"in r&&"byteOffset"in r)}(e)?{value:e}:e:{},this.cwd=Gi_cwd(),this.data={},this.history=[],this.messages=[];let l,s=-1;for(;++sc.length;let f;h&&c.push(l);try{f=r.apply(this,c)}catch(y){if(h&&i)throw y;return l(y)}h||(f&&f.then&&"function"==typeof f.then?f.then(u,l):f instanceof Error?l(f):u(f))};function l(c,...h){i||(i=!0,e(c,...h))}function u(c){l(null,c)}}(g,h)(...y):c(null,...y)}}(null,...l)},use:function s(l){if("function"!=typeof l)throw new TypeError("Expected `middelware` to be a function, not "+l);return r.push(l),e}};return e}()}copy(){const e=new tn;let i=-1;for(;++i0){let[b,...C]=g;const N=s[w][1];ci(N)&&ci(b)&&(b=$i(!0,N,b)),s[w]=[y,b,...C]}}}}const Is=(new tn).freeze();function Ts(r,e){if("function"!=typeof e)throw new TypeError("Cannot `"+r+"` without `parser`")}function Ps(r,e){if("function"!=typeof e)throw new TypeError("Cannot `"+r+"` without `compiler`")}function Fo(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function La(r){if(!ci(r)||"string"!=typeof r.type)throw new TypeError("Expected node, got `"+r+"`")}function Na(r,e,i){if(!i)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function Ls(r){return function wc(r){return!!(r&&"object"==typeof r&&"message"in r&&"messages"in r)}(r)?r:new Rr(r)}const Fr=[],Ma={allowDangerousHtml:!0},Bo=/^(https?|ircs?|mailto|xmpp)$/i,Ho=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Da(r){const e=r.allowedElements,i=r.allowElement,s=r.children||"",l=r.className,u=r.components,c=r.disallowedElements,h=r.rehypePlugins||Fr,f=r.remarkPlugins||Fr,y=r.remarkRehypeOptions?{...r.remarkRehypeOptions,...Ma}:Ma,g=r.skipHtml,x=r.unwrapDisallowed,w=r.urlTransform||za,b=Is().use(Jp).use(f).use(Kn,y).use(h),C=new Rr;"string"==typeof s&&(C.value=s);for(const O of Ho)Object.hasOwn(r,O.from);const N=b.parse(C);let V=b.runSync(N,C);return l&&(V={type:"element",tagName:"div",properties:{className:l},children:"root"===V.type?V.children:[V]}),en(V,function D(O,B,X){if("raw"===O.type&&X&&"number"==typeof B)return g?X.children.splice(B,1):X.children[B]={type:"text",value:O.value},B;if("element"===O.type){let ae;for(ae in us)if(Object.hasOwn(us,ae)&&Object.hasOwn(O.properties,ae)){const H=O.properties[ae],ve=us[ae];(null===ve||ve.includes(O.tagName))&&(O.properties[ae]=w(String(H||""),ae,O))}}if("element"===O.type){let ae=e?!e.includes(O.tagName):!!c&&c.includes(O.tagName);if(!ae&&i&&"number"==typeof B&&(ae=!i(O,B,X)),ae&&X&&"number"==typeof B)return x&&O.children?X.children.splice(B,1,...O.children):X.children.splice(B,1),B}}),function En(r,e){if(!e||void 0===e.Fragment)throw new TypeError("Expected `Fragment` in options");const i=e.filePath||void 0;let s;if(e.development){if("function"!=typeof e.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=function Lu(r,e){return function i(s,l,u,c){const h=Array.isArray(u.children),f=to(s);return e(l,u,c,h,{columnNumber:f?f.column-1:void 0,fileName:r,lineNumber:f?f.line:void 0},void 0)}}(i,e.jsxDEV)}else{if("function"!=typeof e.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof e.jsxs)throw new TypeError("Expected `jsxs` in production options");s=function Ll(r,e,i){return function s(l,u,c,h){const y=Array.isArray(c.children)?i:e;return h?y(u,c,h):y(u,c)}}(0,e.jsx,e.jsxs)}const l={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:s,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:!1!==e.passKeys,passNode:e.passNode||!1,schema:"svg"===e.space?Cl:is,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==e.tableCellAlignToStyle},u=Tu(l,r,void 0);return u&&"string"!=typeof u?u:l.create(r,l.Fragment,{children:u||void 0},void 0)}(V,{Fragment:p.Fragment,components:u,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0})}function za(r){const e=r.indexOf(":"),i=r.indexOf("?"),s=r.indexOf("#"),l=r.indexOf("/");return e<0||l>-1&&e>l||i>-1&&e>i||s>-1&&e>s||Bo.test(r.slice(0,e))?r:""}var Uo=F(1732),ue=F(6763),L=F(3584),I=F(9611),$e=F(7561);class jc extends Z.dL{constructor(){super(...arguments),this.updateParams=e=>{this.plugin.managers.animation.updateParams({[e.name]:e.value})},this.updateCurrentParams=e=>{this.plugin.managers.animation.updateCurrentParams({[e.name]:e.value})},this.startOrStop=()=>{const e=this.plugin.managers.animation;"playing"===e.state.animationState?e.stop():(this.props.onStart&&this.props.onStart(),e.start())}}componentDidMount(){this.subscribe(this.plugin.managers.animation.events.updated,()=>this.forceUpdate())}render(){var e,i;const s=this.plugin.managers.animation;if(s.isEmpty)return null;const l="playing"===s.state.animationState,u=null===(i=(e=s.current.anim).canApply)||void 0===i?void 0:i.call(e,this.plugin);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($e.y1,{params:s.getParams(),values:s.state.params,onChange:this.updateParams,isDisabled:l}),(0,p.jsx)($e.y1,{params:s.current.params,values:s.current.paramValues,onChange:this.updateCurrentParams,isDisabled:l}),(0,p.jsx)("div",{className:"msp-flex-row",children:(0,p.jsx)(L.$n,{icon:"playing"!==s.state.animationState?void 0:I.M6,onClick:this.startOrStop,disabled:void 0!==u&&!1===u.canApply,children:"playing"===s.state.animationState?"Stop":void 0===u||u.canApply?"Start":u.reason||"Start"})})]})}}var Ec=F(1893),Br=F(9039),Ac=F(2277),tt=F(1832),Ee=F(8791),Hr=F(1094),Oa=F(4412);function Ra(r){return(0,mt.p)((e,i)=>r<=i)}class Ii extends Z.jB{constructor(){super(...arguments),this.onChange=({name:e,value:i})=>{const s={...this.props.params,[e]:i};this.props.events.onChange(s,this.areInitial(s),this.validate(s))}}validate(e){}areInitial(e){return Q.t.areEqual(this.props.info.params,e,this.props.info.initialValues)}render(){return(0,p.jsx)($e.y1,{params:this.props.info.params,values:this.props.params,onChange:this.onChange,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled})}}!function(r){function e(l){const u=Object.keys(l);for(const c of u)if(!l[c].isHidden)return!1;return!0}r.infoFromAction=function i(l,u,c,h){const f=u.cells.get(h).obj,y=c.definition.params?c.definition.params(f,l):{};return{initialValues:Q.t.getDefaultValues(y),params:y,isEmpty:e(y)}},r.infoFromTransform=function s(l,u,c){const h=u.cells.get(c.ref),f=h.params&&h.params.definition||{};return{initialValues:h.params&&h.params.values||{},params:f,isEmpty:e(f)}}}(Ii||(Ii={}));class Ns extends Z.jB{constructor(){var e;super(...arguments),e=this,this.busy=new Oa.t(!1),this.onEnter=()=>{this.state.error||this.apply()},this.autoApplyHandle=void 0,this.events={onEnter:this.onEnter,onChange:(i,s,l)=>{this.clearAutoApply(),this.setState({params:i,isInitial:s,error:l&&l[0]},()=>{!s&&!this.state.error&&this.canAutoApply(i)&&(this.clearAutoApply(),this.autoApplyHandle=setTimeout(this.apply,50))})}},this.apply=(0,R.A)(function*(){var i,s;e.clearAutoApply(),e.setState({busy:!0});try{yield e.applyAction()}catch(l){console.error(l)}finally{null===(s=(i=e.props).onApply)||void 0===s||s.call(i),e.busy.next(!1)}}),this.refresh=()=>{this.setState({params:this.getInfo().initialValues,isInitial:!0,error:void 0})},this.setDefault=()=>{const i=this.getInfo(),s=Q.t.getDefaultValues(i.params);this.setState({params:s,isInitial:Q.t.areEqual(i.params,s,i.initialValues),error:void 0})},this.toggleExpanded=()=>{this.setState({isCollapsed:!this.state.isCollapsed})}}clearAutoApply(){void 0!==this.autoApplyHandle&&(clearTimeout(this.autoApplyHandle),this.autoApplyHandle=void 0)}componentDidMount(){this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.busy.value!==e&&this.busy.next(e)}),this.subscribe(this.busy.pipe(Ra(1)),e=>{this.setState({busy:e})})}renderApply(){const e=this.canApply();return!this.props.autoHideApply||e&&!this.canAutoApply(this.state.params)?(0,p.jsxs)("div",{className:"msp-transform-apply-wrap",children:[(0,p.jsx)(L.K0,{svg:I.ij,className:"msp-transform-default-params",onClick:this.setDefault,disabled:this.state.busy,title:"Set default params"}),(0,p.jsx)("div",{className:"msp-transform-apply-wider",children:(0,p.jsx)(L.$n,{icon:e?I.Xq:void 0,className:"msp-btn-commit msp-btn-commit-"+(e?"on":"off"),onClick:this.apply,disabled:!e,children:this.props.applyLabel||this.applyText()})})]}):null}renderDefault(){const e=this.getInfo(),i=e.isEmpty&&this.isUpdate(),s=this.getHeader(),l=this.getTransformerId(),u=this.plugin.customParamEditors.has(l)?this.plugin.customParamEditors.get(l):Ii,c=this.state.isCollapsed?"msp-transform-wrapper msp-transform-wrapper-collapsed":"msp-transform-wrapper";let h=null;if(!i&&!this.state.isCollapsed){const{a:y,b:g,bCell:x}=this.getSourceAndTarget(),w=this.renderApply();h=(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u,{info:e,a:y,b:g,bCell:x,events:this.events,params:this.state.params,isDisabled:this.state.busy}),w]})}const f=(0,p.jsxs)("div",{className:c,style:{marginBottom:this.props.noMargin?0:void 0},children:["none"!==s&&!this.props.wrapInExpander&&(0,p.jsx)("div",{className:"msp-transform-header",children:(0,p.jsxs)(L.$n,{onClick:this.toggleExpanded,title:s.description,children:[!i&&(0,p.jsx)(I.In,{svg:this.state.isCollapsed?I.Cp:I.DM}),s.name]})}),h]});return i||!this.props.wrapInExpander?f:(0,p.jsx)(L.Yj,{header:this.isUpdate()?`Update ${"none"===s?"":s.name}`:`Apply ${"none"===s?"":s.name}`,headerLeftMargin:this.props.expanderHeaderLeftMargin,children:f})}renderSimple(){var e,i,s;const l=this.getInfo(),u=this.canApply(),c=(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.$n,{icon:null===(e=this.props.simpleApply)||void 0===e?void 0:e.icon,title:null===(i=this.props.simpleApply)||void 0===i?void 0:i.title,disabled:this.state.busy||!u,onClick:this.apply,className:"msp-btn-apply-simple",children:null===(s=this.props.simpleApply)||void 0===s?void 0:s.header}),!l.isEmpty&&(0,p.jsx)(L.ff,{icon:I.Hk,label:"",title:"Options",toggle:this.toggleExpanded,isSelected:!this.state.isCollapsed,disabled:this.state.busy,style:{flex:"0 0 40px",padding:0}})]});if(this.state.isCollapsed)return c;const h=this.getTransformerId(),f=this.plugin.customParamEditors.has(h)?this.plugin.customParamEditors.get(h):Ii,{a:y,b:g,bCell:x}=this.getSourceAndTarget();return(0,p.jsxs)(p.Fragment,{children:[c,(0,p.jsx)(f,{info:l,a:y,b:g,bCell:x,events:this.events,params:this.state.params,isDisabled:this.state.busy})]})}render(){return this.props.simpleApply?this.renderSimple():this.renderDefault()}}class pi extends Ns{constructor(){super(...arguments),this._getInfo=(0,Hr._)(e=>Ii.infoFromTransform(this.plugin,this.props.state,e)),this.state={error:void 0,isInitial:!0,params:this.getInfo().initialValues,busy:!1,isCollapsed:this.props.initiallyCollapsed}}applyAction(){return this.props.customUpdate?this.props.customUpdate(this.state.params):this.plugin.state.updateTransform(this.props.state,this.props.transform.ref,this.state.params)}getInfo(){return this._getInfo(this.props.transform)}getTransformerId(){return this.props.transform.transformer.id}getHeader(){return this.props.customHeader||this.props.transform.transformer.definition.display}canApply(){const{state:e}=this.props,i=e.cells.get(this.props.transform.ref);if(!i)return!1;if("error"===i.status){const s=e.cells.get(this.props.transform.parent);return!!s&&"ok"===s.status}return!this.state.error&&!this.state.busy&&!this.state.isInitial}applyText(){return this.canApply()?"Update":"Nothing to Update"}isUpdate(){return!0}getSourceAndTarget(){const e=this.props.state.cells.get(this.props.transform.ref);return{a:this.props.state.cells.get(this.props.transform.parent).obj,b:e?.obj,bCell:e}}canAutoApply(e){const i=this.props.transform.transformer.definition.canAutoUpdate;if(!i)return!1;const{state:s}=this.props,l=s.cells.get(this.props.transform.ref);return!(!l||!l.sourceRef||"ok"!==l.status)&&i({a:s.cells.get(l.sourceRef).obj,b:l.obj,oldParams:this.getInfo().initialValues,newParams:e},this.plugin)}componentDidMount(){super.componentDidMount(),this.props.toggleCollapsed&&this.subscribe(this.props.toggleCollapsed,()=>this.setState({isCollapsed:!this.state.isCollapsed})),this.subscribe(this.plugin.state.events.object.updated,({ref:e,state:i})=>{this.props.transform.ref!==e||this.props.state!==i||this.state.params!==this.props.transform.params&&(this._getInfo=(0,Hr._)(s=>Ii.infoFromTransform(this.plugin,this.props.state,s)),this.setState({params:this.props.transform.params,isInitial:!0}))})}componentDidUpdate(e){var i;if(this.props.transform!==e.transform){const s=this.props.state.cells.get(this.props.transform.ref);this.setState({params:(null===(i=s.params)||void 0===i?void 0:i.values)||{},isInitial:!0,error:void 0,simpleOnly:this.state.simpleOnly})}}}class nd extends Z.jB{get current(){return this.plugin.managers.structure.hierarchy.behaviors.selection}componentDidMount(){this.subscribe(this.current,()=>this.forceUpdate())}get unitcell(){var e;const{selection:i}=this.plugin.managers.structure.hierarchy;if(0===i.structures.length)return null;const s=[];for(const l of i.structures){const u=l.model;u?.unitcell&&null!==(e=u.unitcell)&&void 0!==e&&e.cell.obj&&s.push(u.unitcell)}return 0===s.length?null:(0,p.jsx)(bn,{refs:s,labelMultiple:"Unit Cells"})}get customControls(){const e=[];return this.plugin.genericRepresentationControls.forEach((i,s)=>{const[l,u]=i(this.plugin.managers.structure.hierarchy.selection);l.length>0&&e.push((0,p.jsx)("div",{children:(0,p.jsx)(bn,{refs:l,labelMultiple:u})},s))}),e.length>0?e:null}render(){return(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("div",{style:{marginTop:"6px"},children:[this.unitcell,this.customControls]})})}}class bn extends Z.jB{constructor(){super(...arguments),this.state={showOptions:!1},this.toggleVisibility=e=>{e.preventDefault(),this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.refs),e.currentTarget.blur()},this.highlight=e=>{e.preventDefault(),this.pivot.cell.parent&&ue.a.Interactivity.Object.Highlight(this.plugin,{state:this.pivot.cell.parent,ref:this.props.refs.map(i=>i.cell.transform.ref)})},this.clearHighlight=e=>{e.preventDefault(),ue.a.Interactivity.ClearHighlights(this.plugin)},this.focus=e=>{var i;e.preventDefault();let s=!0;for(const u of this.props.refs)if(!u.cell.state.isHidden){s=!1;break}s&&this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.refs,"show");const l=[];for(const u of this.props.refs){if(u.cell.state.isHidden)continue;const c=null===(i=u.cell.obj)||void 0===i?void 0:i.data.repr.getLoci();c&&l.push(c)}this.plugin.managers.camera.focusLoci(l)},this.toggleOptions=()=>this.setState({showOptions:!this.state.showOptions})}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,e=>{var i;tt.Uw.ObjectEvent.isCell(e,null===(i=this.pivot)||void 0===i?void 0:i.cell)&&this.forceUpdate()})}get pivot(){return this.props.refs[0]}render(){const{refs:e,labelMultiple:i}=this.props;if(0===e.length)return null;const s=e[0];let l,u;if(1===e.length){const{obj:c}=s.cell;if(!c)return null;l=c?.label,u=c?.description}else l=`${e.length} ${i||"Objects"}`;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsxs)("button",{className:"msp-form-control msp-control-button-label",title:`${l}. Click to focus.`,onClick:this.focus,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlign:"left"},children:[l," ",(0,p.jsx)("small",{children:u})]}),(0,p.jsx)(L.K0,{svg:s.cell.state.isHidden?I.qF:I.zs,toggleState:!1,className:"msp-form-control",onClick:this.toggleVisibility,title:s.cell.state.isHidden?"Show":"Hide",small:!0,flex:!0}),1===e.length&&(0,p.jsx)(L.K0,{svg:I.cv,className:"msp-form-control",onClick:this.toggleOptions,title:"Options",toggleState:this.state.showOptions,flex:!0})]}),1===e.length&&this.state.showOptions&&s.cell.parent&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"msp-control-offset",children:(0,p.jsx)(pi,{state:s.cell.parent,transform:s.cell.transform,customHeader:"none",autoHideApply:!0})})})]})}}class Fa extends Z.VK{defaultState(){return{header:"Components",isCollapsed:!1,isDisabled:!1,brand:{accent:"blue",svg:I.c3}}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,e=>this.setState({description:Ac.G.getSelectedStructuresDescription(this.plugin)}))}renderControls(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Vo,{}),(0,p.jsx)(Tc,{}),(0,p.jsx)(nd,{})]})}}class Vo extends Z.jB{constructor(){super(...arguments),this.state={isEmpty:!0,isBusy:!1,canUndo:!1},this.togglePreset=this.toggleAction("preset"),this.toggleAdd=this.toggleAction("add"),this.toggleOptions=this.toggleAction("options"),this.hideAction=()=>this.setState({action:void 0}),this.applyPreset=e=>{if(this.hideAction(),!e)return;const i=this.plugin.managers.structure,{structures:s}=i.hierarchy.selection;null===e.value?i.component.clear(s):i.component.applyPreset(s,e.value)},this.undo=()=>{const e=this.plugin.state.data.undo();e&&this.plugin.runTask(e)}}get isDisabled(){return this.state.isBusy||this.state.isEmpty}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,e=>this.setState({action:"options"!==this.state.action||0===e.structures.length?void 0:"options",isEmpty:0===e.structures.length})),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e,action:"options"!==this.state.action?void 0:"options"})}),this.subscribe(this.plugin.state.data.events.historyUpdated,({state:e})=>{this.setState({canUndo:e.canUndo})})}toggleAction(e){return()=>this.setState({action:this.state.action===e?void 0:e})}get presetControls(){return(0,p.jsx)(Ee.W,{items:this.presetActions,onSelect:this.applyPreset})}get presetActions(){const e=this.plugin.managers.structure.component.pivotStructure,i=this.plugin.builders.structure.representation.getPresets(e?.cell.obj);return Ee.W.createItems(i,{label:s=>s.display.name,category:s=>s.display.group,description:s=>s.display.description})}render(){const e=this.state.canUndo?`Undo ${this.plugin.state.data.latestUndoLabel}`:"Some mistakes of the past can be undone.";return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.ff,{icon:I.sM,label:"Preset",title:"Apply a representation preset for the current structure(s).",toggle:this.togglePreset,isSelected:"preset"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.CR,label:"Add",title:"Add a new representation component for a selection.",toggle:this.toggleAdd,isSelected:"add"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.Hk,label:"",title:"Options that are applied to all applicable representations.",style:{flex:"0 0 40px",padding:0},toggle:this.toggleOptions,isSelected:"options"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.K0,{svg:I.L3,className:"msp-flex-item",flex:"40px",onClick:this.undo,disabled:!this.state.canUndo||this.isDisabled,title:e})]}),"preset"===this.state.action&&this.presetControls,"add"===this.state.action&&(0,p.jsx)("div",{className:"msp-control-offset",children:(0,p.jsx)(Ba,{onApply:this.hideAction})}),"options"===this.state.action&&(0,p.jsx)("div",{className:"msp-control-offset",children:(0,p.jsx)(Ic,{isDisabled:this.isDisabled})})]})}}class Ba extends Z.jB{constructor(){super(...arguments),this.state=this.createState(),this.apply=()=>{const e=this.props.forSelection?this.currentStructures:this.selectedStructures;this.props.onApply(),this.plugin.managers.structure.component.add(this.state.values,e)},this.paramsChanged=e=>this.setState({values:e})}createState(){const e=Br.C.getAddParams(this.plugin);return{params:e,values:Q.t.getDefaultValues(e)}}get selectedStructures(){return this.plugin.managers.structure.component.currentStructures}get currentStructures(){return this.plugin.managers.structure.hierarchy.current.structures}render(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($e.y1,{params:this.state.params,values:this.state.values,onChangeValues:this.paramsChanged}),(0,p.jsx)(L.$n,{icon:I.CR,title:"Use Selection and optional Representation to create a new Component.",className:"msp-btn-commit msp-btn-commit-on",onClick:this.apply,style:{marginTop:"1px"},children:"Create Component"})]})}}class Ic extends Z.jB{constructor(){super(...arguments),this.update=e=>this.plugin.managers.structure.component.setOptions(e)}componentDidMount(){this.subscribe(this.plugin.managers.structure.component.events.optionsUpdated,()=>this.forceUpdate())}render(){return(0,p.jsx)($e.y1,{params:Br.C.OptionsParams,values:this.plugin.managers.structure.component.state.options,onChangeValues:this.update,isDisabled:this.props.isDisabled})}}class Tc extends Z.jB{componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,()=>{this.forceUpdate()})}render(){const e=this.plugin.managers.structure.hierarchy.currentComponentGroups;return 0===e.length?null:(0,p.jsx)("div",{style:{marginTop:"6px"},children:e.map(i=>(0,p.jsx)(Ha,{group:i},i[0].cell.transform.ref))})}}class Ha extends Z.jB{constructor(){super(...arguments),this.state={action:void 0},this.toggleVisible=e=>{e.preventDefault(),e.currentTarget.blur(),this.plugin.managers.structure.component.toggleVisibility(this.props.group)},this.selectAction=e=>{e&&(0,e?.value)()},this.remove=()=>this.plugin.managers.structure.hierarchy.remove(this.props.group,!0),this.toggleAction=()=>this.setState({action:"action"===this.state.action?void 0:"action"}),this.toggleLabel=()=>this.setState({action:"label"===this.state.action?void 0:"label"}),this.highlight=e=>{e.preventDefault(),this.props.group[0].cell.parent&&ue.a.Interactivity.Object.Highlight(this.plugin,{state:this.props.group[0].cell.parent,ref:this.props.group.map(i=>i.cell.transform.ref)})},this.clearHighlight=e=>{e.preventDefault(),ue.a.Interactivity.ClearHighlights(this.plugin)},this.focus=()=>{let e=!0;for(const i of this.props.group)if(!i.cell.state.isHidden){e=!1;break}e&&this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.group,"show"),this.plugin.managers.camera.focusSpheres(this.props.group,i=>{var s;if(!i.cell.state.isHidden)return null===(s=i.cell.obj)||void 0===s?void 0:s.data.boundary.sphere})},this.updateLabel=e=>{this.plugin.managers.structure.component.updateLabel(this.pivot,e)}}get pivot(){return this.props.group[0]}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,e=>{tt.Uw.ObjectEvent.isCell(e,this.pivot.cell)&&this.forceUpdate()})}get colorByActions(){var e,i;const s=this.plugin.managers.structure.component,u=null===(e=this.pivot.representations[0].cell.transform.params)||void 0===e?void 0:e.colorTheme.name,c=(0,Ec.A8)(this.plugin,null===(i=this.pivot.cell.obj)||void 0===i?void 0:i.data);return Ee.W.createItemsFromSelectOptions(c,{value:h=>()=>s.updateRepresentationsTheme(this.props.group,{color:h[0]}),selected:h=>h[0]===u})}get actions(){const e=this.plugin.managers.structure.component,i=[[Ee.W.Header("Add Representation"),...Br.C.getRepresentationTypes(this.plugin,this.props.group[0]).map(s=>Ee.W.Item(s[1],()=>e.addRepresentation(this.props.group,s[0])))]];return this.pivot.representations.length>0&&i.push([Ee.W.Header("Set Coloring",{isIndependent:!0}),...this.colorByActions]),e.canBeModified(this.props.group[0])&&i.push([Ee.W.Header("Modify by Selection"),Ee.W.Item("Include",()=>e.modifyByCurrentSelection(this.props.group,"union"),{icon:I.QM}),Ee.W.Item("Subtract",()=>e.modifyByCurrentSelection(this.props.group,"subtract"),{icon:I.tk}),Ee.W.Item("Intersect",()=>e.modifyByCurrentSelection(this.props.group,"intersect"),{icon:I.sx})]),i.push(Ee.W.Item("Select This",()=>e.selectThis(this.props.group),{icon:I.B7})),e.canBeModified(this.props.group[0])&&i.push(Ee.W.Item("Edit Label",this.toggleLabel)),i}get reprLabel(){var e;const i=this.pivot;return 0===i.representations.length?"No repr.":1===i.representations.length?null===(e=i.representations[0].cell.obj)||void 0===e?void 0:e.label:`${i.representations.length} reprs`}render(){var e;const i=this.pivot,s=i.cell,l=null===(e=s.obj)||void 0===e?void 0:e.label;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsxs)(L.$n,{noOverflow:!0,className:"msp-control-button-label",title:`${l}. Click to focus.`,onClick:this.focus,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlign:"left"},children:[l,(0,p.jsx)("small",{className:"msp-25-lower-contrast-text",style:{float:"right"},children:this.reprLabel})]}),(0,p.jsx)(L.K0,{svg:s.state.isHidden?I.qF:I.zs,toggleState:!1,onClick:this.toggleVisible,title:(s.state.isHidden?"Show":"Hide")+" component",small:!0,className:"msp-form-control",flex:!0}),(0,p.jsx)(L.K0,{svg:I.mf,toggleState:!1,onClick:this.remove,title:"Remove",small:!0,className:"msp-form-control",flex:!0}),(0,p.jsx)(L.K0,{svg:I.cv,onClick:this.toggleAction,title:"Actions",toggleState:"action"===this.state.action,className:"msp-form-control",flex:!0})]}),"label"===this.state.action&&(0,p.jsx)("div",{className:"msp-control-offset",style:{marginBottom:"6px"},children:(0,p.jsx)(L.eJ,{label:"Label",control:(0,p.jsxs)("div",{style:{display:"flex",textAlignLast:"center"},children:[(0,p.jsx)(L.ks,{onChange:this.updateLabel,value:l,style:{flex:"1 1 auto",minWidth:0},className:"msp-form-control",blurOnEnter:!0,blurOnEscape:!0}),(0,p.jsx)(L.K0,{svg:I.Xq,onClick:this.toggleLabel,className:"msp-form-control msp-control-button-label",flex:!0})]})})}),"action"===this.state.action&&(0,p.jsxs)("div",{className:"msp-accent-offset",children:[(0,p.jsx)("div",{style:{marginBottom:"6px"},children:(0,p.jsx)(Ee.W,{items:this.actions,onSelect:this.selectAction,noOffset:!0})}),(0,p.jsx)("div",{style:{marginBottom:"6px"},children:i.representations.map(c=>(0,p.jsx)(Ur,{group:this.props.group,representation:c},c.cell.transform.ref))})]})]})}}class Ur extends Z.jB{constructor(){super(...arguments),this.remove=()=>this.plugin.managers.structure.component.removeRepresentations(this.props.group,this.props.representation),this.toggleVisible=e=>{e.preventDefault(),e.currentTarget.blur(),this.plugin.managers.structure.component.toggleVisibility(this.props.group,this.props.representation)},this.update=e=>this.plugin.managers.structure.component.updateRepresentations(this.props.group,this.props.representation,e)}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,e=>{tt.Uw.ObjectEvent.isCell(e,this.props.representation.cell)&&this.forceUpdate()})}render(){var e;const i=this.props.representation.cell;return(0,p.jsxs)("div",{className:"msp-representation-entry",children:[i.parent&&(0,p.jsx)(L.Yj,{header:`${(null===(e=i.obj)||void 0===e?void 0:e.label)||""} Representation`,noOffset:!0,children:(0,p.jsx)(pi,{state:i.parent,transform:i.transform,customHeader:"none",customUpdate:this.update,noMargin:!0})}),(0,p.jsx)(L.K0,{svg:I.mf,onClick:this.remove,title:"Remove",small:!0,className:"msp-default-bg",toggleState:!1,style:{position:"absolute",top:0,right:"32px",lineHeight:"24px",height:"24px",textAlign:"right",width:"44px",paddingRight:"6px",background:"none"}}),(0,p.jsx)(L.K0,{svg:this.props.representation.cell.state.isHidden?I.qF:I.zs,toggleState:!1,onClick:this.toggleVisible,title:"Toggle Visibility",small:!0,className:"msp-default-bg",style:{position:"absolute",top:0,right:0,lineHeight:"24px",height:"24px",textAlign:"right",width:"32px",paddingRight:"6px",background:"none"}})]})}}var qo=F(3246),Ua=F(5995),Bt=F(237),Nn=F(3917),Zi=F(9096),Pc=F(4986),Va=F(7232),qa=F(9677);function Dc(r,e){if("atom-id"===e){const i=function Mc(r){return r.split(",").map(e=>e.trim().split(/\s+|[-]/g).filter(i=>!!i)).filter(e=>1===e.length||2===e.length).map(e=>1===e.length?[+e[0],+e[0]]:[+e[0],+e[1]])}(r);return function nn(r){const e=qa.th.create();for(const[s,l]of r)for(let u=s;u<=l;u++)qa.th.add(e,u,u);const i=De.J.struct.generator.atomGroups({"atom-test":De.J.core.set.has([De.J.set(...e.array),De.J.ammp("id")])});return(0,Va.wE)(i)}(i)}return function id(r,e){var i;const s=[],l="auth"===e?"auth_asym_id":"label_asym_id",u="auth"===e?"auth_seq_id":"label_seq_id";for(const h of r)if("range"===h.kind)s.push(De.J.struct.generator.atomGroups({"chain-test":De.J.core.rel.eq([De.J.ammp(l),h.asym_id]),"residue-test":De.J.core.rel.inRange([De.J.ammp(u),h.seq_id_beg,h.seq_id_end])}));else{const f=(null!==(i=h.ins_code)&&void 0!==i?i:"").trim();s.push(De.J.struct.generator.atomGroups({"chain-test":De.J.core.rel.eq([De.J.ammp(l),h.asym_id]),"residue-test":De.J.core.logic.and([De.J.core.rel.eq([De.J.ammp(u),h.seq_id]),De.J.core.rel.eq([De.J.ammp("pdbx_PDB_ins_code"),f])])}))}const c=De.J.struct.combinator.merge(s);return(0,Va.wE)(c)}(function Nc(r){return r.split(",").map(e=>e.trim().split(/\s+|[-]/g).filter(i=>!!i)).map(e=>function Qt(r,e,i){if(r&&0!==e.length&&!Number.isNaN(+e[0]))return Number.isNaN(i)?{kind:"single",asym_id:r,seq_id:+e[0],ins_code:e[1]}:{kind:"range",asym_id:r,seq_id_beg:+e[0],seq_id_end:i}}(e[0],function Lc(r){return r?r.split(":"):[]}(e[1]),+e[2])).filter(e=>!!e)}(r),e)}var Xi=F(7785),di=F(4123),Ms=F(1937);class _o extends he.PureComponent{getBindingComponents(){const e=function _a(r){return Object.keys(r).map(e=>[e,r[e]]).filter(e=>di.O.isBinding(e[1]))}(this.props.bindings);return(0,p.jsx)(p.Fragment,{children:e.map(i=>{const[s,l]=i;return di.O.isEmpty(l)?null:(0,p.jsxs)("div",{style:{marginBottom:"6px"},children:[(0,p.jsx)("b",{children:l.action}),(0,p.jsx)("br",{}),(0,p.jsx)("span",{dangerouslySetInnerHTML:{__html:di.O.format(l,s)}})]},s)})})}render(){return(0,p.jsx)(Mn,{children:this.getBindingComponents()})}}class Mn extends he.PureComponent{render(){return(0,p.jsx)("div",{className:"msp-help-text",children:(0,p.jsx)("div",{children:this.props.children})})}}class wn extends he.PureComponent{constructor(){super(...arguments),this.state={header:this.props.header,isExpanded:!!this.props.initiallyExpanded},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){return(0,p.jsxs)("div",{className:"msp-control-group-wrapper",children:[(0,p.jsx)("div",{className:"msp-control-group-header",children:(0,p.jsxs)(L.$n,{onClick:this.toggleExpanded,children:[(0,p.jsx)(I.In,{svg:this.state.isExpanded?I.DM:I.Cp}),this.props.header]})}),this.state.isExpanded&&(0,p.jsx)("div",{className:"msp-control-offset",style:{display:this.state.isExpanded?"block":"none"},children:this.props.children})]})}}function Ds(r){return(0,p.jsx)("div",{className:"msp-simple-help-section",children:r.header})}class Wo extends Z.dL{constructor(){super(...arguments),this.getInteractionBindings=(0,Hr._)(e=>{let i;return e.forEach(s=>{var l;const u=null===(l=s.params)||void 0===l?void 0:l.values;u?.bindings&&Object.keys(u.bindings).length>0&&(i||(i={}),Object.assign(i,u.bindings))}),i})}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate())}render(){const e=this.getInteractionBindings(this.plugin.state.behaviors.cells);return(0,p.jsxs)(p.Fragment,{children:[!this.props.selectOnly&&this.plugin.canvas3d&&(0,p.jsx)(wn,{header:"Moving in 3D",children:(0,p.jsx)(_o,{bindings:this.plugin.canvas3d.props.trackball.bindings})},"trackball"),!!e&&(0,p.jsx)(wn,{header:"Mouse & Key Controls",children:(0,p.jsx)(_o,{bindings:e})},"interactions")]})}}class Wa extends Z.dL{componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate())}formatTriggers(e){return e.triggers.map(i=>di.O.Trigger.format(i)).join(" or ")}getTriggerFor(e,i){const l=this.plugin.state.behaviors.select(tt.QX.Generators.ofTransformer(e)),u=1===l.length?l[0].params:void 0,c=u?u.values.bindings:{};return this.formatTriggers(i in c?c[i]:di.O.Empty)}render(){const e=this.getTriggerFor(Ms.SelectLoci,"clickSelectToggle"),i=this.getTriggerFor(Ms.FocusLoci,"clickFocus");return(0,p.jsxs)("div",{children:[(0,p.jsx)(Ds,{header:"Interface Controls"}),(0,p.jsxs)(wn,{header:"Inline Help",children:[(0,p.jsx)(Mn,{children:"Many user interface elements show a little questionmark icon when hovered over. Clicking the icon toggles the display of an inline help text."}),(0,p.jsx)(Mn,{children:"Tooltips may provide additional information on a user interface element and are shown when hovering over it with the mouse."})]}),(0,p.jsx)(wn,{header:"Selections",children:(0,p.jsxs)(Mn,{children:["The viewer allows changing colors and representations for selections of atoms, residues or chains. Selections can be created by",(0,p.jsxs)("ul",{style:{paddingLeft:"20px"},children:[(0,p.jsxs)("li",{children:["picking elements on the 3D canvas or the sequence view using the mouse, e.g. toggle selection using ",e," (for more see help section on ",(0,p.jsx)("i",{children:"Mouse Controls"}),")"]}),(0,p.jsxs)("li",{children:["using the ",(0,p.jsx)("i",{children:"Add"}),", ",(0,p.jsx)("i",{children:"Remove"})," and ",(0,p.jsx)("i",{children:"Only"})," dropdown buttons in the ",(0,p.jsx)("i",{children:"Manage Selection"})," panel which allow modifing the current selection by predefined sets"]})]})]})}),(0,p.jsx)(wn,{header:"Coloring",children:(0,p.jsxs)(Mn,{children:["There are two ways to color structures. Every representation (e.g. cartoon or spacefill) has a color theme which can be changed using the dropdown for each representation in the ",(0,p.jsx)("i",{children:"Structure Settings"})," panel. Additionally any selection atoms, residues or chains can by given a custom color. For that, first select the parts of the structure to be colored (see help section on ",(0,p.jsx)("i",{children:"Selections"}),") and, second, choose a color from the color dropdown botton in the ",(0,p.jsx)("i",{children:"Selection"})," row of the ",(0,p.jsx)("i",{children:"Change Representation"})," panel. The theme color can be seen as a base color that is overpainted by the custom color. Custom colors can be removed for a selection with the 'Clear' option in the color dropdown."]})}),(0,p.jsx)(wn,{header:"Representations",children:(0,p.jsxs)(Mn,{children:["Structures can be shown with many different representations (e.g. cartoon or spacefill). The ",(0,p.jsx)("i",{children:"Change Representation"})," panel offers a collection of predefined styles which can be applied using the ",(0,p.jsx)("i",{children:"Preset"})," dropdown button. Additionally any selection atoms, residues or chains can by shown with a custom representation. For that, first select the parts of the structure to be mofified (see help section on ",(0,p.jsx)("i",{children:"Selections"}),") and, second, choose a representation to hide or show from the ",(0,p.jsx)("i",{children:"Show"})," and ",(0,p.jsx)("i",{children:"Hide"})," dropdown bottons in the ",(0,p.jsx)("i",{children:"Selection"})," row of the ",(0,p.jsx)("i",{children:"Change Representation"})," panel. The ",(0,p.jsx)("i",{children:"Everything"})," row applies the action to the whole structure instead of the current selection."]})}),(0,p.jsx)(wn,{header:"Surroundings",children:(0,p.jsxs)(Mn,{children:["To show the surroundings of a residue or ligand, click it in the 3D scene or in the sequence widget using ",i,"."]})}),(0,p.jsx)(Ds,{header:"How-to Guides"}),(0,p.jsx)(wn,{header:"Create an Image",children:(0,p.jsxs)(Mn,{children:[(0,p.jsxs)("p",{children:["Use the ",(0,p.jsx)(I.In,{svg:I.OY})," icon in the viewport to bring up the screenshot controls."]}),(0,p.jsxs)("p",{children:["To adjust the size of the image, use the ",(0,p.jsx)("i",{children:"Resolution"})," dropdown."]})]})}),(0,p.jsx)(Ds,{header:"Mouse Controls"}),(0,p.jsx)(Wo,{})]})}}class Vr extends Z.jB{constructor(){super(...arguments),this._toggleSelMode=()=>{this.plugin.selectionMode=!this.plugin.selectionMode}}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.layout.events.updated,()=>this.forceUpdate()),this.subscribe(this.plugin.behaviors.interaction.selectionMode,()=>this.forceUpdate())}render(){return(0,p.jsx)(L.K0,{svg:I.yG,onClick:this._toggleSelMode,title:"Toggle Selection Mode",style:this.props.inline?{background:"transparent",width:"auto",height:"auto",lineHeight:"unset"}:{background:"transparent"},toggleState:this.plugin.selectionMode})}}const rd={granularity:Pc.d.Params.granularity},Ji=new Map([["add","Add/Union Selection"],["remove","Remove/Subtract Selection"],["intersect","Intersect Selection"],["set","Set Selection"]]);class Ka extends Z.dL{constructor(){super(...arguments),this.state={action:void 0,helper:void 0,isEmpty:!0,isBusy:!1,canUndo:!1},this.set=(e,i)=>{this.plugin.managers.structure.selection.fromSelectionQuery(e,i,!1)},this.selectQuery=(e,i)=>{if(!e||!this.state.action)return void this.setState({action:void 0});const s=this.state.action;i?.shiftKey?this.set(s,e.value):this.setState({action:void 0},()=>{this.set(s,e.value)})},this.selectHelper=(e,i)=>{console.log(e),this.setState(e&&this.state.action?{helper:e.value.kind}:{action:void 0,helper:void 0})},this.queriesItems=[],this.queriesVersion=-1,this.helpersItems=void 0,this.toggleAdd=this.showAction("add"),this.toggleRemove=this.showAction("remove"),this.toggleIntersect=this.showAction("intersect"),this.toggleSet=this.showAction("set"),this.toggleTheme=this.showAction("theme"),this.toggleAddComponent=this.showAction("add-component"),this.toggleHelp=this.showAction("help"),this.setGranuality=({value:e})=>{this.plugin.managers.interactivity.setProps({granularity:e})},this.turnOff=()=>this.plugin.selectionMode=!1,this.undo=()=>{const e=this.plugin.state.data.undo();e&&this.plugin.runTask(e)},this.subtract=()=>{const e=this.plugin.managers.structure.hierarchy.getStructuresWithSelection(),i=[];for(const s of e)i.push(...s.components);0!==i.length&&this.plugin.managers.structure.component.modifyByCurrentSelection(i,"subtract")}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,e=>{const i=0===e.hierarchy.structures.length;this.state.isEmpty!==i&&this.setState({isEmpty:i}),this.queriesVersion=-1,this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e,action:void 0})}),this.subscribe(this.plugin.managers.interactivity.events.propsUpdated,()=>{this.forceUpdate()}),this.subscribe(this.plugin.state.data.events.historyUpdated,({state:e})=>{this.setState({canUndo:e.canUndo})})}get isDisabled(){return this.state.isBusy||this.state.isEmpty}get structures(){var e;const i=[];for(const s of this.plugin.managers.structure.hierarchy.selection.structures){const l=null===(e=s.cell.obj)||void 0===e?void 0:e.data;l&&i.push(l)}return i}get queries(){const{registry:e}=this.plugin.query.structure;if(e.version!==this.queriesVersion){const i=this.structures,s=[...e.list,...(0,Zi.Ag)(i),...(0,Zi.Mt)(i),...(0,Zi.HU)(i)].sort((l,u)=>u.priority-l.priority);this.queriesItems=Ee.W.createItems(s,{filter:l=>l!==Zi.Ou.current&&!l.isHidden,label:l=>l.label,category:l=>l.category,description:l=>l.description}),this.queriesVersion=e.version}return this.queriesItems}get helpers(){return this.helpersItems||(this.helpersItems=Ee.W.createItems([{kind:"residue-list",category:"Helpers",label:"Atom/Residue Identifier List",description:"Create a selection from a list of atom/residue ranges."}],{label:i=>i.label,category:i=>i.category,description:i=>i.description})),this.helpersItems}showAction(e){return()=>this.setState({action:this.state.action===e?void 0:e,helper:void 0})}render(){const e=this.plugin.managers.interactivity.props.granularity,i=this.state.canUndo?`Undo ${this.plugin.state.data.latestUndoLabel}`:"Some mistakes of the past can be undone.";let s;if(this.state.action&&!this.state.helper)s=(0,p.jsxs)(p.Fragment,{children:[this.state.action&&"theme"!==this.state.action&&"add-component"!==this.state.action&&"help"!==this.state.action&&(0,p.jsxs)("div",{className:"msp-selection-viewport-controls-actions",children:[(0,p.jsx)(Ee.W,{header:Ji.get(this.state.action),title:"Click to close.",items:this.queries,onSelect:this.selectQuery,noOffset:!0}),(0,p.jsx)(Ee.W,{items:this.helpers,onSelect:this.selectHelper,noOffset:!0})]}),"theme"===this.state.action&&(0,p.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,p.jsx)(L.tW,{header:"Theme",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleTheme,topRightIcon:I.X6,children:(0,p.jsx)(Ko,{onApply:this.toggleTheme})})}),"add-component"===this.state.action&&(0,p.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,p.jsx)(L.tW,{header:"Add Component",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleAddComponent,topRightIcon:I.X6,children:(0,p.jsx)(Ba,{onApply:this.toggleAddComponent,forSelection:!0})})}),"help"===this.state.action&&(0,p.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,p.jsxs)(L.tW,{header:"Help",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleHelp,topRightIcon:I.X6,maxHeight:"300px",children:[(0,p.jsx)(wn,{header:"Selection Operations",children:(0,p.jsxs)(Mn,{children:["Use ",(0,p.jsx)(I.In,{svg:I.QM,inline:!0})," ",(0,p.jsx)(I.In,{svg:I.tk,inline:!0})," ",(0,p.jsx)(I.In,{svg:I.sx,inline:!0})," ",(0,p.jsx)(I.In,{svg:I.B7,inline:!0})," to modify the selection."]})}),(0,p.jsx)(wn,{header:"Representation Operations",children:(0,p.jsxs)(Mn,{children:["Use ",(0,p.jsx)(I.In,{svg:I.fe,inline:!0})," ",(0,p.jsx)(I.In,{svg:I.c3,inline:!0})," ",(0,p.jsx)(I.In,{svg:I.$j,inline:!0})," ",(0,p.jsx)(I.In,{svg:I.L3,inline:!0})," to color, create components, remove from components, or undo actions."]})}),(0,p.jsx)(Wo,{selectOnly:!0})]})})]});else if(Ji.has(this.state.action)&&"residue-list"===this.state.helper){const l=()=>this.setState({action:void 0,helper:void 0});s=(0,p.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,p.jsx)(L.tW,{header:"Atom/Residue Identifier List",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:l,topRightIcon:I.X6,children:(0,p.jsx)(Oc,{modifier:this.state.action,plugin:this.plugin,close:l})})})}return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",style:{background:"none"},children:[(0,p.jsx)($e.UT,{title:"Picking Level for selecting and highlighting",param:rd.granularity,name:"granularity",value:e,onChange:this.setGranuality,isDisabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.QM,title:`${Ji.get("add")}. Hold shift key to keep menu open.`,toggle:this.toggleAdd,isSelected:"add"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.tk,title:`${Ji.get("remove")}. Hold shift key to keep menu open.`,toggle:this.toggleRemove,isSelected:"remove"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.sx,title:`${Ji.get("intersect")}. Hold shift key to keep menu open.`,toggle:this.toggleIntersect,isSelected:"intersect"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.B7,title:`${Ji.get("set")}. Hold shift key to keep menu open.`,toggle:this.toggleSet,isSelected:"set"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.fe,title:"Apply Theme to Selection",toggle:this.toggleTheme,isSelected:"theme"===this.state.action,disabled:this.isDisabled,style:{marginLeft:"10px"}}),(0,p.jsx)(L.ff,{icon:I.c3,title:"Create Component of Selection with Representation",toggle:this.toggleAddComponent,isSelected:"add-component"===this.state.action,disabled:this.isDisabled}),(0,p.jsx)(L.K0,{svg:I.$j,title:"Remove/subtract Selection from all Components",onClick:this.subtract,disabled:this.isDisabled}),(0,p.jsx)(L.K0,{svg:I.L3,onClick:this.undo,disabled:!this.state.canUndo||this.isDisabled,title:i}),(0,p.jsx)(L.ff,{icon:I.ml,title:"Show/hide help",toggle:this.toggleHelp,style:{marginLeft:"10px"},isSelected:"help"===this.state.action}),this.plugin.config.get(Bt.AB.Viewport.ShowSelectionMode)&&(0,p.jsx)(L.K0,{svg:I.XD,title:"Turn selection mode off",onClick:this.turnOff})]}),s]})}}class zc extends Z.dL{constructor(){super(...arguments),this.state={isEmpty:!0,isBusy:!1},this.clear=()=>this.plugin.managers.interactivity.lociSelects.deselectAll(),this.focus=()=>{if(0===this.plugin.managers.structure.selection.stats.elementCount)return;const{sphere:e}=this.plugin.managers.structure.selection.getBoundary();this.plugin.managers.camera.focusSphere(e)},this.highlight=e=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights(),this.plugin.managers.structure.selection.entries.forEach(i=>{this.plugin.managers.interactivity.lociHighlights.highlight({loci:i.selection},!1)})},this.clearHighlight=()=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights()}}componentDidMount(){this.subscribe(this.plugin.managers.structure.selection.events.changed,()=>{this.forceUpdate()}),this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,e=>{const i=0===e.structures.length;this.state.isEmpty!==i&&this.setState({isEmpty:i})}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e})})}get isDisabled(){return this.state.isBusy||this.state.isEmpty}get stats(){const e=this.plugin.managers.structure.selection.stats;return 0===e.structureCount||0===e.elementCount?"Nothing Selected":`${(0,Xi.Kq)(e.label)} Selected`}render(){const e=this.plugin.managers.structure.selection.stats,i=0===e.structureCount||0===e.elementCount;return i&&this.props.hideOnEmpty?null:(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.$n,{noOverflow:!0,onClick:this.focus,title:"Click to Focus Selection",disabled:i,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlignLast:i?void 0:"left"},children:this.stats}),!i&&(0,p.jsx)(L.K0,{svg:I.XD,onClick:this.clear,title:"Clear",className:"msp-form-control",flex:!0})]})})}}class Ko extends Z.jB{constructor(){super(...arguments),this._params=(0,Hr._)(e=>Br.C.getThemeParams(this.plugin,e)),this.state={values:Q.t.getDefaultValues(this.params)},this.apply=()=>{var e,i;this.plugin.managers.structure.component.applyTheme(this.state.values,this.plugin.managers.structure.hierarchy.current.structures),null===(i=(e=this.props).onApply)||void 0===i||i.call(e)},this.paramsChanged=e=>this.setState({values:e})}get params(){return this._params(this.plugin.managers.structure.component.pivotStructure)}render(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($e.y1,{params:this.params,values:this.state.values,onChangeValues:this.paramsChanged}),(0,p.jsx)(L.$n,{icon:I.fe,className:"msp-btn-commit msp-btn-commit-on",onClick:this.apply,style:{marginTop:"1px"},children:"Apply Theme"})]})}}const Qn={idType:Q.t.Select("auth",Q.t.arrayToOptions(["auth","label","atom-id"])),identifiers:Q.t.Text("",{description:"A comma separated list of atom identifiers (e.g. 10, 15-25) or residue ranges in given chain (e.g. A 10-15, B 25, C 30:i)"})},sd=Q.t.getDefaultValues(Qn);function Oc({modifier:r,plugin:e,close:i}){const[s,l]=he.useState(sd),u=()=>{if(0!==s.identifiers.trim().length)try{i();const c=Dc(s.identifiers,s.idType);e.managers.structure.selection.fromCompiledQuery(r,c,!1)}catch(c){console.error(c),e.log.error("Failed to create selection")}};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($e.y1,{params:Qn,values:s,onChangeValues:l,onEnter:u}),(0,p.jsxs)(L.$n,{className:"msp-btn-commit msp-btn-commit-on",disabled:0===s.identifiers.trim().length,onClick:u,style:{marginTop:"1px"},children:[(0,Xi.ZH)(r)," Selection"]})]})}class $a extends Z.VK{defaultState(){return{isCollapsed:!1,header:"Measurements",brand:{accent:"gray",svg:I.yF}}}renderControls(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Fc,{}),(0,p.jsx)(Rc,{})]})}}class Rc extends Z.jB{componentDidMount(){this.subscribe(this.plugin.managers.structure.measurement.behaviors.state,()=>{this.forceUpdate()})}renderGroup(e,i){const s=[];for(const l of e)l.obj&&s.push((0,p.jsx)(Ht,{cell:l},l.obj.id));return s.length?(0,p.jsx)(L.Yj,{header:i,initiallyExpanded:!0,children:s}):null}render(){const e=this.plugin.managers.structure.measurement.state;return(0,p.jsxs)("div",{style:{marginTop:"6px"},children:[this.renderGroup(e.labels,"Labels"),this.renderGroup(e.distances,"Distances"),this.renderGroup(e.angles,"Angles"),this.renderGroup(e.dihedrals,"Dihedrals"),this.renderGroup(e.orientations,"Orientations"),this.renderGroup(e.planes,"Planes")]})}}class Fc extends Z.jB{constructor(){super(...arguments),this.state={isBusy:!1,action:void 0},this.measureDistance=()=>{const e=this.plugin.managers.structure.selection.additionsHistory;this.plugin.managers.structure.measurement.addDistance(e[0].loci,e[1].loci)},this.measureAngle=()=>{const e=this.plugin.managers.structure.selection.additionsHistory;this.plugin.managers.structure.measurement.addAngle(e[0].loci,e[1].loci,e[2].loci)},this.measureDihedral=()=>{const e=this.plugin.managers.structure.selection.additionsHistory;this.plugin.managers.structure.measurement.addDihedral(e[0].loci,e[1].loci,e[2].loci,e[3].loci)},this.addLabel=()=>{this.plugin.managers.structure.measurement.addLabel(this.plugin.managers.structure.selection.additionsHistory[0].loci)},this.addOrientation=()=>{const e=[];this.plugin.managers.structure.selection.entries.forEach(i=>{e.push(i.selection)}),this.plugin.managers.structure.measurement.addOrientation(e)},this.addPlane=()=>{const e=[];this.plugin.managers.structure.selection.entries.forEach(i=>{e.push(i.selection)}),this.plugin.managers.structure.measurement.addPlane(e)},this.selectAction=e=>{this.toggleAdd(),e&&(0,e?.value)()},this.toggleAdd=()=>this.setState({action:"add"===this.state.action?void 0:"add"}),this.toggleOptions=()=>this.setState({action:"options"===this.state.action?void 0:"options"})}componentDidMount(){this.subscribe(this.selection.events.additionsHistoryUpdated,()=>{this.forceUpdate(),this.updateOrderLabels()}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e})})}componentWillUnmount(){this.clearOrderLabels(),super.componentWillUnmount()}componentDidUpdate(e,i){this.state.action!==i.action&&this.updateOrderLabels()}clearOrderLabels(){this.plugin.managers.structure.measurement.addOrderLabels([])}updateOrderLabels(){if("add"!==this.state.action)return void this.clearOrderLabels();const e=[],i=this.selection.additionsHistory;for(let s=0;sthis.highlight(e.loci),onMouseLeave:()=>this.plugin.managers.interactivity.lociHighlights.clearHighlights(),children:[(0,p.jsxs)(L.$n,{noOverflow:!0,title:"Click to focus. Hover to highlight.",onClick:()=>this.focusLoci(e.loci),style:{width:"auto",textAlign:"left"},children:[i,". ",(0,p.jsx)("span",{dangerouslySetInnerHTML:{__html:e.label}})]}),s.length>1&&(0,p.jsx)(L.K0,{svg:I.p8,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(e,"up"),flex:"20px",title:"Move up"}),s.length>1&&(0,p.jsx)(L.K0,{svg:I.qp,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(e,"down"),flex:"20px",title:"Move down"}),(0,p.jsx)(L.K0,{svg:I.mf,small:!0,className:"msp-form-control",onClick:()=>this.plugin.managers.structure.selection.modifyHistory(e,"remove"),flex:!0,title:"Remove"})]},e.id)}add(){const e=this.plugin.managers.structure.selection.additionsHistory,i=[];for(let u=0,c=Math.min(e.length,4);u0&&(0,p.jsx)("div",{className:"msp-control-offset",children:i}),0===i.length&&(0,p.jsx)("div",{className:"msp-control-offset msp-help-text",children:(0,p.jsxs)("div",{className:"msp-help-description",children:[(0,p.jsx)(I.In,{svg:I.ml,inline:!0}),"Add one or more selections",l]})})]})}render(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.ff,{icon:I.CR,label:"Add",toggle:this.toggleAdd,isSelected:"add"===this.state.action,disabled:this.state.isBusy,className:"msp-btn-apply-simple"}),(0,p.jsx)(L.ff,{icon:I.Hk,label:"",title:"Options",toggle:this.toggleOptions,isSelected:"options"===this.state.action,disabled:this.state.isBusy,style:{flex:"0 0 40px",padding:0}})]}),"add"===this.state.action&&this.add(),"options"===this.state.action&&(0,p.jsx)(zs,{})]})}}class zs extends Z.jB{constructor(){super(...arguments),this.state={isDisabled:!1},this.changed=e=>{this.plugin.managers.structure.measurement.setOptions(e)}}componentDidMount(){this.subscribe(this.plugin.managers.structure.measurement.behaviors.state,()=>{this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isDisabled:e})})}render(){return(0,p.jsx)("div",{className:"msp-control-offset",children:(0,p.jsx)($e.y1,{params:Ua.Gu,values:this.plugin.managers.structure.measurement.state.options,onChangeValues:this.changed,isDisabled:this.state.isDisabled})})}}class Ht extends Z.jB{constructor(){super(...arguments),this.state={showUpdate:!1},this.delete=()=>{ue.a.State.RemoveObject(this.plugin,{state:this.props.cell.parent,ref:this.props.cell.transform.parent,removeParentGhosts:!0})},this.toggleVisibility=e=>{e.preventDefault(),ue.a.State.ToggleVisibility(this.plugin,{state:this.props.cell.parent,ref:this.props.cell.transform.parent}),e.currentTarget.blur()},this.highlight=()=>{var e;if(!this.selections)return;this.plugin.managers.interactivity.lociHighlights.clearHighlights();for(const l of this.lociArray)this.plugin.managers.interactivity.lociHighlights.highlight({loci:l},!1);const s=null===(e=this.props.cell.obj)||void 0===e?void 0:e.data.repr.getAllLoci();if(s)for(const l of s)this.plugin.managers.interactivity.lociHighlights.highlight({loci:l},!1)},this.clearHighlight=()=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights()},this.toggleUpdate=()=>this.setState({showUpdate:!this.state.showUpdate}),this.focus=()=>{if(!this.selections)return;const i=qo.QN.getBundleBoundingSphere({loci:this.lociArray});i&&this.plugin.managers.camera.focusSphere(i)},this.selectAction=e=>{e&&(this.setState({showUpdate:!1}),(0,e?.value)())}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,e=>{this.forceUpdate()})}get selections(){var e;return null===(e=this.props.cell.obj)||void 0===e?void 0:e.data.sourceData}get lociArray(){const e=this.selections;return e?e.infos?[e.infos[0].loci]:e.pairs?e.pairs[0].loci:e.triples?e.triples[0].loci:e.quads?e.quads[0].loci:e.locis?e.locis:[]:[]}get label(){const e=this.selections;return e?e.infos?(0,Nn.YQ)(e.infos[0].loci,{condensed:!0}):e.pairs?(0,Nn.W8)(e.pairs[0],{condensed:!0,unitLabel:this.plugin.managers.structure.measurement.state.options.distanceUnitLabel}):e.triples?(0,Nn.k0)(e.triples[0],{condensed:!0}):e.quads?(0,Nn.kd)(e.quads[0],{condensed:!0}):e.locis?(0,Nn.k7)(e.locis,{countsOnly:!0}):"":""}get actions(){return[Ee.W.Item("Select This",()=>this.plugin.managers.structure.selection.fromSelections(this.props.cell.sourceRef),{icon:I.B7})]}render(){const{cell:e}=this.props,{obj:i}=e;return i?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,children:[(0,p.jsx)("button",{className:"msp-form-control msp-control-button-label msp-no-overflow",title:"Click to focus. Hover to highlight.",onClick:this.focus,style:{width:"auto",textAlign:"left"},children:(0,p.jsx)("span",{dangerouslySetInnerHTML:{__html:this.label}})}),(0,p.jsx)(L.K0,{svg:e.state.isHidden?I.qF:I.zs,toggleState:!1,small:!0,className:"msp-form-control",onClick:this.toggleVisibility,flex:!0,title:e.state.isHidden?"Show":"Hide"}),(0,p.jsx)(L.K0,{svg:I.mf,small:!0,className:"msp-form-control",onClick:this.delete,flex:!0,title:"Delete",toggleState:!1}),(0,p.jsx)(L.K0,{svg:I.cv,className:"msp-form-control",onClick:this.toggleUpdate,flex:!0,title:"Actions",toggleState:this.state.showUpdate})]},i.id),this.state.showUpdate&&e.parent&&(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("div",{className:"msp-accent-offset",children:[(0,p.jsx)(Ee.W,{items:this.actions,onSelect:this.selectAction,noOffset:!0}),(0,p.jsx)(L.Yj,{header:"Options",noOffset:!0,children:(0,p.jsx)(pi,{state:e.parent,transform:e.transform,customHeader:"none",autoHideApply:!0})})]})})]}):null}}var Ce=F(3543);function Qa(r,e,i,s){const l=Ce.SortedArray.indexOf(e.unit.elements,e.element),u=z.iZ.Loci(e.structure,[{unit:e.unit,indices:Ce.CD.ofSingleton(l)}]),c="residue"===s?z.iZ.Loci.extendToWholeResidues(u):z.iZ.Loci.extendToWholeChains(u),h=z.StructureProperties.entity.pdbx_description(e).join(", ");for(const f of i.units){const y=z.iZ.Loci(c.structure,[{unit:f,indices:c.elements[0].indices}]);let g=(0,Nn.YQ)(y,{reverse:!0,hidePrefix:!0,htmlStyling:!1,granularity:s});g||(g=(0,Nn.YQ)(y,{hidePrefix:!1,htmlStyling:!1})),i.units.length>1&&(g+=` | ${y.elements[0].unit.conformation.operator.name}`);const x={label:g,category:h,loci:y};r.has(h)?r.get(h).push(x):r.set(h,[x])}}function $o(r){const e=new Map,i=z.iZ.Location.create(r);for(const l of r.unitSymmetryGroups){if(!z.Nf.isAtomic(l.units[0]))continue;i.unit=l.units[0],i.element=l.elements[0];const u=z.Nf.Traits.is(i.unit.traits,z.Nf.Trait.MultiChain),c=z.StructureProperties.entity.type(i),h="non-polymer"===c,f="branched"===c;if(z.StructureProperties.entity.prd_id(i))Qa(e,i,l,"chain");else if(h&&!u)Qa(e,i,l,"residue");else if(f||h&&u){const g=i.unit,{index:x}=g.model.atomicHierarchy.residueAtomSegments;let w=-1;for(let b=0,C=g.elements.length;b{1===l.length?s.push({label:`${u}: ${l[0].label}`,loci:l[0].loci}):l.length<2e3&&s.push(...l)}),s}class Ut extends Z.dL{constructor(){super(...arguments),this.state={isBusy:!1,showAction:!1},this.getSelectionItems=(0,Hr._)(e=>{var i;const s=[];for(const l of e){const u=null===(i=l.cell.obj)||void 0===i?void 0:i.data;if(u){const c=$o(u);c.length>0&&s.push([Ee.W.Header(u.label,{description:u.label}),...Ee.W.createItems(c,{label:h=>h.label,category:h=>h.category,description:h=>h.label})])}}return s}),this.selectAction=(e,i)=>{if(!e||!this.state.showAction)return void this.setState({showAction:!1});const s=e.value;i?.shiftKey?this.plugin.managers.structure.focus.addFromLoci(s.loci):this.plugin.managers.structure.focus.set(s),this.focusCamera()},this.toggleAction=()=>this.setState({showAction:!this.state.showAction}),this.focusCamera=()=>{const{current:e}=this.plugin.managers.structure.focus;e&&this.plugin.managers.camera.focusLoci(e.loci)},this.clear=()=>{this.plugin.managers.structure.focus.clear(),this.plugin.managers.camera.reset()},this.highlightCurrent=()=>{const{current:e}=this.plugin.managers.structure.focus;e&&this.plugin.managers.interactivity.lociHighlights.highlightOnly({loci:e.loci},!1)},this.clearHighlights=()=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights()}}componentDidMount(){this.subscribe(this.plugin.managers.structure.focus.behaviors.current,e=>{this.getSelectionItems([]),this.forceUpdate()}),this.subscribe(this.plugin.managers.structure.focus.events.historyUpdated,e=>{this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e,showAction:!1})})}get isDisabled(){return this.state.isBusy||0===this.plugin.managers.structure.hierarchy.selection.structures.length}get actionItems(){const e=[],{history:i}=this.plugin.managers.structure.focus;i.length>0&&e.push([Ee.W.Header("History",{description:"Previously focused on items."}),...Ee.W.createItems(i,{label:u=>u.label,description:u=>u.category&&u.label!==u.category?`${u.category} | ${u.label}`:u.label})]);const s=this.getSelectionItems(this.plugin.managers.structure.hierarchy.selection.structures);1===s.length&&(s[0][0].initiallyExpanded=!0);const l=[];return s.length>0&&l.push(...s),e.length>0&&l.push(...e),l}getToggleBindingLabel(){var e;const i=this.plugin.state.behaviors.transforms.get(Ms.FocusLoci.id);if(!i)return"";const s=null===(e=i.params)||void 0===e?void 0:e.bindings.clickFocus;return!s||di.O.isEmpty(s)?"":di.O.formatTriggers(s)}render(){const{current:e}=this.plugin.managers.structure.focus,i=e?.label||"Nothing Focused";let s="Click to Center Camera";if(!e){s="Select focus using the menu";const l=this.getToggleBindingLabel();l&&(s+=`\nor use '${l}' on element`)}return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.$n,{noOverflow:!0,onClick:this.focusCamera,title:s,onMouseEnter:this.highlightCurrent,onMouseLeave:this.clearHighlights,disabled:this.isDisabled||!e,style:{textAlignLast:e?"left":void 0},children:i}),e&&(0,p.jsx)(L.K0,{svg:I.XD,onClick:this.clear,title:"Clear",className:"msp-form-control",flex:!0,disabled:this.isDisabled}),(0,p.jsx)(L.ff,{icon:I.vC,title:"Select a focus target to center on an show its surroundings. Hold shift to focus on multiple targets.",toggle:this.toggleAction,isSelected:this.state.showAction,disabled:this.isDisabled,style:{flex:"0 0 40px",padding:0}})]}),this.state.showAction&&(0,p.jsx)(Ee.W,{items:this.actionItems,onSelect:this.selectAction})]})}}class od extends Z.VK{constructor(){super(...arguments),this.item=e=>{var i,s,l,u,c,h,f,y,g;const x=this.plugin.managers.structure.hierarchy.seletionSet;let w;switch(e.kind){case"model":{const C=null===(i=e.cell.obj)||void 0===i?void 0:i.data;C&&z.Kx.TrajectoryInfo.get(C).size>1&&(w=`${null===(s=e.cell.obj)||void 0===s?void 0:s.data.entryId} | Model ${z.Kx.TrajectoryInfo.get(C).index+1} of ${z.Kx.TrajectoryInfo.get(C).size}`),w=`${null===(l=e.cell.obj)||void 0===l?void 0:l.data.entryId} | ${null===(u=e.cell.obj)||void 0===u?void 0:u.label}`;break}case"structure":{const C=null===(c=e.cell.obj)||void 0===c?void 0:c.data.models[0];if(C&&z.Kx.TrajectoryInfo.get(C).size>1){w=`${C.entryId} | ${null===(h=e.cell.obj)||void 0===h?void 0:h.label} (Model ${z.Kx.TrajectoryInfo.get(C).index+1} of ${z.Kx.TrajectoryInfo.get(C).size})`;break}if(C){w=`${C.entryId} | ${null===(f=e.cell.obj)||void 0===f?void 0:f.label}`;break}w=`${null===(y=e.cell.obj)||void 0===y?void 0:y.label}`;break}default:w=null===(g=e.cell.obj)||void 0===g?void 0:g.label}return{kind:"item",label:w||e.kind,selected:x.has(e.cell.transform.ref),value:[e]}},this.getTrajectoryItems=e=>{var i;return 0===e.models.length?this.item(e):[Ee.W.Header(null===(i=e.cell.obj)||void 0===i?void 0:i.label),...e.models.map(this.getModelItems)]},this.getModelItems=e=>{var i,s,l;if(0===e.structures.length)return this.item(e);if(1===e.structures.length){const c=e.structures[0];return{label:`${null===(i=e.cell.obj)||void 0===i?void 0:i.label} | ${null===(s=c.cell.obj)||void 0===s?void 0:s.label}`,selected:this.plugin.managers.structure.hierarchy.seletionSet.has(c.cell.transform.ref),value:[e,c]}}return[Ee.W.Header(null===(l=e.cell.obj)||void 0===l?void 0:l.label),...e.structures.map(this.item)]},this.selectHierarchy=e=>{if(!e||0===e.length)return;const i=[];for(const s of e)for(const l of s.value)i.push(l);this.plugin.managers.structure.hierarchy.updateCurrent(i,e[0].selected?"remove":"add")},this.toggleHierarchy=()=>this.setState({show:"hierarchy"!==this.state.show?"hierarchy":void 0}),this.togglePreset=()=>this.setState({show:"presets"!==this.state.show?"presets":void 0}),this.applyPreset=e=>{if(this.setState({show:void 0}),!e)return;const i=this.plugin.managers.structure,{trajectories:s}=i.hierarchy.selection;i.hierarchy.applyPreset(s,e.value)},this.updateModelQueueParams=void 0,this.isUpdatingModel=!1,this.updateStructureModel=e=>{this.updateModelQueueParams=e,this._updateStructureModel()},this.updateStructure=e=>{const{selection:i}=this.plugin.managers.structure.hierarchy;return this.plugin.managers.structure.hierarchy.updateStructure(i.structures[0],e)}}defaultState(){return{header:"Structure",isCollapsed:!1,isBusy:!1,brand:{accent:"purple",svg:I.Rm}}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,()=>this.forceUpdate()),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e})})}get hierarchyItems(){const e=this.plugin.managers.structure.hierarchy,{current:i}=e,s=[];return i.trajectories.length>1&&s.push([Ee.W.Header("Trajectories"),...i.trajectories.map(this.item)]),(i.models.length>1||i.trajectories.length>1)&&s.push([Ee.W.Header("Models"),...i.models.map(this.item)]),1===i.trajectories.length&&1===i.models.length?s.push(...i.structures.map(this.item)):i.structures.length>0&&s.push([Ee.W.Header("Structures"),...i.structures.map(this.item)]),s}get isEmpty(){const{structures:e,models:i,trajectories:s}=this.plugin.managers.structure.hierarchy.current;return 0===s.length&&0===i.length&&0===e.length}get label(){var e,i,s,l,u,c,h,f,y,g,x,w,b,C;const{structures:N,models:V,trajectories:D}=this.plugin.managers.structure.hierarchy.selection;if(1===N.length){const O=N[0];return null!==(i=null===(e=O.model)||void 0===e?void 0:e.trajectory)&&void 0!==i&&i.models&&1===O.model.trajectory.models.length?null===(s=O.cell.obj)||void 0===s?void 0:s.data.label:O.model?`${null===(l=O.model.cell.obj)||void 0===l?void 0:l.label} | ${null===(u=O.cell.obj)||void 0===u?void 0:u.data.label}`:null===(c=O.cell.obj)||void 0===c?void 0:c.data.label}if(N.length>1){const O=N[0],B=null===(h=O?.model)||void 0===h?void 0:h.trajectory;let X=!0;for(const ae of N)if((null===(f=ae?.model)||void 0===f?void 0:f.trajectory)!==B){X=!1;break}return X&&B?`${null===(y=B.cell.obj)||void 0===y?void 0:y.label} | ${N.length} structures`:`${N.length} structures`}if(V.length>0){const O=V[0].trajectory;if(1===V.length){const X=null===(g=V[0].cell.obj)||void 0===g?void 0:g.data;return X&&z.Kx.TrajectoryInfo.get(X).size>1?`${null===(x=O?.cell.obj)||void 0===x?void 0:x.label} | Model ${z.Kx.TrajectoryInfo.get(X).index+1} of ${z.Kx.TrajectoryInfo.get(X).size}`:`${null===(w=O?.cell.obj)||void 0===w?void 0:w.label} | Model`}let B=!0;for(const X of V)if(X.trajectory!==O){B=!1;break}return B?`${null===(b=O?.cell.obj)||void 0===b?void 0:b.label} | ${V.length} models`:`${V.length} models`}return D.length>0?1===D.length?`${null===(C=D[0].cell.obj)||void 0===C?void 0:C.label} trajectory`:`${D.length} trajectories`:0===D.length&&0===V.length&&0===N.length?"Nothing Loaded":"Nothing Selected"}get presetActions(){const e=[],{trajectories:i}=this.plugin.managers.structure.hierarchy.selection;if(0===i.length)return e;let s=this.plugin.builders.structure.hierarchy.getPresets(i[0].cell.obj);if(i.length>1){const l=new Set(s);for(let u=1;ul.has(u))}for(const l of s)e.push(Ee.W.Item(l.display.name,l,{description:l.display.description}));return e}_updateStructureModel(){var e=this;return(0,R.A)(function*(){if(!e.updateModelQueueParams||e.isUpdatingModel)return;const i=e.updateModelQueueParams;e.updateModelQueueParams=void 0;try{e.isUpdatingModel=!0;const{selection:s}=e.plugin.managers.structure.hierarchy,l=s.structures[0].model;yield e.plugin.state.updateTransform(e.plugin.state.data,l.cell.transform.ref,i,"Model Index")}finally{e.isUpdatingModel=!1,e._updateStructureModel()}})()}get modelIndex(){var e,i;const{selection:s}=this.plugin.managers.structure.hierarchy;if(1!==s.structures.length)return null;const l=s.structures[0].model;if(!l||l.cell.transform.transformer!==jt.f.Model.ModelFromTrajectory||!l.cell.obj||z.Kx.TrajectoryInfo.get(l.cell.obj.data).size<=1)return null;const u=null===(e=l.cell.params)||void 0===e?void 0:e.definition;return u?(0,p.jsx)($e.y1,{params:u,values:null===(i=l.cell.params)||void 0===i?void 0:i.values,onChangeValues:this.updateStructureModel,isDisabled:this.state.isBusy}):null}get structureType(){var e;const{selection:i}=this.plugin.managers.structure.hierarchy;if(1!==i.structures.length)return null;const s=i.structures[0];return(null===(e=s.cell.params)||void 0===e?void 0:e.definition)&&s.cell.parent?(0,p.jsx)(pi,{state:s.cell.parent,transform:s.cell.transform,customHeader:"none",customUpdate:this.updateStructure,noMargin:!0,autoHideApply:!0}):null}get transform(){const{selection:e}=this.plugin.managers.structure.hierarchy;if(1!==e.structures.length)return null;const i=e.structures[0];if(!i.cell.parent)return null;const s=tt.QX.tryFindDecorator(this.plugin.state.data,i.cell.transform.ref,jt.f.Model.TransformStructureConformation);return s?(0,p.jsx)(L.Yj,{header:"Conformation Transform",children:(0,p.jsx)(pi,{state:s.parent,transform:s.transform,customHeader:"none",noMargin:!0,autoHideApply:!0})}):void 0}renderControls(){const e=this.state.isBusy||this.isEmpty,i=this.presetActions,s=this.label;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",style:{marginTop:"1px"},children:[(0,p.jsx)(L.$n,{noOverflow:!0,flex:!0,onClick:this.toggleHierarchy,disabled:e,title:s,children:s}),i.length>0&&(0,p.jsx)(L.K0,{svg:I.sM,className:"msp-form-control",flex:"40px",onClick:this.togglePreset,title:"Apply a structure presets to the current hierarchy.",toggleState:"presets"===this.state.show,disabled:e})]}),"hierarchy"===this.state.show&&(0,p.jsx)(Ee.W,{items:this.hierarchyItems,onSelect:this.selectHierarchy,multiselect:!0}),"presets"===this.state.show&&(0,p.jsx)(Ee.W,{items:i,onSelect:this.applyPreset}),this.modelIndex,this.structureType,this.transform,(0,p.jsxs)("div",{style:{marginTop:"6px"},children:[(0,p.jsx)(Ut,{}),(0,p.jsx)(zc,{hideOnEmpty:!0})]})]})}}var ne=F(9012),er=F(6230),Qo=F(958);class Go extends Ns{constructor(){super(...arguments),this._getInfo=(0,Hr._)((e,i,s)=>Ii.infoFromAction(this.plugin,this.props.state,this.props.action,this.props.nodeRef)),this.state={plugin:this.plugin,ref:this.props.nodeRef,version:this.props.state.transforms.get(this.props.nodeRef).version,error:void 0,isInitial:!0,params:this.getInfo().initialValues,busy:!1,isCollapsed:this.props.initiallyCollapsed}}applyAction(){return ue.a.State.ApplyAction(this.plugin,{state:this.props.state,action:this.props.action.create(this.state.params),ref:this.props.nodeRef})}getInfo(){var e;return this._getInfo(this.props.nodeRef,this.props.state.transforms.get(this.props.nodeRef).version,null===(e=this.state)||void 0===e?void 0:e.isCollapsed)}getTransformerId(){return this.props.state.transforms.get(this.props.nodeRef).transformer.id}getHeader(){return this.props.hideHeader?"none":this.props.action.definition.display}canApply(){return!this.state.error&&!this.state.busy}canAutoApply(){return!1}applyText(){return"Apply"}isUpdate(){return!1}getSourceAndTarget(){return{a:this.props.state.cells.get(this.props.nodeRef).obj}}static getDerivedStateFromProps(e,i){const s=e.state.transforms.get(e.nodeRef).version;if(e.nodeRef===i.ref&&s===i.version)return null;const l=e.state.cells.get(e.nodeRef).obj,u=e.action.definition.params?Q.t.getDefaultValues(e.action.definition.params(l,i.plugin)):{};return{plugin:i.plugin,ref:e.nodeRef,version:s,params:u,isInitial:!0,error:void 0}}}var ld=F(3442),Os=F(22);class Yo extends Z.VK{defaultState(){return{header:"Volume Streaming",isCollapsed:!1,isBusy:!1,isHidden:!0,brand:{accent:"cyan",svg:I.Fi}}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,()=>{this.setState({isHidden:!this.canEnable(),description:Ac.G.getSelectedStructuresDescription(this.plugin)})}),this.subscribe(this.plugin.state.events.cell.stateUpdated,e=>{tt.Cn.hasTag(e.cell.transform,er.h.RootTag)&&this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e})})}get pivot(){return this.plugin.managers.structure.hierarchy.selection.structures[0]}canEnable(){var e,i;const{selection:s}=this.plugin.managers.structure.hierarchy;if(1!==s.structures.length)return!1;const l=this.pivot.cell;return!!l.obj&&!(null===(i=(e=Qo.p3.definition).isApplicable)||void 0===i||!i.call(e,l.obj,l.transform,this.plugin))}renderEnable(){var e,i;const s=this.pivot;if(!s.cell.parent)return null;const l=tt.QX.findTagInSubtree(s.cell.parent.tree,this.pivot.cell.transform.ref,er.h.RootTag),u=l&&s.cell.parent.cells.get(l),c=u&&"error"===u.status?{header:u.errorText&&null!==(e=u.errorText)&&void 0!==e&&e.includes("404")?"No Density Data Available":"Error Enabling",icon:I.Bw,title:u.errorText}:u&&0===(null===(i=u.obj)||void 0===i?void 0:i.data.entries.length)?{header:"Error Enabling",icon:I.Bw,title:"No Entry for Streaming Found"}:{header:"Enable",icon:I.Xq,title:"Enable"};return(0,p.jsx)(Go,{state:s.cell.parent,action:Qo.p3,initiallyCollapsed:!0,nodeRef:s.cell.transform.ref,simpleApply:c})}renderParams(){var e,i,s,l,u;const c=this.pivot;if(!c.cell.parent)return null;const h="selection-box"===(null===(i=null===(e=c.volumeStreaming)||void 0===e?void 0:e.cell.transform.params)||void 0===i?void 0:i.entry.params.view.name)&&(null===(u=null===(l=null===(s=this.plugin.state.behaviors.cells.get(Ms.FocusLoci.id))||void 0===s?void 0:s.params)||void 0===l?void 0:l.values)||void 0===u?void 0:u.bindings);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(pi,{state:c.cell.parent,transform:c.volumeStreaming.cell.transform,customHeader:"none",noMargin:!0}),h&&(0,p.jsx)(L.Yj,{header:"Controls Help",children:(0,p.jsx)(_o,{bindings:h})})]})}renderControls(){const e=this.pivot;return e?e.volumeStreaming?this.renderParams():this.renderEnable():null}}class Ga extends Z.VK{constructor(){super(...arguments),this.item=e=>{var i;const l=(null===(i=e.cell.obj)||void 0===i?void 0:i.label)||"Volume";return{kind:"item",label:("lazy-volume"===e.kind?"Load ":"")+(l||e.kind),selected:this.plugin.managers.volume.hierarchy.selection===e,value:e}},this.selectCurrent=e=>{if(this.toggleHierarchy(),!e)return;const i=e.value;"volume"===i.kind?this.plugin.managers.volume.hierarchy.setCurrent(i):this.lazyLoad(i.cell)},this.selectAdd=e=>{e&&(this.setState({show:void 0}),e.value())},this.toggleHierarchy=()=>this.setState({show:"hierarchy"!==this.state.show?"hierarchy":void 0}),this.toggleAddRepr=()=>this.setState({show:"add-repr"!==this.state.show?"add-repr":void 0})}defaultState(){return{header:"Volume",isCollapsed:!1,isBusy:!1,isHidden:!0,brand:{accent:"purple",svg:I.Fi}}}componentDidMount(){this.subscribe(this.plugin.managers.volume.hierarchy.behaviors.selection,e=>{this.setState({isHidden:0===e.hierarchy.volumes.length&&0===e.hierarchy.lazyVolumes.length})}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e})})}get hierarchyItems(){const e=this.plugin.managers.volume.hierarchy,{current:i}=e,s=[];for(const l of i.volumes)s.push(this.item(l));for(const l of i.lazyVolumes)s.push(this.item(l));return s}get addActions(){const e=this.plugin.managers.volume.hierarchy,i=e.selection;return[...ne.L.getRepresentationTypes(this.plugin,i).map(l=>Ee.W.Item(l[1],()=>e.addRepresentation(i,l[0])))]}get isEmpty(){const{volumes:e,lazyVolumes:i}=this.plugin.managers.volume.hierarchy.current;return 0===e.length&&0===i.length}get label(){var e;if(this.state.loadingLabel)return`Loading ${this.state.loadingLabel}...`;const i=this.plugin.managers.volume.hierarchy.selection;return i?(null===(e=i?.cell.obj)||void 0===e?void 0:e.label)||"Volume":"Nothing Selected"}lazyLoad(e){var i=this;return(0,R.A)(function*(){const{url:s,isBinary:l,format:u,entryId:c,isovalues:h}=e.obj.data;i.setState({isBusy:!0,loadingLabel:e.obj.label});try{const f=i.plugin;yield f.dataTransaction((0,R.A)(function*(){var y,g,x,w;const b=yield f.builders.data.download({url:s,isBinary:l},{state:{isGhost:!0}}),C=yield f.dataFormats.get(u).parse(f,b,{entryId:c}),N=C.volume||C.volumes[0];if(!N?.isOk)throw new Error("Failed to parse any volume.");const V=f.build();for(const D of h)V.to(null!==(x=null===(y=C.volumes)||void 0===y?void 0:y[null!==(g=D.volumeIndex)&&void 0!==g?g:0])&&void 0!==x?x:C.volume).apply(jt.f.Representation.VolumeRepresentation3D,(0,ld.aK)(i.plugin,N.data,{type:"isosurface",typeParams:{alpha:null!==(w=D.alpha)&&void 0!==w?w:1,isoValue:"absolute"===D.type?{kind:"absolute",absoluteValue:D.value}:{kind:"relative",relativeValue:D.value}},color:"uniform",colorParams:{value:D.color}}));yield V.commit(),yield f.build().delete(e).commit()}))}finally{i.setState({isBusy:!1,loadingLabel:void 0})}})()}renderControls(){const e=this.state.isBusy||this.isEmpty,i=this.label,s=this.plugin.managers.volume.hierarchy.selection;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",style:{marginTop:"1px"},children:[(0,p.jsx)(L.$n,{noOverflow:!0,flex:!0,onClick:this.toggleHierarchy,disabled:e,title:i,children:i}),!this.isEmpty&&s&&(0,p.jsx)(L.K0,{svg:I.CR,onClick:this.toggleAddRepr,title:"Apply a structure presets to the current hierarchy.",toggleState:"add-repr"===this.state.show,disabled:e})]}),"hierarchy"===this.state.show&&(0,p.jsx)(Ee.W,{items:this.hierarchyItems,onSelect:this.selectCurrent}),"add-repr"===this.state.show&&(0,p.jsx)(Ee.W,{items:this.addActions,onSelect:this.selectAdd}),s&&s.representations.length>0&&(0,p.jsx)("div",{style:{marginTop:"6px"},children:s.representations.map(l=>(0,p.jsx)(Bc,{representation:l},l.cell.transform.ref))})]})}}class Bc extends Z.jB{constructor(){super(...arguments),this.state={action:void 0},this.remove=()=>this.plugin.managers.volume.hierarchy.remove([this.props.representation],!0),this.toggleVisible=e=>{e.preventDefault(),e.currentTarget.blur(),this.plugin.managers.volume.hierarchy.toggleVisibility([this.props.representation])},this.toggleColor=()=>{this.setState({action:"select-color"===this.state.action?void 0:"select-color"})},this.toggleUpdate=()=>this.setState({action:"update"===this.state.action?void 0:"update"}),this.highlight=e=>{e.preventDefault(),this.props.representation.cell.parent&&ue.a.Interactivity.Object.Highlight(this.plugin,{state:this.props.representation.cell.parent,ref:this.props.representation.cell.transform.ref})},this.clearHighlight=e=>{e.preventDefault(),ue.a.Interactivity.ClearHighlights(this.plugin)},this.focus=()=>{var e;const i=this.props.representation,s=null===(e=i.cell.obj)||void 0===e?void 0:e.data.repr.getAllLoci();i.cell.state.isHidden&&this.plugin.managers.volume.hierarchy.toggleVisibility([this.props.representation],"show"),s&&this.plugin.managers.camera.focusLoci(s,{extraRadius:1})},this.updateColor=({value:e})=>{const i=this.props.representation.cell.transform;return this.plugin.build().to(i.ref).update({...i.params,colorTheme:{name:"uniform",params:{value:e}}}).commit()}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,e=>{tt.Uw.ObjectEvent.isCell(e,this.props.representation.cell)&&this.forceUpdate()})}get color(){var e,i;const s=this.props.representation.cell;if("uniform"===(null===(e=s.transform.params)||void 0===e?void 0:e.colorTheme.name))return null===(i=s.transform.params)||void 0===i?void 0:i.colorTheme.params.value}render(){var e,i,s;const l=this.props.representation.cell,u=this.color;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[void 0!==u&&(0,p.jsx)(L.$n,{style:{backgroundColor:wt.Q1.toStyle(u),minWidth:32,width:32},onClick:this.toggleColor}),(0,p.jsxs)(L.$n,{noOverflow:!0,className:"msp-control-button-label",title:`${null===(e=l.obj)||void 0===e?void 0:e.label}. Click to focus.`,onClick:this.focus,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlign:"left"},children:[null===(i=l.obj)||void 0===i?void 0:i.label,(0,p.jsx)("small",{className:"msp-25-lower-contrast-text",style:{float:"right"},children:null===(s=l.obj)||void 0===s?void 0:s.description})]}),(0,p.jsx)(L.K0,{svg:l.state.isHidden?I.qF:I.zs,toggleState:!1,onClick:this.toggleVisible,title:(l.state.isHidden?"Show":"Hide")+" component",small:!0,className:"msp-form-control",flex:!0}),(0,p.jsx)(L.K0,{svg:I.mf,onClick:this.remove,title:"Remove",small:!0}),(0,p.jsx)(L.K0,{svg:I.cv,onClick:this.toggleUpdate,title:"Actions",toggleState:"update"===this.state.action})]}),"update"===this.state.action&&!!l.parent&&(0,p.jsx)("div",{style:{marginBottom:"6px"},className:"msp-accent-offset",children:(0,p.jsx)(pi,{state:l.parent,transform:l.transform,customHeader:"none",noMargin:!0})}),"select-color"===this.state.action&&void 0!==u&&(0,p.jsx)("div",{style:{marginBottom:"6px",marginTop:1},className:"msp-accent-offset",children:(0,p.jsx)(L.tW,{header:"Select Color",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleColor,topRightIcon:I.X6,noTopMargin:!0,childrenClassName:"msp-viewport-controls-panel-controls",children:(0,p.jsx)(Os.cq,{param:Hc,value:this.color,onChange:this.updateColor,name:"color",hideNameRow:!0})})})]})}}const Hc=Q.t.Color((0,wt.Q1)(1184274));var yt,r,Ya=F(6220),nt=F(6639),it=F(1778);function Za(r,e){if(Math.abs(r)>Math.abs(e)){const i=e/r;return Math.abs(r)*Math.sqrt(1+i*i)}if(0!==e){const i=r/e;return Math.abs(e)*Math.sqrt(1+i*i)}return 0}(r=yt||(yt={})).createCache=function e(s){return{size:s,matrix:it.u.create(s,s),eigenValues:new Float64Array(s),D:new Float64Array(s),E:new Float64Array(s)}},r.compute=function i(s){!function Dn(r,e,i,s,l){for(let c=0;c0;l--){let u=0,c=0;for(let h=0;h0&&(f=-f),i[l]=u*f,c-=h*f,e[l-1]=h-f;for(let g=0;gf){let g=0;do{g+=1;let x=e[f],w=(e[f+1]-x)/(2*i[f]),b=Za(w,1);w<0&&(b=-b),e[f]=i[f]/(w+b),e[f+1]=i[f]*(w+b);const C=e[f+1];let N=x-e[f];for(let H=f+2;H=f;H--){O=D,D=V,ae=X,x=V*i[H],N=V*w,b=Za(w,i[H]),i[H+1]=X*b,X=i[H]/b,V=w/b,w=V*e[H]-X*x,e[H+1]=N+X*(V*x+X*e[H]);for(let ve=0;ve=1e3)throw new Error("SVD: Not converging.")}while(Math.abs(i[f])>h*c)}e[f]=e[f]+u,i[f]=0}for(let f=0;f"u"&&(l={bTransform:nt.$.zero(),rmsd:0}),function _c(r){const e=function Vc(r){const e=r.evdCache.matrix;it.u.makeZero(e);const i=r.a.x,s=r.a.y,l=r.a.z,u=r.b.x,c=r.b.y,h=r.b.z,f=r.centerA,y=r.centerB;let g=0;const x=Math.min(r.a.x.length,r.b.x.length);for(let w=0;w{i=0;const c={};u.forEach(h=>c[r[i++]]=h),l[r[s++]]=c}),l}const vt={blosum62:Ct("ARNDCQEGHILKMFPSTWYVBZX",[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1]]),blosum62x:Ct("ACDEFGHIKLMNPQRSTVWY",[[4,0,-2,-1,-2,0,-2,-1,-1,-1,-1,-2,-1,-1,-1,1,0,0,-3,-2],[0,9,-3,-4,-2,-3,-3,-1,-3,-1,-1,-3,-3,-3,-3,-1,-1,-1,-2,-2],[-2,-3,6,2,-3,-1,-1,-3,-1,-4,-3,1,-1,0,-2,0,-1,-3,-4,-3],[-1,-4,2,5,-3,-2,0,-3,1,-3,-2,0,-1,2,0,0,-1,-2,-3,-2],[-2,-2,-3,-3,6,-3,-1,0,-3,0,0,-3,-4,-3,-3,-2,-2,-1,1,3],[0,-3,-1,-2,-3,6,-2,-4,-2,-4,-3,0,-2,-2,-2,0,-2,-3,-2,-3],[-2,-3,-1,0,-1,-2,8,-3,-1,-3,-2,1,-2,0,0,-1,-2,-3,-2,2],[-1,-1,-3,-3,0,-4,-3,4,-3,2,1,-3,-3,-3,-3,-2,-1,3,-3,-1],[-1,-3,-1,1,-3,-2,-1,-3,5,-2,-1,0,-1,1,2,0,-1,-2,-3,-2],[-1,-1,-4,-3,0,-4,-3,2,-2,4,2,-3,-3,-2,-2,-2,-1,1,-2,-1],[-1,-1,-3,-2,0,-3,-2,1,-1,2,5,-2,-2,0,-1,-1,-1,1,-1,-1],[-2,-3,1,0,-3,0,1,-3,0,-3,-2,6,-2,0,0,1,0,-3,-4,-2],[-1,-3,-1,-1,-4,-2,-2,-3,-1,-3,-2,-2,7,-1,-2,-1,-1,-2,-4,-3],[-1,-3,0,2,-3,-2,0,-3,1,-2,0,0,-1,5,1,0,-1,-2,-2,-1],[-1,-3,-2,0,-3,-2,0,-3,2,-2,-1,0,-2,1,5,-1,-1,-3,-3,-2],[1,-1,0,0,-2,0,-1,-2,0,-2,-1,1,-1,0,-1,4,1,-2,-3,-2],[0,-1,-1,-1,-2,-2,-2,-1,-1,-1,-1,0,-1,-1,-1,1,5,0,-2,-2],[0,-1,-3,-2,-1,-3,-3,3,-2,1,1,-3,-2,-2,-3,-2,0,4,-3,-1],[-3,-2,-4,-3,1,-2,-2,-3,-3,-2,-1,-4,-4,-2,-3,-3,-2,-3,11,2],[-2,-2,-3,-2,3,-3,2,-1,-2,-1,-1,-2,-3,-1,-2,-2,-2,-1,2,7]])},Ot={gapPenalty:-11,gapExtensionPenalty:-1,substMatrix:"default"};class qr{constructor(e,i,s){this.seqA=e,this.seqB=i,this.S=[],this.V=[],this.H=[],this.gapPenalty=s.gapPenalty,this.gapExtensionPenalty=s.gapExtensionPenalty,this.substMatrix="default"===s.substMatrix?void 0:vt[s.substMatrix],this.n=this.seqA.length,this.m=this.seqB.length}initMatrices(){const{n:e,m:i,gapPenalty:s,S:l,V:u,H:c}=this;for(let h=0;h<=e;++h){l[h]=[],u[h]=[],c[h]=[];for(let f=0;f<=i;++f)l[h][f]=0,u[h][f]=0,c[h][f]=0}for(let h=0;h<=e;++h)l[h][0]=s,c[h][0]=-1/0;for(let h=0;h<=i;++h)l[0][h]=s,u[0][h]=-1/0;l[0][0]=0}makeScoreFn(){const{seqA:e,seqB:i,substMatrix:s}=this;return s?function(u,c){var h,f;return null!==(f=null===(h=s[e[u]])||void 0===h?void 0:h[i[c]])&&void 0!==f?f:-4}:function(u,c){return e[u]===i[c]?5:-3}}calculate(){this.initMatrices();const e=this.makeScoreFn(),{V:i,H:s,S:l,n:u,m:c,gapExtensionPenalty:h,gapPenalty:f}=this;let y,g,x,w,b;for(let C=1;C<=u;++C){g=l[C-1],y=i[C-1],x=i[C],w=s[C],b=l[C];for(let N=1;N<=c;++N)x[N]=Math.max(g[N]+f,y[N]+h),w[N]=Math.max(b[N-1]+f,w[N-1]+h),b[N]=Math.max(g[N-1]+e(C-1,N-1),x[N],w[N])}}trace(){const e=this.makeScoreFn(),{V:i,H:s,S:l,seqA:u,seqB:c,gapExtensionPenalty:h,gapPenalty:f}=this;let x,w,y=this.n,g=this.m,b="",C="";for(l[y][g]>=i[y][g]?(x="S",w=l[y][g]):i[y][g]>=s[y][g]?(x="V",w=i[y][g]):(x="H",w=s[y][g]);y>0&&g>0;)"S"===x?l[y][g]===l[y-1][g-1]+e(y-1,g-1)?(b=u[y-1]+b,C=c[g-1]+C,--y,--g,x="S"):l[y][g]===i[y][g]?x="V":l[y][g]===s[y][g]?x="H":(--y,--g):"V"===x?i[y][g]===i[y-1][g]+h?(b=u[y-1]+b,C="-"+C,--y,x="V"):i[y][g]===l[y-1][g]+f?(b=u[y-1]+b,C="-"+C,--y,x="S"):--y:"H"===x&&(s[y][g]===s[y][g-1]+h?(b="-"+b,C=c[g-1]+C,--g,x="H"):s[y][g]===l[y][g-1]+f?(b="-"+b,C=c[g-1]+C,--g,x="S"):--g);for(;y>0;)b=u[y-1]+b,C="-"+C,--y;for(;g>0;)b="-"+b,C=c[g-1]+C,--g;return{aliA:b,aliB:C,score:w}}}var dt;function Pi(r){return r.model.sequence.byEntityKey[function Rs(r){switch(r.kind){case 0:return r.model.atomicHierarchy.index.getEntityFromChain(r.chainIndex[r.elements[0]]);case 1:return r.model.coarseHierarchy.spheres.entityKey[r.elements[0]];case 2:return r.model.coarseHierarchy.gaussians.entityKey[r.elements[0]]}}(r)].sequence}!function(r){function e(s){const l=new Map;if(Ja.Nf.isAtomic(s.unit)){const{label_seq_id:u}=s.unit.model.atomicHierarchy.residues,{residueIndex:c}=s.unit;for(let h=0,f=Ce.CD.size(s.indices);h=e)break}if(s>=e)break}return i}function el(r,e,i,s){const l=Tt.Positions.empty(s),u=Tt.Positions.empty(s);let c=0;for(const{pivots:h}of r){const f=h[e],y=h[i];if(!f||!y)continue;const g=Math.min(f[2]-f[1],y[2]-y[1]);for(let x=0;x=0?B:X,!l(u,O,X,ae))continue;const H=`${g[O]}-${x[O]}-${w[O]}`;if(e.has(H)){const ve=e.get(H);ve.pivots[i]||(ve.pivots[i]=[c,X,ae])}else e.set(H,{key:H,pivots:{[i]:[c,X,ae]}})}}}}class Ni extends Z.VK{defaultState(){return{isCollapsed:!1,header:"Superposition",brand:{accent:"gray",svg:I.lj},isHidden:!0}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,e=>{this.setState({isHidden:e.structures.length<2})})}renderControls(){return(0,p.jsx)(p.Fragment,{children:(0,p.jsx)(nl,{})})}}const Bs={alignSequences:Q.t.Boolean(!0,{isEssential:!0,description:"For Chain-based 3D superposition, perform a sequence alignment and use the aligned residue pairs to guide the 3D superposition."}),traceOnly:Q.t.Boolean(!0,{description:"For Chain- and Uniprot-based 3D superposition, base superposition only on CA (and equivalent) atoms."})},Hs=Q.t.getDefaultValues(Bs);class nl extends Z.jB{constructor(){var e;super(...arguments),e=this,this.state={isBusy:!1,canUseDb:!1,action:void 0,options:Hs},this.superposeChains=(0,R.A)(function*(){var i,s,l;const{query:u}=e.state.options.traceOnly?Zi.Ou.trace:Zi.Ou.polymer,c=e.chainEntries,h=c.map(w=>{const b=z.iZ.Loci.toStructure(w.loci),C=z.cv.toLociWithSourceUnits(u(new z.cY(b)));return z.iZ.Loci.remap(C,e.getRootStructure(w.loci.structure))}),f=e.plugin.managers.structure.hierarchy.findStructure(null===(i=h[0])||void 0===i?void 0:i.structure),y=null===(l=null===(s=f?.transform)||void 0===s?void 0:s.cell.obj)||void 0===l?void 0:l.data.coordinateSystem,g=e.state.options.alignSequences?function rn(r){const e=[];if(r.length<=0)return e;const i=tr.i.Loci.getFirstLocation(r[0]),l=Xo.Z.entity.subtype(i).match(Fs)?"blosum62":"default";for(let u=1;uz.iZ.Loci.remap(x.loci,e.getRootStructure(x.loci.structure))),h=Jo(c),f=e.plugin.managers.structure.hierarchy.findStructure(null===(i=c[0])||void 0===i?void 0:i.structure),y=null===(l=null===(s=f?.transform)||void 0===s?void 0:s.cell.obj)||void 0===l?void 0:l.data.coordinateSystem,g=u[0];for(let x=1,w=c.length;x{var N;return null===(N=C.cell.obj)||void 0===N?void 0:N.data}),{entries:f,failedPairs:y,zeroOverlapPairs:g}=function hi(r,e){var i,s;const l=new Map;for(let g=0;g`[${C.map(([N,V])=>`(${h[N].models[0].entryId}, ${h[V].models[0].entryId})`).join(", ")}]`;g.length&&e.plugin.log.warn(`Superposition: No UNIPROT mapping overlap between structures ${b(g)}.`),y.length&&e.plugin.log.error(`Superposition: Failed to superpose structures ${b(y)}.`),f.length&&(e.plugin.log.info(`Superposed ${f.length+1} structures with avg. RMSD ${w.toFixed(2)} \xc5.`),yield e.cameraReset())}),this.toggleByChains=()=>this.setState({action:"byChains"===this.state.action?void 0:"byChains"}),this.toggleByAtoms=()=>this.setState({action:"byAtoms"===this.state.action?void 0:"byAtoms"}),this.toggleOptions=()=>this.setState({action:"options"===this.state.action?void 0:"options"}),this.setOptions=i=>{this.setState({options:i})}}componentDidMount(){this.subscribe(this.selection.events.changed,()=>{this.forceUpdate()}),this.subscribe(this.selection.events.additionsHistoryUpdated,()=>{this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState({isBusy:e})}),this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,e=>{this.setState({canUseDb:e.structures.every(i=>{var s;return!(null===(s=i.cell.obj)||void 0===s||!s.data)&&i.cell.obj.data.models.some(l=>Ya.W.Provider.isApplicable(l))})})})}get selection(){return this.plugin.managers.structure.selection}transform(e,i,s){var l=this;return(0,R.A)(function*(){const u=tt.so.resolveAndCheck(l.plugin.state.data,e);if(!u)return;const c=l.plugin.state.data.selectQ(g=>g.byRef(u.transform.ref).subtree().withTransformer(jt.f.Model.TransformStructureConformation))[0],f={transform:{name:"matrix",params:{data:s&&!bt.$I.isIdentity(s.matrix)?bt.$I.mul((0,bt.$I)(),s.matrix,i):i,transpose:!1}}},y=c?l.plugin.state.data.build().to(c).update(f):l.plugin.state.data.build().to(e).insert(jt.f.Model.TransformStructureConformation,f,{tags:"SuperpositionTransform"});yield l.plugin.runTask(l.plugin.state.data.updateTree(y))})()}getRootStructure(e){var i;const s=this.plugin.helpers.substructureParent.get(e);return null===(i=this.plugin.state.data.selectQ(l=>l.byValue(s).rootOfType(we.O.Molecule.Structure))[0].obj)||void 0===i?void 0:i.data}cameraReset(){var e=this;return(0,R.A)(function*(){yield new Promise(i=>requestAnimationFrame(i)),ue.a.Camera.Reset(e.plugin)})()}highlight(e){this.plugin.managers.interactivity.lociHighlights.highlightOnly({loci:e},!1)}moveHistory(e,i){this.plugin.managers.structure.selection.modifyHistory(e,i,void 0,!0)}focusLoci(e){this.plugin.managers.camera.focusLoci(e)}lociEntry(e,i){return(0,p.jsx)("div",{className:"msp-flex-row",children:(0,p.jsx)(L.$n,{noOverflow:!0,title:"Click to focus. Hover to highlight.",onClick:()=>this.focusLoci(e.loci),style:{width:"auto",textAlign:"left"},onMouseEnter:()=>this.highlight(e.loci),onMouseLeave:()=>this.plugin.managers.interactivity.lociHighlights.clearHighlights(),children:(0,p.jsx)("span",{dangerouslySetInnerHTML:{__html:e.label}})})},i)}historyEntry(e,i){const s=this.plugin.managers.structure.selection.additionsHistory;return(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsxs)(L.$n,{noOverflow:!0,title:"Click to focus. Hover to highlight.",onClick:()=>this.focusLoci(e.loci),style:{width:"auto",textAlign:"left"},onMouseEnter:()=>this.highlight(e.loci),onMouseLeave:()=>this.plugin.managers.interactivity.lociHighlights.clearHighlights(),children:[i,". ",(0,p.jsx)("span",{dangerouslySetInnerHTML:{__html:e.label}})]}),s.length>1&&(0,p.jsx)(L.K0,{svg:I.p8,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(e,"up"),flex:"20px",title:"Move up"}),s.length>1&&(0,p.jsx)(L.K0,{svg:I.qp,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(e,"down"),flex:"20px",title:"Move down"}),(0,p.jsx)(L.K0,{svg:I.mf,small:!0,className:"msp-form-control",onClick:()=>this.plugin.managers.structure.selection.modifyHistory(e,"remove"),flex:!0,title:"Remove"})]},e.id)}atomsLociEntry(e,i){return(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{className:"msp-control-group-header",children:(0,p.jsx)("div",{className:"msp-no-overflow",title:e.label,children:e.label})}),(0,p.jsx)("div",{className:"msp-control-offset",children:e.atoms.map((s,l)=>this.historyEntry(s,l))})]},i)}get chainEntries(){const e=z.iZ.Location.create(),i=[];return this.plugin.managers.structure.selection.entries.forEach(({selection:s},l)=>{const u=tt.so.resolveAndCheck(this.plugin.state.data,l);if(!u||z.iZ.Loci.isEmpty(s))return;const c=z.iZ.Loci.getFirstLocation(s,e);if(s.elements.length>1||"polymer"!==z.StructureProperties.entity.type(c))return;const h=z.iZ.Stats.ofLoci(s),f=(0,Nn.d_)(h,{countsOnly:!0}),y=(0,Nn.BB)(c,{reverse:!0,granularity:"chain"}).split("|");i.push({loci:s,label:`${f} | ${y[0]} | ${y[y.length-1]}`,cell:u})}),i}get atomEntries(){const e=new Map,i=this.plugin.managers.structure.selection.additionsHistory;for(let l=0,u=i.length;l{const c=this.plugin.helpers.substructureParent.get(u),h=[];for(let g=0,x=l.length;g0&&(0,p.jsx)("div",{className:"msp-control-offset",children:e.map((i,s)=>this.lociEntry(i,s))}),e.length<2&&(0,p.jsx)("div",{className:"msp-control-offset msp-help-text",children:(0,p.jsxs)("div",{className:"msp-help-description",children:[(0,p.jsx)(I.In,{svg:I.ml,inline:!0}),"Add 2 or more selections",this.toggleHint()," from separate structures. Selections must be limited to single polymer chains or residues therein."]})}),e.length>1&&(0,p.jsx)(L.$n,{title:"Superpose structures by selected chains.",className:"msp-btn-commit msp-btn-commit-on",onClick:this.superposeChains,style:{marginTop:"1px"},children:"Superpose"})]})}addByAtoms(){const e=this.atomEntries;return(0,p.jsxs)(p.Fragment,{children:[e.length>0&&(0,p.jsx)("div",{className:"msp-control-offset",children:e.map((i,s)=>this.atomsLociEntry(i,s))}),e.length<2&&(0,p.jsx)("div",{className:"msp-control-offset msp-help-text",children:(0,p.jsxs)("div",{className:"msp-help-description",children:[(0,p.jsx)(I.In,{svg:I.ml,inline:!0}),"Add 1 or more selections",this.toggleHint()," from separate structures. Selections must be limited to single atoms."]})}),e.length>1&&(0,p.jsx)(L.$n,{title:"Superpose structures by selected atoms.",className:"msp-btn-commit msp-btn-commit-on",onClick:this.superposeAtoms,style:{marginTop:"1px"},children:"Superpose"})]})}superposeByDbMapping(){return(0,p.jsx)(p.Fragment,{children:(0,p.jsx)(L.$n,{icon:I.$8,title:"Superpose structures using intersection of residues from SIFTS UNIPROT mapping.",className:"msp-btn msp-btn-block",onClick:this.superposeDb,style:{marginTop:"1px"},disabled:this.state.isBusy,children:"Uniprot"})})}render(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.ff,{icon:I.$8,label:"Chains",toggle:this.toggleByChains,isSelected:"byChains"===this.state.action,disabled:this.state.isBusy}),(0,p.jsx)(L.ff,{icon:I.z7,label:"Atoms",toggle:this.toggleByAtoms,isSelected:"byAtoms"===this.state.action,disabled:this.state.isBusy}),this.state.canUseDb&&this.superposeByDbMapping(),(0,p.jsx)(L.ff,{icon:I.Hk,label:"",title:"Options",toggle:this.toggleOptions,isSelected:"options"===this.state.action,disabled:this.state.isBusy,style:{flex:"0 0 40px",padding:0}})]}),"byChains"===this.state.action&&this.addByChains(),"byAtoms"===this.state.action&&this.addByAtoms(),"options"===this.state.action&&(0,p.jsx)("div",{className:"msp-control-offset",children:(0,p.jsx)($e.y1,{params:Bs,values:this.state.options,onChangeValues:this.setOptions,isDisabled:this.state.isBusy})})]})}}var Us=F(9880),Gt=F(3099);class Mi extends Z.VK{defaultState(){return{isCollapsed:!1,header:"Quick Styles",brand:{accent:"gray",svg:I._c}}}renderControls(){return(0,p.jsx)(p.Fragment,{children:(0,p.jsx)(zn,{})})}}class zn extends Z.jB{default(){var e=this;return(0,R.A)(function*(){const{structures:i}=e.plugin.managers.structure.hierarchy.selection,s=e.plugin.config.get(Bt.AB.Structure.DefaultRepresentationPreset)||Us.Bj.auto.id,l=e.plugin.builders.structure.representation.resolveProvider(s);if(yield e.plugin.managers.structure.component.applyPreset(i,l),e.plugin.managers.structure.component.setOptions(Q.t.getDefaultValues(Br.C.OptionsParams)),e.plugin.canvas3d){const u=Q.t.getDefaultValues(Gt.co);e.plugin.canvas3d.setProps({postprocessing:{outline:u.outline,occlusion:u.occlusion}})}})()}illustrative(){var e=this;return(0,R.A)(function*(){const{structures:i}=e.plugin.managers.structure.hierarchy.selection;yield e.plugin.managers.structure.component.applyPreset(i,Us.Bj.illustrative),e.plugin.canvas3d&&e.plugin.canvas3d.setProps({postprocessing:{outline:{name:"on",params:{scale:1,color:(0,wt.Q1)(0),threshold:.25,includeTransparent:!0}},occlusion:{name:"on",params:{multiScale:{name:"off",params:{}},radius:5,bias:.8,blurKernelSize:15,samples:32,resolutionScale:1,color:(0,wt.Q1)(0)}},shadow:{name:"off",params:{}}}})})()}stylized(){var e=this;return(0,R.A)(function*(){if(e.plugin.managers.structure.component.setOptions({...e.plugin.managers.structure.component.state.options,ignoreLight:!0}),e.plugin.canvas3d){const i=e.plugin.canvas3d.props.postprocessing;e.plugin.canvas3d.setProps({postprocessing:{outline:{name:"on",params:"on"===i.outline.name?i.outline.params:{scale:1,color:(0,wt.Q1)(0),threshold:.33,includeTransparent:!0}},occlusion:{name:"on",params:"on"===i.occlusion.name?i.occlusion.params:{multiScale:{name:"off",params:{}},radius:5,bias:.8,blurKernelSize:15,samples:32,resolutionScale:1,color:(0,wt.Q1)(0)}},shadow:{name:"off",params:{}}}})}})()}render(){return(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.$n,{noOverflow:!0,title:"Applies default representation preset. Set outline and occlusion effects to defaults.",onClick:()=>this.default(),style:{width:"auto"},children:"Default"}),(0,p.jsx)(L.$n,{noOverflow:!0,title:"Applies no representation preset. Enables outline and occlusion effects. Enables ignore-light representation parameter.",onClick:()=>this.stylized(),style:{width:"auto"},children:"Stylized"}),(0,p.jsx)(L.$n,{noOverflow:!0,title:"Applies illustrative representation preset. Enables outline and occlusion effects. Enables ignore-light parameter.",onClick:()=>this.illustrative(),style:{width:"auto"},children:"Illustrative"})]})}}class sn extends Z.dL{constructor(){super(...arguments),this.state={show:!1,label:""},this.update=()=>{const e=this.plugin.state.data,i=e.selectQ(c=>c.ofTransformer(jt.f.Model.ModelFromTrajectory));if(0===i.length)return void this.setState({show:!1});let s="",l=0;const u=new Set;for(const c of i){if(!c.sourceRef)continue;const h=e.cells.get(c.sourceRef).obj;if(h&&h.data.frameCount>1){if(u.has(c.sourceRef))return void this.setState({show:!1});u.add(c.sourceRef),l++,s||(s=`Model ${c.transform.params.modelIndex+1} / ${h.data.frameCount}`)}}l>1&&(s=""),this.setState({show:l>0,label:s})},this.reset=()=>ue.a.State.ApplyAction(this.plugin,{state:this.plugin.state.data,action:Uo.UpdateTrajectory.create({action:"reset"})}),this.prev=()=>ue.a.State.ApplyAction(this.plugin,{state:this.plugin.state.data,action:Uo.UpdateTrajectory.create({action:"advance",by:-1})}),this.next=()=>ue.a.State.ApplyAction(this.plugin,{state:this.plugin.state.data,action:Uo.UpdateTrajectory.create({action:"advance",by:1})})}componentDidMount(){this.subscribe(this.plugin.state.data.events.changed,this.update),this.subscribe(this.plugin.behaviors.state.isAnimating,this.update)}render(){const e=this.plugin.behaviors.state.isAnimating.value;return!this.state.show||e&&!this.state.label||!this.plugin.config.get(Bt.AB.Viewport.ShowTrajectoryControls)?null:(0,p.jsxs)("div",{className:"msp-traj-controls",children:[!e&&(0,p.jsx)(L.K0,{svg:I.je,title:"First Model",onClick:this.reset,disabled:e}),!e&&(0,p.jsx)(L.K0,{svg:I.d6,title:"Previous Model",onClick:this.prev,disabled:e}),!e&&(0,p.jsx)(L.K0,{svg:I.xf,title:"Next Model",onClick:this.next,disabled:e}),!!this.state.label&&(0,p.jsx)("span",{children:this.state.label})]})}}class Wc extends Z.dL{constructor(){super(...arguments),this.state={isBusy:!1,show:!0},this.keyUp=e=>{if(!e.ctrlKey||this.state.isBusy||e.target!==document.body)return;const i=this.plugin.managers.snapshot;if(37===e.keyCode||"ArrowLeft"===e.key)i.state.isPlaying&&i.stop(),this.prev();else if(38===e.keyCode||"ArrowUp"===e.key){if(i.state.isPlaying&&i.stop(),0===i.state.entries.size)return;const s=i.state.entries.get(0);this.update(s.snapshot.id)}else if(39===e.keyCode||"ArrowRight"===e.key)i.state.isPlaying&&i.stop(),this.next();else if(40===e.keyCode||"ArrowDown"===e.key){if(i.state.isPlaying&&i.stop(),0===i.state.entries.size)return;const s=i.state.entries.get(i.state.entries.size-1);this.update(s.snapshot.id)}},this.change=e=>{"none"!==e.target.value&&this.update(e.target.value)},this.prev=()=>{const e=this.plugin.managers.snapshot,i=e.getNextId(e.state.current,-1);i&&this.update(i)},this.next=()=>{const e=this.plugin.managers.snapshot,i=e.getNextId(e.state.current,1);i&&this.update(i)},this.togglePlay=()=>{this.plugin.managers.snapshot.togglePlay()}}componentDidMount(){this.subscribe(this.plugin.managers.snapshot.events.changed,()=>this.forceUpdate()),this.subscribe(this.plugin.behaviors.state.isBusy,e=>this.setState({isBusy:e})),this.subscribe(this.plugin.behaviors.state.isAnimating,e=>this.setState({isBusy:e})),window.addEventListener("keyup",this.keyUp,!1)}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener("keyup",this.keyUp,!1)}update(e){var i=this;return(0,R.A)(function*(){i.setState({isBusy:!0}),yield ue.a.State.Snapshots.Apply(i.plugin,{id:e}),i.setState({isBusy:!1})})()}render(){const e=this.plugin.managers.snapshot,i=e.state.entries.size;if(i<2||!this.state.show)return null;const s=e.state.current,l=e.state.isPlaying;return(0,p.jsxs)("div",{className:"msp-state-snapshot-viewport-controls",children:[(0,p.jsxs)("select",{className:"msp-form-control",value:s||"none",onChange:this.change,disabled:this.state.isBusy||l,children:[!s&&(0,p.jsx)("option",{value:"none"},"none"),e.state.entries.valueSeq().map((u,c)=>(0,p.jsxs)("option",{value:u.snapshot.id,children:[`[${c+1}/${i}]`," ",u.name||new Date(u.timestamp).toLocaleString()]},u.snapshot.id))]}),(0,p.jsx)(L.K0,{svg:l?I.xY:I.M6,title:l?"Pause":"Cycle States",onClick:this.togglePlay,disabled:!l&&this.state.isBusy}),!l&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.K0,{svg:I.d6,title:"Previous State",onClick:this.prev,disabled:this.state.isBusy||l}),(0,p.jsx)(L.K0,{svg:I.xf,title:"Next State",onClick:this.next,disabled:this.state.isBusy||l})]})]})}}function iu(){var r;const e=he.useContext(Z.aU),[i,s]=he.useState(0);he.useEffect(()=>{const c=e.managers.snapshot.events.changed.subscribe(()=>s(h=>h+1));return()=>c.unsubscribe()},[e]);const l=e.managers.snapshot.state.current;if(!l)return null;const u=e.managers.snapshot.getEntry(l);return null!==(r=u?.description)&&void 0!==r&&r.trim()?(0,p.jsx)("div",{className:"msp-snapshot-description-wrapper",children:(0,p.jsx)(Da,{skipHtml:!0,components:{a:ru},children:u.description})}):null}function ru({href:r,children:e,element:i}){const s=he.useContext(Z.aU);return r&&"#"===r[0]?(0,p.jsx)("a",{href:"#",onClick:l=>{l.preventDefault(),s.managers.snapshot.applyKey(r.substring(1))},children:e}):i}class ud extends Z.dL{constructor(){super(...arguments),this.state={isEmpty:!0,isExpanded:!1,isBusy:!1,isAnimating:!1,isPlaying:!1},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded}),this.stop=()=>{this.plugin.managers.animation.stop(),this.plugin.managers.snapshot.stop()}}componentDidMount(){this.subscribe(this.plugin.managers.snapshot.events.changed,()=>{this.setState(this.plugin.managers.snapshot.state.isPlaying?{isPlaying:!0,isExpanded:!1}:{isPlaying:!1})}),this.subscribe(this.plugin.behaviors.state.isBusy,e=>{this.setState(e?{isBusy:!0,isExpanded:!1,isEmpty:this.plugin.state.data.tree.transforms.size<2}:{isBusy:!1,isEmpty:this.plugin.state.data.tree.transforms.size<2})}),this.subscribe(this.plugin.behaviors.state.isAnimating,e=>{this.setState(e?{isAnimating:!0,isExpanded:!1}:{isAnimating:!1})})}render(){const e=this.plugin.managers.snapshot.state.isPlaying;if(e||this.state.isEmpty||this.plugin.managers.animation.isEmpty||!this.plugin.config.get(Bt.AB.Viewport.ShowAnimation))return null;const i=this.state.isAnimating;return(0,p.jsxs)("div",{className:"msp-animation-viewport-controls",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{className:"msp-semi-transparent-background"}),(0,p.jsx)(L.K0,{svg:i||e?I.xY:I.NT,transparent:!0,title:i?"Stop":"Select Animation",onClick:i||e?this.stop:this.toggleExpanded,toggleState:this.state.isExpanded,disabled:!i&&!e&&(this.state.isBusy||this.state.isPlaying||this.state.isEmpty)})]}),this.state.isExpanded&&!this.state.isBusy&&(0,p.jsx)("div",{className:"msp-animation-viewport-controls-select",children:(0,p.jsx)(jc,{onStart:this.toggleExpanded})})]})}}class Di extends Z.dL{componentDidMount(){this.subscribe(this.plugin.behaviors.interaction.selectionMode,()=>this.forceUpdate())}render(){return this.plugin.selectionMode?(0,p.jsx)("div",{className:"msp-selection-viewport-controls",children:(0,p.jsx)(Ka,{})}):null}}class Kc extends Z.dL{constructor(){super(...arguments),this.state={labels:[]}}componentDidMount(){this.subscribe(this.plugin.behaviors.labels.highlight,e=>this.setState({labels:e.labels}))}render(){return 0===this.state.labels.length?null:(0,p.jsx)("div",{className:"msp-highlight-info",children:this.state.labels.map((e,i)=>e.indexOf("\n")>0?(0,p.jsx)("div",{className:"msp-highlight-markdown-row",children:(0,p.jsx)(Da,{skipHtml:!0,children:e})},""+i):(0,p.jsx)("div",{className:"msp-highlight-simple-row",dangerouslySetInnerHTML:{__html:e}},""+i))})}}class su extends Z.dL{componentDidMount(){this.subscribe(this.plugin.state.behaviors.events.changed,()=>this.forceUpdate())}render(){const e=[];return this.plugin.customStructureControls.forEach((i,s)=>{e.push((0,p.jsx)(i,{initiallyCollapsed:this.props.initiallyCollapsed},s))}),e.length>0?(0,p.jsx)(p.Fragment,{children:e}):null}}class ir extends Z.dL{render(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-section-header",children:[(0,p.jsx)(I.In,{svg:I.RZ}),"Structure Tools"]}),(0,p.jsx)(od,{}),(0,p.jsx)($a,{}),(0,p.jsx)(Ni,{}),(0,p.jsx)(Mi,{}),(0,p.jsx)(Fa,{}),this.plugin.config.get(Bt.AB.VolumeStreaming.Enabled)&&(0,p.jsx)(Yo,{}),(0,p.jsx)(Ga,{}),(0,p.jsx)(su,{})]})}}var Wr=F(3386),ut=F(3177);class $c extends Z.dL{get current(){return this.props.state.behaviors.currentObject.value}componentDidMount(){this.subscribe(this.plugin.state.events.object.updated,({ref:e,state:i})=>{const s=this.current;s.ref!==e||s.state!==i||this.forceUpdate()}),this.subscribe(this.plugin.state.data.actions.events.added,()=>this.forceUpdate()),this.subscribe(this.plugin.state.data.actions.events.removed,()=>this.forceUpdate())}render(){const{state:e,nodeRef:i}=this.props,s=e.cells.get(i),l=e.actions.fromCell(s,this.plugin);if(0===l.length)return null;const u=s.transform.transformer.definition,c=s.obj?s.obj.label:u.display&&u.display.name||u.name;return(0,p.jsxs)("div",{className:"msp-state-actions",children:[!this.props.hideHeader&&(0,p.jsxs)("div",{className:"msp-section-header",children:[(0,p.jsx)(I.In,{svg:I.Mm})," ",`Actions (${c})`]}),l.map((h,f)=>(0,p.jsx)(Go,{state:e,action:h,nodeRef:i,initiallyCollapsed:0===f?!this.props.alwaysExpandFirst&&this.props.initiallyCollapsed:this.props.initiallyCollapsed},`${h.id}`))]})}}var Kr=F(39),ou=F(2768),il=F(9854),cd=F(5091);class pd extends Z.dL{render(){var e;return(0,p.jsxs)("div",{children:[(0,p.jsx)(L.X3,{icon:I.e,title:"Plugin State"}),(0,p.jsx)("div",{style:{marginBottom:"10px"},children:(0,p.jsx)(L.Yj,{header:"Save Options",initiallyExpanded:!1,children:(0,p.jsx)(au,{})})}),(0,p.jsx)(Gn,{}),(0,p.jsx)(Gc,{}),(0,p.jsx)(L.X3,{title:"Save as File",accent:"blue"}),(0,p.jsx)(lu,{}),"none"!==(null===(e=this.plugin.spec.components)||void 0===e?void 0:e.remoteState)&&(0,p.jsx)(uu,{})]})}}class lu extends Z.dL{constructor(){super(...arguments),this.downloadToFileJson=()=>{var e,i;null===(i=(e=this.props).onAction)||void 0===i||i.call(e),ue.a.State.Snapshots.DownloadToFile(this.plugin,{type:"json"})},this.downloadToFileZip=()=>{var e,i;null===(i=(e=this.props).onAction)||void 0===i||i.call(e),ue.a.State.Snapshots.DownloadToFile(this.plugin,{type:"zip"})},this.open=e=>{var i,s;e.target.files&&e.target.files[0]?(null===(s=(i=this.props).onAction)||void 0===s||s.call(i),ue.a.State.Snapshots.OpenFile(this.plugin,{file:e.target.files[0]})):this.plugin.log.error("No state file selected")}}render(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.$n,{icon:I.U3,onClick:this.downloadToFileJson,title:"Save the state description. Input data are loaded using the provided sources. Does not work if local files are used as input.",children:"State"}),(0,p.jsx)(L.$n,{icon:I.U3,onClick:this.downloadToFileZip,title:"Save the state including the input data.",children:"Session"}),(0,p.jsxs)("div",{className:"msp-btn msp-btn-block msp-btn-action msp-loader-msp-btn-file",children:[(0,p.jsx)(I.In,{svg:I.sd,inline:!0})," Open ",(0,p.jsx)("input",{onChange:this.open,type:"file",multiple:!1,accept:".molx,.molj"})]})]}),(0,p.jsxs)("div",{className:"msp-help-text",style:{padding:"10px"},children:[(0,p.jsx)(I.In,{svg:I.Rf})," This is an experimental feature and stored states/sessions might not be openable in a future version."]})]})}}class au extends Z.dL{componentDidMount(){this.subscribe(this.plugin.state.snapshotParams,()=>this.forceUpdate())}render(){return(0,p.jsx)($e.y1,{params:ou.p.SnapshotParams,values:this.plugin.state.snapshotParams.value,onChangeValues:this.plugin.state.setSnapshotParams})}}class Gn extends Z.dL{constructor(){super(...arguments),this.state={params:Q.t.getDefaultValues(Gn.Params)},this.add=()=>{ue.a.State.Snapshots.Add(this.plugin,{name:this.state.params.name,description:this.state.params.description})},this.updateParams=e=>this.setState({params:e}),this.clear=()=>{ue.a.State.Snapshots.Clear(this.plugin,{})}}shouldComponentUpdate(e,i){return!(0,Zr.f8)(this.props,e)||!(0,Zr.f8)(this.state,i)}render(){return(0,p.jsx)("div",{children:(0,p.jsx)($r,{parent:this})})}}function Qc(r,e,i){return!!e&&r.managers.snapshot.state.entries.some(s=>(!i||s.snapshot.id!==i)&&s.key===e)}function $r({parent:r}){const[e,i]=he.useState({key:"",name:"",description:""}),s=()=>{ue.a.State.Snapshots.Add(r.plugin,{key:e.key,name:e.name,description:e.description}),i({key:"",name:"",description:""})},l=Qc(r.plugin,e.key);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lt,{state:e,setState:i,apply:s}),(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.K0,{onClick:r.clear,svg:I.mf,title:"Remove All"}),(0,p.jsx)(L.$n,{onClick:s,icon:l?void 0:I.CR,style:{textAlign:"right"},commit:l?"off":"on",disabled:l,children:l?"Key must be unique":"Add"})]})]})}Gn.Params={name:Q.t.Text(),description:Q.t.Text()};class Gc extends Z.dL{constructor(){super(...arguments),this.state={editingId:void 0},this.edit=e=>{const i=e.currentTarget.getAttribute("data-id");i&&this.setState({editingId:i===this.state.editingId?void 0:i})},this.doneEdit=()=>this.setState({editingId:void 0}),this.apply=e=>{const i=e.currentTarget.getAttribute("data-id");i&&ue.a.State.Snapshots.Apply(this.plugin,{id:i})},this.remove=e=>{const i=e.currentTarget.getAttribute("data-id");i&&ue.a.State.Snapshots.Remove(this.plugin,{id:i})},this.moveUp=e=>{const i=e.currentTarget.getAttribute("data-id");i&&ue.a.State.Snapshots.Move(this.plugin,{id:i,dir:-1})},this.moveDown=e=>{const i=e.currentTarget.getAttribute("data-id");i&&ue.a.State.Snapshots.Move(this.plugin,{id:i,dir:1})},this.replace=e=>{const i=e.currentTarget.getAttribute("data-id");i&&ue.a.State.Snapshots.Replace(this.plugin,{id:i})}}componentDidMount(){this.subscribe(this.plugin.managers.snapshot.events.changed,()=>this.forceUpdate())}render(){const e=this.plugin.managers.snapshot.state.current,i=[];return this.plugin.managers.snapshot.state.entries.forEach(s=>{var l;i.push((0,p.jsxs)("li",{className:"msp-flex-row",children:[(0,p.jsxs)(L.$n,{"data-id":s.snapshot.id,onClick:this.apply,className:"msp-no-overflow",children:[(0,p.jsxs)("span",{style:{fontWeight:s.snapshot.id===e?"bold":void 0},children:[!!s.key&&`[${s.key}] `,s.name||new Date(s.timestamp).toLocaleString()]})," ",(0,p.jsx)("small",{children:`${s.snapshot.durationInMs?(0,il.H)(s.snapshot.durationInMs,!1):""}`})]}),(0,p.jsx)(L.K0,{svg:I.Hk,"data-id":s.snapshot.id,title:"Edit",onClick:this.edit,flex:"28px"}),(0,p.jsx)(L.K0,{svg:I.p8,"data-id":s.snapshot.id,title:"Move Up",onClick:this.moveUp,flex:"20px"}),(0,p.jsx)(L.K0,{svg:I.qp,"data-id":s.snapshot.id,title:"Move Down",onClick:this.moveDown,flex:"20px"}),(0,p.jsx)(L.K0,{svg:I.sy,"data-id":s.snapshot.id,title:"Replace",onClick:this.replace,flex:"20px"}),(0,p.jsx)(L.K0,{svg:I.mf,"data-id":s.snapshot.id,title:"Remove",onClick:this.remove,flex:"20px"})]},s.snapshot.id)),this.state.editingId===s.snapshot.id&&i.push((0,p.jsx)(dd,{entry:s,plugin:this.plugin,done:this.doneEdit},`${s.snapshot.id}-edit`));const u=s.image&&(null===(l=this.plugin.managers.asset.get(s.image))||void 0===l?void 0:l.file);u&&i.push((0,p.jsx)("li",{className:"msp-state-image-row",children:(0,p.jsx)(L.$n,{"data-id":s.snapshot.id,onClick:this.apply,children:(0,p.jsx)("img",{draggable:!1,src:URL.createObjectURL(u)})})},`${s.snapshot.id}-image`))}),(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("ul",{style:{listStyle:"none",marginTop:"10px"},className:"msp-state-list",children:i})})}}function lt({state:r,setState:e,apply:i}){const s=he.useRef(),l=he.useRef(),[u,c]=he.useState(!1);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.eJ,{label:"Name",control:(0,p.jsx)("input",{type:"text",value:r.name,placeholder:"Name",onChange:h=>e({...r,name:h.target.value}),onKeyUp:h=>{var f;"Enter"===h.key&&(null===(f=s.current)||void 0===f||f.focus())}})}),(0,p.jsx)(L.eJ,{label:(0,p.jsxs)(p.Fragment,{children:["Key",(0,p.jsx)($e.Z4,{show:u,toggle:()=>c(h=>!h)})]}),control:(0,p.jsx)("input",{type:"text",ref:s,value:r.key,placeholder:"Key (optional)",onChange:h=>e({...r,key:h.target.value}),onKeyUp:h=>{var f;"Enter"===h.key&&(null===(f=l.current)||void 0===f||f.focus())}})}),u&&(0,p.jsx)("div",{className:"msp-control-offset",children:(0,p.jsx)($e.jH,{description:"Optional snapshot key used to activate snapshots from descriptions, labels, etc."})}),(0,p.jsx)("div",{className:"msp-flex-row msp-text-area-wrapper",style:{marginBottom:1},children:(0,p.jsx)("textarea",{ref:l,placeholder:"Markdown Description\n\n- Use [title](#key) to link to a snapshot",className:"msp-form-control",value:r.description,onChange:h=>e({...r,description:h.target.value}),onKeyUp:h=>{"Enter"===h.key&&h.ctrlKey&&i(r)}})})]})}function dd({entry:r,plugin:e,done:i}){var s,l,u;const[c,h]=he.useState({key:null!==(s=r.key)&&void 0!==s?s:"",name:null!==(l=r.name)&&void 0!==l?l:"",description:null!==(u=r.description)&&void 0!==u?u:""}),f=()=>{e.managers.snapshot.update(r,c),i()},y=Qc(e,c.key,r.snapshot.id);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lt,{state:c,setState:h,apply:f}),(0,p.jsx)("div",{className:"msp-flex-row",style:{marginBottom:1},children:(0,p.jsx)(L.$n,{onClick:f,icon:y?void 0:I.Xq,style:{textAlign:"right"},commit:y?"off":"on",disabled:y,children:y?"Key must be unique":"Apply"})})]})}class uu extends Z.dL{constructor(){var e;super(...arguments),e=this,this.Params={name:Q.t.Text(),options:Q.t.Group({description:Q.t.Text(),playOnLoad:Q.t.Boolean(!1),serverUrl:Q.t.Text(this.plugin.config.get(Bt.AB.State.CurrentServer))})},this.state={params:Q.t.getDefaultValues(this.Params),entries:(0,Kr.uY)(),isBusy:!1},this.ListOnlyParams={options:Q.t.Group({serverUrl:Q.t.Text(this.plugin.config.get(Bt.AB.State.CurrentServer))},{isFlat:!0})},this._mounted=!1,this.refresh=(0,R.A)(function*(){try{e.setState({isBusy:!0}),e.plugin.config.set(Bt.AB.State.CurrentServer,e.state.params.options.serverUrl);const i=(yield e.plugin.runTask(e.plugin.fetch({url:e.serverUrl("list"),type:"json"})))||[];i.sort((l,u)=>l.isSticky===u.isSticky?l.timestamp-u.timestamp:l.isSticky?-1:1);const s=(0,Kr.uY)().asMutable();for(const l of i)s.set(l.id,{...l,url:e.serverUrl(`get/${l.id}`),removeUrl:e.serverUrl(`remove/${l.id}`)});e._mounted&&e.setState({entries:s.asImmutable(),isBusy:!1})}catch(i){console.error(i),e.plugin.log.error("Error fetching remote snapshots"),e._mounted&&e.setState({entries:(0,Kr.uY)(),isBusy:!1})}}),this.upload=(0,R.A)(function*(){e.setState({isBusy:!0}),e.plugin.config.set(Bt.AB.State.CurrentServer,e.state.params.options.serverUrl),yield ue.a.State.Snapshots.Upload(e.plugin,{name:e.state.params.name,description:e.state.params.options.description,playOnLoad:e.state.params.options.playOnLoad,serverUrl:e.state.params.options.serverUrl}),e.plugin.log.message("Snapshot uploaded."),e._mounted&&(e.setState({isBusy:!1}),e.refresh())}),this.fetch=function(){var i=(0,R.A)(function*(s){const l=s.currentTarget.getAttribute("data-id");if(!l)return;const u=e.state.entries.get(l);if(u){e.setState({isBusy:!0});try{yield ue.a.State.Snapshots.Fetch(e.plugin,{url:u.url})}finally{e._mounted&&e.setState({isBusy:!1})}}});return function(s){return i.apply(this,arguments)}}(),this.remove=function(){var i=(0,R.A)(function*(s){const l=s.currentTarget.getAttribute("data-id");if(!l)return;const u=e.state.entries.get(l);if(u){e.setState({entries:e.state.entries.remove(l)});try{yield fetch(u.removeUrl)}catch(c){console.error(c)}}});return function(s){return i.apply(this,arguments)}}()}componentDidMount(){this.refresh(),this._mounted=!0}componentWillUnmount(){super.componentWillUnmount(),this._mounted=!1}serverUrl(e){return e?(0,cd.r)(this.state.params.options.serverUrl,e):this.state.params.options.serverUrl}render(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.X3,{title:"Remote States",accent:"blue"}),!this.props.listOnly&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($e.y1,{params:this.Params,values:this.state.params,onEnter:this.upload,onChange:e=>{this.setState({params:{...this.state.params,[e.name]:e.value}})},isDisabled:this.state.isBusy}),(0,p.jsxs)("div",{className:"msp-flex-row",children:[(0,p.jsx)(L.K0,{onClick:this.refresh,disabled:this.state.isBusy,svg:I.ij}),(0,p.jsx)(L.$n,{icon:I.XI,onClick:this.upload,disabled:this.state.isBusy,commit:!0,children:"Upload"})]})]}),(0,p.jsx)(hd,{entries:this.state.entries,isBusy:this.state.isBusy,serverUrl:this.state.params.options.serverUrl,fetch:this.fetch,remove:this.props.listOnly?void 0:this.remove}),this.props.listOnly&&(0,p.jsxs)("div",{style:{marginTop:"10px"},children:[(0,p.jsx)($e.y1,{params:this.ListOnlyParams,values:this.state.params,onEnter:this.upload,onChange:e=>{this.setState({params:{...this.state.params,[e.name]:e.value}})},isDisabled:this.state.isBusy}),(0,p.jsx)("div",{className:"msp-flex-row",children:(0,p.jsx)(L.$n,{onClick:this.refresh,disabled:this.state.isBusy,icon:I.ij,children:"Refresh"})})]})]})}}class hd extends Z.jB{constructor(){var e;super(...arguments),e=this,this.open=function(){var i=(0,R.A)(function*(s){const l=s.currentTarget.getAttribute("data-id");if(!l)return;const u=e.props.entries.get(l);if(!u)return;s.preventDefault();let c=`${window.location}`;const h=c.indexOf("?");h>0&&(c=c.substr(0,h)),window.open(`${c}?snapshot-url=${encodeURIComponent(u.url)}`,"_blank")});return function(s){return i.apply(this,arguments)}}()}render(){return(0,p.jsx)("ul",{style:{listStyle:"none",marginTop:"10px"},className:"msp-state-list",children:this.props.entries.valueSeq().map(e=>(0,p.jsxs)("li",{className:"msp-flex-row",children:[(0,p.jsxs)(L.$n,{"data-id":e.id,onClick:this.props.fetch,disabled:this.props.isBusy,onContextMenu:this.open,title:"Click to download, right-click to open in a new tab.",children:[e.name||new Date(e.timestamp).toLocaleString()," ",(0,p.jsx)("small",{children:e.description})]}),!e.isSticky&&this.props.remove&&(0,p.jsx)(L.K0,{svg:I.mf,"data-id":e.id,title:"Remove",onClick:this.props.remove,disabled:this.props.isBusy,small:!0})]},e.id))})}}var md=F(152),Yc=F(6323);class cu extends Z.dL{constructor(){super(...arguments),this.state={showActions:!0}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.created,e=>{e.cell.transform.parent===tt.Cn.RootRef&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.removed,e=>{e.parent===tt.Cn.RootRef&&this.forceUpdate()})}static getDerivedStateFromProps(e,i){const u=0===e.state.tree.children.get(e.state.tree.root.ref).size;return i.showActions===u?null:{showActions:u}}render(){const e=this.props.state.tree.root.ref;return this.state.showActions?(0,p.jsxs)("div",{style:{margin:"10px",cursor:"default"},children:[(0,p.jsx)("p",{children:"Nothing to see here yet."}),(0,p.jsxs)("p",{children:["Structures and Volumes can be loaded from the ",(0,p.jsx)(I.In,{svg:I.yf})," tab."]})]}):(0,p.jsx)(On,{cell:this.props.state.cells.get(e),depth:0})}}class On extends Z.dL{constructor(){super(...arguments),this.state={isCollapsed:!!this.props.cell.state.isCollapsed,isNull:On.isNull(this.props.cell),showLabel:On.showLabel(this.props.cell)}}is(e){return e.ref===this.ref&&e.state===this.props.cell.parent}get ref(){return this.props.cell.transform.ref}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,e=>{this.props.cell===e.cell&&this.is(e)&&e.state.cells.has(this.ref)&&(this.state.isCollapsed!==!!e.cell.state.isCollapsed||this.state.isNull!==On.isNull(e.cell)||this.state.showLabel!==On.showLabel(e.cell))&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.created,e=>{this.props.cell.parent===e.state&&this.ref===e.cell.transform.parent&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.removed,e=>{this.props.cell.parent===e.state&&this.ref===e.parent&&this.forceUpdate()})}static getDerivedStateFromProps(e,i){const s=On.isNull(e.cell),l=On.showLabel(e.cell);return!!e.cell.state.isCollapsed===i.isCollapsed&&i.isNull===s&&i.showLabel===l?null:{isCollapsed:!!e.cell.state.isCollapsed,isNull:s,showLabel:l}}static hasDecorator(e){var i;const s=e.parent.tree.children.get(e.transform.ref);return 1===s.size&&!(null===(i=e.parent)||void 0===i||!i.tree.transforms.get(s.first()).transformer.definition.isDecorator)}static isNull(e){return!e||!e.parent||e.obj===tt.BM.Null||!e.parent.tree.transforms.has(e.transform.ref)}static showLabel(e){return e.transform.ref!==tt.Cn.RootRef&&("ok"!==e.status||!e.state.isGhost&&!On.hasDecorator(e))}render(){if(this.state.isNull)return null;const e=this.props.cell,i=e.parent.tree.children.get(this.ref);if(!this.state.showLabel)return 0===i.size?null:(0,p.jsx)(p.Fragment,{children:i.map(l=>(0,p.jsx)(On,{cell:e.parent.cells.get(l),depth:this.props.depth},l))});const s=this.props.depth+1;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Cn,{cell:e,depth:this.props.depth}),0===i.size?void 0:(0,p.jsx)("div",{style:{display:this.state.isCollapsed?"none":"block"},children:i.map(l=>(0,p.jsx)(On,{cell:e.parent.cells.get(l),depth:s},l))})]})}}class Cn extends Z.dL{constructor(){super(...arguments),this.state={isCurrent:this.props.cell.parent.current===this.ref,isCollapsed:!!this.props.cell.state.isCollapsed,action:void 0,currentAction:void 0},this.setCurrent=e=>{e?.preventDefault(),e?.currentTarget.blur(),ue.a.State.SetCurrentObject(this.plugin,{state:this.props.cell.parent,ref:this.ref})},this.setCurrentRoot=e=>{e?.preventDefault(),e?.currentTarget.blur(),ue.a.State.SetCurrentObject(this.plugin,{state:this.props.cell.parent,ref:tt.Cn.RootRef})},this.remove=e=>{e?.preventDefault(),ue.a.State.RemoveObject(this.plugin,{state:this.props.cell.parent,ref:this.ref,removeParentGhosts:!0})},this.toggleVisible=e=>{e.preventDefault(),ue.a.State.ToggleVisibility(this.plugin,{state:this.props.cell.parent,ref:this.ref}),e.currentTarget.blur()},this.toggleExpanded=e=>{e.preventDefault(),ue.a.State.ToggleExpanded(this.plugin,{state:this.props.cell.parent,ref:this.ref}),e.currentTarget.blur()},this.highlight=e=>{e.preventDefault(),ue.a.Interactivity.Object.Highlight(this.plugin,{state:this.props.cell.parent,ref:this.ref}),e.currentTarget.blur()},this.clearHighlight=e=>{e.preventDefault(),ue.a.Interactivity.ClearHighlights(this.plugin),e.currentTarget.blur()},this.hideApply=()=>{this.setCurrentRoot()},this.selectAction=e=>{e&&(0,e?.value)()}}is(e){return e.ref===this.ref&&e.state===this.props.cell.parent}get ref(){return this.props.cell.transform.ref}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated.pipe((0,mt.p)(e=>this.is(e)),(0,md.B)(33)),e=>{this.forceUpdate()}),this.subscribe(this.props.cell.parent.behaviors.currentObject,e=>{this.is(e)?e.state.transforms.has(this.ref)&&this._setCurrent(this.props.cell.parent.current===this.ref,!!this.props.cell.state.isCollapsed):this.state.isCurrent&&e.state.transforms.has(this.ref)&&this._setCurrent(this.props.cell.parent.current===this.ref,this.state.isCollapsed)})}_setCurrent(e,i){this.setState(e?{isCurrent:e,action:"options",currentAction:void 0,isCollapsed:i}:{isCurrent:e,action:void 0,currentAction:void 0,isCollapsed:i})}static getDerivedStateFromProps(e,i){const s=e.cell.parent.current===e.cell.transform.ref,l=!!e.cell.state.isCollapsed;return i.isCollapsed===l&&i.isCurrent===s?null:{isCurrent:s,isCollapsed:l,action:void 0,currentAction:void 0}}get actions(){const e=this.props.cell,i=[...e.parent.actions.fromCell(e,this.plugin)];if(0!==i.length)return i.sort((s,l)=>s.definition.display.nameEe.W.Item(s.definition.display.name,()=>this.setState({action:"apply",currentAction:s})))]}updates(e){const i=this.props.cell,s=Yc.P.getDecoratorChain(i.parent,i.transform.ref),l=[];for(let u=s.length-1;u>=0;u--){const c=s[u];l.push((0,p.jsx)(pi,{state:i.parent,transform:c.transform,noMargin:!0,wrapInExpander:!0,expanderHeaderLeftMargin:e},`${c.transform.transformer.id}-${u}`))}return(0,p.jsx)("div",{className:"msp-tree-updates-wrapper",children:l})}render(){const e=this.props.cell,i=e.transform;if(!e)return null;const s=this.is(e.parent.behaviors.currentObject.value),l="error"!==e.status&&"ok"!==e.status;let u;if("error"!==e.status&&e.obj){const b=e.obj;u=(0,p.jsxs)(L.$n,{className:`msp-btn-tree-label msp-type-class-${b.type.typeClass}`,noOverflow:!0,disabled:l,title:`${b.label} ${b.description?b.description:""}`,onClick:this.state.isCurrent?this.setCurrentRoot:this.setCurrent,children:[(0,p.jsx)("span",{children:b.label})," ",b.description?(0,p.jsx)("small",{children:b.description}):void 0]})}else{const b="error"===e.status?e.errorText:i.transformer.definition.display.name;u=(0,p.jsxs)(L.$n,{className:"msp-btn-tree-label msp-no-hover-outline",noOverflow:!0,title:b,onClick:this.state.isCurrent?this.setCurrentRoot:this.setCurrent,disabled:l,children:["error"===e.status&&(0,p.jsxs)("b",{children:["[",e.status,"]"]})," ",(0,p.jsx)("span",{children:b})]})}const c=e.parent.tree.children.get(this.ref),h=e.state,f=(0,p.jsx)(L.K0,{svg:h.isCollapsed?I.Cp:I.DM,flex:"20px",disabled:l,onClick:this.toggleExpanded,transparent:!0,className:"msp-no-hover-outline",style:{visibility:c.size>0?"visible":"hidden"}}),y=e.state.isLocked?void 0:(0,p.jsx)(L.K0,{svg:I.mf,onClick:this.remove,disabled:l,small:!0,toggleState:!1}),g=(0,p.jsx)(L.K0,{svg:h.isHidden?I.qF:I.zs,toggleState:!1,disabled:l,small:!0,onClick:this.toggleVisible}),w=(0,p.jsxs)("div",{className:"msp-flex-row msp-tree-row"+(s?" msp-tree-row-current":""),onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{marginLeft:8*this.props.depth+"px"},children:[f,u,y,g]});if(!s)return w;if("apply"===this.state.action&&this.state.currentAction)return(0,p.jsxs)("div",{style:{marginBottom:"1px"},children:[w,(0,p.jsx)(L.tW,{header:`Apply ${this.state.currentAction.definition.display.name}`,initialExpanded:!0,hideExpander:!0,hideOffset:!1,onHeaderClick:this.hideApply,topRightIcon:I.X6,headerLeftMargin:8*this.props.depth+21+"px",children:(0,p.jsx)(Go,{onApply:this.hideApply,state:this.props.cell.parent,action:this.state.currentAction,nodeRef:this.props.cell.transform.ref,hideHeader:!0,noMargin:!0})})]});if("options"===this.state.action){const b=this.actions,C=this.updates(8*this.props.depth+21+"px");return(0,p.jsxs)("div",{style:{marginBottom:"1px"},children:[w,C,b&&(0,p.jsx)("div",{style:{marginLeft:8*this.props.depth+21+"px",marginTop:"-1px"},children:(0,p.jsx)(Ee.W,{items:b,onSelect:this.selectAction})})]})}return w}}class pu extends Z.dL{componentDidMount(){this.subscribe(this.plugin.state.behaviors.events.changed,()=>this.forceUpdate())}render(){const e=[];return this.plugin.customImportControls.forEach((i,s)=>{e.push((0,p.jsx)(i,{initiallyCollapsed:this.props.initiallyCollapsed},s))}),e.length>0?(0,p.jsx)(p.Fragment,{children:e}):null}}class fd extends Z.dL{constructor(){var e;super(...arguments),this.state={tab:this.plugin.behaviors.layout.leftPanelTabName.value},this.set=i=>{if(this.state.tab===i)return this.setState({tab:"none"},()=>this.plugin.behaviors.layout.leftPanelTabName.next("none")),void ue.a.Layout.Update(this.plugin,{state:{regionState:{...this.plugin.layout.state.regionState,left:"collapsed"}}});this.setState({tab:i},()=>this.plugin.behaviors.layout.leftPanelTabName.next(i)),"full"!==this.plugin.layout.state.regionState.left&&ue.a.Layout.Update(this.plugin,{state:{regionState:{...this.plugin.layout.state.regionState,left:"full"}}})},this.tabs={none:(0,p.jsx)(p.Fragment,{}),root:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.X3,{icon:I.yf,title:"Home"}),(0,p.jsx)($c,{state:this.plugin.state.data,nodeRef:tt.Cn.RootRef,hideHeader:!0,initiallyCollapsed:!0,alwaysExpandFirst:!0}),(0,p.jsx)(pu,{}),"none"!==(null===(e=this.plugin.spec.components)||void 0===e?void 0:e.remoteState)&&(0,p.jsx)(uu,{listOnly:!0})]}),data:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.X3,{icon:I.ID,title:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(rr,{})," State Tree"]})}),(0,p.jsx)(cu,{state:this.plugin.state.data})]}),states:(0,p.jsx)(pd,{}),settings:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.X3,{icon:I.Hk,title:"Plugin Settings"}),(0,p.jsx)(rl,{})]}),help:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.X3,{icon:I.ml,title:"Help"}),(0,p.jsx)(Wa,{})]})}}componentDidMount(){this.subscribe(this.plugin.behaviors.layout.leftPanelTabName,e=>{this.state.tab!==e&&this.setState({tab:e}),"none"===e&&"collapsed"!==this.plugin.layout.state.regionState.left&&ue.a.Layout.Update(this.plugin,{state:{regionState:{...this.plugin.layout.state.regionState,left:"collapsed"}}})}),this.subscribe(this.plugin.state.data.events.changed,({state:e})=>{"data"===this.state.tab&&1===e.cells.size&&this.set("root")})}render(){const e=this.state.tab;return(0,p.jsxs)("div",{className:"msp-left-panel-controls",children:[(0,p.jsxs)("div",{className:"msp-left-panel-controls-buttons",children:[(0,p.jsx)(L.K0,{svg:I.yf,toggleState:"root"===e,transparent:!0,onClick:()=>this.set("root"),title:"Home"}),(0,p.jsx)(zi,{set:this.set}),(0,p.jsx)(L.K0,{svg:I.e,toggleState:"states"===e,transparent:!0,onClick:()=>this.set("states"),title:"Plugin State"}),(0,p.jsx)(L.K0,{svg:I.ml,toggleState:"help"===e,transparent:!0,onClick:()=>this.set("help"),title:"Help"}),(0,p.jsx)("div",{className:"msp-left-panel-controls-buttons-bottom",children:(0,p.jsx)(L.K0,{svg:I.Hk,toggleState:"settings"===e,transparent:!0,onClick:()=>this.set("settings"),title:"Settings"})})]}),(0,p.jsx)("div",{className:"msp-scrollable-container",children:this.tabs[e]})]})}}class zi extends Z.dL{constructor(){super(...arguments),this.state={changed:!1}}get tab(){return this.plugin.behaviors.layout.leftPanelTabName.value}componentDidMount(){this.subscribe(this.plugin.behaviors.layout.leftPanelTabName,e=>{"data"===this.tab?this.setState({changed:!1}):this.forceUpdate()}),this.subscribe(this.plugin.state.data.events.changed,e=>{"data"!==this.tab&&this.setState({changed:!0})})}render(){return(0,p.jsx)(L.K0,{svg:I.ID,toggleState:"data"===this.tab,transparent:!0,onClick:()=>this.props.set("data"),title:"State Tree",style:{position:"relative"},extraContent:this.state.changed?(0,p.jsx)("div",{className:"msp-left-panel-controls-button-data-dirty"}):void 0})}}class rl extends Z.dL{constructor(){super(...arguments),this.setSettings=e=>{ue.a.Canvas3D.SetSettings(this.plugin,{settings:{[e.name]:e.value}})},this.setCanvas3DContextProps=e=>{var i;null===(i=this.plugin.canvas3dContext)||void 0===i||i.setProps({[e.name]:e.value}),this.plugin.events.canvas3d.settingsUpdated.next(void 0)}}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.layout.events.updated,()=>this.forceUpdate()),this.plugin.canvas3d&&this.subscribe(this.plugin.canvas3d.camera.stateChanged.pipe((0,Wr.c)(500,void 0,{leading:!0,trailing:!0})),e=>{(void 0!==e.radiusMax||void 0!==e.radius)&&this.forceUpdate()})}render(){return(0,p.jsxs)(p.Fragment,{children:[this.plugin.canvas3d&&this.plugin.canvas3dContext&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L.X3,{title:"Viewport"}),(0,p.jsx)($e.y1,{params:ut._i,values:this.plugin.canvas3d.props,onChange:this.setSettings}),(0,p.jsx)($e.y1,{params:ut.H7.Params,values:this.plugin.canvas3dContext.props,onChange:this.setCanvas3DContextProps})]}),(0,p.jsx)(L.X3,{title:"Behavior"}),(0,p.jsx)(cu,{state:this.plugin.state.behaviors})]})}}class rr extends Z.dL{constructor(){super(...arguments),this.remove=e=>{e.preventDefault(),ue.a.State.RemoveObject(this.plugin,{state:this.plugin.state.data,ref:tt.Cn.RootRef})}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.created,e=>{e.cell.transform.parent===tt.Cn.RootRef&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.removed,e=>{e.parent===tt.Cn.RootRef&&this.forceUpdate()})}render(){return 0===this.plugin.state.data.tree.children.get(tt.Cn.RootRef).size?null:(0,p.jsx)(L.K0,{svg:I.mf,onClick:this.remove,title:"Remove All",style:{display:"inline-block"},small:!0,className:"msp-no-hover-outline",transparent:!0})}}var sl=F(1413),ol=F(2443),Vt=F(4080);class du extends Z.dL{constructor(){super(...arguments),this.parentDiv=he.createRef(),this.lastMouseOverSeqIdx=-1,this.highlightQueue=new sl.B,this.lociHighlightProvider=(e,i)=>{this.props.sequenceWrapper.markResidue(e.loci,i)&&this.updateMarker()},this.lociSelectionProvider=(e,i)=>{this.props.sequenceWrapper.markResidue(e.loci,i)&&this.updateMarker()},this.contextMenu=e=>{e.preventDefault()},this.mouseDownLoci=void 0,this.mouseDown=e=>{e.stopPropagation();const i=this.getSeqIdx(e),s=this.getLoci(i),l=(0,Vt.Y7)(e.nativeEvent),u=(0,Vt.vq)(e.nativeEvent),c=(0,Vt.RN)(e.nativeEvent);this.click(s,l,u,c),this.mouseDownLoci=s},this.mouseUp=e=>{if(e.stopPropagation(),void 0===this.mouseDownLoci)return;const i=this.getSeqIdx(e),s=this.getLoci(i);if(s&&!z.iZ.Loci.areEqual(this.mouseDownLoci,s)){const l=(0,Vt.Y7)(e.nativeEvent),u=(0,Vt.vq)(e.nativeEvent),c=(0,Vt.RN)(e.nativeEvent),h=this.mouseDownLoci.elements[0],f=s.elements[0],y=Math.min(Ce.CD.min(h.indices),Ce.CD.min(f.indices)),g=Math.max(Ce.CD.max(h.indices),Ce.CD.max(f.indices)),x=z.iZ.Loci(s.structure,[{unit:h.unit,indices:Ce.CD.ofRange(y,g)}]);this.click(z.iZ.Loci.subtract(x,this.mouseDownLoci),l,u,c)}this.mouseDownLoci=void 0},this.location=z.iZ.Location.create(void 0),this.mouseMove=e=>{e.stopPropagation();const i=(0,Vt.Y7)(e.nativeEvent),s=(0,Vt.vq)(e.nativeEvent),l=(0,Vt.RN)(e.nativeEvent),u=e.target;if(!u||!u.getAttribute){if(-1===this.lastMouseOverSeqIdx)return;return this.lastMouseOverSeqIdx=-1,void this.highlightQueue.next({seqIdx:-1,buttons:i,button:s,modifiers:l})}const c=u.hasAttribute("data-seqid")?+u.getAttribute("data-seqid"):-1;if(this.lastMouseOverSeqIdx!==c)if(this.lastMouseOverSeqIdx=c,void 0!==this.mouseDownLoci){const h=this.getLoci(c);this.hover(h,Vt.qt.Flag.None,Vt.qt.Flag.None,{...l,shift:!0})}else this.highlightQueue.next({seqIdx:c,buttons:i,button:s,modifiers:l})},this.mouseLeave=e=>{if(e.stopPropagation(),this.mouseDownLoci=void 0,-1===this.lastMouseOverSeqIdx)return;this.lastMouseOverSeqIdx=-1;const i=(0,Vt.Y7)(e.nativeEvent),s=(0,Vt.vq)(e.nativeEvent),l=(0,Vt.RN)(e.nativeEvent);this.highlightQueue.next({seqIdx:-1,buttons:i,button:s,modifiers:l})}}get sequenceNumberPeriod(){return void 0!==this.props.sequenceNumberPeriod?this.props.sequenceNumberPeriod:this.props.sequenceWrapper.length>10?10:this.getSequenceNumber(this.props.sequenceWrapper.length-1).length>1?5:1}componentDidMount(){this.plugin.managers.interactivity.lociHighlights.addProvider(this.lociHighlightProvider),this.plugin.managers.interactivity.lociSelects.addProvider(this.lociSelectionProvider),this.subscribe(this.highlightQueue.pipe((0,Wr.c)(3*16.666,void 0,{leading:!0,trailing:!0})),e=>{const i=this.getLoci(e.seqIdx<0?void 0:e.seqIdx);this.hover(i,e.buttons,e.button,e.modifiers)})}componentWillUnmount(){super.componentWillUnmount(),this.plugin.managers.interactivity.lociHighlights.removeProvider(this.lociHighlightProvider),this.plugin.managers.interactivity.lociSelects.removeProvider(this.lociSelectionProvider)}getLoci(e){if(void 0!==e){const i=this.props.sequenceWrapper.getLoci(e);if(!z.iZ.Loci.isEmpty(i))return i}}getSeqIdx(e){let i;const s=e.target;return s&&s.getAttribute&&(i=s.hasAttribute("data-seqid")?+s.getAttribute("data-seqid"):void 0),i}hover(e,i,s,l){const u={current:ol.YL.Loci.Empty,buttons:i,button:s,modifiers:l};void 0!==e&&!z.iZ.Loci.isEmpty(e)&&(u.current={loci:e}),this.plugin.behaviors.interaction.hover.next(u)}click(e,i,s,l){const u={current:ol.YL.Loci.Empty,buttons:i,button:s,modifiers:l};void 0!==e&&!z.iZ.Loci.isEmpty(e)&&(u.current={loci:e}),this.plugin.behaviors.interaction.click.next(u)}getBackgroundColor(e){return typeof e>"u"&&console.error("unexpected marker value"),0===e?"":e%2==0?"rgb(51, 255, 25)":"rgb(255, 102, 153)"}getResidueClass(e,i){return i.length>1?this.props.sequenceWrapper.residueClass(e)+(0===e?" msp-sequence-residue-long-begin":" msp-sequence-residue-long"):this.props.sequenceWrapper.residueClass(e)}residue(e,i,s){return(0,p.jsx)("span",{"data-seqid":e,style:{backgroundColor:this.getBackgroundColor(s)},className:this.getResidueClass(e,i),children:`\u200b${i}\u200b`},e)}getSequenceNumberClass(e,i,s){const l=["msp-sequence-number"];return i.startsWith("-")?l.push(s.length>1&&e>0?"msp-sequence-number-long-negative":"msp-sequence-number-negative"):s.length>1&&e>0&&l.push("msp-sequence-number-long"),l.join(" ")}getSequenceNumber(e){let i="";const s=this.props.sequenceWrapper.getLoci(e),l=z.iZ.Loci.getFirstLocation(s,this.location);return l&&(z.Nf.isAtomic(l.unit)?i=`${z.StructureProperties.residue.auth_seq_id(l)}${z.StructureProperties.residue.pdbx_PDB_ins_code(l)||""}`:z.Nf.isCoarse(l.unit)&&(i=`${e+1}`)),i}padSeqNum(e){return e.length<5?e+new Array(5-e.length+1).join("\xa0"):e}getSequenceNumberSpan(e,i){const s=this.getSequenceNumber(e);return(0,p.jsx)("span",{className:this.getSequenceNumberClass(e,s,i),children:this.padSeqNum(s)},`marker-${e}`)}updateMarker(){if(!this.parentDiv.current)return;const e=this.parentDiv.current.children,{markerArray:i}=this.props.sequenceWrapper,s=!this.props.hideSequenceNumbers,l=this.sequenceNumberPeriod;let u=0;for(let c=0,h=i.length;cthis.sequence.index(c);if(z.iZ.Loci.is(e)){if(!z.oE.areRootsEquivalent(e.structure,l))return!1;e=z.iZ.Loci.remap(e,l);for(const c of e.elements)this.unitMap.has(c.unit.id)&&(s=z.Nf.isAtomic(c.unit)?Xc(c,i,this.markerArray,u)||s:hu(c,i,this.markerArray,u)||s)}else if(z.oE.isLoci(e)){if(!z.oE.areRootsEquivalent(e.structure,l))return!1;(0,Rn.BH)(this.markerArray,this.observed,i)&&(s=!0)}return s}getLoci(e){const i=function al(r,e,i){return z.RT.generators.atoms({unitTest:s=>z.StructureProperties.unit.chainGroupId(s.element)===r&&z.StructureProperties.unit.operator_name(s.element)===e,residueTest:s=>0===s.element.unit.kind?z.StructureProperties.residue.label_seq_id(s.element)===i:z.StructureProperties.coarse.seq_id_begin(s.element)<=i&&z.StructureProperties.coarse.seq_id_end(s.element)>=i})}(this.data.units[0].chainGroupId,this.data.units[0].conformation.operator.name,this.seqId(e));return z.cv.toLociWithSourceUnits(z.Oz.run(i,this.data.structure))}constructor(e){const i=z.iZ.Location.create(e.structure,e.units[0],e.units[0].elements[0]),s=e.units[0].model.sequence.byEntityKey[z.StructureProperties.entity.key(i)],l=s.sequence.length;super(e,new Uint8Array(l),l),this.unitMap=new Map;for(const h of e.units)this.unitMap.set(h.id,h);this.sequence=s.sequence,this.missing=e.units[0].model.properties.missingResidues,this.modelNum=e.units[0].model.modelNum,this.asymId=z.Nf.isAtomic(e.units[0])?z.StructureProperties.chain.label_asym_id(i):z.StructureProperties.coarse.asym_id(i);const c=[];for(let h=0;hc[u[f]],f=>{const y=h.value(f);(0,Rn.ly)(i,s(y),e)}),!0}function hu(r,e,i,s){const{model:l,elements:u}=r.unit,c=z.Nf.isSpheres(r.unit)?l.coarseHierarchy.spheres.seq_id_begin:l.coarseHierarchy.gaussians.seq_id_begin,h=z.Nf.isSpheres(r.unit)?l.coarseHierarchy.spheres.seq_id_end:l.coarseHierarchy.gaussians.seq_id_end;return Ce.CD.forEach(r.indices,f=>{const y=u[f];for(let g=s(c.value(y)),x=s(h.value(y));g<=x;g++)(0,Rn.ly)(i,g,e)}),!0}class gd extends Vs{residueLabel(e){return this.sequence[e]}residueColor(e){return Qr.s.black}residueClass(e){return"msp-sequence-present"}mark(e,i){let s=!1;const{structure:l}=this.data;if(z.iZ.Loci.is(e)){if(!z.oE.areRootsEquivalent(e.structure,l))return!1;e=z.iZ.Loci.remap(e,l);for(const u of e.elements){const c=this.unitMap.get(u.unit.id);if(c){const{index:h}=u.unit.model.atomicHierarchy.residueAtomSegments;Ce.CD.forEach(u.indices,f=>{const y=this.sequenceIndices.get(h[c.elements[f]]);void 0!==y&&(0,Rn.BH)(this.markerArray,Ce.IX.ofSingleton(y),i)&&(s=!0)})}}}else if(z.oE.isLoci(e)){if(!z.oE.areRootsEquivalent(e.structure,l))return!1;(0,Rn.BH)(this.markerArray,Ce.IX.ofBounds(0,this.length),i)&&(s=!0)}return s}getLoci(e){const i=[],s=this.residueIndices.get(e);if(void 0!==s){const l=this.seqToUnit.get(e),{offsets:u}=l.model.atomicHierarchy.residueAtomSegments,c=Ce.SortedArray.findPredecessorIndex(l.elements,u[s]),h=Ce.SortedArray.findPredecessorIndex(l.elements,u[s+1]);i.push({unit:l,indices:Ce.IX.ofBounds(c,h)})}return z.iZ.Loci(this.data.structure,i)}constructor(e){const i=[],s=new Map,l=new Map,u=new Map;for(let f=0,y=e.units.length;f0&&l.push(`${i} residues`),l.push(`${s} elements`),super(e,new Uint8Array(1),1),this.label=`Whole Chain (${l.join(", ")})`,this.unitIndices=c,this.loci=z.iZ.Loci(this.data.structure,h)}}class mu extends Vs{residueLabel(e){return"X"}residueColor(e){return Qr.s.black}residueClass(e){return"msp-sequence-present"}mark(e,i){let s=!1;const{structure:l,units:u}=this.data;if(z.iZ.Loci.is(e)){if(!z.oE.areRootsEquivalent(e.structure,l))return!1;e=z.iZ.Loci.remap(e,l);for(const c of e.elements){const h=this.unitIndices.get(c.unit.id);h&&Ce.CD.isSubset(h,c.indices)&&(0,Rn.BH)(this.markerArray,c.indices,i)&&(s=!0)}}else if(z.oE.isLoci(e)){if(!z.oE.areRootsEquivalent(e.structure,l))return!1;for(let c=0,h=u.length;c0){const g={structure:i,units:y},x=y[0];let w;if(x.polymerElements.length){const b=z.iZ.Location.create(i,x,x.elements[0]),C=x.model.sequence.byEntityKey[z.StructureProperties.entity.key(b)];if(C&&C.sequence.length<=5e3)w=new ll(g);else{const N=y.reduce((V,D)=>V+D.polymerElements.length,0);w=z.Nf.isAtomic(x)||N>5e3?new ul(g):new mu(g)}}else z.Nf.isAtomic(x)?w=y.reduce((C,N)=>C+N.residueCount,0)>5e3?new ul(g):new gd(g):(console.warn("should not happen, expecting coarse units to be polymeric"),w=new ul(g));return w.markResidue(e.getLoci(i),Rn.xi.Select),w}return"No sequence available"}function Oi(r,e=!1){const i=[],s=z.iZ.Location.create(r),l=new Set;for(const u of r.units){z.iZ.Location.set(s,r,u,u.elements[0]);const c=z.StructureProperties.entity.id(s),h=r.getModelIndex(u.model),f=`${h}|${c}`;if(l.has(f)||e&&"polymer"!==z.StructureProperties.entity.type(s))continue;let y=z.StructureProperties.entity.pdbx_description(s).join(", ");if(r.models.length&&(r.representativeModel?y+=` (Model ${r.models[h].modelNum})`:y.startsWith("Polymer ")&&(y+=` (${r.models[h].entry})`)),i.push([f,`${c}: ${y}`]),l.add(f),i.length>1e3)return[["","Too many entities"]]}return 0===i.length&&i.push(["","No entities"]),i}function _s(r,e){const i=[],s=z.iZ.Location.create(r),l=new Set,[u,c]=Yr(e);for(const h of r.units){if(z.iZ.Location.set(s,r,h,h.elements[0]),r.getModelIndex(h.model)!==u||z.StructureProperties.entity.id(s)!==c)continue;const f=h.chainGroupId;if(l.has(f))continue;const y=(0,Nn.BB)(s,{granularity:"chain",hidePrefix:!0,htmlStyling:!1});if(i.push([f,y]),l.add(f),i.length>1e3)return[[-1,"Too many chains"]]}return 0===i.length&&i.push([-1,"No chains"]),i}function mi(r,e,i){const s=[],l=z.iZ.Location.create(r),u=new Set,[c,h]=Yr(e);for(const f of r.units){if(z.iZ.Location.set(l,r,f,f.elements[0]),r.getModelIndex(f.model)!==c||z.StructureProperties.entity.id(l)!==h||f.chainGroupId!==i)continue;const y=ep(l);if(!u.has(y)&&(s.push([y,f.conformation.operator.name]),u.add(y),s.length>1e3))return[["","Too many operators"]]}return 0===s.length&&s.push(["","No operators"]),s}function t(r){var e;const i=[],s=[],l=r.select(tt.QX.Generators.rootsOfType(we.O.Molecule.Structure));for(const u of l)null!==(e=u.obj)&&void 0!==e&&e.data&&(s.push(u.obj.data),i.push([u.transform.ref,u.obj.data.label]));return 0===i.length&&i.push(["","No structure"]),{options:i,all:s}}const n=Q.t.Select("single",[["single","Chain"],["polymers","Polymers"],["all","Everything"]]);class o extends Z.dL{constructor(){super(...arguments),this.state={structureOptions:{options:[],all:[]},structure:z.oE.Empty,structureRef:"",modelEntityId:"",chainGroupId:-1,operatorKey:"",mode:"single"},this.setParamProps=e=>{const i={...this.state};switch(e.name){case"mode":if(i.mode=e.value,this.state.mode===i.mode)return;if("all"===i.mode||"polymers"===i.mode)break;case"structure":"structure"===e.name&&(i.structureRef=e.value),i.structure=this.getStructure(i.structureRef),i.modelEntityId=Oi(i.structure)[0][0],i.chainGroupId=_s(i.structure,i.modelEntityId)[0][0],i.operatorKey=mi(i.structure,i.modelEntityId,i.chainGroupId)[0][0];break;case"entity":i.modelEntityId=e.value,i.chainGroupId=_s(i.structure,i.modelEntityId)[0][0],i.operatorKey=mi(i.structure,i.modelEntityId,i.chainGroupId)[0][0];break;case"chain":i.chainGroupId=e.value,i.operatorKey=mi(i.structure,i.modelEntityId,i.chainGroupId)[0][0];break;case"operator":i.operatorKey=e.value}this.setState(i)}}componentDidMount(){this.plugin.state.data.select(tt.QX.Generators.rootsOfType(we.O.Molecule.Structure)).length>0&&this.setState(this.getInitialState()),this.subscribe(this.plugin.state.events.object.updated,({ref:e,obj:i})=>{e===this.state.structureRef&&i&&i.type===we.O.Molecule.Structure.type&&i.data!==this.state.structure&&this.sync()}),this.subscribe(this.plugin.state.events.object.created,({obj:e})=>{e&&e.type===we.O.Molecule.Structure.type&&this.sync()}),this.subscribe(this.plugin.state.events.object.removed,({obj:e})=>{e&&e.type===we.O.Molecule.Structure.type&&e.data===this.state.structure&&this.sync()})}sync(){const e=t(this.plugin.state.data);(0,cl.af)(e.all,this.state.structureOptions.all)||this.setState(this.getInitialState())}getStructure(e){const s=this.plugin.state.data.select(e)[0];return e&&s&&s.obj?s.obj.data:z.oE.Empty}getSequenceWrapper(e){return{wrapper:tp(this.state,this.plugin.managers.structure.selection),label:`${Q.t.optionLabel(e.chain,this.state.chainGroupId)} | ${Q.t.optionLabel(e.entity,this.state.modelEntityId)}`}}getSequenceWrappers(e){if("single"===this.state.mode)return[this.getSequenceWrapper(e)];const i=this.getStructure(this.state.structureRef),s=[];for(const[l,u]of Oi(i,"polymers"===this.state.mode))for(const[c,h]of _s(i,l))for(const[f]of mi(i,l,c))if(s.push({wrapper:tp({structure:i,modelEntityId:l,chainGroupId:c,operatorKey:f},this.plugin.managers.structure.selection),label:`${h} | ${u}`}),s.length>30)return[];return s}getInitialState(){var e;const i=t(this.plugin.state.data),s=i.options[0][0],l=this.getStructure(s);let u=Oi(l)[0][0],c=_s(l,u)[0][0],h=mi(l,u,c)[0][0];return this.state.structure&&this.state.structure===l&&(u=this.state.modelEntityId,c=this.state.chainGroupId,h=this.state.operatorKey),{structureOptions:i,structure:l,structureRef:s,modelEntityId:u,chainGroupId:c,operatorKey:h,mode:null!==(e=this.props.defaultMode)&&void 0!==e?e:"single"}}get params(){const{structureOptions:e,structure:i,modelEntityId:s,chainGroupId:l}=this.state,u=Oi(i),c=_s(i,s),h=mi(i,s,l);return{structure:Q.t.Select(e.options[0][0],e.options,{shortLabel:!0}),entity:Q.t.Select(u[0][0],u,{shortLabel:!0}),chain:Q.t.Select(c[0][0],c,{shortLabel:!0,twoColumns:!0,label:"Chain"}),operator:Q.t.Select(h[0][0],h,{shortLabel:!0,twoColumns:!0}),mode:n}}get values(){return{structure:this.state.structureRef,entity:this.state.modelEntityId,chain:this.state.chainGroupId,operator:this.state.operatorKey,mode:this.state.mode}}render(){if(this.getStructure(this.state.structureRef)===z.oE.Empty)return(0,p.jsx)("div",{className:"msp-sequence",children:(0,p.jsxs)("div",{className:"msp-sequence-select",children:[(0,p.jsx)(I.In,{svg:I.ml,style:{cursor:"help",position:"absolute",right:0,top:0},title:"Shows a sequence of one or more chains. Use the controls to alter selection."}),(0,p.jsx)("span",{children:"Sequence"}),(0,p.jsx)("span",{style:{fontWeight:"normal"},children:"No structure available"})]})});const e=this.params,i=this.values,s=this.getSequenceWrappers(e);return(0,p.jsxs)("div",{className:"msp-sequence",children:[(0,p.jsxs)("div",{className:"msp-sequence-select",children:[(0,p.jsx)(I.In,{svg:I.ml,style:{cursor:"help",position:"absolute",right:0,top:0},title:"This shows a single sequence. Use the controls to show a different sequence."}),(0,p.jsx)("span",{children:"Sequence of"}),(0,p.jsx)($e.UT,{title:`[Structure] ${Q.t.optionLabel(e.structure,i.structure)}`,param:e.structure,name:"structure",value:i.structure,onChange:this.setParamProps}),(0,p.jsx)($e.UT,{title:"[Mode]",param:n,name:"mode",value:i.mode,onChange:this.setParamProps}),"single"===i.mode&&(0,p.jsx)($e.UT,{title:`[Entity] ${Q.t.optionLabel(e.entity,i.entity)}`,param:e.entity,name:"entity",value:i.entity,onChange:this.setParamProps}),"single"===i.mode&&(0,p.jsx)($e.UT,{title:`[Chain] ${Q.t.optionLabel(e.chain,i.chain)}`,param:e.chain,name:"chain",value:i.chain,onChange:this.setParamProps}),e.operator.options.length>1&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)($e.UT,{title:`[Instance] ${Q.t.optionLabel(e.operator,i.operator)}`,param:e.operator,name:"operator",value:i.operator,onChange:this.setParamProps})})]}),(0,p.jsx)(a,{children:s.map((l,u)=>{const c="string"==typeof l.wrapper?(0,p.jsx)("div",{className:"msp-sequence-wrapper",children:l.wrapper},u):(0,p.jsx)(du,{sequenceWrapper:l.wrapper},u);return"single"===i.mode?c:(0,p.jsxs)(he.Fragment,{children:[(0,p.jsx)("div",{className:"msp-sequence-chain-label",children:l.label}),c]},u)})})]})}}function a({children:r}){return(0,p.jsx)("div",{className:"msp-sequence-wrapper-non-empty",children:r})}const v=he.useSyncExternalStore?function m(r){return he.useSyncExternalStore(he.useCallback(e=>{const i=r?.pipe(Ra(1)).subscribe(e);return()=>i?.unsubscribe()},[r]),he.useCallback(()=>r?.value,[r]))}:function d(r){const[,e]=he.useState({}),i=he.useRef();return i.current=r?.value,he.useEffect(()=>{if(!r)return;const s=r.subscribe(l=>{i.current!==l&&e({})});return()=>s.unsubscribe()},[r]),r?.value};function S(r){return v(r)}function k(){const r=(0,he.useContext)(Z.aU),[e,i]=(0,he.useState)((0,Kr.uY)());return(0,he.useEffect)(()=>{const s=r.events.task.progress.subscribe(u=>{var c;const h=!(null===(c=r.spec.components)||void 0===c||!c.hideTaskOverlay);"background"===u.level&&(h||!u.useOverlay)&&i(f=>f.set(u.id,u))}),l=r.events.task.finished.subscribe(({id:u})=>{i(c=>c.delete(u))});return()=>{s.unsubscribe(),l.unsubscribe()}},[r]),(0,p.jsxs)("div",{className:"msp-background-tasks",children:[e.valueSeq().map(s=>(0,p.jsx)(_,{event:s},s.id)),(0,p.jsx)(M,{})]})}function M(){var r;const i=S(null===(r=(0,he.useContext)(Z.aU).canvas3d)||void 0===r?void 0:r.commitQueueSize);return i?(0,p.jsx)("div",{className:"msp-task-state",children:(0,p.jsx)("div",{children:(0,p.jsxs)("div",{children:["Commiting renderables... ",i," remaining"]})})}):null}class _ extends Z.dL{constructor(){super(...arguments),this.abort=()=>{this.plugin.managers.task.requestAbort(this.props.event.progress.root.progress.taskId,"User Request")}}render(){const e=this.props.event.progress.root,i=K(this.props.event.progress.root)-1,s=e.progress.isIndeterminate?void 0:(0,p.jsxs)(p.Fragment,{children:["[",e.progress.current,"/",e.progress.max,"]"]}),l=i>0?(0,p.jsxs)(p.Fragment,{children:["[",i," subtask(s)]"]}):void 0;return(0,p.jsx)("div",{className:"msp-task-state",children:(0,p.jsxs)("div",{children:[e.progress.canAbort&&(0,p.jsx)(L.K0,{svg:I.VH,onClick:this.abort,title:"Abort"}),(0,p.jsxs)("div",{children:[e.progress.message," ",s," ",l]})]})})}}function K(r){if(0===r.children.length)return 1;let e=0;for(const i of r.children)e+=K(i);return e}function q(){const r=(0,he.useContext)(Z.aU),[e,i]=(0,he.useState)((0,Kr.uY)());return(0,he.useEffect)(()=>{const s=r.events.task.progress.subscribe(u=>{u.useOverlay&&i(c=>c.set(u.id,u))}),l=r.events.task.finished.subscribe(({id:u})=>{i(c=>c.delete(u))});return()=>{s.unsubscribe(),l.unsubscribe()}},[r]),0===e.size?null:(0,p.jsx)("div",{className:"msp-overlay-tasks",children:e.valueSeq().map(s=>(0,p.jsx)(_,{event:s},s.id))})}class J extends Z.dL{constructor(){super(...arguments),this.hide=()=>{(this.props.entry.hide||function(){}).call(null)}}render(){const e=this.props.entry,i=(0,p.jsx)("div","string"==typeof e.message?{dangerouslySetInnerHTML:{__html:e.message}}:{children:(0,p.jsx)(e.message,{})});return(0,p.jsxs)("div",{className:"msp-toast-entry",children:[(0,p.jsx)("div",{className:"msp-toast-title",onClick:()=>this.hide(),children:e.title}),(0,p.jsx)("div",{className:"msp-toast-message",children:i}),(0,p.jsx)("div",{className:"msp-toast-clear"}),(0,p.jsx)("div",{className:"msp-toast-hide",children:(0,p.jsx)(L.K0,{svg:I.VH,onClick:this.hide,title:"Hide",className:"msp-no-hover-outline"})})]})}}class ie extends Z.dL{componentDidMount(){this.subscribe(this.plugin.managers.toast.events.changed,()=>this.forceUpdate())}render(){const e=this.plugin.managers.toast.state;if(!e.entries.count())return null;const i=[];return e.entries.forEach((s,l)=>i.push(s)),i.sort(function(s,l){return s.serialNumber-l.serialNumber}),(0,p.jsx)("div",{className:"msp-toast-container",children:i.map(s=>(0,p.jsx)(J,{entry:s},s.serialNumber))})}}class re extends Z.dL{constructor(){super(...arguments),this.container=he.createRef(),this.state={noWebGl:!1,showLogo:!0},this.handleLogo=()=>{var e;this.setState({showLogo:!(null!==(e=this.plugin.canvas3d)&&void 0!==e&&e.reprCount.value)})}}componentDidMount(){this.container.current&&this.plugin.mount(this.container.current,{checkeredCanvasBackground:!0})?(this.handleLogo(),this.subscribe(this.plugin.canvas3d.reprCount,this.handleLogo)):this.setState({noWebGl:!0})}componentWillUnmount(){super.componentWillUnmount(),this.plugin.unmount()}renderMissing(){return this.props.noWebGl?(0,p.jsx)(this.props.noWebGl,{}):(0,p.jsx)("div",{className:"msp-no-webgl",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("p",{children:(0,p.jsx)("b",{children:"WebGL does not seem to be available."})}),(0,p.jsx)("p",{children:"This can be caused by an outdated browser, graphics card driver issue, or bad weather. Sometimes, just restarting the browser helps. Also, make sure hardware acceleration is enabled in your browser."}),(0,p.jsxs)("p",{children:["For a list of supported browsers, refer to ",(0,p.jsx)("a",{href:"http://caniuse.com/#feat=webgl",target:"_blank",children:"http://caniuse.com/#feat=webgl"}),"."]})]})})}render(){if(this.state.noWebGl)return this.renderMissing();const e=this.props.logo;return(0,p.jsx)("div",{className:this.props.parentClassName||"msp-viewport",style:this.props.parentStyle,ref:this.container,children:this.state.showLogo&&e&&(0,p.jsx)(e,{})})}}var ct=F(9359);const A=he.memo(r=>{const{plugin:e,cropFrameColor:i}=r,s=e.helpers.viewportScreenshot,[l,u]=(0,he.useState)(null),c=(0,he.useRef)(null),h=(0,he.useRef)(r);return(0,he.useEffect)(()=>{h.current=r},Object.values(r)),(0,he.useEffect)(()=>{l!==c.current&&u(c.current)}),(0,he.useEffect)(()=>{var f;let y=!1;const g=[];function x(V,D){V&&g.push(V.subscribe(D))}function w(){const V=h.current;!V.suspend&&c.current&&P(s,c.current,V.customBackground,V.borderColor,V.borderWidth),c.current||(y=!0)}const b=setInterval(()=>{y&&(y=!1,w())},125);let C;x(e.events.canvas3d.settingsUpdated,()=>y=!0),x(null===(f=e.canvas3d)||void 0===f?void 0:f.didDraw,()=>y=!0),x(e.state.data.behaviors.isUpdating,V=>{V||(y=!0)}),x(s?.behaviors.values,()=>y=!0),x(s?.behaviors.cropParams,()=>y=!0),typeof ResizeObserver<"u"&&(C=new ResizeObserver(()=>y=!0));const N=c.current;return C?.observe(N),w(),()=>{clearInterval(b),g.forEach(V=>V.unsubscribe()),C?.unobserve(N)}},[s]),(0,he.useLayoutEffect)(()=>{c.current&&P(s,c.current,r.customBackground,r.borderColor,r.borderWidth)},[...Object.values(r)]),(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("div",{style:{position:"relative",width:"100%",height:"100%"},children:[(0,p.jsx)("canvas",{ref:c,onContextMenu:f=>{f.preventDefault(),f.stopPropagation()},style:{display:"block",width:"100%",height:"100%"}}),(0,p.jsx)(G,{plugin:e,canvas:l,color:i})]})})},(r,e)=>(0,ct.bN)(r,e));function P(r,e,i,s,l){if(!r)return;const{canvas:u,width:c,height:h}=r.getPreview(),f=e.getContext("2d");if(!f)return;const y=e.clientWidth,g=e.clientHeight;e.width=y,e.height=g,f.clearRect(0,0,y,g);const x=ce(c,h,y,g);if(i)f.fillStyle=i,f.fillRect(x.x,x.y,x.width,x.height);else if(r.values.transparent)for(let b=0;bx.width?x.width-b:13,C+13>x.height?x.height-C:13);if(f.drawImage(u,x.x,x.y,x.width,x.height),s&&l){const w=l;f.rect(x.x,x.y,x.width,x.height),f.rect(x.x+w,x.y+w,x.width-2*w,x.height-2*w),f.fillStyle=s,f.fill("evenodd")}}function G({plugin:r,canvas:e,color:i="rgba(255, 87, 45, 0.75)"}){var s;const l=r.helpers.viewportScreenshot,u=S(l?.behaviors.values),c=S(l?.behaviors.cropParams),h=S(l?.behaviors.relativeCrop),f=(0,he.useRef)({x:0,y:0,width:0,height:0});S("viewport"===u?.resolution.name?null===(s=r.canvas3d)||void 0===s?void 0:s.resized:void 0);const[y,g]=he.useState(""),[x,w]=(0,he.useState)([0,0]),[b,C]=(0,he.useState)([0,0]);if(!l||!e||!h)return null;const{width:N,height:V}=l.getSizeAndViewport(),D=ce(N,V,e.clientWidth,e.clientHeight),O={x:D.x+Math.floor(D.width*h.x),y:D.y+Math.floor(D.height*h.y),width:Math.ceil(D.width*h.width),height:Math.ceil(D.height*h.height)},B=se(O),X=se(D);if("move"===y?(B.l+=b[0]-x[0],B.r+=b[0]-x[0],B.t+=b[1]-x[1],B.b+=b[1]-x[1]):y&&(y.indexOf("left")>=0?B.l+=b[0]-x[0]:y.indexOf("right")>=0&&(B.r+=b[0]-x[0]),y.indexOf("top")>=0?B.t+=b[1]-x[1]:y.indexOf("bottom")>=0&&(B.b+=b[1]-x[1])),B.l>B.r){const ye=B.l;B.l=B.r,B.r=ye}if(B.t>B.b){const ye=B.t;B.t=B.b,B.b=ye}B.l=Math.min(X.r-40,Math.max(X.l,B.l)),B.r=Math.max(X.l+40,Math.min(X.r,B.r)),B.t=Math.min(X.b-40,Math.max(X.t,B.t)),B.b=Math.max(X.t+40,Math.min(X.b,B.b)),O.x=B.l,O.y=B.t,O.width=B.r-B.l+1,O.height=B.b-B.t+1,f.current=O;const H=ye=>{ye.preventDefault(),C([ye.pageX,ye.pageY])},ve=ye=>{ye.preventDefault();const ht=ye.touches[0];C([ht.pageX,ht.pageY])},Fe=ye=>{ye.preventDefault(),g(ye.currentTarget.getAttribute("data-drag"));const ht=ye.touches[0],Fn=[ht.pageX,ht.pageY];w(Fn),C(Fn),window.addEventListener("touchend",mn),window.addEventListener("touchmove",ve)},Ae=ye=>{ye.preventDefault(),g(ye.currentTarget.getAttribute("data-drag"));const ht=[ye.pageX,ye.pageY];w(ht),C(ht),window.addEventListener("mouseup",Ze),window.addEventListener("mousemove",H)},Ze=()=>{window.removeEventListener("mouseup",Ze),window.removeEventListener("mousemove",H),_e()},mn=()=>{window.removeEventListener("touchend",mn),window.removeEventListener("touchmove",ve),_e()};function _e(){const ye=f.current;c?.auto&&l?.behaviors.cropParams.next({...c,auto:!1}),l?.behaviors.relativeCrop.next({x:(ye.x-D.x)/D.width,y:(ye.y-D.y)/D.height,width:ye.width/D.width,height:ye.height/D.height}),g("");const ht=[0,0];w(ht),C(ht)}const oe=ye=>{ye.preventDefault(),ye.stopPropagation()},qe="transparent";return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{"data-drag":"move",style:{position:"absolute",left:O.x,top:O.y,width:O.width,height:O.height,border:`3px solid ${i}`,cursor:"move"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"left",style:{position:"absolute",left:O.x-4,top:O.y+4,width:16,height:O.height-4,background:qe,cursor:"w-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"right",style:{position:"absolute",left:B.r-8,top:O.y,width:16,height:O.height-4,background:qe,cursor:"w-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"top",style:{position:"absolute",left:O.x-4,top:O.y-4,width:O.width+8,height:16,background:qe,cursor:"n-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"bottom",style:{position:"absolute",left:O.x-4,top:B.b-8,width:O.width+8,height:16,background:qe,cursor:"n-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"top, left",style:{position:"absolute",left:B.l-4,top:B.t-4,width:16,height:16,background:qe,cursor:"nw-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"bottom, right",style:{position:"absolute",left:B.r-8,top:B.b-8,width:16,height:16,background:qe,cursor:"nw-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"top, right",style:{position:"absolute",left:B.r-8,top:B.t-4,width:16,height:16,background:qe,cursor:"ne-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe}),(0,p.jsx)("div",{"data-drag":"bottom, left",style:{position:"absolute",left:B.l-4,top:B.b-8,width:16,height:16,background:qe,cursor:"ne-resize"},onMouseDown:Ae,onTouchStart:Fe,draggable:!1,onContextMenu:oe})]})}function se(r){return{l:r.x,t:r.y,r:r.x+r.width-1,b:r.y+r.height-1}}function ce(r,e,i,s){const l=r/e;if(l<=i/s){const c=s*l;return{x:Math.round((i-c)/2),y:0,width:Math.round(c),height:s}}{const c=i/l;return{x:0,y:Math.round((s-c)/2),width:i,height:Math.round(c)}}}class pe extends Z.dL{constructor(){var e;super(...arguments),e=this,this.state={showPreview:!0,isDisabled:!1},this.download=()=>{var i;null===(i=this.plugin.helpers.viewportScreenshot)||void 0===i||i.download(),this.props.close()},this.copy=(0,R.A)(function*(){var i;try{yield null===(i=e.plugin.helpers.viewportScreenshot)||void 0===i?void 0:i.copyToClipboard(),ue.a.Toast.Show(e.plugin,{message:"Copied to clipboard.",title:"Screenshot",timeoutMs:1500})}catch{return e.copyImg()}}),this.copyImg=(0,R.A)(function*(){var i;const s=yield null===(i=e.plugin.helpers.viewportScreenshot)||void 0===i?void 0:i.getImageDataUri();e.setState({imageData:s})}),this.open=i=>{!i.target.files||!i.target.files[0]||ue.a.State.Snapshots.OpenFile(this.plugin,{file:i.target.files[0]})}}componentDidMount(){this.subscribe(this.plugin.state.data.behaviors.isUpdating,e=>{this.setState({isDisabled:e})})}componentWillUnmount(){super.componentWillUnmount(),this.setState({imageData:void 0})}render(){var e;const i=!(null===(e=navigator.clipboard)||void 0===e||!e.write);return(0,p.jsxs)("div",{children:[this.state.showPreview&&(0,p.jsxs)("div",{className:"msp-image-preview",children:[(0,p.jsx)(A,{plugin:this.plugin}),(0,p.jsx)(Pt,{plugin:this.plugin})]}),(0,p.jsxs)("div",{className:"msp-flex-row",children:[!this.state.imageData&&(0,p.jsx)(L.$n,{icon:I.y5,onClick:i?this.copy:this.copyImg,disabled:this.state.isDisabled,children:"Copy"}),this.state.imageData&&(0,p.jsx)(L.$n,{onClick:()=>this.setState({imageData:void 0}),disabled:this.state.isDisabled,children:"Clear"}),(0,p.jsx)(L.$n,{icon:I.U3,onClick:this.download,disabled:this.state.isDisabled,children:"Download"})]}),this.state.imageData&&(0,p.jsxs)("div",{className:"msp-row msp-copy-image-wrapper",children:[(0,p.jsx)("div",{children:"Right click below + Copy Image"}),(0,p.jsx)("img",{src:this.state.imageData,style:{width:"100%",height:32,display:"block"}})]}),(0,p.jsx)(me,{plugin:this.plugin,isDisabled:this.state.isDisabled}),(0,p.jsxs)(L.Yj,{header:"State",children:[(0,p.jsx)(lu,{onAction:this.props.close}),(0,p.jsx)(L.Yj,{header:"Save Options",initiallyExpanded:!1,noOffset:!0,children:(0,p.jsx)(au,{})})]})]})}}function me({plugin:r,isDisabled:e}){const i=r.helpers.viewportScreenshot,s=S(i?.behaviors.values);return i?(0,p.jsx)($e.y1,{params:i.params,values:s,onChangeValues:l=>i.behaviors.values.next(l),isDisabled:e}):null}function Pt({plugin:r}){const e=r.helpers.viewportScreenshot,i=S(e?.behaviors.cropParams);return S(e?.behaviors.relativeCrop),e&&i?(0,p.jsxs)("div",{style:{width:"100%",height:"24px",marginTop:"8px"},children:[(0,p.jsx)(L.ff,{icon:I.l8,title:"Auto-crop",inline:!0,isSelected:i.auto,style:{background:"transparent",float:"left",width:"auto",height:"24px",lineHeight:"24px"},toggle:()=>e.toggleAutocrop(),label:"Auto-crop "+(i.auto?"On":"Off")}),!i.auto&&(0,p.jsx)(L.$n,{icon:I.FJ,title:"Crop",style:{background:"transparent",float:"right",height:"24px",lineHeight:"24px",width:"24px",padding:"0"},onClick:()=>e.autocrop()}),!i.auto&&!e.isFullFrame&&(0,p.jsx)(L.$n,{icon:I.fL,title:"Reset Crop",style:{background:"transparent",float:"right",height:"24px",lineHeight:"24px",width:"24px",padding:"0"},onClick:()=>e.resetCrop()})]}):null}var Re=F(1025);class yd extends Z.dL{componentDidMount(){this.plugin.canvas3d&&(this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.canvas3d.camera.stateChanged.pipe((0,Wr.c)(500,void 0,{leading:!0,trailing:!0})),e=>{(void 0!==e.radiusMax||void 0!==e.radius)&&this.forceUpdate()}))}render(){return this.plugin.canvas3d?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($e.dr,{mapping:Md}),(0,p.jsx)(Wo,{})]}):null}}const fu={sequence:"Sequence",log:"Log",left:"Left Panel",right:"Right Panel"},Nd={animate:ut._i.trackball.params.animate,camera:ut._i.camera,background:Q.t.Group({color:Q.t.Color((0,wt.Q1)(16579577),{label:"Background",description:"Custom background color"}),transparent:Q.t.Boolean(!1),style:ut._i.postprocessing.params.background},{pivot:"color"}),lighting:Q.t.Group({occlusion:ut._i.postprocessing.params.occlusion,shadow:ut._i.postprocessing.params.shadow,outline:ut._i.postprocessing.params.outline,dof:ut._i.postprocessing.params.dof,fog:ut._i.cameraFog},{isFlat:!0}),clipping:Q.t.Group({...ut._i.cameraClipping.params},{pivot:"radius"}),layout:Q.t.MultiSelect([],Q.t.objectToOptions(fu)),advanced:Q.t.Group({multiSample:ut._i.multiSample,hiZ:ut._i.hiZ,sharpening:ut._i.postprocessing.params.sharpening,pixelScale:ut.H7.Params.pixelScale,transparency:ut.H7.Params.transparency})},Md=function Ri(r){return({values:e,update:i,apply:s})=>({params:"function"==typeof r.params?r.params:l=>r.params,getTarget:r.target,getValues:e,update(l,u){const c=r.target(u);return(0,Re.jM)(c,h=>i(l,h,u))},apply:s||(()=>{})})}({params:r=>{var e;const i=Q.t.clone(Nd),s=null===(e=r.spec.components)||void 0===e?void 0:e.controls;if(s){const u=[];"none"!==s.top&&u.push(["sequence",fu.sequence]),"none"!==s.bottom&&u.push(["log",fu.log]),"none"!==s.left&&u.push(["left",fu.left]),"none"!==s.right&&u.push(["right",fu.right]),i.layout.options=u}const l=r.config.get(Bt.AB.Background.Styles)||[];return l.length>0&&Object.assign(i.background.params.style,{presets:(0,ct.Go)(l),isFlat:!1}),i},target(r){var e,i,s;const l=null===(e=r.spec.components)||void 0===e?void 0:e.controls,u=r.layout.state.regionState,c=[];"hidden"!==u.top&&(!l||"none"!==l.top)&&c.push("sequence"),"hidden"!==u.bottom&&(!l||"none"!==l.bottom)&&c.push("log"),"hidden"!==u.left&&(!l||"none"!==l.left)&&c.push("left"),"hidden"!==u.right&&(!l||"none"!==l.right)&&c.push("right");const{pixelScale:h,transparency:f}=null===(i=r.canvas3dContext)||void 0===i?void 0:i.props;return{canvas:null===(s=r.canvas3d)||void 0===s?void 0:s.props,layout:c,pixelScale:h,transparency:f}}})({values(r,e){const{canvas:i}=r;return{layout:r.layout,animate:i.trackball.animate,camera:i.camera,background:{color:i.renderer.backgroundColor,transparent:i.transparentBackground,style:i.postprocessing.background},lighting:{occlusion:i.postprocessing.occlusion,shadow:i.postprocessing.shadow,outline:i.postprocessing.outline,dof:i.postprocessing.dof,fog:i.cameraFog},clipping:{...i.cameraClipping},advanced:{multiSample:i.multiSample,hiZ:i.hiZ,sharpening:i.postprocessing.sharpening,pixelScale:r.pixelScale,transparency:r.transparency}}},update(r,e){const i=e.canvas;i.trackball.animate=r.animate,i.camera=r.camera,i.transparentBackground=r.background.transparent,i.renderer.backgroundColor=r.background.color,i.postprocessing.occlusion=r.lighting.occlusion,i.postprocessing.shadow=r.lighting.shadow,i.postprocessing.outline=r.lighting.outline,i.postprocessing.background=r.background.style,i.cameraFog=r.lighting.fog,i.cameraClipping={radius:r.clipping.radius,far:r.clipping.far,minNear:r.clipping.minNear},i.multiSample=r.advanced.multiSample,i.hiZ=r.advanced.hiZ,i.postprocessing.sharpening=r.advanced.sharpening,i.postprocessing.dof=r.lighting.dof,e.layout=r.layout,e.pixelScale=r.advanced.pixelScale,e.transparency=r.advanced.transparency},apply:(r,e)=>(0,R.A)(function*(){var i;yield ue.a.Canvas3D.SetSettings(e,{settings:r.canvas});const s=r.layout.indexOf("left")<0,l=(0,Re.jM)(e.layout.state,u=>{u.regionState.top=r.layout.indexOf("sequence")>=0?"full":"hidden",u.regionState.bottom=r.layout.indexOf("log")>=0?"full":"hidden",u.regionState.left=s?"hidden":"none"===e.behaviors.layout.leftPanelTabName.value?"collapsed":"full",u.regionState.right=r.layout.indexOf("right")>=0?"full":"hidden"});yield ue.a.Layout.Update(e,{state:l}),s&&ue.a.State.SetCurrentObject(e,{state:e.state.data,ref:tt.Cn.RootRef}),null===(i=e.canvas3dContext)||void 0===i||i.setProps({pixelScale:r.pixelScale,transparency:r.transparency})})()});class Dd extends Z.dL{constructor(){super(...arguments),this.allCollapsedState={isSettingsExpanded:!1,isScreenshotExpanded:!1},this.state={...this.allCollapsedState,isCameraResetEnabled:!0},this.resetCamera=()=>{ue.a.Camera.Reset(this.plugin,{})},this.toggleSettingsExpanded=this.toggle("isSettingsExpanded"),this.toggleScreenshotExpanded=this.toggle("isScreenshotExpanded"),this.toggleControls=()=>{ue.a.Layout.Update(this.plugin,{state:{showControls:!this.plugin.layout.state.showControls}})},this.toggleExpanded=()=>{ue.a.Layout.Update(this.plugin,{state:{isExpanded:!this.plugin.layout.state.isExpanded}})},this.setSettings=e=>{ue.a.Canvas3D.SetSettings(this.plugin,{settings:{[e.name]:e.value}})},this.setLayout=e=>{ue.a.Layout.Update(this.plugin,{state:{[e.name]:e.value}})},this.screenshot=()=>{var e;null===(e=this.plugin.helpers.viewportScreenshot)||void 0===e||e.download()},this.enableCameraReset=e=>{this.setState(i=>({...i,isCameraResetEnabled:e}))}}toggle(e){return i=>{this.setState(s=>({...s,...this.allCollapsedState,[e]:!this.state[e]})),i?.currentTarget.blur()}}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.layout.events.updated,()=>this.forceUpdate()),this.plugin.canvas3d&&this.subscribe(this.plugin.canvas3d.camera.stateChanged.pipe((0,Wr.c)(500,void 0,{leading:!0,trailing:!0})),e=>this.enableCameraReset(0!==e.radius&&0!==e.radiusMax))}icon(e,i,s,l=!0){return(0,p.jsx)(L.K0,{svg:e,toggleState:l,onClick:i,title:s,style:{background:"transparent"}})}render(){return(0,p.jsxs)("div",{className:"msp-viewport-controls",children:[(0,p.jsxs)("div",{className:"msp-viewport-controls-buttons",children:[(0,p.jsxs)("div",{className:"msp-hover-box-wrapper",children:[(0,p.jsx)("div",{className:"msp-semi-transparent-background"}),this.icon(I.FP,this.resetCamera,"Reset Zoom"),(0,p.jsx)("div",{className:"msp-hover-box-body",children:(0,p.jsxs)("div",{className:"msp-flex-column",children:[(0,p.jsx)("div",{className:"msp-flex-row",children:(0,p.jsx)(L.$n,{onClick:()=>this.resetCamera(),disabled:!this.state.isCameraResetEnabled,title:"Set camera zoom to fit the visible scene into view",children:"Reset Zoom"})}),(0,p.jsx)("div",{className:"msp-flex-row",children:(0,p.jsx)(L.$n,{onClick:()=>ue.a.Camera.OrientAxes(this.plugin),disabled:!this.state.isCameraResetEnabled,title:"Align principal component axes of the loaded structures to the screen axes (\u201clay flat\u201d)",children:"Orient Axes"})}),(0,p.jsx)("div",{className:"msp-flex-row",children:(0,p.jsx)(L.$n,{onClick:()=>ue.a.Camera.ResetAxes(this.plugin),disabled:!this.state.isCameraResetEnabled,title:"Align Cartesian axes to the screen axes",children:"Reset Axes"})})]})}),(0,p.jsx)("div",{className:"msp-hover-box-spacer"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{className:"msp-semi-transparent-background"}),this.icon(I.C$,this.toggleScreenshotExpanded,"Screenshot / State Snapshot",this.state.isScreenshotExpanded)]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{className:"msp-semi-transparent-background"}),this.plugin.config.get(Bt.AB.Viewport.ShowControls)&&this.icon(I.fl,this.toggleControls,"Toggle Controls Panel",this.plugin.layout.state.showControls),this.plugin.config.get(Bt.AB.Viewport.ShowExpand)&&this.icon(I.E2,this.toggleExpanded,"Toggle Expanded Viewport",this.plugin.layout.state.isExpanded),this.plugin.config.get(Bt.AB.Viewport.ShowSettings)&&this.icon(I.Hk,this.toggleSettingsExpanded,"Settings / Controls Info",this.state.isSettingsExpanded)]}),this.plugin.config.get(Bt.AB.Viewport.ShowSelectionMode)&&(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{className:"msp-semi-transparent-background"}),(0,p.jsx)(Vr,{})]})]}),this.state.isScreenshotExpanded&&(0,p.jsx)("div",{className:"msp-viewport-controls-panel",children:(0,p.jsx)(L.tW,{header:"Screenshot / State",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleScreenshotExpanded,topRightIcon:I.X6,noTopMargin:!0,childrenClassName:"msp-viewport-controls-panel-controls",children:(0,p.jsx)(pe,{close:this.toggleScreenshotExpanded})})}),this.state.isSettingsExpanded&&(0,p.jsx)("div",{className:"msp-viewport-controls-panel",children:(0,p.jsx)(L.tW,{header:"Settings / Controls Info",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleSettingsExpanded,topRightIcon:I.X6,noTopMargin:!0,childrenClassName:"msp-viewport-controls-panel-controls",children:(0,p.jsx)(yd,{})})})]})}}const zd=()=>(0,p.jsx)("a",{className:"msp-logo",href:"https://molstar.org",target:"_blank"}),Od=()=>(0,p.jsx)(re,{logo:zd});var Rd=F(6511),Fd=F(1861);function Bd({plugin:r}){return r.isInitialized?(0,p.jsx)(Z.aU.Provider,{value:r,children:(0,p.jsx)(Cd,{})}):(0,p.jsx)(Hd,{plugin:r})}function Hd({plugin:r}){const[e,i]=he.useState({kind:"pending"});return he.useEffect(()=>{i({kind:"pending"});let s=!0;return r.initialized.then(()=>{s&&i({kind:"initialized"})}).catch(l=>{s&&i({kind:"error",message:`${l}`})}),()=>{s=!1}},[r]),"pending"===e.kind?null:"error"===e.kind?(0,p.jsx)("div",{className:"msp-plugin",children:(0,p.jsxs)("div",{className:"msp-plugin-init-error",children:["Initialization error: ",e.message]})}):(0,p.jsx)(Z.aU.Provider,{value:r,children:(0,p.jsx)(Cd,{})})}class Cd extends Z.dL{constructor(){super(...arguments),this.onDrop=e=>{e.preventDefault();const i=[];if(e.dataTransfer.items)for(let l=0;l{const u=l.name.toLowerCase();return u.endsWith(".molx")||u.endsWith(".molj")});s.length>0?ue.a.State.Snapshots.OpenFile(this.plugin,{file:s[0]}):this.plugin.runTask(this.plugin.state.data.applyAction(Rd.OpenFiles,{files:i.map(l=>Fd.V.File(l)),format:{name:"auto",params:{}},visuals:!0}))},this.onDragOver=e=>{e.preventDefault()},this.showDragOverlay=new Oa.t(!1),this.onDragEnter=e=>{let i=!1;if(e.dataTransfer.items&&e.dataTransfer.items.length>0){for(let s=0;sthis.forceUpdate())}region(e,i){return(0,p.jsx)("div",{className:`msp-layout-region msp-layout-${e}`,children:(0,p.jsx)("div",{className:"msp-layout-static",children:i?(0,p.jsx)(i,{}):null})})}get layoutVisibilityClassName(){var e,i;const s=this.plugin.layout.state,l=null!==(i=null===(e=this.plugin.spec.components)||void 0===e?void 0:e.controls)&&void 0!==i?i:{},u=[];return("none"===l.top||!s.showControls||"hidden"===s.regionState.top)&&u.push("msp-layout-hide-top"),"none"!==l.left&&s.showControls&&"hidden"!==s.regionState.left?"collapsed"===s.regionState.left&&u.push("msp-layout-collapse-left"):u.push("msp-layout-hide-left"),("none"===l.right||!s.showControls||"hidden"===s.regionState.right)&&u.push("msp-layout-hide-right"),("none"===l.bottom||!s.showControls||"hidden"===s.regionState.bottom)&&u.push("msp-layout-hide-bottom"),u.join(" ")}get layoutClassName(){const e=this.plugin.layout.state,i=["msp-plugin-content"];return e.isExpanded?i.push("msp-layout-expanded"):i.push("msp-layout-standard",`msp-layout-standard-${e.controlsDisplay}`),i.join(" ")}render(){var e,i,s,l,u,c,h;const f=this.plugin.layout.state,y=(null===(e=this.plugin.spec.components)||void 0===e?void 0:e.controls)||{},g=(null===(s=null===(i=this.plugin.spec.components)||void 0===i?void 0:i.viewport)||void 0===s?void 0:s.view)||_d,x=(null===(u=null===(l=this.plugin.spec.components)||void 0===l?void 0:l.sequenceViewer)||void 0===u?void 0:u.view)||o;return(0,p.jsx)("div",{className:"msp-plugin",children:(0,p.jsxs)("div",{className:this.layoutClassName,onDragEnter:this.onDragEnter,children:[(0,p.jsxs)("div",{className:this.layoutVisibilityClassName,children:[this.region("main",g),f.showControls&&"none"!==y.top&&this.region("top",y.top||x),f.showControls&&"none"!==y.left&&this.region("left",y.left||fd),f.showControls&&"none"!==y.right&&this.region("right",y.right||qd),f.showControls&&"none"!==y.bottom&&this.region("bottom",y.bottom||Wd)]}),!(null!==(c=this.plugin.spec.components)&&void 0!==c&&c.hideTaskOverlay)&&(0,p.jsx)(q,{}),!(null!==(h=this.plugin.spec.components)&&void 0!==h&&h.disableDragOverlay)&&(0,p.jsx)(Vd,{plugin:this.plugin,showDragOverlay:this.showDragOverlay})]})})}}function Vd({plugin:r,showDragOverlay:e}){const i=S(e),s=l=>{l.dataTransfer.dropEffect="copy",l.preventDefault(),l.stopPropagation()};return(0,p.jsx)("div",{className:"msp-drag-drop-overlay",style:{display:i?"flex":"none"},onDragEnter:s,onDragOver:s,onDragLeave:()=>e.next(!1),onDrop:l=>function Ud(r,e,i){r.preventDefault(),r.stopPropagation(),i.next(!1);const s=[];if(r.dataTransfer.items)for(let l=0;lthis.setState({entries:this.plugin.log.entries}))}componentDidUpdate(){this.scrollToBottom()}scrollToBottom(){const e=this.wrapper.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight-1)}render(){const i=this.state.entries,s=i.size,l=[];for(let u=Math.max(0,s-10),c=0;u{class r{set container(i){this.initialize$.next(i)}constructor(i,s){this.settingsService=i,this.pluginService=s,this.initialize$=new Nt.m(1);const l=this.pluginService.plugin$,u=this.settingsService.settings$;this.initialized$=this.initialize$.pipe((0,je.T)(c=>{const h=c.nativeElement;return{div:h,canvas:h.firstElementChild}}),(0,Pe.v)(l),(0,je.T)(([{div:c},h])=>((0,Kd.render)((0,he.createElement)(Bd,{plugin:h}),c),h)),(0,Dt.t)(1),(0,Pe.v)(u),(0,je.T)(([c,h])=>{if(c.canvas3d){const[f,y]=on(h["background-color"]);c.canvas3d.setProps({renderer:{backgroundColor:f,pickingAlphaThreshold:y}})}return c}))}static#e=this.\u0275fac=function(s){return new(s||r)(W.KVO(gn),W.KVO(_t.z))};static#t=this.\u0275prov=W.jDH({token:r,factory:r.\u0275fac,providedIn:"platform"})}return r})();function xd(r,e){return function $d(r,e){const i=fn.e.getStructureSelection(r,e);return z.cv.toLociWithSourceUnits(i)}(De.J.struct.generator.atomGroups({"residue-test":De.J.core.set.has([De.J.set(...r),De.J.core.str.concat([De.J.ammp("auth_asym_id"),De.J.ammp("auth_seq_id"),De.J.ammp("pdbx_PDB_ins_code")])])}),e)}let jd=(()=>{class r{set loci(i){this.loci$.next(i)}set interactions(i){this.interactions$.next(i)}constructor(i,s,l,u){var c=this;this.structureService=i,this.settingsService=s,this.pluginService=l,this.canvasService=u,this.loci$=new Nt.m(1),this.interactions$=new Nt.m(1);const h=this.structureService.source$.pipe((0,mt.p)(g=>null!=g));this.structure$=this.structureService.structure$.pipe(function Mt(...r){const e=(0,qt.ms)(r);return(0,Ue.N)((i,s)=>{const l=r.length,u=new Array(l);let c=r.map(()=>!1),h=!1;for(let f=0;f{u[f]=y,!h&&!c[f]&&(c[f]=!0,(h=c.every(Ne.D))&&(c=null))},Me.l));i.subscribe((0,fe._)(s,f=>{if(h){const y=[f,...u];s.next(e?e(...y):y)}}))})}(h),(0,xe.n)(([g,x])=>(0,xt.H)((0,R.A)(function*(){const w=c.pluginService.plugin,b=yield w.builders.structure.tryCreateComponentStatic(g,"polymer",{label:x.label}),[C]=on(c.settingsService.settings["backbone-color"]);return yield w.builders.structure.representation.addRepresentation(b,{type:"cartoon",color:"uniform",colorParams:{value:C}}),g.cell.obj.data})())),(0,Dt.t)(1));const f=this.getLociRepresentation(),y=this.getInteractionsRepresentation();this.representation$=this.structure$.pipe((0,Pe.v)(this.canvasService.initialized$),(0,Pe.v)(f),(0,Pe.v)(y),(0,je.T)(()=>{}),(0,Dt.t)(1)),this._representation=this.representation$.subscribe()}ngOnDestroy(){this._representation.unsubscribe()}getLociRepresentation(){return this.structure$.pipe((0,Pe.v)(this.loci$),(0,je.T)(([i,s])=>({structure:i,loci:s})),(0,je.T)(({structure:i,loci:s})=>{const l=[...this.structureService.i2r.values()];return{structure:i,loci:s.map(c=>{if(c.start){c={...c,end:c.end||c.start};const h=this.structureService.r2i.get(c.chain+c.start),f=this.structureService.r2i.get(c.chain+c.end);return{...c,ids:l.slice(h,f+1)}}return{...c,ids:l.filter(h=>h.startsWith(c.chain))}})}}),(0,xe.n)(({structure:i,loci:s})=>{const l=[];for(const{ids:f,color:y}of s){const g=xd(f,i),x=z.iZ.Bundle.fromLoci(g),[w]=on(y||this.settingsService.settings["backbone-color"]);l.push({bundle:x,color:w,clear:!1})}const u=this.pluginService.plugin,c=u.state.data.build(),h=function Qd(r,e){const i=ft.l.ofBundle(r,e.root),s=ft.l.merge(i);return ft.l.filter(s,e)}(l,i);for(const f of u.managers.structure.hierarchy.current.structures)for(const y of f.components)for(const g of y.representations){c.to(g.cell.transform.ref).apply(jt.f.Representation.OverpaintStructureRepresentation3DFromBundle,ft.l.toBundle(h));const x=xd([...this.structureService.i2r.values()],i),w=z.iZ.Bundle.fromLoci(x),[b,C]=on(this.settingsService.settings["backbone-color"]);c.to(g.cell.transform.ref).apply(jt.f.Representation.TransparencyStructureRepresentation3DFromBundle,{layers:[{bundle:w,value:C}]})}return(0,xt.H)(c.commit({doNotUpdateCurrent:!0}))}))}getInteractionsRepresentation(){let i;return this.structure$.pipe((0,Pe.v)(this.interactions$),(0,je.T)(([s,l])=>({structure:s,interactions:l})),(0,je.T)(({structure:s,interactions:l})=>{const u=l.reduce((c,{from:h,to:f})=>[...c,h,f],[]);return z.oE.eachAtomicHierarchyElement(s,{atom:c=>{const h=bt.eB.create(z.StructureProperties.atom.x(c),z.StructureProperties.atom.y(c),z.StructureProperties.atom.z(c));for(const f of u)f.coordinates||(f["atom.id"]===z.StructureProperties.atom.id(c)||f["chain.id"]===z.StructureProperties.chain.auth_asym_id(c)&&f["residue.id"]===z.StructureProperties.residue.auth_seq_id(c)+z.StructureProperties.residue.pdbx_PDB_ins_code(c)&&f["atom.name"]===z.StructureProperties.atom.auth_atom_id(c))&&(f.coordinates=h)}}),{structure:s,interactions:l=l.filter(({from:c,to:h})=>c.coordinates&&h.coordinates)}}),(0,xe.n)(({interactions:s})=>{const u=this.pluginService.plugin.state.data.build(),c=s.map(({from:f,to:y,color:g,label:x,size:w})=>({from:f.coordinates,to:y.coordinates,color:on(g||this.settingsService.settings["interaction-color"]).at(0),size:w||this.settingsService.settings["interaction-size"],label:x}));return i&&u.delete(i),i=u.toRoot().apply(Je,{data:c}).apply(jt.f.Representation.ShapeRepresentation3D).ref,(0,xt.H)(u.commit({doNotUpdateCurrent:!0}))}),(0,Dt.t)(1))}static#e=this.\u0275fac=function(s){return new(s||r)(W.KVO(Zt.Z),W.KVO(gn),W.KVO(_t.z),W.KVO(vd))};static#t=this.\u0275prov=W.jDH({token:r,factory:r.\u0275fac,providedIn:"platform"})}return r})();var Gd=F(2326),Yd=F(6365);let Ed=(()=>{class r{set highlights(i){this.input$.next(i)}constructor(i,s){this.structureService=i,this.pluginService=s,this.input$=new Nt.m(1);const l=this.pluginService.plugin,u=l.behaviors.interaction.hover,c=this.structureService.structure$.pipe((0,Pe.v)(this.input$),(0,je.T)(([f,y])=>({structure:f,highlights:y})),(0,je.T)(({structure:f,highlights:y})=>{if(y){const g=[...this.structureService.i2r.values()],x=this.structureService.r2i.get(y.chain+y.start),w=this.structureService.r2i.get(y.chain+y.end);return{structure:f,highlights:{...y,ids:g.slice(x,w+1)}}}return{structure:f,highlights:{start:"",end:"",chain:"",ids:[]}}}),(0,je.T)(({structure:f,highlights:y})=>{if(y.ids.length>0){const g=xd(y.ids,f);l.managers.interactivity.lociHighlights.highlightOnly({loci:g})}}));this.output$=u.pipe((0,je.T)(f=>{if(f&&"element-loci"===f.current.loci.kind&&z.iZ.Loci.is(f.current.loci)){const y=z.iZ.Loci.getFirstLocation(f.current.loci);if(y){const g=z.StructureProperties.chain.auth_asym_id(y),b=z.StructureProperties.residue.auth_seq_id(y)+z.StructureProperties.residue.pdbx_PDB_ins_code(y);return{start:b,end:b+"",chain:g}}}}),(0,Dt.t)(1));const h=c.pipe(function Xd(...r){return function Zd(...r){const e=(0,qt.lI)(r),i=(0,qt.R0)(r,1/0);return r=(0,Gd.K)(r),(0,Ue.N)((s,l)=>{(0,Yd.U)(i)((0,xt.H)([s,...r],e)).subscribe(l)})}(...r)}(this.output$),(0,je.T)(()=>{}));this._highlights=h.subscribe()}ngOnDestroy(){this._highlights.unsubscribe()}static#e=this.\u0275fac=function(s){return new(s||r)(W.KVO(Zt.Z),W.KVO(_t.z))};static#t=this.\u0275prov=W.jDH({token:r,factory:r.\u0275fac,providedIn:"platform"})}return r})();const Jd=["container"];let eh=(()=>{class r{set container(i){this.canvasService.container=i}set source(i){this.structureService.source=i}set loci(i){this.representationService.loci=i}set interactions(i){this.representationService.interactions=i}set settings(i){this.settingsService.settings=i}set highlights(i){this.highlightService.highlights=i}constructor(i,s,l,u,c,h){this.representationService=i,this.highlightService=s,this.structureService=l,this.settingsService=u,this.pluginService=c,this.canvasService=h,this.highlights$=this.highlightService.output$}static#e=this.\u0275fac=function(s){return new(s||r)(W.rXU(jd),W.rXU(Ed),W.rXU(Zt.Z),W.rXU(gn),W.rXU(_t.z),W.rXU(vd))};static#t=this.\u0275cmp=W.VBU({type:r,selectors:[["ngx-structure-viewer"]],viewQuery:function(s,l){if(1&s&&W.GBs(Jd,5),2&s){let u;W.mGM(u=W.lsd())&&(l.container=u.first)}},inputs:{source:"source",loci:"loci",interactions:"interactions",settings:"settings",highlights:"highlights"},outputs:{highlights$:"highlights"},standalone:!0,features:[W.Jv_([jd,Ed,Zt.Z,gn,_t.z,vd]),W.aNF],decls:4,vars:0,consts:[["container",""],["canvas",""],[1,"ngx-structure-viewer-container"],[1,"ngx-structure-viewer-canvas"]],template:function(s,l){1&s&&(W.j41(0,"div",2,0),W.nrm(2,"canvas",3,1),W.k0s())},dependencies:[He.MD],styles:[".msp-plugin{font-family:Helvetica Neue,Segoe UI,Helvetica,Source Sans Pro,Arial,sans-serif;font-size:14px;line-height:1.42857143;position:absolute;inset:0;background:#111318}.msp-plugin *{box-sizing:border-box}.msp-plugin [hidden],.msp-plugin template{display:none}.msp-plugin a{background-color:transparent}.msp-plugin a:active,.msp-plugin a:hover{outline:0}.msp-plugin abbr[title]{border-bottom:1px dotted}.msp-plugin b,.msp-plugin strong{font-weight:700}.msp-plugin small{font-size:80%}.msp-plugin img{border:0}.msp-plugin svg:not(:root){overflow:hidden}.msp-plugin button,.msp-plugin input,.msp-plugin optgroup,.msp-plugin select,.msp-plugin textarea{color:inherit;font:inherit;margin:0}.msp-plugin button{overflow:visible}.msp-plugin button,.msp-plugin select{text-transform:none}.msp-plugin button,.msp-plugin html input[type=button],.msp-plugin input[type=reset],.msp-plugin input[type=submit]{-webkit-appearance:button;cursor:pointer}.msp-plugin button[disabled],.msp-plugin html input[disabled]{cursor:default}.msp-plugin button::-moz-focus-inner,.msp-plugin input::-moz-focus-inner{border:0;padding:0}.msp-plugin input{line-height:normal}.msp-plugin input[type=checkbox],.msp-plugin input[type=radio]{box-sizing:border-box;padding:0}.msp-plugin input[type=number]::-webkit-inner-spin-button,.msp-plugin input[type=number]::-webkit-outer-spin-button{height:auto}.msp-plugin textarea{overflow:auto}.msp-plugin .msp-layout-expanded,.msp-plugin .msp-layout-standard{inset:0}.msp-plugin .msp-layout-standard{border:1px solid #313645}.msp-plugin .msp-layout-region{overflow:hidden}.msp-plugin .msp-layout-static,.msp-plugin .msp-layout-scrollable{position:absolute}.msp-plugin .msp-scrollable{overflow-y:auto}.msp-plugin .msp-scrollable-container{position:absolute;inset:0;overflow-y:auto}.msp-plugin .msp-layout-static{overflow:hidden}.msp-plugin .msp-layout-top .msp-layout-static,.msp-plugin .msp-layout-main .msp-layout-static,.msp-plugin .msp-layout-bottom .msp-layout-static,.msp-plugin .msp-layout-right .msp-layout-static{inset:0}.msp-plugin .msp-layout-right .msp-layout-scrollable{inset:43px 0 0}.msp-plugin .msp-layout-left .msp-layout-static{inset:0}.msp-plugin .msp-layout-standard-outside{position:absolute}.msp-plugin .msp-layout-standard-outside .msp-layout-main{position:absolute;inset:0}.msp-plugin .msp-layout-standard-outside .msp-layout-top{position:absolute;right:0;height:97px;top:-97px;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;top:-97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-right{position:absolute;width:50%;right:0;bottom:-295px;height:295px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-left{position:absolute;width:50%;left:0;bottom:-295px;height:295px;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-standard-outside .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-outside .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-standard-landscape{position:absolute}.msp-plugin .msp-layout-standard-landscape .msp-layout-main{position:absolute;inset:100px 300px 70px 330px}.msp-plugin .msp-layout-standard-landscape .msp-layout-top{position:absolute;left:330px;right:300px;height:100px;top:0;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-bottom{position:absolute;left:330px;right:300px;height:70px;bottom:0;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-right{position:absolute;width:300px;right:0;bottom:0;top:0;border-left:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-left{position:absolute;width:330px;left:0;bottom:0;top:0;border-right:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-main,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-top,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-bottom{right:0}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-main,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-top,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-bottom{left:0}.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-main,.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-top,.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-bottom{left:32px}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-bottom .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-top .msp-layout-main{top:0}.msp-plugin .msp-layout-standard-portrait{position:absolute}.msp-plugin .msp-layout-standard-portrait .msp-layout-main{position:absolute;inset:97px 0 361px}.msp-plugin .msp-layout-standard-portrait .msp-layout-top{position:absolute;right:0;height:97px;top:0;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-right{position:absolute;width:50%;right:0;bottom:0;height:361px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-left{position:absolute;width:50%;left:0;bottom:0;height:361px;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-right.msp-layout-hide-left .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-portrait .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-portrait .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-top.msp-layout-hide-bottom .msp-layout-main{top:0}.msp-plugin .msp-layout-standard-reactive{position:absolute}@media (orientation: landscape),(min-width: 1000px){.msp-plugin .msp-layout-standard-reactive .msp-layout-main{position:absolute;inset:100px 300px 70px 330px}.msp-plugin .msp-layout-standard-reactive .msp-layout-top{position:absolute;left:330px;right:300px;height:100px;top:0;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-bottom{position:absolute;left:330px;right:300px;height:70px;bottom:0;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-right{position:absolute;width:300px;right:0;bottom:0;top:0;border-left:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-left{position:absolute;width:330px;left:0;bottom:0;top:0;border-right:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-main,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-top,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-bottom{right:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-main,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-top,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-bottom{left:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-main,.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-top,.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-bottom{left:32px}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-main{top:0}}@media (orientation: portrait) and (max-width: 1000px){.msp-plugin .msp-layout-standard-reactive .msp-layout-main{position:absolute;inset:97px 0 361px}.msp-plugin .msp-layout-standard-reactive .msp-layout-top{position:absolute;right:0;height:97px;top:0;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-right{position:absolute;width:50%;right:0;bottom:0;height:361px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-left{position:absolute;width:50%;left:0;bottom:0;height:361px;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right.msp-layout-hide-left .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top.msp-layout-hide-bottom .msp-layout-main{top:0}}.msp-plugin .msp-layout-expanded{position:fixed}@media (orientation: landscape){.msp-plugin .msp-layout-expanded .msp-layout-main{position:absolute;inset:100px 300px 70px 330px}.msp-plugin .msp-layout-expanded .msp-layout-top{position:absolute;left:330px;right:300px;height:100px;top:0;border-bottom:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-bottom{position:absolute;left:330px;right:300px;height:70px;bottom:0;border-top:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-right{position:absolute;width:300px;right:0;bottom:0;top:0;border-left:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-left{position:absolute;width:330px;left:0;bottom:0;top:0;border-right:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-main,.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-top,.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-bottom{right:0}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-main,.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-top,.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-bottom{left:0}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-main,.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-top,.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-bottom{left:32px}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-main{bottom:0}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-main{top:0}}@media (orientation: portrait){.msp-plugin .msp-layout-expanded .msp-layout-main{position:absolute;inset:97px 0 361px}.msp-plugin .msp-layout-expanded .msp-layout-top{position:absolute;right:0;height:97px;top:0;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-right{position:absolute;width:50%;right:0;bottom:0;height:361px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-left{position:absolute;width:50%;left:0;bottom:0;height:361px;border-top:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-right.msp-layout-hide-left .msp-layout-main{bottom:0}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-top.msp-layout-hide-bottom .msp-layout-main{top:0}}.msp-plugin ::-webkit-scrollbar{width:10px;height:10px}.msp-plugin ::-webkit-scrollbar-track{border-radius:0;background-color:#16191f}.msp-plugin ::-webkit-scrollbar-thumb{border-radius:0;background-color:#0e0f14}.msp-plugin .msp-form-control,.msp-plugin .msp-control-row select,.msp-plugin .msp-control-row button,.msp-plugin .msp-control-row input[type=text],.msp-plugin .msp-btn{display:block;width:100%;background:#0c0d11;border:none;padding:0 10px;line-height:30px;height:32px;appearance:none;box-shadow:none;background-image:none}.msp-plugin .msp-form-control::-moz-placeholder,.msp-plugin .msp-control-row select::-moz-placeholder,.msp-plugin .msp-control-row button::-moz-placeholder,.msp-plugin .msp-control-row input[type=text]::-moz-placeholder,.msp-plugin .msp-btn::-moz-placeholder{color:#637ca0;opacity:1}.msp-plugin .msp-form-control:-ms-input-placeholder,.msp-plugin .msp-control-row select:-ms-input-placeholder,.msp-plugin .msp-control-row button:-ms-input-placeholder,.msp-plugin .msp-control-row input[type=text]:-ms-input-placeholder,.msp-plugin .msp-btn:-ms-input-placeholder{color:#637ca0}.msp-plugin .msp-form-control::-webkit-input-placeholder,.msp-plugin .msp-control-row select::-webkit-input-placeholder,.msp-plugin .msp-control-row button::-webkit-input-placeholder,.msp-plugin .msp-control-row input[type=text]::-webkit-input-placeholder,.msp-plugin .msp-btn::-webkit-input-placeholder{color:#637ca0}.msp-plugin .msp-form-control:hover,.msp-plugin .msp-control-row select:hover,.msp-plugin .msp-control-row button:hover,.msp-plugin .msp-control-row input[type=text]:hover,.msp-plugin .msp-btn:hover{color:#51a2fb;background-color:#16191f;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-form-control:active,.msp-plugin .msp-control-row select:active,.msp-plugin .msp-control-row button:active,.msp-plugin .msp-control-row input[type=text]:active,.msp-plugin .msp-btn:active,.msp-plugin .msp-form-control:focus,.msp-plugin .msp-control-row select:focus,.msp-plugin .msp-control-row button:focus,.msp-plugin .msp-control-row input[type=text]:focus,.msp-plugin .msp-btn:focus{color:#ccd4e0;background-color:#0c0d11;border:none;outline-offset:0;outline:none}.msp-plugin .msp-form-control[disabled],.msp-plugin .msp-control-row select[disabled],.msp-plugin .msp-control-row button[disabled],.msp-plugin .msp-control-row input[disabled][type=text],.msp-plugin [disabled].msp-btn,.msp-plugin .msp-form-control[readonly],.msp-plugin .msp-control-row select[readonly],.msp-plugin .msp-control-row button[readonly],.msp-plugin .msp-control-row input[readonly][type=text],.msp-plugin [readonly].msp-btn,fieldset[disabled] .msp-plugin .msp-form-control,fieldset[disabled] .msp-plugin .msp-control-row select,fieldset[disabled] .msp-plugin .msp-control-row button,fieldset[disabled] .msp-plugin .msp-control-row input[type=text],fieldset[disabled] .msp-plugin .msp-btn{background:#111318;opacity:.35}.msp-plugin .msp-btn,.msp-plugin .msp-control-row button{display:inline-block;margin-bottom:0;text-align:center;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;-webkit-user-select:none;user-select:none;padding:0 10px;line-height:32px;border:none;box-sizing:border-box}.msp-plugin .msp-btn[disabled],.msp-plugin .msp-control-row button[disabled]{background:#111318;opacity:.35}.msp-plugin .msp-btn-block,.msp-plugin .msp-control-row button{display:block;width:100%}.msp-plugin .msp-btn,.msp-plugin .msp-control-row button,.msp-plugin .msp-btn:active,.msp-plugin .msp-btn-link:focus,.msp-plugin .msp-btn:hover{outline:none}.msp-plugin .msp-material-icon svg{display:inline-flex;vertical-align:middle;font-size:1.2em;margin-bottom:3px;fill:currentColor;width:1em;height:1em;flex-shrink:0;-webkit-user-select:none;user-select:none}.msp-plugin .msp-btn-block>.msp-material-icon,.msp-plugin .msp-control-row button>.msp-material-icon{margin-left:0;margin-right:.4em}.msp-plugin .msp-btn-childless>.msp-material-icon{margin-left:0;margin-right:0}.msp-plugin .msp-btn-icon{border:none;height:32px;width:32px;line-height:32px;padding:0;text-align:center}.msp-plugin .msp-btn-icon:hover{color:#51a2fb;background-color:#16191f;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-btn-icon[disabled],.msp-plugin .msp-btn-icon[disabled]:hover,.msp-plugin .msp-btn-icon[disabled]:active{color:#637ca0}.msp-plugin .msp-btn-icon-small{border:none;height:32px;width:20px;line-height:32px;padding:0;text-align:center}.msp-plugin .msp-btn-icon-small:hover{color:#51a2fb;background-color:#16191f;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-btn-icon-small[disabled],.msp-plugin .msp-btn-icon-small[disabled]:hover,.msp-plugin .msp-btn-icon-small[disabled]:active{color:#637ca0}.msp-plugin .msp-btn-link{font-weight:400;border-radius:0}.msp-plugin .msp-btn-link,.msp-plugin .msp-btn-link:active,.msp-plugin .msp-btn-link.active,.msp-plugin .msp-btn-link[disabled],fieldset[disabled] .msp-plugin .msp-btn-link{background-color:transparent;box-shadow:none}.msp-plugin .msp-btn-link,.msp-plugin .msp-btn-link:hover,.msp-plugin .msp-btn-link:focus,.msp-plugin .msp-btn-link:active{border-color:transparent}.msp-plugin .msp-btn-link:hover,.msp-plugin .msp-btn-link:focus{text-decoration:none;background-color:transparent}.msp-plugin .msp-btn-link[disabled]:hover,.msp-plugin .msp-btn-link[disabled]:focus,fieldset[disabled] .msp-plugin .msp-btn-link:hover,fieldset[disabled] .msp-plugin .msp-btn-link:focus{text-decoration:none}.msp-plugin .msp-btn-link .msp-icon{font-size:100%}.msp-plugin .msp-btn-link,.msp-plugin .msp-btn-link:active,.msp-plugin .msp-btn-link:focus{color:#ccd4e0;text-decoration:none}.msp-plugin .msp-btn-link:hover{color:#51a2fb;text-decoration:none}.msp-plugin .msp-btn-link-toggle-on{color:#ccd4e0}.msp-plugin .msp-btn-link-toggle-off,.msp-plugin .msp-btn-link-toggle-off:active,.msp-plugin .msp-btn-link-toggle-off:focus{color:#637ca0!important}.msp-plugin .msp-btn-link-toggle-off:hover,.msp-plugin .msp-btn-link-toggle-on:hover{color:#51a2fb!important}.msp-plugin .msp-btn-action,.msp-plugin .msp-btn-action:active,.msp-plugin .msp-btn-action:focus{color:#ccd4e0;background:#0c0d11}.msp-plugin .msp-btn-action:hover{color:#51a2fb;background:#060709}.msp-plugin .msp-btn-action[disabled],.msp-plugin .msp-btn-action[disabled]:hover,.msp-plugin .msp-btn-action[disabled]:active,.msp-plugin .msp-btn-action[disabled]:focus{color:#c9d1de}.msp-plugin .msp-btn-commit-on,.msp-plugin .msp-btn-commit-on:active,.msp-plugin .msp-btn-commit-on:focus{color:#68befd;background:#0d0e12}.msp-plugin .msp-btn-commit-on:hover{color:#51a2fb;background:#07080b}.msp-plugin .msp-btn-commit-on[disabled],.msp-plugin .msp-btn-commit-on[disabled]:hover,.msp-plugin .msp-btn-commit-on[disabled]:active,.msp-plugin .msp-btn-commit-on[disabled]:focus{color:#63bcfd}.msp-plugin .msp-btn-commit-off,.msp-plugin .msp-btn-commit-off:active,.msp-plugin .msp-btn-commit-off:focus{color:#ccd4e0;background:#090a0c}.msp-plugin .msp-btn-commit-off:hover{color:#51a2fb;background:#030405}.msp-plugin .msp-btn-commit-off[disabled],.msp-plugin .msp-btn-commit-off[disabled]:hover,.msp-plugin .msp-btn-commit-off[disabled]:active,.msp-plugin .msp-btn-commit-off[disabled]:focus{color:#c9d1de}.msp-plugin .msp-btn-remove:hover{color:#f2f4f7}.msp-plugin .msp-btn-commit-on:hover{color:#0393fc}.msp-plugin .msp-btn-action{height:32px;line-height:32px}.msp-plugin input[type=file]{display:block}.msp-plugin input[type=range]{display:block;width:100%}.msp-plugin select[multiple],.msp-plugin select[size],.msp-plugin textarea.msp-form-control,.msp-plugin textarea.msp-btn{height:auto}.msp-plugin .msp-control-top-offset{margin-top:1px}.msp-plugin .msp-btn-commit{text-align:right;padding:0 10px 0 0;line-height:32px;border:none;overflow:hidden;font-weight:700}.msp-plugin .msp-btn-commit .msp-icon{display:block-inline;line-height:32px;width:32px;text-align:center}.msp-plugin select.msp-form-control,.msp-plugin .msp-control-row select,.msp-plugin select.msp-btn{background:none;background-color:#0c0d11;background-size:8px 12px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAMAAACzvE1FAAAADFBMVEUzMzMzMzMzMzMzMzMKAG/3AAAAA3RSTlMAf4C/aSLHAAAAPElEQVR42q3NMQ4AIAgEQTn//2cLdRKppSGzBYwzVXvznNWs8C58CiussPJj8h6NwgorrKRdTvuV9v16Afn0AYFOB7aYAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right 10px center;padding-right:24px}.msp-plugin select.msp-form-control:-moz-focusring,.msp-plugin .msp-control-row select:-moz-focusring,.msp-plugin select.msp-btn:-moz-focusring{color:transparent;text-shadow:0 0 0 #ccd4e0}.msp-plugin .msp-default-bg{background:#111318}.msp-plugin .msp-transparent-bg{background:transparent}.msp-plugin .msp-no-hover-outline:hover{color:#51a2fb;background-color:inherit;border:none;outline-offset:0!important;outline:none!important}.msp-plugin .msp-icon-inline{margin-right:8px}.msp-plugin .msp-control-row{position:relative;height:32px;background:#111318;margin-top:1px}.msp-plugin .msp-control-row>span.msp-control-row-label,.msp-plugin .msp-control-row>button.msp-control-button-label{line-height:32px;display:block;width:120px;text-align:right;padding:0 10px;color:#9cacc3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-control-row>button.msp-control-button-label{background:#111318;cursor:pointer}.msp-plugin .msp-control-row .msp-control-current{background:#111318}.msp-plugin .msp-control-row>div.msp-control-row-ctrl{position:absolute;inset:0 0 0 120px}.msp-plugin .msp-control-row>div{background:#0c0d11}.msp-plugin .msp-control-row>.msp-flex-row,.msp-plugin .msp-control-row>.msp-state-image-row{background:#111318}.msp-plugin .msp-control-label-short>span{width:80px!important}.msp-plugin .msp-control-label-short>div:nth-child(2){left:80px!important}.msp-plugin .msp-control-col-2{float:left;width:50%}.msp-plugin .msp-control-twoline{height:64px!important}.msp-plugin .msp-control-group{position:relative}.msp-plugin .msp-toggle-button .msp-icon{display:inline-block;margin-right:6px}.msp-plugin .msp-toggle-button>div>button:hover{border-color:#16191f!important;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-slider>div:first-child{position:absolute;inset:0 62px 0 18px;display:flex}.msp-plugin .msp-slider>div:last-child{position:absolute;height:32px;line-height:32px;text-align:center;right:0;width:50px;top:0;bottom:0}.msp-plugin .msp-slider input[type=text]{padding-right:6px;padding-left:4px;font-size:80%;text-align:right}.msp-plugin .msp-slider2>div:first-child{position:absolute;height:32px;line-height:32px;text-align:center;left:0;width:25px;top:0;bottom:0;font-size:80%}.msp-plugin .msp-slider2>div:nth-child(2){position:absolute;inset:0 37px 0 35px;display:flex}.msp-plugin .msp-slider2>div:last-child{position:absolute;height:32px;line-height:32px;text-align:center;right:0;width:25px;top:0;bottom:0;font-size:80%}.msp-plugin .msp-slider2 input[type=text]{padding-right:4px;padding-left:4px;font-size:80%;text-align:center}.msp-plugin .msp-toggle-color-picker button{border:10px solid #0c0d11!important;margin:0;text-align:center;padding-right:10px;padding-left:10px}.msp-plugin .msp-toggle-color-picker button:hover{border-color:#16191f!important;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-toggle-color-picker .msp-color-picker{position:absolute;z-index:100000;background:#111318;border-top:1px solid #111318;padding-bottom:5px;width:100%}.msp-plugin .msp-toggle-color-picker-above .msp-color-picker{top:-85px;height:85px}.msp-plugin .msp-toggle-color-picker-below .msp-color-picker{top:32px;height:80px}.msp-plugin .msp-control-offset{padding-left:10px}.msp-plugin .msp-accent-offset{padding-left:1px;margin-left:8px;border-left:2px solid #d67118}.msp-plugin .msp-control-group-wrapper{margin-bottom:0;margin-top:1px}.msp-plugin .msp-control-group-header{background:#111318}.msp-plugin .msp-control-group-header>button,.msp-plugin .msp-control-group-header div{padding-left:4px;text-align:left;height:24px!important;line-height:24px!important;font-size:85%!important;background:#111318!important;color:#9cacc3}.msp-plugin .msp-control-group-header .msp-icon{height:24px!important;line-height:24px!important}.msp-plugin .msp-control-group-header>span{padding-left:5px;line-height:21.3333333333px;font-size:70%;background:#111318;color:#9cacc3}.msp-plugin .msp-control-current{background:#111318}.msp-plugin .msp-control-group-footer{background:#1c1f27;height:5px;font-size:1px;margin-top:1px}.msp-plugin .msp-control-group-expander{display:block;position:absolute;line-height:32px;padding:0;left:0;top:0;width:120px;text-align:left;background:transparent}.msp-plugin .msp-control-group-expander .msp-icon{line-height:29px;width:31px;text-align:center;font-size:100%}.msp-plugin .msp-plugin-layout_controls{position:absolute;left:10px;top:10px}.msp-plugin .msp-plugin-layout_controls>button:first-child{margin-right:6px}.msp-plugin .msp-empty-control{display:none}.msp-plugin .msp-control .msp-btn-block,.msp-plugin .msp-control .msp-control-row button,.msp-plugin .msp-control-row .msp-control button{margin-bottom:0;margin-top:0}.msp-plugin .msp-row-text{height:32px;position:relative;background:#111318;margin-top:1px}.msp-plugin .msp-row-text>div{line-height:32px;text-align:center;color:#9cacc3}.msp-plugin .msp-help span{display:none}.msp-plugin .msp-help:hover span{display:inline-block;background:linear-gradient(#111318,#111318cc)}.msp-plugin .msp-help-text{position:relative;background:#111318;margin-top:1px}.msp-plugin .msp-help-text>div{padding:5px 10px;text-align:left;color:#9cacc3}.msp-plugin .msp-help-description{font-style:italic}.msp-plugin .msp-help-legend{padding-top:10px}.msp-plugin .msp-scale-legend>div{width:100%;height:30px}.msp-plugin .msp-scale-legend>div>span{padding:5px;color:#fff;font-weight:700;background-color:#0003}.msp-plugin .msp-table-legend>div{margin-right:5px;display:inline-flex}.msp-plugin .msp-table-legend>div .msp-table-legend-color{width:30px;height:20px}.msp-plugin .msp-table-legend>div .msp-table-legend-text{margin:0 5px}.msp-plugin .msp-image-preview{position:relative;background:#111318;margin-top:1px;padding:10px}.msp-plugin .msp-image-preview canvas{-webkit-user-select:none;user-select:none}.msp-plugin .msp-image-preview>span{margin-top:6px;display:block;text-align:center;font-size:80%;line-height:15px}.msp-plugin .msp-copy-image-wrapper{position:relative}.msp-plugin .msp-copy-image-wrapper div{font-weight:700;padding:3px;margin:1px 0;width:100%;background:#0c0d11;text-align:center}.msp-plugin .msp-copy-image-wrapper img{margin-top:1px}.msp-plugin .msp-control-text-area-wrapper,.msp-plugin .msp-text-area-wrapper{position:relative}.msp-plugin .msp-control-text-area-wrapper textarea,.msp-plugin .msp-text-area-wrapper textarea{border:none;width:100%;height:100%;background:#0c0d11;padding:5px 10px;resize:none;font-size:12px;line-height:16px}.msp-plugin .msp-control-text-area-wrapper{height:64px!important}.msp-plugin .msp-text-area-wrapper{height:96px!important}.msp-plugin .msp-slider-base{position:relative;height:14px;padding:5px 0;width:100%;border-radius:6px;align-self:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.msp-plugin .msp-slider-base *{box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.msp-plugin .msp-slider-base-rail{position:absolute;width:100%;background-color:#1f222b;height:4px;border-radius:2px}.msp-plugin .msp-slider-base-track{position:absolute;left:0;height:4px;border-radius:6px;background-color:tint(#ccd4e0,60%)}.msp-plugin .msp-slider-base-handle{position:absolute;margin-left:-11px;margin-top:-9px;width:22px;height:22px;cursor:pointer;border-radius:50%;background-color:#ccd4e0;border:4px solid #1f222b}.msp-plugin .msp-slider-base-handle:hover{background-color:#51a2fb}.msp-plugin .msp-slider-base-mark{position:absolute;top:18px;left:0;width:100%;font-size:12px}.msp-plugin .msp-slider-base-mark-text{position:absolute;display:inline-block;vertical-align:middle;text-align:center;cursor:pointer;color:#999}.msp-plugin .msp-slider-base-mark-text-active{color:#666}.msp-plugin .msp-slider-base-step{position:absolute;width:100%;height:4px;background:transparent}.msp-plugin .msp-slider-base-dot{position:absolute;bottom:-2px;margin-left:-4px;width:8px;height:8px;border:2px solid #e9e9e9;background-color:#fff;cursor:pointer;border-radius:50%;vertical-align:middle}.msp-plugin .msp-slider-base-dot:first-child{margin-left:-4px}.msp-plugin .msp-slider-base-dot:last-child{margin-left:-4px}.msp-plugin .msp-slider-base-dot-active{border-color:tint(#ccd4e0,50%)}.msp-plugin .msp-slider-base-disabled{background:#111318;opacity:.35}.msp-plugin .msp-slider-base-disabled .msp-slider-base-handle,.msp-plugin .msp-slider-base-disabled .msp-slider-base-dot{cursor:not-allowed}.msp-plugin .msp-slider-base-disabled .msp-slider-base-mark-text,.msp-plugin .msp-slider-base-disabled .msp-slider-base-dot{cursor:not-allowed!important}.msp-plugin .msp-description{padding:10px;font-size:85%;background:#111318;text-align:center;-webkit-user-select:none;-o-user-select:none;user-select:none;font-weight:light;cursor:default}.msp-plugin .msp-description:not(:first-child){border-top:1px solid #1f222b}.msp-plugin .msp-color-picker input{color:#000!important}.msp-plugin .msp-no-webgl{position:absolute;width:100%;height:100%;left:0;top:0;display:table;text-align:center;background:#111318}.msp-plugin .msp-no-webgl>div{display:table-cell;vertical-align:middle;text-align:center;width:100%;height:100%}.msp-plugin .msp-no-webgl>div b{font-size:120%}.msp-plugin .msp-loader-msp-btn-file{position:relative;overflow:hidden}.msp-plugin .msp-loader-msp-btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block}.msp-plugin .msp-controls-section{margin-bottom:10px}.msp-plugin .msp-combined-color-button{border:4px solid #0c0d11!important;margin:0;text-align:center;padding-right:10px;padding-left:10px}.msp-plugin .msp-combined-color-button:hover{border-color:#16191f!important;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-combined-color-swatch{width:100%;display:grid;grid-gap:1px;grid-template-columns:repeat(6,auto)}.msp-plugin .msp-combined-color-swatch .msp-btn:hover,.msp-plugin .msp-combined-color-swatch .msp-control-row button:hover,.msp-plugin .msp-control-row .msp-combined-color-swatch button:hover{outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-action-select{position:relative}.msp-plugin .msp-action-select select{padding-left:42px}.msp-plugin .msp-action-select option:first-child{color:#9cacc3}.msp-plugin .msp-action-select>.msp-icon{display:block;top:0;left:10px;position:absolute;line-height:32px}.msp-plugin .msp-simple-help-section{height:28px;line-height:28px;margin-top:5px;margin-bottom:5px;padding:0 10px;font-weight:500;background:#111318;color:#ccd4e0}.msp-plugin .msp-left-panel-controls-buttons{position:absolute;width:32px;top:0;bottom:0;padding-top:10px;background:#111318}.msp-plugin .msp-left-panel-controls-buttons-bottom{position:absolute;bottom:0}.msp-plugin .msp-left-panel-controls-button-data-dirty{position:absolute;width:6px;height:6px;background:#d67118;border-radius:3px;right:6px;bottom:6px}.msp-plugin .msp-left-panel-controls .msp-scrollable-container{left:33px}.msp-plugin .msp-mapped-parameter-group{position:relative}.msp-plugin .msp-mapped-parameter-group>.msp-control-row:first-child>div:nth-child(2){right:33px}.msp-plugin .msp-mapped-parameter-group>button:first-child{right:33px}.msp-plugin .msp-mapped-parameter-group>.msp-btn-icon{position:absolute;right:0;width:32px;top:0;padding:0}.msp-plugin .msp-shape-filled{fill:#ccd4e0;stroke:#ccd4e0}.msp-plugin .msp-shape-empty{fill:none;stroke:#ccd4e0}.msp-plugin .msp-no-overflow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.msp-plugin .msp-25-lower-contrast-text{color:#7d91b0}.msp-plugin .msp-expandable-group-color-stripe{position:absolute;left:0;top:30px;width:120px;height:2px}.msp-plugin .msp-section-header{height:32px;line-height:32px;margin-top:10px;margin-bottom:10px;text-align:right;padding:0 10px;font-weight:700;background:#111318;overflow:hidden;cursor:default}.msp-plugin .msp-section-header>.msp-icon{display:block;float:left}.msp-plugin .msp-section-header>small{font-weight:400}.msp-plugin .msp-current-header{height:32px;line-height:32px;margin-bottom:10px;text-align:center;font-weight:700;background:#111318}.msp-plugin .msp-flex-row,.msp-plugin .msp-state-image-row{margin-top:1px;background:#111318;display:flex;flex-direction:row;width:inherit;height:32px}.msp-plugin .msp-flex-row>.msp-flex-item,.msp-plugin .msp-state-image-row>.msp-flex-item{margin:0 1px 0 0;flex:1 1 auto;overflow:hidden}.msp-plugin .msp-flex-row>.msp-flex-item:last-child,.msp-plugin .msp-state-image-row>.msp-flex-item:last-child{margin-right:0}.msp-plugin .msp-flex-row>select,.msp-plugin .msp-state-image-row>select,.msp-plugin .msp-flex-row>button,.msp-plugin .msp-state-image-row>button{margin:0 1px 0 0;flex:1 1 auto;height:32px;overflow:hidden}.msp-plugin .msp-flex-row .msp-btn-icon,.msp-plugin .msp-state-image-row .msp-btn-icon,.msp-plugin .msp-flex-row .msp-btn-icon-small,.msp-plugin .msp-state-image-row .msp-btn-icon-small{flex:0 0 32px;max-width:32px}.msp-plugin .msp-flex-row>select,.msp-plugin .msp-state-image-row>select{background:none}.msp-plugin .msp-flex-row>select>option[value=_],.msp-plugin .msp-state-image-row>select>option[value=_]{display:none}.msp-plugin .msp-flex-row>select:last-child,.msp-plugin .msp-state-image-row>select:last-child,.msp-plugin .msp-flex-row>button:last-child,.msp-plugin .msp-state-image-row>button:last-child{margin-right:0}.msp-plugin .msp-flex-row>button.msp-control-button-label,.msp-plugin .msp-state-image-row>button.msp-control-button-label{background:#111318}.msp-plugin .msp-state-list{list-style:none}.msp-plugin .msp-state-list>li{position:relative;overflow:hidden}.msp-plugin .msp-state-list>li>button:first-child{text-align:left;border-left:10px solid #2a2f3c!important}.msp-plugin .msp-state-list>li>div{position:absolute;right:0;top:0}.msp-plugin .msp-state-image-row{height:96px;margin-top:0}.msp-plugin .msp-state-image-row>button{height:96px;padding:0}.msp-plugin .msp-state-image-row>button>img{min-height:96px;width:inherit;transform:translateY(-50%);top:50%;position:relative}.msp-plugin .msp-tree-row{position:relative;margin-top:0;margin-bottom:1px;background:transparent}.msp-plugin .msp-tree-row-current .msp-btn-tree-label{border-radius:0!important}.msp-plugin .msp-tree-row-current .msp-btn-tree-label>span{font-weight:700}.msp-plugin .msp-tree-row .msp-btn-tree-label{text-align:left;border-radius:0 0 0 8px;border-left-width:4px;border-left-style:solid}.msp-plugin .msp-tree-row .msp-btn-tree-label>small{color:#8d9fb9}.msp-plugin .msp-tree-updates-wrapper .msp-control-group-header:last-child{margin-bottom:1px}.msp-plugin .msp-viewport-top-left-controls{position:absolute;left:10px;top:10px}.msp-plugin .msp-viewport-top-left-controls .msp-traj-controls{line-height:32px;float:left;margin-right:10px;background-color:#0c0d11}.msp-plugin .msp-viewport-top-left-controls .msp-traj-controls>span{color:#ccd4e0;margin-left:10px;margin-right:10px;font-size:85%;display:inline-block}.msp-plugin .msp-viewport-top-left-controls .msp-state-snapshot-viewport-controls{line-height:32px;float:left;margin-right:10px}.msp-plugin .msp-viewport-top-left-controls .msp-state-snapshot-viewport-controls>button{background-color:#0c0d11}.msp-plugin .msp-viewport-top-left-controls .msp-state-snapshot-viewport-controls>select{display:inline-block;width:200px;margin-right:10px}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls{line-height:32px;float:left;margin-right:10px;position:relative}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls>div:first-child{position:relative;display:inline-block}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls>div:first-child>button{position:relative}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls .msp-animation-viewport-controls-select{width:290px;position:absolute;left:0;margin-top:10px;background:#1f222b}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls .msp-animation-viewport-controls-select .msp-control-row:first-child{margin-top:0}.msp-plugin .msp-selection-viewport-controls{position:relative;margin:10px auto 0;width:430px}.msp-plugin .msp-selection-viewport-controls-actions{position:absolute;width:100%;top:32px;background:#1f222b}.msp-plugin .msp-selection-viewport-controls>.msp-flex-row .msp-btn,.msp-plugin .msp-selection-viewport-controls>.msp-state-image-row .msp-btn,.msp-plugin .msp-selection-viewport-controls>.msp-flex-row .msp-control-row button,.msp-plugin .msp-control-row .msp-selection-viewport-controls>.msp-flex-row button,.msp-plugin .msp-selection-viewport-controls>.msp-state-image-row .msp-control-row button,.msp-plugin .msp-control-row .msp-selection-viewport-controls>.msp-state-image-row button{padding:0 5px}.msp-plugin .msp-selection-viewport-controls select.msp-form-control,.msp-plugin .msp-selection-viewport-controls select.msp-btn,.msp-plugin .msp-selection-viewport-controls .msp-control-row select,.msp-plugin .msp-control-row .msp-selection-viewport-controls select{padding:0 5px;text-align:center;background:#0c0d11;flex:0 0 80px;text-overflow:ellipsis}.msp-plugin .msp-param-object-list-item{margin-top:1px;position:relative}.msp-plugin .msp-param-object-list-item>button{text-align:left}.msp-plugin .msp-param-object-list-item>button>span{font-weight:700}.msp-plugin .msp-param-object-list-item>div{position:absolute;right:0;top:0}.msp-plugin .msp-state-actions .msp-transform-wrapper:last-child{margin-bottom:10px}.msp-plugin .msp-button-row{display:flex;flex-direction:row;height:32px;width:inherit}.msp-plugin .msp-button-row>button{margin:0 1px 0 0;flex:1 1 auto;height:32px;text-align-last:center;background:none;padding:0 10px;overflow:hidden}.msp-plugin .msp-action-menu-options-no-header,.msp-plugin .msp-action-menu-options .msp-control-group-children{max-height:300px;overflow:hidden;overflow-y:auto}.msp-plugin .msp-action-menu-options .msp-control-row,.msp-plugin .msp-action-menu-options button,.msp-plugin .msp-action-menu-options .msp-icon,.msp-plugin .msp-action-menu-options .msp-flex-row,.msp-plugin .msp-action-menu-options .msp-state-image-row{height:24px;line-height:24px}.msp-plugin .msp-action-menu-options button{text-align:left}.msp-plugin .msp-action-menu-options .msp-action-menu-button{margin-top:1px;display:flex}.msp-plugin .msp-action-menu-options .msp-action-menu-button .msp-icon{margin-right:6px}.msp-plugin .msp-representation-entry{position:relative}.msp-plugin .msp-representation-entry>.msp-control-group-header>.msp-btn,.msp-plugin .msp-control-row .msp-representation-entry>.msp-control-group-header>button{font-weight:700}.msp-plugin .msp-representation-entry>.msp-control-group-header>.msp-icon,.msp-plugin .msp-representation-entry>.msp-control-group-header>.msp-btn-link{line-height:24px;height:24px}.msp-plugin .msp-control-group-presets-wrapper{position:absolute;right:0;top:0}.msp-plugin .msp-control-group-presets-wrapper .msp-control-group-header{background:transparent}.msp-plugin .msp-control-group-presets-wrapper button{background:transparent!important}.msp-plugin .msp-parameter-matrix input{flex:1 1 auto;min-width:0}.msp-plugin .msp-btn-apply-simple{text-align:left}.msp-plugin .msp-btn-apply-simple .msp-icon{margin-right:10px}.msp-plugin .msp-type-class-Root{border-left-color:#111318}.msp-plugin .msp-type-class-Group{border-left-color:#d67118}.msp-plugin .msp-type-class-Data{border-left-color:#6d8082}.msp-plugin .msp-type-class-Object{border-left-color:#25a25a}.msp-plugin .msp-type-class-Representation3D{border-left-color:#258cd1}.msp-plugin .msp-type-class-Behavior{border-left-color:#804399}.msp-plugin .msp-accent-color-cyan{color:#6d8082}.msp-plugin .msp-accent-bg-cyan{background:#6d8082}.msp-plugin .msp-transform-header-brand-cyan{border-bottom:1px solid #6d8082}.msp-plugin .msp-transform-header-brand-cyan:active,.msp-plugin .msp-transform-header-brand-cyan:focus{border-bottom:1px solid #6d8082}.msp-plugin .msp-accent-color-red{color:#bf2718}.msp-plugin .msp-accent-bg-red{background:#bf2718}.msp-plugin .msp-transform-header-brand-red{border-bottom:1px solid #bf2718}.msp-plugin .msp-transform-header-brand-red:active,.msp-plugin .msp-transform-header-brand-red:focus{border-bottom:1px solid #bf2718}.msp-plugin .msp-accent-color-gray{color:#22303d}.msp-plugin .msp-accent-bg-gray{background:#22303d}.msp-plugin .msp-transform-header-brand-gray{border-bottom:1px solid #22303d}.msp-plugin .msp-transform-header-brand-gray:active,.msp-plugin .msp-transform-header-brand-gray:focus{border-bottom:1px solid #22303d}.msp-plugin .msp-accent-color-green{color:#25a25a}.msp-plugin .msp-accent-bg-green{background:#25a25a}.msp-plugin .msp-transform-header-brand-green{border-bottom:1px solid #25a25a}.msp-plugin .msp-transform-header-brand-green:active,.msp-plugin .msp-transform-header-brand-green:focus{border-bottom:1px solid #25a25a}.msp-plugin .msp-accent-color-purple{color:#804399}.msp-plugin .msp-accent-bg-purple{background:#804399}.msp-plugin .msp-transform-header-brand-purple{border-bottom:1px solid #804399}.msp-plugin .msp-transform-header-brand-purple:active,.msp-plugin .msp-transform-header-brand-purple:focus{border-bottom:1px solid #804399}.msp-plugin .msp-accent-color-blue{color:#258cd1}.msp-plugin .msp-accent-bg-blue{background:#258cd1}.msp-plugin .msp-transform-header-brand-blue{border-bottom:1px solid #258cd1}.msp-plugin .msp-transform-header-brand-blue:active,.msp-plugin .msp-transform-header-brand-blue:focus{border-bottom:1px solid #258cd1}.msp-plugin .msp-accent-color-orange{color:#d67118}.msp-plugin .msp-accent-bg-orange{background:#d67118}.msp-plugin .msp-transform-header-brand-orange{border-bottom:1px solid #d67118}.msp-plugin .msp-transform-header-brand-orange:active,.msp-plugin .msp-transform-header-brand-orange:focus{border-bottom:1px solid #d67118}.msp-plugin .msp-volume-channel-inline-controls>:first-child{position:absolute;left:0;top:0;height:32px;right:32px}.msp-plugin .msp-volume-channel-inline-controls .msp-slider>div:first-child{right:42px}.msp-plugin .msp-volume-channel-inline-controls .msp-slider>div:last-child{width:30px}.msp-plugin .msp-volume-channel-inline-controls>button{position:absolute;right:0;width:32px;top:0;padding:0}.msp-plugin .msp-volume-channel-inline-controls>button .msp-material-icon{margin-right:0}.msp-plugin .msp-list-unstyled{padding-left:0;list-style:none}.msp-plugin .msp-drag-drop-overlay{border:12px dashed #ccd4e0;background:#0000005c;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;font-size:48px;font-weight:700}.msp-plugin .msp-task-state{line-height:32px}.msp-plugin .msp-task-state>span{-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-overlay-tasks{position:absolute;display:flex;inset:0;height:100%;width:100%;z-index:1000;justify-content:center;align-items:center;background:#00000040}.msp-plugin .msp-overlay-tasks .msp-task-state>div{height:32px;margin-top:1px;position:relative;width:100%;background:#111318}.msp-plugin .msp-overlay-tasks .msp-task-state>div>div{height:32px;line-height:32px;display:inline-block;padding:0 10px;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:default;white-space:nowrap;background:#111318;position:absolute}.msp-plugin .msp-overlay-tasks .msp-task-state>div>button{display:inline-block;margin-top:-3px}.msp-plugin .msp-background-tasks{position:absolute;left:0;bottom:0;z-index:1000}.msp-plugin .msp-background-tasks .msp-task-state>div{height:32px;margin-top:1px;position:relative;width:100%;background:#111318}.msp-plugin .msp-background-tasks .msp-task-state>div>div{height:32px;line-height:32px;display:inline-block;padding:0 10px;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:default;white-space:nowrap;background:#111318;position:absolute}.msp-plugin .msp-background-tasks .msp-task-state>div>button{display:inline-block;margin-top:-3px}.msp-plugin .msp-viewport{position:absolute;inset:0;background:#111318}.msp-plugin .msp-viewport .msp-btn-link{background:#0003}.msp-plugin .msp-viewport-expanded{position:fixed;z-index:1000}.msp-plugin .msp-viewport-host3d{position:absolute;inset:0;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none;touch-action:manipulation}.msp-plugin .msp-viewport-host3d>canvas{background-color:#111318;background-image:linear-gradient(45deg,lightgrey 25%,transparent 25%,transparent 75%,lightgrey 75%,lightgrey),linear-gradient(45deg,lightgrey 25%,transparent 25%,transparent 75%,lightgrey 75%,lightgrey);background-size:60px 60px;background-position:0 0,30px 30px}.msp-plugin .msp-viewport-controls{position:absolute;right:10px;top:10px;width:32px}.msp-plugin .msp-viewport-controls-buttons{text-align:right;position:relative}.msp-plugin .msp-viewport-controls-buttons>div{position:relative;margin-bottom:4px}.msp-plugin .msp-viewport-controls-buttons button{padding:0;text-align:center;width:32px;position:relative}.msp-plugin .msp-viewport-controls-buttons .msp-btn-link-toggle-off{color:#637ca0}.msp-plugin .msp-viewport-controls-buttons .msp-btn-link:hover{color:#51a2fb}.msp-plugin .msp-semi-transparent-background{background:#111318;opacity:.5;position:absolute;top:0;left:0;width:100%;height:100%}.msp-plugin .msp-hover-box-wrapper{position:relative}.msp-plugin .msp-hover-box-wrapper .msp-hover-box-body{visibility:hidden;position:absolute;right:36px;top:0;width:100px;background-color:#111318}.msp-plugin .msp-hover-box-wrapper .msp-hover-box-spacer{visibility:hidden;position:absolute;right:32px;top:0;width:4px;height:32px}.msp-plugin .msp-hover-box-wrapper:hover .msp-hover-box-body,.msp-plugin .msp-hover-box-wrapper:hover .msp-hover-box-spacer{visibility:visible}.msp-plugin .msp-viewport-controls-panel{width:290px;top:0;right:36px;position:absolute;background:#1f222b}.msp-plugin .msp-viewport-controls-panel .msp-control-group-wrapper:first-child{padding-top:0}.msp-plugin .msp-viewport-controls-panel .msp-viewport-controls-panel-controls{overflow-y:auto;max-height:400px}.msp-plugin .msp-highlight-toast-wrapper{position:absolute;right:10px;bottom:10px;max-width:95%;z-index:10000}.msp-plugin .msp-highlight-info{color:#51a2fb;padding:3px 10px;background:#111318;opacity:90%;max-width:400px;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-highlight-markdown-row{padding-left:10px}.msp-plugin .msp-highlight-simple-row{text-align:right}.msp-plugin .msp-highlight-info-hr{margin-inline:0px;margin-block:3px;border:none;height:1px;background-color:#51a2fb}.msp-plugin .msp-highlight-info-additional{font-size:85%;display:inline-block;color:#056ee1}.msp-plugin .msp-snapshot-description-wrapper{background:#11131880;position:absolute;left:0;top:42px;padding:6.6px 10px;max-height:224px;overflow:hidden;overflow-y:auto;max-width:400px}.msp-plugin .msp-snapshot-description-wrapper a{text-decoration:underline;cursor:pointer;color:#ccd4e0}.msp-plugin .msp-snapshot-description-wrapper ul,.msp-plugin .msp-snapshot-description-wrapper ol{padding-left:14px}.msp-plugin .msp-log-wrap{position:absolute;inset:0;overflow:hidden}.msp-plugin .msp-log{position:absolute;inset:0 -20px 0 0;overflow-y:scroll;overflow-x:hidden;font-size:90%;background:#1f222b}.msp-plugin .msp-log{font-size:90%;color:#bcc7d6}.msp-plugin .msp-log ul{padding:0;margin:0}.msp-plugin .msp-log li{clear:both;margin:0;background:#111318;position:relative}.msp-plugin .msp-log li:not(:last-child){border-bottom:1px solid #313645}.msp-plugin .msp-log .msp-log-entry{margin-left:110px;background:#14171c;padding:3px 25px 3px 10px}.msp-plugin .msp-log .msp-log-timestamp{padding:3px 10px;float:left;text-align:right;width:110px;color:#8d9fb9;font-size:100%}.msp-plugin .msp-log .msp-log-timestamp small{font-size:100%}.msp-plugin .msp-log .label{margin-top:-3px;font-size:7pt}.msp-plugin .msp-log-entry-badge{position:absolute;left:0;top:0;bottom:0;width:6px}.msp-plugin .msp-log-entry-message{background:#0cca5d}.msp-plugin .msp-log-entry-info{background:#5e3673}.msp-plugin .msp-log-entry-error{background:#fd354b}.msp-plugin .msp-log-entry-warning{background:#fcc937}.msp-plugin .msp-sequence{position:absolute;inset:0;background:#111318}.msp-plugin .msp-sequence-select{position:relative;height:24px;width:100%;margin-bottom:1px;background:#1f222b;text-align:left}.msp-plugin .msp-sequence-select>span{display:inline-block;line-height:24px;padding:0 10px;font-size:85%;font-weight:700;cursor:default}.msp-plugin .msp-sequence-select>select{display:inline-block;max-width:120px;width:auto;text-overflow:ellipsis;font-size:85%;height:24px;line-height:24px;background-size:6px 8px;background-color:#1f222b}.msp-plugin .msp-sequence-wrapper{word-break:break-word;padding:10px 10px 3px;-webkit-user-select:none;user-select:none}.msp-plugin .msp-sequence-wrapper-non-empty{font-size:85%;line-height:180%;font-family:Courier New,monospace;background:#0c0d11;width:100%;overflow-y:auto;overflow-x:hidden;position:absolute;inset:25px 0 0}.msp-plugin .msp-sequence-chain-label{margin-left:10px;margin-top:10px;-webkit-user-select:none;user-select:none;color:#51a2fb;font-size:90%;line-height:90%;padding-left:.2em}.msp-plugin .msp-sequence-wrapper span{cursor:pointer}.msp-plugin .msp-sequence-wrapper .msp-sequence-residue-long{margin:0 .2em}.msp-plugin .msp-sequence-wrapper .msp-sequence-residue-long-begin{margin:0 .2em 0 0}.msp-plugin .msp-sequence-wrapper .msp-sequence-label{color:#51a2fb;font-size:90%;line-height:90%;padding-bottom:1em;padding-left:.2em}.msp-plugin .msp-sequence-wrapper .msp-sequence-number{color:#51a2fb;word-break:keep-all;cursor:default;position:relative;top:-1.1em;left:3.1em;padding:0;margin-left:-3em;font-size:80%}.msp-plugin .msp-sequence-wrapper .msp-sequence-number-long{left:3.3em}.msp-plugin .msp-sequence-wrapper .msp-sequence-number-long-negative{left:2.7em}.msp-plugin .msp-sequence-wrapper .msp-sequence-number-negative{left:2.5em}.msp-plugin .msp-sequence-wrapper .msp-sequence-present{color:#ccd4e0}.msp-plugin .msp-sequence-wrapper .msp-sequence-missing{color:#637ca0}.msp-plugin .msp-transformer .msp-entity-badge{position:absolute;top:0;right:0;height:32px;line-height:32px;width:32px}.msp-plugin .msp-layout-right,.msp-plugin .msp-layout-left{background:#1f222b}.msp-plugin .msp-transformer-wrapper{position:relative}.msp-plugin .msp-transformer-wrapper .msp-entity-badge{left:0;top:0}.msp-plugin .msp-transformer-wrapper:first-child .msp-panel-description-content{top:33px}.msp-plugin .msp-transformer-wrapper:not(:first-child) .msp-panel-description-content{bottom:33px}.msp-plugin .msp-transform-wrapper{margin-bottom:10px}.msp-plugin .msp-transform-wrapper-collapsed,.msp-plugin .msp-transform-update-wrapper,.msp-plugin .msp-transform-update-wrapper-collapsed{margin-bottom:1px}.msp-plugin .msp-transform-update-wrapper>.msp-transform-header>button,.msp-plugin .msp-transform-update-wrapper-collapsed>.msp-transform-header>button{text-align:left;padding-left:32px;line-height:24px;background:#16191f}.msp-plugin .msp-transform-wrapper>.msp-transform-header>button{text-align:left;background:#111318;font-weight:700;padding-right:5px}.msp-plugin .msp-transform-header{position:relative}.msp-plugin .msp-transform-header>button>small{font-weight:400;float:right}.msp-plugin .msp-transform-header>button>span:first-child{margin-right:10px}.msp-plugin .msp-transform-header>button:hover{color:#9cacc3}.msp-plugin .msp-transform-header-brand{margin-bottom:-1px}.msp-plugin .msp-transform-header-brand svg{fill:#ccd4e0;stroke:#ccd4e0}.msp-plugin .msp-transform-default-params{background:#111318;position:absolute;left:0;top:0;width:32px;padding:0}.msp-plugin .msp-transform-default-params:hover{background:#000}.msp-plugin .msp-transform-apply-wrap{position:relative;margin-top:1px;width:100%;height:32px}.msp-plugin .msp-transform-refresh{width:87px;margin-left:33px;background:#111318;text-align:right}.msp-plugin .msp-transform-apply{display:block;position:absolute;left:120px;right:0;top:0}.msp-plugin .msp-transform-apply-wider{margin-left:33px}.msp-plugin .msp-data-beh{margin:10px 0!important}.msp-plugin .msp-toast-container{position:relative;z-index:1001}.msp-plugin .msp-toast-container .msp-toast-entry{color:#ccd4e0;background:#1f222b;position:relative;float:right;min-height:32px;margin-top:10px;border:1px solid #313645;display:table}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-title{height:100%;line-height:32px;padding:0 10px;background:#111318;font-weight:700;display:table-cell;-webkit-user-select:none;-o-user-select:none;user-select:none;font-weight:light;cursor:pointer}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message{padding:3px 42px 3px 10px;display:table-cell}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a{text-decoration:none;color:#68befd;font-weight:700}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a:hover{text-decoration:underline;color:#0393fc}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a:active,.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a:focus{color:#68befd;outline-offset:0;outline:none}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-hide{position:absolute;width:42px;right:0;top:0;bottom:0}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-hide .msp-btn-icon{background:transparent;position:absolute;inset:1px 0 0;width:100%;text-align:right;padding-right:5px}.msp-plugin .msp-help-row{position:relative;height:32px;background:#111318;margin-top:1px;display:table;width:100%}.msp-plugin .msp-help-row>span{width:120px;text-align:right;padding:3px 10px;color:#9cacc3;display:table-cell;font-weight:700;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-help-row>div{background:#0c0d11;position:relative;padding:3px 10px;display:table-cell}.msp-plugin .msp-canvas{width:100%;height:100%;background-color:#f3f2ee}.msp-plugin .msp-canvas text{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.msp-plugin .msp-canvas circle{stroke:#000;stroke-width:10;stroke-opacity:.3}.msp-plugin .msp-canvas circle:hover{fill:#ae5d04;stroke:#000;stroke-width:10px}.msp-plugin .msp-canvas .info{fill:#fff;stroke:#000;stroke-width:3}.msp-plugin .msp-canvas .show{visibility:visible}.msp-plugin .msp-canvas .hide{visibility:hidden}.msp-plugin .msp-canvas .delete-button rect{fill:#ed4337;stroke:#000}.msp-plugin .msp-canvas .delete-button text{stroke:#fff;fill:#fff}.msp-plugin .msp-canvas .delete-button:hover{stroke:#000;stroke-width:3;fill:#ff6961}.msp-plugin .msp-canvas .infoCircle:hover{fill:#4c66b2}.msp-plugin .msp-canvas:focus{outline:none}.msp-plugin .msp-logo{display:block;position:absolute;bottom:10px;right:10px;height:32px;width:100px;background-repeat:no-repeat;background-position:bottom right;background-size:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAgCAYAAABn7+QVAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTACUobeu8AA0nuTXkVhmBlgKAMOMzSxIaICEUVEmiJIUMSA0VAkVkSxEBRUsAckCCgxGEVULG9G1ouurLz38vL746xv7bP3ufvsvc9aFwCSpy+XlwZLAZDKE/CDPJzpEZFRdOwAgAEeYIApAExWRrpfsHsIEMnLzYWeIXICXwQB8HpYvAJw09AzgE4H/5+kWel8geiYABGbszkZLBEXiDglS5Auts+KmBqXLGYYJWa+KEERy4k5YZENPvsssqOY2ak8tojFOaezU9li7hXxtkwhR8SIr4gLM7mcLBHfErFGijCVK+I34thUDjMDABRJbBdwWIkiNhExiR8S5CLi5QDgSAlfcdxXLOBkC8SXcklLz+FzExIFdB2WLt3U2ppB9+RkpXAEAsMAJiuZyWfTXdJS05m8HAAW7/xZMuLa0kVFtjS1trQ0NDMy/apQ/3Xzb0rc20V6Gfi5ZxCt/4vtr/zSGgBgzIlqs/OLLa4KgM4tAMjd+2LTOACApKhvHde/ug9NPC+JAkG6jbFxVlaWEZfDMhIX9A/9T4e/oa++ZyQ+7o/y0F058UxhioAurhsrLSVNyKdnpDNZHLrhn4f4Hwf+dR4GQZx4Dp/DE0WEiaaMy0sQtZvH5gq4aTw6l/efmvgPw/6kxbkWidL4EVBjjIDUdSpAfu0HKAoRINH7xV3/o2+++DAgfnnhKpOLc//vN/1nwaXiJYOb8DnOJSiEzhLyMxf3xM8SoAEBSAIqkAfKQB3oAENgBqyALXAEbsAb+IMQEAlWAxZIBKmAD7JAHtgECkEx2An2gGpQBxpBM2gFx0EnOAXOg0vgGrgBboP7YBRMgGdgFrwGCxAEYSEyRIHkIRVIE9KHzCAGZA+5Qb5QEBQJxUIJEA8SQnnQZqgYKoOqoXqoGfoeOgmdh65Ag9BdaAyahn6H3sEITIKpsBKsBRvDDNgJ9oFD4FVwArwGzoUL4B1wJdwAH4U74PPwNfg2PAo/g+cQgBARGqKKGCIMxAXxR6KQeISPrEeKkAqkAWlFupE+5CYyiswgb1EYFAVFRxmibFGeqFAUC7UGtR5VgqpGHUZ1oHpRN1FjqFnURzQZrYjWR9ugvdAR6AR0FroQXYFuQrejL6JvoyfQrzEYDA2jjbHCeGIiMUmYtZgSzD5MG+YcZhAzjpnDYrHyWH2sHdYfy8QKsIXYKuxR7FnsEHYC+wZHxKngzHDuuCgcD5ePq8AdwZ3BDeEmcQt4Kbwm3gbvj2fjc/Cl+EZ8N/46fgK/QJAmaBPsCCGEJMImQiWhlXCR8IDwkkgkqhGtiYFELnEjsZJ4jHiZOEZ8S5Ih6ZFcSNEkIWkH6RDpHOku6SWZTNYiO5KjyALyDnIz+QL5EfmNBEXCSMJLgi2xQaJGokNiSOK5JF5SU9JJcrVkrmSF5AnJ65IzUngpLSkXKabUeqkaqZNSI1Jz0hRpU2l/6VTpEukj0lekp2SwMloybjJsmQKZgzIXZMYpCEWd4kJhUTZTGikXKRNUDFWb6kVNohZTv6MOUGdlZWSXyYbJZsvWyJ6WHaUhNC2aFy2FVko7ThumvVuitMRpCWfJ9iWtS4aWzMstlXOU48gVybXJ3ZZ7J0+Xd5NPlt8l3yn/UAGloKcQqJClsF/hosLMUupS26WspUVLjy+9pwgr6ikGKa5VPKjYrzinpKzkoZSuVKV0QWlGmabsqJykXK58RnlahaJir8JVKVc5q/KULkt3oqfQK+m99FlVRVVPVaFqveqA6oKatlqoWr5am9pDdYI6Qz1evVy9R31WQ0XDTyNPo0XjniZek6GZqLlXs09zXktbK1xrq1an1pS2nLaXdq52i/YDHbKOg84anQadW7oYXYZusu4+3Rt6sJ6FXqJejd51fVjfUp+rv09/0ABtYG3AM2gwGDEkGToZZhq2GI4Z0Yx8jfKNOo2eG2sYRxnvMu4z/mhiYZJi0mhy31TG1Ns037Tb9HczPTOWWY3ZLXOyubv5BvMu8xfL9Jdxlu1fdseCYuFnsdWix+KDpZUl37LVctpKwyrWqtZqhEFlBDBKGJet0dbO1husT1m/tbG0Edgct/nN1tA22faI7dRy7eWc5Y3Lx+3U7Jh29Xaj9nT7WPsD9qMOqg5MhwaHx47qjmzHJsdJJ12nJKejTs+dTZz5zu3O8y42Lutczrkirh6uRa4DbjJuoW7Vbo/c1dwT3FvcZz0sPNZ6nPNEe/p47vIc8VLyYnk1e816W3mv8+71IfkE+1T7PPbV8+X7dvvBft5+u/0erNBcwVvR6Q/8vfx3+z8M0A5YE/BjICYwILAm8EmQaVBeUF8wJTgm+Ejw6xDnkNKQ+6E6ocLQnjDJsOiw5rD5cNfwsvDRCOOIdRHXIhUiuZFdUdiosKimqLmVbiv3rJyItogujB5epb0qe9WV1QqrU1afjpGMYcaciEXHhsceiX3P9Gc2MOfivOJq42ZZLqy9rGdsR3Y5e5pjxynjTMbbxZfFTyXYJexOmE50SKxInOG6cKu5L5I8k+qS5pP9kw8lf0oJT2lLxaXGpp7kyfCSeb1pymnZaYPp+umF6aNrbNbsWTPL9+E3ZUAZqzK6BFTRz1S/UEe4RTiWaZ9Zk/kmKyzrRLZ0Ni+7P0cvZ3vOZK577rdrUWtZa3vyVPM25Y2tc1pXvx5aH7e+Z4P6hoINExs9Nh7eRNiUvOmnfJP8svxXm8M3dxcoFWwsGN/isaWlUKKQXziy1XZr3TbUNu62ge3m26u2fyxiF10tNimuKH5fwiq5+o3pN5XffNoRv2Og1LJ0/07MTt7O4V0Ouw6XSZfllo3v9tvdUU4vLyp/tSdmz5WKZRV1ewl7hXtHK30ru6o0qnZWva9OrL5d41zTVqtYu712fh9739B+x/2tdUp1xXXvDnAP3Kn3qO9o0GqoOIg5mHnwSWNYY9+3jG+bmxSaips+HOIdGj0cdLi32aq5+YjikdIWuEXYMn00+uiN71y/62o1bK1vo7UVHwPHhMeefh/7/fBxn+M9JxgnWn/Q/KG2ndJe1AF15HTMdiZ2jnZFdg2e9D7Z023b3f6j0Y+HTqmeqjkte7r0DOFMwZlPZ3PPzp1LPzdzPuH8eE9Mz/0LERdu9Qb2Dlz0uXj5kvulC31OfWcv210+dcXmysmrjKud1yyvdfRb9Lf/ZPFT+4DlQMd1q+tdN6xvdA8uHzwz5DB0/qbrzUu3vG5du73i9uBw6PCdkeiR0TvsO1N3U+6+uJd5b+H+xgfoB0UPpR5WPFJ81PCz7s9to5ajp8dcx/ofBz++P84af/ZLxi/vJwqekJ9UTKpMNk+ZTZ2adp++8XTl04ln6c8WZgp/lf619rnO8x9+c/ytfzZiduIF/8Wn30teyr889GrZq565gLlHr1NfL8wXvZF/c/gt423fu/B3kwtZ77HvKz/ofuj+6PPxwafUT5/+BQOY8/xvJtwPAAAACXBIWXMAAC4iAAAuIgGq4t2SAAANMElEQVRoQ92aB1xURx7H/69sY5eOFBELCipESsSC0RCMJRZMrICHGiMmGjWaqDk7YEsuGok5TS6xi56KGtsFG6jBiAYLKhqVc8GGBZG+fd97N+/twNJWFksS7/v5DG/nN/OG/fze/838Z4CA/wMCE9d9W8oQ3mUMBSojBTqWAuBQAweHIC56lanXHw8xJixM6qhQNcX1KuQykluyKzMPVxvF5XUh3hIpgFSiQz8AJBItSKU6sCsX55P9byLxxRKwYl3W5O6dg5o62IMRmcpyBBz87wNYcyH3R4iL+gh3+8MhHaTqYJKUKO2dPYTigIqza1MlLZLnzh3arQ/uZzVn14YOIGRyJWXrqgR5U6VI1kRJS92VBEEry+wrAnC3F04XL3cY4OMF7/p6weC2zSDQzQG3/IlM7dspdPmU0VxtLqYf5haM6HYOBYLVUwcXByQy92JxXioexUzFhT5cySn3TrjrC4WP3EsPHuPfZGJVZg4HCdt/wF0aT8LWUHT/jTpl4fZU3KNBSHytQ0D33uDR0qfjoqg3hmOpQU65d4u2cW4X6NCyJ1ZeIeKSFRC3p1q4kzYdmzr6Zk98p6rsj+rhi0KoFe5gIm53M/ypDhbNJQgC3kbTFUGSi+LiwmgsWyQ5zk9McESCZ8gEVHvF1kneWJI5CJT2SHWDbUQ0vNbEvqr4OClwCyZ+RzSQ+psomqOwUgOL5vL4BIdCi/aBvtJb3AdYsoirs0usnWfH1vbNOmPlFWHmWlve2DFB3t0nhvh0qm2wRRZuG+ksFyUlDe4qcbYRJ0H8v6NxSxVPNZcnPPJDIAlY8PWnXWVYqsPhZb3lDAfzW3T50xbmZ+MfyFhbRcr7yNj1EZ1gdb+O8DFvMKk7it4+ywYjY11k0s1po8KpmA4tITUmnHaWS5HBKJKr0aC5zXw6QJvgNzyhXDIZS3UgCN3UJq3fdLd188PKs3H8+Bjpvn2x/jv2TwnbsOezt3/YPavTss3TXXHzi4U3Vic/+H5gq+7rkLEkmgb5yWwVb3CnNiFAcD+aOtaGaMobmzrqLaoyIwlC11RkNB/JvPGCiGjQXJ43h8QCSRGzEqeG1Xmah77u48QCPdM7NBYrjSPveJg069i7H2UcjUpndWSZrZ3bFRfHlic8nL1TnezcM2Vyh0dLtsbnzdu8JHHW5qVt8G3Pj9qOT4RYluOE/UYllQZPCvFxMik1cbGRSKsbWwlKUPhxhDGxZJ25Ls28oX2X3k60HmZiqQqDTj+rqX8fB7lTC6xYT2569zA9Jb5m7xz8r3aB03uE9fpOFP7WYujZ/TPo22MSDOs1FT4ePBfG9ZvQsod/12kUJf190prli4YnJ6Mt2HOSMKICGLL/5su3Tn6wPxMYZE4lvMH/RAZP6NjaJGBsJSJIi3mrTg6d9bAYem05YSxS6WJgQdR2LFtnLk9oxFigRaKpq2aEuWMJDizu6UlQosltuo3FivU8zgyOkEhkRzz941u2CogDxyYhgMzDrWb4rMXN0Q36vN4TZr43XuTt0WyeoiR/MwqV509JqgzOSx+77zcw8nGM4UMx2r+5qYJpqpByHVztcc3E+QdFXJWx8dE78MgCDaZYldi5eIB/jwj577/+NB9VJ/GajmHj2nYZKpPZNW5aVJ9v2ULDwlaXdsvFYlvzpo1l9PD4yXUoKStAY3MgFjuAexNvcFA4C+32NgqY3HcofHFg18ioH1adRSHyjdBgCQJaQ/y2SFyzAIMKuSkp+1YAepIOGwZ1Bgo9UGu4gCK2z9ZfoEit3yMI1X8XxZwh+B2al2/7jOnfbsKqGaNeB7RYgmsAmvJi2LHkbwaC0baXyElKKpVe7f/JVlpsY4978Abp0PxsvqcSVVZfMGoud3Z44+HZ8vOeG2m3GWOkntNwK8CTgky4eiWJK9fqflUZJRe0jFirZmgvDSPu29or2PmdzhEgpkVC3/ziIpiRvL1ETUua74+NLed3aEnRg4IC3F2Edp6DNx/AmqxcXLMeFK0w3M8L1yxToTfCtCNZUKTRY8VMZv4TyC/VxFiM3OM7N0BudiaMW/g9VgBkto7QIWyYKDstaSEYGdo3dEQNY/n5/EbKJHBq2QPcOozBWk24K00UGgM3QuI2GisA5cVXIOdyYqHeKBo0cEDSaSwLLNu8TJ5968o6LQORI3oMETRPRycI9GrhkHH7Di/UjQpEvzYeQnlZKMQ0rB1Y/25+xO4M2Fl61/KcazTo4W5ONuRcOIUVEx3CI0Fqax8lljsO9w2tuTMuyksHVcHvwKHX2xIcU9aFsgmQEbR5MX50aztQYJzWu19NY3lmjp6pekIrxmbfvv6woLQQqwCBzZujn0SYqfbX5KkLGprVL51IXgMcW5VdgFgqh4DwkaR/WAxBi837Co5j4Hbmj3wucglL9cJy4ENKzRkVf5+q9Bqnpol9WKpDYuR0DfoKabcL8rGCotfBEQ0GLy41ewk81VyWIfYV3lNmXj2NNizVaNvtPfBBc2B1Hl07BKqi2xkkyf0HSxYg0D7eFn9G5rJ69EAYfXj4zgos1QtaYoq16G2qRCYWA0dw5oFqcb9cAyfvPG50ufq4FI/wdPg5t777+VKoNh1ZPzVbIAiWIwl69qm9G9Lad+kJFF5QKFosXCthjXrI/W0jsCw5G62+Tz0D5p8mU3sxrp7FWwClZKYcHWMawvKqvuf6PZh86HwBusW6VY0g/FzlEru0mHAsPB05mnN3X7sHKzNz+K91Df2o+VQIorDBVGz2lpPHvhobdvRy+v7ewT2HYrUmdy/tBU3po5Ren55MP7e+a6MP2F8aHLHXqr9ExO8Y46oQr08bFS6cflkD/1gT+wYLH1aeydGCSD8Q5ox5Ymo1YdUmgqTI2ZkpWziDToMVM0adCpRntrAERc/B0qvFImSsrWAsWdvYx/j1rkRtYNBGo+bbk9gnGKZ19Q0GgzgVlm4yJeQYq8ydsfb4eW158a6LaTuxYkaZuQN0mrLtb39y/KkL2V+Shdved7URrz9Wj7Fn7xfBuAOZuGbiTqkKRu09Y8HgtkFg5A3+qcpgq8zloUT0vItpyUZthXlq0amKQfnbTgNw5AIsvTos3o2SYGL10vAA0r8eY/mdV4nWgBUz26/eqWMwz7JeQeDrbIcM1idgyXpzp6xOyzHoVBuyUrdiBeD6ySQw6DVr+n9+XImlBmE5ggHOiGs8wleg0G7e8urEQwBNEuavywjpYY2BGse8oQ9QHjgM7bK0/ApfiWDslhOGEq1+NZZqwnH526/cOVbdYP7K13OelKcBY/O5ICKsNpeHFJMJ1zL2aVQlBaAqfgDKswdUKIFYhJutAqVqDznDI1xDdbRVFkkc6YzDQ9piqX448HNSmE+jitVq/mkU4OqzERd9sEJnGNJ/W7pgcGalsTp9FDLRdF5QGwJ0wNpEoAhOi0GGao0M8Fe+DkzpIEgYpMY9G2fuxMRj+axBvyrryEbITtsIjNGwcuDnvzzEzVahJ+gsVnURfTK/Vg6uYUDSNH8gVG/0Ltqy6E2FVNajjYf5WFNZ8AhQcvb88zxvsIEZzBvcV4hYYyQsiP4Jt9YPbyAycgcytM2qn4G/moz9qMpYnkaZK0CIv8y9cKQk72JqkYqAZVi1GmlAxXVGX3DdWHYGKwDurSLBxrb1yLRDo/ftTxkflpQyxW5lyhTJ97vm+azYNneWiCJ+HtxtICnCeTZ/wH0m9yaQHHNAEJ6X+ZGHeINLtLpIiIusP2JrwxspJyLyyzVL+WttY3kabe74xCNFBMd+xXDcl2MTfinBcqPggP5Kfe+bqimTomTwWkg8tPaNjLC3bX5CxtKljjqxViGzyfFrFfTFB/3GK3w9zTvd49eyobCsNGPvlCl1ziKeGWQwxI2sYWx2QamwsFWWcQfO4hbM9EgNLIiaK1zrofGRy8PQ34o1mmf+Hyz5/nub9Kprh4qVS4WzBR6SFEOLVv3hze7zYOiAFTDqveUQ03829O0yDJrYm8+Lr9+/AztOn1SxHPNy/xoqklxEi9qAo7kPq0rGvcIBaOIah3s0yDOZO/rro6rIxDP1Pi1rIBKABb3tiIqCw0fzL38GmvKbuMUyOoMODmf9Ct8d3l3CsfpByR9Pu4KbXg5zhjxBUZlSp8yPPoF7NIhwWG5jb5/h16kbltBrShLw+K4SCvOVCYt2no7HslWg7e9iW5fWcxVNvIGmGVMRGYEoO4zmykLhsBx3heTk4VSgW+lENSObQ8n9POSOHUEi90L97dHOlQKtXg9FFSVwu+A+XLmbx5Tp2F1qhvr7d7Ezb+MhBPjD8tdbNA+SSGSgYwmUGpFwo7AczuYX/an/iEdM6B3qKqbZAbguIKJQEZEosYSLi3efzsKyVZxd3/V1Cc0FisQMGsMAUqkBXfXoqgXChjlgF/LAfCiLOXfuQ5G2tDRcY5CGaRhxO41R4qJlRJSaEZVrjOLbapY6Z9BASkJswn18Sw2CVqx/t5ghncoZElQsBTqm8u+X3A0UaRm48gcD8D/XZskfp8IFSwAAAABJRU5ErkJggg==)}.msp-plugin .msp-plugin-content{color:#ccd4e0}.msp-plugin .msp-plugin-init-error{white-space:pre;margin:10px}\n",".ngx-structure-viewer-container{position:relative;height:100%;width:100%}.ngx-structure-viewer-canvas{position:absolute;height:100%;width:100%;left:0;top:0}\n"],encapsulation:2})}return r})();var th=F(8839),nh=F(1584),rh=F(9172);function sh(r,e){if(1&r&&(W.j41(0,"div",6)(1,"div",7),W.nrm(2,"div",8),W.j41(3,"code",9)(4,"pre",10),W.EFF(5),W.nI1(6,"json"),W.k0s()()()()),2&r){const i=e.$implicit;W.R7$(2),W.xc7("background-color",i.color),W.R7$(3),W.JRh(W.bMT(6,3,i))}}function oh(r,e){if(1&r&&(W.j41(0,"div",0)(1,"div",1)(2,"div",2),W.nrm(3,"ngx-structure-viewer",3),W.k0s()(),W.j41(4,"div",4)(5,"h2"),W.EFF(6,"Color chain"),W.k0s(),W.j41(7,"div",5),W.Z7z(8,sh,7,5,"div",6,W.Vm6),W.k0s()()()),2&r){const i=e,s=W.XpG();W.R7$(3),W.Y8G("settings",s.settings)("source",s.source)("loci",i),W.R7$(5),W.Dyx(i)}}let lh=(()=>{class r{constructor(){this.settings={"background-color":"#2b3035ff","backbone-color":"#6ea8fecc","interaction-color":"#ff0000ff","interaction-size":1},this.source={type:"remote",format:"mmcif",label:"8VAP",binary:!1,link:"assets/8vap.cif"};const i=[{chain:"A",color:"#6f42c1"},{chain:"B",color:"#0d6efd"},{chain:"C",color:"#dc3545"},{chain:"D",color:"#ffc107"},{chain:"E",color:"#28a745"},{chain:"F",color:"#17a2b8"},{chain:"G",color:"#fd7e14"}];this.chains$=function ih(r=0,e=th.E){return r<0&&(r=0),(0,nh.O)(r,r,e)}(3e3).pipe((0,je.T)(()=>i.map(s=>s.color)),(0,je.T)(s=>s.sort(()=>Math.random()-.5)),(0,je.T)(s=>s.map((l,u)=>({...i[u],color:l}))),(0,rh.Z)(i),(0,Dt.t)(1))}static#e=this.\u0275fac=function(s){return new(s||r)};static#t=this.\u0275cmp=W.VBU({type:r,selectors:[["app-section-chains"]],standalone:!0,features:[W.aNF],decls:2,vars:3,consts:[[1,"row","mb-3"],[1,"col-9"],[1,"rounded","squared","overflow-hidden","shadow-sm"],[3,"settings","source","loci"],[1,"col-3","pt-0","p-3"],[1,"d-flex","flex-column","gap-2"],[1,"flex-1"],[1,"d-flex","flex-row","gap-2"],[1,"d-block","flex-shrink-0","p-2"],[1,"bg-body-tertiary","flex-grow-1","p-3"],[1,"m-0"]],template:function(s,l){if(1&s&&(W.DNE(0,oh,10,3,"div",0),W.nI1(1,"async")),2&s){let u;W.vxM(0,(u=W.bMT(1,1,l.chains$))?0:-1,u)}},dependencies:[eh,He.MD,He.Jj,He.TG],changeDetection:0})}return r})();var ah=F(6933);let uh=(()=>{class r{static#e=this.\u0275fac=function(s){return new(s||r)};static#t=this.\u0275cmp=W.VBU({type:r,selectors:[["page-structure-viewer"]],standalone:!0,features:[W.aNF],decls:10,vars:0,consts:[[1,"container","pt-3"],[1,"mb-3"]],template:function(s,l){1&s&&(W.j41(0,"div",0)(1,"div",1)(2,"h1"),W.EFF(3,"Structure viewer"),W.k0s(),W.j41(4,"p"),W.EFF(5," The "),W.j41(6,"b"),W.EFF(7,"ngx-structure-viewer"),W.k0s(),W.EFF(8," is a Mol* wrapper for Angular. It is a viewer for molecular structures and can be used to visualize and interact with 3D molecular structures. It works out of the box with the latest releases of Angular and automatized the most common features of Mol*. "),W.k0s()(),W.nrm(9,"app-section-chains"),W.k0s())},dependencies:[lh,ah.iI,He.MD],styles:[".progress-bar[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_progress 10s linear infinite;width:0}@keyframes _ngcontent-%COMP%_progress{0%{width:0}to{width:100%}}"]})}return r})()},6216:Zn=>{"use strict";var be=Object.prototype.hasOwnProperty,F=Object.prototype.toString,Le=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,He=function(fe){return"function"==typeof Array.isArray?Array.isArray(fe):"[object Array]"===F.call(fe)},R=function(fe){if(!fe||"[object Object]"!==F.call(fe))return!1;var Me,Te=be.call(fe,"constructor"),Ne=fe.constructor&&fe.constructor.prototype&&be.call(fe.constructor.prototype,"isPrototypeOf");if(fe.constructor&&!Te&&!Ne)return!1;for(Me in fe);return typeof Me>"u"||be.call(fe,Me)},Nt=function(fe,Te){Le&&"__proto__"===Te.name?Le(fe,Te.name,{enumerable:!0,configurable:!0,value:Te.newValue,writable:!0}):fe[Te.name]=Te.newValue},mt=function(fe,Te){if("__proto__"===Te){if(!be.call(fe,Te))return;if(Lt)return Lt(fe,Te).value}return fe[Te]};Zn.exports=function Ue(){var fe,Te,Ne,Me,qt,Mt,xe=arguments[0],xt=1,Dt=arguments.length,Pe=!1;for("boolean"==typeof xe&&(Pe=xe,xe=arguments[1]||{},xt=2),(null==xe||"object"!=typeof xe&&"function"!=typeof xe)&&(xe={});xt{var be=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,F=/\n/g,Le=/^\s*/,Lt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,He=/^:\s*/,R=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Nt=/^[;\s]*/,mt=/^\s+|\s+$/g;function Mt(xe){return xe?xe.replace(mt,""):""}Zn.exports=function(xe,xt){if("string"!=typeof xe)throw new TypeError("First argument must be a string");if(!xe)return[];xt=xt||{};var Dt=1,Pe=1;function je(we){var Q=we.match(F);Q&&(Dt+=Q.length);var St=we.lastIndexOf("\n");Pe=~St?we.length-St:Pe+we.length}function z(){var we={line:Dt,column:Pe};return function(Q){return Q.position=new De(we),fn(),Q}}function De(we){this.start=we,this.end={line:Dt,column:Pe},this.source=xt.source}De.prototype.content=xe;var jt=[];function ft(we){var Q=new Error(xt.source+":"+Dt+":"+Pe+": "+we);if(Q.reason=we,Q.filename=xt.source,Q.line=Dt,Q.column=Pe,Q.source=xe,!xt.silent)throw Q;jt.push(Q)}function bt(we){var Q=we.exec(xe);if(Q){var St=Q[0];return je(St),xe=xe.slice(St.length),Q}}function fn(){bt(Le)}function wt(we){var Q;for(we=we||[];Q=on();)!1!==Q&&we.push(Q);return we}function on(){var we=z();if("/"==xe.charAt(0)&&"*"==xe.charAt(1)){for(var Q=2;""!=xe.charAt(Q)&&("*"!=xe.charAt(Q)||"/"!=xe.charAt(Q+1));)++Q;if(""===xe.charAt((Q+=2)-1))return ft("End of comment missing");var St=xe.slice(2,Q-2);return Pe+=2,je(St),xe=xe.slice(Q),Pe+=2,we({type:"comment",comment:St})}}function Xn(){var we=z(),Q=bt(Lt);if(Q){if(on(),!bt(He))return ft("property missing ':'");var St=bt(R),Jn=we({type:"declaration",property:Mt(Q[0].replace(be,"")),value:St?Mt(St[0].replace(be,"")):""});return bt(Nt),Jn}}return fn(),function jn(){var Q,we=[];for(wt(we);Q=Xn();)!1!==Q&&(we.push(Q),wt(we));return we}()}},7578:(Zn,be,F)=>{"use strict";var Lt=F(1395),He=F(1605);function R(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,o=1;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ne=Object.prototype.hasOwnProperty,Me=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,qt={},Mt={};function Pe(t,n,o,a,d,m,v){this.acceptsBooleans=2===n||3===n||4===n,this.attributeName=a,this.attributeNamespace=d,this.mustUseProperty=o,this.propertyName=t,this.type=n,this.sanitizeURL=m,this.removeEmptyString=v}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){je[t]=new Pe(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];je[n]=new Pe(n,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){je[t]=new Pe(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){je[t]=new Pe(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){je[t]=new Pe(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){je[t]=new Pe(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){je[t]=new Pe(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){je[t]=new Pe(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){je[t]=new Pe(t,5,!1,t.toLowerCase(),null,!1,!1)});var z=/[\-:]([a-z])/g;function De(t){return t[1].toUpperCase()}function jt(t,n,o,a){var d=je.hasOwnProperty(n)?je[n]:null;(null!==d?0!==d.type:a||!(2"u"||function xt(t,n,o,a){if(null!==o&&0===o.type)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return!a&&(null!==o?!o.acceptsBooleans:"data-"!==(t=t.toLowerCase().slice(0,5))&&"aria-"!==t);default:return!1}}(t,n,o,a))return!0;if(a)return!1;if(null!==o)switch(o.type){case 3:return!n;case 4:return!1===n;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}(n,o,d,a)&&(o=null),a||null===d?function xe(t){return!!Ne.call(Mt,t)||!Ne.call(qt,t)&&(Me.test(t)?Mt[t]=!0:(qt[t]=!0,!1))}(n)&&(null===o?t.removeAttribute(n):t.setAttribute(n,""+o)):d.mustUseProperty?t[d.propertyName]=null===o?3!==d.type&&"":o:(n=d.attributeName,a=d.attributeNamespace,null===o?t.removeAttribute(n):(o=3===(d=d.type)||4===d&&!0===o?"":""+o,a?t.setAttributeNS(a,n,o):t.setAttribute(n,o))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var n=t.replace(z,De);je[n]=new Pe(n,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var n=t.replace(z,De);je[n]=new Pe(n,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var n=t.replace(z,De);je[n]=new Pe(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){je[t]=new Pe(t,1,!1,t.toLowerCase(),null,!1,!1)}),je.xlinkHref=new Pe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){je[t]=new Pe(t,1,!1,t.toLowerCase(),null,!0,!0)});var ft=Lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,bt=Symbol.for("react.element"),fn=Symbol.for("react.portal"),wt=Symbol.for("react.fragment"),on=Symbol.for("react.strict_mode"),Xn=Symbol.for("react.profiler"),jn=Symbol.for("react.provider"),we=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),St=Symbol.for("react.suspense"),Jn=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),de=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var Se=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var rt=Symbol.iterator;function Je(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=rt&&t[rt]||t["@@iterator"])?t:null}var Zt,W=Object.assign;function gn(t){if(void 0===Zt)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);Zt=n&&n[1]||""}return"\n"+Zt+t}var _t=!1;function p(t,n){if(!t||_t)return"";_t=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(M){var a=M}Reflect.construct(t,[],n)}else{try{n.call()}catch(M){a=M}t.call(n.prototype)}else{try{throw Error()}catch(M){a=M}t()}}catch(M){if(M&&a&&"string"==typeof M.stack){for(var d=M.stack.split("\n"),m=a.stack.split("\n"),v=d.length-1,S=m.length-1;1<=v&&0<=S&&d[v]!==m[S];)S--;for(;1<=v&&0<=S;v--,S--)if(d[v]!==m[S]){if(1!==v||1!==S)do{if(v--,0>--S||d[v]!==m[S]){var k="\n"+d[v].replace(" at new "," at ");return t.displayName&&k.includes("")&&(k=k.replace("",t.displayName)),k}}while(1<=v&&0<=S);break}}}finally{_t=!1,Error.prepareStackTrace=o}return(t=t?t.displayName||t.name:"")?gn(t):""}function he(t){switch(t.tag){case 5:return gn(t.type);case 16:return gn("Lazy");case 13:return gn("Suspense");case 19:return gn("SuspenseList");case 0:case 2:case 15:return p(t.type,!1);case 11:return p(t.type.render,!1);case 1:return p(t.type,!0);default:return""}}function Zr(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case wt:return"Fragment";case fn:return"Portal";case Xn:return"Profiler";case on:return"StrictMode";case St:return"Suspense";case Jn:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case we:return(t.displayName||"Context")+".Consumer";case jn:return(t._context.displayName||"Context")+".Provider";case Q:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case ee:return null!==(n=t.displayName||null)?n:Zr(t.type)||"Memo";case de:n=t._payload,t=t._init;try{return Zr(t(n))}catch{}}return null}function Z(t){var n=t.type;switch(t.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=n.render).displayName||t.name||"",n.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zr(n);case 8:return n===on?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof n)return n.displayName||n.name||null;if("string"==typeof n)return n}return null}function Fi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":case"object":return t;default:return""}}function ip(t){var n=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===n||"radio"===n)}function hl(t){t._valueTracker||(t._valueTracker=function Sd(t){var n=ip(t)?"checked":"value",o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),a=""+t[n];if(!t.hasOwnProperty(n)&&typeof o<"u"&&"function"==typeof o.get&&"function"==typeof o.set){var d=o.get,m=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return d.call(this)},set:function(v){a=""+v,m.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}(t))}function rp(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var o=n.getValue(),a="";return t&&(a=ip(t)?t.checked?"true":"false":t.value),(t=a)!==o&&(n.setValue(t),!0)}function Qs(t){if(typeof(t=t||(typeof document<"u"?document:void 0))>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ml(t,n){return W({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n.checked??t._wrapperState.initialChecked})}function xu(t,n){var o=null==n.defaultValue?"":n.defaultValue,a=null!=n.checked?n.checked:n.defaultChecked;o=Fi(null!=n.value?n.value:o),t._wrapperState={initialChecked:a,initialValue:o,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function bu(t,n){null!=(n=n.checked)&&jt(t,"checked",n,!1)}function fl(t,n){bu(t,n);var o=Fi(n.value),a=n.type;if(null!=o)"number"===a?(0===o&&""===t.value||t.value!=o)&&(t.value=""+o):t.value!==""+o&&(t.value=""+o);else if("submit"===a||"reset"===a)return void t.removeAttribute("value");n.hasOwnProperty("value")?Gs(t,n.type,o):n.hasOwnProperty("defaultValue")&&Gs(t,n.type,Fi(n.defaultValue)),null==n.checked&&null!=n.defaultChecked&&(t.defaultChecked=!!n.defaultChecked)}function wu(t,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var a=n.type;if(("submit"===a||"reset"===a)&&null==n.value)return;n=""+t._wrapperState.initialValue,o||n===t.value||(t.value=n),t.defaultValue=n}""!==(o=t.name)&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,""!==o&&(t.name=o)}function Gs(t,n,o){("number"!==n||Qs(t.ownerDocument)!==t)&&(null==o?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+o&&(t.defaultValue=""+o))}var Ys=Array.isArray;function Xr(t,n,o,a){if(t=t.options,n){n={};for(var d=0;d"+n.valueOf().toString()+"",n=cr.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}},typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,a,d){MSApp.execUnsafeLocalFunction(function(){return t(n,o)})}:t);function Jr(t,n){if(n){var o=t.firstChild;if(o&&o===t.lastChild&&3===o.nodeType)return void(o.nodeValue=n)}t.textContent=n}var ge={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gt=["Webkit","ms","Moz","O"];function yl(t,n,o){return null==n||"boolean"==typeof n||""===n?"":o||"number"!=typeof n||0===n||ge.hasOwnProperty(t)&&ge[t]?(""+n).trim():n+"px"}function $(t,n){for(var o in t=t.style,n)if(n.hasOwnProperty(o)){var a=0===o.indexOf("--"),d=yl(o,n[o],a);"float"===o&&(o="cssFloat"),a?t.setProperty(o,d):t[o]=d}}Object.keys(ge).forEach(function(t){gt.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),ge[n]=ge[t]})});var Qe=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gi(t,n){if(n){if(Qe[t]&&(null!=n.children||null!=n.dangerouslySetInnerHTML))throw Error(R(137,t));if(null!=n.dangerouslySetInnerHTML){if(null!=n.children)throw Error(R(60));if("object"!=typeof n.dangerouslySetInnerHTML||!("__html"in n.dangerouslySetInnerHTML))throw Error(R(61))}if(null!=n.style&&"object"!=typeof n.style)throw Error(R(62))}}function Wt(t,n){if(-1===t.indexOf("-"))return"string"==typeof n.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ei=null;function es(t){return(t=t.target||t.srcElement||window).correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}var ts=null,Bi=null,pr=null;function Hi(t){if(t=vi(t)){if("function"!=typeof ts)throw Error(R(280));var n=t.stateNode;n&&(n=Tr(n),ts(t.stateNode,t.type,n))}}function vl(t){Bi?pr?pr.push(t):pr=[t]:Bi=t}function xl(){if(Bi){var t=Bi,n=pr;if(pr=Bi=null,Hi(t),n)for(t=0;t>>=0)?32:31-(Tu(t)/cp|0)|0},Tu=Math.log,cp=Math.LN2,so=64,oo=4194304;function ls(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function lo(t,n){var o=t.pendingLanes;if(0===o)return 0;var a=0,d=t.suspendedLanes,m=t.pingedLanes,v=268435455&o;if(0!==v){var S=v&~d;0!==S?a=ls(S):0!=(m&=v)&&(a=ls(m))}else 0!=(v=o&~d)?a=ls(v):0!==m&&(a=ls(m));if(0===a)return 0;if(0!==n&&n!==a&&!(n&d)&&((d=a&-a)>=(m=n&-n)||16===d&&4194240&m))return n;if(4&a&&(a|=16&o),0!==(n=t.entangledLanes))for(t=t.entanglements,n&=a;0o;o++)n.push(t);return n}function as(t,n,o){t.pendingLanes|=n,536870912!==n&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[n=31-En(n)]=o}function Dl(t,n){var o=t.entangledLanes|=n;for(t=t.entanglements;o;){var a=31-En(o),d=1<=ms),Kl=" ",$l=!1;function Sr(t,n){switch(t){case"keyup":return-1!==Vu.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ui(t){return"object"==typeof(t=t.detail)&&"data"in t?t.data:null}var kr=!1,Rp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mo(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===n?!!Rp[t.type]:"textarea"===n}function qu(t,n,o,a){vl(a),0<(n=bo(n,"onChange")).length&&(o=new Fl("onChange","change",null,o,a),t.push({event:o,listeners:n}))}var fs=null,gs=null;function Fp(t){rc(t,0)}function fo(t){if(rp(oi(t)))return t}function Bp(t,n){if("change"===t)return n}var Ql=!1;if(Te){var Gl;if(Te){var Yl="oninput"in document;if(!Yl){var _u=document.createElement("div");_u.setAttribute("oninput","return;"),Yl="function"==typeof _u.oninput}Gl=Yl}else Gl=!1;Ql=Gl&&(!document.documentMode||9=n)return{node:o,offset:n-t};t=a}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Xl(o)}}function $u(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?$u(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}function Jl(){for(var t=window,n=Qs();n instanceof t.HTMLIFrameElement;){try{var o="string"==typeof n.contentWindow.location.href}catch{o=!1}if(!o)break;n=Qs((t=n.contentWindow).document)}return n}function ys(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&("input"===n&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===n||"true"===t.contentEditable)}function Qu(t){var n=Jl(),o=t.focusedElem,a=t.selectionRange;if(n!==o&&o&&o.ownerDocument&&$u(o.ownerDocument.documentElement,o)){if(null!==a&&ys(o))if(n=a.start,void 0===(t=a.end)&&(t=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(t,o.value.length);else if((t=(n=o.ownerDocument||document)&&n.defaultView||window).getSelection){t=t.getSelection();var d=o.textContent.length,m=Math.min(a.start,d);a=void 0===a.end?m:Math.min(a.end,d),!t.extend&&m>a&&(d=a,a=m,m=d),d=Ku(o,m);var v=Ku(o,a);d&&v&&(1!==t.rangeCount||t.anchorNode!==d.node||t.anchorOffset!==d.offset||t.focusNode!==v.node||t.focusOffset!==v.offset)&&((n=n.createRange()).setStart(d.node,d.offset),t.removeAllRanges(),m>a?(t.addRange(n),t.extend(v.node,v.offset)):(n.setEnd(v.node,v.offset),t.addRange(n)))}for(n=[],t=o;t=t.parentNode;)1===t.nodeType&&n.push({element:t,left:t.scrollLeft,top:t.scrollTop});for("function"==typeof o.focus&&o.focus(),o=0;o=document.documentMode,Vi=null,ea=null,qi=null,ta=!1;function go(t,n,o){var a=o.window===o?o.document:9===o.nodeType?o:o.ownerDocument;ta||null==Vi||Vi!==Qs(a)||(a="selectionStart"in(a=Vi)&&ys(a)?{start:a.selectionStart,end:a.selectionEnd}:{anchorNode:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset},qi&&Cr(qi,a)||(qi=a,0<(a=bo(ea,"onSelect")).length&&(n=new Fl("onSelect","select",null,n,o),t.push({event:n,listeners:a}),n.target=Vi)))}function yo(t,n){var o={};return o[t.toLowerCase()]=n.toLowerCase(),o["Webkit"+t]="webkit"+n,o["Moz"+t]="moz"+n,o}var jr={animationend:yo("Animation","AnimationEnd"),animationiteration:yo("Animation","AnimationIteration"),animationstart:yo("Animation","AnimationStart"),transitionend:yo("Transition","TransitionEnd")},na={},Gu={};function vo(t){if(na[t])return na[t];if(!jr[t])return t;var o,n=jr[t];for(o in n)if(n.hasOwnProperty(o)&&o in Gu)return na[t]=n[o];return t}Te&&(Gu=document.createElement("div").style,"AnimationEvent"in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),"TransitionEvent"in window||delete jr.transitionend.transition);var Yu=vo("animationend"),Zu=vo("animationiteration"),Xu=vo("animationstart"),Ju=vo("transitionend"),ec=new Map,tc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ii(t,n){ec.set(t,n),Ue(n,[t])}for(var vs=0;vsxi||(t.current=Ss[xi],Ss[xi]=null,xi--)}function Ke(t,n){xi++,Ss[xi]=t.current,t.current=n}var li={},Ft=qn(li),Kt=qn(!1),yn=li;function Pr(t,n){var o=t.type.contextTypes;if(!o)return li;var a=t.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===n)return a.__reactInternalMemoizedMaskedChildContext;var m,d={};for(m in o)d[m]=n[m];return a&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=d),d}function Jt(t){return null!=t.childContextTypes}function bi(){Ge(Kt),Ge(Ft)}function ks(t,n,o){if(Ft.current!==li)throw Error(R(168));Ke(Ft,n),Ke(Kt,o)}function cc(t,n,o){var a=t.stateNode;if(n=n.childContextTypes,"function"!=typeof a.getChildContext)return o;for(var d in a=a.getChildContext())if(!(d in n))throw Error(R(108,Z(t)||"Unknown",d));return W({},o,a)}function Cs(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||li,yn=Ft.current,Ke(Ft,t),Ke(Kt,Kt.current),!0}function js(t,n,o){var a=t.stateNode;if(!a)throw Error(R(169));o?(t=cc(t,n,yn),a.__reactInternalMemoizedMergedChildContext=t,Ge(Kt),Ge(Ft),Ke(Ft,t)):Ge(Kt),Ke(Kt,o)}var wi=null,_n=!1,pa=!1;function pc(t){null===wi?wi=[t]:wi.push(t)}function Si(){if(!pa&&null!==wi){pa=!0;var t=0,n=Ve;try{var o=wi;for(Ve=1;t>=v,d-=v,ji=1<<32-En(n)+d|o<me?(Pt=pe,pe=null):Pt=pe.sibling;var Re=q(T,pe,P[me],G);if(null===Re){null===pe&&(pe=Pt);break}t&&pe&&null===Re.alternate&&n(T,pe),A=m(Re,A,me),null===ce?se=Re:ce.sibling=Re,ce=Re,pe=Pt}if(me===P.length)return o(T,pe),et&&_i(T,me),se;if(null===pe){for(;meme?(Pt=pe,pe=null):Pt=pe.sibling;var Ri=q(T,pe,Re.value,G);if(null===Ri){null===pe&&(pe=Pt);break}t&&pe&&null===Ri.alternate&&n(T,pe),A=m(Ri,A,me),null===ce?se=Ri:ce.sibling=Ri,ce=Ri,pe=Pt}if(Re.done)return o(T,pe),et&&_i(T,me),se;if(null===pe){for(;!Re.done;me++,Re=P.next())null!==(Re=K(T,Re.value,G))&&(A=m(Re,A,me),null===ce?se=Re:ce.sibling=Re,ce=Re);return et&&_i(T,me),se}for(pe=a(T,pe);!Re.done;me++,Re=P.next())null!==(Re=J(pe,T,me,Re.value,G))&&(t&&null!==Re.alternate&&pe.delete(null===Re.key?me:Re.key),A=m(Re,A,me),null===ce?se=Re:ce.sibling=Re,ce=Re);return t&&pe.forEach(function(yd){return n(T,yd)}),et&&_i(T,me),se}(T,A,P,G);Io(T,P)}return"string"==typeof P&&""!==P||"number"==typeof P?(P=""+P,null!==A&&6===A.tag?(o(T,A.sibling),(A=d(A,P)).return=T,T=A):(o(T,A),(A=ol(P,T.mode,G)).return=T,T=A),v(T)):o(T,A)}}var Wi=gc(!0),yc=gc(!1),To=qn(null),Po=null,Mr=null,xa=null;function ba(){xa=Mr=Po=null}function wa(t){var n=To.current;Ge(To),t._currentValue=n}function Lo(t,n,o){for(;null!==t;){var a=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,null!==a&&(a.childLanes|=n)):null!==a&&(a.childLanes&n)!==n&&(a.childLanes|=n),t===o)break;t=t.return}}function Ki(t,n){Po=t,xa=Mr=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(t.lanes&n&&(nn=!0),t.firstContext=null)}function xn(t){var n=t._currentValue;if(xa!==t)if(t={context:t,memoizedValue:n,next:null},null===Mr){if(null===Po)throw Error(R(308));Mr=t,Po.dependencies={lanes:0,firstContext:t}}else Mr=Mr.next=t;return n}var Ei=null;function Sa(t){null===Ei?Ei=[t]:Ei.push(t)}function vc(t,n,o,a){var d=n.interleaved;return null===d?(o.next=o,Sa(n)):(o.next=d.next,d.next=o),n.interleaved=o,ai(t,a)}function ai(t,n){t.lanes|=n;var o=t.alternate;for(null!==o&&(o.lanes|=n),o=t,t=t.return;null!==t;)t.childLanes|=n,null!==(o=t.alternate)&&(o.childLanes|=n),o=t,t=t.return;return 3===o.tag?o.stateNode:null}var Pn=!1;function As(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xc(t,n){n.updateQueue===(t=t.updateQueue)&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ui(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function Ai(t,n,o){var a=t.updateQueue;if(null===a)return null;if(a=a.shared,2&Oe){var d=a.pending;return null===d?n.next=n:(n.next=d.next,d.next=n),a.pending=n,ai(t,o)}return null===(d=a.interleaved)?(n.next=n,Sa(a)):(n.next=d.next,d.next=n),a.interleaved=n,ai(t,o)}function No(t,n,o){if(null!==(n=n.updateQueue)&&(n=n.shared,4194240&o)){var a=n.lanes;n.lanes=o|=a&=t.pendingLanes,Dl(t,o)}}function bc(t,n){var o=t.updateQueue,a=t.alternate;if(null===a||o!==(a=a.updateQueue))null===(t=o.lastBaseUpdate)?o.firstBaseUpdate=n:t.next=n,o.lastBaseUpdate=n;else{var d=null,m=null;if(null!==(o=o.firstBaseUpdate)){do{var v={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};null===m?d=m=v:m=m.next=v,o=o.next}while(null!==o);null===m?d=m=n:m=m.next=n}else d=m=n;t.updateQueue=o={baseState:a.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:a.shared,effects:a.effects}}}function Mo(t,n,o,a){var d=t.updateQueue;Pn=!1;var m=d.firstBaseUpdate,v=d.lastBaseUpdate,S=d.shared.pending;if(null!==S){d.shared.pending=null;var k=S,M=k.next;k.next=null,null===v?m=M:v.next=M,v=k;var _=t.alternate;null!==_&&(S=(_=_.updateQueue).lastBaseUpdate)!==v&&(null===S?_.firstBaseUpdate=M:S.next=M,_.lastBaseUpdate=k)}if(null!==m){var K=d.baseState;for(v=0,_=M=k=null,S=m;;){var q=S.lane,J=S.eventTime;if((a&q)===q){null!==_&&(_=_.next={eventTime:J,lane:0,tag:S.tag,payload:S.payload,callback:S.callback,next:null});e:{var ie=t,re=S;switch(q=n,J=o,re.tag){case 1:if("function"==typeof(ie=re.payload)){K=ie.call(J,K,q);break e}K=ie;break e;case 3:ie.flags=-65537&ie.flags|128;case 0:if(null==(q="function"==typeof(ie=re.payload)?ie.call(J,K,q):ie))break e;K=W({},K,q);break e;case 2:Pn=!0}}null!==S.callback&&0!==S.lane&&(t.flags|=64,null===(q=d.effects)?d.effects=[S]:q.push(S))}else J={eventTime:J,lane:q,tag:S.tag,payload:S.payload,callback:S.callback,next:null},null===_?(M=_=J,k=K):_=_.next=J,v|=q;if(null===(S=S.next)){if(null===(S=d.shared.pending))break;S=(q=S).next,q.next=null,d.lastBaseUpdate=q,d.shared.pending=null}}if(null===_&&(k=K),d.baseState=k,d.firstBaseUpdate=M,d.lastBaseUpdate=_,null!==(n=d.shared.interleaved)){d=n;do{v|=d.lane,d=d.next}while(d!==n)}else null===m&&(d.shared.lanes=0);Pi|=v,t.lanes=v,t.memoizedState=K}}function ka(t,n,o){if(t=n.effects,n.effects=null,null!==t)for(n=0;no?o:4,t(!0);var a=Qi.transition;Qi.transition={};try{t(!1),n()}finally{Ve=o,Qi.transition=a}}function tt(){return tn().memoizedState}function Ee(t,n,o){var a=Mi(t);o={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null},Oa(t)?Ra(n,o):null!==(o=vc(t,n,o,a))&&(zn(o,t,a,Gt()),Ii(o,n,a))}function Hr(t,n,o){var a=Mi(t),d={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null};if(Oa(t))Ra(n,d);else{var m=t.alternate;if(0===t.lanes&&(null===m||0===m.lanes)&&null!==(m=n.lastRenderedReducer))try{var v=n.lastRenderedState,S=m(v,o);if(d.hasEagerState=!0,d.eagerState=S,In(S,v)){var k=n.interleaved;return null===k?(d.next=d,Sa(n)):(d.next=k.next,k.next=d),void(n.interleaved=d)}}catch{}null!==(o=vc(t,n,d,a))&&(zn(o,t,a,d=Gt()),Ii(o,n,a))}}function Oa(t){var n=t.alternate;return t===ot||null!==n&&n===ot}function Ra(t,n){Yi=Oo=!0;var o=t.pending;null===o?n.next=n:(n.next=o.next,o.next=n),t.pending=n}function Ii(t,n,o){if(4194240&o){var a=n.lanes;n.lanes=o|=a&=t.pendingLanes,Dl(t,o)}}var Ns={readContext:xn,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useInsertionEffect:It,useLayoutEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useMutableSource:It,useSyncExternalStore:It,useId:It,unstable_isNewReconciler:!1},pi={readContext:xn,useCallback:function(t,n){return $n().memoizedState=[t,void 0===n?null:n],t},useContext:xn,useEffect:Da,useImperativeHandle:function(t,n,o){return o=null!=o?o.concat([t]):null,Bo(4194308,4,L.bind(null,n,t),o)},useLayoutEffect:function(t,n){return Bo(4194308,4,t,n)},useInsertionEffect:function(t,n){return Bo(4,2,t,n)},useMemo:function(t,n){var o=$n();return n=void 0===n?null:n,t=t(),o.memoizedState=[t,n],t},useReducer:function(t,n,o){var a=$n();return n=void 0!==o?o(n):n,a.memoizedState=a.baseState=n,a.queue=t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},t=t.dispatch=Ee.bind(null,ot,t),[a.memoizedState,t]},useRef:function(t){return $n().memoizedState={current:t}},useState:Cc,useDebugValue:$e,useDeferredValue:function(t){return $n().memoizedState=t},useTransition:function(){var t=Cc(!1),n=t[0];return t=Ac.bind(null,t[1]),$n().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,o){var a=ot,d=$n();if(et){if(void 0===o)throw Error(R(407));o=o()}else{if(o=n(),null===Ct)throw Error(R(349));30&Gi||Na(a,n,o)}d.memoizedState=o;var m={value:o,getSnapshot:n};return d.queue=m,Da(wc.bind(null,a,m,t),[t]),a.flags|=2048,Fr(9,Ls.bind(null,a,m,o,n),void 0,null),o},useId:function(){var t=$n(),n=Ct.identifierPrefix;if(et){var o=Wn;n=":"+n+"R"+(o=(ji&~(1<<32-En(ji)-1)).toString(32)+o),0<(o=Rr++)&&(n+="H"+o.toString(32)),n+=":"}else n=":"+n+"r"+(o=Ia++).toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},kd={readContext:xn,useCallback:jc,useContext:xn,useEffect:za,useImperativeHandle:I,useInsertionEffect:Uo,useLayoutEffect:ue,useMemo:Ec,useReducer:Ts,useRef:Ma,useState:function(){return Ts(Is)},useDebugValue:$e,useDeferredValue:function(t){return Br(tn(),pt.memoizedState,t)},useTransition:function(){return[Ts(Is)[0],tn().memoizedState]},useMutableSource:Fo,useSyncExternalStore:La,useId:tt,unstable_isNewReconciler:!1},nd={readContext:xn,useCallback:jc,useContext:xn,useEffect:za,useImperativeHandle:I,useInsertionEffect:Uo,useLayoutEffect:ue,useMemo:Ec,useReducer:Ps,useRef:Ma,useState:function(){return Ps(Is)},useDebugValue:$e,useDeferredValue:function(t){var n=tn();return null===pt?n.memoizedState=t:Br(n,pt.memoizedState,t)},useTransition:function(){return[Ps(Is)[0],tn().memoizedState]},useMutableSource:Fo,useSyncExternalStore:La,useId:tt,unstable_isNewReconciler:!1};function bn(t,n){if(t&&t.defaultProps){for(var o in n=W({},n),t=t.defaultProps)void 0===n[o]&&(n[o]=t[o]);return n}return n}function Fa(t,n,o,a){o=null==(o=o(a,n=t.memoizedState))?n:W({},n,o),t.memoizedState=o,0===t.lanes&&(t.updateQueue.baseState=o)}var Vo={isMounted:function(t){return!!(t=t._reactInternals)&&dr(t)===t},enqueueSetState:function(t,n,o){t=t._reactInternals;var a=Gt(),d=Mi(t),m=ui(a,d);m.payload=n,null!=o&&(m.callback=o),null!==(n=Ai(t,m,d))&&(zn(n,t,d,a),No(n,t,d))},enqueueReplaceState:function(t,n,o){t=t._reactInternals;var a=Gt(),d=Mi(t),m=ui(a,d);m.tag=1,m.payload=n,null!=o&&(m.callback=o),null!==(n=Ai(t,m,d))&&(zn(n,t,d,a),No(n,t,d))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var o=Gt(),a=Mi(t),d=ui(o,a);d.tag=2,null!=n&&(d.callback=n),null!==(n=Ai(t,d,a))&&(zn(n,t,a,o),No(n,t,a))}};function Ba(t,n,o,a,d,m,v){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(a,m,v):!(n.prototype&&n.prototype.isPureReactComponent&&Cr(o,a)&&Cr(d,m))}function Ic(t,n,o){var a=!1,d=li,m=n.contextType;return"object"==typeof m&&null!==m?m=xn(m):(d=Jt(n)?yn:Ft.current,m=(a=null!=(a=n.contextTypes))?Pr(t,d):li),n=new n(o,m),t.memoizedState=null!=n.state?n.state:null,n.updater=Vo,t.stateNode=n,n._reactInternals=t,a&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=d,t.__reactInternalMemoizedMaskedChildContext=m),n}function Tc(t,n,o,a){t=n.state,"function"==typeof n.componentWillReceiveProps&&n.componentWillReceiveProps(o,a),"function"==typeof n.UNSAFE_componentWillReceiveProps&&n.UNSAFE_componentWillReceiveProps(o,a),n.state!==t&&Vo.enqueueReplaceState(n,n.state,null)}function Ha(t,n,o,a){var d=t.stateNode;d.props=o,d.state=t.memoizedState,d.refs={},As(t);var m=n.contextType;"object"==typeof m&&null!==m?d.context=xn(m):(m=Jt(n)?yn:Ft.current,d.context=Pr(t,m)),d.state=t.memoizedState,"function"==typeof(m=n.getDerivedStateFromProps)&&(Fa(t,n,m,o),d.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof d.getSnapshotBeforeUpdate||"function"!=typeof d.UNSAFE_componentWillMount&&"function"!=typeof d.componentWillMount||(n=d.state,"function"==typeof d.componentWillMount&&d.componentWillMount(),"function"==typeof d.UNSAFE_componentWillMount&&d.UNSAFE_componentWillMount(),n!==d.state&&Vo.enqueueReplaceState(d,d.state,null),Mo(t,o,d,a),d.state=t.memoizedState),"function"==typeof d.componentDidMount&&(t.flags|=4194308)}function Ur(t,n){try{var o="",a=n;do{o+=he(a),a=a.return}while(a);var d=o}catch(m){d="\nError generating stack: "+m.message+"\n"+m.stack}return{value:t,source:n,stack:d,digest:null}}function qo(t,n,o){return{value:t,source:null,stack:o??null,digest:n??null}}function Ua(t,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var Bt="function"==typeof WeakMap?WeakMap:Map;function Nn(t,n,o){(o=ui(-1,o)).tag=3,o.payload={element:null};var a=n.value;return o.callback=function(){el||(el=!0,tu=a),Ua(0,n)},o}function Zi(t,n,o){(o=ui(-1,o)).tag=3;var a=t.type.getDerivedStateFromError;if("function"==typeof a){var d=n.value;o.payload=function(){return a(d)},o.callback=function(){Ua(0,n)}}var m=t.stateNode;return null!==m&&"function"==typeof m.componentDidCatch&&(o.callback=function(){Ua(0,n),"function"!=typeof a&&(null===Li?Li=new Set([this]):Li.add(this));var v=n.stack;this.componentDidCatch(n.value,{componentStack:null!==v?v:""})}),o}function Pc(t,n,o){var a=t.pingCache;if(null===a){a=t.pingCache=new Bt;var d=new Set;a.set(n,d)}else void 0===(d=a.get(n))&&a.set(n,d=new Set);d.has(o)||(d.add(o),t=dd.bind(null,t,n,o),n.then(t,t))}function Va(t){do{var n;if((n=13===t.tag)&&(n=null===(n=t.memoizedState)||null!==n.dehydrated),n)return t;t=t.return}while(null!==t);return null}function qa(t,n,o,a,d){return 1&t.mode?(t.flags|=65536,t.lanes=d,t):(t===n?t.flags|=65536:(t.flags|=128,o.flags|=131072,o.flags&=-52805,1===o.tag&&(null===o.alternate?o.tag=17:((n=ui(-1,1)).tag=2,Ai(o,n,1))),o.lanes|=1),t)}var id=ft.ReactCurrentOwner,nn=!1;function Qt(t,n,o,a){n.child=null===t?yc(n,null,o,a):Wi(n,t.child,o,a)}function Lc(t,n,o,a,d){o=o.render;var m=n.ref;return Ki(n,d),a=Ta(t,n,o,a,m,d),o=Pa(),null===t||nn?(et&&o&&ha(n),n.flags|=1,Qt(t,n,a,d),n.child):(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~d,Qn(t,n,d))}function Nc(t,n,o,a,d){if(null===t){var m=o.type;return"function"!=typeof m||pu(m)||void 0!==m.defaultProps||null!==o.compare||void 0!==o.defaultProps?((t=rl(o.type,null,a,n,n.mode,d)).ref=n.ref,t.return=n,n.child=t):(n.tag=15,n.type=m,Mc(t,n,m,a,d))}return m=t.child,t.lanes&d||!(o=null!==(o=o.compare)?o:Cr)(m.memoizedProps,a)||t.ref!==n.ref?(n.flags|=1,(t=zi(m,a)).ref=n.ref,t.return=n,n.child=t):Qn(t,n,d)}function Mc(t,n,o,a,d){if(null!==t){var m=t.memoizedProps;if(Cr(m,a)&&t.ref===n.ref){if(nn=!1,n.pendingProps=a=m,!(t.lanes&d))return n.lanes=t.lanes,Qn(t,n,d);131072&t.flags&&(nn=!0)}}return di(t,n,o,a,d)}function Dc(t,n,o){var a=n.pendingProps,d=a.children,m=null!==t?t.memoizedState:null;if("hidden"===a.mode)if(1&n.mode){if(!(1073741824&o))return t=null!==m?m.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t,cachePool:null,transitions:null},n.updateQueue=null,Ke(qr,hn),hn|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=null!==m?m.baseLanes:o,Ke(qr,hn),hn|=a}else n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(qr,hn),hn|=o;else null!==m?(a=m.baseLanes|o,n.memoizedState=null):a=o,Ke(qr,hn),hn|=a;return Qt(t,n,d,o),n.child}function Xi(t,n){var o=n.ref;(null===t&&null!==o||null!==t&&t.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function di(t,n,o,a,d){var m=Jt(o)?yn:Ft.current;return m=Pr(n,m),Ki(n,d),o=Ta(t,n,o,a,m,d),a=Pa(),null===t||nn?(et&&a&&ha(n),n.flags|=1,Qt(t,n,o,d),n.child):(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~d,Qn(t,n,d))}function Ms(t,n,o,a,d){if(Jt(o)){var m=!0;Cs(n)}else m=!1;if(Ki(n,d),null===n.stateNode)Ko(t,n),Ic(n,o,a),Ha(n,o,a,d),a=!0;else if(null===t){var v=n.stateNode,S=n.memoizedProps;v.props=S;var k=v.context,M=o.contextType;M="object"==typeof M&&null!==M?xn(M):Pr(n,M=Jt(o)?yn:Ft.current);var _=o.getDerivedStateFromProps,K="function"==typeof _||"function"==typeof v.getSnapshotBeforeUpdate;K||"function"!=typeof v.UNSAFE_componentWillReceiveProps&&"function"!=typeof v.componentWillReceiveProps||(S!==a||k!==M)&&Tc(n,v,a,M),Pn=!1;var q=n.memoizedState;v.state=q,Mo(n,a,v,d),k=n.memoizedState,S!==a||q!==k||Kt.current||Pn?("function"==typeof _&&(Fa(n,o,_,a),k=n.memoizedState),(S=Pn||Ba(n,o,S,a,q,k,M))?(K||"function"!=typeof v.UNSAFE_componentWillMount&&"function"!=typeof v.componentWillMount||("function"==typeof v.componentWillMount&&v.componentWillMount(),"function"==typeof v.UNSAFE_componentWillMount&&v.UNSAFE_componentWillMount()),"function"==typeof v.componentDidMount&&(n.flags|=4194308)):("function"==typeof v.componentDidMount&&(n.flags|=4194308),n.memoizedProps=a,n.memoizedState=k),v.props=a,v.state=k,v.context=M,a=S):("function"==typeof v.componentDidMount&&(n.flags|=4194308),a=!1)}else{v=n.stateNode,xc(t,n),S=n.memoizedProps,M=n.type===n.elementType?S:bn(n.type,S),v.props=M,K=n.pendingProps,q=v.context,k="object"==typeof(k=o.contextType)&&null!==k?xn(k):Pr(n,k=Jt(o)?yn:Ft.current);var J=o.getDerivedStateFromProps;(_="function"==typeof J||"function"==typeof v.getSnapshotBeforeUpdate)||"function"!=typeof v.UNSAFE_componentWillReceiveProps&&"function"!=typeof v.componentWillReceiveProps||(S!==K||q!==k)&&Tc(n,v,a,k),Pn=!1,v.state=q=n.memoizedState,Mo(n,a,v,d);var ie=n.memoizedState;S!==K||q!==ie||Kt.current||Pn?("function"==typeof J&&(Fa(n,o,J,a),ie=n.memoizedState),(M=Pn||Ba(n,o,M,a,q,ie,k)||!1)?(_||"function"!=typeof v.UNSAFE_componentWillUpdate&&"function"!=typeof v.componentWillUpdate||("function"==typeof v.componentWillUpdate&&v.componentWillUpdate(a,ie,k),"function"==typeof v.UNSAFE_componentWillUpdate&&v.UNSAFE_componentWillUpdate(a,ie,k)),"function"==typeof v.componentDidUpdate&&(n.flags|=4),"function"==typeof v.getSnapshotBeforeUpdate&&(n.flags|=1024)):("function"!=typeof v.componentDidUpdate||S===t.memoizedProps&&q===t.memoizedState||(n.flags|=4),"function"!=typeof v.getSnapshotBeforeUpdate||S===t.memoizedProps&&q===t.memoizedState||(n.flags|=1024),n.memoizedProps=a,n.memoizedState=ie),v.props=a,v.state=ie,v.context=k,a=M):("function"!=typeof v.componentDidUpdate||S===t.memoizedProps&&q===t.memoizedState||(n.flags|=4),"function"!=typeof v.getSnapshotBeforeUpdate||S===t.memoizedProps&&q===t.memoizedState||(n.flags|=1024),a=!1)}return _a(t,n,o,a,m,d)}function _a(t,n,o,a,d,m){Xi(t,n);var v=!!(128&n.flags);if(!a&&!v)return d&&js(n,o,!1),Qn(t,n,m);a=n.stateNode,id.current=n;var S=v&&"function"!=typeof o.getDerivedStateFromError?null:a.render();return n.flags|=1,null!==t&&v?(n.child=Wi(n,t.child,null,m),n.child=Wi(n,null,S,m)):Qt(t,n,S,m),n.memoizedState=a.state,d&&js(n,o,!0),n.child}function _o(t){var n=t.stateNode;n.pendingContext?ks(0,n.pendingContext,n.pendingContext!==n.context):n.context&&ks(0,n.context,!1),Ca(t,n.containerInfo)}function Mn(t,n,o,a,d){return Nr(),va(d),n.flags|=256,Qt(t,n,o,a),n.child}var Oc,$a,Rc,Fc,wn={dehydrated:null,treeContext:null,retryLane:0};function Ds(t){return{baseLanes:t,cachePool:null,transitions:null}}function Wo(t,n,o){var S,a=n.pendingProps,d=st.current,m=!1,v=!!(128&n.flags);if((S=v)||(S=(null===t||null!==t.memoizedState)&&!!(2&d)),S?(m=!0,n.flags&=-129):(null===t||null!==t.memoizedState)&&(d|=1),Ke(st,1&d),null===t)return ga(n),null!==(t=n.memoizedState)&&null!==(t=t.dehydrated)?(n.lanes=1&n.mode?"$!"===t.data?8:1073741824:1,null):(v=a.children,t=a.fallback,m?(m=n.child,v={mode:"hidden",children:v},1&(a=n.mode)||null===m?m=sl(v,a,0,null):(m.childLanes=0,m.pendingProps=v),t=rr(t,a,o,null),m.return=n,t.return=n,m.sibling=t,n.child=m,n.child.memoizedState=Ds(o),n.memoizedState=wn,t):Wa(n,v));if(null!==(d=t.memoizedState)&&null!==(S=d.dehydrated))return function rd(t,n,o,a,d,m,v){if(o)return 256&n.flags?(n.flags&=-257,Vr(t,n,v,a=qo(Error(R(422))))):null!==n.memoizedState?(n.child=t.child,n.flags|=128,null):(m=a.fallback,a=sl({mode:"visible",children:a.children},d=n.mode,0,null),(m=rr(m,d,v,null)).flags|=2,a.return=n,m.return=n,a.sibling=m,n.child=a,1&n.mode&&Wi(n,t.child,null,v),n.child.memoizedState=Ds(v),n.memoizedState=wn,m);if(!(1&n.mode))return Vr(t,n,v,null);if("$!"===d.data){if(a=d.nextSibling&&d.nextSibling.dataset)var S=a.dgst;return a=S,Vr(t,n,v,a=qo(m=Error(R(419)),a,void 0))}if(S=!!(v&t.childLanes),nn||S){if(null!==(a=Ct)){switch(v&-v){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}0!==(d=d&(a.suspendedLanes|v)?0:d)&&d!==m.retryLane&&(m.retryLane=d,ai(t,d),zn(a,t,d,-1))}return ou(),Vr(t,n,v,a=qo(Error(R(421))))}return"$?"===d.data?(n.flags|=128,n.child=t.child,n=hd.bind(null,t),d._reactRetry=n,null):(t=m.treeContext,en=ri(d.nextSibling),dn=n,et=!0,Tn=null,null!==t&&($t[vn++]=ji,$t[vn++]=Wn,$t[vn++]=Ci,ji=t.id,Wn=t.overflow,Ci=n),(n=Wa(n,a.children)).flags|=4096,n)}(t,n,v,a,S,d,o);if(m){m=a.fallback,S=(d=t.child).sibling;var k={mode:"hidden",children:a.children};return 1&(v=n.mode)||n.child===d?(a=zi(d,k)).subtreeFlags=14680064&d.subtreeFlags:((a=n.child).childLanes=0,a.pendingProps=k,n.deletions=null),null!==S?m=zi(S,m):(m=rr(m,v,o,null)).flags|=2,m.return=n,a.return=n,a.sibling=m,n.child=a,a=m,m=n.child,v=null===(v=t.child.memoizedState)?Ds(o):{baseLanes:v.baseLanes|o,cachePool:null,transitions:v.transitions},m.memoizedState=v,m.childLanes=t.childLanes&~o,n.memoizedState=wn,a}return t=(m=t.child).sibling,a=zi(m,{mode:"visible",children:a.children}),!(1&n.mode)&&(a.lanes=o),a.return=n,a.sibling=null,null!==t&&(null===(o=n.deletions)?(n.deletions=[t],n.flags|=16):o.push(t)),n.child=a,n.memoizedState=null,a}function Wa(t,n){return(n=sl({mode:"visible",children:n},t.mode,0,null)).return=t,t.child=n}function Vr(t,n,o,a){return null!==a&&va(a),Wi(n,t.child,null,o),(t=Wa(n,n.pendingProps.children)).flags|=2,n.memoizedState=null,t}function Ji(t,n,o){t.lanes|=n;var a=t.alternate;null!==a&&(a.lanes|=n),Lo(t.return,n,o)}function Ka(t,n,o,a,d){var m=t.memoizedState;null===m?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:o,tailMode:d}:(m.isBackwards=n,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=o,m.tailMode=d)}function zc(t,n,o){var a=n.pendingProps,d=a.revealOrder,m=a.tail;if(Qt(t,n,a.children,o),2&(a=st.current))a=1&a|2,n.flags|=128;else{if(null!==t&&128&t.flags)e:for(t=n.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Ji(t,o,n);else if(19===t.tag)Ji(t,o,n);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;null===t.sibling;){if(null===t.return||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}if(Ke(st,a),1&n.mode)switch(d){case"forwards":for(o=n.child,d=null;null!==o;)null!==(t=o.alternate)&&null===Do(t)&&(d=o),o=o.sibling;null===(o=d)?(d=n.child,n.child=null):(d=o.sibling,o.sibling=null),Ka(n,!1,d,o,m);break;case"backwards":for(o=null,d=n.child,n.child=null;null!==d;){if(null!==(t=d.alternate)&&null===Do(t)){n.child=d;break}t=d.sibling,d.sibling=o,o=d,d=t}Ka(n,!0,o,null,m);break;case"together":Ka(n,!1,null,null,void 0);break;default:n.memoizedState=null}else n.memoizedState=null;return n.child}function Ko(t,n){!(1&n.mode)&&null!==t&&(t.alternate=null,n.alternate=null,n.flags|=2)}function Qn(t,n,o){if(null!==t&&(n.dependencies=t.dependencies),Pi|=n.lanes,!(o&n.childLanes))return null;if(null!==t&&n.child!==t.child)throw Error(R(153));if(null!==n.child){for(o=zi(t=n.child,t.pendingProps),n.child=o,o.return=n;null!==t.sibling;)(o=o.sibling=zi(t=t.sibling,t.pendingProps)).return=n;o.sibling=null}return n.child}function zs(t,n){if(!et)switch(t.tailMode){case"hidden":n=t.tail;for(var o=null;null!==n;)null!==n.alternate&&(o=n),n=n.sibling;null===o?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var a=null;null!==o;)null!==o.alternate&&(a=o),o=o.sibling;null===a?n||null===t.tail?t.tail=null:t.tail.sibling=null:a.sibling=null}}function Ht(t){var n=null!==t.alternate&&t.alternate.child===t.child,o=0,a=0;if(n)for(var d=t.child;null!==d;)o|=d.lanes|d.childLanes,a|=14680064&d.subtreeFlags,a|=14680064&d.flags,d.return=t,d=d.sibling;else for(d=t.child;null!==d;)o|=d.lanes|d.childLanes,a|=d.subtreeFlags,a|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=a,t.childLanes=o,n}function Ce(t,n,o){var a=n.pendingProps;switch(ma(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(n),null;case 1:case 17:return Jt(n.type)&&bi(),Ht(n),null;case 3:return a=n.stateNode,Or(),Ge(Kt),Ge(Ft),Aa(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(null===t||null===t.child)&&(Ao(n)?n.flags|=4:null===t||t.memoizedState.isDehydrated&&!(256&n.flags)||(n.flags|=1024,null!==Tn&&(ru(Tn),Tn=null))),$a(t,n),Ht(n),null;case 5:ja(n);var d=ci($i.current);if(o=n.type,null!==t&&null!=n.stateNode)Rc(t,n,o,a,d),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!a){if(null===n.stateNode)throw Error(R(166));return Ht(n),null}if(t=ci(Kn.current),Ao(n)){o=n.type;var m=n.memoizedProps;switch((a=n.stateNode)[zt]=n,a[Ir]=m,t=!!(1&n.mode),o){case"dialog":Ye("cancel",a),Ye("close",a);break;case"iframe":case"object":case"embed":Ye("load",a);break;case"video":case"audio":for(d=0;d<\/script>",t=t.removeChild(t.firstChild)):"string"==typeof a.is?t=v.createElement(o,{is:a.is}):(t=v.createElement(o),"select"===o&&(v=t,a.multiple?v.multiple=!0:a.size&&(v.size=a.size))):t=v.createElementNS(t,o),t[zt]=n,t[Ir]=a,Oc(t,n,!1,!1),n.stateNode=t;e:{switch(v=Wt(o,a),o){case"dialog":Ye("cancel",t),Ye("close",t),d=a;break;case"iframe":case"object":case"embed":Ye("load",t),d=a;break;case"video":case"audio":for(d=0;d_r&&(n.flags|=128,a=!0,zs(m,!1),n.lanes=4194304)}else{if(!a)if(null!==(t=Do(v))){if(n.flags|=128,a=!0,null!==(o=t.updateQueue)&&(n.updateQueue=o,n.flags|=4),zs(m,!0),null===m.tail&&"hidden"===m.tailMode&&!v.alternate&&!et)return Ht(n),null}else 2*at()-m.renderingStartTime>_r&&1073741824!==o&&(n.flags|=128,a=!0,zs(m,!1),n.lanes=4194304);m.isBackwards?(v.sibling=n.child,n.child=v):(null!==(o=m.last)?o.sibling=v:n.child=v,m.last=v)}return null!==m.tail?(m.rendering=n=m.tail,m.tail=n.sibling,m.renderingStartTime=at(),n.sibling=null,o=st.current,Ke(st,a?1&o|2:1&o),n):(Ht(n),null);case 22:case 23:return Wr(),a=null!==n.memoizedState,null!==t&&null!==t.memoizedState!==a&&(n.flags|=8192),a&&1&n.mode?1073741824&hn&&(Ht(n),6&n.subtreeFlags&&(n.flags|=8192)):Ht(n),null;case 24:case 25:return null}throw Error(R(156,n.tag))}function Qa(t,n){switch(ma(n),n.tag){case 1:return Jt(n.type)&&bi(),65536&(t=n.flags)?(n.flags=-65537&t|128,n):null;case 3:return Or(),Ge(Kt),Ge(Ft),Aa(),65536&(t=n.flags)&&!(128&t)?(n.flags=-65537&t|128,n):null;case 5:return ja(n),null;case 13:if(Ge(st),null!==(t=n.memoizedState)&&null!==t.dehydrated){if(null===n.alternate)throw Error(R(340));Nr()}return 65536&(t=n.flags)?(n.flags=-65537&t|128,n):null;case 19:return Ge(st),null;case 4:return Or(),null;case 10:return wa(n.type._context),null;case 22:case 23:return Wr(),null;default:return null}}Oc=function(t,n){for(var o=n.child;null!==o;){if(5===o.tag||6===o.tag)t.appendChild(o.stateNode);else if(4!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===n)break;for(;null===o.sibling;){if(null===o.return||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},$a=function(){},Rc=function(t,n,o,a){var d=t.memoizedProps;if(d!==a){t=n.stateNode,ci(Kn.current);var v,m=null;switch(o){case"input":d=ml(t,d),a=ml(t,a),m=[];break;case"select":d=W({},d,{value:void 0}),a=W({},a,{value:void 0}),m=[];break;case"textarea":d=Zs(t,d),a=Zs(t,a),m=[];break;default:"function"!=typeof d.onClick&&"function"==typeof a.onClick&&(t.onclick=So)}for(M in gi(o,a),o=null,d)if(!a.hasOwnProperty(M)&&d.hasOwnProperty(M)&&null!=d[M])if("style"===M){var S=d[M];for(v in S)S.hasOwnProperty(v)&&(o||(o={}),o[v]="")}else"dangerouslySetInnerHTML"!==M&&"children"!==M&&"suppressContentEditableWarning"!==M&&"suppressHydrationWarning"!==M&&"autoFocus"!==M&&(mt.hasOwnProperty(M)?m||(m=[]):(m=m||[]).push(M,null));for(M in a){var k=a[M];if(S=d?.[M],a.hasOwnProperty(M)&&k!==S&&(null!=k||null!=S))if("style"===M)if(S){for(v in S)!S.hasOwnProperty(v)||k&&k.hasOwnProperty(v)||(o||(o={}),o[v]="");for(v in k)k.hasOwnProperty(v)&&S[v]!==k[v]&&(o||(o={}),o[v]=k[v])}else o||(m||(m=[]),m.push(M,o)),o=k;else"dangerouslySetInnerHTML"===M?(S=S?S.__html:void 0,null!=(k=k?k.__html:void 0)&&S!==k&&(m=m||[]).push(M,k)):"children"===M?"string"!=typeof k&&"number"!=typeof k||(m=m||[]).push(M,""+k):"suppressContentEditableWarning"!==M&&"suppressHydrationWarning"!==M&&(mt.hasOwnProperty(M)?(null!=k&&"onScroll"===M&&Ye("scroll",t),m||S===k||(m=[])):(m=m||[]).push(M,k))}o&&(m=m||[]).push("style",o);var M=m;(n.updateQueue=M)&&(n.flags|=4)}},Fc=function(t,n,o,a){o!==a&&(n.flags|=4)};var $o=!1,Ut=!1,od="function"==typeof WeakSet?WeakSet:Set,ne=null;function er(t,n){var o=t.ref;if(null!==o)if("function"==typeof o)try{o(null)}catch(a){lt(t,n,a)}else o.current=null}function Qo(t,n,o){try{o()}catch(a){lt(t,n,a)}}var Go=!1;function Os(t,n,o){var a=n.updateQueue;if(null!==(a=null!==a?a.lastEffect:null)){var d=a=a.next;do{if((d.tag&t)===t){var m=d.destroy;d.destroy=void 0,void 0!==m&&Qo(n,o,m)}d=d.next}while(d!==a)}}function Yo(t,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var o=n=n.next;do{(o.tag&t)===t&&(o.destroy=(0,o.create)()),o=o.next}while(o!==n)}}function Ga(t){var n=t.ref;null!==n&&(t=t.stateNode,"function"==typeof n?n(t):n.current=t)}function Bc(t){var n=t.alternate;null!==n&&(t.alternate=null,Bc(n)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(n=t.stateNode)&&(delete n[zt],delete n[Ir],delete n[Co],delete n[Jp],delete n[uc]),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Hc(t){return 5===t.tag||3===t.tag||4===t.tag}function Ya(t){e:for(;;){for(;null===t.sibling;){if(null===t.return||Hc(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags||null===t.child||4===t.tag)continue e;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function nt(t,n,o){var a=t.tag;if(5===a||6===a)t=t.stateNode,n?8===o.nodeType?o.parentNode.insertBefore(t,n):o.insertBefore(t,n):(8===o.nodeType?(n=o.parentNode).insertBefore(t,o):(n=o).appendChild(t),null!=(o=o._reactRootContainer)||null!==n.onclick||(n.onclick=So));else if(4!==a&&null!==(t=t.child))for(nt(t,n,o),t=t.sibling;null!==t;)nt(t,n,o),t=t.sibling}function it(t,n,o){var a=t.tag;if(5===a||6===a)t=t.stateNode,n?o.insertBefore(t,n):o.appendChild(t);else if(4!==a&&null!==(t=t.child))for(it(t,n,o),t=t.sibling;null!==t;)it(t,n,o),t=t.sibling}var yt=null,Dn=!1;function Ti(t,n,o){for(o=o.child;null!==o;)Uc(t,n,o),o=o.sibling}function Uc(t,n,o){if(Un&&"function"==typeof Un.onCommitFiberUnmount)try{Un.onCommitFiberUnmount(ro,o)}catch{}switch(o.tag){case 5:Ut||er(o,n);case 6:var a=yt,d=Dn;yt=null,Ti(t,n,o),Dn=d,null!==(yt=a)&&(Dn?(o=o.stateNode,8===(t=yt).nodeType?t.parentNode.removeChild(o):t.removeChild(o)):yt.removeChild(o.stateNode));break;case 18:null!==yt&&(Dn?(o=o.stateNode,8===(t=yt).nodeType?ca(t.parentNode,o):1===t.nodeType&&ca(t,o),uo(t)):ca(yt,o.stateNode));break;case 4:a=yt,d=Dn,yt=o.stateNode.containerInfo,Dn=!0,Ti(t,n,o),yt=a,Dn=d;break;case 0:case 11:case 14:case 15:if(!Ut&&null!==(a=o.updateQueue)&&null!==(a=a.lastEffect)){d=a=a.next;do{var m=d,v=m.destroy;m=m.tag,void 0!==v&&(2&m||4&m)&&Qo(o,n,v),d=d.next}while(d!==a)}Ti(t,n,o);break;case 1:if(!Ut&&(er(o,n),"function"==typeof(a=o.stateNode).componentWillUnmount))try{a.props=o.memoizedProps,a.state=o.memoizedState,a.componentWillUnmount()}catch(S){lt(o,n,S)}Ti(t,n,o);break;case 21:Ti(t,n,o);break;case 22:1&o.mode?(Ut=(a=Ut)||null!==o.memoizedState,Ti(t,n,o),Ut=a):Ti(t,n,o);break;default:Ti(t,n,o)}}function Za(t){var n=t.updateQueue;if(null!==n){t.updateQueue=null;var o=t.stateNode;null===o&&(o=t.stateNode=new od),n.forEach(function(a){var d=md.bind(null,t,a);o.has(a)||(o.add(a),a.then(d,d))})}}function Sn(t,n){var o=n.deletions;if(null!==o)for(var a=0;ad&&(d=v),a&=~m}if(a=d,10<(a=(120>(a=at()-a)?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*Ja(a/1960))-a)){t.timeoutHandle=ko(Gn.bind(null,t,rn,hi),a);break}Gn(t,rn,hi);break;default:throw Error(R(329))}}}return sn(t,at()),t.callbackNode===o?Wc.bind(null,t):null}function iu(t,n){var o=Fs;return t.current.memoizedState.isDehydrated&&(ut(t,n).flags|=256),2!==(t=il(t,n))&&(n=rn,rn=o,null!==n&&ru(n)),t}function ru(t){null===rn?rn=t:rn.push.apply(rn,t)}function Di(t,n){for(n&=~Jo,t.suspendedLanes|=n&=~Xo,t.pingedLanes&=~n,t=t.expirationTimes;0t?16:t,null===Ni)var a=!1;else{if(t=Ni,Ni=null,Bs=0,6&Oe)throw Error(R(331));var d=Oe;for(Oe|=4,ne=t.current;null!==ne;){var m=ne,v=m.child;if(16&ne.flags){var S=m.deletions;if(null!==S){for(var k=0;kat()-nr?ut(t,0):Jo|=o),sn(t,n)}function uu(t,n){0===n&&(1&t.mode?(n=oo,!(130023424&(oo<<=1))&&(oo=4194304)):n=1);var o=Gt();null!==(t=ai(t,n))&&(as(t,n,o),sn(t,o))}function hd(t){var n=t.memoizedState,o=0;null!==n&&(o=n.retryLane),uu(t,o)}function md(t,n){var o=0;switch(t.tag){case 13:var a=t.stateNode,d=t.memoizedState;null!==d&&(o=d.retryLane);break;case 19:a=t.stateNode;break;default:throw Error(R(314))}null!==a&&a.delete(n),uu(t,o)}function cu(t,n){return Il(t,n)}function On(t,n,o,a){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cn(t,n,o,a){return new On(t,n,o,a)}function pu(t){return!(!(t=t.prototype)||!t.isReactComponent)}function zi(t,n){var o=t.alternate;return null===o?((o=Cn(t.tag,n,t.key,t.mode)).elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=n,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=14680064&t.flags,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,o.dependencies=null===(n=t.dependencies)?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o}function rl(t,n,o,a,d,m){var v=2;if(a=t,"function"==typeof t)pu(t)&&(v=1);else if("string"==typeof t)v=5;else e:switch(t){case wt:return rr(o.children,d,m,n);case on:v=8,d|=8;break;case Xn:return(t=Cn(12,o,n,2|d)).elementType=Xn,t.lanes=m,t;case St:return(t=Cn(13,o,n,d)).elementType=St,t.lanes=m,t;case Jn:return(t=Cn(19,o,n,d)).elementType=Jn,t.lanes=m,t;case Se:return sl(o,d,m,n);default:if("object"==typeof t&&null!==t)switch(t.$$typeof){case jn:v=10;break e;case we:v=9;break e;case Q:v=11;break e;case ee:v=14;break e;case de:v=16,a=null;break e}throw Error(R(130,null==t?t:typeof t,""))}return(n=Cn(v,o,n,d)).elementType=t,n.type=a,n.lanes=m,n}function rr(t,n,o,a){return(t=Cn(7,t,a,n)).lanes=o,t}function sl(t,n,o,a){return(t=Cn(22,t,a,n)).elementType=Se,t.lanes=o,t.stateNode={isHidden:!1},t}function ol(t,n,o){return(t=Cn(6,t,null,n)).lanes=o,t}function Vt(t,n,o){return(n=Cn(4,null!==t.children?t.children:[],t.key,n)).lanes=o,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function Zc(t,n,o,a,d){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nl(0),this.expirationTimes=Nl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nl(0),this.identifierPrefix=a,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function du(t,n,o,a,d,m,v,S,k){return t=new Zc(t,n,o,S,k),1===n?(n=1,!0===m&&(n|=8)):n=0,m=Cn(3,null,null,n),t.current=m,m.stateNode=t,m.memoizedState={element:a,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},As(m),t}function Vs(t){if(!t)return li;e:{if(dr(t=t._reactInternals)!==t||1!==t.tag)throw Error(R(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Jt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(null!==n);throw Error(R(171))}if(1===t.tag){var o=t.type;if(Jt(o))return cc(t,o,n)}return n}function ll(t,n,o,a){var d=n.current,m=Gt(),v=Mi(d);return o=Vs(o),null===n.context?n.context=o:n.pendingContext=o,(n=ui(m,v)).payload={element:t},null!==(a=void 0===a?null:a)&&(n.callback=a),null!==(t=Ai(d,n,v))&&(zn(t,d,v,m),No(t,d,v)),v}function al(t){return(t=t.current).child?t.child.stateNode:null}function Xc(t,n){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var o=t.retryLane;t.retryLane=0!==o&&o{"use strict";(function Le(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||"function"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Le)}catch(Lt){console.error(Lt)}})(),Zn.exports=F(7578)},3909:(Zn,be)=>{"use strict";function F(ee,de){var Se=ee.length;ee.push(de);e:for(;0>>1,Je=ee[rt];if(!(0>>1;rtHe(gn,Se))_tHe(p,gn)?(ee[rt]=p,ee[_t]=Se,rt=_t):(ee[rt]=gn,ee[Zt]=Se,rt=Zt);else{if(!(_tHe(p,Se)))break e;ee[rt]=p,ee[_t]=Se,rt=_t}}}return de}function He(ee,de){var Se=ee.sortIndex-de.sortIndex;return 0!==Se?Se:ee.id-de.id}if("object"==typeof performance&&"function"==typeof performance.now){var R=performance;be.unstable_now=function(){return R.now()}}else{var Nt=Date,mt=Nt.now();be.unstable_now=function(){return Nt.now()-mt}}var Ue=[],fe=[],Te=1,Ne=null,Me=3,qt=!1,Mt=!1,xe=!1,xt="function"==typeof setTimeout?setTimeout:null,Dt="function"==typeof clearTimeout?clearTimeout:null,Pe=typeof setImmediate<"u"?setImmediate:null;function je(ee){for(var de=Le(fe);null!==de;){if(null===de.callback)Lt(fe);else{if(!(de.startTime<=ee))break;Lt(fe),de.sortIndex=de.expirationTime,F(Ue,de)}de=Le(fe)}}function z(ee){if(xe=!1,je(ee),!Mt)if(null!==Le(Ue))Mt=!0,St(De);else{var de=Le(fe);null!==de&&Jn(z,de.startTime-ee)}}function De(ee,de){Mt=!1,xe&&(xe=!1,Dt(bt),bt=-1),qt=!0;var Se=Me;try{for(je(de),Ne=Le(Ue);null!==Ne&&(!(Ne.expirationTime>de)||ee&&!on());){var rt=Ne.callback;if("function"==typeof rt){Ne.callback=null,Me=Ne.priorityLevel;var Je=rt(Ne.expirationTime<=de);de=be.unstable_now(),"function"==typeof Je?Ne.callback=Je:Ne===Le(Ue)&&Lt(Ue),je(de)}else Lt(Ue);Ne=Le(Ue)}if(null!==Ne)var W=!0;else{var Zt=Le(fe);null!==Zt&&Jn(z,Zt.startTime-de),W=!1}return W}finally{Ne=null,Me=Se,qt=!1}}typeof navigator<"u"&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var jn,jt=!1,ft=null,bt=-1,fn=5,wt=-1;function on(){return!(be.unstable_now()-wtee||125rt?(ee.sortIndex=Se,F(fe,ee),null===Le(Ue)&&ee===Le(fe)&&(xe?(Dt(bt),bt=-1):xe=!0,Jn(z,Se-rt))):(ee.sortIndex=Je,F(Ue,ee),Mt||qt||(Mt=!0,St(De))),ee},be.unstable_shouldYield=on,be.unstable_wrapCallback=function(ee){var de=Me;return function(){var Se=Me;Me=de;try{return ee.apply(this,arguments)}finally{Me=Se}}}},1605:(Zn,be,F)=>{"use strict";Zn.exports=F(3909)},5390:function(Zn,be,F){"use strict";var Le=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(be,"__esModule",{value:!0});var Lt=Le(F(1763));be.default=function He(R,Nt){var mt=null;if(!R||"string"!=typeof R)return mt;var Ue=(0,Lt.default)(R),fe="function"==typeof Nt;return Ue.forEach(function(Te){if("declaration"===Te.type){var Ne=Te.property,Me=Te.value;fe?Nt(Ne,Me,Te):Me&&((mt=mt||{})[Ne]=Me)}}),mt}}}]); \ No newline at end of file diff --git a/docs/chunk-IFRY76GO.js b/docs/chunk-IFRY76GO.js new file mode 100644 index 0000000..65da914 --- /dev/null +++ b/docs/chunk-IFRY76GO.js @@ -0,0 +1,7 @@ +import{$a as bn,Fa as So,Ha as Xe,Ia as de,K as yo,Ka as zo,Pb as Co,R as xe,Sb as To,T as ht,Tb as Eo,U as ae,Ua as qo,W as B,Wa as He,Za as an,_ as te,_a as ln,a as Be,ab as sn,b as pt,bb as mt,cb as gt,da as ye,eb as un,fb as Mo,gb as dn,hb as we,ia as wo,ib as Ao,ja as vo,jb as $o,kb as pn,la as ko,lb as hn,n as ce,pb as No,qa as _o,qb as Io,ra as fn,rb as mn,sa as cn,tb as gn,u as O,ub as xn}from"./chunk-M6PASJEJ.js";var yn=(()=>{let t=class t{set _where(n){n==="left"||n==="right"?this.where=n:this.where="left"}constructor(n){this.templateRef=n,this.where="left"}};t.\u0275fac=function(r){return new(r||t)(de(zo))},t.\u0275dir=ko({type:t,selectors:[["","ngx-features-viewer-label",""]],inputs:{_where:[wo.None,"ngx-features-viewer-label","_where"]},standalone:!0});let e=t;return e})();function ve(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function wn(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function xt(e){let t,o,n;e.length!==2?(t=ve,o=(c,a)=>ve(e(c),a),n=(c,a)=>e(c)-a):(t=e===ve||e===wn?e:ff,o=e,n=e);function r(c,a,l=0,b=c.length){if(l>>1;o(c[u],a)<0?l=u+1:b=u}while(l>>1;o(c[u],a)<=0?l=u+1:b=u}while(ll&&n(c[u-1],a)>-n(c[u],a)?u-1:u}return{left:r,center:f,right:i}}function ff(){return 0}function vn(e){return e===null?NaN:+e}var Oo=xt(ve),Ro=Oo.right,cf=Oo.left,af=xt(vn).center,kn=Ro;var Te=class extends Map{constructor(t,o=sf){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:o}}),t!=null)for(let[n,r]of t)this.set(n,r)}get(t){return super.get(Fo(this,t))}has(t){return super.has(Fo(this,t))}set(t,o){return super.set(lf(this,t),o)}delete(t){return super.delete(bf(this,t))}};function Fo({_intern:e,_key:t},o){let n=t(o);return e.has(n)?e.get(n):o}function lf({_intern:e,_key:t},o){let n=t(o);return e.has(n)?e.get(n):(e.set(n,o),o)}function bf({_intern:e,_key:t},o){let n=t(o);return e.has(n)&&(o=e.get(n),e.delete(n)),o}function sf(e){return e!==null&&typeof e=="object"?e.valueOf():e}var uf=Math.sqrt(50),df=Math.sqrt(10),pf=Math.sqrt(2);function yt(e,t,o){let n=(t-e)/Math.max(0,o),r=Math.floor(Math.log10(n)),i=n/Math.pow(10,r),f=i>=uf?10:i>=df?5:i>=pf?2:1,c,a,l;return r<0?(l=Math.pow(10,-r)/f,c=Math.round(e*l),a=Math.round(t*l),c/lt&&--a,l=-l):(l=Math.pow(10,r)*f,c=Math.round(e/l),a=Math.round(t/l),c*lt&&--a),a0))return[];if(e===t)return[e];let n=t=r))return[];let c=i-r+1,a=new Array(c);if(n)if(f<0)for(let l=0;l+e(t)}function xf(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),o=>+e(o)+t}function yf(){return!this.__axis}function wf(e,t){var o=[],n=null,r=null,i=6,f=6,c=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===Sn||e===vt?-1:1,b=e===vt||e===zn?"x":"y",u=e===Sn||e===qn?hf:mf;function s(p){var y=n??(t.ticks?t.ticks.apply(t,o):t.domain()),k=r??(t.tickFormat?t.tickFormat.apply(t,o):jo),q=Math.max(i,0)+c,m=t.range(),A=+m[0]+a,M=+m[m.length-1]+a,N=(t.bandwidth?xf:gf)(t.copy(),a),z=p.selection?p.selection():p,T=z.selectAll(".domain").data([null]),E=z.selectAll(".tick").data(y,t).order(),G=E.exit(),Q=E.enter().append("g").attr("class","tick"),Y=E.select("line"),_=E.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(Q),Y=Y.merge(Q.append("line").attr("stroke","currentColor").attr(b+"2",l*i)),_=_.merge(Q.append("text").attr("fill","currentColor").attr(b,l*q).attr("dy",e===Sn?"0em":e===qn?"0.71em":"0.32em")),p!==z&&(T=T.transition(p),E=E.transition(p),Y=Y.transition(p),_=_.transition(p),G=G.transition(p).attr("opacity",Po).attr("transform",function(P){return isFinite(P=N(P))?u(P+a):this.getAttribute("transform")}),Q.attr("opacity",Po).attr("transform",function(P){var F=this.parentNode.__axis;return u((F&&isFinite(F=F(P))?F:N(P))+a)})),G.remove(),T.attr("d",e===vt||e===zn?f?"M"+l*f+","+A+"H"+a+"V"+M+"H"+l*f:"M"+a+","+A+"V"+M:f?"M"+A+","+l*f+"V"+a+"H"+M+"V"+l*f:"M"+A+","+a+"H"+M),E.attr("opacity",1).attr("transform",function(P){return u(N(P)+a)}),Y.attr(b+"2",l*i),_.attr(b,l*q).text(k),z.filter(yf).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===zn?"start":e===vt?"end":"middle"),z.each(function(){this.__axis=N})}return s.scale=function(p){return arguments.length?(t=p,s):t},s.ticks=function(){return o=Array.from(arguments),s},s.tickArguments=function(p){return arguments.length?(o=p==null?[]:Array.from(p),s):o.slice()},s.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),s):n&&n.slice()},s.tickFormat=function(p){return arguments.length?(r=p,s):r},s.tickSize=function(p){return arguments.length?(i=f=+p,s):i},s.tickSizeInner=function(p){return arguments.length?(i=+p,s):i},s.tickSizeOuter=function(p){return arguments.length?(f=+p,s):f},s.tickPadding=function(p){return arguments.length?(c=+p,s):c},s.offset=function(p){return arguments.length?(a=+p,s):a},s}function Mn(e){return wf(qn,e)}var vf={value:()=>{}};function Lo(){for(var e=0,t=arguments.length,o={},n;e=0&&(n=o.slice(r+1),o=o.slice(0,r)),o&&!t.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:n}})}kt.prototype=Lo.prototype={constructor:kt,on:function(e,t){var o=this._,n=kf(e+"",o),r,i=-1,f=n.length;if(arguments.length<2){for(;++i0)for(var o=new Array(r),n=0,r,i;n=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),An.hasOwnProperty(t)?{space:An[t],local:e}:e}function Sf(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===_t&&t.documentElement.namespaceURI===_t?t.createElement(e):t.createElementNS(o,e)}}function zf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ee(e){var t=le(e);return(t.local?zf:Sf)(t)}function qf(){}function ke(e){return e==null?qf:function(){return this.querySelector(e)}}function Vo(e){typeof e!="function"&&(e=ke(e));for(var t=this._groups,o=t.length,n=new Array(o),r=0;r=M&&(M=A+1);!(z=q[M])&&++M=0;)(f=n[r])&&(i&&f.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(f,i),i=f);return this}function er(e){e||(e=Pf);function t(u,s){return u&&s?e(u.__data__,s.__data__):!u-!s}for(var o=this._groups,n=o.length,r=new Array(n),i=0;it?1:e>=t?0:NaN}function tr(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function nr(){return Array.from(this)}function or(){for(var e=this._groups,t=0,o=e.length;t1?this.each((t==null?Yf:typeof t=="function"?Qf:Gf)(e,t,o??"")):pe(this.node(),e)}function pe(e,t){return e.style.getPropertyValue(t)||qt(e).getComputedStyle(e,null).getPropertyValue(t)}function Uf(e){return function(){delete this[e]}}function Wf(e,t){return function(){this[e]=t}}function Kf(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function lr(e,t){return arguments.length>1?this.each((t==null?Uf:typeof t=="function"?Kf:Wf)(e,t)):this.node()[e]}function br(e){return e.trim().split(/^|\s+/)}function Nn(e){return e.classList||new sr(e)}function sr(e){this._node=e,this._names=br(e.getAttribute("class")||"")}sr.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ur(e,t){for(var o=Nn(e),n=-1,r=t.length;++n=0&&(o=t.slice(n+1),t=t.slice(0,n)),{type:t,name:o}})}function hc(e){return function(){var t=this.__on;if(t){for(var o=0,n=-1,r=t.length,i;o>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?Nt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?Nt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vc.exec(e))?new H(t[1],t[2],t[3],1):(t=kc.exec(e))?new H(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_c.exec(e))?Nt(t[1],t[2],t[3],t[4]):(t=Sc.exec(e))?Nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zc.exec(e))?Rr(t[1],t[2]/100,t[3]/100,1):(t=qc.exec(e))?Rr(t[1],t[2]/100,t[3]/100,t[4]):Nr.hasOwnProperty(e)?Tr(Nr[e]):e==="transparent"?new H(NaN,NaN,NaN,0):null}function Tr(e){return new H(e>>16&255,e>>8&255,e&255,1)}function Nt(e,t,o,n){return n<=0&&(e=t=o=NaN),new H(e,t,o,n)}function $c(e){return e instanceof Je||(e=Z(e)),e?(e=e.rgb(),new H(e.r,e.g,e.b,e.opacity)):new H}function Re(e,t,o,n){return arguments.length===1?$c(e):new H(e,t,o,n??1)}function H(e,t,o,n){this.r=+e,this.g=+t,this.b=+o,this.opacity=+n}$t(H,Re,On(Je,{brighter(e){return e=e==null?Ct:Math.pow(Ct,e),new H(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ke:Math.pow(Ke,e),new H(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new H(Se(this.r),Se(this.g),Se(this.b),Tt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Er,formatHex:Er,formatHex8:Nc,formatRgb:Or,toString:Or}));function Er(){return`#${_e(this.r)}${_e(this.g)}${_e(this.b)}`}function Nc(){return`#${_e(this.r)}${_e(this.g)}${_e(this.b)}${_e((isNaN(this.opacity)?1:this.opacity)*255)}`}function Or(){let e=Tt(this.opacity);return`${e===1?"rgb(":"rgba("}${Se(this.r)}, ${Se(this.g)}, ${Se(this.b)}${e===1?")":`, ${e})`}`}function Tt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Se(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _e(e){return e=Se(e),(e<16?"0":"")+e.toString(16)}function Rr(e,t,o,n){return n<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new K(e,t,o,n)}function jr(e){if(e instanceof K)return new K(e.h,e.s,e.l,e.opacity);if(e instanceof Je||(e=Z(e)),!e)return new K;if(e instanceof K)return e;e=e.rgb();var t=e.r/255,o=e.g/255,n=e.b/255,r=Math.min(t,o,n),i=Math.max(t,o,n),f=NaN,c=i-r,a=(i+r)/2;return c?(t===i?f=(o-n)/c+(o0&&a<1?0:f,new K(f,c,a,e.opacity)}function Pr(e,t,o,n){return arguments.length===1?jr(e):new K(e,t,o,n??1)}function K(e,t,o,n){this.h=+e,this.s=+t,this.l=+o,this.opacity=+n}$t(K,Pr,On(Je,{brighter(e){return e=e==null?Ct:Math.pow(Ct,e),new K(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ke:Math.pow(Ke,e),new K(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,n=o+(o<.5?o:1-o)*t,r=2*o-n;return new H(Rn(e>=240?e-240:e+120,r,n),Rn(e,r,n),Rn(e<120?e+240:e-120,r,n),this.opacity)},clamp(){return new K(Fr(this.h),It(this.s),It(this.l),Tt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Tt(this.opacity);return`${e===1?"hsl(":"hsla("}${Fr(this.h)}, ${It(this.s)*100}%, ${It(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Fr(e){return e=(e||0)%360,e<0?e+360:e}function It(e){return Math.max(0,Math.min(1,e||0))}function Rn(e,t,o){return(e<60?t+(o-t)*e/60:e<180?o:e<240?t+(o-t)*(240-e)/60:t)*255}function Fn(e,t,o,n,r){var i=e*e,f=i*e;return((1-3*e+3*i-f)*t+(4-6*i+3*f)*o+(1+3*e+3*i-3*f)*n+f*r)/6}function Dr(e){var t=e.length-1;return function(o){var n=o<=0?o=0:o>=1?(o=1,t-1):Math.floor(o*t),r=e[n],i=e[n+1],f=n>0?e[n-1]:2*r-i,c=n()=>e;function Ic(e,t){return function(o){return e+o*t}}function Cc(e,t,o){return e=Math.pow(e,o),t=Math.pow(t,o)-e,o=1/o,function(n){return Math.pow(e+n*t,o)}}function Vr(e){return(e=+e)==1?Et:function(t,o){return o-t?Cc(t,o,e):et(isNaN(t)?o:t)}}function Et(e,t){var o=t-e;return o?Ic(e,o):et(isNaN(e)?t:e)}var ze=function e(t){var o=Vr(t);function n(r,i){var f=o((r=Re(r)).r,(i=Re(i)).r),c=o(r.g,i.g),a=o(r.b,i.b),l=Et(r.opacity,i.opacity);return function(b){return r.r=f(b),r.g=c(b),r.b=a(b),r.opacity=l(b),r+""}}return n.gamma=e,n}(1);function Br(e){return function(t){var o=t.length,n=new Array(o),r=new Array(o),i=new Array(o),f,c;for(f=0;fo&&(i=t.slice(o,i),c[f]?c[f]+=i:c[++f]=i),(n=n[0])===(r=r[0])?c[f]?c[f]+=r:c[++f]=r:(c[++f]=null,a.push({i:f,x:L(n,r)})),o=jn.lastIndex;return o180?b+=360:b-l>180&&(l+=360),s.push({i:u.push(r(u)+"rotate(",null,n)-2,x:L(l,b)})):b&&u.push(r(u)+"rotate("+b+n)}function c(l,b,u,s){l!==b?s.push({i:u.push(r(u)+"skewX(",null,n)-2,x:L(l,b)}):b&&u.push(r(u)+"skewX("+b+n)}function a(l,b,u,s,p,y){if(l!==u||b!==s){var k=p.push(r(p)+"scale(",null,",",null,")");y.push({i:k-4,x:L(l,u)},{i:k-2,x:L(b,s)})}else(u!==1||s!==1)&&p.push(r(p)+"scale("+u+","+s+")")}return function(l,b){var u=[],s=[];return l=e(l),b=e(b),i(l.translateX,l.translateY,b.translateX,b.translateY,u,s),f(l.rotate,b.rotate,u,s),c(l.skewX,b.skewX,u,s),a(l.scaleX,l.scaleY,b.scaleX,b.scaleY,u,s),l=b=null,function(p){for(var y=-1,k=s.length,q;++y=0&&e._call.call(void 0,t),e=e._next;--Fe}function ei(){Me=(jt=it.now())+Pt,Fe=ot=0;try{oi()}finally{Fe=0,Vc(),Me=0}}function Lc(){var e=it.now(),t=e-jt;t>ti&&(Pt-=t,jt=e)}function Vc(){for(var e,t=Ft,o,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(o=t._next,t._next=null,t=e?e._next=o:Ft=o);rt=e,Hn(n)}function Hn(e){if(!Fe){ot&&(ot=clearTimeout(ot));var t=e-Me;t>24?(e<1/0&&(ot=setTimeout(ei,e-it.now()-Pt)),nt&&(nt=clearInterval(nt))):(nt||(jt=it.now(),nt=setInterval(Lc,ti)),Fe=1,ni(ei))}}function Lt(e,t,o){var n=new ft;return t=t==null?0:+t,n.restart(r=>{n.stop(),e(r+t)},t,o),n}var Bc=Ge("start","end","cancel","interrupt"),Xc=[],fi=0,ri=1,Bt=2,Vt=3,ii=4,Xt=5,at=6;function he(e,t,o,n,r,i){var f=e.__transition;if(!f)e.__transition={};else if(o in f)return;Hc(e,o,{name:t,index:n,group:r,on:Bc,tween:Xc,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:fi})}function lt(e,t){var o=j(e,t);if(o.state>fi)throw new Error("too late; already scheduled");return o}function V(e,t){var o=j(e,t);if(o.state>Vt)throw new Error("too late; already running");return o}function j(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function Hc(e,t,o){var n=e.__transition,r;n[t]=o,o.timer=Dt(i,0,o.time);function i(l){o.state=ri,o.timer.restart(f,o.delay,o.time),o.delay<=l&&f(l-o.delay)}function f(l){var b,u,s,p;if(o.state!==ri)return a();for(b in n)if(p=n[b],p.name===o.name){if(p.state===Vt)return Lt(f);p.state===ii?(p.state=at,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[b]):+bBt&&n.state=0&&(t=t.slice(0,o)),!t||t==="start"})}function sa(e,t,o){var n,r,i=ba(t)?lt:V;return function(){var f=i(this,e),c=f.on;c!==n&&(r=(n=c).copy()).on(t,o),f.on=r}}function gi(e,t){var o=this._id;return arguments.length<2?j(this.node(),o).on.on(e):this.each(sa(o,e,t))}function ua(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function xi(){return this.on("end.remove",ua(this._id))}function yi(e){var t=this._name,o=this._id;typeof e!="function"&&(e=ke(e));for(var n=this._groups,r=n.length,i=new Array(r),f=0;f=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Ci;let o=10**t;return function(n){this._+=n[0];for(let r=1,i=n.length;rAe)if(!(Math.abs(u*a-l*b)>Ae)||!i)this._append`L${this._x1=t},${this._y1=o}`;else{let p=n-f,y=r-c,k=a*a+l*l,q=p*p+y*y,m=Math.sqrt(k),A=Math.sqrt(s),M=i*Math.tan((Gn-Math.acos((k+s-q)/(2*m*A)))/2),N=M/A,z=M/m;Math.abs(N-1)>Ae&&this._append`L${t+N*b},${o+N*u}`,this._append`A${i},${i},0,0,${+(u*p>b*y)},${this._x1=t+z*a},${this._y1=o+z*l}`}}arc(t,o,n,r,i,f){if(t=+t,o=+o,n=+n,f=!!f,n<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(r),a=n*Math.sin(r),l=t+c,b=o+a,u=1^f,s=f?r-i:i-r;this._x1===null?this._append`M${l},${b}`:(Math.abs(this._x1-l)>Ae||Math.abs(this._y1-b)>Ae)&&this._append`L${l},${b}`,n&&(s<0&&(s=s%Qn+Qn),s>Aa?this._append`A${n},${n},0,1,${u},${t-c},${o-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=b}`:s>Ae&&this._append`A${n},${n},0,${+(s>=Gn)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=o+n*Math.sin(i)}`)}rect(t,o,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+o}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Ti(){return new $e}Ti.prototype=$e.prototype;function Ei(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ne(e,t){if((o=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var o,n=e.slice(0,o);return[n.length>1?n[0]+n.slice(2):n,+e.slice(o+1)]}function oe(e){return e=Ne(Math.abs(e)),e?e[1]:NaN}function Oi(e,t){return function(o,n){for(var r=o.length,i=[],f=0,c=e[0],a=0;r>0&&c>0&&(a+c+1>n&&(c=Math.max(1,n-a)),i.push(o.substring(r-=c,r+c)),!((a+=c+1)>n));)c=e[f=(f+1)%e.length];return i.reverse().join(t)}}function Ri(e){return function(t){return t.replace(/[0-9]/g,function(o){return e[+o]})}}var Na=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ge(e){if(!(t=Na.exec(e)))throw new Error("invalid format: "+e);var t;return new Qt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ge.prototype=Qt.prototype;function Qt(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Qt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Fi(e){e:for(var t=e.length,o=1,n=-1,r;o0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(r+1):e}var Un;function ji(e,t){var o=Ne(e,t);if(!o)return e+"";var n=o[0],r=o[1],i=r-(Un=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,f=n.length;return i===f?n:i>f?n+new Array(i-f+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Ne(e,Math.max(0,t+i-1))[0]}function Wn(e,t){var o=Ne(e,t);if(!o)return e+"";var n=o[0],r=o[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}var Kn={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ei,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Wn(e*100,t),r:Wn,s:ji,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Zn(e){return e}var Pi=Array.prototype.map,Di=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Li(e){var t=e.grouping===void 0||e.thousands===void 0?Zn:Oi(Pi.call(e.grouping,Number),e.thousands+""),o=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Zn:Ri(Pi.call(e.numerals,String)),f=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"\u2212":e.minus+"",a=e.nan===void 0?"NaN":e.nan+"";function l(u){u=ge(u);var s=u.fill,p=u.align,y=u.sign,k=u.symbol,q=u.zero,m=u.width,A=u.comma,M=u.precision,N=u.trim,z=u.type;z==="n"?(A=!0,z="g"):Kn[z]||(M===void 0&&(M=12),N=!0,z="g"),(q||s==="0"&&p==="=")&&(q=!0,s="0",p="=");var T=k==="$"?o:k==="#"&&/[boxX]/.test(z)?"0"+z.toLowerCase():"",E=k==="$"?n:/[%p]/.test(z)?f:"",G=Kn[z],Q=/[defgprs%]/.test(z);M=M===void 0?6:/[gprs]/.test(z)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function Y(_){var P=T,F=E,d,g,h;if(z==="c")F=G(_)+F,_="";else{_=+_;var x=_<0||1/_<0;if(_=isNaN(_)?a:G(Math.abs(_),M),N&&(_=Fi(_)),x&&+_==0&&y!=="+"&&(x=!1),P=(x?y==="("?y:c:y==="-"||y==="("?"":y)+P,F=(z==="s"?Di[8+Un/3]:"")+F+(x&&y==="("?")":""),Q){for(d=-1,g=_.length;++dh||h>57){F=(h===46?r+_.slice(d+1):_.slice(d))+F,_=_.slice(0,d);break}}}A&&!q&&(_=t(_,1/0));var v=P.length+_.length+F.length,w=v>1)+P+_+F+w.slice(v);break;default:_=w+P+_+F;break}return i(_)}return Y.toString=function(){return u+""},Y}function b(u,s){var p=l((u=ge(u),u.type="f",u)),y=Math.max(-8,Math.min(8,Math.floor(oe(s)/3)))*3,k=Math.pow(10,-y),q=Di[8+y/3];return function(m){return p(k*m)+q}}return{format:l,formatPrefix:b}}var Ut,Pe,Wt;Jn({thousands:",",grouping:[3],currency:["$",""]});function Jn(e){return Ut=Li(e),Pe=Ut.format,Wt=Ut.formatPrefix,Ut}function eo(e){return Math.max(0,-oe(Math.abs(e)))}function to(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(oe(t)/3)))*3-oe(Math.abs(e)))}function no(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,oe(t)-oe(e))+1}function Kt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var oo=Symbol("implicit");function bt(){var e=new Te,t=[],o=[],n=oo;function r(i){let f=e.get(i);if(f===void 0){if(n!==oo)return n;e.set(i,f=t.push(i)-1)}return o[f%o.length]}return r.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Te;for(let f of i)e.has(f)||e.set(f,t.push(f)-1);return r},r.range=function(i){return arguments.length?(o=Array.from(i),r):o.slice()},r.unknown=function(i){return arguments.length?(n=i,r):n},r.copy=function(){return bt(t,o).unknown(n)},Kt.apply(r,arguments),r}function ro(e){return function(){return e}}function io(e){return+e}var Vi=[0,1];function De(e){return e}function fo(e,t){return(t-=e=+e)?function(o){return(o-e)/t}:ro(isNaN(t)?NaN:.5)}function Ia(e,t){var o;return e>t&&(o=e,e=t,t=o),function(n){return Math.max(e,Math.min(t,n))}}function Ca(e,t,o){var n=e[0],r=e[1],i=t[0],f=t[1];return r2?Ta:Ca,a=l=null,u}function u(s){return s==null||isNaN(s=+s)?i:(a||(a=c(e.map(n),t,o)))(n(f(s)))}return u.invert=function(s){return f(r((l||(l=c(t,e.map(n),L)))(s)))},u.domain=function(s){return arguments.length?(e=Array.from(s,io),b()):e.slice()},u.range=function(s){return arguments.length?(t=Array.from(s),b()):t.slice()},u.rangeRound=function(s){return t=Array.from(s),o=Dn,b()},u.clamp=function(s){return arguments.length?(f=s?!0:De,b()):f!==De},u.interpolate=function(s){return arguments.length?(o=s,b()):o},u.unknown=function(s){return arguments.length?(i=s,u):i},function(s,p){return n=s,r=p,b()}}function co(){return Ea()(De,De)}function ao(e,t,o,n){var r=_n(e,t,o),i;switch(n=ge(n??",f"),n.type){case"s":{var f=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=to(r,f))&&(n.precision=i),Wt(n,f)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=no(r,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=eo(r))&&(n.precision=i-(n.type==="%")*2);break}}return Pe(n)}function Oa(e){var t=e.domain;return e.ticks=function(o){var n=t();return wt(n[0],n[n.length-1],o??10)},e.tickFormat=function(o,n){var r=t();return ao(r[0],r[r.length-1],o??10,n)},e.nice=function(o){o==null&&(o=10);var n=t(),r=0,i=n.length-1,f=n[r],c=n[i],a,l,b=10;for(c0;){if(l=Ye(f,c,o),l===a)return n[r]=f,n[i]=c,t(n);if(l>0)f=Math.floor(f/l)*l,c=Math.ceil(c/l)*l;else if(l<0)f=Math.ceil(f*l)/l,c=Math.floor(c*l)/l;else break;a=l}return e},e}function st(){var e=co();return e.copy=function(){return Bi(e,st())},Kt.apply(e,arguments),Oa(e)}function Ie(e){return function(){return e}}function Xi(e){let t=3;return e.digits=function(o){if(!arguments.length)return t;if(o==null)t=null;else{let n=Math.floor(o);if(!(n>=0))throw new RangeError(`invalid digits: ${o}`);t=n}return e},()=>new $e(t)}var Am=Array.prototype.slice;function Hi(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yi(e){this._context=e}Yi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Gi(e){return new Yi(e)}function Qi(e){return e[0]}function Ui(e){return e[1]}function lo(e,t){var o=Ie(!0),n=null,r=Gi,i=null,f=Xi(c);e=typeof e=="function"?e:e===void 0?Qi:Ie(e),t=typeof t=="function"?t:t===void 0?Ui:Ie(t);function c(a){var l,b=(a=Hi(a)).length,u,s=!1,p;for(n==null&&(i=r(p=f())),l=0;l<=b;++l)!(l()=>e;function uo(e,{sourceEvent:t,target:o,transform:n,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:r}})}function J(e,t,o){this.k=e,this.x=t,this.y=o}J.prototype={constructor:J,scale:function(e){return e===1?this:new J(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new J(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var dt=new J(1,0,0);po.prototype=J.prototype;function po(e){for(;!e.__zoom;)if(!(e=e.parentNode))return dt;return e.__zoom}function Jt(e){e.stopImmediatePropagation()}function Le(e){e.preventDefault(),e.stopImmediatePropagation()}function Fa(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ja(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ef(){return this.__zoom||dt}function Pa(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Da(){return navigator.maxTouchPoints||"ontouchstart"in this}function La(e,t,o){var n=e.invertX(t[0][0])-o[0][0],r=e.invertX(t[1][0])-o[1][0],i=e.invertY(t[0][1])-o[0][1],f=e.invertY(t[1][1])-o[1][1];return e.translate(r>n?(n+r)/2:Math.min(0,n)||Math.max(0,r),f>i?(i+f)/2:Math.min(0,i)||Math.max(0,f))}function ho(){var e=Fa,t=ja,o=La,n=Pa,r=Da,i=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],c=250,a=Xn,l=Ge("start","zoom","end"),b,u,s,p=500,y=150,k=0,q=10;function m(d){d.property("__zoom",ef).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",Q).on("dblclick.zoom",Y).filter(r).on("touchstart.zoom",_).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(d,g,h,x){var v=d.selection?d.selection():d;v.property("__zoom",ef),d!==v?z(d,g,h,x):v.interrupt().each(function(){T(this,arguments).event(x).start().zoom(null,typeof g=="function"?g.apply(this,arguments):g).end()})},m.scaleBy=function(d,g,h,x){m.scaleTo(d,function(){var v=this.__zoom.k,w=typeof g=="function"?g.apply(this,arguments):g;return v*w},h,x)},m.scaleTo=function(d,g,h,x){m.transform(d,function(){var v=t.apply(this,arguments),w=this.__zoom,S=h==null?N(v):typeof h=="function"?h.apply(this,arguments):h,$=w.invert(S),C=typeof g=="function"?g.apply(this,arguments):g;return o(M(A(w,C),S,$),v,f)},h,x)},m.translateBy=function(d,g,h,x){m.transform(d,function(){return o(this.__zoom.translate(typeof g=="function"?g.apply(this,arguments):g,typeof h=="function"?h.apply(this,arguments):h),t.apply(this,arguments),f)},null,x)},m.translateTo=function(d,g,h,x,v){m.transform(d,function(){var w=t.apply(this,arguments),S=this.__zoom,$=x==null?N(w):typeof x=="function"?x.apply(this,arguments):x;return o(dt.translate($[0],$[1]).scale(S.k).translate(typeof g=="function"?-g.apply(this,arguments):-g,typeof h=="function"?-h.apply(this,arguments):-h),w,f)},x,v)};function A(d,g){return g=Math.max(i[0],Math.min(i[1],g)),g===d.k?d:new J(g,d.x,d.y)}function M(d,g,h){var x=g[0]-h[0]*d.k,v=g[1]-h[1]*d.k;return x===d.x&&v===d.y?d:new J(d.k,x,v)}function N(d){return[(+d[0][0]+ +d[1][0])/2,(+d[0][1]+ +d[1][1])/2]}function z(d,g,h,x){d.on("start.zoom",function(){T(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(x).end()}).tween("zoom",function(){var v=this,w=arguments,S=T(v,w).event(x),$=t.apply(v,w),C=h==null?N($):typeof h=="function"?h.apply(v,w):h,ee=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),D=v.__zoom,U=typeof g=="function"?g.apply(v,w):g,ie=a(D.invert(C).concat(ee/D.k),U.invert(C).concat(ee/U.k));return function(W){if(W===1)W=U;else{var fe=ie(W),rn=ee/fe[2];W=new J(rn,C[0]-fe[0]*rn,C[1]-fe[1]*rn)}S.zoom(null,W)}})}function T(d,g,h){return!h&&d.__zooming||new E(d,g)}function E(d,g){this.that=d,this.args=g,this.active=0,this.sourceEvent=null,this.extent=t.apply(d,g),this.taps=0}E.prototype={event:function(d){return d&&(this.sourceEvent=d),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(d,g){return this.mouse&&d!=="mouse"&&(this.mouse[1]=g.invert(this.mouse[0])),this.touch0&&d!=="touch"&&(this.touch0[1]=g.invert(this.touch0[0])),this.touch1&&d!=="touch"&&(this.touch1[1]=g.invert(this.touch1[0])),this.that.__zoom=g,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(d){var g=R(this.that).datum();l.call(d,this.that,new uo(d,{sourceEvent:this.sourceEvent,target:m,type:d,transform:this.that.__zoom,dispatch:l}),g)}};function G(d,...g){if(!e.apply(this,arguments))return;var h=T(this,g).event(d),x=this.__zoom,v=Math.max(i[0],Math.min(i[1],x.k*Math.pow(2,n.apply(this,arguments)))),w=se(d);if(h.wheel)(h.mouse[0][0]!==w[0]||h.mouse[0][1]!==w[1])&&(h.mouse[1]=x.invert(h.mouse[0]=w)),clearTimeout(h.wheel);else{if(x.k===v)return;h.mouse=[w,x.invert(w)],me(this),h.start()}Le(d),h.wheel=setTimeout(S,y),h.zoom("mouse",o(M(A(x,v),h.mouse[0],h.mouse[1]),h.extent,f));function S(){h.wheel=null,h.end()}}function Q(d,...g){if(s||!e.apply(this,arguments))return;var h=d.currentTarget,x=T(this,g,!0).event(d),v=R(d.view).on("mousemove.zoom",C,!0).on("mouseup.zoom",ee,!0),w=se(d,h),S=d.clientX,$=d.clientY;Tn(d.view),Jt(d),x.mouse=[w,this.__zoom.invert(w)],me(this),x.start();function C(D){if(Le(D),!x.moved){var U=D.clientX-S,ie=D.clientY-$;x.moved=U*U+ie*ie>k}x.event(D).zoom("mouse",o(M(x.that.__zoom,x.mouse[0]=se(D,h),x.mouse[1]),x.extent,f))}function ee(D){v.on("mousemove.zoom mouseup.zoom",null),En(D.view,x.moved),Le(D),x.event(D).end()}}function Y(d,...g){if(e.apply(this,arguments)){var h=this.__zoom,x=se(d.changedTouches?d.changedTouches[0]:d,this),v=h.invert(x),w=h.k*(d.shiftKey?.5:2),S=o(M(A(h,w),x,v),t.apply(this,g),f);Le(d),c>0?R(this).transition().duration(c).call(z,S,x,d):R(this).call(m.transform,S,x,d)}}function _(d,...g){if(e.apply(this,arguments)){var h=d.touches,x=h.length,v=T(this,g,d.changedTouches.length===x).event(d),w,S,$,C;for(Jt(d),S=0;S{let t=class t{get div(){return this.root.nativeElement}get width(){return this.div.offsetWidth}get margin(){let{"margin-top":n,"margin-right":r,"margin-bottom":i,"margin-left":f}=this.settings;return{top:n,right:r,bottom:i,left:f}}constructor(){this.initialize$=new ce(1),this.initialized$=this.initialize$.pipe(B(n=>this.root=n),O(()=>{let n=Cn("svg"),r=n.node();if(r)this.div.append(r);else throw new Error("Could not create SVG node");return n}),B(n=>this.svg=n),B(n=>{this.clip=n.append("defs").append("clipPath").attr("id","clip").append("rect");let r=n.append("g").attr("class","focus");this.draw=r.append("g").attr("class","features").attr("clip-path","url(#clip)"),this.zoom=ho(),this.events=r.append("rect").attr("class","zoom").style("fill","none").style("pointer-events","all").lower(),r.call(this.zoom)}),B(n=>{let r=n.append("g").attr("class","x axis"),i=n.append("g").attr("class","y axis");this.axes={x:r,y:i}}),B(()=>this.scale={x:st(),y:bt()}),xe(1))}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=te({token:t,factory:t.\u0275fac,providedIn:"platform"});let e=t;return e})();var Ve=(()=>{let t=class t{constructor(){this._traces=new Map,this._parent=new Map,this._children=new Map}set hierarchy(n){this.setHierarchy(n)}get traces(){return this._traces}get features(){let n=this.traces,r=new Map;for(let i of n.values())for(let[f,c]of Object.entries(i.values))r.set(`trace-${i.id}-feature-${f}`,c);return r}setHierarchy(n){let r=0,i=[...n];for(;i.length>0;){let[f]=i.splice(0,1),c=f.nested||[],a=new Array;for(let u of[f,...c]){let s=u.type==="trace"?u:{type:"trace",values:[u],label:u.label,id:void 0,expanded:void 0};s.values=s.values.sort((p,y)=>p.type!=="continuous"?-1:y.type!=="continuous"?1:0),s.id=s.id!==void 0?s.id:r++,s.expanded=s.expanded!==!1,this._traces.set(s.id,s),a.push(s)}let l=a[0],b=a.slice(1);b.forEach(u=>this._parent.set(u,l.id)),this._children.set(l,b.map(u=>u.id)),i=[...a.slice(1),...i]}}getTrace(n){return this.traces.get(n)}getParent(n){let r=this._parent.get(n);return r&&this._traces.get(r)}getBranch(n){let r=[],i=[n];for(;i.length>0;){let f=i.pop();r.push(f);let c=this.getChildren(f);i.push(...c)}return r}getChildren(n){return(this._children.get(n)||[]).map(i=>this._traces.get(i))}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=te({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function nf(e,t,o){e.attr("height",t.height).attr("width",t.width).attr("y",o.top).attr("x",o.left)}var tn=(()=>{let t=class t{get svg(){return this.initializeService.svg}get div(){return this.initializeService.div}get height(){return this.div.offsetHeight}get width(){return this.div.offsetWidth}get margin(){return this.initializeService.margin}get scale(){return this.initializeService.scale}get axes(){return this.initializeService.axes}constructor(n){this.initializeService=n,this.resize$=new ce(1);let r=this.resize$.pipe(O(()=>({width:this.width,height:this.height})),yo((i,f)=>i.width===f.width),O(()=>{}),ht(void 0));this.resized$=r.pipe(O(()=>this.updateRoot()),O(()=>this.updateDraw()),O(()=>this.updateAxes()),O(()=>this.updateRangeX()),O(()=>this.updateRangeY()))}updateRoot(){let{y:n}=this.scale,i=n.range().at(-1)+this.margin.bottom,f=this.width;this.svg.attr("height",i).attr("width",f)}updateDraw(){let n={width:0,height:0};n.height=this.height-this.margin.top-this.margin.bottom,n.width=this.width-this.margin.left-this.margin.right,nf(this.initializeService.clip,n,this.margin),nf(this.initializeService.events,n,this.margin)}updateAxes(){let{x:n,y:r}=this.axes;n.attr("transform",`translate(0, ${this.height-this.margin.top})`),r.attr("transform",`translate(${this.margin.left}, 0)`)}updateRangeX(){let n=this.scale.x,r=this.width,{left:i,right:f}=this.margin;n.range([i,r-f])}updateRangeY(){}};t.\u0275fac=function(r){return new(r||t)(ye(re))},t.\u0275prov=te({token:t,factory:t.\u0275fac,providedIn:"platform"});let e=t;return e})();var nn=(()=>{let t=class t{constructor(n){this.initService=n,this.zoom$=new ce(1);let i=this.initService.initialized$.pipe(O(()=>this._scale={x:this.initService.scale.x.copy(),y:this.initService.scale.y.copy()}),xe(1)).pipe(ae(()=>this.zoom$),O(f=>{let{x:c}=this._scale,{x:a}=this.initService.scale,l=f.transform.rescaleX(c),[b,u]=l.domain();return a.domain([b,u]),this.initService.scale}),ht(this.initService.scale));this.zoomed$=i.pipe(O(()=>{let f=this.initService.axes,c=this.initService.scale,a=c.x.ticks().filter(b=>Number.isInteger(b)).slice(1,-1),l=Mn(c.x).tickValues(a).tickFormat(Pe(".0f"));f.x.call(l)}))}};t.\u0275fac=function(r){return new(r||t)(ye(re))},t.\u0275prov=te({token:t,factory:t.\u0275fac,providedIn:"platform"});let e=t;return e})();var of={H:"blue",K:"blue",R:"blue",D:"red",E:"red",S:"green",T:"green",N:"green",Q:"green",A:"white",V:"white",L:"white",I:"white",M:"white",F:"magenta",W:"magenta",Y:"magenta",P:"brown",G:"brown",C:"yellow",B:"grey",Z:"grey",X:"grey","-":"grey"},Dg=parseFloat(getComputedStyle(document.documentElement).fontSize),go=e=>e.id,xo=(e,t)=>t,on=(()=>{let t=class t{constructor(n,r){this.initializeService=n,this.featuresService=r,this.traces$=new ce(1),this.sequence$=new ce(1),this["char.width"]=0,this.draw$=this.sequence$.pipe(B(i=>{let f=this.initializeService.scale.x,c=[0,i.length+1];f.domain(c)}),O(i=>this.createSequence(i)),B(()=>{let f=this.initializeService.settings["content-size"]/3;this.tooltip=R(this.initializeService.div).append("div").attr("class","tooltip").style("position","absolute").style("display","none").style("opacity",1).style("color","black").style("padding",".25rem").style("background-color","white").style("border","solid").style("border-width","1px").style("border-radius",f+"px")}),xe(1),ae(()=>this.traces$),B(i=>this.updateScale(i)),B(i=>this.createLabels(i)),B(i=>this.createGrid(i)),B(i=>this.createTraces(i)),xe(1)),this.drawn$=this.draw$.pipe(O(()=>this.updateSequence()),O(()=>this.updateGrid()),O(()=>this.updateLabels()),O(()=>this.updateTraces()))}updateScale(n){let r=this.initializeService.scale.y,i=["sequence",...n.map(({id:c})=>c+"")],f=i.reduce((c,a,l)=>{if(l===0&&a==="sequence"){let u=this.initializeService.settings["line-height"],s=this.initializeService.settings["margin-top"];return[s,s+u]}let b=this.featuresService.getTrace(+a);if(b){let u=c.at(-1),s=b["line-height"]||this.initializeService.settings["line-height"];return b.position==="dodge"&&(s=b.values.reduce((p,y)=>p+(y["line-height"]||this.initializeService.settings["line-height"]),0)),[...c,u+s]}throw new Error("Trace not found")},[]);r.domain(i).range(f)}createSequence(n){let r=c=>of[c]||of.X,i=this.initializeService.draw.selectAll("g.sequence").data([n]).join("g").attr("class","sequence");this["group.residues"]=i.selectAll("g.residue").data(n).join("g").attr("id",(c,a)=>`residue-${a+1}`).attr("class","residue"),this["group.residues"].append("rect").attr("class","color").attr("fill",c=>r(c)).attr("fill-opacity",.1);let f=0;this["group.residues"].append("text").attr("class","name").text(c=>""+c).each(function(){f=Math.max(f,this.getBBox().width)}),this["char.width"]=f}updateSequence(){let n=this.initializeService.margin,{x:r,y:i}=this.initializeService.scale,{"line-height":f}=this.initializeService.settings,c=r(1)-r(0),a=this["char.width"],{"group.residues":l}=this;l.select("rect.color").attr("x",(b,u)=>r(u+.5)).attr("y",n.top).attr("width",()=>c).attr("height","100%"),l.select("text.name").attr("x",(b,u)=>r(u+1)).attr("y",i("sequence")+f/2).attr("width",()=>c).attr("height",f).attr("dominant-baseline","central").style("text-anchor","middle").attr("fill",this.initializeService.settings["text-color"]).attr("opacity",()=>a>c?0:1)}createLabels(n){let{y:r}=this.initializeService.scale,i=this.initializeService.settings,{left:f}=this.initializeService.margin,c=this.initializeService.svg.selectAll("g.labels").data([n],xo).join("g").attr("class","labels");this["group.labels"]=c.selectAll("g.label").data([{id:"sequence",label:"Sequence",expanded:!0},...n],go).join(a=>{let l=a.append("g").attr("id",b=>"label-"+b.id).attr("class","label");return l.each(b=>{let u=""+b.id,s=this.initializeService.div.querySelector("div#label-"+u);s&&(s.style.position="absolute",s.style.left="0px",s.style.overflow="hidden",s.style.top=r(u)+"px",s.style.height=(b["line-height"]||i["line-height"])+"px",s.style.width=f+"px")}),l},a=>a,a=>(a.each(l=>{let b=l.id,u=this.initializeService.div.querySelector("div#label-"+b);u&&(u.style.display="none")}),a)),this["group.labels"].each(a=>{let l=""+a.id,b=this.initializeService.div.querySelector("div#label-"+l);b&&(b.style.position="absolute",b.style.overflow="hidden",b.style.left="0px",b.style.top=r(l)+"px",b.style.display="block",b.style.height=(a["line-height"]||i["line-height"])+"px",b.style.width=f+"px")}),this["group.labels"].selectAll("rect").data(a=>[a],xo).join("rect").attr("height",a=>a["line-height"]||i["line-height"]).attr("width",()=>f).attr("fill","none")}updateLabels(){let n=this.initializeService.scale.y,r=this.initializeService.settings;this["group.labels"].select("rect").attr("y",i=>n(String(i.id))).attr("x",0),this["group.labels"].select("text").attr("y",i=>{let f=n(String(i.id)),c=i["line-height"]||r["line-height"];return f+c/2}).attr("x",0).attr("dominant-baseline","central").attr("fill",i=>i["text-color"]||r["text-color"])}createGrid(n){let r=this.initializeService.svg.selectAll("g.grid").data([n],xo).join("g").attr("class","grid").lower();this["group.grid"]=r.selectAll("rect.grid-line").data(n,go).join("rect").attr("id",i=>"grid-"+i.id).attr("class","grid-line")}updateGrid(){let n=this.initializeService.scale.y,r=this.initializeService.width,i=this.initializeService.margin,f=this.initializeService.settings;this["group.grid"].attr("x",i.left).attr("y",c=>{let a=c.values[c.values.length-1],l=n(""+c.id),b=a["line-height"]||c["line-height"]||f["line-height"],u=a["content-size"]||c["content-size"]||f["content-size"];return a.type!=="continuous"?l+b/2-.5:l+b/2-u/2}).attr("width",r-i.left-i.right).attr("height",c=>{let a=c.values[c.values.length-1];return a.type==="continuous"?a["content-size"]||c["content-size"]||f["content-size"]:1}).attr("fill",this.initializeService.settings["grid-color"])}createTraces(n){let r=this.initializeService.settings,i=this.tooltip;this["group.traces"]=this.initializeService.draw.selectAll("g.trace").data(n,go).join("g").attr("id",f=>"trace-"+f.id).attr("class","trace"),this["group.traces"].each(function(f){let a=R(this).selectAll("g.feature").data(f.values);a.enter().append("g").attr("class",l=>"feature "+l.type).attr("id",(l,b)=>`trace-${f.id}-feature-${b}`).each(function(l,b){l.type==="loci"&&l.values.forEach((u,s)=>{let p=(l["content-size"]||f["content-size"]||r["content-size"])/3,y=R(this).append("rect").attr("stroke",l["trace-color"]||f["trace-color"]||r["trace-color"]).attr("stroke-opacity",1).attr("stroke-width",1).attr("fill",l["trace-color"]||f["trace-color"]||r["trace-color"]).attr("fill-opacity",.5).attr("rx",p).attr("ry",p);y.data([u]),y.on("mouseover",k=>Xa(k,i,f,pt(Be({},l),{index:b}),s,u)),y.on("mousemove",k=>Ha(k,i,f,pt(Be({},l),{index:b}),s,u)),y.on("mouseleave",k=>Ya(k,i,f,pt(Be({},l),{index:b}),s,u))}),l.type==="continuous"&&R(this).append("path").attr("stroke",l["trace-color"]||f["trace-color"]||r["trace-color"]).attr("stroke-opacity",1).attr("stroke-width",2).attr("fill","none").data([l.values])}),a.exit().remove()})}updateTraces(){let n=this.initializeService.scale,r=this.initializeService.settings;this["group.traces"].each(function(i){R(this).selectAll("g.feature").each(function(a){let l=n.y(""+i.id),b=a["line-height"]||i["line-height"]||r["line-height"],u=a["line-height"]||i["content-size"]||r["content-size"];if(a.type==="loci"){let s=n.x(1)-n.x(0);R(this).selectAll("rect").attr("x",p=>n.x(p.start-.5)).attr("y",l+b/2-u/2).attr("height",u).attr("width",p=>s*(p.end-p.start+1))}if(a.type==="continuous"){let s=a.values,p=a.min!==void 0?a.min:Math.min(...a.values),y=a.max!==void 0?a.max:Math.max(...a.values),k=s.map((m,A)=>[A+1,1-(m-p)/(y-p)]),q=lo().curve(so).x(([m])=>n.x(m)).y(([,m])=>l+b/2-(u-2)/2+(u-2)*m);R(this).select("path").attr("d",q(k))}})})}onLabelClick(n){n.expanded=n.expanded===!1;let r=Array.from(this.featuresService.traces.values()),i=[];for(let c of r){let{expanded:a}=Be({expanded:!0},c);if(a!==!0){let l=this.featuresService.getBranch(c).slice(1);i.push(...l)}}let f=r.filter(c=>!i.includes(c));this.traces$.next(f),console.log("Trace",n)}};t.\u0275fac=function(r){return new(r||t)(ye(re),ye(Ve))},t.\u0275prov=te({token:t,factory:t.\u0275fac,providedIn:"platform"});let e=t;return e})();function Xa(e,t,o,n,r,i){t.style("display","block"),t.style("opacity",1)}function Ha(e,t,o,n,r,i){if(n.type==="loci"){let f=i;t.html(`Trace: ${o.id}
Feature: ${n.index}
Index: ${r}
Value: ${f.start!==f.end?f.start+"-"+f.end:f.start}`)}n.type==="continuous"&&t.html(`Trace: ${o.id}
Feature: ${n.index}
Index: ${r}
Value: ${i}`),t.style("left",e.offsetX+10+"px").style("top",e.offsetY+10+"px")}function Ya(e,t,o,n,r,i){t.style("opacity",0),t.style("display","none")}var Qa=["root"],rf=e=>({trace:e});function Ua(e,t){if(e&1){let o=Mo();mt(0,"div",3),dn("click",function(){let r=fn(o).$implicit,i=we(2);return cn(i.drawService.onLabelClick(r.value))})("keyup",function(){let r=fn(o).$implicit,i=we(2);return cn(i.drawService.onLabelClick(r.value))}),un(1,4),gt()}if(e&2){let o=t.$implicit,n=we(2);He("id","label-left-"+o.key),Xe(),He("ngTemplateOutlet",n.labelLeft.templateRef)("ngTemplateOutletContext",mn(3,rf,o.value))}}function Wa(e,t){if(e&1&&(bn(0,Ua,2,5,"div",2,ln),gn(2,"keyvalue")),e&2){let o=we();sn(xn(2,0,o.featuresService.traces))}}function Ka(e,t){if(e&1&&(mt(0,"div",2),un(1,4),gt()),e&2){let o=t.$implicit,n=we(2);He("id","label-right-"+o.key),Xe(),He("ngTemplateOutlet",n.labelRight.templateRef)("ngTemplateOutletContext",mn(3,rf,o.value))}}function Za(e,t){if(e&1&&(bn(0,Ka,2,5,"div",2,ln),gn(2,"keyvalue")),e&2){let o=we();sn(xn(2,0,o.featuresService.traces))}}var Ja=(()=>{let t=class t{set settings(n){this.initService.settings=n}set features(n){this.featuresService.hierarchy=n;let r=Array.from(this.featuresService.traces.values());this.traces$.next(r)}constructor(n,r,i,f,c){this.featuresService=n,this.initService=r,this.resizeService=i,this.zoomService=f,this.drawService=c,this.traces$=this.drawService.traces$,this.sequence$=this.drawService.sequence$,this.update$=this.initService.initialized$.pipe(ae(()=>this.drawService.draw$),ae(()=>this.resizeService.resized$),B(()=>{let{left:a,right:l,bottom:b}=this.resizeService.margin,u=this.resizeService.height,s=this.resizeService.width,p=this.sequence.length+1;this.initService.zoom.translateExtent([[a,0],[s-l,u-b]]).scaleExtent([1,p/5]).extent([[a,0],[s-l,u-b]]).on("zoom",y=>{this.zoomService.zoom$.next(y)})}),ae(()=>this.zoomService.zoomed$),ae(()=>this.drawService.drawn$)),this._update=this.update$.subscribe()}ngOnChanges(n){n&&n.sequence&&this.sequence$.next(this.sequence)}ngAfterContentInit(){this.labels&&this.labels.forEach(n=>{if(this.labelLeft&&this.labelRight)throw new Error("Only one label can be defined");n.where==="left"&&(this.labelLeft=n),n.where==="right"&&(this.labelRight=n)})}ngAfterViewInit(){this.initService.initialize$.next(this._root)}ngOnDestroy(){this._update.unsubscribe()}onResize(n){this.resizeService.resize$.next(n)}};t.\u0275fac=function(r){return new(r||t)(de(Ve),de(re),de(tn),de(nn),de(on))},t.\u0275cmp=vo({type:t,selectors:[["ngx-features-viewer"]],contentQueries:function(r,i,f){if(r&1&&Ao(f,yn,4),r&2){let c;pn(c=hn())&&(i.labels=c)}},viewQuery:function(r,i){if(r&1&&$o(Qa,5),r&2){let f;pn(f=hn())&&(i._root=f.first)}},hostBindings:function(r,i){r&1&&dn("resize",function(c){return i.onResize(c)},!1,So)},inputs:{settings:"settings",features:"features",sequence:"sequence"},standalone:!0,features:[No([re,Ve,tn,on,nn]),_o,Io],decls:4,vars:2,consts:[["root",""],[2,"position","relative","display","block","width","100%","height","100%"],["tabindex","0",3,"id"],["tabindex","0",3,"click","keyup","id"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,i){r&1&&(mt(0,"div",1,0),qo(2,Wa,3,2)(3,Za,3,2),gt()),r&2&&(Xe(2),an(2,i.labelLeft?2:-1),Xe(),an(3,i.labelRight?3:-1))},dependencies:[Eo,Co,To],styles:[`@charset "UTF-8";.labels #label-sequence .parent div{cursor:default}.labels #label-sequence .parent div i{display:none}.labels .label .children-0>i{visibility:hidden}.labels .label i:before{transition:transform .4s}.labels .label.active i:before{transform:roate(0deg)}.labels .label:not(.active) i:before{transform:rotate(-90deg)}.labels .label div{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;align-items:center;box-sizing:border-box;height:100%;width:100%;cursor:pointer}.labels .label div span{text-wrap:wrap;line-break:anywhere;flex-shrink:1;flex-grow:1}.labels .label div i{flex-shrink:0;flex-grow:0}.labels div.depth-0{width:100%;padding:0 .25rem 0 .75rem}.labels div.depth-1{width:100%;padding:0 .25rem 0 1.5rem}.labels div.depth-2{width:100%;padding:0 .25rem 0 2.25rem}.labels div.depth-3{width:100%;padding:0 .25rem 0 3rem}.labels div.depth-4{width:100%;padding:0 .25rem 0 3.75rem}.labels div.depth-5{width:100%;padding:0 .25rem 0 4.5rem}@font-face{font-display:block;font-family:bootstrap-icons;src:url("./media/bootstrap-icons-X6UQXWUS.woff2") format("woff2"),url("./media/bootstrap-icons-OCU552PF.woff") format("woff")}.bi:before,[class^=bi-]:before,[class*=" bi-"]:before{display:inline-block;font-family:bootstrap-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;line-height:1;vertical-align:-.125em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bi-123:before{content:"\\f67f"}.bi-alarm-fill:before{content:"\\f101"}.bi-alarm:before{content:"\\f102"}.bi-align-bottom:before{content:"\\f103"}.bi-align-center:before{content:"\\f104"}.bi-align-end:before{content:"\\f105"}.bi-align-middle:before{content:"\\f106"}.bi-align-start:before{content:"\\f107"}.bi-align-top:before{content:"\\f108"}.bi-alt:before{content:"\\f109"}.bi-app-indicator:before{content:"\\f10a"}.bi-app:before{content:"\\f10b"}.bi-archive-fill:before{content:"\\f10c"}.bi-archive:before{content:"\\f10d"}.bi-arrow-90deg-down:before{content:"\\f10e"}.bi-arrow-90deg-left:before{content:"\\f10f"}.bi-arrow-90deg-right:before{content:"\\f110"}.bi-arrow-90deg-up:before{content:"\\f111"}.bi-arrow-bar-down:before{content:"\\f112"}.bi-arrow-bar-left:before{content:"\\f113"}.bi-arrow-bar-right:before{content:"\\f114"}.bi-arrow-bar-up:before{content:"\\f115"}.bi-arrow-clockwise:before{content:"\\f116"}.bi-arrow-counterclockwise:before{content:"\\f117"}.bi-arrow-down-circle-fill:before{content:"\\f118"}.bi-arrow-down-circle:before{content:"\\f119"}.bi-arrow-down-left-circle-fill:before{content:"\\f11a"}.bi-arrow-down-left-circle:before{content:"\\f11b"}.bi-arrow-down-left-square-fill:before{content:"\\f11c"}.bi-arrow-down-left-square:before{content:"\\f11d"}.bi-arrow-down-left:before{content:"\\f11e"}.bi-arrow-down-right-circle-fill:before{content:"\\f11f"}.bi-arrow-down-right-circle:before{content:"\\f120"}.bi-arrow-down-right-square-fill:before{content:"\\f121"}.bi-arrow-down-right-square:before{content:"\\f122"}.bi-arrow-down-right:before{content:"\\f123"}.bi-arrow-down-short:before{content:"\\f124"}.bi-arrow-down-square-fill:before{content:"\\f125"}.bi-arrow-down-square:before{content:"\\f126"}.bi-arrow-down-up:before{content:"\\f127"}.bi-arrow-down:before{content:"\\f128"}.bi-arrow-left-circle-fill:before{content:"\\f129"}.bi-arrow-left-circle:before{content:"\\f12a"}.bi-arrow-left-right:before{content:"\\f12b"}.bi-arrow-left-short:before{content:"\\f12c"}.bi-arrow-left-square-fill:before{content:"\\f12d"}.bi-arrow-left-square:before{content:"\\f12e"}.bi-arrow-left:before{content:"\\f12f"}.bi-arrow-repeat:before{content:"\\f130"}.bi-arrow-return-left:before{content:"\\f131"}.bi-arrow-return-right:before{content:"\\f132"}.bi-arrow-right-circle-fill:before{content:"\\f133"}.bi-arrow-right-circle:before{content:"\\f134"}.bi-arrow-right-short:before{content:"\\f135"}.bi-arrow-right-square-fill:before{content:"\\f136"}.bi-arrow-right-square:before{content:"\\f137"}.bi-arrow-right:before{content:"\\f138"}.bi-arrow-up-circle-fill:before{content:"\\f139"}.bi-arrow-up-circle:before{content:"\\f13a"}.bi-arrow-up-left-circle-fill:before{content:"\\f13b"}.bi-arrow-up-left-circle:before{content:"\\f13c"}.bi-arrow-up-left-square-fill:before{content:"\\f13d"}.bi-arrow-up-left-square:before{content:"\\f13e"}.bi-arrow-up-left:before{content:"\\f13f"}.bi-arrow-up-right-circle-fill:before{content:"\\f140"}.bi-arrow-up-right-circle:before{content:"\\f141"}.bi-arrow-up-right-square-fill:before{content:"\\f142"}.bi-arrow-up-right-square:before{content:"\\f143"}.bi-arrow-up-right:before{content:"\\f144"}.bi-arrow-up-short:before{content:"\\f145"}.bi-arrow-up-square-fill:before{content:"\\f146"}.bi-arrow-up-square:before{content:"\\f147"}.bi-arrow-up:before{content:"\\f148"}.bi-arrows-angle-contract:before{content:"\\f149"}.bi-arrows-angle-expand:before{content:"\\f14a"}.bi-arrows-collapse:before{content:"\\f14b"}.bi-arrows-expand:before{content:"\\f14c"}.bi-arrows-fullscreen:before{content:"\\f14d"}.bi-arrows-move:before{content:"\\f14e"}.bi-aspect-ratio-fill:before{content:"\\f14f"}.bi-aspect-ratio:before{content:"\\f150"}.bi-asterisk:before{content:"\\f151"}.bi-at:before{content:"\\f152"}.bi-award-fill:before{content:"\\f153"}.bi-award:before{content:"\\f154"}.bi-back:before{content:"\\f155"}.bi-backspace-fill:before{content:"\\f156"}.bi-backspace-reverse-fill:before{content:"\\f157"}.bi-backspace-reverse:before{content:"\\f158"}.bi-backspace:before{content:"\\f159"}.bi-badge-3d-fill:before{content:"\\f15a"}.bi-badge-3d:before{content:"\\f15b"}.bi-badge-4k-fill:before{content:"\\f15c"}.bi-badge-4k:before{content:"\\f15d"}.bi-badge-8k-fill:before{content:"\\f15e"}.bi-badge-8k:before{content:"\\f15f"}.bi-badge-ad-fill:before{content:"\\f160"}.bi-badge-ad:before{content:"\\f161"}.bi-badge-ar-fill:before{content:"\\f162"}.bi-badge-ar:before{content:"\\f163"}.bi-badge-cc-fill:before{content:"\\f164"}.bi-badge-cc:before{content:"\\f165"}.bi-badge-hd-fill:before{content:"\\f166"}.bi-badge-hd:before{content:"\\f167"}.bi-badge-tm-fill:before{content:"\\f168"}.bi-badge-tm:before{content:"\\f169"}.bi-badge-vo-fill:before{content:"\\f16a"}.bi-badge-vo:before{content:"\\f16b"}.bi-badge-vr-fill:before{content:"\\f16c"}.bi-badge-vr:before{content:"\\f16d"}.bi-badge-wc-fill:before{content:"\\f16e"}.bi-badge-wc:before{content:"\\f16f"}.bi-bag-check-fill:before{content:"\\f170"}.bi-bag-check:before{content:"\\f171"}.bi-bag-dash-fill:before{content:"\\f172"}.bi-bag-dash:before{content:"\\f173"}.bi-bag-fill:before{content:"\\f174"}.bi-bag-plus-fill:before{content:"\\f175"}.bi-bag-plus:before{content:"\\f176"}.bi-bag-x-fill:before{content:"\\f177"}.bi-bag-x:before{content:"\\f178"}.bi-bag:before{content:"\\f179"}.bi-bar-chart-fill:before{content:"\\f17a"}.bi-bar-chart-line-fill:before{content:"\\f17b"}.bi-bar-chart-line:before{content:"\\f17c"}.bi-bar-chart-steps:before{content:"\\f17d"}.bi-bar-chart:before{content:"\\f17e"}.bi-basket-fill:before{content:"\\f17f"}.bi-basket:before{content:"\\f180"}.bi-basket2-fill:before{content:"\\f181"}.bi-basket2:before{content:"\\f182"}.bi-basket3-fill:before{content:"\\f183"}.bi-basket3:before{content:"\\f184"}.bi-battery-charging:before{content:"\\f185"}.bi-battery-full:before{content:"\\f186"}.bi-battery-half:before{content:"\\f187"}.bi-battery:before{content:"\\f188"}.bi-bell-fill:before{content:"\\f189"}.bi-bell:before{content:"\\f18a"}.bi-bezier:before{content:"\\f18b"}.bi-bezier2:before{content:"\\f18c"}.bi-bicycle:before{content:"\\f18d"}.bi-binoculars-fill:before{content:"\\f18e"}.bi-binoculars:before{content:"\\f18f"}.bi-blockquote-left:before{content:"\\f190"}.bi-blockquote-right:before{content:"\\f191"}.bi-book-fill:before{content:"\\f192"}.bi-book-half:before{content:"\\f193"}.bi-book:before{content:"\\f194"}.bi-bookmark-check-fill:before{content:"\\f195"}.bi-bookmark-check:before{content:"\\f196"}.bi-bookmark-dash-fill:before{content:"\\f197"}.bi-bookmark-dash:before{content:"\\f198"}.bi-bookmark-fill:before{content:"\\f199"}.bi-bookmark-heart-fill:before{content:"\\f19a"}.bi-bookmark-heart:before{content:"\\f19b"}.bi-bookmark-plus-fill:before{content:"\\f19c"}.bi-bookmark-plus:before{content:"\\f19d"}.bi-bookmark-star-fill:before{content:"\\f19e"}.bi-bookmark-star:before{content:"\\f19f"}.bi-bookmark-x-fill:before{content:"\\f1a0"}.bi-bookmark-x:before{content:"\\f1a1"}.bi-bookmark:before{content:"\\f1a2"}.bi-bookmarks-fill:before{content:"\\f1a3"}.bi-bookmarks:before{content:"\\f1a4"}.bi-bookshelf:before{content:"\\f1a5"}.bi-bootstrap-fill:before{content:"\\f1a6"}.bi-bootstrap-reboot:before{content:"\\f1a7"}.bi-bootstrap:before{content:"\\f1a8"}.bi-border-all:before{content:"\\f1a9"}.bi-border-bottom:before{content:"\\f1aa"}.bi-border-center:before{content:"\\f1ab"}.bi-border-inner:before{content:"\\f1ac"}.bi-border-left:before{content:"\\f1ad"}.bi-border-middle:before{content:"\\f1ae"}.bi-border-outer:before{content:"\\f1af"}.bi-border-right:before{content:"\\f1b0"}.bi-border-style:before{content:"\\f1b1"}.bi-border-top:before{content:"\\f1b2"}.bi-border-width:before{content:"\\f1b3"}.bi-border:before{content:"\\f1b4"}.bi-bounding-box-circles:before{content:"\\f1b5"}.bi-bounding-box:before{content:"\\f1b6"}.bi-box-arrow-down-left:before{content:"\\f1b7"}.bi-box-arrow-down-right:before{content:"\\f1b8"}.bi-box-arrow-down:before{content:"\\f1b9"}.bi-box-arrow-in-down-left:before{content:"\\f1ba"}.bi-box-arrow-in-down-right:before{content:"\\f1bb"}.bi-box-arrow-in-down:before{content:"\\f1bc"}.bi-box-arrow-in-left:before{content:"\\f1bd"}.bi-box-arrow-in-right:before{content:"\\f1be"}.bi-box-arrow-in-up-left:before{content:"\\f1bf"}.bi-box-arrow-in-up-right:before{content:"\\f1c0"}.bi-box-arrow-in-up:before{content:"\\f1c1"}.bi-box-arrow-left:before{content:"\\f1c2"}.bi-box-arrow-right:before{content:"\\f1c3"}.bi-box-arrow-up-left:before{content:"\\f1c4"}.bi-box-arrow-up-right:before{content:"\\f1c5"}.bi-box-arrow-up:before{content:"\\f1c6"}.bi-box-seam:before{content:"\\f1c7"}.bi-box:before{content:"\\f1c8"}.bi-braces:before{content:"\\f1c9"}.bi-bricks:before{content:"\\f1ca"}.bi-briefcase-fill:before{content:"\\f1cb"}.bi-briefcase:before{content:"\\f1cc"}.bi-brightness-alt-high-fill:before{content:"\\f1cd"}.bi-brightness-alt-high:before{content:"\\f1ce"}.bi-brightness-alt-low-fill:before{content:"\\f1cf"}.bi-brightness-alt-low:before{content:"\\f1d0"}.bi-brightness-high-fill:before{content:"\\f1d1"}.bi-brightness-high:before{content:"\\f1d2"}.bi-brightness-low-fill:before{content:"\\f1d3"}.bi-brightness-low:before{content:"\\f1d4"}.bi-broadcast-pin:before{content:"\\f1d5"}.bi-broadcast:before{content:"\\f1d6"}.bi-brush-fill:before{content:"\\f1d7"}.bi-brush:before{content:"\\f1d8"}.bi-bucket-fill:before{content:"\\f1d9"}.bi-bucket:before{content:"\\f1da"}.bi-bug-fill:before{content:"\\f1db"}.bi-bug:before{content:"\\f1dc"}.bi-building:before{content:"\\f1dd"}.bi-bullseye:before{content:"\\f1de"}.bi-calculator-fill:before{content:"\\f1df"}.bi-calculator:before{content:"\\f1e0"}.bi-calendar-check-fill:before{content:"\\f1e1"}.bi-calendar-check:before{content:"\\f1e2"}.bi-calendar-date-fill:before{content:"\\f1e3"}.bi-calendar-date:before{content:"\\f1e4"}.bi-calendar-day-fill:before{content:"\\f1e5"}.bi-calendar-day:before{content:"\\f1e6"}.bi-calendar-event-fill:before{content:"\\f1e7"}.bi-calendar-event:before{content:"\\f1e8"}.bi-calendar-fill:before{content:"\\f1e9"}.bi-calendar-minus-fill:before{content:"\\f1ea"}.bi-calendar-minus:before{content:"\\f1eb"}.bi-calendar-month-fill:before{content:"\\f1ec"}.bi-calendar-month:before{content:"\\f1ed"}.bi-calendar-plus-fill:before{content:"\\f1ee"}.bi-calendar-plus:before{content:"\\f1ef"}.bi-calendar-range-fill:before{content:"\\f1f0"}.bi-calendar-range:before{content:"\\f1f1"}.bi-calendar-week-fill:before{content:"\\f1f2"}.bi-calendar-week:before{content:"\\f1f3"}.bi-calendar-x-fill:before{content:"\\f1f4"}.bi-calendar-x:before{content:"\\f1f5"}.bi-calendar:before{content:"\\f1f6"}.bi-calendar2-check-fill:before{content:"\\f1f7"}.bi-calendar2-check:before{content:"\\f1f8"}.bi-calendar2-date-fill:before{content:"\\f1f9"}.bi-calendar2-date:before{content:"\\f1fa"}.bi-calendar2-day-fill:before{content:"\\f1fb"}.bi-calendar2-day:before{content:"\\f1fc"}.bi-calendar2-event-fill:before{content:"\\f1fd"}.bi-calendar2-event:before{content:"\\f1fe"}.bi-calendar2-fill:before{content:"\\f1ff"}.bi-calendar2-minus-fill:before{content:"\\f200"}.bi-calendar2-minus:before{content:"\\f201"}.bi-calendar2-month-fill:before{content:"\\f202"}.bi-calendar2-month:before{content:"\\f203"}.bi-calendar2-plus-fill:before{content:"\\f204"}.bi-calendar2-plus:before{content:"\\f205"}.bi-calendar2-range-fill:before{content:"\\f206"}.bi-calendar2-range:before{content:"\\f207"}.bi-calendar2-week-fill:before{content:"\\f208"}.bi-calendar2-week:before{content:"\\f209"}.bi-calendar2-x-fill:before{content:"\\f20a"}.bi-calendar2-x:before{content:"\\f20b"}.bi-calendar2:before{content:"\\f20c"}.bi-calendar3-event-fill:before{content:"\\f20d"}.bi-calendar3-event:before{content:"\\f20e"}.bi-calendar3-fill:before{content:"\\f20f"}.bi-calendar3-range-fill:before{content:"\\f210"}.bi-calendar3-range:before{content:"\\f211"}.bi-calendar3-week-fill:before{content:"\\f212"}.bi-calendar3-week:before{content:"\\f213"}.bi-calendar3:before{content:"\\f214"}.bi-calendar4-event:before{content:"\\f215"}.bi-calendar4-range:before{content:"\\f216"}.bi-calendar4-week:before{content:"\\f217"}.bi-calendar4:before{content:"\\f218"}.bi-camera-fill:before{content:"\\f219"}.bi-camera-reels-fill:before{content:"\\f21a"}.bi-camera-reels:before{content:"\\f21b"}.bi-camera-video-fill:before{content:"\\f21c"}.bi-camera-video-off-fill:before{content:"\\f21d"}.bi-camera-video-off:before{content:"\\f21e"}.bi-camera-video:before{content:"\\f21f"}.bi-camera:before{content:"\\f220"}.bi-camera2:before{content:"\\f221"}.bi-capslock-fill:before{content:"\\f222"}.bi-capslock:before{content:"\\f223"}.bi-card-checklist:before{content:"\\f224"}.bi-card-heading:before{content:"\\f225"}.bi-card-image:before{content:"\\f226"}.bi-card-list:before{content:"\\f227"}.bi-card-text:before{content:"\\f228"}.bi-caret-down-fill:before{content:"\\f229"}.bi-caret-down-square-fill:before{content:"\\f22a"}.bi-caret-down-square:before{content:"\\f22b"}.bi-caret-down:before{content:"\\f22c"}.bi-caret-left-fill:before{content:"\\f22d"}.bi-caret-left-square-fill:before{content:"\\f22e"}.bi-caret-left-square:before{content:"\\f22f"}.bi-caret-left:before{content:"\\f230"}.bi-caret-right-fill:before{content:"\\f231"}.bi-caret-right-square-fill:before{content:"\\f232"}.bi-caret-right-square:before{content:"\\f233"}.bi-caret-right:before{content:"\\f234"}.bi-caret-up-fill:before{content:"\\f235"}.bi-caret-up-square-fill:before{content:"\\f236"}.bi-caret-up-square:before{content:"\\f237"}.bi-caret-up:before{content:"\\f238"}.bi-cart-check-fill:before{content:"\\f239"}.bi-cart-check:before{content:"\\f23a"}.bi-cart-dash-fill:before{content:"\\f23b"}.bi-cart-dash:before{content:"\\f23c"}.bi-cart-fill:before{content:"\\f23d"}.bi-cart-plus-fill:before{content:"\\f23e"}.bi-cart-plus:before{content:"\\f23f"}.bi-cart-x-fill:before{content:"\\f240"}.bi-cart-x:before{content:"\\f241"}.bi-cart:before{content:"\\f242"}.bi-cart2:before{content:"\\f243"}.bi-cart3:before{content:"\\f244"}.bi-cart4:before{content:"\\f245"}.bi-cash-stack:before{content:"\\f246"}.bi-cash:before{content:"\\f247"}.bi-cast:before{content:"\\f248"}.bi-chat-dots-fill:before{content:"\\f249"}.bi-chat-dots:before{content:"\\f24a"}.bi-chat-fill:before{content:"\\f24b"}.bi-chat-left-dots-fill:before{content:"\\f24c"}.bi-chat-left-dots:before{content:"\\f24d"}.bi-chat-left-fill:before{content:"\\f24e"}.bi-chat-left-quote-fill:before{content:"\\f24f"}.bi-chat-left-quote:before{content:"\\f250"}.bi-chat-left-text-fill:before{content:"\\f251"}.bi-chat-left-text:before{content:"\\f252"}.bi-chat-left:before{content:"\\f253"}.bi-chat-quote-fill:before{content:"\\f254"}.bi-chat-quote:before{content:"\\f255"}.bi-chat-right-dots-fill:before{content:"\\f256"}.bi-chat-right-dots:before{content:"\\f257"}.bi-chat-right-fill:before{content:"\\f258"}.bi-chat-right-quote-fill:before{content:"\\f259"}.bi-chat-right-quote:before{content:"\\f25a"}.bi-chat-right-text-fill:before{content:"\\f25b"}.bi-chat-right-text:before{content:"\\f25c"}.bi-chat-right:before{content:"\\f25d"}.bi-chat-square-dots-fill:before{content:"\\f25e"}.bi-chat-square-dots:before{content:"\\f25f"}.bi-chat-square-fill:before{content:"\\f260"}.bi-chat-square-quote-fill:before{content:"\\f261"}.bi-chat-square-quote:before{content:"\\f262"}.bi-chat-square-text-fill:before{content:"\\f263"}.bi-chat-square-text:before{content:"\\f264"}.bi-chat-square:before{content:"\\f265"}.bi-chat-text-fill:before{content:"\\f266"}.bi-chat-text:before{content:"\\f267"}.bi-chat:before{content:"\\f268"}.bi-check-all:before{content:"\\f269"}.bi-check-circle-fill:before{content:"\\f26a"}.bi-check-circle:before{content:"\\f26b"}.bi-check-square-fill:before{content:"\\f26c"}.bi-check-square:before{content:"\\f26d"}.bi-check:before{content:"\\f26e"}.bi-check2-all:before{content:"\\f26f"}.bi-check2-circle:before{content:"\\f270"}.bi-check2-square:before{content:"\\f271"}.bi-check2:before{content:"\\f272"}.bi-chevron-bar-contract:before{content:"\\f273"}.bi-chevron-bar-down:before{content:"\\f274"}.bi-chevron-bar-expand:before{content:"\\f275"}.bi-chevron-bar-left:before{content:"\\f276"}.bi-chevron-bar-right:before{content:"\\f277"}.bi-chevron-bar-up:before{content:"\\f278"}.bi-chevron-compact-down:before{content:"\\f279"}.bi-chevron-compact-left:before{content:"\\f27a"}.bi-chevron-compact-right:before{content:"\\f27b"}.bi-chevron-compact-up:before{content:"\\f27c"}.bi-chevron-contract:before{content:"\\f27d"}.bi-chevron-double-down:before{content:"\\f27e"}.bi-chevron-double-left:before{content:"\\f27f"}.bi-chevron-double-right:before{content:"\\f280"}.bi-chevron-double-up:before{content:"\\f281"}.bi-chevron-down:before{content:"\\f282"}.bi-chevron-expand:before{content:"\\f283"}.bi-chevron-left:before{content:"\\f284"}.bi-chevron-right:before{content:"\\f285"}.bi-chevron-up:before{content:"\\f286"}.bi-circle-fill:before{content:"\\f287"}.bi-circle-half:before{content:"\\f288"}.bi-circle-square:before{content:"\\f289"}.bi-circle:before{content:"\\f28a"}.bi-clipboard-check:before{content:"\\f28b"}.bi-clipboard-data:before{content:"\\f28c"}.bi-clipboard-minus:before{content:"\\f28d"}.bi-clipboard-plus:before{content:"\\f28e"}.bi-clipboard-x:before{content:"\\f28f"}.bi-clipboard:before{content:"\\f290"}.bi-clock-fill:before{content:"\\f291"}.bi-clock-history:before{content:"\\f292"}.bi-clock:before{content:"\\f293"}.bi-cloud-arrow-down-fill:before{content:"\\f294"}.bi-cloud-arrow-down:before{content:"\\f295"}.bi-cloud-arrow-up-fill:before{content:"\\f296"}.bi-cloud-arrow-up:before{content:"\\f297"}.bi-cloud-check-fill:before{content:"\\f298"}.bi-cloud-check:before{content:"\\f299"}.bi-cloud-download-fill:before{content:"\\f29a"}.bi-cloud-download:before{content:"\\f29b"}.bi-cloud-drizzle-fill:before{content:"\\f29c"}.bi-cloud-drizzle:before{content:"\\f29d"}.bi-cloud-fill:before{content:"\\f29e"}.bi-cloud-fog-fill:before{content:"\\f29f"}.bi-cloud-fog:before{content:"\\f2a0"}.bi-cloud-fog2-fill:before{content:"\\f2a1"}.bi-cloud-fog2:before{content:"\\f2a2"}.bi-cloud-hail-fill:before{content:"\\f2a3"}.bi-cloud-hail:before{content:"\\f2a4"}.bi-cloud-haze-fill:before{content:"\\f2a6"}.bi-cloud-haze:before{content:"\\f2a7"}.bi-cloud-haze2-fill:before{content:"\\f2a8"}.bi-cloud-lightning-fill:before{content:"\\f2a9"}.bi-cloud-lightning-rain-fill:before{content:"\\f2aa"}.bi-cloud-lightning-rain:before{content:"\\f2ab"}.bi-cloud-lightning:before{content:"\\f2ac"}.bi-cloud-minus-fill:before{content:"\\f2ad"}.bi-cloud-minus:before{content:"\\f2ae"}.bi-cloud-moon-fill:before{content:"\\f2af"}.bi-cloud-moon:before{content:"\\f2b0"}.bi-cloud-plus-fill:before{content:"\\f2b1"}.bi-cloud-plus:before{content:"\\f2b2"}.bi-cloud-rain-fill:before{content:"\\f2b3"}.bi-cloud-rain-heavy-fill:before{content:"\\f2b4"}.bi-cloud-rain-heavy:before{content:"\\f2b5"}.bi-cloud-rain:before{content:"\\f2b6"}.bi-cloud-slash-fill:before{content:"\\f2b7"}.bi-cloud-slash:before{content:"\\f2b8"}.bi-cloud-sleet-fill:before{content:"\\f2b9"}.bi-cloud-sleet:before{content:"\\f2ba"}.bi-cloud-snow-fill:before{content:"\\f2bb"}.bi-cloud-snow:before{content:"\\f2bc"}.bi-cloud-sun-fill:before{content:"\\f2bd"}.bi-cloud-sun:before{content:"\\f2be"}.bi-cloud-upload-fill:before{content:"\\f2bf"}.bi-cloud-upload:before{content:"\\f2c0"}.bi-cloud:before{content:"\\f2c1"}.bi-clouds-fill:before{content:"\\f2c2"}.bi-clouds:before{content:"\\f2c3"}.bi-cloudy-fill:before{content:"\\f2c4"}.bi-cloudy:before{content:"\\f2c5"}.bi-code-slash:before{content:"\\f2c6"}.bi-code-square:before{content:"\\f2c7"}.bi-code:before{content:"\\f2c8"}.bi-collection-fill:before{content:"\\f2c9"}.bi-collection-play-fill:before{content:"\\f2ca"}.bi-collection-play:before{content:"\\f2cb"}.bi-collection:before{content:"\\f2cc"}.bi-columns-gap:before{content:"\\f2cd"}.bi-columns:before{content:"\\f2ce"}.bi-command:before{content:"\\f2cf"}.bi-compass-fill:before{content:"\\f2d0"}.bi-compass:before{content:"\\f2d1"}.bi-cone-striped:before{content:"\\f2d2"}.bi-cone:before{content:"\\f2d3"}.bi-controller:before{content:"\\f2d4"}.bi-cpu-fill:before{content:"\\f2d5"}.bi-cpu:before{content:"\\f2d6"}.bi-credit-card-2-back-fill:before{content:"\\f2d7"}.bi-credit-card-2-back:before{content:"\\f2d8"}.bi-credit-card-2-front-fill:before{content:"\\f2d9"}.bi-credit-card-2-front:before{content:"\\f2da"}.bi-credit-card-fill:before{content:"\\f2db"}.bi-credit-card:before{content:"\\f2dc"}.bi-crop:before{content:"\\f2dd"}.bi-cup-fill:before{content:"\\f2de"}.bi-cup-straw:before{content:"\\f2df"}.bi-cup:before{content:"\\f2e0"}.bi-cursor-fill:before{content:"\\f2e1"}.bi-cursor-text:before{content:"\\f2e2"}.bi-cursor:before{content:"\\f2e3"}.bi-dash-circle-dotted:before{content:"\\f2e4"}.bi-dash-circle-fill:before{content:"\\f2e5"}.bi-dash-circle:before{content:"\\f2e6"}.bi-dash-square-dotted:before{content:"\\f2e7"}.bi-dash-square-fill:before{content:"\\f2e8"}.bi-dash-square:before{content:"\\f2e9"}.bi-dash:before{content:"\\f2ea"}.bi-diagram-2-fill:before{content:"\\f2eb"}.bi-diagram-2:before{content:"\\f2ec"}.bi-diagram-3-fill:before{content:"\\f2ed"}.bi-diagram-3:before{content:"\\f2ee"}.bi-diamond-fill:before{content:"\\f2ef"}.bi-diamond-half:before{content:"\\f2f0"}.bi-diamond:before{content:"\\f2f1"}.bi-dice-1-fill:before{content:"\\f2f2"}.bi-dice-1:before{content:"\\f2f3"}.bi-dice-2-fill:before{content:"\\f2f4"}.bi-dice-2:before{content:"\\f2f5"}.bi-dice-3-fill:before{content:"\\f2f6"}.bi-dice-3:before{content:"\\f2f7"}.bi-dice-4-fill:before{content:"\\f2f8"}.bi-dice-4:before{content:"\\f2f9"}.bi-dice-5-fill:before{content:"\\f2fa"}.bi-dice-5:before{content:"\\f2fb"}.bi-dice-6-fill:before{content:"\\f2fc"}.bi-dice-6:before{content:"\\f2fd"}.bi-disc-fill:before{content:"\\f2fe"}.bi-disc:before{content:"\\f2ff"}.bi-discord:before{content:"\\f300"}.bi-display-fill:before{content:"\\f301"}.bi-display:before{content:"\\f302"}.bi-distribute-horizontal:before{content:"\\f303"}.bi-distribute-vertical:before{content:"\\f304"}.bi-door-closed-fill:before{content:"\\f305"}.bi-door-closed:before{content:"\\f306"}.bi-door-open-fill:before{content:"\\f307"}.bi-door-open:before{content:"\\f308"}.bi-dot:before{content:"\\f309"}.bi-download:before{content:"\\f30a"}.bi-droplet-fill:before{content:"\\f30b"}.bi-droplet-half:before{content:"\\f30c"}.bi-droplet:before{content:"\\f30d"}.bi-earbuds:before{content:"\\f30e"}.bi-easel-fill:before{content:"\\f30f"}.bi-easel:before{content:"\\f310"}.bi-egg-fill:before{content:"\\f311"}.bi-egg-fried:before{content:"\\f312"}.bi-egg:before{content:"\\f313"}.bi-eject-fill:before{content:"\\f314"}.bi-eject:before{content:"\\f315"}.bi-emoji-angry-fill:before{content:"\\f316"}.bi-emoji-angry:before{content:"\\f317"}.bi-emoji-dizzy-fill:before{content:"\\f318"}.bi-emoji-dizzy:before{content:"\\f319"}.bi-emoji-expressionless-fill:before{content:"\\f31a"}.bi-emoji-expressionless:before{content:"\\f31b"}.bi-emoji-frown-fill:before{content:"\\f31c"}.bi-emoji-frown:before{content:"\\f31d"}.bi-emoji-heart-eyes-fill:before{content:"\\f31e"}.bi-emoji-heart-eyes:before{content:"\\f31f"}.bi-emoji-laughing-fill:before{content:"\\f320"}.bi-emoji-laughing:before{content:"\\f321"}.bi-emoji-neutral-fill:before{content:"\\f322"}.bi-emoji-neutral:before{content:"\\f323"}.bi-emoji-smile-fill:before{content:"\\f324"}.bi-emoji-smile-upside-down-fill:before{content:"\\f325"}.bi-emoji-smile-upside-down:before{content:"\\f326"}.bi-emoji-smile:before{content:"\\f327"}.bi-emoji-sunglasses-fill:before{content:"\\f328"}.bi-emoji-sunglasses:before{content:"\\f329"}.bi-emoji-wink-fill:before{content:"\\f32a"}.bi-emoji-wink:before{content:"\\f32b"}.bi-envelope-fill:before{content:"\\f32c"}.bi-envelope-open-fill:before{content:"\\f32d"}.bi-envelope-open:before{content:"\\f32e"}.bi-envelope:before{content:"\\f32f"}.bi-eraser-fill:before{content:"\\f330"}.bi-eraser:before{content:"\\f331"}.bi-exclamation-circle-fill:before{content:"\\f332"}.bi-exclamation-circle:before{content:"\\f333"}.bi-exclamation-diamond-fill:before{content:"\\f334"}.bi-exclamation-diamond:before{content:"\\f335"}.bi-exclamation-octagon-fill:before{content:"\\f336"}.bi-exclamation-octagon:before{content:"\\f337"}.bi-exclamation-square-fill:before{content:"\\f338"}.bi-exclamation-square:before{content:"\\f339"}.bi-exclamation-triangle-fill:before{content:"\\f33a"}.bi-exclamation-triangle:before{content:"\\f33b"}.bi-exclamation:before{content:"\\f33c"}.bi-exclude:before{content:"\\f33d"}.bi-eye-fill:before{content:"\\f33e"}.bi-eye-slash-fill:before{content:"\\f33f"}.bi-eye-slash:before{content:"\\f340"}.bi-eye:before{content:"\\f341"}.bi-eyedropper:before{content:"\\f342"}.bi-eyeglasses:before{content:"\\f343"}.bi-facebook:before{content:"\\f344"}.bi-file-arrow-down-fill:before{content:"\\f345"}.bi-file-arrow-down:before{content:"\\f346"}.bi-file-arrow-up-fill:before{content:"\\f347"}.bi-file-arrow-up:before{content:"\\f348"}.bi-file-bar-graph-fill:before{content:"\\f349"}.bi-file-bar-graph:before{content:"\\f34a"}.bi-file-binary-fill:before{content:"\\f34b"}.bi-file-binary:before{content:"\\f34c"}.bi-file-break-fill:before{content:"\\f34d"}.bi-file-break:before{content:"\\f34e"}.bi-file-check-fill:before{content:"\\f34f"}.bi-file-check:before{content:"\\f350"}.bi-file-code-fill:before{content:"\\f351"}.bi-file-code:before{content:"\\f352"}.bi-file-diff-fill:before{content:"\\f353"}.bi-file-diff:before{content:"\\f354"}.bi-file-earmark-arrow-down-fill:before{content:"\\f355"}.bi-file-earmark-arrow-down:before{content:"\\f356"}.bi-file-earmark-arrow-up-fill:before{content:"\\f357"}.bi-file-earmark-arrow-up:before{content:"\\f358"}.bi-file-earmark-bar-graph-fill:before{content:"\\f359"}.bi-file-earmark-bar-graph:before{content:"\\f35a"}.bi-file-earmark-binary-fill:before{content:"\\f35b"}.bi-file-earmark-binary:before{content:"\\f35c"}.bi-file-earmark-break-fill:before{content:"\\f35d"}.bi-file-earmark-break:before{content:"\\f35e"}.bi-file-earmark-check-fill:before{content:"\\f35f"}.bi-file-earmark-check:before{content:"\\f360"}.bi-file-earmark-code-fill:before{content:"\\f361"}.bi-file-earmark-code:before{content:"\\f362"}.bi-file-earmark-diff-fill:before{content:"\\f363"}.bi-file-earmark-diff:before{content:"\\f364"}.bi-file-earmark-easel-fill:before{content:"\\f365"}.bi-file-earmark-easel:before{content:"\\f366"}.bi-file-earmark-excel-fill:before{content:"\\f367"}.bi-file-earmark-excel:before{content:"\\f368"}.bi-file-earmark-fill:before{content:"\\f369"}.bi-file-earmark-font-fill:before{content:"\\f36a"}.bi-file-earmark-font:before{content:"\\f36b"}.bi-file-earmark-image-fill:before{content:"\\f36c"}.bi-file-earmark-image:before{content:"\\f36d"}.bi-file-earmark-lock-fill:before{content:"\\f36e"}.bi-file-earmark-lock:before{content:"\\f36f"}.bi-file-earmark-lock2-fill:before{content:"\\f370"}.bi-file-earmark-lock2:before{content:"\\f371"}.bi-file-earmark-medical-fill:before{content:"\\f372"}.bi-file-earmark-medical:before{content:"\\f373"}.bi-file-earmark-minus-fill:before{content:"\\f374"}.bi-file-earmark-minus:before{content:"\\f375"}.bi-file-earmark-music-fill:before{content:"\\f376"}.bi-file-earmark-music:before{content:"\\f377"}.bi-file-earmark-person-fill:before{content:"\\f378"}.bi-file-earmark-person:before{content:"\\f379"}.bi-file-earmark-play-fill:before{content:"\\f37a"}.bi-file-earmark-play:before{content:"\\f37b"}.bi-file-earmark-plus-fill:before{content:"\\f37c"}.bi-file-earmark-plus:before{content:"\\f37d"}.bi-file-earmark-post-fill:before{content:"\\f37e"}.bi-file-earmark-post:before{content:"\\f37f"}.bi-file-earmark-ppt-fill:before{content:"\\f380"}.bi-file-earmark-ppt:before{content:"\\f381"}.bi-file-earmark-richtext-fill:before{content:"\\f382"}.bi-file-earmark-richtext:before{content:"\\f383"}.bi-file-earmark-ruled-fill:before{content:"\\f384"}.bi-file-earmark-ruled:before{content:"\\f385"}.bi-file-earmark-slides-fill:before{content:"\\f386"}.bi-file-earmark-slides:before{content:"\\f387"}.bi-file-earmark-spreadsheet-fill:before{content:"\\f388"}.bi-file-earmark-spreadsheet:before{content:"\\f389"}.bi-file-earmark-text-fill:before{content:"\\f38a"}.bi-file-earmark-text:before{content:"\\f38b"}.bi-file-earmark-word-fill:before{content:"\\f38c"}.bi-file-earmark-word:before{content:"\\f38d"}.bi-file-earmark-x-fill:before{content:"\\f38e"}.bi-file-earmark-x:before{content:"\\f38f"}.bi-file-earmark-zip-fill:before{content:"\\f390"}.bi-file-earmark-zip:before{content:"\\f391"}.bi-file-earmark:before{content:"\\f392"}.bi-file-easel-fill:before{content:"\\f393"}.bi-file-easel:before{content:"\\f394"}.bi-file-excel-fill:before{content:"\\f395"}.bi-file-excel:before{content:"\\f396"}.bi-file-fill:before{content:"\\f397"}.bi-file-font-fill:before{content:"\\f398"}.bi-file-font:before{content:"\\f399"}.bi-file-image-fill:before{content:"\\f39a"}.bi-file-image:before{content:"\\f39b"}.bi-file-lock-fill:before{content:"\\f39c"}.bi-file-lock:before{content:"\\f39d"}.bi-file-lock2-fill:before{content:"\\f39e"}.bi-file-lock2:before{content:"\\f39f"}.bi-file-medical-fill:before{content:"\\f3a0"}.bi-file-medical:before{content:"\\f3a1"}.bi-file-minus-fill:before{content:"\\f3a2"}.bi-file-minus:before{content:"\\f3a3"}.bi-file-music-fill:before{content:"\\f3a4"}.bi-file-music:before{content:"\\f3a5"}.bi-file-person-fill:before{content:"\\f3a6"}.bi-file-person:before{content:"\\f3a7"}.bi-file-play-fill:before{content:"\\f3a8"}.bi-file-play:before{content:"\\f3a9"}.bi-file-plus-fill:before{content:"\\f3aa"}.bi-file-plus:before{content:"\\f3ab"}.bi-file-post-fill:before{content:"\\f3ac"}.bi-file-post:before{content:"\\f3ad"}.bi-file-ppt-fill:before{content:"\\f3ae"}.bi-file-ppt:before{content:"\\f3af"}.bi-file-richtext-fill:before{content:"\\f3b0"}.bi-file-richtext:before{content:"\\f3b1"}.bi-file-ruled-fill:before{content:"\\f3b2"}.bi-file-ruled:before{content:"\\f3b3"}.bi-file-slides-fill:before{content:"\\f3b4"}.bi-file-slides:before{content:"\\f3b5"}.bi-file-spreadsheet-fill:before{content:"\\f3b6"}.bi-file-spreadsheet:before{content:"\\f3b7"}.bi-file-text-fill:before{content:"\\f3b8"}.bi-file-text:before{content:"\\f3b9"}.bi-file-word-fill:before{content:"\\f3ba"}.bi-file-word:before{content:"\\f3bb"}.bi-file-x-fill:before{content:"\\f3bc"}.bi-file-x:before{content:"\\f3bd"}.bi-file-zip-fill:before{content:"\\f3be"}.bi-file-zip:before{content:"\\f3bf"}.bi-file:before{content:"\\f3c0"}.bi-files-alt:before{content:"\\f3c1"}.bi-files:before{content:"\\f3c2"}.bi-film:before{content:"\\f3c3"}.bi-filter-circle-fill:before{content:"\\f3c4"}.bi-filter-circle:before{content:"\\f3c5"}.bi-filter-left:before{content:"\\f3c6"}.bi-filter-right:before{content:"\\f3c7"}.bi-filter-square-fill:before{content:"\\f3c8"}.bi-filter-square:before{content:"\\f3c9"}.bi-filter:before{content:"\\f3ca"}.bi-flag-fill:before{content:"\\f3cb"}.bi-flag:before{content:"\\f3cc"}.bi-flower1:before{content:"\\f3cd"}.bi-flower2:before{content:"\\f3ce"}.bi-flower3:before{content:"\\f3cf"}.bi-folder-check:before{content:"\\f3d0"}.bi-folder-fill:before{content:"\\f3d1"}.bi-folder-minus:before{content:"\\f3d2"}.bi-folder-plus:before{content:"\\f3d3"}.bi-folder-symlink-fill:before{content:"\\f3d4"}.bi-folder-symlink:before{content:"\\f3d5"}.bi-folder-x:before{content:"\\f3d6"}.bi-folder:before{content:"\\f3d7"}.bi-folder2-open:before{content:"\\f3d8"}.bi-folder2:before{content:"\\f3d9"}.bi-fonts:before{content:"\\f3da"}.bi-forward-fill:before{content:"\\f3db"}.bi-forward:before{content:"\\f3dc"}.bi-front:before{content:"\\f3dd"}.bi-fullscreen-exit:before{content:"\\f3de"}.bi-fullscreen:before{content:"\\f3df"}.bi-funnel-fill:before{content:"\\f3e0"}.bi-funnel:before{content:"\\f3e1"}.bi-gear-fill:before{content:"\\f3e2"}.bi-gear-wide-connected:before{content:"\\f3e3"}.bi-gear-wide:before{content:"\\f3e4"}.bi-gear:before{content:"\\f3e5"}.bi-gem:before{content:"\\f3e6"}.bi-geo-alt-fill:before{content:"\\f3e7"}.bi-geo-alt:before{content:"\\f3e8"}.bi-geo-fill:before{content:"\\f3e9"}.bi-geo:before{content:"\\f3ea"}.bi-gift-fill:before{content:"\\f3eb"}.bi-gift:before{content:"\\f3ec"}.bi-github:before{content:"\\f3ed"}.bi-globe:before{content:"\\f3ee"}.bi-globe2:before{content:"\\f3ef"}.bi-google:before{content:"\\f3f0"}.bi-graph-down:before{content:"\\f3f1"}.bi-graph-up:before{content:"\\f3f2"}.bi-grid-1x2-fill:before{content:"\\f3f3"}.bi-grid-1x2:before{content:"\\f3f4"}.bi-grid-3x2-gap-fill:before{content:"\\f3f5"}.bi-grid-3x2-gap:before{content:"\\f3f6"}.bi-grid-3x2:before{content:"\\f3f7"}.bi-grid-3x3-gap-fill:before{content:"\\f3f8"}.bi-grid-3x3-gap:before{content:"\\f3f9"}.bi-grid-3x3:before{content:"\\f3fa"}.bi-grid-fill:before{content:"\\f3fb"}.bi-grid:before{content:"\\f3fc"}.bi-grip-horizontal:before{content:"\\f3fd"}.bi-grip-vertical:before{content:"\\f3fe"}.bi-hammer:before{content:"\\f3ff"}.bi-hand-index-fill:before{content:"\\f400"}.bi-hand-index-thumb-fill:before{content:"\\f401"}.bi-hand-index-thumb:before{content:"\\f402"}.bi-hand-index:before{content:"\\f403"}.bi-hand-thumbs-down-fill:before{content:"\\f404"}.bi-hand-thumbs-down:before{content:"\\f405"}.bi-hand-thumbs-up-fill:before{content:"\\f406"}.bi-hand-thumbs-up:before{content:"\\f407"}.bi-handbag-fill:before{content:"\\f408"}.bi-handbag:before{content:"\\f409"}.bi-hash:before{content:"\\f40a"}.bi-hdd-fill:before{content:"\\f40b"}.bi-hdd-network-fill:before{content:"\\f40c"}.bi-hdd-network:before{content:"\\f40d"}.bi-hdd-rack-fill:before{content:"\\f40e"}.bi-hdd-rack:before{content:"\\f40f"}.bi-hdd-stack-fill:before{content:"\\f410"}.bi-hdd-stack:before{content:"\\f411"}.bi-hdd:before{content:"\\f412"}.bi-headphones:before{content:"\\f413"}.bi-headset:before{content:"\\f414"}.bi-heart-fill:before{content:"\\f415"}.bi-heart-half:before{content:"\\f416"}.bi-heart:before{content:"\\f417"}.bi-heptagon-fill:before{content:"\\f418"}.bi-heptagon-half:before{content:"\\f419"}.bi-heptagon:before{content:"\\f41a"}.bi-hexagon-fill:before{content:"\\f41b"}.bi-hexagon-half:before{content:"\\f41c"}.bi-hexagon:before{content:"\\f41d"}.bi-hourglass-bottom:before{content:"\\f41e"}.bi-hourglass-split:before{content:"\\f41f"}.bi-hourglass-top:before{content:"\\f420"}.bi-hourglass:before{content:"\\f421"}.bi-house-door-fill:before{content:"\\f422"}.bi-house-door:before{content:"\\f423"}.bi-house-fill:before{content:"\\f424"}.bi-house:before{content:"\\f425"}.bi-hr:before{content:"\\f426"}.bi-hurricane:before{content:"\\f427"}.bi-image-alt:before{content:"\\f428"}.bi-image-fill:before{content:"\\f429"}.bi-image:before{content:"\\f42a"}.bi-images:before{content:"\\f42b"}.bi-inbox-fill:before{content:"\\f42c"}.bi-inbox:before{content:"\\f42d"}.bi-inboxes-fill:before{content:"\\f42e"}.bi-inboxes:before{content:"\\f42f"}.bi-info-circle-fill:before{content:"\\f430"}.bi-info-circle:before{content:"\\f431"}.bi-info-square-fill:before{content:"\\f432"}.bi-info-square:before{content:"\\f433"}.bi-info:before{content:"\\f434"}.bi-input-cursor-text:before{content:"\\f435"}.bi-input-cursor:before{content:"\\f436"}.bi-instagram:before{content:"\\f437"}.bi-intersect:before{content:"\\f438"}.bi-journal-album:before{content:"\\f439"}.bi-journal-arrow-down:before{content:"\\f43a"}.bi-journal-arrow-up:before{content:"\\f43b"}.bi-journal-bookmark-fill:before{content:"\\f43c"}.bi-journal-bookmark:before{content:"\\f43d"}.bi-journal-check:before{content:"\\f43e"}.bi-journal-code:before{content:"\\f43f"}.bi-journal-medical:before{content:"\\f440"}.bi-journal-minus:before{content:"\\f441"}.bi-journal-plus:before{content:"\\f442"}.bi-journal-richtext:before{content:"\\f443"}.bi-journal-text:before{content:"\\f444"}.bi-journal-x:before{content:"\\f445"}.bi-journal:before{content:"\\f446"}.bi-journals:before{content:"\\f447"}.bi-joystick:before{content:"\\f448"}.bi-justify-left:before{content:"\\f449"}.bi-justify-right:before{content:"\\f44a"}.bi-justify:before{content:"\\f44b"}.bi-kanban-fill:before{content:"\\f44c"}.bi-kanban:before{content:"\\f44d"}.bi-key-fill:before{content:"\\f44e"}.bi-key:before{content:"\\f44f"}.bi-keyboard-fill:before{content:"\\f450"}.bi-keyboard:before{content:"\\f451"}.bi-ladder:before{content:"\\f452"}.bi-lamp-fill:before{content:"\\f453"}.bi-lamp:before{content:"\\f454"}.bi-laptop-fill:before{content:"\\f455"}.bi-laptop:before{content:"\\f456"}.bi-layer-backward:before{content:"\\f457"}.bi-layer-forward:before{content:"\\f458"}.bi-layers-fill:before{content:"\\f459"}.bi-layers-half:before{content:"\\f45a"}.bi-layers:before{content:"\\f45b"}.bi-layout-sidebar-inset-reverse:before{content:"\\f45c"}.bi-layout-sidebar-inset:before{content:"\\f45d"}.bi-layout-sidebar-reverse:before{content:"\\f45e"}.bi-layout-sidebar:before{content:"\\f45f"}.bi-layout-split:before{content:"\\f460"}.bi-layout-text-sidebar-reverse:before{content:"\\f461"}.bi-layout-text-sidebar:before{content:"\\f462"}.bi-layout-text-window-reverse:before{content:"\\f463"}.bi-layout-text-window:before{content:"\\f464"}.bi-layout-three-columns:before{content:"\\f465"}.bi-layout-wtf:before{content:"\\f466"}.bi-life-preserver:before{content:"\\f467"}.bi-lightbulb-fill:before{content:"\\f468"}.bi-lightbulb-off-fill:before{content:"\\f469"}.bi-lightbulb-off:before{content:"\\f46a"}.bi-lightbulb:before{content:"\\f46b"}.bi-lightning-charge-fill:before{content:"\\f46c"}.bi-lightning-charge:before{content:"\\f46d"}.bi-lightning-fill:before{content:"\\f46e"}.bi-lightning:before{content:"\\f46f"}.bi-link-45deg:before{content:"\\f470"}.bi-link:before{content:"\\f471"}.bi-linkedin:before{content:"\\f472"}.bi-list-check:before{content:"\\f473"}.bi-list-nested:before{content:"\\f474"}.bi-list-ol:before{content:"\\f475"}.bi-list-stars:before{content:"\\f476"}.bi-list-task:before{content:"\\f477"}.bi-list-ul:before{content:"\\f478"}.bi-list:before{content:"\\f479"}.bi-lock-fill:before{content:"\\f47a"}.bi-lock:before{content:"\\f47b"}.bi-mailbox:before{content:"\\f47c"}.bi-mailbox2:before{content:"\\f47d"}.bi-map-fill:before{content:"\\f47e"}.bi-map:before{content:"\\f47f"}.bi-markdown-fill:before{content:"\\f480"}.bi-markdown:before{content:"\\f481"}.bi-mask:before{content:"\\f482"}.bi-megaphone-fill:before{content:"\\f483"}.bi-megaphone:before{content:"\\f484"}.bi-menu-app-fill:before{content:"\\f485"}.bi-menu-app:before{content:"\\f486"}.bi-menu-button-fill:before{content:"\\f487"}.bi-menu-button-wide-fill:before{content:"\\f488"}.bi-menu-button-wide:before{content:"\\f489"}.bi-menu-button:before{content:"\\f48a"}.bi-menu-down:before{content:"\\f48b"}.bi-menu-up:before{content:"\\f48c"}.bi-mic-fill:before{content:"\\f48d"}.bi-mic-mute-fill:before{content:"\\f48e"}.bi-mic-mute:before{content:"\\f48f"}.bi-mic:before{content:"\\f490"}.bi-minecart-loaded:before{content:"\\f491"}.bi-minecart:before{content:"\\f492"}.bi-moisture:before{content:"\\f493"}.bi-moon-fill:before{content:"\\f494"}.bi-moon-stars-fill:before{content:"\\f495"}.bi-moon-stars:before{content:"\\f496"}.bi-moon:before{content:"\\f497"}.bi-mouse-fill:before{content:"\\f498"}.bi-mouse:before{content:"\\f499"}.bi-mouse2-fill:before{content:"\\f49a"}.bi-mouse2:before{content:"\\f49b"}.bi-mouse3-fill:before{content:"\\f49c"}.bi-mouse3:before{content:"\\f49d"}.bi-music-note-beamed:before{content:"\\f49e"}.bi-music-note-list:before{content:"\\f49f"}.bi-music-note:before{content:"\\f4a0"}.bi-music-player-fill:before{content:"\\f4a1"}.bi-music-player:before{content:"\\f4a2"}.bi-newspaper:before{content:"\\f4a3"}.bi-node-minus-fill:before{content:"\\f4a4"}.bi-node-minus:before{content:"\\f4a5"}.bi-node-plus-fill:before{content:"\\f4a6"}.bi-node-plus:before{content:"\\f4a7"}.bi-nut-fill:before{content:"\\f4a8"}.bi-nut:before{content:"\\f4a9"}.bi-octagon-fill:before{content:"\\f4aa"}.bi-octagon-half:before{content:"\\f4ab"}.bi-octagon:before{content:"\\f4ac"}.bi-option:before{content:"\\f4ad"}.bi-outlet:before{content:"\\f4ae"}.bi-paint-bucket:before{content:"\\f4af"}.bi-palette-fill:before{content:"\\f4b0"}.bi-palette:before{content:"\\f4b1"}.bi-palette2:before{content:"\\f4b2"}.bi-paperclip:before{content:"\\f4b3"}.bi-paragraph:before{content:"\\f4b4"}.bi-patch-check-fill:before{content:"\\f4b5"}.bi-patch-check:before{content:"\\f4b6"}.bi-patch-exclamation-fill:before{content:"\\f4b7"}.bi-patch-exclamation:before{content:"\\f4b8"}.bi-patch-minus-fill:before{content:"\\f4b9"}.bi-patch-minus:before{content:"\\f4ba"}.bi-patch-plus-fill:before{content:"\\f4bb"}.bi-patch-plus:before{content:"\\f4bc"}.bi-patch-question-fill:before{content:"\\f4bd"}.bi-patch-question:before{content:"\\f4be"}.bi-pause-btn-fill:before{content:"\\f4bf"}.bi-pause-btn:before{content:"\\f4c0"}.bi-pause-circle-fill:before{content:"\\f4c1"}.bi-pause-circle:before{content:"\\f4c2"}.bi-pause-fill:before{content:"\\f4c3"}.bi-pause:before{content:"\\f4c4"}.bi-peace-fill:before{content:"\\f4c5"}.bi-peace:before{content:"\\f4c6"}.bi-pen-fill:before{content:"\\f4c7"}.bi-pen:before{content:"\\f4c8"}.bi-pencil-fill:before{content:"\\f4c9"}.bi-pencil-square:before{content:"\\f4ca"}.bi-pencil:before{content:"\\f4cb"}.bi-pentagon-fill:before{content:"\\f4cc"}.bi-pentagon-half:before{content:"\\f4cd"}.bi-pentagon:before{content:"\\f4ce"}.bi-people-fill:before{content:"\\f4cf"}.bi-people:before{content:"\\f4d0"}.bi-percent:before{content:"\\f4d1"}.bi-person-badge-fill:before{content:"\\f4d2"}.bi-person-badge:before{content:"\\f4d3"}.bi-person-bounding-box:before{content:"\\f4d4"}.bi-person-check-fill:before{content:"\\f4d5"}.bi-person-check:before{content:"\\f4d6"}.bi-person-circle:before{content:"\\f4d7"}.bi-person-dash-fill:before{content:"\\f4d8"}.bi-person-dash:before{content:"\\f4d9"}.bi-person-fill:before{content:"\\f4da"}.bi-person-lines-fill:before{content:"\\f4db"}.bi-person-plus-fill:before{content:"\\f4dc"}.bi-person-plus:before{content:"\\f4dd"}.bi-person-square:before{content:"\\f4de"}.bi-person-x-fill:before{content:"\\f4df"}.bi-person-x:before{content:"\\f4e0"}.bi-person:before{content:"\\f4e1"}.bi-phone-fill:before{content:"\\f4e2"}.bi-phone-landscape-fill:before{content:"\\f4e3"}.bi-phone-landscape:before{content:"\\f4e4"}.bi-phone-vibrate-fill:before{content:"\\f4e5"}.bi-phone-vibrate:before{content:"\\f4e6"}.bi-phone:before{content:"\\f4e7"}.bi-pie-chart-fill:before{content:"\\f4e8"}.bi-pie-chart:before{content:"\\f4e9"}.bi-pin-angle-fill:before{content:"\\f4ea"}.bi-pin-angle:before{content:"\\f4eb"}.bi-pin-fill:before{content:"\\f4ec"}.bi-pin:before{content:"\\f4ed"}.bi-pip-fill:before{content:"\\f4ee"}.bi-pip:before{content:"\\f4ef"}.bi-play-btn-fill:before{content:"\\f4f0"}.bi-play-btn:before{content:"\\f4f1"}.bi-play-circle-fill:before{content:"\\f4f2"}.bi-play-circle:before{content:"\\f4f3"}.bi-play-fill:before{content:"\\f4f4"}.bi-play:before{content:"\\f4f5"}.bi-plug-fill:before{content:"\\f4f6"}.bi-plug:before{content:"\\f4f7"}.bi-plus-circle-dotted:before{content:"\\f4f8"}.bi-plus-circle-fill:before{content:"\\f4f9"}.bi-plus-circle:before{content:"\\f4fa"}.bi-plus-square-dotted:before{content:"\\f4fb"}.bi-plus-square-fill:before{content:"\\f4fc"}.bi-plus-square:before{content:"\\f4fd"}.bi-plus:before{content:"\\f4fe"}.bi-power:before{content:"\\f4ff"}.bi-printer-fill:before{content:"\\f500"}.bi-printer:before{content:"\\f501"}.bi-puzzle-fill:before{content:"\\f502"}.bi-puzzle:before{content:"\\f503"}.bi-question-circle-fill:before{content:"\\f504"}.bi-question-circle:before{content:"\\f505"}.bi-question-diamond-fill:before{content:"\\f506"}.bi-question-diamond:before{content:"\\f507"}.bi-question-octagon-fill:before{content:"\\f508"}.bi-question-octagon:before{content:"\\f509"}.bi-question-square-fill:before{content:"\\f50a"}.bi-question-square:before{content:"\\f50b"}.bi-question:before{content:"\\f50c"}.bi-rainbow:before{content:"\\f50d"}.bi-receipt-cutoff:before{content:"\\f50e"}.bi-receipt:before{content:"\\f50f"}.bi-reception-0:before{content:"\\f510"}.bi-reception-1:before{content:"\\f511"}.bi-reception-2:before{content:"\\f512"}.bi-reception-3:before{content:"\\f513"}.bi-reception-4:before{content:"\\f514"}.bi-record-btn-fill:before{content:"\\f515"}.bi-record-btn:before{content:"\\f516"}.bi-record-circle-fill:before{content:"\\f517"}.bi-record-circle:before{content:"\\f518"}.bi-record-fill:before{content:"\\f519"}.bi-record:before{content:"\\f51a"}.bi-record2-fill:before{content:"\\f51b"}.bi-record2:before{content:"\\f51c"}.bi-reply-all-fill:before{content:"\\f51d"}.bi-reply-all:before{content:"\\f51e"}.bi-reply-fill:before{content:"\\f51f"}.bi-reply:before{content:"\\f520"}.bi-rss-fill:before{content:"\\f521"}.bi-rss:before{content:"\\f522"}.bi-rulers:before{content:"\\f523"}.bi-save-fill:before{content:"\\f524"}.bi-save:before{content:"\\f525"}.bi-save2-fill:before{content:"\\f526"}.bi-save2:before{content:"\\f527"}.bi-scissors:before{content:"\\f528"}.bi-screwdriver:before{content:"\\f529"}.bi-search:before{content:"\\f52a"}.bi-segmented-nav:before{content:"\\f52b"}.bi-server:before{content:"\\f52c"}.bi-share-fill:before{content:"\\f52d"}.bi-share:before{content:"\\f52e"}.bi-shield-check:before{content:"\\f52f"}.bi-shield-exclamation:before{content:"\\f530"}.bi-shield-fill-check:before{content:"\\f531"}.bi-shield-fill-exclamation:before{content:"\\f532"}.bi-shield-fill-minus:before{content:"\\f533"}.bi-shield-fill-plus:before{content:"\\f534"}.bi-shield-fill-x:before{content:"\\f535"}.bi-shield-fill:before{content:"\\f536"}.bi-shield-lock-fill:before{content:"\\f537"}.bi-shield-lock:before{content:"\\f538"}.bi-shield-minus:before{content:"\\f539"}.bi-shield-plus:before{content:"\\f53a"}.bi-shield-shaded:before{content:"\\f53b"}.bi-shield-slash-fill:before{content:"\\f53c"}.bi-shield-slash:before{content:"\\f53d"}.bi-shield-x:before{content:"\\f53e"}.bi-shield:before{content:"\\f53f"}.bi-shift-fill:before{content:"\\f540"}.bi-shift:before{content:"\\f541"}.bi-shop-window:before{content:"\\f542"}.bi-shop:before{content:"\\f543"}.bi-shuffle:before{content:"\\f544"}.bi-signpost-2-fill:before{content:"\\f545"}.bi-signpost-2:before{content:"\\f546"}.bi-signpost-fill:before{content:"\\f547"}.bi-signpost-split-fill:before{content:"\\f548"}.bi-signpost-split:before{content:"\\f549"}.bi-signpost:before{content:"\\f54a"}.bi-sim-fill:before{content:"\\f54b"}.bi-sim:before{content:"\\f54c"}.bi-skip-backward-btn-fill:before{content:"\\f54d"}.bi-skip-backward-btn:before{content:"\\f54e"}.bi-skip-backward-circle-fill:before{content:"\\f54f"}.bi-skip-backward-circle:before{content:"\\f550"}.bi-skip-backward-fill:before{content:"\\f551"}.bi-skip-backward:before{content:"\\f552"}.bi-skip-end-btn-fill:before{content:"\\f553"}.bi-skip-end-btn:before{content:"\\f554"}.bi-skip-end-circle-fill:before{content:"\\f555"}.bi-skip-end-circle:before{content:"\\f556"}.bi-skip-end-fill:before{content:"\\f557"}.bi-skip-end:before{content:"\\f558"}.bi-skip-forward-btn-fill:before{content:"\\f559"}.bi-skip-forward-btn:before{content:"\\f55a"}.bi-skip-forward-circle-fill:before{content:"\\f55b"}.bi-skip-forward-circle:before{content:"\\f55c"}.bi-skip-forward-fill:before{content:"\\f55d"}.bi-skip-forward:before{content:"\\f55e"}.bi-skip-start-btn-fill:before{content:"\\f55f"}.bi-skip-start-btn:before{content:"\\f560"}.bi-skip-start-circle-fill:before{content:"\\f561"}.bi-skip-start-circle:before{content:"\\f562"}.bi-skip-start-fill:before{content:"\\f563"}.bi-skip-start:before{content:"\\f564"}.bi-slack:before{content:"\\f565"}.bi-slash-circle-fill:before{content:"\\f566"}.bi-slash-circle:before{content:"\\f567"}.bi-slash-square-fill:before{content:"\\f568"}.bi-slash-square:before{content:"\\f569"}.bi-slash:before{content:"\\f56a"}.bi-sliders:before{content:"\\f56b"}.bi-smartwatch:before{content:"\\f56c"}.bi-snow:before{content:"\\f56d"}.bi-snow2:before{content:"\\f56e"}.bi-snow3:before{content:"\\f56f"}.bi-sort-alpha-down-alt:before{content:"\\f570"}.bi-sort-alpha-down:before{content:"\\f571"}.bi-sort-alpha-up-alt:before{content:"\\f572"}.bi-sort-alpha-up:before{content:"\\f573"}.bi-sort-down-alt:before{content:"\\f574"}.bi-sort-down:before{content:"\\f575"}.bi-sort-numeric-down-alt:before{content:"\\f576"}.bi-sort-numeric-down:before{content:"\\f577"}.bi-sort-numeric-up-alt:before{content:"\\f578"}.bi-sort-numeric-up:before{content:"\\f579"}.bi-sort-up-alt:before{content:"\\f57a"}.bi-sort-up:before{content:"\\f57b"}.bi-soundwave:before{content:"\\f57c"}.bi-speaker-fill:before{content:"\\f57d"}.bi-speaker:before{content:"\\f57e"}.bi-speedometer:before{content:"\\f57f"}.bi-speedometer2:before{content:"\\f580"}.bi-spellcheck:before{content:"\\f581"}.bi-square-fill:before{content:"\\f582"}.bi-square-half:before{content:"\\f583"}.bi-square:before{content:"\\f584"}.bi-stack:before{content:"\\f585"}.bi-star-fill:before{content:"\\f586"}.bi-star-half:before{content:"\\f587"}.bi-star:before{content:"\\f588"}.bi-stars:before{content:"\\f589"}.bi-stickies-fill:before{content:"\\f58a"}.bi-stickies:before{content:"\\f58b"}.bi-sticky-fill:before{content:"\\f58c"}.bi-sticky:before{content:"\\f58d"}.bi-stop-btn-fill:before{content:"\\f58e"}.bi-stop-btn:before{content:"\\f58f"}.bi-stop-circle-fill:before{content:"\\f590"}.bi-stop-circle:before{content:"\\f591"}.bi-stop-fill:before{content:"\\f592"}.bi-stop:before{content:"\\f593"}.bi-stoplights-fill:before{content:"\\f594"}.bi-stoplights:before{content:"\\f595"}.bi-stopwatch-fill:before{content:"\\f596"}.bi-stopwatch:before{content:"\\f597"}.bi-subtract:before{content:"\\f598"}.bi-suit-club-fill:before{content:"\\f599"}.bi-suit-club:before{content:"\\f59a"}.bi-suit-diamond-fill:before{content:"\\f59b"}.bi-suit-diamond:before{content:"\\f59c"}.bi-suit-heart-fill:before{content:"\\f59d"}.bi-suit-heart:before{content:"\\f59e"}.bi-suit-spade-fill:before{content:"\\f59f"}.bi-suit-spade:before{content:"\\f5a0"}.bi-sun-fill:before{content:"\\f5a1"}.bi-sun:before{content:"\\f5a2"}.bi-sunglasses:before{content:"\\f5a3"}.bi-sunrise-fill:before{content:"\\f5a4"}.bi-sunrise:before{content:"\\f5a5"}.bi-sunset-fill:before{content:"\\f5a6"}.bi-sunset:before{content:"\\f5a7"}.bi-symmetry-horizontal:before{content:"\\f5a8"}.bi-symmetry-vertical:before{content:"\\f5a9"}.bi-table:before{content:"\\f5aa"}.bi-tablet-fill:before{content:"\\f5ab"}.bi-tablet-landscape-fill:before{content:"\\f5ac"}.bi-tablet-landscape:before{content:"\\f5ad"}.bi-tablet:before{content:"\\f5ae"}.bi-tag-fill:before{content:"\\f5af"}.bi-tag:before{content:"\\f5b0"}.bi-tags-fill:before{content:"\\f5b1"}.bi-tags:before{content:"\\f5b2"}.bi-telegram:before{content:"\\f5b3"}.bi-telephone-fill:before{content:"\\f5b4"}.bi-telephone-forward-fill:before{content:"\\f5b5"}.bi-telephone-forward:before{content:"\\f5b6"}.bi-telephone-inbound-fill:before{content:"\\f5b7"}.bi-telephone-inbound:before{content:"\\f5b8"}.bi-telephone-minus-fill:before{content:"\\f5b9"}.bi-telephone-minus:before{content:"\\f5ba"}.bi-telephone-outbound-fill:before{content:"\\f5bb"}.bi-telephone-outbound:before{content:"\\f5bc"}.bi-telephone-plus-fill:before{content:"\\f5bd"}.bi-telephone-plus:before{content:"\\f5be"}.bi-telephone-x-fill:before{content:"\\f5bf"}.bi-telephone-x:before{content:"\\f5c0"}.bi-telephone:before{content:"\\f5c1"}.bi-terminal-fill:before{content:"\\f5c2"}.bi-terminal:before{content:"\\f5c3"}.bi-text-center:before{content:"\\f5c4"}.bi-text-indent-left:before{content:"\\f5c5"}.bi-text-indent-right:before{content:"\\f5c6"}.bi-text-left:before{content:"\\f5c7"}.bi-text-paragraph:before{content:"\\f5c8"}.bi-text-right:before{content:"\\f5c9"}.bi-textarea-resize:before{content:"\\f5ca"}.bi-textarea-t:before{content:"\\f5cb"}.bi-textarea:before{content:"\\f5cc"}.bi-thermometer-half:before{content:"\\f5cd"}.bi-thermometer-high:before{content:"\\f5ce"}.bi-thermometer-low:before{content:"\\f5cf"}.bi-thermometer-snow:before{content:"\\f5d0"}.bi-thermometer-sun:before{content:"\\f5d1"}.bi-thermometer:before{content:"\\f5d2"}.bi-three-dots-vertical:before{content:"\\f5d3"}.bi-three-dots:before{content:"\\f5d4"}.bi-toggle-off:before{content:"\\f5d5"}.bi-toggle-on:before{content:"\\f5d6"}.bi-toggle2-off:before{content:"\\f5d7"}.bi-toggle2-on:before{content:"\\f5d8"}.bi-toggles:before{content:"\\f5d9"}.bi-toggles2:before{content:"\\f5da"}.bi-tools:before{content:"\\f5db"}.bi-tornado:before{content:"\\f5dc"}.bi-trash-fill:before{content:"\\f5dd"}.bi-trash:before{content:"\\f5de"}.bi-trash2-fill:before{content:"\\f5df"}.bi-trash2:before{content:"\\f5e0"}.bi-tree-fill:before{content:"\\f5e1"}.bi-tree:before{content:"\\f5e2"}.bi-triangle-fill:before{content:"\\f5e3"}.bi-triangle-half:before{content:"\\f5e4"}.bi-triangle:before{content:"\\f5e5"}.bi-trophy-fill:before{content:"\\f5e6"}.bi-trophy:before{content:"\\f5e7"}.bi-tropical-storm:before{content:"\\f5e8"}.bi-truck-flatbed:before{content:"\\f5e9"}.bi-truck:before{content:"\\f5ea"}.bi-tsunami:before{content:"\\f5eb"}.bi-tv-fill:before{content:"\\f5ec"}.bi-tv:before{content:"\\f5ed"}.bi-twitch:before{content:"\\f5ee"}.bi-twitter:before{content:"\\f5ef"}.bi-type-bold:before{content:"\\f5f0"}.bi-type-h1:before{content:"\\f5f1"}.bi-type-h2:before{content:"\\f5f2"}.bi-type-h3:before{content:"\\f5f3"}.bi-type-italic:before{content:"\\f5f4"}.bi-type-strikethrough:before{content:"\\f5f5"}.bi-type-underline:before{content:"\\f5f6"}.bi-type:before{content:"\\f5f7"}.bi-ui-checks-grid:before{content:"\\f5f8"}.bi-ui-checks:before{content:"\\f5f9"}.bi-ui-radios-grid:before{content:"\\f5fa"}.bi-ui-radios:before{content:"\\f5fb"}.bi-umbrella-fill:before{content:"\\f5fc"}.bi-umbrella:before{content:"\\f5fd"}.bi-union:before{content:"\\f5fe"}.bi-unlock-fill:before{content:"\\f5ff"}.bi-unlock:before{content:"\\f600"}.bi-upc-scan:before{content:"\\f601"}.bi-upc:before{content:"\\f602"}.bi-upload:before{content:"\\f603"}.bi-vector-pen:before{content:"\\f604"}.bi-view-list:before{content:"\\f605"}.bi-view-stacked:before{content:"\\f606"}.bi-vinyl-fill:before{content:"\\f607"}.bi-vinyl:before{content:"\\f608"}.bi-voicemail:before{content:"\\f609"}.bi-volume-down-fill:before{content:"\\f60a"}.bi-volume-down:before{content:"\\f60b"}.bi-volume-mute-fill:before{content:"\\f60c"}.bi-volume-mute:before{content:"\\f60d"}.bi-volume-off-fill:before{content:"\\f60e"}.bi-volume-off:before{content:"\\f60f"}.bi-volume-up-fill:before{content:"\\f610"}.bi-volume-up:before{content:"\\f611"}.bi-vr:before{content:"\\f612"}.bi-wallet-fill:before{content:"\\f613"}.bi-wallet:before{content:"\\f614"}.bi-wallet2:before{content:"\\f615"}.bi-watch:before{content:"\\f616"}.bi-water:before{content:"\\f617"}.bi-whatsapp:before{content:"\\f618"}.bi-wifi-1:before{content:"\\f619"}.bi-wifi-2:before{content:"\\f61a"}.bi-wifi-off:before{content:"\\f61b"}.bi-wifi:before{content:"\\f61c"}.bi-wind:before{content:"\\f61d"}.bi-window-dock:before{content:"\\f61e"}.bi-window-sidebar:before{content:"\\f61f"}.bi-window:before{content:"\\f620"}.bi-wrench:before{content:"\\f621"}.bi-x-circle-fill:before{content:"\\f622"}.bi-x-circle:before{content:"\\f623"}.bi-x-diamond-fill:before{content:"\\f624"}.bi-x-diamond:before{content:"\\f625"}.bi-x-octagon-fill:before{content:"\\f626"}.bi-x-octagon:before{content:"\\f627"}.bi-x-square-fill:before{content:"\\f628"}.bi-x-square:before{content:"\\f629"}.bi-x:before{content:"\\f62a"}.bi-youtube:before{content:"\\f62b"}.bi-zoom-in:before{content:"\\f62c"}.bi-zoom-out:before{content:"\\f62d"}.bi-bank:before{content:"\\f62e"}.bi-bank2:before{content:"\\f62f"}.bi-bell-slash-fill:before{content:"\\f630"}.bi-bell-slash:before{content:"\\f631"}.bi-cash-coin:before{content:"\\f632"}.bi-check-lg:before{content:"\\f633"}.bi-coin:before{content:"\\f634"}.bi-currency-bitcoin:before{content:"\\f635"}.bi-currency-dollar:before{content:"\\f636"}.bi-currency-euro:before{content:"\\f637"}.bi-currency-exchange:before{content:"\\f638"}.bi-currency-pound:before{content:"\\f639"}.bi-currency-yen:before{content:"\\f63a"}.bi-dash-lg:before{content:"\\f63b"}.bi-exclamation-lg:before{content:"\\f63c"}.bi-file-earmark-pdf-fill:before{content:"\\f63d"}.bi-file-earmark-pdf:before{content:"\\f63e"}.bi-file-pdf-fill:before{content:"\\f63f"}.bi-file-pdf:before{content:"\\f640"}.bi-gender-ambiguous:before{content:"\\f641"}.bi-gender-female:before{content:"\\f642"}.bi-gender-male:before{content:"\\f643"}.bi-gender-trans:before{content:"\\f644"}.bi-headset-vr:before{content:"\\f645"}.bi-info-lg:before{content:"\\f646"}.bi-mastodon:before{content:"\\f647"}.bi-messenger:before{content:"\\f648"}.bi-piggy-bank-fill:before{content:"\\f649"}.bi-piggy-bank:before{content:"\\f64a"}.bi-pin-map-fill:before{content:"\\f64b"}.bi-pin-map:before{content:"\\f64c"}.bi-plus-lg:before{content:"\\f64d"}.bi-question-lg:before{content:"\\f64e"}.bi-recycle:before{content:"\\f64f"}.bi-reddit:before{content:"\\f650"}.bi-safe-fill:before{content:"\\f651"}.bi-safe2-fill:before{content:"\\f652"}.bi-safe2:before{content:"\\f653"}.bi-sd-card-fill:before{content:"\\f654"}.bi-sd-card:before{content:"\\f655"}.bi-skype:before{content:"\\f656"}.bi-slash-lg:before{content:"\\f657"}.bi-translate:before{content:"\\f658"}.bi-x-lg:before{content:"\\f659"}.bi-safe:before{content:"\\f65a"}.bi-apple:before{content:"\\f65b"}.bi-microsoft:before{content:"\\f65d"}.bi-windows:before{content:"\\f65e"}.bi-behance:before{content:"\\f65c"}.bi-dribbble:before{content:"\\f65f"}.bi-line:before{content:"\\f660"}.bi-medium:before{content:"\\f661"}.bi-paypal:before{content:"\\f662"}.bi-pinterest:before{content:"\\f663"}.bi-signal:before{content:"\\f664"}.bi-snapchat:before{content:"\\f665"}.bi-spotify:before{content:"\\f666"}.bi-stack-overflow:before{content:"\\f667"}.bi-strava:before{content:"\\f668"}.bi-wordpress:before{content:"\\f669"}.bi-vimeo:before{content:"\\f66a"}.bi-activity:before{content:"\\f66b"}.bi-easel2-fill:before{content:"\\f66c"}.bi-easel2:before{content:"\\f66d"}.bi-easel3-fill:before{content:"\\f66e"}.bi-easel3:before{content:"\\f66f"}.bi-fan:before{content:"\\f670"}.bi-fingerprint:before{content:"\\f671"}.bi-graph-down-arrow:before{content:"\\f672"}.bi-graph-up-arrow:before{content:"\\f673"}.bi-hypnotize:before{content:"\\f674"}.bi-magic:before{content:"\\f675"}.bi-person-rolodex:before{content:"\\f676"}.bi-person-video:before{content:"\\f677"}.bi-person-video2:before{content:"\\f678"}.bi-person-video3:before{content:"\\f679"}.bi-person-workspace:before{content:"\\f67a"}.bi-radioactive:before{content:"\\f67b"}.bi-webcam-fill:before{content:"\\f67c"}.bi-webcam:before{content:"\\f67d"}.bi-yin-yang:before{content:"\\f67e"}.bi-bandaid-fill:before{content:"\\f680"}.bi-bandaid:before{content:"\\f681"}.bi-bluetooth:before{content:"\\f682"}.bi-body-text:before{content:"\\f683"}.bi-boombox:before{content:"\\f684"}.bi-boxes:before{content:"\\f685"}.bi-dpad-fill:before{content:"\\f686"}.bi-dpad:before{content:"\\f687"}.bi-ear-fill:before{content:"\\f688"}.bi-ear:before{content:"\\f689"}.bi-envelope-check-fill:before{content:"\\f68b"}.bi-envelope-check:before{content:"\\f68c"}.bi-envelope-dash-fill:before{content:"\\f68e"}.bi-envelope-dash:before{content:"\\f68f"}.bi-envelope-exclamation-fill:before{content:"\\f691"}.bi-envelope-exclamation:before{content:"\\f692"}.bi-envelope-plus-fill:before{content:"\\f693"}.bi-envelope-plus:before{content:"\\f694"}.bi-envelope-slash-fill:before{content:"\\f696"}.bi-envelope-slash:before{content:"\\f697"}.bi-envelope-x-fill:before{content:"\\f699"}.bi-envelope-x:before{content:"\\f69a"}.bi-explicit-fill:before{content:"\\f69b"}.bi-explicit:before{content:"\\f69c"}.bi-git:before{content:"\\f69d"}.bi-infinity:before{content:"\\f69e"}.bi-list-columns-reverse:before{content:"\\f69f"}.bi-list-columns:before{content:"\\f6a0"}.bi-meta:before{content:"\\f6a1"}.bi-nintendo-switch:before{content:"\\f6a4"}.bi-pc-display-horizontal:before{content:"\\f6a5"}.bi-pc-display:before{content:"\\f6a6"}.bi-pc-horizontal:before{content:"\\f6a7"}.bi-pc:before{content:"\\f6a8"}.bi-playstation:before{content:"\\f6a9"}.bi-plus-slash-minus:before{content:"\\f6aa"}.bi-projector-fill:before{content:"\\f6ab"}.bi-projector:before{content:"\\f6ac"}.bi-qr-code-scan:before{content:"\\f6ad"}.bi-qr-code:before{content:"\\f6ae"}.bi-quora:before{content:"\\f6af"}.bi-quote:before{content:"\\f6b0"}.bi-robot:before{content:"\\f6b1"}.bi-send-check-fill:before{content:"\\f6b2"}.bi-send-check:before{content:"\\f6b3"}.bi-send-dash-fill:before{content:"\\f6b4"}.bi-send-dash:before{content:"\\f6b5"}.bi-send-exclamation-fill:before{content:"\\f6b7"}.bi-send-exclamation:before{content:"\\f6b8"}.bi-send-fill:before{content:"\\f6b9"}.bi-send-plus-fill:before{content:"\\f6ba"}.bi-send-plus:before{content:"\\f6bb"}.bi-send-slash-fill:before{content:"\\f6bc"}.bi-send-slash:before{content:"\\f6bd"}.bi-send-x-fill:before{content:"\\f6be"}.bi-send-x:before{content:"\\f6bf"}.bi-send:before{content:"\\f6c0"}.bi-steam:before{content:"\\f6c1"}.bi-terminal-dash:before{content:"\\f6c3"}.bi-terminal-plus:before{content:"\\f6c4"}.bi-terminal-split:before{content:"\\f6c5"}.bi-ticket-detailed-fill:before{content:"\\f6c6"}.bi-ticket-detailed:before{content:"\\f6c7"}.bi-ticket-fill:before{content:"\\f6c8"}.bi-ticket-perforated-fill:before{content:"\\f6c9"}.bi-ticket-perforated:before{content:"\\f6ca"}.bi-ticket:before{content:"\\f6cb"}.bi-tiktok:before{content:"\\f6cc"}.bi-window-dash:before{content:"\\f6cd"}.bi-window-desktop:before{content:"\\f6ce"}.bi-window-fullscreen:before{content:"\\f6cf"}.bi-window-plus:before{content:"\\f6d0"}.bi-window-split:before{content:"\\f6d1"}.bi-window-stack:before{content:"\\f6d2"}.bi-window-x:before{content:"\\f6d3"}.bi-xbox:before{content:"\\f6d4"}.bi-ethernet:before{content:"\\f6d5"}.bi-hdmi-fill:before{content:"\\f6d6"}.bi-hdmi:before{content:"\\f6d7"}.bi-usb-c-fill:before{content:"\\f6d8"}.bi-usb-c:before{content:"\\f6d9"}.bi-usb-fill:before{content:"\\f6da"}.bi-usb-plug-fill:before{content:"\\f6db"}.bi-usb-plug:before{content:"\\f6dc"}.bi-usb-symbol:before{content:"\\f6dd"}.bi-usb:before{content:"\\f6de"}.bi-boombox-fill:before{content:"\\f6df"}.bi-displayport:before{content:"\\f6e1"}.bi-gpu-card:before{content:"\\f6e2"}.bi-memory:before{content:"\\f6e3"}.bi-modem-fill:before{content:"\\f6e4"}.bi-modem:before{content:"\\f6e5"}.bi-motherboard-fill:before{content:"\\f6e6"}.bi-motherboard:before{content:"\\f6e7"}.bi-optical-audio-fill:before{content:"\\f6e8"}.bi-optical-audio:before{content:"\\f6e9"}.bi-pci-card:before{content:"\\f6ea"}.bi-router-fill:before{content:"\\f6eb"}.bi-router:before{content:"\\f6ec"}.bi-thunderbolt-fill:before{content:"\\f6ef"}.bi-thunderbolt:before{content:"\\f6f0"}.bi-usb-drive-fill:before{content:"\\f6f1"}.bi-usb-drive:before{content:"\\f6f2"}.bi-usb-micro-fill:before{content:"\\f6f3"}.bi-usb-micro:before{content:"\\f6f4"}.bi-usb-mini-fill:before{content:"\\f6f5"}.bi-usb-mini:before{content:"\\f6f6"}.bi-cloud-haze2:before{content:"\\f6f7"}.bi-device-hdd-fill:before{content:"\\f6f8"}.bi-device-hdd:before{content:"\\f6f9"}.bi-device-ssd-fill:before{content:"\\f6fa"}.bi-device-ssd:before{content:"\\f6fb"}.bi-displayport-fill:before{content:"\\f6fc"}.bi-mortarboard-fill:before{content:"\\f6fd"}.bi-mortarboard:before{content:"\\f6fe"}.bi-terminal-x:before{content:"\\f6ff"}.bi-arrow-through-heart-fill:before{content:"\\f700"}.bi-arrow-through-heart:before{content:"\\f701"}.bi-badge-sd-fill:before{content:"\\f702"}.bi-badge-sd:before{content:"\\f703"}.bi-bag-heart-fill:before{content:"\\f704"}.bi-bag-heart:before{content:"\\f705"}.bi-balloon-fill:before{content:"\\f706"}.bi-balloon-heart-fill:before{content:"\\f707"}.bi-balloon-heart:before{content:"\\f708"}.bi-balloon:before{content:"\\f709"}.bi-box2-fill:before{content:"\\f70a"}.bi-box2-heart-fill:before{content:"\\f70b"}.bi-box2-heart:before{content:"\\f70c"}.bi-box2:before{content:"\\f70d"}.bi-braces-asterisk:before{content:"\\f70e"}.bi-calendar-heart-fill:before{content:"\\f70f"}.bi-calendar-heart:before{content:"\\f710"}.bi-calendar2-heart-fill:before{content:"\\f711"}.bi-calendar2-heart:before{content:"\\f712"}.bi-chat-heart-fill:before{content:"\\f713"}.bi-chat-heart:before{content:"\\f714"}.bi-chat-left-heart-fill:before{content:"\\f715"}.bi-chat-left-heart:before{content:"\\f716"}.bi-chat-right-heart-fill:before{content:"\\f717"}.bi-chat-right-heart:before{content:"\\f718"}.bi-chat-square-heart-fill:before{content:"\\f719"}.bi-chat-square-heart:before{content:"\\f71a"}.bi-clipboard-check-fill:before{content:"\\f71b"}.bi-clipboard-data-fill:before{content:"\\f71c"}.bi-clipboard-fill:before{content:"\\f71d"}.bi-clipboard-heart-fill:before{content:"\\f71e"}.bi-clipboard-heart:before{content:"\\f71f"}.bi-clipboard-minus-fill:before{content:"\\f720"}.bi-clipboard-plus-fill:before{content:"\\f721"}.bi-clipboard-pulse:before{content:"\\f722"}.bi-clipboard-x-fill:before{content:"\\f723"}.bi-clipboard2-check-fill:before{content:"\\f724"}.bi-clipboard2-check:before{content:"\\f725"}.bi-clipboard2-data-fill:before{content:"\\f726"}.bi-clipboard2-data:before{content:"\\f727"}.bi-clipboard2-fill:before{content:"\\f728"}.bi-clipboard2-heart-fill:before{content:"\\f729"}.bi-clipboard2-heart:before{content:"\\f72a"}.bi-clipboard2-minus-fill:before{content:"\\f72b"}.bi-clipboard2-minus:before{content:"\\f72c"}.bi-clipboard2-plus-fill:before{content:"\\f72d"}.bi-clipboard2-plus:before{content:"\\f72e"}.bi-clipboard2-pulse-fill:before{content:"\\f72f"}.bi-clipboard2-pulse:before{content:"\\f730"}.bi-clipboard2-x-fill:before{content:"\\f731"}.bi-clipboard2-x:before{content:"\\f732"}.bi-clipboard2:before{content:"\\f733"}.bi-emoji-kiss-fill:before{content:"\\f734"}.bi-emoji-kiss:before{content:"\\f735"}.bi-envelope-heart-fill:before{content:"\\f736"}.bi-envelope-heart:before{content:"\\f737"}.bi-envelope-open-heart-fill:before{content:"\\f738"}.bi-envelope-open-heart:before{content:"\\f739"}.bi-envelope-paper-fill:before{content:"\\f73a"}.bi-envelope-paper-heart-fill:before{content:"\\f73b"}.bi-envelope-paper-heart:before{content:"\\f73c"}.bi-envelope-paper:before{content:"\\f73d"}.bi-filetype-aac:before{content:"\\f73e"}.bi-filetype-ai:before{content:"\\f73f"}.bi-filetype-bmp:before{content:"\\f740"}.bi-filetype-cs:before{content:"\\f741"}.bi-filetype-css:before{content:"\\f742"}.bi-filetype-csv:before{content:"\\f743"}.bi-filetype-doc:before{content:"\\f744"}.bi-filetype-docx:before{content:"\\f745"}.bi-filetype-exe:before{content:"\\f746"}.bi-filetype-gif:before{content:"\\f747"}.bi-filetype-heic:before{content:"\\f748"}.bi-filetype-html:before{content:"\\f749"}.bi-filetype-java:before{content:"\\f74a"}.bi-filetype-jpg:before{content:"\\f74b"}.bi-filetype-js:before{content:"\\f74c"}.bi-filetype-jsx:before{content:"\\f74d"}.bi-filetype-key:before{content:"\\f74e"}.bi-filetype-m4p:before{content:"\\f74f"}.bi-filetype-md:before{content:"\\f750"}.bi-filetype-mdx:before{content:"\\f751"}.bi-filetype-mov:before{content:"\\f752"}.bi-filetype-mp3:before{content:"\\f753"}.bi-filetype-mp4:before{content:"\\f754"}.bi-filetype-otf:before{content:"\\f755"}.bi-filetype-pdf:before{content:"\\f756"}.bi-filetype-php:before{content:"\\f757"}.bi-filetype-png:before{content:"\\f758"}.bi-filetype-ppt:before{content:"\\f75a"}.bi-filetype-psd:before{content:"\\f75b"}.bi-filetype-py:before{content:"\\f75c"}.bi-filetype-raw:before{content:"\\f75d"}.bi-filetype-rb:before{content:"\\f75e"}.bi-filetype-sass:before{content:"\\f75f"}.bi-filetype-scss:before{content:"\\f760"}.bi-filetype-sh:before{content:"\\f761"}.bi-filetype-svg:before{content:"\\f762"}.bi-filetype-tiff:before{content:"\\f763"}.bi-filetype-tsx:before{content:"\\f764"}.bi-filetype-ttf:before{content:"\\f765"}.bi-filetype-txt:before{content:"\\f766"}.bi-filetype-wav:before{content:"\\f767"}.bi-filetype-woff:before{content:"\\f768"}.bi-filetype-xls:before{content:"\\f76a"}.bi-filetype-xml:before{content:"\\f76b"}.bi-filetype-yml:before{content:"\\f76c"}.bi-heart-arrow:before{content:"\\f76d"}.bi-heart-pulse-fill:before{content:"\\f76e"}.bi-heart-pulse:before{content:"\\f76f"}.bi-heartbreak-fill:before{content:"\\f770"}.bi-heartbreak:before{content:"\\f771"}.bi-hearts:before{content:"\\f772"}.bi-hospital-fill:before{content:"\\f773"}.bi-hospital:before{content:"\\f774"}.bi-house-heart-fill:before{content:"\\f775"}.bi-house-heart:before{content:"\\f776"}.bi-incognito:before{content:"\\f777"}.bi-magnet-fill:before{content:"\\f778"}.bi-magnet:before{content:"\\f779"}.bi-person-heart:before{content:"\\f77a"}.bi-person-hearts:before{content:"\\f77b"}.bi-phone-flip:before{content:"\\f77c"}.bi-plugin:before{content:"\\f77d"}.bi-postage-fill:before{content:"\\f77e"}.bi-postage-heart-fill:before{content:"\\f77f"}.bi-postage-heart:before{content:"\\f780"}.bi-postage:before{content:"\\f781"}.bi-postcard-fill:before{content:"\\f782"}.bi-postcard-heart-fill:before{content:"\\f783"}.bi-postcard-heart:before{content:"\\f784"}.bi-postcard:before{content:"\\f785"}.bi-search-heart-fill:before{content:"\\f786"}.bi-search-heart:before{content:"\\f787"}.bi-sliders2-vertical:before{content:"\\f788"}.bi-sliders2:before{content:"\\f789"}.bi-trash3-fill:before{content:"\\f78a"}.bi-trash3:before{content:"\\f78b"}.bi-valentine:before{content:"\\f78c"}.bi-valentine2:before{content:"\\f78d"}.bi-wrench-adjustable-circle-fill:before{content:"\\f78e"}.bi-wrench-adjustable-circle:before{content:"\\f78f"}.bi-wrench-adjustable:before{content:"\\f790"}.bi-filetype-json:before{content:"\\f791"}.bi-filetype-pptx:before{content:"\\f792"}.bi-filetype-xlsx:before{content:"\\f793"}.bi-1-circle-fill:before{content:"\\f796"}.bi-1-circle:before{content:"\\f797"}.bi-1-square-fill:before{content:"\\f798"}.bi-1-square:before{content:"\\f799"}.bi-2-circle-fill:before{content:"\\f79c"}.bi-2-circle:before{content:"\\f79d"}.bi-2-square-fill:before{content:"\\f79e"}.bi-2-square:before{content:"\\f79f"}.bi-3-circle-fill:before{content:"\\f7a2"}.bi-3-circle:before{content:"\\f7a3"}.bi-3-square-fill:before{content:"\\f7a4"}.bi-3-square:before{content:"\\f7a5"}.bi-4-circle-fill:before{content:"\\f7a8"}.bi-4-circle:before{content:"\\f7a9"}.bi-4-square-fill:before{content:"\\f7aa"}.bi-4-square:before{content:"\\f7ab"}.bi-5-circle-fill:before{content:"\\f7ae"}.bi-5-circle:before{content:"\\f7af"}.bi-5-square-fill:before{content:"\\f7b0"}.bi-5-square:before{content:"\\f7b1"}.bi-6-circle-fill:before{content:"\\f7b4"}.bi-6-circle:before{content:"\\f7b5"}.bi-6-square-fill:before{content:"\\f7b6"}.bi-6-square:before{content:"\\f7b7"}.bi-7-circle-fill:before{content:"\\f7ba"}.bi-7-circle:before{content:"\\f7bb"}.bi-7-square-fill:before{content:"\\f7bc"}.bi-7-square:before{content:"\\f7bd"}.bi-8-circle-fill:before{content:"\\f7c0"}.bi-8-circle:before{content:"\\f7c1"}.bi-8-square-fill:before{content:"\\f7c2"}.bi-8-square:before{content:"\\f7c3"}.bi-9-circle-fill:before{content:"\\f7c6"}.bi-9-circle:before{content:"\\f7c7"}.bi-9-square-fill:before{content:"\\f7c8"}.bi-9-square:before{content:"\\f7c9"}.bi-airplane-engines-fill:before{content:"\\f7ca"}.bi-airplane-engines:before{content:"\\f7cb"}.bi-airplane-fill:before{content:"\\f7cc"}.bi-airplane:before{content:"\\f7cd"}.bi-alexa:before{content:"\\f7ce"}.bi-alipay:before{content:"\\f7cf"}.bi-android:before{content:"\\f7d0"}.bi-android2:before{content:"\\f7d1"}.bi-box-fill:before{content:"\\f7d2"}.bi-box-seam-fill:before{content:"\\f7d3"}.bi-browser-chrome:before{content:"\\f7d4"}.bi-browser-edge:before{content:"\\f7d5"}.bi-browser-firefox:before{content:"\\f7d6"}.bi-browser-safari:before{content:"\\f7d7"}.bi-c-circle-fill:before{content:"\\f7da"}.bi-c-circle:before{content:"\\f7db"}.bi-c-square-fill:before{content:"\\f7dc"}.bi-c-square:before{content:"\\f7dd"}.bi-capsule-pill:before{content:"\\f7de"}.bi-capsule:before{content:"\\f7df"}.bi-car-front-fill:before{content:"\\f7e0"}.bi-car-front:before{content:"\\f7e1"}.bi-cassette-fill:before{content:"\\f7e2"}.bi-cassette:before{content:"\\f7e3"}.bi-cc-circle-fill:before{content:"\\f7e6"}.bi-cc-circle:before{content:"\\f7e7"}.bi-cc-square-fill:before{content:"\\f7e8"}.bi-cc-square:before{content:"\\f7e9"}.bi-cup-hot-fill:before{content:"\\f7ea"}.bi-cup-hot:before{content:"\\f7eb"}.bi-currency-rupee:before{content:"\\f7ec"}.bi-dropbox:before{content:"\\f7ed"}.bi-escape:before{content:"\\f7ee"}.bi-fast-forward-btn-fill:before{content:"\\f7ef"}.bi-fast-forward-btn:before{content:"\\f7f0"}.bi-fast-forward-circle-fill:before{content:"\\f7f1"}.bi-fast-forward-circle:before{content:"\\f7f2"}.bi-fast-forward-fill:before{content:"\\f7f3"}.bi-fast-forward:before{content:"\\f7f4"}.bi-filetype-sql:before{content:"\\f7f5"}.bi-fire:before{content:"\\f7f6"}.bi-google-play:before{content:"\\f7f7"}.bi-h-circle-fill:before{content:"\\f7fa"}.bi-h-circle:before{content:"\\f7fb"}.bi-h-square-fill:before{content:"\\f7fc"}.bi-h-square:before{content:"\\f7fd"}.bi-indent:before{content:"\\f7fe"}.bi-lungs-fill:before{content:"\\f7ff"}.bi-lungs:before{content:"\\f800"}.bi-microsoft-teams:before{content:"\\f801"}.bi-p-circle-fill:before{content:"\\f804"}.bi-p-circle:before{content:"\\f805"}.bi-p-square-fill:before{content:"\\f806"}.bi-p-square:before{content:"\\f807"}.bi-pass-fill:before{content:"\\f808"}.bi-pass:before{content:"\\f809"}.bi-prescription:before{content:"\\f80a"}.bi-prescription2:before{content:"\\f80b"}.bi-r-circle-fill:before{content:"\\f80e"}.bi-r-circle:before{content:"\\f80f"}.bi-r-square-fill:before{content:"\\f810"}.bi-r-square:before{content:"\\f811"}.bi-repeat-1:before{content:"\\f812"}.bi-repeat:before{content:"\\f813"}.bi-rewind-btn-fill:before{content:"\\f814"}.bi-rewind-btn:before{content:"\\f815"}.bi-rewind-circle-fill:before{content:"\\f816"}.bi-rewind-circle:before{content:"\\f817"}.bi-rewind-fill:before{content:"\\f818"}.bi-rewind:before{content:"\\f819"}.bi-train-freight-front-fill:before{content:"\\f81a"}.bi-train-freight-front:before{content:"\\f81b"}.bi-train-front-fill:before{content:"\\f81c"}.bi-train-front:before{content:"\\f81d"}.bi-train-lightrail-front-fill:before{content:"\\f81e"}.bi-train-lightrail-front:before{content:"\\f81f"}.bi-truck-front-fill:before{content:"\\f820"}.bi-truck-front:before{content:"\\f821"}.bi-ubuntu:before{content:"\\f822"}.bi-unindent:before{content:"\\f823"}.bi-unity:before{content:"\\f824"}.bi-universal-access-circle:before{content:"\\f825"}.bi-universal-access:before{content:"\\f826"}.bi-virus:before{content:"\\f827"}.bi-virus2:before{content:"\\f828"}.bi-wechat:before{content:"\\f829"}.bi-yelp:before{content:"\\f82a"}.bi-sign-stop-fill:before{content:"\\f82b"}.bi-sign-stop-lights-fill:before{content:"\\f82c"}.bi-sign-stop-lights:before{content:"\\f82d"}.bi-sign-stop:before{content:"\\f82e"}.bi-sign-turn-left-fill:before{content:"\\f82f"}.bi-sign-turn-left:before{content:"\\f830"}.bi-sign-turn-right-fill:before{content:"\\f831"}.bi-sign-turn-right:before{content:"\\f832"}.bi-sign-turn-slight-left-fill:before{content:"\\f833"}.bi-sign-turn-slight-left:before{content:"\\f834"}.bi-sign-turn-slight-right-fill:before{content:"\\f835"}.bi-sign-turn-slight-right:before{content:"\\f836"}.bi-sign-yield-fill:before{content:"\\f837"}.bi-sign-yield:before{content:"\\f838"}.bi-ev-station-fill:before{content:"\\f839"}.bi-ev-station:before{content:"\\f83a"}.bi-fuel-pump-diesel-fill:before{content:"\\f83b"}.bi-fuel-pump-diesel:before{content:"\\f83c"}.bi-fuel-pump-fill:before{content:"\\f83d"}.bi-fuel-pump:before{content:"\\f83e"}.bi-0-circle-fill:before{content:"\\f83f"}.bi-0-circle:before{content:"\\f840"}.bi-0-square-fill:before{content:"\\f841"}.bi-0-square:before{content:"\\f842"}.bi-rocket-fill:before{content:"\\f843"}.bi-rocket-takeoff-fill:before{content:"\\f844"}.bi-rocket-takeoff:before{content:"\\f845"}.bi-rocket:before{content:"\\f846"}.bi-stripe:before{content:"\\f847"}.bi-subscript:before{content:"\\f848"}.bi-superscript:before{content:"\\f849"}.bi-trello:before{content:"\\f84a"}.bi-envelope-at-fill:before{content:"\\f84b"}.bi-envelope-at:before{content:"\\f84c"}.bi-regex:before{content:"\\f84d"}.bi-text-wrap:before{content:"\\f84e"}.bi-sign-dead-end-fill:before{content:"\\f84f"}.bi-sign-dead-end:before{content:"\\f850"}.bi-sign-do-not-enter-fill:before{content:"\\f851"}.bi-sign-do-not-enter:before{content:"\\f852"}.bi-sign-intersection-fill:before{content:"\\f853"}.bi-sign-intersection-side-fill:before{content:"\\f854"}.bi-sign-intersection-side:before{content:"\\f855"}.bi-sign-intersection-t-fill:before{content:"\\f856"}.bi-sign-intersection-t:before{content:"\\f857"}.bi-sign-intersection-y-fill:before{content:"\\f858"}.bi-sign-intersection-y:before{content:"\\f859"}.bi-sign-intersection:before{content:"\\f85a"}.bi-sign-merge-left-fill:before{content:"\\f85b"}.bi-sign-merge-left:before{content:"\\f85c"}.bi-sign-merge-right-fill:before{content:"\\f85d"}.bi-sign-merge-right:before{content:"\\f85e"}.bi-sign-no-left-turn-fill:before{content:"\\f85f"}.bi-sign-no-left-turn:before{content:"\\f860"}.bi-sign-no-parking-fill:before{content:"\\f861"}.bi-sign-no-parking:before{content:"\\f862"}.bi-sign-no-right-turn-fill:before{content:"\\f863"}.bi-sign-no-right-turn:before{content:"\\f864"}.bi-sign-railroad-fill:before{content:"\\f865"}.bi-sign-railroad:before{content:"\\f866"}.bi-building-add:before{content:"\\f867"}.bi-building-check:before{content:"\\f868"}.bi-building-dash:before{content:"\\f869"}.bi-building-down:before{content:"\\f86a"}.bi-building-exclamation:before{content:"\\f86b"}.bi-building-fill-add:before{content:"\\f86c"}.bi-building-fill-check:before{content:"\\f86d"}.bi-building-fill-dash:before{content:"\\f86e"}.bi-building-fill-down:before{content:"\\f86f"}.bi-building-fill-exclamation:before{content:"\\f870"}.bi-building-fill-gear:before{content:"\\f871"}.bi-building-fill-lock:before{content:"\\f872"}.bi-building-fill-slash:before{content:"\\f873"}.bi-building-fill-up:before{content:"\\f874"}.bi-building-fill-x:before{content:"\\f875"}.bi-building-fill:before{content:"\\f876"}.bi-building-gear:before{content:"\\f877"}.bi-building-lock:before{content:"\\f878"}.bi-building-slash:before{content:"\\f879"}.bi-building-up:before{content:"\\f87a"}.bi-building-x:before{content:"\\f87b"}.bi-buildings-fill:before{content:"\\f87c"}.bi-buildings:before{content:"\\f87d"}.bi-bus-front-fill:before{content:"\\f87e"}.bi-bus-front:before{content:"\\f87f"}.bi-ev-front-fill:before{content:"\\f880"}.bi-ev-front:before{content:"\\f881"}.bi-globe-americas:before{content:"\\f882"}.bi-globe-asia-australia:before{content:"\\f883"}.bi-globe-central-south-asia:before{content:"\\f884"}.bi-globe-europe-africa:before{content:"\\f885"}.bi-house-add-fill:before{content:"\\f886"}.bi-house-add:before{content:"\\f887"}.bi-house-check-fill:before{content:"\\f888"}.bi-house-check:before{content:"\\f889"}.bi-house-dash-fill:before{content:"\\f88a"}.bi-house-dash:before{content:"\\f88b"}.bi-house-down-fill:before{content:"\\f88c"}.bi-house-down:before{content:"\\f88d"}.bi-house-exclamation-fill:before{content:"\\f88e"}.bi-house-exclamation:before{content:"\\f88f"}.bi-house-gear-fill:before{content:"\\f890"}.bi-house-gear:before{content:"\\f891"}.bi-house-lock-fill:before{content:"\\f892"}.bi-house-lock:before{content:"\\f893"}.bi-house-slash-fill:before{content:"\\f894"}.bi-house-slash:before{content:"\\f895"}.bi-house-up-fill:before{content:"\\f896"}.bi-house-up:before{content:"\\f897"}.bi-house-x-fill:before{content:"\\f898"}.bi-house-x:before{content:"\\f899"}.bi-person-add:before{content:"\\f89a"}.bi-person-down:before{content:"\\f89b"}.bi-person-exclamation:before{content:"\\f89c"}.bi-person-fill-add:before{content:"\\f89d"}.bi-person-fill-check:before{content:"\\f89e"}.bi-person-fill-dash:before{content:"\\f89f"}.bi-person-fill-down:before{content:"\\f8a0"}.bi-person-fill-exclamation:before{content:"\\f8a1"}.bi-person-fill-gear:before{content:"\\f8a2"}.bi-person-fill-lock:before{content:"\\f8a3"}.bi-person-fill-slash:before{content:"\\f8a4"}.bi-person-fill-up:before{content:"\\f8a5"}.bi-person-fill-x:before{content:"\\f8a6"}.bi-person-gear:before{content:"\\f8a7"}.bi-person-lock:before{content:"\\f8a8"}.bi-person-slash:before{content:"\\f8a9"}.bi-person-up:before{content:"\\f8aa"}.bi-scooter:before{content:"\\f8ab"}.bi-taxi-front-fill:before{content:"\\f8ac"}.bi-taxi-front:before{content:"\\f8ad"}.bi-amd:before{content:"\\f8ae"}.bi-database-add:before{content:"\\f8af"}.bi-database-check:before{content:"\\f8b0"}.bi-database-dash:before{content:"\\f8b1"}.bi-database-down:before{content:"\\f8b2"}.bi-database-exclamation:before{content:"\\f8b3"}.bi-database-fill-add:before{content:"\\f8b4"}.bi-database-fill-check:before{content:"\\f8b5"}.bi-database-fill-dash:before{content:"\\f8b6"}.bi-database-fill-down:before{content:"\\f8b7"}.bi-database-fill-exclamation:before{content:"\\f8b8"}.bi-database-fill-gear:before{content:"\\f8b9"}.bi-database-fill-lock:before{content:"\\f8ba"}.bi-database-fill-slash:before{content:"\\f8bb"}.bi-database-fill-up:before{content:"\\f8bc"}.bi-database-fill-x:before{content:"\\f8bd"}.bi-database-fill:before{content:"\\f8be"}.bi-database-gear:before{content:"\\f8bf"}.bi-database-lock:before{content:"\\f8c0"}.bi-database-slash:before{content:"\\f8c1"}.bi-database-up:before{content:"\\f8c2"}.bi-database-x:before{content:"\\f8c3"}.bi-database:before{content:"\\f8c4"}.bi-houses-fill:before{content:"\\f8c5"}.bi-houses:before{content:"\\f8c6"}.bi-nvidia:before{content:"\\f8c7"}.bi-person-vcard-fill:before{content:"\\f8c8"}.bi-person-vcard:before{content:"\\f8c9"}.bi-sina-weibo:before{content:"\\f8ca"}.bi-tencent-qq:before{content:"\\f8cb"}.bi-wikipedia:before{content:"\\f8cc"}.bi-alphabet-uppercase:before{content:"\\f2a5"}.bi-alphabet:before{content:"\\f68a"}.bi-amazon:before{content:"\\f68d"}.bi-arrows-collapse-vertical:before{content:"\\f690"}.bi-arrows-expand-vertical:before{content:"\\f695"}.bi-arrows-vertical:before{content:"\\f698"}.bi-arrows:before{content:"\\f6a2"}.bi-ban-fill:before{content:"\\f6a3"}.bi-ban:before{content:"\\f6b6"}.bi-bing:before{content:"\\f6c2"}.bi-cake:before{content:"\\f6e0"}.bi-cake2:before{content:"\\f6ed"}.bi-cookie:before{content:"\\f6ee"}.bi-copy:before{content:"\\f759"}.bi-crosshair:before{content:"\\f769"}.bi-crosshair2:before{content:"\\f794"}.bi-emoji-astonished-fill:before{content:"\\f795"}.bi-emoji-astonished:before{content:"\\f79a"}.bi-emoji-grimace-fill:before{content:"\\f79b"}.bi-emoji-grimace:before{content:"\\f7a0"}.bi-emoji-grin-fill:before{content:"\\f7a1"}.bi-emoji-grin:before{content:"\\f7a6"}.bi-emoji-surprise-fill:before{content:"\\f7a7"}.bi-emoji-surprise:before{content:"\\f7ac"}.bi-emoji-tear-fill:before{content:"\\f7ad"}.bi-emoji-tear:before{content:"\\f7b2"}.bi-envelope-arrow-down-fill:before{content:"\\f7b3"}.bi-envelope-arrow-down:before{content:"\\f7b8"}.bi-envelope-arrow-up-fill:before{content:"\\f7b9"}.bi-envelope-arrow-up:before{content:"\\f7be"}.bi-feather:before{content:"\\f7bf"}.bi-feather2:before{content:"\\f7c4"}.bi-floppy-fill:before{content:"\\f7c5"}.bi-floppy:before{content:"\\f7d8"}.bi-floppy2-fill:before{content:"\\f7d9"}.bi-floppy2:before{content:"\\f7e4"}.bi-gitlab:before{content:"\\f7e5"}.bi-highlighter:before{content:"\\f7f8"}.bi-marker-tip:before{content:"\\f802"}.bi-nvme-fill:before{content:"\\f803"}.bi-nvme:before{content:"\\f80c"}.bi-opencollective:before{content:"\\f80d"}.bi-pci-card-network:before{content:"\\f8cd"}.bi-pci-card-sound:before{content:"\\f8ce"}.bi-radar:before{content:"\\f8cf"}.bi-send-arrow-down-fill:before{content:"\\f8d0"}.bi-send-arrow-down:before{content:"\\f8d1"}.bi-send-arrow-up-fill:before{content:"\\f8d2"}.bi-send-arrow-up:before{content:"\\f8d3"}.bi-sim-slash-fill:before{content:"\\f8d4"}.bi-sim-slash:before{content:"\\f8d5"}.bi-sourceforge:before{content:"\\f8d6"}.bi-substack:before{content:"\\f8d7"}.bi-threads-fill:before{content:"\\f8d8"}.bi-threads:before{content:"\\f8d9"}.bi-transparency:before{content:"\\f8da"}.bi-twitter-x:before{content:"\\f8db"}.bi-type-h4:before{content:"\\f8dc"}.bi-type-h5:before{content:"\\f8dd"}.bi-type-h6:before{content:"\\f8de"}.bi-backpack-fill:before{content:"\\f8df"}.bi-backpack:before{content:"\\f8e0"}.bi-backpack2-fill:before{content:"\\f8e1"}.bi-backpack2:before{content:"\\f8e2"}.bi-backpack3-fill:before{content:"\\f8e3"}.bi-backpack3:before{content:"\\f8e4"}.bi-backpack4-fill:before{content:"\\f8e5"}.bi-backpack4:before{content:"\\f8e6"}.bi-brilliance:before{content:"\\f8e7"}.bi-cake-fill:before{content:"\\f8e8"}.bi-cake2-fill:before{content:"\\f8e9"}.bi-duffle-fill:before{content:"\\f8ea"}.bi-duffle:before{content:"\\f8eb"}.bi-exposure:before{content:"\\f8ec"}.bi-gender-neuter:before{content:"\\f8ed"}.bi-highlights:before{content:"\\f8ee"}.bi-luggage-fill:before{content:"\\f8ef"}.bi-luggage:before{content:"\\f8f0"}.bi-mailbox-flag:before{content:"\\f8f1"}.bi-mailbox2-flag:before{content:"\\f8f2"}.bi-noise-reduction:before{content:"\\f8f3"}.bi-passport-fill:before{content:"\\f8f4"}.bi-passport:before{content:"\\f8f5"}.bi-person-arms-up:before{content:"\\f8f6"}.bi-person-raised-hand:before{content:"\\f8f7"}.bi-person-standing-dress:before{content:"\\f8f8"}.bi-person-standing:before{content:"\\f8f9"}.bi-person-walking:before{content:"\\f8fa"}.bi-person-wheelchair:before{content:"\\f8fb"}.bi-shadows:before{content:"\\f8fc"}.bi-suitcase-fill:before{content:"\\f8fd"}.bi-suitcase-lg-fill:before{content:"\\f8fe"}.bi-suitcase-lg:before{content:"\\f8ff"}.bi-suitcase:before{content:"\\f900"}.bi-suitcase2-fill:before{content:"\\f901"}.bi-suitcase2:before{content:"\\f902"}.bi-vignette:before{content:"\\f903"}foreignObject.loci{box-sizing:border-box;border-radius:.375rem;position:relative;display:block}foreignObject.loci div.foreground{position:relative;display:flex;height:100%;width:100%;justify-content:center;align-items:center;box-sizing:inherit;border-radius:inherit;border-width:1px;border-style:solid;opacity:1}foreignObject.loci div.background{position:absolute;left:0;top:0;display:block;height:100%;width:100%;opacity:.3}foreignObject.pins div.foreground{position:relative;display:flex;height:100%;width:100%;justify-content:center;align-items:flex-end;box-sizing:border-box}foreignObject.dssp div.foreground{position:relative;display:flex;height:100%;width:100%;justify-content:center;align-items:flex-end;box-sizing:border-box}foreignObject.dssp i[class^=dssp]{position:relative;visibility:hidden;display:flex;height:100%;width:100%}foreignObject.dssp i.dssp-helix{visibility:visible;background-color:inherit;-webkit-mask-image:url("./media/dssp-helix-OTIKI7SN.svg");mask-image:url("./media/dssp-helix-OTIKI7SN.svg");-webkit-mask-position:0 center;mask-position:0 center;-webkit-mask-size:auto 100%;mask-size:auto 100%}foreignObject.dssp i.dssp-strand{display:flex;visibility:hidden}foreignObject.dssp i.dssp-strand:before{visibility:visible;background-color:inherit;-webkit-mask-image:url("./media/dssp-strand-tail-PA4GJMUI.svg");mask-image:url("./media/dssp-strand-tail-PA4GJMUI.svg");-webkit-mask-position:0 center;mask-position:0 center;-webkit-mask-size:auto 100%;mask-size:auto 100%;flex-shrink:1;flex-grow:1;content:""}foreignObject.dssp i.dssp-strand:after{visibility:visible;background-color:inherit;-webkit-mask-image:url("./media/dssp-strand-head-QWRJLFK7.svg");mask-image:url("./media/dssp-strand-head-QWRJLFK7.svg");-webkit-mask-position:0 center;mask-position:0 center;-webkit-mask-size:auto 100%;mask-size:auto 100%;flex-shrink:0;flex-grow:0;content:"";width:31px}.axis-grid line{stroke-opacity:.3;stroke:gray}.axis-grid line:nth-child(1){stroke-dasharray:2}.y.axis .tick text{display:none} +/*! + * Bootstrap Icons v1.11.3 (https://icons.getbootstrap.com/) + * Copyright 2019-2024 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE) + */ +`],encapsulation:2,changeDetection:0});let e=t;return e})();export{yn as a,Ja as b}; diff --git a/docs/chunk-KRYPOJUJ.js b/docs/chunk-KRYPOJUJ.js new file mode 100644 index 0000000..74de49f --- /dev/null +++ b/docs/chunk-KRYPOJUJ.js @@ -0,0 +1,6083 @@ +import{B as zm,C as Np,E as Vm,G as cA,I as PG,Ia as e1,K as IG,P as EG,R as vd,S as uA,Tb as VG,U as hg,W as DG,X as xd,Y as kG,_ as bd,a as k,b as te,bb as BG,c as TG,cb as RG,d as Mu,da as Bu,db as LG,e as hi,f as vr,fa as kB,g as Y,ga as MB,ja as MG,jb as FG,kb as OG,l as mo,lb as NG,m as Zs,n as Xf,p as Kf,pb as UG,qb as zG,u as Rs,va as $2}from"./chunk-M6PASJEJ.js";var oY=Mu((Rut,nY)=>{"use strict";nY.exports=XMLHttpRequest});var Ide=Mu(to=>{"use strict";var iw=Symbol.for("react.element"),NVe=Symbol.for("react.portal"),UVe=Symbol.for("react.fragment"),zVe=Symbol.for("react.strict_mode"),VVe=Symbol.for("react.profiler"),GVe=Symbol.for("react.provider"),HVe=Symbol.for("react.context"),jVe=Symbol.for("react.forward_ref"),qVe=Symbol.for("react.suspense"),WVe=Symbol.for("react.memo"),YVe=Symbol.for("react.lazy"),yde=Symbol.iterator;function XVe(e){return e===null||typeof e!="object"?null:(e=yde&&e[yde]||e["@@iterator"],typeof e=="function"?e:null)}var bde={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sde=Object.assign,Cde={};function fS(e,t,r){this.props=e,this.context=t,this.refs=Cde,this.updater=r||bde}fS.prototype.isReactComponent={};fS.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};fS.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _de(){}_de.prototype=fS.prototype;function pU(e,t,r){this.props=e,this.context=t,this.refs=Cde,this.updater=r||bde}var fU=pU.prototype=new _de;fU.constructor=pU;Sde(fU,fS.prototype);fU.isPureReactComponent=!0;var vde=Array.isArray,wde=Object.prototype.hasOwnProperty,hU={current:null},Ade={key:!0,ref:!0,__self:!0,__source:!0};function Tde(e,t,r){var n,o={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)wde.call(t,n)&&!Ade.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(a===1)o.children=r;else if(1{"use strict";Ede.exports=Ide()});var kde=Mu(aD=>{"use strict";var JVe=Ui(),e9e=Symbol.for("react.element"),t9e=Symbol.for("react.fragment"),r9e=Object.prototype.hasOwnProperty,n9e=JVe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o9e={key:!0,ref:!0,__self:!0,__source:!0};function Dde(e,t,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)r9e.call(t,n)&&!o9e.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:e9e,type:e,key:i,ref:s,props:o,_owner:n9e.current}}aD.Fragment=t9e;aD.jsx=Dde;aD.jsxs=Dde});var Ln=Mu((oyr,Mde)=>{"use strict";Mde.exports=kde()});var sge=Mu((X5r,ige)=>{"use strict";var tge=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,CWe=/\n/g,_We=/^\s*/,wWe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,AWe=/^:\s*/,TWe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,PWe=/^[;\s]*/,IWe=/^\s+|\s+$/g,EWe=` +`,rge="/",nge="*",Iv="",DWe="comment",kWe="declaration";ige.exports=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function o(f){var y=f.match(CWe);y&&(r+=y.length);var g=f.lastIndexOf(EWe);n=~g?f.length-g:n+f.length}function i(){var f={line:r,column:n};return function(y){return y.position=new s(f),u(),y}}function s(f){this.start=f,this.end={line:r,column:n},this.source=t.source}s.prototype.content=e;var a=[];function l(f){var y=new Error(t.source+":"+r+":"+n+": "+f);if(y.reason=f,y.filename=t.source,y.line=r,y.column=n,y.source=e,t.silent)a.push(y);else throw y}function c(f){var y=f.exec(e);if(y){var g=y[0];return o(g),e=e.slice(g.length),y}}function u(){c(_We)}function d(f){var y;for(f=f||[];y=m();)y!==!1&&f.push(y);return f}function m(){var f=i();if(!(rge!=e.charAt(0)||nge!=e.charAt(1))){for(var y=2;Iv!=e.charAt(y)&&(nge!=e.charAt(y)||rge!=e.charAt(y+1));)++y;if(y+=2,Iv===e.charAt(y-1))return l("End of comment missing");var g=e.slice(2,y-2);return n+=2,o(g),e=e.slice(y),n+=2,f({type:DWe,comment:g})}}function p(){var f=i(),y=c(wWe);if(y){if(m(),!c(AWe))return l("property missing ':'");var g=c(TWe),v=f({type:kWe,property:oge(y[0].replace(tge,Iv)),value:g?oge(g[0].replace(tge,Iv)):Iv});return c(PWe),v}}function h(){var f=[];d(f);for(var y;y=p();)y!==!1&&(f.push(y),d(f));return f}return u(),h()};function oge(e){return e?e.replace(IWe,Iv):Iv}});var age=Mu(Yw=>{"use strict";var MWe=Yw&&Yw.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yw,"__esModule",{value:!0});var BWe=MWe(sge());function RWe(e,t){var r=null;if(!e||typeof e!="string")return r;var n=(0,BWe.default)(e),o=typeof t=="function";return n.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(r=r||{},r[s]=a)}}),r}Yw.default=RWe});var D0e=Mu((MUr,E0e)=>{"use strict";var vM=Object.prototype.hasOwnProperty,I0e=Object.prototype.toString,C0e=Object.defineProperty,_0e=Object.getOwnPropertyDescriptor,w0e=function(t){return typeof Array.isArray=="function"?Array.isArray(t):I0e.call(t)==="[object Array]"},A0e=function(t){if(!t||I0e.call(t)!=="[object Object]")return!1;var r=vM.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&vM.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var o;for(o in t);return typeof o>"u"||vM.call(t,o)},T0e=function(t,r){C0e&&r.name==="__proto__"?C0e(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},P0e=function(t,r){if(r==="__proto__")if(vM.call(t,r)){if(_0e)return _0e(t,r).value}else return;return t[r]};E0e.exports=function e(){var t,r,n,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l{"use strict";function h9(e,t){var r=e.length;e.push(t);e:for(;0>>1,o=e[n];if(0>>1;nc4(a,r))lc4(c,a)?(e[n]=c,e[l]=r,n=l):(e[n]=a,e[s]=r,n=s);else if(lc4(c,r))e[n]=c,e[l]=r,n=l;else break e}}return t}function c4(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(xye=performance,_i.unstable_now=function(){return xye.now()}):(m9=Date,bye=m9.now(),_i.unstable_now=function(){return m9.now()-bye});var xye,m9,bye,Gf=[],ky=[],uQe=1,Bm=null,uc=3,m4=!1,Nv=!1,x3=!1,_ye=typeof setTimeout=="function"?setTimeout:null,wye=typeof clearTimeout=="function"?clearTimeout:null,Sye=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g9(e){for(var t=Dp(ky);t!==null;){if(t.callback===null)d4(ky);else if(t.startTime<=e)d4(ky),t.sortIndex=t.expirationTime,h9(Gf,t);else break;t=Dp(ky)}}function y9(e){if(x3=!1,g9(e),!Nv)if(Dp(Gf)!==null)Nv=!0,x9(v9);else{var t=Dp(ky);t!==null&&b9(y9,t.startTime-e)}}function v9(e,t){Nv=!1,x3&&(x3=!1,wye(b3),b3=-1),m4=!0;var r=uc;try{for(g9(t),Bm=Dp(Gf);Bm!==null&&(!(Bm.expirationTime>t)||e&&!Pye());){var n=Bm.callback;if(typeof n=="function"){Bm.callback=null,uc=Bm.priorityLevel;var o=n(Bm.expirationTime<=t);t=_i.unstable_now(),typeof o=="function"?Bm.callback=o:Bm===Dp(Gf)&&d4(Gf),g9(t)}else d4(Gf);Bm=Dp(Gf)}if(Bm!==null)var i=!0;else{var s=Dp(ky);s!==null&&b9(y9,s.startTime-t),i=!1}return i}finally{Bm=null,uc=r,m4=!1}}var p4=!1,u4=null,b3=-1,Aye=5,Tye=-1;function Pye(){return!(_i.unstable_now()-Tyee||125n?(e.sortIndex=r,h9(ky,e),Dp(Gf)===null&&e===Dp(ky)&&(x3?(wye(b3),b3=-1):x3=!0,b9(y9,r-n))):(e.sortIndex=o,h9(Gf,e),Nv||m4||(Nv=!0,x9(v9))),e};_i.unstable_shouldYield=Pye;_i.unstable_wrapCallback=function(e){var t=uc;return function(){var r=uc;uc=t;try{return e.apply(this,arguments)}finally{uc=r}}}});var Dye=Mu((hjr,Eye)=>{"use strict";Eye.exports=Iye()});var Rxe=Mu(hd=>{"use strict";var dQe=Ui(),pd=Dye();function Gt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H9=Object.prototype.hasOwnProperty,mQe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,kye={},Mye={};function pQe(e){return H9.call(Mye,e)?!0:H9.call(kye,e)?!1:mQe.test(e)?Mye[e]=!0:(kye[e]=!0,!1)}function fQe(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hQe(e,t,r,n){if(t===null||typeof t>"u"||fQe(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function jc(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Bl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Bl[e]=new jc(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Bl[t]=new jc(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Bl[e]=new jc(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Bl[e]=new jc(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Bl[e]=new jc(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Bl[e]=new jc(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Bl[e]=new jc(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Bl[e]=new jc(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Bl[e]=new jc(e,5,!1,e.toLowerCase(),null,!1,!1)});var L7=/[\-:]([a-z])/g;function F7(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(L7,F7);Bl[t]=new jc(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(L7,F7);Bl[t]=new jc(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(L7,F7);Bl[t]=new jc(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Bl[e]=new jc(e,1,!1,e.toLowerCase(),null,!1,!1)});Bl.xlinkHref=new jc("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Bl[e]=new jc(e,1,!1,e.toLowerCase(),null,!0,!0)});function O7(e,t,r,n){var o=Bl.hasOwnProperty(t)?Bl[t]:null;(o!==null?o.type!==0:n||!(2a||o[s]!==i[a]){var l=` +`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{C9=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?E3(e):""}function gQe(e){switch(e.tag){case 5:return E3(e.type);case 16:return E3("Lazy");case 13:return E3("Suspense");case 19:return E3("SuspenseList");case 0:case 2:case 15:return e=_9(e.type,!1),e;case 11:return e=_9(e.type.render,!1),e;case 1:return e=_9(e.type,!0),e;default:return""}}function Y9(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A2:return"Fragment";case w2:return"Portal";case j9:return"Profiler";case N7:return"StrictMode";case q9:return"Suspense";case W9:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U1e:return(e.displayName||"Context")+".Consumer";case N1e:return(e._context.displayName||"Context")+".Provider";case U7:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z7:return t=e.displayName||null,t!==null?t:Y9(e.type)||"Memo";case By:t=e._payload,e=e._init;try{return Y9(e(t))}catch{}}return null}function yQe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Y9(t);case 8:return t===N7?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yy(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function V1e(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vQe(e){var t=V1e(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function h4(e){e._valueTracker||(e._valueTracker=vQe(e))}function G1e(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=V1e(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function H4(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function X9(e,t){var r=t.checked;return _s({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Rye(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Yy(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function H1e(e,t){t=t.checked,t!=null&&O7(e,"checked",t,!1)}function K9(e,t){H1e(e,t);var r=Yy(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Q9(e,t.type,r):t.hasOwnProperty("defaultValue")&&Q9(e,t.type,Yy(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lye(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Q9(e,t,r){(t!=="number"||H4(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var D3=Array.isArray;function F2(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=g4.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function H3(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var B3={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xQe=["Webkit","ms","Moz","O"];Object.keys(B3).forEach(function(e){xQe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),B3[t]=B3[e]})});function Y1e(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||B3.hasOwnProperty(e)&&B3[e]?(""+t).trim():t+"px"}function X1e(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=Y1e(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var bQe=_s({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function J9(e,t){if(t){if(bQe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Gt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Gt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Gt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Gt(62))}}function e7(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var t7=null;function V7(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var r7=null,O2=null,N2=null;function Nye(e){if(e=aA(e)){if(typeof r7!="function")throw Error(Gt(280));var t=e.stateNode;t&&(t=yB(t),r7(e.stateNode,e.type,t))}}function K1e(e){O2?N2?N2.push(e):N2=[e]:O2=e}function Q1e(){if(O2){var e=O2,t=N2;if(N2=O2=null,Nye(e),t)for(e=0;e>>=0,e===0?32:31-(kQe(e)/MQe|0)|0}var y4=64,v4=4194304;function k3(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Y4(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=k3(a):(i&=s,i!==0&&(n=k3(i)))}else s=r&~o,s!==0?n=k3(s):i!==0&&(n=k3(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function iA(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lp(t),e[t]=r}function FQe(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=L3),Yye=" ",Xye=!1;function gve(e,t){switch(e){case"keyup":return uZe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yve(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var T2=!1;function mZe(e,t){switch(e){case"compositionend":return yve(t);case"keypress":return t.which!==32?null:(Xye=!0,Yye);case"textInput":return e=t.data,e===Yye&&Xye?null:e;default:return null}}function pZe(e,t){if(T2)return e==="compositionend"||!K7&&gve(e,t)?(e=fve(),R4=W7=Oy=null,T2=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Zye(r)}}function Sve(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sve(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cve(){for(var e=window,t=H4();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=H4(e.document)}return t}function Q7(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function CZe(e){var t=Cve(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Sve(r.ownerDocument.documentElement,r)){if(n!==null&&Q7(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=$ye(r,i);var s=$ye(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,P2=null,l7=null,O3=null,c7=!1;function Jye(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;c7||P2==null||P2!==H4(n)||(n=P2,"selectionStart"in n&&Q7(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),O3&&K3(O3,n)||(O3=n,n=Q4(l7,"onSelect"),0D2||(e.current=h7[D2],h7[D2]=null,D2--)}function wi(e,t){D2++,h7[D2]=e.current,e.current=t}var Xy={},fc=Qy(Xy),Eu=Qy(!1),Wv=Xy;function H2(e,t){var r=e.type.contextTypes;if(!r)return Xy;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Du(e){return e=e.childContextTypes,e!=null}function $4(){Gi(Eu),Gi(fc)}function l1e(e,t,r){if(fc.current!==Xy)throw Error(Gt(168));wi(fc,t),wi(Eu,r)}function kve(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(Gt(108,yQe(e)||"Unknown",o));return _s({},r,n)}function J4(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xy,Wv=fc.current,wi(fc,e),wi(Eu,Eu.current),!0}function c1e(e,t,r){var n=e.stateNode;if(!n)throw Error(Gt(169));r?(e=kve(e,t,Wv),n.__reactInternalMemoizedMergedChildContext=e,Gi(Eu),Gi(fc),wi(fc,e)):Gi(Eu),wi(Eu,r)}var og=null,vB=!1,R9=!1;function Mve(e){og===null?og=[e]:og.push(e)}function MZe(e){vB=!0,Mve(e)}function Zy(){if(!R9&&og!==null){R9=!0;var e=0,t=oi;try{var r=og;for(oi=1;e>=s,o-=s,ig=1<<32-Lp(t)+o|r<A?(P=E,E=null):P=E.sibling;var T=m(g,E,b[A],S);if(T===null){E===null&&(E=P);break}e&&E&&T.alternate===null&&t(g,E),v=i(T,v,A),w===null?_=T:w.sibling=T,w=T,E=P}if(A===b.length)return r(g,E),is&&Uv(g,A),_;if(E===null){for(;AA?(P=E,E=null):P=E.sibling;var B=m(g,E,T.value,S);if(B===null){E===null&&(E=P);break}e&&E&&B.alternate===null&&t(g,E),v=i(B,v,A),w===null?_=B:w.sibling=B,w=B,E=P}if(T.done)return r(g,E),is&&Uv(g,A),_;if(E===null){for(;!T.done;A++,T=b.next())T=d(g,T.value,S),T!==null&&(v=i(T,v,A),w===null?_=T:w.sibling=T,w=T);return is&&Uv(g,A),_}for(E=n(g,E);!T.done;A++,T=b.next())T=p(E,g,A,T.value,S),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?A:T.key),v=i(T,v,A),w===null?_=T:w.sibling=T,w=T);return e&&E.forEach(function(D){return t(g,D)}),is&&Uv(g,A),_}function y(g,v,b,S){if(typeof b=="object"&&b!==null&&b.type===A2&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case f4:e:{for(var _=b.key,w=v;w!==null;){if(w.key===_){if(_=b.type,_===A2){if(w.tag===7){r(g,w.sibling),v=o(w,b.props.children),v.return=g,g=v;break e}}else if(w.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===By&&m1e(_)===w.type){r(g,w.sibling),v=o(w,b.props),v.ref=A3(g,w,b),v.return=g,g=v;break e}r(g,w);break}else t(g,w);w=w.sibling}b.type===A2?(v=qv(b.props.children,g.mode,S,b.key),v.return=g,g=v):(S=G4(b.type,b.key,b.props,null,g.mode,S),S.ref=A3(g,v,b),S.return=g,g=S)}return s(g);case w2:e:{for(w=b.key;v!==null;){if(v.key===w)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){r(g,v.sibling),v=o(v,b.children||[]),v.return=g,g=v;break e}else{r(g,v);break}else t(g,v);v=v.sibling}v=G9(b,g.mode,S),v.return=g,g=v}return s(g);case By:return w=b._init,y(g,v,w(b._payload),S)}if(D3(b))return h(g,v,b,S);if(S3(b))return f(g,v,b,S);E4(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(r(g,v.sibling),v=o(v,b),v.return=g,g=v):(r(g,v),v=V9(b,g.mode,S),v.return=g,g=v),s(g)):r(g,v)}return y}var q2=Fve(!0),Ove=Fve(!1),rB=Qy(null),nB=null,B2=null,eG=null;function tG(){eG=B2=nB=null}function rG(e){var t=rB.current;Gi(rB),e._currentValue=t}function v7(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function z2(e,t){nB=e,eG=B2=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Iu=!0),e.firstContext=null)}function Nm(e){var t=e._currentValue;if(eG!==e)if(e={context:e,memoizedValue:t,next:null},B2===null){if(nB===null)throw Error(Gt(308));B2=e,nB.dependencies={lanes:0,firstContext:e}}else B2=B2.next=e;return t}var Gv=null;function nG(e){Gv===null?Gv=[e]:Gv.push(e)}function Nve(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,nG(t)):(r.next=o.next,o.next=r),t.interleaved=r,ug(e,n)}function ug(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ry=!1;function oG(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uve(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ag(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hy(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,bo&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,ug(e,r)}return o=n.interleaved,o===null?(t.next=t,nG(n)):(t.next=o.next,o.next=t),n.interleaved=t,ug(e,r)}function F4(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,H7(e,r)}}function p1e(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var o=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?o=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?o=i=t:i=i.next=t}else o=i=t;r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function oB(e,t,r,n){var o=e.updateQueue;Ry=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,u=c=l=null,a=i;do{var m=a.lane,p=a.eventTime;if((n&m)===m){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,f=a;switch(m=t,p=r,f.tag){case 1:if(h=f.payload,typeof h=="function"){d=h.call(p,d,m);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=f.payload,m=typeof h=="function"?h.call(p,d,m):h,m==null)break e;d=_s({},d,m);break e;case 2:Ry=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[a]:m.push(a))}else p={eventTime:p,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,s|=m;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;m=a,a=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Kv|=s,e.lanes=s,e.memoizedState=d}}function f1e(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=F9.transition;F9.transition={};try{e(!1),t()}finally{oi=r,F9.transition=n}}function rxe(){return Um().memoizedState}function FZe(e,t,r){var n=qy(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},nxe(e))oxe(t,r);else if(r=Nve(e,t,r,n),r!==null){var o=Hc();Fp(r,e,n,o),ixe(r,t,n)}}function OZe(e,t,r){var n=qy(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(nxe(e))oxe(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,Op(a,s)){var l=t.interleaved;l===null?(o.next=o,nG(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=Nve(e,t,o,n),r!==null&&(o=Hc(),Fp(r,e,n,o),ixe(r,t,n))}}function nxe(e){var t=e.alternate;return e===Cs||t!==null&&t===Cs}function oxe(e,t){N3=sB=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ixe(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,H7(e,r)}}var aB={readContext:Nm,useCallback:dc,useContext:dc,useEffect:dc,useImperativeHandle:dc,useInsertionEffect:dc,useLayoutEffect:dc,useMemo:dc,useReducer:dc,useRef:dc,useState:dc,useDebugValue:dc,useDeferredValue:dc,useTransition:dc,useMutableSource:dc,useSyncExternalStore:dc,useId:dc,unstable_isNewReconciler:!1},NZe={readContext:Nm,useCallback:function(e,t){return jf().memoizedState=[e,t===void 0?null:t],e},useContext:Nm,useEffect:g1e,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,N4(4194308,4,Zve.bind(null,t,e),r)},useLayoutEffect:function(e,t){return N4(4194308,4,e,t)},useInsertionEffect:function(e,t){return N4(4,2,e,t)},useMemo:function(e,t){var r=jf();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=jf();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=FZe.bind(null,Cs,e),[n.memoizedState,e]},useRef:function(e){var t=jf();return e={current:e},t.memoizedState=e},useState:h1e,useDebugValue:mG,useDeferredValue:function(e){return jf().memoizedState=e},useTransition:function(){var e=h1e(!1),t=e[0];return e=LZe.bind(null,e[1]),jf().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Cs,o=jf();if(is){if(r===void 0)throw Error(Gt(407));r=r()}else{if(r=t(),vl===null)throw Error(Gt(349));Xv&30||Hve(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,g1e(qve.bind(null,n,i,e),[e]),n.flags|=2048,nA(9,jve.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=jf(),t=vl.identifierPrefix;if(is){var r=sg,n=ig;r=(n&~(1<<32-Lp(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=tA++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[qf]=t,e[$3]=n,hxe(e,t,!1,!1),t.stateNode=e;e:{switch(s=e7(r,n),r){case"dialog":Vi("cancel",e),Vi("close",e),o=n;break;case"iframe":case"object":case"embed":Vi("load",e),o=n;break;case"video":case"audio":for(o=0;oX2&&(t.flags|=128,n=!0,T3(i,!1),t.lanes=4194304)}else{if(!n)if(e=iB(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),T3(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!is)return mc(t),null}else 2*Qs()-i.renderingStartTime>X2&&r!==1073741824&&(t.flags|=128,n=!0,T3(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Qs(),t.sibling=null,r=Ss.current,wi(Ss,n?r&1|2:r&1),t):(mc(t),null);case 22:case 23:return vG(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?ud&1073741824&&(mc(t),t.subtreeFlags&6&&(t.flags|=8192)):mc(t),null;case 24:return null;case 25:return null}throw Error(Gt(156,t.tag))}function WZe(e,t){switch($7(t),t.tag){case 1:return Du(t.type)&&$4(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return W2(),Gi(Eu),Gi(fc),aG(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return sG(t),null;case 13:if(Gi(Ss),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Gt(340));j2()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gi(Ss),null;case 4:return W2(),null;case 10:return rG(t.type._context),null;case 22:case 23:return vG(),null;case 24:return null;default:return null}}var k4=!1,pc=!1,YZe=typeof WeakSet=="function"?WeakSet:Set,gr=null;function R2(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Bs(e,t,n)}else r.current=null}function P7(e,t,r){try{r()}catch(n){Bs(e,t,n)}}var P1e=!1;function XZe(e,t){if(u7=X4,e=Cve(),Q7(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,m=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)m=d,d=p;for(;;){if(d===e)break t;if(m===r&&++c===o&&(a=s),m===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(d7={focusedElem:e,selectionRange:r},X4=!1,gr=t;gr!==null;)if(t=gr,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gr=e;else for(;gr!==null;){t=gr;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var f=h.memoizedProps,y=h.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?f:Mp(t.type,f),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Gt(163))}}catch(S){Bs(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,gr=e;break}gr=t.return}return h=P1e,P1e=!1,h}function U3(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&P7(t,r,i)}o=o.next}while(o!==n)}}function SB(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function I7(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function vxe(e){var t=e.alternate;t!==null&&(e.alternate=null,vxe(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qf],delete t[$3],delete t[f7],delete t[DZe],delete t[kZe])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xxe(e){return e.tag===5||e.tag===3||e.tag===4}function I1e(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xxe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function E7(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Z4));else if(n!==4&&(e=e.child,e!==null))for(E7(e,t,r),e=e.sibling;e!==null;)E7(e,t,r),e=e.sibling}function D7(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(D7(e,t,r),e=e.sibling;e!==null;)D7(e,t,r),e=e.sibling}var kl=null,Bp=!1;function My(e,t,r){for(r=r.child;r!==null;)bxe(e,t,r),r=r.sibling}function bxe(e,t,r){if(Wf&&typeof Wf.onCommitFiberUnmount=="function")try{Wf.onCommitFiberUnmount(pB,r)}catch{}switch(r.tag){case 5:pc||R2(r,t);case 6:var n=kl,o=Bp;kl=null,My(e,t,r),kl=n,Bp=o,kl!==null&&(Bp?(e=kl,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):kl.removeChild(r.stateNode));break;case 18:kl!==null&&(Bp?(e=kl,r=r.stateNode,e.nodeType===8?B9(e.parentNode,r):e.nodeType===1&&B9(e,r),Y3(e)):B9(kl,r.stateNode));break;case 4:n=kl,o=Bp,kl=r.stateNode.containerInfo,Bp=!0,My(e,t,r),kl=n,Bp=o;break;case 0:case 11:case 14:case 15:if(!pc&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&P7(r,t,s),o=o.next}while(o!==n)}My(e,t,r);break;case 1:if(!pc&&(R2(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Bs(r,t,a)}My(e,t,r);break;case 21:My(e,t,r);break;case 22:r.mode&1?(pc=(n=pc)||r.memoizedState!==null,My(e,t,r),pc=n):My(e,t,r);break;default:My(e,t,r)}}function E1e(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new YZe),t.forEach(function(n){var o=n$e.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function kp(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=Qs()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*QZe(n/1960))-n,10e?16:e,Ny===null)var n=!1;else{if(e=Ny,Ny=null,uB=0,bo&6)throw Error(Gt(331));var o=bo;for(bo|=4,gr=e.current;gr!==null;){var i=gr,s=i.child;if(gr.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lQs()-gG?jv(e,0):hG|=r),ku(e,t)}function Ixe(e,t){t===0&&(e.mode&1?(t=v4,v4<<=1,!(v4&130023424)&&(v4=4194304)):t=1);var r=Hc();e=ug(e,t),e!==null&&(iA(e,t,r),ku(e,r))}function r$e(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ixe(e,r)}function n$e(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Gt(314))}n!==null&&n.delete(t),Ixe(e,r)}var Exe;Exe=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Eu.current)Iu=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Iu=!1,jZe(e,t,r);Iu=!!(e.flags&131072)}else Iu=!1,is&&t.flags&1048576&&Bve(t,tB,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;U4(e,t),e=t.pendingProps;var o=H2(t,fc.current);z2(t,r),o=cG(null,t,n,e,o,r);var i=uG();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Du(n)?(i=!0,J4(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,oG(t),o.updater=bB,t.stateNode=o,o._reactInternals=t,b7(t,n,e,r),t=_7(null,t,n,!0,i,r)):(t.tag=0,is&&i&&Z7(t),Gc(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(U4(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=i$e(n),e=Mp(n,e),o){case 0:t=C7(null,t,n,e,r);break e;case 1:t=w1e(null,t,n,e,r);break e;case 11:t=C1e(null,t,n,e,r);break e;case 14:t=_1e(null,t,n,Mp(n.type,e),r);break e}throw Error(Gt(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Mp(n,o),C7(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Mp(n,o),w1e(e,t,n,o,r);case 3:e:{if(mxe(t),e===null)throw Error(Gt(387));n=t.pendingProps,i=t.memoizedState,o=i.element,Uve(e,t),oB(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Y2(Error(Gt(423)),t),t=A1e(e,t,n,r,o);break e}else if(n!==o){o=Y2(Error(Gt(424)),t),t=A1e(e,t,n,r,o);break e}else for(dd=Gy(t.stateNode.containerInfo.firstChild),md=t,is=!0,Rp=null,r=Ove(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(j2(),n===o){t=dg(e,t,r);break e}Gc(e,t,n,r)}t=t.child}return t;case 5:return zve(t),e===null&&y7(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,m7(n,o)?s=null:i!==null&&m7(n,i)&&(t.flags|=32),dxe(e,t),Gc(e,t,s,r),t.child;case 6:return e===null&&y7(t),null;case 13:return pxe(e,t,r);case 4:return iG(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=q2(t,null,n,r):Gc(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Mp(n,o),C1e(e,t,n,o,r);case 7:return Gc(e,t,t.pendingProps,r),t.child;case 8:return Gc(e,t,t.pendingProps.children,r),t.child;case 12:return Gc(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,wi(rB,n._currentValue),n._currentValue=s,i!==null)if(Op(i.value,s)){if(i.children===o.children&&!Eu.current){t=dg(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ag(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),v7(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Gt(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),v7(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Gc(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,z2(t,r),o=Nm(o),n=n(o),t.flags|=1,Gc(e,t,n,r),t.child;case 14:return n=t.type,o=Mp(n,t.pendingProps),o=Mp(n.type,o),_1e(e,t,n,o,r);case 15:return cxe(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Mp(n,o),U4(e,t),t.tag=1,Du(n)?(e=!0,J4(t)):e=!1,z2(t,r),sxe(t,n,o),b7(t,n,o,r),_7(null,t,n,!0,e,r);case 19:return fxe(e,t,r);case 22:return uxe(e,t,r)}throw Error(Gt(156,t.tag))};function Dxe(e,t){return nve(e,t)}function o$e(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fm(e,t,r,n){return new o$e(e,t,r,n)}function bG(e){return e=e.prototype,!(!e||!e.isReactComponent)}function i$e(e){if(typeof e=="function")return bG(e)?1:0;if(e!=null){if(e=e.$$typeof,e===U7)return 11;if(e===z7)return 14}return 2}function Wy(e,t){var r=e.alternate;return r===null?(r=Fm(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function G4(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")bG(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case A2:return qv(r.children,o,i,t);case N7:s=8,o|=8;break;case j9:return e=Fm(12,r,t,o|2),e.elementType=j9,e.lanes=i,e;case q9:return e=Fm(13,r,t,o),e.elementType=q9,e.lanes=i,e;case W9:return e=Fm(19,r,t,o),e.elementType=W9,e.lanes=i,e;case z1e:return _B(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N1e:s=10;break e;case U1e:s=9;break e;case U7:s=11;break e;case z7:s=14;break e;case By:s=16,n=null;break e}throw Error(Gt(130,e==null?e:typeof e,""))}return t=Fm(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function qv(e,t,r,n){return e=Fm(7,e,n,t),e.lanes=r,e}function _B(e,t,r,n){return e=Fm(22,e,n,t),e.elementType=z1e,e.lanes=r,e.stateNode={isHidden:!1},e}function V9(e,t,r){return e=Fm(6,e,null,t),e.lanes=r,e}function G9(e,t,r){return t=Fm(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function s$e(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=A9(0),this.expirationTimes=A9(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=A9(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function SG(e,t,r,n,o,i,s,a,l){return e=new s$e(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Fm(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},oG(i),e}function a$e(e,t,r){var n=3{"use strict";function Lxe(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lxe)}catch(e){console.error(e)}}Lxe(),Fxe.exports=Rxe()});var Uxe=Mu(AG=>{"use strict";var Nxe=Oxe();AG.createRoot=Nxe.createRoot,AG.hydrateRoot=Nxe.hydrateRoot;var vjr});var gi;(function(e){function t(o){return o}e.create=t;function r(o,i){return(o&i)!==0}e.has=r;function n(o,i){return!!i&&(o&i)===i}e.hasAll=n})(gi||(gi={}));var yn;(function(e){function t(S=512){return{current:[],offset:0,capacity:S,chunks:[]}}e.create=t;function r(S){return S.chunks.length?(S.offset>0&&(S.chunks[S.chunks.length]=S.current.length===S.offset?S.current.join(""):S.current.slice(0,S.offset).join("")),S.chunks.join("")):S.current.length===S.offset?S.current.join(""):S.current.splice(0,S.offset).join("")}e.getString=r;function n(S){let _=0;for(let w of S.chunks)_+=w.length;for(let w=0;w0&&(S.current.length===S.offset?S.chunks[S.chunks.length]=S.current.join(""):S.chunks[S.chunks.length]=S.current.slice(0,S.offset).join(""),S.offset=0),S.chunks}e.getChunks=o;let i=[];(function(){let S="";for(let _=0;_<512;_++)i[_]=S,S=S+" "})();function s(S){u(S,` +`)}e.newline=s;function a(S,_){_>0&&u(S,i[_])}e.whitespace=a;function l(S){u(S," ")}e.whitespace1=l;function c(S,_){_&&(S.offset===S.capacity&&(S.chunks[S.chunks.length]=S.current.join(""),S.offset=0),S.current[S.offset++]=_)}e.write=c;function u(S,_){S.offset===S.capacity&&(S.chunks[S.chunks.length]=S.current.join(""),S.offset=0),S.current[S.offset++]=_}e.writeSafe=u;function d(S,_,w){if(!_){a(S,w);return}let E=w-_.length;a(S,E),u(S,_)}e.writePadLeft=d;function m(S,_,w){if(!_){a(S,w);return}let E=w-_.length;u(S,_),a(S,E)}e.writePadRight=m;function p(S,_){u(S,""+_)}e.writeInteger=p;function h(S,_){u(S,""+_+" ")}e.writeIntegerAndSpace=h;function f(S,_,w){let E=""+_,A=w-E.length;a(S,A),u(S,E)}e.writeIntegerPadLeft=f;function y(S,_,w){let E=""+_,A=w-E.length;u(S,E),a(S,A)}e.writeIntegerPadRight=y;function g(S,_,w){u(S,""+Math.round(w*_)/w)}e.writeFloat=g;function v(S,_,w,E){let A=""+Math.round(w*_)/w,P=E-A.length;a(S,P),u(S,A)}e.writeFloatPadLeft=v;function b(S,_,w,E){let A=""+Math.round(w*_)/w,P=E-A.length;u(S,A),a(S,P)}e.writeFloatPadRight=b})(yn||(yn={}));var On=function(){if(typeof window<"u"&&window.performance){let e=window.performance;return()=>e.now()}else return typeof process<"u"&&process.hrtime!=="undefined"&&typeof process.hrtime=="function"?()=>{let e=process.hrtime();return e[0]*1e3+e[1]/1e6}:Date.now?()=>Date.now():()=>+new Date}();function ix(e,t=!0){if(isNaN(e))return"n/a";let r=Math.floor(e/(60*60*1e3)),n=Math.floor(e/(60*1e3)%60),o=Math.floor(e/1e3%60),i=Math.floor(e%1e3).toString();for(;i.length<3;)i="0"+i;for(;!t&&i.length>1&&i[i.length-1]==="0";)i=i.substr(0,i.length-1);return r>0?`${r}h${n}m${o}.${i}s`:n>0?`${n}m${o}.${i}s`:o>0?`${o}.${i}s`:`${e.toFixed(0)}ms`}var qr;(function(e){let t=typeof btoa<"u"?btoa:s=>Buffer.from(s).toString("base64"),r=[];function n(){let s=+new Date+On();for(let a=0;a<16;a++)r[a]=String.fromCharCode((s+Math.random()*255)%255|0),s=Math.floor(s/255);return t(r.join("")).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22)}e.create22=n;function o(){let s=+new Date+On();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(l){let c=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(l==="x"?c:c&3|8).toString(16)})}e.createv4=o;function i(s){return typeof s=="string"}e.is=i})(qr||(qr={}));function Hxe(e,t){return e-t}function jxe(e){return Array.prototype.sort.call(e,Hxe),e}var BB;(function(e){class t{has(h){return!1}forEach(h,f){return f}constructor(){this.size=0}}class r{has(h){return h===this.idx}forEach(h,f){return h(this.idx,f),f}constructor(h){this.idx=h,this.size=1}}class n{has(h){return hh[f++]=y),jxe(h),this._flat=h,this._flat}forEach(h,f){return this._forEach(h,f),f}constructor(h){this.set=h,this._flat=void 0,this.size=h.size}}function s(p){return new o(p)}e.always=s,e.never=new t;function a(p){return new i(p)}e.ofSet=a;function l(p){return new r(p)}e.singleton=l;function c(p){let h=p.length;if(h===0)return new t;if(h===1)return new r(p[0]);let f=0;for(let v of p)v>f&&(f=v);if(h===f)return new o(h);if(h/f<1/12){let v=new Set;for(let b of p)v.add(b);return new i(v)}let g=new Int8Array(f+1);for(let v of p)g[v]=1;return new n(g,p.length)}e.ofUniqueIndices=c;function u(p,h){return new n(p,h)}e.ofMask=u;function d(p,h){for(let f of h)if(p.has(f))return!0;return!1}e.hasAny=d;function m(p,h){let f=0,y=0;if(h.forEach(g=>{p.has(g)||(f++,g>y&&(y=g))}),f/y<1/12){let g=new Set;return h.forEach(v=>{p.has(v)||g.add(v)}),a(g)}else{let g=new Uint8Array(y+1);return h.forEach(v=>{p.has(v)||(g[v]=1)}),u(g,f)}}e.complement=m})(BB||(BB={}));function ko(e=0,t=Number.MAX_SAFE_INTEGER){let r=e;return()=>{let n=r;return r=(r+1)%t,n}}var J2;(function(e){function t(n){return{ref:n}}e.create=t;function r(n,o){return n.ref=o,n}e.set=r})(J2||(J2={}));var qxe=ko(0,2147483647),Up;(function(e){function t(n,o){return{id:qxe(),version:0,value:n,metadata:o}}e.create=t;function r(n,o){return{id:n.id,version:n.version+1,value:o,metadata:n.metadata}}e.withValue=r})(Up||(Up={}));var I;(function(e){function t(i,s){return J2.create(Up.create(i,s))}e.create=t;function r(i,s){return J2.set(i,Up.withValue(i.ref,s))}e.update=r;function n(i,s){return J2.set(i,s)}e.set=n;function o(i,s){return i.ref.value!==s?r(i,s):i}e.updateIfChanged=o})(I||(I={}));var Ll=function(){};function Ls(e,t){let r=e.length;if(r!==t.length)return!1;for(let n=0;nYxe,createArray:()=>t1,fillArrayValues:()=>qG,getArrayBounds:()=>gg,isTypedArray:()=>dA,typedArrayWindow:()=>mA});function gg(e,t){let r=t&&typeof t.start<"u"?Math.max(Math.min(t.start,e-1),0):0,n=t&&typeof t.end<"u"?Math.min(t.end,e):e;return{start:r,end:n}}function t1(e,t){let r=t&&typeof t.array<"u"?t.array:Array,{start:n,end:o}=gg(e,t);return{array:new r(o-n),start:n,end:o}}function qG(e,t,r){for(let n=0,o=t.length;n0&&(vt=1/Math.sqrt(vt),me[0]=Se[0]*vt,me[1]=Se[1]*vt,me[2]=Se[2]*vt),me}e.normalize=Q;function H(me,Se){return me[0]*Se[0]+me[1]*Se[1]+me[2]*Se[2]}e.dot=H;function W(me,Se,he){let et=Se[0],Et=Se[1],vt=Se[2],mr=he[0],yr=he[1],In=he[2];return me[0]=Et*In-vt*yr,me[1]=vt*mr-et*In,me[2]=et*yr-Et*mr,me}e.cross=W;function K(me,Se,he,et){let Et=Se[0],vt=Se[1],mr=Se[2];return me[0]=Et+et*(he[0]-Et),me[1]=vt+et*(he[1]-vt),me[2]=mr+et*(he[2]-mr),me}e.lerp=K;let ce=t();function V(me,Se,he,et){let Et=po(H(Se,he),-1,1),vt=Math.acos(Et)*et;return b(ce,he,Se,-Et),Q(ce,ce),h(me,v(me,Se,Math.cos(vt)),v(ce,ce,Math.sin(vt)))}e.slerp=V;function G(me,Se,he,et,Et,vt){let mr=vt*vt,yr=mr*(2*vt-3)+1,In=mr*(vt-2)+vt,io=mr*(vt-1),Ai=mr*(3-2*vt);return me[0]=Se[0]*yr+he[0]*In+et[0]*io+Et[0]*Ai,me[1]=Se[1]*yr+he[1]*In+et[1]*io+Et[1]*Ai,me[2]=Se[2]*yr+he[2]*In+et[2]*io+Et[2]*Ai,me}e.hermite=G;function X(me,Se,he,et,Et,vt){let mr=1-vt,yr=mr*mr,In=vt*vt,io=yr*mr,Ai=3*vt*yr,li=3*In*mr,hc=In*vt;return me[0]=Se[0]*io+he[0]*Ai+et[0]*li+Et[0]*hc,me[1]=Se[1]*io+he[1]*Ai+et[1]*li+Et[1]*hc,me[2]=Se[2]*io+he[2]*Ai+et[2]*li+Et[2]*hc,me}e.bezier=X;function Z(me,Se,he,et,Et){return me[0]=pA(Se[0],he[0],et[0],Et),me[1]=pA(Se[1],he[1],et[1],Et),me[2]=pA(Se[2],he[2],et[2],Et),me}e.quadraticBezier=Z;function ie(me,Se,he,et,Et,vt,mr){return me[0]=sx(Se[0],he[0],et[0],Et[0],vt,mr),me[1]=sx(Se[1],he[1],et[1],Et[1],vt,mr),me[2]=sx(Se[2],he[2],et[2],Et[2],vt,mr),me}e.spline=ie;function de(me,Se){let he=Math.random()*2*Math.PI,et=Math.random()*2-1,Et=Math.sqrt(1-et*et)*Se;return me[0]=Math.cos(he)*Et,me[1]=Math.sin(he)*Et,me[2]=et*Se,me}e.random=de;function we(me,Se,he){let et=Se[0],Et=Se[1],vt=Se[2],mr=1/(he[3]*et+he[7]*Et+he[11]*vt+he[15]||1);return me[0]=(he[0]*et+he[4]*Et+he[8]*vt+he[12])*mr,me[1]=(he[1]*et+he[5]*Et+he[9]*vt+he[13])*mr,me[2]=(he[2]*et+he[6]*Et+he[10]*vt+he[14])*mr,me}e.transformMat4=we;function Be(me,Se,he){let et=Se[0],Et=Se[1],vt=Se[2];return me[0]=he[0]*et+he[4]*Et+he[8]*vt,me[1]=he[1]*et+he[5]*Et+he[9]*vt,me[2]=he[2]*et+he[6]*Et+he[10]*vt,Q(me,me)}e.transformDirection=Be;function Ie(me,Se,he,et,Et,vt){let mr=Se[0+Et],yr=Se[1+Et],In=Se[2+Et],io=1/(he[3+vt]*mr+he[7+vt]*yr+he[11+vt]*In+he[15+vt]||1);return me[0+et]=(he[0+vt]*mr+he[4+vt]*yr+he[8+vt]*In+he[12+vt])*io,me[1+et]=(he[1+vt]*mr+he[5+vt]*yr+he[9+vt]*In+he[13+vt])*io,me[2+et]=(he[2+vt]*mr+he[6+vt]*yr+he[10+vt]*In+he[14+vt])*io,me}e.transformMat4Offset=Ie;function le(me,Se,he,et,Et,vt){let mr=Se[0+Et],yr=Se[1+Et],In=Se[2+Et];me[0+et]=he[0+vt]*mr+he[4+vt]*yr+he[8+vt]*In,me[1+et]=he[1+vt]*mr+he[5+vt]*yr+he[9+vt]*In,me[2+et]=he[2+vt]*mr+he[6+vt]*yr+he[10+vt]*In;let io=Math.hypot(me[0+et],me[1+et],me[2+et]);return io>0&&(me[0+et]/=io,me[1+et]/=io,me[2+et]/=io),me}e.transformDirectionOffset=le;function j(me,Se,he){let et=Se[0],Et=Se[1],vt=Se[2];return me[0]=et*he[0]+Et*he[3]+vt*he[6],me[1]=et*he[1]+Et*he[4]+vt*he[7],me[2]=et*he[2]+Et*he[5]+vt*he[8],me}e.transformMat3=j;function ue(me,Se,he){let et=Se[0],Et=Se[1],vt=Se[2],mr=he[0],yr=he[1],In=he[2],io=he[3],Ai=io*et+yr*vt-In*Et,li=io*Et+In*et-mr*vt,hc=io*vt+mr*Et-yr*et,gd=-mr*et-yr*Et-In*vt;return me[0]=Ai*io+gd*-mr+li*-In-hc*-yr,me[1]=li*io+gd*-yr+hc*-mr-Ai*-In,me[2]=hc*io+gd*-In+Ai*-yr-li*-mr,me}e.transformQuat=ue;function fe(me,Se){let he=Math.sqrt(z(me)*z(Se));if(he===0)return Math.PI/2;let et=H(me,Se)/he;return Math.acos(po(et,-1,1))}e.angle=fe;let De=t(),Re=t(),Xe=t(),L=t(),ee=t(),xe=t(),pe=t();function be(me,Se,he,et){f(De,me,Se),f(Re,he,Se),f(Xe,Se,he),f(L,et,he),W(ee,De,Re),W(xe,Xe,L);let Et=fe(ee,xe);return W(pe,ee,xe),H(Re,pe)>0?Et:-Et}e.dihedralAngle=be;function ke(me,Se,he,et){return e.set(me,et*Math.cos(he)*Math.sin(Se),et*Math.sin(he)*Math.sin(Se),et*Math.cos(Se))}e.directionFromSpherical=ke;function Ve(me,Se){return me[0]===Se[0]&&me[1]===Se[1]&&me[2]===Se[2]}e.exactEquals=Ve;function Ke(me,Se){let he=me[0],et=me[1],Et=me[2],vt=Se[0],mr=Se[1],yr=Se[2];return Math.abs(he-vt)<=1e-6*Math.max(1,Math.abs(he),Math.abs(vt))&&Math.abs(et-mr)<=1e-6*Math.max(1,Math.abs(et),Math.abs(mr))&&Math.abs(Et-yr)<=1e-6*Math.max(1,Math.abs(Et),Math.abs(yr))}e.equals=Ke;let it=t();function Ue(me,Se,he){let et=fe(Se,he);if(Math.abs(et)<1e-4)return ne.setIdentity(me);if(Math.abs(et-Math.PI)<1e-6)return ne.fromScaling(me,e.negUnit);let Et=W(it,Se,he);return ne.fromRotation(me,et,Et)}e.makeRotation=Ue;function nt(me){return me[0]===0&&me[1]===0&&me[2]===0}e.isZero=nt;function ut(me,Se,he,et){f(me,Se,et);let Et=H(he,me)/z(he);return h(me,v(me,he,Et),et)}e.projectPointOnVector=ut;let St=t();function mt(me,Se,he,et){return Q(St,he),f(me,Se,et),f(me,Se,v(St,St,H(me,St)))}e.projectPointOnPlane=mt;function Pt(me,Se,he){let et=H(he,Se)/z(he);return v(me,he,et)}e.projectOnVector=Pt;let It=t();function ar(me,Se,he){return Pt(It,Se,he),f(me,Se,It)}e.projectOnPlane=ar;function Hr(me,Se,he){return Q(me,W(me,W(me,Se,he),Se))}e.orthogonalize=Hr;function gn(me,Se,he){return H(Se,he)>0?p(me,Se):O(me,p(me,Se)),me}e.matchDirection=gn;let tt=t(),bt=t();function Tt(me,Se,he,et){return f(tt,he,Se),f(bt,et,Se),Q(me,W(me,tt,bt))}e.triangleNormal=Tt;function xt(me,Se){return`[${me[0].toPrecision(Se)} ${me[1].toPrecision(Se)} ${me[2].toPrecision(Se)}]`}e.toString=xt,e.origin=u(0,0,0),e.unit=u(1,1,1),e.negUnit=u(-1,-1,-1),e.unitX=u(1,0,0),e.unitY=u(0,1,0),e.unitZ=u(0,0,1),e.negUnitX=u(-1,0,0),e.negUnitY=u(0,-1,0),e.negUnitZ=u(0,0,-1)})(x||(x={}));var r1=Math.PI/2,WG=Math.PI/180;function Cr(e){return e*WG}function Fs(e){return e/WG}function yg(e){return e!==0&&(e&e-1)===0}function YG(...e){let t=0,r=0;for(let n=0,o=e.length;nr&&(t=i,r=s)}return t}function hA(e,t){return e*t}function XG(e){let t=0,r=0,n=[0,-1],o=e*2+1,i=o/2,s=[];for(let a=Math.pow(o,2);a>0;--a)-i0&&t===1-r)&&([n[0],n[1]]=[-n[1],n[0]]),t+=n[0],r+=n[1];return s}function ne(){return ne.zero()}(function(e){function t(){let L=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];return L[0]=0,L}e.zero=t;function r(){let L=t();return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.identity=r;function n(L){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.setIdentity=n;function o(L){for(let ee=0;ee<16;ee++)L[ee]=0;return L}e.setZero=o;function i(L){let ee=t();for(let xe=0;xe<4;xe++){let pe=L[xe];for(let be=0;be<4;be++)ee[4*be+xe]=pe[be]}return ee}e.ofRows=i;let s=r();function a(L,ee){return c(L,s,typeof ee>"u"?1e-6:ee)}e.isIdentity=a;function l(L){for(let ee=0;ee<16;ee++)if(isNaN(L[ee]))return!0;return!1}e.hasNaN=l;function c(L,ee,xe){for(let pe=0;pe<16;pe++)if(Math.abs(L[pe]-ee[pe])>xe)return!1;return!0}e.areEqual=c;function u(L,ee,xe,pe){L[4*xe+ee]=pe}e.setValue=u;function d(L,ee,xe){return L[4*xe+ee]}e.getValue=d;function m(L,ee,xe){return ee[xe+0]=L[0],ee[xe+1]=L[1],ee[xe+2]=L[2],ee[xe+3]=L[3],ee[xe+4]=L[4],ee[xe+5]=L[5],ee[xe+6]=L[6],ee[xe+7]=L[7],ee[xe+8]=L[8],ee[xe+9]=L[9],ee[xe+10]=L[10],ee[xe+11]=L[11],ee[xe+12]=L[12],ee[xe+13]=L[13],ee[xe+14]=L[14],ee[xe+15]=L[15],ee}e.toArray=m;function p(L,ee,xe){return L[0]=ee[xe+0],L[1]=ee[xe+1],L[2]=ee[xe+2],L[3]=ee[xe+3],L[4]=ee[xe+4],L[5]=ee[xe+5],L[6]=ee[xe+6],L[7]=ee[xe+7],L[8]=ee[xe+8],L[9]=ee[xe+9],L[10]=ee[xe+10],L[11]=ee[xe+11],L[12]=ee[xe+12],L[13]=ee[xe+13],L[14]=ee[xe+14],L[15]=ee[xe+15],L}e.fromArray=p;function h(L,ee,xe,pe){return o(L),u(L,0,0,ee[0]),u(L,1,0,ee[1]),u(L,2,0,ee[2]),u(L,0,1,xe[0]),u(L,1,1,xe[1]),u(L,2,1,xe[2]),u(L,0,2,pe[0]),u(L,1,2,pe[1]),u(L,2,2,pe[2]),u(L,3,3,1),L}e.fromBasis=h;function f(L,ee){return L[0]=ee[0],L[1]=ee[1],L[2]=ee[2],L[3]=ee[3],L[4]=ee[4],L[5]=ee[5],L[6]=ee[6],L[7]=ee[7],L[8]=ee[8],L[9]=ee[9],L[10]=ee[10],L[11]=ee[11],L[12]=ee[12],L[13]=ee[13],L[14]=ee[14],L[15]=ee[15],L}e.copy=f;function y(L){return f(t(),L)}e.clone=y;function g(L,ee){return L[0]=ee[12],L[1]=ee[13],L[2]=ee[14],L}e.getTranslation=g;function v(L,ee){let xe=ee[0],pe=ee[1],be=ee[2],ke=ee[4],Ve=ee[5],Ke=ee[6],it=ee[8],Ue=ee[9],nt=ee[10];return L[0]=Math.sqrt(xe*xe+pe*pe+be*be),L[1]=Math.sqrt(ke*ke+Ve*Ve+Ke*Ke),L[2]=Math.sqrt(it*it+Ue*Ue+nt*nt),L}e.getScaling=v;function b(L,ee){let xe=ee[0]+ee[5]+ee[10],pe=0;return xe>0?(pe=Math.sqrt(xe+1)*2,L[3]=.25*pe,L[0]=(ee[6]-ee[9])/pe,L[1]=(ee[8]-ee[2])/pe,L[2]=(ee[1]-ee[4])/pe):ee[0]>ee[5]&&ee[0]>ee[10]?(pe=Math.sqrt(1+ee[0]-ee[5]-ee[10])*2,L[3]=(ee[6]-ee[9])/pe,L[0]=.25*pe,L[1]=(ee[1]+ee[4])/pe,L[2]=(ee[8]+ee[2])/pe):ee[5]>ee[10]?(pe=Math.sqrt(1+ee[5]-ee[0]-ee[10])*2,L[3]=(ee[8]-ee[2])/pe,L[0]=(ee[1]+ee[4])/pe,L[1]=.25*pe,L[2]=(ee[6]+ee[9])/pe):(pe=Math.sqrt(1+ee[10]-ee[0]-ee[5])*2,L[3]=(ee[1]-ee[4])/pe,L[0]=(ee[8]+ee[2])/pe,L[1]=(ee[6]+ee[9])/pe,L[2]=.25*pe),L}e.getRotation=b;function S(L,ee){let xe=1/Math.sqrt(ee[0]*ee[0]+ee[1]*ee[1]+ee[2]*ee[2]),pe=1/Math.sqrt(ee[4]*ee[4]+ee[5]*ee[5]+ee[6]*ee[6]),be=1/Math.sqrt(ee[8]*ee[8]+ee[9]*ee[9]+ee[10]*ee[10]);return L[0]=ee[0]*xe,L[1]=ee[1]*xe,L[2]=ee[2]*xe,L[3]=0,L[4]=ee[4]*pe,L[5]=ee[5]*pe,L[6]=ee[6]*pe,L[7]=0,L[8]=ee[8]*be,L[9]=ee[9]*be,L[10]=ee[10]*be,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.extractRotation=S;function _(L,ee){if(L===ee){let xe=ee[1],pe=ee[2],be=ee[3],ke=ee[6],Ve=ee[7],Ke=ee[11];L[1]=ee[4],L[2]=ee[8],L[3]=ee[12],L[4]=xe,L[6]=ee[9],L[7]=ee[13],L[8]=pe,L[9]=ke,L[11]=ee[14],L[12]=be,L[13]=Ve,L[14]=Ke}else L[0]=ee[0],L[1]=ee[4],L[2]=ee[8],L[3]=ee[12],L[4]=ee[1],L[5]=ee[5],L[6]=ee[9],L[7]=ee[13],L[8]=ee[2],L[9]=ee[6],L[10]=ee[10],L[11]=ee[14],L[12]=ee[3],L[13]=ee[7],L[14]=ee[11],L[15]=ee[15];return L}e.transpose=_;function w(L,ee){let xe=ee[0],pe=ee[1],be=ee[2],ke=ee[3],Ve=ee[4],Ke=ee[5],it=ee[6],Ue=ee[7],nt=ee[8],ut=ee[9],St=ee[10],mt=ee[11],Pt=ee[12],It=ee[13],ar=ee[14],Hr=ee[15],gn=xe*Ke-pe*Ve,tt=xe*it-be*Ve,bt=xe*Ue-ke*Ve,Tt=pe*it-be*Ke,xt=pe*Ue-ke*Ke,me=be*Ue-ke*it,Se=nt*It-ut*Pt,he=nt*ar-St*Pt,et=nt*Hr-mt*Pt,Et=ut*ar-St*It,vt=ut*Hr-mt*It,mr=St*Hr-mt*ar,yr=gn*mr-tt*vt+bt*Et+Tt*et-xt*he+me*Se;return yr?(yr=1/yr,L[0]=(Ke*mr-it*vt+Ue*Et)*yr,L[1]=(be*vt-pe*mr-ke*Et)*yr,L[2]=(It*me-ar*xt+Hr*Tt)*yr,L[3]=(St*xt-ut*me-mt*Tt)*yr,L[4]=(it*et-Ve*mr-Ue*he)*yr,L[5]=(xe*mr-be*et+ke*he)*yr,L[6]=(ar*bt-Pt*me-Hr*tt)*yr,L[7]=(nt*me-St*bt+mt*tt)*yr,L[8]=(Ve*vt-Ke*et+Ue*Se)*yr,L[9]=(pe*et-xe*vt-ke*Se)*yr,L[10]=(Pt*xt-It*bt+Hr*gn)*yr,L[11]=(ut*bt-nt*xt-mt*gn)*yr,L[12]=(Ke*he-Ve*Et-it*Se)*yr,L[13]=(xe*Et-pe*he+be*Se)*yr,L[14]=(It*tt-Pt*Tt-ar*gn)*yr,L[15]=(nt*Tt-ut*tt+St*gn)*yr,!0):!1}e.tryInvert=w;function E(L,ee){return w(L,ee)||console.warn("non-invertible matrix.",ee),L}e.invert=E;function A(L,ee,xe){let pe=ee[0],be=ee[1],ke=ee[2],Ve=ee[3],Ke=ee[4],it=ee[5],Ue=ee[6],nt=ee[7],ut=ee[8],St=ee[9],mt=ee[10],Pt=ee[11],It=ee[12],ar=ee[13],Hr=ee[14],gn=ee[15],tt=xe[0],bt=xe[1],Tt=xe[2],xt=xe[3];return L[0]=tt*pe+bt*Ke+Tt*ut+xt*It,L[1]=tt*be+bt*it+Tt*St+xt*ar,L[2]=tt*ke+bt*Ue+Tt*mt+xt*Hr,L[3]=tt*Ve+bt*nt+Tt*Pt+xt*gn,tt=xe[4],bt=xe[5],Tt=xe[6],xt=xe[7],L[4]=tt*pe+bt*Ke+Tt*ut+xt*It,L[5]=tt*be+bt*it+Tt*St+xt*ar,L[6]=tt*ke+bt*Ue+Tt*mt+xt*Hr,L[7]=tt*Ve+bt*nt+Tt*Pt+xt*gn,tt=xe[8],bt=xe[9],Tt=xe[10],xt=xe[11],L[8]=tt*pe+bt*Ke+Tt*ut+xt*It,L[9]=tt*be+bt*it+Tt*St+xt*ar,L[10]=tt*ke+bt*Ue+Tt*mt+xt*Hr,L[11]=tt*Ve+bt*nt+Tt*Pt+xt*gn,tt=xe[12],bt=xe[13],Tt=xe[14],xt=xe[15],L[12]=tt*pe+bt*Ke+Tt*ut+xt*It,L[13]=tt*be+bt*it+Tt*St+xt*ar,L[14]=tt*ke+bt*Ue+Tt*mt+xt*Hr,L[15]=tt*Ve+bt*nt+Tt*Pt+xt*gn,L}e.mul=A;function P(L,ee,xe,pe,be,ke){let Ve=ee[0+be],Ke=ee[1+be],it=ee[2+be],Ue=ee[3+be],nt=ee[4+be],ut=ee[5+be],St=ee[6+be],mt=ee[7+be],Pt=ee[8+be],It=ee[9+be],ar=ee[10+be],Hr=ee[11+be],gn=ee[12+be],tt=ee[13+be],bt=ee[14+be],Tt=ee[15+be],xt=xe[0+ke],me=xe[1+ke],Se=xe[2+ke],he=xe[3+ke];return L[0+pe]=xt*Ve+me*nt+Se*Pt+he*gn,L[1+pe]=xt*Ke+me*ut+Se*It+he*tt,L[2+pe]=xt*it+me*St+Se*ar+he*bt,L[3+pe]=xt*Ue+me*mt+Se*Hr+he*Tt,xt=xe[4+ke],me=xe[5+ke],Se=xe[6+ke],he=xe[7+ke],L[4+pe]=xt*Ve+me*nt+Se*Pt+he*gn,L[5+pe]=xt*Ke+me*ut+Se*It+he*tt,L[6+pe]=xt*it+me*St+Se*ar+he*bt,L[7+pe]=xt*Ue+me*mt+Se*Hr+he*Tt,xt=xe[8+ke],me=xe[9+ke],Se=xe[10+ke],he=xe[11+ke],L[8+pe]=xt*Ve+me*nt+Se*Pt+he*gn,L[9+pe]=xt*Ke+me*ut+Se*It+he*tt,L[10+pe]=xt*it+me*St+Se*ar+he*bt,L[11+pe]=xt*Ue+me*mt+Se*Hr+he*Tt,xt=xe[12+ke],me=xe[13+ke],Se=xe[14+ke],he=xe[15+ke],L[12+pe]=xt*Ve+me*nt+Se*Pt+he*gn,L[13+pe]=xt*Ke+me*ut+Se*It+he*tt,L[14+pe]=xt*it+me*St+Se*ar+he*bt,L[15+pe]=xt*Ue+me*mt+Se*Hr+he*Tt,L}e.mulOffset=P;function T(L,ee,xe,pe){return A(L,A(L,ee,xe),pe)}e.mul3=T;function B(L,ee,xe){let pe=xe[0],be=xe[1],ke=xe[2],Ve,Ke,it,Ue,nt,ut,St,mt,Pt,It,ar,Hr;return ee===L?(L[12]=ee[0]*pe+ee[4]*be+ee[8]*ke+ee[12],L[13]=ee[1]*pe+ee[5]*be+ee[9]*ke+ee[13],L[14]=ee[2]*pe+ee[6]*be+ee[10]*ke+ee[14],L[15]=ee[3]*pe+ee[7]*be+ee[11]*ke+ee[15]):(Ve=ee[0],Ke=ee[1],it=ee[2],Ue=ee[3],nt=ee[4],ut=ee[5],St=ee[6],mt=ee[7],Pt=ee[8],It=ee[9],ar=ee[10],Hr=ee[11],L[0]=Ve,L[1]=Ke,L[2]=it,L[3]=Ue,L[4]=nt,L[5]=ut,L[6]=St,L[7]=mt,L[8]=Pt,L[9]=It,L[10]=ar,L[11]=Hr,L[12]=Ve*pe+nt*be+Pt*ke+ee[12],L[13]=Ke*pe+ut*be+It*ke+ee[13],L[14]=it*pe+St*be+ar*ke+ee[14],L[15]=Ue*pe+mt*be+Hr*ke+ee[15]),L}e.translate=B;function D(L,ee){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=ee[0],L[13]=ee[1],L[14]=ee[2],L[15]=1,L}e.fromTranslation=D;function M(L,ee){return L[12]=ee[0],L[13]=ee[1],L[14]=ee[2],L}e.setTranslation=M;function R(L,ee,xe,pe){return L[0]=xe[0],L[4]=xe[1],L[8]=xe[2],L[1]=pe[0],L[5]=pe[1],L[9]=pe[2],L[2]=ee[0],L[6]=ee[1],L[10]=ee[2],L}e.setAxes=R;function U(L,ee,xe,pe){let be=pe[0],ke=pe[1],Ve=pe[2],Ke=Math.sqrt(be*be+ke*ke+Ve*Ve);if(Math.abs(Ke)<1e-6)return r();Ke=1/Ke,be*=Ke,ke*=Ke,Ve*=Ke;let it=Math.sin(xe),Ue=Math.cos(xe),nt=1-Ue,ut=ee[0],St=ee[1],mt=ee[2],Pt=ee[3],It=ee[4],ar=ee[5],Hr=ee[6],gn=ee[7],tt=ee[8],bt=ee[9],Tt=ee[10],xt=ee[11],me=be*be*nt+Ue,Se=ke*be*nt+Ve*it,he=Ve*be*nt-ke*it,et=be*ke*nt-Ve*it,Et=ke*ke*nt+Ue,vt=Ve*ke*nt+be*it,mr=be*Ve*nt+ke*it,yr=ke*Ve*nt-be*it,In=Ve*Ve*nt+Ue;return L[0]=ut*me+It*Se+tt*he,L[1]=St*me+ar*Se+bt*he,L[2]=mt*me+Hr*Se+Tt*he,L[3]=Pt*me+gn*Se+xt*he,L[4]=ut*et+It*Et+tt*vt,L[5]=St*et+ar*Et+bt*vt,L[6]=mt*et+Hr*Et+Tt*vt,L[7]=Pt*et+gn*Et+xt*vt,L[8]=ut*mr+It*yr+tt*In,L[9]=St*mr+ar*yr+bt*In,L[10]=mt*mr+Hr*yr+Tt*In,L[11]=Pt*mr+gn*yr+xt*In,ee!==L&&(L[12]=ee[12],L[13]=ee[13],L[14]=ee[14],L[15]=ee[15]),L}e.rotate=U;function F(L,ee,xe){let pe=xe[0],be=xe[1],ke=xe[2],Ve=Math.sqrt(pe*pe+be*be+ke*ke);if(Math.abs(Ve)<1e-6)return n(L);Ve=1/Ve,pe*=Ve,be*=Ve,ke*=Ve;let Ke=Math.sin(ee),it=Math.cos(ee),Ue=1-it;return L[0]=pe*pe*Ue+it,L[1]=be*pe*Ue+ke*Ke,L[2]=ke*pe*Ue-be*Ke,L[3]=0,L[4]=pe*be*Ue-ke*Ke,L[5]=be*be*Ue+it,L[6]=ke*be*Ue+pe*Ke,L[7]=0,L[8]=pe*ke*Ue+be*Ke,L[9]=be*ke*Ue-pe*Ke,L[10]=ke*ke*Ue+it,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.fromRotation=F;function N(L,ee,xe){let pe=xe[0],be=xe[1],ke=xe[2];return L[0]=ee[0]*pe,L[1]=ee[1]*pe,L[2]=ee[2]*pe,L[3]=ee[3]*pe,L[4]=ee[4]*be,L[5]=ee[5]*be,L[6]=ee[6]*be,L[7]=ee[7]*be,L[8]=ee[8]*ke,L[9]=ee[9]*ke,L[10]=ee[10]*ke,L[11]=ee[11]*ke,L[12]=ee[12],L[13]=ee[13],L[14]=ee[14],L[15]=ee[15],L}e.scale=N;function z(L,ee,xe){return L[0]=ee[0]*xe,L[1]=ee[1]*xe,L[2]=ee[2]*xe,L[3]=ee[3]*xe,L[4]=ee[4]*xe,L[5]=ee[5]*xe,L[6]=ee[6]*xe,L[7]=ee[7]*xe,L[8]=ee[8]*xe,L[9]=ee[9]*xe,L[10]=ee[10]*xe,L[11]=ee[11]*xe,L[12]=ee[12],L[13]=ee[13],L[14]=ee[14],L[15]=ee[15],L}e.scaleUniformly=z;function q(L,ee){return L[0]=ee[0],L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=ee[1],L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=ee[2],L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.fromScaling=q;function O(L,ee){return L[0]=ee,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=ee,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=ee,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.fromUniformScaling=O;function J(L,ee){return L[0]=ee[0],L[1]=ee[1],L[2]=ee[2],L[4]=ee[3],L[5]=ee[4],L[6]=ee[5],L[8]=ee[6],L[9]=ee[7],L[10]=ee[8],L}e.fromMat3=J;function Q(L,ee,xe,pe){let[be,ke,Ve,Ke]=xe,it=be+be,Ue=ke+ke,nt=Ve+Ve,ut=be*it,St=be*Ue,mt=be*nt,Pt=ke*Ue,It=ke*nt,ar=Ve*nt,Hr=Ke*it,gn=Ke*Ue,tt=Ke*nt,[bt,Tt,xt]=pe;return L[0]=(1-(Pt+ar))*bt,L[1]=(St+tt)*bt,L[2]=(mt-gn)*bt,L[3]=0,L[4]=(St-tt)*Tt,L[5]=(1-(ut+ar))*Tt,L[6]=(It+Hr)*Tt,L[7]=0,L[8]=(mt+gn)*xt,L[9]=(It-Hr)*xt,L[10]=(1-(ut+Pt))*xt,L[11]=0,L[12]=ee[0],L[13]=ee[1],L[14]=ee[2],L[15]=1,L}e.compose=Q;let H=[0,0,0],W=t();function K(L,ee,xe,pe){let be=x.magnitude(x.set(H,L[0],L[1],L[2])),ke=x.magnitude(x.set(H,L[4],L[5],L[6])),Ve=x.magnitude(x.set(H,L[8],L[9],L[10]));V(L)<0&&(be=-be),ee[0]=L[12],ee[1]=L[13],ee[2]=L[14],f(W,L);let it=1/be,Ue=1/ke,nt=1/Ve;return W[0]*=it,W[1]*=it,W[2]*=it,W[4]*=Ue,W[5]*=Ue,W[6]*=Ue,W[8]*=nt,W[9]*=nt,W[10]*=nt,b(xe,W),pe[0]=be,pe[1]=ke,pe[2]=Ve,L}e.decompose=K;function ce(L){let ee="";for(let xe=0;xe<4;xe++){for(let pe=0;pe<4;pe++)ee+=L[4*pe+xe].toString(),pe<3&&(ee+=" ");xe<3&&(ee+=` +`)}return ee}e.makeTable=ce;function V(L){let ee=L[0],xe=L[1],pe=L[2],be=L[3],ke=L[4],Ve=L[5],Ke=L[6],it=L[7],Ue=L[8],nt=L[9],ut=L[10],St=L[11],mt=L[12],Pt=L[13],It=L[14],ar=L[15],Hr=ee*Ve-xe*ke,gn=ee*Ke-pe*ke,tt=ee*it-be*ke,bt=xe*Ke-pe*Ve,Tt=xe*it-be*Ve,xt=pe*it-be*Ke,me=Ue*Pt-nt*mt,Se=Ue*It-ut*mt,he=Ue*ar-St*mt,et=nt*It-ut*Pt,Et=nt*ar-St*Pt,vt=ut*ar-St*It;return Hr*vt-gn*Et+tt*et+bt*he-Tt*Se+xt*me}e.determinant=V;function G(L,ee){return X(L,typeof ee<"u"?ee:1e-6)}e.isRotationAndTranslation=G;function X(L,ee){let xe=L[0],pe=L[1],be=L[2],ke=L[3],Ve=L[4],Ke=L[5],it=L[6],Ue=L[7],nt=L[8],ut=L[9],St=L[10],mt=L[11],Pt=L[15];if(!jn(Pt,1,ee)||!jn(ke,0,ee)||!jn(Ue,0,ee)||!jn(mt,0,ee))return!1;let It=Math.abs(xe*(Ke*St-it*ut)-pe*(Ve*St-it*nt)+be*(Ve*ut-Ke*nt));return!!jn(It,1,ee)}function Z(L,ee){return ie(L,typeof ee<"u"?ee:1e-6)}e.isTranslationAndUniformScaling=Z;function ie(L,ee){let xe=L[0];return jn(L[1],0,ee)&&jn(L[2],0,ee)&&jn(L[3],0,ee)&&jn(L[4],0,ee)&&jn(L[5],xe,ee)&&jn(L[6],0,ee)&&jn(L[7],0,ee)&&jn(L[8],0,ee)&&jn(L[9],0,ee)&&jn(L[10],xe,ee)&&jn(L[11],0,ee)&&jn(L[15],1,ee)}function de(L,ee){let xe=ee[0],pe=ee[1],be=ee[2],ke=ee[3],Ve=xe+xe,Ke=pe+pe,it=be+be,Ue=xe*Ve,nt=pe*Ve,ut=pe*Ke,St=be*Ve,mt=be*Ke,Pt=be*it,It=ke*Ve,ar=ke*Ke,Hr=ke*it;return L[0]=1-ut-Pt,L[1]=nt+Hr,L[2]=St-ar,L[3]=0,L[4]=nt-Hr,L[5]=1-Ue-Pt,L[6]=mt+It,L[7]=0,L[8]=St+ar,L[9]=mt-It,L[10]=1-Ue-ut,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.fromQuat=de;function we(L,ee,xe){let pe=ee[0],be=ee[1],ke=ee[2],Ve=Math.cos(pe),Ke=Math.sin(pe),it=Math.cos(be),Ue=Math.sin(be),nt=Math.cos(ke),ut=Math.sin(ke);if(xe==="XYZ"){let St=Ve*nt,mt=Ve*ut,Pt=Ke*nt,It=Ke*ut;L[0]=it*nt,L[4]=-it*ut,L[8]=Ue,L[1]=mt+Pt*Ue,L[5]=St-It*Ue,L[9]=-Ke*it,L[2]=It-St*Ue,L[6]=Pt+mt*Ue,L[10]=Ve*it}else if(xe==="YXZ"){let St=it*nt,mt=it*ut,Pt=Ue*nt,It=Ue*ut;L[0]=St+It*Ke,L[4]=Pt*Ke-mt,L[8]=Ve*Ue,L[1]=Ve*ut,L[5]=Ve*nt,L[9]=-Ke,L[2]=mt*Ke-Pt,L[6]=It+St*Ke,L[10]=Ve*it}else if(xe==="ZXY"){let St=it*nt,mt=it*ut,Pt=Ue*nt,It=Ue*ut;L[0]=St-It*Ke,L[4]=-Ve*ut,L[8]=Pt+mt*Ke,L[1]=mt+Pt*Ke,L[5]=Ve*nt,L[9]=It-St*Ke,L[2]=-Ve*Ue,L[6]=Ke,L[10]=Ve*it}else if(xe==="ZYX"){let St=Ve*nt,mt=Ve*ut,Pt=Ke*nt,It=Ke*ut;L[0]=it*nt,L[4]=Pt*Ue-mt,L[8]=St*Ue+It,L[1]=it*ut,L[5]=It*Ue+St,L[9]=mt*Ue-Pt,L[2]=-Ue,L[6]=Ke*it,L[10]=Ve*it}else if(xe==="YZX"){let St=Ve*it,mt=Ve*Ue,Pt=Ke*it,It=Ke*Ue;L[0]=it*nt,L[4]=It-St*ut,L[8]=Pt*ut+mt,L[1]=ut,L[5]=Ve*nt,L[9]=-Ke*nt,L[2]=-Ue*nt,L[6]=mt*ut+Pt,L[10]=St-It*ut}else if(xe==="XZY"){let St=Ve*it,mt=Ve*Ue,Pt=Ke*it,It=Ke*Ue;L[0]=it*nt,L[4]=-ut,L[8]=Ue*nt,L[1]=St*ut+It,L[5]=Ve*nt,L[9]=mt*ut-Pt,L[2]=Pt*ut-mt,L[6]=Ke*nt,L[10]=It*ut+St}return L[3]=0,L[7]=0,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}e.fromEuler=we;function Be(L,ee,xe,pe,be,ke,Ve){let Ke=2*ke/(xe-ee),it=2*ke/(pe-be),Ue=(xe+ee)/(xe-ee),nt=(pe+be)/(pe-be),ut=-(Ve+ke)/(Ve-ke),St=-2*Ve*ke/(Ve-ke);return L[0]=Ke,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=it,L[6]=0,L[7]=0,L[8]=Ue,L[9]=nt,L[10]=ut,L[11]=-1,L[12]=0,L[13]=0,L[14]=St,L[15]=0,L}e.perspective=Be;function Ie(L,ee,xe,pe,be,ke,Ve){let Ke=1/(xe-ee),it=1/(pe-be),Ue=1/(Ve-ke),nt=(xe+ee)*Ke,ut=(pe+be)*it,St=(Ve+ke)*Ue;return L[0]=2*Ke,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=2*it,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=-2*Ue,L[11]=0,L[12]=-nt,L[13]=-ut,L[14]=-St,L[15]=1,L}e.ortho=Ie;function le(L,ee,xe,pe){let be,ke,Ve,Ke,it,Ue,nt,ut,St,mt,Pt=ee[0],It=ee[1],ar=ee[2],Hr=pe[0],gn=pe[1],tt=pe[2],bt=xe[0],Tt=xe[1],xt=xe[2];return Math.abs(Pt-bt)<1e-6&&Math.abs(It-Tt)<1e-6&&Math.abs(ar-xt)<1e-6?n(L):(nt=Pt-bt,ut=It-Tt,St=ar-xt,mt=1/Math.sqrt(nt*nt+ut*ut+St*St),nt*=mt,ut*=mt,St*=mt,be=gn*St-tt*ut,ke=tt*nt-Hr*St,Ve=Hr*ut-gn*nt,mt=Math.sqrt(be*be+ke*ke+Ve*Ve),mt?(mt=1/mt,be*=mt,ke*=mt,Ve*=mt):(be=0,ke=0,Ve=0),Ke=ut*Ve-St*ke,it=St*be-nt*Ve,Ue=nt*ke-ut*be,mt=Math.sqrt(Ke*Ke+it*it+Ue*Ue),mt?(mt=1/mt,Ke*=mt,it*=mt,Ue*=mt):(Ke=0,it=0,Ue=0),L[0]=be,L[1]=Ke,L[2]=nt,L[3]=0,L[4]=ke,L[5]=it,L[6]=ut,L[7]=0,L[8]=Ve,L[9]=Ue,L[10]=St,L[11]=0,L[12]=-(be*Pt+ke*It+Ve*ar),L[13]=-(Ke*Pt+it*It+Ue*ar),L[14]=-(nt*Pt+ut*It+St*ar),L[15]=1,L)}e.lookAt=le;function j(L,ee,xe,pe){let be=ee[0],ke=ee[1],Ve=ee[2],Ke=pe[0],it=pe[1],Ue=pe[2],nt=be-xe[0],ut=ke-xe[1],St=Ve-xe[2],mt=nt*nt+ut*ut+St*St;mt>0&&(mt=1/Math.sqrt(mt),nt*=mt,ut*=mt,St*=mt);let Pt=it*St-Ue*ut,It=Ue*nt-Ke*St,ar=Ke*ut-it*nt;return mt=Pt*Pt+It*It+ar*ar,mt>0&&(mt=1/Math.sqrt(mt),Pt*=mt,It*=mt,ar*=mt),L[0]=Pt,L[1]=It,L[2]=ar,L[3]=0,L[4]=ut*ar-St*It,L[5]=St*Pt-nt*ar,L[6]=nt*It-ut*Pt,L[7]=0,L[8]=nt,L[9]=ut,L[10]=St,L[11]=0,L[12]=be,L[13]=ke,L[14]=Ve,L[15]=1,L}e.targetTo=j;function ue(L,ee){o(L);for(let xe=0;xe<4;xe++){let pe=ee[xe];u(L,xe,pe,1)}return L}e.fromPermutation=ue;function fe(L){let ee=L[0]*L[0]+L[1]*L[1]+L[2]*L[2],xe=L[4]*L[4]+L[5]*L[5]+L[6]*L[6],pe=L[8]*L[8]+L[9]*L[9]+L[10]*L[10];return Math.sqrt(Math.max(ee,xe,pe))}e.getMaxScaleOnAxis=fe;let De=[1,0,0],Re=[0,1,0],Xe=[0,0,1];e.rotX90=F(t(),Cr(90),De),e.rotX180=F(t(),Cr(180),De),e.rotY90=F(t(),Cr(90),Re),e.rotY180=F(t(),Cr(180),Re),e.rotY270=F(t(),Cr(270),Re),e.rotZ90=F(t(),Cr(90),Xe),e.rotZ180=F(t(),Cr(180),Xe),e.rotXY90=A(t(),e.rotX90,e.rotY90),e.rotZY90=A(t(),e.rotZ90,e.rotY90),e.rotZYZ90=A(t(),e.rotZY90,e.rotZ90),e.rotZ90X180=A(t(),e.rotZ90,e.rotX180),e.rotY90Z180=A(t(),e.rotY90,e.rotZ180),e.id=r()})(ne||(ne={}));function Kt(){return Kt.zero()}(function(e){function t(){let V=[.1,0,0,0,0,0,0,0,0];return V[0]=0,V}e.zero=t;function r(){let V=t();return V[0]=1,V[1]=0,V[2]=0,V[3]=0,V[4]=1,V[5]=0,V[6]=0,V[7]=0,V[8]=1,V}e.identity=r;function n(V){return V[0]=1,V[1]=0,V[2]=0,V[3]=0,V[4]=1,V[5]=0,V[6]=0,V[7]=0,V[8]=1,V}e.setIdentity=n;function o(V,G,X){return G[X+0]=V[0],G[X+1]=V[1],G[X+2]=V[2],G[X+3]=V[3],G[X+4]=V[4],G[X+5]=V[5],G[X+6]=V[6],G[X+7]=V[7],G[X+8]=V[8],G}e.toArray=o;function i(V,G,X){return V[0]=G[X+0],V[1]=G[X+1],V[2]=G[X+2],V[3]=G[X+3],V[4]=G[X+4],V[5]=G[X+5],V[6]=G[X+6],V[7]=G[X+7],V[8]=G[X+8],V}e.fromArray=i;function s(V,G,X,Z){return V[0]=G[0],V[1]=G[1],V[2]=G[2],V[3]=X[0],V[4]=X[1],V[5]=X[2],V[6]=Z[0],V[7]=Z[1],V[8]=Z[2],V}e.fromColumns=s;function a(V,G){return V[0]=G[0],V[1]=G[1],V[2]=G[2],V[3]=G[4],V[4]=G[5],V[5]=G[6],V[6]=G[8],V[7]=G[9],V[8]=G[10],V}e.fromMat4=a;let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function c(V,G,X){return ne.fromEuler(l,G,X),a(V,l)}e.fromEuler=c;function u(V,G,X,Z,ie,de,we,Be,Ie){let le=t();return le[0]=V,le[1]=G,le[2]=X,le[3]=Z,le[4]=ie,le[5]=de,le[6]=we,le[7]=Be,le[8]=Ie,le}e.create=u;let d=r();function m(V,G){return f(V,d,typeof G>"u"?1e-6:G)}e.isIdentity=m;function p(V){for(let G=0;G<9;G++)if(isNaN(V[G]))return!0;return!1}e.hasNaN=p;function h(V){return v(t(),V)}e.clone=h;function f(V,G,X){for(let Z=0;Z<9;Z++)if(Math.abs(V[Z]-G[Z])>X)return!1;return!0}e.areEqual=f;function y(V,G,X,Z){V[3*X+G]=Z}e.setValue=y;function g(V,G,X){return V[3*X+G]}e.getValue=g;function v(V,G){return V[0]=G[0],V[1]=G[1],V[2]=G[2],V[3]=G[3],V[4]=G[4],V[5]=G[5],V[6]=G[6],V[7]=G[7],V[8]=G[8],V}e.copy=v;function b(V,G){if(V===G){let X=G[1],Z=G[2],ie=G[5];V[1]=G[3],V[2]=G[6],V[3]=X,V[5]=G[7],V[6]=Z,V[7]=ie}else V[0]=G[0],V[1]=G[3],V[2]=G[6],V[3]=G[1],V[4]=G[4],V[5]=G[7],V[6]=G[2],V[7]=G[5],V[8]=G[8];return V}e.transpose=b;function S(V,G){let X=G[0],Z=G[1],ie=G[2],de=G[3],we=G[4],Be=G[5],Ie=G[6],le=G[7],j=G[8],ue=j*we-Be*le,fe=-j*de+Be*Ie,De=le*de-we*Ie,Re=X*ue+Z*fe+ie*De;return Re?(Re=1/Re,V[0]=ue*Re,V[1]=(-j*Z+ie*le)*Re,V[2]=(Be*Z-ie*we)*Re,V[3]=fe*Re,V[4]=(j*X-ie*Ie)*Re,V[5]=(-Be*X+ie*de)*Re,V[6]=De*Re,V[7]=(-le*X+Z*Ie)*Re,V[8]=(we*X-Z*de)*Re,V):(console.warn("non-invertible matrix.",G),V)}e.invert=S;function _(V,G){return V===G?(V[3]=G[1],V[6]=G[2],V[7]=G[5]):(V[0]=G[0],V[1]=G[1],V[2]=G[2],V[3]=G[1],V[4]=G[4],V[5]=G[5],V[6]=G[2],V[7]=G[5],V[8]=G[8]),V}e.symmtricFromUpper=_;function w(V,G){return V===G?(V[1]=G[3],V[2]=G[6],V[5]=G[7]):(V[0]=G[0],V[1]=G[3],V[2]=G[6],V[3]=G[3],V[4]=G[4],V[5]=G[7],V[6]=G[6],V[7]=G[7],V[8]=G[8]),V}e.symmtricFromLower=w;function E(V){let G=V[0],X=V[1],Z=V[2],ie=V[3],de=V[4],we=V[5],Be=V[6],Ie=V[7],le=V[8],j=le*de-we*Ie,ue=-le*ie+we*Be,fe=Ie*ie-de*Be;return G*j+X*ue+Z*fe}e.determinant=E;function A(V){return V[0]+V[4]+V[8]}e.trace=A;function P(V,G,X){return V[0]=G[0]-X[0],V[1]=G[1]-X[1],V[2]=G[2]-X[2],V[3]=G[3]-X[3],V[4]=G[4]-X[4],V[5]=G[5]-X[5],V[6]=G[6]-X[6],V[7]=G[7]-X[7],V[8]=G[8]-X[8],V}e.sub=P;function T(V,G,X){return V[0]=G[0]+X[0],V[1]=G[1]+X[1],V[2]=G[2]+X[2],V[3]=G[3]+X[3],V[4]=G[4]+X[4],V[5]=G[5]+X[5],V[6]=G[6]+X[6],V[7]=G[7]+X[7],V[8]=G[8]+X[8],V}e.add=T;function B(V,G,X){let Z=G[0],ie=G[1],de=G[2],we=G[3],Be=G[4],Ie=G[5],le=G[6],j=G[7],ue=G[8],fe=X[0],De=X[1],Re=X[2],Xe=X[3],L=X[4],ee=X[5],xe=X[6],pe=X[7],be=X[8];return V[0]=fe*Z+De*we+Re*le,V[1]=fe*ie+De*Be+Re*j,V[2]=fe*de+De*Ie+Re*ue,V[3]=Xe*Z+L*we+ee*le,V[4]=Xe*ie+L*Be+ee*j,V[5]=Xe*de+L*Ie+ee*ue,V[6]=xe*Z+pe*we+be*le,V[7]=xe*ie+pe*Be+be*j,V[8]=xe*de+pe*Ie+be*ue,V}e.mul=B;function D(V,G,X){return V[0]=G[0]-X,V[1]=G[1]-X,V[2]=G[2]-X,V[3]=G[3]-X,V[4]=G[4]-X,V[5]=G[5]-X,V[6]=G[6]-X,V[7]=G[7]-X,V[8]=G[8]-X,V}e.subScalar=D;function M(V,G,X){return V[0]=G[0]+X,V[1]=G[1]+X,V[2]=G[2]+X,V[3]=G[3]+X,V[4]=G[4]+X,V[5]=G[5]+X,V[6]=G[6]+X,V[7]=G[7]+X,V[8]=G[8]+X,V}e.addScalar=M;function R(V,G,X){return V[0]=G[0]*X,V[1]=G[1]*X,V[2]=G[2]*X,V[3]=G[3]*X,V[4]=G[4]*X,V[5]=G[5]*X,V[6]=G[6]*X,V[7]=G[7]*X,V[8]=G[8]*X,V}e.mulScalar=R;let U=Math.PI/3,F=t();function N(V,G){let X=G[1]*G[1]+G[2]*G[2]+G[5]*G[5];if(X===0)V[0]=G[0],V[1]=G[4],V[2]=G[8];else{let Z=A(G)/3,ie=G[0]-Z,de=G[4]-Z,we=G[8]-Z,Be=ie*ie+de*de+we*we+2*X,Ie=Math.sqrt(Be/6);R(F,e.Identity,Z),P(F,G,F),R(F,F,1/Ie);let le=E(F)/2,j=le<=-1?U:le>=1?0:Math.acos(le)/3;V[0]=Z+2*Ie*Math.cos(j),V[2]=Z+2*Ie*Math.cos(j+2*U),V[1]=3*Z-V[0]-V[2]}return V}e.symmetricEigenvalues=N;let z=[.1,0,0],q=[.1,0,0],O=[.1,0,0],J=[.1,0,0],Q=[.1,0,0],H=[.1,0,0];function W(V,G,X){x.set(z,G[0]-X,G[1],G[2]),x.set(q,G[1],G[4]-X,G[5]),x.set(O,G[2],G[5],G[8]-X),x.cross(J,z,q),x.cross(Q,z,O),x.cross(H,q,O);let Z=x.dot(J,J),ie=x.dot(Q,Q),de=x.dot(H,H),we=Z,Be=0;return ie>we&&(we=ie,Be=1),de>we&&(Be=2),Be===0?x.scale(V,J,1/Math.sqrt(Z)):Be===1?x.scale(V,Q,1/Math.sqrt(ie)):x.scale(V,H,1/Math.sqrt(de)),V}e.eigenvector=W;function K(V,G){return a(V,G),S(V,V),b(V,V),V}e.directionTransform=K,e.Identity=r();function ce(V,G){return V[0]*G[0]+V[1]*G[1]+V[2]*G[2]+V[3]*G[3]+V[4]*G[4]+V[5]*G[5]+V[6]*G[6]+V[7]*G[7]+V[8]*G[8]}e.innerProduct=ce})(Kt||(Kt={}));function Ae(){return Ae.zero()}(function(e){function t(){let A=[.1,0];return A[0]=0,A}e.zero=t;function r(A){let P=t();return P[0]=A[0],P[1]=A[1],P}e.clone=r;function n(A,P){let T=t();return T[0]=A,T[1]=P,T}e.create=n;function o(A){return isNaN(A[0])||isNaN(A[1])}e.hasNaN=o;function i(A,P,T){return P[T+0]=A[0],P[T+1]=A[1],P}e.toArray=i;function s(A,P,T){return A[0]=P[T+0],A[1]=P[T+1],A}e.fromArray=s;function a(A,P){return A[0]=P[0],A[1]=P[1],A}e.copy=a;function l(A,P,T){return A[0]=P,A[1]=T,A}e.set=l;function c(A,P,T){return A[0]=P[0]+T[0],A[1]=P[1]+T[1],A}e.add=c;function u(A,P,T){return A[0]=P[0]-T[0],A[1]=P[1]-T[1],A}e.sub=u;function d(A,P,T){return A[0]=P[0]*T[0],A[1]=P[1]*T[1],A}e.mul=d;function m(A,P,T){return A[0]=P[0]/T[0],A[1]=P[1]/T[1],A}e.div=m;function p(A,P,T){return A[0]=P[0]*T,A[1]=P[1]*T,A}e.scale=p;function h(A,P){return A[0]=Math.round(P[0]),A[1]=Math.round(P[1]),A}e.round=h;function f(A,P){return A[0]=Math.ceil(P[0]),A[1]=Math.ceil(P[1]),A}e.ceil=f;function y(A,P){return A[0]=Math.floor(P[0]),A[1]=Math.floor(P[1]),A}e.floor=y;function g(A,P){let T=P[0]-A[0],B=P[1]-A[1];return Math.sqrt(T*T+B*B)}e.distance=g;function v(A,P){let T=P[0]-A[0],B=P[1]-A[1];return T*T+B*B}e.squaredDistance=v;function b(A){let P=A[0],T=A[1];return Math.sqrt(P*P+T*T)}e.magnitude=b;function S(A){let P=A[0],T=A[1];return P*P+T*T}e.squaredMagnitude=S;function _(A,P){return A[0]=1/P[0],A[1]=1/P[1],A}e.inverse=_;function w(A,P){return A[0]===P[0]&&A[1]===P[1]}e.areEqual=w;function E(A,P){return`[${A[0].toPrecision(P)} ${A[1].toPrecision(P)}}]`}e.toString=E})(Ae||(Ae={}));function Rt(){return Rt.zero()}(function(e){function t(){let D=[.1,0,0,0];return D[0]=0,D}e.zero=t;function r(D){let M=t();return M[0]=D[0],M[1]=D[1],M[2]=D[2],M[3]=D[3],M}e.clone=r;function n(D,M,R,U){let F=t();return F[0]=D,F[1]=M,F[2]=R,F[3]=U,F}e.create=n;function o(D,M){return D[0]=M.center[0],D[1]=M.center[1],D[2]=M.center[2],D[3]=M.radius,D}e.fromSphere=o;function i(D){return o(t(),D)}e.ofSphere=i;function s(D){return isNaN(D[0])||isNaN(D[1])||isNaN(D[2])||isNaN(D[3])}e.hasNaN=s;function a(D,M,R){return M[R+0]=D[0],M[R+1]=D[1],M[R+2]=D[2],M[R+3]=D[3],M}e.toArray=a;function l(D,M,R){return D[0]=M[R+0],D[1]=M[R+1],D[2]=M[R+2],D[3]=M[R+3],D}e.fromArray=l;function c(D,M,R){M[R+0]=D[0],M[R+1]=D[1],M[R+2]=D[2]}e.toVec3Array=c;function u(D,M,R){return D[0]=M[R+0],D[1]=M[R+1],D[2]=M[R+2],D[3]=0,D}e.fromVec3Array=u;function d(D,M){return D[0]=M[0],D[1]=M[1],D[2]=M[2],D[3]=M[3],D}e.copy=d;function m(D,M,R,U,F){return D[0]=M,D[1]=R,D[2]=U,D[3]=F,D}e.set=m;function p(D,M,R){return D[0]=M[0]+R[0],D[1]=M[1]+R[1],D[2]=M[2]+R[2],D[3]=M[3]+R[3],D}e.add=p;function h(D,M){let R=M[0]-D[0],U=M[1]-D[1],F=M[2]-D[2],N=M[3]-D[3];return Math.sqrt(R*R+U*U+F*F+N*N)}e.distance=h;function f(D,M,R){return D[0]=M[0]*R,D[1]=M[1]*R,D[2]=M[2]*R,D[4]=M[4]*R,D}e.scale=f;function y(D,M){return D[0]=Math.round(M[0]),D[1]=Math.round(M[1]),D[2]=Math.round(M[2]),D[3]=Math.round(M[3]),D}e.round=y;function g(D,M){return D[0]=Math.ceil(M[0]),D[1]=Math.ceil(M[1]),D[2]=Math.ceil(M[2]),D[3]=Math.ceil(M[3]),D}e.ceil=g;function v(D,M){return D[0]=Math.floor(M[0]),D[1]=Math.floor(M[1]),D[2]=Math.floor(M[2]),D[3]=Math.floor(M[3]),D}e.floor=v;function b(D,M){let R=M[0]-D[0],U=M[1]-D[1],F=M[2]-D[2],N=M[3]-D[3];return R*R+U*U+F*F+N*N}e.squaredDistance=b;function S(D){let M=D[0],R=D[1],U=D[2],F=D[3];return Math.sqrt(M*M+R*R+U*U+F*F)}e.norm=S;function _(D){let M=D[0],R=D[1],U=D[2],F=D[3];return M*M+R*R+U*U+F*F}e.squaredNorm=_;function w(D,M,R){let U=M[0],F=M[1],N=M[2],z=M[3];return D[0]=R[0]*U+R[4]*F+R[8]*N+R[12]*z,D[1]=R[1]*U+R[5]*F+R[9]*N+R[13]*z,D[2]=R[2]*U+R[6]*F+R[10]*N+R[14]*z,D[3]=R[3]*U+R[7]*F+R[11]*N+R[15]*z,D}e.transformMat4=w;function E(D,M){return D[0]*M[0]+D[1]*M[1]+D[2]*M[2]+D[3]*M[3]}e.dot=E;function A(D,M){return D[0]=1/M[0],D[1]=1/M[1],D[2]=1/M[2],D[3]=1/M[3],D}e.inverse=A;function P(D,M){return D[0]===M[0]&&D[1]===M[1]&&D[2]===M[2]&&D[3]===M[3]}e.exactEquals=P;function T(D,M){let R=D[0],U=D[1],F=D[2],N=D[3],z=M[0],q=M[1],O=M[2],J=M[3];return Math.abs(R-z)<=1e-6*Math.max(1,Math.abs(R),Math.abs(z))&&Math.abs(U-q)<=1e-6*Math.max(1,Math.abs(U),Math.abs(q))&&Math.abs(F-O)<=1e-6*Math.max(1,Math.abs(F),Math.abs(O))&&Math.abs(N-J)<=1e-6*Math.max(1,Math.abs(N),Math.abs(J))}e.equals=T;function B(D,M){return`[${D[0].toPrecision(M)} ${D[1].toPrecision(M)} ${D[2].toPrecision(M)} ${D[3].toPrecision(M)}]`}e.toString=B})(Rt||(Rt={}));function n1(e){return Object.keys(e)}function _r(e){throw new Error("unreachable")}function vg(e){return typeof e?.then=="function"}function vn(){return vn.zero()}(function(e){function t(){let W=[.1,0,0,0];return W[0]=0,W}e.zero=t;function r(){let W=t();return W[3]=1,W}e.identity=r;function n(W){W[0]=0,W[1]=0,W[2]=0,W[3]=1}e.setIdentity=n;function o(W){return isNaN(W[0])||isNaN(W[1])||isNaN(W[2])||isNaN(W[3])}e.hasNaN=o;function i(W,K,ce,V){let G=r();return G[0]=W,G[1]=K,G[2]=ce,G[3]=V,G}e.create=i;function s(W,K,ce){ce=ce*.5;let V=Math.sin(ce);return W[0]=V*K[0],W[1]=V*K[1],W[2]=V*K[2],W[3]=Math.cos(ce),W}e.setAxisAngle=s;function a(W,K){let ce=Math.acos(K[3])*2,V=Math.sin(ce/2);return V!==0?(W[0]=K[0]/V,W[1]=K[1]/V,W[2]=K[2]/V):(W[0]=1,W[1]=0,W[2]=0),ce}e.getAxisAngle=a;function l(W,K,ce){let V=K[0],G=K[1],X=K[2],Z=K[3],ie=ce[0],de=ce[1],we=ce[2],Be=ce[3];return W[0]=V*Be+Z*ie+G*we-X*de,W[1]=G*Be+Z*de+X*ie-V*we,W[2]=X*Be+Z*we+V*de-G*ie,W[3]=Z*Be-V*ie-G*de-X*we,W}e.multiply=l;function c(W,K,ce){ce*=.5;let V=K[0],G=K[1],X=K[2],Z=K[3],ie=Math.sin(ce),de=Math.cos(ce);return W[0]=V*de+Z*ie,W[1]=G*de+X*ie,W[2]=X*de-G*ie,W[3]=Z*de-V*ie,W}e.rotateX=c;function u(W,K,ce){ce*=.5;let V=K[0],G=K[1],X=K[2],Z=K[3],ie=Math.sin(ce),de=Math.cos(ce);return W[0]=V*de-X*ie,W[1]=G*de+Z*ie,W[2]=X*de+V*ie,W[3]=Z*de-G*ie,W}e.rotateY=u;function d(W,K,ce){ce*=.5;let V=K[0],G=K[1],X=K[2],Z=K[3],ie=Math.sin(ce),de=Math.cos(ce);return W[0]=V*de+G*ie,W[1]=G*de-V*ie,W[2]=X*de+Z*ie,W[3]=Z*de-X*ie,W}e.rotateZ=d;function m(W,K){let ce=K[0],V=K[1],G=K[2];return W[0]=ce,W[1]=V,W[2]=G,W[3]=Math.sqrt(Math.abs(1-ce*ce-V*V-G*G)),W}e.calculateW=m;function p(W,K,ce,V){let G=K[0],X=K[1],Z=K[2],ie=K[3],de=ce[0],we=ce[1],Be=ce[2],Ie=ce[3],le,j,ue,fe,De;return j=G*de+X*we+Z*Be+ie*Ie,j<0&&(j=-j,de=-de,we=-we,Be=-Be,Ie=-Ie),1-j>1e-6?(le=Math.acos(j),ue=Math.sin(le),fe=Math.sin((1-V)*le)/ue,De=Math.sin(V*le)/ue):(fe=1-V,De=V),W[0]=fe*G+De*de,W[1]=fe*X+De*we,W[2]=fe*Z+De*Be,W[3]=fe*ie+De*Ie,W}e.slerp=p;function h(W,K){let ce=K[0],V=K[1],G=K[2],X=K[3],Z=ce*ce+V*V+G*G+X*X,ie=Z?1/Z:0;return W[0]=-ce*ie,W[1]=-V*ie,W[2]=-G*ie,W[3]=X*ie,W}e.invert=h;function f(W,K){return W[0]=-K[0],W[1]=-K[1],W[2]=-K[2],W[3]=K[3],W}e.conjugate=f;function y(W,K){return W[0]*K[0]+W[1]*K[1]+W[2]*K[2]+W[3]*K[3]}e.dot=y;function g(W,K){let ce=K[0]+K[4]+K[8],V;if(ce>0)V=Math.sqrt(ce+1),W[3]=.5*V,V=.5/V,W[0]=(K[5]-K[7])*V,W[1]=(K[6]-K[2])*V,W[2]=(K[1]-K[3])*V;else{let G=0;K[4]>K[0]&&(G=1),K[8]>K[G*3+G]&&(G=2);let X=(G+1)%3,Z=(G+2)%3;V=Math.sqrt(K[G*3+G]-K[X*3+X]-K[Z*3+Z]+1),W[G]=.5*V,V=.5/V,W[3]=(K[X*3+Z]-K[Z*3+X])*V,W[X]=(K[X*3+G]+K[G*3+X])*V,W[Z]=(K[Z*3+G]+K[G*3+Z])*V}return W}e.fromMat3=g;function v(W,K,ce){let[V,G,X]=K,Z=Math.cos(V/2),ie=Math.cos(G/2),de=Math.cos(X/2),we=Math.sin(V/2),Be=Math.sin(G/2),Ie=Math.sin(X/2);switch(ce){case"XYZ":W[0]=we*ie*de+Z*Be*Ie,W[1]=Z*Be*de-we*ie*Ie,W[2]=Z*ie*Ie+we*Be*de,W[3]=Z*ie*de-we*Be*Ie;break;case"YXZ":W[0]=we*ie*de+Z*Be*Ie,W[1]=Z*Be*de-we*ie*Ie,W[2]=Z*ie*Ie-we*Be*de,W[3]=Z*ie*de+we*Be*Ie;break;case"ZXY":W[0]=we*ie*de-Z*Be*Ie,W[1]=Z*Be*de+we*ie*Ie,W[2]=Z*ie*Ie+we*Be*de,W[3]=Z*ie*de-we*Be*Ie;break;case"ZYX":W[0]=we*ie*de-Z*Be*Ie,W[1]=Z*Be*de+we*ie*Ie,W[2]=Z*ie*Ie-we*Be*de,W[3]=Z*ie*de+we*Be*Ie;break;case"YZX":W[0]=we*ie*de+Z*Be*Ie,W[1]=Z*Be*de+we*ie*Ie,W[2]=Z*ie*Ie-we*Be*de,W[3]=Z*ie*de-we*Be*Ie;break;case"XZY":W[0]=we*ie*de-Z*Be*Ie,W[1]=Z*Be*de-we*ie*Ie,W[2]=Z*ie*Ie+we*Be*de,W[3]=Z*ie*de+we*Be*Ie;break;default:_r(ce)}return W}e.fromEuler=v;let b=[0,0,0];function S(W,K,ce){let V=x.dot(K,ce)+1;return V<1e-6?(V=0,Math.abs(K[0])>Math.abs(K[2])?x.set(b,-K[1],K[0],0):x.set(b,0,-K[2],K[1])):x.cross(b,K,ce),W[0]=b[0],W[1]=b[1],W[2]=b[2],W[3]=V,M(W,W),W}e.fromUnitVec3=S;function _(W){let K=t();return K[0]=W[0],K[1]=W[1],K[2]=W[2],K[3]=W[3],K}e.clone=_;function w(W,K,ce){return K[ce+0]=W[0],K[ce+1]=W[1],K[ce+2]=W[2],K[ce+3]=W[3],K}e.toArray=w;function E(W,K,ce){return W[0]=K[ce+0],W[1]=K[ce+1],W[2]=K[ce+2],W[3]=K[ce+3],W}e.fromArray=E;function A(W,K){return W[0]=K[0],W[1]=K[1],W[2]=K[2],W[3]=K[3],W}e.copy=A;function P(W,K,ce,V,G){return W[0]=K,W[1]=ce,W[2]=V,W[3]=G,W}e.set=P;function T(W,K){return W[0]===K[0]&&W[1]===K[1]&&W[2]===K[2]&&W[3]===K[3]}e.exactEquals=T;function B(W,K){let ce=W[0],V=W[1],G=W[2],X=W[3],Z=K[0],ie=K[1],de=K[2],we=K[3];return Math.abs(ce-Z)<=1e-6*Math.max(1,Math.abs(ce),Math.abs(Z))&&Math.abs(V-ie)<=1e-6*Math.max(1,Math.abs(V),Math.abs(ie))&&Math.abs(G-de)<=1e-6*Math.max(1,Math.abs(G),Math.abs(de))&&Math.abs(X-we)<=1e-6*Math.max(1,Math.abs(X),Math.abs(we))}e.equals=B;function D(W,K,ce){return W[0]=K[0]+ce[0],W[1]=K[1]+ce[1],W[2]=K[2]+ce[2],W[3]=K[3]+ce[3],W}e.add=D;function M(W,K){let ce=K[0],V=K[1],G=K[2],X=K[3],Z=ce*ce+V*V+G*G+X*X;return Z>0&&(Z=1/Math.sqrt(Z),W[0]=ce*Z,W[1]=V*Z,W[2]=G*Z,W[3]=X*Z),W}e.normalize=M;let R=[0,0,0],U=[1,0,0],F=[0,1,0];function N(W,K,ce){let V=x.dot(K,ce);return V<-.999999?(x.cross(R,U,K),x.magnitude(R)<1e-6&&x.cross(R,F,K),x.normalize(R,R),s(W,R,Math.PI),W):V>.999999?(W[0]=0,W[1]=0,W[2]=0,W[3]=1,W):(x.cross(R,K,ce),W[0]=R[0],W[1]=R[1],W[2]=R[2],W[3]=1+V,M(W,W))}e.rotationTo=N;let z=t(),q=t();function O(W,K,ce,V,G,X){return p(z,K,G,X),p(q,ce,V,X),p(W,z,q,2*X*(1-X)),W}e.sqlerp=O;let J=[0,0,0,0,0,0,0,0,0];function Q(W,K,ce,V){return J[0]=ce[0],J[3]=ce[1],J[6]=ce[2],J[1]=V[0],J[4]=V[1],J[7]=V[2],J[2]=-K[0],J[5]=-K[1],J[8]=-K[2],M(W,g(W,J))}e.setAxes=Q;function H(W,K){return`[${W[0].toPrecision(K)} ${W[1].toPrecision(K)} ${W[2].toPrecision(K)} ${W[3].toPrecision(K)}]`}e.toString=H,e.Identity=r()})(vn||(vn={}));var lr;(function(e){function t(_,w,E){let A=[];for(let T=0;TA[P],set:(A,P,T)=>A[P]=T,add:(A,P,T)=>A[P]+=T,dataOffset:A=>A,getCoords:(A,P)=>(P[0]=A,P)};case 2:{if(E[0]===0&&E[1]===1){let A=w[0];return{get:(P,T,B)=>P[B*A+T],set:(P,T,B,D)=>P[B*A+T]=D,add:(P,T,B,D)=>P[B*A+T]+=D,dataOffset:(P,T)=>T*A+P,getCoords:(P,T)=>(T[0]=P%A,T[1]=Math.floor(P/A),T)}}if(E[0]===1&&E[1]===0){let A=w[1];return{get:(P,T,B)=>P[T*A+B],set:(P,T,B,D)=>P[T*A+B]=D,add:(P,T,B,D)=>P[T*A+B]+=D,dataOffset:(P,T)=>P*A+T,getCoords:(P,T)=>(T[0]=Math.floor(P/A),T[1]=P%A,T)}}throw new Error("bad axis order")}case 3:{if(E[0]===0&&E[1]===1&&E[2]===2){let A=w[0],P=w[1],T=A*P;return{get:(B,D,M,R)=>B[D+M*A+R*T],set:(B,D,M,R,U)=>B[D+M*A+R*T]=U,add:(B,D,M,R,U)=>B[D+M*A+R*T]+=U,dataOffset:(B,D,M)=>B+D*A+M*T,getCoords:(B,D)=>{let M=Math.floor(B/A);return D[0]=B%A,D[1]=M%P,D[2]=Math.floor(M/P),D}}}if(E[0]===0&&E[1]===2&&E[2]===1){let A=w[0],P=w[2],T=A*P;return{get:(B,D,M,R)=>B[D+R*A+M*T],set:(B,D,M,R,U)=>B[D+R*A+M*T]=U,add:(B,D,M,R,U)=>B[D+R*A+M*T]+=U,dataOffset:(B,D,M)=>B+M*A+D*T,getCoords:(B,D)=>{let M=Math.floor(B/A);return D[0]=B%A,D[1]=Math.floor(M/P),D[2]=M%P,D}}}if(E[0]===1&&E[1]===0&&E[2]===2){let A=w[1],P=w[0],T=A*P;return{get:(B,D,M,R)=>B[M+D*A+R*T],set:(B,D,M,R,U)=>B[M+D*A+R*T]=U,add:(B,D,M,R,U)=>B[M+D*A+R*T]+=U,dataOffset:(B,D,M)=>D+B*A+M*T,getCoords:(B,D)=>{let M=Math.floor(B/A);return D[0]=M%P,D[1]=B%A,D[2]=Math.floor(M/P),D}}}if(E[0]===1&&E[1]===2&&E[2]===0){let A=w[1],P=w[2],T=A*P;return{get:(B,D,M,R)=>B[M+R*A+D*T],set:(B,D,M,R,U)=>B[M+R*A+D*T]=U,add:(B,D,M,R,U)=>B[M+R*A+D*T]+=U,dataOffset:(B,D,M)=>D+M*A+B*T,getCoords:(B,D)=>{let M=Math.floor(B/A);return D[0]=Math.floor(M/P),D[1]=B%A,D[2]=M%P,D}}}if(E[0]===2&&E[1]===0&&E[2]===1){let A=w[2],P=w[0],T=A*P;return{get:(B,D,M,R)=>B[R+D*A+M*T],set:(B,D,M,R,U)=>B[R+D*A+M*T]=U,add:(B,D,M,R,U)=>B[R+D*A+M*T]+=U,dataOffset:(B,D,M)=>M+B*A+D*T,getCoords:(B,D)=>{let M=Math.floor(B/A);return D[0]=M%P,D[1]=Math.floor(M/P),D[2]=B%A,D}}}if(E[0]===2&&E[1]===1&&E[2]===0){let A=w[2],P=w[1],T=A*P;return{get:(B,D,M,R)=>B[R+M*A+D*T],set:(B,D,M,R,U)=>B[R+M*A+D*T]=U,add:(B,D,M,R,U)=>B[R+M*A+D*T]+=U,dataOffset:(B,D,M)=>M+D*A+B*T,getCoords:(B,D)=>{let M=Math.floor(B/A);return D[0]=Math.floor(M/P),D[1]=M%P,D[2]=B%A,D}}}throw new Error("bad axis order")}default:return{get:(A,...P)=>A[f(_,P)],set:(A,...P)=>A[f(_,P)]=P[P.length-1],add:(A,...P)=>A[f(_,P)]+=P[P.length-1],dataOffset:(...A)=>f(_,A),getCoords:(A,P)=>y(_,A,P)}}}function h(_){let{dimensions:w}=_,E=1;for(let A=0,P=w.length;Anew(A||_.defaultCtor)(E)}function f(_,w){let{accessDimensions:E,axisOrderFastToSlow:A}=_,P=E.length-1,T=E[P]*w[A[P]];for(let B=P-1;B>=0;B--)T=(T+w[A[B]])*E[B];return T}function y(_,w,E){let{dimensions:A,axisOrderFastToSlow:P}=_,T=A.length,B=w;for(let D=0;Dv(E,w)}e.convertToCanonicalAxisIndicesFastToSlow=b;function S(_){let w=new Int32Array(_.length);for(let E=0;E<_.length;E++)w[_[_.length-E-1]]=E;return E=>v(E,w)}e.convertToCanonicalAxisIndicesSlowToFast=S})(lr||(lr={}));function Zf(e,t,r){for(;t9||s<0)return i*o|0;o=10*o+s|0}return i*o}function KG(e,t,r,n){return t.charCodeAt(r)===43&&r++,e*Math.pow(10,Sd(t,r,n))}function QG(e,t,r){for(;t=0&&l<10)i=i*10+l,++n;else if(l===-2){for(++n;n=0&&l<10)s=10*s+l,a=10*a,++n;else return l===53||l===21?KG(o*(i+s/a),e,n+1,r):o*(i+s/a);return o*(i+s/a)}else{if(l===53||l===21)return KG(o*i,e,n+1,r);break}}return o*i}var re;(function(e){let t;(function(T){T.str={"@type":"str",T:"",valueType:"str"},T.ustr={"@type":"str",T:"",valueType:"str",transform:"uppercase"},T.lstr={"@type":"str",T:"",valueType:"str",transform:"lowercase"},T.int={"@type":"int",T:0,valueType:"int"},T.coord={"@type":"coord",T:0,valueType:"float"},T.float={"@type":"float",T:0,valueType:"float"};function B(q){var O;return{"@type":"str",T:(O=q?.defaultValue)!==null&&O!==void 0?O:"",transform:q?.transform,valueType:"str"}}T.Str=B;function D(q=0){return{"@type":"int",T:q,valueType:"int"}}T.Int=D;function M(q=0){return{"@type":"float",T:q,valueType:"float"}}T.Float=M;function R(q,O=T.float){return{"@type":"tensor",T:q.create(),space:q,valueType:"tensor",baseType:O}}T.Tensor=R;function U(q,O=T.float){return R(lr.Vector(q,O["@type"]==="int"?Int32Array:Float64Array),O)}T.Vector=U;function F(q,O,J=T.float){return R(lr.ColumnMajorMatrix(q,O,J["@type"]==="int"?Int32Array:Float64Array),J)}T.Matrix=F;function N(q){return q}T.Aliased=N;function z(q,O,J=[]){return{"@type":"list",T:J,separator:q,itemParse:O,valueType:"list"}}T.List=z})(t=e.Schema||(e.Schema={}));function r(T){return!!T&&!!T.schema&&!!T.value}e.is=r,e.ValueKind={Present:0,NotPresent:1,Unknown:2};function n(T,B){return ZG(B.T,T,B,1)}e.Undefined=n;function o(T,B,D){return ZG(T,B,D,0)}e.ofConst=o;function i(T){return gA(T)}e.ofLambda=i;function s(T,B){return i({value:D=>D+T,rowCount:Math.max(B-T+1,0),schema:t.int})}e.range=s;function a(T){return $f(T)}e.ofArray=a;function l(T){return $f({array:T,schema:t.int})}e.ofIntArray=l;function c(T){return $f({array:T,schema:t.float})}e.ofFloatArray=c;function u(T){return $f({array:T,schema:t.str})}e.ofStringArray=u;function d(T){return $f({array:T,schema:t.Aliased(t.str)})}e.ofStringAliasArray=d;function m(T,B=","){return $f({array:T,schema:t.List(B,D=>D)})}e.ofStringListArray=m;function p(T){let{count:B,data:D,indices:M}=T;return gA({value:R=>Sd(D,M[2*R],M[2*R+1])||0,rowCount:B,schema:t.int})}e.ofIntTokens=p;function h(T){let{count:B,data:D,indices:M}=T;return gA({value:R=>vc(D,M[2*R],M[2*R+1])||0,rowCount:B,schema:t.float})}e.ofFloatTokens=h;function f(T){let{count:B,data:D,indices:M}=T;return gA({value:R=>{let U=D.substring(M[2*R],M[2*R+1]);return U==="."||U==="?"?"":U},rowCount:B,schema:t.str})}e.ofStringTokens=f;function y(T,B,D){return $xe(T,B,D)}e.window=y;function g(T,B,D=!0){return rbe(T,B,D)}e.view=g;function v(T){return Qxe(T)}e.createFirstIndexMap=v;function b(T){return Zxe(T)}e.createIndexer=b;function S(T,B,D){return ibe(T,B,D||Array)}e.mapToArray=S;function _(T,B){return sbe(T,B)}e.areEqual=_;function w(T,B){return cbe(T,B)}e.indicesOf=w;function E(T,B){return T.__array?T:T.isDefined?$f({array:T.toArray({array:B}),schema:T.schema,valueKind:T.valueKind}):n(T.rowCount,T.schema)}e.asArrayColumn=E;function A(T,B,D=0){if(!T.isDefined)return;let M=T.__array;if(M)for(let R=0,U=M.length;Rt.has(r)?t.get(r):-1}function ZG(e,t,r,n){return{schema:r,__array:void 0,isDefined:n===0,rowCount:t,value:i=>e,valueKind:i=>n,toArray:i=>{let{array:s}=t1(t,i);for(let a=0,l=s.length;a!0}}function gA({value:e,valueKind:t,areValuesEqual:r,rowCount:n,schema:o}){return{schema:o,__array:void 0,isDefined:!0,rowCount:n,value:e,valueKind:t||(i=>0),toArray:i=>{let{array:s,start:a}=t1(n,i);for(let l=0,c=s.length;le(i)===e(s))}}function $f({array:e,schema:t,valueKind:r}){let n=e.length,o=t.T,i=t.valueType==="str"?t.transform==="lowercase"?a=>{let l=e[a];return typeof l=="string"?l.toLowerCase():`${l??o}`.toLowerCase()}:t.transform==="uppercase"?a=>{let l=e[a];return typeof l=="string"?l.toUpperCase():`${l??o}`.toUpperCase()}:a=>{let l=e[a];return typeof l=="string"?l:`${l??o}`}:a=>e[a],s=dA(e);return{schema:t,__array:e,isDefined:!0,rowCount:n,value:i,valueKind:r||(a=>0),toArray:t.valueType==="str"?t.transform==="lowercase"?a=>{let{start:l,end:c}=gg(n,a),u=new(a&&typeof a.array<"u"?a.array:e.constructor)(c-l);for(let d=0,m=c-l;d{let{start:l,end:c}=gg(n,a),u=new(a&&typeof a.array<"u"?a.array:e.constructor)(c-l);for(let d=0,m=c-l;d{let{start:l,end:c}=gg(n,a),u=new(a&&typeof a.array<"u"?a.array:e.constructor)(c-l);for(let d=0,m=c-l;dmA(e,a):a=>{let{start:l,end:c}=gg(n,a);if(l===0&&c===e.length)return e;let u=new(a&&typeof a.array<"u"?a.array:e.constructor)(c-l);for(let d=0,m=c-l;de[a]===e[l]}}function $xe(e,t,r){return e.isDefined?t===0&&r===e.rowCount?e:e.__array&&dA(e.__array)?Jxe(e,t,r):ebe(e,t,r):re.Undefined(r-t,e.schema)}function Jxe(e,t,r){let n=mA(e.__array,{start:t,end:r}),o=e.valueKind;return $f({array:n,schema:e.schema,valueKind:i=>o(t+i)})}function ebe(e,t,r){let n=e.value,o=e.valueKind,i=e.areValuesEqual,s=t===0?n:l=>n(l+t),a=r-t;return{schema:e.schema,__array:void 0,isDefined:e.isDefined,rowCount:a,value:s,valueKind:t===0?o:l=>o(l+t),toArray:l=>{let{array:c}=t1(a,l);for(let u=0,d=c.length;ui(l+t,c+t)}}function tbe(e,t){if(e.length!==t)return!1;for(let r=0,n=e.length;ro(t[i])})}function obe(e,t){let r=e.value,n=e.valueKind,o=e.areValuesEqual,i=a=>r(t[a]),s=t.length;return{schema:e.schema,__array:void 0,isDefined:e.isDefined,rowCount:s,value:i,valueKind:a=>n(t[a]),toArray:a=>{let{array:l}=t1(s,a);for(let c=0,u=l.length;co(t[a],t[l])}}function ibe(e,t,r){let n=new r(e.rowCount);for(let o=0,i=e.rowCount;o>1;return t(e,r,n)>0?t(e,r,o)>0?t(e,o,n)>0?o:n:r:t(e,n,o)>0?t(e,o,r)>0?o:r:n}function ube(e,t,r){let{cmp:n,swap:o,data:i,parts:s}=e,a=t+1,l=r;for(o(i,t,$G(i,n,t,r));n(i,l,t)>0;)--l;for(let c=t+1;c<=l;c++){let u=n(i,c,t);if(u>0){for(o(i,c,l),--l;n(i,l,t)>0;)--l;c--}else u===0&&(o(i,c,a),a++)}for(let c=t;c=n&&t(e,s,s+1)>0;)r(e,s,s+1),s=s-1}}function vA(e,t,r){let{parts:n}=e;for(;ts;)--i;for(let a=r+1;a<=i;a++){let l=e[a];if(l>s){for(Jf(e,a,i),--i;e[i]>s;)--i;a--}else l===s&&(Jf(e,a,o),++o)}for(let a=r;a=t&&e[i]>o;)e[i+1]=e[i],i=i-1;e[i+1]=o}}function LB(e,t,r,n){for(;r_[T][P],valueKind:T=>typeof _[T][P]>"u"?1:0});return w}e.ofRows=s;function a(S,_){var w;let E=Object.create(null),A=Object.keys(S);E._rowCount=0,E._columns=A,E._schema=S;for(let P of A)typeof _[P]<"u"?(E[P]=re.ofArray({array:_[P],schema:S[P]}),E._rowCount=(w=_[P])===null||w===void 0?void 0:w.length):E[P]=re.Undefined(E._rowCount,S[P]);return E}e.ofArrays=a;function l(S,_,w){let E=Object.create(null),A=Object.keys(_);E._rowCount=w.length,E._columns=A,E._schema=_;for(let P of A)E[P]=re.view(S[P],w);return E}e.view=l;function c(S,_,w){let E=[];for(let A=0,P=S._rowCount;A_(T,B));let E=!0;for(let P=0,T=w.length;P0}has(t){return this._set.has(t)}assets(t,r){let n=this._assets.get(t);if(n)for(let o of n)o.dispose();r?this._assets.set(t,r):this._assets.delete(t)}dispose(){this._assets.forEach(t=>{for(let r of t)r.dispose()})}};var bA=Object.prototype.hasOwnProperty;function JG(e,t){for(let r of Object.keys(t))bA.call(t,r)&&typeof e[r]>"u"&&(e[r]=t[r]);return e}function gbe(e,t){let r=!1;for(let n of Object.keys(t))if(bA.call(t,n)&&t[n]!==e[n]){r=!0;break}return r?Object.assign({},e,t):e}function bg(e,t){if(!e)return!t;if(!t)return!1;let r=Object.keys(e);if(Object.keys(t).length!==r.length)return!1;for(let n of r)if(!bA.call(e,n)||e[n]!==t[n])return!1;return!0}function eH(e,t){let r=e;for(let n=0;nt&&(t=e[r]);return t}function Sg(e){let t=1/0;for(let r=0,n=e.length;rr&&(r=e[n]);return[t,r]}function FB(e,t=1,r=0){let n=e.length,o=0;for(let i=r;i=0?!1:(e.push(t),!0)}function _d(e,t){let r=e.indexOf(t);if(r<0)return!1;for(let n=r,o=e.length-1;n{t.add(n),r.add(o)}),{auth:t.size,label:r.size}}function ybe(){let e=function(){let f=typeof window<"u"&&window,y=typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self;return f||typeof global<"u"&&global||y}(),t={},r=typeof document<"u"?document:void 0,n=1,o;function i(f,...y){typeof f!="function"&&(f=new Function(""+f));let g={callback:f,args:y};return t[n]=g,o(n),n++}function s(f){delete t[f]}function a(f){let y=f.callback,g=f.args;switch(g.length){case 0:y();break;case 1:y(g[0]);break;case 2:y(g[0],g[1]);break;case 3:y(g[0],g[1],g[2]);break;default:y.apply(void 0,g);break}}function l(f){let y=t[f];s(f),a(y)}function c(){o=function(f){process.nextTick(function(){l(f)})}}function u(){if(e&&e.postMessage&&!e.importScripts){let f=!0,y=e.onmessage;return e.onmessage=function(){f=!1},e.postMessage("","*"),e.onmessage=y,f}}function d(){let f="setImmediate$"+Math.random()+"$",y=function(g){g.source===e&&typeof g.data=="string"&&g.data.indexOf(f)===0&&l(+g.data.slice(f.length))};window.addEventListener?window.addEventListener("message",y,!1):window.attachEvent("onmessage",y),o=function(g){window.postMessage(f+g,"*")}}function m(){let f=new MessageChannel;f.port1.onmessage=function(y){let g=y.data;l(g)},o=function(y){f.port2.postMessage(y)}}function p(){let f=r.documentElement;o=function(y){let g=r.createElement("script");g.onreadystatechange=function(){l(y),g.onreadystatechange=null,f.removeChild(g),g=null},f.appendChild(g)}}function h(){o=function(f){setTimeout(l,0,f)}}return typeof process<"u"&&{}.toString.call(process)==="[object process]"?c():u()?d():typeof MessageChannel<"u"?m():r&&"onreadystatechange"in r.createElement("script")?p():h(),{setImmediate:i,clearImmediate:s}}var OB=function(){return typeof setImmediate<"u"?typeof window<"u"?{setImmediate:(e,...t)=>window.setImmediate(e,...t),clearImmediate:e=>window.clearImmediate(e)}:{setImmediate,clearImmediate}:ybe()}();function vbe(e){OB.setImmediate(e)}var th={setImmediate:OB.setImmediate,clearImmediate:OB.clearImmediate,immediatePromise(){return new Promise(vbe)},delay(e,t=void 0){return new Promise(r=>setTimeout(r,e,t))}};var Ag=function(){try{return!0}catch{return!1}}(),$t=function(){try{let t=process.env.DEBUG;return t==="*"||t==="molstar"}catch{return!1}}(),ot=!1;var SA=[];function oH(e){SA.includes(e)||SA.push(e)}function iH(e){let t=SA.indexOf(e);t!==-1&&SA.splice(t,1)}var xbe=typeof performance<"u"&&!!performance.mark&&performance.measure,NB=xbe&&ot,cx;(function(e){function t(s){return`startTask${s.id}`}function r(s){return`endTask${s.id}`}function n(s){NB&&performance.mark(t(s))}e.markStart=n;function o(s){NB&&performance.mark(r(s))}e.markEnd=o;function i(s){NB&&performance.measure(`\u2733\uFE0F ${s.name}`,t(s),r(s))}e.measure=i})(cx||(cx={}));function sH(e,t,r=250){let n=uH(e,t,r),o=new CA(n,n.root);return UB(e,o)}function aH(e,t,r=250){let n=uH(e,t,r);return new CA(n,n.root)}function _A(e,t){return UB(t,e)}function lH(e,t,r){return e.runChild(t,r)}function cH(e){return{taskId:e.id,taskName:e.name,message:"",startedTime:0,canAbort:!0,isIndeterminate:!0,current:0,max:0}}function uH(e,t,r){let n={abortRequested:!1,treeAborted:!1,reason:""};return{updateRateMs:r,lastNotified:On(),observer:t,abortToken:n,taskId:e.id,root:{progress:cH(e),children:[]},tryAbort:bbe(n)}}function bbe(e){return t=>{e.abortRequested=!0,e.reason=t||e.reason}}function dH(e){return{progress:k({},e.progress),children:e.children.map(dH)}}function mH(e){return e.progress.canAbort&&e.children.every(mH)}function Sbe(e){return{root:dH(e.root),canAbort:mH(e.root),requestAbort:e.tryAbort}}function UB(e,t){return Y(this,null,function*(){cx.markStart(e),t.node.progress.startedTime=On();try{let r=yield e.f(t);return cx.markEnd(e),cx.measure(e),t.info.abortToken.abortRequested&&pH(t.info),r}catch(r){throw Pe.isAbort(r)&&(t.isAborted=!0,t.node.children.length>0&&(yield new Promise(n=>{t.onChildrenFinished=n})),e.onAbort&&e.onAbort()),r}})}function pH(e){throw e.abortToken.treeAborted||(e.abortToken.treeAborted=!0,fH(e.root),hH(e,On())),Pe.Aborted(e.abortToken.reason)}function fH(e){let t=e.progress;t.isIndeterminate=!0,t.canAbort=!1,t.message="Aborting...";for(let r of e.children)fH(r)}function hH(e,t){e.lastNotified=t;let r=Sbe(e);e.observer(r)}var CA=class e{checkAborted(){this.info.abortToken.abortRequested&&(this.isAborted=!0,pH(this.info))}get shouldUpdate(){return this.checkAborted(),On()-this.lastUpdatedTime>this.info.updateRateMs}updateProgress(t){if(this.checkAborted(),!t)return;let r=this.node.progress;typeof t=="string"?(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))}update(t,r){if(this.lastUpdatedTime=On(),this.updateProgress(t),!r)return hH(this.info,this.lastUpdatedTime),this.checkAborted(),th.immediatePromise()}runChild(t,r){return Y(this,null,function*(){this.updateProgress(r);let n={progress:cH(t),children:[]},o=this.node.children;o.push(n);let i=new e(this.info,n);try{return yield UB(t,i)}catch(s){if(Pe.isAbort(s)&&this.isAborted)return;throw s}finally{let s=o.indexOf(n);if(s>=0){for(let a=s,l=o.length-1;aY(this,null,function*(){return m}))}e.constant=s;function a(){return i("",d=>Y(this,null,function*(){}))}e.empty=a;function l(d,m){return i(d,p=>Y(this,null,function*(){throw new Error(m)}))}e.fail=l;function c(d,m){return r(d)?m?d.runInContext(m):d.run():d}e.resolveInContext=c;let u=ko(0,1073741823)})(Pe||(Pe={}));var VB;(function(e){function t(n,o=""){let i=n.progress;if(!n.children.length)return i.isIndeterminate?`${o}${i.taskName}: ${i.message}`:`${o}${i.taskName}: [${i.current}/${i.max}] ${i.message}`;let s=o+" |_ ",a=n.children.map(l=>t(l,s));return i.isIndeterminate?`${o}${i.taskName}: ${i.message} +${a.join(` +`)}`:`${o}${i.taskName}: [${i.current}/${i.max}] ${i.message} +${a.join(` +`)}`}function r(n){return t(n.root)}e.format=r})(VB||(VB={}));function Ol(e,t,r,n,o){return Y(this,null,function*(){let i=Math.max(t,0),s=0,a=0;if(e.isSynchronous)return n(Number.MAX_SAFE_INTEGER,r),r;let l=On(),c=0,u=0;for(;(c=n(i,r))>0;){s+=c;let d=On()-l;u+=d,a+=d,e.shouldUpdate&&(yield o(e,r,s),i=Math.round(u*s/a)+1,l=On(),u=0)}return e.shouldUpdate&&(yield o(e,r,s)),r})}var je;(function(e){function t(m){return m.creator&&m.chunkSize}e.is=t;function r(m){let p=m.growBy*m.elementSize;m.currentSize=p,m.currentIndex=0,m.currentChunk=new m.ctor(p),m.allocatedSize+=p,m.chunks[m.chunks.length]=m.currentChunk}function n(m,p,h,f,y){m.currentIndex>=m.currentSize&&r(m);let g=m.currentChunk,v=m.currentIndex;return g[v]=p,g[v+1]=h,g[v+2]=f,g[v+3]=y,m.currentIndex+=4,m.elementCount++}e.add4=n;function o(m,p,h,f){m.currentIndex>=m.currentSize&&r(m);let y=m.currentChunk,g=m.currentIndex;return y[g]=p,y[g+1]=h,y[g+2]=f,m.currentIndex+=3,m.elementCount++}e.add3=o;function i(m,p,h){m.currentIndex>=m.currentSize&&r(m);let f=m.currentChunk,y=m.currentIndex;return f[y]=p,f[y+1]=h,m.currentIndex+=2,m.elementCount++}e.add2=i;function s(m,p){return m.currentIndex>=m.currentSize&&r(m),m.currentChunk[m.currentIndex]=p,m.currentIndex+=1,m.elementCount++}e.add=s;function a(m,p,h){for(let f=0;f=m.currentSize&&r(m),m.currentChunk[m.currentIndex++]=h,m.elementCount++;return m.elementCount}e.addRepeat=a;function l(m,p){let{elementSize:h}=m;for(let f=0,y=p.length;f=m.currentSize&&r(m);let{currentChunk:g}=m;for(let v=0;v=m.currentSize)v.set(S,b);else for(let _=0,w=S.length;_"u")return y;if(typeof f=="number")return y.currentChunk=new m(f*p),y.allocatedSize=f*p,y.currentSize=y.currentChunk.length,y.chunks[0]=y.currentChunk,y;let g=f;if(g.length%p!==0)throw new Error("initialChunk length must be a multiple of the element size.");return y.currentChunk=g,y.allocatedSize=g.length,y.currentSize=g.length,y.chunks[0]=g,y}e.create=d})(je||(je={}));function Cbe(e,t,r){return e[t].keys[p].key){u=!1;break}}if(l&&u){for(let p=0;p>4;return t=(t^3735928559)+(t<<5),t=t^t>>11,t}function Wc(e,t){let r=23;return r=31*r+e|0,r=31*r+t|0,r=r^r>>4,r=(r^3735928559)+(r<<5),r=r^r>>11,r}function yH(e,t,r){let n=23;return n=31*n+e|0,n=31*n+t|0,n=31*n+r|0,n=n^n>>4,n=(n^3735928559)+(n<<5),n=n^n>>11,n}function vH(e,t,r,n){let o=23;return o=31*o+e|0,o=31*o+t|0,o=31*o+r|0,o=31*o+n|0,o=o^o>>4,o=(o^3735928559)+(o<<5),o=o^o>>11,o}function nC(e){let t=0;for(let r=0,n=e.length;r>>0}function ux(e,t){for(let r=0,n=e.length;r=r&&t0&&n>0&&sC(e)>=iC(t)&&iC(e)<=sC(t)}function IH(e,t){return Pg(e)?Pg(t)?Vp(e)<=Vp(t)&&rh(e)>=rh(t):!0:Pg(t)===0}function PA(e,t){let r=Vp(e);if(t<=r)return 0;let n=rh(e);return t>=n?n-r:t-r}function EH(e,t,r){let n=Vp(r),o=Vp(e);if(t<=n+o)return n;let i=rh(r);return t>=i+o?i:t-o}function WB(e,t,r){return IA(PA(e,t),PA(e,r+1))}function DH(e,t){return qB(e,t)?IA(Math.max(Vp(e),Vp(t)),Math.min(rh(e),rh(t))):HB}function kH(e,t){return Pg(WB(e,iC(t),sC(t)))}var ve;(function(e){e.Empty=HB,e.ofSingleton=t=>jB(t,t),e.ofRange=jB,e.ofBounds=IA,e.ofLength=bH,e.is=SH,e.has=wH,e.indexOf=AH,e.getAt=TH,e.start=Vp,e.end=rh,e.min=iC,e.max=sC,e.size=Pg,e.hashCode=CH,e.toString=_H,e.areEqual=PH,e.areIntersecting=qB,e.isSubInterval=IH,e.findPredecessorIndex=PA,e.findPredecessorIndexInInterval=EH,e.findRange=WB,e.intersectionSize=kH,e.intersect=DH})(ve||(ve={}));var mx=[];function MH(e){return[e]}function BH(e){return e}function RH(e){return $s(e),e}function YB(e,t){if(t2?vH(t,e[0],e[t-1],e[t>>1]):yH(t,e[0],e[t-1]):0}function UH(e){let t=e.length;return t>5?`[${e[0]}, ${e[1]}, ..., ${e[t-1]}], length ${t}`:`[${e.join(", ")}]`}function QB(e,t){let r=e.length;return r===0?-1:e[0]<=t&&t<=e[r-1]?jH(e,t,0,r):-1}function zH(e,t,r){return ZB(e,t,ve.start(r),ve.end(r))}function ZB(e,t,r,n){return e.length===0||n<=r?-1:e[r]<=t&&t<=e[n-1]?jH(e,t,r,n):-1}function VH(e,t){return QB(e,t)>=0}function $B(e,t){if(e===t)return!0;let r=e.length;if(r!==t.length||e[0]!==t[0]||e[r-1]!==t[r-1])return!1;if(XB(e))return!0;r--;for(let n=1;ne[r-1]?r:qH(e,t,0,r)}function GH(e,t,r){let n=ve.start(r),o=ve.end(r),i=e[n];return t<=i?n:o>n&&t>e[o-1]?o:t-i<=11?Pbe(e,t,n+1,o):qH(e,t,n,o)}function HH(e,t,r){return ve.ofBounds(Ig(e,t),Ig(e,r+1))}function jH(e,t,r,n){let o=r,i=n-1;for(;o<=i;){if(o+11>i){for(let l=o;l<=i;l++)if(t===e[l])return l;return-1}let s=o+i>>1,a=e[s];if(ta)o=s+1;else return s}return-1}function qH(e,t,r,n){let o=r,i=n-1;for(;oi){for(let l=o;l<=i;l++)if(t<=e[l])return l;return i+1}let s=o+i>>1,a=e[s];if(ta)o=s+1;else return s}return o>i?i+1:e[o]>=t?o:o+1}function Pbe(e,t,r,n){for(let o=r;oa)n++;else return!0}return!1}function YH(e,t){if(e===t)return!0;let r=t.length,{startI:n,startJ:o,endI:i,endJ:s}=o1(e,t);if(s-oc?o++:(n++,o++,a++)}return a===r}function JB(e,t){if(e===t)return e;let r=e.length,n=t.length;if(r===0)return t;if(n===0)return e;if(e[0]>t[0])return JB(t,e);let{startI:o,startJ:i,endI:s,endJ:a}=o1(e,t),l=eR(e,t,o,i,s,a);if(l===r&&l===n||l===n)return e;if(l===r)return t;let c=new Int32Array(r+n-l),u=0,d=0,m=0;for(u=0;ut[d];)c[m++]=t[d++];for(;uh?(c[m++]=h,d++):(c[m++]=p,u++,d++)}for(;uu?a++:(s++,a++,l++)}return l}function KH(e,t){if(e===t)return e;let{startI:r,startJ:n,endI:o,endJ:i}=o1(e,t),s=eR(e,t,r,n,o,i),a=e.length,l=t.length;if(!s)return mx;if(s===a&&s===l||s===l)return t;if(s===a)return e;let c=new Int32Array(s),u=0,d=r,m=n;for(;dh||(c[u++]=p,d++),m++)}return c}function QH(e,t){if(e===t)return mx;let r=e.length,{startI:n,startJ:o,endI:i,endJ:s}=o1(e,t),a=n,l=o,c=0;for(;ap?l++:(a++,l++,c++)}if(!c)return e;if(c>=r)return mx;let u=new Int32Array(r-c),d=0;for(let m=0;mp||a++,l++)}for(;ap?a++:(s++,a++,l++)}let c=e.length;if(!l)return mx;if(l===c)return oC(0,e.length-1);let u=new Int32Array(l),d=0;for(s=r,a=n;sp||(u[d++]=s,s++),a++)}return u}var nh={startI:0,startJ:0,endI:0,endJ:0};function o1(e,t){let r=e.length,n=t.length,o=r/n;return r>=128||n>=128||o<=.34||o>=2.99?(nh.startI=Ig(e,EA(t)),nh.startJ=Ig(t,EA(e)),nh.endI=Ig(e,DA(t)),nh.endJ=Ig(t,DA(e))):(nh.startI=0,nh.startJ=0,nh.endI=r,nh.endJ=n),nh}var Fe;(function(e){e.Empty=mx,e.ofUnsortedArray=RH,e.ofSingleton=MH,e.ofSortedArray=BH,e.ofRange=YB,e.ofBounds=(t,r)=>YB(t,r-1),e.is=LH,e.isRange=XB,e.has=VH,e.indexOf=QB,e.indexOfInInterval=zH,e.indexOfInRange=ZB,e.start=EA,e.end=DA,e.min=FH,e.max=OH,e.size=KB,e.hashCode=NH,e.toString=UH,e.areEqual=$B,e.areIntersecting=WH,e.isSubset=YH,e.union=JB,e.intersect=KH,e.subtract=QH,e.findPredecessorIndex=Ig,e.findPredecessorIndexInInterval=GH,e.findRange=HH,e.intersectionSize=XH,e.deduplicate=ZH,e.indicesOf=$H})(Fe||(Fe={}));var Gm=ve.Empty,oj=ve.ofSingleton,ij=ve.ofRange,sj=ve.ofBounds;function wd(e){return e.length?Fe.isRange(e)?ve.ofRange(e[0],e[e.length-1]):e:Gm}function Eg(e){return ve.is(e)?ve.size(e):Fe.size(e)}function aj(e,t){return ve.is(e)?ve.has(e,t):Fe.has(e,t)}function lj(e,t){return ve.is(e)?ve.indexOf(e,t):Fe.indexOf(e,t)}function kA(e,t){return ve.is(e)?ve.getAt(e,t):e[t]}function i1(e){return ve.is(e)?ve.min(e):Fe.min(e)}function s1(e){return ve.is(e)?ve.max(e):Fe.max(e)}function cj(e){return ve.is(e)?ve.start(e):Fe.start(e)}function uj(e){return ve.is(e)?ve.end(e):Fe.end(e)}function dj(e){return ve.is(e)?ve.hashCode(e):Fe.hashCode(e)}function mj(e){return ve.is(e)?ve.toString(e):Fe.toString(e)}function pj(e,t){return ve.is(e)?ve.is(t)?ve.areEqual(e,t):JH(e,t):ve.is(t)?JH(t,e):Fe.areEqual(e,t)}function fj(e,t){return ve.is(e)?ve.is(t)?ve.areIntersecting(e,t):ej(t,e):ve.is(t)?ej(e,t):Fe.areIntersecting(e,t)}function hj(e,t){return ve.is(e)?ve.is(t)?ve.isSubInterval(e,t):Dbe(e,t):ve.is(t)?Ebe(e,t):Fe.isSubset(e,t)}function gj(e,t){return ve.is(e)?ve.findPredecessorIndex(e,t):Fe.findPredecessorIndex(e,t)}function yj(e,t,r){return ve.is(e)?ve.findPredecessorIndexInInterval(e,t,r):Fe.findPredecessorIndexInInterval(e,t,r)}function vj(e,t,r){return ve.is(e)?ve.findRange(e,t,r):Fe.findRange(e,t,r)}function xj(e,t){return ve.is(e)?ve.is(t)?ve.intersectionSize(e,t):rj(t,e):ve.is(t)?rj(e,t):Fe.intersectionSize(e,t)}function bj(e,t){return ve.is(e)?ve.is(t)?Bbe(e,t):tj(t,e):ve.is(t)?tj(e,t):wd(Fe.union(e,t))}function Sj(e,t){return ve.is(e)?ve.is(t)?ve.intersect(e,t):nj(t,e):ve.is(t)?nj(e,t):wd(Fe.intersect(e,t))}function Cj(e,t){return ve.is(e)?ve.is(t)?Rbe(e,t):Fbe(e,t):ve.is(t)?Lbe(e,t):wd(Fe.subtract(e,t))}function JH(e,t){return ve.size(e)===Fe.size(t)&&ve.start(e)===Fe.start(t)&&ve.end(e)===Fe.end(t)}function ej(e,t){return e.length!==0&&ve.size(Fe.findRange(e,ve.min(t),ve.max(t)))!==0}function Ebe(e,t){let r=ve.min(t),n=ve.max(t);if(n-r+1===0)return!0;let o=Fe.min(e),i=Fe.max(e);if(ri)return!1;let s=Fe.findRange(e,r,n);return ve.size(s)===ve.size(t)}function Dbe(e,t){let r=ve.min(e),n=ve.max(e);if(n-r+1===0)return!1;let o=Fe.min(t),i=Fe.max(t);return o>=r&&i<=n}function kbe(e,t){let r=Eg(e),n=Eg(t);return r===0&&n===0?!0:r>0&&n>0&&s1(e)>=i1(t)&&i1(e)<=s1(t)}function Mbe(e,t){return Eg(e)?Eg(t)?i1(e)<=i1(t)&&s1(e)>=s1(t):!0:Eg(t)===0}function Bbe(e,t){if(ve.areEqual(e,t))return e;let r=ve.size(e),n=ve.size(t);if(!n)return e;if(!r)return t;let o=ve.min(e),i=ve.min(t);if(kbe(e,t))return ve.ofRange(Math.min(o,i),Math.max(ve.max(e),ve.max(t)));let s,a,l,c;oh||(l++,u++),d++)}if(l===0)return Gm;if(l===o&&l===i)return e;let m=new Int32Array(l);for(c=0,u=0,d=s;uh||(m[c++]=d,u++),d++)}return wd(m)}var Te;(function(e){e.Empty=Gm,e.ofSingleton=oj,e.ofRange=ij,e.ofBounds=sj,e.ofSortedArray=wd,e.has=aj,e.indexOf=lj,e.getAt=kA,e.min=i1,e.max=s1,e.start=cj,e.end=uj,e.size=Eg,e.hashCode=dj,e.areEqual=pj,e.areIntersecting=fj,e.isSubset=hj,e.union=bj,e.intersect=Sj,e.indexedIntersect=Aj,e.subtract=Cj,e.findPredecessorIndex=gj,e.findPredecessorIndexInInterval=yj,e.findRange=vj,e.intersectionSize=xj;function t(a,l,c){return _j(a,l,c)}e.forEach=t;function r(a,l,c,u){return wj(a,l,c,u)}e.forEachSegment=r;function n(a){return ve.is(a)}e.isInterval=n;function o(a){return!ve.is(a)}e.isSortedArray=o;function i(a){let l=[];return e.forEach(a,c=>l.push(c)),l}e.toArray=i;function s(a){return mj(a)}e.toString=s})(Te||(Te={}));function rR(e){let t=Fe.ofSortedArray(e),r=Fe.max(t),n=new Int32Array(r);for(let o=0,i=e.length-1;o=n?-1:Te.findPredecessorIndex(e,r-1);return Te.findRange(t,Te.getAt(e,o),Te.getAt(e,o+1)-1)}var tR=class{move(){for(;this.hasNext;)if(this.updateValue()){this.value.index=this.segmentMin++,this.hasNext=this.segmentMax>=this.segmentMin&&ve.size(this.setRange)>0;break}else this.updateSegmentRange();return this.value}updateValue(){let t=this.segments[this.segmentMin+1],r=Te.findPredecessorIndexInInterval(this.set,t,this.setRange);return this.value.start=ve.start(this.setRange),this.value.end=r,this.setRange=ve.ofBounds(r,ve.end(this.setRange)),r>this.value.start}updateSegmentRange(){let t=ve.min(this.setRange),r=ve.max(this.setRange);if(r=this.segmentMin}setSegment(t){this.setRange=ve.ofBounds(t.start,t.end),this.updateSegmentRange()}constructor(t,r,n,o){this.segments=t,this.segmentMap=r,this.set=n,this.segmentMin=0,this.segmentMax=0,this.setRange=ve.Empty,this.value={index:0,start:0,end:0},this.hasNext=!1,this.setRange=o,this.updateSegmentRange()}};function Dj(e,t,r){let n=typeof r<"u"?ve.ofBounds(r.start,r.end):ve.ofBounds(0,Te.size(t));return new tR(e.offsets,e.index,t,n)}var Bt;(function(e){e.create=rR,e.ofOffsets=Tj,e.count=Pj,e.getSegment=Ij,e.projectValue=Ej,e.transientSegments=Dj})(Bt||(Bt={}));function oR(e){return new nR(e)}var nR=class{remove(t){let{prev:r,next:n}=this,o=r[t],i=n[t];o>=0&&(n[o]=i,r[t]=-1),i>=0&&(r[i]=o,n[t]=-1),t===this.head&&(o<0?this.head=i:this.head=o)}has(t){return this.prev[t]>=0||this.next[t]>=0||this.head===t}constructor(t){this.head=t>0?0:-1,this.prev=new Int32Array(t),this.next=new Int32Array(t);for(let r=0;r0,this.xs=t,this.index=-1,this.lastValue=t.length>0?t[0]:void 0}},MA=class{move(){return++this.value,this.hasNext=this.value=t}},sR=class{move(){return this.hasNext=!1,this.value}constructor(t){this.value=t,this.hasNext=!0}},aR=class{move(){let t=this.f(this.base.move());return this.hasNext=this.base.hasNext,t}constructor(t,r){this.base=t,this.f=r,this.hasNext=!1,this.hasNext=t.hasNext}},lR=class{move(){let t=this.next;return this.hasNext=this.findNext(),t}findNext(){for(;this.base.hasNext;)if(this.next=this.base.move(),this.p(this.next))return!0;return!1}constructor(t,r){this.base=t,this.p=r,this.hasNext=this.findNext()}},Dg;(function(e){e.Empty=new MA(0,-1);function t(a){return new iR(a)}e.Array=t;function r(a){return new sR(a)}e.Value=r;function n(a,l){return new MA(a,l)}e.Range=n;function o(a,l){return new aR(a,l)}e.map=o;function i(a,l){return new lR(a,l)}e.filter=i;function s(a,l,c){for(;a.hasNext;)if(l(a.move(),c))return c;return c}e.forEach=s})(Dg||(Dg={}));var ls;(function(e){function t(d,m){if(d===m)return!0;if(d.vertexCount!==m.vertexCount||d.edgeCount!==m.edgeCount)return!1;let{a:p,b:h,offset:f}=d,{a:y,b:g,offset:v}=m;for(let b=0,S=d.a.length;bp&&(h=p,f=m);let y=ea(h,f);return this.included.has(y)?!1:(this.included.add(y),this.xs[this.xs.length]=h,this.ys[this.ys.length]=f,!0)}getGraph(){return a(this.vertexCount,this.xs,this.ys)}getEdgeBuiler(){return new o(this.vertexCount,this.xs,this.ys)}constructor(m){this.vertexCount=m,this.xs=[],this.ys=[],this.included=new Set}}e.UniqueEdgeBuilder=s;function a(d,m,p){let h=new e.EdgeBuilder(d,m,p);return h.addAllEdges(),h.createGraph({})}e.fromVertexPairs=a;function l(d,m,p){let{b:h,offset:f,vertexCount:y,edgeProps:g}=d,v=new Int32Array(y);for(let B=0,D=m.length;BB&&v[h[D]]!==0&&b++;let S=new Int32Array(m.length+1),_=new Int32Array(2*b),w=new Int32Array(2*b),E=new Int32Array(2*b),A=0,P=0;for(let B=0;B0;){let b=g.pop(),S=p[b];for(let _=f[b],w=f[b+1];_=0&&(g.push(v.head),p[v.head]=++h,v.remove(v.head))}return{componentCount:m,componentIndex:p}}e.connectedComponents=c;function u(d,m,p,h){if(Fe.areIntersecting(m,p))return!0;if(h<1)return!1;let f=new Set;for(let y=0,g=m.length;y1?kj(e,a,r,n-1,o):!1}var cR=class{constructor(){this.map=new Map,this.applicable=new Map}add(t,r,n){this.map.set(t,r),n&&this.applicable.set(t,n)}remove(t){this.map.delete(t),this.applicable.delete(t)}get(t){return this.map.get(t)}isApplicable(t){if(!this.map.has(t.sourceData.kind))return!1;let r=this.applicable.get(t.sourceData.kind);return r?r(t):!0}};var ta;(function(e){function t(r,n){let{name:o}=r,i=new cR;return{descriptor:r,formatRegistry:i,isApplicable(s){return i.isApplicable(s)},get(s){let a=n?.asDynamic?s._dynamicPropertyData:s._staticPropertyData;if(a[o])return a[o];if(s.customProperties.has(r))return;let l=i.get(s.sourceData.kind);if(l)return a[o]=l(s),s.customProperties.add(r),a[o]},set(s,a){n?.asDynamic?s._dynamicPropertyData[o]=a:s._staticPropertyData[o]=a},delete(s){n?.asDynamic?delete s._dynamicPropertyData[o]:delete s._staticPropertyData[o]}}}e.create=t})(ta||(ta={}));function zbe(e,t,r,n){let o=new ls.EdgeBuilder(n,e,t),i=new Int32Array(o.slotCount),s=new Array(o.slotCount),a=new Array(o.slotCount),l=new Int8Array(o.slotCount),c=new Array(o.slotCount),u=new Array(o.slotCount);for(let d=0,m=o.edgeCount;dr.substring(n[2*a],n[2*a+1]):i==="int"?a=>Sd(r,n[2*a],n[2*a+1])||0:a=>vc(r,n[2*a],n[2*a+1])||0;return{schema:t,__array:void 0,isDefined:!0,rowCount:o,value:s,valueKind:a=>0,toArray:a=>Xo.createAndFillArray(o,s,a),areValuesEqual:uR(e)}}function uR(e){let{data:t,indices:r}=e;return function(n,o){let i=r[2*n],s=r[2*o],a=r[2*n+1]-i;if(a!==r[2*o+1]-s)return!1;for(let l=0;l0?i[s[0]].rowCount:0,name:o,fieldNames:s,getField(a){return i[a]}}}e.ofFields=r;function n(o,i){let s={};for(let a of i._columns)s[a]=gt.ofColumn(i[a]);return r(o,s)}e.ofTable=n})(vi||(vi={}));var gt;(function(e){function t(a){return r([a])}e.ofString=t;function r(a){let l=a.length,c=p=>{let h=a[p];return!h||h==="."||h==="?"?"":h},u=p=>{let h=a[p];return Sd(h,0,h.length)||0},d=p=>{let h=a[p];return vc(h,0,h.length)||0};return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:l,str:c,int:u,float:d,valueKind:p=>{let h=a[p],f=h.length;if(f>1)return 0;if(f===0)return 1;let y=h.charCodeAt(0);return y===46?1:y===63?2:0},areValuesEqual:(p,h)=>a[p]===a[h],toStringArray:p=>p?Xo.createAndFillArray(l,c,p):a,toIntArray:p=>Xo.createAndFillArray(l,u,p),toFloatArray:p=>Xo.createAndFillArray(l,d,p)}}e.ofStrings=r;function n(a){let l=a.length,c=p=>""+a[p],u=p=>a[p],d=p=>0,m=p=>!p||p.array&&a instanceof p.array?a:Xo.createAndFillArray(l,u,p);return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:l,str:c,int:u,float:u,valueKind:d,areValuesEqual:(p,h)=>a[p]===a[h],toStringArray:p=>Xo.createAndFillArray(l,c,p),toIntArray:m,toFloatArray:m}}e.ofNumbers=n;function o(a){let{data:l,indices:c,count:u}=a,d=f=>{let y=l.substring(c[2*f],c[2*f+1]);return y==="."||y==="?"?"":y},m=f=>Sd(l,c[2*f],c[2*f+1])||0,p=f=>vc(l,c[2*f],c[2*f+1])||0;return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:u,str:d,int:m,float:p,valueKind:f=>{let y=c[2*f],g=c[2*f+1]-y;if(g>1)return 0;if(g===0)return 1;let v=l.charCodeAt(y);return v===46?1:v===63?2:0},areValuesEqual:uR(a),toStringArray:f=>Xo.createAndFillArray(u,d,f),toIntArray:f=>Xo.createAndFillArray(u,m,f),toFloatArray:f=>Xo.createAndFillArray(u,p,f)}}e.ofTokens=o;function i(a){let{rowCount:l,valueKind:c,areValuesEqual:u,isDefined:d}=a,m,p,h;switch(a.schema.valueType){case"float":case"int":m=y=>""+a.value(y),p=a.value,h=a.value;break;case"str":m=a.value,p=y=>{let g=a.value(y);return Sd(g,0,g.length)||0},h=y=>{let g=a.value(y);return vc(g,0,g.length)||0};break;case"list":let{separator:f}=a.schema;m=y=>a.value(y).join(f),p=y=>NaN,h=y=>NaN;break;default:throw new Error(`unsupported valueType '${a.schema.valueType}'`)}return{__array:void 0,binaryEncoding:void 0,isDefined:d,rowCount:l,str:m,int:p,float:h,valueKind:c,areValuesEqual:u,toStringArray:f=>Xo.createAndFillArray(l,m,f),toIntArray:f=>Xo.createAndFillArray(l,p,f),toFloatArray:f=>Xo.createAndFillArray(l,h,f)}}e.ofColumn=i;function s(a,l){return i(re.Undefined(a,l))}e.ofUndefined=s})(gt||(gt={}));function Rj(e,t,r,n){let o=r?0:1;switch(t){case 1:return n==="brackets"?i=>`${e}[${i+o}]`:i=>`${e}_${i+o}`;case 2:return n==="brackets"?(i,s)=>`${e}[${i+o}][${s+o}]`:(i,s)=>`${e}_${i+o}${s+o}`;case 3:return n==="brackets"?(i,s,a)=>`${e}[${i+o}][${s+o}][${a+o}]`:(i,s,a)=>`${e}_${i+o}${s+o}${a+o}`;default:throw new Error("Tensors with rank > 3 or rank 0 are currently not supported.")}}function Lj(e,t,r,n){let o=t.create();if(t.rank===1){let i=t.dimensions[0];for(let s=0;s 3 or rank 0 are currently not supported.");return o}var px;(function(e){function t(o){return o.replace(".","_").replace(/\[/,"_").replace(/(\[|\])/g,"")}e.canonical=t;function r(o,i){return t(o)===t(i)}e.equal=r;function n(o,i,s=!1){let a=`${o}${i?`.${i}`:""}`;return s?t(a):a}e.create=n})(px||(px={}));function Oj(e,t,r){let n={};for(let o of t.blocks)n[o.header]=Ad(e,o,r);return n}function Ad(e,t,r){return qbe(e,t,r)}function Nj(e,t){return new LA(t,e,!0)}function Vbe(e){switch(e.valueType){case"str":return(t,r,n)=>Gbe(e,t,t.str,t.toStringArray);case"int":return(t,r,n)=>Fj(e,t,t.int,t.toIntArray);case"float":return(t,r,n)=>Fj(e,t,t.float,t.toFloatArray);case"list":throw new Error("Use createListColumn instead.");case"tensor":throw new Error("Use createTensorColumn instead.")}}function Gbe(e,t,r,n){return{schema:e,__array:t.__array,isDefined:t.isDefined,rowCount:t.rowCount,value:e.transform==="lowercase"?o=>r(o).toLowerCase():e.transform==="uppercase"?o=>r(o).toUpperCase():r,valueKind:t.valueKind,areValuesEqual:t.areValuesEqual,toArray:e.transform==="lowercase"?o=>Array.from(n(o)).map(i=>i.toLowerCase()):e.transform==="uppercase"?o=>Array.from(n(o)).map(i=>i.toUpperCase()):n}}function Fj(e,t,r,n){return{schema:e,__array:t.__array,isDefined:t.isDefined,rowCount:t.rowCount,value:r,valueKind:t.valueKind,areValuesEqual:t.areValuesEqual,toArray:n}}function Hbe(e,t,r){let n=e.separator,o=e.itemParse,i=t.getField(r),s=i?l=>i.str(l).split(n).map(c=>o(c.trim())).filter(c=>!!c):l=>[],a=l=>Xo.createAndFillArray(t.rowCount,s,l);return{schema:e,__array:void 0,isDefined:!!i,rowCount:t.rowCount,value:s,valueKind:i?i.valueKind:()=>1,areValuesEqual:(l,c)=>Ls(s(l),s(c)),toArray:a}}function jbe(e,t,r){let n=e.space,o=t.fieldNames.includes(`${r}[0]`)||t.fieldNames.includes(`${r}[0][0]`)||t.fieldNames.includes(`${r}[0][0][0]`),i=o?0:1,s=t.fieldNames.includes(`${r}_1`)||t.fieldNames.includes(`${r}_11`)||t.fieldNames.includes(`${r}_111`)?"underscore":"brackets",a=Rj(r,n.rank,o,s),l=t.getField(a(i,i,i))||re.Undefined(t.rowCount,e),c=d=>Lj(t,n,d,a),u=d=>Xo.createAndFillArray(t.rowCount,c,d);return{schema:e,__array:void 0,isDefined:l.isDefined,rowCount:t.rowCount,value:c,valueKind:l.valueKind,areValuesEqual:(d,m)=>lr.areEqualExact(c(d),c(m)),toArray:u}}var LA=class{constructor(t,r,n){this._isDefined=n;let o=Object.keys(r);this._rowCount=t.rowCount,this._columns=o,this._schema=r;let i=Object.create(null);for(let s of o)Object.defineProperty(this,s,{get:function(){if(i[s])return i[s];let a=r[s];if(a.valueType==="list")i[s]=Hbe(a,t,s);else if(a.valueType==="tensor")i[s]=jbe(a,t,s);else{let l=Vbe(a),c=t.getField(s);i[s]=c?l(c,t,s):re.Undefined(t.rowCount,a)}return i[s]},enumerable:!0,configurable:!1})}};function qbe(e,t,r){let n=Object.create(null);for(let o of Object.keys(e))n[o]=Xbe(o,e[o],t,r);return eC.ofTables(t.header,e,n)}function Wbe(e){let t=Object.create(null);for(let r of Object.keys(e.categories))for(let n of e.categories[r].fieldNames){let o=px.create(r,n,!0);t[o]=e.categories[r].getField(n)}return t}function Ybe(e,t,r,n){let o=px.create(t,e),i=px.canonical(o);if(i in r)return r[i];if(n&&o in n)for(let s of n[o]){let a=px.canonical(s);if(a in r)return r[a]}}function Xbe(e,t,r,n){let o=r.categories[e];if(n){let i=Wbe(r),s=Object.create(null),a=[],l=0;for(let c of Object.keys(t)){let u=Ybe(c,e,i,n);u&&(s[c]=u,a.push(c),l=u.rowCount)}o={rowCount:l,name:e,fieldNames:[...a],getField(c){return s[c]}}}return new LA(o||vi.empty(e),t,!!o)}function kg(e,t,r){let n=new Float32Array(e);for(let o=0;o146&&++t,e>148&&++t,e>155&&++t,e>160&&++t,e>161&&++t,e>166&&++t,e>167&&++t,e-1+t}function Zbe(e){if(e<146)return e+1;if(e===146)return 1146;if(e<149)return e+1-1;if(e===149)return 1148;if(e<157)return e+1-2;if(e===157)return 1155;if(e<163)return e+1-3;if(e===163)return 1160;if(e<165)return e+1-4;if(e===165)return 1161;if(e<171)return e+1-5;if(e===171)return 1166;if(e<173)return e+1-6;if(e===173)return 1167;if(e<237)return e+1-7;if(e===237)return 1003;if(e===238)return 1004;if(e===239)return 1005;if(e===240)return 2005;if(e===241)return 3005;if(e===242)return 4005;if(e===243)return 5005;if(e===244)return 1006;if(e===245)return 1007;if(e===246)return 1008;if(e===247)return 1009;if(e===248)return 1010;if(e===249)return 1011;if(e===250)return 1012;if(e===251)return 1013;if(e===252)return 1014;if(e===253)return 2014;if(e===254)return 3014;if(e===255)return 1015;if(e===256)return 1017;if(e===257)return 2017;if(e===258)return 1018;if(e===259)return 2018;if(e===260)return 3018;if(e===261)return 1020;if(e===262)return 1021;if(e===263)return 1022;if(e===264)return 1023;if(e===265)return 1059;if(e===266)return 1094;if(e===267)return 1197;throw new Error(`unknown spacegroup index '${e}'`)}var mR=function(){let e=Object.create(null);for(let t of Object.keys(lC))e[lC[t]]=t;return e}(),Vj=function(){let e=Object.create(null);for(let t of Object.keys(lC)){let r=lC[t];e[r]=Zbe(r)}return e}();function Gj(e){let t=typeof e=="number"?Qbe(e):lC[e];return typeof t>"u"||typeof mR[t]>"u"?-1:t}var ui;(function(e){e.Zero=r("P 1",x.create(1,1,1),x.create(Math.PI/2,Math.PI/2,Math.PI/2));function t(n){return n?n.index===0&&n.size[0]===1&&n.size[1]===1&&n.size[1]===1:!0}e.isZero=t;function r(n,o,i){let s=Gj(n);if(s<0)return console.warn(`Unknown spacegroup '${n}', returning a 'P 1' with cellsize [1, 1, 1]`),e.Zero;let a=o[0]*o[1]*o[2],l=i[0],c=i[1],u=i[2],d=o[0],m=o[1],p=o[2],h=Math.cos(c),f=(Math.cos(l)-Math.cos(c)*Math.cos(u))/Math.sin(u),y=Math.sqrt(1-h*h-f*f),g=[d,0,0],v=[Math.cos(u)*m,Math.sin(u)*m,0],b=[h*p,f*p,y*p],S=ne.ofRows([[g[0],v[0],b[0],0],[0,v[1],b[1],0],[0,0,b[2],0],[0,0,0,1]]),_=ne.invert(ne.zero(),S);return{index:s,size:o,volume:a,anglesInRadians:i,toFractional:_,fromFractional:S}}e.create=r})(ui||(ui={}));var Os;(function(e){e.ZeroP1=t(ui.Zero);function t(y){let g=zj[y.index].map(S=>d(Uj[S])),v=mR[y.index],b=Vj[y.index];return{name:v,num:b,cell:y,operators:g}}e.create=t;let r=x(),n=ne();function o(y,g,v,b,S,_){return x.set(r,v,b,S),ne.fromTranslation(n,r),ne.mul(_,ne.mul(_,ne.mul(_,y.cell.fromFractional,n),y.operators[g]),y.cell.toFractional)}e.setOperatorMatrix=o;function i(y,g,v,b,S){let _=o(y,g,v,b,S,ne.zero());return Vn.create(`${g+1}_${5+v}${5+b}${5+S}`,_,{hkl:x.create(v,b,S),spgrOp:g})}e.getSymmetryOperator=i;let s=x(),a=x(),l=x(),c=x();function u(y,g,v,b,S,_){let w=ne.zero();x.set(r,v,b,S),x.floor(s,_),ne.copy(w,y.operators[g]),x.floor(a,x.transformMat4(a,_,w)),ne.getTranslation(c,w),x.sub(c,c,a),x.add(c,c,s),x.add(c,c,r),ne.setTranslation(w,c),ne.mul(w,y.cell.fromFractional,w),ne.mul(w,w,y.cell.toFractional),x.sub(l,a,s);let E=v-l[0],A=b-l[1],P=S-l[2];return Vn.create(`${g+1}_${5+E}${5+A}${5+P}`,w,{hkl:x.create(E,A,P),spgrOp:g})}e.getSymmetryOperatorRef=u;function d(y){let g=OA[y[0]],v=OA[y[1]],b=OA[y[2]];return ne.ofRows([g,v,b,[0,0,0,1]])}function m(y){return[f(p(y[0],y[4],y[8]),h(y[12])),f(p(y[1],y[5],y[9]),h(y[13])),f(p(y[2],y[6],y[10]),h(y[14]))].join(",")}e.getOperatorXyz=m;function p(y,g,v){let b=[];if(y>0?b.push("+X"):y<0&&b.push("-X"),g>0?b.push("+Y"):g<0&&b.push("-Y"),v>0?b.push("+Z"):v<0&&b.push("-Z"),b.length===1)return b[0].charAt(0)==="+"?b[0].substr(1):b[0];if(b.length===2){let S=b[0].charAt(0),_=b[1].charAt(0);if(S==="+")return`${b[0].substr(1)}${b[1]}`;if(_==="+")return`${b[1].substr(1)}${b[0]}`}throw new Error(`unknown rotation '${b}', ${y} ${g} ${v}`)}function h(y){switch(y){case 1/2: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 f(y,g){return g===""?y:y.length>2?`${y}+${g}`:y.charAt(0)==="-"?`${g}${y}`:`${g}+${y}`}})(Os||(Os={}));var Yc;(function(e){function t(i,s,a){i.squaredDistances[i.count]=a,i.indices[i.count++]=s}e.add=t;function r(i){i.count=0}e.reset=r;function n(){return{count:0,indices:[],squaredDistances:[]}}e.create=n;function o(i,s){for(let a=0;at?(t/=e,e*Math.sqrt(1+t*t)):t>0?(e/=t,t*Math.sqrt(1+e*e)):0}var Jbe=1192092896e-16,eSe=1e-37;function tSe(e,t,r,n,o,i,s,a){let l=Jbe*2,c=eSe,u=0,d=0,m=0,p=0,h=Math.max(i,30),f=0,y=0,g=0,v=0,b=0,S=0,_=0,w=0,E=0,A=0,P=0,T=0,B=0,D=0,M=0,R=0,U=0,F=4660,N=0,z=0,q=0,O=new Float64Array(s<<3);for(;u>16&32767&256?z:-z,e[u*t+m]=N;for(p=0;p<2;p++)for(d=0;d0?M>l&&(l=M):M>c&&(c=M),x.projectPointOnVector(h,x.fromArray(h,s,T),g.dirB,y);let R=x.dot(g.dirB,x.normalize(f,x.sub(f,h,y))),U=x.distance(h,y);R>0?U>u&&(u=U):U>d&&(d=U),x.projectPointOnVector(h,x.fromArray(h,s,T),g.dirC,y);let F=x.dot(g.dirC,x.normalize(f,x.sub(f,h,y))),N=x.distance(h,y);F>0?N>m&&(m=N):N>p&&(p=N)}let v=x.setMagnitude(x(),g.dirA,(l+c)/2),b=x.setMagnitude(x(),g.dirB,(u+d)/2),S=x.setMagnitude(x(),g.dirC,(m+p)/2),_=x.isFinite(v),w=x.isFinite(b),E=x.isFinite(S),A=x(),P=function(T,B,D){x.copy(o,y),_&&x.scaleAndAdd(o,o,g.dirA,T),w&&x.scaleAndAdd(o,o,g.dirB,B),E&&x.scaleAndAdd(o,o,g.dirC,D),x.add(A,A,o)};return P(l,u,m),P(l,u,-p),P(l,-d,-p),P(l,-d,m),P(-c,-d,-p),P(-c,-d,m),P(-c,u,m),P(-c,u,-p),x.scale(A,A,1/8),Ei.create(A,v,b,S)}e.calculateBoxAxes=i})(Fa||(Fa={}));function ge(){return ge.zero()}(function(e){function t(D){return D.extrema!==void 0}e.hasExtrema=t;function r(D,M){return{center:D,radius:M}}e.create=r;function n(){return{center:x(),radius:0}}e.zero=n;function o(D){let M=r(x.clone(D.center),D.radius);return t(D)&&(M.extrema=D.extrema.map(R=>x.clone(R))),M}e.clone=o;function i(D,M,R){return x.copy(D.center,M),D.radius=R,D}e.set=i;function s(D,M){return x.copy(D.center,M.center),D.radius=M.radius,t(M)&&a(D,M.extrema.map(R=>x.clone(R))),D}e.copy=s;function a(D,M){return D.extrema!==void 0?(D.extrema.length=0,D.extrema.push(...M)):D.extrema=M,D}e.setExtrema=a;function l(D){let{x:M,y:R,z:U,indices:F}=D,N=0,z=0,q=0,O=0,J=Te.size(F);for(let Q=0;Q0&&(N/=J,z/=J,q/=J);for(let Q=0;QO&&(O=V)}return{center:x.create(N,z,q),radius:Math.sqrt(O)}}e.computeBounding=l;function c(D,M,R){return x.transformMat4(D.center,M.center,R),D.radius=M.radius*ne.getMaxScaleOnAxis(R),t(M)&&a(D,M.extrema.map(U=>x.transformMat4(x(),U,R))),D}e.transform=c;function u(D,M,R){return x.add(D.center,M.center,R),t(M)&&a(D,M.extrema.map(U=>x.add(x(),U,R))),D}e.translate=u;function d(D,M,R){return x.toArray(D.center,M,R),M[R+3]=D.radius,M}e.toArray=d;function m(D,M,R){return x.fromArray(D.center,M,R),D.radius=M[R+3],D}e.fromArray=m;function p(D,M){return x.scale(D.center,x.add(D.center,M.max,M.min),.5),D.radius=x.distance(D.center,M.max),e.setExtrema(D,[x.create(M.min[0],M.min[1],M.min[2]),x.create(M.max[0],M.max[1],M.max[2]),x.create(M.max[0],M.min[1],M.min[2]),x.create(M.min[0],M.max[1],M.max[2]),x.create(M.min[0],M.min[1],M.max[2]),x.create(M.max[0],M.min[1],M.max[2]),x.create(M.max[0],M.max[1],M.min[2]),x.create(M.min[0],M.max[1],M.min[2])]),D}e.fromBox3D=p;function h(D,M){return x.copy(D.center,M.origin),D.radius=Math.max(x.magnitude(M.dirA),x.magnitude(M.dirB),x.magnitude(M.dirC)),D}e.fromAxes3D=h;let f=x();function y(D,M,R){let[U,F,N]=M,z=x.create(0,0,0);x.transformMat4(z,z,R);let q=x.create(U,F,N);x.transformMat4(q,q,R);let O=x.create(U,0,0);x.transformMat4(O,O,R);let J=x.create(0,F,N);x.transformMat4(J,J,R);let Q=x.create(0,0,N);x.transformMat4(Q,Q,R);let H=x.create(U,0,N);x.transformMat4(H,H,R);let W=x.create(U,F,0);x.transformMat4(W,W,R);let K=x.create(0,F,0);x.transformMat4(K,K,R),x.add(f,z,q),x.scale(f,f,.5);let ce=Math.max(x.distance(z,q),x.distance(O,J));return e.set(D,f,ce/2),e.setExtrema(D,[z,q,O,J,Q,H,W,K]),D}e.fromDimensionsAndTransform=y;let g=x();function v(D,M,R){return x.distance(M.center,R)x.clone(U)),...R.extrema.map(U=>x.clone(U))]),D}e.expandBySphere=b;let S=x();function _(D,M,R){var U,F;if(x.copy(D.center,M.center),D.radius=M.radius+R,M.radius<1e-12||((F=(U=M.extrema)===null||U===void 0?void 0:U.length)!==null&&F!==void 0?F:0)<=1)return D.extrema=void 0,D;if(t(M)){let N=new Float32Array(M.extrema.length*3);for(let q=0;q{x.normalize(S,x.sub(S,q,M.center));let O=x.clone(q),J=x.dot(S,z.dirA)<0?-1:1;x.scaleAndAdd(O,O,z.dirA,J);let Q=x.dot(S,z.dirB)<0?-1:1;x.scaleAndAdd(O,O,z.dirB,Q);let H=x.dot(S,z.dirC)<0?-1:1;return x.scaleAndAdd(O,O,z.dirC,H),x.distance(D.center,O)>D.radius&&(M.extrema.length>=14&&x.normalize(S,x.sub(S,O,M.center)),x.scaleAndAdd(O,D.center,S,D.radius)),O}))}return D}e.expand=_;function w(D,M){return D.radius===M.radius&&x.exactEquals(D.center,M.center)}e.exactEquals=w;function E(D,M){let R=D.radius,U=M.radius;return Math.abs(R-U)<=1e-6*Math.max(1,Math.abs(R),Math.abs(U))&&x.equals(D.center,M.center)}e.equals=E;function A(D,M){if(t(M)){for(let R of M.extrema)if(x.distance(D.center,R)>D.radius)return!1;return!0}else return x.distance(D.center,M.center)+M.radius<=D.radius}e.includes=A;function P(D,M){return x.distance(D.center,M.center)<=D.radius+M.radius}e.overlaps=P;function T(D,M){return x.distance(D.center,M.center)-D.radius+M.radius}e.distance=T;function B(D,M){let{center:R,radius:U}=D;return x.distance(M,R)-U}e.distanceToVec=B})(ge||(ge={}));function ft(){return ft.zero()}(function(e){function t(P,T){return{min:P,max:T}}e.create=t;function r(){return{min:x(),max:x()}}e.zero=r;function n(P,T){return x.copy(P.min,T.min),x.copy(P.max,T.max),P}e.copy=n;function o(P){return n(r(),P)}e.clone=o;let i=x();function s(P,T){return ge.hasExtrema(T)&&T.extrema.length>=14?l(P,T.extrema):(x.set(i,T.radius,T.radius,T.radius),x.sub(P.min,T.center,i),x.add(P.max,T.center,i),P)}e.fromSphere3D=s;function a(P,T){for(let B=0,D=T.length;B=14?a(P,T.extrema):(y(P,x.subScalar(i,T.center,T.radius)),y(P,x.addScalar(i,T.center,T.radius)),P)}e.addSphere3D=c;function u(P,T){return x.clamp(i,T.center,P.min,P.max),x.squaredDistance(i,T.center)<=T.radius*T.radius}e.intersectsSphere3D=u;function d(P){let T=x.create(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),B=x.create(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),{x:D,y:M,z:R,indices:U}=P;for(let F=0,N=Te.size(U);FP.max[0]||T[1]P.max[1]||T[2]P.max[2])}e.containsVec3=_;function w(P,T){return!(P.max[0]T.max[0]||P.max[1]T.max[1]||P.max[2]T.max[2])}e.overlaps=w;function E(P,T){let B=T.center,D=T.radius;return!(B[0]-DP.max[0]||B[1]-DP.max[1]||B[2]-DP.max[2])}e.containsSphere3D=E;function A(P,T,B,D){let[M,R,U]=T.min,[F,N,z]=T.max,[q,O,J]=B,Q=1/D[0],H=1/D[1],W=1/D[2],K,ce,V,G,X,Z;return Q>=0?(K=(M-q)*Q,ce=(F-q)*Q):(K=(F-q)*Q,ce=(M-q)*Q),H>=0?(V=(R-O)*H,G=(N-O)*H):(V=(N-O)*H,G=(R-O)*H),W>=0?(X=(U-J)*W,Z=(z-J)*W):(X=(z-J)*W,Z=(U-J)*W),V>K&&(K=V),GK&&(K=X),Z0)throw new Error("New key is larger than old key");t.key=r;let 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)}delete(t){let r=t.parent;r&&(this._cut(t,r,this._minNode),this._cascadingCut(r,this._minNode)),this._minNode=t,this.extractMinimum()}extractMinimum(){let t=this._minNode;if(t){if(t.child){let n=t.child;do n.parent=null,n=n.next;while(n!==t.child)}let r=null;t.next!==t&&(r=t.next),this._removeNodeFromList(t),this._nodeCount--,this._minNode=this._mergeLists(r,t.child),this._minNode&&(this._minNode=this._consolidate(this._minNode))}return t}findMinimum(){return this._minNode}insert(t,r){let n=new hR(t,r);return this._minNode=this._mergeLists(this._minNode,n),this._nodeCount++,n}isEmpty(){return this._minNode===null}size(){return this._minNode===null?0:this._getNodeListSize(this._minNode)}union(t){this._minNode=this._mergeLists(this._minNode,t._minNode),this._nodeCount+=t._nodeCount}_defaultCompare(t,r){return t.key>r.key?1:t.key0){let s=o;o=i,i=s}this._linkHeaps(i,o),r[o.degree]=null,o.degree++,i=r[o.degree]}r[o.degree]=o}let n=null;for(let o=0;oy&&(y=l[P])}let S=new Int32Array(g);for(let A=0,P=0;A0&&(v[A]=P+1,S[P]=T,P+=1)}let _=new Uint32Array(g);for(let A=1;A0){let T=P-1;E[_[T]+w[T]]=A,w[T]+=1}}return{size:e.size,bucketArray:E,bucketCounts:S,bucketOffset:_,grid:v,delta:d,min:e.expandedBox.min,data:e.data,maxRadius:y,expandedBox:e.expandedBox,boundingBox:e.boundingBox,boundingSphere:e.boundingSphere}}function nSe(e,t,r){let n=ft.expand(ft(),t.box,x.create(.5,.5,.5)),{indices:o}=e,i=ft.size(x(),n),s,a,l=Te.size(o),c=typeof r=="number"?r:32,u=Array.isArray(r)&&r;if(u&&!x.isZero(u))a=[Math.ceil(i[0]/u[0]),Math.ceil(i[1]/u[1]),Math.ceil(i[2]/u[2])],s=u;else if(l>0){let p=Math.ceil(l/c),h=Math.pow(p/(i[0]*i[1]*i[2]),1/3);a=[Math.ceil(i[0]*h),Math.ceil(i[1]*h),Math.ceil(i[2]*h)],s=[i[0]/a[0],i[1]/a[1],i[2]/a[2]]}else s=i,a=[1,1,1];let d={x:e.x,y:e.y,z:e.z,indices:o,radius:e.radius},m={size:a,data:d,expandedBox:n,boundingBox:t.box,boundingSphere:t.sphere,elementCount:l,delta:s};return rSe(m)}function oSe(e){return{grid:e,x:.1,y:.1,z:.1,k:1,stopIf:void 0,radius:.1,isCheck:!1}}function jj(e,t){let{min:r,size:[n,o,i],bucketOffset:s,bucketCounts:a,bucketArray:l,grid:c,data:{x:u,y:d,z:m,indices:p,radius:h},delta:f,maxRadius:y}=e.grid,{radius:g,isCheck:v,x:b,y:S,z:_}=e,w=g+y,E=w*w;Yc.reset(t);let A=Math.max(0,Math.floor((b-w-r[0])/f[0])),P=Math.max(0,Math.floor((S-w-r[1])/f[1])),T=Math.max(0,Math.floor((_-w-r[2])/f[2])),B=Math.min(n-1,Math.floor((b+w-r[0])/f[0])),D=Math.min(o-1,Math.floor((S+w-r[1])/f[1])),M=Math.min(i-1,Math.floor((_+w-r[2])/f[2]));if(A>B||P>D||T>M)return!1;for(let R=A;R<=B;R++)for(let U=P;U<=D;U++)for(let F=T;F<=M;F++){let N=c[(R*o+U)*i+F];if(N===0)continue;let z=N-1,q=s[z],O=a[z],J=q+O;for(let Q=q;Q0&&Math.sqrt(V)-h[H]>g)continue;if(v)return!0;Yc.add(t,l[Q],V)}}}return t.count>0}var qj=x(),Mg=x(),cC=new Set,yR=new Set,iSe=[.1],sSe=[.1],aSe=[.1],hx=new fx;function lSe(e,t){let{min:r,expandedBox:n,boundingSphere:{center:o},size:[i,s,a],bucketOffset:l,bucketCounts:c,bucketArray:u,grid:d,data:{x:m,y:p,z:h,indices:f,radius:y},delta:g,maxRadius:v}=e.grid,{x:b,y:S,z:_,k:w,stopIf:E}=e,A=Te.size(f);if(Yc.reset(t),A===0||w<=0)return!1;let P,T,B,D=!1,M=1,R=!0,U=0,F=iSe,N=sSe,z=0,q=!0,O,J=!1,Q=aSe,H=v*v;F.length=0,Q.length=0,cC.clear(),hx.clear(),x.set(Mg,b,S,_),ft.containsVec3(n,Mg)?(P=Math.floor((b-r[0])/g[0]),T=Math.floor((S-r[1])/g[1]),B=Math.floor((_-r[2])/g[2])):(ft.nearestIntersectionWithRay(Mg,n,Mg,x.normalize(qj,x.sub(qj,o,Mg))),P=Math.max(0,Math.min(i-1,Math.floor((Mg[0]-r[0])/g[0]))),T=Math.max(0,Math.min(s-1,Math.floor((Mg[1]-r[1])/g[1]))),B=Math.max(0,Math.min(a-1,Math.floor((Mg[2]-r[2])/g[2]))));let W=v!==0?Math.max(1,Math.min(i-1,Math.ceil(v/g[0]))):1,K=v!==0?Math.max(1,Math.min(s-1,Math.ceil(v/g[1]))):1,ce=v!==0?Math.max(1,Math.min(a-1,Math.ceil(v/g[2]))):1;for(F.push(P,T,B,(P*s+T)*a+B);t.count=d.length;let X=d[O];if(X!==0){let Z=z,ie=X-1,de=l[ie],we=c[ie],Be=de+we;for(let Ie=de;Iez&&(z=Re),hx.insert(Re,le)}Z=i))for(let ie=-K;ie<=K;ie++){let de=T+ie;if(!(de<0||de>=s))for(let we=-ce;we<=ce;we++){let Be=B+we;if(!(Be<0||Be>=a)&&(O=(Z*s+de)*a+Be,!yR.has(O)&&(yR.add(O),!cC.has(O)))){if(!R){let Ie=r[0]+Z*g[0]-b,le=r[1]+de*g[1]-S,j=r[2]+Be*g[2]-_;if(Ie*Ie+le*le+j*j-H>z){Q.push(Z,de,Be,O);continue}}N.push(Z,de,Be,O),U++}}}}}if(R=!1,U===0){if(w===1){let G=hx.findMinimum();if(G){let{key:X,value:Z}=G;return Yc.add(t,Z,X),!0}}else for(;!hx.isEmpty()&&(J||hx.findMinimum().key<=z)&&t.count=w||D||t.count>=A)return t.count>0;if(R=!0,q=!0,Q.length>0){for(let G=0,X=Q.length;G0}var $={};hi($,{Bundle:()=>vC,Location:()=>Qn,Loci:()=>zg,Stats:()=>g5,atomicProperty:()=>iAe,chainIndex:()=>lAe,coarseProperty:()=>sAe,entityIndex:()=>cAe,property:()=>oAe,residueIndex:()=>aAe});var Qn;(function(e){function t(p,h,f){return{kind:"element-location",structure:p,unit:h,element:f||0}}e.create=t;function r(p){return t(p.structure,p.unit,p.element)}e.clone=r;function n(p,h,f,y){return h&&(p.structure=h),f&&(p.unit=f),y!==void 0&&(p.element=y),p}e.set=n;function o(p,h){return p.unit=h.unit,p.element=h.element,p}e.copy=o;function i(p){return!!p&&p.kind==="element-location"}e.is=i;function s(p,h){return p.unit===h.unit&&p.element===h.element}e.areEqual=s;let a=x(),l=x();function c(p,h){return p.unit.conformation.position(p.element,a),h.unit.conformation.position(h.element,l),x.distance(a,l)}e.distance=c;function u(p,h){return h.unit.conformation.position(h.element,p)}e.position=u;function d(p){return p.unit.model.atomicHierarchy.residueAtomSegments.index[p.element]}e.residueIndex=d;function m(p){return p.unit.model.atomicHierarchy.chainAtomSegments.index[p.element]}e.chainIndex=m})(Qn||(Qn={}));var xR=class{add(t){let r=this.getHash(t);if(this.byHash.has(r)){let n=this.byHash.get(r);for(let o=0,i=n.length;o`${n}-${o.toLocaleLowerCase()}${i}`).replace(t,(r,n,o,i)=>`${n}-${o.toLocaleLowerCase()}${i}`)}function Xj(e,t,r){if(dC(r)){r.info.namespace=e,r.info.name=r.info.name||Yj(t),r.id=`${r.info.namespace}.${r.info.name}`;return}let n=`${r["@namespace"]||Yj(t)}`,o=e?`${e}.${n}`:n;for(let i of Object.keys(r))typeof r[i]!="object"&&!dC(r[i])||Xj(o,i,r[i])}function Kj(e,t){if(dC(e)){t.push(e);return}for(let r of Object.keys(e))typeof e[r]!="object"&&!dC(e[r])||Kj(e[r],t)}var un;(function(e){e.AnyVar=Ee.Variable("a",Ee.Any),e.AnyValueVar=Ee.Variable("a",Ee.Any),e.ConstrainedVar=Ee.Variable("a",Ee.Any,!0),e.Regex=Ee.Value("Core","Regex"),e.Set=t=>Ee.Container("Core","Set",t||e.AnyValueVar),e.List=t=>Ee.Container("Core","List",t||e.AnyVar),e.Fn=(t,r)=>Ee.Container("Core","Fn",t||e.AnyVar,r),e.Flags=(t,r)=>Ee.Container("Core","Flags",t,r),e.BitFlags=e.Flags(Ee.Num,"BitFlags")})(un||(un={}));function Ns(e,t){return rr(Zt.Dictionary({0:ht(e)}),e,t)}function Bg(e,t){return rr(Zt.List(e,{nonEmpty:!0}),e,t)}function Td(e,t,r){return rr(Zt.Dictionary({0:ht(e),1:ht(e)}),t,r)}var ont=Zt.Dictionary({0:ht(Ee.Num),1:ht(Ee.Num)}),uSe={"@header":"Types",bool:rr(Zt.Dictionary({0:ht(Ee.AnyValue)}),Ee.Bool,"Convert a value to boolean."),num:rr(Zt.Dictionary({0:ht(Ee.AnyValue)}),Ee.Num,"Convert a value to number."),str:rr(Zt.Dictionary({0:ht(Ee.AnyValue)}),Ee.Str,"Convert a value to string."),regex:rr(Zt.Dictionary({0:ht(Ee.Str,{description:"Expression"}),1:ht(Ee.Str,{isOptional:!0,description:"Flags, e.g. 'i' for ignore case"})}),un.Regex,"Creates a regular expression from a string using the ECMAscript syntax."),list:rr(Zt.List(un.AnyVar),un.List()),set:rr(Zt.List(un.AnyValueVar),un.Set()),bitflags:rr(Zt.Dictionary({0:ht(Ee.Num)}),un.BitFlags,"Interpret a number as bitflags."),compositeKey:rr(Zt.List(Ee.AnyValue),Ee.AnyValue)},dSe={"@header":"Logic",not:Ns(Ee.Bool),and:Bg(Ee.Bool),or:Bg(Ee.Bool)},mSe={"@header":"Control",eval:rr(Zt.Dictionary({0:ht(un.Fn(un.AnyVar))}),un.AnyVar,"Evaluate a function."),fn:rr(Zt.Dictionary({0:ht(un.AnyVar)}),un.Fn(un.AnyVar),'Wrap an expression to a "lazy" function.'),if:rr(Zt.Dictionary({0:ht(Ee.Bool,{description:"Condition"}),1:ht(Ee.Variable("a",Ee.Any),{description:"If true"}),2:ht(Ee.Variable("b",Ee.Any),{description:"If false"})}),Ee.Union([Ee.Variable("a",Ee.Any),Ee.Variable("b",Ee.Any)])),assoc:rr(Zt.Dictionary({0:ht(Ee.Str,{description:"Name"}),1:ht(Ee.Variable("a",Ee.Any),{description:"Value to assign"})}),Ee.Variable("a",Ee.Any))},pSe={"@header":"Relational",eq:Td(Ee.Variable("a",Ee.AnyValue,!0),Ee.Bool),neq:Td(Ee.Variable("a",Ee.AnyValue,!0),Ee.Bool),lt:Td(Ee.Num,Ee.Bool),lte:Td(Ee.Num,Ee.Bool),gr:Td(Ee.Num,Ee.Bool),gre:Td(Ee.Num,Ee.Bool),inRange:rr(Zt.Dictionary({0:ht(Ee.Num,{description:"Value to test"}),1:ht(Ee.Num,{description:"Minimum value"}),2:ht(Ee.Num,{description:"Maximum value"})}),Ee.Bool,"Check if the value of the 1st argument is >= 2nd and <= 3rd.")},fSe={"@header":"Math",add:Bg(Ee.Num),sub:Bg(Ee.Num),mult:Bg(Ee.Num),div:Td(Ee.Num,Ee.Num),pow:Td(Ee.Num,Ee.Num),mod:Td(Ee.Num,Ee.Num),min:Bg(Ee.Num),max:Bg(Ee.Num),cantorPairing:Td(Ee.Num,Ee.Num),sortedCantorPairing:Td(Ee.Num,Ee.Num),invertCantorPairing:rr(Zt.Dictionary({0:ht(Ee.Num)}),un.List(Ee.Num)),floor:Ns(Ee.Num),ceil:Ns(Ee.Num),roundInt:Ns(Ee.Num),trunc:Ns(Ee.Num),abs:Ns(Ee.Num),sign:Ns(Ee.Num),sqrt:Ns(Ee.Num),cbrt:Ns(Ee.Num),sin:Ns(Ee.Num),cos:Ns(Ee.Num),tan:Ns(Ee.Num),asin:Ns(Ee.Num),acos:Ns(Ee.Num),atan:Ns(Ee.Num),sinh:Ns(Ee.Num),cosh:Ns(Ee.Num),tanh:Ns(Ee.Num),exp:Ns(Ee.Num),log:Ns(Ee.Num),log10:Ns(Ee.Num),atan2:Td(Ee.Num,Ee.Num)},hSe={"@header":"Strings",concat:Bg(Ee.Str),match:rr(Zt.Dictionary({0:ht(un.Regex),1:ht(Ee.Str)}),Ee.Bool)},gSe={"@header":"Lists",getAt:rr(Zt.Dictionary({0:ht(un.List()),1:ht(Ee.Num)}),un.AnyVar),equal:rr(Zt.Dictionary({0:ht(un.List()),1:ht(un.List())}),Ee.Bool)},ySe={"@header":"Sets",has:rr(Zt.Dictionary({0:ht(un.Set(un.ConstrainedVar)),1:ht(un.ConstrainedVar)}),Ee.Bool,"Check if the the 1st argument includes the value of the 2nd."),isSubset:rr(Zt.Dictionary({0:ht(un.Set(un.ConstrainedVar)),1:ht(un.Set(un.ConstrainedVar))}),Ee.Bool,"Check if the the 1st argument is a subset of the 2nd.")},vSe={"@header":"Flags",hasAny:rr(Zt.Dictionary({0:ht(un.Flags(un.ConstrainedVar)),1:ht(un.Flags(un.ConstrainedVar))}),Ee.Bool,"Check if the the 1st argument has at least one of the 2nd one's flags."),hasAll:rr(Zt.Dictionary({0:ht(un.Flags(un.ConstrainedVar)),1:ht(un.Flags(un.ConstrainedVar))}),Ee.Bool,"Check if the the 1st argument has all 2nd one's flags.")},zA={"@header":"Language Primitives",type:uSe,logic:dSe,ctrl:mSe,rel:pSe,math:fSe,str:hSe,list:gSe,set:ySe,flags:vSe};NA(zA);var xSe=UA(zA),int=function(){let e=Object.create(null);for(let t of xSe)e[t.id]=t;return e}();var kt;(function(e){e.ElementSymbol=Ee.Value("Structure","ElementSymbol"),e.AtomName=Ee.Value("Structure","AtomName"),e.BondFlag=Ee.OneOf("Structure","BondFlag",Ee.Str,["covalent","metallic","ion","hydrogen","sulfide","computed","aromatic"]),e.BondFlags=un.Flags(e.BondFlag,"BondFlags"),e.SecondaryStructureFlag=Ee.OneOf("Structure","SecondaryStructureFlag",Ee.Str,["alpha","beta","3-10","pi","sheet","strand","helix","turn","none"]),e.SecondaryStructureFlags=un.Flags(e.SecondaryStructureFlag,"SecondaryStructureFlag"),e.RingFingerprint=Ee.Value("Structure","RingFingerprint"),e.EntityType=Ee.OneOf("Structure","EntityType",Ee.Str,["polymer","non-polymer","water","branched"]),e.EntitySubtype=Ee.OneOf("Structure","EntitySubtype",Ee.Str,["other","polypeptide(D)","polypeptide(L)","polydeoxyribonucleotide","polyribonucleotide","polydeoxyribonucleotide/polyribonucleotide hybrid","cyclic-pseudo-peptide","peptide nucleic acid","oligosaccharide"]),e.ObjectPrimitive=Ee.OneOf("Structure","ObjectPrimitive",Ee.Str,["atomistic","sphere","gaussian","other"]),e.ResidueId=Ee.Value("Structure","ResidueId"),e.ElementSet=Ee.Value("Structure","ElementSet"),e.ElementSelection=Ee.Value("Structure","ElementSelection"),e.ElementReference=Ee.Value("Structure","ElementReference"),e.ElementSelectionQuery=un.Fn(e.ElementSelection,"ElementSelectionQuery")})(kt||(kt={}));var SSe={"@header":"Types",elementSymbol:rr(Zt.Dictionary({0:ht(Ee.Str)}),kt.ElementSymbol,"Create element symbol representation from a string value."),atomName:rr(Zt.Dictionary({0:ht(Ee.AnyValue)}),kt.AtomName,"Convert a value to an atom name."),entityType:rr(Zt.Dictionary({0:ht(kt.EntityType)}),kt.EntityType,`Create normalized representation of entity type: ${Ee.oneOfValues(kt.EntityType).join(", ")}.`),bondFlags:rr(Zt.List(kt.BondFlag),kt.BondFlags,`Create bond flags representation from a list of strings. Allowed flags: ${Ee.oneOfValues(kt.BondFlag).join(", ")}.`),ringFingerprint:rr(Zt.List(kt.ElementSymbol,{nonEmpty:!0}),kt.RingFingerprint,"Create ring fingerprint from the supplied atom element list."),secondaryStructureFlags:rr(Zt.List(kt.SecondaryStructureFlag),kt.SecondaryStructureFlags,`Create secondary structure flags representation from a list of strings. Allowed flags: ${Ee.oneOfValues(kt.SecondaryStructureFlag).join(", ")}.`),authResidueId:rr(Zt.Dictionary({0:ht(Ee.Str,{description:"auth_asym_id"}),1:ht(Ee.Num,{description:"auth_seq_id"}),2:ht(Ee.Str,{description:"pdbx_PDB_ins_code",isOptional:!0})}),kt.ResidueId,'Residue identifier based on "auth_" annotation.'),labelResidueId:rr(Zt.Dictionary({0:ht(Ee.Str,{description:"label_entity_id"}),1:ht(Ee.Str,{description:"label_asym_id"}),2:ht(Ee.Num,{description:"label_seq_id"}),3:ht(Ee.Str,{description:"pdbx_PDB_ins_code",isOptional:!0})}),kt.ResidueId,`Residue identifier based on mmCIF's "label_" annotation.`)},CSe={"@header":"Iteration Slots",element:rr(Zt.None,kt.ElementReference,"A reference to the current element."),elementSetReduce:rr(Zt.None,Ee.Variable("a",Ee.AnyValue,!0),"Current value of the element set reducer.")},_Se={"@header":"Generators",all:rr(Zt.None,kt.ElementSelectionQuery,"The entire structure."),atomGroups:rr(Zt.Dictionary({"entity-test":ht(Ee.Bool,{isOptional:!0,defaultValue:!0,description:"Test for the 1st atom of every entity"}),"chain-test":ht(Ee.Bool,{isOptional:!0,defaultValue:!0,description:"Test for the 1st atom of every chain"}),"residue-test":ht(Ee.Bool,{isOptional:!0,defaultValue:!0,description:"Test for the 1st atom every residue"}),"atom-test":ht(Ee.Bool,{isOptional:!0,defaultValue:!0}),"group-by":ht(Ee.Any,{isOptional:!0,defaultValue:"atom-key",description:"Group atoms to sets based on this property. Default: each atom has its own set"})}),kt.ElementSelectionQuery,"Return all atoms for which the tests are satisfied, grouped into sets."),bondedAtomicPairs:rr(Zt.Dictionary({0:ht(Ee.Bool,{isOptional:!0,defaultValue:"true for covalent bonds",description:"Test each bond with this predicate. Each bond is visited twice with swapped atom order."})}),kt.ElementSelectionQuery,"Return all pairs of atoms for which the test is satisfied."),rings:rr(Zt.Dictionary({fingerprint:ht(kt.RingFingerprint,{isOptional:!0}),"only-aromatic":ht(Ee.Bool,{isOptional:!0,defaultValue:!1})}),kt.ElementSelectionQuery,"Return all rings or those with the specified fingerprint and/or only aromatic rings."),queryInSelection:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),query:ht(kt.ElementSelectionQuery),"in-complement":ht(Ee.Bool,{isOptional:!0,defaultValue:!1})}),kt.ElementSelectionQuery,"Executes query only on atoms that are in the source selection."),empty:rr(Zt.None,kt.ElementSelectionQuery,"Nada.")},wSe={"@header":"Selection Modifications",queryEach:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),query:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"Query every atom set in the input selection separately."),intersectBy:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),by:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"Intersect each atom set from the first sequence from atoms in the second one."),exceptBy:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),by:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"Remove all atoms from 'selection' that occur in 'by'."),unionBy:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),by:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"For each atom set A in the orginal sequence, combine all atoms sets in the target selection that intersect with A."),union:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"Collects all atom sets in the sequence into a single atom set."),cluster:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),"min-distance":ht(Ee.Num,{isOptional:!0,defaultValue:0}),"max-distance":ht(Ee.Num),"min-size":ht(Ee.Num,{description:"Minimal number of sets to merge, must be at least 2",isOptional:!0,defaultValue:2}),"max-size":ht(Ee.Num,{description:"Maximal number of sets to merge, if not set, no limit",isOptional:!0})}),kt.ElementSelectionQuery,"Combines atom sets that have mutual distance in the interval [min-radius, max-radius]. Minimum/maximum size determines how many atom sets can be combined."),includeSurroundings:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),radius:ht(Ee.Num),"atom-radius":ht(Ee.Num,{isOptional:!0,defaultValue:0,description:"Value added to each atom before the distance check, for example VDW radius. Using this argument is computationally demanding."}),"as-whole-residues":ht(Ee.Bool,{isOptional:!0})}),kt.ElementSelectionQuery,"For each atom set in the selection, include all surrouding atoms/residues that are within the specified radius."),surroundingLigands:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),radius:ht(Ee.Num),"include-water":ht(Ee.Bool,{isOptional:!0,defaultValue:!0})}),kt.ElementSelectionQuery,"Find all ligands components around the source query."),includeConnected:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),"bond-test":ht(Ee.Bool,{isOptional:!0,defaultValue:"true for covalent bonds"}),"layer-count":ht(Ee.Num,{isOptional:!0,defaultValue:1,description:"Number of bonded layers to include."}),"fixed-point":ht(Ee.Bool,{isOptional:!0,defaultValue:!1,description:"Continue adding layers as long as new connections exist."}),"as-whole-residues":ht(Ee.Bool,{isOptional:!0})}),kt.ElementSelectionQuery,"Pick all atom sets that are connected to the target."),wholeResidues:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"Expand the selection to whole residues."),expandProperty:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),property:ht(Ee.AnyValue)}),kt.ElementSelectionQuery,"To each atom set in the selection, add all atoms that have the same property value that was already present in the set.")},ASe={"@header":"Selection Filters",pick:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),test:ht(Ee.Bool)}),kt.ElementSelectionQuery,"Pick all atom sets that satisfy the test."),first:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"Take the 1st atom set in the sequence."),withSameAtomProperties:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),source:ht(kt.ElementSelectionQuery),property:ht(Ee.Any)}),kt.ElementSelectionQuery,"Pick all atom sets for which the set of given atom properties is a subset of the source properties."),intersectedBy:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),by:ht(kt.ElementSelectionQuery)}),kt.ElementSelectionQuery,"Pick all atom sets that have non-zero intersection with the target."),within:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),target:ht(kt.ElementSelectionQuery),"min-radius":ht(Ee.Num,{isOptional:!0,defaultValue:0}),"max-radius":ht(Ee.Num),"atom-radius":ht(Ee.Num,{isOptional:!0,defaultValue:0,description:"Value added to each atom before the distance check, for example VDW radius. Using this argument is computationally demanding."}),invert:ht(Ee.Bool,{isOptional:!0,defaultValue:!1,description:"If true, pick only atom sets that are further than the specified radius."})}),kt.ElementSelectionQuery,"Pick all atom sets from selection that have any atom within the radius of any atom from target."),isConnectedTo:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery),target:ht(kt.ElementSelectionQuery),"bond-test":ht(Ee.Bool,{isOptional:!0,defaultValue:"true for covalent bonds"}),disjunct:ht(Ee.Bool,{isOptional:!0,defaultValue:!0,description:"If true, there must exist a bond to an atom that lies outside the given atom set to pass test."}),invert:ht(Ee.Bool,{isOptional:!0,defaultValue:!1,description:"If true, return atom sets that are not connected."})}),kt.ElementSelectionQuery,"Pick all atom sets that are connected to the target.")},TSe={"@header":"Selection Combinators",intersect:rr(Zt.List(kt.ElementSelectionQuery),kt.ElementSelectionQuery,"Return all unique atom sets that appear in all of the source selections."),merge:rr(Zt.List(kt.ElementSelectionQuery),kt.ElementSelectionQuery,"Merges multiple selections into a single one. Only unique atom sets are kept."),distanceCluster:rr(Zt.Dictionary({matrix:ht(un.List(un.List(Ee.Num)),{description:"Distance matrix, represented as list of rows (num[][])). Lower triangle is min distance, upper triangle is max distance."}),selections:ht(un.List(kt.ElementSelectionQuery),{description:"A list of held selections."})}),kt.ElementSelectionQuery,"Pick combinations of atom sets from the source sequences that are mutually within distances specified by a matrix.")},PSe={"@header":"Atom Sets",atomCount:rr(Zt.None,Ee.Num),countQuery:rr(Zt.Dictionary({0:ht(kt.ElementSelectionQuery)}),Ee.Num,"Counts the number of occurences of a specific query inside the current atom set."),reduce:rr(Zt.Dictionary({initial:ht(Ee.Variable("a",Ee.AnyValue,!0),{description:"Initial value assigned to slot.atom-set-reduce. Current atom is set to the 1st atom of the current set for this."}),value:ht(Ee.Variable("a",Ee.AnyValue,!0),{description:"Expression executed for each atom in the set"})}),Ee.Variable("a",Ee.AnyValue,!0),"Execute the value expression for each atom in the current atom set and return the result. Works the same way as Array.reduce in JavaScript (``result = value(value(...value(initial)))``)"),propertySet:rr(Zt.Dictionary({0:ht(un.ConstrainedVar)}),un.Set(un.ConstrainedVar),"Returns a set with all values of the given property in the current atom set.")},ISe={"@header":"Atom Properties",core:{"@header":"Core Properties",elementSymbol:dn(kt.ElementSymbol),vdw:dn(Ee.Num,"Van der Waals radius"),mass:dn(Ee.Num,"Atomic weight"),atomicNumber:dn(Ee.Num,"Atomic number"),x:dn(Ee.Num,"Cartesian X coordinate"),y:dn(Ee.Num,"Cartesian Y coordinate"),z:dn(Ee.Num,"Cartesian Z coordinate"),atomKey:dn(Ee.AnyValue,"Unique value for each atom. Main use case is grouping of atoms."),bondCount:rr(Zt.Dictionary({0:ht(kt.ElementReference,{isOptional:!0,defaultValue:"slot.current-atom"}),flags:ht(kt.BondFlags,{isOptional:!0,defaultValue:"covalent"})}),Ee.Num,"Number of bonds (by default only covalent bonds are counted)."),sourceIndex:dn(Ee.Num,"Index of the atom/element in the input file."),operatorName:dn(Ee.Str,"Name of the symmetry operator applied to this element."),operatorKey:dn(Ee.Num,"Key of the symmetry operator applied to this element."),modelIndex:dn(Ee.Num,"Index of the model in the input file."),modelLabel:dn(Ee.Str,"Label/header of the model in the input file.")},topology:{connectedComponentKey:dn(Ee.AnyValue,"Unique value for each connected component.")},macromolecular:{"@header":"Macromolecular Properties (derived from the mmCIF format)",authResidueId:dn(kt.ResidueId,"type.auth-residue-id symbol executed on current atom's residue"),labelResidueId:dn(kt.ResidueId,"type.label-residue-id symbol executed on current atom's residue"),residueKey:dn(Ee.AnyValue,"Unique value for each tuple ``(label_entity_id,auth_asym_id, auth_seq_id, pdbx_PDB_ins_code)``, main use case is grouping of atoms"),chainKey:dn(Ee.AnyValue,"Unique value for each tuple ``(label_entity_id, auth_asym_id)``, main use case is grouping of atoms"),entityKey:dn(Ee.AnyValue,"Unique value for each tuple ``label_entity_id``, main use case is grouping of atoms"),isHet:dn(Ee.Bool,"Equivalent to atom_site.group_PDB !== ATOM"),id:dn(Ee.Num,"_atom_site.id"),label_atom_id:dn(kt.AtomName),label_alt_id:dn(Ee.Str),label_comp_id:dn(Ee.Str),label_asym_id:dn(Ee.Str),label_entity_id:dn(Ee.Str),label_seq_id:dn(Ee.Num),auth_atom_id:dn(kt.AtomName),auth_comp_id:dn(Ee.Str),auth_asym_id:dn(Ee.Str),auth_seq_id:dn(Ee.Num),pdbx_PDB_ins_code:dn(Ee.Str),pdbx_formal_charge:dn(Ee.Num),occupancy:dn(Ee.Num),B_iso_or_equiv:dn(Ee.Num),entityType:dn(kt.EntityType,"Type of the entity as defined in mmCIF (polymer, non-polymer, branched, water)"),entitySubtype:dn(kt.EntitySubtype,"Subtype of the entity as defined in mmCIF _entity_poly.type and _pdbx_entity_branch.type (other, polypeptide(D), polypeptide(L), polydeoxyribonucleotide, polyribonucleotide, polydeoxyribonucleotide/polyribonucleotide hybrid, cyclic-pseudo-peptide, peptide nucleic acid, oligosaccharide)"),entityPrdId:dn(Ee.Str,"The PRD ID of the entity."),entityDescription:dn(un.List(Ee.Str)),objectPrimitive:dn(kt.ObjectPrimitive,"Type of the primitive object used to model this segment as defined in mmCIF/IHM (atomistic, sphere, gaussian, other)"),secondaryStructureKey:dn(Ee.AnyValue,"Unique value for each secondary structure element."),secondaryStructureFlags:dn(kt.SecondaryStructureFlags),isModified:dn(Ee.Bool,"True if the atom belongs to modification of a standard residue."),modifiedParentName:dn(Ee.Str,"'3-letter' code of the modifed parent residue."),isNonStandard:dn(Ee.Bool,"True if this is a non-standard residue."),chemCompType:dn(Ee.Str,"Type of the chemical component as defined in mmCIF.")}},ESe={"@header":"Bond Properties",flags:yx(kt.BondFlags),order:yx(Ee.Num),key:yx(Ee.Num),length:yx(Ee.Num),atomA:yx(kt.ElementReference),atomB:yx(kt.ElementReference)};function dn(e,t){return rr(Zt.Dictionary({0:ht(kt.ElementReference,{isOptional:!0,defaultValue:"slot.current-atom"})}),e,t)}function yx(e,t){return rr(Zt.None,e,t)}var Qj={"@header":"Structure Queries",type:SSe,slot:CSe,generator:_Se,modifier:wSe,filter:ASe,combinator:TSe,atomSet:PSe,atomProperty:ISe,bondProperty:ESe};var kSe={"@header":"Generators",bundleElement:rr(Zt.Dictionary({groupedUnits:ht(Ee.Any),set:ht(Ee.Any),ranges:ht(Ee.Any)}),Ee.Any),bundle:rr(Zt.Dictionary({elements:ht(Ee.Any)}),kt.ElementSelectionQuery,"A selection with single structure containing represented by the bundle."),current:rr(Zt.None,kt.ElementSelectionQuery,"Current selection provided by the query context. Avoid using this in State Transforms.")},Zj={"@header":"Internal Queries",generator:kSe};var Ce={core:zA,structureQuery:Qj,internal:Zj};NA(Ce);var MSe=UA(Ce),ynt=function(){let e=Object.create(null);for(let t of MSe)e[t.id]=t;return e}();var oe;(function(e){e.core=Ce.core,e.struct=Ce.structureQuery,e.internal=Ce.internal;function t(v){return e.struct.type.atomName([v])}e.atomName=t;function r(v){return e.struct.type.elementSymbol([v])}e.es=r;function n(...v){return e.core.type.list(v)}e.list=n;function o(...v){return e.core.type.set(v)}e.set=o;function i(v,b){return e.core.type.regex([v,b])}e.re=i;function s(v){return e.core.ctrl.fn([v])}e.fn=s;function a(v){return e.core.ctrl.eval([v])}e.evaluate=a;let l=e.struct.atomProperty.core,c=e.struct.atomProperty.macromolecular,u=e.struct.atomProperty.topology;function d(v){return l[v]()}e.acp=d;function m(v){return u[v]()}e.atp=m;function p(v){return c[v]()}e.ammp=p;let h=e.struct.atomSet.propertySet;function f(v){return h([d(v)])}e.acpSet=f;function y(v){return h([m(v)])}e.atpSet=y;function g(v){return h([p(v)])}e.ammpSet=g})(oe||(oe={}));function ji(){return ji.zero()}(function(e){function t(){let D=[.1,0,0];return D[0]=0,D}e.zero=t;function r(D,M,R){let U=t();return U[0]=D,U[1]=M,U[2]=R,U}e.create=r;function n(D,M,R,U){return D[0]=M,D[1]=R,D[2]=U,D}e.set=n;function o(D,M){let R=M[0]-D[0],U=M[1]-D[1],F=M[2]-D[2];return Math.sqrt(R*R+U*U+F*F)}e.distance=o;function i(D,M){let[R,U,F]=Oe.toRgb(M),[N,z,q]=B(R,U,F),O=116*z-16;return D[0]=O<0?0:O,D[1]=500*(N-z),D[2]=200*(z-q),D}e.fromColor=i;function s(D,M){return Xc.toLab(D,M)}e.fromHcl=s;function a(D){let M=(D[0]+16)/116,R=isNaN(D[1])?M:M+D[1]/500,U=isNaN(D[2])?M:M-D[2]/200;M=g*A(M),R=y*A(R),U=v*A(U);let F=E(3.2404542*R-1.5371385*M-.4985314*U),N=E(-.969266*R+1.8760108*M+.041556*U),z=E(.0556434*R-.2040259*M+1.0572252*U);return Oe.fromRgb(Math.round(po(F,0,255)),Math.round(po(N,0,255)),Math.round(po(z,0,255)))}e.toColor=a;function l(D,M){let[R,U,F]=M,N=Math.sqrt(U*U+F*F),z=(Fs(Math.atan2(F,U))+360)%360;return Math.round(N*1e4)===0&&(z=Number.NaN),D[0]=z,D[1]=N,D[2]=R,D}e.toHcl=l;function c(D,M){return D[0]=M[0],D[1]=M[1],D[2]=M[2],D}e.copy=c;function u(D,M,R){return D[0]=M[0]-f*R,D[1]=M[1],D[2]=M[2],D}e.darken=u;function d(D,M,R){return u(D,M,-R)}e.lighten=d;let m=[0,0,0];function p(D,M,R){return l(m,M),Xc.toLab(D,Xc.saturate(m,m,R))}e.saturate=p;function h(D,M,R){return p(D,M,-R)}e.desaturate=h;let f=18,y=.95047,g=1,v=1.08883,b=.137931034,S=.206896552,_=.12841855,w=.008856452;function E(D){return 255*(D<=.00304?12.92*D:1.055*Math.pow(D,1/2.4)-.055)}function A(D){return D>S?D*D*D:_*(D-b)}function P(D){return(D/=255)<=.04045?D/12.92:Math.pow((D+.055)/1.055,2.4)}function T(D){return D>w?Math.pow(D,1/3):D/_+b}function B(D,M,R){D=P(D),M=P(M),R=P(R);let U=T((.4124564*D+.3575761*M+.1804375*R)/y),F=T((.2126729*D+.7151522*M+.072175*R)/g),N=T((.0193339*D+.119192*M+.9503041*R)/v);return[U,F,N]}})(ji||(ji={}));function Xc(){return Xc.zero()}(function(e){function t(){let v=[.1,0,0];return v[0]=0,v}e.zero=t;function r(v,b,S){let _=t();return _[0]=v,_[1]=b,_[2]=S,_}e.create=r;function n(v,b,S,_){return v[0]=b,v[1]=S,v[2]=_,v}e.set=n;function o(v){return!isNaN(v[0])}e.hasHue=o;let i=[0,0,0];function s(v,b){return ji.toHcl(v,ji.fromColor(i,b))}e.fromColor=s;function a(v,b){return ji.toHcl(v,b)}e.fromLab=a;let l=[0,0,0];function c(v){return ji.toColor(u(l,v))}e.toColor=c;function u(v,b){let[S,_,w]=b;return isNaN(S)&&(S=0),S=Cr(S),v[0]=w,v[1]=Math.cos(S)*_,v[2]=Math.sin(S)*_,v}e.toLab=u;function d(v,b){return v[0]=b[0],v[1]=b[1],v[2]=b[2],v}e.copy=d;function m(v,b,S){return v[0]=b[0],v[1]=Math.max(0,b[1]+g*S),v[2]=b[2],v}e.saturate=m;function p(v,b,S){return m(v,b,-S)}e.desaturate=p;let h=[0,0,0];function f(v,b,S){return u(h,b),ji.toHcl(v,ji.darken(h,h,S))}e.darken=f;function y(v,b,S){return f(v,b,-S)}e.lighten=y;let g=18})(Xc||(Xc={}));function Oe(e){return e}(function(e){function t(F){return`rgb(${F>>16&255}, ${F>>8&255}, ${F&255})`}e.toStyle=t;function r(F){return"#"+("000000"+F.toString(16)).slice(-6)}e.toHexStyle=r;function n(F){return"0x"+("000000"+F.toString(16)).slice(-6)}e.toHexString=n;function o(F){return`RGB: ${e.toRgb(F).join(", ")}`}e.toRgbString=o;function i(F){return[F>>16&255,F>>8&255,F&255]}e.toRgb=i;function s(F){return[(F>>16&255)/255,(F>>8&255)/255,(F&255)/255]}e.toRgbNormalized=s;function a(F){return parseInt(F.replace("#","0x"))}e.fromHexStyle=a;function l(F){return parseInt(F)}e.fromHexString=l;function c(F,N,z){return F<<16|N<<8|z}e.fromRgb=c;function u(F,N,z){return F*255<<16|N*255<<8|z*255}e.fromNormalizedRgb=u;function d(F,N){return c(F[N],F[N+1],F[N+2])}e.fromArray=d;function m(F,N){return u(F[N],F[N+1],F[N+2])}e.fromNormalizedArray=m;function p(F,N,z){return N[z]=F>>16&255,N[z+1]=F>>8&255,N[z+2]=F&255,N}e.toArray=p;function h(F,N,z){return N[z]=(F>>16&255)/255,N[z+1]=(F>>8&255)/255,N[z+2]=(F&255)/255,N}e.toArrayNormalized=h;function f(F,N){return F[0]=N>>16&255,F[1]=N>>8&255,F[2]=N&255,F}e.toVec3=f;function y(F,N){return F[0]=(N>>16&255)/255,F[1]=(N>>8&255)/255,F[2]=(N&255)/255,F}e.toVec3Normalized=y;function g(F,N,z){let q=F>>16&255,O=F>>8&255,J=F&255,Q=N>>16&255,H=N>>8&255,W=N&255,K=q+(Q-q)*z,ce=O+(H-O)*z,V=J+(W-J)*z;return K<<16|ce<<8|V}e.interpolate=g;function v(F){let N=F>>16&255,z=F>>8&255,q=F&255;return N!==z||N!==q}e.hasHue=v;let b=[0,0,0];function S(F,N){return v(F)?(Xc.fromColor(b,F),Xc.toColor(Xc.saturate(b,b,N))):F}e.saturate=S;function _(F,N){return S(F,-N)}e.desaturate=_;let w=[0,0,0];function E(F,N){return ji.fromColor(w,F),ji.toColor(ji.darken(w,w,N))}e.darken=E;function A(F,N){return E(F,-N)}e.lighten=A;function P(F){return F<=.03928?F/12.92:Math.pow((F+.055)/1.055,2.4)}function T(F){let N=P((F>>16&255)/255),z=P((F>>8&255)/255),q=P((F&255)/255);return .2126*N+.7152*z+.0722*q}e.luminance=T;function B(F,N){let z=T(F),q=T(N);return z>q?(z+.05)/(q+.05):(q+.05)/(z+.05)}e.contrast=B;function D(F){return F<.04045?F*.0773993808:Math.pow(F*.9478672986+.0521327014,2.4)}function M(F){return u(D((F>>16&255)/255),D((F>>8&255)/255),D((F&255)/255))}e.sRGBToLinear=M;function R(F){return F<.0031308?F*12.92:1.055*Math.pow(F,.41666)-.055}function U(F){return u(R((F>>16&255)/255),R((F>>8&255)/255),R((F&255)/255))}e.linearToSRGB=U})(Oe||(Oe={}));function mn(e,t,r,n){return{label:e,description:r,list:n,type:t}}function Rg(e,t,r){let n={};for(let o in e){let i=e[o];i=Oe.saturate(i,t),i=Oe.darken(i,-r),n[o]=i}return n}function $j(e,t=" "){return e.replace(/([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g,`$1${t}$2`)}function ra(e){return Gp($j(e))}var BSe=e=>e.toUpperCase();function Jj(e){return e?typeof e=="string"?e.toUpperCase():`${e}`.toUpperCase():""}function Gp(e){return e.toLowerCase().replace(/^\w|\s\w/g,BSe)}function RSe(e){return e.replace(/_/g," ")}function LSe(e){return e.replace(/-/g," ")}function Us(e){return Gp($j(RSe(LSe(e))))}function Di(e,t,r,n){let o=n.length;if(o>r-t)return!1;for(let i=0;i]+>/g,"")}function oh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ca={"orange-red":mn("Orange-Red","sequential","Orange-Red, sequential color scheme from ColorBrewer 2.0",[16775148,16705736,16635038,16628612,16551257,15689032,14102559,11730944,8323072]),"purple-blue":mn("Purple-Blue","sequential","Purple-Blue, sequential color scheme from ColorBrewer 2.0",[16775163,15525874,13685222,10927579,7645647,3576e3,356528,285325,145496]),"blue-purple":mn("Blue-Purple","sequential","Blue-Purple, sequential color scheme from ColorBrewer 2.0",[16252157,14740724,12571622,10403034,9213638,9202609,8929693,8458108,5046347]),oranges:mn("Oranges","sequential","",[16774635,16705230,16634018,16625259,16616764,15821075,14239745,10892803,8333060]),"blue-green":mn("Blue-Green","sequential","",[16252157,15070713,13429990,10082505,6734500,4304502,2329413,27948,17435]),"yellow-orange-brown":mn("Yellow-Orange-Brown","sequential","",[16777189,16775100,16704401,16696399,16685353,15495188,13388802,10040324,6694150]),"yellow-green":mn("Yellow-Green","sequential","",[16777189,16252089,14282915,11394446,7915129,4303709,2327619,26679,17705]),reds:mn("Reds","sequential","",[16774640,16703698,16563105,16552562,16476746,15678252,13309981,10817301,6750221]),"red-purple":mn("Red-Purple","sequential","",[16775155,16638173,16565696,16424885,16214177,14496919,11403646,7995767,4784234]),greens:mn("Greens","sequential","",[16252149,15070688,13101504,10607003,7652470,4303709,2329413,27948,17435]),"yellow-green-blue":mn("Yellow-Green-Blue","sequential","",[16777177,15595697,13101492,8375739,4306628,1937856,2252456,2438292,531800]),purples:mn("Purples","sequential","",[16579581,15724021,14342891,12369372,10394312,8420794,6967715,5515151,4128893]),"green-blue":mn("Green-Blue","sequential","",[16252144,14742491,13429701,11066805,8113348,5157843,2854078,551084,540801]),greys:mn("Greys","sequential","",[16777215,15790320,14277081,12434877,9868950,7566195,5395026,2434341,0]),"yellow-orange-red":mn("Yellow-Orange-Red","sequential","",[16777164,16772512,16701814,16691788,16616764,16535082,14883356,12386342,8388646]),"purple-red":mn("Purple-Red","sequential","",[16250105,15196655,13941210,13210823,14640560,15149450,13505110,9961539,6750239]),blues:mn("Blues","sequential","",[16251903,14609399,13032431,10406625,7057110,4362950,2191797,545180,536683]),"purple-blue-green":mn("Purple-Blue-Green","sequential","",[16775163,15524592,13685222,10927579,6793679,3576e3,164234,93273,83510]),spectral:mn("Spectral","diverging","",[10355010,13975119,16018755,16625249,16703627,16777151,15136152,11263396,6734501,3311805,6180770]),"red-yellow-green":mn("Red-Yellow-Green","diverging","",[10813478,14102567,16018755,16625249,16703627,16777151,14282635,10934634,6733155,1742928,26679]),"red-blue":mn("Red-Blue","diverging","",[6750239,11671595,14049357,16033154,16636871,16250871,13755888,9618910,4428739,2188972,340065]),"pink-yellow-green":mn("Pink-Yellow-Green","diverging","",[9306450,12917629,14579630,15840986,16638191,16250871,15136208,12116358,8371265,5083681,2581529]),"purple-green":mn("Purple-Green","diverging","",[4194379,7744131,10055851,12756431,15193320,16250871,14282963,10935200,5942881,1800247,17435]),"red-yellow-blue":mn("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":mn("Brown-White-Green","diverging","",[5517317,9195786,12550445,14664317,16181443,16119285,13101797,8441281,3512207,91742,15408]),"red-grey":mn("Red-Grey","diverging","",[6750239,11671595,14049357,16033154,16636871,16777215,14737632,12237498,8882055,5066061,1710618]),"orange-purple":mn("Orange-Purple","diverging","",[8338184,11753478,14713364,16627811,16703670,16250871,14211819,11709394,8418220,5515144,2949195]),"set-2":mn("Set-2","qualitative","",[6734501,16551266,9281739,15174339,10934356,16767279,15058068,11776947]),accent:mn("Accent","qualitative","",[8374655,12496596,16629894,16777113,3697840,15729279,12540695,6710886]),"set-1":mn("Set-1","qualitative","",[14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607,10066329]),"set-3":mn("Set-3","qualitative","",[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081,12353725,13429701,16772463]),"dark-2":mn("Dark-2","qualitative","",[1810039,14245634,7696563,15149450,6727198,15117058,10909213,6710886]),paired:mn("Paired","qualitative","",[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054,6962586,16777113,11622696]),"pastel-2":mn("Pastel-2","qualitative","",[11789005,16633260,13358568,16042724,15136201,16773806,15852236,13421772]),"pastel-1":mn("Pastel-1","qualitative","",[16495790,11783651,13429701,14601188,16701862,16777164,15063229,16636652,15921906]),"many-distinct":mn("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:mn("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:mn("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:mn("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:mn("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:mn("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:mn("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:mn("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:mn("Rainbow","sequential","",[3367393,3516485,16383744,15501073,12526114]),"red-white-blue":mn("Red-White-Blue","diverging","",[12526114,16777215,3367393])},FSe=Object.keys(Ca),VA=FSe.map(e=>[e,Ca[e].label,Gp(Ca[e].type)]),tq=VA.filter(e=>Ca[e[0]].type==="diverging"||Ca[e[0]].type==="sequential"),rq=VA.filter(e=>Ca[e[0]].type==="qualitative");function zs(e){return e in Ca?Ca[e]:(console.warn(`unknown color list named '${e}'`),Ca["red-yellow-blue"])}function Nl(e){return{kind:"table-legend",table:e}}function nq(e,t,r){return{kind:"scale-legend",minLabel:e,maxLabel:t,colors:r}}var OSe={domain:[0,1],reverse:!1,listOrName:"red-yellow-blue",minLabel:"",maxLabel:""},cs;(function(e){function t(r){let{domain:n,reverse:o,listOrName:i}=k(k({},OSe),r),s=typeof i=="string"?zs(i).list:i,a=o?s.slice().reverse():s,l=a.length-1,c=0,u=0,d=0;function m(g,v){u=g,d=v,c=d-u||1}m(n[0],n[1]);let p=Ti(r.minLabel,u.toString()),h=Ti(r.maxLabel,d.toString()),f;if(a.every(g=>Array.isArray(g))){let g=[...a];g.sort((_,w)=>_[1]-w[1]);let v=g.map(_=>_[0]),b=Fe.ofSortedArray(g.map(_=>_[1])),S=v.length-1;f=_=>{let w=po((_-u)/c,0,1),E=Fe.findPredecessorIndex(b,w);if(E===0)return v[u];if(E>S)return v[S];let A=b[E-1],P=b[E],T=po((w-A)/(P-A),0,1);return Oe.interpolate(v[E-1],v[E],T)}}else f=g=>{let v=Math.min(a.length-1,Math.max(0,(g-u)/c*l)),b=Math.floor(v),S=a[b],_=a[Math.ceil(v)];return Oe.interpolate(S,_,v-b)};return{color:f,colorToArray:(g,v,b)=>{Oe.toArray(f(g),v,b)},normalizedColorToArray:(g,v,b)=>{Oe.toArrayNormalized(f(g),v,b)},setDomain:m,get legend(){return nq(p,h,a)}}}e.create=t})(cs||(cs={}));var CR=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","9RN","9S7","9SG","9SJ","9SM","9SP","9T1","9T7","9VP","9WJ","9WN","9WZ","9YW","A0K","A1AIO","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","VDF","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"]);var so=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}(so||{}),jt={Blue:37052,Green:42577,Yellow:16765952,Orange:16021792,Pink:16162465,Purple:10830745,LightBlue:9424105,Brown:10582605,Red:15539236,Secondary:15854817},Dt=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}(Dt||{}),$nt={[Dt.Hexose]:"Hexose",[Dt.HexNAc]:"HexNAc",[Dt.Hexosamine]:"Hexosamine",[Dt.Hexuronate]:"Hexuronate",[Dt.Deoxyhexose]:"Deoxyhexose",[Dt.DeoxyhexNAc]:"DeoxyhexNAc",[Dt.DiDeoxyhexose]:"Di-deoxyhexose",[Dt.Pentose]:"Pentose",[Dt.Deoxynonulosonate]:"Deoxynonulosonate",[Dt.DiDeoxynonulosonate]:"Di-deoxynonulosonate",[Dt.Unknown]:"Unknown",[Dt.Assigned]:"Assigned"};var NSe={[Dt.Hexose]:so.FilledSphere,[Dt.HexNAc]:so.FilledCube,[Dt.Hexosamine]:so.CrossedCube,[Dt.Hexuronate]:so.DividedDiamond,[Dt.Deoxyhexose]:so.FilledCone,[Dt.DeoxyhexNAc]:so.DevidedCone,[Dt.DiDeoxyhexose]:so.FlatBox,[Dt.Pentose]:so.FilledStar,[Dt.Deoxynonulosonate]:so.FilledDiamond,[Dt.DiDeoxynonulosonate]:so.FlatDiamond,[Dt.Unknown]:so.FlatHexagon,[Dt.Assigned]:so.Pentagon};function oq(e,t){return e===Dt.Unknown?t===4?so.DiamondPrism:t===5?so.PentagonalPrism:t===6?so.HexagonalPrism:t===7?so.HeptagonalPrism:so.FlatHexagon:NSe[e]}var GA={abbr:"Unk",name:"Unknown",color:jt.Secondary,type:Dt.Unknown},vx=[{abbr:"Glc",name:"Glucose",color:jt.Blue,type:Dt.Hexose},{abbr:"Man",name:"Mannose",color:jt.Green,type:Dt.Hexose},{abbr:"Gal",name:"Galactose",color:jt.Yellow,type:Dt.Hexose},{abbr:"Gul",name:"Gulose",color:jt.Orange,type:Dt.Hexose},{abbr:"Alt",name:"Altrose",color:jt.Pink,type:Dt.Hexose},{abbr:"All",name:"Allose",color:jt.Purple,type:Dt.Hexose},{abbr:"Tal",name:"Talose",color:jt.LightBlue,type:Dt.Hexose},{abbr:"Ido",name:"Idose",color:jt.Brown,type:Dt.Hexose},{abbr:"GlcNAc",name:"N-Acetyl Glucosamine",color:jt.Blue,type:Dt.HexNAc},{abbr:"ManNAc",name:"N-Acetyl Mannosamine",color:jt.Green,type:Dt.HexNAc},{abbr:"GalNAc",name:"N-Acetyl Galactosamine",color:jt.Yellow,type:Dt.HexNAc},{abbr:"GulNAc",name:"N-Acetyl Gulosamine",color:jt.Orange,type:Dt.HexNAc},{abbr:"AltNAc",name:"N-Acetyl Altrosamine",color:jt.Pink,type:Dt.HexNAc},{abbr:"AllNAc",name:"N-Acetyl Allosamine",color:jt.Purple,type:Dt.HexNAc},{abbr:"TalNAc",name:"N-Acetyl Talosamine",color:jt.LightBlue,type:Dt.HexNAc},{abbr:"IdoNAc",name:"N-Acetyl Idosamine",color:jt.Brown,type:Dt.HexNAc},{abbr:"GlcN",name:"Glucosamine",color:jt.Blue,type:Dt.Hexosamine},{abbr:"ManN",name:"Mannosamine",color:jt.Green,type:Dt.Hexosamine},{abbr:"GalN",name:"Galactosamine",color:jt.Yellow,type:Dt.Hexosamine},{abbr:"GulN",name:"Gulosamine",color:jt.Orange,type:Dt.Hexosamine},{abbr:"AltN",name:"Altrosamine",color:jt.Pink,type:Dt.Hexosamine},{abbr:"AllN",name:"Allosamine",color:jt.Purple,type:Dt.Hexosamine},{abbr:"TalN",name:"Talosamine",color:jt.LightBlue,type:Dt.Hexosamine},{abbr:"IdoN",name:"Idosamine",color:jt.Brown,type:Dt.Hexosamine},{abbr:"GlcA",name:"Glucuronic Acid",color:jt.Blue,type:Dt.Hexuronate},{abbr:"ManA",name:"Mannuronic Acid",color:jt.Green,type:Dt.Hexuronate},{abbr:"GalA",name:"Galacturonic Acid",color:jt.Yellow,type:Dt.Hexuronate},{abbr:"GulA",name:"Guluronic Acid",color:jt.Orange,type:Dt.Hexuronate},{abbr:"AltA",name:"Altruronic Acid",color:jt.Pink,type:Dt.Hexuronate},{abbr:"AllA",name:"Alluronic Acid",color:jt.Purple,type:Dt.Hexuronate},{abbr:"TalA",name:"Taluronic Acid",color:jt.LightBlue,type:Dt.Hexuronate},{abbr:"IdoA",name:"Iduronic Acid",color:jt.Brown,type:Dt.Hexuronate},{abbr:"Qui",name:"Quinovose",color:jt.Blue,type:Dt.Deoxyhexose},{abbr:"Rha",name:"Rhamnose",color:jt.Green,type:Dt.Deoxyhexose},{abbr:"6dGul",name:"6-Deoxy Gulose",color:jt.Orange,type:Dt.Deoxyhexose},{abbr:"6dAlt",name:"6-Deoxy Altrose",color:jt.Pink,type:Dt.Deoxyhexose},{abbr:"6dTal",name:"6-Deoxy Talose",color:jt.LightBlue,type:Dt.Deoxyhexose},{abbr:"Fuc",name:"Fucose",color:jt.Red,type:Dt.Deoxyhexose},{abbr:"QuiNAc",name:"N-Acetyl Quinovosamine",color:jt.Blue,type:Dt.DeoxyhexNAc},{abbr:"RhaNAc",name:"N-Acetyl Rhamnosamine",color:jt.Green,type:Dt.DeoxyhexNAc},{abbr:"6dAltNAc",name:"N-Acetyl 6-Deoxy Altrosamine",color:jt.Pink,type:Dt.DeoxyhexNAc},{abbr:"6dTalNAc",name:"N-Acetyl 6-Deoxy Talosamine",color:jt.LightBlue,type:Dt.DeoxyhexNAc},{abbr:"FucNAc",name:"N-Acetyl Fucosamine",color:jt.Red,type:Dt.DeoxyhexNAc},{abbr:"Oli",name:"Olivose",color:jt.Blue,type:Dt.DiDeoxyhexose},{abbr:"Tyv",name:"Tyvelose",color:jt.Green,type:Dt.DiDeoxyhexose},{abbr:"Abe",name:"Abequose",color:jt.Orange,type:Dt.DiDeoxyhexose},{abbr:"Par",name:"Paratose",color:jt.Pink,type:Dt.DiDeoxyhexose},{abbr:"Dig",name:"Digitoxose",color:jt.Purple,type:Dt.DiDeoxyhexose},{abbr:"Col",name:"Colitose",color:jt.LightBlue,type:Dt.DiDeoxyhexose},{abbr:"Ara",name:"Arabinose",color:jt.Green,type:Dt.Pentose},{abbr:"Lyx",name:"Lyxose",color:jt.Yellow,type:Dt.Pentose},{abbr:"Xyl",name:"Xylose",color:jt.Orange,type:Dt.Pentose},{abbr:"Rib",name:"Ribose",color:jt.Pink,type:Dt.Pentose},{abbr:"Kdn",name:"Keto-Deoxy Nonulonic Acid",color:jt.Green,type:Dt.Deoxynonulosonate},{abbr:"Neu5Ac",name:"N-Acetyl Neuraminic Acid",color:jt.Purple,type:Dt.Deoxynonulosonate},{abbr:"Neu5Gc",name:"N-Glycolyl Neuraminic Acid",color:jt.LightBlue,type:Dt.Deoxynonulosonate},{abbr:"Neu",name:"Neuraminic Acid",color:jt.Brown,type:Dt.Deoxynonulosonate},{abbr:"Sia",name:"Sialic acid",color:jt.Red,type:Dt.Deoxynonulosonate},{abbr:"Pse",name:"Pseudaminic Acid",color:jt.Green,type:Dt.DiDeoxynonulosonate},{abbr:"Leg",name:"Legionaminic Acid",color:jt.Yellow,type:Dt.DiDeoxynonulosonate},{abbr:"Aci",name:"Acinetaminic Acid",color:jt.Pink,type:Dt.DiDeoxynonulosonate},{abbr:"4eLeg",name:"4-Epilegionaminic Acid",color:jt.LightBlue,type:Dt.DiDeoxynonulosonate},{abbr:"Bac",name:"Bacillosamine",color:jt.Blue,type:Dt.Unknown},{abbr:"LDmanHep",name:"L-Glycero-D-Manno Heptose",color:jt.Green,type:Dt.Unknown},{abbr:"Kdo",name:"Keto-Deoxy Octulonic Acid",color:jt.Yellow,type:Dt.Unknown},{abbr:"Dha",name:"3-Deoxy Lyxo-Heptulosaric Acid",color:jt.Orange,type:Dt.Unknown},{abbr:"DDmanHep",name:"D-Glycero-D-Manno-Heptose",color:jt.Pink,type:Dt.Unknown},{abbr:"MurNAc",name:"N-Acetyl Muramic Acid",color:jt.Purple,type:Dt.Unknown},{abbr:"MurNGc",name:"N-Glycolyl Muramic Acid",color:jt.LightBlue,type:Dt.Unknown},{abbr:"Mur",name:"Muramic Acid",color:jt.Brown,type:Dt.Unknown},{abbr:"Api",name:"Apicose",color:jt.Green,type:Dt.Assigned},{abbr:"Fru",name:"Fructose",color:jt.Green,type:Dt.Assigned},{abbr:"Tag",name:"Tagatose",color:jt.Yellow,type:Dt.Assigned},{abbr:"Sor",name:"Sorbose",color:jt.Orange,type:Dt.Assigned},{abbr:"Psi",name:"Psicose",color:jt.Pink,type:Dt.Assigned}],iq=function(){let e=new Map;for(let t=0,r=vx.length;t{e.has(t)||e.set(t,GA)}),e}(),zSe=function(){let e=new Map;for(let t=0,r=vx.length;t{e.has(t)||e.set(t,GA)}),e}();function uq(e){Pd=e==="default"?cq:zSe}var Pd=cq;var Dn;(function(e){function t(p){return Array.from(p.values())}e.toArray=t;function r(p,h){if(p===h)return!0;if(p.size0;p.size[e[0],jm(e[1])]));function mq(e){return dq.has(e)?dq.get(e):jm("H")}var pq={0:{trace:new Set,directionFrom:new Set,directionTo:new Set,backboneStart:new Set,backboneEnd:new Set,coarseBackbone:new Set},1:{trace:new Set(["CA"]),directionFrom:new Set(["C"]),directionTo:new Set(["O","OC1","O1","OX1","OXT","OT1"]),backboneStart:new Set(["N"]),backboneEnd:new Set(["C"]),coarseBackbone:new Set(["CA","BB","CA1"])},2:{trace:new Set(["CA"]),directionFrom:new Set(["C"]),directionTo:new Set(["O"]),backboneStart:new Set(["N"]),backboneEnd:new Set(["CD"]),coarseBackbone:new Set(["CA"])},3:{trace:new Set(["CA"]),directionFrom:new Set(["C"]),directionTo:new Set(["O"]),backboneStart:new Set(["N"]),backboneEnd:new Set(["CG"]),coarseBackbone:new Set(["CA"])},4:{trace:new Set(["O3'","O3*"]),directionFrom:new Set(["C4'","C4*"]),directionTo:new Set(["C3'","C3*"]),backboneStart:new Set(["P"]),backboneEnd:new Set(["O3'","O3*"]),coarseBackbone:new Set(["P"])},5:{trace:new Set(["O3'","O3*"]),directionFrom:new Set(["C3'","C3*"]),directionTo:new Set(["C1'","C1*"]),backboneStart:new Set(["P"]),backboneEnd:new Set(["O3'","O3*"]),coarseBackbone:new Set(["P"])},6:{trace:new Set(["N4'","N4*"]),directionFrom:new Set(["N4'","N4*"]),directionTo:new Set(["C7'","C7*"]),backboneStart:new Set(["N1'","N1*"]),backboneEnd:new Set(["C'","C*"]),coarseBackbone:new Set(["P"])}},Ru=new Set(["CA","C","N","O","O1","O2","OC1","OC2","OT1","OT2","OX1","OXT","H","H1","H2","H3","HA","HN","HXT","BB"]),xx=new Set(["P","OP1","OP2","HOP2","HOP3","O2'","O3'","O4'","O5'","C1'","C2'","C3'","C4'","C5'","H1'","H2'","H2''","HO2'","H3'","H4'","H5'","H5''","HO3'","HO5'","O2*","O3*","O4*","O5*","C1*","C2*","C3*","C4*","C5*"]),fq=new Set(["d-peptide linking","d-peptide nh3 amino terminus","d-peptide cooh carboxy terminus","d-gamma-peptide, c-delta linking","d-beta-peptide, c-gamma linking"]),hq=new Set(["l-peptide linking","l-peptide nh3 amino terminus","l-peptide cooh carboxy terminus","l-gamma-peptide, c-delta linking","l-beta-peptide, c-gamma linking"]),GSe=new Set(["d-gamma-peptide, c-delta linking","l-gamma-peptide, c-delta linking"]),HSe=new Set(["d-beta-peptide, c-gamma linking","l-beta-peptide, c-gamma linking"]),jSe=new Set(["d-peptide nh3 amino terminus","d-peptide cooh carboxy terminus","l-peptide nh3 amino terminus","l-peptide cooh carboxy terminus"]),gq=new Set(["peptide linking","peptide-like"]),qSe=Dn.unionMany(fq,hq,gq),yq=new Set(["dna linking","l-dna linking","dna oh 5 prime terminus","dna oh 3 prime terminus"]),vq=new Set(["rna linking","l-rna linking","rna oh 5 prime terminus","rna oh 3 prime terminus"]),xq=Dn.unionMany(new Set(["d-saccharide, beta linking","l-saccharide, beta linking","d-saccharide, alpha linking","l-saccharide, alpha linking","l-saccharide","d-saccharide","saccharide"]),new Set(["d-saccharide 1,4 and 1,4 linking","l-saccharide 1,4 and 1,4 linking","d-saccharide 1,4 and 1,6 linking","l-saccharide 1,4 and 1,6 linking"])),WSe=new Set(["non-polymer","other"]),YSe=new Set(["ion"]),XSe=new Set(["lipid"]),bx=new Set(["SOL","WAT","HOH","H2O","W","DOD","D3O","TIP","TIP3","TIP4","SPC"]),HA=new Set(["HIS","ARG","LYS","ILE","PHE","LEU","TRP","ALA","MET","PRO","CYS","ASN","VAL","GLY","SER","GLN","TYR","ASP","GLU","THR","SEC","PYL","UNK","MSE","SEP","TPO","PTR","PCA","HYP","HSD","HSE","HSP","LSN","ASPP","GLUP","HID","HIE","HIP","LYN","ASH","GLH"]),bq=new Set(["DAL","DAR","DSG","DAS","DCY","DGL","DGN","DHI","DIL","DLE","DLY","MED","DPN","DPR","DSN","DTH","DTR","DTY","DVA","DNE"]),c1=Dn.unionMany(HA,bq),Sq=new Set(["NME","ACE","NH2","FOR","FMT"]),Sx=new Set(["A","C","T","G","I","U","N"]),Cx=new Set(["DA","DC","DT","DG","DI","DU","DN"]),AR=new Set(["APN","CPN","TPN","GPN"]),KSe=new Set(["A","G","I","DA","DG","DI","APN","GPN"]),QSe=new Set(["C","T","U","DC","DT","DU","CPN","TPN"]),u1=Dn.unionMany(Sx,Cx,AR),Cq=e=>KSe.has(e.toUpperCase()),_q=e=>QSe.has(e.toUpperCase()),ih=Dn.unionMany(c1,u1);function Ul(e,t){return t=t.toUpperCase(),AR.has(t)?8:qSe.has(e)?5:vq.has(e)?6:yq.has(e)?7:xq.has(e)?9:bx.has(t)?2:wR.has(t)?3:_R.has(t)?4:WSe.has(e)?Pd.has(t)?9:c1.has(t)?5:Sx.has(t)?6:Cx.has(t)?7:1:0}function wq(e,t){return t===5?GSe.has(e)?2:HSe.has(e)?3:jSe.has(e)?0:1:t===6?4:t===7?5:t===8?6:0}function TR(e){return e=e.toUpperCase(),c1.has(e)?"peptide linking":Sx.has(e)?"rna linking":Cx.has(e)?"dna linking":Pd.has(e)?"saccharide":"other"}function Aq(e){return{formula:"",formula_weight:0,id:e,name:e,mon_nstd_flag:ih.has(e)?"y":"n",pdbx_synonyms:[],type:TR(e)}}function Tq(e){return e=e.toUpperCase(),bx.has(e)?"water":ih.has(e)?"polymer":Pd.has(e)?"branched":"non-polymer"}function Pq(e,t){return e=e.toUpperCase(),hq.has(t)?"polypeptide(L)":fq.has(t)?"polypeptide(D)":vq.has(t)?"polyribonucleotide":yq.has(t)?"polydeoxyribonucleotide":xq.has(t)||Pd.has(e)?"oligosaccharide":AR.has(e)?"peptide nucleic acid":HA.has(e)?"polypeptide(L)":bq.has(e)?"polypeptide(D)":Sx.has(e)?"polyribonucleotide":Cx.has(e)?"polydeoxyribonucleotide":YSe.has(t)||wR.has(e)?"ion":XSe.has(t)||_R.has(e)?"lipid":gq.has(t)?"peptide-like":"other"}function Lg(e){return xi(e)||PR(e)}function xi(e){return e===7||e===6||e===8}function PR(e){return e===5}var pn;(function(e){e.is=gi.has,e.create=gi.create,e.SecondaryStructureMmcif={helx_lh_27_p:1058,helx_lh_3t_p:2082,helx_lh_al_p:4130,helx_lh_a_n:524321,helx_lh_b_n:1048609,helx_lh_ga_p:8226,helx_lh_n:33,helx_lh_om_p:16418,helx_lh_ot_n:131105,helx_lh_ot_p:546,helx_lh_p:34,helx_lh_pi_p:32802,helx_lh_pp_p:65570,helx_lh_z_n:262177,helx_n:1,helx_ot_n:1,helx_ot_p:2,helx_p:2,helx_rh_27_p:1090,helx_rh_3t_p:2114,helx_rh_al_p:4162,helx_rh_a_n:524353,helx_rh_b_n:1048641,helx_rh_ga_p:8258,helx_rh_n:65,helx_rh_om_p:16450,helx_rh_ot_n:131137,helx_rh_ot_p:578,helx_rh_p:66,helx_rh_pi_p:32834,helx_rh_pp_p:65602,helx_rh_z_n:262209,strn:4194308,turn_ot_p:33554448,turn_p:16,turn_ty1p_p:67109136,turn_ty1_p:67109008,turn_ty2p_p:134218e3,turn_ty2_p:134217872,turn_ty3p_p:268435728,turn_ty3_p:268435600,bend:8,other:0},e.SecondaryStructurePdb={1:4162,2:16450,3:32834,4:8258,5:2114,6:4130,7:16418,8:8226,9:1026,10:65538},e.SecondaryStructureStride={H:4098,G:2050,I:32770,E:8388612,B:4194308,T:16,C:536870912},e.SecondaryStructureDssp={H:4098,B:4194308,E:8388612,G:2050,I:32770,T:16,S:8}})(pn||(pn={}));var Er;(function(e){e.is=gi.has;function t(a){return gi.create(a)}e.create=t;function r(a){return(a&1)!==0}e.isCovalent=r;function n(a){return a===Math.pow(2,6)-1}e.isAll=n,e.Names={covalent:1,"metal-coordination":2,"hydrogen-bond":4,disulfide:8,aromatic:16,computed:32};function o(a){return a in e.Names}e.isName=o;function i(a){switch(a){case"covalent":return 1;case"metal-coordination":return 2;case"hydrogen-bond":return 4;case"disulfide":return 8;case"aromatic":return 16;case"computed":return 32}}e.fromName=i;function s(a){let l=0;for(let c=0,u=a.length;cthis.radiusSq&&(this.radiusSq=r)}radiusSphereStep(t,r){let n=e2e(t,this.center)+r,o=n*n;o>this.radiusSq&&(this.radiusSq=o)}getSphere(t){return t||(t=ge()),x.copy(t.center,this.center),t.radius=Math.sqrt(this.radiusSq),t}getCount(){return this.count}constructor(){this.count=0,this.center=x(),this.radiusSq=0}};(function(e){let t=new e,r=x(),n=x();function o({x:a,y:l,z:c},u){t.reset();let d=a.length;for(let m=0;m{s.forEach(a=>{r+=a.edgeCount,a.connectedIndices.forEach(l=>{a.getEdges(l).forEach(c=>{let{unitA:u,unitB:d}=a,m=e.getEdgeKey(l,u,c.indexB,d);o.set(m,n.length);let p=e.getVertexKey(l,u),h=i.get(p);h===void 0?i.set(p,[n.length]):h.push(n.length),n.push(te(k({},c),{indexA:l,unitA:u,unitB:d}))})})})}),this.edgeCount=r,this.edges=n,this.edgeKeyIndex=o,this.vertexKeyIndex=i}};(function(e){class t{hasEdges(a){return this.edgeMap.has(a)}getEdges(a){return this.edgeMap.has(a)?this.edgeMap.get(a):Iq}get areUnitsOrdered(){return this.unitA0?o:t<0?r:(r+n)/1.95}var i2e=IR.H;function Id(e){return e===i2e}var s2e=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 Dq(e,t,r){return[t,r]=tr&&([e,r]=[r,e],[t,n]=[n,t]),a2e.get(`${e}|${t}|${r}|${n}`)||1}var ah=re.Schema,se=ah.str,Le=ah.int,zr=ah.float,ER=ah.coord,Lt=ah.Aliased,Og=ah.Matrix,XA=ah.Vector,Zn=ah.lstr,d1=ah.List,jr={atom_site:{auth_asym_id:se,auth_atom_id:se,auth_comp_id:se,auth_seq_id:Le,B_iso_or_equiv:zr,Cartn_x:ER,Cartn_y:ER,Cartn_z:ER,group_PDB:Lt(se),id:Le,label_alt_id:se,label_asym_id:se,label_atom_id:se,label_comp_id:se,label_entity_id:se,label_seq_id:Le,occupancy:zr,type_symbol:se,pdbx_PDB_ins_code:se,pdbx_PDB_model_num:Le,pdbx_formal_charge:Le,pdbx_label_index:Le,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:Le},atom_site_anisotrop:{id:Le,type_symbol:se,U:Og(3,3),U_esd:Og(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:Le,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:Og(3,3),fract_transf_vector:XA(3)},audit_author:{name:se,pdbx_ordinal:Le,identifier_ORCID:se},audit_conform:{dict_location:se,dict_name:se,dict_version:se},cell:{angle_alpha:zr,angle_beta:zr,angle_gamma:zr,entry_id:se,length_a:zr,length_b:zr,length_c:zr,Z_PDB:Le,pdbx_unique_axis:se},chem_comp:{formula:se,formula_weight:zr,id:se,mon_nstd_flag:Lt(Zn),name:se,type:Lt(Zn),pdbx_synonyms:d1(";",e=>e)},chem_comp_bond:{atom_id_1:se,atom_id_2:se,comp_id:se,value_order:Lt(Zn),pdbx_ordinal:Le,pdbx_stereo_config:Lt(Zn),pdbx_aromatic_flag:Lt(Zn)},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:Le,pdbx_database_id_DOI:se,pdbx_database_id_PubMed:Le},citation_author:{citation_id:se,name:se,ordinal:Le},database_2:{database_id:Lt(Zn),database_code:se},entity:{details:se,formula_weight:zr,id:se,src_method:Lt(Zn),type:Lt(Zn),pdbx_description:d1(",",e=>e),pdbx_number_of_molecules:Le,pdbx_mutation:se,pdbx_fragment:se,pdbx_ec:d1(",",e=>e)},entity_poly:{entity_id:se,nstd_linkage:Lt(Zn),nstd_monomer:Lt(Zn),type:Lt(se),pdbx_strand_id:d1(",",e=>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:Lt(Zn),mon_id:se,num:Le},entry:{id:se},exptl:{entry_id:se,method:Lt(se)},software:{classification:se,date:se,description:se,name:se,type:Lt(Zn),version:se,pdbx_ordinal:Le},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:Lt(se)},struct_conf:{beg_label_asym_id:se,beg_label_comp_id:se,beg_label_seq_id:Le,beg_auth_asym_id:se,beg_auth_comp_id:se,beg_auth_seq_id:Le,conf_type_id:Lt(Zn),details:se,end_label_asym_id:se,end_label_comp_id:se,end_label_seq_id:Le,end_auth_asym_id:se,end_auth_comp_id:se,end_auth_seq_id:Le,id:se,pdbx_beg_PDB_ins_code:se,pdbx_end_PDB_ins_code:se,pdbx_PDB_helix_class:se,pdbx_PDB_helix_length:Le,pdbx_PDB_helix_id:se},struct_conn:{conn_type_id:Lt(Zn),details:se,id:se,ptnr1_label_asym_id:se,ptnr1_label_atom_id:se,ptnr1_label_comp_id:se,ptnr1_label_seq_id:Le,ptnr1_auth_asym_id:se,ptnr1_auth_comp_id:se,ptnr1_auth_seq_id:Le,ptnr1_symmetry:se,ptnr2_label_asym_id:se,ptnr2_label_atom_id:se,ptnr2_label_comp_id:se,ptnr2_label_seq_id:Le,ptnr2_auth_asym_id:se,ptnr2_auth_comp_id:se,ptnr2_auth_seq_id:Le,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:Le,pdbx_PDB_id:se,pdbx_dist_value:zr,pdbx_value_order:Lt(Zn)},struct_conn_type:{criteria:se,id:Lt(Zn),reference:se},struct_keywords:{entry_id:se,text:d1(",",e=>e),pdbx_keywords:se},struct_ncs_oper:{code:Lt(se),details:se,id:Le,matrix:Og(3,3),vector:XA(3)},struct_sheet_range:{beg_label_asym_id:se,beg_label_comp_id:se,beg_label_seq_id:Le,end_label_asym_id:se,end_label_comp_id:se,end_label_seq_id:Le,beg_auth_asym_id:se,beg_auth_comp_id:se,beg_auth_seq_id:Le,end_auth_asym_id:se,end_auth_comp_id:se,end_auth_seq_id:Le,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:Le,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:Le,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:Le},symmetry:{entry_id:se,cell_setting:Lt(Zn),Int_Tables_number:Le,space_group_name_Hall:se,"space_group_name_H-M":se},pdbx_database_status:{status_code:Lt(se),status_code_sf:Lt(se),status_code_mr:Lt(se),entry_id:se,recvd_initial_deposition_date:se,SG_entry:Lt(Zn),deposit_site:Lt(se),process_site:Lt(se),status_code_cs:Lt(se),methods_development_category:Lt(se),pdb_format_compatible:Lt(Zn)},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:Lt(se)},pdbx_entity_nonpoly:{entity_id:se,comp_id:se,name:se},pdbx_chem_comp_synonyms:{name:se,comp_id:se,provenance:Lt(se)},pdbx_chem_comp_identifier:{comp_id:se,identifier:se,type:Lt(se),program:se,program_version:se},pdbx_unobs_or_zero_occ_residues:{id:Le,polymer_flag:Lt(Zn),occupancy_flag:Lt(Le),PDB_model_num:Le,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:Le},pdbx_struct_mod_residue:{id:Le,auth_asym_id:se,auth_comp_id:se,auth_seq_id:Le,PDB_ins_code:se,label_asym_id:se,label_comp_id:se,label_seq_id:Le,parent_comp_id:se,details:se},pdbx_struct_oper_list:{id:se,type:Lt(se),name:se,symmetry_operation:se,matrix:Og(3,3),vector:XA(3)},pdbx_struct_assembly:{method_details:se,oligomeric_details:se,oligomeric_count:Le,details:se,id:se},pdbx_struct_assembly_gen:{asym_id_list:d1(",",e=>e),assembly_id:se,oper_expression:se},pdbx_reference_entity_list:{prd_id:se,ref_entity_id:se,type:Lt(Zn),details:se,component_id:Le},pdbx_reference_entity_link:{link_id:Le,prd_id:se,details:se,ref_entity_id_1:se,ref_entity_id_2:se,entity_seq_num_1:Le,entity_seq_num_2:Le,comp_id_1:se,comp_id_2:se,atom_id_1:se,atom_id_2:se,value_order:Lt(Zn),component_1:Le,component_2:Le,link_class:Lt(se)},pdbx_reference_entity_poly_link:{link_id:Le,prd_id:se,ref_entity_id:se,component_id:Le,entity_seq_num_1:Le,entity_seq_num_2:Le,comp_id_1:se,comp_id_2:se,atom_id_1:se,atom_id_2:se,value_order:Lt(Zn)},pdbx_molecule:{prd_id:se,instance_id:Le,asym_id:se},pdbx_molecule_features:{prd_id:se,class:Lt(Zn),type:Lt(Zn),name:se,details:se},entity_src_nat:{entity_id:se,pdbx_organism_scientific:se,pdbx_plasmid_name:se,pdbx_src_id:Le,pdbx_beg_seq_num:Le,pdbx_end_seq_num:Le},entity_src_gen:{entity_id:se,pdbx_gene_src_gene:d1(",",e=>e),pdbx_gene_src_scientific_name:se,plasmid_name:se,pdbx_src_id:Le,pdbx_beg_seq_num:Le,pdbx_end_seq_num:Le},pdbx_entity_src_syn:{organism_scientific:se,entity_id:se,pdbx_src_id:Le,pdbx_beg_seq_num:Le,pdbx_end_seq_num:Le},pdbx_entity_branch_descriptor:{entity_id:se,descriptor:se,type:Lt(Zn),program:se,program_version:se,ordinal:Le},pdbx_entity_instance_feature:{details:se,feature_type:Lt(se),auth_asym_id:se,asym_id:se,auth_seq_num:se,seq_num:Le,comp_id:se,auth_comp_id:se,ordinal:Le},pdbx_entity_branch_list:{entity_id:se,hetero:Lt(Zn),comp_id:se,num:Le},pdbx_entity_branch_link:{link_id:Le,details:se,entity_id:se,entity_branch_list_num_1:Le,entity_branch_list_num_2:Le,comp_id_1:se,comp_id_2:se,atom_id_1:se,leaving_atom_id_1:se,atom_stereo_config_1:Lt(Zn),atom_id_2:se,leaving_atom_id_2:se,atom_stereo_config_2:Lt(Zn),value_order:Lt(Zn)},pdbx_entity_branch:{entity_id:se,type:Lt(se)},pdbx_branch_scheme:{entity_id:se,hetero:Lt(Zn),asym_id:se,mon_id:se,num:Le,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:Lt(se),details:se},ihm_starting_model_details:{starting_model_id:se,entity_id:se,entity_description:se,asym_id:se,entity_poly_segment_id:Le,starting_model_source:Lt(se),starting_model_auth_asym_id:se,starting_model_sequence_offset:Le,dataset_list_id:Le},ihm_starting_comparative_models:{id:Le,starting_model_id:se,starting_model_auth_asym_id:se,starting_model_seq_id_begin:Le,starting_model_seq_id_end:Le,template_auth_asym_id:se,template_seq_id_begin:Le,template_seq_id_end:Le,template_sequence_identity:zr,template_sequence_identity_denominator:Lt(Le),template_dataset_list_id:Le,alignment_file_id:Le},ihm_starting_model_seq_dif:{id:Le,entity_id:se,asym_id:se,seq_id:Le,comp_id:se,starting_model_id:se,db_asym_id:se,db_seq_id:Le,db_comp_id:se,details:se},ihm_model_representation:{id:Le,name:se,details:se},ihm_model_representation_details:{id:Le,representation_id:Le,entity_poly_segment_id:Le,entity_id:se,entity_description:se,entity_asym_id:se,model_object_primitive:Lt(se),starting_model_id:se,model_mode:Lt(se),model_granularity:Lt(se),model_object_count:Le},ihm_struct_assembly_details:{id:Le,assembly_id:Le,parent_assembly_id:Le,entity_description:se,entity_id:se,asym_id:se,entity_poly_segment_id:Le},ihm_struct_assembly:{id:Le,name:se,description:se},ihm_modeling_protocol:{id:Le,num_steps:Le,protocol_name:se},ihm_modeling_protocol_details:{id:Le,protocol_id:Le,step_id:Le,struct_assembly_id:Le,dataset_group_id:Le,struct_assembly_description:se,step_name:se,step_method:se,num_models_begin:Le,num_models_end:Le,multi_scale_flag:Lt(Zn),multi_state_flag:Lt(Zn),ordered_flag:Lt(Zn),script_file_id:Le,software_id:Le},ihm_multi_state_modeling:{state_id:Le,state_group_id:Le,population_fraction:zr,population_fraction_sd:zr,state_type:se,state_name:se,experiment_type:Lt(se),details:se},ihm_modeling_post_process:{id:Le,protocol_id:Le,analysis_id:Le,step_id:Le,type:Lt(se),feature:Lt(se),num_models_begin:Le,num_models_end:Le},ihm_ensemble_info:{ensemble_id:Le,ensemble_name:se,post_process_id:Le,model_group_id:Le,ensemble_clustering_method:Lt(se),ensemble_clustering_feature:Lt(se),num_ensemble_models:Le,num_ensemble_models_deposited:Le,ensemble_precision_value:zr,ensemble_file_id:Le},ihm_model_list:{model_id:Le,model_name:se,assembly_id:Le,protocol_id:Le,representation_id:Le},ihm_model_group:{id:Le,name:se,details:se},ihm_model_group_link:{model_id:Le,group_id:Le},ihm_model_representative:{id:Le,model_group_id:Le,model_id:Le,selection_criteria:Lt(se)},ihm_dataset_list:{id:Le,data_type:Lt(se),database_hosted:Lt(Zn)},ihm_dataset_group:{id:Le,name:se,application:Lt(se),details:se},ihm_dataset_group_link:{dataset_list_id:Le,group_id:Le},ihm_related_datasets:{dataset_list_id_derived:Le,dataset_list_id_primary:Le},ihm_dataset_related_db_reference:{id:Le,dataset_list_id:Le,db_name:Lt(se),accession_code:se,version:se,details:se},ihm_external_reference_info:{reference_id:Le,reference_provider:se,reference_type:Lt(se),reference:se,refers_to:Lt(se),associated_url:se},ihm_external_files:{id:Le,reference_id:Le,file_path:se,content_type:Lt(se),file_size_bytes:zr,details:se},ihm_dataset_external_reference:{id:Le,dataset_list_id:Le,file_id:Le},ihm_localization_density_files:{id:Le,file_id:Le,ensemble_id:Le,entity_id:se,entity_poly_segment_id:Le,asym_id:se},ihm_predicted_contact_restraint:{id:Le,group_id:Le,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:Le,seq_id_2:Le,rep_atom_1:Lt(se),rep_atom_2:Lt(se),distance_lower_limit:zr,distance_upper_limit:zr,probability:zr,restraint_type:Lt(se),model_granularity:Lt(se),dataset_list_id:Le,software_id:Le},ihm_cross_link_list:{id:Le,group_id:Le,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:Le,seq_id_2:Le,linker_type:Lt(se),dataset_list_id:Le},ihm_cross_link_restraint:{id:Le,group_id:Le,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:Le,seq_id_2:Le,atom_id_1:se,atom_id_2:se,restraint_type:Lt(se),conditional_crosslink_flag:Lt(se),model_granularity:Lt(se),distance_threshold:zr,psi:zr,sigma_1:zr,sigma_2:zr},ihm_cross_link_result_parameters:{id:Le,restraint_id:Le,model_id:Le,psi:zr,sigma_1:zr,sigma_2:zr},ihm_2dem_class_average_restraint:{id:Le,dataset_list_id:Le,number_raw_micrographs:Le,pixel_size_width:zr,pixel_size_height:zr,image_resolution:zr,image_segment_flag:Lt(Zn),number_of_projections:Le,struct_assembly_id:Le,details:se},ihm_2dem_class_average_fitting:{id:Le,restraint_id:Le,model_id:Le,cross_correlation_coefficient:zr,rot_matrix:Og(3,3),tr_vector:XA(3)},ihm_3dem_restraint:{id:Le,dataset_list_id:Le,model_id:Le,struct_assembly_id:Le,fitting_method:se,number_of_gaussians:Le,cross_correlation_coefficient:zr},ihm_sas_restraint:{id:Le,dataset_list_id:Le,model_id:Le,struct_assembly_id:Le,profile_segment_flag:Lt(Zn),fitting_atom_type:se,fitting_method:se,fitting_state:Lt(se),radius_of_gyration:zr,chi_value:zr,details:se},ihm_starting_model_coord:{ordinal_id:Le,starting_model_id:se,group_PDB:Lt(se),id:Le,type_symbol:se,entity_id:se,atom_id:se,comp_id:se,seq_id:Le,asym_id:se,Cartn_x:zr,Cartn_y:zr,Cartn_z:zr,B_iso_or_equiv:zr},ihm_sphere_obj_site:{id:Le,entity_id:se,seq_id_begin:Le,seq_id_end:Le,asym_id:se,Cartn_x:zr,Cartn_y:zr,Cartn_z:zr,object_radius:zr,rmsf:zr,model_id:Le},ihm_gaussian_obj_site:{id:Le,entity_id:se,seq_id_begin:Le,seq_id_end:Le,asym_id:se,mean_Cartn_x:zr,mean_Cartn_y:zr,mean_Cartn_z:zr,weight:zr,covariance_matrix:Og(3,3),model_id:Le},ihm_gaussian_obj_ensemble:{id:Le,entity_id:se,seq_id_begin:Le,seq_id_end:Le,asym_id:se,mean_Cartn_x:zr,mean_Cartn_y:zr,mean_Cartn_z:zr,weight:zr,covariance_matrix:Og(3,3),ensemble_id:Le},ihm_feature_list:{feature_id:Le,feature_type:Lt(se),entity_type:Lt(se)},ihm_poly_residue_feature:{ordinal_id:Le,feature_id:Le,entity_id:se,asym_id:se,comp_id_begin:se,comp_id_end:se,seq_id_begin:Le,seq_id_end:Le},ihm_derived_distance_restraint:{id:Le,group_id:Le,feature_id_1:Le,feature_id_2:Le,group_conditionality:Lt(se),random_exclusion_fraction:zr,distance_upper_limit:zr,restraint_type:Lt(se),dataset_list_id:Le},ma_model_list:{ordinal_id:Le,model_id:Le,model_group_id:Le,model_name:se,model_group_name:se,model_type:Lt(se),data_id:Le},ma_target_entity:{entity_id:se,data_id:Le,origin:Lt(se)},ma_target_entity_instance:{asym_id:se,entity_id:se,details:se},ma_target_ref_db_details:{target_entity_id:se,db_name:Lt(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:Le,content_type:Lt(se),content_type_other_details:se,name:se},ma_software_group:{ordinal_id:Le,group_id:Le,software_id:Le},ma_qa_metric:{id:Le,name:se,type:Lt(se),mode:Lt(se),software_group_id:Le},ma_qa_metric_global:{ordinal_id:Le,model_id:Le,metric_id:Le,metric_value:zr},ma_qa_metric_local:{ordinal_id:Le,model_id:Le,label_asym_id:se,label_seq_id:Le,label_comp_id:se,metric_id:Le,metric_value:zr}};var kq="0.3.0",xn;(function(e){let t;(function(i){i[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"})(t=e.IntDataType||(e.IntDataType={}));let r;(function(i){i[i.Float32=32]="Float32",i[i.Float64=33]="Float64"})(r=e.FloatDataType||(e.FloatDataType={}));function n(i){let s;return i instanceof Int8Array?s=e.IntDataType.Int8:i instanceof Int16Array?s=e.IntDataType.Int16:i instanceof Int32Array?s=e.IntDataType.Int32:i instanceof Uint8Array?s=e.IntDataType.Uint8:i instanceof Uint16Array?s=e.IntDataType.Uint16:i instanceof Uint32Array?s=e.IntDataType.Uint32:i instanceof Float32Array?s=e.FloatDataType.Float32:i instanceof Float64Array?s=e.FloatDataType.Float64:s=e.IntDataType.Int32,s}e.getDataType=n;function o(i){if(i instanceof Int8Array||i instanceof Int16Array||i instanceof Int32Array)return!0;for(let s=0,a=i.length;sDR){let t=[];for(let r=0;r=0;r--)t=l2e(t,e.encoding[r]);return t}function l2e(e,t){switch(t.kind){case"ByteArray":switch(t.type){case xn.IntDataType.Uint8:return e;case xn.IntDataType.Int8:return c2e(e);case xn.IntDataType.Int16:return u2e(e);case xn.IntDataType.Uint16:return d2e(e);case xn.IntDataType.Int32:return m2e(e);case xn.IntDataType.Uint32:return p2e(e);case xn.FloatDataType.Float32:return f2e(e);case xn.FloatDataType.Float64:return h2e(e);default:_r(t.type)}case"FixedPoint":return g2e(e,t);case"IntervalQuantization":return y2e(e,t);case"RunLength":return v2e(e,t);case"Delta":return x2e(e,t);case"IntegerPacking":return C2e(e,t);case"StringArray":return _2e(e,t)}}function Lq(e,t){switch(e){case xn.IntDataType.Int8:return new Int8Array(t);case xn.IntDataType.Int16:return new Int16Array(t);case xn.IntDataType.Int32:return new Int32Array(t);case xn.IntDataType.Uint8:return new Uint8Array(t);case xn.IntDataType.Uint16:return new Uint16Array(t);case xn.IntDataType.Uint32:return new Uint32Array(t);default:return new Int32Array(t)}}function Fq(e,t){switch(e){case xn.FloatDataType.Float32:return new Float32Array(t);case xn.FloatDataType.Float64:return new Float64Array(t);default:return new Float64Array(t)}}function c2e(e){return new Int8Array(e.buffer,e.byteOffset)}function Ax(e,t,r){return Mq?new r(e.buffer):new r(Bq(e,t))}function u2e(e){return Ax(e,2,Int16Array)}function d2e(e){return Ax(e,2,Uint16Array)}function m2e(e){return Ax(e,4,Int32Array)}function p2e(e){return Ax(e,4,Uint32Array)}function f2e(e){return Ax(e,4,Float32Array)}function h2e(e){return Ax(e,8,Float64Array)}function g2e(e,t){let r=e.length,n=Fq(t.srcType,r),o=1/t.factor;for(let i=0;i=0){let l=w2e(e[i],t,r);l<0?n=-1:l>n&&(n=l)}let a=Math.abs(e[i]);if(a>r){let l=Math.floor(Math.log10(Math.abs(a)))+1;l>o&&(o=l)}}return{mantissaDigits:n,integerDigits:o}}function Uq(e){e=e.trim();let t=parseInt(e,10);return isNaN(t)?!1:t.toString()===e}function mC(e){if(!isFinite(e))return 0;let t=1,r=0;for(;Math.round(e*t)/t!==e;)t*=10,++r;return r}function pC(e,t){return parseFloat(e.toPrecision(t))}function hC(e){return fC.classify(e)}function zq(e){return kR.classify(e)}var fC;(function(e){function t(p,h){return p>=0?Math.ceil((p+1)/h):Math.ceil((p+1)/(-h-1))}function r(p){let h=!1;for(let f=0,y=p.length;fy.length-g.length),f}e.getSize=d;function m(p){if(p.length<2)return Xr.by(Xr.byteArray);let f=d(p)[0];switch(f.kind){case"pack":return Xr.by(Xr.integerPacking);case"rle":return Xr.by(Xr.runLength).and(Xr.integerPacking);case"delta":return Xr.by(Xr.delta).and(Xr.integerPacking);case"delta-rle":return Xr.by(Xr.delta).and(Xr.runLength).and(Xr.integerPacking);default:_r(f)}}e.classify=m})(fC||(fC={}));var kR;(function(e){function r(o){let{mantissaDigits:s,integerDigits:a}=Nq(o,4,1e-6);if(s<0||s+a>10)return Xr.by(Xr.byteArray);if(s===0)return fC.classify(o);let l=n(s),c=new Int32Array(o.length);for(let p=0,h=o.length;pa(_,S)}e.fixedPoint=l;function c(S,_,w,E,A){let P=xn.getDataType(S);if(!S.length)return{encodings:[{kind:"IntervalQuantization",min:_,max:w,numSteps:E,srcType:P}],data:new Int32Array(0)};if(w<_){let D=_;_=w,w=D}let T=(w-_)/(E-1),B=new A(S.length);for(let D=0,M=S.length;D=w?B[D]=E-1:B[D]=Math.round((R-_)/T)|0}return{encodings:[{kind:"IntervalQuantization",min:_,max:w,numSteps:E,srcType:P}],data:B}}function u(S,_,w,E=Int32Array){return A=>c(A,S,_,w,E)}e.intervalQuantizaiton=u;function d(S){let _=xn.getDataType(S);if(_===void 0&&(S=new Int32Array(S),_=xn.IntDataType.Int32),!S.length)return{encodings:[{kind:"RunLength",srcType:_,srcSize:0}],data:new Int32Array(0)};let w=2;for(let T=1,B=S.length;T=0?E+=T/_|0:E+=T/w|0}return E+=S.length,E}function y(S){let _=p(S),w=_?f(S,127):h(S,255),E=_?f(S,32767):h(S,65535);return S.length*4=0)for(;M>=w;)P[T]=w,++T,M-=w;else for(;M<=E;)P[T]=E,++T,M-=E;P[T]=M,++T}let B=s(P);return{encodings:[{kind:"IntegerPacking",byteCount:_.bytesPerElement,isUnsigned:!_.isSigned,srcSize:A},B.encodings[0]],data:B.data}}function v(S){let _=y(S);return _.bytesPerElement===4?s(S):g(S,_)}e.integerPacking=v;function b(S){let _=Object.create(null),w=[],E=new Int32Array(S.length),A=je.create(Int32Array,1,Math.min(1024,S.length<32?S.length+1:Math.round(S.length/8)+1));je.add(A,0);let P=0,T=0;for(let F of S){if(F==null){E[T++]=-1;continue}let N=_[F];N===void 0&&(P+=F.length,N=w.length,w[N]=F,_[F]=N,je.add(A,P)),E[T++]=N}let B=je.compact(A),M=hC(B).encode(B),U=hC(E).encode(E);return{encodings:[{kind:"StringArray",dataEncoding:U.encoding,stringData:w.join(""),offsetEncoding:M.encoding,offsets:M.data}],data:U.data}}e.stringArray=b})(Xr||(Xr={}));var QA;(function(e){function t(a,l,c){return{name:a,type:0,value:l,valueKind:c&&c.valueKind,defaultFormat:c&&c.encoder?{encoder:c.encoder}:void 0,shouldInclude:c&&c.shouldInclude}}e.str=t;function r(a,l,c){return{name:a,type:1,value:l,valueKind:c&&c.valueKind,defaultFormat:c?{encoder:c.encoder,typedArray:c.typedArray}:void 0,shouldInclude:c&&c.shouldInclude}}e.int=r;function n(a,l,c){return{name:a,type:2,value:l,valueKind:c&&c.valueKind,defaultFormat:c?{encoder:c.encoder,typedArray:c.typedArray,digitCount:typeof c.digitCount<"u"?c.digitCount:void 0}:void 0,shouldInclude:c&&c.shouldInclude}}e.float=n;function o(a){return r(a,(l,c,u)=>u+1,{typedArray:Int32Array,encoder:Xr.by(Xr.delta).and(Xr.runLength).and(Xr.integerPacking)})}e.index=o;class i{constructor(){this.fields=[]}index(l){return this.fields.push(e.index(l)),this}str(l,c,u){return this.fields.push(e.str(l,c,u)),this}int(l,c,u){return this.fields.push(e.int(l,c,u)),this}vec(l,c,u){for(let d=0;dc.split(".")[0]);return{includeCategory(c){return i.includes(c)?!1:o.length<=0||o.indexOf(c)!==-1},includeField(c,u){let d=c+"."+u;return a.includes(d)?!1:!l.includes(c)||s.includes(d)}}}e.filterOf=t,e.DefaultFilter={includeCategory(n){return!0},includeField(n,o){return!0}},e.DefaultFormatter={getFormat(n,o){}};function r(n,o){return o?{fields:Vq(n._schema),source:[{data:n,rowCount:o.length,keys:()=>Dg.Array(o)}]}:{fields:Vq(n._schema),source:[{data:n,rowCount:n._rowCount}]}}e.ofTable=r})(zl||(zl={}));var ZA;(function(e){function t(n,o,i){n.startDataBlock(o);for(let s of i._tableNames)n.writeCategory({name:s,instance:()=>zl.ofTable(i[s])})}e.writeDatabase=t;function r(n,o){for(let i of Object.keys(o))t(n,i,o[i])}e.writeDatabaseCollection=r})(ZA||(ZA={}));function MR(e){return(t,r)=>r[e].value(t)}function A2e(e){return(t,r)=>r[e].value(t).join(r[e].schema.separator)}function BR(e,...t){return(r,n)=>n[e].schema.space.get(n[e].value(r),...t)}function gC(e){return(t,r)=>r[e].valueKind(t)}function T2e(e,t){let r=[],o=gC(e);if(t.rank===1){let i=t.dimensions[0];for(let s=0;s 3 or rank 0 are currently not supported.");return r}function Vq(e){let t=[];for(let r of Object.keys(e)){let n=e[r];n.valueType==="int"?t.push({name:r,type:1,value:MR(r),valueKind:gC(r)}):n.valueType==="float"?t.push({name:r,type:2,value:MR(r),valueKind:gC(r)}):n.valueType==="str"?t.push({name:r,type:0,value:MR(r),valueKind:gC(r)}):n.valueType==="list"?t.push({name:r,type:0,value:A2e(r),valueKind:gC(r)}):n.valueType==="tensor"?t.push(...T2e(r,n.space)):_r(n.valueType)}return t}function Gq(e){return e.defaultFormat&&typeof e.defaultFormat.digitCount<"u"?Math.max(0,Math.min(e.defaultFormat.digitCount,16)):6}function yC(e){return e.fields.some(t=>!!t.shouldInclude)?e.fields.filter(t=>!t.shouldInclude||e.source.some(r=>t.shouldInclude(r.data))):e.fields}function $A(e,t){let r=e.instance(t),n=r.source.filter(s=>s.rowCount>0);if(!n.length)return{instance:r,rowCount:0,source:[]};let o=n.reduce((s,a)=>s+a.rowCount,0),i=n.map(s=>({data:s.data,keys:()=>s.keys?s.keys():Dg.Range(0,s.rowCount-1),rowCount:s.rowCount}));return{instance:r,rowCount:o,source:i}}var eT=class{constructor(){this.builder=yn.create(),this.encoded=!1,this.dataBlockCreated=!1,this.filter=zl.DefaultFilter,this.formatter=zl.DefaultFormatter,this.isBinary=!1,this.binaryEncodingProvider=void 0}setFilter(t){this.filter=t||zl.DefaultFilter}isCategoryIncluded(t){return this.filter.includeCategory(t)}setFormatter(t){this.formatter=t||zl.DefaultFormatter}startDataBlock(t){this.dataBlockCreated=!0,yn.write(this.builder,`data_${(t||"").replace(/[ \n\t]/g,"").toUpperCase()} +# +`)}writeCategory(t,r,n){if(this.encoded)throw new Error("The writer contents have already been encoded, no more writing.");if(!this.dataBlockCreated)throw new Error("No data block created.");if(!n?.ignoreFilter&&!this.filter.includeCategory(t.name))return;let{instance:o,rowCount:i,source:s}=$A(t,r);i&&(i===1?I2e(t,o,s,this.builder,this.filter,this.formatter):E2e(t,o,s,this.builder,this.filter,this.formatter))}encode(){this.encoded=!0}writeTo(t){let r=yn.getChunks(this.builder);for(let n=0,o=r.length;no.includeField(e.name,h.name)?Math.max(p,h.name.length):0,0);if(c===0)return;c+=e.name.length+6;let d=a.keys().move(),m=qq(e.name,t.fields,i);for(let p=0;po.includeField(e.name,d.name)),l=a.length;if(l===0)return;let c=qq(e.name,a,i);Hq(n,"loop_");for(let d=0;d=0}function Hq(e,t){yn.write(e,t),yn.newline(e)}function k2e(e,t){yn.writeInteger(e,t),yn.whitespace1(e)}function M2e(e,t,r){yn.writeFloat(e,t,r),yn.whitespace1(e)}function B2e(e){yn.writeSafe(e,". ")}function R2e(e){yn.writeSafe(e,"? ")}function L2e(e,t){if(!t)return yn.writeSafe(e,". "),!1;let r=t.charCodeAt(0),n=!1,o=0,i=!1,s=!1;for(let a=0,l=t.length-1;a<=l;a++)switch(t.charCodeAt(a)){case 9:n=!0;break;case 10:return JA(e,t),!0;case 32:n=!0;break;case 34:if(a&&a===l)break;if(i)return JA(e,t),!0;s=!0,n=!0,o=0;break;case 39:if(a&&a===l)break;if(s)return JA(e,t),!0;i=!0,n=!0,o=1;break}return!n&&(r===35||r===36||r===59||r===91||r===93||r===95)&&(n=!0),n?(yn.writeSafe(e,o?'"':"'"),yn.writeSafe(e,t),yn.writeSafe(e,o?'" ':"' ")):(yn.writeSafe(e,t),yn.writeSafe(e," ")),!1}function JA(e,t){yn.writeSafe(e,` +;`+t),yn.writeSafe(e,` +; +`)}function Ng(e,t,r){for(let n=0,o=r.length;n>>0&127|0;continue}if(i<2048){e[t++]=i>>>6&31|192,e[t++]=i>>>0&63|128;continue}if(i<65536){e[t++]=i>>>12&15|224,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128;continue}if(i<1114112){e[t++]=i>>>18&7|240,e[t++]=i>>>12&63|128,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128;continue}throw new Error("bad codepoint "+i)}}var F2e=function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();function Yq(e){throw new Error(e)}function O2e(e,t,r){let n=F2e,o,i=0,s=[],a=512;for(let l=t,c=t+r;l0&&(o[o.length]=s.slice(0,i).join("")),o.join("")):s.slice(0,i).join("")}var Wq=typeof TextDecoder<"u"?new TextDecoder:void 0;function Tx(e,t,r){if(Wq){let n=t||r!==e.length?e.subarray(t,t+r):e;return Wq.decode(n)}else return O2e(e,t,r)}function Px(e){let t=0;for(let 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(t==="boolean"||e===null||e===void 0)return 1;if(t==="object"){let r,n=0;if(Array.isArray(e)){r=e.length;for(let 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(e==null)return t.setUint8(n,192),1;if(o==="boolean")return t.setUint8(n,e?195:194),1;if(o==="object"){let i,s=0,a=Array.isArray(e),l;if(a?i=e.length:(l=Object.keys(e),i=l.length),i<16?(t.setUint8(n,i|(a?144:128)),s=1):i<65536?(t.setUint8(n,a?220:222),t.setUint16(n+1,i),s=3):i<4294967296&&(t.setUint8(n,a?221:223),t.setUint32(n+1,i),s=5),a)for(let c=0;co.properties.chemicalComponentMap.has(i.comp_id.value(s)))}e.chemCompBondFromTable=t;function r(o){let i=new Map;function s(f){if(i.has(f))return i.get(f);let y=new n(f);return i.set(f,y),y}let{comp_id:a,atom_id_1:l,atom_id_2:c,value_order:u,pdbx_aromatic_flag:d,_rowCount:m,pdbx_ordinal:p}=o,h=s(a.value(0));for(let f=0;f.95}e.isExhaustive=t;function r({units:i},s){for(let a=0,l=i.length;a=0)return!0;return!1}function n(i){let s=new Map;for(let a of i){let{partnerA:{atomIndex:l},partnerB:{atomIndex:c}}=a;s.has(l)?s.get(l).push(a):s.set(l,[a]),s.has(c)?s.get(c).push(a):s.set(c,[a])}return s}e.getAtomIndexFromEntries=n;function o(i,s){let{conn_type_id:a,pdbx_dist_value:l,pdbx_value_order:c}=i,u={label_asym_id:i.ptnr1_label_asym_id,label_seq_id:i.ptnr1_label_seq_id,auth_seq_id:i.ptnr1_auth_seq_id,label_atom_id:i.ptnr1_label_atom_id,label_alt_id:i.pdbx_ptnr1_label_alt_id,ins_code:i.pdbx_ptnr1_PDB_ins_code,symmetry:i.ptnr1_symmetry},d={label_asym_id:i.ptnr2_label_asym_id,label_seq_id:i.ptnr2_label_seq_id,auth_seq_id:i.ptnr2_auth_seq_id,label_atom_id:i.ptnr2_label_atom_id,label_alt_id:i.pdbx_ptnr2_label_alt_id,ins_code:i.pdbx_ptnr2_PDB_ins_code,symmetry:i.ptnr2_symmetry},m=Array.from(s.entities.data.id.toArray()),p=(f,y)=>{if(y.label_asym_id.valueKind(f)!==0)return;let g=y.label_asym_id.value(f),v=y.label_atom_id.value(f);if(!v)return;let b=y.auth_seq_id.valueKind(f)===re.ValueKind.Present?y.auth_seq_id.value(f):y.label_seq_id.value(f),S=y.ins_code.value(f),_=y.label_alt_id.value(f);for(let w of m){let E=s.atomicHierarchy.index.findResidue(w,g,b,S);if(E<0)continue;let A=s.atomicHierarchy.index.findAtomOnResidue(E,v,_);if(!(A<0))return{residueIndex:E,atomIndex:A,symmetry:y.symmetry.value(f)}}},h=[];for(let f=0;f=M)continue;let R=Fe.indexOf(e.elements,M);if(R<0)continue;let U=m[B],F=p[B];if(U>=0&&U!==_||F>=0&&F!==_)continue;let N=Kc(n.value(M)),z=c[B],q=q2e(e,E,M),O=!1;if(z>=0)O=jn(q,z,.3);else if(i>=0)O=q1&&(R=!1)}}}return Zq(_,w,A,E,P,s,{canRemap:D||M&&R})}function $q(e,t){let r=k(k({},WA),t);return r.noCompute||Ut.isCoarseGrained(e.model)&&!yi.Provider.get(e.model)&&!bl.isExhaustive(e.model)?qA.Empty:!r.forceCompute&&yi.Provider.get(e.model)?Y2e(e):X2e(e,r)}var K2e=x.distance,Q2e=x.set,Z2e=x.squaredDistance,$2e=x.transformMat4,Jq=x(),eW=x();function tW(e,t,r,n){return e.conformation.position(t,Jq),r.conformation.position(n,eW),K2e(Jq,eW)}var J2e=ne(),m1=x();function eCe(e,t,r,n){let{maxRadius:o}=r,{elements:i,residueIndex:s}=e,{x:a,y:l,z:c}=e.model.atomicConformation,{elements:u,residueIndex:d}=t,m=e.elements.length,{type_symbol:p,label_alt_id:h,label_atom_id:f,label_comp_id:y}=e.model.atomicHierarchy.atoms,{type_symbol:g,label_alt_id:v,label_atom_id:b,label_comp_id:S}=t.model.atomicHierarchy.atoms,{auth_seq_id:_}=e.model.atomicHierarchy.residues,{auth_seq_id:w}=t.model.atomicHierarchy.residues,{occupancy:E}=e.model.atomicConformation,{occupancy:A}=t.model.atomicConformation,P=E.isDefined&&A.isDefined,T=e.model===t.model&&bl.Provider.get(e.model),B=!r.forceCompute&&e.model===t.model&&yi.Provider.get(e.model),{atomSourceIndex:D}=e.model.atomicHierarchy,{invertedIndex:M}=B?Ut.getInvertedAtomSourceIndex(t.model):{invertedIndex:void 0},R=e.model===t.model&&bl.isExhaustive(e.model),U=ne.mul(J2e,t.conformation.operator.inverse,e.conformation.operator.matrix),F=!ne.isIdentity(U),{center:N,radius:z}=t.boundary.sphere,q=(z+o)*(z+o);n.startUnitPair(e.id,t.id);let O=e.conformation.operator.key,J=t.conformation.operator.key;for(let Q=0;Qq)continue;if(!r.forceCompute&&B){let{maxDistance:j}=B,{offset:ue,b:fe,edgeProps:{order:De,distance:Re,flag:Xe,key:L,operatorA:ee,operatorB:xe}}=B.bonds,pe=D.value(H),be=Kc(p.value(H));for(let ke=ue[pe],Ve=ue[pe+1];ke=0&&nt>=0&&(Ue===nt||Ue!==O||nt!==J))continue;let ut=Kc(p.value(Ke)),St=Re[ke],mt=tW(e,H,t,Ke),Pt=!1;if(St>=0)Pt=jn(mt,St,.3);else if(j>=0)Pt=mto||(n.add(Q,Xe,{order:ue.order,flag:ue.flags,key:ue.rowIndex}),j=!0)}if(j)continue}if(R)continue;let K=E.value(H),{lookup3d:ce}=t,{indices:V,count:G,squaredDistances:X}=ce.find(m1[0],m1[1],m1[2],o);if(G===0)continue;let Z=Kc(p.value(H)),ie=Id(Z),de=Hp(Z),we=h.value(H),Be=Fg.has(Z),Ie=f.value(H),le=y.value(s[H]);for(let j=0;jyi.Provider.get(i)),o=e.models.some(i=>bl.isExhaustive(i));return t.noCompute||e.isCoarseGrained&&!n&&!o?new sh(r.getMap()):(Me.eachUnitPair(e,(i,s)=>{eCe(i,s,t,r)},{maxRadius:t.maxRadius,validUnit:i=>t.validUnit(i),validUnitPair:(i,s)=>t.validUnitPair(e,i,s)}),new sh(r.getMap()))}function rW(e,t){let r=k(k({},tCe),t);return rCe(e,te(k({},r),{validUnit:t&&t.validUnit||(n=>_e.isAtomic(n)),validUnitPair:t&&t.validUnitPair||((n,o,i)=>{if(!Me.validUnitPair(n,o,i))return!1;let a=o.model.atomicHierarchy.derived.residue.moleculeType,l=i.model.atomicHierarchy.derived.residue.moleculeType,c=(!_e.isAtomic(o)||a[o.residueIndex[o.elements[0]]]!==2)&&(!_e.isAtomic(i)||l[i.residueIndex[i.elements[0]]]!==2),u=!_e.isAtomic(o)||a[o.residueIndex[o.elements[0]]]!==3,d=!_e.isAtomic(i)||l[i.residueIndex[i.elements[0]]]!==3,m=u&&d;return(c||!r.ignoreWater)&&(m||!r.ignoreIon)?!0:nCe(o,i)})}))}function nCe(e,t){if(e.model!==t.model||!_e.isAtomic(e)||!_e.isAtomic(t))return!1;let r=bl.Provider.get(e.model);if(!r)return!1;let n=e.elements.length=t.elements.length?e:t,{elements:i}=n,{elements:s}=o,{indexOf:a}=Fe;for(let l=0,c=i.length;l=0)return!0}}return!1}var yt;(function(e){function t(y,g,v,b,S,_){return{kind:"bond-location",aStructure:y,aUnit:g,aIndex:v,bStructure:b,bUnit:S,bIndex:_}}e.Location=t;function r(y){return!!y&&y.kind==="bond-location"}e.isLocation=r;function n(y,g){return y.aStructure.label===g.aStructure.label&&y.bStructure.label===g.bStructure.label&&y.aIndex===g.aIndex&&y.bIndex===g.bIndex&&y.aUnit.id===g.aUnit.id&&y.bUnit.id===g.bUnit.id}e.areLocationsEqual=n;function o(y,g){return{kind:"bond-loci",structure:y,bonds:g}}e.Loci=o;function i(y){return!!y&&y.kind==="bond-loci"}e.isLoci=i;function s(y,g){if(y.structure!==g.structure||y.bonds.length!==g.bonds.length)return!1;for(let v=0,b=y.bonds.length;v{let S=g.unitMap.get(b.aUnit.id);if(!S)return;let _=g.unitMap.get(b.bUnit.id);if(!_)return;let w=b.aUnit.elements[b.aIndex],E=Fe.indexOf(S.elements,w);if(E===-1)return;let A=b.bUnit.elements[b.bIndex],P=Fe.indexOf(_.elements,A);P!==-1&&v.push(t(y.structure,S,E,y.structure,_,P))}),o(g,v)}e.remapLoci=l;function c(y){let g=[],v=new Map;for(let b of y.bonds){let{aIndex:S,aUnit:_,bIndex:w,bUnit:E}=b;_===E?v.has(_.id)?v.get(_.id).push(S,w):v.set(_.id,[S,w]):(v.has(_.id)?v.get(_.id).push(S):v.set(_.id,[S]),v.has(E.id)?v.get(E.id).push(w):v.set(E.id,[w]))}return v.forEach((b,S)=>{g.push({unit:y.structure.unitMap.get(S),indices:Fe.deduplicate(Fe.ofUnsortedArray(b))})}),$.Loci(y.structure,g)}e.toStructureElementLoci=c;function u(y){let{aUnit:g,aIndex:v}=y.bonds[0];return $.Loci(y.structure,[{unit:g,indices:Te.ofSingleton(v)}])}e.toFirstStructureElementLoci=u;function d(y,g){if(g.aUnit===g.bUnit){let v=g.aUnit.bonds,b=v.getEdgeIndex(g.aIndex,g.bIndex);return b<0?Er.create(0):Er.create(v.edgeProps.flags[b])}else{let v=y.interUnitBonds.getBondFromLocation(g);return v?Er.create(v.props.flag):Er.create(0)}}e.getType=d;function m(y,g){if(g.aUnit===g.bUnit){let v=g.aUnit.bonds,b=v.getEdgeIndex(g.aIndex,g.bIndex);return b<0?0:v.edgeProps.order[b]}else{let v=y.interUnitBonds.getBondFromLocation(g);return v?v.props.order:0}}e.getOrder=m;function p(y){let g=0;for(let v=0,b=y.units.length;v{let{aUnit:_,aIndex:w,bUnit:E,bIndex:A}=y.bonds[v];_.conformation.position(_.elements[w],b),E.conformation.position(E.elements[A],S)},g)}e.getBoundingSphere=f})(yt||(yt={}));function cW(e){let t=iCe(e),r=oCe(e,t),n=Bt.transientSegments(e.model.atomicHierarchy.residueAtomSegments,e.elements);for(;n.hasNext;){let o=n.move();sCe(r,o.start,o.end)}return r.rings}function oCe(e,t){return{startVertex:0,endVertex:0,count:0,isRingAtom:new Int32Array(t),marked:new Int32Array(t),queue:new Int32Array(t),pred:new Int32Array(t),depth:new Int32Array(t),left:new Int32Array(5),right:new Int32Array(5),color:new Int32Array(t),currentColor:0,currentAltLoc:"",hasAltLoc:!1,rings:[],currentRings:[],unit:e,bonds:e.bonds,altLoc:e.model.atomicHierarchy.atoms.label_alt_id}}function nW(e){e.count=e.endVertex-e.startVertex;let{isRingAtom:t,pred:r,color:n,depth:o,marked:i}=e;for(let s=0;s=0;g--)f[y++]=e.startVertex+a[g],n[a[g]]=1;$s(f);for(let g=0,v=e.currentRings.length;gb.length&&Fe.isSubset(f,b))return!1}return e.currentRings.push(Fe.ofSortedArray(f)),!0}function sW(e,t,r){let{bonds:n,startVertex:o,endVertex:i,isRingAtom:s,marked:a,queue:l,pred:c,depth:u}=e,{elements:d}=e.unit,{b:m,edgeProps:{flags:p},offset:h}=n;a[t]=r,u[t]=0,l[0]=t;let f=0,y=1;for(;f=i||!Er.isCovalent(p[w]))continue;if(e.hasAltLoc){let T=e.altLoc.value(d[E]);if(T&&e.currentAltLoc!==T)continue}let A=E-o;if(a[A]===r){if(c[A]!==g&&c[g]!==A&&aCe(e,g,A,s))return r+1;continue}let P=Math.min(u[A],v+1);P>5||(u[A]=P,a[A]=r,l[y++]=A,c[A]=g)}}return r+1}function uW(e){let t=e.length,r=new Array(t);for(let s=0;s=g||o.addEdge(l,g)}}}let i=ls.connectedComponents(o.getGraph()),s=i.componentIndex,a=[];for(let l=0;l0)return!1;let g=Fa.calculateMomentsAxes(oT(a,l));return x.magnitude(g.dirC)=0&&(r.has(a)?r.get(a).push(s):r.set(a,[s]))}}function pCe(e,t){let r=[];for(let n=0,o=t.length;nTe.max(_)||i(S)this.maxDist[t]&&(this.maxDist[t]=n,SW(this.extrema[t*2+1],r))}computeSphereExtrema(t,r,n){let o=this.dir[t],i=bW(o,r);i-nthis.maxDist[t]&&(this.maxDist[t]=i+n,gCe(this.extrema[t*2+1],r,o,n))}includeSphere(t){if(ge.hasExtrema(t)&&t.extrema.length>1)for(let r of t.extrema)this.includePosition(r);else this.includePositionRadius(t.center,t.radius)}includePosition(t){for(let r=0;r1)for(let r of t.extrema)this.radiusPosition(r);else this.radiusPositionRadius(t.center,t.radius)}radiusPosition(t){this.centroidHelper.radiusStep(t)}radiusPositionRadius(t,r){this.centroidHelper.radiusSphereStep(t,r)}getSphere(t){return ge.setExtrema(this.centroidHelper.getSphere(t),this.extrema.slice())}getBox(t){return ft.fromVec3Array(t||ft(),this.extrema)}reset(){for(let t=0;t{let n=x.create(r[0],r[1],r[2]);return x.normalize(n,n)})}var iT=[[1,0,0],[0,1,0],[0,0,1]],LR=[[1,1,1],[-1,1,1],[-1,-1,1],[1,-1,1]],CW=[[1,1,0],[1,-1,0],[1,0,1],[1,0,-1],[0,1,1],[0,1,-1]],vCe=[[0,1,2],[0,2,1],[1,0,2],[2,0,1],[1,2,0],[2,1,0],[0,1,-2],[0,2,-1],[1,0,-2],[2,0,-1],[1,-2,0],[2,-1,0]],xCe=[[1,1,2],[2,1,1],[1,2,1],[1,-1,2],[1,1,-2],[1,-1,-2],[2,-1,1],[2,1,-1],[2,-1,-1],[1,-2,1],[1,2,-1],[1,-2,-1]],bCe=[[2,2,1],[1,2,2],[2,1,2],[2,-2,1],[2,2,-1],[2,-2,-1],[1,-2,2],[1,2,-2],[1,-2,-2],[2,-1,2],[2,1,-2],[2,-1,-2]];var _W=x.set,SCe=new ki("14"),CCe=new ki("98");function _Ce(e){return e>1e4?SCe:CCe}function aT(e){let t=ft.computeBounding(e);return{box:t,sphere:ge.fromBox3D(ge(),t)}}var sT=x();function Zc(e){let{x:t,y:r,z:n,radius:o,indices:i}=e,s=Te.size(i);if(s>25e4)return aT(e);let a=_Ce(s);a.reset();for(let c=0;ca.id.toLowerCase()===i):void 0}e.findAssembly=t;function r(n){let{cell:o,name:i,num:s}=n.spacegroup,{size:a,anglesInRadians:l}=o,c=a[0].toFixed(2),u=a[1].toFixed(2),d=a[2].toFixed(2),m=Fs(l[0]).toFixed(2),p=Fs(l[1]).toFixed(2),h=Fs(l[2]).toFixed(2),f=[];return f.push(`Unit Cell ${i} #${s}`),f.push(`${c}\xD7${u}\xD7${d} \u212B`),f.push(`\u03B1=${m}\xB0 \u03B2=${p}\xB0 \u03B3=${h}\xB0`),f.join(" | ")}e.getUnitcellLabel=r})(ch||(ch={}));function wW(e,t,r){if(!e._rowCount)return[];let n=TCe(r),o=[];for(let i=0;i{let r=[],n=0;for(let o=0;oNe.unit.operator_name(u.element),Vn.DefaultName),bn.pred.inSet(u=>Ne.chain.label_asym_id(u.element),i.asymIds))});r[r.length]={selector:c,operators:l,asymIds:i.asymIds},n+=l.length}return r}}function TCe(e){let{id:t,matrix:r,vector:n,_schema:o}=e,i=new Map,s=x();for(let a=0,l=e._rowCount;a{let s=[];i.split(",").forEach(a=>{let l=a.indexOf("-");if(l>0){let c=parseInt(a.substring(0,l)),u=parseInt(a.substr(l+1));for(let d=c;d<=u;d++)s[s.length]=d.toString()}else s[s.length]=a.trim()}),n[n.length]=s}),n}var ao;(function(e){e.Descriptor={name:"model_symmetry"},e.Provider=ta.create(e.Descriptor);function t(n){let o=wW(n.pdbx_struct_assembly,n.pdbx_struct_assembly_gen,n.pdbx_struct_oper_list),i=MCe(n.symmetry,n.cell),s=DCe(n.atom_sites,i);return{assemblies:o,spacegroup:i,isNonStandardCrystalFrame:s,ncsOperators:BCe(n.struct_ncs_oper)}}e.fromData=t;function r(n,o){let i=ui.create("P 1",n,o),s=Os.create(i);return{assemblies:[],spacegroup:s,isNonStandardCrystalFrame:!1}}e.fromCell=r})(ao||(ao={}));function DCe(e,t){return e._rowCount===0,!1}function kCe(e){let t=e.Int_Tables_number.value(0),r=e["space_group_name_H-M"].value(0);return e.Int_Tables_number.isDefined?e["space_group_name_H-M"].isDefined?r:t:r}function MCe(e,t){if(e._rowCount===0||t._rowCount===0)return Os.ZeroP1;let r=t.length_a.value(0),n=t.length_b.value(0),o=t.length_c.value(0);if(r===0||n===0||o===0)return Os.ZeroP1;let i=t.angle_alpha.value(0),s=t.angle_beta.value(0),a=t.angle_gamma.value(0);if(i===0||s===0||a===0)return Os.ZeroP1;let l=kCe(e),c=ui.create(l,x.create(r,n,o),x.scale(x(),x.create(i,s,a),Math.PI/180));return Os.create(c)}function BCe(e){if(e._rowCount===0)return;let{id:t,matrix:r,vector:n}=e,o=jr.struct_ncs_oper.matrix.space,i=jr.struct_ncs_oper.vector.space,s=[];for(let a=0;a{let f=l.length;l.push(Fe.ofUnsortedArray([m,p,h])),c.set(Tg(m,p),h),u.has(m)?u.get(m).push(f):u.set(m,[f])};for(let m=0;m=2){d(m,h[0],h[1]);for(let f=1,y=h.length;fc.get(Tg(m,p)),getTripletIndices:m=>u.get(m),triplets:l}}var _e;(function(e){let t;(function(z){z[z.Atomic=0]="Atomic",z[z.Spheres=1]="Spheres",z[z.Gaussians=2]="Gaussians"})(t=e.Kinds||(e.Kinds={}));function r(z){return z.kind===0}e.isAtomic=r;function n(z){return z.kind===1||z.kind===2}e.isCoarse=n;function o(z){return z.kind===1}e.isSpheres=o;function i(z){return z.kind===2}e.isGaussians=i;function s(z,q,O,J,Q,H,W,K,ce){switch(Q){case 0:return new g(z,q,O,J,H,K,Vn.createMapping(W,H.atomicConformation),ce??v());case 1:return A(z,q,O,J,H,1,K,Vn.createMapping(W,H.coarseConformation.spheres,f(H)),ce??_());case 2:return A(z,q,O,J,H,2,K,Vn.createMapping(W,H.coarseConformation.gaussians,y(H)),ce??_())}}e.create=s;function a(z){let q=Sa.Mutable();for(let O=0,J=z.length;Oq[O]}function y(z){return q=>0}class g{getChild(q){return q.length===this.elements.length?this:new g(this.id,this.invariantId,this.chainGroupId,this.traits,this.model,q,this.conformation,v())}applyOperator(q,O,J=!1){let Q=J?O:Vn.compose(this.conformation.operator,O);return new g(q,this.invariantId,this.chainGroupId,this.traits,this.model,this.elements,Vn.createMapping(Q,this.model.atomicConformation,this.conformation.r),this.props)}remapModel(q,O,J){var Q,H;J||(J=te(k({},this.props),{bonds:O&&!(!((H=(Q=this.props.bonds)===null||Q===void 0?void 0:Q.props)===null||H===void 0)&&H.canRemap)?void 0:D(this,this.props.bonds,q,O)}),e.isSameConformation(this,q)||(J.boundary=void 0,J.lookup3d=void 0,J.principalAxes=void 0));let W=this.conformation.operator,K=ao.Provider.get(q);if(W.spgrOp!==-1&&K&&K!==ao.Provider.get(this.model)){let[V,G,X]=W.hkl,{toFractional:Z}=K.spacegroup.cell,ie=x.transformMat4(x(),Ut.getCenter(q),Z);W=Os.getSymmetryOperatorRef(K.spacegroup,W.spgrOp,V,G,X,ie)}let ce=this.model.atomicConformation!==q.atomicConformation||W!==this.conformation.operator?Vn.createMapping(W,q.atomicConformation):this.conformation;return new g(this.id,this.invariantId,this.chainGroupId,this.traits,q,this.elements,ce,J)}get boundary(){if(this.props.boundary)return this.props.boundary;let{x:q,y:O,z:J}=this.model.atomicConformation;return this.props.boundary=p.is(this.traits,m.FastBoundary)?aT({x:q,y:O,z:J,indices:this.elements}):Zc({x:q,y:O,z:J,indices:this.elements}),this.props.boundary}get lookup3d(){if(this.props.lookup3d)return this.props.lookup3d;let{x:q,y:O,z:J}=this.model.atomicConformation;return this.props.lookup3d=Oa({x:q,y:O,z:J,indices:this.elements},this.boundary),this.props.lookup3d}get principalAxes(){return this.props.principalAxes?this.props.principalAxes:(this.props.principalAxes=RR(this),this.props.principalAxes)}get bonds(){var q;if(this.props.bonds)return this.props.bonds;let O=lT.get(this.model),J=O.get(this.elements);return J||(J=$q(this),!((q=J.props)===null||q===void 0)&&q.cacheable&&O.set(this.elements,J)),this.props.bonds=J,this.props.bonds}get rings(){return this.props.rings?this.props.rings:(this.props.rings=Ug.create(this),this.props.rings)}get resonance(){return this.props.resonance?this.props.resonance:(this.props.resonance=TW(this),this.props.resonance)}get polymerElements(){return this.props.polymerElements?this.props.polymerElements:(this.props.polymerElements=pW(this),this.props.polymerElements)}get gapElements(){return this.props.gapElements?this.props.gapElements:(this.props.gapElements=hW(this),this.props.gapElements)}get nucleotideElements(){return this.props.nucleotideElements?this.props.nucleotideElements:(this.props.nucleotideElements=yW(this),this.props.nucleotideElements)}get proteinElements(){return this.props.proteinElements?this.props.proteinElements:(this.props.proteinElements=vW(this),this.props.proteinElements)}get residueCount(){if(this.props.residueCount!==void 0)return this.props.residueCount;let q=0,O=Bt.transientSegments(this.model.atomicHierarchy.residueAtomSegments,this.elements);for(;O.hasNext;)O.move(),q+=1;return this.props.residueCount=q,this.props.residueCount}getResidueIndex(q){return this.residueIndex[this.elements[q]]}constructor(q,O,J,Q,H,W,K,ce){this.kind=0,this.objectPrimitive="atomistic",this.id=q,this.invariantId=O,this.chainGroupId=J,this.traits=Q,this.model=H,this.elements=W,this.conformation=K,this.residueIndex=H.atomicHierarchy.residueAtomSegments.index,this.chainIndex=H.atomicHierarchy.chainAtomSegments.index,this.props=ce}}e.Atomic=g;function v(){return h()}class b{getChild(q){return q.length===this.elements.length?this:A(this.id,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,q,this.conformation,_())}applyOperator(q,O,J=!1){let Q=J?O:Vn.compose(this.conformation.operator,O);return A(q,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,this.elements,Vn.createMapping(Q,this.getCoarseConformation(),this.conformation.r),this.props)}remapModel(q,O,J){let Q=this.getCoarseConformation(),H=S(this.kind,q);J||(J=k({},this.props),e.isSameConformation(this,q)||(J.boundary=void 0,J.lookup3d=void 0,J.principalAxes=void 0));let W=Q!==H?Vn.createMapping(this.conformation.operator,H,this.kind===1?f(q):y(q)):this.conformation;return new b(this.id,this.invariantId,this.chainGroupId,this.traits,q,this.kind,this.elements,W,J)}get boundary(){if(this.props.boundary)return this.props.boundary;let{x:q,y:O,z:J}=this.getCoarseConformation();return this.props.boundary=p.is(this.traits,m.FastBoundary)?aT({x:q,y:O,z:J,indices:this.elements}):Zc({x:q,y:O,z:J,indices:this.elements}),this.props.boundary}get lookup3d(){if(this.props.lookup3d)return this.props.lookup3d;let{x:q,y:O,z:J}=this.getCoarseConformation();return this.props.lookup3d=Oa({x:q,y:O,z:J,indices:this.elements},this.boundary),this.props.lookup3d}get principalAxes(){return this.props.principalAxes?this.props.principalAxes:(this.props.principalAxes=RR(this),this.props.principalAxes)}get polymerElements(){return this.props.polymerElements?this.props.polymerElements:(this.props.polymerElements=fW(this),this.props.polymerElements)}get gapElements(){return this.props.gapElements?this.props.gapElements:(this.props.gapElements=gW(this),this.props.gapElements)}getCoarseConformation(){return S(this.kind,this.model)}constructor(q,O,J,Q,H,W,K,ce,V){this.kind=W,this.objectPrimitive=W===1?"sphere":"gaussian",this.id=q,this.invariantId=O,this.chainGroupId=J,this.traits=Q,this.model=H,this.elements=K,this.conformation=ce,this.coarseElements=W===1?H.coarseHierarchy.spheres:H.coarseHierarchy.gaussians,this.coarseConformation=W===1?H.coarseConformation.spheres:H.coarseConformation.gaussians,this.props=V}}function S(z,q){return z===1?q.coarseConformation.spheres:q.coarseConformation.gaussians}function _(){return h()}class w extends b{}e.Spheres=w;class E extends b{}e.Gaussians=E;function A(z,q,O,J,Q,H,W,K,ce){return new b(z,q,O,J,Q,H,W,K,ce)}function P(z,q){return z.chainGroupId===q.chainGroupId&&z.conformation.operator.name===q.conformation.operator.name}e.areSameChainOperatorGroup=P;function T(z,q){return ne.areEqual(z.conformation.operator.matrix,q.conformation.operator.matrix,1e-6)}e.areOperatorsEqual=T;function B(z,q){return z===q?!0:Fe.areEqual(z.elements,q.elements)?M(z,q.model):!1}e.areConformationsEqual=B;function D(z,q,O,J){var Q;if(!q)return;if(z.model.atomicConformation.id===O.atomicConformation.id)return q;let H=yi.Provider.get(z.model);if(H){let W=yi.Provider.get(O);return!W||H===W?q:void 0}return!((Q=q.props)===null||Q===void 0)&&Q.canRemap||!J||M(z,O)?q:void 0}function M(z,q){let O=Ut.CoordinatesHistory.get(Ut.getRoot(q));if(O)return O.areEqual(z.elements,z.kind,q);let J=z.elements,{x:Q,y:H,z:W}=z.conformation.coordinates,{x:K,y:ce,z:V}=R(z.kind,q);for(let G=0,X=J.length;G(c+=l[p].elements.length)>=o,i.closeUnitsResult);if(u.count===0)return s;let d=0,m=-Number.MAX_VALUE;for(let p=0,h=u.count;p=o&&ms||l.addElement(v[g.indices[b]])}l.commitUnit()}}check(t,r,n,o){let{units:i}=this.structure,s=this.unitLookup.find(t,r,n,o);if(s.count===0)return!1;for(let a=0,l=s.count;a0&&(o[o.length]=a.getChild(c))}return Me.create(o,{parent:e.parent||t.parent})}var lt;(function(e){function t(g,v){return{kind:"singletons",source:g,structure:v}}e.Singletons=t;function r(g,v){return{kind:"sequence",source:g,structures:v}}e.Sequence=r;function n(g){return t(g,Me.Empty)}e.Empty=n;function o(g){return g.kind==="singletons"}e.isSingleton=o;function i(g){return o(g)?g.structure.units.length===0:g.structures.length===0}e.isEmpty=i;function s(g){return o(g)?g.structure.elementCount:g.structures.length}e.structureCount=s;function a(g){return i(g)?Me.Empty:o(g)?g.structure:uh(g.source,g.structures)}e.unionStructure=a;function l(g){let v=[],{unitMap:b}=g.source;for(let S of a(g).units)S===b.get(S.id)?v[v.length]={unit:S,indices:Te.ofBounds(0,S.elements.length)}:v[v.length]={unit:S,indices:Te.ofSortedArray(Fe.indicesOf(b.get(S.id).elements,S.elements))};return $.Loci(g.source,v)}e.toLociWithCurrentUnits=l;function c(g){let v=[],{unitMap:b}=g.source;for(let S of a(g).units){let _=b.get(S.id);_===S?v[v.length]={unit:_,indices:Te.ofBounds(0,_.elements.length)}:v[v.length]={unit:_,indices:Te.ofSortedArray(Fe.indicesOf(_.elements,S.elements))}}return $.Loci(g.source,v)}e.toLociWithSourceUnits=c;function u(g,v,b){return v.length===0?n(g):b?t(g,uh(g,v)):r(g,v)}class d{add(v){let b=v.elementCount;b!==0&&(this.structures[this.structures.length]=v,b!==1&&(this.allSingletons=!1))}getSelection(){return u(this.source,this.structures,this.allSingletons)}constructor(v){this.source=v,this.structures=[],this.allSingletons=!0}}class m{add(v){let b=v.elementCount;b===0||!this.uniqueSets.add(v)||(this.structures[this.structures.length]=v,b!==1&&(this.allSingletons=!1))}getSelection(){return u(this.structure,this.structures,this.allSingletons)}constructor(v){this.structure=v,this.structures=[],this.allSingletons=!0,this.uniqueSets=gx(Me.hashCode,Me.areUnitIdsAndIndicesEqual)}}function p(g){return new d(g)}e.LinearBuilder=p;function h(g){return new m(g)}e.UniqueBuilder=h;function f(g,v){let b=0;if(e.isSingleton(g))for(let S of g.structure.units){let{elements:_}=S;for(let w=0,E=_.length;wNCe,atomicSequence:()=>FCe,bundleElementImpl:()=>OR,bundleGenerator:()=>NR,defaultBondTest:()=>dT,spheres:()=>UCe,water:()=>OCe});var vC;(function(e){e.Empty={hash:-1,elements:[]};function t(u,d){return n(lt.toLociWithSourceUnits(lt.Singletons(u,d)))}e.fromSubStructure=t;function r(u){return n(lt.toLociWithSourceUnits(u))}e.fromSelection=r;function n(u){let d=[];for(let h of u.elements){let{unit:f,indices:y}=h;if(Te.size(y)===0)continue;let g=[],v=[];if(Te.isInterval(y))Te.size(y)===1?v.push(ve.min(y)):g.push(ve.min(y),ve.max(y));else{let b=0,S=y.length;for(;b2)g.push(y[_],y[w-1]);else for(let E=_;E{let f=[];h.groupedUnits.forEach(y=>f.push(Fe.ofUnsortedArray(y))),f.sort((y,g)=>y[0]-g[0]),p.push({groupedUnits:f,set:h.set,ranges:h.ranges})}),{hash:u.structure.hashCode,elements:p}}e.fromLoci=n;function o(u,d){let m=[];for(let p=0,h=u.length;pg[b]=v),y=Fe.ofSortedArray(g)}else{let g=fn.size(p.ranges),v=new Int32Array(p.set.length+g);fn.forEach(p.ranges,(b,S)=>v[S]=b),v.set(p.set,g),y=Fe.ofUnsortedArray(v)}for(let g of f)m.push({unit:g,indices:y})}return zg(d,m)}e.toLoci=i;function s(u,d){u.hash!==-1&&u.hash!==d.hashCode&&new Error("Bundle not compatible with given structure");let m=[];for(let p of u.elements)for(let h of p.groupedUnits){let f=o(h,d);if(f.length===0)continue;let y=f[0].elements,g=fn.size(p.ranges),v=p.set.length,b=new Int32Array(v+g),S;if(g===0){for(let _=0,w=v;_b[w]=y[_]),S=Fe.ofSortedArray(b);else if(Fe.min(p.set)>fn.max(p.ranges)){fn.forEach(p.ranges,(_,w)=>b[w]=y[_]);for(let _=0,w=v;_Fe.max(p.set)){for(let _=0,w=v;_b[w+v]=y[_]),S=Fe.ofSortedArray(b)}else{fn.forEach(p.ranges,(_,w)=>b[w]=y[_]);for(let _=0,w=v;_oe.core.type.list(d))),ranges:oe.core.type.list(u.ranges),set:oe.core.type.list(u.set)})}function l(u){return oe.internal.generator.bundle({elements:oe.core.type.list(u.elements.map(a))})}e.toExpression=l;function c(u,d){if(u.elements.length!==d.elements.length)return!1;for(let m=0,p=u.elements.length;m=8)continue}o.push(i)}}return lt.Singletons(r,Me.create(o,{parent:r}))}}function UCe(){return function(t){let{inputStructure:r}=t,n=[];for(let o of r.units)o.kind===1&&n.push(o);return lt.Singletons(r,Me.create(n,{parent:r}))}}function OR(e,t,r){return{groupedUnits:e,ranges:t,set:r}}function NR(e){return function(r){let n={hash:r.inputStructure.hashCode,elements:e};return lt.Sequence(r.inputStructure,[vC.toStructure(n,r.inputStructure)])}}var Mi=class{pushCurrentElement(){return this.currentElementStack[this.currentElementStack.length]=this.element,this.element=$.Location.create(void 0),this.element}popCurrentElement(){this.element=this.currentElementStack.pop()}pushCurrentBond(){return this.atomicBond&&this.currentAtomicBondStack.push(this.atomicBond),this.atomicBond=new mT,this.atomicBond}popCurrentBond(){this.currentAtomicBondStack.length>0?this.atomicBond=this.currentAtomicBondStack.pop():this.atomicBond=void 0}pushCurrentStructure(){this.currentStructure&&this.currentStructureStack.push(this.currentStructure)}popCurrentStructure(){this.currentStructureStack.length?this.currentStructure=this.currentStructureStack.pop():this.currentStructure=void 0}pushInputStructure(t){this.inputStructureStack.push(this.inputStructure),this.inputStructure=t}popInputStructure(){if(this.inputStructureStack.length===0)throw new Error("Must push before pop.");this.inputStructure=this.inputStructureStack.pop()}throwIfTimedOut(){if(this.timeoutMs!==0&&On()-this.timeCreated>this.timeoutMs)throw new Error(`The query took too long to execute (> ${this.timeoutMs/1e3}s).`)}tryGetCurrentSelection(){if(!this.currentSelection)throw new Error("The current selection is not assigned.");return this.currentSelection}constructor(t,r){this.currentElementStack=[],this.currentAtomicBondStack=[],this.currentStructureStack=[],this.inputStructureStack=[],this.timeCreated=On(),this.element=$.Location.create(void 0),this.currentStructure=void 0,this.atomicBond=new mT,this.currentSelection=void 0,this.inputStructure=t,this.timeoutMs=r&&r.timeoutMs||0,this.currentSelection=r&&r.currentSelection}},mT=class{constructor(){this.a=$.Location.create(void 0),this.aIndex=0,this.b=$.Location.create(void 0),this.bIndex=0,this.type=0,this.order=0,this.key=-1,this.testFn=dT}setStructure(t){this.a.structure=t,this.b.structure=t}setTestFn(t){this.testFn=t||dT}test(t,r){return this.testFn(t)?!0:r?(this.swap(),this.testFn(t)):!1}swap(){let t=this.aIndex;this.aIndex=this.bIndex,this.bIndex=t;let r=this.a.unit;this.a.unit=this.b.unit,this.b.unit=r;let n=this.a.element;this.a.element=this.b.element,this.b.element=n}get length(){return $.Location.distance(this.a,this.b)}};var xC;(function(e){function t(r,n,o){return r(new Mi(n,o))}e.run=t})(xC||(xC={}));var GR={};hi(GR,{all:()=>IW,atoms:()=>VR,bondedAtomicPairs:()=>XCe,chains:()=>VCe,none:()=>fT,querySelection:()=>YCe,residues:()=>zCe,rings:()=>WCe});var Bx=class{add(t){t.elementCount&&(t.elementCount!==1&&(this.allSingletons=!1),this.set.add(t)&&(this.structures[this.structures.length]=t))}getSelection(){return this.allSingletons?lt.Singletons(this.source,uh(this.source,this.structures)):lt.Sequence(this.source,this.structures)}constructor(t){this.source=t,this.set=gx(Me.hashCode,Me.areUnitIdsAndIndicesEqual),this.structures=[],this.allSingletons=!0}},pT=class{add(t,r,n){let o=this.builderMap.get(t);o||(o=this.source.subsetBuilder(!0),this.builders[this.builders.length]=o,this.builderMap.set(t,o)),o.addToUnit(r,n)}allSingletons(){for(let t=0,r=this.builders.length;t1)return!1;return!0}singletonSelection(){let t=this.source.subsetBuilder(!0),r=$.Location.create(this.source);for(let n=0,o=this.builders.length;nlt.Sequence(e.inputStructure,[]),IW=e=>lt.Singletons(e.inputStructure,e.inputStructure);function zCe(e){return VR(te(k({},e),{groupBy:t=>Ne.residue.key(t.element)}))}function VCe(e){return VR(te(k({},e),{groupBy:t=>Ne.chain.key(t.element)}))}function Vg(e){return!0}function GCe(e){return 0}function VR(e){if(!e||!e.atomTest&&!e.residueTest&&!e.chainTest&&!e.entityTest&&!e.unitTest&&!e.groupBy)return IW;if(e.atomTest&&!e.residueTest&&!e.chainTest&&!e.entityTest&&!e.unitTest&&!e.groupBy)return HCe(e.atomTest);let t={unitTest:e.unitTest||Vg,entityTest:e.entityTest||Vg,chainTest:e.chainTest||Vg,residueTest:e.residueTest||Vg,atomTest:e.atomTest||Vg,groupBy:e.groupBy||GCe};return e.groupBy?qCe(t):jCe(t)}function HCe(e){return function(r){let{inputStructure:n}=r,{units:o}=n,i=r.pushCurrentElement(),s=n.subsetBuilder(!0);i.structure=n;for(let a of o){i.unit=a;let l=a.elements;s.beginUnit(a.id);for(let c=0,u=l.length;cr3e,expandProperty:()=>o3e,includeConnected:()=>i3e,includeSurroundings:()=>Jwe,intersectBy:()=>t3e,querySelection:()=>e3e,surroundingLigands:()=>a3e,union:()=>n3e,wholeResidues:()=>Qwe});var p1=class{addToUnit(t,r){let n=this.unitMap.get(t);if(n)cn.add(n,r,r)&&this.elementCount++;else{let o=cn.create();cn.add(o,r,r),this.unitMap.set(t,o),this.ids[this.ids.length]=t,this.elementCount++}}has(t,r){let n=this.unitMap.get(t);return n?cn.has(n,r):!1}beginUnit(t){this.parentId=t,this.unitMap.has(t)?this.currentUnit=this.unitMap.get(t):this.currentUnit=this.currentUnit.array.length>0?cn.create():this.currentUnit}addElement(t){cn.add(this.currentUnit,t,t)&&this.elementCount++}commitUnit(){this.currentUnit.array.length===0||this.unitMap.has(this.parentId)||(this.ids[this.ids.length]=this.parentId,this.unitMap.set(this.parentId,this.currentUnit),this.parentId=-1)}getStructure(){if(this.isEmpty)return Me.Empty;let t=[];$s(this.ids);let r=xc.UnitEquivalenceBuilder();for(let n=0,o=this.ids.length;n1&&$s(a);let c=s.getChild(Fe.ofSortedArray(a)),u=r.add(c.id,c);c!==u&&(c=u.applyOperator(c.id,c.conformation.operator,!0)),t[t.length]=c}return Me.create(t,{parent:this.parent})}get isEmpty(){return this.elementCount===0}constructor(t){this.parent=t,this.ids=[],this.unitMap=Sa.Mutable(),this.parentId=-1,this.currentUnit=cn.create(),this.elementCount=0}};function pt(e){return{data:e,position:0,length:e.length,lineNumber:1,tokenStart:0,tokenEnd:0}}(function(e){function t(v){return v.data.substring(v.tokenStart,v.tokenEnd)}e.getTokenString=t;function r(v){v.position=0,v.lineNumber=1,v.tokenStart=0,v.tokenEnd=0}e.reset=r;function n(v){let{data:b}=v;for(;v.position{let T=Math.min(b-E,A);return l(P,T,w),E+=T,T},(A,P)=>A.update({message:"Parsing...",current:P.position,max:P.length})),w})}e.readLinesAsync=d;function m(v){let b=e(v),S=Ye.create(b.data,Math.max(v.length/80,2));for(;i(b);)Ye.add(S,b.tokenStart,b.tokenEnd);return S}e.readAllLines=m;function p(v,b,S){let _=0;for(let w=0;w(p(A,E,w),A.positionE.update({message:"Parsing...",current:A.position,max:A.length})),w})}e.readAllLinesAsync=h;function f(v){for(;v.position=w;)A=_.charCodeAt(--E);return v.tokenStart=w,v.tokenEnd=E+1,v.position=S,v}e.trim=g})(pt||(pt={}));function EW(e,t,r){let n=t,o=r-1,i=e.charCodeAt(n);for(;(i===9||i===32)&&n<=o;)i=e.charCodeAt(++n);for(i=e.charCodeAt(o);(i===9||i===32)&&o>=n;)i=e.charCodeAt(--o);return e.substring(n,o+1)}var Ye;(function(e){function t(s){let a=new Uint32Array(1.61*s.indices.length|0);a.set(s.indices),s.indices=a,s.indicesLenMinus2=a.length-2|0}function r(s,a,l){let c=s;c.offset>c.indicesLenMinus2&&t(c),c.indices[c.offset++]=a,c.indices[c.offset++]=l,s.count++}e.add=r;function n(s,a){r(s,a.tokenStart,a.tokenEnd)}e.addToken=n;function o(s,a,l){s.indices[s.offset++]=a,s.indices[s.offset++]=l,s.count++}e.addUnchecked=o;function i(s,a){return a=Math.max(10,a),{data:s,indicesLenMinus2:a-2|0,count:0,offset:0,indices:new Uint32Array(a)}}e.create=i})(Ye||(Ye={}));var Vr;(function(e){function t(i,s=-1){return new n(i,s)}e.error=t;function r(i,s=[]){return new o(i,s)}e.success=r;class n{toString(){return this.line>=0?`[Line ${this.line}] ${this.message}`:this.message}constructor(s,a){this.message=s,this.line=a,this.isError=!0}}e.Error=n;class o{constructor(s,a){this.result=s,this.warnings=a,this.isError=!1}}e.Success=o})(Vr||(Vr={}));function DW(e){for(;e.position=e.length){e.tokenType=6;return}e.tokenStart=e.position,e.tokenEnd=e.position,e.isEscaped=!1;let r=e.data.charCodeAt(e.position);switch(r){case 35:JCe(e),e.tokenType=5;break;case 39:if(BW(e)){QCe(e),e.tokenType=3;break}case 34:KCe(e,r),e.tokenType=3;break;case 59:t===10||t===13?ZCe(e):DW(e),e.tokenType=3;break;default:e.isImportGet?$Ce(e):DW(e),e.isEscaped?e.tokenType=3:e.data.charCodeAt(e.tokenStart)===95?(e.inSaveFrame&&o_e(e)&&(e.isImportGet=!0),e.tokenType=4):e.tokenEnd-e.tokenStart>=5&&e.data.charCodeAt(e.tokenStart+4)===95?t_e(e)?e.tokenType=0:r_e(e)?e.tokenType=1:n_e(e)?e.tokenType=2:e.tokenType=3:e.tokenType=3;break}}function Gg(e){for(kW(e);e.tokenType===5;)kW(e)}function a_e(e,t){return{data:e,length:e.length,position:0,tokenStart:0,tokenEnd:0,tokenType:6,lineNumber:1,isEscaped:!1,isImportGet:!1,inSaveFrame:!1,runtimeCtx:t}}function hT(){return{categoryNames:[],categoryData:Object.create(null)}}function qR(e,t){let r=Object.create(null);for(let n of e){let o=t[n];r[n]=vi(o.name,o.rowCount,o.fieldNames,o.fields)}return r}function MW(e,t,r){return aC(e.categoryNames,qR(e.categoryNames,e.categoryData),t,r)}function l_e(e,t){return aC(e.categoryNames,qR(e.categoryNames,e.categoryData),t)}function jR(e,t,r,n,o){if(t in e.categoryData){let i=e.categoryData[t];i.fieldNames.push(...n),Object.assign(i.fields,o)}else e.categoryData[t]={name:t,rowCount:r,fieldNames:n,fields:o},e.categoryNames.push(t)}function c_e(e,t){let r=e.tokenStart,n=RW(e),o=LW(e,n),i=Object.create(null),s=[],a=!0;for(;a;){if(e.tokenType!==4||!i_e(e,r,n)){a=!1;break}let l=HR(e).substring(o.length+1);if(Gg(e),e.tokenType!==3)return{hasError:!0,errorLine:e.lineNumber,errorMessage:"Expected value."};i[l]=gt.ofTokens({data:e.data,indices:[e.tokenStart,e.tokenEnd],count:1}),s[s.length]=l,Gg(e)}return jR(t,o.substr(1),1,s,i),{hasError:!1,errorLine:0,errorMessage:""}}function u_e(e,t){let{tokenizer:r,tokens:n,fieldCount:o}=t,i=t.tokenCount,s=0;for(;r.tokenType===3&&s0&&r.push(MW(i,o,s)),o=e.substring(n.tokenStart+5,n.tokenEnd),i=hT(),s=[],Gg(n)}else if(u===1){if(n.tokenEnd-n.tokenStart===5)a.categoryNames.length>0&&(s[s.length]=l_e(a,c)),n.inSaveFrame=!1;else{if(n.inSaveFrame)return Rx(n.lineNumber,"Save frames cannot be nested.");n.inSaveFrame=!0,c=e.substring(n.tokenStart+5,n.tokenEnd),a=hT()}Gg(n)}else if(u===2){let d=yield m_e(n,n.inSaveFrame?a:i);if(d.hasError)return Rx(d.errorLine,d.errorMessage)}else if(u===4){let d=c_e(n,n.inSaveFrame?a:i);if(d.hasError)return Rx(d.errorLine,d.errorMessage)}else return console.log(n.tokenType,pt.getTokenString(n)),Rx(n.lineNumber,"Unexpected token. Expected data_, loop_, or data name.")}return n.inSaveFrame?Rx(n.lineNumber,`Unfinished save frame (${l.header}).`):((i.categoryNames.length>0||s.length>0)&&r.push(MW(i,o,s)),p_e(RA(r)))})}function WR(e){return Pe.create("Parse CIF",t=>Y(this,null,function*(){return yield f_e(e,t)}))}function FW(e){let t=e.mask?wx(e.mask):void 0,r=wx(e.data),n=Xo.isTypedArray(r),o=n?t?c=>t[c]===0?""+r[c]:"":c=>""+r[c]:t?c=>t[c]===0?r[c]:"":c=>r[c],i=n?c=>r[c]:c=>{let u=r[c];return Sd(u,0,u.length)},s=n?c=>r[c]:c=>{let u=r[c];return vc(u,0,u.length)},a=t?c=>t[c]:c=>0,l=r.length;return{__array:r,binaryEncoding:e.data.encoding,isDefined:!0,rowCount:l,str:o,int:i,float:s,valueKind:a,areValuesEqual:(c,u)=>r[c]===r[u],toStringArray:c=>Xo.createAndFillArray(l,o,c),toIntArray:n?c=>Xo.typedArrayWindow(r,c):c=>Xo.createAndFillArray(l,i,c),toFloatArray:n?c=>Xo.typedArrayWindow(r,c):c=>Xo.createAndFillArray(l,s,c)}}function vT(e){return yT({buffer:e,offset:0,dataView:new DataView(e.buffer)})}function YR(e,t){let r={};for(let n=0;nt[r])return!1;return!0}function g_e(e){let t=Object.create(null),r=Object.create(null);for(let n of e.columns)t[n.name]=n;return{rowCount:e.rowCount,name:e.name.substr(1),fieldNames:e.columns.map(n=>n.name),getField(n){let o=t[n];if(o)return r[n]||(r[n]=FW(o)),r[n]}}}function QR(e){return Pe.create("Parse BinaryCIF",t=>Y(this,null,function*(){let r=[0,3];try{let n=vT(e);if(!h_e(r,n.version.match(/(\d)\.(\d)\.\d/).slice(1).map(i=>+i)))return Vr.error(`Unsupported format version. Current ${n.version}, required ${r.join(".")}.`);let o=RA(n.dataBlocks.map(i=>{let s=Object.create(null);for(let a of i.categories)s[a.name.substr(1)]=g_e(a);return aC(i.categories.map(a=>a.name.substr(1)),s,i.header)}));return Vr.success(o)}catch(n){return Vr.error(""+n)}}))}var f1=re.Schema,Co=f1.str,y_e=f1.float,OW=f1.List,qp=f1.lstr,Fu=f1.Aliased,bC=f1.int,Lx=f1.coord,NW={chem_comp:{formula:Co,formula_weight:y_e,id:Co,mon_nstd_parent_comp_id:OW(",",e=>e),name:Co,one_letter_code:Co,three_letter_code:Co,type:Fu(qp),pdbx_synonyms:OW(";",e=>e),pdbx_type:Co,pdbx_ambiguous_flag:Co,pdbx_replaced_by:Co,pdbx_replaces:Co,pdbx_formal_charge:bC,pdbx_model_coordinates_details:Co,pdbx_model_coordinates_db_code:Co,pdbx_ideal_coordinates_details:Co,pdbx_ideal_coordinates_missing_flag:Fu(qp),pdbx_model_coordinates_missing_flag:Fu(qp),pdbx_initial_date:Co,pdbx_modified_date:Co,pdbx_release_status:Fu(Co),pdbx_processing_site:Fu(Co)},chem_comp_atom:{alt_atom_id:Co,atom_id:Co,charge:bC,model_Cartn_x:Lx,model_Cartn_y:Lx,model_Cartn_z:Lx,comp_id:Co,type_symbol:Co,pdbx_align:bC,pdbx_ordinal:bC,pdbx_model_Cartn_x_ideal:Lx,pdbx_model_Cartn_y_ideal:Lx,pdbx_model_Cartn_z_ideal:Lx,pdbx_stereo_config:Fu(qp),pdbx_aromatic_flag:Fu(qp),pdbx_leaving_atom_flag:Fu(qp)},chem_comp_bond:{atom_id_1:Co,atom_id_2:Co,comp_id:Co,value_order:Fu(qp),pdbx_ordinal:bC,pdbx_stereo_config:Fu(qp),pdbx_aromatic_flag:Fu(qp)},pdbx_chem_comp_descriptor:{comp_id:Co,descriptor:Co,type:Fu(qp),program:Co,program_version:Co},pdbx_chem_comp_identifier:{comp_id:Co,identifier:Co,type:Fu(Co),program:Co,program_version:Co}};var SC=re.Schema,Br=SC.str,v_e=SC.float,dh=SC.lstr,bc=SC.Aliased,Ed=SC.int,UW={pdbx_reference_molecule:{prd_id:Br,formula_weight:v_e,formula:Br,type:bc(dh),type_evidence_code:Br,class:bc(dh),class_evidence_code:Br,name:Br,represent_as:bc(dh),chem_comp_id:Br,compound_details:Br,description:Br,representative_PDB_id_code:Br,release_status:bc(dh),replaces:Br,replaced_by:Br},pdbx_reference_entity_list:{prd_id:Br,ref_entity_id:Br,type:bc(dh),details:Br,component_id:Ed},pdbx_reference_entity_nonpoly:{prd_id:Br,ref_entity_id:Br,name:Br,chem_comp_id:Br},pdbx_reference_entity_link:{link_id:Ed,prd_id:Br,details:Br,ref_entity_id_1:Br,ref_entity_id_2:Br,entity_seq_num_1:Ed,entity_seq_num_2:Ed,comp_id_1:Br,comp_id_2:Br,atom_id_1:Br,atom_id_2:Br,value_order:bc(dh),component_1:Ed,component_2:Ed,link_class:bc(Br)},pdbx_reference_entity_poly_link:{link_id:Ed,prd_id:Br,ref_entity_id:Br,component_id:Ed,entity_seq_num_1:Ed,entity_seq_num_2:Ed,comp_id_1:Br,comp_id_2:Br,atom_id_1:Br,atom_id_2:Br,value_order:bc(dh)},pdbx_reference_entity_poly:{prd_id:Br,ref_entity_id:Br,type:bc(Br),db_code:Br,db_name:Br},pdbx_reference_entity_poly_seq:{prd_id:Br,ref_entity_id:Br,mon_id:Br,parent_mon_id:Br,num:Ed,observed:bc(dh),hetero:bc(dh)},pdbx_reference_entity_sequence:{prd_id:Br,ref_entity_id:Br,type:bc(Br),NRP_flag:bc(Br),one_letter_codes:Br},pdbx_reference_entity_src_nat:{prd_id:Br,ref_entity_id:Br,ordinal:Ed,organism_scientific:Br,taxid:Br,db_code:Br,db_name:Br},pdbx_prd_audit:{prd_id:Br,date:Br,processing_site:bc(Br),action_type:bc(Br)}};var zW=re.Schema,ws=zW.str,x_e=zW.float,b_e={id:ws,description:ws},S_e={title:ws,datablock_id:ws,version:ws},C_e={version:ws,update:ws,revision:ws},__e={id:ws,description:ws},w_e={id:ws,parent_id:ws,description:ws},A_e={code:ws,primitive_code:ws,construct:ws,detail:ws},T_e={code:ws,detail:ws},P_e={from_code:ws,to_code:ws,operator:ws,factor:x_e},VW={datablock:b_e,dictionary:S_e,dictionary_history:C_e,sub_category:__e,category_group_list:w_e,item_type_list:A_e,item_units_list:T_e,item_units_conversion:P_e};var CC=re.Schema,Wp=CC.str,xT=CC.int,mh=CC.float,bT=CC.Aliased,Hg=CC.Vector,nct={density_server_result:{server_version:Wp,datetime_utc:Wp,guid:Wp,is_empty:bT(Wp),has_error:bT(Wp),error:Wp,query_source_id:Wp,query_type:bT(Wp),query_box_type:bT(Wp),query_box_a:Hg(3),query_box_b:Hg(3)}},ST={volume_data_3d_info:{name:Wp,axis_order:Hg(3,xT),origin:Hg(3),dimensions:Hg(3),sample_rate:xT,sample_count:Hg(3,xT),spacegroup_number:xT,spacegroup_cell_size:Hg(3),spacegroup_cell_angles:Hg(3),mean_source:mh,mean_sampled:mh,sigma_source:mh,sigma_sampled:mh,min_source:mh,min_sampled:mh,max_source:mh,max_sampled:mh},volume_data_3d:{values:mh}};var CT=re.Schema,qi=CT.float,ZR=CT.int,Mo=CT.str,I_e=CT.Matrix,GW={cell:{angle_alpha:qi,angle_beta:qi,angle_gamma:qi,formula_units_z:ZR,length_a:qi,length_b:qi,length_c:qi,volume:qi},chemical:{melting_point:qi,name_common:Mo,name_systematic:Mo},chemical_formula:{moiety:Mo,sum:Mo,weight:qi},space_group:{crystal_system:Mo,it_number:ZR,"name_h-m_full":Mo},space_group_symop:{operation_xyz:Mo},geom_bond:{atom_site_label_1:Mo,atom_site_label_2:Mo,distance:qi,publ_flag:Mo,site_symmetry_1:Mo,site_symmetry_2:Mo,valence:qi},audit:{block_doi:Mo},database_code:{cod:Mo,csd:Mo,depnum_ccdc_archive:Mo,depnum_ccdc_fiz:Mo,icsd:Mo,mdf:Mo,nbs:Mo},atom_site:{adp_type:Mo,calc_flag:Mo,disorder_assembly:Mo,disorder_group:Mo,fract_x:qi,fract_y:qi,fract_z:qi,label:Mo,occupancy:qi,refinement_flags:Mo,site_symmetry_multiplicity:ZR,type_symbol:Mo,u_iso_or_equiv:qi},atom_site_aniso:{label:Mo,u_11:qi,u:I_e(3,3),u_12:qi,u_13:qi,u_22:qi,u_23:qi,u_33:qi},atom_type:{description:Mo,symbol:Mo},atom_type_scat:{dispersion_imag:qi,dispersion_real:qi,source:Mo}},HW={"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"]};var E_e=re.Schema,$R=E_e.int,jW={volume_data_3d_info:ST.volume_data_3d_info,segmentation_data_table:{set_id:$R,segment_id:$R},segmentation_data_3d:{values:$R}};var Vl={parse:e=>typeof e=="string"?WR(e):QR(e),parseText:WR,parseBinary:QR,toDatabaseCollection:Oj,toDatabase:Ad,schema:{mmCIF:e=>Ad(jr,e),CCD:e=>Ad(NW,e),BIRD:e=>Ad(UW,e),dic:e=>Ad(VW,e),cifCore:e=>Ad(GW,e,HW),densityServer:e=>Ad(ST,e),segmentation:e=>Ad(jW,e)}};var qW={type_symbol:re.Schema.Aliased(jr.atom_site.type_symbol),label_atom_id:jr.atom_site.label_atom_id,auth_atom_id:jr.atom_site.auth_atom_id,label_alt_id:jr.atom_site.label_alt_id,label_comp_id:jr.atom_site.label_comp_id,auth_comp_id:jr.atom_site.auth_comp_id,pdbx_formal_charge:jr.atom_site.pdbx_formal_charge},WW={group_PDB:jr.atom_site.group_PDB,label_seq_id:jr.atom_site.label_seq_id,auth_seq_id:jr.atom_site.auth_seq_id,pdbx_PDB_ins_code:jr.atom_site.pdbx_PDB_ins_code},YW={label_asym_id:jr.atom_site.label_asym_id,auth_asym_id:jr.atom_site.auth_asym_id,label_entity_id:jr.atom_site.label_entity_id},_T;(function(e){function t(){return{label_entity_id:"",label_asym_id:"",auth_seq_id:0,pdbx_PDB_ins_code:void 0}}e.EmptyResidueKey=t})(_T||(_T={}));var Yp;(function(e){function t(o,i){return o.residueAtomSegments.index[o.chainAtomSegments.offsets[i]]}e.chainStartResidueIndex=t;function r(o,i){return o.residueAtomSegments.index[o.chainAtomSegments.offsets[i+1]-1]+1}e.chainEndResidueIndexExcl=r;function n(o,i){return r(o,i)-t(o,i)}e.chainResidueCount=n})(Yp||(Yp={}));var _C={H:1,D:1,T:1,HE:2,LI:3,BE:4,B:5,C:6,N:7,O:8,F:9,NE:10,NA:11,MG:12,AL:13,SI:14,P:15,S:16,CL:17,AR:18,K:19,CA:20,SC:21,TI:22,V:23,CR:24,MN:25,FE:26,CO:27,NI:28,CU:29,ZN:30,GA:31,GE:32,AS:33,SE:34,BR:35,KR:36,RB:37,SR:38,Y:39,ZR:40,NB:41,MO:42,TC:43,RU:44,RH:45,PD:46,AG:47,CD:48,IN:49,SN:50,SB:51,TE:52,I:53,XE:54,CS:55,BA:56,LA:57,CE:58,PR:59,ND:60,PM:61,SM:62,EU:63,GD:64,TB:65,DY:66,HO:67,ER:68,TM:69,YB:70,LU:71,HF:72,TA:73,W:74,RE:75,OS:76,IR:77,PT:78,AU:79,HG:80,TL:81,PB:82,BI:83,PO:84,AT:85,RN:86,FR:87,RA:88,AC:89,TH:90,PA:91,U:92,NP:93,PU:94,AM:95,CM:96,BK:97,CF:98,ES:99,FM:100,MD:101,NO:102,LR:103,RF:104,DB:105,SG:106,BH:107,HS:108,MT:109},D_e={1:1.1,2:1.4,3:1.81,4:1.53,5:1.92,6:1.7,7:1.55,8:1.52,9:1.47,10:1.54,11:2.27,12:1.73,13:1.84,14:2.1,15:1.8,16:1.8,17:1.75,18:1.88,19:2.75,20:2.31,21:2.3,22:2.15,23:2.05,24:2.05,25:2.05,26:2.05,27:2,28:2,29:2,30:2.1,31:1.87,32:2.11,33:1.85,34:1.9,35:1.83,36:2.02,37:3.03,38:2.49,39:2.4,40:2.3,41:2.15,42:2.1,43:2.05,44:2.05,45:2,46:2.05,47:2.1,48:2.2,49:2.2,50:1.93,51:2.17,52:2.06,53:1.98,54:2.16,55:3.43,56:2.68,57:2.5,58:2.48,59:2.47,60:2.45,61:2.43,62:2.42,63:2.4,64:2.38,65:2.37,66:2.35,67:2.33,68:2.32,69:2.3,70:2.28,71:2.27,72:2.25,73:2.2,74:2.1,75:2.05,76:2,77:2,78:2.05,79:2.1,80:2.05,81:1.96,82:2.02,83:2.07,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:2.4,91:2,92:2.3,93:2,94:2,95:2,96:2,97:2,98:2,99:2,100:2,101:2,102:2,103:2,104:2,105:2,106:2,107:2,108:2,109:2},k_e={1:1.008,2:4.0026,3:6.94,4:9.0122,5:10.81,6:10.81,7:14.007,8:15.999,9:18.998,10:20.18,11:22.99,12:24.305,13:26.982,14:28.085,15:30.974,16:32.06,17:35.45,18:39.948,19:39.098,20:40.078,21:44.956,22:47.867,23:50.942,24:51.996,25:54.938,26:55.845,27:58.933,28:58.693,29:63.546,30:65.38,31:69.723,32:72.63,33:74.922,34:78.971,35:79.904,36:83.798,37:85.468,38:87.62,39:88.906,40:91.224,41:92.906,42:95.95,43:96.906,44:101.07,45:102.91,46:106.42,47:107.87,48:112.41,49:114.82,50:118.71,51:121.76,52:127.6,53:127.6,54:131.29,55:132.91,56:137.33,57:138.91,58:140.12,59:140.91,60:144.24,61:144.912,62:150.36,63:151.96,64:157.25,65:158.93,66:162.5,67:164.93,68:167.26,69:168.93,70:173.05,71:174.97,72:178.49,73:180.95,74:183.84,75:186.21,76:190.23,77:192.22,78:195.08,79:196.97,80:200.59,81:204.38,82:207.2,83:208.98,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:232.04,91:231.04,92:238.03,93:237.048,94:244.064,95:243.061,96:247.07,97:247.07,98:251.079,99:252.083,100:257.095,101:258.098,102:259.101,103:262.11,104:267.122,105:270.131,106:271.134,107:270.133,108:270.134,109:278.156},M_e=1.7,B_e=10.81,R_e=0;function Xp(e){let t=_C[e];return t===void 0?M_e:D_e[t]}function XW(e){let t=_C[e];return t===void 0?B_e:k_e[t]}function jg(e){let t=_C[e];return t===void 0?R_e:t}function wT(e,t,r,n){return{type:e,key:t,elements:r,getIndex:n}}var Wm;(function(e){e.Descriptor={name:"model_secondary_structure"},e.Provider=ta.create(e.Descriptor);function t(r,n,o){let i=new Map,s=[{kind:"none"}],a=L_e(r,n);F_e(r,a,i,s),O_e(n,a,i,r._rowCount,s);let l=o.residues._rowCount,c=d=>d,u={type:new Int32Array(l),key:new Int32Array(l),elements:s};return i.size>0&&U_e(o,a,i,u),wT(u.type,u.key,u.elements,c)}e.fromStruct=t})(Wm||(Wm={}));function L_e(e,t){if(e._rowCount>0){if(e.beg_label_seq_id.valueKind(0)!==0||e.end_label_seq_id.valueKind(0)!==0)return"auth"}else if(t&&(t.beg_label_seq_id.valueKind(0)!==0||t.end_label_seq_id.valueKind(0)!==0))return"auth";return"label"}function F_e(e,t,r,n){if(!e._rowCount)return;let{beg_label_asym_id:o,beg_label_seq_id:i,beg_auth_seq_id:s,pdbx_beg_PDB_ins_code:a}=e,{end_label_seq_id:l,end_auth_seq_id:c,pdbx_end_PDB_ins_code:u}=e,{pdbx_PDB_helix_class:d,conf_type_id:m,details:p}=e,h=t==="label"?i:s,f=t==="label"?l:c;for(let y=0,g=e._rowCount;yc||f===c&&l.value(h)===u)break;h++}}function U_e(e,t,r,n){let{count:o}=e.chainAtomSegments,{label_asym_id:i}=e.chains,{auth_seq_id:s,label_seq_id:a,pdbx_PDB_ins_code:l}=e.residues,c=t==="label"?a:s;for(let u=0;u0}e.hasData=i;function s(a,l){a.writeCategory({name:t,instance(){let c=cr.ofRows(e.Schema.molstar_global_model_transform_info,[{matrix:l}]);return $n.Category.ofTable(c)}})}e.writeMmCif=s})(Kp||(Kp={}));var Qct={label_comp_id:jr.atom_site.label_comp_id,label_seq_id:jr.atom_site.label_seq_id,pdbx_PDB_ins_code:jr.atom_site.pdbx_PDB_ins_code,label_asym_id:jr.atom_site.label_asym_id,label_entity_id:jr.atom_site.label_entity_id,auth_comp_id:jr.atom_site.auth_atom_id,auth_seq_id:jr.atom_site.auth_seq_id,auth_asym_id:jr.atom_site.auth_asym_id},Zct=te(k({},jr.chem_comp_bond),{molstar_protonation_variant:re.Schema.Str()}),KW=te(k({},jr.chem_comp),{type:re.Schema.Aliased(re.Schema.str)});function ZW(e,t){let{ihm_model_group:r,ihm_model_group_link:n}=t,o=cr.pickRow(n,i=>n.model_id.value(i)===e);if(o){let i=cr.pickRow(r,s=>r.id.value(s)===o.group_id);if(i)return i.name}return""}function QW(e){for(let t=0,r=e.rowCount;tthis.namesMap.set(r[0],r[1]))}};var V_e=[new Set(["CA"]),new Set(["C"]),new Set(["N"])],G_e=[new Set(["P","O3'","O3*"]),new Set(["C4'","C4*"]),new Set(["O2'","O2*","F2'","F2*"])],H_e=[new Set(["P","O3'","O3*"]),new Set(["C3'","C3*"]),new Set(["O2'","O2*","F2'","F2*"])],j_e=new Set(["FMN","NCN","FNS","FMA","ATP","ADP","AMP","GTP","GDP","GMP","LIG"]),JW=function(){let e=new Map;return[{id:"HIS",name:"HISTIDINE",type:"l-peptide linking"},{id:"ARG",name:"ARGININE",type:"l-peptide linking"},{id:"LYS",name:"LYSINE",type:"l-peptide linking"},{id:"ILE",name:"ISOLEUCINE",type:"l-peptide linking"},{id:"PHE",name:"PHENYLALANINE",type:"l-peptide linking"},{id:"LEU",name:"LEUCINE",type:"l-peptide linking"},{id:"TRP",name:"TRYPTOPHAN",type:"l-peptide linking"},{id:"ALA",name:"ALANINE",type:"l-peptide linking"},{id:"MET",name:"METHIONINE",type:"l-peptide linking"},{id:"CYS",name:"CYSTEINE",type:"l-peptide linking"},{id:"ASN",name:"ASPARAGINE",type:"l-peptide linking"},{id:"VAL",name:"VALINE",type:"l-peptide linking"},{id:"GLY",name:"GLYCINE",type:"peptide linking"},{id:"SER",name:"SERINE",type:"l-peptide linking"},{id:"GLN",name:"GLUTAMINE",type:"l-peptide linking"},{id:"TYR",name:"TYROSINE",type:"l-peptide linking"},{id:"ASP",name:"ASPARTIC ACID",type:"l-peptide linking"},{id:"GLU",name:"GLUTAMIC ACID",type:"l-peptide linking"},{id:"THR",name:"THREONINE",type:"l-peptide linking"},{id:"PRO",name:"PROLINE",type:"l-peptide linking"},{id:"SEC",name:"SELENOCYSTEINE",type:"l-peptide linking"},{id:"PYL",name:"PYRROLYSINE",type:"l-peptide linking"},{id:"MSE",name:"SELENOMETHIONINE",type:"l-peptide linking"},{id:"SEP",name:"PHOSPHOSERINE",type:"l-peptide linking"},{id:"TPO",name:"PHOSPHOTHREONINE",type:"l-peptide linking"},{id:"PTR",name:"O-PHOSPHOTYROSINE",type:"l-peptide linking"},{id:"PCA",name:"PYROGLUTAMIC ACID",type:"l-peptide linking"},{id:"A",name:"ADENOSINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"C",name:"CYTIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"T",name:"THYMIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"G",name:"GUANOSINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"I",name:"INOSINIC ACID",type:"rna linking"},{id:"U",name:"URIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"DA",name:"2'-DEOXYADENOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DC",name:"2'-DEOXYCYTIDINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DT",name:"THYMIDINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DG",name:"2'-DEOXYGUANOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DI",name:"2'-DEOXYINOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DU",name:"2'-DEOXYURIDINE-5'-MONOPHOSPHATE",type:"dna linking"}].forEach(r=>e.set(r.id,r)),e}(),eY=function(){let e=new Map;return[{id:"ZN2",name:"ZINC ION",type:"ion"},{id:"SOD",name:"SODIUM ION",type:"ion"},{id:"CES",name:"CESIUM ION",type:"ion"},{id:"CLA",name:"CHLORIDE ION",type:"ion"},{id:"CAL",name:"CALCIUM ION",type:"ion"},{id:"POT",name:"POTASSIUM ION",type:"ion"}].forEach(r=>e.set(r.id,r)),e}(),Yi=class{set(t){this.comps.set(t.id,t),this.ids.push(t.id),this.names.push(t.name),this.types.push(t.type),this.mon_nstd_flags.push(ih.has(t.id)?"y":"n")}getAtomIds(t){let r=new Set,n=this.seqId.value(t);for(;tthis.namesMap.set(r[0],r[1]))}constructor(t,r){this.seqId=t,this.atomId=r,this.namesMap=new Map,this.comps=new Map,this.ids=[],this.names=[],this.types=[],this.mon_nstd_flags=[]}};function q_e(e){if(rn.is(e.sourceData))return ao.fromData(e.sourceData.data.db)}ao.Provider.formatRegistry.add("mmCIF",q_e);function W_e(e){if(!rn.is(e.sourceData))return;let{struct_conf:t,struct_sheet_range:r}=e.sourceData.data.db;return Wm.fromStruct(t,r,e.atomicHierarchy)}Wm.Provider.formatRegistry.add("mmCIF",W_e);function Y_e(e){if(!rn.is(e.sourceData))return;let{atom_site_anisotrop:t}=e.sourceData.data.db,r=cr.ofColumns($c.Schema,t),n=$c.getElementToAnsiotrop(e.atomicConformation.atomId,t.id);return{data:r,elementToAnsiotrop:n}}function X_e(e){return rn.is(e.sourceData)?e.sourceData.data.db.atom_site_anisotrop.U.isDefined:!1}$c.Provider.formatRegistry.add("mmCIF",Y_e,X_e);function K_e(e){if(!rn.is(e.sourceData))return;let{chem_comp_bond:t}=e.sourceData.data.db;if(t._rowCount!==0)return{data:t,entries:lh.getEntriesFromChemCompBond(t)}}lh.Provider.formatRegistry.add("mmCIF",K_e);function Q_e(e){if(!rn.is(e.sourceData))return;let{struct_conn:t}=e.sourceData.data.db;if(t._rowCount===0)return;let r=bl.getEntriesFromStructConn(t,e);return{data:t,byAtomIndex:bl.getAtomIndexFromEntries(r),entries:r}}bl.Provider.formatRegistry.add("mmCIF",Q_e);Kp.Provider.formatRegistry.add("mmCIF",Kp.fromMmCif,Kp.hasData);var rn;(function(e){function t(n){return n?.kind==="mmCIF"}e.is=t;function r(n,o,i,s){return o||(o=Vl.schema.mmCIF(n)),{kind:"mmCIF",name:o._name,data:{db:o,file:s,frame:n,source:i}}}e.fromFrame=r})(rn||(rn={}));function TT(e,t){let r=rn.fromFrame(e,void 0,void 0,t),n=us(r.data.db,!0);return Pe.create("Create mmCIF Model",o=>_a(n,r,o))}var wC;(function(e){let t="__CcdCoordinateType__";e.CoordinateType={get(o){return o._staticPropertyData[t]},set(o,i){return o._staticPropertyData[t]=i}};function r(o){return o?.kind==="CCD"}e.is=r;function n(o,i){return i||(i=Vl.schema.CCD(o)),{kind:"CCD",name:i._name,data:{db:i,frame:o}}}e.fromFrame=n})(wC||(wC={}));function rY(e){let t=wC.fromFrame(e);return Pe.create("Create CCD Models",r=>Z_e(t.data.db,wC.fromFrame(e),r))}function Z_e(e,t,r){return Y(this,null,function*(){let n=yield tY(e,t,{coordinateType:"ideal",cartn_x:"pdbx_model_Cartn_x_ideal",cartn_y:"pdbx_model_Cartn_y_ideal",cartn_z:"pdbx_model_Cartn_z_ideal"},r),o=yield tY(e,t,{coordinateType:"model",cartn_x:"model_Cartn_x",cartn_y:"model_Cartn_y",cartn_z:"model_Cartn_z"},r),i=[];n&&i.push(n),o&&i.push(o);for(let s=0,a=i.length;s0||(b[b.length]=K);let S=b.length,_=re.ofConst("A",S,re.Schema.str),w=re.ofConst(1,S,re.Schema.int),E=re.ofConst("1",S,re.Schema.str),A=re.ofConst(1,S,re.Schema.float),P=re.ofConst(1,S,re.Schema.int),T=re.view(p,b),B=re.view(f,b),D=re.view(i[l],b),M=re.view(i[c],b),R=re.view(i[u],b),U=re.view(y,b),F=re.view(g,b),N=re.view(h,b),z=cr.ofPartialColumns(_o.atom_site,{auth_asym_id:_,auth_atom_id:T,auth_comp_id:B,auth_seq_id:w,Cartn_x:D,Cartn_y:M,Cartn_z:R,id:U,label_asym_id:_,label_atom_id:T,label_comp_id:B,label_seq_id:w,label_entity_id:E,occupancy:A,type_symbol:F,pdbx_PDB_model_num:P,pdbx_formal_charge:N},S),q=new Wi;q.setNames([[m,`${d} (${a})`]]),q.getEntityId(m,0,"A");let O=new Yi(w,g);O.setNames([[m,`${d} (${a})`]]),O.add(m,0);let J=us({entity:q.getEntityTable(),chem_comp:O.getChemCompTable(),atom_site:z}),Q=yield _a(J,t,n);if(!Q.representative)return;let H=Q.representative,W=lh.getEntriesFromChemCompBond(s);return lh.Provider.set(H,{data:s,entries:W}),wC.CoordinateType.set(H,a),Q.representative})}var ph=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Fx=$_e(),AC=J_e();function $_e(){return typeof XMLHttpRequest>"u"||ph?oY():XMLHttpRequest}function J_e(){if(typeof File>"u"||ph){class e{arrayBuffer(){return this.blob.arrayBuffer()}slice(r,n,o){return this.blob.slice(r,n,o)}stream(){return this.blob.stream()}text(){return this.blob.text()}constructor(r,n,o){var i;this.blob=new Blob(r,o),this.size=this.blob.size,this.type=this.blob.type,this.name=n,this.lastModified=(i=o?.lastModified)!==null&&i!==void 0?i:0,this.webkitRelativePath=""}}return e}else return File}function iY(e){return e>>0}function Qp(e,t){return e[t]|e[t+1]<<8}function qg(e,t,r){e[t]=r&255,e[t+1]=r>>8&255}function Wg(e,t){return e[t+3]*(256*256*256)+(e[t+2]<<16|e[t+1]<<8|e[t])}function Zp(e,t,r){e[t]=r&255,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255}function ewe(e,t,r){let n="";for(let o=0;o>6,e[t+o+1]=128|s>>0&63,o+=2;else if(!(s&4294901760))e[t+o]=224|s>>12,e[t+o+1]=128|s>>6&63,e[t+o+2]=128|s>>0&63,o+=3;else if(!(s&4294967295-(1<<21)+1))e[t+o]=240|s>>18,e[t+o+1]=128|s>>12&63,e[t+o+2]=128|s>>6&63,e[t+o+3]=128|s>>0&63,o+=4;else throw new Error("e")}return o}function JR(e){let t=e.length,r=0;for(let n=0;n>>1:r=r>>>1;e[t]=r}return e}();function nwe(e,t,r,n){for(let o=0;o>>8;return e}function e5(e,t,r){return nwe(4294967295,e,t,r)^4294967295}var wt=function(){let 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(){for(let r=0;r<32768;r++){let n=r;n=(n&2863311530)>>>1|(n&1431655765)<<1,n=(n&3435973836)>>>2|(n&858993459)<<2,n=(n&4042322160)>>>4|(n&252645135)<<4,n=(n&4278255360)>>>8|(n&16711935)<<8,wt.rev15[r]=(n>>>16|n<<16)>>>17}function t(r,n,o){for(;n--!==0;)r.push(0,o)}for(let r=0;r<32;r++)wt.ldef[r]=wt.of0[r]<<3|wt.exb[r],wt.ddef[r]=wt.df0[r]<<4|wt.dxb[r];t(wt.fltree,144,8),t(wt.fltree,112,9),t(wt.fltree,24,7),t(wt.fltree,8,8),$p(wt.fltree,9),Ox(wt.fltree,9,wt.flmap),Nx(wt.fltree,9),t(wt.fdtree,32,5),$p(wt.fdtree,5),Ox(wt.fdtree,5,wt.fdmap),Nx(wt.fdtree,5),t(wt.itree,19,0),t(wt.ltree,286,0),t(wt.dtree,30,0),t(wt.ttree,320,0)})();function Ox(e,t,r){let n=e.length,o=wt.rev15;for(let i=0;i>1,a=e[i+1],l=s<<4|a,c=t-a,u=e[i]<>>15-t;r[m]=l,u++}}}function $p(e,t){let r=e.length,n=wt.bl_count;for(let s=0;s<=t;s++)n[s]=0;for(let s=1;s>>n}}function owe(e,t){let r=t===void 0;return t===void 0&&(t=new Uint8Array(e.length>>>2<<3)),{data:e,buf:t,noBuf:r,BFINAL:0,off:0,pos:0}}function iwe(e,t){let{data:r,noBuf:n}=e,{buf:o,BFINAL:i,off:s,pos:a}=e,l=0;for(;i===0&&l>>3)+4,f=r[h-4]|r[h-3]<<8;n&&(o=t5(o,s+f)),o.set(new Uint8Array(r.buffer,r.byteOffset+h,f),s),a=h+f<<3,s+=f;continue}if(n&&(o=t5(o,s+(1<<17))),p===1)c=wt.flmap,u=wt.fdmap,d=511,m=31;else if(p===2){let h=Yg(r,a,5)+257,f=Yg(r,a+5,5)+1,y=Yg(r,a+10,4)+4;a+=14;for(let S=0;S<38;S+=2)wt.itree[S]=0,wt.itree[S+1]=0;let g=1;for(let S=0;Sg&&(g=_)}a+=3*y,$p(wt.itree,g),Ox(wt.itree,g,wt.imap),c=wt.lmap,u=wt.dmap,a=swe(wt.imap,(1<>>4;if(!(f>>>8))o[s++]=f;else{if(f===256)break;{let y=s+f-254;if(f>264){let _=wt.ldef[f-257];y=s+(_>>>3)+Yg(r,a,_&7),a+=_&7}let g=u[n5(r,a)&m];a+=g&15;let v=g>>>4,b=wt.ddef[v],S=(b>>>4)+r5(r,a,b&15);for(a+=b&15,n&&(o=t5(o,s+(1<<17)));s>>4;if(l<=15)i[s]=l,s++;else{let c=0,u=0;l===16?(u=3+Yg(n,o,2),o+=2,c=i[s-1]):l===17?(u=3+Yg(n,o,3),o+=3):l===18&&(u=11+Yg(n,o,7),o+=7);let d=s+u;for(;s>>1;for(;io&&(o=a),i++}for(;i>>3]|e[(t>>>3)+1]<<8)>>>(t&7)&(1<>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)&(1<>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)}function PT(e,t,r){let n=[],o=e.length,i=t.length;for(let h=0;hr&&(awe(a,r,p),p=r);for(let h=0;ht;n++){let s=e[n].d;e[n].d=t,o+=i-(1<>>r-t;o>0;){let s=e[n].d;s=0;n--)e[n].d===t&&o<0&&(e[n].d--,o++);o!==0&&console.log("debt left")}function lwe(e,t,r,n){let{lits:o,strt:i,prev:s}=wt;return{data:e,out:t,opt:uwe[n],i:0,pos:r<<3,cvrd:0,dlen:e.length,li:0,lc:0,bs:0,ebits:0,c:0,nc:0,lits:o,strt:i,prev:s}}function cwe(e,t){let{data:r,dlen:n,out:o,opt:i}=e,{i:s,pos:a,cvrd:l,li:c,lc:u,bs:d,ebits:m,c:p,nc:h}=e,{lits:f,strt:y,prev:g}=wt,v=Math.min(s+t,n);for(;s14e3||u>26697)&&n-s>100&&(l>>16,_=b&65535,w=mY(S,wt.of0);wt.lhst[257+w]++;let E=mY(_,wt.df0);wt.dhst[E]++,m+=wt.exb[w]+wt.dxb[E],f[c]=S<<23|s-l,f[c+1]=_<<16|w<<8|E,c+=2,l=s+S}else wt.lhst[r[s]]++;u++}}e.i=s,e.pos=a,e.cvrd=l,e.li=c,e.lc=u,e.bs=d,e.ebits=m,e.c=p,e.nc=h}var uwe=[[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 pY(e,t,r,n,o){return Y(this,null,function*(){let i=lwe(t,r,n,o),{dlen:s}=i;if(o===0){let{i:h,pos:f}=i;for(;h>>3}for(s>2&&(i.nc=i5(t,0),i.strt[i.nc]=0);i.i>>3})}function dwe(e,t,r,n,o,i){let s=t&32767,a=r[s],l=s-a+32768&32767;if(a===s||n!==i5(e,t-l))return 0;let c=0,u=0,d=Math.min(32767,t);for(;l<=d&&--i!==0&&a!==s;){if(c===0||e[t+c]===e[t+c-l]){let m=mwe(e,t,l);if(m>c){if(c=m,u=l,c>=o)break;l+2p&&(p=g,a=f)}}}s=a,a=r[s],l+=s-a+32768&32767}return c<<16|u}function mwe(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;let n=t,o=Math.min(e.length,t+258);for(t+=3;t>>23,B=E+(P&(1<<23)-1);for(;E>16,R=D>>8&255,U=D&255;l=PC(257+R,_,a,l),h1(a,l,T-wt.of0[R]),l+=wt.exb[R],l=PC(U,w,a,l),IT(a,l,M-wt.df0[U]),l+=wt.dxb[U],E+=T}}l=PC(256,_,a,l)}return l}function hY(e,t,r,n,o){let i=o>>>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),o+(r+4<<3)}function pwe(){let e=PT(wt.lhst,wt.ltree,15),t=PT(wt.dhst,wt.dtree,15),r=[],n=dY(wt.ltree,r),o=[],i=dY(wt.dtree,o);for(let l=0;l4&&wt.itree[(wt.ordr[a-1]<<1)+1]===0;)a--;return[e,t,s,n,i,a,r,o]}function TC(e,t){let r=0;for(let n=0;n15&&(h1(r,n,s),n+=a)}return n}function dY(e,t){let r=e.length;for(;r!==2&&e[r-1]===0;)r-=2;for(let n=0;n>>1,138);c<11?t.push(17,c-3):t.push(18,c-11),n+=c*2-2}else if(o===a&&i===o&&s===o){let l=n+5;for(;l+2>>1,6);t.push(16,c-3),n+=c*2-2}else t.push(o,0)}return r>>>1}function mY(e,t){let r=0;return t[r|16]<=e&&(r|=16),t[r|8]<=e&&(r|=8),t[r|4]<=e&&(r|=4),t[r|2]<=e&&(r|=2),t[r|1]<=e&&(r|=1),r}function PC(e,t,r,n){return IT(r,n,t[e<<1]),n+t[(e<<1)+1]}function h1(e,t,r){r=r<<(t&7);let n=t>>>3;e[n]|=r,e[n+1]|=r>>>8}function IT(e,t,r){r=r<<(t&7);let n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16}function Ux(e,t,r=!1){return Y(this,null,function*(){let n=Object.create(null),o=new Uint8Array(t);if(Qp(o,0)!==19280)throw new Error('Invalid ZIP file. A valid ZIP file must start with two magic bytes \\x50\\x4b ("PK" in ASCII).');let i=o.length-4;for(;Wg(o,i)!==101010256;)i--;let s=i;s+=4,s+=4;let a=Qp(o,s);s+=2,s+=2,s+=4;let l=Wg(o,s);s+=4,s=l;for(let c=0;cgwe(r,e,t))}function gwe(e,t,r=!1){return Y(this,null,function*(){let n=0,o={};for(let d in t){let m=!ywe(d)&&!r,p=t[d],h=e5(p,0,p.length);o[d]={cpr:m,usize:p.length,crc:h,file:m?yield hwe(e,p):p}}for(let d in o)n+=o[d].file.length+30+46+2*JR(d);n+=22;let i=new Uint8Array(n),s=0,a=[];for(let d in o){let m=o[d];a.push(s),s=gY(i,s,d,m,0)}let l=0,c=s;for(let d in o){let m=o[d];a.push(s),s=gY(i,s,d,m,1,a[l++])}let u=s-c;return Zp(i,s,101010256),s+=4,s+=4,qg(i,s,l),s+=2,qg(i,s,l),s+=2,Zp(i,s,u),s+=4,Zp(i,s,c),s+=4,s+=2,i.buffer})}function ywe(e){let t=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(t)!==-1}function gY(e,t,r,n,o,i=0){let s=n.file;Zp(e,t,o===0?67324752:33639248),t+=4,o===1&&(t+=2),qg(e,t,20),t+=2,qg(e,t,0),t+=2,qg(e,t,n.cpr?8:0),t+=2,Zp(e,t,0),t+=4,Zp(e,t,n.crc),t+=4,Zp(e,t,s.length),t+=4,Zp(e,t,n.usize),t+=4,qg(e,t,JR(r)),t+=2,qg(e,t,0),t+=2,o===1&&(t+=2,t+=2,t+=6,Zp(e,t,i),t+=4);let a=aY(e,t,r);return t+=a,o===0&&(e.set(s,t),t+=s.length),t}var Dd=function(e){return e[e.None=0]="None",e[e.Gzip=1]="Gzip",e[e.Zip=2]="Zip",e}(Dd||{});function Ym(e,t){return Swe(e,t)}function IC(e){return typeof e=="string"?SY(e,e,"string"):SY(e.title,e.url,e.type||"string",e.body,e.headers)}function vwe(e){if(!ph&&e instanceof FileReader)return e.readyState===FileReader.DONE;if(e instanceof Fx)return e.readyState===Fx.DONE;throw new Error("unknown data type")}function bY(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 AY(e,t,r){return new Promise((n,o)=>{if(vwe(r)){let{error:s}=r;s!=null?o(s??bY(r instanceof Fx)):n(r);return}let i=!1;r.onerror=s=>{if(i)return;let{error:a}=s.target;o(a??bY(r instanceof Fx))},r.onprogress=s=>{if(!(!e.shouldUpdate||i))try{s.lengthComputable?e.update({message:t,isIndeterminate:!1,current:s.loaded,max:s.total}):e.update({message:`${t} ${(s.loaded/1024/1024).toFixed(2)} MB`,isIndeterminate:!0})}catch(a){i=!0,o(a)}},r.onload=s=>{n(r)}})}function TY(e){return/\.gz$/i.test(e)?Dd.Gzip:/\.zip$/i.test(e)?Dd.Zip:Dd.None}var xwe=/^(__MACOSX|.DS_Store)/;function bwe(e,t,r){return Y(this,null,function*(){switch(r){case Dd.None:return t;case Dd.Gzip:return vY(e,t);case Dd.Zip:let n=yield Ux(e,t.buffer),o=Object.keys(n).filter(i=>!xwe.test(i));if(o.length!==1)throw new Error("can only decompress zip files with a single entry");return n[o[0]]}})}function PY(e,t,r,n){return Y(this,null,function*(){let o=t instanceof ArrayBuffer?new Uint8Array(t):t;if(o===null)throw new Error("no data given");if(n!==Dd.None){if(!(o instanceof Uint8Array))throw new Error("need Uint8Array for decompression");let i=yield bwe(e,o,n);r==="string"?(yield e.update({message:"Decoding text..."}),o=Tx(i,0,i.length)):o=i}if(r==="binary"&&o instanceof Uint8Array)return o;if(r==="zip"&&o instanceof Uint8Array)return yield Ux(e,o.buffer);if(r==="string"&&typeof o=="string")return o;if(r==="xml"&&typeof o=="string")return new DOMParser().parseFromString(o,"application/xml");if(r==="json"&&typeof o=="string")return JSON.parse(o);throw new Error(`could not get requested response data '${r}'`)})}function Swe(e,t){if(ph)return Cwe(e,t);let r;return Pe.create("Read File",n=>Y(this,null,function*(){try{r=new FileReader;let o=t==="zip"?Dd.None:TY(e.name);t==="binary"||t==="zip"||o!==Dd.None?r.readAsArrayBuffer(e):r.readAsText(e),yield n.update({message:"Opening file...",canAbort:!0});let i=yield AY(n,"Reading...",r);return yield n.update({message:"Processing file...",canAbort:!1}),yield PY(n,i.result,t,o)}finally{r=void 0}}),()=>{r&&r.abort()})}function Cwe(e,t){return Pe.create("Read File",r=>Y(this,null,function*(){let n=t==="zip"?Dd.None:TY(e.name);yield r.update({message:"Opening file...",canAbort:!1});let o;return t==="binary"||t==="zip"||n!==Dd.None?o=yield e.arrayBuffer():o=yield e.text(),yield r.update({message:"Processing file...",canAbort:!1}),yield PY(r,o,t,n)}))}var s5=(()=>{class e{static get(){return this.pool.length?this.pool.pop():new Fx}static emptyFunc(){}static deposit(r){this.pool.length=200&&e.status<400){let{response:r}=e;if(s5.deposit(e),(t==="binary"||t==="zip")&&r instanceof ArrayBuffer)return new Uint8Array(r);if(t==="string"&&typeof r=="string")return r;if(t==="xml"&&r instanceof XMLDocument)return r;if(t==="json"&&typeof r=="object")return r;throw new Error(`could not get requested response data '${t}'`)}else throw s5.deposit(e),new Error(`Download failed with status code ${e.status}`)}function wwe(e){switch(e){case"json":return"json";case"xml":return"document";case"string":return"text";case"binary":return"arraybuffer";case"zip":return"arraybuffer"}}function SY(e,t,r,n,o){if(ph&&t.startsWith("file://"))return Twe(e,t,r,n,o);let i;return Pe.create(e||"Download",s=>Y(this,null,function*(){if(i=s5.get(),i.open(n?"post":"get",t,!0),o)for(let[c,u]of o)i.setRequestHeader(c,u);i.responseType=wwe(r),i.send(n),yield s.update({message:"Waiting for server...",canAbort:!0});let a=yield AY(s,"Downloading...",i);return i=void 0,yield s.update({message:"Parsing response...",canAbort:!1}),_we(a,r)}),()=>{i&&(i.abort(),i=void 0)})}var CY;function Awe(){if(!CY)throw new Error("When running in Node.js and reading from files, call mol-util/data-source's setFSModule function first.");return CY}function Twe(e,t,r,n,o){if(!ph)throw new Error("This function should only be used when running in Node.js");if(!t.startsWith("file://"))throw new Error("This function is only for URLs with protocol file://");let i=t.substring(7),s=Awe().readFileSync(i),a=new AC([s],"raw-data");return Ym(a,r)}function IY(e,t,r,n){return Y(this,null,function*(){let o=r.length,i=new Array(r.length);yield e.update({message:"Downloading...",current:0,max:o});let s=[],a=[],l=0;for(let u=Math.min(o,n);l0;){let u=yield Promise.race(s),d=r[u.index],m=a.indexOf(u.index);if(c++,u.kind==="error"&&!d.canFail)throw new Error(`${d.url}: ${u.error}`);if(e.shouldUpdate&&(yield e.update({message:"Downloading...",current:c,max:o})),i[u.index]=u,s=s.filter(_Y,m),a=a.filter(_Y,m),l{u.release(c)}}}e.Wrapper=i;function s(l){return typeof l=="string"?l:l.url}e.getUrl=s;function a(l,c,u){return typeof c=="string"?l.tryFindUrl(c,u)||t(c,{body:u}):c}e.getUrlAsset=a})(Or||(Or={}));var ET=class{constructor(){this._assets=new Map}get assets(){return dx(this._assets.values())}tryFindUrl(t,r){let n=this.assets.values();for(;;){let o=n.next();if(o.done)return;let i=o.value.asset;if(Or.isUrl(i)&&i.url===t&&(i.body||"")===(r||""))return i}}set(t,r){this._assets.set(t.id,{asset:t,file:r,refCount:0})}get(t){return this._assets.get(t.id)}delete(t){return this._assets.delete(t.id)}has(t){return this._assets.has(t.id)}resolve(t,r,n=!0){return Or.isUrl(t)?Pe.create(`Download ${t.title||t.url}`,o=>Y(this,null,function*(){if(this._assets.has(t.id)){let a=this._assets.get(t.id);return a.refCount++,Or.Wrapper(yield Ym(a.file,r).runInContext(o),t,this)}if(!n)return Or.Wrapper(yield IC(te(k({},t),{type:r})).runInContext(o),t,this);let i=yield IC(te(k({},t),{type:"binary"})).runInContext(o),s=new AC([i],"raw-data");return this._assets.set(t.id,{asset:t,file:s,refCount:1}),Or.Wrapper(yield Ym(s,r).runInContext(o),t,this)})):Pe.create(`Read ${t.name}`,o=>Y(this,null,function*(){if(this._assets.has(t.id)){let i=this._assets.get(t.id);return i.refCount++,Or.Wrapper(yield Ym(i.file,r).runInContext(o),t,this)}if(!(t.file instanceof AC))throw new Error(`Cannot resolve file asset '${t.name}' (${t.id})`);return n&&this._assets.set(t.id,{asset:t,file:t.file,refCount:1}),Or.Wrapper(yield Ym(t.file,r).runInContext(o),t,this)}))}release(t){let r=this._assets.get(t.id);r&&(r.refCount--,r.refCount<=0&&this._assets.delete(t.id))}clear(){this._assets.clear()}dispose(){this.clear()}};var C;(function(e){e.Essential={isEssential:!0};function t(le,j){return j&&(j.label&&(le.label=j.label),j.description&&(le.description=j.description),j.legend&&(le.legend=j.legend),j.fieldLabels&&(le.fieldLabels=j.fieldLabels),j.isHidden&&(le.isHidden=j.isHidden),j.shortLabel&&(le.shortLabel=j.shortLabel),j.twoColumns&&(le.twoColumns=j.twoColumns),j.isEssential&&(le.isEssential=j.isEssential),j.category&&(le.category=j.category),j.hideIf&&(le.hideIf=j.hideIf),j.help&&(le.help=j.help)),le}function r(le){let j=k({},le);return j.isOptional=!0,j}e.Optional=r;function n(le,j){return t({type:"value",defaultValue:le},j)}e.Value=n;function o(le,j,ue){return t({type:"select",defaultValue:Ie(le,j),options:j,cycle:ue?.cycle},ue)}e.Select=o;function i(le,j,ue){let fe=t({type:"multi-select",defaultValue:le,options:j},ue);return ue?.emptyValue&&(fe.emptyValue=ue.emptyValue),fe}e.MultiSelect=i;function s(le,j){return t({type:"boolean",defaultValue:le},j)}e.Boolean=s;function a(le="",j){return t({type:"text",defaultValue:le,multiline:j?.multiline,placeholder:j?.placeholder,disableInteractiveUpdates:j?.disableInteractiveUpdates},j)}e.Text=a;function l(le,j){let ue=t({type:"color",defaultValue:le},j);return j?.isExpanded&&(ue.isExpanded=j.isExpanded),ue}e.Color=l;function c(le,j){let ue;if(typeof le=="string"){let fe=zs(le);ue={kind:fe.type!=="qualitative"?"interpolate":"set",colors:fe.list}}else ue=le;return t({type:"color-list",presetKind:j?.presetKind||"all",defaultValue:ue,offsets:!!j?.offsets},j)}e.ColorList=c;function u(le,j,ue){return t(f({type:"vec3",defaultValue:le},j),ue)}e.Vec3=u;function d(le,j){return t({type:"mat4",defaultValue:le},j)}e.Mat4=d;function m(le,j){let ue=typeof le=="string"?Or.Url(le):Or.Url(le.url,{body:le.body});return t({type:"url",defaultValue:ue},j)}e.Url=m;function p(le){let j=t({type:"file",defaultValue:null},le);return le?.accept&&(j.accept=le.accept),j}e.File=p;function h(le){let j=t({type:"file-list",defaultValue:null},le);return le?.accept&&(j.accept=le.accept),j}e.FileList=h;function f(le,j){return j&&(typeof j.min<"u"&&(le.min=j.min),typeof j.max<"u"&&(le.max=j.max),typeof j.step<"u"&&(le.step=j.step)),le}function y(le,j,ue){let fe=t(f({type:"number",defaultValue:le},j),ue);return ue?.immediateUpdate&&(fe.immediateUpdate=!0),fe}e.Numeric=y;function g(le,j,ue){return t(f({type:"interval",defaultValue:le},j),ue)}e.Interval=g;function v(le,j){let ue=t({type:"line-graph",defaultValue:le},j);return j?.getVolume&&(ue.getVolume=j.getVolume),ue}e.LineGraph=v;function b(le,j){let ue=t({type:"group",defaultValue:j?.customDefault||F(le),params:le},j);return j?.presets&&(ue.presets=j.presets),j?.isExpanded&&(ue.isExpanded=j.isExpanded),j?.isFlat&&(ue.isFlat=j.isFlat),j?.pivot&&(ue.pivot=j.pivot),ue}e.Group=b;function S(le){return b({},le)}e.EmptyGroup=S;function _(le,j,ue,fe){let De=Ie(le,j);return t({type:"mapped",defaultValue:{name:De,params:ue(De).defaultValue},select:o(De,j,fe),map:ue},fe)}e.Mapped=_;function w(le,j,ue){let fe=ue?.options?ue.options:Object.keys(j).map(Re=>[Re,j[Re].label||Us(Re)]),De=Ie(le,fe);return t({type:"mapped",defaultValue:{name:De,params:j[De].defaultValue},select:o(De,fe,ue),map:Re=>j[Re]},ue)}e.MappedStatic=w;function E(le,j,ue){return t({type:"object-list",element:le,getLabel:j,ctor:A,defaultValue:ue?.defaultValue||[]},ue)}e.ObjectList=E;function A(){return F(this.element)}function P(){throw new Error("getValue not set. Fix runtime.")}function T(le,j,ue){var fe;return t({type:"value-ref",defaultValue:{ref:(fe=ue?.defaultRef)!==null&&fe!==void 0?fe:"",getValue:P},getOptions:le,resolveRef:j},ue)}e.ValueRef=T;function B(le){var j;return t({type:"data-ref",defaultValue:{ref:(j=le?.defaultRef)!==null&&j!==void 0?j:"",getValue:P}},le)}e.DataRef=B;function D(le,j,ue){return t({type:"converted",defaultValue:j(ue.defaultValue),converted:ue,fromValue:le,toValue:j},ue)}e.Converted=D;function M(le,j,ue,fe,De){let Re=Object.keys(j).map(Xe=>[Xe,Xe]);return t({type:"conditioned",select:o(ue(le),Re,De),defaultValue:le,conditionParams:j,conditionForValue:ue,conditionedValue:fe},De)}e.Conditioned=M;function R(le,j){return t({type:"script",defaultValue:le},j)}e.Script=R;function U(le){return 0}e.For=U;function F(le){let j={};for(let ue of Object.keys(le))le[ue].isOptional||(j[ue]=le[ue].defaultValue);return j}e.getDefaultValues=F;function N(le,j,ue){return()=>le(j,ue)}function z(le,j,ue){if(j){if(le.type==="value-ref"){let fe=j;fe.ref?fe.getValue=N(le.resolveRef,fe.ref,ue):fe.getValue=()=>{throw new Error("Unset ref in ValueRef value.")}}else if(le.type==="data-ref"){let fe=j;fe.ref?fe.getValue=N(ue,fe.ref,ue):fe.getValue=()=>{throw new Error("Unset ref in ValueRef value.")}}else if(le.type==="group")J(le.params,j,ue);else if(le.type==="mapped"){let fe=j,De=le.map(fe.name);z(De,fe.params,ue)}else if(le.type==="object-list"){if(!O(le.element))return;for(let fe of j)J(le.element,fe,ue)}}}function q(le){if(le.type==="value-ref"||le.type==="data-ref")return!0;if(le.type==="group"){if(O(le.params))return!0}else if(le.type==="mapped"){for(let[j]of le.select.options)if(q(le.map(j)))return!0}else if(le.type==="object-list")return O(le.element);return!1}function O(le){for(let j of Object.keys(le))if(q(le[j]))return!0;return!1}function J(le,j,ue){for(let fe of Object.keys(le))z(le[fe],j?.[fe],ue)}e.resolveRefs=J;function Q(le,j){for(let ue of Object.keys(le))le[ue].isOptional||(le[ue].defaultValue=j[ue])}e.setDefaultValues=Q;function H(le){return ba(le)}e.clone=H;function W(le,j){}e.validate=W;function K(le,j,ue){if(j===ue)return!0;if(typeof j!="object"||typeof ue!="object")return!1;for(let fe of Object.keys(le))if(!ce(le[fe],j[fe],ue[fe]))return!1;return!0}e.areEqual=K;function ce(le,j,ue){if(j===ue)return!0;if(le.type==="group")return K(le.params,j,ue);if(le.type==="mapped"){let fe=j,De=ue;if(fe.name!==De.name)return!1;let Re=le.map(fe.name);return ce(Re,fe.params,De.params)}else if(le.type==="multi-select"){let fe=j,De=ue;if(fe.length!==De.length)return!1;if(fe.length<10){for(let Re=0,Xe=fe.length;Re"u")return ue?le.defaultValue:void 0;if(!X(le.select,fe.name))return le.defaultValue;let De=le.map(fe.name);return{name:fe.name,params:Z(De,fe.params,ue)}}else{if(le.type==="select")return X(le,j)?j:le.defaultValue;if(le.type==="multi-select"){if(!Array.isArray(j))return le.defaultValue;let fe=j.filter(function(De){return X(this,De)},le);return j.length>0&&fe.length===0?le.defaultValue:fe}else if(le.type==="object-list")return Array.isArray(j)?j.map(fe=>ie(le.element,fe,ue?"all":"skip")):le.defaultValue}return j}function ie(le,j,ue){if(typeof j!="object"||j===null)return ue?F(le):j;let fe=Object.create(null);for(let De of Object.keys(le)){let Re=le[De];j[De]===void 0?ue==="all"&&(fe[De]=Re.defaultValue):fe[De]=Z(Re,j[De],ue!=="skip")}return fe}e.normalizeParams=ie;function de(le,j){let ue=[];for(let fe of Object.keys(le))if(!j)typeof le[fe]=="string"?ue.push([fe,le[fe]]):ue.push([fe,j===null?fe:Us(fe)]);else{let De=j(fe,le[fe]);ue.push(typeof De=="string"?[fe,De]:[fe,De[0],De[1]])}return ue}e.objectToOptions=de;function we(le,j){let ue=[];for(let fe of le)j?ue.push([fe,j(fe)]):ue.push([fe,j===null?fe:Us(fe)]);return ue}e.arrayToOptions=we;function Be(le,j){for(let ue of le.options)if(ue[0]===j)return ue[1];return""}e.optionLabel=Be;function Ie(le,j){for(let ue of j)if(ue[0]===le)return le;return j.length>0?j[0][0]:void 0}})(C||(C={}));function EY(e){let{unit:t,flags:r,proteinInfo:n}=e,o=t.conformation,{traceElementIndex:i}=t.model.atomicHierarchy.derived.residue,{residueIndices:s,nIndices:a}=n,l=s.length,c=(g,v)=>g===-1?x.setNaN(v):o.position(g,v),u=x(),d=x(),m=x(),p=x(),h=x(),f=x(),y=x();e:for(let g=2;g6.25)continue e}let v=s[g-2],b=s[g],S=s[g+2],_=i[v],w=i[b],E=i[S];c(_,u),c(w,d),c(E,m),x.sub(f,u,d),x.sub(y,d,m);let A=Fs(x.angle(f,y));A&&A>70&&(r[g]|=32)}}var Pwe=9,DT=-27.888,Iwe=-.5,DY=-9.9;function Ewe(e,t,r,n){let o=x.distance(e,n),i=x.distance(t,n),s=x.distance(t,r),a=x.distance(e,r),l=DT/o-DT/i,c=DT/s-DT/a,u=l+c;return uIwe||(m[m.length]=A,p[p.length]=F,h[h.length]=q)}}return Dwe(d,m,p,h)}function Dwe(e,t,r,n){let o=new ls.DirectedEdgeBuilder(e,t,r),i=new Float32Array(o.slotCount);for(let s=0,a=o.edgeCount;s0&&(t.secondStart-e.secondEnd<6&&t.firstStart-e.firstEnd<3||t.secondStart-e.secondEnd<3)}function LY(e){let{bridges:t,ladders:r}=e;for(let n=0;np||(a=c+1,l=p,a!==l&&r.getDirectedEdgeIndex(l,a+1)!==-1&&(n[a]|=2,n[l]|=2,o[o.length]=new g1(a,l,0)),a=c,l=p-1,a!==l&&r.getDirectedEdgeIndex(l-1,a)!==-1&&(n[a]|=2,n[l]|=2,o[o.length]=new g1(l,a,0)),a=c,l=p,a!==l&&r.getDirectedEdgeIndex(l,a)!==-1&&(n[a]|=2,n[l]|=2,o[o.length]=new g1(l,a,1)),a=c+1,l=p-1,a!==l&&r.getDirectedEdgeIndex(l-1,a+1)!==-1&&(n[a]|=2,n[l]|=2,o[o.length]=new g1(l,a,1)))}o.sort((c,u)=>c.partner1>u.partner1?1:c.partner1_===-1?x.setNaN(w):i.position(_,w),u=x(),d=x(),m=x(),p=x(),h=x(),f=x(),y=x(),g=x(),v=x();if(l===0)return{phi:new Float32Array(0),psi:new Float32Array(0)};let b=new Float32Array(l-1),S=new Float32Array(l-1);c(-1,u),c(-1,d),c(-1,m),c(r[0],p),c(a[o[0]],h),c(n[0],f),c(r[1],y),c(a[o[1]],g),c(n[1],v);for(let _=0;_Fe.indexOf(n,b);for(let b=0,S=n.length;b(o in l[i]||(l[i][o]={props:k({},C.getDefaultValues(n.getParams(l))),data:Up.create(void 0)}),l[i][o]),a=(l,c,u)=>{let d=s(l);l[i][o]={props:c,data:Up.withValue(d.data,u)}};return{label:n.label,descriptor:n.descriptor,isHidden:n.isHidden,getParams:l=>{let c=C.clone(n.getParams(l));return C.setDefaultValues(c,s(l).props),c},defaultParams:n.defaultParams,isApplicable:n.isApplicable,attach:(m,p,...h)=>Y(this,[m,p,...h],function*(l,c,u={},d){d&&c.customPropertyDescriptors.reference(n.descriptor,!0),n.type==="root"&&(c=c.root);let f=s(c.root).props,y=s(c),g=C.merge(n.defaultParams,f,u);if(y.data.value&&C.areEqual(n.defaultParams,y.props,g))return;let{value:v,assets:b}=yield n.obtain(l,c,g);c.customPropertyDescriptors.add(n.descriptor),c.customPropertyDescriptors.assets(n.descriptor,b),a(c,g,v)}),ref:(l,c)=>l.customPropertyDescriptors.reference(n.descriptor,c),get:l=>s(l).data,set:(l,c={},u)=>{n.type==="root"&&(l=l.root);let d=s(l),m=C.merge(n.defaultParams,d.props,c);C.areEqual(n.defaultParams,d.props,m)||(a(l,m,u),l.customPropertyDescriptors.assets(n.descriptor))},props:l=>s(l).props}}e.createProvider=t;function r(n,o,i){let s={value:C.Value(i,{isHidden:!0})};return t({label:Us(n),descriptor:Pi({name:n}),isHidden:!0,type:o,defaultParams:s,getParams:()=>({value:C.Value(i,{isHidden:!0})}),isApplicable:()=>!0,obtain:(a,l,c)=>Y(this,null,function*(){return k(k({},C.getDefaultValues(s)),c)})})}e.createSimple=r})(Sc||(Sc={}));function qY(e){let t="model";if(e){t="dssp";for(let r=0,n=e.models.length;r!0,obtain:(e,t,r)=>Y(void 0,null,function*(){let n=k(k({},C.getDefaultValues(jY)),r);switch(n.type.name){case"dssp":return{value:yield zwe(t,n.type.params)};case"model":return{value:yield Vwe(t)}}})});function zwe(e,t){return Y(this,null,function*(){let r=new Map;for(let n=0,o=e.unitSymmetryGroups.length;n!0,false:e=>!1,zero:e=>0};function bi(){throw new Error("Property only available for atomic models.")}function fh(e){throw e?new Error(`Property only available for coarse models (${e}).`):new Error("Property only available for coarse models.")}var EC={key:e=>e.element,x:e=>e.unit.conformation.x(e.element),y:e=>e.unit.conformation.y(e.element),z:e=>e.unit.conformation.z(e.element),id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicConformation.atomId.value(e.element):bi(),occupancy:e=>_e.isAtomic(e.unit)?e.unit.model.atomicConformation.occupancy.value(e.element):bi(),B_iso_or_equiv:e=>_e.isAtomic(e.unit)?e.unit.model.atomicConformation.B_iso_or_equiv.value(e.element):bi(),sourceIndex:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atomSourceIndex.value(e.element):e.element,type_symbol:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.type_symbol.value(e.element):bi(),label_atom_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.label_atom_id.value(e.element):bi(),auth_atom_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.auth_atom_id.value(e.element):bi(),label_alt_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.label_alt_id.value(e.element):bi(),label_comp_id:kT,auth_comp_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.auth_comp_id.value(e.element):bi(),pdbx_formal_charge:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.pdbx_formal_charge.value(e.element):bi(),vdw_radius:e=>_e.isAtomic(e.unit)?Xp(e.unit.model.atomicHierarchy.atoms.type_symbol.value(e.element)):bi()};function kT(e){return _e.isAtomic(e.unit)||bi(),e.unit.model.atomicHierarchy.atoms.label_comp_id.value(e.element)}function a5(e){return _e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.label_seq_id.value(e.unit.residueIndex[e.element]):bi()}function Hwe(e){_e.isAtomic(e.unit)||bi();let t=e.unit.model.sequence.byEntityKey[Cc(e)];return t&&t.sequence.microHet.has(a5(e))}function WY(e){_e.isAtomic(e.unit)||bi();let t=e.unit.model.sequence.byEntityKey[Cc(e)];return t?t.sequence.microHet.get(a5(e))||[kT(e)]:[kT(e)]}var jwe={key:e=>_e.isAtomic(e.unit)?e.unit.residueIndex[e.element]:bi(),group_PDB:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.group_PDB.value(e.unit.residueIndex[e.element]):bi(),label_seq_id:a5,auth_seq_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.auth_seq_id.value(e.unit.residueIndex[e.element]):bi(),pdbx_PDB_ins_code:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.pdbx_PDB_ins_code.value(e.unit.residueIndex[e.element]):bi(),isNonStandard:e=>_e.isAtomic(e.unit)?WY(e).some(t=>e.unit.model.properties.chemicalComponentMap.get(t).mon_nstd_flag[0]==="n"):bi(),hasMicroheterogeneity:Hwe,microheterogeneityCompIds:WY,secondary_structure_type:e=>{var t;_e.isAtomic(e.unit)||bi();let r=(t=wa.get(e.structure).value)===null||t===void 0?void 0:t.get(e.unit.invariantId);return r?r.type[r.getIndex(e.unit.residueIndex[e.element])]:536870912},secondary_structure_key:e=>{var t;_e.isAtomic(e.unit)||bi();let r=(t=wa.get(e.structure).value)===null||t===void 0?void 0:t.get(e.unit.invariantId);return r?r.key[r.getIndex(e.unit.residueIndex[e.element])]:-1},chem_comp_type:e=>_e.isAtomic(e.unit)?e.unit.model.properties.chemicalComponentMap.get(kT(e)).type:bi()},qwe={key:e=>_e.isAtomic(e.unit)?e.unit.chainIndex[e.element]:bi(),label_asym_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.chains.label_asym_id.value(e.unit.chainIndex[e.element]):bi(),auth_asym_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.chains.auth_asym_id.value(e.unit.chainIndex[e.element]):bi(),label_entity_id:e=>_e.isAtomic(e.unit)?e.unit.model.atomicHierarchy.chains.label_entity_id.value(e.unit.chainIndex[e.element]):bi()},Wwe={key:EC.key,entityKey:e=>_e.isCoarse(e.unit)?e.unit.coarseElements.entityKey[e.element]:fh(),x:EC.x,y:EC.y,z:EC.z,asym_id:e=>_e.isCoarse(e.unit)?e.unit.coarseElements.asym_id.value(e.element):fh(),entity_id:e=>_e.isCoarse(e.unit)?e.unit.coarseElements.entity_id.value(e.element):fh(),seq_id_begin:e=>_e.isCoarse(e.unit)?e.unit.coarseElements.seq_id_begin.value(e.element):fh(),seq_id_end:e=>_e.isCoarse(e.unit)?e.unit.coarseElements.seq_id_end.value(e.element):fh(),sphere_radius:e=>_e.isSpheres(e.unit)?e.unit.coarseConformation.radius[e.element]:fh("spheres"),sphere_rmsf:e=>_e.isSpheres(e.unit)?e.unit.coarseConformation.rmsf[e.element]:fh("spheres"),gaussian_weight:e=>_e.isGaussians(e.unit)?e.unit.coarseConformation.weight[e.element]:fh("gaussians"),gaussian_covariance_matrix:e=>_e.isGaussians(e.unit)?e.unit.coarseConformation.covariance_matrix[e.element]:fh("gaussians")};function Cc(e){switch(e.unit.kind){case 0:return e.unit.model.atomicHierarchy.index.getEntityFromChain(e.unit.chainIndex[e.element]);case 1:return e.unit.model.coarseHierarchy.spheres.entityKey[e.element];case 2:return e.unit.model.coarseHierarchy.gaussians.entityKey[e.element]}}var Ywe={key:Cc,id:e=>e.unit.model.entities.data.id.value(Cc(e)),type:e=>e.unit.model.entities.data.type.value(Cc(e)),src_method:e=>e.unit.model.entities.data.src_method.value(Cc(e)),pdbx_description:e=>e.unit.model.entities.data.pdbx_description.value(Cc(e)),formula_weight:e=>e.unit.model.entities.data.formula_weight.value(Cc(e)),pdbx_number_of_molecules:e=>e.unit.model.entities.data.pdbx_number_of_molecules.value(Cc(e)),details:e=>e.unit.model.entities.data.details.value(Cc(e)),pdbx_mutation:e=>e.unit.model.entities.data.pdbx_mutation.value(Cc(e)),pdbx_fragment:e=>e.unit.model.entities.data.pdbx_fragment.value(Cc(e)),pdbx_ec:e=>e.unit.model.entities.data.pdbx_ec.value(Cc(e)),subtype:e=>e.unit.model.entities.subtype.value(Cc(e)),prd_id:e=>{var t,r;return(r=(t=e.unit.model.entities.prd_id)===null||t===void 0?void 0:t.value(Cc(e)))!==null&&r!==void 0?r:""}},Xwe=[],Kwe={id:e=>e.unit.id,chainGroupId:e=>e.unit.chainGroupId,multiChain:e=>_e.Traits.is(e.unit.traits,_e.Trait.MultiChain),object_primitive:e=>e.unit.objectPrimitive,operator_name:e=>e.unit.conformation.operator.name,operator_key:e=>e.unit.conformation.operator.key,model_index:e=>e.unit.model.modelNum,model_label:e=>e.unit.model.label,model_entry_id:e=>e.unit.model.entryId,hkl:e=>e.unit.conformation.operator.hkl,spgrOp:e=>e.unit.conformation.operator.spgrOp,model_num:e=>e.unit.model.modelNum,pdbx_struct_assembly_id:e=>{var t;return((t=e.unit.conformation.operator.assembly)===null||t===void 0?void 0:t.id)||Vn.DefaultName},pdbx_struct_oper_list_ids:e=>{var t;return((t=e.unit.conformation.operator.assembly)===null||t===void 0?void 0:t.operList)||Xwe},struct_ncs_oper_id:e=>e.unit.conformation.operator.ncsId},Ne={constant:Gwe,atom:EC,residue:jwe,chain:qwe,entity:Ywe,unit:Kwe,coarse:Wwe};var Xg=class{add(t){let r=this.index.get(t.label_asym_id);r||(r=new Map,this.index.set(t.label_asym_id,r));let n=r.get(t.label_seq_id);return n||(n=[],r.set(t.label_seq_id,n)),this._find(t,n)?!1:(n.push(t),!0)}hasLabelAsymId(t){return this.index.has(t)}has(t){var r,n;let o=YY(t);if(!this.index.has(o))return;let i=this.index.get(o),s=XY(t);if(!i.has(s))return;let a=i.get(s),l=KY(t),c=QY(t),u=ZY(t),d=(r=$Y(t))!==null&&r!==void 0?r:"1_555";for(let m of a)if(!(m.label_comp_id!==l||m.label_alt_id!==c||m.ins_code!==u)&&!(this.checkOperator&&((n=m.operator_name)!==null&&n!==void 0?n:"1_555")!==d))return m}static getLabel(t,r=!1){var n;return`${t.label_asym_id} ${t.label_comp_id} ${t.label_seq_id}:${t.ins_code}:${t.label_alt_id}${r?" "+((n=t.operator_name)!==null&&n!==void 0?n:"1_555"):""}`}static getEntryFromLocation(t){var r;return{label_asym_id:YY(t),label_comp_id:KY(t),label_seq_id:XY(t),label_alt_id:QY(t),ins_code:ZY(t),operator_name:(r=$Y(t))!==null&&r!==void 0?r:"1_555"}}_find(t,r){var n,o;for(let i of r)if(!(i.label_comp_id!==t.label_comp_id||i.label_alt_id!==t.label_alt_id||i.ins_code!==t.ins_code)&&!(this.checkOperator&&((n=i.operator_name)!==null&&n!==void 0?n:"1_555")!==((o=t.operator_name)!==null&&o!==void 0?o:"1_555")))return!0;return!1}constructor(t){var r;this.index=new Map,this.checkOperator=!1,this.checkOperator=(r=t?.checkOperator)!==null&&r!==void 0?r:!1}},YY=Ne.chain.label_asym_id,XY=Ne.residue.label_seq_id,KY=Ne.atom.label_comp_id,QY=Ne.atom.label_alt_id,ZY=Ne.residue.pdbx_PDB_ins_code,$Y=Ne.unit.operator_name;function zx(e,t,r){let n=t.subsetBuilder(!0);for(let o of r.units){if(o.kind!==0){n.setUnit(o.id,o.elements);continue}let{residueAtomSegments:i}=o.model.atomicHierarchy,s=t.unitMap.get(o.id).elements,a=o.elements;n.beginUnit(o.id);let l=Bt.transientSegments(i,a);for(;l.hasNext;){let c=l.move().index;for(let u=i.offsets[c],d=i.offsets[c+1];u(e.element.structure=r.structure,e.element.unit=r.unit,e.element.element=r.element,t(e))}function $we(e,t){let r=0;e.element.structure=e.inputStructure;for(let n of e.inputStructure.units){e.element.unit=n;let o=n.elements;for(let i=0,s=o.length;ir&&(r=l)}}return e.throwIfTimedOut(),r}function Jwe(e,t){return function(n){let o=e(n);if(t.elementRadius){let i=te(k({},t),{elementRadius:t.elementRadius,elementRadiusClosure:Zwe(n,t.elementRadius),sourceMaxRadius:$we(n,t.elementRadius)});if(lt.isSingleton(o)){let s=JY(n,n.inputStructure,o.structure,i);return lt.Singletons(n.inputStructure,s)}else{let s=new Bx(n.inputStructure);for(let a of o.structures)s.add(JY(n,n.inputStructure,a,i));return s.getSelection()}}if(lt.isSingleton(o)){let i=l5(n,n.inputStructure,o.structure,t);return lt.Singletons(n.inputStructure,i)}else{let i=new Bx(n.inputStructure);for(let s of o.structures)i.add(l5(n,n.inputStructure,s,t));return i.getSelection()}}}function e3e(e,t){return function(n){let o=e(n);if(lt.structureCount(o)===0)return o;let i=lt.UniqueBuilder(n.inputStructure),s=a=>i.add(a);return lt.forEach(o,(a,l)=>{n.pushInputStructure(a),lt.forEach(t(n),s),n.popInputStructure(),l%10===0&&n.throwIfTimedOut()}),i.getSelection()}}function t3e(e,t){return function(n){let o=e(n);if(lt.structureCount(o)===0)return o;let i=t(n);if(lt.structureCount(i)===0)return lt.Empty(n.inputStructure);let s=lt.unionStructure(i),a=lt.UniqueBuilder(n.inputStructure);return lt.forEach(o,(l,c)=>{let u=uT(s,l);u.elementCount!==0&&a.add(u),c%50===0&&n.throwIfTimedOut()}),a.getSelection()}}function r3e(e,t){return function(n){let o=e(n);if(lt.structureCount(o)===0)return o;let i=t(n);if(lt.structureCount(i)===0)return o;let s=lt.unionStructure(i),a=lt.UniqueBuilder(n.inputStructure);return lt.forEach(o,(l,c)=>{let u=Mx(l,s);u.elementCount!==0&&a.add(u),c%50===0&&n.throwIfTimedOut()}),a.getSelection()}}function n3e(e){return function(r){let n=lt.LinearBuilder(r.inputStructure);return n.add(lt.unionStructure(e(r))),n.getSelection()}}function o3e(e,t){return function(n){let o=e(n),i=new Map,s=[];n.pushCurrentElement(),lt.forEach(o,(l,c)=>{n.element.structure=l;for(let u of l.units){n.element.unit=u;let d=u.elements;for(let m=0,p=d.length;m{let m=u;if(o)for(;;){let p=m.elementCount;if(m=eX(a,r,m),m.elementCount===p)break}else for(let p=0;p=0){m.addElementRange(f,v.start,v.end);continue}if(d.hasLabelAsymId(b))for(g.setSegment(v);g.hasNext;){let _=g.move();c.element=f[_.start],d.has(c)&&m.addElementRange(f,_.start,_.end)}}m.commitUnit(),o.throwIfTimedOut()}let p=uh(o.inputStructure,[m.getStructure(),i]);if(r){let h=new p1(o.inputStructure),f=o.inputStructure.lookup3d;for(let y of p.units){let g=y.conformation,v=y.elements;for(let b=0,S=v.length;b0;){let a=s.pop();o.add(a);let l=this.vertices.get(a);for(let c of this.edges.get(a)){if(o.has(c)||(s.push(c),i.has(c)))continue;i.add(c);let u=this.vertices.get(c);l.operator_name===u.operator_name?r.add(te(k({},u),{operator_name:t.operator_name})):r.add(u)}}}};var d5={};hi(d5,{areIntersectedBy:()=>g3e,first:()=>p3e,getCurrentStructureProperties:()=>DC,isConnectedTo:()=>C3e,pick:()=>m3e,withSameAtomProperties:()=>h3e,within:()=>y3e});function tX(e,t,r,n,o,i){return t.elementCount===0||r.elementCount===0?!0:t.elementCount<=r.elementCount?MT.check(e,t,r,n,o,i):MT.check(e,r,t,n,o,i)}function rX(e,t,r,n,o){return t.elementCount===0||r.elementCount===0?!0:t.elementCount<=r.elementCount?BT.check(e,t,r,n,o):BT.check(e,r,t,n,o)}var MT;(function(e){let t=x();function r(s,a,l,c,u,d,m){let{elements:p,conformation:h}=a,f=t;s.element.unit=a;let y=!1;for(let g=0,v=p.length;g{let n=e(r),o=lt.LinearBuilder(r.inputStructure);return r.pushCurrentElement(),lt.forEach(n,(i,s)=>{r.currentStructure=i,t(r)&&o.add(i),s%100&&r.throwIfTimedOut()}),r.popCurrentStructure(),o.getSelection()}}function p3e(e){return t=>{let r=e(t),n=lt.LinearBuilder(t.inputStructure);if(r.kind==="singletons"){if(r.structure.elementCount>0){let o=r.structure.units[0],i=Me.create([o.getChild(Fe.ofSingleton(o.elements[0]))],{parent:t.inputStructure});n.add(i)}}else r.structures.length>0&&n.add(r.structures[0]);return n.getSelection()}}function DC(e,t,r){let{units:n}=e.currentStructure,o=e.pushCurrentElement();o.structure=e.currentStructure;for(let i of n){o.unit=i;let s=i.elements,a=t;if(a){for(let l=0,c=s.length;l{e.currentStructure=i,DC(e,r,n),s%10&&e.throwIfTimedOut()}),e.popCurrentElement(),n}function h3e(e,t,r){return n=>{let o=e(n),i=f3e(n,t,r),s=lt.LinearBuilder(n.inputStructure);return n.pushCurrentStructure(),lt.forEach(o,(a,l)=>{n.currentStructure=a;let c=DC(n,r,new Set);Dn.isSuperset(i,c)&&s.add(a),l%10&&n.throwIfTimedOut()}),n.popCurrentStructure(),s.getSelection()}}function g3e(e,t){return r=>{let n=lt.unionStructure(t(r)),o=lt.LinearBuilder(r.inputStructure);return lt.forEach(e(r),(i,s)=>{kx(n,i)&&o.add(i),s%10&&r.throwIfTimedOut()}),o.getSelection()}}function y3e(e){return t=>{let r={queryCtx:t,selection:e.query(t),target:e.target(t),maxRadius:e.maxRadius,minRadius:e.minRadius?Math.max(0,e.minRadius):0,elementRadius:e.elementRadius,invert:!!e.invert};return r.minRadius===0&&typeof e.minRadius>"u"?v3e(r):r.minRadius===0?x3e(r):b3e(r)}}function v3e({queryCtx:e,selection:t,target:r,maxRadius:n,invert:o}){let i=lt.unionStructure(r).lookup3d,s=lt.LinearBuilder(e.inputStructure),a=x.zero();return lt.forEach(t,(l,c)=>{let{units:u}=l,d=!1;for(let m=0,p=u.length;m{let u=rX(e,s,l,n,i);o&&(u=!u),u&&a.add(l),c%10===0&&e.throwIfTimedOut()}),e.popCurrentElement(),a.getSelection()}function b3e({queryCtx:e,selection:t,target:r,minRadius:n,maxRadius:o,invert:i,elementRadius:s}){let a=lt.unionStructure(r),l=lt.LinearBuilder(e.inputStructure);return e.pushCurrentElement(),lt.forEach(t,(c,u)=>{let d=tX(e,a,c,n,o,s);i&&(d=!d),d&&l.add(c),u%10===0&&e.throwIfTimedOut()}),e.popCurrentElement(),l.getSelection()}function S3e(e,t){let{queryCtx:r,input:n,target:o,disjunct:i}=e,s=r.atomicBond,a=n.interUnitBonds;s.setStructure(n);for(let l of t.units){if(!_e.isAtomic(l))continue;let c=n.unitMap.get(l.id),{offset:u,b:d,edgeProps:{flags:m,order:p,key:h}}=c.bonds,f=a.getConnectedUnits(l.id),y=f.length,g=l.elements,v=c.elements;for(let b=0,S=g.length;b{let s=t(i);if(lt.isEmpty(s))return s;let a=e(i);if(lt.isEmpty(a))return a;let l={queryCtx:i,input:i.inputStructure,disjunct:r,target:lt.unionStructure(s)},c=lt.LinearBuilder(i.inputStructure);return i.pushCurrentBond(),i.atomicBond.setTestFn(o),lt.forEach(a,(u,d)=>{(S3e(l,u)||n)&&c.add(u),d%5===0&&i.throwIfTimedOut()}),i.popCurrentBond(),c.getSelection()}}var m5={};hi(m5,{intersect:()=>w3e,merge:()=>_3e});function _3e(e){return e.length===0?fT:e.length===1?e[0]:t=>{let r=lt.UniqueBuilder(t.inputStructure);for(let n=0;n{r.add(o),n%100&&t.throwIfTimedOut()});return r.getSelection()}}function w3e(e){return e.length===0?fT:e.length===1?e[0]:t=>{let r=[];for(let a=0;aa.hashCode,Me.areUnitIdsAndIndicesEqual);lt.forEach(r[n],a=>i.add(a));let s=lt.UniqueBuilder(t.inputStructure);for(let a=0;a{i.has(l)&&s.add(l)}),t.throwIfTimedOut());return s.getSelection()}}var p5={};hi(p5,{atomCount:()=>A3e,countQuery:()=>T3e,propertySet:()=>P3e});function A3e(e){return e.currentStructure.elementCount}function T3e(e){return t=>{let r=e(t);return lt.structureCount(r)}}function P3e(e){return t=>DC(t,e,new Set)}var RT;(function(e){function t(m){return!!m&&!!m.has}function r(m,p){return h=>m(h)===p}e.eq=r;function n(m,p){return h=>m(h)m(h)<=p}e.lte=o;function i(m,p){return h=>m(h)>p}e.gt=i;function s(m,p){return h=>m(h)>=p}e.gte=s;function a(m){return!0}function l(m){return!1}function c(m,p){if(t(p))return h=>p.has(m(h));{if(p.length===0)return l;let h=new Set;for(let f=0;fh.has(m(f))}}e.inSet=c;function u(...m){switch(m.length){case 0:return a;case 1:return m[0];case 2:{let p=m[0],h=m[1];return f=>p(f)&&h(f)}case 3:{let p=m[0],h=m[1],f=m[2];return y=>p(y)&&h(y)&&f(y)}case 4:{let p=m[0],h=m[1],f=m[2],y=m[3];return g=>p(g)&&h(g)&&f(g)&&y(g)}case 5:{let p=m[0],h=m[1],f=m[2],y=m[3],g=m[4];return v=>p(v)&&h(v)&&f(v)&&y(v)&&g(v)}case 6:{let p=m[0],h=m[1],f=m[2],y=m[3],g=m[4],v=m[5];return b=>p(b)&&h(b)&&f(b)&&y(b)&&g(b)&&v(b)}default:{let p=m.length;return h=>{for(let f=0;fp(f)||h(f)}case 3:{let p=m[0],h=m[1],f=m[2];return y=>p(y)||h(y)||f(y)}case 4:{let p=m[0],h=m[1],f=m[2],y=m[3];return g=>p(g)||h(g)||f(g)||y(g)}case 5:{let p=m[0],h=m[1],f=m[2],y=m[3],g=m[4];return v=>p(v)||h(v)||f(v)||y(v)||g(v)}case 6:{let p=m[0],h=m[1],f=m[2],y=m[3],g=m[4],v=m[5];return b=>p(b)||h(b)||f(b)||y(b)||g(b)||v(b)}default:{let p=m.length;return h=>{for(let f=0;fY(this,null,function*(){let p=u.models;if(p.length!==1)throw new Error("Can only build assemblies from structures based on 1 model.");let h=ch.findAssembly(p[0],d);if(!h)throw new Error(`Assembly '${d}' is not defined.`);let f=Vn.create(h.id,ne.identity(),{assembly:{id:h.id,operId:0,operList:[]}}),y=Me.Builder({coordinateSystem:f,label:u.label,dynamicBonds:u.dynamicBonds}),g=new Mi(u);for(let v of h.operatorGroups){let b=v.selector(g);if(lt.structureCount(b)===0)continue;let{units:S}=lt.unionStructure(b);for(let _ of v.operators)for(let w of S)y.addWithOperator(w,_)}return y.getStructure()}))}e.buildAssembly=t;function r(u,d,m){return Pe.create("Build Symmetry Assembly",p=>Y(this,null,function*(){let h=u.models;if(h.length!==1)throw new Error("Can only build symmetry assemblies from structures based on 1 model.");let f=x(),y=Me.Builder({label:u.label,representativeModel:h[0],dynamicBonds:u.dynamicBonds}),g=new Mi(u);for(let v of d){let S=I3e(v.asymIds)(g);if(lt.structureCount(S)===0)continue;let{units:_}=lt.unionStructure(S);for(let{index:w,shift:[E,A,P]}of v.operators){let T=nX(m,w,E,A,P,f);for(let B of _)for(let D of T)y.addWithOperator(B,D)}}return y.getStructure()}))}e.buildSymmetryAssembly=r;function n(u,d){return Pe.create("Find Symmetry Mates",m=>M3e(m,u,d))}e.builderSymmetryMates=n;function o(u,d,m){return Pe.create("Build Symmetry",p=>k3e(p,u,d,m))}e.buildSymmetryRange=o;function i(u){return Pe.create("Build NCS",d=>D3e(d,u))}e.buildNcs=i;function s(u,d){return u.invariantId===d.invariantId&&u.model.id===d.model.id&&Fe.areEqual(u.elements,d.elements)}e.areUnitsEquivalent=s;function a(){return gH(_e.hashUnit,s)}e.UnitEquivalenceBuilder=a;function l(u){let d=a();for(let p of u.units)d.add(p.id,p);let m=[];for(let p of d.groups)m.push(_e.SymmetryGroup(p.map(h=>u.unitMap.get(h))));return m}e.computeTransformGroups=l;function c(u,d){if(u.length!==d.length)return!1;for(let m=0,p=u.length;mNe.unit.operator_name(t.element),Vn.DefaultName),bn.pred.inSet(t=>Ne.chain.label_asym_id(t.element),e))})}function nX(e,t,r,n,o,i){let{spacegroup:s,ncsOperators:a}=e,l=[],{toFractional:c}=s.cell,u=x.transformMat4(x(),i,c),d=Os.getSymmetryOperatorRef(s,t,r,n,o,u);if(a&&a.length)for(let m=0,p=a.length;m=0&&t[1]<=0&&r[1]>=0&&t[2]<=0&&r[2]>=0&&(a[0]=Os.getSymmetryOperator(o,0,0,0,0));for(let l=0;l0?[]:this.currentUnit}addElement(t){this.currentUnit[this.currentUnit.length]=t,this.elementCount++}addElementRange(t,r,n){for(let o=r;o1&&$s(l);let d=a.getChild(Fe.ofSortedArray(l)),m=n.add(d.id,d);d!==m&&(d=m.applyOperator(d.id,d.conformation.operator,!0)),r[r.length]=d}return Me.create(r,{parent:this.parent})}getStructure(){return this._getStructure(!1)}getStructureDeduplicate(){return this._getStructure(!0)}setSingletonLocation(t){let r=this.ids[0];t.unit=this.parent.unitMap.get(r),t.element=this.unitMap.get(r)[0]}get isEmpty(){return this.elementCount===0}constructor(t,r){this.parent=t,this.isSorted=r,this.ids=[],this.unitMap=Sa.Mutable(),this.parentId=-1,this.currentUnit=[],this.elementCount=0}};function sX(e,t){let r=1;for(;t--;)r*=e--;return r}function B3e(e,t){return t>e?0:sX(e,t)/sX(t,t)}function R3e(e){let t=e&-e,r=e+t,o=((r&-r)/t>>1)-1;return r|o}var f5=class{move(){if(this.hasNext){let t=0,r=0,n=this.index;for(;n;n>>>=1,t++)n&1&&(this.value[r++]=this.array[t]);this.index=R3e(this.index),this.hasNext=this.index0&&r<=t.length}};function h5(e,t){let r=[],n=new f5(e,t);for(;n.hasNext;)r.push(n.move().slice());return r}var y1=[],aX={links:y1,terminalLinks:y1,elements:y1,partialElements:y1,getElementIndices:()=>y1,getLinkIndices:()=>y1,getTerminalLinkIndices:()=>y1};var na=jm("C"),kC=jm("O"),L3e=[Qc.elementFingerprint([na,na,na,kC]),Qc.elementFingerprint([na,na,na,na,kC]),Qc.elementFingerprint([na,na,na,na,na,kC]),Qc.elementFingerprint([na,na,na,na,na,na,kC])];function F3e(e,t){let r=-1,n=-1,o=-1,i=-1,{elements:s}=e,{type_symbol:a,label_atom_id:l}=e.model.atomicHierarchy.atoms,{b:c,offset:u}=e.bonds;for(let d=0,m=t.length;dm+p.properties.saccharideComponentMap.size,0)===0)return aX;let t=[],r=[],n=[],o=[],i=new Map;function s(m,p,h){return`${m}|${p}|${h}`}function a(m,p){i.has(m)?i.get(m).push(p):i.set(m,[p])}function l(m,p){x.sub(n[m].geometry.direction,n[p].geometry.center,n[m].geometry.center),x.normalize(n[m].geometry.direction,n[m].geometry.direction)}let c=x();function u(m,p,h){let f=h.conformation,y=n[m].geometry;x.sub(y.direction,f.position(h.elements[p],c),y.center),x.normalize(y.direction,y.direction)}for(let m=0,p=e.units.length;m{f.connectedIndices.forEach(y=>{f.getEdges(y).forEach(({props:g,indexB:v})=>{if(!Er.isCovalent(g.flag))return;let b=e.unitMap.get(f.unitA),S=e.unitMap.get(f.unitB),_=d(b,y),w=d(S,v);if(_.length>0&&w.length>0){let E=_.length,A=w.length;for(let P=0,T=Math.max(E,A);P500?G3e:H3e}function uX(e){let{units:t}=e,r=j3e(t.length);r.reset();for(let n=0,o=t.length;n0}get customPropertyDescriptors(){return this.state.customProps||(this.state.customProps=new ss),this.state.customProps}get currentPropertyData(){return this.state.propertyData||(this.state.propertyData=Object.create(null)),this.state.propertyData}get inheritedPropertyData(){return this.parent?this.parent.currentPropertyData:this.currentPropertyData}get polymerResidueCount(){return this.state.polymerResidueCount===-1&&(this.state.polymerResidueCount=$3e(this)),this.state.polymerResidueCount}get polymerGapCount(){return this.state.polymerGapCount===-1&&(this.state.polymerGapCount=J3e(this)),this.state.polymerGapCount}get polymerUnitCount(){return this.state.polymerUnitCount===-1&&(this.state.polymerUnitCount=eAe(this)),this.state.polymerUnitCount}get uniqueElementCount(){return this.state.uniqueElementCount===-1&&(this.state.uniqueElementCount=Z3e(this)),this.state.uniqueElementCount}get atomicResidueCount(){return this.state.atomicResidueCount===-1&&(this.state.atomicResidueCount=tAe(this)),this.state.atomicResidueCount}get isCoarseGrained(){return this.models.some(t=>Ut.isCoarseGrained(t))}get isEmpty(){return this.units.length===0}get hashCode(){return this.state.hashCode!==-1?this.state.hashCode:this.computeHash()}get transformHash(){return this.state.transformHash!==-1?this.state.transformHash:(this.state.transformHash=zo(this.units.map(t=>t.id)),this.state.transformHash)}computeHash(){let t=23;for(let r=0,n=this.units.length;r1)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}get masterModel(){return this.state.masterModel}get representativeModel(){return this.state.representativeModel}hasElement(t){return this.unitMap.has(t.unit.id)?Fe.has(this.unitMap.get(t.unit.id).elements,t.element):!1}getModelIndex(t){return this.models.indexOf(t)}remapModel(t){let{dynamicBonds:r,interUnitBonds:n,parent:o}=this.state,i=[];for(let s of this.unitSymmetryGroups){let a=s.units[0].remapModel(t,r);i.push(a);for(let l=1,c=s.units.length;l0&&(r+=1);return r}function tAe(e){let{units:t}=e,r=0;for(let n=0,o=t.length;no[n.get(a.id)]+Te.indexOf(a.elements,l)}}(function(e){e.Empty=l([]);function t(X){return{kind:"structure-loci",structure:X}}e.Loci=t;function r(X){let Z=[];for(let ie of X.units)Z.push({unit:ie,indices:ve.ofBounds(0,ie.elements.length)});return $.Loci(X,Z)}e.toStructureElementLoci=r;function n(X,Z){return lt.toLociWithSourceUnits(lt.Singletons(X,Z))}e.toSubStructureElementLoci=n;function o(X){return!!X&&X.kind==="structure-loci"}e.isLoci=o;function i(X,Z){return X.structure===Z.structure}e.areLociEqual=i;function s(X){return X.structure.isEmpty}e.isLociEmpty=s;function a(X,Z){return Z===X.structure?X:t(Z)}e.remapLoci=a;function l(X,Z={}){let ie=Sa.Mutable(),de=Sa.Mutable(),we=0,Be=!0,Ie=X.length>0?X[0].id:0;for(let j=0,ue=X.length;j2e5||m(X,j)?f(X,Xe,Ie,Re,ue):Ie.addUnit(0,X,ue,Xe,Re?_e.Trait.MultiChain:_e.Trait.None):Ie.addUnit(0,X,ue,Xe,Re?_e.Trait.MultiChain:_e.Trait.None)}let le=X.coarseHierarchy;return le.isDefined&&(le.spheres.count>0&&y(Ie,X,X.coarseHierarchy.spheres,1),le.gaussians.count>0&&y(Ie,X,X.coarseHierarchy.gaussians,2)),Ie.getStructure()}e.ofModel=d;function m(X,Z){let ie=X.atomicHierarchy.index.getEntityFromChain(Z);return X.entities.data.type.value(ie)==="water"}function p(X,Z){let ie=X.atomicHierarchy.index.getEntityFromChain(Z);return X.entities.data.type.value(ie)==="polymer"}function h(X,Z,ie,de,we){let{x:Be,y:Ie,z:le}=X.atomicConformation,j={x:Be,y:Ie,z:le,indices:Z},ue=Oa(j,Zc(j),8192),{offset:fe,count:De,array:Re}=ue.buckets,Xe=(de?_e.Trait.MultiChain:_e.Trait.None)|(fe.length>1?_e.Trait.Partitioned:_e.Trait.None);ie.beginChainGroup();for(let L=0,ee=fe.length;L1?_e.Trait.Partitioned:_e.Trait.None);ie.beginChainGroup();for(let Ve=0,Ke=xe.length;Ve_e.conformationId(Z)).join("|"))}e.conformationHash=_;function w(X,Z){if(X===Z)return!0;if(X.elementCount!==Z.elementCount)return!1;let ie=X.units.length;if(ie!==Z.units.length)return!1;for(let de=0;de=this.structure.units.length){this.hasNext=!1;return}this.current.unit=this.structure.units[this.unitIndex],this.elements=this.current.unit.elements,this.maxIdx=this.elements.length-1,this.maxIdx===0&&(this.hasNext=this.unitIndex+10,this.hasNext&&(this.elements=Z.units[0].elements,this.maxIdx=this.elements.length-1,this.current.unit=Z.units[0])}}e.ElementLocationIterator=D;let M=x();function R(X,Z,ie){let{elements:de,conformation:we}=X,Be=M,Ie=Number.MAX_VALUE;for(let le=0,j=de.length;lewe(j)))return;let Ie=X.lookup3d,le=x();for(let j of X.units){if(!we(j))continue;let ue=j.boundary.sphere;x.transformMat4(le,ue.center,j.conformation.operator.matrix);let fe=Ie.findUnitIndices(le[0],le[1],le[2],ue.radius+de);for(let De=0;De=Re.id||!we(Re)||!Be(j,Re)||(Re.elements.length>=j.elements.length?Z(j,Re):Z(Re,j))}}}e.eachUnitPair=O;function J(X,{chain:Z,residue:ie,atom:de}){let we=$.Location.create(X);for(let Be of X.units){if(Be.kind!==0)continue;we.unit=Be;let{elements:Ie}=Be,le=Bt.transientSegments(Be.model.atomicHierarchy.chainAtomSegments,Ie),j=Bt.transientSegments(Be.model.atomicHierarchy.residueAtomSegments,Ie);for(;le.hasNext;){let ue=le.move();if(Z&&(we.element=Ie[ue.start],Z(we)),!(!ie&&!de))for(j.setSegment(ue);j.hasNext;){let fe=j.move();if(ie&&(we.element=Ie[fe.start],ie(we)),!!de)for(let De=fe.start,Re=fe.end;DeZ.units[0].polymerElements.length>0)}function H(X,Z){let ie=Q(X);return ie.length===1&&ie[0].units.length>2&&ie[0].units[0].polymerElements.length=1&&ie[0].units.length>Z.highSymmetryUnitCount}let K;(function(X){X[X.Small=0]="Small",X[X.Medium=1]="Medium",X[X.Large=2]="Large",X[X.Huge=3]="Huge",X[X.Gigantic=4]="Gigantic"})(K=e.Size||(e.Size={}));function ce(X,Z={},ie=1){let de=k(k({},e.DefaultSizeThresholds),Z);return X.polymerResidueCount>=de.largeResidueCount*ie?W(X,de)?K.Huge:K.Gigantic:H(X,de)||X.polymerResidueCount0)return!1;return!0}e.isEmpty=n;function o(G){return i(G)===G.structure.elementCount}e.isWholeStructure=o;function i(G){let X=0;for(let{indices:Z}of G.elements)typeof Z=="number"?X+=nAe(Z):X+=Z.length;return X}e.size=i;function s(G){return e(G,G.units.map(X=>({unit:X,indices:Te.ofBounds(0,X.elements.length)})))}e.all=s;function a(G){return e(G,[])}e.none=a;function l(G,X){if(n(G))return;let Z=G.elements[0].unit,ie=Z.elements[Te.getAt(G.elements[0].indices,0)];return X?(X.structure=G.structure,X.unit=G.elements[0].unit,X.element=ie,X):Qn.create(G.structure,Z,ie)}e.getFirstLocation=l;function c(G){return n(G)?G:e(G.structure,[{unit:G.elements[0].unit,indices:Te.ofSingleton(Te.start(G.elements[0].indices))}])}e.firstElement=c;function u(G){return n(G)?G:_(c(G))}e.firstResidue=u;function d(G){return n(G)?G:T(c(G))}e.firstChain=d;function m(G){let X=[];for(let Z of G.elements){let{unit:ie,indices:de}=Z,we=new Int32Array(Te.size(de));Te.forEach(de,(Be,Ie)=>we[Ie]=ie.elements[Be]),X.push(ie.getChild(Fe.ofSortedArray(we)))}return Me.create(X,{parent:G.structure.parent})}e.toStructure=m;function p(G,X){if(e.isEmpty(G))return;let Z=Qn.create(G.structure);for(let ie of G.elements){let{unit:de,indices:we}=ie;Z.unit=de;let{elements:Be}=ie.unit;for(let Ie=0,le=Te.size(we);Ie{if(!X.unitMap.has(ie.unit.id))return;let de=X.unitMap.get(ie.unit.id),we=Te.indexedIntersect(ie.indices,ie.unit.elements,de.elements);Te.size(we)>0&&Z.push({unit:de,indices:we})}),e(X,Z)}e.remap=h;function f(G,X){if(G.elements.length>X.elements.length)return f(X,G);if(e.isEmpty(G))return X;let Z=new Map;for(let de of G.elements)Z.set(de.unit.id,de.indices);let ie=[];for(let de of X.elements)Z.has(de.unit.id)?(ie[ie.length]={unit:de.unit,indices:Te.union(Z.get(de.unit.id),de.indices)},Z.delete(de.unit.id)):ie[ie.length]=de;return Z.forEach((de,we)=>{ie[ie.length]={unit:G.structure.unitMap.get(we),indices:de}}),e(G.structure,ie)}e.union=f;function y(G,X){let Z=new Map;for(let de of X.elements)Z.set(de.unit.id,de.indices);let ie=[];for(let de of G.elements)if(Z.has(de.unit.id)){let we=Te.subtract(de.indices,Z.get(de.unit.id));if(Te.size(we)===0)continue;ie[ie.length]={unit:de.unit,indices:we}}else ie[ie.length]=de;return e(G.structure,ie)}e.subtract=y;function g(G,X){let Z=new Map;for(let de of G.elements)Z.set(de.unit.id,de.indices);let ie=[];for(let de of X.elements){if(!Z.has(de.unit.id))continue;let we=Te.intersect(Z.get(de.unit.id),de.indices);Te.size(we)!==0&&(ie[ie.length]={unit:de.unit,indices:we})}return e(G.structure,ie)}e.intersect=g;function v(G,X){if(G.elements.length>X.elements.length)return v(X,G);if(e.isEmpty(G))return e.isEmpty(X);let Z=new Map;for(let ie of G.elements)Z.set(ie.unit.id,ie.indices);for(let ie of X.elements)if(Z.has(ie.unit.id)&&Te.areIntersecting(Z.get(ie.unit.id),ie.indices))return!0;return!1}e.areIntersecting=v;function b(G,X){if(e.isEmpty(G))return e.isEmpty(X);let Z=new Map;for(let de of G.elements)Z.set(de.unit.id,de.indices);let ie=!1;for(let de of X.elements)if(Z.has(de.unit.id))if(Te.isSubset(Z.get(de.unit.id),de.indices))ie=!0;else return!1;return ie}e.isSubset=b;function S(G){return G.length>3&&Fe.isRange(G)?ve.ofRange(G[0],G[G.length-1]):Fe.ofSortedArray(G)}function _(G,X){let Z=[],ie=new Set;for(let de of G.elements){if(E(de)){Z[Z.length]=de;continue}if(de.unit.kind===0){let we=de.unit.elements,Be=de.unit.model.atomicHierarchy,{label_alt_id:Ie}=de.unit.model.atomicHierarchy.atoms,{index:le,offsets:j}=Be.residueAtomSegments,ue=[],fe=de.indices,De=Te.size(fe),Re=0;for(;Re=0){let ke=Ie.value(xe);(!X||ee||!ke||ie.has(ke))&&(ue[ue.length]=be)}}}Z[Z.length]={unit:de.unit,indices:S(ue)}}else Z[Z.length]=de}return e(G.structure,Z)}e.extendToWholeResidues=_;function w(G){switch(G.kind){case 0:return G.model.atomicHierarchy.chainAtomSegments;case 1:return G.model.coarseHierarchy.spheres.chainElementSegments;case 2:return G.model.coarseHierarchy.gaussians.chainElementSegments}}function E(G){return G.unit.elements.length===Te.size(G.indices)}function A(G,X,Z){let{index:ie}=w(G),de=G.elements,we=0;for(let Ie=0,le=de.length;Ie0&&(Z[Z.length]={unit:G,indices:S(Be)})}function P(G,X,Z,ie,de){let{index:we}=w(G.elements[0].unit),Be=new Set;for(let Ie=X;Ie{X+=i(de)});let Z=new Float32Array(3*X),ie=0;return G.forEach(de=>{Q(de,Z,ie),ie+=i(de)*3}),Fa.ofPositions(Z)}e.getPrincipalAxesMany=W;function K(G,X){return _e.isAtomic(G)?G.model.atomicHierarchy.atomSourceIndex.value(X):X}function ce(G){if(e.isEmpty(G))return oe.struct.generator.empty();let X=G.structure.models,Z=new Map;for(let Ie of G.elements){let{indices:le}=Ie,{elements:j}=Ie.unit,ue=Ie.unit.conformation.operator.name,fe;Z.has(ue)?fe=Z.get(ue).xs:(fe=cn.create(),Z.set(ue,{modelLabel:Ie.unit.model.label,modelIndex:Ie.unit.model.modelNum,xs:fe}));for(let De=0,Re=Te.size(le);De1,le.modelLabel,le.modelIndex))}let we=new Map;for(let Ie=0,le=ie.length;Ie{let{ranges:le,set:j}=Ie.atom,{opName:ue}=Ie.chain,fe=oe.struct.atomProperty.core.operatorName(),De=oe.struct.atomProperty.core.sourceIndex(),Re=[];j.length>0&&(Re[Re.length]=oe.core.set.has([oe.core.type.set(j),De]));for(let Xe=0,L=le.length/2;Xe1?oe.core.logic.or(Re):Re[0],"chain-test":ue.length>1?oe.core.set.has([oe.core.type.set(ue),fe]):oe.core.rel.eq([fe,ue[0]]),"entity-test":oe.core.logic.and([oe.core.rel.eq([oe.struct.atomProperty.core.modelLabel(),Xe]),oe.core.rel.eq([oe.struct.atomProperty.core.modelIndex(),L])])}))}else Be.push(oe.struct.generator.atomGroups({"atom-test":Re.length>1?oe.core.logic.or(Re):Re[0],"chain-test":ue.length>1?oe.core.set.has([oe.core.type.set(ue),fe]):oe.core.rel.eq([fe,ue[0]])}))}),oe.struct.modifier.union([Be.length===1?Be[0]:oe.struct.combinator.merge(Be.map(Ie=>oe.struct.modifier.union([Ie])))])}e.toExpression=ce;function V(G,X,Z,ie,de){$s(X);let we=[],Be=[],Ie=0,le=X.length;for(;Ie12)we[we.length]=X[j],we[we.length]=X[ue-1];else for(let fe=j;fe0&&Qn.set(l.firstElementLoc,c,m,p[Te.start(d)]),h===p.length)l.unitCount+=1,l.unitCount===1&&Qn.set(l.firstUnitLoc,c,m,p[Te.start(d)]);else if(h===1){if(_e.Traits.is(m.traits,_e.Trait.MultiChain))return;l.elementCount+=1,l.elementCount===1&&Qn.set(l.firstElementLoc,c,m,p[Te.start(d)])}else if(_e.isAtomic(m)){let{index:g,offsets:v}=m.model.atomicHierarchy.residueAtomSegments,{label_alt_id:b}=m.model.atomicHierarchy.atoms,S=0;for(;S{if(y.get(P)===A){if(P!==""&&(l.conformationCount+=1,l.conformationCount===1)){for(let T=v[E],B=v[E+1];T{y[S+1]-y[S]===b&&(l.chainCount+=1,l.chainCount===1&&(v=S))}),!(v<0))for(let b=d;b_e.isAtomic(t.unit)?e(t):dX("atomic")}function sAe(e){return t=>_e.isCoarse(t.unit)?e(t):dX("coarse")}function aAe(e){return _e.isAtomic(e.unit)?e.unit.residueIndex[e.element]:-1}function lAe(e){return _e.isAtomic(e.unit)?e.unit.chainIndex[e.element]:-1}function cAe(e){return Ne.entity.key(e)}var Jp;(function(e){function t(n){let o=n.descriptor.name,i=n.type==="static"?"_staticPropertyData":"_dynamicPropertyData",s=l=>(o in l[i]||(l[i][o]={props:k({},C.getDefaultValues(n.getParams(l))),data:Up.create(void 0)}),l[i][o]),a=(l,c,u)=>{let d=s(l);l[i][o]={props:c,data:Up.withValue(d.data,u)}};return{label:n.label,descriptor:n.descriptor,isHidden:n.isHidden,getParams:l=>{let c=C.clone(n.getParams(l));return C.setDefaultValues(c,s(l).props),c},defaultParams:n.defaultParams,isApplicable:n.isApplicable,attach:(m,p,...h)=>Y(this,[m,p,...h],function*(l,c,u={},d){d&&c.customProperties.reference(n.descriptor,!0);let f=s(c),y=C.merge(n.defaultParams,f.props,u);if(f.data.value&&C.areEqual(n.defaultParams,f.props,y))return;let{value:g,assets:v}=yield n.obtain(l,c,y);c.customProperties.add(n.descriptor),c.customProperties.assets(n.descriptor,v),a(c,y,g)}),ref:(l,c)=>l.customProperties.reference(n.descriptor,c),get:l=>{var c;return(c=s(l))===null||c===void 0?void 0:c.data},set:(l,c={},u)=>{let d=s(l),m=C.merge(n.defaultParams,d.props,c);C.areEqual(n.defaultParams,d.props,m)||(a(l,m,u),l.customProperties.assets(n.descriptor))},props:l=>s(l).props}}e.createProvider=t;function r(n,o,i){let s={value:C.Value(i,{isHidden:!0})};return t({label:Us(n),descriptor:Pi({name:n}),isHidden:!0,type:o,defaultParams:s,getParams:()=>({value:C.Value(i,{isHidden:!0})}),isApplicable:()=>!0,obtain:(a,l,c)=>Y(this,null,function*(){return k(k({},C.getDefaultValues(s)),c)})})}e.createSimple=r})(Jp||(Jp={}));var Cl;(function(e){e.Provider=Jp.createProvider({label:"SIFTS Mapping",descriptor:Pi({name:"sifts_sequence_mapping"}),type:"static",defaultParams:{},getParams:()=>({}),isApplicable:i=>t(i),obtain:(i,s)=>Y(this,null,function*(){return{value:o(s)}})});function t(i){if(!rn.is(i.sourceData))return!1;let{pdbx_sifts_xref_db_name:s,pdbx_sifts_xref_db_acc:a,pdbx_sifts_xref_db_num:l,pdbx_sifts_xref_db_res:c}=i.sourceData.data.db.atom_site;return s.isDefined&&a.isDefined&&l.isDefined&&c.isDefined}e.isAvailable=t;function r(i){let s=i.unit.model,a=e.Provider.get(s).value;if(!a)return"";let l=s.atomicHierarchy.residueAtomSegments.index[i.element];return a.accession[l]}e.getKey=r;function n(i){let s=i.unit.model,a=e.Provider.get(s).value;if(!a)return;let l=s.atomicHierarchy.residueAtomSegments.index[i.element],c=a.dbName[l];if(c)return`${c} ${a.accession[l]} ${a.num[l]} ${a.residue[l]}`}e.getLabel=n;function o(i){if(!rn.is(i.sourceData))return;let{pdbx_sifts_xref_db_name:s,pdbx_sifts_xref_db_acc:a,pdbx_sifts_xref_db_num:l,pdbx_sifts_xref_db_res:c}=i.sourceData.data.db.atom_site;if(!s.isDefined||!a.isDefined||!l.isDefined||!c.isDefined)return;let{atomSourceIndex:u}=i.atomicHierarchy,{count:d,offsets:m}=i.atomicHierarchy.residueAtomSegments,p=new Array(d),h=new Array(d),f=new Array(d),y=new Array(d);for(let g=0;g$n.fields().str("group_PDB",Ne.residue.group_PDB).index("id").str("type_symbol",Ne.atom.type_symbol).str("label_atom_id",Ne.atom.label_atom_id).str("label_comp_id",Ne.atom.label_comp_id).int("label_seq_id",Ne.residue.label_seq_id,{encoder:Xm.deltaRLE,valueKind:(e,t)=>{let r=e.unit.model;return r.atomicHierarchy.residues.label_seq_id.valueKind(r.atomicHierarchy.residueAtomSegments.index[e.element])}}).str("label_alt_id",Ne.atom.label_alt_id).str("pdbx_PDB_ins_code",Ne.residue.pdbx_PDB_ins_code).str("label_asym_id",uAe).str("label_entity_id",Ne.chain.label_entity_id).float("Cartn_x",Ne.atom.x,{digitCount:3,encoder:Xm.fixedPoint3}).float("Cartn_y",Ne.atom.y,{digitCount:3,encoder:Xm.fixedPoint3}).float("Cartn_z",Ne.atom.z,{digitCount:3,encoder:Xm.fixedPoint3}).float("occupancy",Ne.atom.occupancy,{digitCount:2,encoder:Xm.fixedPoint2}).float("B_iso_or_equiv",Ne.atom.B_iso_or_equiv,{digitCount:2,encoder:Xm.fixedPoint2}).int("pdbx_formal_charge",Ne.atom.pdbx_formal_charge,{encoder:Xm.deltaRLE,valueKind:(e,t)=>e.unit.model.atomicHierarchy.atoms.pdbx_formal_charge.valueKind(e.element)}).str("auth_atom_id",Ne.atom.auth_atom_id).str("auth_comp_id",Ne.atom.auth_comp_id).int("auth_seq_id",Ne.residue.auth_seq_id,{encoder:Xm.deltaRLE}).str("auth_asym_id",dAe).int("pdbx_PDB_model_num",Ne.unit.model_num,{encoder:Xm.deltaRLE}).int("pdbx_label_index",mX.value,{shouldInclude:mX.shouldInclude}).str("pdbx_sifts_xref_db_name",kd.pdbx_sifts_xref_db_name.value,{shouldInclude:kd.shouldInclude,valueKind:kd.pdbx_sifts_xref_db_name.valueKind}).str("pdbx_sifts_xref_db_acc",kd.pdbx_sifts_xref_db_acc.value,{shouldInclude:kd.shouldInclude,valueKind:kd.pdbx_sifts_xref_db_acc.valueKind}).str("pdbx_sifts_xref_db_num",kd.pdbx_sifts_xref_db_num.value,{shouldInclude:kd.shouldInclude,valueKind:kd.pdbx_sifts_xref_db_num.valueKind}).str("pdbx_sifts_xref_db_res",kd.pdbx_sifts_xref_db_res.value,{shouldInclude:kd.shouldInclude,valueKind:kd.pdbx_sifts_xref_db_res.valueKind}).getFields(),pX={name:"atom_site",instance({structures:e}){return{fields:mAe(),source:e.map(t=>({data:{structure:t,sourceIndex:t.model.atomicHierarchy.atomSourceIndex,atom_site:rn.is(t.model.sourceData)?t.model.sourceData.data.db.atom_site:void 0},rowCount:t.elementCount,keys:()=>t.elementLocations()}))}}};function v1(e,t){return e?`${e}_${t}`:t}function pAe(e){return e?`pdbx_${e}_PDB_ins_code`:"pdbx_PDB_ins_code"}function hh(e,t){return(r,n)=>t(e(r,n))}function fAe(e,t,r){r&&r.includeModelNum&&e.int("pdbx_PDB_model_num",hh(t,Ne.unit.model_num))}function MC(e,t){let r=t&&t.prefix,n=$n.fields().str(v1(r,"label_comp_id"),hh(e,Ne.atom.label_comp_id)).int(v1(r,"label_seq_id"),hh(e,Ne.residue.label_seq_id),{encoder:Xm.deltaRLE,valueKind:(o,i)=>{let s=e(o,i),a=s.unit.model;return a.atomicHierarchy.residues.label_seq_id.valueKind(a.atomicHierarchy.residueAtomSegments.index[s.element])}}).str(pAe(r),hh(e,Ne.residue.pdbx_PDB_ins_code)).str(v1(r,"label_asym_id"),hh(e,Ne.chain.label_asym_id)).str(v1(r,"label_entity_id"),hh(e,Ne.chain.label_entity_id)).str(v1(r,"auth_comp_id"),hh(e,Ne.atom.auth_comp_id)).int(v1(r,"auth_seq_id"),hh(e,Ne.residue.auth_seq_id),{encoder:Xm.deltaRLE}).str(v1(r,"auth_asym_id"),hh(e,Ne.chain.auth_asym_id));return fAe(n,e,t),n.getFields()}var Kg=$n.Field,fX={name:"struct_conf",instance(e){let t=gX(e,"helix");return{fields:gAe(),source:[{data:t,rowCount:t.length}]}}},hX={name:"struct_sheet_range",instance(e){let t=gX(e,"sheet").sort(hAe);return{fields:yAe(),source:[{data:t,rowCount:t.length}]}}};function hAe(e,t){let r=e.element,n=t.element;return r.sheet_id[Kg.str("conf_type_id",(e,t)=>t[e].element.type_id),Kg.str("id",(e,t,r)=>`${t[e].element.type_id}${r+1}`),...MC((e,t)=>t[e].start,{prefix:"beg"}),...MC((e,t)=>t[e].end,{prefix:"end"}),Kg.str("pdbx_PDB_helix_class",(e,t)=>t[e].element.helix_class),Kg.str("details",(e,t)=>t[e].element.details||"",{valueKind:(e,t)=>t[e].element.details?0:2}),Kg.int("pdbx_PDB_helix_length",(e,t)=>t[e].length)],yAe=()=>[Kg.str("sheet_id",(e,t)=>t[e].element.sheet_id),Kg.index("id"),...MC((e,t)=>t[e].start,{prefix:"beg"}),...MC((e,t)=>t[e].end,{prefix:"end"}),Kg.str("symmetry",(e,t)=>"",{valueKind:(e,t)=>2})];function gX(e,t){let r=Wm.Provider.get(e.firstModel);if(!r)return[];let{key:n,elements:o}=r,i=[],s=e.structures[0];for(let{units:a}of s.unitSymmetryGroups){let l=a[0];if(!_e.isAtomic(l))continue;let c=l.model.atomicHierarchy.residueAtomSegments,u=Bt.transientSegments(c,l.elements),d,m=!0;for(;u.hasNext;){m&&(d=u.move());let p=d.index,h=n[p],f=o[h];if(f.kind!==t){m=!0;continue}let y=p;for(;u.hasNext;)if(y=d.index,d=u.move(),h!==n[d.index]){m=!1,i[i.length]={start:$.Location.create(s,l,c.offsets[p]),end:$.Location.create(s,l,c.offsets[y]),length:y-p+1,element:f};break}}}return i}function x1(e,t){if(rn.is(e.sourceData))return e.sourceData.data.db[t]}function OT(e){return Dn.unionMany(...e.map(t=>t.uniqueResidueNames))}function yX(e){if(e.length===0)return new Set;let t=e[0].model.entities.data.id;return new Set(y5(e).map(r=>t.value(r)))}function y5(e){if(e.length===0)return[];if(e.length===1)return e[0].entityIndices;let t=cn.create();for(let r of e)for(let n of r.entityIndices)cn.add(t,n,n);return $s(t.array),t.array}function Ou(e,t){return{name:e,instance({structures:r}){if(t&&!t(r[0]))return $n.Category.Empty;let n=r[0].model;if(!rn.is(n.sourceData))return $n.Category.Empty;let o=n.sourceData.data.db[e];return!o||!o._rowCount?$n.Category.Empty:$n.Category.ofTable(o)}}}var Qg=$n.Category,vX={name:"chem_comp",instance({firstModel:e,structures:t,cache:r}){let n=x1(t[0].model,"chem_comp");if(!n)return Qg.Empty;let{id:o}=n,i=r.uniqueResidueNames||(r.uniqueResidueNames=OT(t)),s=re.indicesOf(o,a=>i.has(a));return Qg.ofTable(n,s)}},xX={name:"chem_comp_bond",instance({firstModel:e,structures:t,cache:r}){let n=x1(t[0].model,"chem_comp_bond");if(!n)return Qg.Empty;let{comp_id:o}=n,i=r.uniqueResidueNames||(r.uniqueResidueNames=OT(t)),s=re.indicesOf(o,a=>i.has(a));return Qg.ofTable(n,s)}},bX={name:"pdbx_chem_comp_identifier",instance({firstModel:e,structures:t,cache:r}){let n=x1(e,"pdbx_chem_comp_identifier");if(!n)return Qg.Empty;let{comp_id:o}=n,i=r.uniqueResidueNames||(r.uniqueResidueNames=OT(t)),s=re.indicesOf(o,a=>i.has(a));return Qg.ofTable(n,s)}},SX={name:"pdbx_nonpoly_scheme",instance({firstModel:e,structures:t,cache:r}){let n=x1(e,"pdbx_nonpoly_scheme");return n?Qg.ofTable(n):Qg.Empty}};var CX=$n.Category,_X=v5("struct_asym"),wX=v5("entity_poly"),AX=v5("entity_poly_seq");function v5(e){return{name:e,instance({structures:t,cache:r}){return vAe(t,e,r)}}}function vAe(e,t,r){let n=x1(e[0].model,t);if(!n)return CX.Empty;let{entity_id:o}=n,i=r.uniqueEntityIds||(r.uniqueEntityIds=yX(e)),s=re.indicesOf(o,a=>i.has(a));return CX.ofTable(n,s)}var xAe=$n.Category,TX;(function(e){function t(r){let n=Array.isArray(r)?r:[r];return{structures:n,firstModel:n[0].model,cache:Object.create(null)}}e.create=t})(TX||(TX={}));var bAe={name:"entity",instance({structures:e}){let t=y5(e);return xAe.ofTable(e[0].model.entities.data,t)}};function b5(e){return e.units.every(t=>t.conformation.operator.isIdentity)}function x5(e){return b5(e)&&e.units.every(t=>!t.conformation.operator.assembly&&!t.conformation.operator.suffix)}var jht=[Ou("entry"),Ou("exptl"),bAe,Ou("cell",b5),Ou("symmetry",b5),Ou("pdbx_struct_assembly",x5),Ou("pdbx_struct_assembly_gen",x5),Ou("pdbx_struct_oper_list",x5),fX,hX,_X,wX,AX,Ou("pdbx_entity_branch"),Ou("pdbx_entity_branch_link"),Ou("pdbx_branch_scheme"),Ou("struct_conn"),vX,xX,bX,Ou("atom_sites"),SX,pX],PX;(function(e){e.AtomSitePositionsFieldNames=new Set(["id","Cartn_x","Cartn_y","Cartn_z"])})(PX||(PX={}));var EX={molstar_atom_site_operator_mapping:{label_asym_id:re.Schema.Str(),auth_asym_id:re.Schema.Str(),operator_name:re.Schema.Str(),suffix:re.Schema.Str(),assembly_id:re.Schema.Str(),assembly_operator_id:re.Schema.Int(),symmetry_operator_index:re.Schema.Int(),symmetry_hkl:re.Schema.Vector(3),ncs_id:re.Schema.Int()}},IX=(e,t)=>typeof t[e].operator.assembly>"u"?1:0,S5=(e,t)=>t[e].operator.spgrOp===-1?1:0,sgt=$n.fields().str("label_asym_id",(e,t)=>t[e].label_asym_id).str("auth_asym_id",(e,t)=>t[e].auth_asym_id).str("operator_name",(e,t)=>t[e].operator.name).str("suffix",(e,t)=>t[e].operator.suffix).str("assembly_id",(e,t)=>{var r;return((r=t[e].operator.assembly)===null||r===void 0?void 0:r.id)||""},{valueKind:IX}).int("assembly_operator_id",(e,t)=>{var r;return((r=t[e].operator.assembly)===null||r===void 0?void 0:r.operId)||0},{valueKind:IX}).int("symmetry_operator_index",(e,t)=>t[e].operator.spgrOp,{valueKind:S5}).vec("symmetry_hkl",[(e,t)=>t[e].operator.hkl[0],(e,t)=>t[e].operator.hkl[1],(e,t)=>t[e].operator.hkl[2]],{valueKind:S5}).int("ncs_id",(e,t)=>t[e].operator.ncsId,{valueKind:S5}).getFields();function DX(e,t,r,n){let{label_comp_id:o,type_symbol:i,_rowCount:s}=e.atoms,{_rowCount:a}=e.residues,{offsets:l}=t.residueAtomSegments,c=new Uint8Array(s);for(let g=0;g=a?a:i}findAtom(t){let r=this.findResidue(t);return r<0?-1:typeof t.label_alt_id>"u"?C5(this.residueOffsets[r],this.residueOffsets[r+1],this.map.label_atom_id,t.label_atom_id):_5(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)}findAtomAuth(t){let r=this.findResidueAuth(t);return r<0?-1:typeof t.label_alt_id>"u"?C5(this.residueOffsets[r],this.residueOffsets[r+1],this.map.auth_atom_id,t.auth_atom_id):_5(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)}findAtomOnResidue(t,r,n){return typeof n>"u"?C5(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,r):_5(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,this.map.label_alt_id,r,n)}findAtomsOnResidue(t,r){return wAe(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,r)}findElementOnResidue(t,r){return AAe(this.residueOffsets[t],this.residueOffsets[t+1],this.map.type_symbol,r)}constructor(t){this.map=t,this.entityIndex=t.entities.getEntityIndex,this.residueOffsets=this.map.segments.residueAtomSegments.offsets}};function C5(e,t,r,n){for(let o=e;o=l[c+1]&&(c+=1,u=0),s[d]=++u;o.label_seq_id=re.ofIntArray(s)}return cr.columnToArray(o,"label_seq_id",Int32Array),cr.columnToArray(o,"auth_seq_id",Int32Array),{atoms:n,residues:o,chains:i,atomSourceIndex:t}}function IAe(e){return{id:qr.create22(),atomId:e.id,occupancy:e.occupancy.isDefined?e.occupancy:re.ofConst(1,e._rowCount,re.Schema.float),B_iso_or_equiv:e.B_iso_or_equiv,xyzDefined:e.Cartn_x.isDefined&&e.Cartn_y.isDefined&&e.Cartn_z.isDefined,x:e.Cartn_x.toArray({array:Float32Array}),y:e.Cartn_y.toArray({array:Float32Array}),z:e.Cartn_z.toArray({array:Float32Array})}}function EAe(e,t){return cr.areEqual(e.chains,t.chains)&&cr.areEqual(e.residues,t.residues)&&cr.areEqual(e.atoms,t.atoms)}function DAe(e,t){let r=new Map;if(!rn.is(t))return r;let{molstar_atom_site_operator_mapping:n}=Ad(EX,t.data.frame);if(n._rowCount===0)return r;let o=new Map,i=new Map;for(let u=0;u-1,findChainKey:()=>-1,getEntityFromChain:()=>-1,count:0,entity_id:re.Undefined(0,re.Schema.str),asym_id:re.Undefined(0,re.Schema.str),seq_id_begin:re.Undefined(0,re.Schema.int),seq_id_end:re.Undefined(0,re.Schema.int),chainElementSegments:Bt.create([]),polymerRanges:fn.ofSortedRanges([]),gapRanges:fn.ofSortedRanges([])},T5=function(e){return e.Empty={isDefined:!1,spheres:MX,gaussians:MX},e}(T5||{});function MAe(e,t,r){if(e.has(t))return e.get(t);let n=r.index++;return e.set(t,n),n}function BAe(e,t){if(e.has(t))return e.get(t);let r=new Map;return e.set(t,r),r}function RAe(e,t,r){let n=e.getEntityIndex;return{findChainKey:(s,a)=>{let l=n(s);if(l<0)return-1;let c=t.get(l);return c.has(a)?c.get(a):-1},findSequenceKey:(s,a,l)=>{let c=n(s);if(c<0)return-1;let u=t.get(c);if(u===void 0)return-1;let d=u.get(a);if(d===void 0)return-1;let m=r.get(d),{elementIndices:p,seqRanges:h}=m,f=fn.firstIntersectionIndex(h,Te.ofSingleton(l));return f!==-1?p[f]:-1}}}function LAe(e){throw new Error(`Missing entity entry for entity id '${e}'.`)}function P5(e,t){let{entity_id:r,asym_id:n,seq_id_begin:o,seq_id_end:i,count:s,chainElementSegments:a}=e,l=new Map,c=new Map,u={index:0},d=new Int32Array(s),m=new Int32Array(s),p=new Int32Array(a.count);for(let g=0;gp[g]}}function I5(e,t){let r=[],n=[],o=Bt.transientSegments(e.chainElementSegments,ve.ofBounds(0,e.count)),{seq_id_begin:i,seq_id_end:s}=e;for(;o.hasNext;){let{start:a,end:l}=o.move(),c=-1,u=-1;for(let d=a;d1&&(r.push(c,d-1),n.push(d-1,d),c=d),d===l-1&&r.push(c,d),u=m}}return{polymerRanges:fn.ofSortedRanges(r),gapRanges:fn.ofSortedRanges(n)}}var E5={hierarchy:T5.Empty,conformation:void 0};function RX(e,t){let{ihm_sphere_obj_site:r,ihm_gaussian_obj_site:n}=e;if(r._rowCount===0&&n._rowCount===0)return E5;let o=BX(r),i=FAe(r),s=P5(o,e.entities),a=I5(o,t),l=BX(n),c=OAe(n),u=P5(l,e.entities),d=I5(l,t);return{hierarchy:{isDefined:!0,spheres:k(k(k({},o),s),a),gaussians:k(k(k({},l),u),d)},conformation:{id:qr.create22(),spheres:i,gaussians:c}}}function FAe(e){return{x:e.Cartn_x.toArray({array:Float32Array}),y:e.Cartn_y.toArray({array:Float32Array}),z:e.Cartn_z.toArray({array:Float32Array}),radius:e.object_radius.toArray({array:Float32Array}),rmsf:e.rmsf.toArray({array:Float32Array})}}function OAe(e){let t=_o.ihm_gaussian_obj_site.covariance_matrix.space,r=[],{covariance_matrix:n}=e;for(let o=0,i=n.rowCount;o"X";break;default:_r(c)}return u&&u.size>0?m=>{let p=d(m);return p!=="X"||!u.has(m)?p:d(u.get(m))}:d}function i(c,u){if(u.rowCount===0)throw new Error("cannot be empty");let d=n(c);return new s(d,c,u)}e.ofResidueNames=i;class s{index(u){return this.indexMap.get(u)}constructor(u,d,m){this.kind=u,this.microHet=new Map;let p=o(u),h=[],f=[],y=[],g=new Map,v=0,b=new Map;for(let _=0,w=m.rowCount;_{let T=p(P);return T==="X"?P:T});S[_]=`(${A.join("|")})`}else S[_]=h[_]==="X"?f[_]:h[_]}this.length=v,this.code=re.ofStringArray(h),this.compId=re.ofStringArray(f),this.seqId=re.ofIntArray(y),this.label=re.ofStringArray(S),this.microHet=g,this.indexMap=b}}function a(c,u){let d=t.Generic;return new l(d,c,u)}e.ofSequenceRanges=a;class l{index(u){return u-this.minSeqId}constructor(u,d,m){this.kind=u,this.seqIdStart=d,this.seqIdEnd=m,this.microHet=new Map;let p=0,h=Number.MAX_SAFE_INTEGER;for(let y=0,g=this.seqIdStart.rowCount;yy+h+1,rowCount:f,schema:re.Schema.int}),this.compId=re.ofConst("",f,re.Schema.str),this.length=f,this.minSeqId=h}}})(b1||(b1={}));var RC;(function(e){let t={byEntityKey:{},sequences:[]};function r(...a){let l=[],c={};for(let u=0,d=a.length;u{if(!t||t.length!==n.length)return t=n,r=e.apply(void 0,n),r;for(let o=0,i=n.length;o{if(t.has(r))return t.get(r);let n=e(r);return t.set(r,n),n}}function FX(e){let t=new Map,r=(o,i,s)=>`${o}|${i}|${s}`,n=e.pdbx_unobs_or_zero_occ_residues;for(let o=0,i=n._rowCount;ot.has(r(o,i,s)),get:(o,i,s)=>t.get(r(o,i,s)),size:t.size}}function OX(e){let t=new Map;if(e.chem_comp._rowCount>0){let{id:r}=e.chem_comp;for(let n=0,o=r.rowCount;n{t.set(n,Aq(n))});return t}function NX(e){let t=new Map;if(e.pdbx_chem_comp_identifier._rowCount>0){let{comp_id:r,type:n,identifier:o}=e.pdbx_chem_comp_identifier;for(let i=0,s=r.rowCount;i0){let{id:r,type:n}=e.chem_comp;for(let o=0,i=r.rowCount;o{!t.has(o)&&r.has(o)&&t.set(o,n)})}return t}var UX=gh(e=>{let t=new Set,{label_comp_id:r,auth_comp_id:n}=e.atom_site,o=r.isDefined?r:n;for(let i=0,s=o.rowCount;i0?yield WAe(r,e,n,t):yield qAe(r,e,n,t);for(let i=0;i0?o[o.length-1]:void 0);o.push(d),a=l}}return o})}function U5(e,t){let r=new Map,n=e._rowCount,o=0;for(;oY(this,null,function*(){let q=yield _a(F.basic,F.sourceData,z);if(q.frameCount===0)throw new Error("found no model");let O=q.representative,{trajectory:J}=t(O,N),Q={pairs:F.bonds,count:O.atomicHierarchy.atoms._rowCount},H=yi.fromData(Q),W=f(O),K=0;for(let ce of J)yi.Provider.set(ce,H),e.TrajectoryInfo.set(ce,{index:K++,size:J.length}),e.CoarseGrained.set(ce,W);return new Sl(J)}))}e.trajectoryFromTopologyAndCoordinates=n;let o="__Center__";function i(F){if(F._dynamicPropertyData[o])return F._dynamicPropertyData[o];let N=rH(F.atomicConformation,F.coarseConformation);return F._dynamicPropertyData[o]=N,N}e.getCenter=i;function s(F){let N=new Int32Array(F.rowCount),z=!1;for(let q=0,O=F.rowCount;q0}e.hasCarbohydrate=y;function g(F){let{subtype:N}=F.entities;for(let z=0,q=N.rowCount;z=0)return!0;return!1}e.isFromXray=P;function T(F){if(!rn.is(F.sourceData))return!1;let{db:N}=F.sourceData.data;for(let z=0;z=0)return!0;return!1}e.isFromEm=T;function B(F){if(!rn.is(F.sourceData))return!1;let{db:N}=F.sourceData.data;for(let z=0;z=0)return!0;return!1}e.isFromNmr=B;function D(F){if(!rn.is(F.sourceData)||!P(F))return!1;let{db:N}=F.sourceData.data,{status_code_sf:z}=N.pdbx_database_status;return z.isDefined&&z.value(0)==="REL"}e.hasXrayMap=D;function M(F){if(!rn.is(F.sourceData))return!1;let{db:N}=F.sourceData.data,{db_name:z,content_type:q}=N.pdbx_database_related;for(let O=0,J=N.pdbx_database_related._rowCount;Od.atomicHierarchy.residueAtomSegments;function i(d){return new Gx("residue",d,o,0)}e.fromResidueMap=i;function s(d){return new Gx("residue",z5(d),o,0)}e.fromResidueArray=s;let a=d=>d.atomicHierarchy.chainAtomSegments;function l(d){return new Gx("chain",d,a,0)}e.fromChainMap=l;function c(d){return new Gx("chain",z5(d),a,0)}e.fromChainArray=c;function u(d){return new V5(d)}e.fromEntityMap=u})(GX||(GX={}));function z5(e){let t=new Map;for(let r=0,n=e.length;ra.element-l.element),i}getElements(t){let r=this.segmentGetter(t.model).index,n=this.getStructureElements(t);return{elements:n,property:o=>this.get(r[n[o].element])}}constructor(t,r,n,o){this.level=t,this.map=r,this.segmentGetter=n,this.id=qr.create22(),this.kind=o}},NT=class{has(t){return this.map.has(t)}get(t){return this.map.get(t)}getStructureElements(t){if(t.models.length!==1)throw new Error("Only works on structures with a single model.");let n=new Set,o=t.unitSymmetryGroups,i=[];for(let s of o){let a=s.units[0];if(a.kind!==this.kind)continue;let l=a.elements;for(let c=0,u=l.length;cs.element-a.element),i}getElements(t){let r=this.getStructureElements(t);return{elements:r,property:n=>this.get(r[n].element)}}constructor(t){this.map=t,this.id=qr.create22(),this.level="atom",this.kind=0}},V5=class{has(t){return this.map.has(t)}get(t){return this.map.get(t)}getStructureElements(t){let r=t.models;if(r.length!==1)throw new Error("Only works on structures with a single model.");let n=r[0].atomicHierarchy.index,o=new Set,i=t.unitSymmetryGroups,s=[],a=r[0].atomicHierarchy.chainAtomSegments;for(let l of i){let c=l.units[0];if(c.kind!==this.kind)continue;let u=Bt.transientSegments(a,c.elements);for(;u.hasNext;){let d=u.move(),m=n.getEntityFromChain(d.index);!this.has(m)||o.has(m)||(o.add(m),s[s.length]=$.Location.create(t,c,c.elements[d.start]))}}return s.sort((l,c)=>l.element-c.element),s}getElements(t){let r=this.getStructureElements(t),n=t.model.atomicHierarchy.chainAtomSegments.index,o=t.model.atomicHierarchy.index;return{elements:r,property:i=>this.get(o.getEntityFromChain(n[r[i].element]))}}constructor(t){this.map=t,this.id=qr.create22(),this.level="entity",this.kind=0}};var UT=new Map([["ALA","A"],["ARG","R"],["ASN","N"],["ASP","D"],["CYS","C"],["GLN","Q"],["GLU","E"],["GLY","G"],["HIS","H"],["ILE","I"],["LEU","L"],["LYS","K"],["MET","M"],["PHE","F"],["PRO","P"],["SER","S"],["THR","T"],["TRP","W"],["TYR","Y"],["VAL","V"]]),Byt=new Map(Array.from(UT.entries()).map(([e,t])=>[t,e]));var kn;(function(e){function t(){return o=>r(o)}e.factory=t;function r(o){var i;return i=class{static is(a){return!!a&&o===a.type}constructor(a,l){this.data=a,this.id=qr.create22(),this.type=o,this.label=l&&l.label||o.name,this.description=l&&l.description}},i.type=o,i}e.create=r;function n(o,i){if(!o.tags)return!1;for(let s of o.tags)if(s===i)return!0;return!1}e.hasTag=n,e.Null={id:qr.create22(),type:{name:"Null",typeClass:"Null"},data:void 0,label:"Null"}})(kn||(kn={}));var Hx;(function(e){function t(n){let o=n;return!!o&&!!o.transform&&!!o.parent&&!!o.status}e.is=t;function r(n,o){let i=typeof o=="string"?o:e.is(o)?o.transform.ref:o.ref;return n.cells.get(i)}e.resolve=r})(Hx||(Hx={}));var jx=class{get cell(){var t;return(t=this.state)===null||t===void 0?void 0:t.cells.get(this.ref)}get obj(){var t,r;return(r=(t=this.state)===null||t===void 0?void 0:t.cells.get(this.ref))===null||r===void 0?void 0:r.obj}get data(){var t;return(t=this.obj)===null||t===void 0?void 0:t.data}update(t,r){if(!this.state)throw new Error("To use update() from StateObjectSelector, 'state' must be defined.");return r||(r=this.state.build()),(r||this.state.build()).to(this).update(t),r}checkValid(){if(!this.state)throw new Error("Unassigned State.");let t=this.cell;if(!t)throw new Error("Not created at all. Did you await/then the corresponding state update?");if(t.status==="ok")return!0;throw t.status==="error"?new Error(t.errorText):t.obj===kn.Null?new Error("The object is Null."):new Error("Unresolved. Did you await/then the corresponding state update?")}get isOk(){let t=this.cell;return t&&t.status==="ok"&&t.obj!==kn.Null}constructor(t,r){this.ref=t,this.state=r}},Vo;(function(e){function t(o){var i;if(o)return typeof o=="string"?o:Hx.is(o)?o.transform.ref:(i=o.cell)===null||i===void 0?void 0:i.transform.ref}e.resolveRef=t;function r(o,i){if(i)return Hx.is(i)?i:typeof i=="string"?o.cells.get(i):i.cell}e.resolve=r;function n(o,i){let s=r(o,i);if(!(!s||!s.obj||s.status!=="ok"))return s}e.resolveAndCheck=n})(Vo||(Vo={}));var qC="delete",Bi=5,Md=1<>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?qx(e)+t:t}function fK(){return!0}function YT(e,t,r){return(e===0&&!gK(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function WC(e,t){return hK(e,t,0)}function XT(e,t){return hK(e,t,t)}function hK(e,t,r){return e===void 0?r:gK(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function gK(e){return e<0||e===0&&1/e===-1/0}var yK="@@__IMMUTABLE_ITERABLE__@@";function eu(e){return!!(e&&e[yK])}var vK="@@__IMMUTABLE_KEYED__@@";function Xi(e){return!!(e&&e[vK])}var xK="@@__IMMUTABLE_INDEXED__@@";function Jc(e){return!!(e&&e[xK])}function KT(e){return Xi(e)||Jc(e)}var Vs=function(t){return eu(t)?t:Vu(t)},Ld=function(e){function t(r){return Xi(r)?r:t0(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Vs),_1=function(e){function t(r){return Jc(r)?r:$m(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Vs),$x=function(e){function t(r){return eu(r)&&!KT(r)?r:rb(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Vs);Vs.Keyed=Ld;Vs.Indexed=_1;Vs.Set=$x;var bK="@@__IMMUTABLE_SEQ__@@";function oL(e){return!!(e&&e[bK])}var SK="@@__IMMUTABLE_RECORD__@@";function Jx(e){return!!(e&&e[SK])}function tf(e){return eu(e)||Jx(e)}var eb="@@__IMMUTABLE_ORDERED__@@";function Qm(e){return!!(e&&e[eb])}var YC=0,Zm=1,Rd=2,K5=typeof Symbol=="function"&&Symbol.iterator,CK="@@iterator",QT=K5||CK,Bo=function(t){this.next=t};Bo.prototype.toString=function(){return"[Iterator]"};Bo.KEYS=YC;Bo.VALUES=Zm;Bo.ENTRIES=Rd;Bo.prototype.inspect=Bo.prototype.toSource=function(){return this.toString()};Bo.prototype[QT]=function(){return this};function Ki(e,t,r,n){var o=e===0?t:e===1?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function tu(){return{value:void 0,done:!0}}function _K(e){return Array.isArray(e)?!0:!!ZT(e)}function HX(e){return e&&typeof e.next=="function"}function Q5(e){var t=ZT(e);return t&&t.call(e)}function ZT(e){var t=e&&(K5&&e[K5]||e[CK]);if(typeof t=="function")return t}function YAe(e){var t=ZT(e);return t&&t===e.entries}function XAe(e){var t=ZT(e);return t&&t===e.keys}var tb=Object.prototype.hasOwnProperty;function wK(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var Vu=function(e){function t(r){return r==null?sL():tf(r)?r.toSeq():QAe(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.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,o){var i=this._cache;if(i){for(var s=i.length,a=0;a!==s;){var l=i[o?s-++a:a++];if(n(l[1],l[0],this)===!1)break}return a}return this.__iterateUncached(n,o)},t.prototype.__iterator=function(n,o){var i=this._cache;if(i){var s=i.length,a=0;return new Bo(function(){if(a===s)return tu();var l=i[o?s-++a:a++];return Ki(n,l[0],l[1])})}return this.__iteratorUncached(n,o)},t}(Vs),t0=function(e){function t(r){return r==null?sL().toKeyedSeq():eu(r)?Xi(r)?r.toSeq():r.fromEntrySeq():Jx(r)?r.toSeq():aL(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(Vu),$m=function(e){function t(r){return r==null?sL():eu(r)?Xi(r)?r.entrySeq():r.toIndexedSeq():Jx(r)?r.toSeq().entrySeq():AK(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(Vu),rb=function(e){function t(r){return(eu(r)&&!KT(r)?r:$m(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(Vu);Vu.isSeq=oL;Vu.Keyed=t0;Vu.Set=rb;Vu.Indexed=$m;Vu.prototype[bK]=!0;var C1=function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return this.has(n)?this._array[Jg(this,n)]:o},t.prototype.__iterate=function(n,o){for(var i=this._array,s=i.length,a=0;a!==s;){var l=o?s-++a:a++;if(n(i[l],l,this)===!1)break}return a},t.prototype.__iterator=function(n,o){var i=this._array,s=i.length,a=0;return new Bo(function(){if(a===s)return tu();var l=o?s-++a:a++;return Ki(n,l,i[l])})},t}($m),iL=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),t.prototype.constructor=t,t.prototype.get=function(n,o){return o!==void 0&&!this.has(n)?o:this._object[n]},t.prototype.has=function(n){return tb.call(this._object,n)},t.prototype.__iterate=function(n,o){for(var i=this._object,s=this._keys,a=s.length,l=0;l!==a;){var c=s[o?a-++l:l++];if(n(i[c],c,this)===!1)break}return l},t.prototype.__iterator=function(n,o){var i=this._object,s=this._keys,a=s.length,l=0;return new Bo(function(){if(l===a)return tu();var c=s[o?a-++l:l++];return Ki(n,c,i[c])})},t}(t0);iL.prototype[eb]=!0;var KAe=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),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,o){if(o)return this.cacheResult().__iterate(n,o);var i=this._collection,s=Q5(i),a=0;if(HX(s))for(var l;!(l=s.next()).done&&n(l.value,a++,this)!==!1;);return a},t.prototype.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var i=this._collection,s=Q5(i);if(!HX(s))return new Bo(tu);var a=0;return new Bo(function(){var l=s.next();return l.done?l:Ki(n,a++,l.value)})},t}($m),jX;function sL(){return jX||(jX=new C1([]))}function aL(e){var t=lL(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new iL(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function AK(e){var t=lL(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function QAe(e){var t=lL(e);if(t)return YAe(e)?t.fromEntrySeq():XAe(e)?t.toSetSeq():t;if(typeof e=="object")return new iL(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function lL(e){return wK(e)?new C1(e):_K(e)?new KAe(e):void 0}var TK="@@__IMMUTABLE_MAP__@@";function cL(e){return!!(e&&e[TK])}function PK(e){return cL(e)&&Qm(e)}function qX(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function zu(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(qX(e)&&qX(t)&&e.equals(t))}var LC=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,o=r&65535;return n*o+((t>>>16)*o+n*(r>>>16)<<16>>>0)|0};function $T(e){return e>>>1&1073741824|e&3221225471}var ZAe=Object.prototype.valueOf;function Nu(e){if(e==null)return WX(e);if(typeof e.hashCode=="function")return $T(e.hashCode(e));var t=nTe(e);if(t==null)return WX(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return $Ae(t);case"string":return t.length>oTe?JAe(t):Z5(t);case"object":case"function":return tTe(t);case"symbol":return eTe(t);default:if(typeof t.toString=="function")return Z5(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function WX(e){return e===null?1108378658:1108378659}function $Ae(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return $T(t)}function JAe(e){var t=j5[e];return t===void 0&&(t=Z5(e),H5===iTe&&(H5=0,j5={}),H5++,j5[e]=t),t}function Z5(e){for(var t=0,r=0;r0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function nTe(e){return e.valueOf!==ZAe&&typeof e.valueOf=="function"?e.valueOf(e):e}function IK(){var e=++G5;return G5&1073741824&&(G5=0),e}var $5=typeof WeakMap=="function",J5;$5&&(J5=new WeakMap);var KX=Object.create(null),G5=0,S1="__immutablehash__";typeof Symbol=="function"&&(S1=Symbol(S1));var oTe=16,iTe=255,H5=0,j5={},JT=function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return this._iter.get(n,o)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,o=uL(this,!0);return this._useKeys||(o.valueSeq=function(){return n._iter.toSeq().reverse()}),o},t.prototype.map=function(n,o){var i=this,s=BK(this,n,o);return this._useKeys||(s.valueSeq=function(){return i._iter.toSeq().map(n,o)}),s},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(s,a){return n(s,a,i)},o)},t.prototype.__iterator=function(n,o){return this._iter.__iterator(n,o)},t}(t0);JT.prototype[eb]=!0;var EK=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,o){var i=this,s=0;return o&&qx(this),this._iter.__iterate(function(a){return n(a,o?i.size-++s:s++,i)},o)},t.prototype.__iterator=function(n,o){var i=this,s=this._iter.__iterator(Zm,o),a=0;return o&&qx(this),new Bo(function(){var l=s.next();return l.done?l:Ki(n,o?i.size-++a:a++,l.value,l)})},t}($m),DK=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(s){return n(s,s,i)},o)},t.prototype.__iterator=function(n,o){var i=this._iter.__iterator(Zm,o);return new Bo(function(){var s=i.next();return s.done?s:Ki(n,s.value,s.value,s)})},t}(rb),kK=function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(s){if(s){ZX(s);var a=eu(s);return n(a?s.get(1):s[1],a?s.get(0):s[0],i)}},o)},t.prototype.__iterator=function(n,o){var i=this._iter.__iterator(Zm,o);return new Bo(function(){for(;;){var s=i.next();if(s.done)return s;var a=s.value;if(a){ZX(a);var l=eu(a);return Ki(n,l?a.get(0):a[0],l?a.get(1):a[1],s)}}})},t}(t0);EK.prototype.cacheResult=JT.prototype.cacheResult=DK.prototype.cacheResult=kK.prototype.cacheResult=pL;function MK(e){var t=rf(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=pL,t.__iterateUncached=function(r,n){var o=this;return e.__iterate(function(i,s){return r(s,i,o)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===Rd){var o=e.__iterator(r,n);return new Bo(function(){var i=o.next();if(!i.done){var s=i.value[0];i.value[0]=i.value[1],i.value[1]=s}return i})}return e.__iterator(r===Zm?YC:Zm,n)},t}function BK(e,t,r){var n=rf(e);return n.size=e.size,n.has=function(o){return e.has(o)},n.get=function(o,i){var s=e.get(o,lo);return s===lo?i:t.call(r,s,o,e)},n.__iterateUncached=function(o,i){var s=this;return e.__iterate(function(a,l,c){return o(t.call(r,a,l,c),l,s)!==!1},i)},n.__iteratorUncached=function(o,i){var s=e.__iterator(Rd,i);return new Bo(function(){var a=s.next();if(a.done)return a;var l=a.value,c=l[0];return Ki(o,c,t.call(r,l[1],c,e),a)})},n}function uL(e,t){var r=this,n=rf(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var o=MK(e);return o.reverse=function(){return e.flip()},o}),n.get=function(o,i){return e.get(t?o:-1-o,i)},n.has=function(o){return e.has(t?o:-1-o)},n.includes=function(o){return e.includes(o)},n.cacheResult=pL,n.__iterate=function(o,i){var s=this,a=0;return i&&qx(e),e.__iterate(function(l,c){return o(l,t?c:i?s.size-++a:a++,s)},!i)},n.__iterator=function(o,i){var s=0;i&&qx(e);var a=e.__iterator(Rd,!i);return new Bo(function(){var l=a.next();if(l.done)return l;var c=l.value;return Ki(o,t?c[0]:i?r.size-++s:s++,c[1],l)})},n}function RK(e,t,r,n){var o=rf(e);return n&&(o.has=function(i){var s=e.get(i,lo);return s!==lo&&!!t.call(r,s,i,e)},o.get=function(i,s){var a=e.get(i,lo);return a!==lo&&t.call(r,a,i,e)?a:s}),o.__iterateUncached=function(i,s){var a=this,l=0;return e.__iterate(function(c,u,d){if(t.call(r,c,u,d))return l++,i(c,n?u:l-1,a)},s),l},o.__iteratorUncached=function(i,s){var a=e.__iterator(Rd,s),l=0;return new Bo(function(){for(;;){var c=a.next();if(c.done)return c;var u=c.value,d=u[0],m=u[1];if(t.call(r,m,d,e))return Ki(i,n?d:l++,m,c)}})},o}function sTe(e,t,r){var n=Hu().asMutable();return e.__iterate(function(o,i){n.update(t.call(r,o,i,e),0,function(s){return s+1})}),n.asImmutable()}function aTe(e,t,r){var n=Xi(e),o=(Qm(e)?ia():Hu()).asMutable();e.__iterate(function(s,a){o.update(t.call(r,s,a,e),function(l){return l=l||[],l.push(n?[a,s]:s),l})});var i=mL(e);return o.map(function(s){return di(e,i(s))}).asImmutable()}function lTe(e,t,r){var n=Xi(e),o=[[],[]];e.__iterate(function(s,a){o[t.call(r,s,a,e)?1:0].push(n?[a,s]:s)});var i=mL(e);return o.map(function(s){return di(e,i(s))})}function dL(e,t,r,n){var o=e.size;if(YT(t,r,o))return e;var i=WC(t,o),s=XT(r,o);if(i!==i||s!==s)return dL(e.toSeq().cacheResult(),t,r,n);var a=s-i,l;a===a&&(l=a<0?0:a);var c=rf(e);return c.size=l===0?l:e.size&&l||void 0,!n&&oL(e)&&l>=0&&(c.get=function(u,d){return u=Jg(this,u),u>=0&&ul)return tu();var f=m.next();return n||u===Zm||f.done?f:u===YC?Ki(u,h-1,void 0,f):Ki(u,h-1,f.value[1],f)})},c}function cTe(e,t,r){var n=rf(e);return n.__iterateUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterate(o,i);var a=0;return e.__iterate(function(l,c,u){return t.call(r,l,c,u)&&++a&&o(l,c,s)}),a},n.__iteratorUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterator(o,i);var a=e.__iterator(Rd,i),l=!0;return new Bo(function(){if(!l)return tu();var c=a.next();if(c.done)return c;var u=c.value,d=u[0],m=u[1];return t.call(r,m,d,s)?o===Rd?c:Ki(o,d,m,c):(l=!1,tu())})},n}function LK(e,t,r,n){var o=rf(e);return o.__iterateUncached=function(i,s){var a=this;if(s)return this.cacheResult().__iterate(i,s);var l=!0,c=0;return e.__iterate(function(u,d,m){if(!(l&&(l=t.call(r,u,d,m))))return c++,i(u,n?d:c-1,a)}),c},o.__iteratorUncached=function(i,s){var a=this;if(s)return this.cacheResult().__iterator(i,s);var l=e.__iterator(Rd,s),c=!0,u=0;return new Bo(function(){var d,m,p;do{if(d=l.next(),d.done)return n||i===Zm?d:i===YC?Ki(i,u++,void 0,d):Ki(i,u++,d.value[1],d);var h=d.value;m=h[0],p=h[1],c&&(c=t.call(r,p,m,a))}while(c);return i===Rd?d:Ki(i,m,p,d)})},o}function uTe(e,t){var r=Xi(e),n=[e].concat(t).map(function(s){return eu(s)?r&&(s=Ld(s)):s=r?aL(s):AK(Array.isArray(s)?s:[s]),s}).filter(function(s){return s.size!==0});if(n.length===0)return e;if(n.length===1){var o=n[0];if(o===e||r&&Xi(o)||Jc(e)&&Jc(o))return o}var i=new C1(n);return r?i=i.toKeyedSeq():Jc(e)||(i=i.toSetSeq()),i=i.flatten(!0),i.size=n.reduce(function(s,a){if(s!==void 0){var l=a.size;if(l!==void 0)return s+l}},0),i}function FK(e,t,r){var n=rf(e);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var s=0,a=!1;function l(c,u){c.__iterate(function(d,m){return(!t||u0}function VT(e,t,r,n){var o=rf(e),i=new C1(r).map(function(s){return s.size});return o.size=n?i.max():i.min(),o.__iterate=function(s,a){for(var l=this.__iterator(Zm,a),c,u=0;!(c=l.next()).done&&s(c.value,u++,this)!==!1;);return u},o.__iteratorUncached=function(s,a){var l=r.map(function(d){return d=Vs(d),Q5(a?d.reverse():d)}),c=0,u=!1;return new Bo(function(){var d;return u||(d=l.map(function(m){return m.next()}),u=n?d.every(function(m){return m.done}):d.some(function(m){return m.done})),u?tu():Ki(s,c++,t.apply(null,d.map(function(m){return m.value})))})},o}function di(e,t){return e===t?e:oL(e)?t:e.constructor(t)}function ZX(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function mL(e){return Xi(e)?Ld:Jc(e)?_1:$x}function rf(e){return Object.create((Xi(e)?t0:Jc(e)?$m:rb).prototype)}function pL(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Vu.prototype.cacheResult.call(this)}function OK(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return jK(this,t,e)}function jK(e,t,r){for(var n=[],o=0;o0;)t[r]=arguments[r+1];return xL(this,t,e)}function SL(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return nb(this,e,Km(),function(n){return bL(n,t)})}function CL(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return nb(this,e,Km(),function(n){return xL(n,t)})}function XC(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function KC(){return this.__ownerID?this:this.__ensureOwner(new nL)}function QC(){return this.__ensureOwner()}function _L(){return this.__altered}var Hu=function(e){function t(r){return r==null?Km():cL(r)&&!Qm(r)?r:Km().withMutations(function(n){var o=e(r);Uu(o.size),o.forEach(function(i,s){return n.set(s,i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return Km().withMutations(function(i){for(var s=0;s=n.length)throw new Error("Missing value for key: "+n[s]);i.set(n[s],n[s+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,o){return this._root?this._root.get(0,void 0,n,o):o},t.prototype.set=function(n,o){return eK(this,n,o)},t.prototype.remove=function(n){return eK(this,n,lo)},t.prototype.deleteAll=function(n){var o=Vs(n);return o.size===0?this:this.withMutations(function(i){o.forEach(function(s){return i.remove(s)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Km()},t.prototype.sort=function(n){return ia(Wx(this,n))},t.prototype.sortBy=function(n,o){return ia(Wx(this,o,n))},t.prototype.map=function(n,o){var i=this;return this.withMutations(function(s){s.forEach(function(a,l){s.set(l,n.call(o,a,l,i))})})},t.prototype.__iterator=function(n,o){return new CTe(this,n,o)},t.prototype.__iterate=function(n,o){var i=this,s=0;return this._root&&this._root.iterate(function(a){return s++,n(a[1],a[0],i)},o),s},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?wL(this.size,this._root,n,this.__hash):this.size===0?Km():(this.__ownerID=n,this.__altered=!1,this)},t}(Ld);Hu.isMap=cL;var Ri=Hu.prototype;Ri[TK]=!0;Ri[qC]=Ri.remove;Ri.removeAll=Ri.deleteAll;Ri.setIn=hL;Ri.removeIn=Ri.deleteIn=gL;Ri.update=yL;Ri.updateIn=vL;Ri.merge=Ri.concat=GK;Ri.mergeWith=HK;Ri.mergeDeep=qK;Ri.mergeDeepWith=WK;Ri.mergeIn=SL;Ri.mergeDeepIn=CL;Ri.withMutations=XC;Ri.wasAltered=_L;Ri.asImmutable=QC;Ri["@@transducer/init"]=Ri.asMutable=KC;Ri["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Ri["@@transducer/result"]=function(e){return e.asImmutable()};var VC=function(t,r){this.ownerID=t,this.entries=r};VC.prototype.get=function(t,r,n,o){for(var i=this.entries,s=0,a=i.length;s=ITe)return _Te(t,c,o,i);var p=t&&t===this.ownerID,h=p?c:ef(c);return m?l?u===d-1?h.pop():h[u]=h.pop():h[u]=[o,i]:h.push([o,i]),p?(this.entries=h,this):new VC(t,h)}};var Yx=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};Yx.prototype.get=function(t,r,n,o){r===void 0&&(r=Nu(n));var i=1<<((t===0?r:r>>>t)&wc),s=this.bitmap;return s&i?this.nodes[YK(s&i-1)].get(t+Bi,r,n,o):o};Yx.prototype.update=function(t,r,n,o,i,s,a){n===void 0&&(n=Nu(o));var l=(r===0?n:n>>>r)&wc,c=1<=ETe)return ATe(t,p,u,l,f);if(d&&!f&&p.length===2&&tK(p[m^1]))return p[m^1];if(d&&f&&p.length===1&&tK(f))return f;var y=t&&t===this.ownerID,g=d?f?u:u^c:u|c,v=d?f?XK(p,m,f,y):PTe(p,m,y):TTe(p,m,f,y);return y?(this.bitmap=g,this.nodes=v,this):new Yx(t,g,v)};var GC=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};GC.prototype.get=function(t,r,n,o){r===void 0&&(r=Nu(n));var i=(t===0?r:r>>>t)&wc,s=this.nodes[i];return s?s.get(t+Bi,r,n,o):o};GC.prototype.update=function(t,r,n,o,i,s,a){n===void 0&&(n=Nu(o));var l=(r===0?n:n>>>r)&wc,c=i===lo,u=this.nodes,d=u[l];if(c&&!d)return this;var m=AL(d,t,r+Bi,n,o,i,s,a);if(m===d)return this;var p=this.count;if(!d)p++;else if(!m&&(p--,p>>r)&wc,s=(r===0?n:n>>>r)&wc,a,l=i===s?[TL(e,t,r+Bi,n,o)]:(a=new yh(t,n,o),i>>=1)s[a]=r&1?t[i++]:void 0;return s[n]=o,new GC(e,i+1,s)}function YK(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function XK(e,t,r,n){var o=n?e:ef(e);return o[t]=r,o}function TTe(e,t,r,n){var o=e.length+1;if(n&&t+1===o)return e[t]=r,e;for(var i=new Array(o),s=0,a=0;a0&&i=0&&n>>r&wc;if(o>=this.array.length)return new $g([],t);var i=o===0,s;if(r>0){var a=this.array[o];if(s=a&&a.removeBefore(t,r-Bi,n),s===a&&i)return this}if(i&&!s)return this;var l=Kx(this,t);if(!i)for(var c=0;c>>r&wc;if(o>=this.array.length)return this;var i;if(r>0){var s=this.array[o];if(i=s&&s.removeAfter(t,r-Bi,n),i===s&&o===this.array.length-1)return this}var a=Kx(this,t);return a.array.splice(o+1),i&&(a.array[o]=i),a};var UC={};function rK(e,t){var r=e._origin,n=e._capacity,o=jC(n),i=e._tail;return s(e._root,e._level,0);function s(c,u,d){return u===0?a(c,d):l(c,u,d)}function a(c,u){var d=u===o?i&&i.array:c&&c.array,m=u>r?0:r-u,p=n-u;return p>Md&&(p=Md),function(){if(m===p)return UC;var h=t?--p:m++;return d&&d[h]}}function l(c,u,d){var m,p=c&&c.array,h=d>r?0:r-d>>u,f=(n-d>>u)+1;return f>Md&&(f=Md),function(){for(;;){if(m){var y=m();if(y!==UC)return y;m=null}if(h===f)return UC;var g=t?--f:h++;m=s(p&&p[g],u-Bi,d+(g<=e.size||t<0)return e.withMutations(function(s){t<0?Zg(s,t).set(0,r):Zg(s,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,o=e._root,i=X5();return t>=jC(e._capacity)?n=eL(n,e.__ownerID,0,t,r,i):o=eL(o,e.__ownerID,e._level,t,r,i),i.value?e.__ownerID?(e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e):HC(e._origin,e._capacity,e._level,o,n):e}function eL(e,t,r,n,o,i){var s=n>>>r&wc,a=e&&s0){var c=e&&e.array[s],u=eL(c,t,r-Bi,n,o,i);return u===c?e:(l=Kx(e,t),l.array[s]=u,l)}return a&&e.array[s]===o?e:(i&&Bd(i),l=Kx(e,t),o===void 0&&s===l.array.length-1?l.array.pop():l.array[s]=o,l)}function Kx(e,t){return t&&e&&t===e.ownerID?e:new $g(e?e.array.slice():[],t)}function ZK(e,t){if(t>=jC(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&wc],n-=Bi;return r}}function Zg(e,t,r){t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new nL,o=e._origin,i=e._capacity,s=o+t,a=r===void 0?i:r<0?i+r:o+r;if(s===o&&a===i)return e;if(s>=a)return e.clear();for(var l=e._level,c=e._root,u=0;s+u<0;)c=new $g(c&&c.array.length?[void 0,c]:[],n),l+=Bi,u+=1<=1<d?new $g([],n):p;if(p&&m>d&&sBi;y-=Bi){var g=d>>>y&wc;f=f.array[g]=Kx(f.array[g],n)}f.array[d>>>Bi&wc]=p}if(a=m)s-=m,a-=m,l=Bi,c=null,h=h&&h.removeBefore(n,0,s);else if(s>o||m>>l&wc;if(v!==m>>>l&wc)break;v&&(u+=(1<o&&(c=c.removeBefore(n,l,s-u)),c&&m>>Bi<=Md&&o.size>=n.size*2?(l=o.filter(function(c,u){return c!==void 0&&i!==u}),a=l.toKeyedSeq().map(function(c){return c[0]}).flip().toMap(),e.__ownerID&&(a.__ownerID=l.__ownerID=e.__ownerID)):(a=n.remove(t),l=i===o.size-1?o.pop():o.set(i,void 0))}else if(s){if(r===o.get(i)[1])return e;a=n,l=o.set(i,[t,r])}else a=n.set(t,o.size),l=o.set(o.size,[t,r]);return e.__ownerID?(e.size=a.size,e._map=a,e._list=l,e.__hash=void 0,e.__altered=!0,e):PL(a,l)}var $K="@@__IMMUTABLE_STACK__@@";function tL(e){return!!(e&&e[$K])}var IL=function(e){function t(r){return r==null?GT():tL(r)?r:GT().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,o){var i=this._head;for(n=Jg(this,n);i&&n--;)i=i.next;return i?i.value:o},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var o=this.size+arguments.length,i=this._head,s=arguments.length-1;s>=0;s--)i={value:n[s],next:i};return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):OC(o,i)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&tL(n))return n;Uu(n.size);var o=this.size,i=this._head;return n.__iterate(function(s){o++,i={value:s,next:i}},!0),this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):OC(o,i)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):GT()},t.prototype.slice=function(n,o){if(YT(n,o,this.size))return this;var i=WC(n,this.size),s=XT(o,this.size);if(s!==this.size)return e.prototype.slice.call(this,n,o);for(var a=this.size-i,l=this._head;i--;)l=l.next;return this.__ownerID?(this.size=a,this._head=l,this.__hash=void 0,this.__altered=!0,this):OC(a,l)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?OC(this.size,this._head,n,this.__hash):this.size===0?GT():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,o){var i=this;if(o)return new C1(this.toArray()).__iterate(function(l,c){return n(l,c,i)},o);for(var s=0,a=this._head;a&&n(a.value,s++,this)!==!1;)a=a.next;return s},t.prototype.__iterator=function(n,o){if(o)return new C1(this.toArray()).__iterator(n,o);var i=0,s=this._head;return new Bo(function(){if(s){var a=s.value;return s=s.next,Ki(n,i++,a)}return tu()})},t}(_1);IL.isStack=tL;var Ac=IL.prototype;Ac[$K]=!0;Ac.shift=Ac.pop;Ac.unshift=Ac.push;Ac.unshiftAll=Ac.pushAll;Ac.withMutations=XC;Ac.wasAltered=_L;Ac.asImmutable=QC;Ac["@@transducer/init"]=Ac.asMutable=KC;Ac["@@transducer/step"]=function(e,t){return e.unshift(t)};Ac["@@transducer/result"]=function(e){return e.asImmutable()};function OC(e,t,r,n){var o=Object.create(Ac);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}var sK;function GT(){return sK||(sK=OC(0))}var JK="@@__IMMUTABLE_SET__@@";function EL(e){return!!(e&&e[JK])}function eQ(e){return EL(e)&&Qm(e)}function tQ(e,t){if(e===t)return!0;if(!eu(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Xi(e)!==Xi(t)||Jc(e)!==Jc(t)||Qm(e)!==Qm(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!KT(e);if(Qm(e)){var n=e.entries();return t.every(function(l,c){var u=n.next().value;return u&&zu(u[1],l)&&(r||zu(u[0],c))})&&n.next().done}var o=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var s=!0,a=t.__iterate(function(l,c){if(r?!e.has(l):o?!zu(l,e.get(c,lo)):!zu(e.get(c,lo),l))return s=!1,!1});return s&&e.size===a}function w1(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 WT(e){if(!e||typeof e!="object")return e;if(!eu(e)){if(!e0(e))return e;e=Vu(e)}if(Xi(e)){var t={};return e.__iterate(function(n,o){t[o]=WT(n)}),t}var r=[];return e.__iterate(function(n){r.push(WT(n))}),r}var eP=function(e){function t(r){return r==null?NC():EL(r)&&!Qm(r)?r:NC().withMutations(function(n){var o=e(r);Uu(o.size),o.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Ld(n).keySeq())},t.intersect=function(n){return n=Vs(n).toArray(),n.length?_l.intersect.apply(t(n.pop()),n):NC()},t.union=function(n){return n=Vs(n).toArray(),n.length?_l.union.apply(t(n.pop()),n):NC()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return HT(this,this._map.set(n,n))},t.prototype.remove=function(n){return HT(this,this._map.remove(n))},t.prototype.clear=function(){return HT(this,this._map.clear())},t.prototype.map=function(n,o){var i=this,s=!1,a=HT(this,this._map.mapEntries(function(l){var c=l[1],u=n.call(o,c,c,i);return u!==c&&(s=!0),[u,u]},o));return s?a:this},t.prototype.union=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return n=n.filter(function(i){return i.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(i){for(var s=0;s=0&&o=0&&ithis.size?r:this.find(function(n,o){return o===t},void 0,r)},has:function(t){return t=Jg(this,t),t>=0&&(this.size!==void 0?this.size===1/0||tt?-1:0}function OTe(e){if(e.size===1/0)return 0;var t=Qm(e),r=Xi(e),n=t?1:0,o=e.__iterate(r?t?function(i,s){n=31*n+mK(Nu(i),Nu(s))|0}:function(i,s){n=n+mK(Nu(i),Nu(s))|0}:t?function(i){n=31*n+Nu(i)|0}:function(i){n=n+Nu(i)|0});return NTe(o,n)}function NTe(e,t){return t=LC(t,3432918353),t=LC(t<<15|t>>>-15,461845907),t=LC(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=LC(t^t>>>16,2246822507),t=LC(t^t>>>13,3266489909),t=$T(t^t>>>16),t}function mK(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var Gu=function(e){function t(r){return r==null?rL():eQ(r)?r:rL().withMutations(function(n){var o=$x(r);Uu(o.size),o.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Ld(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(eP);Gu.isOrderedSet=eQ;var A1=Gu.prototype;A1[eb]=!0;A1.zip=ob.zip;A1.zipWith=ob.zipWith;A1.zipAll=ob.zipAll;A1.__empty=rL;A1.__make=sQ;function sQ(e,t){var r=Object.create(A1);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var pK;function rL(){return pK||(pK=sQ(FC()))}function UTe(e){if(Jx(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(tf(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Na=function(t,r){var n;UTe(t);var o=function(a){var l=this;if(a instanceof o)return a;if(!(this instanceof o))return new o(a);if(!n){n=!0;var c=Object.keys(t),u=i._indices={};i._name=r,i._keys=c,i._defaultValues=t;for(var d=0;do.definition.isApplicable(s,l):void 0,run({cell:s,state:a,params:l}){let c=a.build().to(s.transform.ref).apply(o,l);return a.updateTree(c)}})}e.fromTransformer=r;let n;(function(o){function i(s){return a=>t(k({from:s.from instanceof Array?s.from:s.from?[s.from]:[],display:typeof s.display=="string"?{name:s.display}:s.display?s.display:{name:"Unnamed State Action"},params:typeof s.params=="object"?()=>s.params:s.params?s.params:void 0,isApplicable:s.isApplicable},typeof a=="function"?{run:a}:a))}o.build=s=>i(s)})(n=e.Builder||(e.Builder={})),e.build=n.build})(sa||(sa={}));var $e;(function(e){function t(f,y,g){return f.definition.params?f.definition.params(y,g):{}}e.getParamDefinition=t;function r(f){return!!f&&typeof f.toAction=="function"&&typeof f.apply=="function"}e.is=r;let n;(function(f){f[f.Unchanged=0]="Unchanged",f[f.Updated=1]="Updated",f[f.Recreate=2]="Recreate",f[f.Null=3]="Null"})(n=e.UpdateResult||(e.UpdateResult={}));let o=new Map,i=new Map;function s(f){for(let y of f.definition.from)i.has(y.type)?i.get(y.type).push(f):i.set(y.type,[f])}function a(){return Array.from(o.values())}e.getAll=a;function l(f){let y=o.get(f);if(!y)throw new Error(`A transformer with signature '${f}' is not registered.`);return y}e.get=l;function c(f){return i.get(f)||[]}e.fromType=c;function u(f,y){let{name:g}=y,v=`${f}.${g}`;if(o.has(v))throw new Error(`A transform with id '${g}' is already registered. Please pick a unique identifier for your transforms and/or register them only once. This is to ensure that transforms can be serialized and replayed.`);let b={apply(S,_,w){return ur.create(S,b,_,w)},toAction(){return sa.fromTransformer(b)},namespace:f,id:v,definition:y,createDefaultParams(S,_){return y.params?C.getDefaultValues(y.params(S,_)):{}}};return o.set(v,b),s(b),b}e.create=u;function d(f){return y=>u(f,y)}e.factory=d;function m(f){return p.build(f)}e.builderFactory=m;let p;(function(f){function y(v,b){return S=>u(v,k({name:b.name,from:b.from instanceof Array?b.from:[b.from],to:b.to instanceof Array?b.to:[b.to],display:typeof b.display=="string"?{name:b.display}:b.display?b.display:{name:Gp(b.name.replace(/[-]/g," "))},params:typeof b.params=="object"?()=>b.params:b.params?b.params:void 0,isDecorator:b.isDecorator},S))}function g(v){return b=>y(v,b)}f.build=g})(p=e.Builder||(e.Builder={}));function h(f){return p.build(f)}e.build=h,e.ROOT=u("build-in",{name:"root",from:[],to:[],display:{name:"Root",description:"For internal use."},apply(){throw new Error("should never be applied")},update(){return n.Unchanged}})})($e||($e={}));var ur;(function(e){e.RootRef="-=root=-";function t(y,g){return!!y.isHidden!=!!g.isHidden||!!y.isCollapsed!=!!g.isCollapsed||!!y.isGhost!=!!g.isGhost||!!y.isLocked!=!!g.isLocked}e.areStatesEqual=t;function r(y,g){return g?typeof g.isCollapsed<"u"&&y.isCollapsed!==g.isCollapsed||typeof g.isHidden<"u"&&y.isHidden!==g.isHidden||typeof g.isGhost<"u"&&y.isGhost!==g.isGhost||typeof g.isLocked<"u"&&y.isLocked!==g.isLocked:!1}e.isStateChange=r;function n(y,g){if(!g)return!1;let v=!1;for(let b of Object.keys(g)){let S=g[b],_=y[b];!!S!=!!_&&(v=!0,y[b]=S)}return v}e.assignState=n;function o(y,g){if(!g)return!1;let v=!1;for(let b of Object.keys(g)){let S=g[b],_=y[b];!!S!=!!_&&(v=!0,S!==void 0?y[b]=S:delete y[b])}for(let b of Object.keys(y)){let S=g[b],_=y[b];!!S!=!!_&&(v=!0,S!==void 0?y[b]=S:delete y[b])}return v}e.syncState=o;function i(y,g,v,b){let S=b&&b.ref?b.ref:qr.create22(),_;return b&&b.tags&&(_=typeof b.tags=="string"?[b.tags]:b.tags,_.length===0?_=void 0:_.sort()),{parent:y,transformer:g,state:b?.state||{},tags:_,ref:S,dependsOn:b&&b.dependsOn,params:v,version:qr.create22()}}e.create=i;function s(y,g){return te(k({},y),{params:g,version:qr.create22()})}e.withParams=s;function a(y,g){return g?te(k({},y),{state:k(k({},y.state),g)}):y}e.withState=a;function l(y,g){let v;return g&&(v=typeof g=="string"?[g]:g,v.length===0?v=void 0:v.sort()),te(k({},y),{tags:v,version:qr.create22()})}e.withTags=l;function c(y,g){return te(k({},y),{parent:g,version:qr.create22()})}e.withParent=c;function u(y){return i(e.RootRef,$e.ROOT,{},{ref:e.RootRef,state:y})}e.createRoot=u;function d(y,g){return y.tags?y.tags.indexOf(g)>=0:!1}e.hasTag=d;function m(y,g){if(!y.tags)return typeof g!="string"&&g.length===0;if(typeof g=="string")return d(y,g);for(let v of g)if(y.tags.indexOf(v)<0)return!1;return!0}e.hasTags=m;function p(y){return y}function h(y){let g=y.transformer.definition.customSerialization?y.transformer.definition.customSerialization.toJSON:p,v;for(let b of Object.keys(y.state))y.state[b]&&(v||(v={}),v[b]=!0);return{parent:y.parent,transformer:y.transformer.id,params:y.params?g(y.params):void 0,state:v,tags:y.tags,ref:y.ref,dependsOn:y.dependsOn,version:y.version}}e.toJSON=h;function f(y){let g=$e.get(y.transformer),v=g.definition.customSerialization?g.definition.customSerialization.fromJSON:p;return{parent:y.parent,transformer:g,params:y.params?v(y.params):void 0,state:y.state||{},tags:y.tags,ref:y.ref,dependsOn:y.dependsOn,version:y.version}}e.fromJSON=f})(ur||(ur={}));var $C=class{get childMutations(){return this._childMutations?this._childMutations:(this._childMutations=new Map,this._childMutations)}get dependencyMutations(){return this._dependencyMutations?this._dependencyMutations:(this._dependencyMutations=new Map,this._dependencyMutations)}changeNodes(){this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable())}changeChildren(){this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable())}changeDependencies(){this.changedDependencies||(this.changedDependencies=!0,this.dependencies=this.dependencies.asMutable())}get root(){return this.transforms.get(ur.RootRef)}asTransient(){return this.asImmutable().asTransient()}addChild(t,r){if(this.changeChildren(),this.childMutations.has(t))this.childMutations.get(t).add(r);else{let n=this.children.get(t).asMutable();n.add(r),this.children.set(t,n),this.childMutations.set(t,n)}}removeChild(t,r){if(this.changeChildren(),this.childMutations.has(t))this.childMutations.get(t).remove(r);else{let n=this.children.get(t).asMutable();n.remove(r),this.children.set(t,n),this.childMutations.set(t,n)}}clearRoot(){let t=ur.RootRef;if(this.children.get(t).size===0)return;this.changeChildren();let r=Gu();this.children.set(t,r),this.childMutations.set(t,r)}mutateDependency(t,r,n){let o=this.dependencyMutations.get(t);if(!o){let i=this.dependencies.get(t);if(!i&&n==="remove")return;this.changeDependencies(),o=i?i.asMutable():Gu().asMutable(),this.dependencyMutations.set(t,o),this.dependencies.set(t,o)}n==="add"?o.add(r):o.remove(r)}changeParent(t,r){tP(this.transforms,t);let n=this.transforms.get(t);this.removeChild(n.parent,t),this.addChild(r,t),this.changeNodes(),this.transforms.set(t,ur.withParent(n,r))}add(t){let r=t.ref;this.transforms.has(t.ref)&&this.transforms.get(t.ref).parent!==t.parent&&HTe(t.ref);let n=this.children.get(t.parent);if(n||jTe(t.parent),n.has(t.ref)||this.addChild(t.parent,t.ref),this.children.has(t.ref)||(this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable()),this.children.set(t.ref,Gu())),this.changeNodes(),this.transforms.set(r,t),t.dependsOn)for(let o of t.dependsOn)this.mutateDependency(o,r,"add");return this}setParams(t,r){tP(this.transforms,t);let n=this.transforms.get(t);return bg(n.params,r)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,ur.withParams(n,r)),!0)}setTags(t,r){tP(this.transforms,t);let n=this.transforms.get(t),o=ur.withParams(n,r);return lx(n.tags,o.tags)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,o),!0)}assignState(t,r){tP(this.transforms,t);let n=this.transforms.get(t);if(this._stateUpdates&&this._stateUpdates.has(t))return ur.assignState(n.state,r),n;{this._stateUpdates||(this._stateUpdates=new Set),this._stateUpdates.add(n.ref),this.changeNodes();let o=ur.withState(n,r);return this.transforms.set(t,o),o}}remove(t){let r=this.transforms.get(t);if(!r)return[];let n=Go.subtreePostOrder(this,r);if(t===ur.RootRef){if(n.pop(),n.length===0)return n;this.clearRoot()}else{if(n.length===0)return n;this.removeChild(r.parent,r.ref)}this.changeNodes(),this.changeChildren();for(let i of n)this.transforms.delete(i.ref),this.children.delete(i.ref),this._childMutations&&this._childMutations.delete(i.ref);let o=[];for(let i of n){if(i.dependsOn)for(let s of i.dependsOn)this.transforms.has(s)&&this.mutateDependency(s,i.ref,"remove");if(this.dependencies.has(i.ref)){let s=this.dependencies.get(i.ref).toArray();this.changeDependencies(),this.dependencies.delete(i.ref),this._dependencyMutations&&this._dependencyMutations.delete(i.ref);for(let a of s)if(this.transforms.has(a))for(let l of this.remove(a))o[o.length]=l}}for(let i of o)n[n.length]=i;return n}asImmutable(){return!this.changedNodes&&!this.changedChildren&&!this._childMutations?this.tree:(this._childMutations&&this._childMutations.forEach(VTe,this.children),this._dependencyMutations&&this._dependencyMutations.forEach(GTe,this.dependencies),Go.create(this.changedNodes?this.transforms.asImmutable():this.transforms,this.changedChildren?this.children.asImmutable():this.children,this.changedDependencies?this.dependencies.asImmutable():this.dependencies))}constructor(t){this.tree=t,this.transforms=this.tree.transforms,this.children=this.tree.children,this.dependencies=this.tree.dependencies,this.changedNodes=!1,this.changedChildren=!1,this.changedDependencies=!1,this._childMutations=void 0,this._dependencyMutations=void 0,this._stateUpdates=void 0}};function VTe(e,t){this.set(t,e.asImmutable())}function GTe(e,t){e.size===0?this.delete(t):this.set(t,e.asImmutable())}function HTe(e){throw new Error(`Transform '${e}' is already present in the tree.`)}function jTe(e){throw new Error(`Parent '${e}' must be present in the tree.`)}function tP(e,t){if(!e.has(t))throw new Error(`Node '${t}' is not present in the tree.`)}var Go;(function(e){class t{get root(){return this.transforms.get(ur.RootRef)}asTransient(){return new $C(this)}constructor(S,_,w){this.transforms=S,this.children=_,this.dependencies=w}}function r(b){let S=b||ur.createRoot();return n(Hu([[S.ref,S]]),Hu([[S.ref,Gu()]]),Hu())}e.createEmpty=r;function n(b,S,_){return new t(b,S,_)}e.create=n;function o(b){i(this,this.tree.transforms.get(b))}function i(b,S){let _=b.tree.children.get(S.ref);_&&_.size&&_.forEach(o,b),b.f(S,b.tree,b.state)}function s(b,S,_,w){let E={tree:b,state:_,f:w};return i(E,S),E.state}e.doPostOrder=s;function a(b){l(this,this.tree.transforms.get(b))}function l(b,S){let _=b.f(S,b.tree,b.state);if(typeof _=="boolean"&&!_)return;let w=b.tree.children.get(S.ref);w&&w.size&&w.forEach(a,b)}function c(b,S,_,w){let E={tree:b,state:_,f:w};return l(E,S),E.state}e.doPreOrder=c;function u(b,S,_){_.push(b)}function d(b,S){return s(b,S,[],u)}e.subtreePostOrder=d;function m(b,S,_){_.push(ur.toJSON(b))}function p(b){let S=[];return c(b,b.root,S,m),{transforms:S}}e.toJSON=p;function h(b){let S=Hu().asMutable(),_=Hu().asMutable(),w=Hu().asMutable();for(let A of b.transforms){let P=ur.fromJSON(A);S.set(P.ref,P),_.has(P.ref)||_.set(P.ref,Gu().asMutable()),P.ref!==P.parent&&_.get(P.parent).add(P.ref)}let E=new Set;for(let A of b.transforms){let P=A.ref;if(_.set(P,_.get(P).asImmutable()),!!A.dependsOn)for(let T of A.dependsOn)E.add(T),w.has(T)?w.get(T).add(P):w.set(T,Gu([P]).asMutable())}return E.forEach(A=>{w.set(A,w.get(A).asImmutable())}),n(S.asImmutable(),_.asImmutable(),w.asImmutable())}e.fromJSON=h;function f(b){console.log({tr:b.transforms.keySeq().toArray(),tr1:b.transforms.valueSeq().toArray().map(S=>S.ref),ch:b.children.keySeq().toArray()})}e.dump=f;function y(b,S,_){if(S===_)return!0;let E=b.children.get(S).values();for(;;){let A=E.next();if(A.done)return!1;if(y(b,A.value,_))return!0}}function g(b,S,_){return!b.transforms.has(S)||!b.transforms.has(_)?!1:y(b,S,_)}e.subtreeHasRef=g;function v(b,S){let _=b.children.get(S);if(_.size!==1)return S;let w=b.transforms.get(_.first());return w.transformer.definition.isDecorator?v(b,w.ref):S}e.getDecoratorRoot=v})(Go||(Go={}));var qt;(function(e){function t(K,ce){return r(K)(ce)}e.select=t;function r(K){let ce=K||c.root,V;return o(ce)?V=ce.compile():n(ce)?V=c.byValue(ce).compile():i(ce)?V=ce:V=c.byRef(ce).compile(),V}e.compile=r;function n(K){return K.transform!==void 0&&K.status!==void 0}function o(K){return K.compile!==void 0}function i(K){return typeof K=="function"}let s={select(K){return t(this,K||this.state)}};function a(K,ce){s[K]=function(...V){return ce.call(void 0,this,...V)}}function l(K){return Object.create(s,{compile:{writable:!1,configurable:!1,value:K}})}let c;(function(K){K.root=l(()=>le=>[le.cells.get(le.tree.root.ref)]);function ce(...le){return l(()=>j=>{let ue=[];for(let fe of le){let De=j.cells.get(fe);De&&ue.push(De)}return ue})}K.byRef=ce;function V(...le){return l(()=>j=>le)}K.byValue=V;function G(le,j=ur.RootRef){return l(()=>ue=>{let fe={roots:[],cells:ue.cells,type:le.type};return Go.doPreOrder(ue.tree,ue.tree.transforms.get(j),fe,de),fe.roots})}K.rootsOfType=G;function X(le,j=ur.RootRef){return l(()=>ue=>{let fe={ret:[],cells:ue.cells,type:le.type};return Go.doPreOrder(ue.tree,ue.tree.transforms.get(j),fe,we),fe.ret})}K.ofType=X;function Z(le,j=ur.RootRef){return l(()=>ue=>{let fe={ret:[],cells:ue.cells,t:le};return Go.doPreOrder(ue.tree,ue.tree.transforms.get(j),fe,Be),fe.ret})}K.ofTransformer=Z;function ie(le,j=ur.RootRef){return l(()=>ue=>{let fe={ret:[],cells:ue.cells,t:le};return Go.doPreOrder(ue.tree,ue.tree.transforms.get(j),fe,Ie),fe.ret})}K.ofTransformerWithError=ie;function de(le,j,ue){let fe=ue.cells.get(le.ref);return fe&&fe.obj&&fe.obj.type===ue.type?(ue.roots.push(fe),!1):!0}function we(le,j,ue){let fe=ue.cells.get(le.ref);return fe&&fe.obj&&fe.obj.type===ue.type&&ue.ret.push(fe),!0}function Be(le,j,ue){let fe=ue.cells.get(le.ref);return fe&&fe.obj&&fe.transform.transformer===ue.t&&ue.ret.push(fe),!0}function Ie(le,j,ue){let fe=ue.cells.get(le.ref);return fe&&fe.status==="error"&&fe.transform.transformer===ue.t&&ue.ret.push(fe),!0}})(c=e.Generators||(e.Generators={})),a("flatMap",u);function u(K,ce){let V=r(K);return l(()=>G=>{let X=[];for(let Z of V(G))for(let ie of ce(Z,G))X.push(ie);return X})}e.flatMap=u,a("mapObject",d);function d(K,ce){let V=r(K);return l(()=>G=>{let X=[];for(let Z of V(G)){let ie=ce(Z,G);ie&&X.push(ie)}return X})}e.mapObject=d,a("unique",m);function m(K){let ce=r(K);return l(()=>V=>{let G=new Set,X=[];for(let Z of ce(V))Z&&(G.has(Z.transform.ref)||(G.add(Z.transform.ref),X.push(Z)));return X})}e.unique=m,a("first",p);function p(K){let ce=r(K);return l(()=>V=>{let G=ce(V);return G.length?[G[0]]:[]})}e.first=p,a("filter",h);function h(K,ce){return u(K,V=>ce(V)?[V]:[])}e.filter=h,a("withStatus",f);function f(K,ce){return h(K,V=>V.status===ce)}e.withStatus=f,a("withTag",y);function y(K,ce){return h(K,V=>!!V.transform.tags&&V.transform.tags.indexOf(ce)>=0)}e.withTag=y,a("subtree",g);function g(K){return u(K,(ce,V)=>{let G=[];return Go.doPreOrder(V.tree,V.tree.transforms.get(ce.transform.ref),G,(X,Z,ie)=>{ie.push(X.ref)}),G.map(X=>V.cells.get(X))})}e.subtree=g,a("children",v);function v(K){return u(K,(ce,V)=>{let G=[];return V.tree.children.get(ce.transform.ref).forEach(X=>G.push(V.cells.get(X))),G})}e.children=v,a("ofType",b);function b(K,ce){return h(K,V=>V.obj?V.obj.type===ce.type:!1)}e.ofType=b,a("ancestor",S);function S(K,ce){return m(d(K,(V,G)=>D(G.tree,G.cells,V.transform.ref,ce)))}e.ancestor=S,a("ancestorOfType",_);function _(K,ce){return m(d(K,(V,G)=>U(G.tree,G.cells,V.transform.ref,ce)))}e.ancestorOfType=_,a("ancestorWithTransformer",w);function w(K,ce){return m(d(K,(V,G)=>R(G.tree,G.cells,V.transform.ref,ce)))}e.ancestorWithTransformer=w,a("withTransformer",E);function E(K,ce){return h(K,V=>V.transform.transformer===ce)}e.withTransformer=E,a("root",A);function A(K,ce){return m(d(K,(V,G)=>M(G.tree,G.cells,V.transform.ref,ce)))}e.root=A,a("rootOfType",P);function P(K,ce){return m(d(K,(V,G)=>F(G.tree,G.cells,V.transform.ref,ce)))}e.rootOfType=P,a("parent",T);function T(K){return m(d(K,(ce,V)=>V.cells.get(V.tree.transforms.get(ce.transform.ref).parent)))}e.parent=T;function B(K,ce,V,G,X){let Z=K.transforms.get(V),ie;for(;;){Z=K.transforms.get(Z.parent);let de=ce.get(Z.ref);if(de.obj&&G(de)&&(ie=de,X)||Z.ref===ur.RootRef)return ie}}function D(K,ce,V,G){return B(K,ce,V,G,!0)}e.findAncestor=D;function M(K,ce,V,G){return B(K,ce,V,G,!1)}e.findRoot=M;function R(K,ce,V,G){return D(K,ce,V,Array.isArray(G)?X=>G.indexOf(X.transform.transformer)>=0:X=>X.transform.transformer===G)}e.findAncestorWithTransformer=R;function U(K,ce,V,G){return D(K,ce,V,N(G))}e.findAncestorOfType=U;function F(K,ce,V,G){return M(K,ce,V,N(G))}e.findRootOfType=F;function N(K){return Array.isArray(K)?ce=>{for(let V of K)if(V.type===ce.obj.type)return!0}:ce=>ce.obj.type===K.type}function z(K,ce,V){return Go.doPreOrder(K,K.transforms.get(ce),{refs:{},tags:V},q).refs}e.findUniqueTagsInSubtree=z;function q(K,ce,V){if(K.tags){for(let G of K.tags)if(V.tags.has(G)){V.refs[G]=K.ref;break}}return!0}function O(K,ce,V){return Go.doPreOrder(K,K.transforms.get(ce),{ref:void 0,tag:V},J).ref}e.findTagInSubtree=O;function J(K,ce,V){return K.tags&&K.tags.indexOf(V.tag)>=0?(V.ref=K.ref,!1):!0}function Q(K,ce,V){return Go.doPreOrder(K,K.transforms.get(ce),{refs:[],tags:V},H).refs}e.findWithAllTags=Q;function H(K,ce,V){if(K.tags){let G=V.tags.size,X=0;for(let Z of K.tags)if(V.tags.has(Z)&&(X++,X===G)){V.refs.push(K);break}}else V.tags.size===0&&V.refs.push(K)}function W(K,ce,V){if(K.transforms.get(ce).transformer===V)return K.cells.get(ce);let X=K.tree.children.get(ce);if(X.size!==1)return;let Z=X.first();if(K.transforms.get(Z).transformer.definition.isDecorator)return W(K,Z,V)}e.tryFindDecorator=W})(qt||(qt={}));var Hl;(function(e){function t(){let r=new ML,n=()=>r.create();return n.dispose=()=>r.dispose(),n.behavior=o=>r.behavior(o),n}e.create=t})(Hl||(Hl={}));var ML=class{constructor(){this._eventList=[],this._disposed=!1}create(){let t=new mo;return this._eventList.push(t),t}behavior(t){let r=new Zs(t);return this._eventList.push(r),r}dispose(){if(!this._disposed){for(let t of this._eventList)t.complete();this._disposed=!0}}};var mQ=Symbol.for("immer-nothing"),aQ=Symbol.for("immer-draftable"),ju=Symbol.for("immer-state");function Jm(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ib=Object.getPrototypeOf;function sb(e){return!!e&&!!e[ju]}function P1(e){return e?pQ(e)||Array.isArray(e)||!!e[aQ]||!!e.constructor?.[aQ]||sP(e)||aP(e):!1}var qTe=Object.prototype.constructor.toString();function pQ(e){if(!e||typeof e!="object")return!1;let t=ib(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===qTe}function rP(e,t){iP(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function iP(e){let t=e[ju];return t?t.type_:Array.isArray(e)?1:sP(e)?2:aP(e)?3:0}function LL(e,t){return iP(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fQ(e,t,r){let n=iP(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function WTe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function sP(e){return e instanceof Map}function aP(e){return e instanceof Set}function T1(e){return e.copy_||e.base_}function FL(e,t){if(sP(e))return new Map(e);if(aP(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=pQ(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ju];let o=Reflect.ownKeys(n);for(let i=0;i1&&(e.set=e.add=e.clear=e.delete=YTe),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>VL(n,!0))),e}function YTe(){Jm(2)}function lP(e){return Object.isFrozen(e)}var XTe={};function I1(e){let t=XTe[e];return t||Jm(0,e),t}var JC;function hQ(){return JC}function KTe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function lQ(e,t){t&&(I1("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function OL(e){NL(e),e.drafts_.forEach(QTe),e.drafts_=null}function NL(e){e===JC&&(JC=e.parent_)}function cQ(e){return JC=KTe(JC,e)}function QTe(e){let t=e[ju];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function uQ(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ju].modified_&&(OL(t),Jm(4)),P1(e)&&(e=nP(t,e),t.parent_||oP(t,e)),t.patches_&&I1("Patches").generateReplacementPatches_(r[ju].base_,e,t.patches_,t.inversePatches_)):e=nP(t,r,[]),OL(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mQ?e:void 0}function nP(e,t,r){if(lP(t))return t;let n=t[ju];if(!n)return rP(t,(o,i)=>dQ(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return oP(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,s=!1;n.type_===3&&(i=new Set(o),o.clear(),s=!0),rP(i,(a,l)=>dQ(e,n,o,a,l,r,s)),oP(e,o,!1),r&&e.patches_&&I1("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function dQ(e,t,r,n,o,i,s){if(sb(o)){let a=i&&t&&t.type_!==3&&!LL(t.assigned_,n)?i.concat(n):void 0,l=nP(e,o,a);if(fQ(r,n,l),sb(l))e.canAutoFreeze_=!1;else return}else s&&r.add(o);if(P1(o)&&!lP(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nP(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&oP(e,o)}}function oP(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&VL(t,r)}function ZTe(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:hQ(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=GL;r&&(o=[n],i=e_);let{revoke:s,proxy:a}=Proxy.revocable(o,i);return n.draft_=a,n.revoke_=s,a}var GL={get(e,t){if(t===ju)return e;let r=T1(e);if(!LL(r,t))return $Te(e,r,t);let n=r[t];return e.finalized_||!P1(n)?n:n===BL(e.base_,t)?(RL(e),e.copy_[t]=zL(n,e)):n},has(e,t){return t in T1(e)},ownKeys(e){return Reflect.ownKeys(T1(e))},set(e,t,r){let n=gQ(T1(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=BL(T1(e),t),i=o?.[ju];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(WTe(r,o)&&(r!==void 0||LL(e.base_,t)))return!0;RL(e),UL(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return BL(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,RL(e),UL(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=T1(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Jm(11)},getPrototypeOf(e){return ib(e.base_)},setPrototypeOf(){Jm(12)}},e_={};rP(GL,(e,t)=>{e_[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});e_.deleteProperty=function(e,t){return e_.set.call(this,e,t,void 0)};e_.set=function(e,t,r){return GL.set.call(this,e[0],t,r,e[0])};function BL(e,t){let r=e[ju];return(r?T1(r):e)[t]}function $Te(e,t,r){let n=gQ(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function gQ(e,t){if(!(t in e))return;let r=ib(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=ib(r)}}function UL(e){e.modified_||(e.modified_=!0,e.parent_&&UL(e.parent_))}function RL(e){e.copy_||(e.copy_=FL(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var JTe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let s=this;return function(l=i,...c){return s.produce(l,u=>r.call(this,u,...c))}}typeof r!="function"&&Jm(6),n!==void 0&&typeof n!="function"&&Jm(7);let o;if(P1(t)){let i=cQ(this),s=zL(t,void 0),a=!0;try{o=r(s),a=!1}finally{a?OL(i):NL(i)}return lQ(i,n),uQ(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===mQ&&(o=void 0),this.autoFreeze_&&VL(o,!0),n){let i=[],s=[];I1("Patches").generateReplacementPatches_(t,o,i,s),n(i,s)}return o}else Jm(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let n,o;return[this.produce(t,r,(s,a)=>{n=s,o=a}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){P1(e)||Jm(8),sb(e)&&(e=ePe(e));let t=cQ(this),r=zL(e,void 0);return r[ju].isManual_=!0,NL(t),r}finishDraft(e,t){let r=e&&e[ju];(!r||!r.isManual_)&&Jm(9);let{scope_:n}=r;return lQ(n,t),uQ(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=I1("Patches").applyPatches_;return sb(e)?n(e,t):this.produce(e,o=>n(o,t))}};function zL(e,t){let r=sP(e)?I1("MapSet").proxyMap_(e,t):aP(e)?I1("MapSet").proxySet_(e,t):ZTe(e,t);return(t?t.scope_:hQ()).drafts_.push(r),r}function ePe(e){return sb(e)||Jm(10,e),yQ(e)}function yQ(e){if(!P1(e)||lP(e))return e;let t=e[ju],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=FL(e,t.scope_.immer_.useStrictShallowCopy_)}else r=FL(e,!0);return rP(r,(n,o)=>{fQ(r,n,yQ(o))}),t&&(t.finalized_=!1),r}var qu=new JTe,wl=qu.produce,v1t=qu.produceWithPatches.bind(qu),vQ=qu.setAutoFreeze.bind(qu),x1t=qu.setUseStrictShallowCopy.bind(qu),b1t=qu.applyPatches.bind(qu),S1t=qu.createDraft.bind(qu),C1t=qu.finishDraft.bind(qu);var r0;(function(e){function t(s){if(!s.state||s.state.tree===s.editInfo.sourceTree)return s.tree.asImmutable();let a=s.state.tree.asTransient();for(let l of s.actions)switch(l.kind){case"add":a.add(l.transform);break;case"update":a.setParams(l.ref,l.params);break;case"delete":a.remove(l.ref);break;case"insert":{let c=a.children.get(l.ref).toArray();a.add(l.transform);for(let u of c)a.changeParent(u,l.transform.ref);break}}return s.editInfo.sourceTree=s.tree,a.asImmutable()}function r(s){return!!s&&typeof s.getTree=="function"}e.is=r;function n(s){return!!s&&typeof s.getTree=="function"&&typeof s.ref=="string"}e.isTo=n;class o{get editInfo(){return this.state.editInfo}get currentTree(){return this.state.tree}to(a){let l=typeof a=="string"?a:Hx.is(a)?a.transform.ref:a.ref;return new i(this.state,l,this)}toRoot(){return new i(this.state,this.state.tree.root.ref,this)}delete(a){let l=Vo.resolveRef(a);return!l||!this.state.tree.transforms.has(l)?this:(this.editInfo.count++,this.state.tree.remove(l),this.state.actions.push({kind:"delete",ref:l}),this)}getTree(){return t(this.state)}commit(a){if(!this.state.state)throw new Error("Cannot commit template tree");return this.state.state.runTask(this.state.state.updateTree(this,a))}constructor(a,l){this.state={state:l,tree:a.asTransient(),actions:[],editInfo:{applied:!1,sourceTree:a,count:0,lastUpdate:void 0}}}}e.Root=o;class i{get editInfo(){return this.state.editInfo}get selector(){return new jx(this.ref,this.state.state)}getApplyRoot(){return Go.getDecoratorRoot(this.state.tree,this.ref)}apply(a,l,c){if(a.definition.isDecorator)return this.insert(a,l,c);let u=this.getApplyRoot(),d=a.apply(u,l,c);return this.state.tree.add(d),this.editInfo.count++,this.editInfo.lastUpdate=d.ref,this.state.actions.push({kind:"add",transform:d}),new i(this.state,d.ref,this.root)}applyOrUpdate(a,l,c,u){if(this.state.tree.transforms.has(a)){let d=this.to(a);return c&&d.update(c),d}else return this.apply(l,c,te(k({},u),{ref:a}))}applyOrUpdateTagged(a,l,c,u){if(l.definition.isDecorator)throw new Error("Can't use applyOrUpdateTagged on decorator transformers.");let d=this.getApplyRoot(),m=this.state.tree.children.get(d).values();for(;;){let h=m.next();if(h.done)break;let f=this.state.tree.transforms.get(h.value);if(f&&ur.hasTags(f,a)){let y=this.to(h.value);return y.updateTagged(c,xQ(f.tags,a,u&&u.tags)),y}}let p=l.apply(d,c,te(k({},u),{tags:xQ(a,u&&u.tags)}));return this.state.tree.add(p),this.editInfo.count++,this.editInfo.lastUpdate=p.ref,this.state.actions.push({kind:"add",transform:p}),new i(this.state,p.ref,this.root)}group(a,l,c){return this.apply(a,l,c)}insert(a,l,c){let u=this.state.tree.children.get(this.ref).toArray(),d=a.apply(this.ref,l,c);this.state.tree.add(d);for(let m of u)this.state.tree.changeParent(m,d.ref);return this.editInfo.count++,this.editInfo.lastUpdate=d.ref,this.state.actions.push({kind:"insert",ref:this.ref,transform:d}),new i(this.state,d.ref,this.root)}updateTagged(a,l){(this.state.tree.setParams(this.ref,a)||this.state.tree.setTags(this.ref,l))&&(this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.push({kind:"update",ref:this.ref,params:a}))}update(a,l){let c;if(l){let u=this.state.tree.transforms.get(this.ref);c=wl(u.params,l)}else c=typeof a=="function"?wl(this.state.tree.transforms.get(this.ref).params,a):a;return this.state.tree.setParams(this.ref,c)&&(this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.push({kind:"update",ref:this.ref,params:c})),this.root}to(a){return this.root.to(a)}toRoot(){return this.root.toRoot()}delete(a){return this.root.delete(a)}getTree(){return t(this.state)}commit(a){if(!this.state.state)throw new Error("Cannot commit template tree");return this.state.state.runTask(this.state.state.updateTree(this,a))}constructor(a,l,c){if(this.state=a,this.root=c,this.ref=l,!this.state.tree.transforms.has(l))throw new Error(`Could not find node '${l}'.`)}}e.To=i})(r0||(r0={}));function xQ(...e){let t,r=[];for(let n of e)if(n)if(t||(t=new Set),typeof n=="string"){if(t.has(n))continue;t.add(n),r.push(n)}else for(let o of n)t.has(o)||(t.add(o),r.push(o));return r}var cP=class{constructor(){this.ev=Hl.create(),this.actions=new Map,this.fromTypeIndex=new Map,this.events={added:this.ev(),removed:this.ev()}}add(t){let r=$e.is(t)?t.toAction():t;if(this.actions.has(r.id))return this;this.actions.set(r.id,r);for(let n of r.definition.from)this.fromTypeIndex.has(n.type)?this.fromTypeIndex.get(n.type).push(r):this.fromTypeIndex.set(n.type,[r]);return this.events.added.next(void 0),this}remove(t){let r=$e.is(t)?t.toAction().id:qr.is(t)?t:t.id,n=this.actions.get(r);if(!n)return this;this.actions.delete(r);for(let o of n.definition.from){let i=this.fromTypeIndex.get(o.type);i&&(_d(i,n),i.length===0&&this.fromTypeIndex.delete(o.type))}return this.events.removed.next(void 0),this}fromCell(t,r){let n=t.obj;if(!n)return[];let o=this.fromTypeIndex.get(n.type);if(!o)return[];let i=!1;for(let a of o)if(a.definition.isApplicable){i=!0;break}if(!i)return o;let s=[];for(let a of o)a.definition.isApplicable?a.definition.isApplicable(n,t.transform,r)&&s.push(a):s.push(a);return s}dispose(){this.ev.dispose()}};var Fd;(function(e){function t(i){return{type:"message",timestamp:new Date,message:i}}e.message=t;function r(i){return{type:"error",timestamp:new Date,message:i}}e.error=r;function n(i){return{type:"warning",timestamp:new Date,message:i}}e.warning=n;function o(i){return{type:"info",timestamp:new Date,message:i}}e.info=o})(Fd||(Fd={}));var n0;(function(e){class t{get current(){return this._current}set current(i){this._current=i}getAncestorOfType(i){if(!this._current)return;let s=this._current;for(;;){if(s=this.cells.get(s.transform.parent),!s.obj)return;if(s.obj.type===i.type)return s.obj;if(s.transform.ref===ur.RootRef)return}}getRootOfType(i){if(!this._current)return;let s=this._current,a;for(;;){if(!s.obj)return;if(s.obj.type===i.type&&(a=s),s.transform.ref===ur.RootRef)return a?a.obj:void 0;s=this.cells.get(s.transform.parent)}}constructor(i){this.cells=i,this._current=void 0}}e.Impl=t;function r(o,i){let s=o.cells,a=s.get(i),l=[a];for(;a?.transform.transformer.definition.isDecorator;)a=s.get(a.transform.parent),l.push(a);return l}e.getDecoratorChain=r;function n(o,i,s){let a,l=o.cells.get(s);if(l)for(;;){if(!l.obj)return;if(l.obj.type===i.type&&(a=l),l.transform.ref===ur.RootRef)return a?a.obj:void 0;l=o.cells.get(l.transform.parent)}}e.getRootOfType=n})(n0||(n0={}));var uP=class{constructor(){this.queue=[],this.signal=new mo}get length(){return this.queue.length}enqueue(t){return this.queue.push(t),this.queue.length===1?!0:this.waitFor(t)}handled(t){eh(this.queue,t),this.queue.length>0&&this.signal.next({v:this.queue[0],stillPresent:!0})}remove(t){let r=eh(this.queue,t);return r&&this.signal.next({v:t,stillPresent:!1}),r}waitFor(t){return new Promise(r=>{let n=this.signal.subscribe(({v:o,stillPresent:i})=>{o===t&&(n.unsubscribe(),r(i))})})}};var ru=class{get tree(){return this._tree}get transforms(){return this._tree.transforms}get current(){return this.behaviors.currentObject.value.ref}get root(){return this.cells.get(this._tree.root.ref)}build(){return new r0.Root(this.tree,this)}addHistory(t,r){this.historyCapacity!==0&&(this.history.unshift([t,r||"Update"]),this.history.length>this.historyCapacity&&this.history.pop(),this.events.historyUpdated.next({state:this}))}clearHistory(){this.history.length!==0&&(this.history=[],this.events.historyUpdated.next({state:this}))}get latestUndoLabel(){return this.history.length>0?this.history[0][1]:void 0}get canUndo(){return this.history.length>0}undo(){return Pe.create("Undo",t=>Y(this,null,function*(){let r=this.history.shift();if(r){this.events.historyUpdated.next({state:this}),this.undoingHistory=!0;try{yield this.updateTree(r[0],{canUndo:!1}).runInContext(t)}finally{this.undoingHistory=!1}}}))}getSnapshot(){return{tree:Go.toJSON(this._tree)}}setSnapshot(t){let r=Go.fromJSON(t.tree);return this.updateTree(r)}setCurrent(t){this.behaviors.currentObject.next({state:this,ref:t})}updateCellState(t,r){let n=this.cells.get(t);if(!n)return;let o=typeof r=="function"?r(n.state):r;ur.assignState(n.state,o)&&(n.transform=this._tree.assignState(n.transform.ref,o),this.events.cell.stateUpdated.next({state:this,ref:t,cell:n}))}dispose(){this.ev.dispose(),this.actions.dispose()}select(t){return qt.select(t,this)}selectQ(t){return typeof t=="string"?qt.select(t,this):qt.select(t(qt.Generators),this)}applyAction(t,r,n=ur.RootRef){return Pe.create("Apply Action",o=>{let i=this.cells.get(n);if(!i)throw new Error(`'${n}' does not exist.`);if(i.status!=="ok")throw new Error(`Action cannot be applied to a cell with status '${i.status}'`);return qL(t.definition.run({ref:n,cell:i,a:i.obj,params:r,state:this},this.globalContext),o)})}transaction(t,r){return Pe.create("State Transaction",n=>Y(this,null,function*(){let o=this.inTransaction,i=this._tree.asImmutable(),s=!1;try{o||this.behaviors.isUpdating.next(!0),this.inTransaction=!0,this.inTransactionError=!1,yield t(n),this.inTransactionError&&(s=!0,yield this.updateTree(i).runInContext(n))}catch(a){if(s||(s=!0,yield this.updateTree(i).runInContext(n),this.events.log.next(Fd.error("Error during state transaction, reverting"))),o)throw this.inTransactionError=!0,a;if(r?.rethrowErrors)throw a;console.error(a)}finally{o||(this.inTransaction=!1,this.events.changed.next({state:this,inTransaction:!1}),this.behaviors.isUpdating.next(!1),s||(r?.canUndo?this.addHistory(i,typeof r.canUndo=="string"?r.canUndo:void 0):this.clearHistory()))}}))}get inUpdate(){return this._inUpdate}updateTree(t,r){let n={tree:t,options:r};return Pe.create("Update Tree",o=>Y(this,null,function*(){if(!(yield this.updateQueue.enqueue(n)))return;this._inUpdate=!0;let s=r?.canUndo?this._tree.asImmutable():void 0,a=!1;this.inTransaction||this.behaviors.isUpdating.next(!0);try{if(r0.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}this.reverted=!1;let l=r&&(r.revertIfAborted||r.revertOnError)?yield this._revertibleTreeUpdate(o,n,r):yield this._updateTree(o,n);return a=this.reverted,l.ctx.hadError&&(this.inTransactionError=!0),l.cell?new jx(l.cell.transform.ref,this):void 0}finally{this._inUpdate=!1,this.updateQueue.handled(n),this.inTransaction||(this.behaviors.isUpdating.next(!1),r?.canUndo?a||this.addHistory(s,typeof r.canUndo=="string"?r.canUndo:void 0):this.undoingHistory||this.clearHistory())}}),()=>{this.updateQueue.remove(n)})}_revertibleTreeUpdate(t,r,n){return Y(this,null,function*(){let o=this.tree,i=yield this._updateTree(t,r);return(i.ctx.hadError||i.ctx.wasAborted)&&n.revertOnError||i.ctx.wasAborted&&n.revertIfAborted?(this.reverted=!0,yield this._updateTree(t,{tree:o,options:r.options})):i})}_updateTree(t,r){return Y(this,null,function*(){let n=!1,o=this.updateTreeAndCreateCtx(r.tree,t,r.options);try{if(n=yield rPe(o),r0.isTo(r.tree)){let i=this.select(r.tree.ref)[0];return{ctx:o,cell:i}}return{ctx:o}}finally{this.spine.current=void 0,n&&this.events.changed.next({state:this,inTransaction:this.inTransaction})}})}updateTreeAndCreateCtx(t,r,n){let o=(r0.is(t)?t.getTree():t).asTransient(),i=this._tree;this._tree=o;let s=this.cells,a={parent:this,editInfo:r0.is(t)?t.editInfo:void 0,errorFree:this.errorFree,taskCtx:r,oldTree:i,tree:o,cells:this.cells,spine:this.spine,results:[],options:k(k({},tPe),n),changed:!1,hadError:!1,wasAborted:!1,newCurrent:void 0,getCellData:l=>{var c;return(c=s.get(l).obj)===null||c===void 0?void 0:c.data}};return this.errorFree=!0,a}constructor(t,r){this.errorFree=!0,this.ev=Hl.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:ur.RootRef}),isUpdating:this.ev.behavior(!1)},this.actions=new cP,this.cells=new Map,this.spine=new n0.Impl(this.cells),this.tryGetCellData=i=>{var s,a;let l=(a=(s=this.cells.get(i))===null||s===void 0?void 0:s.obj)===null||a===void 0?void 0:a.data;if(l===void 0)throw new Error(`Cell '${i}' data undefined.`);return l},this.historyCapacity=5,this.history=[],this.undoingHistory=!1,this.inTransaction=!1,this.inTransactionError=!1,this._inUpdate=!1,this.reverted=!1,this.updateQueue=new uP,this._tree=Go.createEmpty(ur.createRoot(r&&r.rootState)).asTransient();let o=this._tree.root;this.runTask=r.runTask,r?.historyCapacity!==void 0&&(this.historyCapacity=r.historyCapacity),this.cells.set(o.ref,{parent:this,transform:o,sourceRef:void 0,obj:t,status:"ok",state:k({},o.state),errorText:void 0,params:{definition:{},values:{}},paramsNormalizedVersion:o.version,dependencies:{dependentBy:[],dependsOn:[]},cache:{}}),this.globalContext=r&&r.globalContext}};(function(e){function t(n,o){return new e(n,o)}e.create=t;let r;(function(n){function o(i,s){return!!s&&i.ref===s.transform.ref&&i.state===s.parent}n.isCell=o})(r=e.ObjectEvent||(e.ObjectEvent={}))})(ru||(ru={}));var tPe={doNotLogTiming:!1,doNotUpdateCurrent:!0,revertIfAborted:!1,revertOnError:!1,canUndo:!1};function rPe(e){return Y(this,null,function*(){let t=!!(e.editInfo&&e.editInfo.count===1&&e.editInfo.lastUpdate&&e.editInfo.sourceTree===e.oldTree),r,n=[],o;if(t)r=[],o=[e.editInfo.lastUpdate];else{r=sPe(e);let a=e.parent.current,l=!1;for(let c of r)if(c===a){l=!0;break}if(l){let c=bQ(e.oldTree,a,r,e.cells);e.parent.setCurrent(c)}for(let c=r.length-1;c>=0;c--){let u=e.cells.get(r[c]);u&&dP(u.transform,u.obj,u?.transform.params,u.cache,e.parent.globalContext)}for(let c of r){let u=e.cells.get(c);u&&(u.parent=void 0,dPe(u));let d=u&&u.obj;e.cells.delete(c),n.push(d)}o=nPe(e.cells,e.tree)}let i=fPe(e,o);for(let a of i.added)e.parent.events.cell.created.next({state:e.parent,ref:a.transform.ref,cell:a});for(let a=0;a0||o.length>0||e.changed})}function nPe(e,t){let r={roots:[],cells:e};return Go.doPreOrder(t,t.root,r,oPe),r.roots}function oPe(e,t,r){let n=r.cells.get(e.ref);return!n||n.transform.version!==e.version?(r.roots.push(e.ref),!1):!(n.status==="error"||n&&n.obj===kn.Null)}function iPe(e,t,r){!r.newTree.transforms.has(e.ref)&&r.cells.has(e.ref)&&r.deletes.push(e.ref)}function sPe(e){let t={newTree:e.tree,cells:e.cells,deletes:[]};return Go.doPostOrder(e.oldTree,e.oldTree.root,t,iPe),t.deletes}function aPe(e,t,r){let n=r.cells.get(e.ref);!n||!ur.syncState(n.state,e.state)||r.parent.events.cell.stateUpdated.next({state:r.parent,ref:e.ref,cell:n})}function lPe(e){Go.doPreOrder(e.tree,e.tree.root,e,aPe)}function mP(e,t,r,n){let o=e.cells.get(t),i=o.status!==r;o.status=r,o.errorText=n,i&&e.parent.events.cell.stateUpdated.next({state:e.parent,ref:t,cell:o})}function cPe(e,t,r){r.cells.get(e.ref).transform=e,mP(r,e.ref,"pending")}function uPe(e,t){for(let r of t)Go.doPreOrder(e.tree,e.tree.transforms.get(r),e,cPe)}function dPe(e){for(let t of e.dependencies.dependsOn)_d(t.dependencies.dependentBy,e)}function mPe(e,t,{ctx:r,added:n,visited:o}){if(o.add(e.ref),r.cells.has(e.ref))return;let i={parent:r.parent,transform:e,sourceRef:void 0,status:"pending",state:k({},e.state),errorText:void 0,params:void 0,paramsNormalizedVersion:"",dependencies:{dependentBy:[],dependsOn:[]},cache:void 0};r.cells.set(e.ref,i),n.push(i)}function pPe(e,t){if(e.transform.dependsOn)for(let r of e.transform.dependsOn){if(!t.tree.transforms.get(r))throw new Error("Cannot depend on a non-existent transform.");let o=t.cells.get(r);So(e.dependencies.dependsOn,o),So(o.dependencies.dependentBy,e)}}function fPe(e,t){let r={ctx:e,visited:new Set,added:[]};for(let o of t)Go.doPreOrder(e.tree,e.tree.transforms.get(o),r,mPe);for(let o of r.added)pPe(o,e);let n;return r.visited.forEach(o=>{let i=e.cells.get(o);for(let s of i.dependencies.dependentBy)r.visited.has(s.transform.ref)||(n||(n=cn.create()),cn.add(n,s.transform.ref,s))}),{added:r.added,dependent:n?n.array:void 0}}function bQ(e,t,r,n){let o=new Set(r);return CQ(e,t,o,n)}function CQ(e,t,r,n){if(t===ur.RootRef)return t;let o=e.transforms.get(t),i=e.children.get(o.parent).values(),s,a=!1;for(;;){let l=i.next();if(l.done)break;if(r.has(l.value))continue;let c=n.get(l.value);if(!c||c.status==="error"||c.obj===kn.Null)continue;let u=e.transforms.get(l.value);if(!u.state.isGhost){if(l.value===t){a=!0,r.has(t)||(s=t);continue}if(a)return u.ref;s=u.ref}}return s||CQ(e,o.parent,r,n)}function jL(e,t,r,n){n||(e.hadError=!0,e.parent.errorFree=!1);let o=e.cells.get(t);if(r){e.wasAborted=e.wasAborted||Pe.isAbort(r);let s=""+r;mP(e,t,"error",s),n||e.parent.events.log.next({type:"error",timestamp:new Date,message:s})}else o.params=void 0;if(o.obj){let s=o.obj;o.obj=void 0,o.cache=void 0,e.parent.events.object.removed.next({state:e.parent,ref:t,obj:s})}let i=e.tree.children.get(t).values();for(;;){let s=i.next();if(s.done)return;jL(e,s.value,void 0,n)}}var hPe="Parent is null";function _Q(e,t){return Y(this,null,function*(){mP(e,t,"processing");let r=!1;try{let o=On(),i=yield yPe(e,t),s=On()-o;i.action!=="none"&&(e.changed=!0),mP(e,t,"ok"),e.results.push(i),i.action==="created"?(r=i.obj===kn.Null,!r&&!e.options.doNotLogTiming&&e.parent.events.log.next(Fd.info(`Created ${i.obj.label} in ${ix(s)}.`))):i.action==="updated"?(r=i.obj===kn.Null,!r&&!e.options.doNotLogTiming&&e.parent.events.log.next(Fd.info(`Updated ${i.obj.label} in ${ix(s)}.`))):i.action==="replaced"&&(r=i.obj===kn.Null,!r&&!e.options.doNotLogTiming&&e.parent.events.log.next(Fd.info(`Updated ${i.obj.label} in ${ix(s)}.`)))}catch(o){e.changed=!0,e.hadError||(e.newCurrent=t),jL(e,t,o,!1),console.error(o);return}let n=e.tree.children.get(t).values();for(;;){let o=n.next();if(o.done)return;r?jL(e,o.value,void 0,!0):yield _Q(e,o.value)}})}function gPe(e,t,r,n){let o=t.transformer.definition.params,i=o?o(r,e.parent.globalContext):{};if(n.paramsNormalizedVersion!==t.version)t.params=C.normalizeParams(i,t.params,"all"),n.paramsNormalizedVersion=t.version;else{let s=C.getDefaultValues(i);t.params=t.params?JG(t.params,s):s}return C.resolveRefs(i,t.params,e.getCellData),{definition:i,values:t.params}}function yPe(e,t){return Y(this,null,function*(){var r;let{oldTree:n,tree:o}=e,i=e.cells.get(t),s=i.transform;if(i.transform.ref===ur.RootRef)return{action:"none"};let a=e.cells.get(i.transform.parent);if(a?.obj===kn.Null)if(i.sourceRef=a.transform.ref,n.transforms.has(t)&&i.params){let m=i.params.values,p=i.cache;return dP(s,i.obj,m,p,e.parent.globalContext),i.params=void 0,i.obj=kn.Null,{ref:t,action:"updated",obj:i.obj}}else return i.params=void 0,{ref:t,action:"created",obj:kn.Null};let c=s.transformer.definition.from.length===0?a:qt.findAncestorOfType(o,e.cells,t,s.transformer.definition.from);if(!c)throw new Error(`No suitable parent found for '${t}'`);e.spine.current=i;let u=c.obj;i.sourceRef=c.transform.ref;let d=gPe(e,s,u,i);if(!n.transforms.has(t)||!i.params){i.params=d;let m=yield SQ(e,i,s.transformer,u,d.values);return HL(m,s),i.obj=m,{ref:t,action:"created",obj:m}}else{let m=i.params.values,p=i.cache,h=(r=i.obj)===null||r===void 0?void 0:r.data,f=d.values;switch(i.params=d,i.obj&&i.obj!==kn.Null?yield vPe(e,i,s.transformer,u,i.obj,m,f):$e.UpdateResult.Recreate){case $e.UpdateResult.Recreate:{let g=i.obj;dP(s,g,m,p,e.parent.globalContext);let v=yield SQ(e,i,s.transformer,u,f);return HL(v,s),i.obj=v,{ref:t,action:"replaced",oldObj:g,obj:v}}case $e.UpdateResult.Updated:return HL(i.obj,s),{ref:t,action:"updated",oldData:h,obj:i.obj};case $e.UpdateResult.Null:return dP(s,i.obj,m,p,e.parent.globalContext),i.obj=kn.Null,{ref:t,action:"updated",obj:i.obj};default:return{action:"none"}}}})}function dP(e,t,r,n,o){var i,s;(s=(i=e.transformer.definition).dispose)===null||s===void 0||s.call(i,{b:t!==kn.Null?t:void 0,params:r,cache:n},o)}function HL(e,t){!e||e===kn.Null||(e.tags=t.tags)}function qL(e,t){return typeof e.runInContext=="function"?e.runInContext(t):e}function wQ(e){if(e.dependencies.dependsOn.length===0)return;let t=Object.create(null);for(let r of e.dependencies.dependsOn){if(!r.obj)throw new Error("Unresolved dependency.");t[r.transform.ref]=r.obj}return t}function SQ(e,t,r,n,o){return t.cache||(t.cache=Object.create(null)),qL(r.definition.apply({a:n,params:o,cache:t.cache,spine:e.spine,dependencies:wQ(t)},e.parent.globalContext),e.taskCtx)}function vPe(e,t,r,n,o,i,s){return Y(this,null,function*(){return r.definition.update?(t.cache||(t.cache=Object.create(null)),qL(r.definition.update({a:n,oldParams:i,b:o,newParams:s,cache:t.cache,spine:e.spine,dependencies:wQ(t)},e.parent.globalContext),e.taskCtx)):$e.UpdateResult.Recreate})}var ae;(function(e){e.Create=kn.factory();function t(m){return!!m&&m.type.typeClass==="Representation3D"}e.isRepresentation3D=t;function r(m){return!!m&&m.type.typeClass==="Behavior"}e.isBehavior=r;function n(m){return e.Create(te(k({},m),{typeClass:"Representation3D"}))}e.CreateRepresentation3D=n;function o(m){return e.Create(te(k({},m),{typeClass:"Behavior"}))}e.CreateBehavior=o;class i extends e.Create({name:"Root",typeClass:"Root"}){}e.Root=i;class s extends e.Create({name:"Group",typeClass:"Group"}){}e.Group=s;let a;(function(m){class p extends e.Create({name:"String Data",typeClass:"Data"}){}m.String=p;class h extends e.Create({name:"Binary Data",typeClass:"Data"}){}m.Binary=h;class f extends e.Create({name:"Data Blob",typeClass:"Data"}){}m.Blob=f})(a=e.Data||(e.Data={}));let l;(function(m){class p extends e.Create({name:"JSON Data",typeClass:"Data"}){}m.Json=p;class h extends e.Create({name:"CIF File",typeClass:"Data"}){}m.Cif=h;class f extends e.Create({name:"Cube File",typeClass:"Data"}){}m.Cube=f;class y extends e.Create({name:"PSF File",typeClass:"Data"}){}m.Psf=y;class g extends e.Create({name:"PRMTOP File",typeClass:"Data"}){}m.Prmtop=g;class v extends e.Create({name:"TOP File",typeClass:"Data"}){}m.Top=v;class b extends e.Create({name:"PLY File",typeClass:"Data"}){}m.Ply=b;class S extends e.Create({name:"CCP4/MRC/MAP File",typeClass:"Data"}){}m.Ccp4=S;class _ extends e.Create({name:"DSN6/BRIX File",typeClass:"Data"}){}m.Dsn6=_;class w extends e.Create({name:"DX File",typeClass:"Data"}){}m.Dx=w;class E extends e.Create({name:"Format Blob",typeClass:"Data"}){}m.Blob=E})(l=e.Format||(e.Format={}));let c;(function(m){class p extends e.Create({name:"Coordinates",typeClass:"Object"}){}m.Coordinates=p;class h extends e.Create({name:"Topology",typeClass:"Object"}){}m.Topology=h;class f extends e.Create({name:"Model",typeClass:"Object"}){}m.Model=f;class y extends e.Create({name:"Trajectory",typeClass:"Object"}){}m.Trajectory=y;class g extends e.Create({name:"Structure",typeClass:"Object"}){}m.Structure=g,function(v){class b extends n({name:"Structure 3D"}){}v.Representation3D=b;class S extends e.Create({name:"Structure 3D State",typeClass:"Object"}){}v.Representation3DState=S;class _ extends e.Create({name:"Selections",typeClass:"Object"}){}v.Selections=_}(g=m.Structure||(m.Structure={}))})(c=e.Molecule||(e.Molecule={}));let u;(function(m){class p extends e.Create({name:"Volume",typeClass:"Object"}){}m.Data=p;class h extends e.Create({name:"Lazy Volume",typeClass:"Object"}){}m.Lazy=h;class f extends n({name:"Volume 3D"}){}m.Representation3D=f})(u=e.Volume||(e.Volume={}));let d;(function(m){class p extends e.Create({name:"Shape Provider",typeClass:"Object"}){}m.Provider=p;class h extends n({name:"Shape 3D"}){}m.Representation3D=h})(d=e.Shape||(e.Shape={}))})(ae||(ae={}));var Mt;(function(e){e.CreateBuiltIn=$e.factory("ms-plugin"),e.BuiltIn=$e.builderFactory("ms-plugin")})(Mt||(Mt={}));var ab=class extends ae.Create({name:"Volume Streaming",typeClass:"Object"}){},AQ;(function(e){let t;(function(r){r.Float32="float32",r.Int8="int8"})(t=e.ValueType||(e.ValueType={}))})(AQ||(AQ={}));function o0(e,t){return`${e}${e[e.length-1]==="/"||t[0]==="/"?"":"/"}${t}`}function PQ(e,t,r){if(r)return TQ(e,t,r.min,r.max);{let[n,o]=Fl(e);return TQ(e,t,n,o)}}function TQ(e,t,r,n){let o=(n-r)/t;o===0&&(o=1);let i=new Int32Array(t);for(let s=0,a=e.length;s=t?l=t-1:l<0&&(l=0),i[l]++}return{min:r,max:n,binWidth:o,counts:i}}var wo;(function(e){e.One={transform:{kind:"matrix",matrix:ne.identity()},cells:lr.create(lr.Space([1,1,1],[0,1,2]),lr.Data1([0])),stats:{min:0,max:0,mean:0,sigma:0}};let t=ne.zero(),r=ne.zero();function n(l){if(l.transform.kind==="matrix")return ne.copy(ne(),l.transform.matrix);if(l.transform.kind==="spacegroup"){let{cells:{space:c}}=l,u=ne.fromScaling(t,x.div(x.zero(),ft.size(x.zero(),l.transform.fractionalBox),x.ofArray(c.dimensions))),d=ne.fromTranslation(r,l.transform.fractionalBox.min);return ne.mul3(ne.zero(),l.transform.cell.fromFractional,d,u)}return ne.identity()}e.getGridToCartesianTransform=n;function o(l,c){return l===c}e.areEquivalent=o;function i(l){return l.cells.data.length===0}e.isEmpty=i;function s(l,c){c||(c=ge());let u=l.cells.space.dimensions,d=e.getGridToCartesianTransform(l);return ge.fromDimensionsAndTransform(c,u,d)}e.getBoundingSphere=s;function a(l,c){let u=l._historams;return u||(u=l._historams={}),u[c]||(u[c]=PQ(l.cells.data,c,{min:l.stats.min,max:l.stats.max})),u[c]}e.getHistogram=a})(wo||(wo={}));function IQ(e,t){return Pe.create("Create Volume",()=>Y(this,null,function*(){let{header:r,values:n}=e,o=lr.Space(r.dim,[0,1,2],Float64Array),i;if(r.dataSetIds.length===0)i=n;else{let[c,u,d]=r.dim,m=(t?.dataIndex||0)+1,p=0,h=0;i=new Float64Array(c*u*d);for(let f=0;fY(this,null,function*(){let{volume_data_3d_info:n,volume_data_3d:o}=e,i=ui.create(n.spacegroup_number.value(0),x.ofArray(n.spacegroup_cell_size.value(0)),x.scale(x.zero(),x.ofArray(n.spacegroup_cell_angles.value(0)),Math.PI/180)),s=n.axis_order.value(0),a=lr.convertToCanonicalAxisIndicesFastToSlow(s),l=a(n.sample_count.value(0)),c=lr.Space(l,lr.invertAxisOrder(s),Float32Array),u=lr.create(c,lr.Data1(o.values.toArray({array:Float32Array}))),d=x.ofArray(a(n.origin.value(0))),m=x.ofArray(a(n.dimensions.value(0)));return{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"spacegroup",cell:i,fractionalBox:ft.create(d,x.add(x.zero(),d,m))},cells:u,stats:{min:n.min_sampled.value(0),max:n.max_sampled.value(0),mean:n.mean_sampled.value(0),sigma:n.sigma_sampled.value(0)}},sourceData:r_.create(e),customProperties:new ss,_propertyData:Object.create(null)}}))}var r_;(function(e){function t(n){return n?.kind==="dscif"}e.is=t;function r(n){return{kind:"dscif",name:n._name,data:n}}e.create=r})(r_||(r_={}));var Je;(function(e){function t(g){var v,b,S,_;return((_=(S=(b=(v=g?.grid)===null||v===void 0?void 0:v.cells)===null||b===void 0?void 0:b.space)===null||S===void 0?void 0:S.dimensions)===null||_===void 0?void 0:_.length)&&g?.sourceData&&g?.customProperties&&g?._propertyData}e.is=t;let r;(function(g){function v(T,B,D){return jn(E(T,D).absoluteValue,E(B,D).absoluteValue,D.sigma/100)}g.areSame=v;function b(T){return{kind:"absolute",absoluteValue:T}}g.absolute=b;function S(T){return{kind:"relative",relativeValue:T}}g.relative=S;function _(T,B){return B*T.sigma+T.mean}g.calcAbsolute=_;function w(T,B){return T.sigma===0?0:(B-T.mean)/T.sigma}g.calcRelative=w;function E(T,B){return T.kind==="absolute"?T:{kind:"absolute",absoluteValue:g.calcAbsolute(B,T.relativeValue)}}g.toAbsolute=E;function A(T,B){return T.kind==="relative"?T:{kind:"relative",relativeValue:g.calcRelative(B,T.absoluteValue)}}g.toRelative=A;function P(T){return T.kind==="relative"?`${T.relativeValue.toFixed(2)} \u03C3`:`${T.absoluteValue.toPrecision(4)}`}g.toString=P})(r=e.IsoValue||(e.IsoValue={}));function n(g,v,b){if(b==="relative")return r.relative(v);let S=r.absolute(v);if(r_.is(g.sourceData)){let _={min:g.sourceData.data.volume_data_3d_info.min_source.value(0),max:g.sourceData.data.volume_data_3d_info.max_source.value(0),mean:g.sourceData.data.volume_data_3d_info.mean_source.value(0),sigma:g.sourceData.data.volume_data_3d_info.sigma_source.value(0)};return e.IsoValue.toRelative(S,_)}return S}e.adjustedIsoValue=n;let o={min:-1,max:1,mean:0,sigma:.1};function i(g,v){let b=v||o,{min:S,max:_,mean:w,sigma:E}=b,A=(S-w)/E,P=(_-w)/E,T=g;return g.kind==="absolute"?g.absoluteValue_&&(T=e.IsoValue.absolute(_)):g.relativeValueP&&(T=e.IsoValue.relative(P)),C.Conditioned(T,{absolute:C.Converted(B=>e.IsoValue.toAbsolute(B,wo.One.stats).absoluteValue,B=>e.IsoValue.absolute(B),C.Numeric(w,{min:S,max:_,step:pC(E/100,2)},{immediateUpdate:!0})),relative:C.Converted(B=>e.IsoValue.toRelative(B,wo.One.stats).relativeValue,B=>e.IsoValue.relative(B),C.Numeric(Math.min(1,P),{min:A,max:P,step:pC(Math.round((_-S)/E)/100,2)},{immediateUpdate:!0}))},B=>B.kind==="absolute"?"absolute":"relative",(B,D)=>D==="absolute"?e.IsoValue.toAbsolute(B,b):e.IsoValue.toRelative(B,b),{isEssential:!0})}e.createIsoValueParam=i,e.IsoValueParam=i(e.IsoValue.relative(2)),e.One={label:"",grid:wo.One,sourceData:{kind:"",name:"",data:{}},customProperties:new ss,_propertyData:Object.create(null)};function s(g,v){return wo.areEquivalent(g.grid,v.grid)}e.areEquivalent=s;function a(g){return wo.isEmpty(g.grid)}e.isEmpty=a;function l(g){return t_.is(g.sourceData)?g.sourceData.data.header.orbitals:!1}e.isOrbitals=l;function c(g){return{kind:"volume-loci",volume:g}}e.Loci=c;function u(g){return!!g&&g.kind==="volume-loci"}e.isLoci=u;function d(g,v){return g.volume===v.volume}e.areLociEqual=d;function m(g){return wo.isEmpty(g.volume.grid)}e.isLociEmpty=m;function p(g,v){return wo.getBoundingSphere(g.grid,v)}e.getBoundingSphere=p;let h;(function(g){function v(A,P){return{kind:"isosurface-loci",volume:A,isoValue:P}}g.Loci=v;function b(A){return!!A&&A.kind==="isosurface-loci"}g.isLoci=b;function S(A,P){return A.volume===P.volume&&e.IsoValue.areSame(A.isoValue,P.isoValue,A.volume.grid.stats)}g.areLociEqual=S;function _(A){return A.volume.grid.cells.data.length===0}g.isLociEmpty=_;let w=ft();function E(A,P,T){let B=e.IsoValue.toAbsolute(P,A.grid.stats).absoluteValue,D=B<0,M=[0,0,0],R=A.grid.cells.space.getCoords,U=A.grid.cells.data,[F,N,z]=A.grid.cells.space.dimensions,q=F-1,O=N-1,J=z-1,Q=0,H=0,W=0;for(let ce=0,V=U.length;ce=B)&&(R(ce,M),M[0]Q&&(Q=M[0]),M[1]>H&&(H=M[1]),M[2]>W&&(W=M[2]));x.set(w.min,q-1,O-1,J-1),x.set(w.max,Q+1,H+1,W+1);let K=wo.getGridToCartesianTransform(A.grid);return ft.transform(w,w,K),ge.fromBox3D(T||ge(),w)}g.getBoundingSphere=E})(h=e.Isosurface||(e.Isosurface={}));let f;(function(g){function v(P,T){return{kind:"cell-loci",volume:P,indices:T}}g.Loci=v;function b(P){return!!P&&P.kind==="cell-loci"}g.isLoci=b;function S(P,T){return P.volume===T.volume&&Te.areEqual(P.indices,T.indices)}g.areLociEqual=S;function _(P){return Te.size(P.indices)===0}g.isLociEmpty=_;let w=new ki("98"),E=x();function A(P,T,B){w.reset();let D=wo.getGridToCartesianTransform(P.grid),{getCoords:M}=P.grid.cells.space;for(let U=0,F=Te.size(T);U"u"||typeof window>"u")return!1;if(["Version/15.1 Safari","Version/15.2 Safari","Version/15.3 Safari"].some(o=>navigator.userAgent.indexOf(o)>0))return!0;let t=/iPad|iPhone|iPod/.test(navigator.userAgent),r=navigator.userAgent.includes("Macintosh"),n=navigator.maxTouchPoints>=4;return!window.MSStream&&(t||r&&n)}};var WL=class{toString(){return this.key}valueOf(){return this.key}constructor(t,r){this.key=t,this.defaultValue=r}};function Ho(e,t){return new WL(e,t)}var Tr={item:Ho,General:{IsBusyTimeoutMs:Ho("plugin-config.is-busy-timeout",750),DisableAntialiasing:Ho("plugin-config.disable-antialiasing",!1),DisablePreserveDrawingBuffer:Ho("plugin-config.disable-preserve-drawing-buffer",!1),PixelScale:Ho("plugin-config.pixel-scale",1),PickScale:Ho("plugin-config.pick-scale",.25),Transparency:Ho("plugin-config.transparency","wboit"),PreferWebGl1:Ho("plugin-config.prefer-webgl1",EQ.preferWebGl1),AllowMajorPerformanceCaveat:Ho("plugin-config.allow-major-performance-caveat",!1),PowerPreference:Ho("plugin-config.power-preference","high-performance")},State:{DefaultServer:Ho("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),CurrentServer:Ho("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),HistoryCapacity:Ho("history-capacity.server",5)},VolumeStreaming:{Enabled:Ho("volume-streaming.enabled",!0),DefaultServer:Ho("volume-streaming.server","https://ds.litemol.org"),CanStream:Ho("volume-streaming.can-stream",(e,t)=>e.models.length===1&&Ut.probablyHasDensityMap(e.models[0])),EmdbHeaderServer:Ho("volume-streaming.emdb-header-server","https://files.wwpdb.org/pub/emdb/structures")},Viewport:{ShowExpand:Ho("viewer.show-expand-button",!0),ShowControls:Ho("viewer.show-controls-button",!0),ShowSettings:Ho("viewer.show-settings-button",!0),ShowSelectionMode:Ho("viewer.show-selection-model-button",!0),ShowAnimation:Ho("viewer.show-animation-button",!0),ShowTrajectoryControls:Ho("viewer.show-trajectory-controls",!0)},Download:{DefaultPdbProvider:Ho("download.default-pdb-provider","pdbe"),DefaultEmdbProvider:Ho("download.default-emdb-provider","pdbe")},Structure:{SizeThresholds:Ho("structure.size-thresholds",Me.DefaultSizeThresholds),DefaultRepresentationPreset:Ho("structure.default-representation-preset","auto"),DefaultRepresentationPresetParams:Ho("structure.default-representation-preset-params",{}),SaccharideCompIdMapType:Ho("structure.saccharide-comp-id-map-type","default")},Background:{Styles:Ho("background.styles",[])}},fP=class{get(t){return this._config.has(t)?this._config.get(t):t.defaultValue}set(t,r){this._config.set(t,r)}delete(t){this._config.delete(t)}constructor(t){this._config=new Map,t&&t.forEach(([r,n])=>this._config.set(r,n))}};function DQ(e,t="x-ray"){if(!e)return t;let r=e.models[0];return rn.is(r.sourceData)?Ut.hasEmMap(r)?"em":Ut.hasXrayMap(r)?"x-ray":Ut.isFromEm(r)?"em":Ut.isFromXray(r)?"x-ray":t:t}function xPe(e){let t=[];if(!rn.is(e.sourceData))return[e.entryId];let{db_id:r,db_name:n,content_type:o}=e.sourceData.data.db.pdbx_database_related;if(!n.isDefined)return[e.entryId];for(let i=0,s=n.rowCount;ic.primary))===null||i===void 0?void 0:i.level)!==null&&s!==void 0?s:l[0].level})}function CPe(e,t,r){return Y(this,null,function*(){var n,o,i;r=r.toUpperCase();let s=yield e.fetch({url:`https://www.ebi.ac.uk/pdbe/api/emdb/entry/map/${r}`,type:"json"}).runInContext(t),a=s?.[r],l;return((i=(o=(n=a?.[0])===null||n===void 0?void 0:n.map)===null||o===void 0?void 0:o.contour_level)===null||i===void 0?void 0:i.value)!==void 0&&(l=+a[0].map.contour_level.value),l})}function MQ(e,t,r){return Y(this,null,function*(){var n;let o=yield e.fetch({url:`https://www.ebi.ac.uk/pdbe/api/pdb/entry/summary/${r}`,type:"json"}).runInContext(t),i=o?.[r],s=[];if(!((n=i?.[0])===null||n===void 0)&&n.related_structures){let a=i[0].related_structures.filter(l=>l.resource==="EMDB"&&l.relationship==="associated EM volume");if(!a.length)throw new Error(`No related EMDB entry found for '${r}'.`);s.push(...a.map(l=>l.accession))}else throw new Error(`No related EMDB entry found for '${r}'.`);return s})}var Ur;(function(e){class t extends ae.Create({name:"Root",typeClass:"Root"}){}e.Root=t;class r extends ae.Create({name:"Category",typeClass:"Object"}){}e.Category=r;class n extends ae.CreateBehavior({name:"Behavior"}){}e.Behavior=n,e.Categories={common:"Common",representation:"Representation",interaction:"Interaction","custom-props":"Custom Properties",misc:"Miscellaneous"},e.CreateCategory=Mt.BuiltIn({name:"create-behavior-category",display:{name:"Behavior Category"},from:t,to:r,params:{label:C.Text("",{isHidden:!0})}})({apply({params:u}){return new r({},{label:u.label})}});let o=new Map;function i(u){return o.get(u.id)}e.getCategoryId=i;function s(u){let d=Mt.CreateBuiltIn({name:u.name,display:u.display,from:[t],to:[n],params:u.params,apply({params:m},p){let h=u.label?u.label(m):{label:u.display.name,description:u.display.description};return new n(new u.ctor(p,m),h)},update({b:m,newParams:p}){return Pe.create("Update Behavior",()=>Y(this,null,function*(){return m.data.update?(yield m.data.update(p))?$e.UpdateResult.Updated:$e.UpdateResult.Unchanged:$e.UpdateResult.Unchanged}))},canAutoUpdate:u.canAutoUpdate});return o.set(d.id,u.category),d}e.create=s;function a(u,d){return class{register(){this.sub=u.subscribe(this.ctx,m=>d(m,this.ctx))}dispose(){this.sub&&this.sub.unsubscribe(),this.sub=void 0}constructor(m){this.ctx=m,this.sub=void 0}}}e.simpleCommandHandler=a;class l{subscribeCommand(d,m){this.subs.push(d.subscribe(this.ctx,m))}subscribeObservable(d,m){this.subs.push(d.subscribe(m))}track(d){this.subs.push(d)}dispose(){for(let d of this.subs)d.unsubscribe();this.subs=[]}update(d){return zp(d,this.params)?!1:(this.params=d,!0)}constructor(d,m){this.ctx=d,this.params=m,this.subs=[]}}e.Handler=l;class c{subscribeCommand(d,m){this.subs.push(d.subscribe(this.plugin,m))}subscribeObservable(d,m){let p=d.subscribe(m);return this.subs.push(p),{unsubscribe:()=>{let h=this.subs.indexOf(p);h>=0&&(this.subs.splice(h,1),p.unsubscribe())}}}dispose(){for(let d of this.subs)d.unsubscribe();this.subs=[]}constructor(d,m){this.plugin=d,this.params=m,this.subs=[]}}e.WithSubscribers=c})(Ur||(Ur={}));var lb;(function(e){function t(s,a){return{key:s,data:a}}function r(s){return{entries:uC(),capacity:Math.max(1,s)}}e.create=r;function n(s,a){for(let l=s.entries.first;l;l=l.next)if(l.value.key===a)return s.entries.remove(l),s.entries.addLast(l.value),l.value.data}e.get=n;function o(s,a,l){let c;if(s.entries.count>=s.capacity){let u=s.entries.first;c=u.value.data,s.entries.remove(u)}return s.entries.addLast(t(a,l)),c}e.set=o;function i(s,a){for(let l=s.entries.first;l;l=l.next)if(l.value.key===a){s.entries.remove(l);break}}e.remove=i})(lb||(lb={}));function Ao(){let e=(t,r)=>t.commands.dispatch(e,r||{});return e.subscribe=(t,r)=>t.commands.subscribe(e,r),e.id=qr.create22(),e}var hP=class{constructor(){this.subs=new Map,this.disposing=!1}subscribe(t,r){let n=this.subs.get(t.id);return n||(n=[],this.subs.set(t.id,n)),n.push(r),{unsubscribe:()=>{let o=this.subs.get(t.id);if(!o)return;let i=o.indexOf(r);if(!(i<0)){for(let s=i+1;s{if(this.disposing){o("disposed");return}if(!this.subs.get(t.id)){n();return}this.resolve({cmd:t,params:r,resolve:n,reject:o})})}dispose(){this.subs.clear()}resolve(t){return Y(this,null,function*(){let r=this.subs.get(t.cmd.id);if(!r){t.resolve();return}try{for(let n of r)yield n(t.params);t.resolve()}catch(n){t.reject(n)}})}};var ct={State:{SetCurrentObject:Ao(),ApplyAction:Ao(),Update:Ao(),RemoveObject:Ao(),ToggleExpanded:Ao(),ToggleVisibility:Ao(),Snapshots:{Add:Ao(),Replace:Ao(),Move:Ao(),Remove:Ao(),Apply:Ao(),Clear:Ao(),Upload:Ao(),Fetch:Ao(),DownloadToFile:Ao(),OpenFile:Ao(),OpenUrl:Ao()}},Interactivity:{Object:{Highlight:Ao()},Structure:{Highlight:Ao(),Select:Ao()},ClearHighlights:Ao()},Layout:{Update:Ao()},Toast:{Show:Ao(),Hide:Ao()},Camera:{Reset:Ao(),SetSnapshot:Ao(),Focus:Ao(),OrientAxes:Ao(),ResetAxes:Ao()},Canvas3D:{SetSettings:Ao(),ResetSettings:Ao()}};function _Pe(e,t){for(let r=0,n=t*3;r0?Math.ceil(e/n):0;return{width:n,height:o,length:n*o*t}}function Jn(e,t,r,n){let{length:o,width:i,height:s}=wPe(e,t);return n=n&&n.length>=o?n:new r(o),{array:n,width:i,height:s}}var zd=x(),APe=new ki("14"),TPe=new ki("98");function NQ(e){return e>1e5?APe:TPe}function ou(e,t,r){let n=r*3,o=NQ(t);o.reset();for(let s=0,a=t*3;s>2),n=t-4>>2,o=4*n,i=0;if(n<0)for(let s=0;s>16]}for(let s=o;s!1,s){if(e%r!==0)throw new Error("incompatible groupCount and stride");let a={location:Qi,location2:Qi,index:0,groupIndex:0,instanceIndex:0,isSecondary:!1},l=a.groupIndexe.bindFramebuffer(e.FRAMEBUFFER,t),reset:()=>{t=zQ(e)},destroy:()=>{r||(e.deleteFramebuffer(t),r=!0)}}}function HQ(){return{id:VQ(),bind:()=>{},reset:()=>{},destroy:()=>{}}}function JL(e){let t=jQ(e);if(t===null)throw new Error('Could not find support for "instanced_arrays"');let r=WQ(e);if(r===null)throw new Error('Could not find support for "element_index_uint"');let n=qQ(e);if(n===null)throw new Error('Could not find support for "standard_derivatives"');let o=XQ(e);$t&&o===null&&console.log('Could not find support for "texture_float"');let i=KQ(e);$t&&i===null&&console.log('Could not find support for "texture_float_linear"');let s=QQ(e);$t&&s===null&&console.log('Could not find support for "texture_half_float"');let a=ZQ(e);$t&&a===null&&console.log('Could not find support for "texture_half_float_linear"');let l=iZ(e);$t&&l===null&&console.log('Could not find support for "depth_texture"');let c=$Q(e);$t&&c===null&&console.log('Could not find support for "blend_minmax"');let u=YQ(e);$t&&u===null&&console.log('Could not find support for "vertex_array_object"');let d=JQ(e);$t&&d===null&&console.log('Could not find support for "frag_depth"');let m=eZ(e);$t&&m===null&&console.log('Could not find support for "color_buffer_float"');let p=tZ(e);$t&&p===null&&console.log('Could not find support for "color_buffer_half_float"');let h=rZ(e);$t&&h===null&&console.log('Could not find support for "draw_buffers"');let f=nZ(e);$t&&f===null&&console.log('Could not find support for "draw_buffers_indexed"');let y=oZ(e);$t&&y===null&&console.log('Could not find support for "shader_texture_lod"');let g=sZ(e);$t&&g===null&&console.log('Could not find support for "sRGB"');let v=aZ(e);$t&&v===null&&console.log('Could not find support for "disjoint_timer_query"');let b=lZ(e);$t&&b===null&&console.log('Could not find support for "multi_draw"');let S=cZ(e);$t&&S===null&&console.log('Could not find support for "draw_instanced_base_vertex_base_instance"');let _=uZ(e);$t&&_===null&&console.log('Could not find support for "multi_draw_instanced_base_vertex_base_instance"');let w=dZ(e);$t&&w===null&&console.log('Could not find support for "parallel_shader_compile"');let E=mZ(e);$t&&E===null&&console.log('Could not find support for "fbo_render_mipmap"');let A=pZ(e);$t&&A===null&&console.log('Could not find support for "provoking_vertex"');let P=fZ(e);$t&&P===null&&console.log('Could not find support for "clip_cull_distance"');let T=hZ(e);$t&&T===null&&console.log('Could not find support for "conservative_depth"');let B=gZ(e);$t&&B===null&&console.log('Could not find support for "stencil_texturing"');let D=yZ(e);$t&&D===null&&console.log('Could not find support for "clip_control"');let M=vZ(e);return{instancedArrays:t,standardDerivatives:n,elementIndexUint:r,textureFloat:o,textureFloatLinear:i,textureHalfFloat:s,textureHalfFloatLinear:a,depthTexture:l,blendMinMax:c,vertexArrayObject:u,fragDepth:d,colorBufferFloat:m,colorBufferHalfFloat:p,drawBuffers:h,drawBuffersIndexed:f,shaderTextureLod:y,sRGB:g,disjointTimerQuery:v,multiDraw:b,drawInstancedBaseVertexBaseInstance:S,multiDrawInstancedBaseVertexBaseInstance:_,parallelShaderCompile:w,fboRenderMipmap:E,provokingVertex:A,clipCullDistance:P,conservativeDepth:T,stencilTexturing:B,clipControl:D,noNonInstancedActiveAttribs:M}}function xZ(e,t){let r={},n=e.getParameter(e.FRONT_FACE),o=e.getParameter(e.CULL_FACE_MODE),i=e.getParameter(e.DEPTH_WRITEMASK),s=e.getParameter(e.DEPTH_CLEAR_VALUE),a=e.getParameter(e.DEPTH_FUNC),l=e.getParameter(e.COLOR_WRITEMASK),c=e.getParameter(e.COLOR_CLEAR_VALUE),u=e.getParameter(e.BLEND_SRC_RGB),d=e.getParameter(e.BLEND_DST_RGB),m=e.getParameter(e.BLEND_SRC_ALPHA),p=e.getParameter(e.BLEND_DST_ALPHA),h=e.getParameter(e.BLEND_COLOR),f=e.getParameter(e.BLEND_EQUATION_RGB),y=e.getParameter(e.BLEND_EQUATION_ALPHA),g=e.getParameter(e.STENCIL_FUNC),v=e.getParameter(e.STENCIL_VALUE_MASK),b=e.getParameter(e.STENCIL_REF),S=e.getParameter(e.STENCIL_BACK_FUNC),_=e.getParameter(e.STENCIL_BACK_VALUE_MASK),w=e.getParameter(e.STENCIL_BACK_REF),E=e.getParameter(e.STENCIL_WRITEMASK),A=e.getParameter(e.STENCIL_BACK_WRITEMASK),P=e.getParameter(e.STENCIL_FAIL),T=e.getParameter(e.STENCIL_PASS_DEPTH_PASS),B=e.getParameter(e.STENCIL_PASS_DEPTH_FAIL),D=e.getParameter(e.STENCIL_BACK_FAIL),M=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_PASS),R=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_FAIL),U=e.getParameter(e.MAX_VERTEX_ATTRIBS),F=[],N=e.getParameter(e.VIEWPORT),z=e.getParameter(e.SCISSOR_BOX),q=t.clipControl?e.getParameter(t.clipControl.CLIP_ORIGIN):-1,O=t.clipControl?e.getParameter(t.clipControl.CLIP_DEPTH_MODE):-1,J=()=>{for(let Q=0;Q{r[Q]!==!0&&(e.enable(Q),r[Q]=!0)},disable:Q=>{r[Q]!==!1&&(e.disable(Q),r[Q]=!1)},frontFace:Q=>{Q!==n&&(e.frontFace(Q),n=Q)},cullFace:Q=>{Q!==o&&(e.cullFace(Q),o=Q)},depthMask:Q=>{Q!==i&&(e.depthMask(Q),i=Q)},clearDepth:Q=>{Q!==s&&(e.clearDepth(Q),s=Q)},depthFunc:Q=>{Q!==a&&(e.depthFunc(Q),a=Q)},colorMask:(Q,H,W,K)=>{(Q!==l[0]||H!==l[1]||W!==l[2]||K!==l[3])&&(e.colorMask(Q,H,W,K),l[0]=Q,l[1]=H,l[2]=W,l[3]=K)},clearColor:(Q,H,W,K)=>{(Q!==c[0]||H!==c[1]||W!==c[2]||K!==c[3])&&(e.clearColor(Q,H,W,K),c[0]=Q,c[1]=H,c[2]=W,c[3]=K)},blendFunc:(Q,H)=>{(Q!==u||H!==d||Q!==m||H!==p)&&(e.blendFunc(Q,H),u=Q,d=H,m=Q,p=H)},blendFuncSeparate:(Q,H,W,K)=>{(Q!==u||H!==d||W!==m||K!==p)&&(e.blendFuncSeparate(Q,H,W,K),u=Q,d=H,m=W,p=K)},blendEquation:Q=>{(Q!==f||Q!==y)&&(e.blendEquation(Q),f=Q,y=Q)},blendEquationSeparate:(Q,H)=>{(Q!==f||H!==y)&&(e.blendEquationSeparate(Q,H),f=Q,y=H)},blendColor:(Q,H,W,K)=>{(Q!==h[0]||H!==h[1]||W!==h[2]||K!==h[3])&&(e.blendColor(Q,H,W,K),h[0]=Q,h[1]=H,h[2]=W,h[3]=K)},stencilFunc:(Q,H,W)=>{(Q!==g||H!==b||W!==v||Q!==S||H!==w||W!==_)&&(e.stencilFunc(Q,H,W),g=Q,b=H,v=W,S=Q,w=H,_=W)},stencilFuncSeparate:(Q,H,W,K)=>{Q===e.FRONT?(H!==g||W!==b||K!==v)&&(e.stencilFuncSeparate(Q,H,W,K),g=H,b=W,v=K):Q===e.BACK?(H!==S||W!==w||K!==_)&&(e.stencilFuncSeparate(Q,H,W,K),S=H,w=W,_=K):Q===e.FRONT_AND_BACK&&(H!==g||W!==b||K!==v||H!==S||W!==w||K!==_)&&(e.stencilFuncSeparate(Q,H,W,K),g=H,b=W,v=K,S=H,w=W,_=K)},stencilMask:Q=>{(Q!==E||Q!==A)&&(e.stencilMask(Q),E=Q,A=Q)},stencilMaskSeparate:(Q,H)=>{Q===e.FRONT?H!==E&&(e.stencilMaskSeparate(Q,H),E=H):Q===e.BACK?H!==A&&(e.stencilMaskSeparate(Q,H),A=H):Q===e.FRONT_AND_BACK&&(H!==E||H!==A)&&(e.stencilMaskSeparate(Q,H),E=H,A=H)},stencilOp:(Q,H,W)=>{(Q!==P||H!==B||W!==T||Q!==D||H!==R||W!==M)&&(e.stencilOp(Q,H,W),P=Q,B=H,T=W,D=Q,R=H,M=W)},stencilOpSeparate:(Q,H,W,K)=>{Q===e.FRONT?(H!==P||W!==B||K!==T)&&(e.stencilOpSeparate(Q,H,W,K),P=H,B=W,T=K):Q===e.BACK?(H!==D||W!==R||K!==M)&&(e.stencilOpSeparate(Q,H,W,K),D=H,R=W,M=K):Q===e.FRONT_AND_BACK&&(H!==P||W!==B||K!==T||H!==D||W!==R||K!==M)&&(e.stencilOpSeparate(Q,H,W,K),P=H,B=W,T=K,D=H,R=W,M=K)},enableVertexAttrib:Q=>{e.enableVertexAttribArray(Q),F[Q]=1},clearVertexAttribsState:J,disableUnusedVertexAttribs:()=>{for(let Q=0;Q{(Q!==N[0]||H!==N[1]||W!==N[2]||K!==N[3])&&(e.viewport(Q,H,W,K),N[0]=Q,N[1]=H,N[2]=W,N[3]=K)},scissor:(Q,H,W,K)=>{(Q!==z[0]||H!==z[1]||W!==z[2]||K!==z[3])&&(e.scissor(Q,H,W,K),z[0]=Q,z[1]=H,z[2]=W,z[3]=K)},clipControl:t.clipControl?(Q,H)=>{(Q!==q||H!==O)&&(t.clipControl.clipControl(Q,H),q=Q,O=H)}:void 0,reset:()=>{r={},n=e.getParameter(e.FRONT_FACE),o=e.getParameter(e.CULL_FACE_MODE),i=e.getParameter(e.DEPTH_WRITEMASK),s=e.getParameter(e.DEPTH_CLEAR_VALUE),a=e.getParameter(e.DEPTH_FUNC),l=e.getParameter(e.COLOR_WRITEMASK),c=e.getParameter(e.COLOR_CLEAR_VALUE),u=e.getParameter(e.BLEND_SRC_RGB),d=e.getParameter(e.BLEND_DST_RGB),m=e.getParameter(e.BLEND_SRC_ALPHA),p=e.getParameter(e.BLEND_DST_ALPHA),h=e.getParameter(e.BLEND_COLOR),f=e.getParameter(e.BLEND_EQUATION_RGB),y=e.getParameter(e.BLEND_EQUATION_ALPHA),g=e.getParameter(e.STENCIL_FUNC),v=e.getParameter(e.STENCIL_VALUE_MASK),b=e.getParameter(e.STENCIL_REF),S=e.getParameter(e.STENCIL_BACK_FUNC),_=e.getParameter(e.STENCIL_BACK_VALUE_MASK),w=e.getParameter(e.STENCIL_BACK_REF),E=e.getParameter(e.STENCIL_WRITEMASK),A=e.getParameter(e.STENCIL_BACK_WRITEMASK),P=e.getParameter(e.STENCIL_FAIL),T=e.getParameter(e.STENCIL_PASS_DEPTH_PASS),B=e.getParameter(e.STENCIL_PASS_DEPTH_FAIL),D=e.getParameter(e.STENCIL_BACK_FAIL),M=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_PASS),R=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_FAIL),U=e.getParameter(e.MAX_VERTEX_ATTRIBS),F.length=0;for(let Q=0;Q 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) { + material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness; + material.rgb -= 0.5 * uBumpAmplitude * bumpiness; + } + #endif + + #if defined(dRenderVariant_color) + material.rgb += material.rgb * emissive; + #endif + + gl_FragColor = material; +#else + #ifdef bumpEnabled + if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) { + normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency); + } + #endif + + vec4 color = material; + + ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0)); + + PhysicalMaterial physicalMaterial; + physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness); + #ifdef enabledFragDepth + physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0); + #else + vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal))); + float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z); + physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0); + #endif + physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness); + physicalMaterial.specularF90 = 1.0; + + GeometricContext geometry; + geometry.position = -vViewPosition; + geometry.normal = normal; + geometry.viewDir = normalize(vViewPosition); + + IncidentLight directLight; + #pragma unroll_loop_start + for (int i = 0; i < dLightCount; ++i) { + directLight.direction = uLightDirection[i]; + directLight.color = uLightColor[i] * PI; // * PI for punctual light + RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight); + } + #pragma unroll_loop_end + + vec3 irradiance = uAmbientColor * PI; // * PI for punctual light + RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight); + + // indirect specular only metals + vec3 radiance = uAmbientColor * metalness; + vec3 iblIrradiance = uAmbientColor * metalness; + vec3 clearcoatRadiance = vec3(0.0); + RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight); + + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular; + outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background + + #if defined(dRenderVariant_color) + outgoingLight += color.rgb * emissive; + #endif + + gl_FragColor = vec4(outgoingLight, color.a); +#endif + +#if defined(dXrayShaded_on) + gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff); +#elif defined(dXrayShaded_inverted) + gl_FragColor.a *= pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff); +#endif + +gl_FragColor.rgb *= uExposure; +`;var _Z=` + +#if defined(dColorMarker) + if (marker > 0.0) { + if ((uMarkerPriority == 1 && marker != 2.0) || (uMarkerPriority != 1 && marker == 1.0)) { + gl_FragColor.rgb = mix(gl_FragColor.rgb, uHighlightColor, uHighlightStrength); + gl_FragColor.a = max(gl_FragColor.a, uHighlightStrength * 0.002); // for direct-volume rendering + } else { + gl_FragColor.rgb = mix(gl_FragColor.rgb, uSelectColor, uSelectStrength); + gl_FragColor.a = max(gl_FragColor.a, uSelectStrength * 0.002); // for direct-volume rendering + } + } else if (uMarkerAverage > 0.0) { + gl_FragColor.rgb = mix(gl_FragColor.rgb, uDimColor, uDimStrength); + gl_FragColor.a = max(gl_FragColor.a, uDimStrength * 0.002); // for direct-volume rendering + } +#endif +`;var wZ=` +#if dClipObjectCount != 0 && defined(dClipping) + #if defined(dClippingType_instance) + vClipping = readFromTexture(tClipping, aInstance, uClippingTexDim).a; + #elif defined(dMarkerType_groupInstance) + vClipping = readFromTexture(tClipping, aInstance * float(uGroupCount) + group, uClippingTexDim).a; + #endif +#endif +`;var AZ=` +#if defined(dRenderVariant_color) + #if defined(dColorType_attribute) + vColor.rgb = aColor; + #elif defined(dColorType_instance) + vColor.rgb = readFromTexture(tColor, aInstance, uColorTexDim).rgb; + #elif defined(dColorType_group) + #if defined(dDualColor) + vec4 color2; + if (aColorMode == 2.0) { + vColor.rgb = readFromTexture(tColor, group, uColorTexDim).rgb; + } else { + vColor.rgb = readFromTexture(tColor, group * 2.0, uColorTexDim).rgb; + color2.rgb = readFromTexture(tColor, group * 2.0 + 1.0, uColorTexDim).rgb; + } + #else + vColor.rgb = readFromTexture(tColor, group, uColorTexDim).rgb; + #endif + #elif defined(dColorType_groupInstance) + #if defined(dDualColor) + vec4 color2; + if (aColorMode == 2.0) { + vColor.rgb = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim).rgb; + } else { + vColor.rgb = readFromTexture(tColor, (aInstance * float(uGroupCount) + group) * 2.0, uColorTexDim).rgb; + color2.rgb = readFromTexture(tColor, (aInstance * float(uGroupCount) + group) * 2.0 + 1.0, uColorTexDim).rgb; + } + #else + vColor.rgb = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim).rgb; + #endif + #elif defined(dColorType_vertex) + vColor.rgb = readFromTexture(tColor, VertexID, uColorTexDim).rgb; + #elif defined(dColorType_vertexInstance) + vColor.rgb = readFromTexture(tColor, int(aInstance) * uVertexCount + VertexID, uColorTexDim).rgb; + #elif defined(dColorType_volume) + vec3 cgridPos = (uColorGridTransform.w * (position - uColorGridTransform.xyz)) / uColorGridDim; + vColor.rgb = texture3dFrom2dLinear(tColorGrid, cgridPos, uColorGridDim, uColorTexDim).rgb; + #elif defined(dColorType_volumeInstance) + vec3 cgridPos = (uColorGridTransform.w * (vModelPosition - uColorGridTransform.xyz)) / uColorGridDim; + vColor.rgb = texture3dFrom2dLinear(tColorGrid, cgridPos, uColorGridDim, uColorTexDim).rgb; + #endif + + #ifdef dUsePalette + vPaletteV = ((vColor.r * 256.0 * 256.0 * 255.0 + vColor.g * 256.0 * 255.0 + vColor.b * 255.0) - 1.0) / 16777215.0; + #endif + + #ifdef dOverpaint + #if defined(dOverpaintType_instance) + vOverpaint = readFromTexture(tOverpaint, aInstance, uOverpaintTexDim); + #elif defined(dOverpaintType_groupInstance) + vOverpaint = readFromTexture(tOverpaint, aInstance * float(uGroupCount) + group, uOverpaintTexDim); + #elif defined(dOverpaintType_vertexInstance) + vOverpaint = readFromTexture(tOverpaint, int(aInstance) * uVertexCount + VertexID, uOverpaintTexDim); + #elif defined(dOverpaintType_volumeInstance) + vec3 ogridPos = (uOverpaintGridTransform.w * (vModelPosition - uOverpaintGridTransform.xyz)) / uOverpaintGridDim; + vOverpaint = texture3dFrom2dLinear(tOverpaintGrid, ogridPos, uOverpaintGridDim, uOverpaintTexDim); + #endif + + // pre-mix to avoid darkening due to empty overpaint + #ifdef dColorType_uniform + vOverpaint.rgb = mix(uColor.rgb, vOverpaint.rgb, vOverpaint.a); + #else + vOverpaint.rgb = mix(vColor.rgb, vOverpaint.rgb, vOverpaint.a); + #endif + vOverpaint *= uOverpaintStrength; + #endif + + #ifdef dEmissive + #if defined(dEmissiveType_instance) + vEmissive = readFromTexture(tEmissive, aInstance, uEmissiveTexDim).a; + #elif defined(dEmissiveType_groupInstance) + vEmissive = readFromTexture(tEmissive, aInstance * float(uGroupCount) + group, uEmissiveTexDim).a; + #elif defined(dEmissiveType_vertexInstance) + vEmissive = readFromTexture(tEmissive, int(aInstance) * uVertexCount + VertexID, uEmissiveTexDim).a; + #elif defined(dEmissiveType_volumeInstance) + vec3 egridPos = (uEmissiveGridTransform.w * (vModelPosition - uEmissiveGridTransform.xyz)) / uEmissiveGridDim; + vEmissive = texture3dFrom2dLinear(tEmissiveGrid, egridPos, uEmissiveGridDim, uEmissiveTexDim).a; + #endif + vEmissive *= uEmissiveStrength; + #endif + + #ifdef dSubstance + #if defined(dSubstanceType_instance) + vSubstance = readFromTexture(tSubstance, aInstance, uSubstanceTexDim); + #elif defined(dSubstanceType_groupInstance) + vSubstance = readFromTexture(tSubstance, aInstance * float(uGroupCount) + group, uSubstanceTexDim); + #elif defined(dSubstanceType_vertexInstance) + vSubstance = readFromTexture(tSubstance, int(aInstance) * uVertexCount + VertexID, uSubstanceTexDim); + #elif defined(dSubstanceType_volumeInstance) + vec3 sgridPos = (uSubstanceGridTransform.w * (vModelPosition - uSubstanceGridTransform.xyz)) / uSubstanceGridDim; + vSubstance = texture3dFrom2dLinear(tSubstanceGrid, sgridPos, uSubstanceGridDim, uSubstanceTexDim); + #endif + + // pre-mix to avoid artifacts due to empty substance + vSubstance.rgb = mix(vec3(uMetalness, uRoughness, uBumpiness), vSubstance.rgb, vSubstance.a); + vSubstance *= uSubstanceStrength; + #endif +#elif defined(dRenderVariant_emissive) + #ifdef dEmissive + #if defined(dEmissiveType_instance) + vEmissive = readFromTexture(tEmissive, aInstance, uEmissiveTexDim).a; + #elif defined(dEmissiveType_groupInstance) + vEmissive = readFromTexture(tEmissive, aInstance * float(uGroupCount) + group, uEmissiveTexDim).a; + #elif defined(dEmissiveType_vertexInstance) + vEmissive = readFromTexture(tEmissive, int(aInstance) * uVertexCount + VertexID, uEmissiveTexDim).a; + #elif defined(dEmissiveType_volumeInstance) + vec3 egridPos = (uEmissiveGridTransform.w * (vModelPosition - uEmissiveGridTransform.xyz)) / uEmissiveGridDim; + vEmissive = texture3dFrom2dLinear(tEmissiveGrid, egridPos, uEmissiveGridDim, uEmissiveTexDim).a; + #endif + vEmissive *= uEmissiveStrength; + #endif +#elif defined(dRenderVariant_pick) + #ifdef requiredDrawBuffers + vObject = vec4(packIntToRGB(float(uObjectId)), 1.0); + vInstance = vec4(packIntToRGB(aInstance), 1.0); + vGroup = vec4(packIntToRGB(group), 1.0); + #else + if (uPickType == 1) { + vColor = vec4(packIntToRGB(float(uObjectId)), 1.0); + } else if (uPickType == 2) { + vColor = vec4(packIntToRGB(aInstance), 1.0); + } else { + vColor = vec4(packIntToRGB(group), 1.0); + } + #endif +#endif + +#ifdef dTransparency + #if defined(dTransparencyType_instance) + vTransparency = readFromTexture(tTransparency, aInstance, uTransparencyTexDim).a; + #elif defined(dTransparencyType_groupInstance) + vTransparency = readFromTexture(tTransparency, aInstance * float(uGroupCount) + group, uTransparencyTexDim).a; + #elif defined(dTransparencyType_vertexInstance) + vTransparency = readFromTexture(tTransparency, int(aInstance) * uVertexCount + VertexID, uTransparencyTexDim).a; + #elif defined(dTransparencyType_volumeInstance) + vec3 tgridPos = (uTransparencyGridTransform.w * (vModelPosition - uTransparencyGridTransform.xyz)) / uTransparencyGridDim; + vTransparency = texture3dFrom2dLinear(tTransparencyGrid, tgridPos, uTransparencyGridDim, uTransparencyTexDim).a; + #endif + vTransparency *= uTransparencyStrength; +#endif +`;var TZ=` +#ifdef dGeometryType_textureMesh + float group = unpackRGBToInt(readFromTexture(tGroup, VertexID, uGeoTexDim).rgb); +#else + float group = aGroup; +#endif +`;var PZ=` +#if defined(dNeedsMarker) + #if defined(dMarkerType_instance) + vMarker = readFromTexture(tMarker, aInstance, uMarkerTexDim).a; + #elif defined(dMarkerType_groupInstance) + vMarker = readFromTexture(tMarker, aInstance * float(uGroupCount) + group, uMarkerTexDim).a; + #endif +#endif +`;var IZ=` +#if defined(dNeedsMarker) + float marker = uMarker; + if (uMarker == -1.0) { + marker = floor(vMarker * 255.0 + 0.5); // rounding required to work on some cards on win + } +#endif + +#if defined(dRenderVariant_color) + #if defined(dUsePalette) + vec4 material = vec4(texture2D(tPalette, vec2(vPaletteV, 0.5)).rgb, uAlpha); + #elif defined(dColorType_uniform) + vec4 material = vec4(uColor, uAlpha); + #elif defined(dColorType_varying) + vec4 material = vec4(vColor.rgb, uAlpha); + #endif + + // mix material with overpaint + #if defined(dOverpaint) + material.rgb = mix(material.rgb, vOverpaint.rgb, vOverpaint.a); + #endif + + float emissive = uEmissive; + #ifdef dEmissive + emissive += vEmissive; + #endif + + float metalness = uMetalness; + float roughness = uRoughness; + float bumpiness = uBumpiness; + #ifdef dSubstance + float sf = clamp(vSubstance.a, 0.0, 0.99); // clamp to avoid artifacts + metalness = mix(metalness, vSubstance.r, sf); + roughness = mix(roughness, vSubstance.g, sf); + bumpiness = mix(bumpiness, vSubstance.b, sf); + #endif +#elif defined(dRenderVariant_depth) + if (fragmentDepth > getDepth(gl_FragCoord.xy / uDrawingBufferSize)) { + discard; + } + + #ifndef dXrayShaded + #if defined(dTransparency) + float dta = 1.0 - vTransparency; + if (vTransparency < 0.2) dta = 1.0; // hard cutoff looks better + + if (uRenderMask == MaskTransparent && uAlpha * dta == 1.0) { + discard; + } else if (uRenderMask == MaskOpaque && uAlpha * dta < 1.0) { + discard; + } + #else + if (uRenderMask == MaskTransparent && uAlpha == 1.0) { + discard; + } else if (uRenderMask == MaskOpaque && uAlpha < 1.0) { + discard; + } + #endif + #else + if (uRenderMask == MaskOpaque) { + discard; + } + #endif + + vec4 material = packDepthToRGBA(fragmentDepth); +#elif defined(dRenderVariant_marking) + vec4 material; + if(uMarkingType == 1) { + if (marker > 0.0) + discard; + #ifdef enabledFragDepth + material = packDepthToRGBA(gl_FragDepthEXT); + #else + material = packDepthToRGBA(gl_FragCoord.z); + #endif + } else { + if (marker == 0.0) + discard; + float depthTest = 1.0; + if (uMarkingDepthTest) { + depthTest = (fragmentDepth >= getDepthPacked(gl_FragCoord.xy / uDrawingBufferSize)) ? 1.0 : 0.0; + } + bool isHighlight = intMod(marker, 2.0) > 0.1; + float viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar); + float fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ)); + if (fogFactor == 1.0) + discard; + material = vec4(0.0, depthTest, isHighlight ? 1.0 : 0.0, 1.0 - fogFactor); + } +#elif defined(dRenderVariant_emissive) + float emissive = uEmissive; + #ifdef dEmissive + emissive += vEmissive; + #endif + vec4 material = vec4(emissive); +#endif + +// apply per-group transparency +#if defined(dTransparency) && (defined(dRenderVariant_pick) || defined(dRenderVariant_color) || defined(dRenderVariant_emissive)) + float ta = 1.0 - vTransparency; + if (vTransparency < 0.09) ta = 1.0; // hard cutoff looks better + + #if defined(dRenderVariant_pick) + if (ta * uAlpha < uPickingAlphaThreshold) + discard; // ignore so the element below can be picked + #elif defined(dRenderVariant_emissive) + if (ta < 1.0) + discard; // emissive not supported with transparency + #elif defined(dRenderVariant_color) + material.a *= ta; + #endif +#endif +`;var EZ=` +mat4 model = uModel * aTransform; +mat4 modelView = uView * model; +#ifdef dGeometryType_textureMesh + vec3 position = readFromTexture(tPosition, VertexID, uGeoTexDim).xyz; +#else + vec3 position = aPosition; +#endif +vec4 position4 = vec4(position, 1.0); +// for accessing tColorGrid in vert shader and for clipping in frag shader +vModelPosition = (model * position4).xyz; +vec4 mvPosition = modelView * position4; +vViewPosition = mvPosition.xyz; +gl_Position = uProjection * mvPosition; +`;var DZ=` +#if defined(dSizeType_uniform) + float size = uSize; +#elif defined(dSizeType_attribute) + float size = aSize; +#elif defined(dSizeType_instance) + float size = unpackRGBToInt(readFromTexture(tSize, aInstance, uSizeTexDim).rgb); +#elif defined(dSizeType_group) + float size = unpackRGBToInt(readFromTexture(tSize, group, uSizeTexDim).rgb); +#elif defined(dSizeType_groupInstance) + float size = unpackRGBToInt(readFromTexture(tSize, aInstance * float(uGroupCount) + group, uSizeTexDim).rgb); +#endif + +#if defined(dSizeType_instance) || defined(dSizeType_group) || defined(dSizeType_groupInstance) + size /= 100.0; // NOTE factor also set in TypeScript +#endif + +size *= uSizeFactor; +`;var kZ=` +float viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar); +float fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ)); +float alpha = (1.0 - fogFactor) * uAlpha; +// if not opaque enough ignore so the element below can be picked +if (uAlpha < uPickingAlphaThreshold || alpha < 0.1) { + #ifdef dTransparentBackfaces_opaque + if (!interior) discard; + #else + discard; + #endif +} +`;var MZ=` +#if defined(dRenderVariant_color) + #if defined(dTransparentBackfaces_off) + if (interior && material.a < 1.0) discard; + #elif defined(dTransparentBackfaces_opaque) + if (interior) material.a = 1.0; + #endif + + #if !defined(dXrayShaded_on) && !defined(dXrayShaded_inverted) + if ((uRenderMask == MaskOpaque && material.a < 1.0) || + (uRenderMask == MaskTransparent && material.a == 1.0) + ) { + discard; + } + #endif +#endif +`;var BZ=` +#if defined(dClipVariant_instance) && dClipObjectCount != 0 + vec4 mCenter = uModel * aTransform * vec4(uInvariantBoundingSphere.xyz, 1.0); + if (clipTest(vec4(mCenter.xyz, uInvariantBoundingSphere.w))) + // move out of [ -w, +w ] to 'discard' in vert shader + gl_Position.z = 2.0 * gl_Position.w; +#endif +`;var RZ=` +#if defined(dClipVariant_pixel) && dClipObjectCount != 0 + if (clipTest(vec4(vModelPosition, 0.0))) + discard; +#endif +`;var LZ=` +uniform float uMetalness; +uniform float uRoughness; +uniform float uBumpiness; +#ifdef bumpEnabled + uniform float uBumpFrequency; + uniform float uBumpAmplitude; +#endif +uniform float uEmissive; + +#if defined(dRenderVariant_color) + #if defined(dColorType_uniform) + uniform vec3 uColor; + #elif defined(dColorType_varying) + varying vec4 vColor; + #endif + + #ifdef dUsePalette + uniform sampler2D tPalette; + varying float vPaletteV; + #endif + + #ifdef dOverpaint + varying vec4 vOverpaint; + #endif + + #ifdef dEmissive + varying float vEmissive; + #endif + + #ifdef dSubstance + varying vec4 vSubstance; + #endif +#elif defined(dRenderVariant_emissive) + #ifdef dEmissive + varying float vEmissive; + #endif +#elif defined(dRenderVariant_pick) + #if __VERSION__ == 100 || !defined(dVaryingGroup) + #ifdef requiredDrawBuffers + varying vec4 vObject; + varying vec4 vInstance; + varying vec4 vGroup; + #else + varying vec4 vColor; + #endif + #else + #ifdef requiredDrawBuffers + flat in vec4 vObject; + flat in vec4 vInstance; + flat in vec4 vGroup; + #else + flat in vec4 vColor; + #endif + #endif +#endif + +#ifdef dTransparency + varying float vTransparency; +#endif +`;var FZ=` +uniform float uMetalness; +uniform float uRoughness; +uniform float uBumpiness; + +#if defined(dRenderVariant_color) + #if defined(dColorType_uniform) + uniform vec3 uColor; + #elif defined(dColorType_attribute) + varying vec4 vColor; + attribute vec3 aColor; + #elif defined(dColorType_texture) + varying vec4 vColor; + uniform vec2 uColorTexDim; + uniform sampler2D tColor; + #elif defined(dColorType_grid) + varying vec4 vColor; + uniform vec2 uColorTexDim; + uniform vec3 uColorGridDim; + uniform vec4 uColorGridTransform; + uniform sampler2D tColorGrid; + #elif defined(dColorType_direct) + varying vec4 vColor; + #endif + + #ifdef dUsePalette + varying float vPaletteV; + #endif + + #ifdef dOverpaint + #if defined(dOverpaintType_instance) || defined(dOverpaintType_groupInstance) || defined(dOverpaintType_vertexInstance) + varying vec4 vOverpaint; + uniform vec2 uOverpaintTexDim; + uniform sampler2D tOverpaint; + #elif defined(dOverpaintType_volumeInstance) + varying vec4 vOverpaint; + uniform vec2 uOverpaintTexDim; + uniform vec3 uOverpaintGridDim; + uniform vec4 uOverpaintGridTransform; + uniform sampler2D tOverpaintGrid; + #endif + uniform float uOverpaintStrength; + #endif + + #ifdef dEmissive + #if defined(dEmissiveType_instance) || defined(dEmissiveType_groupInstance) || defined(dEmissiveType_vertexInstance) + varying float vEmissive; + uniform vec2 uEmissiveTexDim; + uniform sampler2D tEmissive; + #elif defined(dEmissiveType_volumeInstance) + varying float vEmissive; + uniform vec2 uEmissiveTexDim; + uniform vec3 uEmissiveGridDim; + uniform vec4 uEmissiveGridTransform; + uniform sampler2D tEmissiveGrid; + #endif + uniform float uEmissiveStrength; + #endif + + #ifdef dSubstance + #if defined(dSubstanceType_instance) || defined(dSubstanceType_groupInstance) || defined(dSubstanceType_vertexInstance) + varying vec4 vSubstance; + uniform vec2 uSubstanceTexDim; + uniform sampler2D tSubstance; + #elif defined(dSubstanceType_volumeInstance) + varying vec4 vSubstance; + uniform vec2 uSubstanceTexDim; + uniform vec3 uSubstanceGridDim; + uniform vec4 uSubstanceGridTransform; + uniform sampler2D tSubstanceGrid; + #endif + uniform float uSubstanceStrength; + #endif +#elif defined(dRenderVariant_emissive) + #ifdef dEmissive + #if defined(dEmissiveType_instance) || defined(dEmissiveType_groupInstance) || defined(dEmissiveType_vertexInstance) + varying float vEmissive; + uniform vec2 uEmissiveTexDim; + uniform sampler2D tEmissive; + #elif defined(dEmissiveType_volumeInstance) + varying float vEmissive; + uniform vec2 uEmissiveTexDim; + uniform vec3 uEmissiveGridDim; + uniform vec4 uEmissiveGridTransform; + uniform sampler2D tEmissiveGrid; + #endif + uniform float uEmissiveStrength; + #endif +#elif defined(dRenderVariant_pick) + #if __VERSION__ == 100 || !defined(dVaryingGroup) + #ifdef requiredDrawBuffers + varying vec4 vObject; + varying vec4 vInstance; + varying vec4 vGroup; + #else + varying vec4 vColor; + #endif + #else + #ifdef requiredDrawBuffers + flat out vec4 vObject; + flat out vec4 vInstance; + flat out vec4 vGroup; + #else + flat out vec4 vColor; + #endif + #endif +#endif + +#ifdef dTransparency + #if defined(dTransparencyType_instance) || defined(dTransparencyType_groupInstance) || defined(dTransparencyType_vertexInstance) + varying float vTransparency; + uniform vec2 uTransparencyTexDim; + uniform sampler2D tTransparency; + #elif defined(dTransparencyType_volumeInstance) + varying float vTransparency; + uniform vec2 uTransparencyTexDim; + uniform vec3 uTransparencyGridDim; + uniform vec4 uTransparencyGridTransform; + uniform sampler2D tTransparencyGrid; + #endif + uniform float uTransparencyStrength; +#endif +`;var OZ=` +#if dClipObjectCount != 0 + vec3 quaternionTransform(const in vec4 q, const in vec3 v) { + vec3 t = 2.0 * cross(q.xyz, v); + return v + q.w * t + cross(q.xyz, t); + } + + vec4 computePlane(const in vec3 normal, const in vec3 inPoint) { + return vec4(normalize(normal), -dot(normal, inPoint)); + } + + float planeSD(const in vec4 plane, const in vec3 center) { + return -dot(plane.xyz, center - plane.xyz * -plane.w); + } + + float sphereSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) { + return ( + length(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position) / size) - 1.0 + ) * min(min(size.x, size.y), size.z); + } + + float cubeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) { + vec3 d = abs(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position)) - size; + return min(max(d.x, max(d.y, d.z)), 0.0) + length(max(d, 0.0)); + } + + float cylinderSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) { + vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position); + + vec2 d = abs(vec2(length(t.xz), t.y)) - size.xy; + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); + } + + float infiniteConeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) { + vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position); + + float q = length(t.xy); + return dot(size.xy, vec2(q, t.z)); + } + + float getSignedDistance(const in vec3 center, const in int type, const in vec3 position, const in vec4 rotation, const in vec3 scale) { + if (type == 1) { + vec3 normal = quaternionTransform(rotation, vec3(0.0, 1.0, 0.0)); + vec4 plane = computePlane(normal, position); + return planeSD(plane, center); + } else if (type == 2) { + return sphereSD(position, rotation, scale * 0.5, center); + } else if (type == 3) { + return cubeSD(position, rotation, scale * 0.5, center); + } else if (type == 4) { + return cylinderSD(position, rotation, scale * 0.5, center); + } else if (type == 5) { + return infiniteConeSD(position, rotation, scale * 0.5, center); + } else { + return 0.1; + } + } + + #if __VERSION__ == 100 + // 8-bit + int bitwiseAnd(in int a, in int b) { + int d = 128; + int result = 0; + for (int i = 0; i < 8; ++i) { + if (d <= 0) break; + if (a >= d && b >= d) result += d; + if (a >= d) a -= d; + if (b >= d) b -= d; + d /= 2; + } + return result; + } + + bool hasBit(const in int mask, const in int bit) { + return bitwiseAnd(mask, bit) == 0; + } + #else + bool hasBit(const in int mask, const in int bit) { + return (mask & bit) == 0; + } + #endif + + bool clipTest(const in vec4 sphere) { + // flag is a bit-flag for clip-objects to ignore (note, object ids start at 1 not 0) + #if defined(dClipping) + int flag = int(floor(vClipping * 255.0 + 0.5)); + #else + int flag = 0; + #endif + + #pragma unroll_loop_start + for (int i = 0; i < dClipObjectCount; ++i) { + if (flag == 0 || hasBit(flag, UNROLLED_LOOP_INDEX + 1)) { + // TODO take sphere radius into account? + bool test = getSignedDistance(sphere.xyz, uClipObjectType[i], uClipObjectPosition[i], uClipObjectRotation[i], uClipObjectScale[i]) <= 0.0; + if ((!uClipObjectInvert[i] && test) || (uClipObjectInvert[i] && !test)) { + return true; + } + } + } + #pragma unroll_loop_end + return false; + } +#endif +`;var NZ=` +uniform int uObjectId; +uniform int uInstanceCount; +uniform int uGroupCount; + +uniform int uPickType; +uniform int uMarkingType; + +uniform vec4 uCameraPlane; +uniform vec4 uLod; + +#if dClipObjectCount != 0 + uniform int uClipObjectType[dClipObjectCount]; + uniform bool uClipObjectInvert[dClipObjectCount]; + uniform vec3 uClipObjectPosition[dClipObjectCount]; + uniform vec4 uClipObjectRotation[dClipObjectCount]; + uniform vec3 uClipObjectScale[dClipObjectCount]; + + #if defined(dClipping) + #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup) + varying float vClipping; + #else + flat in float vClipping; + #endif + #endif +#endif + +#if defined(dColorMarker) + uniform vec3 uHighlightColor; + uniform vec3 uSelectColor; + uniform vec3 uDimColor; + uniform float uHighlightStrength; + uniform float uSelectStrength; + uniform float uDimStrength; + uniform int uMarkerPriority; + uniform float uMarkerAverage; +#endif + +#if defined(dNeedsMarker) + uniform float uMarker; + #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup) + varying float vMarker; + #else + flat in float vMarker; + #endif +#endif + +#if defined(dRenderVariant_colorDpoit) + #define MAX_DPOIT_DEPTH 99999.0 // NOTE constant also set in TypeScript + uniform sampler2D tDpoitDepth; + uniform sampler2D tDpoitFrontColor; +#endif + +varying vec3 vModelPosition; +varying vec3 vViewPosition; + +uniform vec2 uViewOffset; + +uniform float uNear; +uniform float uFar; +uniform float uIsOrtho; + +uniform bool uFog; +uniform float uFogNear; +uniform float uFogFar; +uniform vec3 uFogColor; + +uniform float uAlpha; +uniform float uPickingAlphaThreshold; +uniform bool uTransparentBackground; + +uniform bool uDoubleSided; +uniform float uInteriorDarkening; +uniform bool uInteriorColorFlag; +uniform vec3 uInteriorColor; +bool interior; + +uniform float uXrayEdgeFalloff; +uniform float uExposure; + +uniform mat4 uProjection; + +uniform int uRenderMask; +uniform bool uMarkingDepthTest; + +uniform sampler2D tDepth; +uniform vec2 uDrawingBufferSize; + +float getDepthPacked(const in vec2 coords) { + return unpackRGBAToDepth(texture2D(tDepth, coords)); +} + +float getDepth(const in vec2 coords) { + #ifdef depthTextureSupport + return texture2D(tDepth, coords).r; + #else + return unpackRGBAToDepth(texture2D(tDepth, coords)); + #endif +} + +float calcDepth(const in vec3 pos) { + vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw; + return 0.5 + 0.5 * clipZW.x / clipZW.y; +} + +// "Bump Mapping Unparametrized Surfaces on the GPU" Morten S. Mikkelsen +// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf +vec3 perturbNormal(in vec3 position, in vec3 normal, in float height, in float scale) { + vec3 sigmaS = dFdx(position); + vec3 sigmaT = dFdy(position); + + vec3 r1 = cross(sigmaT, normal); + vec3 r2 = cross(normal, sigmaS); + float det = dot(sigmaS, r1); + if (det == 0.0) return normal; + + float bs = dFdx(height); + float bt = dFdy(height); + + vec3 surfGrad = sign(det) * (bs * r1 + bt * r2); + return normalize(abs(det) * normal - scale * surfGrad); +} + +float hash(in float h) { + return fract(sin(h) * 43758.5453123); +} + +float noise(in vec3 x) { + vec3 p = floor(x); + vec3 f = fract(x); + f = f * f * (3.0 - 2.0 * f); + + float n = p.x + p.y * 157.0 + 113.0 * p.z; + return mix( + mix(mix(hash(n + 0.0), hash(n + 1.0), f.x), + mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y), + mix(mix(hash(n + 113.0), hash(n + 114.0), f.x), + mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y), f.z); +} + +float fbm(in vec3 p) { + float f = 0.0; + f += 0.5 * noise(p); + p *= 2.01; + f += 0.25 * noise(p); + p *= 2.02; + f += 0.125 * noise(p); + + return f; +} +`;var UZ=` +uniform mat4 uProjection, uModel, uView; +uniform vec3 uCameraPosition; +uniform vec4 uCameraPlane; + +uniform int uObjectId; +uniform int uVertexCount; +uniform int uInstanceCount; +uniform int uGroupCount; +uniform vec4 uInvariantBoundingSphere; +uniform vec4 uLod; + +uniform bool uDoubleSided; +uniform int uPickType; + +#if dClipObjectCount != 0 + uniform int uClipObjectType[dClipObjectCount]; + uniform bool uClipObjectInvert[dClipObjectCount]; + uniform vec3 uClipObjectPosition[dClipObjectCount]; + uniform vec4 uClipObjectRotation[dClipObjectCount]; + uniform vec3 uClipObjectScale[dClipObjectCount]; + + #if defined(dClipping) + uniform vec2 uClippingTexDim; + uniform sampler2D tClipping; + #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup) + varying float vClipping; + #else + flat out float vClipping; + #endif + #endif +#endif + +#if defined(dNeedsMarker) + uniform float uMarker; + uniform vec2 uMarkerTexDim; + uniform sampler2D tMarker; + #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup) + varying float vMarker; + #else + flat out float vMarker; + #endif +#endif + +varying vec3 vModelPosition; +varying vec3 vViewPosition; + +#if defined(noNonInstancedActiveAttribs) + // int() is needed for some Safari versions + // see https://bugs.webkit.org/show_bug.cgi?id=244152 + #define VertexID int(gl_VertexID) +#else + attribute float aVertex; + #define VertexID int(aVertex) +#endif + +#if defined(enabledMultiDraw) + #define DrawID gl_DrawID +#else + #define DrawID uDrawId +#endif +`;var zZ=` +// TODO find a better place for these convenience defines + +#if defined(dRenderVariant_colorBlended) || defined(dRenderVariant_colorWboit) || defined(dRenderVariant_colorDpoit) + #define dRenderVariant_color +#endif + +#if defined(dColorType_instance) || defined(dColorType_group) || defined(dColorType_groupInstance) || defined(dColorType_vertex) || defined(dColorType_vertexInstance) + #define dColorType_texture +#endif + +#if defined(dColorType_volume) || defined(dColorType_volumeInstance) + #define dColorType_grid +#endif + +#if defined(dColorType_attribute) || defined(dColorType_texture) || defined(dColorType_grid) + #define dColorType_varying +#endif + +#if (defined(dRenderVariant_color) && defined(dColorMarker)) || defined(dRenderVariant_marking) + #define dNeedsMarker +#endif + +#if defined(dXrayShaded_on) || defined(dXrayShaded_inverted) + #define dXrayShaded +#endif + +#define MaskAll 0 +#define MaskOpaque 1 +#define MaskTransparent 2 + +// + +#define PI 3.14159265 +#define RECIPROCAL_PI 0.31830988618 +#define EPSILON 1e-6 + +#define saturate(a) clamp(a, 0.0, 1.0) + +#if __VERSION__ == 100 + #define round(x) floor((x) + 0.5) +#endif + +float intDiv(const in float a, const in float b) { return float(int(a) / int(b)); } +vec2 ivec2Div(const in vec2 a, const in vec2 b) { return vec2(ivec2(a) / ivec2(b)); } +float intMod(const in float a, const in float b) { return a - b * float(int(a) / int(b)); } +int imod(const in int a, const in int b) { return a - b * (a / b); } + +float pow2(const in float x) { return x * x; } + +vec3 packIntToRGB(in float value) { + value = clamp(round(value), 0.0, 16777216.0 - 1.0) + 1.0; + vec3 c = vec3(0.0); + c.b = mod(value, 256.0); + value = floor(value / 256.0); + c.g = mod(value, 256.0); + value = floor(value / 256.0); + c.r = mod(value, 256.0); + return c / 255.0; +} +float unpackRGBToInt(const in vec3 rgb) { + 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; +} + +vec2 packUnitIntervalToRG(const in float v) { + vec2 enc; + enc.xy = vec2(fract(v * 256.0), v); + enc.y -= enc.x * (1.0 / 256.0); + enc.xy *= 256.0 / 255.0; + + return enc; +} + +float unpackRGToUnitInterval(const in vec2 enc) { + return dot(enc, vec2(255.0 / (256.0 * 256.0), 255.0 / 256.0)); +} + +vec3 screenSpaceToViewSpace(const in vec3 ssPos, const in mat4 invProjection) { + vec4 p = vec4(ssPos * 2.0 - 1.0, 1.0); + p = invProjection * p; + return p.xyz / p.w; +} + +const float PackUpscale = 256.0 / 255.0; // fraction -> 0..1 (including 1) +const float UnpackDownscale = 255.0 / 256.0; // 0..1 -> fraction (excluding 1) +const vec3 PackFactors = vec3(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0); +const vec4 UnpackFactors = UnpackDownscale / vec4(PackFactors, 1.0); +const float ShiftRight8 = 1.0 / 256.0; + +vec4 packDepthToRGBA(const in float v) { + vec4 r = vec4(fract(v * PackFactors), v); + r.yzw -= r.xyz * ShiftRight8; // tidy overflow + return r * PackUpscale; +} +float unpackRGBAToDepth(const in vec4 v) { + return dot(v, UnpackFactors); +} + +vec4 sRGBToLinear(const in vec4 c) { + 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); +} +vec4 linearTosRGB(const in vec4 c) { + 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); +} + +float linearizeDepth(const in float depth, const in float near, const in float far) { + return (2.0 * near) / (far + near - depth * (far - near)); +} + +float perspectiveDepthToViewZ(const in float invClipZ, const in float near, const in float far) { + return (near * far) / ((far - near) * invClipZ - far); +} + +float orthographicDepthToViewZ(const in float linearClipZ, const in float near, const in float far) { + return linearClipZ * (near - far) - near; +} + +float depthToViewZ(const in float isOrtho, const in float linearClipZ, const in float near, const in float far) { + return isOrtho == 1.0 ? orthographicDepthToViewZ(linearClipZ, near, far) : perspectiveDepthToViewZ(linearClipZ, near, far); +} + +#if __VERSION__ == 100 + // transpose + + float transpose(const in float m) { + return m; + } + + mat2 transpose2(const in mat2 m) { + return mat2( + m[0][0], m[1][0], + m[0][1], m[1][1] + ); + } + + mat3 transpose3(const in mat3 m) { + return mat3( + m[0][0], m[1][0], m[2][0], + m[0][1], m[1][1], m[2][1], + m[0][2], m[1][2], m[2][2] + ); + } + + mat4 transpose4(const in mat4 m) { + return mat4( + m[0][0], m[1][0], m[2][0], m[3][0], + m[0][1], m[1][1], m[2][1], m[3][1], + m[0][2], m[1][2], m[2][2], m[3][2], + m[0][3], m[1][3], m[2][3], m[3][3] + ); + } + + // inverse + + float inverse(const in float m) { + return 1.0 / m; + } + + mat2 inverse2(const in mat2 m) { + return mat2(m[1][1],-m[0][1], + -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]); + } + + mat3 inverse3(const in mat3 m) { + float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2]; + float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2]; + float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2]; + + float b01 = a22 * a11 - a12 * a21; + float b11 = -a22 * a10 + a12 * a20; + float b21 = a21 * a10 - a11 * a20; + + float det = a00 * b01 + a01 * b11 + a02 * b21; + + return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11), + b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10), + b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det; + } + + mat4 inverse4(const in mat4 m) { + float + a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3], + a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3], + a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3], + a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3], + + b00 = a00 * a11 - a01 * a10, + b01 = a00 * a12 - a02 * a10, + b02 = a00 * a13 - a03 * a10, + b03 = a01 * a12 - a02 * a11, + b04 = a01 * a13 - a03 * a11, + b05 = a02 * a13 - a03 * a12, + b06 = a20 * a31 - a21 * a30, + b07 = a20 * a32 - a22 * a30, + b08 = a20 * a33 - a23 * a30, + b09 = a21 * a32 - a22 * a31, + b10 = a21 * a33 - a23 * a31, + b11 = a22 * a33 - a23 * a32, + + det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + return mat4( + a11 * b11 - a12 * b10 + a13 * b09, + a02 * b10 - a01 * b11 - a03 * b09, + a31 * b05 - a32 * b04 + a33 * b03, + a22 * b04 - a21 * b05 - a23 * b03, + a12 * b08 - a10 * b11 - a13 * b07, + a00 * b11 - a02 * b08 + a03 * b07, + a32 * b02 - a30 * b05 - a33 * b01, + a20 * b05 - a22 * b02 + a23 * b01, + a10 * b10 - a11 * b08 + a13 * b06, + a01 * b08 - a00 * b10 - a03 * b06, + a30 * b04 - a31 * b02 + a33 * b00, + a21 * b02 - a20 * b04 - a23 * b00, + a11 * b07 - a10 * b09 - a12 * b06, + a00 * b09 - a01 * b07 + a02 * b06, + a31 * b01 - a30 * b03 - a32 * b00, + a20 * b03 - a21 * b01 + a22 * b00) / det; + } + + #define isNaN(x) ((x) != (x)) + #define isInf(x) ((x) == (x) + 1.0) +#else + #define transpose2(m) transpose(m) + #define transpose3(m) transpose(m) + #define transpose4(m) transpose(m) + + #define inverse2(m) inverse(m) + #define inverse3(m) inverse(m) + #define inverse4(m) inverse(m) + + #define isNaN isnan + #define isInf isinf +#endif +`;var VZ=` +if (uLod.w == 0.0 && (uLod.x != 0.0 || uLod.y != 0.0)) { + float d = dot(uCameraPlane.xyz, vModelPosition) + uCameraPlane.w; + float ta = min( + smoothstep(uLod.x, uLod.x + uLod.z, d), + 1.0 - smoothstep(uLod.y - uLod.z, uLod.y, d) + ); + + #if defined(dRenderVariant_color) + float at = 0.0; + + // shift by view-offset during multi-sample rendering to allow for blending + vec2 coord = gl_FragCoord.xy + uViewOffset * 0.25; + + const mat4 thresholdMatrix = mat4( + 1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0, + 13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0, + 4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0, + 16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0 + ); + int ci = int(intMod(coord.x, 4.0)); + int ri = int(intMod(coord.y, 4.0)); + #if __VERSION__ == 100 + vec4 i = vec4(float(ci * 4 + ri)); + vec4 v = thresholdMatrix[0] * vec4(equal(i, vec4(0.0, 1.0, 2.0, 3.0))) + + thresholdMatrix[1] * vec4(equal(i, vec4(4.0, 5.0, 6.0, 7.0))) + + thresholdMatrix[2] * vec4(equal(i, vec4(8.0, 9.0, 10.0, 11.0))) + + thresholdMatrix[3] * vec4(equal(i, vec4(12.0, 13.0, 14.0, 15.0))); + at = v.x + v.y + v.z + v.w; + #else + at = thresholdMatrix[ci][ri]; + #endif + + if (ta < 0.99 && (ta < 0.01 || ta < at)) { + discard; + } + #else + if (ta < uPickingAlphaThreshold) { + discard; + } + #endif +} +`;var GZ=` + // floatToRgba adapted from https://github.com/equinor/glsl-float-to-rgba + // MIT License, Copyright (c) 2020 Equinor + + float shiftRight (float v, float amt) { + v = floor(v) + 0.5; + return floor(v / exp2(amt)); + } + float shiftLeft (float v, float amt) { + return floor(v * exp2(amt) + 0.5); + } + float maskLast (float v, float bits) { + return mod(v, shiftLeft(1.0, bits)); + } + float extractBits (float num, float from, float to) { + from = floor(from + 0.5); to = floor(to + 0.5); + return maskLast(shiftRight(num, from), to - from); + } + + vec4 floatToRgba(float texelFloat, bool littleEndian) { + if (texelFloat == 0.0) return vec4(0.0, 0.0, 0.0, 0.0); + float sign = texelFloat > 0.0 ? 0.0 : 1.0; + texelFloat = abs(texelFloat); + float exponent = floor(log2(texelFloat)); + float biased_exponent = exponent + 127.0; + float fraction = ((texelFloat / exp2(exponent)) - 1.0) * 8388608.0; + float t = biased_exponent / 2.0; + float last_bit_of_biased_exponent = fract(t) * 2.0; + float remaining_bits_of_biased_exponent = floor(t); + float byte4 = extractBits(fraction, 0.0, 8.0) / 255.0; + float byte3 = extractBits(fraction, 8.0, 16.0) / 255.0; + float byte2 = (last_bit_of_biased_exponent * 128.0 + extractBits(fraction, 16.0, 23.0)) / 255.0; + float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0; + return ( + littleEndian + ? vec4(byte4, byte3, byte2, byte1) + : vec4(byte1, byte2, byte3, byte4) + ); + } +`;var HZ=` +#if dLightCount != 0 + uniform vec3 uLightDirection[dLightCount]; + uniform vec3 uLightColor[dLightCount]; +#endif +uniform vec3 uAmbientColor; + +struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; +}; + +struct IncidentLight { + vec3 color; + vec3 direction; +}; + +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; + +struct GeometricContext { + vec3 position; + vec3 normal; + vec3 viewDir; +}; + +vec3 BRDF_Lambert(const in vec3 diffuseColor) { + return RECIPROCAL_PI * diffuseColor; +} + +vec3 F_Schlick(const in vec3 f0, const in float f90, const in float dotVH) { + // Original approximation by Christophe Schlick '94 + // float fresnel = pow( 1.0 - dotVH, 5.0 ); + // Optimized variant (presented by Epic at SIGGRAPH '13) + // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf + float fresnel = exp2((-5.55473 * dotVH - 6.98316) * dotVH); + return f0 * (1.0 - fresnel) + (f90 * fresnel); +} + +// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2 +// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf +float V_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) { + float a2 = pow2(alpha); + float gv = dotNL * sqrt(a2 + (1.0 - a2) * pow2(dotNV)); + float gl = dotNV * sqrt(a2 + (1.0 - a2) * pow2(dotNL)); + return 0.5 / max(gv + gl, EPSILON); +} + +// Microfacet Models for Refraction through Rough Surfaces - equation (33) +// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html +// alpha is "roughness squared" in Disney\u2019s reparameterization +float D_GGX(const in float alpha, const in float dotNH) { + float a2 = pow2(alpha); + float denom = pow2(dotNH) * (a2 - 1.0) + 1.0; // avoid alpha = 0 with dotNH = 1 + return RECIPROCAL_PI * a2 / pow2(denom); +} + +// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility +vec3 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) { + float alpha = pow2(roughness); // UE4's roughness + vec3 halfDir = normalize( lightDir + viewDir); + float dotNL = saturate(dot(normal, lightDir)); + float dotNV = saturate(dot(normal, viewDir)); + float dotNH = saturate(dot(normal, halfDir)); + float dotVH = saturate(dot(viewDir, halfDir)); + vec3 F = F_Schlick(f0, f90, dotVH); + float V = V_GGX_SmithCorrelated(alpha, dotNL, dotNV); + float D = D_GGX(alpha, dotNH); + return F * (V * D); +} + +// Analytical approximation of the DFG LUT, one half of the +// split-sum approximation used in indirect specular lighting. +// via 'environmentBRDF' from "Physically Based Shading on Mobile" +// https://www.unrealengine.com/blog/physically-based-shading-on-mobile +vec2 DFGApprox(const in vec3 normal, const in vec3 viewDir, const in float roughness) { + float dotNV = saturate(dot(normal, viewDir)); + const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022); + const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04); + vec4 r = roughness * c0 + c1; + float a004 = min(r.x * r.x, exp2(-9.28 * dotNV)) * r.x + r.y; + vec2 fab = vec2(-1.04, 1.04) * a004 + r.zw; + return fab; +} + +// Fdez-Ag\xFCera's "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting" +// Approximates multiscattering in order to preserve energy. +// http://www.jcgt.org/published/0008/01/03/ +void 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) { + vec2 fab = DFGApprox(normal, viewDir, roughness); + vec3 FssEss = specularColor * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = specularColor + (1.0 - specularColor) * 0.047619; // 1/21 + vec3 Fms = FssEss * Favg / (1.0 - Ems * Favg); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} + +void RE_Direct_Physical(const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + float dotNL = saturate(dot(geometry.normal, directLight.direction)); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directSpecular += irradiance * BRDF_GGX(directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert(material.diffuseColor); +} + +void RE_IndirectDiffuse_Physical(const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert(material.diffuseColor); +} + +void 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) { + // Both indirect specular and indirect diffuse light accumulate here + vec3 singleScattering = vec3(0.0); + vec3 multiScattering = vec3(0.0); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + computeMultiscattering(geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering); + vec3 diffuse = material.diffuseColor * (1.0 - ( singleScattering + multiScattering)); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +`;var jZ=` +float matrixScale(in mat4 m){ + vec4 r = m[0]; + return sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]); +} +`;var qZ=` +varying vec3 vNormal; +`;var WZ=` +vec4 readFromTexture(const in sampler2D tex, const in float i, const in vec2 dim) { + float x = intMod(i, dim.x); + float y = floor(intDiv(i, dim.x)); + vec2 uv = (vec2(x, y) + 0.5) / dim; + return texture2D(tex, uv); +} + +vec4 readFromTexture(const in sampler2D tex, const in int i, const in vec2 dim) { + int x = imod(i, int(dim.x)); + int y = i / int(dim.x); + vec2 uv = (vec2(x, y) + 0.5) / dim; + return texture2D(tex, uv); +} +`;var YZ=` + // rgbaToFloat adapted from https://github.com/ihmeuw/glsl-rgba-to-float + // BSD 3-Clause License + // + // Copyright (c) 2019, Institute for Health Metrics and Evaluation All rights reserved. + // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + // - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + // - 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. + // - 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. + // + // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + // OF THE POSSIBILITY OF SUCH DAMAGE. + + ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) { + ivec4 bytes = ivec4(inputFloats * 255.0); + return ( + littleEndian + ? bytes.abgr + : bytes + ); + } + + // Break the four bytes down into an array of 32 bits. + void bytesToBits(const in ivec4 bytes, out bool bits[32]) { + for (int channelIndex = 0; channelIndex < 4; ++channelIndex) { + float acc = float(bytes[channelIndex]); + for (int indexInByte = 7; indexInByte >= 0; --indexInByte) { + float powerOfTwo = exp2(float(indexInByte)); + bool bit = acc >= powerOfTwo; + bits[channelIndex * 8 + (7 - indexInByte)] = bit; + acc = mod(acc, powerOfTwo); + } + } + } + + // Compute the exponent of the 32-bit float. + float getExponent(bool bits[32]) { + const int startIndex = 1; + const int bitStringLength = 8; + const int endBeforeIndex = startIndex + bitStringLength; + float acc = 0.0; + int pow2 = bitStringLength - 1; + for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) { + acc += float(bits[bitIndex]) * exp2(float(pow2--)); + } + return acc; + } + + // Compute the mantissa of the 32-bit float. + float getMantissa(bool bits[32], bool subnormal) { + const int startIndex = 9; + const int bitStringLength = 23; + const int endBeforeIndex = startIndex + bitStringLength; + // Leading/implicit/hidden bit convention: + // If the number is not subnormal (with exponent 0), we add a leading 1 digit. + float acc = float(!subnormal) * exp2(float(bitStringLength)); + int pow2 = bitStringLength - 1; + for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) { + acc += float(bits[bitIndex]) * exp2(float(pow2--)); + } + return acc; + } + + // Parse the float from its 32 bits. + float bitsToFloat(bool bits[32]) { + float signBit = float(bits[0]) * -2.0 + 1.0; + float exponent = getExponent(bits); + bool subnormal = abs(exponent - 0.0) < 0.01; + float mantissa = getMantissa(bits, subnormal); + float exponentBias = 127.0; + return signBit * mantissa * exp2(exponent - exponentBias - 23.0); + } + + float rgbaToFloat(vec4 texelRGBA, bool littleEndian) { + ivec4 rgbaBytes = floatsToBytes(texelRGBA, littleEndian); + bool bits[32]; + bytesToBits(rgbaBytes, bits); + return bitsToFloat(bits); + } +`;var XZ=` +#if defined(dSizeType_uniform) + uniform float uSize; +#elif defined(dSizeType_attribute) + attribute float aSize; +#elif defined(dSizeType_instance) || defined(dSizeType_group) || defined(dSizeType_groupInstance) + uniform vec2 uSizeTexDim; + uniform sampler2D tSize; +#endif + +uniform float uSizeFactor; +`;var KZ=` +vec4 texture3dFrom1dTrilinear(const in sampler2D tex, const in vec3 pos, const in vec3 gridDim, const in vec2 texDim, const in float offset) { + float gdYZ = gridDim.z * gridDim.y; + float gdZ = gridDim.z; + vec3 p0 = floor(pos * gridDim); + vec3 p1 = ceil(pos * gridDim); + vec3 pd = (pos * gridDim - p0) / (p1 - p0); + vec4 s000 = readFromTexture(tex, offset + p0.z + p0.y * gdZ + p0.x * gdYZ, texDim); + vec4 s100 = readFromTexture(tex, offset + p0.z + p0.y * gdZ + p1.x * gdYZ, texDim); + vec4 s001 = readFromTexture(tex, offset + p1.z + p0.y * gdZ + p0.x * gdYZ, texDim); + vec4 s101 = readFromTexture(tex, offset + p1.z + p0.y * gdZ + p1.x * gdYZ, texDim); + vec4 s010 = readFromTexture(tex, offset + p0.z + p1.y * gdZ + p0.x * gdYZ, texDim); + vec4 s110 = readFromTexture(tex, offset + p0.z + p1.y * gdZ + p1.x * gdYZ, texDim); + vec4 s011 = readFromTexture(tex, offset + p1.z + p1.y * gdZ + p0.x * gdYZ, texDim); + vec4 s111 = readFromTexture(tex, offset + p1.z + p1.y * gdZ + p1.x * gdYZ, texDim); + vec4 s00 = mix(s000, s100, pd.x); + vec4 s01 = mix(s001, s101, pd.x); + vec4 s10 = mix(s010, s110, pd.x); + vec4 s11 = mix(s011, s111, pd.x); + vec4 s0 = mix(s00, s10, pd.y); + vec4 s1 = mix(s01, s11, pd.y); + return mix(s0, s1, pd.z); +} +`;var QZ=` +vec4 texture3dFrom2dLinear(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) { + float zSlice0 = floor(pos.z * gridDim.z); + float column0 = intMod(zSlice0 * gridDim.x, texDim.x) / gridDim.x; + float row0 = floor(intDiv(zSlice0 * gridDim.x, texDim.x)); + vec2 coord0 = (vec2(column0 * gridDim.x, row0 * gridDim.y) + (pos.xy * gridDim.xy)) / texDim; + vec4 color0 = texture2D(tex, coord0); + + float zSlice1 = zSlice0 + 1.0; + float column1 = intMod(zSlice1 * gridDim.x, texDim.x) / gridDim.x; + float row1 = floor(intDiv(zSlice1 * gridDim.x, texDim.x)); + vec2 coord1 = (vec2(column1 * gridDim.x, row1 * gridDim.y) + (pos.xy * gridDim.xy)) / texDim; + vec4 color1 = texture2D(tex, coord1); + + float delta0 = abs((pos.z * gridDim.z) - zSlice0); + return mix(color0, color1, delta0); +} +`;var ZZ=` +vec4 texture3dFrom2dNearest(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) { + float zSlice = floor(pos.z * gridDim.z + 0.5); // round to nearest z-slice + float column = intMod(zSlice * gridDim.x, texDim.x) / gridDim.x; + float row = floor(intDiv(zSlice * gridDim.x, texDim.x)); + vec2 coord = (vec2(column * gridDim.x, row * gridDim.y) + (pos.xy * gridDim.xy)) / texDim; + return texture2D(tex, coord); +} +`;var $Z=` +#if defined(dRenderVariant_colorWboit) + if (uRenderMask == MaskOpaque) { + if (preFogAlpha < 1.0) { + discard; + } + } else if (uRenderMask == MaskTransparent) { + if (preFogAlpha != 1.0 && fragmentDepth < getDepth(gl_FragCoord.xy / uDrawingBufferSize)) { + #ifdef dTransparentBackfaces_off + if (interior) discard; + #endif + float alpha = gl_FragColor.a; + float wboitWeight = alpha * clamp(pow(1.0 - fragmentDepth, 2.0), 0.01, 1.0); + gl_FragColor = vec4(gl_FragColor.rgb * alpha * wboitWeight, alpha); + // extra alpha is to handle pre-multiplied alpha + #ifndef dGeometryType_directVolume + gl_FragData[1] = vec4((uTransparentBackground ? alpha : 1.0) * alpha * wboitWeight); + #else + gl_FragData[1] = vec4(alpha * alpha * wboitWeight); + #endif + } else { + discard; + } + } +#endif +`;var JZ=` +#if defined(dRenderVariant_colorDpoit) + if (uRenderMask == MaskOpaque) { + if (preFogAlpha < 1.0) { + discard; + } + } else if (uRenderMask == MaskTransparent) { + vec2 coords = gl_FragCoord.xy / uDrawingBufferSize; + if (preFogAlpha != 1.0 && fragmentDepth < getDepth(coords)) { + #ifdef dTransparentBackfaces_off + if (interior) discard; + #endif + + // adapted from https://github.com/tsherif/webgl2examples + // The MIT License, Copyright 2017 Tarek Sherif, Shuai Shao + + vec2 lastDepth = texture2D(tDpoitDepth, coords).rg; + vec4 lastFrontColor = texture2D(tDpoitFrontColor, coords); + + vec4 fragColor = gl_FragColor; + + // depth value always increases + // so we can use MAX blend equation + gl_FragData[2].rg = vec2(-MAX_DPOIT_DEPTH); + + // front color always increases + // so we can use MAX blend equation + gl_FragColor = lastFrontColor; + + // back color is separately blend afterwards each pass + gl_FragData[1] = vec4(0.0); + + float nearestDepth = -lastDepth.x; + float furthestDepth = lastDepth.y; + float alphaMultiplier = 1.0 - lastFrontColor.a; + + if (fragmentDepth < nearestDepth || fragmentDepth > furthestDepth) { + // Skip this depth since it's been peeled. + return; + } + + if (fragmentDepth > nearestDepth && fragmentDepth < furthestDepth) { + // This needs to be peeled. + // The ones remaining after MAX blended for + // all need-to-peel will be peeled next pass. + gl_FragData[2].rg = vec2(-fragmentDepth, fragmentDepth); + return; + } + + // write to back and front color buffer + if (fragmentDepth == nearestDepth) { + gl_FragColor.rgb += fragColor.rgb * fragColor.a * alphaMultiplier; + gl_FragColor.a = 1.0 - alphaMultiplier * (1.0 - fragColor.a); + } else { + gl_FragData[1] += fragColor; + } + + } else { + discard; + } + } +#endif +`;var e$=` +precision highp float; +precision highp int; + +#include common +#include read_from_texture +#include common_vert_params +#include color_vert_params +#include size_vert_params +#include common_clip + +uniform float uPixelRatio; +uniform vec4 uViewport; + +attribute vec3 aPosition; +attribute mat4 aTransform; +attribute float aInstance; +attribute float aGroup; + +void main(){ + #include assign_group + #include assign_color_varying + #include assign_marker_varying + #include assign_clipping_varying + #include assign_position + #include assign_size + + #ifdef dPointSizeAttenuation + gl_PointSize = size * uPixelRatio * ((uViewport.w / 2.0) / -mvPosition.z) * 5.0; + #else + gl_PointSize = size * uPixelRatio; + #endif + gl_PointSize = max(1.0, gl_PointSize); + + gl_Position = uProjection * mvPosition; + + #include clip_instance +} +`;var t$=` +precision highp float; +precision highp int; + +#include common +#include common_frag_params +#include color_frag_params +#include common_clip + +const vec2 center = vec2(0.5); +const float radius = 0.5; + +void main(){ + #include fade_lod + #include clip_pixel + + float fragmentDepth = gl_FragCoord.z; + #include assign_material_color + + #if defined(dPointStyle_circle) + float dist = distance(gl_PointCoord, center); + if (dist > radius) discard; + #elif defined(dPointStyle_fuzzy) + float dist = distance(gl_PointCoord, center); + float fuzzyAlpha = 1.0 - smoothstep(0.0, radius, dist); + if (fuzzyAlpha < 0.0001) discard; + #endif + + #if defined(dPointStyle_fuzzy) && defined(dRenderVariant_color) + material.a *= fuzzyAlpha; + #endif + + #include check_transparency + + #if defined(dRenderVariant_pick) + #include check_picking_alpha + #ifdef requiredDrawBuffers + gl_FragColor = vObject; + gl_FragData[1] = vInstance; + gl_FragData[2] = vGroup; + gl_FragData[3] = packDepthToRGBA(fragmentDepth); + #else + gl_FragColor = vColor; + #endif + #elif defined(dRenderVariant_depth) + gl_FragColor = material; + #elif defined(dRenderVariant_marking) + gl_FragColor = material; + #elif defined(dRenderVariant_emissive) + gl_FragColor = material; + #elif defined(dRenderVariant_color) + gl_FragColor = material; + + #include apply_marker_color + #include apply_fog + #include wboit_write + #include dpoit_write + #endif +} +`;var r$=` +precision highp float; +precision highp int; + +#include common +#include read_from_texture +#include common_vert_params +#include color_vert_params +#include size_vert_params +#include common_clip + +uniform mat4 uModelView; +uniform mat4 uInvProjection; +uniform float uIsOrtho; + +uniform vec2 uTexDim; +uniform sampler2D tPositionGroup; + +attribute mat4 aTransform; +attribute float aInstance; + +varying float vRadius; +varying vec3 vPoint; +varying vec3 vPointViewPosition; + +#include matrix_scale + +/** + * Bounding rectangle of a clipped, perspective-projected 3D Sphere. + * Michael Mara, Morgan McGuire. 2013 + * + * Specialization by Arseny Kapoulkine, MIT License Copyright (c) 2018 + * https://github.com/zeux/niagara + */ +void sphereProjection(const in vec3 p, const in float r, const in vec2 mapping) { + vec3 pr = p * r; + float pzr2 = p.z * p.z - r * r; + + float vx = sqrt(p.x * p.x + pzr2); + float minx = ((vx * p.x - pr.z) / (vx * p.z + pr.x)) * uProjection[0][0]; + float maxx = ((vx * p.x + pr.z) / (vx * p.z - pr.x)) * uProjection[0][0]; + + float vy = sqrt(p.y * p.y + pzr2); + float miny = ((vy * p.y - pr.z) / (vy * p.z + pr.y)) * uProjection[1][1]; + float maxy = ((vy * p.y + pr.z) / (vy * p.z - pr.y)) * uProjection[1][1]; + + gl_Position.xy = vec2(maxx + minx, maxy + miny) * -0.5; + gl_Position.xy -= mapping * vec2(maxx - minx, maxy - miny) * 0.5; + gl_Position.xy *= gl_Position.w; +} + +void main(void){ + vec2 mapping = vec2(1.0, 1.0); // vertices 2 and 5 + #if __VERSION__ == 100 + int m = imod(VertexID, 6); + #else + int m = VertexID % 6; + #endif + if (m == 0) { + mapping = vec2(-1.0, 1.0); + } else if (m == 1 || m == 3) { + mapping = vec2(-1.0, -1.0); + } else if (m == 4) { + mapping = vec2(1.0, -1.0); + } + + vec4 positionGroup = readFromTexture(tPositionGroup, VertexID / 6, uTexDim); + vec3 position = positionGroup.rgb; + float group = positionGroup.a; + + #include assign_color_varying + #include assign_marker_varying + #include assign_clipping_varying + #include assign_size + + vRadius = size * matrixScale(uModelView); + + vec4 position4 = vec4(position, 1.0); + vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader + + float d; + if (uLod.w != 0.0 && (uLod.x != 0.0 || uLod.y != 0.0)) { + d = dot(uCameraPlane.xyz, vModelPosition) + uCameraPlane.w; + float f = min( + smoothstep(uLod.x, uLod.x + uLod.z, d), + 1.0 - smoothstep(uLod.y - uLod.z, uLod.y, d) + ) * uLod.w; + vRadius *= f; + } + + vec4 mvPosition = uModelView * aTransform * position4; + + #ifdef dApproximate + vec4 mvCorner = vec4(mvPosition.xyz, 1.0); + mvCorner.xy += mapping * vRadius; + gl_Position = uProjection * mvCorner; + #else + if (uIsOrtho == 1.0) { + vec4 mvCorner = vec4(mvPosition.xyz, 1.0); + mvCorner.xy += mapping * vRadius; + gl_Position = uProjection * mvCorner; + } else { + gl_Position = uProjection * vec4(mvPosition.xyz, 1.0); + sphereProjection(mvPosition.xyz, vRadius, mapping); + } + #endif + + vec4 vPoint4 = uInvProjection * gl_Position; + vPoint = vPoint4.xyz / vPoint4.w; + vPointViewPosition = -mvPosition.xyz / mvPosition.w; + + if (gl_Position.z < -gl_Position.w) { + mvPosition.z -= 2.0 * vRadius; // avoid clipping + gl_Position.z = (uProjection * vec4(mvPosition.xyz, 1.0)).z; + } + + if (uLod.w != 0.0 && (uLod.x != 0.0 || uLod.y != 0.0)) { + if (d < uLod.x || d > uLod.y) { + // move out of [ -w, +w ] to 'discard' in vert shader + gl_Position.z = 2.0 * gl_Position.w; + } + } + + #if defined(dClipPrimitive) && !defined(dClipVariant_instance) && dClipObjectCount != 0 + if (clipTest(vec4(vModelPosition.xyz, 0.0))) { + // move out of [ -w, +w ] to 'discard' in vert shader + gl_Position.z = 2.0 * gl_Position.w; + } + #else + #include clip_instance + #endif +} +`;var n$=` +precision highp float; +precision highp int; + +#define bumpEnabled + +#include common +#include common_frag_params +#include color_frag_params +#include light_frag_params +#include common_clip + +uniform mat4 uInvView; +uniform float uAlphaThickness; + +varying float vRadius; +varying vec3 vPoint; +varying vec3 vPointViewPosition; + +#ifdef dSolidInterior + const bool solidInterior = true; +#else + const bool solidInterior = false; +#endif + +bool SphereImpostor(out vec3 modelPos, out vec3 cameraPos, out vec3 cameraNormal, out bool interior, out float fragmentDepth){ + vec3 cameraSpherePos = -vPointViewPosition; + + vec3 rayOrigin = mix(vec3(0.0, 0.0, 0.0), vPoint, uIsOrtho); + vec3 rayDirection = mix(normalize(vPoint), vec3(0.0, 0.0, 1.0), uIsOrtho); + vec3 cameraSphereDir = mix(cameraSpherePos, rayOrigin - cameraSpherePos, uIsOrtho); + + float B = dot(rayDirection, cameraSphereDir); + float det = B * B + vRadius * vRadius - dot(cameraSphereDir, cameraSphereDir); + + if (det < 0.0) return false; + + float sqrtDet = sqrt(det); + float posT = mix(B + sqrtDet, B - sqrtDet, uIsOrtho); + float negT = mix(B - sqrtDet, B + sqrtDet, uIsOrtho); + + cameraPos = rayDirection * negT + rayOrigin; + modelPos = (uInvView * vec4(cameraPos, 1.0)).xyz; + fragmentDepth = calcDepth(cameraPos); + + bool objectClipped = false; + + #if !defined(dClipPrimitive) && defined(dClipVariant_pixel) && dClipObjectCount != 0 + if (clipTest(vec4(modelPos, 0.0))) { + objectClipped = true; + fragmentDepth = -1.0; + } + #endif + + if (fragmentDepth > 0.0) { + cameraNormal = normalize(cameraPos - cameraSpherePos); + interior = false; + return true; + } else if (uDoubleSided || solidInterior) { + cameraPos = rayDirection * posT + rayOrigin; + modelPos = (uInvView * vec4(cameraPos, 1.0)).xyz; + fragmentDepth = calcDepth(cameraPos); + cameraNormal = -normalize(cameraPos - cameraSpherePos); + interior = true; + if (fragmentDepth > 0.0) { + #ifdef dSolidInterior + if (!objectClipped) { + fragmentDepth = 0.0 + (0.0000001 / vRadius); + cameraNormal = -mix(normalize(vPoint), vec3(0.0, 0.0, 1.0), uIsOrtho); + } + #endif + return true; + } + } + + return false; +} + +void main(void){ + vec3 cameraNormal; + float fragmentDepth; + + #ifdef dApproximate + vec3 pointDir = -vPointViewPosition - vPoint; + if (dot(pointDir, pointDir) > vRadius * vRadius) discard; + vec3 vViewPosition = -vPointViewPosition; + fragmentDepth = gl_FragCoord.z; + #if !defined(dIgnoreLight) || defined(dXrayShaded) + pointDir.z -= cos(length(pointDir) / vRadius); + cameraNormal = -normalize(pointDir / vRadius); + #endif + interior = false; + #else + vec3 modelPos; + vec3 cameraPos; + bool hit = SphereImpostor(modelPos, cameraPos, cameraNormal, interior, fragmentDepth); + if (!hit) discard; + + if (fragmentDepth < 0.0) discard; + if (fragmentDepth > 1.0) discard; + + gl_FragDepthEXT = fragmentDepth; + + vec3 vModelPosition = modelPos; + vec3 vViewPosition = cameraPos; + #endif + + #include fade_lod + #if !defined(dClipPrimitive) && defined(dClipVariant_pixel) && dClipObjectCount != 0 + #include clip_pixel + #endif + #include assign_material_color + + #if defined(dRenderVariant_color) + if (uRenderMask == MaskTransparent && uAlphaThickness > 0.0) { + material.a *= min(1.0, vRadius / uAlphaThickness); + } + #endif + + #include check_transparency + + #if defined(dRenderVariant_pick) + #include check_picking_alpha + #ifdef requiredDrawBuffers + gl_FragColor = vObject; + gl_FragData[1] = vInstance; + gl_FragData[2] = vGroup; + gl_FragData[3] = packDepthToRGBA(fragmentDepth); + #else + gl_FragColor = vColor; + #endif + #elif defined(dRenderVariant_depth) + gl_FragColor = material; + #elif defined(dRenderVariant_marking) + gl_FragColor = material; + #elif defined(dRenderVariant_emissive) + gl_FragColor = material; + #elif defined(dRenderVariant_color) + vec3 normal = -cameraNormal; + #include apply_light_color + + #include apply_interior_color + #include apply_marker_color + #include apply_fog + #include wboit_write + #include dpoit_write + #endif +} +`;var o$=` +precision highp float; +precision highp int; + +#include common +#include read_from_texture +#include common_vert_params +#include color_vert_params +#include size_vert_params +#include common_clip + +uniform mat4 uModelView; + +attribute mat4 aTransform; +attribute float aInstance; +attribute float aGroup; + +attribute vec3 aMapping; +attribute vec3 aStart; +attribute vec3 aEnd; +attribute float aScale; +attribute float aCap; +attribute float aColorMode; + +varying mat4 vTransform; +varying vec3 vStart; +varying vec3 vEnd; +varying float vSize; +varying float vCap; + +uniform float uIsOrtho; +uniform vec3 uCameraDir; + +void main() { + #include assign_group + #include assign_color_varying + #include assign_marker_varying + #include assign_clipping_varying + #include assign_size + + mat4 modelTransform = uModel * aTransform; + + vTransform = aTransform; + vStart = (modelTransform * vec4(aStart, 1.0)).xyz; + vEnd = (modelTransform * vec4(aEnd, 1.0)).xyz; + vSize = size * aScale; + vCap = aCap; + + vModelPosition = (vStart + vEnd) * 0.5; + vec3 camDir = -mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho); + vec3 dir = vEnd - vStart; + float f = aMapping.x > 0.0 ? 1.0 : 0.0; + // ensure cylinder 'dir' is pointing towards the camera + if(dot(camDir, dir) < 0.0) { + dir = -dir; + f = 1.0 - f; + } + + vec3 left = cross(camDir, dir); + vec3 up = cross(left, dir); + left = vSize * normalize(left); + up = vSize * normalize(up); + + // move vertex in object-space from center to corner + vModelPosition += aMapping.x * dir + aMapping.y * left + aMapping.z * up; + + vec4 mvPosition = uView * vec4(vModelPosition, 1.0); + vViewPosition = mvPosition.xyz; + gl_Position = uProjection * mvPosition; + + if (gl_Position.z < -gl_Position.w) { + mvPosition.z -= 2.0 * (length(vEnd - vStart) + vSize); // avoid clipping + gl_Position.z = (uProjection * mvPosition).z; + } + + #if defined(dDualColor) && defined(dRenderVariant_color) && (defined(dColorType_group) || defined(dColorType_groupInstance)) + // dual-color mixing + // - for aColorMode between 0 and 1 use aColorMode to interpolate + // - for aColorMode == 2 do nothing, i.e., use vColor + // - for aColorMode == 3 use position on cylinder axis to interpolate + if (aColorMode <= 1.0){ + vColor.rgb = mix(vColor.rgb, color2.rgb, aColorMode); + } else if (aColorMode == 3.0) { + vColor.rgb = mix(vColor.rgb, color2.rgb, mix(-0.25, 1.25, f / 1.5)); + } + #endif + + #include clip_instance +} +`;var i$=` +precision highp float; +precision highp int; + +#define bumpEnabled + +uniform mat4 uView; + +varying mat4 vTransform; +varying vec3 vStart; +varying vec3 vEnd; +varying float vSize; +varying float vCap; + +uniform vec3 uCameraDir; +uniform vec3 uCameraPosition; +uniform mat4 uInvView; + +#include common +#include common_frag_params +#include color_frag_params +#include light_frag_params +#include common_clip + +#ifdef dSolidInterior + const bool solidInterior = true; +#else + const bool solidInterior = false; +#endif + +// adapted from https://www.shadertoy.com/view/4lcSRn +// The MIT License, Copyright 2016 Inigo Quilez +bool CylinderImpostor( + in vec3 rayOrigin, in vec3 rayDir, + in vec3 start, in vec3 end, in float radius, + out vec3 cameraNormal, out bool interior, + out vec3 modelPosition, out vec3 viewPosition, out float fragmentDepth +){ + vec3 ba = end - start; + vec3 oc = rayOrigin - start; + + float baba = dot(ba, ba); + float bard = dot(ba, rayDir); + float baoc = dot(ba, oc); + + float k2 = baba - bard * bard; + float k1 = baba * dot(oc, rayDir) - baoc * bard; + float k0 = baba * dot(oc, oc) - baoc * baoc - radius * radius * baba; + + float h = k1 * k1 - k2 * k0; + if (h < 0.0) return false; + + bool topCap = (vCap > 0.9 && vCap < 1.1) || vCap >= 2.9; + bool bottomCap = (vCap > 1.9 && vCap < 2.1) || vCap >= 2.9; + + #ifdef dSolidInterior + bool topInterior = !topCap; + bool bottomInterior = !bottomCap; + topCap = true; + bottomCap = true; + #else + bool topInterior = false; + bool bottomInterior = false; + #endif + + bool clipped = false; + bool objectClipped = false; + + // body outside + h = sqrt(h); + float t = (-k1 - h) / k2; + float y = baoc + t * bard; + if (y > 0.0 && y < baba) { + interior = false; + cameraNormal = (oc + t * rayDir - ba * y / baba) / radius; + modelPosition = rayOrigin + t * rayDir; + viewPosition = (uView * vec4(modelPosition, 1.0)).xyz; + fragmentDepth = calcDepth(viewPosition); + #if defined(dClipVariant_pixel) && dClipObjectCount != 0 + if (clipTest(vec4(modelPosition, 0.0))) { + objectClipped = true; + fragmentDepth = -1.0; + #ifdef dSolidInterior + topCap = !topInterior; + bottomCap = !bottomInterior; + #endif + } + #endif + if (fragmentDepth > 0.0) return true; + clipped = true; + } + + if (!clipped) { + if (topCap && y < 0.0) { + // top cap + t = -baoc / bard; + if (abs(k1 + k2 * t) < h) { + interior = topInterior; + cameraNormal = -ba / baba; + modelPosition = rayOrigin + t * rayDir; + viewPosition = (uView * vec4(modelPosition, 1.0)).xyz; + fragmentDepth = calcDepth(viewPosition); + #if defined(dClipVariant_pixel) && dClipObjectCount != 0 + if (clipTest(vec4(modelPosition, 0.0))) { + objectClipped = true; + fragmentDepth = -1.0; + #ifdef dSolidInterior + topCap = !topInterior; + bottomCap = !bottomInterior; + #endif + } + #endif + if (fragmentDepth > 0.0) { + #ifdef dSolidInterior + if (interior) cameraNormal = -rayDir; + #endif + return true; + } + } + } else if (bottomCap && y >= 0.0) { + // bottom cap + t = (baba - baoc) / bard; + if (abs(k1 + k2 * t) < h) { + interior = bottomInterior; + cameraNormal = ba / baba; + modelPosition = rayOrigin + t * rayDir; + viewPosition = (uView * vec4(modelPosition, 1.0)).xyz; + fragmentDepth = calcDepth(viewPosition); + #if defined(dClipVariant_pixel) && dClipObjectCount != 0 + if (clipTest(vec4(modelPosition, 0.0))) { + objectClipped = true; + fragmentDepth = -1.0; + #ifdef dSolidInterior + topCap = !topInterior; + bottomCap = !bottomInterior; + #endif + } + #endif + if (fragmentDepth > 0.0) { + #ifdef dSolidInterior + if (interior) cameraNormal = -rayDir; + #endif + return true; + } + } + } + } + + if (uDoubleSided || solidInterior) { + // body inside + h = -h; + t = (-k1 - h) / k2; + y = baoc + t * bard; + if (y > 0.0 && y < baba) { + interior = true; + cameraNormal = -(oc + t * rayDir - ba * y / baba) / radius; + modelPosition = rayOrigin + t * rayDir; + viewPosition = (uView * vec4(modelPosition, 1.0)).xyz; + fragmentDepth = calcDepth(viewPosition); + if (fragmentDepth > 0.0) { + #ifdef dSolidInterior + if (!objectClipped) { + fragmentDepth = 0.0 + (0.0000002 / vSize); + cameraNormal = -rayDir; + } + #endif + return true; + } + } + + if (topCap && y < 0.0) { + // top cap + t = -baoc / bard; + if (abs(k1 + k2 * t) < -h) { + interior = true; + cameraNormal = ba / baba; + modelPosition = rayOrigin + t * rayDir; + viewPosition = (uView * vec4(modelPosition, 1.0)).xyz; + fragmentDepth = calcDepth(viewPosition); + if (fragmentDepth > 0.0) { + #ifdef dSolidInterior + if (!objectClipped) { + fragmentDepth = 0.0 + (0.0000002 / vSize); + cameraNormal = -rayDir; + } + #endif + return true; + } + } + } else if (bottomCap && y >= 0.0) { + // bottom cap + t = (baba - baoc) / bard; + if (abs(k1 + k2 * t) < -h) { + interior = true; + cameraNormal = -ba / baba; + modelPosition = rayOrigin + t * rayDir; + viewPosition = (uView * vec4(modelPosition, 1.0)).xyz; + fragmentDepth = calcDepth(viewPosition); + if (fragmentDepth > 0.0) { + #ifdef dSolidInterior + if (!objectClipped) { + fragmentDepth = 0.0 + (0.0000002 / vSize); + cameraNormal = -rayDir; + } + #endif + return true; + } + } + } + } + + return false; +} + +void main() { + vec3 rayOrigin = vModelPosition; + vec3 rayDir = mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho); + + vec3 cameraNormal; + vec3 modelPosition; + vec3 viewPosition; + float fragmentDepth; + bool hit = CylinderImpostor(rayOrigin, rayDir, vStart, vEnd, vSize, cameraNormal, interior, modelPosition, viewPosition, fragmentDepth); + if (!hit) discard; + + if (fragmentDepth < 0.0) discard; + if (fragmentDepth > 1.0) discard; + + gl_FragDepthEXT = fragmentDepth; + + vec3 vViewPosition = viewPosition; + vec3 vModelPosition = modelPosition; + + #include fade_lod + #include clip_pixel + #include assign_material_color + #include check_transparency + + #if defined(dRenderVariant_pick) + #include check_picking_alpha + #ifdef requiredDrawBuffers + gl_FragColor = vObject; + gl_FragData[1] = vInstance; + gl_FragData[2] = vGroup; + gl_FragData[3] = packDepthToRGBA(fragmentDepth); + #else + gl_FragColor = vColor; + #endif + #elif defined(dRenderVariant_depth) + gl_FragColor = material; + #elif defined(dRenderVariant_marking) + gl_FragColor = material; + #elif defined(dRenderVariant_emissive) + gl_FragColor = material; + #elif defined(dRenderVariant_color) + mat3 normalMatrix = transpose3(inverse3(mat3(uView))); + vec3 normal = normalize(normalMatrix * -normalize(cameraNormal)); + #include apply_light_color + + #include apply_interior_color + #include apply_marker_color + #include apply_fog + #include wboit_write + #include dpoit_write + #endif +} +`;var s$=` +precision highp float; +precision highp int; + +#include common +#include read_from_texture +#include common_vert_params +#include color_vert_params +#include size_vert_params +#include common_clip + +uniform mat4 uModelView; + +attribute vec3 aPosition; +attribute vec2 aMapping; +attribute float aDepth; +attribute vec2 aTexCoord; +attribute mat4 aTransform; +attribute float aInstance; +attribute float aGroup; + +uniform float uOffsetX; +uniform float uOffsetY; +uniform float uOffsetZ; + +uniform float uIsOrtho; +uniform float uPixelRatio; +uniform vec4 uViewport; + +varying vec2 vTexCoord; + +#include matrix_scale + +void main(void){ + #include assign_group + #include assign_color_varying + #include assign_marker_varying + #include assign_clipping_varying + #include assign_size + + vTexCoord = aTexCoord; + + float scale = matrixScale(uModelView); + + float offsetX = uOffsetX * scale; + float offsetY = uOffsetY * scale; + float offsetZ = (uOffsetZ + aDepth * 0.95) * scale; + + vec4 position4 = vec4(aPosition, 1.0); + vec4 mvPosition = uModelView * aTransform * position4; + + vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader + + // TODO + // #ifdef FIXED_SIZE + // if (ortho) { + // scale /= pixelRatio * ((uViewport.w / 2.0) / -uCameraPosition.z) * 0.1; + // } else { + // scale /= pixelRatio * ((uViewport.w / 2.0) / -mvPosition.z) * 0.1; + // } + // #endif + + vec4 mvCorner = vec4(mvPosition.xyz, 1.0); + + if (vTexCoord.x == 10.0) { // indicates background plane + // move a bit to the back, taking distance to camera into account to avoid z-fighting + offsetZ -= 0.001 * distance(uCameraPosition, (uProjection * mvCorner).xyz); + } + + mvCorner.xy += aMapping * size * scale; + mvCorner.x += offsetX; + mvCorner.y += offsetY; + + if (uIsOrtho == 1.0) { + mvCorner.z += offsetZ; + } else { + mvCorner.xyz += normalize(-mvCorner.xyz) * offsetZ; + } + + gl_Position = uProjection * mvCorner; + + vViewPosition = -mvCorner.xyz; + + #include clip_instance +} +`;var a$=` +precision highp float; +precision highp int; + +#include common +#include common_frag_params +#include color_frag_params +#include common_clip + +uniform sampler2D tFont; + +uniform vec3 uBorderColor; +uniform float uBorderWidth; +uniform vec3 uBackgroundColor; +uniform float uBackgroundOpacity; + +varying vec2 vTexCoord; + +const float smoothness = 32.0; +const float gamma = 2.2; + +void main2(){ + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); +} + +void main(){ + #include fade_lod + #include clip_pixel + + float fragmentDepth = gl_FragCoord.z; + #include assign_material_color + + if (vTexCoord.x > 1.0) { + #if defined(dRenderVariant_color) + material = vec4(uBackgroundColor, uBackgroundOpacity * material.a); + #endif + } else { + // retrieve signed distance + float sdf = texture2D(tFont, vTexCoord).a + uBorderWidth; + + // perform adaptive anti-aliasing of the edges + float w = clamp(smoothness * (abs(dFdx(vTexCoord.x)) + abs(dFdy(vTexCoord.y))), 0.0, 0.5); + float a = clamp(0.0, 1.0, smoothstep(0.5 - w, 0.5 + w, sdf)); + + // gamma correction for linear attenuation + a = pow(a, 1.0 / gamma); + + if (a < 0.5) discard; + + #if defined(dRenderVariant_color) + // add border + float t = 0.5 + uBorderWidth; + if (uBorderWidth > 0.0 && sdf < t) { + material.xyz = mix(uBorderColor, material.xyz, smoothstep(t - w, t, sdf)); + } + #endif + } + + #include check_transparency + + #if defined(dRenderVariant_pick) + #include check_picking_alpha + #ifdef requiredDrawBuffers + gl_FragColor = vObject; + gl_FragData[1] = vInstance; + gl_FragData[2] = vGroup; + gl_FragData[3] = packDepthToRGBA(fragmentDepth); + #else + gl_FragColor = vColor; + #endif + #elif defined(dRenderVariant_depth) + gl_FragColor = material; + #elif defined(dRenderVariant_marking) + gl_FragColor = material; + #elif defined(dRenderVariant_emissive) + gl_FragColor = material; + #elif defined(dRenderVariant_color) + gl_FragColor = material; + + #include apply_marker_color + #include apply_fog + #include wboit_write + #include dpoit_write + #endif +} +`;var l$=` +precision highp float; +precision highp int; + +#include common +#include read_from_texture +#include common_vert_params +#include color_vert_params +#include size_vert_params +#include common_clip + +uniform float uPixelRatio; +uniform vec4 uViewport; + +attribute mat4 aTransform; +attribute float aInstance; +attribute float aGroup; + +attribute vec2 aMapping; +attribute vec3 aStart; +attribute vec3 aEnd; + +void trimSegment(const in vec4 start, inout vec4 end) { + // trim end segment so it terminates between the camera plane and the near plane + // conservative estimate of the near plane + float a = uProjection[2][2]; // 3rd entry in 3rd column + float b = uProjection[3][2]; // 3rd entry in 4th column + float nearEstimate = -0.5 * b / a; + float alpha = (nearEstimate - start.z) / (end.z - start.z); + end.xyz = mix(start.xyz, end.xyz, alpha); +} + +void main(){ + float aspect = uViewport.z / uViewport.w; + + #include assign_group + #include assign_color_varying + #include assign_marker_varying + #include assign_clipping_varying + #include assign_size + + mat4 modelView = uView * uModel * aTransform; + + // camera space + vec4 start = modelView * vec4(aStart, 1.0); + vec4 end = modelView * vec4(aEnd, 1.0); + + // assign position + vec4 position4 = vec4((aMapping.y < 0.5) ? aStart : aEnd, 1.0); + vec4 mvPosition = modelView * position4; + vViewPosition = mvPosition.xyz; + + vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader + + // special case for perspective projection, and segments that terminate either in, or behind, the camera plane + // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space + // but we need to perform ndc-space calculations in the shader, so we must address this issue directly + // perhaps there is a more elegant solution -- WestLangley + bool perspective = (uProjection[2][3] == -1.0); // 4th entry in the 3rd column + if (perspective) { + if (start.z < 0.0 && end.z >= 0.0) { + trimSegment(start, end); + } else if (end.z < 0.0 && start.z >= 0.0) { + trimSegment(end, start); + } + } + + // clip space + vec4 clipStart = uProjection * start; + vec4 clipEnd = uProjection * end; + + // ndc space + vec2 ndcStart = clipStart.xy / clipStart.w; + vec2 ndcEnd = clipEnd.xy / clipEnd.w; + + // direction + vec2 dir = ndcEnd - ndcStart; + + // account for clip-space aspect ratio + dir.x *= aspect; + dir = normalize(dir); + + // perpendicular to dir + vec2 offset = vec2(dir.y, - dir.x); + + // undo aspect ratio adjustment + dir.x /= aspect; + offset.x /= aspect; + + // sign flip + if (aMapping.x < 0.0) offset *= -1.0; + + // calculate linewidth + float linewidth; + #ifdef dLineSizeAttenuation + linewidth = size * uPixelRatio * ((uViewport.w / 2.0) / -start.z) * 5.0; + #else + linewidth = size * uPixelRatio; + #endif + linewidth = max(1.0, linewidth); + + // adjust for linewidth + offset *= linewidth; + + // adjust for clip-space to screen-space conversion + offset /= uViewport.w; + + // select end + vec4 clip = (aMapping.y < 0.5) ? clipStart : clipEnd; + + // back to clip space + offset *= clip.w; + clip.xy += offset; + gl_Position = clip; + + #include clip_instance +} +`;var c$=` +precision highp float; +precision highp int; + +#include common +#include common_frag_params +#include color_frag_params +#include common_clip + +void main(){ + #include fade_lod + #include clip_pixel + + float fragmentDepth = gl_FragCoord.z; + #include assign_material_color + #include check_transparency + + #if defined(dRenderVariant_pick) + #include check_picking_alpha + #ifdef requiredDrawBuffers + gl_FragColor = vObject; + gl_FragData[1] = vInstance; + gl_FragData[2] = vGroup; + gl_FragData[3] = packDepthToRGBA(fragmentDepth); + #else + gl_FragColor = vColor; + #endif + #elif defined(dRenderVariant_depth) + gl_FragColor = material; + #elif defined(dRenderVariant_marking) + gl_FragColor = material; + #elif defined(dRenderVariant_emissive) + gl_FragColor = material; + #elif defined(dRenderVariant_color) + gl_FragColor = material; + + #include apply_marker_color + #include apply_fog + #include wboit_write + #include dpoit_write + #endif +} +`;var u$=` +precision highp float; +precision highp int; +precision highp sampler2D; + +#include common +#include read_from_texture +#include common_vert_params +#include color_vert_params +#include common_clip +#include texture3d_from_2d_linear + +#ifdef dGeometryType_textureMesh + uniform vec2 uGeoTexDim; + uniform sampler2D tPosition; + uniform sampler2D tGroup; + uniform sampler2D tNormal; +#else + attribute vec3 aPosition; + attribute float aGroup; + attribute vec3 aNormal; +#endif +attribute mat4 aTransform; +attribute float aInstance; + +varying vec3 vNormal; + +void main(){ + #include assign_group + #include assign_marker_varying + #include assign_clipping_varying + #include assign_position + #include assign_color_varying + #include clip_instance + + #ifdef dGeometryType_textureMesh + vec3 normal = readFromTexture(tNormal, VertexID, uGeoTexDim).xyz; + #else + vec3 normal = aNormal; + #endif + mat3 normalMatrix = transpose3(inverse3(mat3(modelView))); + vec3 transformedNormal = normalize(normalMatrix * normalize(normal)); + #if defined(dFlipSided) + if (!uDoubleSided) { // TODO checking uDoubleSided should not be required, ASR + transformedNormal = -transformedNormal; + } + #endif + vNormal = transformedNormal; +} +`;var d$=` +precision highp float; +precision highp int; + +#define bumpEnabled + +#include common +#include common_frag_params +#include color_frag_params +#include light_frag_params +#include normal_frag_params +#include common_clip + +void main() { + #include fade_lod + #include clip_pixel + + // Workaround for buggy gl_FrontFacing (e.g. on some integrated Intel GPUs) + vec3 fdx = dFdx(vViewPosition); + vec3 fdy = dFdy(vViewPosition); + vec3 faceNormal = normalize(cross(fdx,fdy)); + bool frontFacing = dot(vNormal, faceNormal) > 0.0; + + #if defined(dFlipSided) + interior = frontFacing; + #else + interior = !frontFacing; + #endif + + float fragmentDepth = gl_FragCoord.z; + #include assign_material_color + #include check_transparency + + #if defined(dRenderVariant_pick) + #include check_picking_alpha + #ifdef requiredDrawBuffers + gl_FragColor = vObject; + gl_FragData[1] = vInstance; + gl_FragData[2] = vGroup; + gl_FragData[3] = packDepthToRGBA(fragmentDepth); + #else + gl_FragColor = vColor; + #endif + #elif defined(dRenderVariant_depth) + gl_FragColor = material; + #elif defined(dRenderVariant_marking) + gl_FragColor = material; + #elif defined(dRenderVariant_emissive) + gl_FragColor = material; + #elif defined(dRenderVariant_color) + #if defined(dFlatShaded) + vec3 normal = -faceNormal; + #else + vec3 normal = -normalize(vNormal); + if (uDoubleSided) normal *= float(frontFacing) * 2.0 - 1.0; + #endif + #include apply_light_color + + #include apply_interior_color + #include apply_marker_color + #include apply_fog + #include wboit_write + #include dpoit_write + #endif +} +`;var m$=` +precision highp float; + +attribute vec3 aPosition; +attribute mat4 aTransform; +attribute float aInstance; + +uniform mat4 uModelView; +uniform mat4 uProjection; +uniform vec4 uInvariantBoundingSphere; + +varying vec3 vOrigPos; +varying float vInstance; +varying vec4 vBoundingSphere; +varying mat4 vTransform; + +uniform vec3 uBboxSize; +uniform vec3 uBboxMin; +uniform vec3 uBboxMax; +uniform vec3 uGridDim; +uniform mat4 uTransform; + +uniform mat4 uUnitToCartn; + +void main() { + vec4 unitCoord = vec4(aPosition + vec3(0.5), 1.0); + vec4 mvPosition = uModelView * aTransform * uUnitToCartn * unitCoord; + + vOrigPos = (aTransform * uUnitToCartn * unitCoord).xyz; + vInstance = aInstance; + vBoundingSphere = vec4( + (aTransform * vec4(uInvariantBoundingSphere.xyz, 1.0)).xyz, + uInvariantBoundingSphere.w + ); + vTransform = aTransform; + + gl_Position = uProjection * mvPosition; + + // move z position to near clip plane (but not too close to get precision issues) + gl_Position.z = gl_Position.w - 0.01; +} +`;var p$=` +precision highp float; +precision highp int; + +#include common +#include light_frag_params + +#if dClipObjectCount != 0 + uniform int uClipObjectType[dClipObjectCount]; + uniform bool uClipObjectInvert[dClipObjectCount]; + uniform vec3 uClipObjectPosition[dClipObjectCount]; + uniform vec4 uClipObjectRotation[dClipObjectCount]; + uniform vec3 uClipObjectScale[dClipObjectCount]; +#endif +#include common_clip + +#include read_from_texture +#include texture3d_from_1d_trilinear +#include texture3d_from_2d_nearest +#include texture3d_from_2d_linear + +uniform mat4 uProjection, uTransform, uModelView, uModel, uView; +uniform vec3 uCameraDir; + +uniform sampler2D tDepth; +uniform vec2 uDrawingBufferSize; + +varying vec3 vOrigPos; +varying float vInstance; +varying vec4 vBoundingSphere; +varying mat4 vTransform; + +uniform mat4 uInvView; +uniform vec3 uGridDim; +uniform vec3 uBboxSize; +uniform sampler2D tTransferTex; +uniform float uTransferScale; +uniform float uStepScale; +uniform float uJumpLength; + +uniform int uObjectId; +uniform int uVertexCount; +uniform int uInstanceCount; +uniform int uGroupCount; + +#if defined(dColorMarker) + uniform vec3 uHighlightColor; + uniform vec3 uSelectColor; + uniform vec3 uDimColor; + uniform float uHighlightStrength; + uniform float uSelectStrength; + uniform float uDimStrength; + uniform int uMarkerPriority; + uniform float uMarkerAverage; + + uniform float uMarker; + uniform vec2 uMarkerTexDim; + uniform sampler2D tMarker; +#endif + +uniform float uMetalness; +uniform float uRoughness; +uniform float uEmissive; + +uniform bool uFog; +uniform float uFogNear; +uniform float uFogFar; +uniform vec3 uFogColor; + +uniform float uAlpha; +uniform bool uTransparentBackground; +uniform float uXrayEdgeFalloff; +uniform float uExposure; + +uniform int uRenderMask; + +uniform float uNear; +uniform float uFar; +uniform float uIsOrtho; + +uniform vec3 uCellDim; +uniform vec3 uCameraPosition; +uniform mat4 uCartnToUnit; + +#if __VERSION__ != 100 + // for webgl1 this is given as a 'define' + uniform int uMaxSteps; +#endif + +#if defined(dGridTexType_2d) + precision highp sampler2D; + uniform sampler2D tGridTex; + uniform vec3 uGridTexDim; +#elif defined(dGridTexType_3d) + precision highp sampler3D; + uniform sampler3D tGridTex; +#endif + +#if defined(dColorType_uniform) + uniform vec3 uColor; +#elif defined(dColorType_texture) + uniform vec2 uColorTexDim; + uniform sampler2D tColor; +#endif + +#ifdef dOverpaint + #if defined(dOverpaintType_groupInstance) || defined(dOverpaintType_vertexInstance) + uniform vec2 uOverpaintTexDim; + uniform sampler2D tOverpaint; + #endif +#endif + +#ifdef dUsePalette + uniform sampler2D tPalette; +#endif + +#if defined(dGridTexType_2d) + vec4 textureVal(vec3 pos) { + return texture3dFrom2dLinear(tGridTex, pos + (vec3(0.5, 0.5, 0.0) / uGridDim), uGridDim, uGridTexDim.xy); + } + vec4 textureGroup(vec3 pos) { + return texture3dFrom2dNearest(tGridTex, pos + (vec3(0.5, 0.5, 0.0) / uGridDim), uGridDim, uGridTexDim.xy); + } +#elif defined(dGridTexType_3d) + vec4 textureVal(vec3 pos) { + return texture(tGridTex, pos + (vec3(0.5) / uGridDim)); + } + vec4 textureGroup(vec3 pos) { + return texelFetch(tGridTex, ivec3(pos * uGridDim), 0); + } +#endif + +float calcDepth(const in vec3 pos) { + vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw; + return 0.5 + 0.5 * clipZW.x / clipZW.y; +} + +float transferFunction(float value) { + return texture2D(tTransferTex, vec2(value, 0.0)).a; +} + +float getDepth(const in vec2 coords) { + #ifdef depthTextureSupport + return texture2D(tDepth, coords).r; + #else + return unpackRGBAToDepth(texture2D(tDepth, coords)); + #endif +} + +const float gradOffset = 0.5; + +vec3 v3m4(vec3 p, mat4 m) { + return (m * vec4(p, 1.0)).xyz; +} + +float preFogAlphaBlended = 0.0; + +vec4 raymarch(vec3 startLoc, vec3 step, vec3 rayDir) { + mat3 normalMatrix = transpose3(inverse3(mat3(uModelView * vTransform))); + mat4 cartnToUnit = uCartnToUnit * inverse4(vTransform); + #if defined(dClipVariant_pixel) && dClipObjectCount != 0 + mat4 modelTransform = uModel * vTransform * uTransform; + #endif + mat4 modelViewTransform = uModelView * vTransform * uTransform; + + vec3 scaleVol = vec3(1.0) / uGridDim; + vec3 pos = startLoc; + vec4 cell; + float prevValue = -1.0; + float value = 0.0; + vec4 src = vec4(0.0); + vec4 dst = vec4(0.0); + float fragmentDepth; + + vec3 posMin = vec3(0.0); + vec3 posMax = vec3(1.0) - vec3(1.0) / uGridDim; + + vec3 unitPos; + + vec3 nextPos; + float nextValue; + + vec4 material; + vec4 overpaint; + float metalness = uMetalness; + float roughness = uRoughness; + float emissive = uEmissive; + + vec3 gradient = vec3(1.0); + vec3 dx = vec3(gradOffset * scaleVol.x, 0.0, 0.0); + vec3 dy = vec3(0.0, gradOffset * scaleVol.y, 0.0); + vec3 dz = vec3(0.0, 0.0, gradOffset * scaleVol.z); + + float maxDist = min(vBoundingSphere.w * 2.0, uFar - uNear); + float maxDistSq = maxDist * maxDist; + + for (int i = 0; i < uMaxSteps; ++i) { + // break when beyond bounding-sphere or far-plane + vec3 distVec = startLoc - pos; + if (dot(distVec, distVec) > maxDistSq) break; + + unitPos = v3m4(pos, cartnToUnit); + + // continue when outside of grid + if (unitPos.x > posMax.x || unitPos.y > posMax.y || unitPos.z > posMax.z || + unitPos.x < posMin.x || unitPos.y < posMin.y || unitPos.z < posMin.z + ) { + prevValue = value; + pos += step; + continue; + } + + cell = textureVal(unitPos); + value = cell.a; // current voxel value + + if (uJumpLength > 0.0 && value < 0.01) { + nextPos = pos + rayDir * uJumpLength; + nextValue = textureVal(v3m4(nextPos, cartnToUnit)).a; + if (nextValue < 0.01) { + prevValue = nextValue; + pos = nextPos; + continue; + } + } + + vec4 mvPosition = modelViewTransform * vec4(unitPos * uGridDim, 1.0); + if (calcDepth(mvPosition.xyz) > getDepth(gl_FragCoord.xy / uDrawingBufferSize)) + break; + + #if defined(dClipVariant_pixel) && dClipObjectCount != 0 + vec3 vModelPosition = v3m4(unitPos * uGridDim, modelTransform); + if (clipTest(vec4(vModelPosition, 0.0))) { + prevValue = value; + pos += step; + continue; + } + #endif + + vec3 vViewPosition = mvPosition.xyz; + material.a = transferFunction(value); + + #ifdef dPackedGroup + float group = unpackRGBToInt(textureGroup(floor(unitPos * uGridDim + 0.5) / uGridDim).rgb); + #else + vec3 g = floor(unitPos * uGridDim + 0.5); + // note that we swap x and z because the texture is flipped around y + #if defined(dAxisOrder_012) + float group = g.z + g.y * uGridDim.z + g.x * uGridDim.z * uGridDim.y; // 210 + #elif defined(dAxisOrder_021) + float group = g.y + g.z * uGridDim.y + g.x * uGridDim.y * uGridDim.z; // 120 + #elif defined(dAxisOrder_102) + float group = g.z + g.x * uGridDim.z + g.y * uGridDim.z * uGridDim.x; // 201 + #elif defined(dAxisOrder_120) + float group = g.x + g.z * uGridDim.x + g.y * uGridDim.x * uGridDim.z; // 021 + #elif defined(dAxisOrder_201) + float group = g.y + g.x * uGridDim.y + g.z * uGridDim.y * uGridDim.x; // 102 + #elif defined(dAxisOrder_210) + float group = g.x + g.y * uGridDim.x + g.z * uGridDim.x * uGridDim.y; // 012 + #endif + #endif + + #if defined(dColorType_direct) && defined(dUsePalette) + material.rgb = texture2D(tPalette, vec2(value, 0.0)).rgb; + #elif defined(dColorType_uniform) + material.rgb = uColor; + #elif defined(dColorType_instance) + material.rgb = readFromTexture(tColor, vInstance, uColorTexDim).rgb; + #elif defined(dColorType_group) + material.rgb = readFromTexture(tColor, group, uColorTexDim).rgb; + #elif defined(dColorType_groupInstance) + material.rgb = readFromTexture(tColor, vInstance * float(uGroupCount) + group, uColorTexDim).rgb; + #elif defined(dColorType_vertex) + material.rgb = texture3dFrom1dTrilinear(tColor, unitPos, uGridDim, uColorTexDim, 0.0).rgb; + #elif defined(dColorType_vertexInstance) + material.rgb = texture3dFrom1dTrilinear(tColor, unitPos, uGridDim, uColorTexDim, vInstance * float(uVertexCount)).rgb; + #endif + + #ifdef dOverpaint + #if defined(dOverpaintType_groupInstance) + overpaint = readFromTexture(tOverpaint, vInstance * float(uGroupCount) + group, uOverpaintTexDim); + #elif defined(dOverpaintType_vertexInstance) + overpaint = texture3dFrom1dTrilinear(tOverpaint, unitPos, uGridDim, uOverpaintTexDim, vInstance * float(uVertexCount)); + #endif + + material.rgb = mix(material.rgb, overpaint.rgb, overpaint.a); + #endif + + #if defined(dIgnoreLight) + gl_FragColor.rgb = material.rgb; + #else + if (material.a >= 0.01) { + #ifdef dPackedGroup + // compute gradient by central differences + gradient.x = textureVal(unitPos - dx).a - textureVal(unitPos + dx).a; + gradient.y = textureVal(unitPos - dy).a - textureVal(unitPos + dy).a; + gradient.z = textureVal(unitPos - dz).a - textureVal(unitPos + dz).a; + #else + gradient = cell.xyz * 2.0 - 1.0; + #endif + vec3 normal = -normalize(normalMatrix * normalize(gradient)); + #include apply_light_color + } else { + gl_FragColor.rgb = material.rgb; + } + #endif + + gl_FragColor.a = material.a * uAlpha * uTransferScale; + + #if defined(dColorMarker) + float marker = uMarker; + if (uMarker == -1.0) { + marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a; + marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win + } + #endif + #include apply_marker_color + + preFogAlphaBlended = (1.0 - preFogAlphaBlended) * gl_FragColor.a + preFogAlphaBlended; + fragmentDepth = calcDepth(mvPosition.xyz); + #include apply_fog + + src = gl_FragColor; + + if (!uTransparentBackground) { + // done in 'apply_fog' otherwise + src.rgb *= src.a; + } + dst = (1.0 - dst.a) * src + dst; // standard blending + + // break if the color is opaque enough + if (dst.a > 0.95) + break; + + pos += step; + } + + return dst; +} + +// TODO: support float texture for higher precision values??? +// TODO: support clipping exclusion texture support + +void main() { + #if defined(dRenderVariant_emissive) + discard; + #else + if (gl_FrontFacing) + discard; + + vec3 rayDir = mix(normalize(vOrigPos - uCameraPosition), uCameraDir, uIsOrtho); + vec3 step = rayDir * uStepScale; + + float boundingSphereNear = distance(vBoundingSphere.xyz, uCameraPosition) - vBoundingSphere.w; + float d = max(uNear, boundingSphereNear) - mix(0.0, distance(vOrigPos, uCameraPosition), uIsOrtho); + vec3 start = mix(uCameraPosition, vOrigPos, uIsOrtho) + (d * rayDir); + gl_FragColor = raymarch(start, step, rayDir); + + float fragmentDepth = calcDepth((uModelView * vec4(start, 1.0)).xyz); + float preFogAlpha = clamp(preFogAlphaBlended, 0.0, 1.0); + #include wboit_write + #endif +} +`;var f$=` +precision highp float; +precision highp int; + +#include common +#include common_vert_params + +attribute vec3 aPosition; +attribute vec2 aUv; +attribute mat4 aTransform; +attribute float aInstance; + +varying vec2 vUv; +varying float vInstance; + +void main() { + #include assign_position + + vUv = aUv; + vInstance = aInstance; +} +`;var h$=` +precision highp float; +precision highp int; + +#include common +#include read_from_texture +#include common_frag_params +#include common_clip + +uniform vec2 uImageTexDim; +uniform sampler2D tImageTex; +uniform sampler2D tGroupTex; + +uniform vec2 uMarkerTexDim; +uniform sampler2D tMarker; + +varying vec2 vUv; +varying float vInstance; + +#if defined(dInterpolation_catmulrom) || defined(dInterpolation_mitchell) || defined(dInterpolation_bspline) + #define dInterpolation_cubic +#endif + +#if defined(dInterpolation_cubic) + #if defined(dInterpolation_catmulrom) || defined(dInterpolation_mitchell) + #if defined(dInterpolation_catmulrom) + const float B = 0.0; + const float C = 0.5; + #elif defined(dInterpolation_mitchell) + const float B = 0.333; + const float C = 0.333; + #endif + + float cubicFilter(float x){ + float f = x; + if (f < 0.0) { + f = -f; + } + if (f < 1.0) { + return ((12.0 - 9.0 * B - 6.0 * C) * (f * f * f) + + (-18.0 + 12.0 * B + 6.0 * C) * (f * f) + + (6.0 - 2.0 * B)) / 6.0; + }else if (f >= 1.0 && f < 2.0){ + return ((-B - 6.0 * C) * ( f * f * f) + + (6.0 * B + 30.0 * C) * (f * f) + + (-(12.0 * B) - 48.0 * C) * f + + 8.0 * B + 24.0 * C) / 6.0; + }else{ + return 0.0; + } + } + #elif defined(dInterpolation_bspline) + float cubicFilter(float x) { + float f = x; + if (f < 0.0) { + f = -f; + } + if (f >= 0.0 && f <= 1.0){ + return (2.0 / 3.0) + (0.5) * (f * f * f) - (f * f); + } else if (f > 1.0 && f <= 2.0) { + return 1.0 / 6.0 * pow((2.0 - f), 3.0); + } + return 1.0; + } + #endif + + vec4 biCubic(sampler2D tex, vec2 texCoord) { + vec2 texelSize = 1.0 / uImageTexDim; + texCoord -= texelSize / 2.0; + vec4 nSum = vec4(0.0); + float nDenom = 0.0; + vec2 cell = fract(texCoord * uImageTexDim); + for (float m = -1.0; m <= 2.0; ++m) { + for (float n = -1.0; n <= 2.0; ++n) { + vec4 vecData = texture2D(tex, texCoord + texelSize * vec2(m, n)); + float c = abs(cubicFilter(m - cell.x) * cubicFilter(-n + cell.y)); + nSum += vecData * c; + nDenom += c; + } + } + return nSum / nDenom; + } +#endif + +void main() { + #include fade_lod + #include clip_pixel + + #if defined(dInterpolation_cubic) + vec4 imageData = biCubic(tImageTex, vUv); + #else + vec4 imageData = texture2D(tImageTex, vUv); + #endif + imageData.a = clamp(imageData.a, 0.0, 1.0); + if (imageData.a > 0.9) imageData.a = 1.0; + + imageData.a *= uAlpha; + if (imageData.a < 0.05) + discard; + + float fragmentDepth = gl_FragCoord.z; + + if ((uRenderMask == MaskOpaque && imageData.a < 1.0) || + (uRenderMask == MaskTransparent && imageData.a == 1.0) + ) { + discard; + } + + #if defined(dRenderVariant_pick) + if (imageData.a < 0.3) + discard; + #ifdef requiredDrawBuffers + gl_FragColor = vec4(packIntToRGB(float(uObjectId)), 1.0); + gl_FragData[1] = vec4(packIntToRGB(vInstance), 1.0); + gl_FragData[2] = vec4(texture2D(tGroupTex, vUv).rgb, 1.0); + gl_FragData[3] = packDepthToRGBA(gl_FragCoord.z); + #else + gl_FragColor = vColor; + if (uPickType == 1) { + gl_FragColor = vec4(packIntToRGB(float(uObjectId)), 1.0); + } else if (uPickType == 2) { + gl_FragColor = vec4(packIntToRGB(vInstance), 1.0); + } else { + gl_FragColor = vec4(texture2D(tGroupTex, vUv).rgb, 1.0); + } + #endif + #elif defined(dRenderVariant_depth) + if (imageData.a < 0.05) + discard; + gl_FragColor = packDepthToRGBA(gl_FragCoord.z); + #elif defined(dRenderVariant_marking) + float marker = uMarker; + if (uMarker == -1.0) { + float group = unpackRGBToInt(texture2D(tGroupTex, vUv).rgb); + marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a; + marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win + } + if (uMarkingType == 1) { + if (marker > 0.0 || imageData.a < 0.05) + discard; + gl_FragColor = packDepthToRGBA(gl_FragCoord.z); + } else { + if (marker == 0.0 || imageData.a < 0.05) + discard; + float depthTest = 1.0; + if (uMarkingDepthTest) { + depthTest = (fragmentDepth >= getDepthPacked(gl_FragCoord.xy / uDrawingBufferSize)) ? 1.0 : 0.0; + } + bool isHighlight = intMod(marker, 2.0) > 0.1; + gl_FragColor = vec4(0.0, depthTest, isHighlight ? 1.0 : 0.0, 1.0); + } + #elif defined(dRenderVariant_emissive) + gl_FragColor = vec4(0.0); + #elif defined(dRenderVariant_color) + gl_FragColor = imageData; + + float marker = uMarker; + if (uMarker == -1.0) { + float group = unpackRGBToInt(texture2D(tGroupTex, vUv).rgb); + marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a; + marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win + } + + #include apply_marker_color + #include apply_fog + #include wboit_write + #include dpoit_write + #endif +} +`;var x$=ko(),IPe={apply_fog:bZ,apply_interior_color:SZ,apply_light_color:CZ,apply_marker_color:_Z,assign_clipping_varying:wZ,assign_color_varying:AZ,assign_group:TZ,assign_marker_varying:PZ,assign_material_color:IZ,assign_position:EZ,assign_size:DZ,check_picking_alpha:kZ,check_transparency:MZ,clip_instance:BZ,clip_pixel:RZ,color_frag_params:LZ,color_vert_params:FZ,common_clip:OZ,common_frag_params:NZ,common_vert_params:UZ,common:zZ,fade_lod:VZ,float_to_rgba:GZ,light_frag_params:HZ,matrix_scale:jZ,normal_frag_params:qZ,read_from_texture:WZ,rgba_to_float:YZ,size_vert_params:XZ,texture3d_from_1d_trilinear:KZ,texture3d_from_2d_linear:QZ,texture3d_from_2d_nearest:ZZ,wboit_write:$Z,dpoit_write:JZ},EPe=/^(?!\/\/)\s*#include\s+(\S+)/gm,DPe=/#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,kPe=/[ \t]*\/\/.*\n/g,MPe=/[ \t]*\/\*[\s\S]*?\*\//g,BPe=/\n{2,}/g;function g$(e){return e.replace(EPe,(t,r)=>{let n=IPe[r];if(!n)throw new Error(`empty chunk, '${r}'`);return n}).trim().replace(kPe,` +`).replace(MPe,` +`).replace(BPe,` +`)}function RPe(e){return e.replace(DPe,LPe)}function LPe(e,t,r,n){let o="";for(let i=parseInt(t);i{let n=e[r];n.type==="uniform"?t[r]=I$(n.kind):n.type==="texture"&&(t[r]=I$("t"))}),t}function M$(e){let t={};return Object.keys(e).forEach(r=>{t[r]=I.create(ba(e[r].ref.value))}),t}var rIe=ko();function nIe(e,t){switch(t){case"static":return e.STATIC_DRAW;case"dynamic":return e.DYNAMIC_DRAW;case"stream":return e.STREAM_DRAW}}function oIe(e,t){if(t instanceof Uint8Array)return e.UNSIGNED_BYTE;if(t instanceof Int8Array)return e.BYTE;if(t instanceof Uint16Array)return e.UNSIGNED_SHORT;if(t instanceof Int16Array)return e.SHORT;if(t instanceof Uint32Array)return e.UNSIGNED_INT;if(t instanceof Int32Array)return e.INT;if(t instanceof Float32Array)return e.FLOAT;_r(t)}function iIe(e,t){switch(t){case"attribute":return e.ARRAY_BUFFER;case"elements":return e.ELEMENT_ARRAY_BUFFER;case"uniform":if(Wt(e))return e.UNIFORM_BUFFER;throw new Error("WebGL2 is required for uniform buffers")}}function SP(e){let t=e.createBuffer();if(t===null)throw new Error("Could not create WebGL buffer");return t}function B$(e,t,r,n){let o=SP(e),i=nIe(e,r),s=iIe(e,n),a=oIe(e,t),l=t.BYTES_PER_ELEMENT,c=t.length;function u(m){e.bindBuffer(s,o),e.bufferData(s,m,i)}u(t);let d=!1;return{id:rIe(),_usageHint:i,_bufferType:s,_dataType:a,_bpe:l,length:c,getBuffer:()=>o,updateData:u,updateSubData:(m,p,h)=>{e.bindBuffer(s,o),h-p===m.length?e.bufferSubData(s,0,m):e.bufferSubData(s,p*l,m.subarray(p,p+h))},reset:()=>{o=SP(e),u(t)},destroy:()=>{d||(e.deleteBuffer(o),d=!0)}}}function R$(e,t,r){switch(t){case"float32":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}default:_r(t)}}function L$(e,t,r,n,o,i,s="static"){let{instancedArrays:a}=r,l=B$(e,n,s,"attribute"),{_bufferType:c,_dataType:u,_bpe:d}=l;return te(k({},l),{divisor:i,bind:m=>{if(e.bindBuffer(c,l.getBuffer()),o===16)for(let p=0;p<4;++p)t.enableVertexAttrib(m+p),e.vertexAttribPointer(m+p,4,u,!1,4*4*d,p*4*d),a.vertexAttribDivisor(m+p,i);else t.enableVertexAttrib(m),e.vertexAttribPointer(m,o,u,!1,0,0),a.vertexAttribDivisor(m,i)},changeOffset:(m,p)=>{let h=p*d*o;if(e.bindBuffer(c,l.getBuffer()),o===16)for(let f=0;f<4;++f)e.vertexAttribPointer(m+f,4,u,!1,4*4*d,f*4*d+h);else e.vertexAttribPointer(m,o,u,!1,0,h)}})}function F$(e,t,r){let n=[];return Object.keys(t).forEach(o=>{let i=t[o];i.type==="attribute"&&(n[n.length]=[o,e.resources.attribute(r[o].ref.value,i.itemSize,i.divisor)])}),n}function O$(e,t,r="static"){let n=B$(e,t,r,"elements");return te(k({},n),{bind:()=>{e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.getBuffer())}})}var sIe=ko();function aIe(e,t,r){let n={};return Object.keys(r).forEach(o=>{let i=r[o];if(i.type==="attribute"){let s=e.getAttribLocation(t,o);n[o]=s}else if(i.type==="uniform"){let s=e.getUniformLocation(t,o);s===null&&D$(i.kind)&&(s=e.getUniformLocation(t,o+"[0]")),n[o]=s}else if(i.type==="texture"){let s=e.getUniformLocation(t,o);n[o]=s}}),n}function lIe(e,t,r){let n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let o=0;o{t.currentProgramId=c,e.useProgram(l)},setUniforms:g=>{for(let v=0,b=g.length;v{let b=p[g];b!==null&&h[g](e,b,v)},bindAttributes:g=>{t.clearVertexAttribsState();for(let v=0,b=g.length;v{for(let b=0,S=g.length;b{for(let b=0,S=g.length;b{l=CP(e),f()},destroy:()=>{y||(d.destroy(),m.destroy(),e.deleteProgram(l),y=!0)}}}var dIe=ko();function mIe(e){let t=e.split(` +`);for(let r=0;r{e.attachShader(n,r)},reset:()=>{r=o_(e,t)},destroy:()=>{e.deleteShader(r)}}}function pIe(e,t=0){return{value:e,usageCount:t}}function fIe(e){return{free:()=>{e.usageCount-=1},value:e.value}}function eF(e,t,r){let n=new Map;return{get:o=>{let i=e(o),s=n.get(i);return s||(s=pIe(t(o)),n.set(i,s)),s.usageCount+=1,fIe(s)},clear:()=>{n.forEach((o,i)=>{o.usageCount<=0&&(o.usageCount<0&&console.warn("Reference usageCount below zero."),r(o.value),n.delete(i))})},get count(){return n.size},dispose:()=>{n.forEach(o=>r(o.value)),n.clear()}}}var hIe=ko();function gIe(e,t){switch(t){case"depth16":return e.DEPTH_COMPONENT16;case"stencil8":return e.STENCIL_INDEX8;case"rgba4":return e.RGBA4;case"depth-stencil":return e.DEPTH_STENCIL;case"depth24":if(Wt(e))return e.DEPTH_COMPONENT24;throw new Error("WebGL2 needed for `depth24` renderbuffer format");case"depth32f":if(Wt(e))return e.DEPTH_COMPONENT32F;throw new Error("WebGL2 needed for `depth32f` renderbuffer format");case"depth24-stencil8":if(Wt(e))return e.DEPTH24_STENCIL8;throw new Error("WebGL2 needed for `depth24-stencil8` renderbuffer format");case"depth32f-stencil8":if(Wt(e))return e.DEPTH32F_STENCIL8;throw new Error("WebGL2 needed for `depth32f-stencil8` renderbuffer format")}}function yIe(e,t){switch(t){case"depth":return e.DEPTH_ATTACHMENT;case"stencil":return e.STENCIL_ATTACHMENT;case"depth-stencil":return e.DEPTH_STENCIL_ATTACHMENT;case"color0":return e.COLOR_ATTACHMENT0}}function z$(e){let t=e.createRenderbuffer();if(t===null)throw new Error("Could not create WebGL renderbuffer");return t}function V$(e,t,r,n,o){let i=z$(e),s=()=>e.bindRenderbuffer(e.RENDERBUFFER,i),a=gIe(e,t),l=yIe(e,r);function c(){s(),e.renderbufferStorage(e.RENDERBUFFER,a,n,o)}c();let u=!1;return{id:hIe(),bind:s,attachFramebuffer:d=>{d.bind(),s(),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,i),$t&&E1(e)},detachFramebuffer:d=>{d.bind(),s(),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,null),$t&&E1(e)},setSize:(d,m)=>{n=d,o=m,c()},reset:()=>{i=z$(e),c()},destroy:()=>{u||(e.deleteRenderbuffer(i),u=!0)}}}var vIe=ko();function G$(e){let{vertexArrayObject:t}=e;if(!t)throw new Error("VertexArrayObject not supported");let r=t.createVertexArray();if(!r)throw new Error("Could not create WebGL vertex array");return r}function H$(e){let{vertexArrayObject:t}=e;if(t===null)throw new Error("VertexArrayObject not supported");return t}function j$(e,t,r,n,o){let i=vIe(),s=G$(t),a=H$(t);function l(){a.bindVertexArray(s),o&&o.bind(),r.bindAttributes(n),a.bindVertexArray(null)}l();let c=!1;return{id:i,bind:()=>{a.bindVertexArray(s)},update:l,reset:()=>{s=G$(t),a=H$(t),l()},destroy:()=>{c||(o&&(a.bindVertexArray(s),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),a.deleteVertexArray(s),c=!0)}}}function xIe(e){return typeof e=="boolean"?e?1:0:typeof e=="number"?e*1e4:nC(e)}function q$(e){return te(k({},e.value),{destroy:()=>{e.free()}})}function W$(e,t,r,n){let o={attribute:new Set,elements:new Set,framebuffer:new Set,program:new Set,renderbuffer:new Set,shader:new Set,texture:new Set,cubeTexture:new Set,vertexArray:new Set};function i(c,u){return o[c].add(u),r.resourceCounts[c]+=1,te(k({},u),{destroy:()=>{u.destroy(),o[c].delete(u),r.resourceCounts[c]-=1}})}let s=eF(c=>JSON.stringify(c),c=>i("shader",U$(e,c)),c=>{c.destroy()});function a(c,u){return q$(s.get({type:c,source:u}))}let l=eF(c=>{var u;let d=[c.shaderCode.id],m=((u=c.defineValues.dRenderVariant)===null||u===void 0?void 0:u.ref.value)||"";return Object.keys(c.defineValues).forEach(p=>{var h,f;!((f=(h=c.shaderCode).ignoreDefine)===null||f===void 0)&&f.call(h,p,m,c.defineValues)||d.push(nC(p),xIe(c.defineValues[p].ref.value))}),zo(d).toString()},c=>i("program",N$(e,t,n,a,c)),c=>{c.destroy()});return{attribute:(c,u,d,m)=>i("attribute",L$(e,t,n,c,u,d,m)),elements:(c,u)=>i("elements",O$(e,c,u)),framebuffer:()=>i("framebuffer",GQ(e)),program:(c,u,d)=>q$(l.get({defineValues:c,shaderCode:u,schema:d})),renderbuffer:(c,u,d,m)=>i("renderbuffer",V$(e,c,u,d,m)),shader:a,texture:(c,u,d,m)=>i("texture",Y$(e,n,c,u,d,m)),cubeTexture:(c,u,d)=>i("cubeTexture",X$(e,c,u,d)),vertexArray:(c,u,d)=>i("vertexArray",j$(e,n,c,u,d)),getByteCounts:()=>{let c=0;o.texture.forEach(m=>{c+=m.getByteCount()}),o.cubeTexture.forEach(m=>{c+=m.getByteCount()});let u=0;o.attribute.forEach(m=>{u+=m.length*4});let d=0;return o.elements.forEach(m=>{d+=m.length*4}),{texture:c,attribute:u,elements:d}},reset:()=>{o.attribute.forEach(c=>c.reset()),o.elements.forEach(c=>c.reset()),o.framebuffer.forEach(c=>c.reset()),o.renderbuffer.forEach(c=>c.reset()),o.shader.forEach(c=>c.reset()),o.program.forEach(c=>c.reset()),o.vertexArray.forEach(c=>c.reset()),o.texture.forEach(c=>c.reset())},destroy:()=>{o.attribute.forEach(c=>c.destroy()),o.elements.forEach(c=>c.destroy()),o.framebuffer.forEach(c=>c.destroy()),o.renderbuffer.forEach(c=>c.destroy()),o.shader.forEach(c=>c.destroy()),o.program.forEach(c=>c.destroy()),o.vertexArray.forEach(c=>c.destroy()),o.texture.forEach(c=>c.destroy()),s.clear(),l.clear()}}}var K$=ko();function Q$(e,t,r,n,o=!0,i="uint8",s="nearest",a="rgba"){if(a==="alpha"&&!Wt(e))throw new Error("cannot render to alpha format in webgl1");let l=t.framebuffer(),c=i==="fp16"?t.texture("image-float16",a,"fp16",s):i==="float32"?t.texture("image-float32",a,"float",s):t.texture("image-uint8",a,"ubyte",s),u=o?Wt(e)?t.renderbuffer("depth32f","depth",r,n):t.renderbuffer("depth16","depth",r,n):null;function d(){c.define(r,n),c.attachFramebuffer(l,"color0"),u&&u.attachFramebuffer(l)}d();let m=!1;return{id:K$(),texture:c,framebuffer:l,depthRenderbuffer:u,getWidth:()=>r,getHeight:()=>n,bind:()=>{l.bind()},setSize:(p,h)=>{r===p&&n===h||(r=p,n=h,c.define(r,n),u&&u.setSize(r,n))},reset:()=>{d()},destroy:()=>{m||(c.destroy(),l.destroy(),u&&u.destroy(),m=!0)}}}function Z$(e){return{id:K$(),texture:fo(e),framebuffer:HQ(),depthRenderbuffer:null,getWidth:()=>0,getHeight:()=>0,bind:()=>{e.bindFramebuffer(e.FRAMEBUFFER,null)},setSize:()=>{},reset:()=>{},destroy:()=>{}}}function bIe(e,t,r){return e-=e/r,e+=t/r,e}var _P=class{add(t,r){let n=this.avgs.get(t)||r;return n=bIe(n,r,this.count),this.avgs.set(t,n),n}get(t){return this.avgs.get(t)}stats(){return Object.fromEntries(this.avgs.entries())}clear(){this.avgs.clear()}constructor(t){this.count=t,this.avgs=new Map}};function SIe(e){e.calls.drawInstanced=0,e.calls.drawInstancedBase=0,e.calls.multiDrawInstancedBase=0,e.calls.counts=0,e.culled.lod=0,e.culled.frustum=0,e.culled.occlusion=0}function CIe(e){return e.disjointTimerQuery?e.disjointTimerQuery.createQuery():null}function $$(e,t,r,n){var o;let i=t.disjointTimerQuery,s=(o=n?.avgCount)!==null&&o!==void 0?o:30,a=new Map,l=new Map,c=[],u=new _P(s),d=new _P(s),m=[],p=null,h=!1,f=()=>{i&&(a.forEach((g,v)=>{i.deleteQuery(v)}),l.clear(),c.length=0,u.clear(),d.clear(),m=[],p=null,h=!1)},y=()=>{if(!i)return;let g=CIe(t);g&&(i.beginQuery(i.TIME_ELAPSED,g),l.forEach((v,b)=>{v.queries.push(g)}),a.set(g,{refCount:l.size}),p=g)};return{resolve:()=>{let g=[];if(!i||!m.length)return g;a.forEach((b,S)=>{if(b.timeElapsed!==void 0)return;let _=i.getQueryParameter(S,i.QUERY_RESULT_AVAILABLE),w=e.getParameter(i.GPU_DISJOINT);if(_&&!w){let E=i.getQueryParameter(S,i.QUERY_RESULT);b.timeElapsed=E}(_||w)&&i.deleteQuery(S)});let v=[];for(let b of m)if(b.queries.every(S=>{var _;return((_=a.get(S))===null||_===void 0?void 0:_.timeElapsed)!==void 0})){let S=0;for(let _ of b.queries){let w=a.get(_);S+=w.timeElapsed,w.refCount-=1}if(b.timeElapsed=S,b.root){let _=[],w=(A,P)=>{for(let T of A){let B=T.timeElapsed,D=T.cpu.end-T.cpu.start,M={label:T.label,gpuElapsed:B,gpuAvg:u.add(T.label,B),cpuElapsed:D,cpuAvg:d.add(T.label,D),children:[],calls:T.calls};P.push(M),w(T.children,M.children)}};w(b.children,_);let E=b.cpu.end-b.cpu.start;g.push({label:b.label,gpuElapsed:S,gpuAvg:u.add(b.label,S),cpuElapsed:E,cpuAvg:d.add(b.label,E),children:_,calls:b.calls})}}else v.push(b);return m=v,a.forEach((b,S)=>{b.refCount===0&&a.delete(S)}),g},mark:(g,v=!1)=>{if(!i)return;if(l.has(g))throw new Error(`Timer mark for '${g}' already exists`);p!==null&&i.endQuery(i.TIME_ELAPSED);let b={label:g,queries:[],children:[],root:p===null,cpu:{start:On(),end:-1},captureStats:v};if(l.set(g,b),c.length&&c[c.length-1].children.push(b),c.push(b),v){if(h)throw new Error("Already capturing stats");SIe(r),h=!0}y()},markEnd:g=>{var v;if(!i)return;let b=l.get(g);if(!b)throw new Error(`Timer mark for '${g}' does not exist`);if(((v=c.pop())===null||v===void 0?void 0:v.label)!==g)throw new Error(`Timer mark for '${g}' has pending nested mark`);i.endQuery(i.TIME_ELAPSED),l.delete(g),b.cpu.end=On(),b.captureStats&&(b.calls=k({},r.calls),h=!1),m.push(b),l.size>0?y():p=null},stats:()=>({gpu:u.stats(),cpu:d.stats()}),formatedStats:()=>{let g={},v=u.stats(),b=d.stats();for(let S of Object.keys(v)){let _=`${(v[S]/1e3/1e3).toFixed(2)}`,w=`${b[S].toFixed(2)}`;g[S]=`${_} ms | CPU: ${w} ms`}return g},clear:f,destroy:()=>{f()}}}function _Ie(e){let t=`${(e.gpuElapsed/1e3/1e3).toFixed(2)}`,r=`${(e.gpuAvg/1e3/1e3).toFixed(2)}`,n=`${e.cpuElapsed.toFixed(2)}`,o=`${e.cpuAvg.toFixed(2)}`;return`${e.label} ${t} ms (avg. ${r} ms) | CPU: ${n} ms (avg. ${o} ms)`}function tF(e){e.map(t=>{let r=_Ie(t);t.children.length||t.calls?(console.groupCollapsed(r),t.calls&&console.log(t.calls),tF(t.children),console.groupEnd()):console.log(r)})}function eJ(e,t){function r(o){try{return e.getContext(o,t)}catch{return null}}let n=(t?.preferWebGl1?null:r("webgl2"))||r("webgl")||r("experimental-webgl");return $t&&console.log(`isWebgl2: ${Wt(n)}`),n}function nF(e,t){switch(t){case e.NO_ERROR:return"no error";case e.INVALID_ENUM:return"invalid enum";case e.INVALID_VALUE:return"invalid value";case e.INVALID_OPERATION:return"invalid operation";case e.INVALID_FRAMEBUFFER_OPERATION:return"invalid framebuffer operation";case e.OUT_OF_MEMORY:return"out of memory";case e.CONTEXT_LOST_WEBGL:return"context lost"}return"unknown error"}function oF(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error(`WebGL error: '${nF(e,t)}'`)}function wIe(e){let t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);for(let o=0;o{Wt(e)?nJ(e,t):(J$||(console.info("Sync object not supported in WebGL"),J$=!0),oJ(e),t())})}function oJ(e){e.bindFramebuffer(e.FRAMEBUFFER,null),e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,tJ)}function rF(e,t,r,n,o,i){if($t&&E1(e),i instanceof Uint8Array)e.readPixels(t,r,n,o,e.RGBA,e.UNSIGNED_BYTE,i);else if(i instanceof Float32Array)e.readPixels(t,r,n,o,e.RGBA,e.FLOAT,i);else if(i instanceof Int32Array&&Wt(e))e.readPixels(t,r,n,o,e.RGBA_INTEGER,e.INT,i);else throw new Error("unsupported readPixels buffer type");$t&&oF(e)}function TIe(e,t){let r=e.drawingBufferWidth,n=e.drawingBufferHeight,o=new Uint8Array(r*n*4);return wP(e),t.viewport(0,0,r,n),rF(e,0,0,r,n,o),vh.flipY(vh.create(o,r,n))}function PIe(){return{resourceCounts:{attribute:0,elements:0,framebuffer:0,program:0,renderbuffer:0,shader:0,texture:0,cubeTexture:0,vertexArray:0},drawCount:0,instanceCount:0,instancedDrawCount:0,calls:{drawInstanced:0,drawInstancedBase:0,multiDrawInstancedBase:0,counts:0},culled:{lod:0,frustum:0,occlusion:0}}}function iJ(e,t={}){let r=JL(e),n=xZ(e,r),o=PIe(),i=W$(e,n,o,r),s=$$(e,r,o),a={maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),max3dTextureSize:Wt(e)?e.getParameter(e.MAX_3D_TEXTURE_SIZE):0,maxRenderbufferSize:e.getParameter(e.MAX_RENDERBUFFER_SIZE),maxDrawBuffers:r.drawBuffers?e.getParameter(r.drawBuffers.MAX_DRAW_BUFFERS):0,maxTextureImageUnits:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)};if(a.maxVertexTextureImageUnits<8)throw new Error('Need "MAX_VERTEX_TEXTURE_IMAGE_UNITS" >= 8');let l=r.provokingVertex;l?.provokingVertex(l.FIRST_VERTEX_CONVENTION);let c=!1,u=new Zs(0),d=t.pixelScale||1,m;if(Wt(e)){let h=e.createBuffer(),f,y,g=!1,v=()=>{e.bindBuffer(e.PIXEL_PACK_BUFFER,h),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,f),e.bindBuffer(e.PIXEL_PACK_BUFFER,null),g=!1,y(),y=void 0,f=void 0};m=(b,S,_,w,E)=>new Promise((A,P)=>{if(g){P("Can not call multiple readPixelsAsync at the same time");return}g=!0,e.bindBuffer(e.PIXEL_PACK_BUFFER,h),e.bufferData(e.PIXEL_PACK_BUFFER,_*w*4,e.STREAM_READ),e.readPixels(b,S,_,w,e.RGBA,e.UNSIGNED_BYTE,0),e.bindBuffer(e.PIXEL_PACK_BUFFER,null),y=A,f=E,nJ(e,v)})}else m=(h,f,y,g,v)=>Y(this,null,function*(){rF(e,h,f,y,g,v)});let p=new Set;return{gl:e,isWebGL2:Wt(e),get pixelRatio(){return(typeof window<"u"&&window.devicePixelRatio||1)*(d||1)},extensions:r,state:n,stats:o,resources:i,timer:s,get maxTextureSize(){return a.maxTextureSize},get max3dTextureSize(){return a.max3dTextureSize},get maxRenderbufferSize(){return a.maxRenderbufferSize},get maxDrawBuffers(){return a.maxDrawBuffers},get maxTextureImageUnits(){return a.maxTextureImageUnits},namedComputeRenderables:Object.create(null),namedFramebuffers:Object.create(null),namedTextures:Object.create(null),get isContextLost(){return c||e.isContextLost()},contextRestored:u,setContextLost:()=>{c=!0,s.clear()},handleContextRestored:h=>{Object.assign(r,JL(e)),n.reset(),n.currentMaterialId=-1,n.currentProgramId=-1,n.currentRenderItemId=-1,i.reset(),p.forEach(f=>f.reset()),h?.(),c=!1,u.next(On())},setPixelScale:h=>{d=h},createRenderTarget:(h,f,y,g,v,b)=>{let S=Q$(e,i,h,f,y,g,v,b);return p.add(S),te(k({},S),{destroy:()=>{S.destroy(),p.delete(S)}})},unbindFramebuffer:()=>wP(e),readPixels:(h,f,y,g,v)=>{rF(e,h,f,y,g,v)},readPixelsAsync:m,waitForGpuCommandsComplete:()=>AIe(e),waitForGpuCommandsCompleteSync:()=>oJ(e),getDrawingBufferPixelData:()=>TIe(e,n),clear:(h,f,y,g)=>{wP(e),n.enable(e.SCISSOR_TEST),n.depthMask(!0),n.colorMask(!0,!0,!0,!0),n.clearColor(h,f,y,g),n.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),n.scissor(0,0,e.drawingBufferWidth,e.drawingBufferHeight),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)},destroy:h=>{var f,y;i.destroy(),wIe(e),h?.doNotForceWebGLContextLoss||((f=e.getExtension("WEBGL_lose_context"))===null||f===void 0||f.loseContext(),(y=e.getExtension("STACKGL_destroy_context"))===null||y===void 0||y.destroy())}}}function Wt(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext}function jQ(e){if(Wt(e))return{drawArraysInstanced:e.drawArraysInstanced.bind(e),drawElementsInstanced:e.drawElementsInstanced.bind(e),vertexAttribDivisor:e.vertexAttribDivisor.bind(e),VERTEX_ATTRIB_ARRAY_DIVISOR:e.VERTEX_ATTRIB_ARRAY_DIVISOR};{let t=e.getExtension("ANGLE_instanced_arrays");return t===null?null:{drawArraysInstanced:t.drawArraysInstancedANGLE.bind(t),drawElementsInstanced:t.drawElementsInstancedANGLE.bind(t),vertexAttribDivisor:t.vertexAttribDivisorANGLE.bind(t),VERTEX_ATTRIB_ARRAY_DIVISOR:t.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE}}}function qQ(e){if(Wt(e))return{FRAGMENT_SHADER_DERIVATIVE_HINT:e.FRAGMENT_SHADER_DERIVATIVE_HINT};{let t=e.getExtension("OES_standard_derivatives");return t===null?null:{FRAGMENT_SHADER_DERIVATIVE_HINT:t.FRAGMENT_SHADER_DERIVATIVE_HINT_OES}}}function WQ(e){return Wt(e)?{}:e.getExtension("OES_element_index_uint")}function YQ(e){if(Wt(e))return{VERTEX_ARRAY_BINDING:e.VERTEX_ARRAY_BINDING,bindVertexArray:e.bindVertexArray.bind(e),createVertexArray:e.createVertexArray.bind(e),deleteVertexArray:e.deleteVertexArray.bind(e),isVertexArray:e.isVertexArray.bind(e)};{let t=e.getExtension("OES_vertex_array_object");return t===null?null:{VERTEX_ARRAY_BINDING:t.VERTEX_ARRAY_BINDING_OES,bindVertexArray:t.bindVertexArrayOES.bind(t),createVertexArray:t.createVertexArrayOES.bind(t),deleteVertexArray:t.deleteVertexArrayOES.bind(t),isVertexArray:t.isVertexArrayOES.bind(t)}}}function XQ(e){return Wt(e)?{}:e.getExtension("OES_texture_float")}function KQ(e){return e.getExtension("OES_texture_float_linear")}function QQ(e){if(Wt(e))return{HALF_FLOAT:e.HALF_FLOAT};{let t=e.getExtension("OES_texture_half_float");return t===null?null:{HALF_FLOAT:t.HALF_FLOAT_OES}}}function ZQ(e){return e.getExtension("OES_texture_half_float_linear")}function $Q(e){if(Wt(e))return{MIN:e.MIN,MAX:e.MAX};{let t=e.getExtension("EXT_blend_minmax");return t===null?null:{MIN:t.MIN_EXT,MAX:t.MAX_EXT}}}function JQ(e){return Wt(e)?{}:e.getExtension("EXT_frag_depth")}function eZ(e){if(Wt(e))return e.getExtension("EXT_color_buffer_float")===null?null:(e.getExtension("EXT_float_blend"),{RGBA32F:e.RGBA32F});{let t=e.getExtension("WEBGL_color_buffer_float");return t===null?(e.getExtension("OES_texture_float"),sJ(e,e.FLOAT)?{RGBA32F:34836}:null):(e.getExtension("EXT_float_blend"),{RGBA32F:t.RGBA32F_EXT})}}function tZ(e){if(Wt(e))return e.getExtension("EXT_color_buffer_half_float")===null?null:(e.getExtension("EXT_float_blend"),{RGBA16F:e.RGBA16F});{let t=e.getExtension("EXT_color_buffer_half_float");return t===null?(e.getExtension("OES_texture_half_float"),sJ(e,36193)?{RGBA16F:34842}:null):(e.getExtension("EXT_float_blend"),{RGBA16F:t.RGBA16F_EXT})}}function rZ(e){if(Wt(e))return{drawBuffers:e.drawBuffers.bind(e),COLOR_ATTACHMENT0:e.COLOR_ATTACHMENT0,COLOR_ATTACHMENT1:e.COLOR_ATTACHMENT1,COLOR_ATTACHMENT2:e.COLOR_ATTACHMENT2,COLOR_ATTACHMENT3:e.COLOR_ATTACHMENT3,COLOR_ATTACHMENT4:e.COLOR_ATTACHMENT4,COLOR_ATTACHMENT5:e.COLOR_ATTACHMENT5,COLOR_ATTACHMENT6:e.COLOR_ATTACHMENT6,COLOR_ATTACHMENT7:e.COLOR_ATTACHMENT7,DRAW_BUFFER0:e.DRAW_BUFFER0,DRAW_BUFFER1:e.DRAW_BUFFER1,DRAW_BUFFER2:e.DRAW_BUFFER2,DRAW_BUFFER3:e.DRAW_BUFFER3,DRAW_BUFFER4:e.DRAW_BUFFER4,DRAW_BUFFER5:e.DRAW_BUFFER5,DRAW_BUFFER6:e.DRAW_BUFFER6,DRAW_BUFFER7:e.DRAW_BUFFER7,MAX_COLOR_ATTACHMENTS:e.MAX_COLOR_ATTACHMENTS,MAX_DRAW_BUFFERS:e.MAX_DRAW_BUFFERS};{let t=e.getExtension("WEBGL_draw_buffers");return t===null?null:{drawBuffers:t.drawBuffersWEBGL.bind(t),COLOR_ATTACHMENT0:t.COLOR_ATTACHMENT0_WEBGL,COLOR_ATTACHMENT1:t.COLOR_ATTACHMENT1_WEBGL,COLOR_ATTACHMENT2:t.COLOR_ATTACHMENT2_WEBGL,COLOR_ATTACHMENT3:t.COLOR_ATTACHMENT3_WEBGL,COLOR_ATTACHMENT4:t.COLOR_ATTACHMENT4_WEBGL,COLOR_ATTACHMENT5:t.COLOR_ATTACHMENT5_WEBGL,COLOR_ATTACHMENT6:t.COLOR_ATTACHMENT6_WEBGL,COLOR_ATTACHMENT7:t.COLOR_ATTACHMENT7_WEBGL,DRAW_BUFFER0:t.DRAW_BUFFER0_WEBGL,DRAW_BUFFER1:t.DRAW_BUFFER1_WEBGL,DRAW_BUFFER2:t.DRAW_BUFFER2_WEBGL,DRAW_BUFFER3:t.DRAW_BUFFER3_WEBGL,DRAW_BUFFER4:t.DRAW_BUFFER4_WEBGL,DRAW_BUFFER5:t.DRAW_BUFFER5_WEBGL,DRAW_BUFFER6:t.DRAW_BUFFER6_WEBGL,DRAW_BUFFER7:t.DRAW_BUFFER7_WEBGL,MAX_COLOR_ATTACHMENTS:t.MAX_COLOR_ATTACHMENTS_WEBGL,MAX_DRAW_BUFFERS:t.MAX_DRAW_BUFFERS_WEBGL}}}function nZ(e){let t=e.getExtension("OES_draw_buffers_indexed");return t===null?null:{enablei:t.enableiOES.bind(t),disablei:t.disableiOES.bind(t),blendEquationi:t.blendEquationiOES.bind(t),blendEquationSeparatei:t.blendEquationSeparateiOES.bind(t),blendFunci:t.blendFunciOES.bind(t),blendFuncSeparatei:t.blendFuncSeparateiOES.bind(t),colorMaski:t.colorMaskiOES.bind(t)}}function oZ(e){return Wt(e)?{}:e.getExtension("EXT_shader_texture_lod")}function iZ(e){if(Wt(e))return{UNSIGNED_INT_24_8:e.UNSIGNED_INT_24_8};{let t=e.getExtension("WEBGL_depth_texture");return t===null?null:{UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8_WEBGL}}}function sZ(e){if(Wt(e))return{FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING,SRGB8_ALPHA8:e.SRGB8_ALPHA8,SRGB8:e.SRGB8,SRGB:e.SRGB};{let t=e.getExtension("EXT_sRGB");return t===null?null:{FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT,SRGB8_ALPHA8:t.SRGB8_ALPHA8_EXT,SRGB8:t.SRGB_ALPHA_EXT,SRGB:t.SRGB_EXT}}}function aZ(e){if(Wt(e)){let t=e.getExtension("EXT_disjoint_timer_query_webgl2")||e.getExtension("EXT_disjoint_timer_query");return t===null?null:{QUERY_COUNTER_BITS:t.QUERY_COUNTER_BITS_EXT,CURRENT_QUERY:e.CURRENT_QUERY,QUERY_RESULT:e.QUERY_RESULT,QUERY_RESULT_AVAILABLE:e.QUERY_RESULT_AVAILABLE,TIME_ELAPSED:t.TIME_ELAPSED_EXT,TIMESTAMP:t.TIMESTAMP_EXT,GPU_DISJOINT:t.GPU_DISJOINT_EXT,createQuery:e.createQuery.bind(e),deleteQuery:e.deleteQuery.bind(e),isQuery:e.isQuery.bind(e),beginQuery:e.beginQuery.bind(e),endQuery:e.endQuery.bind(e),queryCounter:t.queryCounterEXT.bind(t),getQuery:e.getQuery.bind(e),getQueryParameter:e.getQueryParameter.bind(e)}}else{let t=e.getExtension("EXT_disjoint_timer_query");return t===null?null:{QUERY_COUNTER_BITS:t.QUERY_COUNTER_BITS_EXT,CURRENT_QUERY:t.CURRENT_QUERY_EXT,QUERY_RESULT:t.QUERY_RESULT_EXT,QUERY_RESULT_AVAILABLE:t.QUERY_RESULT_AVAILABLE_EXT,TIME_ELAPSED:t.TIME_ELAPSED_EXT,TIMESTAMP:t.TIMESTAMP_EXT,GPU_DISJOINT:t.GPU_DISJOINT_EXT,createQuery:t.createQueryEXT.bind(t),deleteQuery:t.deleteQueryEXT.bind(t),isQuery:t.isQueryEXT.bind(t),beginQuery:t.beginQueryEXT.bind(t),endQuery:t.endQueryEXT.bind(t),queryCounter:t.queryCounterEXT.bind(t),getQuery:t.getQueryEXT.bind(t),getQueryParameter:t.getQueryObjectEXT.bind(t)}}}function lZ(e){let t=e.getExtension("WEBGL_multi_draw");return t?{multiDrawArrays:t.multiDrawArraysWEBGL.bind(t),multiDrawElements:t.multiDrawElementsWEBGL.bind(t),multiDrawArraysInstanced:t.multiDrawArraysInstancedWEBGL.bind(t),multiDrawElementsInstanced:t.multiDrawElementsInstancedWEBGL.bind(t)}:null}function cZ(e){let t=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");return t?{drawArraysInstancedBaseInstance:t.drawArraysInstancedBaseInstanceWEBGL.bind(t),drawElementsInstancedBaseVertexBaseInstance:t.drawElementsInstancedBaseVertexBaseInstanceWEBGL.bind(t)}:null}function uZ(e){let t=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");return t?{multiDrawArraysInstancedBaseInstance:t.multiDrawArraysInstancedBaseInstanceWEBGL.bind(t),multiDrawElementsInstancedBaseVertexBaseInstance:t.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL.bind(t)}:null}function dZ(e){let t=e.getExtension("KHR_parallel_shader_compile");return t===null?null:{COMPLETION_STATUS:t.COMPLETION_STATUS_KHR}}function mZ(e){return Wt(e)?{}:e.getExtension("OES_fbo_render_mipmap")}function pZ(e){if(Wt(e)){let t=e.getExtension("WEBGL_provoking_vertex");if(t)return{FIRST_VERTEX_CONVENTION:t.FIRST_VERTEX_CONVENTION_WEBGL,LAST_VERTEX_CONVENTION:t.LAST_VERTEX_CONVENTION_WEBGL,PROVOKING_VERTEX:t.PROVOKING_VERTEX_WEBGL,provokingVertex:t.provokingVertexWEBGL.bind(t)}}return null}function fZ(e){if(Wt(e)){let t=e.getExtension("WEBGL_clip_cull_distance");if(t)return{MAX_CLIP_DISTANCES:t.MAX_CLIP_DISTANCES_WEBGL,MAX_CULL_DISTANCES:t.MAX_CULL_DISTANCES_WEBGL,MAX_COMBINED_CLIP_AND_CULL_DISTANCES:t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL,CLIP_DISTANCE0:t.CLIP_DISTANCE0_WEBGL,CLIP_DISTANCE1:t.CLIP_DISTANCE1_WEBGL,CLIP_DISTANCE2:t.CLIP_DISTANCE2_WEBGL,CLIP_DISTANCE3:t.CLIP_DISTANCE3_WEBGL,CLIP_DISTANCE4:t.CLIP_DISTANCE4_WEBGL,CLIP_DISTANCE5:t.CLIP_DISTANCE5_WEBGL,CLIP_DISTANCE6:t.CLIP_DISTANCE6_WEBGL,CLIP_DISTANCE7:t.CLIP_DISTANCE7_WEBGL}}return null}function hZ(e){return Wt(e)&&e.getExtension("EXT_conservative_depth")?{}:null}function gZ(e){if(Wt(e)){let t=e.getExtension("WEBGL_stencil_texturing");if(t)return{DEPTH_STENCIL_TEXTURE_MODE:t.DEPTH_STENCIL_TEXTURE_MODE_WEBGL,STENCIL_INDEX:t.STENCIL_INDEX_WEBGL}}return null}function yZ(e){let t=e.getExtension("EXT_clip_control");return t?{LOWER_LEFT:t.LOWER_LEFT_EXT,UPPER_LEFT:t.UPPER_LEFT_EXT,NEGATIVE_ONE_TO_ONE:t.NEGATIVE_ONE_TO_ONE_EXT,ZERO_TO_ONE:t.ZERO_TO_ONE_EXT,CLIP_ORIGIN:t.CLIP_ORIGIN_EXT,CLIP_DEPTH_MODE:t.CLIP_DEPTH_MODE_EXT,clipControl:t.clipControlEXT.bind(t)}:null}function vZ(e){if(!Wt(e))return!1;if(typeof navigator<"u"){let t=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./);return t?parseInt(t[1])>=85:!0}return!1}var IIe=` +attribute vec4 aPosition; + +void main() { + gl_Position = aPosition; +}`,EIe=` +precision mediump float; +uniform vec4 uColor; +uniform sampler2D uTexture; + +void main() { + gl_FragColor = texture2D(uTexture, vec2(0.5, 0.5)) * uColor; +}`,DIe=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]);function sJ(e,t){let r=o_(e,{type:"vert",source:IIe}),n=o_(e,{type:"frag",source:EIe});if(!r||!n)return!1;let o=CP(e);e.attachShader(o,r),e.attachShader(o,n),e.linkProgram(o),e.useProgram(o);let i=e.getAttribLocation(o,"aPosition"),s=e.getUniformLocation(o,"uColor");if(!s)return $t&&console.log("error getting 'uColor' uniform location"),!1;let a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,DIe,e.STATIC_DRAW),e.enableVertexAttribArray(i),e.vertexAttribPointer(i,2,e.FLOAT,!1,0,0);let l=e.createTexture(),c=new Uint8Array([255,255,255,255]);e.bindTexture(e.TEXTURE_2D,l),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,c);let u=e.createTexture();e.bindTexture(e.TEXTURE_2D,u),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,t,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST);let d=e.createFramebuffer();if(e.bindFramebuffer(e.FRAMEBUFFER,d),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,u,0),e.checkFramebufferStatus(e.FRAMEBUFFER)!==e.FRAMEBUFFER_COMPLETE)return $t&&console.log(`error creating framebuffer for '${t}'`),!1;e.bindTexture(e.TEXTURE_2D,l),e.uniform4fv(s,[0,10,20,1]),e.drawArrays(e.TRIANGLES,0,6),e.bindTexture(e.TEXTURE_2D,u),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(1,0,0,1),e.clear(e.COLOR_BUFFER_BIT),e.uniform4fv(s,[0,1/10,1/20,1]),e.drawArrays(e.TRIANGLES,0,6);let p=new Uint8Array(4);if(e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,p),p[0]!==0||p[1]<248||p[2]<248||p[3]<254)return $t&&console.log(`not able to actually render to '${t}' texture`),!1;if(t===e.FLOAT){e.bindFramebuffer(e.FRAMEBUFFER,d);let h=new Float32Array(4);e.readPixels(0,0,1,1,e.RGBA,e.FLOAT,h);let f=e.getError();if(f)return $t&&console.log(`error reading float pixels: '${nF(e,f)}'`),!1}return!0}var iF=ko();function kIe(e,t){switch(t){case"image-uint8":return e.TEXTURE_2D;case"image-float32":return e.TEXTURE_2D;case"image-float16":return e.TEXTURE_2D;case"image-depth":return e.TEXTURE_2D}if(Wt(e))switch(t){case"image-int32":return e.TEXTURE_2D;case"volume-uint8":return e.TEXTURE_3D;case"volume-float32":return e.TEXTURE_3D;case"volume-float16":return e.TEXTURE_3D}throw new Error(`unknown texture kind '${t}'`)}function dJ(e,t,r){switch(t){case"alpha":return Wt(e)&&r==="float"?e.RED:Wt(e)&&r==="int"?e.RED_INTEGER:e.ALPHA;case"rgb":return Wt(e)&&r==="int"?e.RGB_INTEGER:e.RGB;case"rg":if(Wt(e)&&r==="float")return e.RG;if(Wt(e)&&r==="int")return e.RG_INTEGER;throw new Error('texture format "rg" requires webgl2 and type "float" or int"');case"rgba":return Wt(e)&&r==="int"?e.RGBA_INTEGER:e.RGBA;case"depth":return e.DEPTH_COMPONENT}}function MIe(e,t,r){if(Wt(e))switch(t){case"alpha":switch(r){case"ubyte":return e.ALPHA;case"float":return e.R32F;case"fp16":return e.R16F;case"int":return e.R32I}case"rg":switch(r){case"ubyte":return e.RG;case"float":return e.RG32F;case"fp16":return e.RG16F;case"int":return e.RG32I}case"rgb":switch(r){case"ubyte":return e.RGB;case"float":return e.RGB32F;case"fp16":return e.RGB16F;case"int":return e.RGB32I}case"rgba":switch(r){case"ubyte":return e.RGBA;case"float":return e.RGBA32F;case"fp16":return e.RGBA16F;case"int":return e.RGBA32I}case"depth":switch(r){case"ushort":return e.DEPTH_COMPONENT16;case"float":return e.DEPTH_COMPONENT32F}}return dJ(e,t,r)}function mJ(e,t,r,n,o){return BIe(e)*RIe(t)*r*n*(o||1)}function BIe(e){switch(e){case"alpha":return 1;case"rg":return 2;case"rgb":return 3;case"rgba":return 4;case"depth":return 4}}function RIe(e){switch(e){case"ubyte":return 1;case"ushort":return 2;case"float":return 4;case"fp16":return 2;case"int":return 4}}function LIe(e,t,r){switch(r){case"ubyte":return e.UNSIGNED_BYTE;case"ushort":return e.UNSIGNED_SHORT;case"float":return e.FLOAT;case"fp16":if(t.textureHalfFloat)return t.textureHalfFloat.HALF_FLOAT;throw new Error('extension "texture_half_float" unavailable');case"int":if(Wt(e))return e.INT;throw new Error('texture type "int" requires webgl2')}}function aJ(e,t){switch(t){case"nearest":return e.NEAREST;case"linear":return e.LINEAR}}function AP(e,t,r){switch(r){case"depth":return e.DEPTH_ATTACHMENT;case"stencil":return e.STENCIL_ATTACHMENT;case"color0":case 0:return e.COLOR_ATTACHMENT0}if(t.drawBuffers)switch(r){case"color1":case 1:return t.drawBuffers.COLOR_ATTACHMENT1;case"color2":case 2:return t.drawBuffers.COLOR_ATTACHMENT2;case"color3":case 3:return t.drawBuffers.COLOR_ATTACHMENT3;case"color4":case 4:return t.drawBuffers.COLOR_ATTACHMENT4;case"color5":case 5:return t.drawBuffers.COLOR_ATTACHMENT5;case"color6":case 6:return t.drawBuffers.COLOR_ATTACHMENT6;case"color7":case 7:return t.drawBuffers.COLOR_ATTACHMENT7}throw new Error("unknown texture attachment")}function lJ(e){return typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement}function FIe(e,t,r){return t===r.TEXTURE_2D}function cJ(e,t,r){return t===r.TEXTURE_3D}function uJ(e){let t=e.createTexture();if(t===null)throw new Error("Could not create WebGL texture");return t}function Y$(e,t,r,n,o,i){let s=iF(),a=uJ(e);if(r.endsWith("float32")&&o!=="float"||r.endsWith("float16")&&o!=="fp16"||r.endsWith("uint8")&&o!=="ubyte"||r.endsWith("int32")&&o!=="int"||r.endsWith("depth")&&o!=="ushort"&&o!=="float")throw new Error(`texture kind '${r}' and type '${o}' are incompatible`);if(!t.depthTexture&&n==="depth")throw new Error("extension 'WEBGL_depth_texture' needed for 'depth' texture format");let l=kIe(e,r),c=aJ(e,i),u=dJ(e,n,o),d=MIe(e,n,o),m=LIe(e,t,o);function p(){e.bindTexture(l,a),e.texParameteri(l,e.TEXTURE_MAG_FILTER,c),e.texParameteri(l,e.TEXTURE_MIN_FILTER,c),e.texParameteri(l,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(l,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(l,null)}p();let h=0,f=0,y=0,g,v=!1,b=!1;function S(A,P,T){if(A===0||P===0||Wt(e)&&l===e.TEXTURE_3D&&T===0)throw new Error("empty textures are not allowed");if(!(h===A&&f===P&&y===(T||0)))if(h=A,f=P,y=T||0,e.bindTexture(l,a),l===e.TEXTURE_2D)e.texImage2D(l,0,d,h,f,0,u,m,null);else if(Wt(e)&&l===e.TEXTURE_3D&&y!==void 0)e.texImage3D(l,0,d,h,f,y,0,u,m,null);else throw new Error("unknown texture target")}S(1,1,Wt(e)&&l===e.TEXTURE_3D?1:0);function _(A,P=!1){if(A.width===0||A.height===0||!lJ(A)&&Wt(e)&&cJ(A,l,e)&&A.depth===0)throw new Error("empty textures are not allowed");if(e.bindTexture(l,a),e.pixelStorei(e.UNPACK_ALIGNMENT,1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),lJ(A))h=A.width,f=A.height,e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,d,u,m,A);else if(FIe(A,l,e)){let T=A.filter?aJ(e,A.filter):c;e.texParameteri(l,e.TEXTURE_MAG_FILTER,T),e.texParameteri(l,e.TEXTURE_MIN_FILTER,T),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!A.flipY),P?e.texSubImage2D(l,0,0,0,A.width,A.height,u,m,A.array):(h=A.width,f=A.height,e.texImage2D(l,0,d,h,f,0,u,m,A.array))}else if(Wt(e)&&cJ(A,l,e))e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),P?e.texSubImage3D(l,0,0,0,0,A.width,A.height,A.depth,u,m,A.array):(h=A.width,f=A.height,y=A.depth,e.texImage3D(l,0,d,h,f,y,0,u,m,A.array));else throw new Error("unknown texture target");e.bindTexture(l,null),g=A}function w(){if(l!==e.TEXTURE_2D)throw new Error("mipmap only supported for 2d textures");if(Wt(e)||yg(h)&&yg(f))e.bindTexture(l,a),e.texParameteri(l,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.generateMipmap(l),e.bindTexture(l,null),v=!0;else throw new Error("mipmap unsupported for non-power-of-two textures and webgl1")}function E(A,P,T){if(A.bind(),l===e.TEXTURE_2D)e.framebufferTexture2D(e.FRAMEBUFFER,AP(e,t,P),e.TEXTURE_2D,a,0);else if(Wt(e)&&l===e.TEXTURE_3D){if(T===void 0)throw new Error("need `layer` to attach 3D texture");e.framebufferTextureLayer(e.FRAMEBUFFER,AP(e,t,P),a,0,T)}else throw new Error("unknown/unsupported texture target")}return{id:s,target:l,format:u,internalFormat:d,type:m,filter:c,getWidth:()=>h,getHeight:()=>f,getDepth:()=>y,getByteCount:()=>mJ(n,o,h,f,y),define:S,load:_,mipmap:w,bind:A=>{e.activeTexture(e.TEXTURE0+A),e.bindTexture(l,a)},unbind:A=>{e.activeTexture(e.TEXTURE0+A),e.bindTexture(l,null)},attachFramebuffer:E,detachFramebuffer:(A,P)=>{if(A.bind(),l===e.TEXTURE_2D)e.framebufferTexture2D(e.FRAMEBUFFER,AP(e,t,P),e.TEXTURE_2D,null,0);else if(Wt(e)&&l===e.TEXTURE_3D)e.framebufferTextureLayer(e.FRAMEBUFFER,AP(e,t,P),null,0,0);else throw new Error("unknown texture target")},reset:()=>{a=uJ(e),p();let[A,P,T]=[h,f,y];h=0,f=0,y=0,S(A,P,T),g&&_(g),v&&w()},destroy:()=>{b||(e.deleteTexture(a),b=!0)}}}function sF(e,t,r){let{resources:n}=e,o=[];return Object.keys(t).forEach(i=>{let s=t[i];if(s.type==="texture"){let a=r[i];if(a)if(s.kind==="texture")o[o.length]=[i,a.ref.value];else{let l=n.texture(s.kind,s.format,s.dataType,s.filter);l.load(a.ref.value),o[o.length]=[i,l]}}}),o}function aF(e,t,r){let n=new Image;n.onload=function(){r.load(n),I.update(t,r)},n.src=e}function OIe(e,t){switch(t){case"nx":return e.TEXTURE_CUBE_MAP_NEGATIVE_X;case"ny":return e.TEXTURE_CUBE_MAP_NEGATIVE_Y;case"nz":return e.TEXTURE_CUBE_MAP_NEGATIVE_Z;case"px":return e.TEXTURE_CUBE_MAP_POSITIVE_X;case"py":return e.TEXTURE_CUBE_MAP_POSITIVE_Y;case"pz":return e.TEXTURE_CUBE_MAP_POSITIVE_Z}}function X$(e,t,r,n){let o=e.TEXTURE_CUBE_MAP,i=e.LINEAR,s=e.RGBA,a=e.RGBA,l=e.UNSIGNED_BYTE,c=0,u=e.createTexture();e.bindTexture(o,u);let d=0;ci(t,(p,h)=>{if(!p)return;let f=0,y=OIe(e,h),g=new Image;p instanceof File?g.src=URL.createObjectURL(p):vg(p)?p.then(v=>{g.src=URL.createObjectURL(v)}):g.src=p,g.addEventListener("load",()=>{c===0&&(c=g.width),e.texImage2D(y,f,s,c,c,0,a,l,null),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.bindTexture(o,u),e.texImage2D(y,f,s,a,l,g),d+=1,d===6&&(m||(r?(e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.generateMipmap(o)):e.texParameteri(o,e.TEXTURE_MIN_FILTER,i),e.texParameteri(o,e.TEXTURE_MAG_FILTER,i)),n?.(m))}),g.addEventListener("error",()=>{n?.(!0)})});let m=!1;return{id:iF(),target:o,format:a,internalFormat:s,type:l,filter:i,getWidth:()=>c,getHeight:()=>c,getDepth:()=>0,getByteCount:()=>mJ("rgba","ubyte",c,c,0)*6*(r?2:1),define:()=>{},load:()=>{},mipmap:()=>{},bind:p=>{e.activeTexture(e.TEXTURE0+p),e.bindTexture(o,u)},unbind:p=>{e.activeTexture(e.TEXTURE0+p),e.bindTexture(o,null)},attachFramebuffer:()=>{},detachFramebuffer:()=>{},reset:()=>{},destroy:()=>{m||(e.deleteTexture(u),m=!0)}}}var pJ=-1;function fJ(e){return e.format===pJ}function fo(e){var t;let r=(t=e?.TEXTURE_2D)!==null&&t!==void 0?t:3553;return{id:iF(),target:r,format:pJ,internalFormat:0,type:0,filter:0,getWidth:()=>0,getHeight:()=>0,getDepth:()=>0,getByteCount:()=>0,define:()=>{},load:()=>{},mipmap:()=>{},bind:n=>{e&&(e.activeTexture(e.TEXTURE0+n),e.bindTexture(r,null))},unbind:n=>{e&&(e.activeTexture(e.TEXTURE0+n),e.bindTexture(r,null))},attachFramebuffer:()=>{throw new Error("cannot attach null-texture to a framebuffer")},detachFramebuffer:()=>{throw new Error("cannot detach null-texture from a framebuffer")},reset:()=>{},destroy:()=>{}}}function Ci(e,t,r,n){let o=NIe(e,t,r,n);return r.palette?(I.updateIfChanged(o.dUsePalette,!0),UIe(r.palette,o.tPalette)):I.updateIfChanged(o.dUsePalette,!1),o}function NIe(e,t,r,n){switch(r.granularity){case"uniform":return VIe(e,r.color,n);case"instance":return e.nonInstanceable?hJ(e,r.color,n):GIe(e,r.color,n);case"group":return hJ(e,r.color,n);case"groupInstance":return HIe(e,r.color,n);case"vertex":return jIe(t,r.color,n);case"vertexInstance":return qIe(t,r.color,n);case"volume":return gJ(r.grid,"volume",n);case"volumeInstance":return gJ(r.grid,"volumeInstance",n);case"direct":return WIe(n)}}function UIe(e,t){let r=!0,n=t.ref.value;if(e.colors.length!==n.width||n.filter!==e.filter)r=!1;else{let s=n.array,a=0;for(let l of e.colors){let[c,u,d]=Oe.toRgb(l);if(s[a++]!==c||s[a++]!==u||s[a++]!==d){r=!1;break}}}if(r)return;let o=new Uint8Array(e.colors.length*3),i=0;for(let s of e.colors){let[a,l,c]=Oe.toRgb(s);o[i++]=a,o[i++]=l,o[i++]=c}I.update(t,{array:o,height:1,width:e.colors.length,filter:e.filter})}function zIe(e,t){return t?(I.update(t.uColor,Oe.toVec3Normalized(t.uColor.ref.value,e)),I.updateIfChanged(t.dColorType,"uniform"),t):{uColor:I.create(Oe.toVec3Normalized(x(),e)),tColor:I.create({array:new Uint8Array(3),width:1,height:1}),tColorGrid:I.create(fo()),tPalette:I.create({array:new Uint8Array(3),width:1,height:1}),uColorTexDim:I.create(Ae.create(1,1)),uColorGridDim:I.create(x.create(1,1,1)),uColorGridTransform:I.create(Rt.create(0,0,0,1)),dColorType:I.create("uniform"),dUsePalette:I.create(!1)}}function VIe(e,t,r){return zIe(t(Qi,!1),r)}function i_(e,t,r){return r?(I.update(r.tColor,e),I.update(r.uColorTexDim,Ae.create(e.width,e.height)),I.updateIfChanged(r.dColorType,t),r):{uColor:I.create(x()),tColor:I.create(e),tColorGrid:I.create(fo()),tPalette:I.create({array:new Uint8Array(3),width:1,height:1}),uColorTexDim:I.create(Ae.create(e.width,e.height)),uColorGridDim:I.create(x.create(1,1,1)),uColorGridTransform:I.create(Rt.create(0,0,0,1)),dColorType:I.create(t),dUsePalette:I.create(!1)}}function GIe(e,t,r){let{instanceCount:n}=e,o=Jn(Math.max(1,n),3,Uint8Array,r&&r.tColor.ref.value.array);for(e.reset();e.hasNext;){let{location:i,isSecondary:s,instanceIndex:a}=e.move();Oe.toArray(t(i,s),o.array,a*3),e.skipInstance()}return i_(o,"instance",r)}function hJ(e,t,r){let{groupCount:n,hasLocation2:o}=e,i=Jn(Math.max(1,n*(o?2:1)),3,Uint8Array,r&&r.tColor.ref.value.array);e.reset();let s=o?6:3;for(;e.hasNext&&!e.isNextNewInstance;){let{location:a,location2:l,isSecondary:c,groupIndex:u}=e.move();Oe.toArray(t(a,c),i.array,u*s),o&&Oe.toArray(t(l,c),i.array,u*s+3)}return i_(i,"group",r)}function HIe(e,t,r){let{groupCount:n,instanceCount:o,hasLocation2:i}=e,s=o*n*(i?2:1),a=Jn(Math.max(1,s),3,Uint8Array,r&&r.tColor.ref.value.array);e.reset();let l=i?6:3;for(;e.hasNext;){let{location:c,location2:u,isSecondary:d,index:m}=e.move();Oe.toArray(t(c,d),a.array,m*l),i&&Oe.toArray(t(u,d),a.array,m*l+3)}return i_(a,"groupInstance",r)}function jIe(e,t,r){let{groupCount:n,stride:o}=e,i=Jn(Math.max(1,n),3,Uint8Array,r&&r.tColor.ref.value.array);for(e.reset(),e.voidInstances();e.hasNext&&!e.isNextNewInstance;){let{location:s,isSecondary:a,groupIndex:l}=e.move(),c=t(s,a);for(let u=0;u=t*16?i.transform.ref.value:new Float32Array(t*16);a.set(e),I.update(i.transform,a),I.updateIfChanged(i.uInstanceCount,t),I.updateIfChanged(i.instanceCount,t);let l=i.aTransform.ref.value.length>=t*16?i.aTransform.ref.value:new Float32Array(t*16);I.update(i.aTransform,l);let c=i.extraTransform.ref.value.length>=t*16?i.extraTransform.ref.value:new Float32Array(t*16);I.update(i.extraTransform,cb(c,t));let u=i.aInstance.ref.value.length>=t?i.aInstance.ref.value:new Float32Array(t);I.update(i.aInstance,as(u,t)),I.update(i.hasReflection,s)}else i={aTransform:I.create(new Float32Array(t*16)),matrix:I.create(ne.identity()),transform:I.create(new Float32Array(e)),extraTransform:I.create(cb(new Float32Array(t*16),t)),uInstanceCount:I.create(t),instanceCount:I.create(t),aInstance:I.create(as(new Float32Array(t))),hasReflection:I.create(s),instanceGrid:I.create(yJ())};return uF(i,r,n,o),i}var cF=new Float32Array(16);ne.toArray(ne.identity(),cF,0);function ub(e){return s_(new Float32Array(cF),1,void 0,0,0,e)}function cb(e,t){for(let r=0;r0){let u=vJ({instanceCount:s,instance:i,transform:o,invariantBoundingSphere:t},r,n);I.update(e.instanceGrid,u),I.update(e.aInstance,u.cellInstance),I.update(e.aTransform,u.cellTransform)}else I.update(e.aInstance,i),I.update(e.aTransform,o)}var Yt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflower:6591981,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,laserlemon:16777044,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrod:16448210,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,maroon2:8323072,maroon3:11546720,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,purple2:8323199,purple3:10494192,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},kCt=function(){let e=new Map;return Object.keys(Yt).forEach(t=>{e.set(Yt[t],t)}),e}();var wr={Atom:"Atom Property",Chain:"Chain Property",Residue:"Residue Property",Symmetry:"Symmetry",Validation:"Validation",Misc:"Miscellaneous"};var bJ=Oe(13421772),$Ie="Gives everything the same, uniform color.",xh={value:C.Color(bJ),saturation:C.Numeric(0,{min:-6,max:6,step:.1}),lightness:C.Numeric(0,{min:-6,max:6,step:.1})};function JIe(e){return xh}function ep(e,t){let r=Ti(t.value,bJ);return r=Oe.saturate(r,t.saturation),r=Oe.lighten(r,t.lightness),{factory:ep,granularity:"uniform",color:()=>r,props:t,description:$Ie,legend:Nl([["uniform",r]])}}var SJ={name:"uniform",label:"Uniform",category:wr.Misc,factory:ep,getParams:JIe,defaultValues:C.getDefaultValues(xh),isApplicable:e=>!0};var eEe="Gives everything the same, uniform size.",CJ={value:C.Numeric(1,{min:0,max:20,step:.1})};function tEe(e){return CJ}function PP(e,t){let r=t.value;return{factory:PP,granularity:"uniform",size:()=>r,props:t,description:eEe}}var _J={name:"uniform",label:"Uniform",category:"",factory:PP,getParams:tEe,defaultValues:C.getDefaultValues(CJ),isApplicable:e=>!0};function ds(e){return k(k({},ds.Zero),e)}(function(e){e.Zero={metalness:0,roughness:0,bumpiness:0};function t(o,i,s){return i[s]=o.metalness*255,i[s+1]=o.roughness*255,i[s+2]=o.bumpiness*255,i}e.toArray=t;function r({metalness:o,roughness:i,bumpiness:s}){return`M ${o.toFixed(2)} | R ${i.toFixed(2)} | B ${s.toFixed(2)}`}e.toString=r;function n(o){return C.Group({metalness:C.Numeric(0,{min:0,max:1,step:.01}),roughness:C.Numeric(1,{min:0,max:1,step:.01}),bumpiness:C.Numeric(0,{min:0,max:1,step:.01})},te(k({},o),{presets:[[{metalness:0,roughness:1,bumpiness:0},"Matte"],[{metalness:0,roughness:.2,bumpiness:0},"Plastic"],[{metalness:0,roughness:.6,bumpiness:0},"Glossy"],[{metalness:1,roughness:.6,bumpiness:0},"Metallic"]]}))}e.getParam=n})(ds||(ds={}));function tp(){}(function(e){e.Type={none:0,plane:1,sphere:2,cube:3,cylinder:4,infiniteCone:5},e.Params={variant:C.Select("pixel",C.arrayToOptions(["instance","pixel"])),objects:C.ObjectList({type:C.Select("plane",C.objectToOptions(e.Type,l=>Us(l))),invert:C.Boolean(!1),position:C.Vec3(x()),rotation:C.Group({axis:C.Vec3(x.create(1,0,0)),angle:C.Numeric(0,{min:-180,max:180,step:1},{description:"Angle in Degrees"})},{isExpanded:!0}),scale:C.Vec3(x.create(1,1,1))},l=>Us(l.type))};function t(l){return{count:0,type:new Array(l).fill(1),invert:new Array(l).fill(!1),position:new Array(l*3).fill(0),rotation:new Array(l*4).fill(0),scale:new Array(l*3).fill(1)}}let r=vn(),n=vn(),o=x(),i=x();function s(l,c){let u=l.objects.length,{type:d,invert:m,position:p,rotation:h,scale:f}=c?.objects||t(u);for(let y=0;y1.2&&(n=2)),{resolution:r,stride:n}}}var We;(function(e){e.MaterialCategory={category:"Material"},e.ShadingCategory={category:"Shading"},e.CullingLodCategory={category:"Culling & LOD"},e.CustomQualityParamInfo={category:"Custom Quality",hideIf:s=>typeof s.quality<"u"&&s.quality!=="custom"},e.Params={alpha:C.Numeric(1,{min:0,max:1,step:.01},{label:"Opacity",isEssential:!0,description:"How opaque/transparent the representation is rendered."}),quality:C.Select("auto",a_,{isEssential:!0,description:"Visual/rendering quality of the representation."}),material:ds.getParam(),clip:C.Group(tp.Params),emissive:C.Numeric(0,{min:0,max:1,step:.01}),instanceGranularity:C.Boolean(!1,{description:"Use instance granularity for marker, transparency, clipping, overpaint, substance data to save memory."}),lod:C.Vec3(x(),void 0,te(k({},e.CullingLodCategory),{description:"Level of detail.",fieldLabels:{x:"Min Distance",y:"Max Distance",z:"Overlap (Shader)"}})),cellSize:C.Numeric(200,{min:0,max:5e3,step:100},te(k({},e.CullingLodCategory),{description:"Instance grid cell size."})),batchSize:C.Numeric(2e3,{min:0,max:5e4,step:500},te(k({},e.CullingLodCategory),{description:"Instance grid batch size."}))};function t(s=Yt.grey,a=1,l){l||(l=ub());let c=Pr(1,l.instanceCount.ref.value,1,()=>Qi,!1,()=>!1),u={color:ep({},{value:s,lightness:0,saturation:0}),size:PP({},{value:a})};return{transform:l,locationIterator:c,theme:u}}e.createSimple=t;function r(s,a){let l=tp.getClip(s.clip);return{alpha:I.create(s.alpha),uAlpha:I.create(s.alpha),uVertexCount:I.create(a.vertexCount),uGroupCount:I.create(a.groupCount),drawCount:I.create(a.drawCount),uMetalness:I.create(s.material.metalness),uRoughness:I.create(s.material.roughness),uBumpiness:I.create(s.material.bumpiness),uEmissive:I.create(s.emissive),dLightCount:I.create(1),dColorMarker:I.create(!0),dClipObjectCount:I.create(l.objects.count),dClipVariant:I.create(l.variant),uClipObjectType:I.create(l.objects.type),uClipObjectInvert:I.create(l.objects.invert),uClipObjectPosition:I.create(l.objects.position),uClipObjectRotation:I.create(l.objects.rotation),uClipObjectScale:I.create(l.objects.scale),instanceGranularity:I.create(s.instanceGranularity),uLod:I.create(Rt.create(s.lod[0],s.lod[1],s.lod[2],0))}}e.createValues=r;function n(s,a){I.updateIfChanged(s.alpha,a.alpha),I.updateIfChanged(s.uMetalness,a.material.metalness),I.updateIfChanged(s.uRoughness,a.material.roughness),I.updateIfChanged(s.uBumpiness,a.material.bumpiness),I.updateIfChanged(s.uEmissive,a.emissive);let l=tp.getClip(a.clip);I.updateIfChanged(s.dClipObjectCount,l.objects.count),I.updateIfChanged(s.dClipVariant,l.variant),I.update(s.uClipObjectType,l.objects.type),I.update(s.uClipObjectInvert,l.objects.invert),I.update(s.uClipObjectPosition,l.objects.position),I.update(s.uClipObjectRotation,l.objects.rotation),I.update(s.uClipObjectScale,l.objects.scale),I.updateIfChanged(s.instanceGranularity,a.instanceGranularity),I.update(s.uLod,Rt.set(s.uLod.ref.value,a.lod[0],a.lod[1],a.lod[2],0))}e.updateValues=n;function o(s={}){let a=s.alpha===void 0?!0:s.alpha===1;return{disposed:!1,visible:!0,alphaFactor:1,pickable:!0,colorOnly:!1,opaque:a,writeDepth:a}}e.createRenderableState=o;function i(s,a){s.opaque=a.alpha*s.alphaFactor>=1,s.writeDepth=s.opaque}e.updateRenderableState=i})(We||(We={}));function AJ(e,t,r,n){for(let o=t;o0),I.updateIfChanged(r.dOverpaintType,t),r):{tOverpaint:I.create(n),uOverpaintTexDim:I.create(Ae.create(n.width,n.height)),dOverpaint:I.create(e>0),tOverpaintGrid:I.create(fo()),uOverpaintGridDim:I.create(x.create(1,1,1)),uOverpaintGridTransform:I.create(Rt.create(0,0,0,1)),dOverpaintType:I.create(t),uOverpaintStrength:I.create(1)}}var wJ={array:new Uint8Array(4),width:1,height:1};function Ua(e){return e?(I.update(e.tOverpaint,wJ),I.update(e.uOverpaintTexDim,Ae.create(1,1)),e):{tOverpaint:I.create(wJ),uOverpaintTexDim:I.create(Ae.create(1,1)),dOverpaint:I.create(!1),tOverpaintGrid:I.create(fo()),uOverpaintGridDim:I.create(x.create(1,1,1)),uOverpaintGridTransform:I.create(Rt.create(0,0,0,1)),dOverpaintType:I.create("groupInstance"),uOverpaintStrength:I.create(1)}}function IJ(e,t,r,n){for(let o=t;o0),I.updateIfChanged(r.transparencyAverage,mF(n.array,e)),I.updateIfChanged(r.dTransparencyType,t),r):{tTransparency:I.create(n),uTransparencyTexDim:I.create(Ae.create(n.width,n.height)),dTransparency:I.create(e>0),transparencyAverage:I.create(0),tTransparencyGrid:I.create(fo()),uTransparencyGridDim:I.create(x.create(1,1,1)),uTransparencyGridTransform:I.create(Rt.create(0,0,0,1)),dTransparencyType:I.create(t),uTransparencyStrength:I.create(1)}}var PJ={array:new Uint8Array(1),width:1,height:1};function za(e){return e?(I.update(e.tTransparency,PJ),I.update(e.uTransparencyTexDim,Ae.create(1,1)),e):{tTransparency:I.create(PJ),uTransparencyTexDim:I.create(Ae.create(1,1)),dTransparency:I.create(!1),transparencyAverage:I.create(0),tTransparencyGrid:I.create(fo()),uTransparencyGridDim:I.create(x.create(1,1,1)),uTransparencyGridTransform:I.create(Rt.create(0,0,0,1)),dTransparencyType:I.create("groupInstance"),uTransparencyStrength:I.create(1)}}function MJ(e,t,r,n){return e.fill(n,t,r),!0}function BJ(e,t,r){e.fill(0,t,r)}function RJ(e,t,r){let n=Jn(Math.max(1,e),1,Uint8Array,r&&r.tClipping.ref.value.array);return r?(I.update(r.tClipping,n),I.update(r.uClippingTexDim,Ae.create(n.width,n.height)),I.updateIfChanged(r.dClipping,e>0),I.updateIfChanged(r.dClippingType,t),r):{tClipping:I.create(n),uClippingTexDim:I.create(Ae.create(n.width,n.height)),dClipping:I.create(e>0),dClippingType:I.create(t)}}var kJ={array:new Uint8Array(1),width:1,height:1};function Va(e){return e?(I.update(e.tClipping,kJ),I.update(e.uClippingTexDim,Ae.create(1,1)),I.updateIfChanged(e.dClipping,!1),e):{tClipping:I.create(kJ),uClippingTexDim:I.create(Ae.create(1,1)),dClipping:I.create(!1),dClippingType:I.create("groupInstance")}}function FJ(e,t,r,n){for(let o=t;o0),I.updateIfChanged(r.dSubstanceType,t),r):{tSubstance:I.create(n),uSubstanceTexDim:I.create(Ae.create(n.width,n.height)),dSubstance:I.create(e>0),tSubstanceGrid:I.create(fo()),uSubstanceGridDim:I.create(x.create(1,1,1)),uSubstanceGridTransform:I.create(Rt.create(0,0,0,1)),dSubstanceType:I.create(t),uSubstanceStrength:I.create(1)}}var LJ={array:new Uint8Array(4),width:1,height:1};function Ga(e){return e?(I.update(e.tSubstance,LJ),I.update(e.uSubstanceTexDim,Ae.create(1,1)),e):{tSubstance:I.create(LJ),uSubstanceTexDim:I.create(Ae.create(1,1)),dSubstance:I.create(!1),tSubstanceGrid:I.create(fo()),uSubstanceGridDim:I.create(x.create(1,1,1)),uSubstanceGridTransform:I.create(Rt.create(0,0,0,1)),dSubstanceType:I.create("groupInstance"),uSubstanceStrength:I.create(1)}}function UJ(e,t,r,n){for(let o=t;o0),I.updateIfChanged(r.emissiveAverage,fF(n.array,e)),I.updateIfChanged(r.dEmissiveType,t),r):{tEmissive:I.create(n),uEmissiveTexDim:I.create(Ae.create(n.width,n.height)),dEmissive:I.create(e>0),emissiveAverage:I.create(0),tEmissiveGrid:I.create(fo()),uEmissiveGridDim:I.create(x.create(1,1,1)),uEmissiveGridTransform:I.create(Rt.create(0,0,0,1)),dEmissiveType:I.create(t),uEmissiveStrength:I.create(1)}}var NJ={array:new Uint8Array(1),width:1,height:1};function Ha(e){return e?(I.update(e.tEmissive,NJ),I.update(e.uEmissiveTexDim,Ae.create(1,1)),e):{tEmissive:I.create(NJ),uEmissiveTexDim:I.create(Ae.create(1,1)),dEmissive:I.create(!1),emissiveAverage:I.create(0),tEmissiveGrid:I.create(fo()),uEmissiveGridDim:I.create(x.create(1,1,1)),uEmissiveGridTransform:I.create(Rt.create(0,0,0,1)),dEmissiveType:I.create("groupInstance"),uEmissiveStrength:I.create(1)}}var dt;(function(e){function t(B,D,M,R,U,F,N){return N?i(B,D,M,R,U,F,N):o(B,D,M,R,U,F)}e.create=t;function r(B){let D=B?B.vertexBuffer.ref.value:new Float32Array(0),M=B?B.indexBuffer.ref.value:new Uint32Array(0),R=B?B.normalBuffer.ref.value:new Float32Array(0),U=B?B.groupBuffer.ref.value:new Float32Array(0);return t(D,M,R,U,0,0,B)}e.createEmpty=r;function n(B){return zo([B.vertexCount,B.triangleCount,B.vertexBuffer.ref.version,B.indexBuffer.ref.version,B.normalBuffer.ref.version,B.groupBuffer.ref.version])}function o(B,D,M,R,U,F){let N=ge(),z,q=-1,O=-1,J={kind:"mesh",vertexCount:U,triangleCount:F,vertexBuffer:I.create(B),indexBuffer:I.create(D),normalBuffer:I.create(M),groupBuffer:I.create(R),varyingGroup:I.create(!1),get boundingSphere(){let Q=n(J);if(Q!==q){let H=ou(J.vertexBuffer.ref.value,J.vertexCount,1);ge.copy(N,H),q=Q}return N},get groupMapping(){return J.groupBuffer.ref.version!==O&&(z=Ud(J.groupBuffer.ref.value,J.vertexCount),O=J.groupBuffer.ref.version),z},setBoundingSphere(Q){ge.copy(N,Q),q=n(J)},meta:{}};return J}function i(B,D,M,R,U,F,N){return N.vertexCount=U,N.triangleCount=F,I.update(N.vertexBuffer,B),I.update(N.indexBuffer,D),I.update(N.normalBuffer,M),I.update(N.groupBuffer,R),N}function s(B){let{vertexCount:D,triangleCount:M}=B,R=B.vertexBuffer.ref.value,U=B.indexBuffer.ref.value,F=B.normalBuffer.ref.value.length>=D*3?B.normalBuffer.ref.value:new Float32Array(D*3);F===B.normalBuffer.ref.value&&F.fill(0,0,D*3),gP(R,U,F,D,M),I.update(B.normalBuffer,F)}e.computeNormals=s;function a(B,D=3){let M=B.vertexBuffer.ref.value,R=new Map,U=(z,q)=>`${z[0].toFixed(q)}|${z[1].toFixed(q)}|${z[2].toFixed(q)}`,F=0,N=x();for(let z=0,q=B.vertexCount;z{let z=Tg(F,N),q=R.get(z)||0;R.set(z,q+1)};for(let F=0;F{R===1&&(TA(M,U),D.add(M[0]),D.add(M[1]))}),D}function f(B,D,M){let R=new Map,U=(F,N)=>{R.has(F)?So(R.get(F),N):R.set(F,[N])};return D.forEach(F=>{let N=B[F];for(let z of N)D.has(z)&&M.get(Tg(F,z))===1&&U(F,z)}),R}function y(B,D){let{indexBuffer:M,triangleCount:R}=B,U=M.ref.value,F=je.create(Uint32Array,3,1024,R),N=0;for(let q=0;qM.get(fe).length<2).map(fe=>{let De=M.get(fe);return x.fromArray(K,O,fe*3),x.fromArray(ce,O,De[0]*3),x.fromArray(V,O,De[1]*3),x.sub(X,ce,K),x.sub(Z,V,K),[fe,x.angle(X,Z)]});j.sort(([,fe],[,De])=>fe-De);for(let[fe,De]of j){if(le.has(fe)||De>Ie)continue;let Re=M.get(fe);if(D[Re[0]].includes(Re[1])&&!(!((U=M.get(Re[0]))===null||U===void 0)&&U.includes(Re[1]))||(x.fromArray(K,O,fe*3),x.fromArray(ce,O,Re[0]*3),x.fromArray(V,O,Re[1]*3),x.sub(X,ce,K),x.sub(Z,V,K),x.add(de,X,Z),x.squaredDistance(K,ce)>=R))continue;let Xe=!1;for(let L of D[fe])if(!Re.includes(L)&&(x.fromArray(G,O,L*3),x.sub(ie,G,K),x.dot(de,ie)<0)){Xe=!0;break}Xe&&(x.fromArray(we,Q,fe*3),x.triangleNormal(Be,K,ce,V),x.dot(Be,we)>0?je.add3(H,fe,Re[0],Re[1]):je.add3(H,Re[1],Re[0],fe),le.add(fe),le.add(Re[0]),le.add(Re[1]),W+=1)}let ue=je.compact(H);return B.triangleCount=W,I.update(N,ue),B}function v(B,D,M){let{iterations:R,lambda:U}=M,F=x(),N=x(),z=x(),q=x(),O=-U,J=new Float32Array(B.vertexBuffer.ref.value.length),Q=H=>{let W=B.vertexBuffer.ref.value;J.set(W),D.forEach((ce,V)=>{if(ce.length!==2)return;x.fromArray(F,W,V*3),x.fromArray(N,W,ce[0]*3),x.fromArray(z,W,ce[1]*3);let G=1/x.distance(F,N),X=1/x.distance(F,z);x.scale(N,N,G),x.scale(z,z,X),x.add(q,N,z),x.scale(q,q,1/(G+X)),x.sub(q,q,F),x.scale(q,q,H),x.add(q,F,q),x.toArray(q,J,V*3)});let K=B.vertexBuffer.ref.value;I.update(B.vertexBuffer,J),J=K};for(let H=0;H(H<0?(x.fromArray(F,z,Q*3),x.fromArray(N,q,Q*3)):(x.transformMat4Offset(F,z,O,0,Q*3,H*16),x.transformDirectionOffset(N,q,O,0,Q*3,H*16)),U))}function _(B,D,M,R,U){let{instanceCount:F,groupCount:N}=M,z=S(B,D),q=Ci(M,z,R.color),O=U.instanceGranularity?Gn(F,"instance"):Gn(F*N,"groupInstance"),J=Ua(),Q=za(),H=Ha(),W=Ga(),K=Va(),ce={drawCount:B.triangleCount*3,vertexCount:B.vertexCount,groupCount:N,instanceCount:F},V=ge.clone(B.boundingSphere),G=Ko(V,D.aTransform.ref.value,F,0);return te(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("mesh"),aPosition:B.vertexBuffer,aNormal:B.normalBuffer,aGroup:B.groupBuffer,elements:B.indexBuffer,dVaryingGroup:B.varyingGroup,boundingSphere:I.create(G),invariantBoundingSphere:I.create(V),uInvariantBoundingSphere:I.create(Rt.ofSphere(V))},q),O),J),Q),H),W),K),D),We.createValues(U,ce)),{uDoubleSided:I.create(U.doubleSided),dFlatShaded:I.create(U.flatShaded),dFlipSided:I.create(U.flipSided),dIgnoreLight:I.create(U.ignoreLight),dXrayShaded:I.create(U.xrayShaded==="inverted"?"inverted":U.xrayShaded===!0?"on":"off"),dTransparentBackfaces:I.create(U.transparentBackfaces),uBumpFrequency:I.create(U.bumpFrequency),uBumpAmplitude:I.create(U.bumpAmplitude),meta:I.create(B.meta)})}function w(B,D,M,R,U){let F=We.createSimple(M,R,U),N=k(k({},C.getDefaultValues(e.Params)),D);return _(B,F.transform,F.locationIterator,F.theme,N)}function E(B,D){We.updateValues(B,D),I.updateIfChanged(B.uDoubleSided,D.doubleSided),I.updateIfChanged(B.dFlatShaded,D.flatShaded),I.updateIfChanged(B.dFlipSided,D.flipSided),I.updateIfChanged(B.dIgnoreLight,D.ignoreLight),I.updateIfChanged(B.dXrayShaded,D.xrayShaded==="inverted"?"inverted":D.xrayShaded===!0?"on":"off"),I.updateIfChanged(B.dTransparentBackfaces,D.transparentBackfaces),I.updateIfChanged(B.uBumpFrequency,D.bumpFrequency),I.updateIfChanged(B.uBumpAmplitude,D.bumpAmplitude)}function A(B,D){let M=ge.clone(D.boundingSphere),R=Ko(M,B.aTransform.ref.value,B.instanceCount.ref.value,0);ge.equals(R,B.boundingSphere.ref.value)||I.update(B.boundingSphere,R),ge.equals(M,B.invariantBoundingSphere.ref.value)||(I.update(B.invariantBoundingSphere,M),I.update(B.uInvariantBoundingSphere,Rt.fromSphere(B.uInvariantBoundingSphere.ref.value,M)))}function P(B){let D=We.createRenderableState(B);return T(D,B),D}function T(B,D){We.updateRenderableState(B,D),B.opaque=B.opaque&&!D.xrayShaded,B.writeDepth=B.opaque}})(dt||(dt={}));function i0(e,t,r){return e=po(Math.round(e),0,16777215)+1,t[r+2]=e%256,e=Math.floor(e/256),t[r+1]=e%256,e=Math.floor(e/256),t[r]=e%256,t}function D1(e,t,r){return Math.floor(e)*256*256+Math.floor(t)*256+Math.floor(r)-1}var EP=255/256,hF=x.create(256*256*256,256*256,256),oEe=Rt.create(EP/hF[0],EP/hF[1],EP/hF[2],EP/1),GJ=Rt();function HJ(e,t,r,n){return Rt.set(GJ,e/255,t/255,r/255,n/255),Rt.dot(GJ,oEe)}function ja(e,t,r){switch(ii.getGranularity(e,t.granularity)){case"uniform":return lEe(e,t.size,r);case"group":return uEe(e,t.size,r);case"groupInstance":return dEe(e,t.size,r);case"instance":return cEe(e,t.size,r)}}var DP=100;function s0(e){switch(e.dSizeType.ref.value){case"uniform":return e.uSize.ref.value;case"instance":case"group":case"groupInstance":let r=0,n=e.tSize.ref.value.array;for(let o=0,i=n.length;o(A<0?x.fromArray(b,S,E*3):x.transformMat4Offset(b,S,_,0,E*3,A*16),v))}function l(h,f,y,g,v){let{instanceCount:b,groupCount:S}=y,_=a(h,f),w=Ci(y,_,g.color),E=ja(y,g.size),A=v.instanceGranularity?Gn(b,"instance"):Gn(b*S,"groupInstance"),P=Ua(),T=za(),B=Ha(),D=Ga(),M=Va(),R={drawCount:h.pointCount,vertexCount:h.pointCount,groupCount:S,instanceCount:b},U=ge.clone(h.boundingSphere),F=Ko(U,f.aTransform.ref.value,b,0);return te(k(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("points"),aPosition:h.centerBuffer,aGroup:h.groupBuffer,boundingSphere:I.create(F),invariantBoundingSphere:I.create(U),uInvariantBoundingSphere:I.create(Rt.ofSphere(U))},w),E),A),P),T),B),D),M),f),We.createValues(v,R)),{uSizeFactor:I.create(v.sizeFactor),dPointSizeAttenuation:I.create(v.pointSizeAttenuation),dPointStyle:I.create(v.pointStyle)})}function c(h,f,y,g,v){let b=We.createSimple(y,g,v),S=k(k({},C.getDefaultValues(e.Params)),f);return l(h,b.transform,b.locationIterator,b.theme,S)}function u(h,f){We.updateValues(h,f),I.updateIfChanged(h.uSizeFactor,f.sizeFactor),I.updateIfChanged(h.dPointSizeAttenuation,f.pointSizeAttenuation),I.updateIfChanged(h.dPointStyle,f.pointStyle)}function d(h,f){let y=ge.clone(f.boundingSphere),g=Ko(y,h.aTransform.ref.value,h.instanceCount.ref.value,0);ge.equals(g,h.boundingSphere.ref.value)||I.update(h.boundingSphere,g),ge.equals(y,h.invariantBoundingSphere.ref.value)||(I.update(h.invariantBoundingSphere,y),I.update(h.uInvariantBoundingSphere,Rt.fromSphere(h.uInvariantBoundingSphere.ref.value,y)))}function m(h){let f=We.createRenderableState(h);return p(f,h),f}function p(h,f){We.updateRenderableState(h,f),h.opaque=h.opaque&&f.pointStyle!=="fuzzy",h.writeDepth=h.opaque}})(su||(su={}));function yF(e,t,r,n,o,i,s){for(let a=0;an&&(this.currentX=0,this.currentY+=this.scratchH),this.currentY+this.scratchH>o)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(let s=0;s(E<0?x.fromArray(v,b,w*3):x.transformMat4Offset(v,b,S,0,w*3,E*16),g))}function a(p,h,f,y,g){let{instanceCount:v,groupCount:b}=f,S=s(p,h),_=Ci(f,S,y.color),w=ja(f,y.size),E=g.instanceGranularity?Gn(v,"instance"):Gn(v*b,"groupInstance"),A=Ua(),P=za(),T=Ha(),B=Ga(),D=Va(),M={drawCount:p.charCount*2*3,vertexCount:p.charCount*4,groupCount:b,instanceCount:v},R=YJ(p.mappingBuffer.ref.value,p.depthBuffer.ref.value,p.charCount,s0(w)),U=ge.expand(ge(),p.boundingSphere,R),F=Ko(U,h.aTransform.ref.value,v,0);return te(k(te(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("text"),aPosition:p.centerBuffer,aMapping:p.mappingBuffer,aDepth:p.depthBuffer,aGroup:p.groupBuffer,elements:p.indexBuffer,boundingSphere:I.create(F),invariantBoundingSphere:I.create(U),uInvariantBoundingSphere:I.create(Rt.ofSphere(U))},_),w),E),A),P),T),B),D),h),{aTexCoord:p.tcoordBuffer,tFont:p.fontTexture,padding:I.create(R)}),We.createValues(g,M)),{uSizeFactor:I.create(g.sizeFactor),uBorderWidth:I.create(po(g.borderWidth,0,.5)),uBorderColor:I.create(Oe.toArrayNormalized(g.borderColor,x.zero(),0)),uOffsetX:I.create(g.offsetX),uOffsetY:I.create(g.offsetY),uOffsetZ:I.create(g.offsetZ),uBackgroundColor:I.create(Oe.toArrayNormalized(g.backgroundColor,x.zero(),0)),uBackgroundOpacity:I.create(g.backgroundOpacity)})}function l(p,h,f,y,g){let v=We.createSimple(f,y,g),b=k(k({},C.getDefaultValues(e.Params)),h);return a(p,v.transform,v.locationIterator,v.theme,b)}function c(p,h){We.updateValues(p,h),I.updateIfChanged(p.uSizeFactor,h.sizeFactor),I.updateIfChanged(p.uBorderWidth,h.borderWidth),Oe.fromNormalizedArray(p.uBorderColor.ref.value,0)!==h.borderColor&&(Oe.toArrayNormalized(h.borderColor,p.uBorderColor.ref.value,0),I.update(p.uBorderColor,p.uBorderColor.ref.value)),I.updateIfChanged(p.uOffsetX,h.offsetX),I.updateIfChanged(p.uOffsetY,h.offsetY),I.updateIfChanged(p.uOffsetZ,h.offsetZ),Oe.fromNormalizedArray(p.uBackgroundColor.ref.value,0)!==h.backgroundColor&&(Oe.toArrayNormalized(h.backgroundColor,p.uBackgroundColor.ref.value,0),I.update(p.uBackgroundColor,p.uBackgroundColor.ref.value)),I.updateIfChanged(p.uBackgroundOpacity,h.backgroundOpacity)}function u(p,h){let f=YJ(p.aMapping.ref.value,p.aDepth.ref.value,h.charCount,s0(p)),y=ge.expand(ge(),h.boundingSphere,f),g=Ko(y,p.aTransform.ref.value,p.instanceCount.ref.value,0);ge.equals(g,p.boundingSphere.ref.value)||I.update(p.boundingSphere,g),ge.equals(y,p.invariantBoundingSphere.ref.value)||(I.update(p.invariantBoundingSphere,y),I.update(p.uInvariantBoundingSphere,Rt.fromSphere(p.uInvariantBoundingSphere.ref.value,y))),I.update(p.padding,f)}function d(p){let h=We.createRenderableState(p);return m(h,p),h}function m(p,h){We.updateRenderableState(p,h),p.pickable=!1,p.opaque=!1,p.writeDepth=!0}})(Zi||(Zi={}));function YJ(e,t,r,n){let o=0,i=0;for(let s=0,a=r*4;so&&(o=c);let u=Math.abs(e[l+1]);u>o&&(o=u);let d=Math.abs(t[s]);d>i&&(i=d)}return Math.max(i,n+n*o)}var Tc=x(),rp=x(),l_=x(),XJ=je.add,kP=je.add3,Gs;(function(e){function t(r=2048,n=1024,o){let i=je.create(Float32Array,1,n,o?o.groupBuffer.ref.value:r),s=je.create(Float32Array,3,n,o?o.startBuffer.ref.value:r),a=je.create(Float32Array,3,n,o?o.endBuffer.ref.value:r),l=(d,m,p,h,f,y,g)=>{for(let v=0;v<4;++v)kP(s,d,m,p),kP(a,h,f,y),XJ(i,g)},c=(d,m,p)=>{for(let h=0;h<4;++h)kP(s,d[0],d[1],d[2]),kP(a,m[0],m[1],m[2]),XJ(i,p)},u=(d,m,p,h)=>{let f=x.distance(d,m),y=p%2!==0,g=Math.floor((p+1)/2),v=f/(p+.5);x.setMagnitude(l_,x.sub(l_,m,d),v),x.copy(Tc,d);for(let b=0;b{let f=x.distance(d,m);u(d,m,f/p,h)},addCage:(d,m,p)=>{let{vertices:h,edges:f}=m;for(let y=0,g=f.length;y{let d=i.elementCount/4,m=je.compact(i,!0),p=je.compact(s,!0),h=je.compact(a,!0),f=o&&d<=o.lineCount?o.mappingBuffer.ref.value:new Float32Array(d*8),y=o&&d<=o.lineCount?o.indexBuffer.ref.value:new Uint32Array(d*6);return(!o||d>o.lineCount)&&fEe(d,f,y),hn.create(f,y,m,p,h,d,o)}}}e.create=t})(Gs||(Gs={}));function fEe(e,t,r){for(let n=0;nb.lineCount&&(I.update(b.mappingBuffer,p),I.update(b.indexBuffer,h)),b.lineCount=v,I.update(b.groupBuffer,f),I.update(b.startBuffer,y),I.update(b.endBuffer,g),b}function a(p,h){let f=p.startBuffer.ref.value;Nd(h,f,0,p.lineCount*4),I.update(p.startBuffer,f);let y=p.endBuffer.ref.value;Nd(h,y,0,p.lineCount*4),I.update(p.endBuffer,y)}e.transform=a,e.Params=te(k({},We.Params),{sizeFactor:C.Numeric(2,{min:0,max:10,step:.1}),lineSizeAttenuation:C.Boolean(!1)}),e.Utils={Params:e.Params,createEmpty:r,createValues:c,createValuesSimple:u,updateValues:d,updateBoundingSphere:m,createRenderableState:We.createRenderableState,updateRenderableState:We.updateRenderableState,createPositionIterator:l};function l(p,h){let f=p.lineCount*4,y=h.instanceCount.ref.value,g=jl(),v=g.position,b=p.startBuffer.ref.value,S=p.endBuffer.ref.value,_=h.aTransform.ref.value;return Pr(f,y,2,(E,A)=>{let P=E%4===0?b:S;return A<0?x.fromArray(v,P,E*3):x.transformMat4Offset(v,P,_,0,E*3,A*16),g})}function c(p,h,f,y,g){let{instanceCount:v,groupCount:b}=f,S=l(p,h),_=Ci(f,S,y.color),w=ja(f,y.size),E=g.instanceGranularity?Gn(v,"instance"):Gn(v*b,"groupInstance"),A=Ua(),P=za(),T=Ha(),B=Ga(),D=Va(),M={drawCount:p.lineCount*2*3,vertexCount:p.lineCount*4,groupCount:b,instanceCount:v},R=ge.clone(p.boundingSphere),U=Ko(R,h.aTransform.ref.value,v,0);return te(k(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("lines"),aMapping:p.mappingBuffer,aGroup:p.groupBuffer,aStart:p.startBuffer,aEnd:p.endBuffer,elements:p.indexBuffer,boundingSphere:I.create(U),invariantBoundingSphere:I.create(R),uInvariantBoundingSphere:I.create(Rt.ofSphere(R))},_),w),E),A),P),T),B),D),h),We.createValues(g,M)),{uSizeFactor:I.create(g.sizeFactor),dLineSizeAttenuation:I.create(g.lineSizeAttenuation),uDoubleSided:I.create(!0),dFlipSided:I.create(!1)})}function u(p,h,f,y,g){let v=We.createSimple(f,y,g),b=k(k({},C.getDefaultValues(e.Params)),h);return c(p,v.transform,v.locationIterator,v.theme,b)}function d(p,h){We.updateValues(p,h),I.updateIfChanged(p.uSizeFactor,h.sizeFactor),I.updateIfChanged(p.dLineSizeAttenuation,h.lineSizeAttenuation)}function m(p,h){let f=ge.clone(h.boundingSphere),y=Ko(f,p.aTransform.ref.value,p.instanceCount.ref.value,0);ge.equals(y,p.boundingSphere.ref.value)||I.update(p.boundingSphere,y),ge.equals(f,p.invariantBoundingSphere.ref.value)||(I.update(p.invariantBoundingSphere,f),I.update(p.uInvariantBoundingSphere,Rt.fromSphere(p.uInvariantBoundingSphere.ref.value,f)))}})(hn||(hn={}));var KJ=x(),QJ=x(),ZJ=x();function k1(e,t){let r=t.length,n=np(r/3);for(let o=0;o{x.toArray(a,r,i),x.toArray(l,r,i+3),x.toArray(c,r,i+6),x.triangleNormal(MP,a,l,c);for(let u=0;u<3;++u)x.toArray(MP,n,i+3*u),o[s+u]=i/3+u;i+=9,s+=3},addQuad:(a,l,c,u)=>{x.toArray(a,r,i),x.toArray(l,r,i+3),x.toArray(c,r,i+6),x.toArray(u,r,i+9),x.triangleNormal(MP,a,l,c);for(let m=0;m<4;++m)x.toArray(MP,n,i+3*m);let d=i/3;o[s]=d,o[s+1]=d+1,o[s+2]=d+2,o[s+3]=d+2,o[s+4]=d+3,o[s+5]=d,i+=12,s+=6},getPrimitive:()=>({vertices:r,normals:n,indices:o})}}var db=x(),hEe=Kt();function mb(e,t){let{vertices:r,normals:n}=e,o=Kt.directionTransform(hEe,t);for(let i=0,s=r.length;i({x:t[0],alpha:t[1]}))}function IF(e,t){let r=[{x:0,alpha:0},{x:0,alpha:0},...e,{x:1,alpha:0},{x:1,alpha:0}],n=256,o=t?t.ref.value.array:new Uint8Array(n),i=0,s,a,l,c,u,d,m=e.length+1;for(let h=0;h{let R=Math.floor(D/_);return P[0]=Math.floor(R/S),P[1]=R%S,P[2]=D%_,x.transformMat4(P,P,v),M>=0&&x.transformMat4Offset(P,P,T,0,0,M*16),A})}function a(y,g){return Math.ceil(x.magnitude(y)*g)}function l(y,g){return Math.min(...y)*(1/g)}function c(y){return 1/y}function u(y,g,v,b,S){let{gridTexture:_,gridTextureDim:w,gridStats:E}=y,{bboxSize:A,bboxMin:P,bboxMax:T,gridDimension:B,transform:D}=y,{instanceCount:M,groupCount:R}=v,U=e.Utils.createPositionIterator(y,g),F=Ci(v,U,b.color),N=S.instanceGranularity?Gn(M,"instance"):Gn(M*R,"groupInstance"),z=Ua(),q=za(),O=Ha(),J=Ga(),Q=Va(),[H,W,K]=B.ref.value,ce={drawCount:EF.indices.length,vertexCount:H*W*K,groupCount:R,instanceCount:M},V=ge.clone(y.boundingSphere),G=Ko(V,g.aTransform.ref.value,M,0),X=PF(S.controlPoints),Z=IF(X);return te(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("directVolume")},F),N),z),q),O),J),Q),g),We.createValues(S,ce)),{aPosition:I.create(EF.vertices),elements:I.create(EF.indices),boundingSphere:I.create(G),invariantBoundingSphere:I.create(V),uInvariantBoundingSphere:I.create(Rt.ofSphere(V)),uBboxMin:P,uBboxMax:T,uBboxSize:A,uMaxSteps:I.create(a(B.ref.value,S.stepsPerCell)),uStepScale:I.create(l(y.cellDim.ref.value,S.stepsPerCell)),uJumpLength:I.create(S.jumpLength),uTransform:D,uGridDim:B,tTransferTex:Z,uTransferScale:I.create(c(S.stepsPerCell)),dGridTexType:I.create(_.ref.value.getDepth()>0?"3d":"2d"),uGridTexDim:w,tGridTex:_,uGridStats:E,uCellDim:y.cellDim,uCartnToUnit:y.cartnToUnit,uUnitToCartn:y.unitToCartn,dPackedGroup:y.packedGroup,dAxisOrder:I.create(y.axisOrder.ref.value.join("")),dIgnoreLight:I.create(S.ignoreLight),dXrayShaded:I.create(S.xrayShaded==="inverted"?"inverted":S.xrayShaded===!0?"on":"off")})}function d(y,g,v,b,S){let _=We.createSimple(v,b,S),w=k(k({},C.getDefaultValues(e.Params)),g);return u(y,_.transform,_.locationIterator,_.theme,w)}function m(y,g){We.updateValues(y,g),I.updateIfChanged(y.dIgnoreLight,g.ignoreLight),I.updateIfChanged(y.dXrayShaded,g.xrayShaded==="inverted"?"inverted":g.xrayShaded===!0?"on":"off");let v=PF(g.controlPoints);IF(v,y.tTransferTex),I.updateIfChanged(y.uMaxSteps,a(y.uGridDim.ref.value,g.stepsPerCell)),I.updateIfChanged(y.uStepScale,l(y.uCellDim.ref.value,g.stepsPerCell)),I.updateIfChanged(y.uTransferScale,c(g.stepsPerCell)),I.updateIfChanged(y.uJumpLength,g.jumpLength)}function p(y,g){let v=ge.clone(g.boundingSphere),b=Ko(v,y.aTransform.ref.value,y.instanceCount.ref.value,0);ge.equals(b,y.boundingSphere.ref.value)||I.update(y.boundingSphere,b),ge.equals(v,y.invariantBoundingSphere.ref.value)||(I.update(y.invariantBoundingSphere,v),I.update(y.uInvariantBoundingSphere,Rt.fromSphere(y.uInvariantBoundingSphere.ref.value,v)))}function h(y){let g=We.createRenderableState(y);return g.opaque=!1,g.writeDepth=!1,g}function f(y,g){We.updateRenderableState(y,g),y.opaque=!1,y.writeDepth=!1}})(Aa||(Aa={}));function gEe(e,t){return ge.fromDimensionsAndTransform(ge(),e,t)}var aa;(function(e){function t(b,S,_,w){return w?i(b,S,_,w):o(b,S,_)}e.create=t;function r(b){let S=b?b.centerBuffer.ref.value:new Float32Array(0),_=b?b.groupBuffer.ref.value:new Float32Array(0);return t(S,_,0,b)}e.createEmpty=r;function n(b){return zo([b.sphereCount,b.centerBuffer.ref.version,b.groupBuffer.ref.version])}function o(b,S,_){let w=ge(),E,A=-1,P=-1,T=I.create(Jn(1,4,Float32Array)),B=I.create(Ae.create(0,0)),D=I.create([]),M=I.create(0),R={kind:"spheres",sphereCount:_,centerBuffer:I.create(b),groupBuffer:I.create(S),get boundingSphere(){let U=n(R);if(U!==A){let F=ou(R.centerBuffer.ref.value,R.sphereCount,1);ge.copy(w,F),A=U}return w},get groupMapping(){return R.groupBuffer.ref.version!==P&&(E=Ud(R.groupBuffer.ref.value,R.sphereCount),P=R.groupBuffer.ref.version),E},setBoundingSphere(U){ge.copy(w,U),A=n(R)},shaderData:{positionGroup:T,texDim:B,lodLevels:D,sizeFactor:M,update(U){var F,N;let z=(F=U?.lodLevels)!==null&&F!==void 0?F:c(D.ref.value),q=(N=U?.sizeFactor)!==null&&N!==void 0?N:M.ref.value,O=d(z,q),J=Jn(R.sphereCount,4,Float32Array,T.ref.value.array),Q=s(J,R.centerBuffer.ref.value,R.groupBuffer.ref.value,R.sphereCount,O),H=Q?l(z,q,Q,R.sphereCount):[];I.update(T,J),I.update(B,Ae.set(B.ref.value,J.width,J.height)),I.update(D,H),I.update(M,q)}}};return R.shaderData.update(),R}function i(b,S,_,w){return w.sphereCount=_,I.update(w.centerBuffer,b),I.update(w.groupBuffer,S),w.shaderData.update(),w}function s(b,S,_,w,E){let{array:A}=b;if(E.length===0){for(let B=0;B{let P=u(E,S);return[E.minDistance,E.maxDistance,E.overlap,_[_.length-1-A],Math.pow(Math.min(w,P),1/E.scaleBias),E.stride,E.scaleBias]})}function c(b){return b.map(S=>({minDistance:S[0],maxDistance:S[1],overlap:S[2],stride:S[5],scaleBias:S[6]}))}function u(b,S){return Math.max(1,Math.round(b.stride/Math.pow(S,b.scaleBias)))}function d(b,S){return b.map(_=>u(_,S)).reverse()}e.Params=te(k({},We.Params),{sizeFactor:C.Numeric(1,{min:0,max:10,step:.1}),doubleSided:C.Boolean(!1,We.CustomQualityParamInfo),ignoreLight:C.Boolean(!1,We.ShadingCategory),xrayShaded:C.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],We.ShadingCategory),transparentBackfaces:C.Select("off",C.arrayToOptions(["off","on","opaque"]),We.ShadingCategory),solidInterior:C.Boolean(!0,We.ShadingCategory),clipPrimitive:C.Boolean(!1,te(k({},We.ShadingCategory),{description:"Clip whole sphere instead of cutting it."})),approximate:C.Boolean(!1,te(k({},We.ShadingCategory),{description:"Faster rendering, but has artifacts."})),alphaThickness:C.Numeric(0,{min:0,max:20,step:1},te(k({},We.ShadingCategory),{description:"If not zero, adjusts alpha for radius."})),bumpFrequency:C.Numeric(0,{min:0,max:10,step:.1},We.ShadingCategory),bumpAmplitude:C.Numeric(1,{min:0,max:5,step:.1},We.ShadingCategory),lodLevels:C.ObjectList({minDistance:C.Numeric(0),maxDistance:C.Numeric(0),overlap:C.Numeric(0),stride:C.Numeric(0),scaleBias:C.Numeric(3,{min:.1,max:10,step:.1})},b=>`${b.stride}`,te(k({},We.CullingLodCategory),{defaultValue:[]}))}),e.Utils={Params:e.Params,createEmpty:r,createValues:p,createValuesSimple:h,updateValues:f,updateBoundingSphere:y,createRenderableState:g,updateRenderableState:v,createPositionIterator:m};function m(b,S){let _=b.sphereCount,w=S.instanceCount.ref.value,E=jl(),A=E.position,P=b.centerBuffer.ref.value,T=S.aTransform.ref.value;return Pr(_,w,1,(D,M)=>(M<0?x.fromArray(A,P,D*3):x.transformMat4Offset(A,P,T,0,D*3,M*16),E))}function p(b,S,_,w,E){let{instanceCount:A,groupCount:P}=_,T=m(b,S),B=Ci(_,T,w.color),D=ja(_,w.size),M=E.instanceGranularity?Gn(A,"instance"):Gn(A*P,"groupInstance"),R=Ua(),U=za(),F=Ha(),N=Ga(),z=Va(),q={drawCount:b.sphereCount*2*3,vertexCount:b.sphereCount*6,groupCount:P,instanceCount:A},O=b.boundingSphere.radius?s0(D)*E.sizeFactor:0,J=ge.expand(ge(),b.boundingSphere,O),Q=Ko(J,S.aTransform.ref.value,A,0);return b.shaderData.update({lodLevels:E.lodLevels,sizeFactor:E.sizeFactor}),te(k(te(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("spheres"),uTexDim:b.shaderData.texDim,tPositionGroup:b.shaderData.positionGroup,boundingSphere:I.create(Q),invariantBoundingSphere:I.create(J),uInvariantBoundingSphere:I.create(Rt.ofSphere(J))},B),D),M),R),U),F),N),z),S),{padding:I.create(O)}),We.createValues(E,q)),{uSizeFactor:b.shaderData.sizeFactor,uDoubleSided:I.create(E.doubleSided),dIgnoreLight:I.create(E.ignoreLight),dXrayShaded:I.create(E.xrayShaded==="inverted"?"inverted":E.xrayShaded===!0?"on":"off"),dTransparentBackfaces:I.create(E.transparentBackfaces),dSolidInterior:I.create(E.solidInterior),dClipPrimitive:I.create(E.clipPrimitive),dApproximate:I.create(E.approximate),uAlphaThickness:I.create(E.alphaThickness),uBumpFrequency:I.create(E.bumpFrequency),uBumpAmplitude:I.create(E.bumpAmplitude),lodLevels:b.shaderData.lodLevels,centerBuffer:b.centerBuffer,groupBuffer:b.groupBuffer})}function h(b,S,_,w,E){let A=We.createSimple(_,w,E),P=k(k({},C.getDefaultValues(e.Params)),S);return p(b,A.transform,A.locationIterator,A.theme,P)}function f(b,S){We.updateValues(b,S),I.updateIfChanged(b.uSizeFactor,S.sizeFactor),I.updateIfChanged(b.uDoubleSided,S.doubleSided),I.updateIfChanged(b.dIgnoreLight,S.ignoreLight),I.updateIfChanged(b.dXrayShaded,S.xrayShaded==="inverted"?"inverted":S.xrayShaded===!0?"on":"off"),I.updateIfChanged(b.dTransparentBackfaces,S.transparentBackfaces),I.updateIfChanged(b.dSolidInterior,S.solidInterior),I.updateIfChanged(b.dClipPrimitive,S.clipPrimitive),I.updateIfChanged(b.dApproximate,S.approximate),I.updateIfChanged(b.uAlphaThickness,S.alphaThickness),I.updateIfChanged(b.uBumpFrequency,S.bumpFrequency),I.updateIfChanged(b.uBumpAmplitude,S.bumpAmplitude);let _=c(b.lodLevels.ref.value);if(!a(S.lodLevels,_)){let w=b.uVertexCount.ref.value/6,E=d(S.lodLevels,S.sizeFactor),A=s(b.tPositionGroup.ref.value,b.centerBuffer.ref.value,b.groupBuffer.ref.value,w,E),P=A?l(S.lodLevels,S.sizeFactor,A,w):[];I.update(b.tPositionGroup,b.tPositionGroup.ref.value),I.update(b.lodLevels,P)}}function y(b,S){let _=S.boundingSphere.radius?s0(b)*b.uSizeFactor.ref.value:0,w=ge.expand(ge(),S.boundingSphere,_),E=Ko(w,b.aTransform.ref.value,b.instanceCount.ref.value,0);ge.equals(E,b.boundingSphere.ref.value)||I.update(b.boundingSphere,E),ge.equals(w,b.invariantBoundingSphere.ref.value)||(I.update(b.invariantBoundingSphere,w),I.update(b.uInvariantBoundingSphere,Rt.fromSphere(b.uInvariantBoundingSphere.ref.value,w))),I.update(b.padding,_)}function g(b){let S=We.createRenderableState(b);return v(S,b),S}function v(b,S){We.updateRenderableState(b,S),b.opaque=b.opaque&&!S.xrayShaded,b.writeDepth=b.opaque}})(aa||(aa={}));var ms;(function(e){class t{constructor(){this.index=0,this.textures=[]}get(){return this.textures[this.index]}set(p,h,f){this.textures[this.index]=Object.assign(this.textures[this.index]||{},{vertex:p,group:h,normal:f}),this.index=(this.index+1)%2}destroy(){for(let p of this.textures)p.vertex.destroy(),p.group.destroy(),p.normal.destroy()}}e.DoubleBuffer=t;function r(m,p,h,f,y,g,v){let b=h.getWidth(),S=h.getHeight();return v?(v.vertexCount=m,v.groupCount=p,I.update(v.geoTextureDim,Ae.set(v.geoTextureDim.ref.value,b,S)),I.update(v.vertexTexture,h),I.update(v.groupTexture,f),I.update(v.normalTexture,y),v.doubleBuffer.set(h,f,y),ge.copy(v.boundingSphere,g),v):{kind:"texture-mesh",vertexCount:m,groupCount:p,geoTextureDim:I.create(Ae.create(b,S)),vertexTexture:I.create(h),groupTexture:I.create(f),normalTexture:I.create(y),varyingGroup:I.create(!1),doubleBuffer:new t,boundingSphere:ge.clone(g),meta:{}}}e.create=r;function n(m){let p=m?m.vertexTexture.ref.value:fo(),h=m?m.groupTexture.ref.value:fo(),f=m?m.normalTexture.ref.value:fo(),y=m?m.boundingSphere:ge();return r(0,0,p,h,f,y,m)}e.createEmpty=n,e.Params=te(k({},We.Params),{doubleSided:C.Boolean(!1,We.CustomQualityParamInfo),flipSided:C.Boolean(!1,We.ShadingCategory),flatShaded:C.Boolean(!1,We.ShadingCategory),ignoreLight:C.Boolean(!1,We.ShadingCategory),xrayShaded:C.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],We.ShadingCategory),transparentBackfaces:C.Select("off",C.arrayToOptions(["off","on","opaque"]),We.ShadingCategory),bumpFrequency:C.Numeric(0,{min:0,max:10,step:.1},We.ShadingCategory),bumpAmplitude:C.Numeric(1,{min:0,max:5,step:.1},We.ShadingCategory)}),e.Utils={Params:e.Params,createEmpty:n,createValues:s,createValuesSimple:a,updateValues:l,updateBoundingSphere:c,createRenderableState:u,updateRenderableState:d,createPositionIterator:i};let o="texture-mesh";function i(m,p){let h=m.meta.webgl;if(!h)return Pr(1,1,1,()=>Qi);h.namedFramebuffers[o]||(h.namedFramebuffers[o]=h.resources.framebuffer());let f=h.namedFramebuffers[o],[y,g]=m.geoTextureDim.ref.value,v=new Float32Array(y*g*4);f.bind(),m.vertexTexture.ref.value.attachFramebuffer(f,0),h.readPixels(0,0,y,g,v);let b=new Float32Array(y*g*4);f.bind(),m.normalTexture.ref.value.attachFramebuffer(f,0),h.readPixels(0,0,y,g,b);let S=m.vertexCount,_=p.instanceCount.ref.value,w=jl(),E=w.position,A=w.normal,P=p.aTransform.ref.value;return Pr(S,_,1,(B,D)=>(D<0?(x.fromArray(E,v,B*4),x.fromArray(A,b,B*4)):(x.transformMat4Offset(E,v,P,0,B*4,D*16),x.transformDirectionOffset(A,b,P,0,B*4,D*16)),w))}function s(m,p,h,f,y){let{instanceCount:g,groupCount:v}=h,b=e.Utils.createPositionIterator(m,p),S=Ci(h,b,f.color),_=y.instanceGranularity?Gn(g,"instance"):Gn(g*v,"groupInstance"),w=Ua(),E=za(),A=Ha(),P=Ga(),T=Va(),B={drawCount:m.vertexCount,vertexCount:m.vertexCount,groupCount:v,instanceCount:g},D=ge.clone(m.boundingSphere),M=Ko(D,p.aTransform.ref.value,g,0);return te(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("textureMesh"),uGeoTexDim:m.geoTextureDim,tPosition:m.vertexTexture,tGroup:m.groupTexture,tNormal:m.normalTexture,dVaryingGroup:m.varyingGroup,boundingSphere:I.create(M),invariantBoundingSphere:I.create(D),uInvariantBoundingSphere:I.create(Rt.ofSphere(D))},S),_),w),E),A),P),T),p),We.createValues(y,B)),{uDoubleSided:I.create(y.doubleSided),dFlatShaded:I.create(y.flatShaded),dFlipSided:I.create(y.flipSided),dIgnoreLight:I.create(y.ignoreLight),dXrayShaded:I.create(y.xrayShaded==="inverted"?"inverted":y.xrayShaded===!0?"on":"off"),dTransparentBackfaces:I.create(y.transparentBackfaces),uBumpFrequency:I.create(y.bumpFrequency),uBumpAmplitude:I.create(y.bumpAmplitude),meta:I.create(m.meta)})}function a(m,p,h,f,y){let g=We.createSimple(h,f,y),v=k(k({},C.getDefaultValues(e.Params)),p);return s(m,g.transform,g.locationIterator,g.theme,v)}function l(m,p){We.updateValues(m,p),I.updateIfChanged(m.uDoubleSided,p.doubleSided),I.updateIfChanged(m.dFlatShaded,p.flatShaded),I.updateIfChanged(m.dFlipSided,p.flipSided),I.updateIfChanged(m.dIgnoreLight,p.ignoreLight),I.updateIfChanged(m.dXrayShaded,p.xrayShaded==="inverted"?"inverted":p.xrayShaded===!0?"on":"off"),I.updateIfChanged(m.dTransparentBackfaces,p.transparentBackfaces),I.updateIfChanged(m.uBumpFrequency,p.bumpFrequency),I.updateIfChanged(m.uBumpAmplitude,p.bumpAmplitude)}function c(m,p){let h=ge.clone(p.boundingSphere),f=Ko(h,m.aTransform.ref.value,m.instanceCount.ref.value,0);ge.equals(f,m.boundingSphere.ref.value)||I.update(m.boundingSphere,f),ge.equals(h,m.invariantBoundingSphere.ref.value)||(I.update(m.invariantBoundingSphere,h),I.update(m.uInvariantBoundingSphere,Rt.fromSphere(m.uInvariantBoundingSphere.ref.value,h)))}function u(m){let p=We.createRenderableState(m);return d(p,m),p}function d(m,p){We.updateRenderableState(m,p),m.opaque=m.opaque&&!p.xrayShaded,m.writeDepth=m.opaque}})(ms||(ms={}));function eee(e,t){let r={},n={},o={},i={},s={},a={},l={};return Object.keys(e).forEach(c=>{let u=e[c];u.type==="attribute"&&(r[c]=t[c]),u.type==="define"&&(n[c]=t[c]),u.type==="texture"&&t[c]!==void 0&&(u.variant==="material"?i[c]=t[c]:o[c]=t[c]),u.type==="uniform"&&t[c]!==void 0&&(u.variant==="material"?a[c]=t[c]:u.variant==="buffered"?l[c]=t[c]:s[c]=t[c])}),{attributeValues:r,defineValues:n,textureValues:o,materialTextureValues:i,uniformValues:s,materialUniformValues:a,bufferedUniformValues:l}}function tee(e){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].ref.version}),t}function nn(e,t,r){return{type:"attribute",kind:e,itemSize:t,divisor:r}}function ye(e,t){return{type:"uniform",kind:e,variant:t}}function Ct(e,t,r,n,o){return{type:"texture",kind:e,format:t,dataType:r,filter:n,variant:o}}function Vd(e){return{type:"elements",kind:e}}function At(e,t){return{type:"define",kind:e,options:t}}function Mn(e){return{type:"value",kind:e}}var qa={uDrawId:ye("i"),uModel:ye("m4"),uView:ye("m4"),uInvView:ye("m4"),uModelView:ye("m4"),uInvModelView:ye("m4"),uProjection:ye("m4"),uInvProjection:ye("m4"),uModelViewProjection:ye("m4"),uInvModelViewProjection:ye("m4"),uIsOrtho:ye("f"),uPixelRatio:ye("f"),uViewport:ye("v4"),uViewOffset:ye("v2"),uDrawingBufferSize:ye("v2"),uCameraPosition:ye("v3"),uCameraDir:ye("v3"),uCameraPlane:ye("v4"),uNear:ye("f"),uFar:ye("f"),uFog:ye("b"),uFogNear:ye("f"),uFogFar:ye("f"),uFogColor:ye("v3"),uTransparentBackground:ye("b"),uLightDirection:ye("v3[]"),uLightColor:ye("v3[]"),uAmbientColor:ye("v3"),uPickingAlphaThreshold:ye("f"),uInteriorDarkening:ye("f"),uInteriorColorFlag:ye("b"),uInteriorColor:ye("v3"),uHighlightColor:ye("v3"),uSelectColor:ye("v3"),uDimColor:ye("v3"),uHighlightStrength:ye("f"),uSelectStrength:ye("f"),uDimStrength:ye("f"),uMarkerPriority:ye("i"),uMarkerAverage:ye("f"),uXrayEdgeFalloff:ye("f"),uExposure:ye("f"),uRenderMask:ye("i"),uMarkingDepthTest:ye("b"),uMarkingType:ye("i"),uPickType:ye("i")},Wa={tDepth:Ct("texture","depth","ushort","nearest"),tDpoitDepth:Ct("texture","rg","float","nearest"),tDpoitFrontColor:Ct("texture","rgba","float","nearest"),tDpoitBackColor:Ct("texture","rgba","float","nearest")},Ya={uObjectId:ye("i")},yEe={uColor:ye("v3","material"),uColorTexDim:ye("v2"),uColorGridDim:ye("v3"),uColorGridTransform:ye("v4"),tColor:Ct("image-uint8","rgb","ubyte","nearest"),tPalette:Ct("image-uint8","rgb","ubyte","nearest"),tColorGrid:Ct("texture","rgb","ubyte","linear"),dColorType:At("string",["uniform","attribute","instance","group","groupInstance","vertex","vertexInstance","volume","volumeInstance","direct"]),dUsePalette:At("boolean")},sf={uSize:ye("f","material"),uSizeTexDim:ye("v2"),tSize:Ct("image-uint8","rgb","ubyte","nearest"),dSizeType:At("string",["uniform","attribute","instance","group","groupInstance"]),uSizeFactor:ye("f","material")},vEe={uMarker:ye("f"),uMarkerTexDim:ye("v2"),tMarker:Ct("image-uint8","alpha","ubyte","nearest"),markerAverage:Mn("number"),markerStatus:Mn("number"),dMarkerType:At("string",["instance","groupInstance"])},xEe={uOverpaintTexDim:ye("v2"),tOverpaint:Ct("image-uint8","rgba","ubyte","nearest"),dOverpaint:At("boolean"),uOverpaintGridDim:ye("v3"),uOverpaintGridTransform:ye("v4"),tOverpaintGrid:Ct("texture","rgba","ubyte","linear"),dOverpaintType:At("string",["instance","groupInstance","volumeInstance"]),uOverpaintStrength:ye("f","material")},bEe={uTransparencyTexDim:ye("v2"),tTransparency:Ct("image-uint8","alpha","ubyte","nearest"),dTransparency:At("boolean"),transparencyAverage:Mn("number"),uTransparencyGridDim:ye("v3"),uTransparencyGridTransform:ye("v4"),tTransparencyGrid:Ct("texture","alpha","ubyte","linear"),dTransparencyType:At("string",["instance","groupInstance","volumeInstance"]),uTransparencyStrength:ye("f","material")},SEe={uEmissiveTexDim:ye("v2"),tEmissive:Ct("image-uint8","alpha","ubyte","nearest"),dEmissive:At("boolean"),emissiveAverage:Mn("number"),uEmissiveGridDim:ye("v3"),uEmissiveGridTransform:ye("v4"),tEmissiveGrid:Ct("texture","alpha","ubyte","linear"),dEmissiveType:At("string",["instance","groupInstance","volumeInstance"]),uEmissiveStrength:ye("f","material")},CEe={uSubstanceTexDim:ye("v2"),tSubstance:Ct("image-uint8","rgba","ubyte","nearest"),dSubstance:At("boolean"),uSubstanceGridDim:ye("v3"),uSubstanceGridTransform:ye("v4"),tSubstanceGrid:Ct("texture","rgba","ubyte","linear"),dSubstanceType:At("string",["instance","groupInstance","volumeInstance"]),uSubstanceStrength:ye("f","material")},_Ee={uClippingTexDim:ye("v2"),tClipping:Ct("image-uint8","alpha","ubyte","nearest"),dClipping:At("boolean"),dClippingType:At("string",["instance","groupInstance"])},Xa=te(k(k(k(k(k(k(k({dGeometryType:At("string",["cylinders","directVolume","image","lines","mesh","points","spheres","text","textureMesh"])},yEe),vEe),xEe),bEe),SEe),CEe),_Ee),{dLightCount:At("number"),dColorMarker:At("boolean"),dClipObjectCount:At("number"),dClipVariant:At("string",["instance","pixel"]),uClipObjectType:ye("i[]","material"),uClipObjectInvert:ye("b[]","material"),uClipObjectPosition:ye("v3[]","material"),uClipObjectRotation:ye("v4[]","material"),uClipObjectScale:ye("v3[]","material"),aInstance:nn("float32",1,1),aTransform:nn("float32",16,1),uAlpha:ye("f","material"),uMetalness:ye("f","material"),uRoughness:ye("f","material"),uBumpiness:ye("f","material"),uEmissive:ye("f","material"),uVertexCount:ye("i"),uInstanceCount:ye("i"),uGroupCount:ye("i"),uInvariantBoundingSphere:ye("v4"),uLod:ye("v4"),drawCount:Mn("number"),instanceCount:Mn("number"),alpha:Mn("number"),matrix:Mn("m4"),transform:Mn("float32"),extraTransform:Mn("float32"),hasReflection:Mn("boolean"),instanceGranularity:Mn("boolean"),boundingSphere:Mn("sphere"),invariantBoundingSphere:Mn("sphere"),instanceGrid:Mn("instanceGrid")});var ree=` +precision highp float; +precision highp sampler2D; + +uniform sampler2D tColor; +uniform vec2 uTexSize; + +void main() { + vec2 coords = gl_FragCoord.xy / uTexSize; + gl_FragColor = texture2D(tColor, coords); +} +`;var Nn=` +precision highp float; + +attribute vec2 aPosition; +uniform vec2 uQuadScale; + +void main(void) { + vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale; + gl_Position = vec4(position, 0.0, 1.0); +} +`;var wEe=ko();function AEe(e,t){let{gl:r}=e;switch(t){case"points":return r.POINTS;case"lines":return r.LINES;case"line-strip":return r.LINE_STRIP;case"line-loop":return r.LINE_LOOP;case"triangles":return r.TRIANGLES;case"triangle-strip":return r.TRIANGLE_STRIP;case"triangle-fan":return r.TRIANGLE_FAN}}var TEe={color:"",pick:"",depth:"",marking:"",emissive:""},PEe=Object.keys(TEe),IEe={compute:""},EEe=Object.keys(IEe);function DF(e,t,r,n,o){return r=te(k({},r),{dRenderVariant:I.create(t)}),o.dRenderVariant===void 0&&Object.defineProperty(o,"dRenderVariant",{value:At("string")}),e.resources.program(r,n,o)}function DEe(){return{attributes:!1,defines:!1,elements:!1,textures:!1}}function kEe(e){e.attributes=!1,e.defines=!1,e.elements=!1,e.textures=!1}function kF(e,t){if(e==="color")switch(t){case"blended":return"colorBlended";case"wboit":return"colorWboit";case"dpoit":return"colorDpoit"}return e}function Ka(e,t,r,n,o,i,s){return nee(e,t,r,n,o,i,PEe,s)}function Jr(e,t,r,n,o,i=-1){return nee(e,t,r,n,o,i,EEe,void 0)}function nee(e,t,r,n,o,i,s,a){let l=wEe(),{stats:c,state:u,resources:d}=e,{instancedArrays:m,vertexArrayObject:p,multiDrawInstancedBaseVertexBaseInstance:h,drawInstancedBaseVertexBaseInstance:f}=e.extensions;if(o.uVertexCount&&!e.extensions.noNonInstancedActiveAttribs){let V=o.uVertexCount.ref.value;o.aVertex=I.create(as(new Float32Array(V))),n.aVertex=nn("float32",1,0)}let{attributeValues:y,defineValues:g,textureValues:v,materialTextureValues:b,uniformValues:S,materialUniformValues:_,bufferedUniformValues:w}=eee(n,o),E=Object.entries(S),A=Object.entries(_),P=Object.entries(w),T=Object.entries(M$(w)),B=Object.entries(g),D=tee(o),M=AEe(e,t),R={};for(let V of s)R[V]=DF(e,kF(V,a),g,r,n);let U=sF(e,n,v),F=sF(e,n,b),N=F$(e,n,y),z=[];for(let V=0,G=N.length;VR[V],setTransparency:V=>{if(V!==a){a=V;for(let G of s)R[G].destroy(),R[G]=DF(e,kF(G,a),g,r,n)}},render:(V,G,X)=>{if(Q===0||H===0)return;let Z=R[V];if(Z.id===ce&&u.currentRenderItemId===l)Z.setUniforms(E),Z.bindTextures(U,G);else{let ie=J[V];(Z.id!==u.currentProgramId||Z.id!==ce||i===-1||i!==u.currentMaterialId)&&(Z.id!==u.currentProgramId&&Z.use(),Z.setUniforms(A),Z.bindTextures(F,G+U.length),u.currentMaterialId=i,ce=Z.id),Z.setUniforms(E),Z.setUniforms(T),Z.bindTextures(U,G),ie?(ie.bind(),q&&q.bind()):(q&&q.bind(),Z.bindAttributes(N)),u.currentRenderItemId=l}if($t)try{E1(e.gl)}catch(ie){throw new Error(`Framebuffer error rendering item id ${l}: '${ie}'`)}if(X){for(let ie of X)if(ie.count!==0){if(Z.setUniforms(ie.uniforms),h)q?h.multiDrawElementsInstancedBaseVertexBaseInstance(M,ie.counts,0,q._dataType,ie.offsets,0,ie.instanceCounts,0,ie.baseVertices,0,ie.baseInstances,0,ie.count):h.multiDrawArraysInstancedBaseInstance(M,ie.firsts,0,ie.counts,0,ie.instanceCounts,0,ie.baseInstances,0,ie.count);else if(f)if(q)for(let de=0;de0&&(Z.uniform("uDrawId",de),f.drawElementsInstancedBaseVertexBaseInstance(M,ie.counts[de],q._dataType,ie.offsets[de],ie.instanceCounts[de],ie.baseVertices[de],ie.baseInstances[de]));else for(let de=0;de0&&(Z.uniform("uDrawId",de),f.drawArraysInstancedBaseInstance(M,ie.firsts[de],ie.counts[de],ie.instanceCounts[de],ie.baseInstances[de]));else if(q)for(let de=0;de0&&(Z.uniform("uDrawId",de),Z.offsetAttributes(z,ie.baseInstances[de]),m.drawElementsInstanced(M,ie.counts[de],q._dataType,ie.offsets[de],ie.instanceCounts[de]));else for(let de=0;de0&&(Z.uniform("uDrawId",de),Z.offsetAttributes(z,ie.baseInstances[de]),m.drawArraysInstanced(M,0,ie.counts[de],ie.instanceCounts[de]));if(ot){h?c.calls.multiDrawInstancedBase+=1:f?c.calls.drawInstancedBase+=ie.count:c.calls.drawInstanced+=ie.count;for(let de=0;de{if(kEe(W),o.aVertex){let V=o.uVertexCount.ref.value;o.aVertex.ref.value.length=ie.ref.value.length)Z.updateSubData(ie.ref.value,0,Z.length);else{Z.destroy();let{itemSize:de,divisor:we}=n[X];N[V][1]=d.attribute(ie.ref.value,de,we),W.attributes=!0}D[X]=ie.ref.version}}if(q&&o.elements.ref.version!==D.elements&&(q.length>=o.elements.ref.value.length?q.updateSubData(o.elements.ref.value,0,q.length):(q.destroy(),q=d.elements(o.elements.ref.value),W.elements=!0),D.elements=o.elements.ref.version),W.attributes||W.defines||W.elements)for(let V of s){let G=J[V];G&&G.destroy(),J[V]=p?d.vertexArray(R[V],N,q):null}for(let V=0,G=U.length;V{if(!K){for(let V of s){R[V].destroy();let G=J[V];G&&G.destroy()}U.forEach(([V,G])=>{n[V].kind!=="texture"&&G.destroy()}),F.forEach(([V,G])=>{n[V].kind!=="texture"&&G.destroy()}),N.forEach(([V,G])=>G.destroy()),q&&q.destroy(),c.drawCount-=Q,c.instanceCount-=H,c.instancedDrawCount-=H*Q,K=!0}}}}function Qo(){return Qo.create(x.create(1,0,0),0)}(function(e){function t(f,y){return{normal:f,constant:y}}e.create=t;function r(f,y){return x.copy(f.normal,y.normal),f.constant=y.constant,f}e.copy=r;function n(f){return r(e(),f)}e.clone=n;function o(f,y){let g=1/x.magnitude(y.normal);return x.scale(f.normal,y.normal,g),f.constant=y.constant*g,f}e.normalize=o;function i(f,y){return x.negate(f.normal,y.normal),f.constant=-y.constant,f}e.negate=i;function s(f,y,g){return x.toArray(f.normal,y,g),y[g+3]=f.constant,y}e.toArray=s;function a(f,y,g){return x.fromArray(f.normal,y,g),f.constant=y[g+3],f}e.fromArray=a;function l(f,y,g){return x.copy(f.normal,y),f.constant=-x.dot(f.normal,g),f}e.fromNormalAndCoplanarPoint=l;function c(f,y,g,v){let b=x.triangleNormal(x(),y,g,v);return l(f,b,y),f}e.fromCoplanarPoints=c;let u=x();function d(f,y,g,v,b){x.set(u,y,g,v);let S=1/x.magnitude(u);return x.scale(f.normal,u,S),f.constant=b*S,f}e.setUnnormalized=d;function m(f,y){return x.dot(f.normal,y)+f.constant}e.distanceToPoint=m;function p(f,y){return m(f,y.center)-y.radius}e.distanceToSpher3D=p;function h(f,y,g){return x.scaleAndAdd(f,f,y.normal,-m(y,g))}e.projectPoint=h})(Qo||(Qo={}));function _h(){return _h.create(Qo(),Qo(),Qo(),Qo(),Qo(),Qo())}(function(e){function t(c,u,d,m,p,h){return[c,u,d,m,p,h]}e.create=t;function r(c,u){for(let d=0;d<6;++d)Qo.copy(c[d],u[d]);return c}e.copy=r;function n(c){return r(e(),c)}e.clone=n;function o(c,u){let d=u[0],m=u[1],p=u[2],h=u[3],f=u[4],y=u[5],g=u[6],v=u[7],b=u[8],S=u[9],_=u[10],w=u[11],E=u[12],A=u[13],P=u[14],T=u[15];return Qo.setUnnormalized(c[0],h-d,v-f,w-b,T-E),Qo.setUnnormalized(c[1],h+d,v+f,w+b,T+E),Qo.setUnnormalized(c[2],h+m,v+y,w+S,T+A),Qo.setUnnormalized(c[3],h-m,v-y,w-S,T-A),Qo.setUnnormalized(c[4],h-p,v-g,w-_,T-P),Qo.setUnnormalized(c[5],h+p,v+g,w+_,T+P),c}e.fromProjectionMatrix=o;function i(c,u){let d=u.center,m=-u.radius;for(let p=0;p<6;++p)if(Qo.distanceToPoint(c[p],d)0?u.max[0]:u.min[0],s[1]=m.normal[1]>0?u.max[1]:u.min[1],s[2]=m.normal[2]>0?u.max[2]:u.min[2],Qo.distanceToPoint(m,s)<0)return!1}return!0}e.intersectsBox3D=a;function l(c,u){for(let d=0;d<6;++d)if(Qo.distanceToPoint(c[d],u)<0)return!1;return!0}e.containsPoint=l})(_h||(_h={}));var RP=Qo.distanceToPoint,LP=_h.intersectsSphere3D,FP=ge.fromArray,oee=ko();function MF(e,t){return t&&t.instanceCounts.length>=e?t:{firsts:new Int32Array(e),counts:new Int32Array(e),offsets:new Int32Array(e),instanceCounts:new Int32Array(e),baseVertices:new Int32Array(e),baseInstances:new Uint32Array(e),count:0,uniforms:[]}}function Qa(e,t,r){let n=oee(),o=MF(0),i=[],s=!1,a=-1,l=ge(),c=()=>{var u;let d=(u=t.lodLevels)===null||u===void 0?void 0:u.ref.value;if(d&&d.length>0){let{cellCount:m}=t.instanceGrid.ref.value;i.length=d.length;for(let p=0,h=d.length;p{var h,f;if(s=!1,t.drawCount.ref.value===0||t.instanceCount.ref.value===0||t.instanceGrid.ref.value.cellSize<=1)return;let{cellOffsets:y,cellSpheres:g,cellCount:v,batchOffsets:b,batchSpheres:S,batchCount:_,batchCell:w,batchSize:E}=t.instanceGrid.ref.value,[A,P]=t.uLod.ref.value,T=A!==0||P!==0,B=2*E,D=(h=t.lodLevels)===null||h===void 0?void 0:h.ref.value;if(D&&D.length>0){if(((f=t.lodLevels)===null||f===void 0?void 0:f.ref.version)!==a)c();else for(let M=0,R=D.length;MP)){ot&&(p.culled.lod+=y[w[U-1]+1]-y[w[R]]);continue}if(!LP(d,l)){ot&&(p.culled.frustum+=y[w[U-1]+1]-y[w[R]]);continue}if(m!==null&&m(l)){ot&&(p.culled.occlusion+=y[w[U-1]+1]-y[w[R]]);continue}for(let z=R;zP)){ot&&(p.culled.lod+=Q);continue}if(!LP(d,l)){ot&&(p.culled.frustum+=Q);continue}if(m!==null&&H-l.radiusD[W][1])continue;let ce=i[W],V=ce.count;V>0&&ce.baseInstances[V-1]+ce.instanceCounts[V-1]===O&&ce.counts[V-1]===D[W][3]?ce.instanceCounts[V-1]+=Q:(ce.counts[V]=D[W][3],ce.instanceCounts[V]=Q,ce.baseInstances[V]=O,ce.count+=1)}}}}else{o=MF(v,o);let{baseInstances:M,instanceCounts:R,counts:U}=o,F=0;for(let N=0;N<_;++N){let z=b[N],q=b[N+1];if(q-z!==0){if(FP(l,S,N*4),T){let J=RP(u,l.center);if(J+l.radiusP){ot&&(p.culled.lod+=y[w[q-1]+1]-y[w[z]]);continue}}if(!LP(d,l)){ot&&(p.culled.frustum+=y[w[q-1]+1]-y[w[z]]);continue}if(m!==null&&m(l)){ot&&(p.culled.occlusion+=y[w[q-1]+1]-y[w[z]]);continue}for(let J=z;JP)){ot&&(p.culled.lod+=K);continue}if(!LP(d,l)){ot&&(p.culled.frustum+=K);continue}if(m!==null&&ce-l.radius0&&M[F-1]+R[F-1]===H?R[F-1]+=K:(U[F]=t.drawCount.ref.value,R[F]=K,M[F]=H,F+=1)}}}o.count=F,i.length=1,i[0]=o,i[0].uniforms.length=0}s=!0},uncull:()=>{s=!1},render:(u,d)=>{t.uAlpha&&t.alpha&&I.updateIfChanged(t.uAlpha,po(t.alpha.ref.value*r.alphaFactor,0,1)),e.render(u,d,s?i:void 0)},getProgram:u=>e.getProgram(u),setTransparency:u=>e.setTransparency(u),update:()=>{e.update(),c()},dispose:()=>e.destroy()}}function en(e,t){return{id:oee(),values:t,render:()=>e.render("compute",0),update:()=>e.update(),dispose:()=>e.destroy()}}var c_=new Float32Array([1,1,-1,1,-1,-1,-1,-1,1,-1,1,1]),wn={drawCount:Mn("number"),instanceCount:Mn("number"),aPosition:nn("float32",2,0),uQuadScale:ye("v2")},An={drawCount:I.create(6),instanceCount:I.create(1),aPosition:I.create(c_),uQuadScale:I.create(Ae.create(1,1))},MEe=te(k({},wn),{tColor:Ct("texture","rgba","ubyte","nearest"),uTexSize:ye("v2")}),BEe=Rr("copy",Nn,ree);function wh(e,t){let r=te(k({},An),{tColor:I.create(t),uTexSize:I.create(Ae.create(t.getWidth(),t.getHeight()))}),n=k({},MEe),o=Jr(e,"triangles",BEe,n,r);return en(o,r)}var iee=new Uint32Array([0,1,2,1,3,2]),REe=new Float32Array([0,1,0,0,1,1,1,0]),see={nearest:"Nearest",catmulrom:"Catmulrom (Cubic)",mitchell:"Mitchell (Cubic)",bspline:"B-Spline (Cubic)"},aee=Object.keys(see);var op;(function(e){function t(m,p,h,f){return f?o(m,p,h,f):n(m,p,h)}e.create=t;function r(m){return zo([m.cornerBuffer.ref.version])}function n(m,p,h){let f=ge(),y=-1,g=m.width,v=m.height,b={kind:"image",imageTexture:I.create(m),imageTextureDim:I.create(Ae.create(g,v)),cornerBuffer:I.create(p),groupTexture:I.create(h),get boundingSphere(){let S=r(b);if(S!==y){let _=LEe(b.cornerBuffer.ref.value);ge.copy(f,_),y=S}return f}};return b}function o(m,p,h,f){let y=m.width,g=m.height;return I.update(f.imageTexture,m),I.update(f.imageTextureDim,Ae.set(f.imageTextureDim.ref.value,y,g)),I.update(f.cornerBuffer,p),I.update(f.groupTexture,h),f}function i(m){let p=Jn(0,4,Uint8Array),h=m?m.cornerBuffer.ref.value:new Float32Array(8*3),f=Jn(0,4,Uint8Array);return t(p,h,f,m)}e.createEmpty=i,e.Params=te(k({},We.Params),{interpolation:C.Select("bspline",C.objectToOptions(see))}),e.Utils={Params:e.Params,createEmpty:i,createValues:s,createValuesSimple:a,updateValues:l,updateBoundingSphere:c,createRenderableState:u,updateRenderableState:d,createPositionIterator:()=>Pr(1,1,1,()=>Qi)};function s(m,p,h,f,y){let{instanceCount:g,groupCount:v}=h,b=e.Utils.createPositionIterator(m,p),S=Ci(h,b,f.color),_=y.instanceGranularity?Gn(g,"instance"):Gn(g*v,"groupInstance"),w=Ua(),E=za(),A=Ha(),P=Ga(),T=Va(),B={drawCount:iee.length,vertexCount:c_.length/3,groupCount:v,instanceCount:g},D=ge.clone(m.boundingSphere),M=Ko(D,p.aTransform.ref.value,g,0);return te(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("image")},S),_),w),E),A),P),T),p),We.createValues(y,B)),{aPosition:m.cornerBuffer,aUv:I.create(REe),elements:I.create(iee),aGroup:I.create(as(new Float32Array(4))),boundingSphere:I.create(M),invariantBoundingSphere:I.create(D),uInvariantBoundingSphere:I.create(Rt.ofSphere(D)),dInterpolation:I.create(y.interpolation),uImageTexDim:m.imageTextureDim,tImageTex:m.imageTexture,tGroupTex:m.groupTexture})}function a(m,p,h,f,y){let g=We.createSimple(h,f,y),v=k(k({},C.getDefaultValues(e.Params)),p);return s(m,g.transform,g.locationIterator,g.theme,v)}function l(m,p){We.updateValues(m,p),I.updateIfChanged(m.dInterpolation,p.interpolation)}function c(m,p){let h=ge.clone(p.boundingSphere),f=Ko(h,m.aTransform.ref.value,m.instanceCount.ref.value,0);ge.equals(f,m.boundingSphere.ref.value)||I.update(m.boundingSphere,f),ge.equals(h,m.invariantBoundingSphere.ref.value)||(I.update(m.invariantBoundingSphere,h),I.update(m.uInvariantBoundingSphere,Rt.fromSphere(m.uInvariantBoundingSphere.ref.value,h)))}function u(m){let p=We.createRenderableState(m);return p.opaque=!1,p}function d(m,p){We.updateRenderableState(m,p),m.opaque=!1}})(op||(op={}));function LEe(e){let t=x(),r=[];for(let i=0,s=e.length;in&&(n=s)}let o=ge.create(t,n);return ge.setExtrema(o,r),o}var Li;(function(e){function t(h,f,y,g,v,b,S,_,w,E){return E?i(h,f,y,g,v,b,S,_,w,E):o(h,f,y,g,v,b,S,_,w)}e.create=t;function r(h){let f=h?h.mappingBuffer.ref.value:new Float32Array(0),y=h?h.indexBuffer.ref.value:new Uint32Array(0),g=h?h.groupBuffer.ref.value:new Float32Array(0),v=h?h.startBuffer.ref.value:new Float32Array(0),b=h?h.endBuffer.ref.value:new Float32Array(0),S=h?h.scaleBuffer.ref.value:new Float32Array(0),_=h?h.capBuffer.ref.value:new Float32Array(0),w=h?h.colorModeBuffer.ref.value:new Float32Array(0);return t(f,y,g,v,b,S,_,w,0,h)}e.createEmpty=r;function n(h){return zo([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,h.colorModeBuffer.ref.version])}function o(h,f,y,g,v,b,S,_,w){let E=ge(),A,P=-1,T=-1,B={kind:"cylinders",cylinderCount:w,mappingBuffer:I.create(h),indexBuffer:I.create(f),groupBuffer:I.create(y),startBuffer:I.create(g),endBuffer:I.create(v),scaleBuffer:I.create(b),capBuffer:I.create(S),colorModeBuffer:I.create(_),get boundingSphere(){let D=n(B);if(D!==P){let M=ou(B.startBuffer.ref.value,B.cylinderCount*6,6),R=ou(B.endBuffer.ref.value,B.cylinderCount*6,6);ge.expandBySphere(E,M,R),P=D}return E},get groupMapping(){return B.groupBuffer.ref.version!==T&&(A=Ud(B.groupBuffer.ref.value,B.cylinderCount,6),T=B.groupBuffer.ref.version),A},setBoundingSphere(D){ge.copy(E,D),P=n(B)}};return B}function i(h,f,y,g,v,b,S,_,w,E){return w>E.cylinderCount&&(I.update(E.mappingBuffer,h),I.update(E.indexBuffer,f)),E.cylinderCount=w,I.update(E.groupBuffer,y),I.update(E.startBuffer,g),I.update(E.endBuffer,v),I.update(E.scaleBuffer,b),I.update(E.capBuffer,S),I.update(E.colorModeBuffer,_),E}function s(h,f){let y=h.startBuffer.ref.value;Nd(f,y,0,h.cylinderCount*6),I.update(h.startBuffer,y);let g=h.endBuffer.ref.value;Nd(f,g,0,h.cylinderCount*6),I.update(h.endBuffer,g)}e.transform=s,e.Params=te(k({},We.Params),{sizeFactor:C.Numeric(1,{min:0,max:10,step:.1}),sizeAspectRatio:C.Numeric(1,{min:0,max:3,step:.01}),doubleSided:C.Boolean(!1,We.CustomQualityParamInfo),ignoreLight:C.Boolean(!1,We.ShadingCategory),xrayShaded:C.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],We.ShadingCategory),transparentBackfaces:C.Select("off",C.arrayToOptions(["off","on","opaque"]),We.ShadingCategory),solidInterior:C.Boolean(!0,We.ShadingCategory),bumpFrequency:C.Numeric(0,{min:0,max:10,step:.1},We.ShadingCategory),bumpAmplitude:C.Numeric(1,{min:0,max:5,step:.1},We.ShadingCategory),colorMode:C.Select("default",C.arrayToOptions(["default","interpolate"]),We.ShadingCategory)}),e.Utils={Params:e.Params,createEmpty:r,createValues:l,createValuesSimple:c,updateValues:u,updateBoundingSphere:d,createRenderableState:m,updateRenderableState:p,createPositionIterator:a};function a(h,f){let y=h.cylinderCount*6,g=f.instanceCount.ref.value,v=jl(),b=v.position,S=h.startBuffer.ref.value,_=h.endBuffer.ref.value,w=f.aTransform.ref.value;return Pr(y,g,2,(A,P)=>{let T=A%6===0?S:_;return P<0?x.fromArray(b,T,A*3):x.transformMat4Offset(b,T,w,0,A*3,P*16),v})}function l(h,f,y,g,v){let{instanceCount:b,groupCount:S}=y,_=a(h,f),w=Ci(y,_,g.color),E=ja(y,g.size),A=v.instanceGranularity?Gn(b,"instance"):Gn(b*S,"groupInstance"),P=Ua(),T=za(),B=Ha(),D=Ga(),M=Va(),R={drawCount:h.cylinderCount*4*3,vertexCount:h.cylinderCount*6,groupCount:S,instanceCount:b},U=s0(E)*v.sizeFactor,F=ge.clone(h.boundingSphere),N=Ko(F,f.aTransform.ref.value,b,0);return te(k(te(k(k(k(k(k(k(k(k(k({dGeometryType:I.create("cylinders"),aMapping:h.mappingBuffer,aGroup:h.groupBuffer,aStart:h.startBuffer,aEnd:h.endBuffer,aScale:h.scaleBuffer,aCap:h.capBuffer,aColorMode:h.colorModeBuffer,elements:h.indexBuffer,boundingSphere:I.create(N),invariantBoundingSphere:I.create(F),uInvariantBoundingSphere:I.create(Rt.ofSphere(F))},w),E),A),P),T),B),D),M),f),{padding:I.create(U)}),We.createValues(v,R)),{uSizeFactor:I.create(v.sizeFactor*v.sizeAspectRatio),uDoubleSided:I.create(v.doubleSided),dIgnoreLight:I.create(v.ignoreLight),dXrayShaded:I.create(v.xrayShaded==="inverted"?"inverted":v.xrayShaded===!0?"on":"off"),dTransparentBackfaces:I.create(v.transparentBackfaces),dSolidInterior:I.create(v.solidInterior),uBumpFrequency:I.create(v.bumpFrequency),uBumpAmplitude:I.create(v.bumpAmplitude),dDualColor:I.create(v.colorMode==="interpolate")})}function c(h,f,y,g,v){let b=We.createSimple(y,g,v),S=k(k({},C.getDefaultValues(e.Params)),f);return l(h,b.transform,b.locationIterator,b.theme,S)}function u(h,f){We.updateValues(h,f),I.updateIfChanged(h.uSizeFactor,f.sizeFactor*f.sizeAspectRatio),I.updateIfChanged(h.uDoubleSided,f.doubleSided),I.updateIfChanged(h.dIgnoreLight,f.ignoreLight),I.updateIfChanged(h.dXrayShaded,f.xrayShaded==="inverted"?"inverted":f.xrayShaded===!0?"on":"off"),I.updateIfChanged(h.dTransparentBackfaces,f.transparentBackfaces),I.updateIfChanged(h.dSolidInterior,f.solidInterior),I.updateIfChanged(h.uBumpFrequency,f.bumpFrequency),I.updateIfChanged(h.uBumpAmplitude,f.bumpAmplitude),I.updateIfChanged(h.dDualColor,f.colorMode==="interpolate")}function d(h,f){let y=ge.clone(f.boundingSphere),g=Ko(y,h.aTransform.ref.value,h.instanceCount.ref.value,0);ge.equals(g,h.boundingSphere.ref.value)||I.update(h.boundingSphere,g),ge.equals(y,h.invariantBoundingSphere.ref.value)||(I.update(h.invariantBoundingSphere,y),I.update(h.uInvariantBoundingSphere,Rt.fromSphere(h.uInvariantBoundingSphere.ref.value,y)))}function m(h){let f=We.createRenderableState(h);return p(f,h),f}function p(h,f){We.updateRenderableState(h,f),h.opaque=h.opaque&&!f.xrayShaded,h.writeDepth=h.opaque}})(Li||(Li={}));var ii;(function(e){function t(s){switch(s.kind){case"mesh":return s.triangleCount*3;case"points":return s.pointCount;case"spheres":return s.sphereCount*2*3;case"cylinders":return s.cylinderCount*4*3;case"text":return s.charCount*2*3;case"lines":return s.lineCount*2*3;case"direct-volume":return 12*3;case"image":return 2*3;case"texture-mesh":return s.vertexCount}}e.getDrawCount=t;function r(s){switch(s.kind){case"mesh":return s.vertexCount;case"points":return s.pointCount;case"spheres":return s.sphereCount*6;case"cylinders":return s.cylinderCount*6;case"text":return s.charCount*4;case"lines":return s.lineCount*4;case"direct-volume":let[a,l,c]=s.gridDimension.ref.value;return a*l*c;case"image":return 4;case"texture-mesh":return s.vertexCount}}e.getVertexCount=r;function n(s){switch(s.kind){case"mesh":case"points":case"spheres":case"cylinders":case"text":case"lines":return t(s)===0?0:Js(s.groupBuffer.ref.value)+1;case"direct-volume":return 1;case"image":return Js(s.groupTexture.ref.value.array)+1;case"texture-mesh":return s.groupCount}}e.getGroupCount=n;function o(s){switch(s.kind){case"mesh":return dt.Utils;case"points":return su.Utils;case"spheres":return aa.Utils;case"cylinders":return Li.Utils;case"text":return Zi.Utils;case"lines":return hn.Utils;case"direct-volume":return Aa.Utils;case"image":return op.Utils;case"texture-mesh":return ms.Utils}}e.getUtils=o;function i(s,a){return a==="instance"&&s.nonInstanceable?"group":a}e.getGranularity=i})(ii||(ii={}));var FEe=1,OEe="Assigns sizes as defined by the shape object.",lee={};function NEe(e){return lee}function OP(e,t){return{factory:OP,granularity:"groupInstance",size:r=>Hs.isLocation(r)?r.shape.getSize(r.group,r.instance):FEe,props:t,description:OEe}}var cee={name:"shape-group",label:"Shape Group",category:"",factory:OP,getParams:NEe,defaultValues:C.getDefaultValues(lee),isApplicable:e=>!!e.shape};var UEe=Oe(13421772),zEe="Assigns colors as defined by the shape object.",uee={};function VEe(e){return uee}function NP(e,t){return{factory:NP,granularity:"groupInstance",color:r=>Hs.isLocation(r)?r.shape.getColor(r.group,r.instance):UEe,props:t,description:zEe}}var dee={name:"shape-group",label:"Shape Group",category:wr.Misc,factory:NP,getParams:VEe,defaultValues:C.getDefaultValues(uee),isApplicable:e=>!!e.shape};var GEe=te(k({},Xa),{aPosition:nn("float32",3,0),elements:Vd("uint32"),uBboxMin:ye("v3"),uBboxMax:ye("v3"),uBboxSize:ye("v3"),uMaxSteps:ye("i"),uStepScale:ye("f"),uJumpLength:ye("f"),uTransform:ye("m4"),uGridDim:ye("v3"),tTransferTex:Ct("image-uint8","alpha","ubyte","linear"),uTransferScale:ye("f","material"),dGridTexType:At("string",["2d","3d"]),uGridTexDim:ye("v3"),tGridTex:Ct("texture","rgba","ubyte","linear"),uGridStats:ye("v4"),uCellDim:ye("v3"),uCartnToUnit:ye("m4"),uUnitToCartn:ye("m4"),dPackedGroup:At("boolean"),dAxisOrder:At("string",["012","021","102","120","201","210"]),dIgnoreLight:At("boolean"),dXrayShaded:At("string",["off","on","inverted"])});function mee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),GEe);e.isWebGL2||(s.uMaxSteps=At("number"));let a={uObjectId:I.create(t)},c=Ka(e,"triangles",A$,s,k(k({},r),a),o,i);return Qa(c,r,n)}var HEe=te(k({},Xa),{aGroup:nn("float32",1,0),aPosition:nn("float32",3,0),aNormal:nn("float32",3,0),elements:Vd("uint32"),dVaryingGroup:At("boolean"),dFlatShaded:At("boolean"),uDoubleSided:ye("b","material"),dFlipSided:At("boolean"),dIgnoreLight:At("boolean"),dXrayShaded:At("string",["off","on","inverted"]),dTransparentBackfaces:At("string",["off","on","opaque"]),uBumpFrequency:ye("f","material"),uBumpAmplitude:ye("f","material"),meta:Mn("unknown")});function pee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),HEe),a={uObjectId:I.create(t)},c=Ka(e,"triangles",bP,s,k(k({},r),a),o,i);return Qa(c,r,n)}var jEe=te(k(k({},Xa),sf),{aGroup:nn("float32",1,0),aPosition:nn("float32",3,0),dPointSizeAttenuation:At("boolean"),dPointStyle:At("string",["square","circle","fuzzy"])});function fee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),jEe),a={uObjectId:I.create(t)},c=Ka(e,"points",b$,s,k(k({},r),a),o,i);return Qa(c,r,n)}var qEe=te(k(k({},Xa),sf),{aGroup:nn("float32",1,0),aMapping:nn("float32",2,0),aStart:nn("float32",3,0),aEnd:nn("float32",3,0),elements:Vd("uint32"),dLineSizeAttenuation:At("boolean"),uDoubleSided:ye("b","material"),dFlipSided:At("boolean")});function hee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),qEe),a={uObjectId:I.create(t)},c=Ka(e,"triangles",w$,s,k(k({},r),a),o,i);return Qa(c,r,n)}var WEe=te(k(k({},Xa),sf),{uTexDim:ye("v2"),tPositionGroup:Ct("image-float32","rgba","float","nearest"),padding:Mn("number"),uDoubleSided:ye("b","material"),dIgnoreLight:At("boolean"),dXrayShaded:At("string",["off","on","inverted"]),dTransparentBackfaces:At("string",["off","on","opaque"]),dSolidInterior:At("boolean"),dClipPrimitive:At("boolean"),dApproximate:At("boolean"),uAlphaThickness:ye("f"),uBumpFrequency:ye("f","material"),uBumpAmplitude:ye("f","material"),lodLevels:Mn("unknown"),centerBuffer:Mn("float32"),groupBuffer:Mn("float32")});function gee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),WEe),a={uObjectId:I.create(t)},c=Ka(e,"triangles",S$,s,k(k({},r),a),o,i);return Qa(c,r,n)}var YEe=te(k(k({},Xa),sf),{aGroup:nn("float32",1,0),aPosition:nn("float32",3,0),aMapping:nn("float32",2,0),aDepth:nn("float32",1,0),elements:Vd("uint32"),aTexCoord:nn("float32",2,0),tFont:Ct("image-uint8","alpha","ubyte","linear"),padding:Mn("number"),uBorderWidth:ye("f","material"),uBorderColor:ye("v3","material"),uOffsetX:ye("f","material"),uOffsetY:ye("f","material"),uOffsetZ:ye("f","material"),uBackgroundColor:ye("v3","material"),uBackgroundOpacity:ye("f","material")});function yee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),YEe),a={uObjectId:I.create(t)},c=Ka(e,"triangles",_$,s,k(k({},r),a),o,i);return Qa(c,r,n)}var XEe=te(k({},Xa),{uGeoTexDim:ye("v2","buffered"),tPosition:Ct("texture","rgb","float","nearest"),tGroup:Ct("texture","alpha","float","nearest"),tNormal:Ct("texture","rgb","float","nearest"),dVaryingGroup:At("boolean"),dFlatShaded:At("boolean"),uDoubleSided:ye("b","material"),dFlipSided:At("boolean"),dIgnoreLight:At("boolean"),dXrayShaded:At("string",["off","on","inverted"]),dTransparentBackfaces:At("string",["off","on","opaque"]),uBumpFrequency:ye("f","material"),uBumpAmplitude:ye("f","material"),meta:Mn("unknown")});function vee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),XEe),a={uObjectId:I.create(t)},c=Ka(e,"triangles",bP,s,k(k({},r),a),o,i);return Qa(c,r,n)}var KEe=te(k({},Xa),{aGroup:nn("float32",1,0),aPosition:nn("float32",3,0),aUv:nn("float32",2,0),elements:Vd("uint32"),uImageTexDim:ye("v2"),tImageTex:Ct("image-uint8","rgba","ubyte","nearest"),tGroupTex:Ct("image-uint8","rgba","ubyte","nearest"),dInterpolation:At("string",aee)});function xee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),KEe),a={uObjectId:I.create(t)},c=Ka(e,"triangles",T$,s,k(k({},r),a),o,i);return Qa(c,r,n)}var QEe=te(k(k({},Xa),sf),{aGroup:nn("float32",1,0),aStart:nn("float32",3,0),aEnd:nn("float32",3,0),aMapping:nn("float32",3,0),aScale:nn("float32",1,0),aCap:nn("float32",1,0),aColorMode:nn("float32",1,0),elements:Vd("uint32"),padding:Mn("number"),uDoubleSided:ye("b","material"),dIgnoreLight:At("boolean"),dXrayShaded:At("string",["off","on","inverted"]),dTransparentBackfaces:At("string",["off","on","opaque"]),dSolidInterior:At("boolean"),uBumpFrequency:ye("f","material"),uBumpAmplitude:ye("f","material"),dDualColor:At("boolean")});function bee(e,t,r,n,o,i){let s=k(k(k(k({},qa),Wa),Ya),QEe),a={uObjectId:I.create(t)},c=Ka(e,"triangles",C$,s,k(k({},r),a),o,i);return Qa(c,r,n)}var ZEe=ko(0,2147483647),Ic=ko(0,2147483647);function Gd(e,t,r,n){return{id:ZEe(),type:e,values:t,state:r,materialId:n}}function See(e,t,r){switch(t.type){case"mesh":return pee(e,t.id,t.values,t.state,t.materialId,r);case"points":return fee(e,t.id,t.values,t.state,t.materialId,r);case"spheres":return gee(e,t.id,t.values,t.state,t.materialId,r);case"cylinders":return bee(e,t.id,t.values,t.state,t.materialId,r);case"text":return yee(e,t.id,t.values,t.state,t.materialId,r);case"lines":return hee(e,t.id,t.values,t.state,t.materialId,r);case"direct-volume":return mee(e,t.id,t.values,t.state,t.materialId,r);case"image":return xee(e,t.id,t.values,t.state,t.materialId,r);case"texture-mesh":return vee(e,t.id,t.values,t.state,t.materialId,r)}throw new Error("unsupported type")}var Dr;(function(e){function t(u,d,m,p,h,f,y){return{id:qr.create22(),name:u,sourceData:d,geometry:m,transforms:y||[ne.identity()],get groupCount(){return ii.getGroupCount(m)},getColor:p,getSize:h,getLabel:f}}e.create=t;function r(u){return{color:NP({shape:u},{}),size:OP({shape:u},{})}}e.getTheme=r;function n(u){let d=u.transforms.length,m=Hs.Location(u),p=(h,f)=>(m.group=h,m.instance=f,m);return Pr(u.groupCount,d,1,p)}e.groupIterator=n;function o(u,d,m,p,h){let f=h&&h.aTransform.ref.value.length>=u.length*16?h.aTransform.ref.value:new Float32Array(u.length*16);for(let y=0,g=u.length;y{for(let w=v[_],E=v[_+1];w{for(let w=v[_],E=v[_+1];w{let w=p.shape.getSize(_,S);fa(g)).filter(g=>!!g);t.reset();for(let g of y)t.includePositionRadius(g.center,g.radius);t.finishedIncludeStep();for(let g of y)t.radiusPositionRadius(g.center,g.radius);return t.getSphere()}e.getBundleBoundingSphere=r;function n(f,y){return Fi(f)&&Fi(y)||Zo(f)&&Zo(y)?!0:M1(f)&&M1(y)?$Ee(f,y):Me.isLoci(f)&&Me.isLoci(y)?Me.areLociEqual(f,y):$.Loci.is(f)&&$.Loci.is(y)?$.Loci.areEqual(f,y):yt.isLoci(f)&&yt.isLoci(y)?yt.areLociEqual(f,y):Dr.isLoci(f)&&Dr.isLoci(y)?Dr.areLociEqual(f,y):Hs.isLoci(f)&&Hs.isLoci(y)?Hs.areLociEqual(f,y):Je.isLoci(f)&&Je.isLoci(y)?Je.areLociEqual(f,y):Je.Isosurface.isLoci(f)&&Je.Isosurface.isLoci(y)?Je.Isosurface.areLociEqual(f,y):Je.Cell.isLoci(f)&&Je.Cell.isLoci(y)?Je.Cell.areLociEqual(f,y):Je.Segment.isLoci(f)&&Je.Segment.isLoci(y)?Je.Segment.areLociEqual(f,y):!1}e.areEqual=n;function o(f){return!!f&&f.kind==="every-loci"}e.isEvery=o;function i(f){return Fi(f)?!1:Zo(f)?!0:M1(f)?JEe(f):Me.isLoci(f)?Me.isLociEmpty(f):$.Loci.is(f)?$.Loci.isEmpty(f):yt.isLoci(f)?yt.isLociEmpty(f):Dr.isLoci(f)?Dr.isLociEmpty(f):Hs.isLoci(f)?Hs.isLociEmpty(f):Je.isLoci(f)?Je.isLociEmpty(f):Je.Isosurface.isLoci(f)?Je.Isosurface.isLociEmpty(f):Je.Cell.isLoci(f)?Je.Cell.isLociEmpty(f):Je.Segment.isLoci(f)?Je.Segment.isLociEmpty(f):!1}e.isEmpty=i;function s(f,y){return y instanceof Me&&($.Loci.is(f)?f=$.Loci.remap(f,y):Me.isLoci(f)?f=Me.remapLoci(f,y):yt.isLoci(f)&&(f=yt.remapLoci(f,y))),f}e.remap=s;function a(f,y){var g;if(!(f.kind==="every-loci"||f.kind==="empty-loci")){if(y||(y=ge()),f.kind==="structure-loci")return ge.copy(y,f.structure.boundary.sphere);if(f.kind==="element-loci")return ge.copy(y,$.Loci.getBoundary(f).sphere);if(f.kind==="bond-loci")return yt.getBoundingSphere(f,y);if(f.kind==="shape-loci")return ge.copy(y,f.shape.geometry.boundingSphere);if(f.kind==="group-loci")return Hs.getBoundingSphere(f,y);if(f.kind==="data-loci")return(g=f.getBoundingSphere)===null||g===void 0?void 0:g.call(f,y);if(f.kind==="volume-loci")return Je.getBoundingSphere(f.volume,y);if(f.kind==="isosurface-loci")return Je.Isosurface.getBoundingSphere(f.volume,f.isoValue,y);if(f.kind==="cell-loci")return Je.Cell.getBoundingSphere(f.volume,f.indices,y);if(f.kind==="segment-loci")return Je.Segment.getBoundingSphere(f.volume,f.segments,y)}}e.getBoundingSphere=a;let l=ge.zero();function c(f,y){let g=a(f,l);return g?x.copy(y||x(),g.center):void 0}e.getCenter=c;function u(f){if(!(f.kind==="every-loci"||f.kind==="empty-loci")){if(f.kind==="structure-loci")return $.Loci.getPrincipalAxes(Me.toStructureElementLoci(f.structure));if(f.kind==="element-loci")return $.Loci.getPrincipalAxes(f);if(f.kind==="bond-loci")return;if(f.kind==="shape-loci")return;if(f.kind==="group-loci")return;if(f.kind==="data-loci")return;if(f.kind==="volume-loci")return;if(f.kind==="isosurface-loci")return;if(f.kind==="cell-loci")return;if(f.kind==="segment-loci")return}}e.getPrincipalAxes=u;let d={element:f=>f,residue:f=>$.Loci.is(f)?$.Loci.extendToWholeResidues(f,!0):f,chain:f=>$.Loci.is(f)?$.Loci.extendToWholeChains(f):f,entity:f=>$.Loci.is(f)?$.Loci.extendToWholeEntities(f):f,model:f=>$.Loci.is(f)?$.Loci.extendToWholeModels(f):f,operator:f=>$.Loci.is(f)?$.Loci.extendToWholeOperators(f):f,structure:f=>$.Loci.is(f)?Me.toStructureElementLoci(f.structure):Hs.isLoci(f)?Dr.Loci(f.shape):Je.Cell.isLoci(f)?Je.Loci(f.volume):f,elementInstances:f=>$.Loci.is(f)?$.Loci.extendToAllInstances(f):f,residueInstances:f=>$.Loci.is(f)?$.Loci.extendToAllInstances($.Loci.extendToWholeResidues(f,!0)):f,chainInstances:f=>$.Loci.is(f)?$.Loci.extendToAllInstances($.Loci.extendToWholeChains(f)):f};e.GranularityOptions=C.objectToOptions(d,f=>{switch(f){case"element":return"Atom/Coarse Element";case"elementInstances":return["Atom/Coarse Element Instances","With Symmetry"];case"structure":return"Structure/Shape";default:return f.indexOf("Instances")?[Us(f),"With Symmetry"]:Us(f)}});function m(f){return f.replace("Instances","")}e.simpleGranularity=m;function p(f,y){return d[y](f)}e.applyGranularity=p;function h(f,y,g=!1){return(y!=="element"||g)&&yt.isLoci(f)&&(f=yt.toStructureElementLoci(f)),Me.isLoci(f)&&(f=Me.toStructureElementLoci(f.structure)),$.Loci.is(f)&&(f=$.Loci.remap(f,f.structure.root)),y&&(f=p(f,y)),f}e.normalize=h})(Ht||(Ht={}));var UP=class{constructor(t=!1){this.isRunning=!1,this.queue=[],this.counter=0,this.log=t}enqueue(t){this.log&&console.log("SingleAsyncQueue enqueue",this.counter),this.queue[0]={id:this.counter,func:t},this.counter++,this.run()}run(){return Y(this,null,function*(){if(this.isRunning)return;let t=this.queue.pop();if(t){this.isRunning=!0;try{this.log&&console.log("SingleAsyncQueue run",t.id),yield t.func(),this.log&&console.log("SingleAsyncQueue complete",t.id)}finally{this.isRunning=!1,this.run()}}})}};var As=class extends ae.CreateBehavior({name:"Volume Streaming"}){};(function(e){e.RootTag="volume-streaming-info";function t(l,c,u,d,m={}){var p,h,f,y;return C.Group({isoValue:Je.createIsoValueParam((p=m.isoValue)!==null&&p!==void 0?p:u,d),color:C.Color((h=m.color)!==null&&h!==void 0?h:c),wireframe:C.Boolean((f=m.wireframe)!==null&&f!==void 0?f:!1),opacity:C.Numeric((y=m.opacity)!==null&&y!==void 0?y:.3,{min:0,max:1,step:.01})},{label:l,isExpanded:!0})}let r={byteOffset:0,rate:1,sampleCount:[1,1,1],valuesInfo:[{mean:0,min:-1,max:1,sigma:.1},{mean:0,min:-1,max:1,sigma:.1}]};function n(l={}){let{data:c,defaultView:u,channelParams:d}=l,m=new Map;c&&c.entries.forEach(f=>m.set(f.dataId,f));let p=c?c.entries.map(f=>[f.dataId,f.dataId]):[],h=c?c.entries[0].dataId:"";return{entry:C.Mapped(h,p,f=>C.Group(o({entryData:m.get(f),defaultView:u,structure:c&&c.structure,channelParams:d})))}}e.createParams=n;function o(l){let{entryData:c,defaultView:u,structure:d,channelParams:m={}}=l,p=c||{kind:"em",header:{sampling:[r],availablePrecisions:[{precision:0,maxVoxels:0}]},emDefaultContourLevel:Je.IsoValue.relative(0)},h=d&&d.boundary.box||ft();return{view:C.MappedStatic(u||(p.kind==="em"?"auto":"selection-box"),{off:C.Group({}),box:C.Group({bottomLeft:C.Vec3(h.min),topRight:C.Vec3(h.max)},{description:"Static box defined by cartesian coords.",isFlat:!0}),"selection-box":C.Group({radius:C.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),bottomLeft:C.Vec3(x.create(0,0,0),{},{isHidden:!0}),topRight:C.Vec3(x.create(0,0,0),{},{isHidden:!0})},{description:"Box around focused element.",isFlat:!0}),"camera-target":C.Group({radius:C.Numeric(.5,{min:0,max:1,step:.05},{description:"Radius within which the volume is shown (relative to the field of view)."}),dynamicDetailLevel:i(p.header.availablePrecisions,0,{label:"Dynamic Detail"}),bottomLeft:C.Vec3(x.create(0,0,0),{},{isHidden:!0}),topRight:C.Vec3(x.create(0,0,0),{},{isHidden:!0})},{description:"Box around camera target.",isFlat:!0}),cell:C.Group({}),auto:C.Group({radius:C.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),selectionDetailLevel:i(p.header.availablePrecisions,6,{label:"Selection Detail"}),isSelection:C.Boolean(!1,{isHidden:!0}),bottomLeft:C.Vec3(h.min,{},{isHidden:!0}),topRight:C.Vec3(h.max,{},{isHidden:!0})},{description:"Box around focused element.",isFlat:!0})},{options:e.ViewTypeOptions,description:'Controls what of the volume is displayed. "Off" hides the volume alltogether. "Bounded box" shows the volume inside the given box. "Around Interaction" shows the volume around the focused element/atom. "Whole Structure" shows the volume for the whole structure.'}),detailLevel:i(p.header.availablePrecisions,3),channels:p.kind==="em"?C.Group({em:t("EM",Oe(6524815),p.emDefaultContourLevel||Je.IsoValue.relative(1),p.header.sampling[0].valuesInfo[0],m.em)},{isFlat:!0}):C.Group({"2fo-fc":t("2Fo-Fc",Oe(3367602),Je.IsoValue.relative(1.5),p.header.sampling[0].valuesInfo[0],m["2fo-fc"]),"fo-fc(+ve)":t("Fo-Fc(+ve)",Oe(3390259),Je.IsoValue.relative(3),p.header.sampling[0].valuesInfo[1],m["fo-fc(+ve)"]),"fo-fc(-ve)":t("Fo-Fc(-ve)",Oe(12268339),Je.IsoValue.relative(-3),p.header.sampling[0].valuesInfo[1],m["fo-fc(-ve)"])},{isFlat:!0})}}e.createEntryParams=o;function i(l,c,u){return C.Select(Math.min(c,l.length-1),l.map((d,m)=>[m,`${m+1} [ ${Math.pow(d.maxVoxels,1/3)|0}^3 cells ]`]),k({description:"Determines the maximum number of voxels. Depending on the size of the volume options are in the range from 1 (0.52M voxels) to 7 (25.17M voxels)."},u))}function s(l){return{entry:{name:l.entry.name,params:{detailLevel:l.entry.params.detailLevel,channels:l.entry.params.channels,view:{name:l.entry.params.view.name,params:k({},l.entry.params.view.params)}}}}}e.copyParams=s,e.ViewTypeOptions=[["off","Off"],["box","Bounded Box"],["selection-box","Around Focus"],["camera-target","Around Camera"],["cell","Whole Structure"],["auto","Auto"]],e.ChannelTypeOptions=[["em","em"],["2fo-fc","2fo-fc"],["fo-fc(+ve)","fo-fc(+ve)"],["fo-fc(-ve)","fo-fc(-ve)"]];class a extends Ur.WithSubscribers{get info(){return this.infoMap.get(this.params.entry.name)}queryData(c){return Y(this,null,function*(){let u=o0(this.data.serverUrl,`${this.info.kind}/${this.info.dataId.toLowerCase()}`);if(c){let{min:g,max:v}=c;u+=`/box/${g.map(b=>Math.round(1e3*b)/1e3).join(",")}/${v.map(b=>Math.round(1e3*b)/1e3).join(",")}`}else u+="/cell";let d=this.params.entry.params.detailLevel;this.params.entry.params.view.name==="auto"&&this.params.entry.params.view.params.isSelection&&(d=this.params.entry.params.view.params.selectionDetailLevel),this.params.entry.params.view.name==="camera-target"&&c&&(d=this.decideDetail(c,this.params.entry.params.view.params.dynamicDetailLevel)),u+=`?detail=${d}`;let m=lb.get(this.cache,u);if(m)return m.data;let p=Or.getUrlAsset(this.plugin.managers.asset,u),h=yield this.plugin.runTask(this.plugin.managers.asset.resolve(p,"binary")),f=yield this.parseCif(h.data);if(!f)return;let y=lb.set(this.cache,u,{data:f,asset:h});return y&&y.asset.dispose(),f})}parseCif(c){return Y(this,null,function*(){let u=yield this.plugin.runTask(Vl.parseBinary(c));if(u.isError){this.plugin.log.error("VolumeStreaming, parsing CIF: "+u.toString());return}if(u.result.blocks.length<2){this.plugin.log.error("VolumeStreaming: Invalid data.");return}let d={};for(let m=1;m{!ae.Molecule.Structure.is(u.obj)||!$.Loci.is(this.lastLoci)||this.lastLoci.structure===u.obj.data&&(this.lastLoci=nr)}),this.subscribeObservable(this.plugin.state.events.object.updated,u=>{!ae.Molecule.Structure.is(u.oldObj)||!$.Loci.is(this.lastLoci)||this.lastLoci.structure===u.oldObj.data&&(this.lastLoci=nr)}),this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current,u=>{if(!this.plugin.state.data.tree.children.has(this.ref))return;let d=u?u.loci:nr;switch(this.params.entry.params.view.name){case"auto":this.updateAuto(d);break;case"selection-box":this.updateSelectionBox(d);break;default:this.lastLoci=d;break}})}unregister(){let c=this.cache.entries.first;for(;c;)c.value.data.asset.dispose(),c=c.next}isCameraTargetSame(c,u){if(!c||!u)return!1;let d=x.equals(c.target,u.target),m=x.squaredDistance(c.target,c.position),p=x.squaredDistance(u.target,u.position),h=Math.abs(m-p)/m<.001;return d&&h}cameraTargetDistance(c){return x.distance(c.target,c.position)}getBoxFromLoci(c){var u,d,m;if(Ht.isEmpty(c)||Zo(c))return ft();let p=this.plugin.helpers.substructureParent.get(c.structure,!0);if(!p)return ft();let h=this.getStructureRoot();if(!h||((u=h.obj)===null||u===void 0?void 0:u.data)!==((d=p.obj)===null||d===void 0?void 0:d.data))return ft();let f=Kp.get((m=h.obj)===null||m===void 0?void 0:m.data.models[0]);f&&ne.invert(this._invTransform,f);let y=$.Loci.extendToWholeResidues(c),g=$.Loci.getBoundary(y,f&&!Number.isNaN(this._invTransform[0])?this._invTransform:void 0).box;return $.Loci.size(y)===1&&ft.expand(g,g,x.create(1,1,1)),g}updateAuto(c){this.updateQueue.enqueue(()=>Y(this,null,function*(){this.lastLoci=c,Zo(c)?yield this.updateParams(this.info.kind==="x-ray"?this.data.structure.boundary.box:void 0,!1):yield this.updateParams(this.getBoxFromLoci(c),!0)}))}updateSelectionBox(c){this.updateQueue.enqueue(()=>Y(this,null,function*(){Ht.areEqual(this.lastLoci,c)?this.lastLoci=nr:this.lastLoci=c;let u=this.getBoxFromLoci(this.lastLoci);yield this.updateParams(u)}))}updateCameraTarget(c){this.updateQueue.enqueue(()=>Y(this,null,function*(){var u,d,m;let p=(u=this.plugin.canvas3d)===null||u===void 0?void 0:u.props.camera.manualReset;try{p||(d=this.plugin.canvas3d)===null||d===void 0||d.setProps({camera:{manualReset:!0}});let h=this.boxFromCameraTarget(c,!0);yield this.updateParams(h)}finally{p||(m=this.plugin.canvas3d)===null||m===void 0||m.setProps({camera:{manualReset:p}})}}))}boxFromCameraTarget(c,u){var d;let m=c.target,p=this.cameraTargetDistance(c),f=Math.tan(.5*c.fov)*p,y=(d=this.plugin.canvas3d)===null||d===void 0?void 0:d.camera.viewport;y&&y.width>y.height&&(f*=y.width/y.height);let g=this.params.entry.params.view.name==="camera-target"?this.params.entry.params.view.params.radius:.5;f*=g;let v,b,S;if(u){let _=x.zero();ft.size(_,this.data.structure.boundary.box),v=Math.min(f,.5*_[0]),b=Math.min(f,.5*_[1]),S=Math.min(f,.5*_[2])}else v=b=S=f;return ft.create(x.create(m[0]-v,m[1]-b,m[2]-S),x.create(m[0]+v,m[1]+b,m[2]+S))}decideDetail(c,u){let d=this.info.kind==="x-ray"?ft.volume(this.data.structure.boundary.box):this.info.header.spacegroup.size.reduce((y,g)=>y*g,1),p=ft.volume(c)/d,h=this.info.header.availablePrecisions.length-1,f=u;for(;p<=.5&&fthis.updateCameraTarget(f))),d=this.boxFromCameraTarget(this.plugin.canvas3d.camera.getSnapshot(),!0);break;case"cell":d=this.info.kind==="x-ray"?this.data.structure.boundary.box:void 0;break;case"auto":if(d=c.entry.params.view.params.isSelection||this.info.kind==="x-ray"?ft.create(x.clone(c.entry.params.view.params.bottomLeft),x.clone(c.entry.params.view.params.topRight)):void 0,d&&(m=ft.volume(d)<1e-4,c.entry.params.view.params.isSelection)){let f=c.entry.params.view.params.radius;ft.expand(d,d,x.create(f,f,f))}break}let p=m?{}:yield this.queryData(d);if(!p)return!1;let h=c.entry.params.channels;return this.info.kind==="x-ray"?(this.channels["2fo-fc"]=this.createChannel(p["2FO-FC"]||Je.One,h["2fo-fc"],this.info.header.sampling[0].valuesInfo[0]),this.channels["fo-fc(+ve)"]=this.createChannel(p["FO-FC"]||Je.One,h["fo-fc(+ve)"],this.info.header.sampling[0].valuesInfo[1]),this.channels["fo-fc(-ve)"]=this.createChannel(p["FO-FC"]||Je.One,h["fo-fc(-ve)"],this.info.header.sampling[0].valuesInfo[1])):this.channels.em=this.createChannel(p.EM||Je.One,h.em,this.info.header.sampling[0].valuesInfo[0]),!0})}createChannel(c,u,d){let m=u;return{data:c,color:m.color,wireframe:m.wireframe,opacity:m.opacity,isoValue:m.isoValue.kind==="relative"?m.isoValue:Je.IsoValue.toRelative(m.isoValue,d)}}getDescription(){return this.params.entry.params.view.name==="selection-box"?"Selection":this.params.entry.params.view.name==="camera-target"?"Camera":this.params.entry.params.view.name==="box"?"Static Box":this.params.entry.params.view.name==="cell"?"Cell":""}constructor(c,u){super(c,{}),this.plugin=c,this.data=u,this.cache=lb.create(25),this.params={},this.lastLoci=nr,this.ref="",this.cameraTargetObservable=this.plugin.canvas3d.didDraw.pipe(xd(500,void 0,{leading:!0,trailing:!0}),Rs(()=>{var d;return(d=this.plugin.canvas3d)===null||d===void 0?void 0:d.camera.getSnapshot()}),IG((d,m)=>this.isCameraTargetSame(d,m)),Np(d=>d!==void 0)),this.cameraTargetSubscription=void 0,this.channels={},this._invTransform=ne(),this.infoMap=new Map,this.data.entries.forEach(d=>this.infoMap.set(d.dataId,d)),this.updateQueue=new UP}}e.Behavior=a})(As||(As={}));var WO={};hi(WO,{ClippingStructureRepresentation3DFromBundle:()=>kBe,ClippingStructureRepresentation3DFromScript:()=>DBe,EmissiveStructureRepresentation3DFromBundle:()=>PBe,EmissiveStructureRepresentation3DFromScript:()=>TBe,ExplodeStructureRepresentation3D:()=>bBe,ModelUnitcell3D:()=>LBe,OverpaintStructureRepresentation3DFromBundle:()=>_Be,OverpaintStructureRepresentation3DFromScript:()=>CBe,ShapeRepresentation3D:()=>RBe,SpinStructureRepresentation3D:()=>SBe,StructureBoundingBox3D:()=>FBe,StructureRepresentation3D:()=>Ub,StructureSelectionsAngle3D:()=>NBe,StructureSelectionsDihedral3D:()=>UBe,StructureSelectionsDistance3D:()=>OBe,StructureSelectionsLabel3D:()=>zBe,StructureSelectionsOrientation3D:()=>VBe,StructureSelectionsPlane3D:()=>GBe,SubstanceStructureRepresentation3DFromBundle:()=>EBe,SubstanceStructureRepresentation3DFromScript:()=>IBe,ThemeStrengthRepresentation3D:()=>MBe,TransparencyStructureRepresentation3DFromBundle:()=>ABe,TransparencyStructureRepresentation3DFromScript:()=>wBe,UnwindStructureAssemblyRepresentation3D:()=>xBe,VolumeRepresentation3D:()=>BBe,VolumeRepresentation3DHelpers:()=>Zd});var zP=Oe(13421772),eDe="Assigns colors according to the Symbol Nomenclature for Glycans (SNFG).",Cee={};function tDe(e){return Cee}function _ee(e,t){let r;if(e.structure){let{elements:n,getElementIndices:o}=e.structure.carbohydrates,i=(s,a)=>{if(!_e.isAtomic(s))return zP;let l=o(s,a);return l.length>0?n[l[0]].component.color:zP};r=(s,a)=>a?jt.Secondary:$.Location.is(s)?i(s.unit,s.element):yt.isLocation(s)?i(s.aUnit,s.aUnit.elements[s.aIndex]):zP}else r=()=>zP;return{factory:_ee,granularity:"group",color:r,props:t,description:eDe,legend:Nl(sq)}}var wee={name:"carbohydrate-symbol",label:"Carbohydrate Symbol",category:wr.Residue,factory:_ee,getParams:tDe,defaultValues:C.getDefaultValues(Cee),isApplicable:e=>!!e.structure&&e.structure.models.some(t=>Ut.hasCarbohydrate(t))};var BF={hue:C.Interval([1,360],{min:0,max:360,step:1}),chroma:C.Interval([40,70],{min:0,max:100,step:1}),luminance:C.Interval([15,85],{min:0,max:100,step:1}),sort:C.Select("contrast",C.arrayToOptions(["none","contrast"]),{description:"no sorting leaves colors approximately ordered by hue"}),clusteringStepCount:C.Numeric(50,{min:10,max:200,step:1},{isHidden:!0}),minSampleCount:C.Numeric(800,{min:100,max:5e3,step:100},{isHidden:!0}),sampleCountFactor:C.Numeric(5,{min:1,max:100,step:1},{isHidden:!0})},hb=2,B1=[0,0,0],R1=[0,0,0];function rDe(e,t){return ji.toHcl(B1,e),ji.fromColor(R1,ji.toColor(e)),B1[0]>=t.hue[0]&&B1[0]<=t.hue[1]&&B1[1]>=t.chroma[0]&&B1[1]<=t.chroma[1]&&B1[2]>=t.luminance[0]&&B1[2]<=t.luminance[1]&&R1[0]>=e[0]-hb&&R1[0]<=e[0]+hb&&R1[1]>=e[1]-hb&&R1[1]<=e[1]+hb&&R1[2]>=e[2]-hb&&R1[2]<=e[2]+hb}function nDe(e){let t=e.slice(0),r=[t.shift()];for(;t.length>0;){let n=r[r.length-1],o=0,i=Number.NEGATIVE_INFINITY;for(let s=0;si&&(i=a,o=s)}r.push(t.splice(o,1)[0])}return r}function oDe(e,t){let r=new Map,n=Math.ceil(Math.cbrt(e)),o=Xc(),i=Math.max((t.hue[1]-t.hue[0])/n,1),s=Math.max((t.chroma[1]-t.chroma[0])/n,1),a=Math.max((t.luminance[1]-t.luminance[0])/n,1);for(let l=t.hue[0]+i/2;l<=t.hue[1];l+=i)for(let c=t.chroma[0]+s/2;c<=t.chroma[1];c+=s)for(let u=t.luminance[0]+a/2;u<=t.luminance[1];u+=a){let d=ji.fromHcl(ji(),Xc.set(o,l,c,u));rDe(d,t)&&r.set(ji.toColor(d),d)}return Array.from(r.values())}function Aee(e,t){let r=1/0,n=0;for(let o=0;o=e));l+=s);for(let l=1;l<=r.clusteringStepCount;++l){let c=ba(i),u=ba(n);for(let m=0;mji.toColor(l))}var Iee={type:"generate",colorList:"red-yellow-blue"};function Ro(e={}){let t=k(k({},Iee),e);return{palette:C.MappedStatic(t.type,{colors:C.Group({list:C.ColorList(t.colorList)},{isFlat:!0}),generate:C.Group(te(k({},BF),{maxCount:C.Numeric(75,{min:1,max:250,step:1})}),{isFlat:!0})},{options:[["colors","Color List"],["generate","Generate Distinct"]]})}}var wDt=C.getDefaultValues(Ro()),Pee={valueLabel:e=>`${e+1}`,minLabel:"Start",maxLabel:"End"};function jo(e,t,r={}){var n;let o,i;if(t.palette.name==="colors"&&t.palette.params.list.kind==="interpolate"){let{list:s}=t.palette.params,a=[0,e-1],{minLabel:l,maxLabel:c}=k(k({},Pee),r),u=s.colors;u.length===0&&(u=zs(Iee.colorList).list);let d=cs.create({listOrName:u,domain:a,minLabel:l,maxLabel:c});i=d.legend,o=d.color}else{let s;t.palette.name==="colors"?(s=t.palette.params.list.colors.map(u=>Array.isArray(u)?u[0]:u),s.length===0&&(s=zs("dark-2").list.map(u=>Array.isArray(u)?u[0]:u))):(e=Math.min(e,t.palette.params.maxCount),s=Tee(e,t.palette.params));let a=(n=r.valueLabel)!==null&&n!==void 0?n:Pee.valueLabel,l=s.length,c=[];for(let u=0;us[u%l]}return{color:o,legend:i}}var iDe="many-distinct",Eee=Oe(16448250),sDe="Gives every chain a color based on its `asym_id` value.",c0=k({asymId:C.Select("auth",C.arrayToOptions(["auth","label"]))},Ro({type:"colors",colorList:iDe}));function aDe(e){var t;let r=C.clone(c0);return!((t=e.structure)===null||t===void 0)&&t.models.some(n=>n.coarseHierarchy.isDefined)&&(r.asymId.defaultValue="label"),r}function lDe(e,t){switch(e.kind){case 0:return t==="auth"?Ne.chain.auth_asym_id:Ne.chain.label_asym_id;case 1:case 2:return Ne.coarse.asym_id}}function Dee(e,t){let r=lDe(e.unit,t)(e);return e.structure.root.models.length>1?kee(e.unit.model,r):r}function kee(e,t){return`${t}|${(Ut.Index.get(e).value||0)+1}`}function cDe(e,t){let r=new Map;for(let n of e.models){let o=Ut.AsymIdOffset.get(n).value,i=(t==="auth"?o?.auth:o?.label)||0,s=0;n.properties.structAsymMap.forEach(({auth_id:a},l)=>{let c=t==="auth"?a:l,u=e.models.length>1?kee(n,c):c;r.has(u)||(r.set(u,s+i),++s)})}return r}function u0(e,t){let r,n;if(e.structure){let o=$.Location.create(e.structure.root),i=cDe(e.structure.root,t.asymId),s=Array.from(i.keys()),a=c=>s[c],l=jo(i.size,t,{valueLabel:a});n=l.legend,r=c=>{let u;if($.Location.is(c)){let d=Dee(c,t.asymId);u=i.get(d)}else if(yt.isLocation(c)){o.unit=c.aUnit,o.element=c.aUnit.elements[c.aIndex];let d=Dee(o,t.asymId);u=i.get(d)}return u===void 0?Eee:l.color(u)}}else r=()=>Eee;return{factory:u0,granularity:"group",color:r,props:t,description:sDe,legend:n}}var VP={name:"chain-id",label:"Chain Id",category:wr.Chain,factory:u0,getParams:aDe,defaultValues:C.getDefaultValues(c0),isApplicable:e=>!!e.structure};var Mee=Oe(13421772),uDe="Gives every element (atom or coarse sphere/gaussian) a unique color based on the position (index) of the element in the list of elements in the structure.",Bee=k({},Ro({type:"colors",colorList:"red-yellow-blue"}));function dDe(e){return Bee}function Ree(e,t){let r,n;if(e.structure){let{units:o}=e.structure.root,i=o.length,s=new Map,a=new Map,l=0;for(let u=0;u{if($.Location.is(u)){let d=a.get(u.unit.id),m=Te.findPredecessorIndex(o[d].elements,u.element);return c.color(s.get(d)+m)}else if(yt.isLocation(u)){let d=a.get(u.aUnit.id),m=Te.findPredecessorIndex(o[d].elements,u.aUnit.elements[u.aIndex]);return c.color(s.get(d)+m)}return Mee}}else r=()=>Mee;return{factory:Ree,granularity:"groupInstance",preferSmoothing:!0,color:r,props:t,description:uDe,legend:n}}var Lee={name:"element-index",label:"Element Index",category:wr.Atom,factory:Ree,getParams:dDe,defaultValues:C.getDefaultValues(Bee),isApplicable:e=>!!e.structure};function d0(e){let t={};return ci(e,(r,n)=>{t[n]=C.Color(e[n])}),t}var mDe="many-distinct",Fee=Oe(13421772),pDe="Assigns a color based on the operator name of a transformed chain.",GP=k({},Ro({type:"colors",colorList:mDe}));function fDe(e){return C.clone(GP)}function hDe(e){let t=new Map;for(let r=0,n=e.units.length;ri[l],a=jo(o.size,t,{valueLabel:s});n=a.legend,r=l=>{let c;if($.Location.is(l)){let u=l.unit.conformation.operator.name;c=o.get(u)}else if(yt.isLocation(l)){let u=l.aUnit.conformation.operator.name;c=o.get(u)}return c===void 0?Fee:a.color(c)}}else r=()=>Fee;return{factory:HP,granularity:"instance",color:r,props:t,description:pDe,legend:n}}var gb={name:"operator-name",label:"Operator Name",category:wr.Symmetry,factory:HP,getParams:fDe,defaultValues:C.getDefaultValues(GP),isApplicable:e=>!!e.structure};var gDe="many-distinct",Oee=Oe(16448250),yDe="Gives every chain a color based on its `label_entity_id` value.",m0=k({},Ro({type:"colors",colorList:gDe}));function vDe(e){return C.clone(m0)}function u_(e,t){return`${e}|${t}`}function xDe(e){let t=new Map;for(let r=0,n=e.models.length;rs[c],l=jo(i.size,t,{valueLabel:a});n=l.legend,r=c=>{let u;if($.Location.is(c)){let d=Nee(c),m=c.structure.models.indexOf(c.unit.model),p=u_(d,m);u=i.get(p)}else if(yt.isLocation(c)){o.unit=c.aUnit,o.element=c.aUnit.elements[c.aIndex];let d=Nee(o),m=o.structure.models.indexOf(o.unit.model),p=u_(d,m);u=i.get(p)}return u===void 0?Oee:l.color(u)}}else r=()=>Oee;return{factory:p0,granularity:"group",color:r,props:t,description:yDe,legend:n}}var Uee={name:"entity-id",label:"Entity Id",category:wr.Chain,factory:p0,getParams:vDe,defaultValues:C.getDefaultValues(m0),isApplicable:e=>!!e.structure};var LF="dark-2",jP=Oe(16448250),bDe="Gives ranges of a polymer chain a color based on the entity source it originates from (e.g. gene, plasmid, organism).",f0=k({},Ro({type:"colors",colorList:LF}));function SDe(e){let t=C.clone(f0);return e.structure&&Vee(e.structure.root.models).srcKeySerialMap.size>Ca[LF].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=te(k({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:zs(LF).list}})),t}function zee(e,t){return`${e}|${t}`}function CDe(e,t,r,n,o,i){return`${e}|${t}|${r}|${i||o||n}`}function RF(e,t,r,n,o,i,s,a){let{entity_id:l,pdbx_src_id:c,pdbx_beg_seq_num:u,pdbx_end_seq_num:d}=o;for(let m=0,p=o._rowCount;m{let n=r.split("|"),o=n[2];return`${Uq(n[3])?`Unnamed ${++t}`:n[3]}${o?` (${o})`:""}`})}function h0(e,t){let r,n;if(e.structure){let o=$.Location.create(e.structure),{models:i}=e.structure.root,{seqToSrcByModelEntity:s,srcKeySerialMap:a}=Vee(i),l=_De(a),c=m=>l[m],u=jo(a.size,t,{valueLabel:c});n=u.legend;let d=m=>{let p=i.indexOf(m.unit.model),h=Ne.entity.id(m),f=zee(p,h),y=s.get(f);if(y){let g=y[Ne.residue.label_seq_id(m)-1]-1;return g===-1?jP:u.color(g)}else return jP};r=m=>$.Location.is(m)?d(m):yt.isLocation(m)?(o.unit=m.aUnit,o.element=m.aUnit.elements[m.aIndex],d(o)):jP}else r=()=>jP;return{factory:h0,granularity:"group",color:r,props:t,description:bDe,legend:n}}var Gee={name:"entity-source",label:"Entity Source",category:wr.Chain,factory:h0,getParams:SDe,defaultValues:C.getDefaultValues(f0),isApplicable:e=>!!e.structure};var Hee=Oe(13421772),wDe="Gives every model a unique color based on its index.",g0=k({},Ro({type:"colors",colorList:"many-distinct"}));function ADe(e){return C.clone(g0)}function y0(e,t){var r;let n,o;if(e.structure){let i=((r=Ut.MaxIndex.get(e.structure.models[0]).value)!==null&&r!==void 0?r:-1)+1,s=jo(i,t);o=s.legend,n=a=>$.Location.is(a)?s.color(Ut.Index.get(a.unit.model).value||0):yt.isLocation(a)?s.color(Ut.Index.get(a.aUnit.model).value||0):Hee}else n=()=>Hee;return{factory:y0,granularity:"instance",color:n,props:t,description:wDe,legend:o}}var jee={name:"model-index",label:"Model Index",category:wr.Chain,factory:y0,getParams:ADe,defaultValues:C.getDefaultValues(g0),isApplicable:e=>!!e.structure&&e.structure.elementCount>0};var qee=Oe(13421772),TDe="Gives every structure a unique color based on its index.",v0=k({},Ro({type:"colors",colorList:"many-distinct"}));function PDe(e){return C.clone(v0)}function x0(e,t){var r;let n,o;if(e.structure){let i=((r=Me.MaxIndex.get(e.structure).value)!==null&&r!==void 0?r:-1)+1,s=jo(i,t);o=s.legend,n=a=>$.Location.is(a)?s.color(Me.Index.get(a.structure).value||0):yt.isLocation(a)?s.color(Me.Index.get(a.aStructure).value||0):qee}else n=()=>qee;return{factory:x0,granularity:"instance",color:n,props:t,description:TDe,legend:o}}var Wee={name:"structure-index",label:"Structure Index",category:wr.Chain,factory:x0,getParams:PDe,defaultValues:C.getDefaultValues(v0),isApplicable:e=>!!e.structure&&e.structure.elementCount>0};var FF="dark-2",Yee=Oe(13421772),IDe="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.",qP=k({},Ro({type:"colors",colorList:FF}));function EDe(e){let t=C.clone(qP);return e.structure&&e.structure.root.units.length>Ca[FF].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=te(k({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:zs(FF).list}})),t}function WP(e,t){let r,n;if(e.structure){let{units:o}=e.structure.root,i=jo(o.length,t);n=i.legend;let s=new Map;for(let a=0,l=o.length;a$.Location.is(a)?s.get(a.unit.id):yt.isLocation(a)?s.get(a.aUnit.id):Yee}else r=()=>Yee;return{factory:WP,granularity:"instance",color:r,props:t,description:IDe,legend:n}}var Xee={name:"unit-index",label:"Chain Instance",category:wr.Chain,factory:WP,getParams:EDe,defaultValues:C.getDefaultValues(qP),isApplicable:e=>!!e.structure};var Kee={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},Qee=Oe(16777215),DDe="Assigns a color to every atom according to its chemical element.",YP={carbonColor:C.MappedStatic("chain-id",{"chain-id":C.Group(c0),"unit-index":C.Group(qP,{label:"Chain Instance"}),"entity-id":C.Group(m0),"entity-source":C.Group(f0),"operator-name":C.Group(GP),"model-index":C.Group(g0),"structure-index":C.Group(v0),uniform:C.Group(xh),"element-symbol":C.EmptyGroup()},{description:"Use chain-id coloring for carbon atoms."}),saturation:C.Numeric(0,{min:-6,max:6,step:.1}),lightness:C.Numeric(.2,{min:-6,max:6,step:.1}),colors:C.MappedStatic("default",{default:C.EmptyGroup(),custom:C.Group(d0(Kee))})};function kDe(e){return C.clone(YP)}function MDe(e,t){let r=e[t];return r===void 0?Qee:r}function BDe(e,t){switch(t.name){case"chain-id":return u0(e,t.params);case"unit-index":return WP(e,t.params);case"entity-id":return p0(e,t.params);case"entity-source":return h0(e,t.params);case"operator-name":return HP(e,t.params);case"model-index":return y0(e,t.params);case"structure-index":return x0(e,t.params);case"uniform":return ep(e,t.params);case"element-symbol":return;default:_r(t)}}function XP(e,t){var r;let n=Rg(t.colors.name==="default"?Kee:t.colors.params,t.saturation,t.lightness),o=(r=BDe(e,t.carbonColor))===null||r===void 0?void 0:r.color;function i(l,c){return o&&l==="C"?o(c,!1):MDe(n,l)}function s(l){if($.Location.is(l)){if(_e.isAtomic(l.unit)){let{type_symbol:c}=l.unit.model.atomicHierarchy.atoms;return i(c.value(l.element),l)}}else if(yt.isLocation(l)&&_e.isAtomic(l.aUnit)){let{type_symbol:c}=l.aUnit.model.atomicHierarchy.atoms,u=c.value(l.aUnit.elements[l.aIndex]);return i(u,l)}return Qee}let a=t.carbonColor.name==="operator-name"||t.carbonColor.name==="unit-index"?"groupInstance":"group";return{factory:XP,granularity:a,preferSmoothing:!0,color:s,props:t,description:DDe,legend:Nl(Object.keys(n).map(l=>[l,n[l]]))}}var Zee={name:"element-symbol",label:"Element Symbol",category:wr.Atom,factory:XP,getParams:kDe,defaultValues:C.getDefaultValues(YP),isApplicable:e=>!!e.structure};var Jee={water:3697840,ion:15729279,protein:12496596,RNA:16629894,DNA:12540695,PNA:4367514,saccharide:8374655},OF=Oe(16777113),RDe="Assigns a color based on the molecule type of a residue.",yb={saturation:C.Numeric(0,{min:-6,max:6,step:.1}),lightness:C.Numeric(0,{min:-6,max:6,step:.1}),colors:C.MappedStatic("default",{default:C.EmptyGroup(),custom:C.Group(d0(Jee))})};function LDe(e){return yb}function $ee(e,t,r){switch(Ix(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 OF}function vb(e,t){let r=Rg(t.colors.name==="default"?Jee:t.colors.params,t.saturation,t.lightness);function n(o){return $.Location.is(o)?$ee(r,o.unit,o.element):yt.isLocation(o)?$ee(r,o.aUnit,o.aUnit.elements[o.aIndex]):OF}return{factory:vb,granularity:"group",color:n,props:t,description:RDe,legend:Nl(Object.keys(r).map(o=>[o,r[o]]).concat([["Other/unknown",OF]]))}}var ete={name:"molecule-type",label:"Molecule Type",category:wr.Residue,factory:vb,getParams:LDe,defaultValues:C.getDefaultValues(yb),isApplicable:e=>!!e.structure};var NF="dark-2",tte=Oe(16448250),FDe="Gives every polymer chain a color based on its `asym_id` value.",nte=k({},Ro({type:"colors",colorList:NF}));function ODe(e){let t=C.clone(nte);return e.structure&&ote(e.structure.root).size>Ca[NF].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=te(k({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:zs(NF).list}})),t}function rte(e){switch(e.kind){case 0:return Ne.chain.label_asym_id;case 1:case 2:return Ne.coarse.asym_id}}function ote(e){let t=new Map;for(let r=0,n=e.unitSymmetryGroups.length;rs[c],l=jo(i.size,t,{valueLabel:a});n=l.legend,r=c=>{let u;if($.Location.is(c)){let d=rte(c.unit);u=i.get(d(c))}else if(yt.isLocation(c)){let d=rte(c.aUnit);o.unit=c.aUnit,o.element=c.aUnit.elements[c.aIndex],u=i.get(d(o))}return u===void 0?tte:l.color(u)}}else r=()=>tte;return{factory:ite,granularity:"group",color:r,props:t,description:FDe,legend:n}}var ste={name:"polymer-id",label:"Polymer Chain Id",category:wr.Chain,factory:ite,getParams:ODe,defaultValues:C.getDefaultValues(nte),isApplicable:e=>!!e.structure};var UF="dark-2",ate=Oe(13421772),NDe="Gives every polymer chain instance a unique color based on the position (index) of the polymer in the list of polymers in the structure.",lte=k({},Ro({type:"colors",colorList:UF}));function UDe(e){let t=C.clone(lte);return e.structure&&cte(e.structure.root)>Ca[UF].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=te(k({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:zs(UF).list}})),t}function cte(e){let t=0,{units:r}=e;for(let n=0,o=r.length;n0&&++t;return t}function ute(e,t){let r,n;if(e.structure){let o=jo(cte(e.structure.root),t);n=o.legend;let{units:i}=e.structure.root,s=new Map;for(let a=0,l=0,c=i.length;a0&&(s.set(i[a].id,o.color(l)),++l);r=a=>{let l;return $.Location.is(a)?l=s.get(a.unit.id):yt.isLocation(a)&&(l=s.get(a.aUnit.id)),l!==void 0?l:ate}}else r=()=>ate;return{factory:ute,granularity:"instance",color:r,props:t,description:NDe,legend:n}}var dte={name:"polymer-index",label:"Polymer Chain Instance",category:wr.Chain,factory:ute,getParams:UDe,defaultValues:C.getDefaultValues(lte),isApplicable:e=>!!e.structure};var fte={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},zF=Oe(16711935),zDe="Assigns a color to every residue according to its name.",QP={saturation:C.Numeric(0,{min:-6,max:6,step:.1}),lightness:C.Numeric(1,{min:-6,max:6,step:.1}),colors:C.MappedStatic("default",{default:C.EmptyGroup(),custom:C.Group(d0(fte))})};function VDe(e){return QP}function mte(e,t){return e.model.atomicHierarchy.atoms.label_comp_id.value(t)}function pte(e,t){let r=e.coarseElements.seq_id_begin.value(t),n=e.coarseElements.seq_id_end.value(t);if(r===n){let o=e.coarseElements.entityKey[t];return e.model.sequence.byEntityKey[o].sequence.compId.value(r-1)}}function KP(e,t){let r=e[t];return r===void 0?zF:r}function ZP(e,t){let r=Rg(t.colors.name==="default"?fte:t.colors.params,t.saturation,t.lightness);function n(o){if($.Location.is(o))if(_e.isAtomic(o.unit)){let i=mte(o.unit,o.element);return KP(r,i)}else{let i=pte(o.unit,o.element);if(i)return KP(r,i)}else if(yt.isLocation(o))if(_e.isAtomic(o.aUnit)){let i=mte(o.aUnit,o.aUnit.elements[o.aIndex]);return KP(r,i)}else{let i=pte(o.aUnit,o.aUnit.elements[o.aIndex]);if(i)return KP(r,i)}return zF}return{factory:ZP,granularity:"group",preferSmoothing:!0,color:n,props:t,description:zDe,legend:Nl(Object.keys(r).map(o=>[o,r[o]]).concat([["Unknown",zF]]))}}var hte={name:"residue-name",label:"Residue Name",category:wr.Residue,factory:ZP,getParams:VDe,defaultValues:C.getDefaultValues(QP),isApplicable:e=>!!e.structure};var yte={alphaHelix:16711808,threeTenHelix:10485888,piHelix:6291584,betaTurn:6324479,betaStrand:16762880,coil:16777215,bend:6740169,turn:45670,dna:11403518,rna:16580962,carbohydrate:10921722},VF=Oe(8421504),GDe="Assigns a color based on the type of secondary structure and basic molecule type.",$P={saturation:C.Numeric(-1,{min:-6,max:6,step:.1}),lightness:C.Numeric(0,{min:-6,max:6,step:.1}),colors:C.MappedStatic("default",{default:C.EmptyGroup(),custom:C.Group(d0(yte))})};function HDe(e){return $P}function gte(e,t,r,n){let o=pn.create(0);if(n&&_e.isAtomic(t)){let i=n.get(t.invariantId);i&&(o=i.type[i.getIndex(t.residueIndex[r])])}if(pn.is(o,2))return pn.is(o,2048)?e.threeTenHelix:pn.is(o,32768)?e.piHelix:e.alphaHelix;if(pn.is(o,4))return e.betaStrand;if(pn.is(o,8))return e.bend;if(pn.is(o,16))return e.turn;{let i=Ix(t,r);if(i===7)return e.dna;if(i===6)return e.rna;if(i===9)return e.carbohydrate;if(i===5)return e.coil}return VF}function JP(e,t){let r=e.structure&&wa.get(e.structure),n=r?Wc(r.id,r.version):-1,o=Rg(t.colors.name==="default"?yte:t.colors.params,t.saturation,t.lightness);function i(s){return $.Location.is(s)?gte(o,s.unit,s.element,r?.value):yt.isLocation(s)?gte(o,s.aUnit,s.aUnit.elements[s.aIndex],r?.value):VF}return{factory:JP,granularity:"group",preferSmoothing:!0,color:i,props:t,contextHash:n,description:GDe,legend:Nl(Object.keys(o).map(s=>[s,o[s]]).concat([["Other",VF]]))}}var vte={name:"secondary-structure",label:"Secondary Structure",category:wr.Residue,factory:JP,getParams:HDe,defaultValues:C.getDefaultValues($P),isApplicable:e=>!!e.structure,ensureCustomProperties:{attach:(e,t)=>t.structure?wa.attach(e,t.structure,void 0,!0):Promise.resolve(),detach:e=>e.structure&&wa.ref(e.structure,!1)}};var jDe=Oe(13421772),qDe="Gives every polymer residue a color based on its `seq_id` value.",Ste={list:C.ColorList("turbo",{presetKind:"scale"})};function WDe(e){return Ste}function xte(e,t){let{model:r}=e;switch(e.kind){case 0:let n=r.atomicHierarchy.residueAtomSegments.index[t];return r.atomicHierarchy.residues.label_seq_id.value(n);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 bte(e,t){let{model:r}=e,n="";switch(e.kind){case 0:let s=r.atomicHierarchy.chainAtomSegments.index[t];n=r.atomicHierarchy.chains.label_entity_id.value(s);break;case 1:n=r.coarseHierarchy.spheres.entity_id.value(t);break;case 2:n=r.coarseHierarchy.gaussians.entity_id.value(t);break}if(n==="")return 0;let o=r.entities.getEntityIndex(n);if(o===-1)return 0;let i=r.sequence.byEntityKey[o];return i===void 0?0:i.sequence.length}function Cte(e,t){let r=cs.create({listOrName:t.list.colors,minLabel:"Start",maxLabel:"End"});return{factory:Cte,granularity:"group",preferSmoothing:!0,color:o=>{if($.Location.is(o)){let{unit:i,element:s}=o,a=xte(i,s);if(a>0){let l=bte(i,s);if(l)return r.setDomain(0,l-1),r.color(a)}}else if(yt.isLocation(o)){let{aUnit:i,aIndex:s}=o,a=xte(i,i.elements[s]);if(a>0){let l=bte(i,i.elements[s]);if(l)return r.setDomain(0,l-1),r.color(a)}}return jDe},props:t,description:qDe,legend:r?r.legend:void 0}}var _te={name:"sequence-id",label:"Sequence Id",category:wr.Residue,factory:Cte,getParams:WDe,defaultValues:C.getDefaultValues(Ste),isApplicable:e=>!!e.structure};var YDe=Oe(16777113),XDe="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.",Ate={domain:C.Interval([0,100]),list:C.ColorList("red-white-blue",{presetKind:"scale"})};function KDe(e){return Ate}function wte(e,t){return _e.isAtomic(e)?e.model.atomicConformation.B_iso_or_equiv.value(t):_e.isSpheres(e)?e.model.coarseConformation.spheres.rmsf[t]:0}function Tte(e,t){let r=cs.create({reverse:!0,domain:t.domain,listOrName:t.list.colors});function n(o){return $.Location.is(o)?r.color(wte(o.unit,o.element)):yt.isLocation(o)?r.color(wte(o.aUnit,o.aUnit.elements[o.aIndex])):YDe}return{factory:Tte,granularity:"group",preferSmoothing:!0,color:n,props:t,description:XDe,legend:r?r.legend:void 0}}var Pte={name:"uncertainty",label:"Uncertainty/Disorder",category:wr.Atom,factory:Tte,getParams:KDe,defaultValues:C.getDefaultValues(Ate),isApplicable:e=>!!e.structure&&e.structure.models.some(t=>t.atomicConformation.B_iso_or_equiv.isDefined||t.coarseHierarchy.isDefined)};var QDe=Oe(15658734),ZDe="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).",Ite={style:C.MappedStatic("entity-id",{uniform:C.Group(xh),"chain-id":C.Group(c0),"entity-id":C.Group(m0),"entity-source":C.Group(f0),"molecule-type":C.Group(yb),"model-index":C.Group(g0),"structure-index":C.Group(v0)}),carbonLightness:C.Numeric(.8,{min:-6,max:6,step:.1})};function $De(e){return C.clone(Ite)}function JDe(e,t){switch(t.name){case"uniform":return ep(e,t.params);case"chain-id":return u0(e,t.params);case"entity-id":return p0(e,t.params);case"entity-source":return h0(e,t.params);case"molecule-type":return vb(e,t.params);case"model-index":return y0(e,t.params);case"structure-index":return x0(e,t.params);default:_r(t)}}function Ete(e,t){let{color:r,legend:n}=JDe(e,t.style);function o(s,a){let l=r(s,!1);return a==="C"?Oe.lighten(l,t.carbonLightness):l}function i(s){if($.Location.is(s)&&_e.isAtomic(s.unit)){let a=s.unit.model.atomicHierarchy.atoms.type_symbol.value(s.element);return o(s,a)}else if(yt.isLocation(s)&&_e.isAtomic(s.aUnit)){let a=s.aUnit.elements[s.aIndex],l=s.aUnit.model.atomicHierarchy.atoms.type_symbol.value(a);return o(s,l)}return QDe}return{factory:Ete,granularity:"group",preferSmoothing:!0,color:i,props:t,description:ZDe,legend:n}}var Dte={name:"illustrative",label:"Illustrative",category:wr.Misc,factory:Ete,getParams:$De,defaultValues:C.getDefaultValues(Ite),isApplicable:e=>!!e.structure};var eke='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).',Bte={list:C.ColorList("red-yellow-green",{presetKind:"scale"}),scale:C.Select("DGwif",[["DGwif","DG water-membrane"],["DGwoct","DG water-octanol"],["Oct-IF","DG difference"]])};function tke(e){return Bte}var rke={DGwif:0,DGwoct:1,"Oct-IF":2};function nke(e,t){let r=jA[e];return r===void 0?0:r[t]}function kte(e,t){return e.model.atomicHierarchy.atoms.label_comp_id.value(t)}function Mte(e,t){let r=e.coarseElements.seq_id_begin.value(t),n=e.coarseElements.seq_id_end.value(t);if(r===n){let o=e.coarseElements.entityKey[t];return e.model.sequence.byEntityKey[o].sequence.compId.value(r-1)}}function Rte(e,t){let r=rke[t.scale],n=1/0,o=-1/0;for(let a in jA){let l=jA[a][r];n=Math.min(n,l),o=Math.max(o,l)}let i=cs.create({listOrName:t.list.colors,domain:[o,n],minLabel:"Hydrophilic",maxLabel:"Hydrophobic"});function s(a){let l;return $.Location.is(a)?_e.isAtomic(a.unit)?l=kte(a.unit,a.element):l=Mte(a.unit,a.element):yt.isLocation(a)&&(_e.isAtomic(a.aUnit)?l=kte(a.aUnit,a.aUnit.elements[a.aIndex]):l=Mte(a.aUnit,a.aUnit.elements[a.aIndex])),i.color(l?nke(l,r):0)}return{factory:Rte,granularity:"group",preferSmoothing:!0,color:s,props:t,description:eke,legend:i?i.legend:void 0}}var Lte={name:"hydrophobicity",label:"Hydrophobicity",category:wr.Residue,factory:Rte,getParams:tke,defaultValues:C.getDefaultValues(Bte),isApplicable:e=>!!e.structure};var Fte=Oe(13421772),oke="Gives every model (frame) a unique color based on the index in its trajectory.",Ote=k({},Ro({type:"colors",colorList:"purples"}));function ike(e){return C.clone(Ote)}function Nte(e,t){var r,n;let o,i;if(e.structure){let{models:s}=e.structure.root,a=0;for(let u of s)a=Math.max(a,((r=Ut.TrajectoryInfo.get(u))===null||r===void 0?void 0:r.size)||0);let l=jo(a,t);i=l.legend;let c=new Map;for(let u=0,d=s.length;u$.Location.is(u)?c.get(Ut.TrajectoryInfo.get(u.unit.model).index):yt.isLocation(u)?c.get(Ut.TrajectoryInfo.get(u.aUnit.model).index):Fte}else o=()=>Fte;return{factory:Nte,granularity:"instance",color:o,props:t,description:oke,legend:i}}var Ute={name:"trajectory-index",label:"Trajectory Index",category:wr.Chain,factory:Nte,getParams:ike,defaultValues:C.getDefaultValues(Ote),isApplicable:e=>!!e.structure&&e.structure.elementCount>0&&Ut.TrajectoryInfo.get(e.structure.models[0]).size>1};var ske=Oe(13421772),ake="Assigns a color based on the occupancy of an atom.",Vte={domain:C.Interval([0,1]),list:C.ColorList("purples",{presetKind:"scale"})};function lke(e){return Vte}function zte(e,t){return _e.isAtomic(e)?e.model.atomicConformation.occupancy.value(t):0}function Gte(e,t){let r=cs.create({reverse:!1,domain:t.domain,listOrName:t.list.colors});function n(o){return $.Location.is(o)?r.color(zte(o.unit,o.element)):yt.isLocation(o)?r.color(zte(o.aUnit,o.aUnit.elements[o.aIndex])):ske}return{factory:Gte,granularity:"group",preferSmoothing:!0,color:n,props:t,description:ake,legend:r?r.legend:void 0}}var Hte={name:"occupancy",label:"Occupancy",category:wr.Atom,factory:Gte,getParams:lke,defaultValues:C.getDefaultValues(Vte),isApplicable:e=>!!e.structure&&e.structure.models.some(t=>t.atomicConformation.occupancy.isDefined)};var HF="dark-2",jte=Oe(13421772),cke="Assigns a color based on the operator HKL value of a transformed chain.",qte=k({},Ro({type:"colors",colorList:HF}));function uke(e){let t=C.clone(qte);return e.structure&&Wte(e.structure.root).map.size>Ca[HF].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=te(k({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:zs(HF).list}})),t}var d_=1e4;function jF(e){return e.map(t=>`${t+d_}`.padStart(5,"0")).join("")}function qF(e){let t=Oq(d_,0),r=parseInt(e.substr(0,t)),n=parseInt(e.substr(t,t)),o=parseInt(e.substr(t+t,t));return x.create(r-d_,n-d_,o-d_)}function GF(e){return e.map(t=>t+5).join("")}function Wte(e){let t=new Map,r=new Set;for(let s=0,a=e.units.length;st.set(s,t.size));let o=qF(n[0]),i=qF(n[n.length-1]);return{min:o,max:i,map:t}}function Yte(e,t){let r,n;if(e.structure){let{min:o,max:i,map:s}=Wte(e.structure.root),a=[];s.forEach((u,d)=>{let m=u%s.size,p=GF(qF(d));a[m]===void 0?a[m]=p:a[m]+=`, ${p}`});let l={minLabel:GF(o),maxLabel:GF(i),valueLabel:u=>a[u]},c=jo(s.size,t,l);n=c.legend,r=u=>{let d;if($.Location.is(u)){let m=jF(u.unit.conformation.operator.hkl);d=s.get(m)}else if(yt.isLocation(u)){let m=jF(u.aUnit.conformation.operator.hkl);d=s.get(m)}return d===void 0?jte:c.color(d)}}else r=()=>jte;return{factory:Yte,granularity:"instance",color:r,props:t,description:cke,legend:n}}var Xte={name:"operator-hkl",label:"Operator HKL",category:wr.Symmetry,factory:Yte,getParams:uke,defaultValues:C.getDefaultValues(qte),isApplicable:e=>!!e.structure};var Ah;(function(e){e.Descriptor={name:"atom_partial_charge"},e.Provider=ta.create(e.Descriptor)})(Ah||(Ah={}));var WF=Oe(16777113),dke="Assigns a color based on the partial charge of an atom.",Qte={domain:C.Interval([-1,1]),list:C.ColorList("red-white-blue",{presetKind:"scale"})};function mke(e){return Qte}function Kte(e,t){var r;return(r=Ah.Provider.get(e.model))===null||r===void 0?void 0:r.data.value(t)}function Zte(e,t){let r=cs.create({domain:t.domain,listOrName:t.list.colors});function n(o){if($.Location.is(o)){let i=Kte(o.unit,o.element);return i!==void 0?r.color(i):WF}else if(yt.isLocation(o)){let i=Kte(o.aUnit,o.aUnit.elements[o.aIndex]);return i!==void 0?r.color(i):WF}return WF}return{factory:Zte,granularity:"group",preferSmoothing:!0,color:n,props:t,description:dke,legend:r?r.legend:void 0}}var $te={name:"partial-charge",label:"Partial Charge",category:wr.Atom,factory:Zte,getParams:mke,defaultValues:C.getDefaultValues(Qte),isApplicable:e=>!!e.structure&&e.structure.models.some(t=>Ah.Provider.get(t)!==void 0)};var pke="many-distinct",Jte=Oe(16448250),fke="Gives every atom a color based on its `label_atom_id` value.",ere=k({},Ro({type:"colors",colorList:pke}));function hke(e){return C.clone(ere)}function gke(e){let t=new Map;for(let r of e.models){let{label_atom_id:n}=r.atomicHierarchy.atoms;for(let o=0,i=n.rowCount;os[c],l=jo(i.size,t,{valueLabel:a});n=l.legend,r=c=>{let u;if($.Location.is(c)){let d=Ne.atom.label_atom_id(c);u=i.get(d)}else if(yt.isLocation(c)){o.unit=c.aUnit,o.element=c.aUnit.elements[c.aIndex];let d=Ne.atom.label_atom_id(o);u=i.get(d)}return u===void 0?Jte:l.color(u)}}else r=()=>Jte;return{factory:tre,granularity:"group",preferSmoothing:!0,color:r,props:t,description:fke,legend:n}}var rre={name:"atom-id",label:"Atom Id",category:wr.Atom,factory:tre,getParams:hke,defaultValues:C.getDefaultValues(ere),isApplicable:e=>!!e.structure};var yke="Assign color based on the given value of a volume cell.",nre={colorList:C.ColorList({kind:"interpolate",colors:[[Yt.white,0],[Yt.red,.25],[Yt.white,.5],[Yt.blue,.75],[Yt.white,1]]},{offsets:!0,isEssential:!0})};function vke(e){return nre}function ore(e,t){let r=cs.create({domain:[0,1],listOrName:t.colorList.colors}),n=[];for(let i=0;i<256;++i)n[i]=r.color(i/255);let o={colors:n,filter:"linear"};return{factory:ore,granularity:"direct",props:t,description:yke,legend:r.legend,palette:o}}var ire={name:"volume-value",label:"Volume Value",category:wr.Misc,factory:ore,getParams:vke,defaultValues:C.getDefaultValues(nre),isApplicable:e=>!!e.volume&&!Je.Segmentation.get(e.volume)};var sre=Oe(13421772),xke="Gives every volume segment a unique color.",are=k({},Ro({type:"colors",colorList:"many-distinct"}));function bke(e){return C.clone(are)}function lre(e,t){let r,n,o=e.volume&&Je.Segmentation.get(e.volume);if(o){let i=o.segments.size,s=Array.from(o.segments.keys()),a=jo(i,t);n=a.legend,r=l=>Je.Segment.isLocation(l)?a.color(s.indexOf(l.segment)):sre}else r=()=>sre;return{factory:lre,granularity:"instance",color:r,props:t,description:xke,legend:n}}var cre={name:"volume-segment",label:"Volume Segment",category:wr.Misc,factory:lre,getParams:bke,defaultValues:C.getDefaultValues(are),isApplicable:e=>!!e.volume&&!!Je.Segmentation.get(e.volume)};var Ske="Assigns a color based on volume value at a given vertex.",ure={volume:C.ValueRef(e=>e.state.data.selectQ(r=>r.root.subtree().filter(n=>{var o;return Je.is((o=n.obj)===null||o===void 0?void 0:o.data)})).map(r=>{var n,o;return[r.transform.ref,(o=(n=r.obj)===null||n===void 0?void 0:n.label)!==null&&o!==void 0?o:""]}),(e,t)=>t(e)),coloring:C.MappedStatic("absolute-value",{"absolute-value":C.Group({domain:C.MappedStatic("auto",{custom:C.Interval([-1,1]),auto:C.Group({symmetric:C.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:C.ColorList("red-white-blue",{presetKind:"scale"})}),"relative-value":C.Group({domain:C.MappedStatic("auto",{custom:C.Interval([-1,1]),auto:C.Group({symmetric:C.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:C.ColorList("red-white-blue",{presetKind:"scale"})})}),defaultColor:C.Color(Oe(13421772)),normalOffset:C.Numeric(0,{min:0,max:20,step:.1},{description:"Offset vertex position along its normal by given amount."})};function dre(e,t){let r;try{r=t.volume.getValue()}catch{}let n;if(r){let o=t.coloring.params,{stats:i}=r.grid,s=o.domain.name==="custom"?o.domain.params:[i.min,i.max],a=t.coloring.name==="relative-value";if(o.domain.name==="auto"&&a&&(s[0]=(s[0]-i.mean)/i.sigma,s[1]=(s[1]-i.mean)/i.sigma),t.coloring.params.domain.name==="auto"&&t.coloring.params.domain.params.symmetric){let g=Math.max(Math.abs(s[0]),Math.abs(s[1]));s[0]=-g,s[1]=g}let l=cs.create({domain:s,listOrName:o.list.colors}),c=wo.getGridToCartesianTransform(r.grid);ne.invert(c,c);let u=x(),{dimensions:d,get:m}=r.grid.cells.space,p=r.grid.cells.data,[h,f,y]=d;n=g=>{if(!UQ(g))return t.defaultColor;x.copy(u,g.position),t.normalOffset>0&&x.scaleAndAdd(u,u,g.normal,t.normalOffset),x.transformMat4(u,u,c);let v=Math.floor(u[0]),b=Math.floor(u[1]),S=Math.floor(u[2]);if(v<0||v>=h||b<0||b>=f||S<0||S>=y)return t.defaultColor;let _=u[0]-v,w=u[1]-b,E=u[2]-S,A=Math.min(v+1,h-1),P=Math.min(b+1,f-1),T=Math.min(S+1,y-1),B=m(p,v,b,S),D=m(p,A,b,S),M=m(p,v,P,S),R=m(p,A,P,S),U=Kn(Kn(B,D,_),Kn(M,R,_),w);B=m(p,v,b,T),D=m(p,A,b,T),M=m(p,v,P,T),R=m(p,A,P,T);let F=Kn(Kn(B,D,_),Kn(M,R,_),w),N=Kn(U,F,E);return a&&(N=(N-i.mean)/i.sigma),l.color(N)}}else n=()=>t.defaultColor;return{factory:dre,granularity:"vertex",preferSmoothing:!0,color:n,props:t,description:Ske}}var mre={name:"external-volume",label:"External Volume",category:wr.Misc,factory:dre,getParams:()=>ure,defaultValues:C.getDefaultValues(ure),isApplicable:e=>!0};var Cke="Uses separate themes for coloring mainchain and sidechain visuals.",pre={mainchain:C.MappedStatic("molecule-type",{uniform:C.Group(xh),"chain-id":C.Group(c0),"entity-id":C.Group(m0),"entity-source":C.Group(f0),"molecule-type":C.Group(yb),"model-index":C.Group(g0),"structure-index":C.Group(v0),"secondary-structure":C.Group($P)}),sidechain:C.MappedStatic("residue-name",{uniform:C.Group(xh),"residue-name":C.Group(QP),"element-symbol":C.Group(YP)})};function _ke(e){return C.clone(pre)}function wke(e,t){switch(t.name){case"uniform":return ep(e,t.params);case"chain-id":return u0(e,t.params);case"entity-id":return p0(e,t.params);case"entity-source":return h0(e,t.params);case"molecule-type":return vb(e,t.params);case"model-index":return y0(e,t.params);case"structure-index":return x0(e,t.params);case"secondary-structure":return JP(e,t.params);default:_r(t)}}function Ake(e,t){switch(t.name){case"uniform":return ep(e,t.params);case"residue-name":return ZP(e,t.params);case"element-symbol":return XP(e,t.params);default:_r(t)}}function fre(e,t){var r,n;let o=wke(e,t.mainchain),i=Ake(e,t.sidechain);function s(l,c){return c?o.color(l,!1):i.color(l,!1)}let a=o.legend;return((r=o.legend)===null||r===void 0?void 0:r.kind)==="table-legend"&&((n=i.legend)===null||n===void 0?void 0:n.kind)==="table-legend"&&(a={kind:"table-legend",table:[...o.legend.table,...i.legend.table]}),{factory:fre,granularity:"group",preferSmoothing:!1,color:s,props:t,description:Cke,legend:a}}var hre={name:"cartoon",label:"Cartoon",category:wr.Misc,factory:fre,getParams:_ke,defaultValues:C.getDefaultValues(pre),isApplicable:e=>!!e.structure};var Oi;(function(e){e.Category=wr,e.PaletteScale=(1<<24)-1,e.EmptyFactory=()=>e.Empty;let t=Oe(13421772);e.Empty={factory:e.EmptyFactory,granularity:"uniform",color:()=>t,props:{}};function r(o,i){return o.contextHash===i.contextHash&&o.factory===i.factory&&Ra(o.props,i.props)}e.areEqual=r,e.EmptyProvider={name:"",label:"",category:"",factory:e.EmptyFactory,getParams:()=>({}),defaultValues:{},isApplicable:()=>!0};function n(){return new xb(e.BuiltIn,e.EmptyProvider)}e.createRegistry=n,e.BuiltIn={"atom-id":rre,"carbohydrate-symbol":wee,cartoon:hre,"chain-id":VP,"element-index":Lee,"element-symbol":Zee,"entity-id":Uee,"entity-source":Gee,hydrophobicity:Lte,illustrative:Dte,"model-index":jee,"molecule-type":ete,occupancy:Hte,"operator-hkl":Xte,"operator-name":gb,"partial-charge":$te,"polymer-id":ste,"polymer-index":dte,"residue-name":hte,"secondary-structure":vte,"sequence-id":_te,"shape-group":dee,"structure-index":Wee,"trajectory-index":Ute,uncertainty:Pte,"unit-index":Xee,uniform:SJ,"volume-segment":cre,"volume-value":ire,"external-volume":mre}})(Oi||(Oi={}));var Tke=1,Pke="Assigns a physical size, i.e. vdW radius for atoms or given radius for coarse spheres.",gre={scale:C.Numeric(1,{min:.1,max:5,step:.1})};function Ike(e){return gre}function YF(e,t){return _e.isAtomic(e)?Xp(e.model.atomicHierarchy.atoms.type_symbol.value(t)):_e.isSpheres(e)?e.model.coarseConformation.spheres.radius[t]:0}function yre(e,t){let r=t.scale===void 0?1:t.scale;function n(o){let i;return $.Location.is(o)?i=r*YF(o.unit,o.element):yt.isLocation(o)?i=r*Math.min(YF(o.aUnit,o.aUnit.elements[o.aIndex]),YF(o.bUnit,o.bUnit.elements[o.bIndex])):i=r*Tke,i}return{factory:yre,granularity:"group",size:n,props:t,description:Pke}}var vre={name:"physical",label:"Physical",category:"",factory:yre,getParams:Ike,defaultValues:C.getDefaultValues(gre),isApplicable:e=>!!e.structure};var Eke="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.",bre={bfactorFactor:C.Numeric(.1,{min:0,max:1,step:.01}),rmsfFactor:C.Numeric(.05,{min:0,max:1,step:.01}),baseSize:C.Numeric(.2,{min:0,max:2,step:.1})};function Dke(e){return bre}function xre(e,t,r){return _e.isAtomic(e)?e.model.atomicConformation.B_iso_or_equiv.value(t)*r.bfactorFactor:_e.isSpheres(e)?e.model.coarseConformation.spheres.rmsf[t]*r.rmsfFactor:0}function Sre(e,t){function r(n){let o=t.baseSize;return $.Location.is(n)?o+=xre(n.unit,n.element,t):yt.isLocation(n)&&(o+=xre(n.aUnit,n.aUnit.elements[n.aIndex],t)),o}return{factory:Sre,granularity:"group",size:r,props:t,description:Eke}}var Cre={name:"uncertainty",label:"Uncertainty/Disorder",category:"",factory:Sre,getParams:Dke,defaultValues:C.getDefaultValues(bre),isApplicable:e=>!!e.structure&&e.structure.models.some(t=>t.atomicConformation.B_iso_or_equiv.isDefined||t.coarseHierarchy.isDefined)};var mi;(function(e){e.EmptyFactory=()=>e.Empty,e.Empty={factory:e.EmptyFactory,granularity:"uniform",size:()=>1,props:{}};function t(n,o){return n.contextHash===o.contextHash&&n.factory===o.factory&&Ra(n.props,o.props)}e.areEqual=t,e.EmptyProvider={name:"",label:"",category:"",factory:e.EmptyFactory,getParams:()=>({}),defaultValues:{},isApplicable:()=>!0};function r(){return new xb(e.BuiltIn,e.EmptyProvider)}e.createRegistry=r,e.BuiltIn={physical:vre,"shape-group":cee,uncertainty:Cre,uniform:_J}})(mi||(mi={}));var Lo;(function(e){function t(i,s,a,l){l=l||r();let c=a.colorTheme,u=a.sizeTheme;return l.color=i.colorThemeRegistry.create(c.name,s,c.params),l.size=i.sizeThemeRegistry.create(u.name,s,u.params),l}e.create=t;function r(){return{color:Oi.Empty,size:mi.Empty}}e.createEmpty=r;function n(i,s,a,l){return Y(this,null,function*(){var c,u;yield(c=s.colorThemeRegistry.get(l.colorTheme.name).ensureCustomProperties)===null||c===void 0?void 0:c.attach(i,a),yield(u=s.sizeThemeRegistry.get(l.sizeTheme.name).ensureCustomProperties)===null||u===void 0?void 0:u.attach(i,a)})}e.ensureDependencies=n;function o(i,s,a){var l,c;(l=i.colorThemeRegistry.get(a.colorTheme.name).ensureCustomProperties)===null||l===void 0||l.detach(s),(c=i.sizeThemeRegistry.get(a.sizeTheme.name).ensureCustomProperties)===null||c===void 0||c.detach(s)}e.releaseDependencies=o})(Lo||(Lo={}));function _re(e){return e.map(t=>[t.name,t.provider.label,t.provider.category])}var xb=class{get default(){return this._list[0]}get list(){return this._list}get types(){return _re(this._list)}constructor(t,r){this.emptyProvider=r,this._list=[],this._map=new Map,this._name=new Map,ci(t,(n,o)=>{if(n.name!==o)throw new Error(`Fix build in themes to have matching names. ${n.name} ${o}`);this.add(n)})}sort(){this._list.sort((t,r)=>t.provider.category===r.provider.category?t.provider.labelr.provider.label?1:0:t.provider.categoryn.name===t.name),1);let r=this._map.get(t.name);r&&(this._map.delete(t.name),this._name.delete(r))}has(t){return this._map.has(t.name)}get(t){return this._map.get(t)||this.emptyProvider}getName(t){if(!this._name.has(t))throw new Error(`'${t.label}' is not a registered theme provider.`);return this._name.get(t)}create(t,r,n={}){let o=this.get(t);return o.factory(r,k(k({},C.getDefaultValues(o.getParams(r))),n))}getApplicableList(t){return this._list.filter(r=>r.provider.isApplicable(t))}getApplicableTypes(t){return _re(this.getApplicableList(t))}clear(){this._list.length=0,this._map.clear(),this._name.clear()}};var Ft=function(e){return e[e.None=0]="None",e[e.Highlight=1]="Highlight",e[e.RemoveHighlight=2]="RemoveHighlight",e[e.Select=4]="Select",e[e.Deselect=8]="Deselect",e[e.Toggle=16]="Toggle",e[e.Clear=32]="Clear",e}(Ft||{}),Fo;(function(e){e.is=gi.has,e.All=Ft.Highlight|Ft.RemoveHighlight|Ft.Select|Ft.Deselect|Ft.Toggle|Ft.Clear,e.Highlighting=Ft.Highlight|Ft.RemoveHighlight|Ft.Clear,e.Selecting=Ft.Select|Ft.Deselect|Ft.Toggle|Ft.Clear;function t(r,n){return r===Ft.Highlight&&n===Ft.RemoveHighlight||r===Ft.RemoveHighlight&&n===Ft.Highlight||r===Ft.Select&&n===Ft.Deselect||r===Ft.Deselect&&n===Ft.Select||r===Ft.Toggle&&n===Ft.Toggle}e.isReverse=t})(Fo||(Fo={}));function wre(e,t,r){e.fill(t,0,r)}function bb(e,t,r){switch(r){case Ft.Highlight:e[t]|=1;break;case Ft.RemoveHighlight:e[t]&=-2;break;case Ft.Select:e[t]|=2;break;case Ft.Deselect:e[t]&=-3;break;case Ft.Toggle:e[t]^=2;break;case Ft.Clear:e[t]=0;break}}function Za(e,t,r){if(r===Ft.None)return!1;if(ve.is(t)){let n=ve.start(t),o=ve.end(t),i=n+3>>2,s=i+(o-4*i>>2);if(s<=i){for(let m=n;m>2),l=n,c=Math.min(4*i,o),u=Math.max(n,4*s),d=o;switch(r){case Ft.Highlight:for(let m=i;m!isNaN(t)).map(t=>+t).sort((t,r)=>t-r).map(t=>e[t])}function eI(e,t,r){return e&&e[t]!==void 0?e[t]:r}function st(e,...t){return{kind:"alias",aliases:t,symbol:e}}function tI(e,t,...r){return e.info.namespace="molscript-macro",e.id=`molscript-macro.${e.info.name}`,{kind:"macro",symbol:e,translate:t,aliases:[e.info.name,...r]}}function kke(e){return e.kind==="alias"||e.kind==="macro"}var Mke=[["Core symbols",st(Ce.core.type.bool,"bool"),st(Ce.core.type.num,"num"),st(Ce.core.type.str,"str"),st(Ce.core.type.regex,"regex"),st(Ce.core.type.list,"list"),st(Ce.core.type.set,"set"),st(Ce.core.type.compositeKey,"composite-key"),st(Ce.core.logic.not,"not"),st(Ce.core.logic.and,"and"),st(Ce.core.logic.or,"or"),st(Ce.core.ctrl.if,"if"),st(Ce.core.ctrl.fn,"fn"),st(Ce.core.ctrl.eval,"eval"),st(Ce.core.math.add,"add","+"),st(Ce.core.math.sub,"sub","-"),st(Ce.core.math.mult,"mult","*"),st(Ce.core.math.div,"div","/"),st(Ce.core.math.pow,"pow","**"),st(Ce.core.math.mod,"mod"),st(Ce.core.math.min,"min"),st(Ce.core.math.max,"max"),st(Ce.core.math.cantorPairing,"cantor-pairing"),st(Ce.core.math.sortedCantorPairing,"sorted-cantor-pairing"),st(Ce.core.math.invertCantorPairing,"invert-cantor-pairing"),st(Ce.core.math.floor,"floor"),st(Ce.core.math.ceil,"ceil"),st(Ce.core.math.roundInt,"round"),st(Ce.core.math.trunc,"trunc"),st(Ce.core.math.abs,"abs"),st(Ce.core.math.sign,"sign"),st(Ce.core.math.sqrt,"sqrt"),st(Ce.core.math.cbrt,"cbrt"),st(Ce.core.math.sin,"sin"),st(Ce.core.math.cos,"cos"),st(Ce.core.math.tan,"tan"),st(Ce.core.math.asin,"asin"),st(Ce.core.math.acos,"acos"),st(Ce.core.math.atan,"atan"),st(Ce.core.math.sinh,"sinh"),st(Ce.core.math.cosh,"cosh"),st(Ce.core.math.tanh,"tanh"),st(Ce.core.math.exp,"exp"),st(Ce.core.math.log,"log"),st(Ce.core.math.log10,"log10"),st(Ce.core.math.atan2,"atan2"),st(Ce.core.rel.eq,"eq","="),st(Ce.core.rel.neq,"neq","!="),st(Ce.core.rel.lt,"lt","<"),st(Ce.core.rel.lte,"lte","<="),st(Ce.core.rel.gr,"gr",">"),st(Ce.core.rel.gre,"gre",">="),st(Ce.core.rel.inRange,"in-range"),st(Ce.core.str.concat,"concat"),st(Ce.core.str.match,"regex.match"),st(Ce.core.list.getAt,"list.get"),st(Ce.core.set.has,"set.has"),st(Ce.core.set.isSubset,"set.subset")],["Structure",["Types",st(Ce.structureQuery.type.entityType,"ent-type"),st(Ce.structureQuery.type.authResidueId,"auth-resid"),st(Ce.structureQuery.type.labelResidueId,"label-resid"),st(Ce.structureQuery.type.ringFingerprint,"ringfp"),st(Ce.structureQuery.type.bondFlags,"bond-flags")],["Slots",st(Ce.structureQuery.slot.elementSetReduce,"atom.set.reduce.value")],["Generators",st(Ce.structureQuery.generator.atomGroups,"sel.atom.atom-groups"),st(Ce.structureQuery.generator.queryInSelection,"sel.atom.query-in-selection"),st(Ce.structureQuery.generator.rings,"sel.atom.rings"),st(Ce.structureQuery.generator.empty,"sel.atom.empty"),st(Ce.structureQuery.generator.all,"sel.atom.all"),st(Ce.structureQuery.generator.bondedAtomicPairs,"sel.atom.bonded-pairs"),tI(a1("sel.atom.atoms",Zt.Dictionary({0:ht(Ee.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to each atom."})}),kt.ElementSelection,"A selection of singleton atom sets."),e=>oe.struct.generator.atomGroups({"atom-test":eI(e,0,!0)})),tI(a1("sel.atom.res",Zt.Dictionary({0:ht(Ee.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each residue."})}),kt.ElementSelection,"A selection of atom sets grouped by residue."),e=>oe.struct.generator.atomGroups({"residue-test":eI(e,0,!0),"group-by":oe.ammp("residueKey")})),tI(a1("sel.atom.chains",Zt.Dictionary({0:ht(Ee.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each chain."})}),kt.ElementSelection,"A selection of atom sets grouped by chain."),e=>oe.struct.generator.atomGroups({"chain-test":eI(e,0,!0),"group-by":oe.ammp("chainKey")}))],["Modifiers",st(Ce.structureQuery.modifier.queryEach,"sel.atom.query-each"),st(Ce.structureQuery.modifier.intersectBy,"sel.atom.intersect-by"),st(Ce.structureQuery.modifier.exceptBy,"sel.atom.except-by"),st(Ce.structureQuery.modifier.unionBy,"sel.atom.union-by"),st(Ce.structureQuery.modifier.union,"sel.atom.union"),st(Ce.structureQuery.modifier.cluster,"sel.atom.cluster"),st(Ce.structureQuery.modifier.includeSurroundings,"sel.atom.include-surroundings"),st(Ce.structureQuery.modifier.surroundingLigands,"sel.atom.surrounding-ligands"),st(Ce.structureQuery.modifier.includeConnected,"sel.atom.include-connected"),st(Ce.structureQuery.modifier.expandProperty,"sel.atom.expand-property")],["Filters",st(Ce.structureQuery.filter.pick,"sel.atom.pick"),st(Ce.structureQuery.filter.first,"sel.atom.first"),st(Ce.structureQuery.filter.withSameAtomProperties,"sel.atom.with-same-atom-properties"),st(Ce.structureQuery.filter.intersectedBy,"sel.atom.intersected-by"),st(Ce.structureQuery.filter.within,"sel.atom.within"),st(Ce.structureQuery.filter.isConnectedTo,"sel.atom.is-connected-to")],["Combinators",st(Ce.structureQuery.combinator.intersect,"sel.atom.intersect"),st(Ce.structureQuery.combinator.merge,"sel.atom.merge"),st(Ce.structureQuery.combinator.distanceCluster,"sel.atom.dist-cluster")],["Atom Set Properties",st(Ce.structureQuery.atomSet.atomCount,"atom.set.atom-count"),st(Ce.structureQuery.atomSet.countQuery,"atom.set.count-query"),st(Ce.structureQuery.atomSet.reduce,"atom.set.reduce"),st(Ce.structureQuery.atomSet.propertySet,"atom.set.property")],["Atom Properties",st(Ce.structureQuery.atomProperty.core.elementSymbol,"atom.el"),st(Ce.structureQuery.atomProperty.core.vdw,"atom.vdw"),st(Ce.structureQuery.atomProperty.core.mass,"atom.mass"),st(Ce.structureQuery.atomProperty.core.atomicNumber,"atom.atomic-number"),st(Ce.structureQuery.atomProperty.core.x,"atom.x"),st(Ce.structureQuery.atomProperty.core.y,"atom.y"),st(Ce.structureQuery.atomProperty.core.z,"atom.z"),st(Ce.structureQuery.atomProperty.core.sourceIndex,"atom.src-index"),st(Ce.structureQuery.atomProperty.core.operatorName,"atom.op-name"),st(Ce.structureQuery.atomProperty.core.operatorKey,"atom.op-key"),st(Ce.structureQuery.atomProperty.core.modelIndex,"atom.model-index"),st(Ce.structureQuery.atomProperty.core.modelLabel,"atom.model-label"),st(Ce.structureQuery.atomProperty.core.atomKey,"atom.key"),st(Ce.structureQuery.atomProperty.core.bondCount,"atom.bond-count"),st(Ce.structureQuery.atomProperty.topology.connectedComponentKey,"atom.key.molecule"),st(Ce.structureQuery.atomProperty.macromolecular.authResidueId,"atom.auth-resid"),st(Ce.structureQuery.atomProperty.macromolecular.labelResidueId,"atom.label-resid"),st(Ce.structureQuery.atomProperty.macromolecular.residueKey,"atom.key.res"),st(Ce.structureQuery.atomProperty.macromolecular.chainKey,"atom.key.chain"),st(Ce.structureQuery.atomProperty.macromolecular.entityKey,"atom.key.entity"),st(Ce.structureQuery.atomProperty.macromolecular.isHet,"atom.is-het"),st(Ce.structureQuery.atomProperty.macromolecular.id,"atom.id"),st(Ce.structureQuery.atomProperty.macromolecular.label_atom_id,"atom.label_atom_id"),st(Ce.structureQuery.atomProperty.macromolecular.label_alt_id,"atom.label_alt_id","atom.altloc"),st(Ce.structureQuery.atomProperty.macromolecular.label_comp_id,"atom.label_comp_id"),st(Ce.structureQuery.atomProperty.macromolecular.label_asym_id,"atom.label_asym_id"),st(Ce.structureQuery.atomProperty.macromolecular.label_entity_id,"atom.label_entity_id"),st(Ce.structureQuery.atomProperty.macromolecular.label_seq_id,"atom.label_seq_id"),st(Ce.structureQuery.atomProperty.macromolecular.auth_atom_id,"atom.auth_atom_id","atom.name"),st(Ce.structureQuery.atomProperty.macromolecular.auth_comp_id,"atom.auth_comp_id","atom.resname"),st(Ce.structureQuery.atomProperty.macromolecular.auth_asym_id,"atom.auth_asym_id","atom.chain"),st(Ce.structureQuery.atomProperty.macromolecular.auth_seq_id,"atom.auth_seq_id","atom.resno"),st(Ce.structureQuery.atomProperty.macromolecular.pdbx_PDB_ins_code,"atom.pdbx_PDB_ins_code","atom.inscode"),st(Ce.structureQuery.atomProperty.macromolecular.pdbx_formal_charge,"atom.pdbx_formal_charge"),st(Ce.structureQuery.atomProperty.macromolecular.occupancy,"atom.occupancy"),st(Ce.structureQuery.atomProperty.macromolecular.B_iso_or_equiv,"atom.B_iso_or_equiv","atom.bfactor"),st(Ce.structureQuery.atomProperty.macromolecular.entityType,"atom.entity-type"),st(Ce.structureQuery.atomProperty.macromolecular.entitySubtype,"atom.entity-subtype"),st(Ce.structureQuery.atomProperty.macromolecular.entityPrdId,"atom.entity-prd-id"),st(Ce.structureQuery.atomProperty.macromolecular.entityDescription,"atom.entity-description"),st(Ce.structureQuery.atomProperty.macromolecular.objectPrimitive,"atom.object-primitive"),st(Ce.structureQuery.atomProperty.macromolecular.chemCompType,"atom.chem-comp-type"),st(Ce.structureQuery.atomProperty.macromolecular.secondaryStructureKey,"atom.key.sec-struct"),st(Ce.structureQuery.atomProperty.macromolecular.isModified,"atom.is-modified"),st(Ce.structureQuery.atomProperty.macromolecular.modifiedParentName,"atom.modified-parent")],["Bond Properties",st(Ce.structureQuery.bondProperty.order,"bond.order"),st(Ce.structureQuery.bondProperty.length,"bond.length"),st(Ce.structureQuery.bondProperty.key,"bond.key"),st(Ce.structureQuery.bondProperty.atomA,"bond.atom-a"),st(Ce.structureQuery.bondProperty.atomB,"bond.atom-b"),tI(a1("bond.is",Zt.List(kt.BondFlag),Ee.Bool,`Test if the current bond has at least one (or all if partial = false) of the specified flags: ${Ee.oneOfValues(kt.BondFlag).join(", ")}`),e=>oe.core.flags.hasAny([oe.struct.bondProperty.flags(),oe.struct.type.bondFlags(Pre(e))]))]]],Ire=[];function Ere(e){for(let t of e)kke(t)?Ire.push(t):t instanceof Array&&Ere(t)}Ere(Mke);var rI=function(){let e=[],t=Object.create(null),r=cn.create(),n=cn.create();for(let o of Ire){for(let s of o.aliases){if(e.push([s,o]),t[s])throw new Error(`Alias '${s}' already in use.`);t[s]=o}let i=o.symbol.args;if(i.kind!=="dictionary"){i.type.kind==="oneof"&&Ee.oneOfValues(i.type).forEach(s=>cn.add(n,s,s));continue}for(let s of Object.keys(i.map)){isNaN(s)&&cn.add(r,s,s);let a=i.map[s];a.type.kind==="oneof"&&Ee.oneOfValues(a.type).forEach(l=>cn.add(n,l,l))}}return{symbolList:e,symbolMap:t,namedArgs:r.array,constants:n.array}}();var e5t=rI.constants,t5t=rI.namedArgs,Sb=rI.symbolMap,r5t=rI.symbolList;function m_(e){if(Hi.isLiteral(e))return e;if(Hi.isSymbol(e)){if(!Sb[e.name])return e;let s=Sb[e.name];if(s.kind==="alias")return Hi.Symbol(Sb[e.name].symbol.id);throw s.translate([])}let t=Hi.isSymbol(e.head)&&!!Sb[e.head.name]&&Sb[e.head.name].kind==="macro",r=t?e.head:m_(e.head),n=r!==e.head;if(!e.args)return t?m_(e.head):n?Hi.Apply(r):e;let o=!1,i;if(Hi.isArgumentsArray(e.args)){i=[];for(let s=0,a=e.args.length;s{let n=[],o;for(;;)if(o=Hd(this._(t,r),o),o.status){if(r===o.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");r=o.index,n.push(o.value)}else return Hd(ql(r,n),o)})}times(t,r){let n=typeof r>"u"?t:r;return new e((o,i)=>{let s=[],a,l,c;for(c=0;ct)}atMost(t){return this.times(0,t)}atLeast(t){return e.seq(this.times(t),this.many()).map(r=>[...r[0],...r[1]])}map(t){return new e((r,n)=>{let o=this._(r,n);return o.status?Hd(ql(o.index,t(o.value)),o):o})}skip(t){return XF(0,this,t)}mark(){return e.seq(e.index,this,e.index).map(t=>({start:t[0],value:t[1],end:t[2]}))}node(t){return e.seq(e.index,this,e.index).map(r=>({name:t,start:r[0],value:r[1],end:r[2]}))}sepBy(t){return e.sepBy(this,t)}sepBy1(t){return e.sepBy1(this,t)}lookahead(t){return this.skip(e.lookahead(t))}notFollowedBy(t){return this.skip(e.notFollowedBy(t))}desc(t){return new e((r,n)=>{let o=this._(r,n);return o.status||(o.expected=[t]),o})}fallback(t){return this.or(e.succeed(t))}ap(t){return e.seq(t,this).map(([r,n])=>r(n))}chain(t){return new e((r,n)=>{let o=this._(r,n);if(!o.status)return o;let i=t(o.value);return Hd(i._(r,o.index),o)})}};(function(e){function t(A,P,T){let B=[].slice.call(arguments);if(B.length===0)throw new Error("seqMap needs at least one argument");let D=B.pop();return Nke(D),n.apply(null,B).map(function(M){return D.apply(null,M)})}e.seqMap=t;function r(A){let P={};for(let T of Object.keys(A))(function(B){P[B]=S(()=>A[B](P))})(T);return P}e.createLanguage=r;function n(...A){let P=A.length;return new e((T,B)=>{let D,M=new Array(P),R=B;for(let U=0;U{let D;for(let M=0;M[B[0],...B[1]])}e.sepBy1=s;function a(A){let P=`'${A}'`;if(A.length===1){let T=A.charCodeAt(0);return new e((B,D)=>B.charCodeAt(D)===T?ql(D+1,A):Th(D,P))}return new e((T,B)=>{let D=B+A.length;return T.slice(B,D)===A?ql(D,A):Th(B,P)})}e.string=a;function l(A){let P=""+A;return P.slice(P.lastIndexOf("/")+1)}function c(A){return RegExp("^(?:"+A.source+")",l(A))}function u(A,P=0){let T=c(A),B=""+A;return new e((D,M)=>{let R=T.exec(D.slice(M));if(R){if(0<=P&&P<=R.length){let F=R[0],N=R[P];return ql(M+F.length,N)}let U=`invalid match group (0 to ${R.length}) in ${B}`;return Th(M,U)}return Th(M,B)})}e.regexp=u;function d(A){return new e((P,T)=>ql(T,A))}e.succeed=d;function m(A){return new e((P,T)=>Th(T,A))}e.fail=m;function p(A){if(Oke(A))return new e((P,T)=>{let B=A._(P,T);return B.status&&(B.index=T,B.value=null),B});if(typeof A=="string")return p(a(A));if(A instanceof RegExp)return p(u(A));throw new Error("not a string, regexp, or parser: "+A)}e.lookahead=p;function h(A){return new e((P,T)=>{let B=A._(P,T);return B.status?Th(T,'not "'+P.slice(T,B.index)+'"'):ql(T,null)})}e.notFollowedBy=h;function f(A){return new e((P,T)=>{let B=P.charAt(T);return TA.indexOf(P)>=0)}e.oneOf=y;function g(A){return f(P=>A.indexOf(P)<0)}e.noneOf=g;function v(A,P){return f(T=>A<=T&&T<=P).desc(A+"-"+P)}e.range=v;function b(A){return new e((P,T)=>{let B=T;for(;B{let D=A()._;return P._=D,D(T,B)});return P}e.lazy=S;function _(){return m("empty")}e.empty=_,e.index=new e(function(A,P){return ql(P,kre(A,P))}),e.anyChar=new e((A,P)=>P>=A.length?Th(P,"any character"):ql(P+1,A.charAt(P))),e.all=new e(function(A,P){return ql(A.length,A.slice(P))}),e.eof=new e(function(A,P){return P{let i,s,a=o;for(let l=0;lt.furthest)return e;let r=e.furthest===t.furthest?Fke(e.expected,t.expected):t.expected;return{status:e.status,furthest:t.furthest,expected:r}}function kre(e,t){let r=e.slice(0,t).split(` +`),n=r.length,o=r[r.length-1].length+1;return{offset:t,line:n,column:o}}function Bke(e){return e.length===1?e[0]:"one of "+e.join(", ")}function Rke(e,t){let r=t.index,n=r.offset;if(n===e.length)return", got the end of the input";let o=n>0?"'...":"'",i=e.length-n>12?"...'":"'";return` at line ${r.line} column ${r.column}, got ${o}${e.slice(n,n+12)}${i}`}function Lke(e,t){return`expected ${Bke(t.expected)}${Rke(e,t)}`}function Fke(e,t){let r=e.length,n=t.length;if(r===0)return t;if(n===0)return e;let o=new Set,i=[];for(let s=0;sqe.alt(o,d,i,s).trim(r)),o=qe.takeWhile(S=>S!=="`").trim("`").map(t.str),i=qe.regexp(/[^()\[\]{};`,\n\r\s]+/).map(t.symb),s=qe.regexp(/\s*;+([^\n\r]*)\n/,1).map(t.comment),a=n.many(),l=a.wrap("(",")").map(S=>t.list("(",S)),c=a.wrap("[","]").map(S=>t.list("[",S)),u=a.wrap("{","}").map(S=>t.list("{",S)),d=qe.alt(l,c,u),m=n.many();function p(S){return m.tryParse(S)}function h(S){switch(S.kind){case"string":return S.value;case"symbol":{let _=S.value;if(_.length>1)switch(_.charAt(0)){case".":return oe.atomName(_.substr(1));case"_":return oe.struct.type.elementSymbol([_.substr(1)])}return _==="true"?!0:_==="false"?!1:v(_)?+_:Hi.Symbol(_)}case"list":switch(S.bracket){case"[":return oe.core.type.list(g(S.nodes).map(h));case"{":return oe.core.type.set(g(S.nodes).map(h));case"(":{if(S.nodes[0].kind==="comment")throw new Error("Invalid expression");let _=h(S.nodes[0]);return Hi.Apply(_,f(S.nodes))}default:_r(S.bracket)}default:_r(S)}}function f(S){if(S.length<=1)return;if(!y(S)){let A=[];for(let P=1,T=S.length;P1&&T.value.charAt(0)===":"){let B=T.value.substr(1);for(++A;A=P)throw new Error(`There must be a value foolowed a named arg ':${B}'.`);if(S[A].kind==="comment")throw new Error("Invalid expression");_[B]=h(S[A]),isNaN(+B)&&(w=!1)}else _[E++]=h(T)}if(w){let A=Object.keys(_).map(T=>+T).sort((T,B)=>T-B),P=!0;for(let T=0,B=A.length;T1&&E.value.charAt(0)===":")return!0}return!1}function g(S){let _=!1;for(let w=0,E=S.length;ww.kind!=="comment"):S}function v(S){return/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/.test(S)&&!isNaN(+S)}function b(S){let _=p(S),w=[];for(let E of _)E.kind!=="comment"&&(w[w.length]=h(E));return w}e.parse=b})(KF||(KF={}));var To=oe;function Ta(e,t,r){let n=qe.lazy(()=>qe.seq(e,n).map(o=>r(...o)).or(t));return n}function p_(e,t,r){return qe.seqMap(t,e.many(),(n,o)=>o.reduce((i,s)=>r(s,i),n))}function la(e,t,r){return qe.seqMap(t,qe.seq(e,t).many(),(n,o)=>o.reduce((i,s)=>{let[a,l]=s;return r(a,i,l)},n))}function b0(e,t){return e.reduce((n,o)=>{let i=o.isUnsupported?Ph(`operator '${o.name}' not supported`):o.map;return o.type(o.rule,n,i)},t)}function jd(e,t=0){return qe.optWhitespace.then(qe.regexp(e,t).skip(qe.optWhitespace))}function Ec(e,t=0){return qe.regexp(e,t).skip(qe.optWhitespace)}function f_(e,t=0){return qe.optWhitespace.then(qe.regexp(e,t))}function nI(e,t){let r=t?`${e}|${oh(t)}`:e,n=RegExp(`(${r})\\s+([-+]?[0-9]*\\.?[0-9]+)\\s+OF`,"i");return jd(n,2).map(parseFloat)}function Ph(e){return function(){throw new Error(e)}}function h_(e){return e.length===1?e[0]:e.length>1?To.core.logic.and(e):void 0}function Rre(e){return e.length===1?e[0]:e.length>1?To.core.logic.or(e):void 0}function QF(e,t){if(t&&t.op!==void 0&&t.val!==void 0){let r=[e,t.val];switch(t.op){case"=":return To.core.rel.eq(r);case"!=":return To.core.rel.neq(r);case">":return To.core.rel.gr(r);case"<":return To.core.rel.lt(r);case">=":return To.core.rel.gre(r);case"<=":return To.core.rel.lte(r);default:throw new Error(`operator '${t.op}' not supported`)}}else return t&&t.flags!==void 0?To.core.flags.hasAny([e,t.flags]):t&&t.min!==void 0&&t.max!==void 0?To.core.rel.inRange([e,t.min,t.max]):Array.isArray(t)?t.length>1?To.core.set.has([To.core.type.set(t),e]):To.core.rel.eq([e,t[0]]):To.core.rel.eq([e,t])}function $a(e){return To.struct.generator.queryInSelection({0:e,query:To.struct.generator.all(),"in-complement":!0})}function au(e,t){return e.length{let n=e[r],o=Ph(`property '${r}' not supported`),i=qe.regexp(n.regex).map(s=>(n.isUnsupported&&o(),QF(n.property,n.map(s))));n.isNumeric||(t[r]=i)}),t}function oI(e){let t=[];return Object.keys(e).sort(au).forEach(r=>{let n=e[r],o=Ph(`property '${r}' not supported`),i=qe.regexp(n.regex).map(l=>(n.isUnsupported&&o(),QF(n.property,n.map(l)))),s=qe.regexp(ZF(r,n.abbr)).trim(qe.optWhitespace),a=l=>To.struct.generator.atomGroups({[n.level]:l});n.isNumeric?t.push(s.then(qe.seq(qe.regexp(/>=|<=|=|!=|>|(n.isUnsupported&&o(),QF(n.property,{op:l[0],val:l[1]}))).map(a)):t.push(s.then(i).map(a))}),t}function Cb(e){let t=[];return Object.keys(e).sort(au).forEach(r=>{let n=e[r],o=n.map?n.map:Ph(`keyword '${r}' not supported`),i=qe.regexp(ZF(r,n.abbr)).map(o);t.push(i)}),t}function Fre(e,t){let r=[],n=qe.regexp(/\(\s*/),o=qe.regexp(/\s*\)/);return Object.keys(e).sort(au).forEach(i=>{let s=e[i],a=s.map?s.map:Ph(`function '${i}' not supported`),l=qe.regexp(new RegExp(i,"i")).skip(n).then(t).skip(o).map(a);r.push(l)}),r}function g_(e,t){let r=[];return Object.keys(e).sort(au).forEach(n=>{let o=e[n],i=Ph(`property '${n}' not supported`),s=qe.regexp(ZF(n,o.abbr)).lookahead(t).map(()=>(o.isUnsupported&&i(),o.property));r.push(s)}),r}function _b(e,t,r,n){let o=[];for(let i in e)o.push(i),e[i].abbr&&o.push(...e[i].abbr);for(let i in t)o.push(i),t[i].abbr&&o.push(...t[i].abbr);return r.forEach(i=>{o.push(i.name),i.abbr&&o.push(...i.abbr)}),o}function Wu(e){return To.core.type.set(e.map(To.atomName))}function Yu(e){return To.struct.generator.queryInSelection({0:e,query:To.struct.generator.all()})}function F1(e,t,r){switch(e.head.name){case"structure-query.atom-property.macromolecular.label_atom_id":return To.atomName(t);case"structure-query.atom-property.core.element-symbol":return To.es(t);case"structure-query.atom-property.macromolecular.secondary-structure-flags":return r&&(t=[r[t.toUpperCase()]||"none"]),To.struct.type.secondaryStructureFlags([t]);default:return t}}var Bre="structure-query.atom-property.macromolecular.",Uke=["entityKey","label_entity_id","entityType"],zke=["chainKey","label_asym_id","label_entity_id","auth_asym_id","entityType"],Vke=["residueKey","label_comp_id","label_seq_id","auth_comp_id","auth_seq_id","pdbx_formal_charge","secondaryStructureKey","secondaryStructureFlags","isModified","modifiedParentName"];function Ore(e){if(e.head.name.startsWith(Bre)){let t=e.head.name.substr(Bre.length);if(Uke.includes(t))return"entity-test";if(zke.includes(t))return"chain-test";if(Vke.includes(t))return"residue-test"}return"atom-test"}var Gke=["structure-query.atom-property.macromolecular.secondary-structure-flags"];function Nre(e,t){if(Gke.includes(e.head.name)){let r=t[0].head,n=[];return t.forEach(o=>n.push(...o.args[0])),To.core.flags.hasAny([e,{head:r,args:n}])}else{if(t.length===1)return To.core.rel.eq([e,t[0]]);if(t.length>1)return To.core.set.has([To.core.type.set(t),e])}}function Sn(e){return To.struct.generator.atomGroups({"residue-test":To.core.set.has([To.core.type.set(e),To.ammp("label_comp_id")])})}var ps=oe,qd=/[-+]?[0-9]*\.?[0-9]+/,y_=/[0-9]+/;function dr(e){return e}var Hke={none:"none",turn:"turn",sheet:"beta",helix:"helix",dna:"dna",rna:"rna",carbohydrate:"carbohydrate",helix310:"3-10",helixalpha:"alpha",helixpi:"pi",0:"none",1:"turn",2:"beta",3:"helix",4:"dna",5:"rna",6:"carbohydrate",7:"3-10",8:"alpha",9:"pi"};function $F(e){if(e.head){if(e.head.name&&e.head.name==="core.type.regex"&&(e=e.args[0].replace(/^\^|\$$/g,"")),e=Hke[e.toString().toLowerCase()]||"none",["dna","rna","carbohydrate"].indexOf(e)!==-1)throw new Error("values 'dna', 'rna', 'carbohydrate' not yet supported for 'structure' property");return ps.struct.type.secondaryStructureFlags([e])}}var JF={adpmax:{"@desc":"the maximum anisotropic displacement parameter for the selected atom","@examples":[""],isUnsupported:!0,regex:qd,map:e=>parseFloat(e),level:"atom-test"},adpmin:{"@desc":"the minimum anisotropic displacement parameter for the selected atom","@examples":[""],isUnsupported:!0,regex:qd,map:e=>parseFloat(e),level:"atom-test"},altloc:{"@desc":"PDB alternate location identifier","@examples":["altloc = A"],regex:/[a-zA-Z0-9]/,map:dr,level:"atom-test",property:ps.ammp("label_alt_id")},altname:{"@desc":"an alternative name given to atoms by some file readers (for example, P2N)","@examples":[""],isUnsupported:!0,regex:/[a-zA-Z0-9]/,map:dr,level:"atom-test"},atomID:{"@desc":"special atom IDs for PDB atoms assigned by Jmol","@examples":[""],isUnsupported:!0,regex:y_,map:e=>parseInt(e),level:"atom-test"},atomIndex:{"@desc":"atom 0-based index; a unique number for each atom regardless of the number of models loaded","@examples":[""],isUnsupported:!0,regex:y_,map:e=>parseInt(e),level:"atom-test"},atomName:{"@desc":"atom name","@examples":["atomName = CA"],regex:/[a-zA-Z0-9]+/,map:e=>ps.atomName(e),level:"atom-test",property:ps.ammp("label_atom_id")},atomno:{"@desc":'sequential number; you can use "@" instead of "atomno=" -- for example, select @33 or Var x = @33 or @35',"@examples":[""],isUnsupported:!0,regex:y_,map:e=>parseInt(e),level:"atom-test"},atomType:{"@desc":"atom type (mol2, AMBER files) or atom name (other file types)","@examples":["atomType = OH"],regex:/[a-zA-Z0-9]+/,map:e=>ps.atomName(e),level:"atom-test",property:ps.ammp("label_atom_id")},atomX:{"@desc":"Cartesian X coordinate (or just X)","@examples":["x = 4.2"],abbr:["X"],isNumeric:!0,regex:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.acp("x")},atomY:{"@desc":"Cartesian Y coordinate (or just Y)","@examples":["y < 42"],abbr:["Y"],isNumeric:!0,regex:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.acp("y")},atomZ:{"@desc":"Cartesian Z coordinate (or just Z)","@examples":["Z > 10"],abbr:["Z"],isNumeric:!0,regex:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.acp("z")},bondcount:{"@desc":"covalent bond count","@examples":["bondcount = 0"],isNumeric:!0,regex:y_,map:e=>parseInt(e),level:"atom-test",property:ps.acp("bondCount")},bondingRadius:{"@desc":"radius used for auto bonding; synonymous with ionic and ionicRadius","@examples":[""],abbr:["ionic","ionicRadius"],isUnsupported:!0,regex:qd,map:e=>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:dr,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:y_,map:e=>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:dr,level:"chain-test",property:ps.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:dr,level:"atom-test"},color:{"@desc":"the atom color","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,level:"atom-test"},cs:{"@desc":"chemical shift calculated using computational results that include magnetic shielding tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:e=>ps.es(e),level:"atom-test",property:ps.acp("elementSymbol")},elemno:{"@desc":"atomic element number","@examples":["elemno=8"],regex:/[0-9\s{}-]+/,map:e=>parseInt(e),level:"atom-test",property:ps.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:dr,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:dr,level:"atom-test"},file:{"@desc":"file number containing this atom","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},formalCharge:{"@desc":"formal charge","@examples":["formalCharge=1"],regex:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.ammp("pdbx_formal_charge")},format:{"@desc":"format (label) of the atom.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fXyz:{"@desc":"fractional XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fX:{"@desc":"fractional X coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fY:{"@desc":"fractional Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fZ:{"@desc":"fractional Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fuxyz:{"@desc":"fractional XYZ coordinates in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fux:{"@desc":"fractional X coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fuy:{"@desc":"fractional Y coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},fuz:{"@desc":"fractional Z coordinate in the unit cell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},group:{"@desc":"3-letter residue code","@examples":["group = ALA"],regex:/[a-zA-Z0-9]{1,3}/,map:dr,level:"residue-test",property:ps.ammp("label_comp_id")},group1:{"@desc":"single-letter residue code (amino acids only)","@examples":["group1 = G"],regex:/[a-zA-Z]/,map:dr,level:"residue-test",property:ps.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:dr,level:"atom-test"},groupindex:{"@desc":"overall group index","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,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:dr,level:"atom-test"},insertion:{"@desc":"protein residue insertion code","@examples":["insertion=A"],regex:/[a-zA-Z0-9]/,map:dr,level:"atom-test",property:ps.ammp("pdbx_PDB_ins_code")},label:{"@desc":"current atom label (same as format)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},mass:{"@desc":"atomic mass -- especially useful with appended .max or .sum","@examples":["mass > 13"],regex:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.acp("mass")},model:{"@desc":"model number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,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:dr,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:dr,level:"atom-test"},molecule:{"@desc":"molecule number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,level:"atom-test"},ms:{"@desc":"magnetic shielding calculated from file-loaded tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.ammp("occupancy")},partialCharge:{"@desc":"partial charge","@examples":[""],isUnsupported:!0,regex:qd,map:e=>parseFloat(e),level:"atom-test"},phi:{"@desc":"protein group PHI angle for atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},polymer:{"@desc":"sequential polymer number in a model, starting with 1.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},polymerLength:{"@desc":"polymer length","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},property_xx:{"@desc":"a property created using the DATA command","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},psi:{"@desc":"protein group PSI angle for the atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,level:"atom-test"},resno:{"@desc":"PDB residue number, not including insertion code (see also seqcode, below)","@examples":["resno = 100"],regex:/-?[0-9]+/,map:e=>parseInt(e),level:"residue-test",property:ps.ammp("auth_seq_id")},selected:{"@desc":"1.0 if atom is selected; 0.0 if not","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,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:dr,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:dr,level:"atom-test"},shape:{"@desc":'hybridization geometry such as "tetrahedral"',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},site:{"@desc":"crystallographic site number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},spacefill:{"@desc":"currently displayed radius","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,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:dr,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:dr,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:dr,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:dr,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:dr,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:dr,level:"atom-test"},temperature:{"@desc":"yes yes temperature factor (B-factor)","@examples":["temperature >= 20"],regex:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.ammp("B_iso_or_equiv")},unitXyz:{"@desc":"unit cell XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},uX:{"@desc":"unit cell X coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},uY:{"@desc":"unit cell Y coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},uZ:{"@desc":"unit cell Z coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,level:"atom-test"},vanderwaals:{"@desc":"van der Waals radius","@examples":["vanderwaals >2"],regex:qd,map:e=>parseFloat(e),level:"atom-test",property:ps.acp("vdw")},vectorScale:{"@desc":"vibration vector scale","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,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:dr,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:dr,level:"atom-test"},vY:{"@desc":"vibration vector Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,level:"atom-test"},vZ:{"@desc":"vibration vector Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:dr,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:dr,level:"atom-test"}};var Ure=oe,eO=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not ARG"],name:"not",type:Ta,rule:qe.alt(qe.regex(/NOT/i).skip(qe.whitespace),qe.string("!").skip(qe.optWhitespace)),map:(e,t)=>$a(t)},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["ASP and .CA"],name:"and",type:la,rule:jd(/AND|&/i),map:(e,t,r)=>Ure.struct.modifier.intersectBy({0:t,by:r})},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["ASP or GLU"],name:"or",type:la,rule:jd(/OR|\||,/i),map:(e,t,r)=>Ure.struct.combinator.merge([t,r])}];var ze=oe,si={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"]},zre={nucleic:["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],protein:["C","N","CA"]};function v_(){return ze.struct.combinator.merge([ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.set(...si.nucleic),ze.ammp("label_comp_id")])}),ze.struct.filter.pick({0:ze.struct.generator.atomGroups({"group-by":ze.ammp("residueKey")}),test:ze.core.logic.and([ze.core.rel.eq([ze.struct.atomSet.atomCount(),1]),ze.core.rel.eq([ze.ammp("label_atom_id"),ze.atomName("P")])])}),ze.struct.filter.pick({0:ze.struct.generator.atomGroups({"group-by":ze.ammp("residueKey")}),test:ze.core.logic.or([ze.core.set.isSubset([Wu(["C1'","C2'","O3'","C3'","C4'","C5'","O5'"]),ze.ammpSet("label_atom_id")]),ze.core.set.isSubset([Wu(["C1*","C2*","O3*","C3*","C4*","C5*","O5*"]),ze.ammpSet("label_atom_id")])])})])}function jke(){return ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.set(...si.amino),ze.ammp("label_comp_id")])})}function qke(){return ze.struct.combinator.merge([ze.struct.modifier.intersectBy({0:ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.core.type.set(si.amino),ze.ammp("label_comp_id")])}),by:ze.struct.generator.atomGroups({"atom-test":ze.core.set.has([ze.core.type.set(zre.protein),ze.ammp("label_atom_id")])})}),ze.struct.modifier.intersectBy({0:ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.core.type.set(si.nucleic),ze.ammp("label_comp_id")])}),by:ze.struct.generator.atomGroups({"atom-test":ze.core.set.has([ze.core.type.set(zre.nucleic),ze.ammp("label_atom_id")])})})])}var tO={all:{"@desc":"all atoms; same as *",abbr:["*"],map:()=>ze.struct.generator.all()},bonded:{"@desc":"covalently bonded",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.rel.gr([ze.struct.atomProperty.core.bondCount({flags:ze.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:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.rel.gr([ze.struct.atomProperty.core.bondCount({flags:ze.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:()=>ze.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:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.set.has([ze.set(...["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map(ze.es)),ze.acp("elementSymbol")])})},metal:{"@desc":"!nonmetal",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.logic.not([ze.core.set.has([ze.set(...["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map(ze.es)),ze.acp("elementSymbol")])])})},alkaliMetal:{"@desc":"_Li,_Na,_K,_Rb,_Cs,_Fr",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.set.has([ze.set(...["Li","Na","K","Rb","Cs","Fr"].map(ze.es)),ze.acp("elementSymbol")])})},alkalineEarth:{"@desc":"_Be,_Mg,_Ca,_Sr,_Ba,_Ra",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.set.has([ze.set(...["Be","Mg","Ca","Sr","Ba","Ra"].map(ze.es)),ze.acp("elementSymbol")])})},nobleGas:{"@desc":"_He,_Ne,_Ar,_Kr,_Xe,_Rn",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.set.has([ze.set(...["He","Ne","Ar","Kr","Xe","Rn"].map(ze.es)),ze.acp("elementSymbol")])})},metalloid:{"@desc":"_B,_Si,_Ge,_As,_Sb,_Te",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.set.has([ze.set(...["B","Si","Ge","As","Sb","Te"].map(ze.es)),ze.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:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.logic.or([ze.core.rel.inRange([ze.acp("atomicNumber"),21,30]),ze.core.rel.inRange([ze.acp("atomicNumber"),39,48]),ze.core.rel.inRange([ze.acp("atomicNumber"),72,80]),ze.core.rel.inRange([ze.acp("atomicNumber"),104,112]),ze.core.set.has([ze.set(57,89),ze.acp("atomicNumber")])])})},lanthanide:{"@desc":"(does not include La) elemno>57 and elemno<=71",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.rel.inRange([ze.acp("atomicNumber"),57,71])})},actinide:{"@desc":"(does not include Ac) elemno>89 and elemno<=103",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.rel.inRange([ze.acp("atomicNumber"),89,103])})},isaromatic:{"@desc":"atoms connected with the AROMATIC, AROMATICSINGLE, or AROMATICDOUBLE bond types",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.rel.gr([ze.struct.atomProperty.core.bondCount({flags:ze.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:()=>v_()},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:()=>ze.struct.modifier.intersectBy({0:v_(),by:ze.struct.combinator.merge([ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.set("A","G","I","DA","DG","DI","+A","+G","+I"),ze.ammp("label_comp_id")])}),ze.struct.filter.pick({0:ze.struct.generator.atomGroups({"group-by":ze.ammp("residueKey")}),test:ze.core.set.isSubset([Wu(["N7","C8","N9"]),ze.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:()=>ze.struct.modifier.intersectBy({0:v_(),by:ze.struct.combinator.merge([ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.set("C","T","U","DC","DT","DU","+C","+T","+U"),ze.ammp("label_comp_id")])}),ze.struct.filter.pick({0:ze.struct.generator.atomGroups({"group-by":ze.ammp("residueKey")}),test:ze.core.logic.or([ze.core.set.has([ze.ammpSet("label_atom_id"),ze.atomName("O2*")]),ze.core.set.has([ze.ammpSet("label_atom_id"),ze.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:()=>ze.struct.modifier.intersectBy({0:v_(),by:ze.struct.combinator.merge([ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.set("DG","DC","DA","DT","DU","DI","T","+G","+C","+A","+T"),ze.ammp("label_comp_id")])}),ze.struct.filter.pick({0:ze.struct.generator.atomGroups({"group-by":ze.ammp("residueKey")}),test:ze.core.logic.not([ze.core.logic.or([ze.core.set.has([ze.ammpSet("label_atom_id"),ze.atomName("O2*")]),ze.core.set.has([ze.ammpSet("label_atom_id"),ze.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:()=>ze.struct.modifier.intersectBy({0:v_(),by:ze.struct.combinator.merge([ze.struct.generator.atomGroups({"residue-test":ze.core.set.has([ze.set("G","C","A","U","I","+U","+I"),ze.ammp("label_comp_id")])}),ze.struct.filter.pick({0:ze.struct.generator.atomGroups({"group-by":ze.ammp("residueKey")}),test:ze.core.logic.or([ze.core.set.has([ze.ammpSet("label_atom_id"),ze.atomName("O2*")]),ze.core.set.has([ze.ammpSet("label_atom_id"),ze.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:()=>jke()},acidic:{"@desc":"ASP GLU",map:()=>Sn(si.acidic)},acyclic:{"@desc":"amino and not cyclic",map:()=>ze.struct.modifier.intersectBy({0:Sn(si.amino),by:$a(Sn(si.cyclic))})},aliphatic:{"@desc":"ALA GLY ILE LEU VAL",map:()=>Sn(si.aliphatic)},amino:{"@desc":"all twenty standard amino acids, plus ASX, GLX, UNK",map:()=>Sn(si.amino)},aromatic:{"@desc":'HIS PHE TRP TYR (see also "isaromatic" for aromatic bonds)',map:()=>Sn(si.aromatic)},basic:{"@desc":"ARG HIS LYS",map:()=>Sn(si.basic)},buried:{"@desc":"ALA CYS ILE LEU MET PHE TRP VAL",map:()=>Sn(si.buried)},charged:{"@desc":"same as acidic or basic -- ASP GLU, ARG HIS LYS",map:()=>Sn(si.acidic.concat(si.basic))},cyclic:{"@desc":"HIS PHE PRO TRP TYR",map:()=>Sn(si.cyclic)},helix:{"@desc":"secondary structure-related.",map:()=>ze.struct.generator.atomGroups({"residue-test":ze.core.flags.hasAny([ze.struct.type.secondaryStructureFlags(["helix"]),ze.ammp("secondaryStructureFlags")])})},helixalpha:{"@desc":"secondary structure-related.",map:()=>ze.struct.generator.atomGroups({"residue-test":ze.core.flags.hasAny([ze.struct.type.secondaryStructureFlags(["alpha"]),ze.ammp("secondaryStructureFlags")])})},helix310:{"@desc":"secondary structure-related.",map:()=>ze.struct.generator.atomGroups({"residue-test":ze.core.flags.hasAny([ze.struct.type.secondaryStructureFlags(["3-10"]),ze.ammp("secondaryStructureFlags")])})},helixpi:{"@desc":"secondary structure-related.",map:()=>ze.struct.generator.atomGroups({"residue-test":ze.core.flags.hasAny([ze.struct.type.secondaryStructureFlags(["pi"]),ze.ammp("secondaryStructureFlags")])})},hetero:{"@desc":"PDB atoms designated as HETATM",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.ammp("isHet")})},hydrophobic:{"@desc":"ALA GLY ILE LEU MET PHE PRO TRP TYR VAL",map:()=>Sn(si.hydrophobic)},large:{"@desc":"ARG GLU GLN HIS ILE LEU LYS MET PHE TRP TYR",map:()=>Sn(si.large)},medium:{"@desc":"ASN ASP CYS PRO THR VAL",map:()=>Sn(si.medium)},negative:{"@desc":"same as acidic -- ASP GLU",map:()=>Sn(si.acidic)},neutral:{"@desc":"amino and not (acidic or basic)",map:()=>ze.struct.modifier.intersectBy({0:Sn(si.amino),by:$a(Sn(si.acidic.concat(si.basic)))})},polar:{"@desc":"amino and not hydrophobic",map:()=>ze.struct.modifier.intersectBy({0:Sn(si.amino),by:$a(Sn(si.hydrophobic))})},positive:{"@desc":"same as basic -- ARG HIS LYS",map:()=>Sn(si.basic)},sheet:{"@desc":"secondary structure-related",map:()=>ze.struct.generator.atomGroups({"residue-test":ze.core.flags.hasAny([ze.struct.type.secondaryStructureFlags(["sheet"]),ze.ammp("secondaryStructureFlags")])})},small:{"@desc":"ALA GLY SER",map:()=>Sn(si.small)},surface:{"@desc":"amino and not buried",map:()=>ze.struct.modifier.intersectBy({0:Sn(si.amino),by:$a(Sn(si.buried))})},turn:{"@desc":"secondary structure-related",map:()=>ze.struct.generator.atomGroups({"residue-test":ze.core.flags.hasAny([ze.struct.type.secondaryStructureFlags(["turn"]),ze.ammp("secondaryStructureFlags")])})},alpha:{"@desc":"(*.CA)",map:()=>ze.struct.generator.atomGroups({"atom-test":ze.core.rel.eq([ze.atomName("CA"),ze.ammp("label_atom_id")])})},base:{"@desc":"(nucleic bases)"},backbone:{"@desc":"(*.C, *.CA, *.N, and all nucleic other than the bases themselves)",abbr:["mainchain"],map:()=>qke()},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'}};var Yr=oe,Wke=[{"@desc":"value comparisons","@examples":[],name:"=",abbr:["=="],type:la,rule:qe.regexp(/\s*(LIKE|>=|<=|=|!=|>|<)\s*/i,1),map:(e,t,r)=>{let n;if(t==="structure"?n=Yr.core.flags.hasAny([Yr.ammp("secondaryStructureFlags"),$F(r)]):r==="structure"?n=Yr.core.flags.hasAny([Yr.ammp("secondaryStructureFlags"),$F(t)]):t.head!==void 0?t.head.name==="core.type.regex"&&(n=Yr.core.str.match([t,Yr.core.type.str([r])])):r.head!==void 0?r.head.name==="core.type.regex"&&(n=Yr.core.str.match([r,Yr.core.type.str([t])])):e.toUpperCase()==="LIKE"&&(t.head?n=Yr.core.str.match([Yr.core.type.regex([`^${r}$`,"i"]),Yr.core.type.str([t])]):n=Yr.core.str.match([Yr.core.type.regex([`^${t}$`,"i"]),Yr.core.type.str([r])])),!n)switch(t.head&&(r=F1(t,r)),r.head&&(t=F1(r,t)),e){case"=":n=Yr.core.rel.eq([t,r]);break;case"!=":n=Yr.core.rel.neq([t,r]);break;case">":n=Yr.core.rel.gr([t,r]);break;case"<":n=Yr.core.rel.lt([t,r]);break;case">=":n=Yr.core.rel.gre([t,r]);break;case"<=":n=Yr.core.rel.lte([t,r]);break;default:throw new Error(`value operator '${e}' not supported`)}return Yr.struct.generator.atomGroups({"atom-test":n})}}];function Yke(e){let[t,r,n,o,i,s,a]=e[1],l={};i&&(l["chain-test"]=Yr.core.rel.eq([Yr.ammp("auth_asym_id"),i]));let c=[];t&&c.push(Yr.core.rel.eq([Yr.ammp("label_comp_id"),t])),r&&c.push(Yr.core.logic.and([Yr.core.rel.gre([Yr.ammp("auth_seq_id"),r[0]]),Yr.core.rel.lte([Yr.ammp("auth_seq_id"),r[1]])])),n&&c.push(Yr.core.rel.eq([Yr.ammp("auth_seq_id"),n])),o&&c.push(Yr.core.rel.eq([Yr.ammp("pdbx_PDB_ins_code"),o])),c.length&&(l["residue-test"]=h_(c));let u=[];return s&&u.push(Yr.core.rel.eq([Yr.ammp("auth_atom_id"),s])),a&&u.push(Yr.core.rel.eq([Yr.ammp("label_alt_id"),a])),u.length&&(l["atom-test"]=h_(u)),Yr.struct.generator.atomGroups(l)}var Xke=qe.createLanguage({Integer:()=>qe.regexp(/-?[0-9]+/).map(Number).desc("integer"),Parens:function(e){return qe.alt(e.Parens,e.Operator,e.Expression).wrap(qe.regexp(/\(\s*/),qe.regexp(/\s*\)/))},Expression:function(e){return qe.alt(e.Keywords,e.AtomExpression.map(Yke),e.Within.map(t=>Yr.struct.modifier.includeSurroundings({0:t[1],radius:t[0]})),e.ValueQuery,e.Element.map(t=>Yr.struct.generator.atomGroups({"atom-test":Yr.core.rel.eq([Yr.acp("elementSymbol"),Yr.struct.type.elementSymbol(t)])})),e.Resname.map(t=>Yr.struct.generator.atomGroups({"residue-test":Yr.core.rel.eq([Yr.ammp("label_comp_id"),t])})))},Operator:function(e){return b0(eO,qe.alt(e.Parens,e.Expression))},AtomExpression:function(e){return qe.seq(qe.lookahead(e.AtomPrefix),qe.seq(e.BracketedResname.or(qe.of(null)),e.ResnoRange.or(qe.of(null)),e.Resno.or(qe.of(null)),e.Inscode.or(qe.of(null)),e.Chainname.or(qe.of(null)),e.Atomname.or(qe.of(null)),e.Altloc.or(qe.of(null)),e.Model.or(qe.of(null)))).desc("expression")},AtomPrefix:()=>qe.regexp(/[\[0-9:^%/.-]/).desc("atom-prefix"),Chainname:()=>qe.regexp(/:([A-Za-z]{1,3})/,1).desc("chainname"),Model:()=>qe.regexp(/\/([0-9]+)/,1).map(Number).desc("model"),Element:()=>qe.regexp(/_([A-Za-z]{1,3})/,1).desc("element"),Atomname:()=>qe.regexp(/\.([a-zA-Z0-9]{1,4})/,1).map(Yr.atomName).desc("atomname"),Resname:()=>qe.regexp(/[a-zA-Z0-9]{1,4}/).desc("resname"),Resno:e=>e.Integer.desc("resno"),Altloc:()=>qe.regexp(/%([a-zA-Z0-9])/,1).desc("altloc"),Inscode:()=>qe.regexp(/\^([a-zA-Z0-9])/,1).desc("inscode"),BracketedResname:()=>qe.regexp(/\[([a-zA-Z0-9]{1,4})\]/,1).desc("bracketed-resname"),ResnoRange:e=>qe.seq(e.Integer.skip(qe.seq(qe.optWhitespace,qe.string("-"),qe.optWhitespace)),e.Integer).desc("resno-range"),Within:e=>qe.regexp(/within/i).skip(qe.regexp(/\s*\(\s*/)).then(qe.seq(e.Integer.skip(qe.regexp(/\s*,\s*/)),e.Query)).skip(qe.regexp(/\)/)),Keywords:()=>qe.alt(...Cb(tO)).desc("keyword"),Query:function(e){return qe.alt(e.Operator,e.Parens,e.Expression).trim(qe.optWhitespace)},Number:function(){return qe.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){let e=_b(JF,tO,eO).sort(au).map(oh).join("|");return qe.alt(qe.regexp(new RegExp(`(?!(${e}))[A-Z0-9_]+`,"i")),qe.regexp(/'((?:[^"\\]|\\.)*)'/,1),qe.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(t=>Yr.core.type.regex([`^${t}$`,"i"]))).desc("string")},Value:function(e){return qe.alt(e.Number,e.String)},ValueParens:function(e){return qe.alt(e.ValueParens,e.ValueOperator,e.ValueExpressions).wrap(qe.string("("),qe.string(")"))},ValuePropertyNames:function(){return qe.alt(...g_(JF,/LIKE|>=|<=|=|!=|>|<|\)|\s/i))},ValueOperator:function(e){return b0(Wke,qe.alt(e.ValueParens,e.ValueExpressions))},ValueExpressions:function(e){return qe.alt(e.Value,e.ValuePropertyNames)},ValueQuery:function(e){return qe.alt(e.ValueOperator.map(t=>{if(t.head){if(t.head.name.startsWith("structure-query.generator"))return t}else if(typeof t=="string"&&t.length<=4)return Yr.struct.generator.atomGroups({"residue-test":Yr.core.rel.eq([Yr.ammp("label_comp_id"),t])});throw new Error(`values must be part of an comparison, value '${t}'`)}))}}),Vre=e=>Xke.Query.tryParse(e);var Ja=oe,iI=/[-+]?[0-9]*\.?[0-9]+/;function Kke(e){return e.split("+").map(Ja.atomName)}function wb(e){return e.split("+").map(t=>t.replace(/^["']|["']$/g,""))}function rO(e){if(e.includes("-")&&e.includes("+")){let t=e.split("+").map(n=>n.replace(/^["']|["']$/g,"")),r=[];return t.forEach(n=>{if(n.includes("-")&&!n.startsWith("-")){let[o,i]=n.split("-").map(s=>parseInt(s));for(let s=o;s<=i;s++)r.push(s)}else if(n.includes("-")&&n.startsWith("-")&&n.match(/[0-9]+-[-0-9]+/)){let o=-parseInt(n.split("-")[1]),i;n.includes("--")?i=-parseInt(n.split("-")[3]):i=parseInt(n.split("-")[2]);for(let s=o;s<=i;s++)r.push(s)}else n.includes("-")&&n.startsWith("-")&&n.match(/[0-9]+-[-0-9]+/),r.push(parseInt(n))}),r}else if(e.includes("-")&&!e.includes("+")){let t=[];if(e.startsWith("-"))if(e.startsWith("-")&&e.match(/[0-9]+-[-0-9]+/)){let r=-parseInt(e.split("-")[1]),n;e.includes("--")?n=-parseInt(e.split("-")[3]):n=parseInt(e.split("-")[2]);for(let o=r;o<=n;o++)t.push(o)}else e.startsWith("-")&&e.match(/[0-9]+-[-0-9]+/),t.push(parseInt(e));else{let[r,n]=e.split("-").map(o=>parseInt(o));for(let o=r;o<=n;o++)t.push(o)}return t}else return!e.includes("-")&&e.includes("+")?wb(e).map(t=>parseInt(t)):[parseInt(e)]}function Qke(e){return e.split("+").map(Ja.struct.type.elementSymbol)}var Zke={H:"helix",S:"beta",L:"none"};function $ke(e){return{flags:Ja.struct.type.secondaryStructureFlags(e.toUpperCase().split("+").map(t=>Zke[t]||"none"))}}var x_={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:Qke,level:"atom-test",property:Ja.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:Kke,level:"atom-test",property:Ja.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:Ja.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:rO,level:"residue-test",property:Ja.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:Ja.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:Ja.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:Ja.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:e=>parseInt(e),level:"atom-test"},numeric_type:{"@desc":"type-number a single integer","@examples":["nt. 5"],isUnsupported:!0,abbr:["nt."],regex:/[0-9]+/,map:e=>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:rO,level:"atom-test",property:Ja.ammp("id")},index:{"@desc":"internal-index-number a single integer","@examples":["index 11"],regex:/[0-9+-]+/,map:rO,level:"atom-test",property:Ja.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:$ke,level:"residue-test",property:Ja.ammp("secondaryStructureFlags")},b:{"@desc":"comparison-operator b-factor-value a real number","@examples":["b > 10"],isNumeric:!0,abbr:[],regex:iI,map:e=>parseFloat(e),level:"atom-test",property:Ja.ammp("B_iso_or_equiv")},q:{"@desc":"comparison-operator occupancy-value a real number","@examples":["q <0.50"],isNumeric:!0,abbr:[],regex:iI,map:e=>parseFloat(e),level:"atom-test",property:Ja.ammp("occupancy")},formal_charge:{"@desc":"comparison-operator formal charge-value an integer","@examples":["fc. = -1"],isNumeric:!0,abbr:["fc."],regex:iI,map:e=>parseFloat(e),level:"atom-test",property:Ja.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:iI,map:e=>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:e=>Ja.es(e),level:"atom-test",property:Ja.acp("elementSymbol")}};var Lr=oe,nO=[{"@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:Ta,rule:qe.alt(qe.regexp(/NOT/i).skip(qe.whitespace),qe.string("!").skip(qe.optWhitespace)),map:(e,t)=>$a(t)},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["chain A AND name CA"],name:"and",type:la,rule:jd(/AND|&/i),map:(e,t,r)=>Lr.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:la,rule:jd(/OR|\|/i),map:(e,t,r)=>Lr.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:la,rule:jd(/IN/i),map:(e,t,r)=>Lr.struct.filter.withSameAtomProperties({0:t,source:r,property:Lr.core.type.compositeKey([Lr.ammp("label_atom_id"),Lr.ammp("label_seq_id"),Lr.ammp("label_comp_id"),Lr.ammp("auth_asym_id"),Lr.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:la,rule:jd(/LIKE|l\./i),map:(e,t,r)=>Lr.struct.filter.withSameAtomProperties({0:t,source:r,property:Lr.core.type.compositeKey([Lr.ammp("label_atom_id"),Lr.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:p_,rule:f_(/GAP\s+([-+]?[0-9]*\.?[0-9]+)/i,1).map(e=>parseFloat(e)),map:(e,t)=>Lr.struct.filter.within({0:Lr.struct.generator.all(),target:t,"atom-radius":Lr.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:p_,rule:f_(/(AROUND|a\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(e=>parseFloat(e)),map:(e,t)=>Lr.struct.modifier.exceptBy({0:Lr.struct.filter.within({0:Lr.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:p_,rule:f_(/(EXPAND|x\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(e=>parseFloat(e)),map:(e,t)=>Lr.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:la,rule:nI("WITHIN","w."),map:(e,t,r)=>Lr.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:la,rule:nI("NEAR_TO","nto."),map:(e,t,r)=>Lr.struct.modifier.exceptBy({0:Lr.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:la,rule:nI("BEYOND","be."),map:(e,t,r)=>Lr.struct.modifier.exceptBy({0:Lr.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:Ta,rule:Ec(/BYRESIDUE|byresi|byres|br\./i),map:(e,t)=>Yu(Lr.struct.modifier.expandProperty({0:Lr.struct.modifier.union({0:t}),property:Lr.ammp("residueKey")}))},{"@desc":"Completely selects all alpha carbons in all residues covered by a selection.","@examples":["BYCALPHA chain A"],name:"bycalpha",abbr:["bca."],type:Ta,rule:Ec(/BYCALPHA|bca\./i),map:(e,t)=>Lr.struct.generator.queryInSelection({0:Lr.struct.modifier.expandProperty({0:Lr.struct.modifier.union({0:t}),property:Lr.ammp("residueKey")}),query:Lr.struct.generator.atomGroups({"atom-test":Lr.core.rel.eq([Lr.atomName("CA"),Lr.ammp("label_atom_id")])})})},{"@desc":"Expands selection to complete molecules.","@examples":["BYMOLECULE resi 20-30"],name:"bymolecule",isUnsupported:!0,abbr:["bymol","bm."],type:Ta,rule:Ec(/BYMOLECULE|bymol|bm\./i),map:(e,t)=>Yu(Lr.struct.modifier.expandProperty({0:Lr.struct.modifier.union({0:t}),property:Lr.atp("connectedComponentKey")}))},{"@desc":"Expands selection to complete fragments.","@examples":["BYFRAGMENT resi 10"],name:"byfragment",abbr:["byfrag","bf."],isUnsupported:!0,type:Ta,rule:Ec(/BYFRAGMENT|byfrag|bf\./i),map:(e,t)=>[e,t]},{"@desc":"Expands selection to complete segments.","@examples":["BYSEGMENT resn CYS"],name:"bysegment",abbr:["bysegi","byseg","bs."],type:Ta,rule:Ec(/BYSEGMENT|bysegi|byseg|bs\./i),map:(e,t)=>Yu(Lr.struct.modifier.expandProperty({0:Lr.struct.modifier.union({0:t}),property:Lr.ammp("chainKey")}))},{"@desc":"Expands selection to complete objects.","@examples":["BYOBJECT chain A"],name:"byobject",abbr:["byobj","bo."],isUnsupported:!0,type:Ta,rule:Ec(/BYOBJECT|byobj|bo\./i),map:(e,t)=>[e,t]},{"@desc":"Expands selection to unit cell.","@examples":["BYCELL chain A"],name:"bycell",isUnsupported:!0,type:Ta,rule:Ec(/BYCELL/i),map:(e,t)=>[e,t]},{"@desc":"All rings of size \u2264 7 which have at least one atom in s1.","@examples":["BYRING resn HEM"],name:"byring",type:Ta,rule:Ec(/BYRING/i),map:(e,t)=>Yu(Lr.struct.modifier.intersectBy({0:Lr.struct.filter.pick({0:Lr.struct.generator.rings(),test:Lr.core.logic.and([Lr.core.rel.lte([Lr.struct.atomSet.atomCount(),7]),Lr.core.rel.gr([Lr.struct.atomSet.countQuery([t]),1])])}),by:t}))},{"@desc":"Selects atoms directly bonded to s1, excludes s1.","@examples":["NEIGHBOR resn CYS"],name:"neighbor",type:Ta,abbr:["nbr."],rule:Ec(/NEIGHBOR|nbr\./i),map:(e,t)=>Lr.struct.modifier.exceptBy({0:Yu(Lr.struct.modifier.includeConnected({0:Lr.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:Ta,rule:Ec(/BOUND_TO|bto\./i),map:(e,t)=>Yu(Lr.struct.modifier.includeConnected({0:Lr.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:p_,rule:f_(/(EXTEND|xt\.)\s+([0-9]+)/i,2).map(e=>parseInt(e)),map:(e,t)=>Yu(Lr.struct.modifier.includeConnected({0:Lr.struct.modifier.union({0:t}),"bond-test":!0,"layer-count":e}))}];var Ot=oe,Wl={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"]},Gre={nucleic:["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],protein:["C","N","CA","O"]};function Hre(){return Ot.struct.combinator.merge([Ot.struct.modifier.intersectBy({0:Ot.struct.generator.atomGroups({"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.protein),Ot.ammp("label_comp_id")])}),by:Ot.struct.generator.atomGroups({"atom-test":Ot.core.set.has([Ot.core.type.set(Gre.protein),Ot.ammp("label_atom_id")])})}),Ot.struct.modifier.intersectBy({0:Ot.struct.generator.atomGroups({"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.nucleic),Ot.ammp("label_comp_id")])}),by:Ot.struct.generator.atomGroups({"atom-test":Ot.core.set.has([Ot.core.type.set(Gre.nucleic),Ot.ammp("label_atom_id")])})})])}var oO={all:{"@desc":"All atoms currently loaded into PyMOL",abbr:["*"],map:()=>Ot.struct.generator.all()},none:{"@desc":"No atoms (empty selection)",map:()=>Ot.struct.generator.empty()},hydrogens:{"@desc":"All hydrogen atoms currently loaded into PyMOL",abbr:["hydro","h."],map:()=>Ot.struct.generator.atomGroups({"atom-test":Ot.core.rel.eq([Ot.acp("elementSymbol"),Ot.es("H")])})},hetatm:{"@desc":"All atoms loaded from Protein Data Bank HETATM records",abbr:["het"],map:()=>Ot.struct.generator.atomGroups({"atom-test":Ot.core.rel.eq([Ot.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:()=>Ot.struct.generator.atomGroups({"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.nucleic.concat(Wl.protein)),Ot.ammp("label_comp_id")])})},sidechain:{"@desc":"Polymer non-backbone atoms (new in PyMOL 1.6.1)",abbr:["sc."],map:()=>Ot.struct.modifier.exceptBy({0:Ot.struct.generator.atomGroups({"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.nucleic.concat(Wl.protein)),Ot.ammp("label_comp_id")])}),by:Hre()})},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:()=>Ot.struct.generator.atomGroups({"atom-test":Ot.core.rel.gr([Ot.struct.atomProperty.core.bondCount({flags:Ot.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:()=>Yu(Ot.struct.modifier.expandProperty({0:Ot.struct.modifier.union([Ot.struct.generator.queryInSelection({0:Ot.struct.generator.atomGroups({"residue-test":Ot.core.logic.not([Ot.core.set.has([Ot.core.type.set(Wl.nucleic.concat(Wl.protein)),Ot.ammp("label_comp_id")])])}),query:Ot.struct.generator.atomGroups({"atom-test":Ot.core.rel.eq([Ot.es("C"),Ot.acp("elementSymbol")])})})]),property:Ot.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:()=>Yu(Ot.struct.modifier.expandProperty({0:Ot.struct.modifier.union([Ot.struct.filter.pick({0:Ot.struct.generator.atomGroups({"residue-test":Ot.core.logic.not([Ot.core.set.has([Ot.core.type.set(Wl.nucleic.concat(Wl.protein).concat(Wl.solvent)),Ot.ammp("label_comp_id")])]),"group-by":Ot.ammp("residueKey")}),test:Ot.core.logic.not([Ot.core.set.has([Ot.struct.atomSet.propertySet([Ot.acp("elementSymbol")]),Ot.es("C")])])})]),property:Ot.ammp("residueKey")}))},solvent:{"@desc":"All water molecules. The hardcoded solvent residue identifiers are currently: HOH, WAT, H20, TIP, SOL.",abbr:["sol."],map:()=>Ot.struct.generator.atomGroups({"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.solvent),Ot.ammp("label_comp_id")])})},guide:{"@desc":"All protein CA and nucleic acid C4*/C4",map:()=>Ot.struct.combinator.merge([Ot.struct.generator.atomGroups({"atom-test":Ot.core.rel.eq([Ot.atomName("CA"),Ot.ammp("label_atom_id")]),"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.protein),Ot.ammp("label_comp_id")])}),Ot.struct.generator.atomGroups({"atom-test":Ot.core.set.has([Wu(["C4*","C4'"]),Ot.ammp("label_atom_id")]),"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.nucleic),Ot.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:()=>Hre()},"polymer.protein":{"@desc":"Protein (New in PyMOL 2.1)",abbr:["polymer.protein"],map:()=>Ot.struct.generator.atomGroups({"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.protein),Ot.ammp("label_comp_id")])})},"polymer.nucleic":{"@desc":"Nucleic Acid (New in PyMOL 2.1)",abbr:["polymer.nucleic"],map:()=>Ot.struct.generator.atomGroups({"residue-test":Ot.core.set.has([Ot.core.type.set(Wl.nucleic),Ot.ammp("label_comp_id")])})}};var Jke=oe,fs=Lre(x_),Ts=qe.string("/");function $o(e){return e.or(qe.of(null))}function eMe(e){let t={},r={};for(let n in e){let o=x_[n];if(!o)throw new Error(`property '${n}' not supported, value '${e[n]}'`);e[n]!==null&&(r[o.level]||(r[o.level]=[]),r[o.level].push(e[n]))}for(let n in r)t[n]=h_(r[n]);return Jke.struct.generator.atomGroups(t)}var tMe=qe.createLanguage({Parens:function(e){return qe.alt(e.Parens,e.Operator,e.Expression).wrap(qe.string("("),qe.string(")"))},Expression:function(e){return qe.alt(e.Keywords,e.AtomSelectionMacro.map(eMe),e.NamedAtomProperties,e.Pepseq,e.Rep,e.Object)},AtomSelectionMacro:function(e){return qe.alt(Ts.then(qe.alt(qe.seq($o(e.ObjectProperty).skip(Ts),$o(fs.segi).skip(Ts),$o(fs.chain).skip(Ts),$o(fs.resi).skip(Ts),$o(fs.name)).map(t=>({object:t[0],segi:t[1],chain:t[2],resi:t[3],name:t[4]})),qe.seq($o(e.ObjectProperty).skip(Ts),$o(fs.segi).skip(Ts),$o(fs.chain).skip(Ts),$o(fs.resi)).map(t=>({object:t[0],segi:t[1],chain:t[2],resi:t[3]})),qe.seq($o(e.ObjectProperty).skip(Ts),$o(fs.segi).skip(Ts),$o(fs.chain)).map(t=>({object:t[0],segi:t[1],chain:t[2]})),qe.seq($o(e.ObjectProperty).skip(Ts),$o(fs.segi)).map(t=>({object:t[0],segi:t[1]})),qe.seq($o(e.ObjectProperty)).map(t=>({object:t[0]})))),qe.alt(qe.seq($o(e.ObjectProperty).skip(Ts),$o(fs.segi).skip(Ts),$o(fs.chain).skip(Ts),$o(fs.resi).skip(Ts),$o(fs.name)).map(t=>({object:t[0],segi:t[1],chain:t[2],resi:t[3],name:t[4]})),qe.seq($o(fs.segi).skip(Ts),$o(fs.chain).skip(Ts),$o(fs.resi).skip(Ts),$o(fs.name)).map(t=>({segi:t[0],chain:t[1],resi:t[2],name:t[3]})),qe.seq($o(fs.chain).skip(Ts),$o(fs.resi).skip(Ts),$o(fs.name)).map(t=>({chain:t[0],resi:t[1],name:t[2]})),qe.seq($o(fs.resi).skip(Ts),$o(fs.name)).map(t=>({resi:t[0],name:t[1]}))))},NamedAtomProperties:function(){return qe.alt(...oI(x_))},Keywords:()=>qe.alt(...Cb(oO)),ObjectProperty:()=>{let e=_b(x_,oO,nO).sort(au).map(oh).join("|");return qe.regexp(new RegExp(`(?!(${e}))[A-Z0-9_]+`,"i"))},Object:e=>e.ObjectProperty.notFollowedBy(Ts).map(t=>{throw new Error(`property 'object' not supported, value '${t}'`)}),Pepseq:()=>qe.regexp(/(PEPSEQ|ps\.)\s+([a-z]+)/i,2).map(Ph("operator 'pepseq' not supported")),Rep:()=>qe.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(Ph("operator 'rep' not supported")),Operator:function(e){return b0(nO,qe.alt(e.Parens,e.Expression,e.Operator))},Query:function(e){return qe.alt(e.Operator,e.Parens,e.Expression).trim(qe.optWhitespace)}}),jre=e=>tMe.Query.tryParse(e);var Ji=oe,lu=/[-+]?[0-9]*\.?[0-9]+/,sI=/[+]?[0-9]+/,b_=/[-+]?[0-9]+/;function O1(e){return e}var iO={T:"turn",E:"sheet",B:"strand",H:"alpha",G:"3-10",I:"pi",C:"none"};function aI(e){return Ji.struct.type.secondaryStructureFlags([iO[e.toUpperCase()]||"none"])}var Eh={name:{"@desc":"str atom name","@examples":["name CA"],regex:/[a-zA-Z0-9]+/,map:Ji.atomName,level:"atom-test",property:Ji.ammp("label_atom_id")},type:{"@desc":"str atom type","@examples":["type C3"],isUnsupported:!0,regex:/[a-zA-Z0-9]+/,map:O1,level:"atom-test"},index:{"@desc":"num the atom number, starting at 0","@examples":["index 10"],isNumeric:!0,regex:sI,map:e=>parseInt(e)-1,level:"atom-test",property:Ji.ammp("id")},serial:{"@desc":"num the atom number, starting at 1","@examples":["serial 11"],isNumeric:!0,regex:sI,map:e=>parseInt(e),level:"atom-test",property:Ji.ammp("id")},atomicnumber:{"@desc":"num atomic number (0 if undefined)","@examples":["atomicnumber 13"],isNumeric:!0,regex:sI,map:e=>parseInt(e),level:"atom-test",property:Ji.acp("atomicNumber")},element:{"@desc":'str atomic element symbol string ("X" if undefined)',"@examples":["element N"],regex:/[a-zA-Z0-9]{1,3}/,map:e=>Ji.es(e),level:"atom-test",property:Ji.acp("elementSymbol")},altloc:{"@desc":"str alternate location/conformation identifier","@examples":["altloc C"],regex:/[a-zA-Z0-9]+/,map:O1,level:"atom-test",property:Ji.ammp("label_alt_id")},chain:{"@desc":"str the one-character chain identifier","@examples":["chain A"],regex:/[a-zA-Z0-9]+/,map:O1,level:"residue-test",property:Ji.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:b_,map:e=>parseInt(e),level:"residue-test",property:Ji.ammp("auth_seq_id")},fragment:{"@desc":"num a set of connected residues","@examples":["fragment 42"],isUnsupported:!0,isNumeric:!0,regex:b_,map:e=>parseInt(e),level:"residue-test"},pfrag:{"@desc":"num a set of connected protein residues","@examples":["pfrag 42"],isUnsupported:!0,isNumeric:!0,regex:b_,map:e=>parseInt(e),level:"residue-test"},nfrag:{"@desc":"num a set of connected nucleic residues","@examples":["nfrag 42"],isUnsupported:!0,isNumeric:!0,regex:b_,map:e=>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:O1,level:"residue-test"},numbonds:{"@desc":"num number of bonds","@examples":["numbonds = 2","numbonds >= 3"],isNumeric:!0,regex:sI,map:e=>parseInt(e),level:"atom-test",property:Ji.acp("bondCount")},resname:{"@desc":"str residue name","@examples":["resname ALA"],regex:/[a-zA-Z0-9]+/,map:O1,level:"residue-test",property:Ji.ammp("auth_comp_id")},resid:{"@desc":"num residue id","@examples":["resid 42"],isNumeric:!0,regex:b_,map:e=>parseInt(e),level:"residue-test",property:Ji.ammp("auth_seq_id")},segname:{"@desc":"str segment name","@examples":["segname B"],regex:/[a-zA-Z0-9]+/,map:O1,level:"residue-test",property:Ji.ammp("label_asym_id")},x:{"@desc":"float x coordinate","@examples":["x 42"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.acp("x")},y:{"@desc":"float y coordinate","@examples":["y > 1.7"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.acp("y")},z:{"@desc":"float z coordinate","@examples":["z < 11","z > -21"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.acp("z")},radius:{"@desc":"float atomic radius","@examples":["radius > 1.3"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.acp("vdw")},mass:{"@desc":"float atomic mass","@examples":["mass > 2"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.acp("mass")},charge:{"@desc":"float atomic charge","@examples":["charge > 0","charge 1"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.ammp("pdbx_formal_charge")},beta:{"@desc":"float temperature factor","@examples":["beta < 20","beta > 35"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.ammp("B_iso_or_equiv")},occupancy:{"@desc":"float occupancy","@examples":["occupancy 1","occupancy < 1"],isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test",property:Ji.ammp("occupancy")},user:{"@desc":"float time-varying user-specified value","@examples":["user < 0.1"],isUnsupported:!0,isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"atom-test"},rasmol:{"@desc":"str translates Rasmol selection string to VMD","@examples":["rasmol 'all'"],isUnsupported:!0,regex:/[^']*/,map:O1,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:aI,level:"atom-test",property:Ji.ammp("secondaryStructureFlags")},phi:{"@desc":"float phi backbone conformational angles","@examples":["phi < 160"],isUnsupported:!0,isNumeric:!0,regex:lu,map:e=>parseFloat(e),level:"residue-test"},psi:{"@desc":"float psi backbone conformational angles","@examples":["psi < 160"],isUnsupported:!0,isNumeric:!0,regex:lu,map:e=>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:e=>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:e=>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:e=>parseInt(e),level:"atom-test"}};var N1=oe,rMe=Object.keys(Eh).sort(au).filter(e=>!Eh[e].isUnsupported).join("|"),sO=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not protein"],name:"not",type:Ta,rule:qe.regexp(/NOT/i).skip(qe.whitespace),map:(e,t)=>$a(t)},{"@desc":"Selects atoms within a specified distance of a selection","@examples":["within 5 of name FE"],name:"within",type:Ta,rule:Ec(/WITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(e=>parseFloat(e)),map:(e,t)=>N1.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:Ta,rule:Ec(/EXWITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(e=>parseFloat(e)),map:(e,t)=>N1.struct.modifier.exceptBy({0:N1.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:Ta,rule:Ec(new RegExp(`SAME\\s+(${rMe})\\s+AS`,"i"),1).map(e=>Eh[e].property),map:(e,t)=>N1.struct.filter.withSameAtomProperties({0:N1.struct.generator.all(),source:t,property:e})},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["backbone and protein"],name:"and",type:la,rule:qe.alt(jd(/AND/i),qe.whitespace),map:(e,t,r)=>N1.struct.modifier.intersectBy({0:t,by:r})},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["water or protein"],name:"or",type:la,rule:jd(/OR/i),map:(e,t,r)=>N1.struct.combinator.merge([t,r])}];var Qr=oe;function Dh(){return Qr.struct.filter.pick({0:Qr.struct.generator.atomGroups({"group-by":Qr.ammp("residueKey")}),test:Qr.core.set.isSubset([Wu(["C","N","CA","O"]),Qr.ammpSet("label_atom_id")])})}function aO(){return Qr.struct.filter.pick({0:Qr.struct.generator.atomGroups({"group-by":Qr.ammp("residueKey")}),test:Qr.core.logic.and([Qr.core.set.isSubset([Wu(["P"]),Qr.ammpSet("label_atom_id")]),Qr.core.logic.or([Qr.core.set.isSubset([Wu(["O3'","C3'","C4'","C5'","O5'"]),Qr.ammpSet("label_atom_id")]),Qr.core.set.isSubset([Wu(["O3*","C3*","C4*","C5*","O5*"]),Qr.ammpSet("label_atom_id")])])])})}function qre(){return Qr.struct.combinator.merge([Qr.struct.generator.queryInSelection({0:Dh(),query:Qr.struct.generator.atomGroups({"atom-test":Qr.core.set.has([Wu(Wre.protein),Qr.ammp("label_atom_id")])})}),Qr.struct.generator.queryInSelection({0:aO(),query:Qr.struct.generator.atomGroups({"atom-test":Qr.core.set.has([Wu(Wre.nucleic),Qr.ammp("label_atom_id")])})})])}function af(e){return Qr.struct.generator.atomGroups({"residue-test":Qr.core.flags.hasAll([Qr.ammp("secondaryStructureFlags"),Qr.struct.type.secondaryStructureFlags(e)])})}var Wre={nucleic:["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*"],protein:["C","N","CA","O"]},Ps={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"]},lO={all:{"@desc":"everything",map:()=>Qr.struct.generator.all()},none:{"@desc":"nothing",map:()=>Qr.struct.generator.empty()},protein:{"@desc":"a residue with atoms named C, N, CA, and O",map:()=>Dh()},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:()=>aO()},backbone:{"@desc":"the C, N, CA, and O atoms of a protein and the equivalent atoms in a nucleic acid.",map:()=>qre()},sidechain:{"@desc":"non-backbone atoms and bonds",map:()=>$a(qre())},water:{"@desc":"all atoms with the resname H2O, HH0, OHH, HOH, OH2, SOL, WAT, TIP, TIP2, TIP3 or TIP4",abbr:["waters"],map:()=>Sn(Ps.water)},at:{"@desc":"residues named ADA A THY T",map:()=>Sn(Ps.at)},acidic:{"@desc":"residues named ASP GLU",map:()=>Sn(Ps.acidic)},acyclic:{"@desc":'"protein and not cyclic"',map:()=>Qr.struct.modifier.intersectBy({0:Dh(),by:$a(Sn(Ps.cyclic))})},aliphatic:{"@desc":"residues named ALA GLY ILE LEU VAL",map:()=>Sn(Ps.aliphatic)},alpha:{"@desc":"atom's residue is an alpha helix",map:()=>af(["alpha"])},amino:{"@desc":"a residue with atoms named C, N, CA, and O",map:()=>Dh()},aromatic:{"@desc":"residues named HIS PHE TRP TYR",map:()=>Sn(Ps.aromatic)},basic:{"@desc":"residues named ARG HIS LYS",map:()=>Sn(Ps.basic)},bonded:{"@desc":"atoms for which numbonds > 0",map:()=>Yu(Qr.struct.filter.pick({0:Qr.struct.modifier.includeConnected({0:Qr.struct.generator.all(),"bond-test":Qr.core.flags.hasAny([Qr.struct.bondProperty.flags(),Qr.struct.type.bondFlags(["covalent","metallic","sulfide"])])}),test:Qr.core.rel.gr([Qr.struct.atomSet.atomCount(),1])}))},buried:{"@desc":"residues named ALA LEU VAL ILE PHE CYS MET TRP",map:()=>Sn(Ps.buried)},cg:{"@desc":"residues named CYT C GUA G",map:()=>Sn(Ps.cg)},charged:{"@desc":'"basic or acidic"',map:()=>Sn(Ps.basic.concat(Ps.acidic))},cyclic:{"@desc":"residues named HIS PHE PRO TRP TYR",map:()=>Sn(Ps.cyclic)},hetero:{"@desc":'"not (protein or nucleic)"',map:()=>$a(Qr.struct.combinator.merge([Dh(),aO()]))},hydrogen:{"@desc":'name "[0-9]?H.*"',map:()=>Qr.struct.generator.atomGroups({"atom-test":Qr.core.str.match([Qr.core.type.regex(["^[0-9]?[H].*$","i"]),Qr.core.type.str([Qr.ammp("label_atom_id")])])})},large:{"@desc":'"protein and not (small or medium)"',map:()=>Qr.struct.modifier.intersectBy({0:Dh(),by:$a(Sn(Ps.small.concat(Ps.medium)))})},medium:{"@desc":"residues named VAL THR ASP ASN PRO CYS ASX PCA HYP",map:()=>Sn(Ps.medium)},neutral:{"@desc":"residues named VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP",map:()=>Sn(Ps.neutral)},hydrophobic:{"@desc":"hydrophobic resname ALA LEU VAL ILE PRO PHE MET TRP",map:()=>Sn(Ps.hydrophobic)},polar:{"@desc":'"protein and not hydrophobic"',map:()=>Qr.struct.modifier.intersectBy({0:Dh(),by:$a(Sn(Ps.hydrophobic))})},purine:{"@desc":"residues named ADE A GUA G",map:()=>Sn(Ps.purine)},pyrimidine:{"@desc":"residues named CYT C THY T URI U",map:()=>Sn(Ps.pyrimidine)},small:{"@desc":"residues named ALA GLY SER",map:()=>Sn(Ps.small)},surface:{"@desc":'"protein and not buried"',map:()=>Qr.struct.modifier.intersectBy({0:Dh(),by:$a(Sn(Ps.buried))})},alpha_helix:{"@desc":"atom's residue is in an alpha helix",map:()=>af(["alpha"])},pi_helix:{"@desc":"atom's residue is in a pi helix",map:()=>af(["pi"])},helix_3_10:{"@desc":"atom's residue is in a 3-10 helix",map:()=>af(["3-10"])},helix:{"@desc":"atom's residue is in an alpha or pi or 3-10 helix",map:()=>af(["helix"])},extended_beta:{"@desc":"atom's residue is a beta sheet",map:()=>af(["sheet"])},bridge_beta:{"@desc":"atom's residue is a beta sheet",map:()=>af(["strand"])},sheet:{"@desc":"atom's residue is a beta sheet",map:()=>af(["beta"])},turn:{"@desc":"atom's residue is in a turn conformation",map:()=>af(["turn"])},coil:{"@desc":"atom's residue is in a coil conformation",map:()=>Qr.struct.modifier.intersectBy({0:Dh(),by:af(["none"])})}};var Pl=oe,Yre={sqr:{"@desc":"square of x","@examples":["sqr(2)"],map:e=>Pl.core.math.pow([e,2])},sqrt:{"@desc":"square root of x","@examples":["sqrt(2)"],map:e=>Pl.core.math.sqrt([e])},abs:{"@desc":"absolute value of x","@examples":["abs(2)"],map:e=>Pl.core.math.abs([e])},floor:{"@desc":"largest integer not greater than x","@examples":["floor(2)"],map:e=>Pl.core.math.floor([e])},ceil:{"@desc":"smallest integer not less than x","@examples":["ceil(2)"],map:e=>Pl.core.math.ceil([e])},sin:{"@desc":"sine of x","@examples":["sin(2)"],map:e=>Pl.core.math.sin([e])},cos:{"@desc":"cosine of x","@examples":["cos(2)"],map:e=>Pl.core.math.cos([e])},tan:{"@desc":"tangent of x","@examples":["tan(2)"],map:e=>Pl.core.math.tan([e])},atan:{"@desc":"arctangent of x","@examples":["atan(2)"],map:e=>Pl.core.math.atan([e])},asin:{"@desc":"arcsin of x","@examples":["asin(2)"],map:e=>Pl.core.math.asin([e])},acos:{"@desc":"arccos of x","@examples":["acos(2)"],map:e=>Pl.core.math.acos([e])},sinh:{"@desc":"hyperbolic sine of x","@examples":["sinh(2)"],map:e=>Pl.core.math.sinh([e])},cosh:{"@desc":"hyperbolic cosine of x","@examples":["cosh(2)"],map:e=>Pl.core.math.cosh([e])},tanh:{"@desc":"hyperbolic tangent of x","@examples":["tanh(2)"],map:e=>Pl.core.math.tanh([e])},exp:{"@desc":"e to the power x","@examples":["exp(2)"],map:e=>Pl.core.math.exp([e])},log:{"@desc":"natural log of x","@examples":["log(2)"],map:e=>Pl.core.math.log([e])},log10:{"@desc":"log base 10 of x","@examples":["log10(2)"],map:e=>Pl.core.math.log10([e])}};var pi=oe,nMe=[{"@desc":"multiplication, division","@examples":[],name:"mul-div",type:la,rule:qe.regexp(/\s*(\*|\/)\s*/,1),map:(e,t,r)=>{switch(e){case"*":return pi.core.math.mult([t,r]);case"/":return pi.core.math.div([t,r]);default:throw new Error(`value operator '${e}' not supported`)}}},{"@desc":"addition, substraction","@examples":[],name:"add-sub",type:la,rule:qe.regexp(/\s*(-|\+)\s*/,1),map:(e,t,r)=>{switch(e){case"-":return pi.core.math.sub([t,r]);case"+":return pi.core.math.add([t,r]);default:throw new Error(`value operator '${e}' not supported`)}}},{"@desc":"value comparisons","@examples":[],name:"comparison",type:la,rule:qe.alt(qe.regexp(/\s*(=~|==|>=|<=|=|!=|>|<)\s*/,1),qe.whitespace.result("=")),map:(e,t,r)=>{let n;if(t.head!==void 0?(t.head.name==="structure-query.atom-property.macromolecular.secondary-structure-flags"&&(n=pi.core.flags.hasAny([t,aI(r)])),t.head.name==="core.type.regex"&&(n=pi.core.str.match([t,pi.core.type.str([r])]))):r.head!==void 0?(r.head.name==="structure-query.atom-property.macromolecular.secondary-structure-flags"&&(n=pi.core.flags.hasAny([r,aI(t)])),r.head.name==="core.type.regex"&&(n=pi.core.str.match([r,pi.core.type.str([t])]))):e==="=~"&&(t.head?n=pi.core.str.match([pi.core.type.regex([`^${r}$`,"i"]),pi.core.type.str([t])]):n=pi.core.str.match([pi.core.type.regex([`^${t}$`,"i"]),pi.core.type.str([r])])),!n)switch(t.head&&(r=F1(t,r)),r.head&&(t=F1(r,t)),e){case"=":case"==":n=pi.core.rel.eq([t,r]);break;case"!=":n=pi.core.rel.neq([t,r]);break;case">":n=pi.core.rel.gr([t,r]);break;case"<":n=pi.core.rel.lt([t,r]);break;case">=":n=pi.core.rel.gre([t,r]);break;case"<=":n=pi.core.rel.lte([t,r]);break;default:throw new Error(`value operator '${e}' not supported`)}return pi.struct.generator.atomGroups({"atom-test":n})}}],oMe=qe.createLanguage({Parens:function(e){return qe.alt(e.Parens,e.Operator,e.Expression).wrap(qe.string("("),qe.string(")"))},Expression:function(e){return qe.alt(e.RangeListProperty,e.ValueQuery,e.Keywords)},NamedAtomProperties:function(){return qe.alt(...oI(Eh))},Keywords:()=>qe.alt(...Cb(lO)),ValueRange:function(e){return qe.seq(e.Value.skip(qe.regexp(/\s+TO\s+/i)),e.Value).map(t=>({range:t}))},RangeListProperty:function(e){return qe.seq(qe.alt(...g_(Eh,/\s/)).skip(qe.whitespace),qe.alt(e.ValueRange,e.Value).sepBy1(qe.whitespace)).map(t=>{let[r,n]=t,o=[],i=[];n.forEach(c=>{c.range?i.push(pi.core.rel.inRange([r,c.range[0],c.range[1]])):o.push(F1(r,c,iO))});let s=Rre(i),a=Nre(r,o),l;return s&&a?l=pi.core.logic.or([s,a]):l=s||a,pi.struct.generator.atomGroups({[Ore(r)]:l})})},Operator:function(e){return b0(sO,qe.alt(e.Parens,e.Expression,e.ValueQuery))},Query:function(e){return qe.alt(e.Operator,e.Parens,e.Expression).trim(qe.optWhitespace)},Number:function(){return qe.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){let e=_b(Eh,lO,sO).sort(au).map(oh).join("|");return qe.alt(qe.regexp(new RegExp(`(?!(${e}))[A-Z0-9_]+`,"i")),qe.regexp(/'((?:[^"\\]|\\.)*)'/,1),qe.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(t=>pi.core.type.regex([`^${t}$`,"i"]))).desc("string")},Value:function(e){return qe.alt(e.Number,e.String)},ValueParens:function(e){return qe.alt(e.ValueParens,e.ValueOperator,e.ValueExpressions).wrap(qe.string("("),qe.string(")"))},ValuePropertyNames:function(){return qe.alt(...g_(Eh,/=~|==|>=|<=|=|!=|>|<|\)|\s|\+|-|\*|\//i))},ValueOperator:function(e){return b0(nMe,qe.alt(e.ValueParens,e.ValueExpressions))},ValueExpressions:function(e){return qe.alt(e.ValueFunctions,e.Value,e.ValuePropertyNames)},ValueFunctions:function(e){return qe.alt(...Fre(Yre,e.ValueOperator))},ValueQuery:function(e){return qe.alt(e.ValueOperator.map(t=>{if(!t.head.name||!t.head.name.startsWith("structure-query.generator"))throw new Error(`values must be part of an comparison, value '${t}'`);return t}))}}),Xre=e=>oMe.Query.tryParse(e);var Kre={pymol:jre,vmd:Xre,jmol:Vre};var iMe=Kre;function Qre(e,t){try{return iMe[e](t)}catch(r){throw console.error(r.message),r}}var cO=class{constructor(){this.map=new Map}removeSymbol(t){this.map.delete(t.symbol.id)}addSymbol(t){this.map.has(t.symbol.id)&&console.warn(`Symbol '${t.symbol.id}' already added. Call removeSymbol/removeCustomProps re-adding the symbol.`),this.map.set(t.symbol.id,t)}addCustomProp(t){if(t.symbols)for(let r of Object.keys(t.symbols))this.addSymbol(t.symbols[r])}removeCustomProp(t){if(t.symbols)for(let r of Object.keys(t.symbols))this.removeSymbol(t.symbols[r])}getRuntime(t){return this.map.get(t)}},Tb=new cO,uO=class{constructor(t){this.table=t,this.constQueryContext=new Mi(Me.Empty)}},Zre;(function(e){function t(n){return{kind:"const",value:n}}e.Const=t;function r(n){return{kind:"dynamic",runtime:n}}e.Dynamic=r})(Zre||(Zre={}));var U1;(function(e){function t(n){return{isConst:!0,fn:function(i){return n}}}e.Const=t;function r(n){return{isConst:!1,fn:n}}e.Dynamic=r})(U1||(U1={}));var Ab;(function(e){function t(r,n,o,i){if(typeof r.length=="number")for(let s=0,a=r.length;si[o]=n,[])}),br(Ce.core.type.set,function(t,r){return Ab.forEachEval(r,t,function(o,i,s){return s.add(o)},new Set)}),br(Ce.core.type.regex,function(t,r){return new RegExp(r[0](t),r[1]&&r[1](t)||"")}),br(Ce.core.type.bitflags,function(t,r){return+r[0](t)}),br(Ce.core.type.compositeKey,function(t,r){return Ab.forEachEval(r,t,(n,o,i)=>i[o]=""+n,[]).join("-")}),br(Ce.core.logic.not,(e,t)=>!t[0](e)),br(Ce.core.logic.and,(e,t)=>{if(typeof t.length=="number"){for(let r=0,n=t.length;r{if(typeof t.length=="number"){for(let r=0,n=t.length;rt[0](e)===t[1](e)),br(Ce.core.rel.neq,(e,t)=>t[0](e)!==t[1](e)),br(Ce.core.rel.lt,(e,t)=>t[0](e)t[0](e)<=t[1](e)),br(Ce.core.rel.gr,(e,t)=>t[0](e)>t[1](e)),br(Ce.core.rel.gre,(e,t)=>t[0](e)>=t[1](e)),br(Ce.core.rel.inRange,(e,t)=>{let r=t[0](e);return r>=t[1](e)&&r<=t[2](e)}),br(Ce.core.math.add,(e,t)=>{let r=0;if(typeof t.length=="number")for(let n=0,o=t.length;n{let r=0;if(typeof t.length=="number"){if(t.length===1)return-t[0](e);r=t[0](e)||0;for(let n=1,o=t.length;n{let r=1;if(typeof t.length=="number")for(let n=0,o=t.length;nt[0](e)/t[1](e)),br(Ce.core.math.pow,(e,t)=>Math.pow(t[0](e),t[1](e))),br(Ce.core.math.mod,(e,t)=>t[0](e)%t[1](e)),br(Ce.core.math.min,(e,t)=>{let r=Number.POSITIVE_INFINITY;if(typeof t.length=="number")for(let n=0,o=t.length;n{let r=Number.NEGATIVE_INFINITY;if(typeof t.length=="number")for(let n=0,o=t.length;nea(t[0](e),t[1](e))),br(Ce.core.math.sortedCantorPairing,(e,t)=>Tg(t[0](e),t[1](e))),br(Ce.core.math.invertCantorPairing,(e,t)=>TA([0,0],t[0](e))),br(Ce.core.math.floor,(e,t)=>Math.floor(t[0](e))),br(Ce.core.math.ceil,(e,t)=>Math.ceil(t[0](e))),br(Ce.core.math.roundInt,(e,t)=>Math.round(t[0](e))),br(Ce.core.math.trunc,(e,t)=>Math.trunc(t[0](e))),br(Ce.core.math.abs,(e,t)=>Math.abs(t[0](e))),br(Ce.core.math.sign,(e,t)=>Math.sign(t[0](e))),br(Ce.core.math.sqrt,(e,t)=>Math.sqrt(t[0](e))),br(Ce.core.math.cbrt,(e,t)=>Math.cbrt(t[0](e))),br(Ce.core.math.sin,(e,t)=>Math.sin(t[0](e))),br(Ce.core.math.cos,(e,t)=>Math.cos(t[0](e))),br(Ce.core.math.tan,(e,t)=>Math.tan(t[0](e))),br(Ce.core.math.asin,(e,t)=>Math.asin(t[0](e))),br(Ce.core.math.acos,(e,t)=>Math.acos(t[0](e))),br(Ce.core.math.atan,(e,t)=>Math.atan(t[0](e))),br(Ce.core.math.sinh,(e,t)=>Math.sinh(t[0](e))),br(Ce.core.math.cosh,(e,t)=>Math.cosh(t[0](e))),br(Ce.core.math.tanh,(e,t)=>Math.tanh(t[0](e))),br(Ce.core.math.exp,(e,t)=>Math.exp(t[0](e))),br(Ce.core.math.log,(e,t)=>Math.log(t[0](e))),br(Ce.core.math.log10,(e,t)=>Math.log10(t[0](e))),br(Ce.core.math.atan2,(e,t)=>Math.atan2(t[0](e),t[1](e))),br(Ce.core.str.match,(e,t)=>t[0](e).test(t[1](e))),br(Ce.core.str.concat,(e,t)=>{let r=[];if(typeof t.length=="number")for(let n=0,o=t.length;nt[0](e)[t[1](e)]),br(Ce.core.list.equal,(e,t)=>lx(t[0](e),t[1](e))),br(Ce.core.set.has,function(t,r){return r[0](t).has(r[1](t))}),br(Ce.core.set.isSubset,function(t,r){return Dn.isSuperset(r[1](t),r[0](t))}),br(Ce.core.flags.hasAny,(e,t)=>{let r=t[1](e),n=t[0](e);return r?(n&r)!==0:!!n}),br(Ce.core.flags.hasAll,(e,t)=>{let r=t[1](e),n=t[0](e);return r?(n&r)===r:!n}),br(Ce.structureQuery.type.elementSymbol,(e,t)=>jm(t[0](e))),br(Ce.structureQuery.type.atomName,(e,t)=>Jj(t[0](e))),br(Ce.structureQuery.type.bondFlags,(e,t)=>{let r=0;if(typeof t.length=="number")for(let n=0,o=t.length;nQc.elementFingerprint(aMe(e,t))),br(Ce.structureQuery.type.secondaryStructureFlags,(e,t)=>{let r=0;if(typeof t.length=="number")for(let n=0,o=t.length;nbn.filters.pick(t[0],t.test)(e)),er(Ce.structureQuery.filter.first,(e,t)=>bn.filters.first(t[0])(e)),er(Ce.structureQuery.filter.withSameAtomProperties,(e,t)=>bn.filters.withSameAtomProperties(t[0],t.source,t.property)(e)),er(Ce.structureQuery.filter.intersectedBy,(e,t)=>bn.filters.areIntersectedBy(t[0],t.by)(e)),er(Ce.structureQuery.filter.within,(e,t)=>{var r,n,o;return bn.filters.within({query:t[0],target:t.target,minRadius:(r=t["min-radius"])===null||r===void 0?void 0:r.call(t,e),maxRadius:(n=t["max-radius"])===null||n===void 0?void 0:n.call(t,e),elementRadius:t["atom-radius"],invert:(o=t.invert)===null||o===void 0?void 0:o.call(t,e)})(e)}),er(Ce.structureQuery.filter.isConnectedTo,(e,t)=>{var r,n;return bn.filters.isConnectedTo({query:t[0],target:t.target,disjunct:(r=t.disjunct)===null||r===void 0?void 0:r.call(t,e),invert:(n=t.invert)===null||n===void 0?void 0:n.call(t,e),bondTest:t["bond-test"]})(e)}),er(Ce.structureQuery.generator.atomGroups,function(t,r){return bn.generators.atoms({entityTest:r["entity-test"],chainTest:r["chain-test"],residueTest:r["residue-test"],atomTest:r["atom-test"],groupBy:r["group-by"]})(t)}),er(Ce.structureQuery.generator.all,function(t){return bn.generators.all(t)}),er(Ce.structureQuery.generator.empty,function(t){return bn.generators.none(t)}),er(Ce.structureQuery.generator.bondedAtomicPairs,function(t,r){return bn.generators.bondedAtomicPairs(r&&r[0])(t)}),er(Ce.structureQuery.generator.rings,function(t,r){var n,o;return bn.generators.rings((n=r?.fingerprint)===null||n===void 0?void 0:n.call(r,t),(o=r?.["only-aromatic"])===null||o===void 0?void 0:o.call(r,t))(t)}),er(Ce.structureQuery.generator.queryInSelection,function(t,r){var n;return bn.generators.querySelection(r[0],r.query,(n=r["in-complement"])===null||n===void 0?void 0:n.call(r,t))(t)}),er(Ce.structureQuery.modifier.includeSurroundings,function(t,r){return bn.modifiers.includeSurroundings(r[0],{radius:r.radius(t),wholeResidues:!!(r["as-whole-residues"]&&r["as-whole-residues"](t)),elementRadius:r["atom-radius"]})(t)}),er(Ce.structureQuery.modifier.surroundingLigands,function(t,r){return bn.modifiers.surroundingLigands({query:r[0],radius:r.radius(t),includeWater:!!(r["include-water"]&&r["include-water"](t))})(t)}),er(Ce.structureQuery.modifier.wholeResidues,function(t,r){return bn.modifiers.wholeResidues(r[0])(t)}),er(Ce.structureQuery.modifier.union,function(t,r){return bn.modifiers.union(r[0])(t)}),er(Ce.structureQuery.modifier.expandProperty,function(t,r){return bn.modifiers.expandProperty(r[0],r.property)(t)}),er(Ce.structureQuery.modifier.exceptBy,function(t,r){return bn.modifiers.exceptBy(r[0],r.by)(t)}),er(Ce.structureQuery.modifier.includeConnected,function(t,r){var n,o;return bn.modifiers.includeConnected({query:r[0],bondTest:r["bond-test"],wholeResidues:!!(r["as-whole-residues"]&&r["as-whole-residues"](t)),layerCount:r["layer-count"]&&r["layer-count"](t)||1,fixedPoint:(o=(n=r["fixed-point"])===null||n===void 0?void 0:n.call(r,t))!==null&&o!==void 0?o:!1})(t)}),er(Ce.structureQuery.modifier.intersectBy,function(t,r){return bn.modifiers.intersectBy(r[0],r.by)(t)}),er(Ce.structureQuery.combinator.merge,(e,t)=>bn.combinators.merge(t)(e)),er(Ce.structureQuery.atomProperty.core.elementSymbol,vo(Ne.atom.type_symbol)),er(Ce.structureQuery.atomProperty.core.vdw,(e,t)=>Xp(Ne.atom.type_symbol(t&&t[0]&&t[0](e)||e.element))),er(Ce.structureQuery.atomProperty.core.mass,(e,t)=>XW(Ne.atom.type_symbol(t&&t[0]&&t[0](e)||e.element))),er(Ce.structureQuery.atomProperty.core.atomicNumber,(e,t)=>jg(Ne.atom.type_symbol(t&&t[0]&&t[0](e)||e.element))),er(Ce.structureQuery.atomProperty.core.x,vo(Ne.atom.x)),er(Ce.structureQuery.atomProperty.core.y,vo(Ne.atom.y)),er(Ce.structureQuery.atomProperty.core.z,vo(Ne.atom.z)),er(Ce.structureQuery.atomProperty.core.sourceIndex,vo(Ne.atom.sourceIndex)),er(Ce.structureQuery.atomProperty.core.operatorName,vo(Ne.unit.operator_name)),er(Ce.structureQuery.atomProperty.core.operatorKey,vo(Ne.unit.operator_key)),er(Ce.structureQuery.atomProperty.core.modelIndex,vo(Ne.unit.model_index)),er(Ce.structureQuery.atomProperty.core.modelLabel,vo(Ne.unit.model_label)),er(Ce.structureQuery.atomProperty.core.atomKey,(e,t)=>{let r=t&&t[0]&&t[0](e)||e.element;return ea(r.unit.id,r.element)}),er(Ce.structureQuery.atomProperty.macromolecular.residueKey,(e,t)=>$.residueIndex(t&&t[0]&&t[0](e)||e.element)),er(Ce.structureQuery.atomProperty.macromolecular.chainKey,(e,t)=>$.chainIndex(t&&t[0]&&t[0](e)||e.element)),er(Ce.structureQuery.atomProperty.macromolecular.entityKey,(e,t)=>$.entityIndex(t&&t[0]&&t[0](e)||e.element)),er(Ce.structureQuery.atomProperty.macromolecular.id,vo(Ne.atom.id)),er(Ce.structureQuery.atomProperty.macromolecular.isHet,(e,t)=>Ne.residue.group_PDB(t&&t[0]&&t[0](e)||e.element)!=="ATOM"),er(Ce.structureQuery.atomProperty.macromolecular.label_atom_id,vo(Ne.atom.label_atom_id)),er(Ce.structureQuery.atomProperty.macromolecular.label_alt_id,vo(Ne.atom.label_alt_id)),er(Ce.structureQuery.atomProperty.macromolecular.label_comp_id,vo(Ne.atom.label_comp_id)),er(Ce.structureQuery.atomProperty.macromolecular.label_seq_id,vo(Ne.residue.label_seq_id)),er(Ce.structureQuery.atomProperty.macromolecular.label_asym_id,vo(Ne.chain.label_asym_id)),er(Ce.structureQuery.atomProperty.macromolecular.label_entity_id,vo(Ne.entity.id)),er(Ce.structureQuery.atomProperty.macromolecular.auth_atom_id,vo(Ne.atom.auth_atom_id)),er(Ce.structureQuery.atomProperty.macromolecular.auth_comp_id,vo(Ne.atom.auth_comp_id)),er(Ce.structureQuery.atomProperty.macromolecular.auth_seq_id,vo(Ne.residue.auth_seq_id)),er(Ce.structureQuery.atomProperty.macromolecular.auth_asym_id,vo(Ne.chain.auth_asym_id)),er(Ce.structureQuery.atomProperty.macromolecular.pdbx_PDB_ins_code,vo(Ne.residue.pdbx_PDB_ins_code)),er(Ce.structureQuery.atomProperty.macromolecular.pdbx_formal_charge,vo(Ne.atom.pdbx_formal_charge)),er(Ce.structureQuery.atomProperty.macromolecular.occupancy,vo(Ne.atom.occupancy)),er(Ce.structureQuery.atomProperty.macromolecular.B_iso_or_equiv,vo(Ne.atom.B_iso_or_equiv)),er(Ce.structureQuery.atomProperty.macromolecular.entityType,vo(Ne.entity.type)),er(Ce.structureQuery.atomProperty.macromolecular.entitySubtype,vo(Ne.entity.subtype)),er(Ce.structureQuery.atomProperty.macromolecular.entityPrdId,vo(Ne.entity.prd_id)),er(Ce.structureQuery.atomProperty.macromolecular.entityDescription,vo(Ne.entity.pdbx_description)),er(Ce.structureQuery.atomProperty.macromolecular.objectPrimitive,vo(Ne.unit.object_primitive)),er(Ce.structureQuery.atomProperty.macromolecular.isNonStandard,vo(Ne.residue.isNonStandard)),er(Ce.structureQuery.atomProperty.macromolecular.secondaryStructureKey,vo(Ne.residue.secondary_structure_key)),er(Ce.structureQuery.atomProperty.macromolecular.secondaryStructureFlags,vo(Ne.residue.secondary_structure_type)),er(Ce.structureQuery.atomProperty.macromolecular.chemCompType,vo(Ne.residue.chem_comp_type)),er(Ce.structureQuery.atomSet.atomCount,function(t,r){return bn.atomset.atomCount(t)}),er(Ce.structureQuery.atomSet.countQuery,function(t,r){return bn.atomset.countQuery(r[0])(t)}),er(Ce.structureQuery.atomSet.propertySet,function(t,r){return bn.atomset.propertySet(r[0])(t)}),er(Ce.structureQuery.bondProperty.order,(e,t)=>e.atomicBond.order),er(Ce.structureQuery.bondProperty.flags,(e,t)=>e.atomicBond.type),er(Ce.structureQuery.bondProperty.key,(e,t)=>e.atomicBond.key),er(Ce.structureQuery.bondProperty.atomA,(e,t)=>e.atomicBond.a),er(Ce.structureQuery.bondProperty.atomB,(e,t)=>e.atomicBond.b),er(Ce.structureQuery.bondProperty.length,(e,t)=>e.atomicBond.length),er(Ce.internal.generator.bundleElement,function(t,r){return OR(r.groupedUnits(t),r.ranges(t),r.set(t))}),er(Ce.internal.generator.bundle,function(t,r){return NR(r.elements(t))(t)}),er(Ce.internal.generator.current,function(t,r){return t.tryGetCurrentSelection()})];function vo(e){return(t,r)=>e(r&&r[0]&&r[0](t)||t.element)}function Jre(e,t){return e|(Er.isName(t)?Er.fromName(t):0)}function ene(e,t){switch(t.toLowerCase()){case"helix":return e|2;case"alpha":return e|2|4096;case"pi":return e|2|32768;case"310":return e|2|2048;case"beta":return e|4;case"strand":return e|4|4194304;case"sheet":return e|4|8388608;case"turn":return e|16;case"bend":return e|8;case"coil":return e|536870912;default:return e}}function aMe(e,t){let r=[];if(!t)return r;if(typeof t.length=="number")for(let n=0,o=t.length;n{let y=f===-1,g=y?Oe(0):f;p.push({loci:h,color:g,clear:y})}),{kind:"element-loci",layers:p}}else return c}e.merge=o;function i(c,u){if(r(c))return c;if(c.kind==="element-loci"){let{structure:d}=c.layers[0].loci,m=[];for(let p of c.layers){let{loci:h,color:f,clear:y}=p,g=$.Loci.remap(h,u);h=$.Loci.remap(g,d),$.Loci.isEmpty(h)||m.push({loci:h,color:f,clear:y})}return{kind:"element-loci",layers:m}}else return c}e.filter=i;function s(c,u){let d=[];for(let m=0,p=c.length;m{p.push({loci:h,value:f})}),{kind:"element-loci",layers:p}}else return c}e.merge=o;function i(c,u){if(r(c))return c;if(c.kind==="element-loci"){let{structure:d}=c.layers[0].loci,m=[];for(let p of c.layers){let{loci:h,value:f}=p,y=$.Loci.remap(h,u);h=$.Loci.remap(y,d),$.Loci.isEmpty(h)||m.push({loci:h,value:f})}return{kind:"element-loci",layers:m}}else return c}e.filter=i;function s(c,u){let d=[];for(let m=0,p=c.length;mr.lowestElementCount?"lowest":n>r.lowerElementCount?"lower":n>r.lowElementCount?"low":n>r.mediumElementCount?"medium":n>r.highElementCount?"high":"higher"}function cMe(e){if(e.root.models.length===1){let t=ao.Provider.get(e.root.model);if(t&&t.spacegroup.name==="P 1"&&!ui.isZero(t.spacegroup.cell))return t.spacegroup.cell.volume}return ft.volume(e.root.boundary.box)}function S_(e,t){let r=Ti(e.quality,"auto"),n=Ti(e.detail,1),o=Ti(e.radialSegments,12),i=Ti(e.linearSegments,8),s=Ti(e.resolution,2),a=Ti(e.probePositions,12),l=Ti(e.doubleSided,!0),c=0;if(r==="auto"){if(t instanceof Me)r=mO(t.root),c=cMe(t);else if(Je.is(t)){let[u,d,m]=t.grid.cells.space.dimensions;c=u*d*m,r=c<1e7?"medium":"low"}}switch(r){case"highest":n=3,o=36,i=18,s=.1,a=72,l=!0;break;case"higher":n=3,o=28,i=14,s=.3,a=48,l=!0;break;case"high":n=2,o=20,i=10,s=.5,a=36,l=!0;break;case"medium":n=1,o=12,i=8,s=.8,a=24,l=!0;break;case"low":n=0,o=8,i=3,s=1.3,a=24,l=!1;break;case"lower":n=0,o=4,i=2,s=3,a=12,l=!1;break;case"lowest":n=0,o=2,i=1,s=8,a=12,l=!1;break;case"custom":break}return s=Math.max(s,c/5e8),s=Math.min(s,20),e.transparentBackfaces==="off"&&(e.alpha!==void 0&&e.alpha<1||e.xrayShaded)&&(l=!1),{detail:n,radialSegments:o,linearSegments:i,resolution:s,probePositions:a,doubleSided:l}}var cI=x.set,tne=x.normalize,rne=x.sub,nne=x.addScalar,uI=x.scale,one=x.toArray;function C0(e,t,r,n){let o=!1;if(Je.isLoci(e)){if(!Je.areEquivalent(e.volume,t))return!1;n(ve.ofLength(t.grid.cells.data.length))&&(o=!0)}else if(Je.Isosurface.isLoci(e)){if(!Je.areEquivalent(e.volume,t))return!1;if(r?.isoValue){if(!Je.IsoValue.areSame(e.isoValue,r.isoValue,t.grid.stats))return!1;n(ve.ofLength(t.grid.cells.data.length))&&(o=!0)}else{let{stats:i,cells:{data:s}}=t.grid,a=i.sigma,l=Je.IsoValue.toAbsolute(e.isoValue,i).absoluteValue;for(let c=0,u=s.length;c{n(ve.ofSingleton(i))&&(o=!0)})}else if(Je.Segment.isLoci(e)){if(!Je.areEquivalent(e.volume,t))return!1;if(r?.segments){if(!Fe.areIntersecting(e.segments,r.segments))return!1;n(ve.ofLength(t.grid.cells.data.length))&&(o=!0)}else{let i=Je.Segmentation.get(t);if(i){let s=new Set;for(let c=0,u=e.segments.length;cU)continue;let xe=U-ee,pe=R(ue,De,Xe);for(let be=0;bec)throw new Error("outputStride + itemOffset must NOT be larger than colorStride");let m=e.colorType.endsWith("Instance"),p=m?e.instanceCount:1,h=Jn(Math.max(1,p*t),d,Uint8Array),{array:f}=h,[y,g]=i,v=s[0],b=x.fromArray(x(),a,0),S=a[3];function _(T,B,D){let M=Math.floor(D*y%v/y),R=Math.floor(D*y/v),U=M*y+T;return c*(R*g*v+B*v+U)}let w=x(),E=x(),A=x(),P=x();for(let T=0;T p) discard; + + float f = p - dist; + gl_FragColor = vColor * f; + gl_FragData[1] = vec4(f); +} +`;var pne=` +precision highp float; + +#include common +#include read_from_texture + +uniform int uGroupCount; + +attribute float aSample; +#define SampleID int(aSample) + +attribute mat4 aTransform; +attribute float aInstance; + +uniform vec2 uGeoTexDim; +uniform sampler2D tPosition; +uniform sampler2D tGroup; + +uniform vec2 uColorTexDim; +uniform sampler2D tColor; + +varying vec3 vPosition; +varying vec4 vColor; + +uniform vec3 uBboxSize; +uniform vec3 uBboxMin; +uniform float uResolution; + +void main() { + vec3 position = readFromTexture(tPosition, SampleID, uGeoTexDim).xyz; + float group = unpackRGBToInt(readFromTexture(tGroup, SampleID, uGeoTexDim).rgb); + + position = (aTransform * vec4(position, 1.0)).xyz; + gl_PointSize = 7.0; + vPosition = (position - uBboxMin) / uResolution; + gl_Position = vec4(((position - uBboxMin) / uBboxSize) * 2.0 - 1.0, 1.0); + + #if defined(dColorType_group) + vColor = readFromTexture(tColor, group, uColorTexDim); + #elif defined(dColorType_groupInstance) + vColor = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim); + #endif +} +`;var gMe={drawCount:Mn("number"),instanceCount:Mn("number"),stride:Mn("number"),uGroupCount:ye("i","material"),aTransform:nn("float32",16,1),aInstance:nn("float32",1,1),aSample:nn("float32",1,0),uGeoTexDim:ye("v2","material"),tPosition:Ct("texture","rgba","float","nearest","material"),tGroup:Ct("texture","rgba","float","nearest","material"),uColorTexDim:ye("v2","material"),tColor:Ct("texture","rgba","ubyte","nearest","material"),dColorType:At("string",["group","groupInstance","vertex","vertexInstance"]),uCurrentSlice:ye("f"),uCurrentX:ye("f"),uCurrentY:ye("f"),uBboxMin:ye("v3","material"),uBboxSize:ye("v3","material"),uResolution:ye("f","material")},Xu="color-accumulate",__="color-count";function fne(e,t){let r=new Float32Array(e);for(let n=0;ns.drawCount.ref.value||o!==s.stride.ref.value)&&I.update(s.aSample,fne(a,o)),I.updateIfChanged(s.drawCount,a),I.updateIfChanged(s.instanceCount,t.instanceCount),I.updateIfChanged(s.stride,o),I.updateIfChanged(s.uGroupCount,t.groupCount),I.update(s.aTransform,t.transformBuffer),I.update(s.aInstance,t.instanceBuffer),I.update(s.uGeoTexDim,Ae.set(s.uGeoTexDim.ref.value,t.positionTexture.getWidth(),t.positionTexture.getHeight())),I.update(s.tPosition,t.positionTexture),I.update(s.tGroup,t.groupTexture),I.update(s.uColorTexDim,Ae.set(s.uColorTexDim.ref.value,t.colorData.getWidth(),t.colorData.getHeight())),I.update(s.tColor,t.colorData),I.updateIfChanged(s.dColorType,t.colorType),I.updateIfChanged(s.uCurrentSlice,0),I.updateIfChanged(s.uCurrentX,0),I.updateIfChanged(s.uCurrentY,0),I.update(s.uBboxMin,r.min),I.update(s.uBboxSize,i),I.updateIfChanged(s.uResolution,n),e.namedComputeRenderables[Xu].update()}else e.namedComputeRenderables[Xu]=vMe(e,t,r,n,o);return e.namedComputeRenderables[Xu]}function vMe(e,t,r,n,o){let i=x.sub(x(),r.max,r.min),s=Math.round(t.vertexCount/o),a={drawCount:I.create(s),instanceCount:I.create(t.instanceCount),stride:I.create(o),uGroupCount:I.create(t.groupCount),aTransform:I.create(t.transformBuffer),aInstance:I.create(t.instanceBuffer),aSample:I.create(fne(s,o)),uGeoTexDim:I.create(Ae.create(t.positionTexture.getWidth(),t.positionTexture.getHeight())),tPosition:I.create(t.positionTexture),tGroup:I.create(t.groupTexture),uColorTexDim:I.create(Ae.create(t.colorData.getWidth(),t.colorData.getHeight())),tColor:I.create(t.colorData),dColorType:I.create(t.colorType),uCurrentSlice:I.create(0),uCurrentX:I.create(0),uCurrentY:I.create(0),uBboxMin:I.create(r.min),uBboxSize:I.create(i),uResolution:I.create(n)},l=k({},gMe),c=Rr("accumulate",pne,mne,{drawBuffers:"required"}),u=Jr(e,"points",c,l,a);return en(u,a)}function xMe(e){let{gl:t,state:r}=e;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)}var bMe=te(k({},wn),{tColor:Ct("texture","rgba","float","nearest"),tCount:Ct("texture","alpha","float","nearest"),uTexSize:ye("v2")}),w_="color-normalize";function SMe(e,t,r){if(e.namedComputeRenderables[w_]){let n=e.namedComputeRenderables[w_].values;I.update(n.tColor,t),I.update(n.tCount,r),I.update(n.uTexSize,Ae.set(n.uTexSize.ref.value,t.getWidth(),t.getHeight())),e.namedComputeRenderables[w_].update()}else e.namedComputeRenderables[w_]=CMe(e,t,r);return e.namedComputeRenderables[w_]}function CMe(e,t,r){let n=te(k({},An),{tColor:I.create(t),tCount:I.create(r),uTexSize:I.create(Ae.create(t.getWidth(),t.getHeight()))}),o=k({},bMe),i=Rr("normalize",Nn,dne),s=Jr(e,"triangles",i,o,n);return en(s,n)}function _Me(e){let{gl:t,state:r}=e;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)}function wMe(e){let t=e[0]*e[1]*e[2],r=Math.sqrt(t),n=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))),o=0,i=e[1],s=1,a=e[2];return n=A&&(F-=A,N+=S,z=0,I.update(U,N)),I.update(R,z),I.update(M,Q),l.viewport(z,N,b,S),l.scissor(z,N,b,S),D.render(),++F,z+=b;T.detachFramebuffer(P,0),B.detachFramebuffer(P,1),i.drawBuffers([s.COLOR_ATTACHMENT0,s.NONE]),ot&&n.timer.markEnd("ColorAccumulate.render"),ot&&n.timer.mark("ColorNormalize.render"),(!o||fJ(o))&&(o=a.texture("image-uint8","rgba","ubyte","linear")),o.define(w,E);let q=SMe(n,T,B);l.currentRenderItemId=-1,_Me(n),o.attachFramebuffer(P,0),l.viewport(0,0,w,E),l.scissor(0,0,w,E),s.clear(s.COLOR_BUFFER_BIT),q.render(),ot&&n.timer.markEnd("ColorNormalize.render");let O=Rt.create(v[0],v[1],v[2],f),J=d?"volumeInstance":"volume";return ot&&n.timer.markEnd("calcTextureMeshColorSmoothing"),{texture:o,gridDim:g,gridTexDim:Ae.create(w,E),gridTransform:O,type:J}}var pO="color-smoothing-rgb",Ib="color-smoothing-rgba",Eb="color-smoothing-alpha";function AMe(e){return e==="group"||e==="groupInstance"}function fO(e,t,r,n,o){if(!AMe(e.dColorType.ref.value))return;r*=3,n.namedTextures[pO]||(n.namedTextures[pO]=n.resources.texture("image-uint8","rgb","ubyte","nearest"));let i=n.namedTextures[pO];i.load(e.tColor.ref.value);let s=A_({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,o);I.updateIfChanged(e.dColorType,s.type),I.update(e.tColorGrid,s.texture),I.update(e.uColorTexDim,s.gridTexDim),I.update(e.uColorGridDim,s.gridDim),I.update(e.uColorGridTransform,s.gridTransform)}function TMe(e){return e==="groupInstance"}function hne(e,t,r,n,o){if(!TMe(e.dOverpaintType.ref.value))return;r*=3,n.namedTextures[Ib]||(n.namedTextures[Ib]=n.resources.texture("image-uint8","rgba","ubyte","nearest"));let i=n.namedTextures[Ib];i.load(e.tOverpaint.ref.value);let s=A_({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,o);I.updateIfChanged(e.dOverpaintType,s.type),I.update(e.tOverpaintGrid,s.texture),I.update(e.uOverpaintTexDim,s.gridTexDim),I.update(e.uOverpaintGridDim,s.gridDim),I.update(e.uOverpaintGridTransform,s.gridTransform)}function PMe(e){return e==="groupInstance"}function gne(e,t,r,n,o){if(!PMe(e.dTransparencyType.ref.value))return;r*=3,n.namedTextures[Eb]||(n.namedTextures[Eb]=n.resources.texture("image-uint8","alpha","ubyte","nearest"));let i=n.namedTextures[Eb];i.load(e.tTransparency.ref.value);let s=A_({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,o);I.updateIfChanged(e.dTransparencyType,s.type),I.update(e.tTransparencyGrid,s.texture),I.update(e.uTransparencyTexDim,s.gridTexDim),I.update(e.uTransparencyGridDim,s.gridDim),I.update(e.uTransparencyGridTransform,s.gridTransform)}function IMe(e){return e==="groupInstance"}function yne(e,t,r,n,o){if(!IMe(e.dEmissiveType.ref.value))return;r*=3,n.namedTextures[Eb]||(n.namedTextures[Eb]=n.resources.texture("image-uint8","alpha","ubyte","nearest"));let i=n.namedTextures[Eb];i.load(e.tEmissive.ref.value);let s=A_({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.dEmissiveType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,o);I.updateIfChanged(e.dEmissiveType,s.type),I.update(e.tEmissiveGrid,s.texture),I.update(e.uEmissiveTexDim,s.gridTexDim),I.update(e.uEmissiveGridDim,s.gridDim),I.update(e.uEmissiveGridTransform,s.gridTransform)}function EMe(e){return e==="groupInstance"}function vne(e,t,r,n,o){if(!EMe(e.dSubstanceType.ref.value))return;r*=3,n.namedTextures[Ib]||(n.namedTextures[Ib]=n.resources.texture("image-uint8","rgba","ubyte","nearest"));let i=n.namedTextures[Ib];i.load(e.tSubstance.ref.value);let s=A_({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,o);I.updateIfChanged(e.dSubstanceType,s.type),I.update(e.tSubstanceGrid,s.texture),I.update(e.uSubstanceTexDim,s.gridTexDim),I.update(e.uSubstanceGridDim,s.gridDim),I.update(e.uSubstanceGridTransform,s.gridTransform)}var Sr;(function(e){function t(p,h){p&&(p.state.visible=h)}e.setVisibility=t;function r(p,h){p&&(p.state.alphaFactor=h)}e.setAlphaFactor=r;function n(p,h){p&&(p.state.pickable=h)}e.setPickable=n;function o(p,h){p&&(p.state.colorOnly=h)}e.setColorOnly=o;function i(p,h,f,y,g){if(!p||Zo(h))return!1;let{tMarker:v,uMarker:b,markerAverage:S,markerStatus:_,uGroupCount:w,instanceCount:E,instanceGranularity:A}=p.values,P=A.ref.value?E.ref.value:w.ref.value*E.ref.value,{array:T}=v.ref.value,B=_.ref.value;if(!Fi(h)){let U=0;if(y(h,F=>(U+=ve.size(F),!0),!0),U===0)return!1;U===P&&(h=a0)}let D=!1,M=-1,R=-1;if(Fi(h)){let U=Are(f,B);U.status!==-1?(D=B!==U.status,D&&wre(T,U.status,P)):D=Za(T,ve.ofLength(P),f),M=U.average,R=U.status}else D=y(h,U=>Za(T,U,f),!0),D&&(M=Tre(f,B),g&&g.status!==-1&&M===-1&&Fo.isReverse(g.action,f)&&Ht.areEqual(h,g.loci)&&(R=g.status,M=R===0?0:.5));return D&&(M===-1&&(M=$L(T,P),M===0&&(R=0)),g&&(g.action=f,g.loci=h,g.status=B),I.updateIfChanged(b,R),R===-1&&I.update(v,v.ref.value),I.updateIfChanged(S,M),I.updateIfChanged(_,R)),D}e.mark=i;function s(p,h,f,y,g){if(!p)return;let{tOverpaint:v,dOverpaintType:b,dOverpaint:S,uGroupCount:_,instanceCount:w,instanceGranularity:E}=p.values,A=E.ref.value?w.ref.value:_.ref.value*w.ref.value,P=E.ref.value?"instance":"groupInstance";TJ(h.layers.length?A:0,P,p.values);let{array:T}=v.ref.value;y&&dF(T,0,A);for(let B=0,D=h.layers.length;B{let z=ve.start(N),q=ve.end(N);return U?dF(T,z,q):AJ(T,z,q,R)},!1)}if(I.update(v,v.ref.value),I.updateIfChanged(b,P),I.updateIfChanged(S,h.layers.length>0),h.layers.length!==0&&P!=="instance"&&g&&iu(g.props)){let{geometry:B,props:D,webgl:M}=g;if(B.kind==="mesh"){let{resolution:R,overpaintTexture:U}=B.meta,F=Tl(D.smoothColors,!0,R);F&&(ane(p.values,F.resolution,F.stride,M,U),B.meta.overpaintTexture=p.values.tOverpaintGrid.ref.value)}else if(M&&B.kind==="texture-mesh"){let{resolution:R,overpaintTexture:U}=B.meta,F=Tl(D.smoothColors,!0,R);F&&(hne(p.values,F.resolution,F.stride,M,U),B.meta.overpaintTexture=p.values.tOverpaintGrid.ref.value)}}}e.setOverpaint=s;function a(p,h,f,y,g){if(!p)return;let{tTransparency:v,dTransparencyType:b,transparencyAverage:S,dTransparency:_,uGroupCount:w,instanceCount:E,instanceGranularity:A}=p.values,P=A.ref.value?E.ref.value:w.ref.value*E.ref.value,T=A.ref.value?"instance":"groupInstance";DJ(h.layers.length?P:0,T,p.values);let{array:B}=v.ref.value;y&&EJ(B,0,P);for(let D=0,M=h.layers.length;D{let z=ve.start(N),q=ve.end(N);return IJ(B,z,q,U)},!1)}if(I.update(v,v.ref.value),I.updateIfChanged(S,mF(B,P)),I.updateIfChanged(b,T),I.updateIfChanged(_,h.layers.length>0),h.layers.length!==0&&T!=="instance"&&g&&iu(g.props)){let{geometry:D,props:M,webgl:R}=g;if(D.kind==="mesh"){let{resolution:U,transparencyTexture:F}=D.meta,N=Tl(M.smoothColors,!0,U);N&&(lne(p.values,N.resolution,N.stride,R,F),D.meta.transparencyTexture=p.values.tTransparencyGrid.ref.value)}else if(R&&D.kind==="texture-mesh"){let{resolution:U,transparencyTexture:F}=D.meta,N=Tl(M.smoothColors,!0,U);N&&(gne(p.values,N.resolution,N.stride,R,F),D.meta.transparencyTexture=p.values.tTransparencyGrid.ref.value)}}}e.setTransparency=a;function l(p,h,f,y,g){if(!p)return;let{tEmissive:v,dEmissiveType:b,emissiveAverage:S,dEmissive:_,uGroupCount:w,instanceCount:E,instanceGranularity:A}=p.values,P=A.ref.value?E.ref.value:w.ref.value*E.ref.value,T=A.ref.value?"instance":"groupInstance";VJ(h.layers.length?P:0,T,p.values);let{array:B}=v.ref.value;y&&zJ(B,0,P);for(let D=0,M=h.layers.length;D{let z=ve.start(N),q=ve.end(N);return UJ(B,z,q,U)},!1)}if(I.update(v,v.ref.value),I.updateIfChanged(S,fF(B,P)),I.updateIfChanged(b,T),I.updateIfChanged(_,h.layers.length>0),h.layers.length!==0&&T!=="instance"&&g&&iu(g.props)){let{geometry:D,props:M,webgl:R}=g;if(D.kind==="mesh"){let{resolution:U,emissiveTexture:F}=D.meta,N=Tl(M.smoothColors,!0,U);N&&(cne(p.values,N.resolution,N.stride,R,F),D.meta.emissiveTexture=p.values.tEmissiveGrid.ref.value)}else if(R&&D.kind==="texture-mesh"){let{resolution:U,emissiveTexture:F}=D.meta,N=Tl(M.smoothColors,!0,U);N&&(yne(p.values,N.resolution,N.stride,R,F),D.meta.emissiveTexture=p.values.tEmissiveGrid.ref.value)}}}e.setEmissive=l;function c(p,h,f,y,g){if(!p)return;let{tSubstance:v,dSubstanceType:b,dSubstance:S,uGroupCount:_,instanceCount:w,instanceGranularity:E}=p.values,A=E.ref.value?w.ref.value:_.ref.value*w.ref.value,P=E.ref.value?"instance":"groupInstance";OJ(h.layers.length?A:0,P,p.values);let{array:T}=v.ref.value;y&&pF(T,0,A);for(let B=0,D=h.layers.length;B{let z=ve.start(N),q=ve.end(N);return U?pF(T,z,q):FJ(T,z,q,R)},!1)}if(I.update(v,v.ref.value),I.updateIfChanged(b,P),I.updateIfChanged(S,h.layers.length>0),h.layers.length!==0&&P!=="instance"&&g&&iu(g.props)){let{geometry:B,props:D,webgl:M}=g;if(B.kind==="mesh"){let{resolution:R,substanceTexture:U}=B.meta,F=Tl(D.smoothColors,!0,R);F&&(une(p.values,F.resolution,F.stride,M,U),B.meta.substanceTexture=p.values.tSubstanceGrid.ref.value)}else if(M&&B.kind==="texture-mesh"){let{resolution:R,substanceTexture:U}=B.meta,F=Tl(D.smoothColors,!0,R);F&&(vne(p.values,F.resolution,F.stride,M,U),B.meta.substanceTexture=p.values.tSubstanceGrid.ref.value)}}}e.setSubstance=c;function u(p,h,f,y){if(!p)return;let{tClipping:g,dClippingType:v,dClipping:b,uGroupCount:S,instanceCount:_,instanceGranularity:w}=p.values,E=w.ref.value?_.ref.value:S.ref.value*_.ref.value,{layers:A}=h,P=w.ref.value?"instance":"groupInstance";RJ(A.length?E:0,P,p.values);let{array:T}=g.ref.value;y&&BJ(T,0,E);for(let B=0,D=h.layers.length;B{let N=ve.start(F),z=ve.end(F);return MJ(T,N,z,R)},!1)}I.update(g,g.ref.value),I.updateIfChanged(v,P),I.updateIfChanged(b,h.layers.length>0)}e.setClipping=u;function d(p,h){p&&(I.updateIfChanged(p.values.uOverpaintStrength,h.overpaint),I.updateIfChanged(p.values.uTransparencyStrength,h.transparency),I.updateIfChanged(p.values.uEmissiveStrength,h.emissive),I.updateIfChanged(p.values.uSubstanceStrength,h.substance))}e.setThemeStrength=d;function m(p,h,f){if(!p||!h&&!f)return;let{values:y}=p;h&&(ne.copy(y.matrix.ref.value,h),I.update(y.matrix,y.matrix.ref.value)),f?(y.extraTransform.ref.value.set(f),I.update(y.extraTransform,y.extraTransform.ref.value)):f===null&&(cb(y.extraTransform.ref.value,y.instanceCount.ref.value),I.update(y.extraTransform,y.extraTransform.ref.value)),uF(y,y.invariantBoundingSphere.ref.value,y.instanceGrid.ref.value.cellSize,y.instanceGrid.ref.value.batchSize);let g=Ko(y.invariantBoundingSphere.ref.value,y.transform.ref.value,y.instanceCount.ref.value,0);I.update(y.boundingSphere,g)}e.setTransform=m})(Sr||(Sr={}));function qn(e,t){return{kind:e,layers:t}}(function(e){e.Empty={kind:"empty-loci",layers:[]};let t;(function(u){u.is=gi.has;let d;(function(g){g[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"})(d=u.Flag||(u.Flag={}));function m(g){return gi.create(g)}u.create=m,u.Names={one:d.One,two:d.Two,three:d.Three,four:d.Four,five:d.Five,six:d.Six};function p(g){return g in u.Names}u.isName=p;function h(g){switch(g){case"one":return d.One;case"two":return d.Two;case"three":return d.Three;case"four":return d.Four;case"five":return d.Five;case"six":return d.Six}}u.fromName=h;function f(g){let v=d.None;for(let b=0,S=g.length;b{h.push({loci:f,groups:y})}),{kind:"element-loci",layers:h}}else return u}e.merge=i;function s(u,d){if(n(u))return u;if(u.kind==="element-loci"){let{structure:m}=u.layers[0].loci,p=[];for(let h of u.layers){let{loci:f,groups:y}=h,g=$.Loci.remap(f,d);f=$.Loci.remap(g,m),$.Loci.isEmpty(f)||p.push({loci:f,groups:y})}return{kind:"element-loci",layers:p}}else return u}e.filter=s;function a(u,d){let m=[];for(let p=0,h=u.length;p{h.push({loci:f,material:y,clear:!1})}),{kind:"element-loci",layers:h}}else return c}e.merge=o;function i(c,u){if(r(c))return c;if(c.kind==="element-loci"){let{structure:d}=c.layers[0].loci,m=[];for(let p of c.layers){let{loci:h,material:f,clear:y}=p,g=$.Loci.remap(h,u);h=$.Loci.remap(g,d),$.Loci.isEmpty(h)||m.push({loci:h,material:f,clear:y})}return{kind:"element-loci",layers:m}}else return c}e.filter=i;function s(c,u){let d=[];for(let m=0,p=c.length;m{p.push({loci:h,value:f})}),{kind:"element-loci",layers:p}}else return c}e.merge=o;function i(c,u){if(r(c))return c;if(c.kind==="element-loci"){let{structure:d}=c.layers[0].loci,m=[];for(let p of c.layers){let{loci:h,value:f}=p,y=$.Loci.remap(h,u);h=$.Loci.remap(y,d),$.Loci.isEmpty(h)||m.push({loci:h,value:f})}return{kind:"element-loci",layers:m}}else return c}e.filter=i;function s(c,u){let d=[];for(let m=0,p=c.length;mNt.Empty,getParams:()=>({}),defaultValues:{},defaultColorTheme:Oi.EmptyProvider,defaultSizeTheme:mi.EmptyProvider,isApplicable:()=>!0};function bne(e){return e.map(t=>[t.name,t.provider.label])}var Db=class{get default(){return this._list[0]}get types(){return bne(this._list)}constructor(){this._list=[],this._map=new Map,this._name=new Map}add(t){if(this._map.has(t.name))throw new Error(`${t.name} already registered.`);this._list.push({name:t.name,provider:t}),this._map.set(t.name,t),this._name.set(t,t.name)}getName(t){if(!this._name.has(t))throw new Error(`'${t.label}' is not a registered represenatation provider.`);return this._name.get(t)}remove(t){let r=t.name;this._list.splice(this._list.findIndex(o=>o.name===r),1);let n=this._map.get(r);n&&(this._map.delete(r),this._name.delete(n))}get(t){return this._map.get(t)||DMe}get list(){return this._list}getApplicableList(t){return this._list.filter(r=>r.provider.isApplicable(t))}getApplicableTypes(t){return bne(this.getApplicableList(t))}clear(){this._list.length=0,this._map.clear(),this._name.clear()}};var Nt;(function(e){let t;(function(a){function l(u,d){return u.repr===d.repr&&Ht.areEqual(u.loci,d.loci)}a.areEqual=l;function c(u){return Ht.isEmpty(u.loci)}a.isEmpty=c,a.Empty={loci:nr}})(t=e.Loci||(e.Loci={}));function r(){return{visible:!0,alphaFactor:1,pickable:!0,colorOnly:!1,syncManually:!1,transform:ne.identity(),overpaint:ai.Empty,transparency:hs.Empty,emissive:ys.Empty,substance:gs.Empty,clipping:qn.Empty,themeStrength:{overpaint:1,transparency:1,emissive:1,substance:1},markerActions:Fo.All}}e.createState=r;function n(a,l){l.visible!==void 0&&(a.visible=l.visible),l.alphaFactor!==void 0&&(a.alphaFactor=l.alphaFactor),l.pickable!==void 0&&(a.pickable=l.pickable),l.colorOnly!==void 0&&(a.colorOnly=l.colorOnly),l.overpaint!==void 0&&(a.overpaint=l.overpaint),l.transparency!==void 0&&(a.transparency=l.transparency),l.emissive!==void 0&&(a.emissive=l.emissive),l.substance!==void 0&&(a.substance=l.substance),l.clipping!==void 0&&(a.clipping=l.clipping),l.themeStrength!==void 0&&(a.themeStrength=l.themeStrength),l.syncManually!==void 0&&(a.syncManually=l.syncManually),l.transform!==void 0&&ne.copy(a.transform,l.transform),l.markerActions!==void 0&&(a.markerActions=l.markerActions)}e.updateState=n,e.StateBuilder={create:r,update:n},e.Empty={label:"",groupCount:0,renderObjects:[],geometryVersion:-1,props:{},params:{},updated:new mo,state:r(),theme:Lo.createEmpty(),createOrUpdate:()=>Pe.constant("",void 0),setState:()=>{},setTheme:()=>{},getLoci:()=>nr,getAllLoci:()=>[],eachLocation:()=>{},mark:()=>!1,destroy:()=>{}};class o{constructor(){this.curr=new Set,this.next=new Set,this._version=-1}get version(){return this._version}add(l,c){this.next.add(ea(l,c))}snapshot(){Dn.areEqual(this.curr,this.next)||(this._version+=1),[this.curr,this.next]=[this.next,this.curr],this.next.clear()}}e.GeometryState=o;function i(a,l,c,u,d){let m=0,p=new mo,h=new o,f=u.create(),y=Lo.createEmpty(),g,v,b,S={},_=Object.keys(d).map((w,E)=>{S[E]=w;let A=d[w](l,c);return A.setState(f),A});return{label:a,updated:p,get groupCount(){let w=0;if(v){let{visuals:E}=v;for(let A=0,P=_.length;A{E&&E!==b&&(g=c(l,E),b=E,v||(v=C.getDefaultValues(g)));let A=S_(Object.assign({},v,w),b);Object.assign(v,w,A);let{visuals:P}=v;return Pe.create(`Creating or updating '${a}' representation`,T=>Y(this,null,function*(){for(let B=0,D=_.length;B{let{visuals:E}=v;for(let A=0,P=_.length;A{let w=[],{visuals:E}=v;for(let A=0,P=_.length;A{let{visuals:E}=v;for(let A=0,P=_.length;A{let A=!1;for(let P=0,T=_.length;P{u.update(f,w);for(let E=0,A=_.length;E{y=w;for(let E=0,A=_.length;E{let g=S_(Object.assign({},f,y));return Object.assign(f,y,g),Pe.create(`Updating '${a}' representation`,v=>Y(this,null,function*(){d.add(0,l.id),d.snapshot(),u.next(c++)}))},get state(){return m},get theme(){return p},getLoci:()=>nr,getAllLoci:()=>[],eachLocation:()=>{},mark:(y,g)=>!1,setState:y=>{y.visible!==void 0&&Sr.setVisibility(l,y.visible),y.alphaFactor!==void 0&&Sr.setAlphaFactor(l,y.alphaFactor),y.pickable!==void 0&&Sr.setPickable(l,y.pickable),y.colorOnly!==void 0&&Sr.setColorOnly(l,y.colorOnly),y.overpaint,y.transparency,y.emissive,y.substance,y.clipping,y.themeStrength!==void 0&&Sr.setThemeStrength(l,y.themeStrength),y.transform!==void 0&&Sr.setTransform(l,y.transform),e.updateState(m,y)},setTheme:()=>{},destroy(){}}}e.fromRenderObject=s})(Nt||(Nt={}));function Jo(e,t,r={}){let n=0,o=new mo,i=Nt.createState(),s=Ic(),a=[],l,c,u=-1,d=Lo.createEmpty(),m=C.getDefaultValues(t.Params),p,h,f;r.modifyState&&Nt.updateState(i,r.modifyState(i));let y=cu.create();function g(_={},w){cu.reset(y),!(!w&&!c)&&(w&&!c?y.createNew=!0:w&&c&&w.id===c.id||(w&&c&&w.id!==c.id?(y.updateTransform=!0,y.createGeometry=!0):w&&console.warn("unexpected state")),_.instanceGranularity!==m.instanceGranularity&&(y.updateTransform=!0),y.updateTransform&&(y.updateColor=!0,y.updateSize=!0,y.updateMatrix=!0),y.createGeometry&&(y.updateColor=!0,y.updateSize=!0))}function v(_={},w){return r.modifyProps&&(_=r.modifyProps(_)),Pe.create("ShapeRepresentation.create",E=>Y(this,null,function*(){let A=Object.assign(m,_),P=w?yield e(E,w,A,c):void 0;if(g(_,P),P&&(c=P,Object.assign(d,Dr.getTheme(c))),y.createNew){a.length=0,h=Dr.groupIterator(c);let T=Dr.createTransform(c.transforms,c.geometry.boundingSphere,A.cellSize,A.batchSize),B=t.createValues(c.geometry,T,h,d,A),D=t.createRenderableState(A);r.modifyState&&Object.assign(D,r.modifyState(D)),Nt.updateState(i,D),l=Gd(c.geometry.kind,B,D,s),l&&a.push(l),f=t.createPositionIterator(c.geometry,l.values)}else{if(!l)throw new Error("expected renderObject to be available");if(y.updateTransform){h=Dr.groupIterator(c);let{instanceCount:T,groupCount:B}=h;_.instanceGranularity?Gn(T,"instance",l.values):Gn(T*B,"groupInstance",l.values)}y.updateMatrix&&(Dr.createTransform(c.transforms,c.geometry.boundingSphere,A.cellSize,A.batchSize,l.values),"lodLevels"in l.values&&I.update(l.values.lodLevels,l.values.lodLevels.ref.value)),y.createGeometry&&(I.updateIfChanged(l.values.drawCount,ii.getDrawCount(c.geometry)),I.updateIfChanged(l.values.uVertexCount,ii.getVertexCount(c.geometry)),I.updateIfChanged(l.values.uGroupCount,ii.getGroupCount(c.geometry))),(y.updateTransform||y.createGeometry)&&(t.updateBoundingSphere(l.values,c.geometry),f=t.createPositionIterator(c.geometry,l.values)),y.updateColor&&Ci(h,f,d.color,l.values),y.updateSize&&"uSize"in l.values&&ja(h,d.size,l.values),t.updateValues(l.values,A),t.updateRenderableState(l.state,A)}m=A,(y.createGeometry||y.createNew)&&(u+=1),o.next(n++)}))}function b(_,w,E){let A=!1;if(!Hs.isLoci(_)||Hs.isLociEmpty(_)||_.shape!==w)return!1;for(let P of _.groups)E(ve.ofSingleton(P.instance))&&(A=!0);return A}function S(_,w){return Fi(_)||Dr.isLoci(_)&&_.shape===c?m.instanceGranularity?w(ve.ofBounds(0,c.transforms.length)):w(ve.ofBounds(0,c.groupCount*c.transforms.length)):m.instanceGranularity?b(_,c,w):kMe(_,c,w)}return{label:"Shape geometry",get groupCount(){return h?h.count:0},get props(){return m},get params(){return p},get state(){return i},get theme(){return d},renderObjects:a,get geometryVersion(){return u},updated:o,createOrUpdate:v,getLoci(_){let{objectId:w,groupId:E,instanceId:A}=_;return l&&l.id===w?Hs.Loci(c,[{ids:Te.ofSingleton(E),instance:A}]):nr},getAllLoci(){return[Dr.Loci(c)]},eachLocation:_=>{for(h.reset();h.hasNext;){let{location:w,isSecondary:E}=h.move();_(w,E)}},mark(_,w){if(!Fo.is(i.markerActions,w))return!1;if(Hs.isLoci(_)||Dr.isLoci(_)){if(_.shape!==c)return!1}else if(!Fi(_))return!1;return Sr.mark(l,_,w,S)},setState(_){r.modifyState&&(_=r.modifyState(_)),l&&(_.visible!==void 0&&Sr.setVisibility(l,_.visible),_.alphaFactor!==void 0&&Sr.setAlphaFactor(l,_.alphaFactor),_.pickable!==void 0&&Sr.setPickable(l,_.pickable),_.colorOnly!==void 0&&Sr.setColorOnly(l,_.colorOnly),_.overpaint!==void 0&&Sr.setOverpaint(l,_.overpaint,S,!0),_.transparency!==void 0&&Sr.setTransparency(l,_.transparency,S,!0),_.substance!==void 0&&Sr.setSubstance(l,_.substance,S,!0),_.transform!==void 0&&Sr.setTransform(l,_.transform)),Nt.updateState(i,_)},setTheme(_){$t&&console.warn("The `ShapeRepresentation` theme is fixed to `ShapeGroupColorTheme` and `ShapeGroupSizeTheme`. Colors are taken from `Shape.getColor` and sizes from `Shape.getSize`")},destroy(){a.length=0,l&&(l.state.disposed=!0,l=void 0)}}}function kMe(e,t,r){if(!Hs.isLoci(e)||e.shape!==t)return!1;let n=!1,{groupCount:o}=t,{groups:i}=e;for(let{ids:s,instance:a}of i)if(ve.is(s)){let l=a*o+ve.start(s),c=a*o+ve.end(s);r(ve.ofBounds(l,c))&&(n=!0)}else for(let l=0,c=s.length;l{t.push(n(o),n(i),n(s))}}}var Yd=(1+Math.sqrt(5))/2,Ine=[-1,Yd,0,1,Yd,0,-1,-Yd,0,1,-Yd,0,0,-1,Yd,0,1,Yd,0,-1,-Yd,0,1,-Yd,Yd,0,-1,Yd,0,1,-Yd,0,-1,-Yd,0,1],RMe=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],LMe=[0,11,5,11,0,5,1,5,0,1,1,7,0,7,7,10,0,10,10,11,5,9,4,11,2,10,6,7,1,8,3,9,4,9,3,4,2,4,2,3,2,6,3,6,6,8,3,8,8,9,4,5,2,11,6,10,7,8,1,9],xO;function Ene(){return xO||(xO=k1(Ine,RMe)),xO}var tNt=of(Ine,LMe);var{vertices:FMe,indices:OMe}=Ene();function sp(e){return 10*Math.pow(Math.pow(2,e),2)+2}function Dne(e){return Pne(FMe,OMe,{detail:e,radius:1})}var kne=new Map,NMe=ne.identity();function UMe(e,t,r){return ne.scaleUniformly(e,ne.fromTranslation(e,t),r)}function bO(e){let t=kne.get(e);return t===void 0&&(t=Dne(e),kne.set(e,t)),t}function Nr(e,t,r,n){rt.addPrimitive(e,UMe(NMe,t,r),bO(n))}var ap={radiusTop:1,radiusBottom:1,height:1,radialSegments:8,heightSegments:1,topCap:!1,bottomCap:!1,thetaStart:0,thetaLength:Math.PI*2};function Mne(e){let{radiusTop:t,radiusBottom:r,height:n,radialSegments:o,heightSegments:i,topCap:s,bottomCap:a,thetaStart:l,thetaLength:c}=k(k({},ap),e),u=[],d=[],m=[],p=0,h=[],f=n/2;return y(),s&&t>0&&g(!0),a&&r>0&&g(!1),{vertices:new Float32Array(d),normals:new Float32Array(m),indices:new Uint32Array(u)};function y(){let v=x.zero(),b=(r-t)/n;for(let S=0;S<=i;++S){let _=[],w=S/i,E=w*(r-t)+t;for(let A=0;A<=o;++A){let T=A/o*c+l,B=Math.sin(T),D=Math.cos(T);d.push(E*B,-w*n+f,E*D),x.normalize(v,x.set(v,B,b,D)),m.push(...v),_.push(p++)}h.push(_)}for(let S=0;SJo(QMe,dt.Utils)},PO=k({},YMe);function KMe(e,t,r){let n=rt.createState(256,128,r),{fromFractional:o}=e.symmetry.spacegroup.cell;x.copy(cp,e.ref),t.attachment==="center"?(x.trunc(cp,cp),x.subScalar(cp,cp,.5)):x.floor(cp,cp),ne.fromTranslation(Qne,cp);let i=_F(CF(jMe),Qne),s=Math.cbrt(e.symmetry.spacegroup.cell.volume)/300*t.cellScale;n.currentGroup=1,rt.addCage(n,o,i,s,2,20);let a=ge.fromDimensionsAndTransform(ge(),x.unit,o);x.transformMat4(cp,cp,o),ge.translate(a,a,cp),ge.expand(a,a,s);let l=rt.getMesh(n);return l.setBoundingSphere(a),l}function QMe(e,t,r,n){let o=KMe(t,r,n&&n.geometry),i=ch.getUnitcellLabel(t.symmetry);return Dr.create(i,t,o,()=>r.cellColor,()=>1,()=>i)}function IO(e,t,r){let n=x();return r.ref==="model"&&x.transformMat4(n,Ut.getCenter(e),t.spacegroup.cell.toFractional),{symmetry:t,ref:n}}function Zne(e,t){return Nt.createMulti("Unit Cell",e,t,Nt.StateBuilder,XMe)}var Kd=new Uint16Array([0,1,2,1,3,2]),V1=je.add3,el=je.add2,$ne=je.add,Kl;(function(e){function t(r={},n=2048,o=1024,i){n*=2,o*=2;let s=je.create(Float32Array,3,o,i?i.centerBuffer.ref.value:n),a=je.create(Float32Array,2,o,i?i.mappingBuffer.ref.value:n),l=je.create(Float32Array,1,o,i?i.depthBuffer.ref.value:n),c=je.create(Uint32Array,3,o,i?i.indexBuffer.ref.value:n),u=je.create(Float32Array,1,o,i?i.groupBuffer.ref.value:n),d=je.create(Float32Array,2,o,i?i.tcoordBuffer.ref.value:n),m=k(k({},C.getDefaultValues(Zi.Params)),r),{attachment:p,background:h,backgroundMargin:f,tether:y,tetherLength:g,tetherBaseWidth:v}=m,b=WJ(m),S=1/2.5*f,_=b.buffer/b.lineHeight,w=(E,A,P,T,B)=>{V1(s,E,A,P),$ne(l,T),$ne(u,B)};return{add:(E,A,P,T,B,D,M)=>{let R=0,U=E.length;for(let W=0;W{let E=b.texture,A=je.compact(s,!0),P=je.compact(a,!0),T=je.compact(l,!0),B=je.compact(c,!0),D=je.compact(u,!0),M=je.compact(d,!0);return Zi.create(E,A,P,T,B,D,M,c.elementCount/2,i)}}}e.create=t})(Kl||(Kl={}));var Rb={granularity:"element",condensed:!1,reverse:!1,countsOnly:!1,hidePrefix:!1,htmlStyling:!0};function Qd(e,t={}){var r;switch(e.kind){case"structure-loci":return e.structure.models.map(d=>d.entry).filter(d=>!!d).join(", ");case"element-loci":return G1($.Stats.ofLoci(e),t);case"bond-loci":let n=e.bonds[0];return n?P_(n,t):"";case"shape-loci":return e.shape.name;case"group-loci":let o=e.groups[0];return o?e.shape.getLabel(Te.start(o.ids),o.instance):"";case"every-loci":return"Everything";case"empty-loci":return"Nothing";case"data-loci":return e.getLabel();case"volume-loci":return e.volume.label||"Volume";case"isosurface-loci":return[`${e.volume.label||"Volume"}`,`Isosurface at ${Je.IsoValue.toString(e.isoValue)}`].join(" | ");case"cell-loci":let i=Te.size(e.indices),s=Te.start(e.indices),a=Je.IsoValue.absolute(e.volume.grid.cells.data[s]),l=Je.IsoValue.toRelative(a,e.volume.grid.stats),c=[`${e.volume.label||"Volume"}`,`${i===1?`Cell #${s}`:`${i} Cells`}`];return i===1&&c.push(`${Je.IsoValue.toString(a)} (${Je.IsoValue.toString(l)})`),c.join(" | ");case"segment-loci":let u=(r=Je.Segmentation.get(e.volume))===null||r===void 0?void 0:r.labels;if(u&&e.segments.length===1){let d=u[e.segments[0]];if(d)return d}return[`${e.volume.label||"Volume"}`,`${e.segments.length===1?`Segment ${e.segments[0]}`:`${e.segments.length} Segments`}`].join(" | ")}}function Bb(e,t){return e===1?`1 ${t}`:`${e} ${t}s`}function T_(e,t,r,n,o,i){return`${Ku(t,{granularity:r,hidePrefix:n,reverse:o,condensed:i})} [+ ${Bb(e-1,`other ${Gp(r)}`)}]`}function ZMe(e){let{elements:t,model:r}=e,{chainAtomSegments:n,residueAtomSegments:o}=r.atomicHierarchy,i=n.offsets[n.index[t[0]]],s=n.offsets[n.index[t[t.length-1]]+1]-1;return o.index[s]-o.index[i]+1}function G1(e,t={}){let r=k(k({},Rb),t),n=$Me(e,r.countsOnly,r.hidePrefix,r.condensed,r.reverse);return r.htmlStyling?n:Hm(n)}function w0(e,t={}){let r=$.Stats.create();for(let n of e)$.Stats.add(r,r,$.Stats.ofLoci(n));return G1(r,t)}function $Me(e,t=!1,r=!1,n=!1,o=!1){let{structureCount:i,chainCount:s,residueCount:a,conformationCount:l,elementCount:c}=e;if(!t&&c===1&&a===0&&s===0)return Ku(e.firstElementLoc,{hidePrefix:r,condensed:n,granularity:"element",reverse:o});if(!t&&c===0&&a===1&&s===0)return Ku(e.firstResidueLoc,{hidePrefix:r,condensed:n,granularity:"residue",reverse:o});if(!t&&c===0&&a===0&&s===1){let{unit:u}=e.firstChainLoc,d=_e.isAtomic(u)&&ZMe(u)===1||_e.Traits.is(u.traits,_e.Trait.MultiChain)?"residue":"chain";return Ku(e.firstChainLoc,{hidePrefix:r,condensed:n,granularity:d,reverse:o})}else if(t){let u=[];return i>0&&u.push(Bb(i,"Structure")),s>0&&u.push(Bb(s,"Chain")),a>0&&u.push(Bb(a,"Residue")),l>0&&u.push(Bb(l,"Conformation")),c>0&&u.push(Bb(c,"Element")),u.join(" + ")}else{let u=[];return i>0&&u.push(i===1?Ku(e.firstStructureLoc,{hidePrefix:r,condensed:n,granularity:"structure",reverse:o}):T_(i,e.firstStructureLoc,"structure",r,o,n)),s>0&&(u.push(s===1?Ku(e.firstChainLoc,{condensed:n,granularity:"chain",hidePrefix:r,reverse:o}):T_(s,e.firstChainLoc,"chain",r,o,n)),r=!0),a>0&&(u.push(a===1?Ku(e.firstResidueLoc,{condensed:n,granularity:"residue",hidePrefix:r,reverse:o}):T_(a,e.firstResidueLoc,"residue",r,o,n)),r=!0),l>0&&(u.push(l===1?Ku(e.firstConformationLoc,{condensed:n,granularity:"conformation",hidePrefix:r,reverse:o}):T_(l,e.firstConformationLoc,"conformation",r,o,n)),r=!0),c>0&&u.push(c===1?Ku(e.firstElementLoc,{condensed:n,granularity:"element",hidePrefix:r,reverse:o}):T_(c,e.firstElementLoc,"element",r,o,n)),u.join(" + ")}}function P_(e,t={}){return bI({loci:[$.Loci(e.aStructure,[{unit:e.aUnit,indices:Te.ofSingleton(e.aIndex)}]),$.Loci(e.bStructure,[{unit:e.bUnit,indices:Te.ofSingleton(e.bIndex)}])]},t)}function bI(e,t={}){let r=k(k({},Rb),t),n=JMe(e,r);return r.htmlStyling?n:Hm(n)}function JMe(e,t){let{granularity:r,hidePrefix:n,reverse:o,condensed:i}=t,s=!0;for(let a of e.loci)if(!$.Loci.is(a)||$.Loci.size(a)!==1){s=!1;break}if(s){let l=e.loci.map(u=>{let{unit:d,indices:m}=u.elements[0];return $.Location.create(u.structure,d,d.elements[Te.start(m)])}).map(u=>Jne(u,r,n,o||i));if(i)return l.map(u=>u[0].replace(/\[.*\]/g,"").trim()).filter(u=>!!u).join(" \u2014 ");let c=0;for(let u=0,d=Math.min(...l.map(m=>m.length))-1;u0){let u=[l[0].join(" | ")];for(let d=1,m=l.length;d!!p).join(" | "));return u.join(" \u2014 ")}else return l.map(u=>u.filter(d=>!!d).join(" | ")).filter(u=>!!u).join("
")}else return e.loci.map(l=>Qd(l,t)).filter(l=>!!l).join(i?" \u2014 ":"
")}function Ku(e,t={}){var r,n;let o=k(k({},Rb),t),i=Jne(e,o.granularity,o.hidePrefix,o.reverse||o.condensed),s=o.condensed?(n=(r=i[0])===null||r===void 0?void 0:r.replace(/\[.*\]/g,"").trim())!==null&&n!==void 0?n:"":i.filter(a=>!!a).join(" | ");return o.htmlStyling?s:Hm(s)}function Jne(e,t="element",r=!1,n=!1){let o=[];if(!r){let i=e.unit.model.entry;i.length>30&&(i=i.substr(0,27)+"\u2026"),o.push(`${i}`),t!=="structure"&&(o.push(`Model ${e.unit.model.modelNum}`),o.push(`Instance ${e.unit.conformation.operator.name}`))}return _e.isAtomic(e.unit)?o.push(...e4e(e,t,n)):_e.isCoarse(e.unit)?o.push(...t4e(e,t)):o.push("Unknown"),n?o.reverse():o}function e4e(e,t,r=!1){let n=$.Location.residueIndex(e),o=Ne.chain.label_asym_id(e),i=Ne.chain.auth_asym_id(e),s=e.unit.model.atomicHierarchy.residues.label_seq_id.valueKind(n)===0,a=Ne.residue.label_seq_id(e),l=Ne.residue.auth_seq_id(e),c=Ne.residue.pdbx_PDB_ins_code(e),u=Ne.atom.label_comp_id(e),d=Ne.atom.label_atom_id(e),m=Ne.atom.label_alt_id(e),p=Ne.atom.occupancy(e),h=Ne.residue.microheterogeneityCompIds(e),f=t==="residue"&&h.length>1?`(${h.join("|")})`:u,y=[];switch(t){case"element":y.push(`${d}${m?`%${m}`:""}`);case"conformation":t==="conformation"&&m&&y.push(`Conformation ${m}`);case"residue":let g=a===l||!s?l:a;y.push(`${f} ${g}${g!==l?` [auth ${l}]`:""}${c||""}`);case"chain":o===i?y.push(`${o}`):t==="chain"&&_e.Traits.is(e.unit.traits,_e.Trait.MultiChain)?y.push(`[auth ${i}]`):y.push(`${o} [auth ${i}]`)}return y.length>0&&p!==1&&!r&&(y[0]=`${y[0]} [occupancy ${Math.round(100*p)/100}]`),y.reverse()}function t4e(e,t){let r=Ne.coarse.asym_id(e),n=Ne.coarse.seq_id_begin(e),o=Ne.coarse.seq_id_end(e),i=[];switch(t){case"element":case"conformation":case"residue":if(n===o){let s=Ne.coarse.entityKey(e),l=e.unit.model.sequence.byEntityKey[s].sequence.compId.value(n-1);i.push(`${l} ${n}`)}else i.push(`${n}-${o}`);case"chain":i.push(`${r}`)}return i.reverse()}function Lb(e,t={}){let r=k(te(k({},Rb),{measureOnly:!1,unitLabel:"\u212B"}),t),[n,o]=e.loci.map(a=>Ht.getCenter(a)),i=`${x.distance(n,o).toFixed(2)} ${r.unitLabel}`;if(r.measureOnly)return i;let s=bI(e,r);return r.condensed?`${i} | ${s}`:`Distance ${i}
${s}`}function Fb(e,t={}){let r=k(te(k({},Rb),{measureOnly:!1}),t),[n,o,i]=e.loci.map(u=>Ht.getCenter(u)),s=x.sub(x(),n,o),a=x.sub(x(),i,o),l=`${Fs(x.angle(s,a)).toFixed(2)}\xB0`;if(r.measureOnly)return l;let c=bI(e,r);return r.condensed?`${l} | ${c}`:`Angle ${l}
${c}`}function Ob(e,t={}){let r=k(te(k({},Rb),{measureOnly:!1}),t),[n,o,i,s]=e.loci.map(c=>Ht.getCenter(c)),a=`${Fs(x.dihedralAngle(n,o,i,s)).toFixed(2)}\xB0`;if(r.measureOnly)return a;let l=bI(e,r);return r.condensed?`${a} | ${l}`:`Dihedral ${a}
${l}`}var EO={customText:C.Text("",{label:"Text",description:"Override the label with custom value.",isEssential:!0}),textColor:C.Color(Yt.black,{isEssential:!0}),textSize:C.Numeric(.5,{min:.1,max:10,step:.1},{isEssential:!0})},A0=te(k(k({},Zi.Params),EO),{borderWidth:C.Numeric(.2,{min:0,max:.5,step:.01})});var eoe={unitLabel:C.Text("\u212B",{isEssential:!0})},r4e=te(k(k({},hn.Params),eoe),{lineSizeAttenuation:C.Boolean(!0),linesColor:C.Color(Yt.lightgreen,{isEssential:!0}),linesSize:C.Numeric(.075,{min:.01,max:5,step:.01}),dashLength:C.Numeric(.2,{min:.01,max:.2,step:.01})}),n4e=k(k({},A0),eoe),toe={lines:(e,t)=>Jo(s4e,hn.Utils,{modifyState:r=>te(k({},r),{markerActions:Fo.Highlighting})}),text:(e,t)=>Jo(l4e,Zi.Utils,{modifyState:r=>te(k({},r),{markerActions:Ft.None})})},DO=te(k(k({},r4e),n4e),{visuals:C.MultiSelect(["lines","text"],C.objectToOptions(toe))});function o4e(){return{sphereA:ge(),sphereB:ge(),center:x(),distance:0}}function roe(e,t){let{sphereA:r,sphereB:n,center:o}=t,[i,s]=e.loci;return Ht.getBoundingSphere(i,r),Ht.getBoundingSphere(s,n),x.add(o,r.center,n.center),x.scale(o,o,.5),t.distance=x.distance(r.center,n.center),t}var I_=o4e();function noe(e,t){return e.pairs.length===1?`Distance ${Lb(e.pairs[0],{unitLabel:t,measureOnly:!0})}`:`${e.pairs.length} Distances`}function i4e(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.pairs.length;oLb(t.pairs[a],r);return Dr.create(i,t,o,()=>r.linesColor,()=>r.linesSize,s)}function a4e(e,t,r){let n=Kl.create(t,128,64,r);for(let o=0,i=e.pairs.length;oLb(t.pairs[a],r);return Dr.create(i,t,o,()=>r.textColor,()=>r.textSize,s)}function ooe(e,t){return Nt.createMulti("Distance",e,t,Nt.StateBuilder,toe)}function kO(e){let t=e[0].loci,r=e[1].loci;return{pairs:[{loci:[t,r]}]}}function MO(e){let t=e[0].loci,r=e[1].loci,n=e[2].loci;return{triples:[{loci:[t,r,n]}]}}function BO(e){let t=e[0].loci,r=e[1].loci,n=e[2].loci,o=e[3].loci;return{quads:[{loci:[t,r,n,o]}]}}function RO(e){return{infos:[{loci:e[0].loci}]}}function LO(e){return{locis:e.map(t=>t.loci)}}function FO(e){return{locis:e.map(t=>t.loci)}}var c4e=k({},A0),ioe={text:(e,t)=>Jo(p4e,Zi.Utils)},OO=te(k({},c4e),{scaleByRadius:C.Boolean(!0),visuals:C.MultiSelect(["text"],C.objectToOptions(ioe)),snapshotKey:C.Text("",{isEssential:!0,disableInteractiveUpdates:!0,description:"Activate the snapshot with the provided key when clicking on the label"}),tooltip:C.Text("",{isEssential:!0,multiline:!0,disableInteractiveUpdates:!0,placeholder:"Tooltip",description:"Tooltip text to be displayed when hovering over the label"})}),u4e=ge();function NO(e,t=!1){return e.label||Qd(e.loci,{hidePrefix:!0,htmlStyling:!1,condensed:t})}function d4e(e){return e.infos.length===1?NO(e.infos[0]):`${e.infos.length} Labels`}function m4e(e,t,r){let n=Kl.create(t,128,64,r),o=t.customText.trim();for(let i=0,s=e.infos.length;il:c?u=d=>c:u=d=>NO(t.infos[d]),Dr.create(a,t,s,()=>r.textColor,()=>r.textSize,u)}function soe(e,t){return Nt.createMulti("Label",e,t,Nt.StateBuilder,ioe)}var H1=x(),f4e=ne.identity(),j1=new Float32Array(6*3),h4e=new Uint8Array([0,1,2,3,4,5]);function aoe(e,t,r,n,o){let{origin:i,dirA:s,dirB:a,dirC:l}=t;x.add(H1,i,s),x.toArray(x.add(H1,i,s),j1,0),x.toArray(x.sub(H1,i,s),j1,3),x.toArray(x.add(H1,i,a),j1,6),x.toArray(x.sub(H1,i,a),j1,9),x.toArray(x.add(H1,i,l),j1,12),x.toArray(x.sub(H1,i,l),j1,15);let c=of(j1,h4e),u=Ei.volume(t),d=Math.cbrt(u)/300*r;rt.addCage(e,f4e,c,d,n,o)}var eUt=x.zero(),tUt=x.zero();var T0=x(),g4e=x(),y4e=x(),v4e=x(),x4e=ne.identity(),loe=new Float32Array(8*3),b4e=new Uint8Array([0,1,0,3,0,6,1,2,1,7,2,3,2,4,3,5,4,5,4,7,5,6,6,7]);function coe(e,t,r,n,o){let{origin:i,dirA:s,dirB:a,dirC:l}=t,c=x.negate(g4e,s),u=x.negate(y4e,a),d=x.negate(v4e,l),m=0,p=function(g,v,b){x.copy(T0,i),x.add(T0,T0,g),x.add(T0,T0,v),x.add(T0,T0,b),x.toArray(T0,loe,m),m+=3};p(s,a,l),p(s,a,d),p(s,u,d),p(s,u,l),p(c,u,d),p(c,u,l),p(c,a,l),p(c,a,d);let h=of(loe,b4e),f=Ei.volume(t),y=Math.cbrt(f)/300*r;rt.addCage(e,x4e,h,y,n,o)}var S4e=ne.identity(),uoe=x();function C4e(e,t,r,n,o){return x.add(uoe,t,r),ne.targetTo(e,t,uoe,n),ne.setTranslation(e,t),ne.scale(e,e,o)}function Nb(e,t,r,n,o,i){rt.addPrimitive(e,C4e(S4e,t,r,n,o),bO(i))}var UO={color:C.Color(Yt.orange),scaleFactor:C.Numeric(1,{min:.1,max:10,step:.1}),radiusScale:C.Numeric(2,{min:.1,max:10,step:.1})},_4e=k(k({},dt.Params),UO),w4e=k(k({},dt.Params),UO),A4e=k(k({},dt.Params),UO),doe={axes:(e,t)=>Jo(I4e,dt.Utils),box:(e,t)=>Jo(k4e,dt.Utils),ellipsoid:(e,t)=>Jo(R4e,dt.Utils)},zO=te(k(k(k({},_4e),w4e),A4e),{visuals:C.MultiSelect(["box"],C.objectToOptions(doe))});function T4e(e){return`Principal Axes of ${w0(e,{countsOnly:!0})}`}function P4e(e,t,r){let n=rt.createState(256,128,r),o=$.Loci.getPrincipalAxesMany(e.locis);return Ei.scale(o.momentsAxes,o.momentsAxes,t.scaleFactor),n.currentGroup=0,aoe(n,o.momentsAxes,t.radiusScale,2,20),rt.getMesh(n)}function I4e(e,t,r,n){let o=P4e(t,r,n&&n.geometry),i=T4e(t.locis);return Dr.create(i,t,o,()=>r.color,()=>1,()=>i)}function E4e(e){return`Oriented Box of ${w0(e,{countsOnly:!0})}`}function D4e(e,t,r){let n=rt.createState(256,128,r),o=$.Loci.getPrincipalAxesMany(e.locis);return Ei.scale(o.boxAxes,o.boxAxes,t.scaleFactor),n.currentGroup=0,coe(n,o.boxAxes,t.radiusScale,2,20),rt.getMesh(n)}function k4e(e,t,r,n){let o=D4e(t,r,n&&n.geometry),i=E4e(t.locis);return Dr.create(i,t,o,()=>r.color,()=>1,()=>i)}function M4e(e){return`Oriented Ellipsoid of ${w0(e,{countsOnly:!0})}`}function B4e(e,t,r){let n=rt.createState(256,128,r),i=$.Loci.getPrincipalAxesMany(e.locis).boxAxes,{origin:s,dirA:a,dirB:l}=i,c=Ei.size(x(),i);x.scale(c,c,.5*t.scaleFactor);let u=x.create(c[2],c[1],c[0]);return n.currentGroup=0,Nb(n,s,a,l,u,2),rt.getMesh(n)}function R4e(e,t,r,n){let o=B4e(t,r,n&&n.geometry),i=M4e(t.locis);return Dr.create(i,t,o,()=>r.color,()=>1,()=>i)}function moe(e,t){let r=Nt.createMulti("Orientation",e,t,Nt.StateBuilder,doe);return r.setState({markerActions:Fo.Highlighting}),r}var L4e={radius:1,segments:36,thetaStart:0,thetaLength:Math.PI*2};function SI(e){let{radius:t,segments:r,thetaStart:n,thetaLength:o}=k(k({},L4e),e),i=o===Math.PI*2,s=i?r+1:r+2,a=new Float32Array(s*3),l=new Float32Array(s*3),c=new Uint32Array(r*3);a[0]=0,a[1]=0,a[2]=0,l[0]=0,l[1]=1,l[2]=0;for(let u=0,d=3;uJo(V4e,hn.Utils,{modifyState:r=>te(k({},r),{pickable:!1})}),arc:(e,t)=>Jo(H4e,hn.Utils,{modifyState:r=>te(k({},r),{pickable:!1})}),sector:(e,t)=>Jo(q4e,dt.Utils,{modifyProps:r=>te(k({},r),{alpha:r.sectorOpacity}),modifyState:r=>te(k({},r),{markerActions:Fo.Highlighting})}),text:(e,t)=>Jo(Y4e,Zi.Utils,{modifyState:r=>te(k({},r),{markerActions:Ft.None})})},VO=te(k(k(k(k({},F4e),O4e),N4e),A0),{visuals:C.MultiSelect(["vectors","sector","text"],C.objectToOptions(hoe))});function U4e(){return{sphereA:ge(),sphereB:ge(),sphereC:ge(),arcDirA:x(),arcDirC:x(),arcNormal:x(),radius:0,angle:0}}var P0=x(),E_=ne();function CI(e,t,r){let{sphereA:n,sphereB:o,sphereC:i}=t,{arcDirA:s,arcDirC:a,arcNormal:l}=t,[c,u,d]=e.loci;Ht.getBoundingSphere(c,n),Ht.getBoundingSphere(u,o),Ht.getBoundingSphere(d,i),x.sub(s,n.center,o.center),x.sub(a,i.center,o.center),x.cross(l,s,a);let p=Math.min(x.magnitude(s),x.magnitude(a))*r;return t.radius=p,t.angle=x.angle(s,a),t}function goe(e,t){let{radius:r,angle:n}=e,o=t?hA(n,r)/t:32;ne.targetTo(E_,e.sphereB.center,e.sphereA.center,e.arcNormal),ne.setTranslation(E_,e.sphereB.center),ne.mul(E_,E_,ne.rotY180);let i=SI({radius:r,thetaLength:n,segments:o});return mb(i,E_)}var tl=U4e();function _I(e){return e.triples.length===1?`Angle ${Fb(e.triples[0],{measureOnly:!0})}`:`${e.triples.length} Angles`}function z4e(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.triples.length;or.color,()=>r.linesSize,()=>"")}function G4e(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.triples.length;or.color,()=>r.linesSize,()=>"")}function j4e(e,t,r){let n=rt.createState(128,64,r);for(let o=0,i=e.triples.length;oFb(t.triples[a]);return Dr.create(i,t,o,()=>r.color,()=>1,s)}function W4e(e,t,r){let n=Kl.create(t,128,64,r);for(let o=0,i=e.triples.length;oFb(t.triples[a]);return Dr.create(i,t,o,()=>r.textColor,()=>r.textSize,s)}function yoe(e,t){return Nt.createMulti("Angle",e,t,Nt.StateBuilder,hoe)}var voe={color:C.Color(Yt.lightgreen),arcScale:C.Numeric(.7,{min:.01,max:1,step:.01})},wI=te(k(k({},hn.Params),voe),{lineSizeAttenuation:C.Boolean(!0),linesSize:C.Numeric(.04,{min:.01,max:5,step:.01}),dashLength:C.Numeric(.04,{min:.01,max:.2,step:.01})}),X4e=k({},wI),K4e=k({},wI),Q4e=k({},wI),Z4e=k({},wI),$4e=te(k(k({},dt.Params),voe),{ignoreLight:C.Boolean(!0),sectorOpacity:C.Numeric(.75,{min:0,max:1,step:.01})}),xoe={vectors:(e,t)=>Jo(tBe,hn.Utils,{modifyState:r=>te(k({},r),{pickable:!1})}),extenders:(e,t)=>Jo(aBe,hn.Utils,{modifyState:r=>te(k({},r),{pickable:!1})}),connector:(e,t)=>Jo(nBe,hn.Utils,{modifyState:r=>te(k({},r),{pickable:!1})}),arms:(e,t)=>Jo(iBe,hn.Utils,{modifyState:r=>te(k({},r),{pickable:!1})}),arc:(e,t)=>Jo(cBe,hn.Utils,{modifyState:r=>te(k({},r),{pickable:!1})}),sector:(e,t)=>Jo(dBe,dt.Utils,{modifyProps:r=>te(k({},r),{alpha:r.sectorOpacity}),modifyState:r=>te(k({},r),{markerActions:Fo.Highlighting})}),text:(e,t)=>Jo(pBe,Zi.Utils,{modifyState:r=>te(k({},r),{markerActions:Ft.None})})},GO=te(k(k(k(k(k(k({},X4e),K4e),Q4e),Z4e),$4e),A0),{visuals:C.MultiSelect(["extenders","arms","sector","text"],C.objectToOptions(xoe))});function J4e(){return{sphereA:ge(),sphereB:ge(),sphereC:ge(),sphereD:ge(),dirBA:x(),dirCD:x(),projA:x(),projD:x(),arcPointA:x(),arcPointD:x(),arcDirA:x(),arcDirD:x(),arcCenter:x(),arcNormal:x(),radius:0,angle:0}}var Ql=x(),D_=ne();function q1(e,t,r){let{sphereA:n,sphereB:o,sphereC:i,sphereD:s,dirBA:a,dirCD:l,projA:c,projD:u}=t,{arcPointA:d,arcPointD:m,arcDirA:p,arcDirD:h,arcCenter:f,arcNormal:y}=t,[g,v,b,S]=e.loci;Ht.getBoundingSphere(g,n),Ht.getBoundingSphere(v,o),Ht.getBoundingSphere(b,i),Ht.getBoundingSphere(S,s),x.add(f,o.center,i.center),x.scale(f,f,.5),x.sub(a,n.center,o.center),x.sub(l,s.center,i.center),x.add(d,f,a),x.add(m,f,l),x.sub(y,i.center,o.center),x.orthogonalize(p,y,a),x.orthogonalize(h,y,l),x.projectPointOnVector(c,d,p,f),x.projectPointOnVector(u,m,h,f);let w=Math.min(x.distance(c,f),x.distance(u,f))*r;x.setMagnitude(p,p,w),x.setMagnitude(h,h,w),x.add(d,f,p),x.add(m,f,h),t.radius=w,t.angle=x.dihedralAngle(n.center,o.center,i.center,s.center),x.matchDirection(Ql,y,x.sub(Ql,d,n.center));let E=x.angle(a,Ql),A=w/Math.cos(E-r1);x.add(c,o.center,x.setMagnitude(Ql,a,A)),x.matchDirection(Ql,y,x.sub(Ql,m,s.center));let P=x.angle(l,Ql),T=w/Math.cos(P-r1);return x.add(u,i.center,x.setMagnitude(Ql,l,T)),t}function boe(e,t){let{radius:r,angle:n}=e,o=t?hA(n,r)/t:32;ne.targetTo(D_,e.arcCenter,n<0?e.arcPointD:e.arcPointA,e.arcNormal),ne.setTranslation(D_,e.arcCenter),ne.mul(D_,D_,ne.rotY180);let i=SI({radius:r,thetaLength:Math.abs(n),segments:o});return mb(i,D_)}var Po=J4e();function W1(e){return e.quads.length===1?`Dihedral ${Ob(e.quads[0],{measureOnly:!0})}`:`${e.quads.length} Dihedrals`}function eBe(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.quads.length;or.color,()=>r.linesSize,()=>"")}function rBe(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.quads.length;or.color,()=>r.linesSize,()=>"")}function oBe(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.quads.length;or.color,()=>r.linesSize,()=>"")}function sBe(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.quads.length;or.color,()=>r.linesSize,()=>"")}function lBe(e,t,r){let n=Gs.create(128,64,r);for(let o=0,i=e.quads.length;or.color,()=>r.linesSize,()=>"")}function uBe(e,t,r){let n=rt.createState(128,64,r);for(let o=0,i=e.quads.length;oOb(t.quads[a]);return Dr.create(i,t,o,()=>r.color,()=>1,s)}function mBe(e,t,r){let n=Kl.create(t,128,64,r);for(let o=0,i=e.quads.length;oOb(t.quads[a]);return Dr.create(i,t,o,()=>r.textColor,()=>r.textSize,s)}function Soe(e,t){return Nt.createMulti("Dihedral",e,t,Nt.StateBuilder,xoe)}var HO={};hi(HO,{BoxShape3D:()=>fBe,getBoxMesh:()=>AI});var fBe=Mt.BuiltIn({name:"box-shape-3d",display:"Box Shape",from:ae.Root,to:ae.Shape.Provider,params:{bottomLeft:C.Vec3(x()),topRight:C.Vec3(x.create(1,1,1)),radius:C.Numeric(.15,{min:.01,max:4,step:.01}),color:C.Color(Yt.red)}})({canAutoUpdate(){return!0},apply({params:e}){return Pe.create("Shape Representation",t=>Y(this,null,function*(){return new ae.Shape.Provider({label:"Box",data:e,params:dt.Params,getShape:(r,n)=>{let o=AI(ft.create(e.bottomLeft,e.topRight),e.radius);return Dr.create("Box",n,o,()=>n.color,()=>1,()=>"Box")},geometryUtils:dt.Utils},{label:"Box"})}))}});function AI(e,t,r){let n=x.sub(x(),e.max,e.min),o=ne.fromTranslation(ne(),x.create(.5,.5,.5)),i=ne.fromScaling(ne(),n),s=ne.fromTranslation(ne(),e.min),a=ne.mul3(ne(),s,i,o),l=rt.createState(256,128,r);l.currentGroup=1,rt.addCage(l,a,BP(),t,2,20);let c=rt.getMesh(l),u=x.scaleAndAdd(x(),e.min,n,.5),d=x.distance(e.min,u);return c.setBoundingSphere(ge.create(u,d)),c}var Coe={vertices:new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]),normals:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1]),indices:new Uint32Array([0,2,1,1,2,3])},P8t={vertices:Coe.vertices,edges:new Uint32Array([0,1,2,3,3,1,2,0])};function _oe(){return Coe}var hBe=te(k({},dt.Params),{color:C.Color(Yt.orange),scaleFactor:C.Numeric(1,{min:.1,max:10,step:.1})}),woe={plane:(e,t)=>Jo(vBe,dt.Utils)},qO=te(k({},hBe),{visuals:C.MultiSelect(["plane"],C.objectToOptions(woe))});function gBe(e){return`Best Fit Plane of ${w0(e,{countsOnly:!0})}`}var I0=ne(),jO=x();function yBe(e,t,r){let n=rt.createState(256,128,r),i=$.Loci.getPrincipalAxesMany(e.locis).boxAxes,s=_oe();return x.add(jO,i.origin,i.dirC),ne.targetTo(I0,jO,i.origin,i.dirB),ne.scale(I0,I0,Ei.size(jO,i)),ne.scaleUniformly(I0,I0,t.scaleFactor),ne.setTranslation(I0,i.origin),n.currentGroup=0,rt.addPrimitive(n,I0,s),rt.addPrimitiveFlipped(n,I0,s),rt.getMesh(n)}function vBe(e,t,r,n){let o=yBe(t,r,n&&n.geometry),i=gBe(t.locis);return Dr.create(i,t,o,()=>r.color,()=>1,()=>i)}function Aoe(e,t){let r=Nt.createMulti("Plane",e,t,Nt.StateBuilder,woe);return r.setState({markerActions:Fo.Highlighting}),r}var Ub=Mt.BuiltIn({name:"structure-representation-3d",display:"3D Representation",from:ae.Molecule.Structure,to:ae.Molecule.Structure.Representation3D,params:(e,t)=>{let{registry:r,themes:n}=t.representation.structure,o=r.get(r.default.name);if(!e){let a={help:l=>{let{name:c,params:u}=l,m=n.colorThemeRegistry.get(c).factory({},u);return{description:m.description,legend:m.legend}}};return{type:C.Mapped(r.default.name,r.types,l=>C.Group(r.get(l).getParams(n,Me.Empty))),colorTheme:C.Mapped(o.defaultColorTheme.name,n.colorThemeRegistry.types,l=>C.Group(n.colorThemeRegistry.get(l).getParams({structure:Me.Empty})),a),sizeTheme:C.Mapped(o.defaultSizeTheme.name,n.sizeThemeRegistry.types,l=>C.Group(n.sizeThemeRegistry.get(l).getParams({structure:Me.Empty})))}}let i={structure:e.data},s={help:a=>{let{name:l,params:c}=a,d=n.colorThemeRegistry.get(l).factory(i,c);return{description:d.description,legend:d.legend}}};return{type:C.Mapped(r.default.name,r.getApplicableTypes(e.data),a=>C.Group(r.get(a).getParams(n,e.data))),colorTheme:C.Mapped(o.defaultColorTheme.name,n.colorThemeRegistry.getApplicableTypes(i),a=>C.Group(n.colorThemeRegistry.get(a).getParams(i)),s),sizeTheme:C.Mapped(o.defaultSizeTheme.name,n.sizeThemeRegistry.getApplicableTypes(i),a=>C.Group(n.sizeThemeRegistry.get(a).getParams(i)))}}})({canAutoUpdate({a:e,oldParams:t,newParams:r}){return e.data.elementCount<1e4||t.type.name===r.type.name&&r.type.params.quality!=="custom"},apply({a:e,params:t,cache:r},n){return Pe.create("Structure Representation",o=>Y(this,null,function*(){var i,s;let a={runtime:o,assetManager:n.managers.asset},l=n.representation.structure.registry.get(t.type.name),c=((i=l.getData)===null||i===void 0?void 0:i.call(l,e.data,t.type.params))||e.data;l.ensureCustomProperties&&(yield l.ensureCustomProperties.attach(a,c));let u=l.factory(k({webgl:(s=n.canvas3d)===null||s===void 0?void 0:s.webgl},n.representation.structure.themes),l.getParams);yield Lo.ensureDependencies(a,n.representation.structure.themes,{structure:c},t),u.setTheme(Lo.create(n.representation.structure.themes,{structure:c},t));let d=t.type.params||{};return yield u.createOrUpdate(d,c).runInContext(o),new ae.Molecule.Structure.Representation3D({repr:u,sourceData:e.data},{label:l.label})}))},update({a:e,b:t,oldParams:r,newParams:n,cache:o},i){return Pe.create("Structure Representation",s=>Y(this,null,function*(){var a,l;if(n.type.name!==r.type.name)return $e.UpdateResult.Recreate;let c=i.representation.structure.registry.get(n.type.name);if(!((a=c.mustRecreate)===null||a===void 0)&&a.call(c,r.type.params,n.type.params))return $e.UpdateResult.Recreate;let u=((l=c.getData)===null||l===void 0?void 0:l.call(c,e.data,n.type.params))||e.data,d={runtime:s,assetManager:i.managers.asset};c.ensureCustomProperties&&(yield c.ensureCustomProperties.attach(d,u)),Lo.releaseDependencies(i.representation.structure.themes,{structure:t.data.sourceData},r),yield Lo.ensureDependencies(d,i.representation.structure.themes,{structure:u},n),t.data.repr.setTheme(Lo.create(i.representation.structure.themes,{structure:u},n));let m=k(k({},t.data.repr.props),n.type.params);return yield t.data.repr.createOrUpdate(m,u).runInContext(s),t.data.sourceData=e.data,$e.UpdateResult.Updated}))},dispose({b:e,params:t},r){if(!e||!t)return;let n=e.data.sourceData,o=r.representation.structure.registry.get(t.type.name);o.ensureCustomProperties&&o.ensureCustomProperties.detach(n),Lo.releaseDependencies(r.representation.structure.themes,{structure:n},t)},interpolate(e,t,r){if(e.colorTheme.name!=="uniform"||t.colorTheme.name!=="uniform")return r<=.5?e:t;let n=e.colorTheme.params.value,o=t.colorTheme.params.value,i=Oe.interpolate(n,o,r);return{type:r<=.5?e.type:t.type,colorTheme:{name:"uniform",params:{value:i}},sizeTheme:r<=.5?e.sizeTheme:t.sizeTheme}}}),xBe=Mt.BuiltIn({name:"unwind-structure-assembly-representation-3d",display:"Unwind Assembly 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:{t:C.Numeric(0,{min:0,max:1,step:.01})}})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=new kh(r);return hO(r,n,t.t),new ae.Molecule.Structure.Representation3DState({state:{unitTransforms:n},initialState:{unitTransforms:new kh(r)},info:r,repr:e.data.repr},{label:`Unwind T = ${t.t.toFixed(2)}`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info;if(e.data.sourceData!==o)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;if(n.t===r.t)return $e.UpdateResult.Unchanged;let i=t.data.state.unitTransforms;return hO(o,i,r.t),t.label=`Unwind T = ${r.t.toFixed(2)}`,t.data.repr=e.data.repr,$e.UpdateResult.Updated}}),bBe=Mt.BuiltIn({name:"explode-structure-representation-3d",display:"Explode 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:{t:C.Numeric(0,{min:0,max:1,step:.01})}})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=new kh(r);return gO(r,n,t.t,r.root.boundary.sphere),new ae.Molecule.Structure.Representation3DState({state:{unitTransforms:n},initialState:{unitTransforms:new kh(r)},info:r,repr:e.data.repr},{label:`Explode T = ${t.t.toFixed(2)}`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=e.data.sourceData;if(t.data.info!==o)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;if(n.t===r.t)return $e.UpdateResult.Unchanged;let i=t.data.state.unitTransforms;return gO(o,i,r.t,o.root.boundary.sphere),t.label=`Explode T = ${r.t.toFixed(2)}`,t.data.repr=e.data.repr,$e.UpdateResult.Updated}}),SBe=Mt.BuiltIn({name:"spin-structure-representation-3d",display:"Spin 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:k({t:C.Numeric(0,{min:0,max:1,step:.01})},Tne)})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=new kh(r),{axis:o,origin:i}=yO(r.root,t);return vO(r,n,t.t,o,i),new ae.Molecule.Structure.Representation3DState({state:{unitTransforms:n},initialState:{unitTransforms:new kh(r)},info:r,repr:e.data.repr},{label:`Spin T = ${t.t.toFixed(2)}`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=e.data.sourceData;if(t.data.info!==o)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;if(n.t===r.t&&n.axis===r.axis&&n.origin===r.origin)return $e.UpdateResult.Unchanged;let i=t.data.state.unitTransforms,{axis:s,origin:a}=yO(o.root,r);return vO(o,i,r.t,s,a),t.label=`Spin T = ${r.t.toFixed(2)}`,t.data.repr=e.data.repr,$e.UpdateResult.Updated}}),CBe=Mt.BuiltIn({name:"overpaint-structure-representation-3d-from-script",display:"Overpaint 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({script:C.Script(eo("(sel.atom.all)","mol-script")),color:C.Color(Yt.blueviolet),clear:C.Boolean(!1)},e=>`${e.clear?"Clear":Oe.toRgbString(e.color)}`,{defaultValue:[{script:eo("(sel.atom.all)","mol-script"),color:Yt.blueviolet,clear:!1}]})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=ai.ofScript(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{overpaint:o},initialState:{overpaint:ai.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Overpaint (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.overpaint,l=ai.ofScript(r.layers,i);return ai.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.overpaint=l,t.data.repr=e.data.repr,t.label=`Overpaint (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),_Be=Mt.BuiltIn({name:"overpaint-structure-representation-3d-from-bundle",display:"Overpaint 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({bundle:C.Value($.Bundle.Empty),color:C.Color(Yt.blueviolet),clear:C.Boolean(!1)},e=>`${e.clear?"Clear":Oe.toRgbString(e.color)}`,{defaultValue:[{bundle:$.Bundle.Empty,color:Yt.blueviolet,clear:!1}],isHidden:!0})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=ai.ofBundle(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{overpaint:o},initialState:{overpaint:ai.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Overpaint (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.overpaint,l=ai.ofBundle(r.layers,i);return ai.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.overpaint=l,t.data.repr=e.data.repr,t.label=`Overpaint (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),wBe=Mt.BuiltIn({name:"transparency-structure-representation-3d-from-script",display:"Transparency 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({script:C.Script(eo("(sel.atom.all)","mol-script")),value:C.Numeric(.5,{min:0,max:1,step:.01},{label:"Transparency"})},e=>`Transparency (${e.value})`,{defaultValue:[{script:eo("(sel.atom.all)","mol-script"),value:.5}]})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=hs.ofScript(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{transparency:o},initialState:{transparency:hs.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Transparency (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.transparency,l=hs.ofScript(r.layers,i);return hs.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.transparency=l,t.data.repr=e.data.repr,t.label=`Transparency (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),ABe=Mt.BuiltIn({name:"transparency-structure-representation-3d-from-bundle",display:"Transparency 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({bundle:C.Value($.Bundle.Empty),value:C.Numeric(.5,{min:0,max:1,step:.01},{label:"Transparency"})},e=>`Transparency (${e.value})`,{defaultValue:[{bundle:$.Bundle.Empty,value:.5}],isHidden:!0})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=hs.ofBundle(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{transparency:o},initialState:{transparency:hs.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Transparency (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.transparency,l=hs.ofBundle(r.layers,i);return hs.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.transparency=l,t.data.repr=e.data.repr,t.label=`Transparency (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),TBe=Mt.BuiltIn({name:"emissive-structure-representation-3d-from-script",display:"Emissive 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({script:C.Script(eo("(sel.atom.all)","mol-script")),value:C.Numeric(.5,{min:0,max:1,step:.01},{label:"Emissive"})},e=>`Emissive (${e.value})`,{defaultValue:[{script:eo("(sel.atom.all)","mol-script"),value:.5}]})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=ys.ofScript(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{emissive:o},initialState:{emissive:ys.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Emissive (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.emissive,l=ys.ofScript(r.layers,i);return ys.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.emissive=l,t.data.repr=e.data.repr,t.label=`Emissive (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),PBe=Mt.BuiltIn({name:"emissive-structure-representation-3d-from-bundle",display:"Emissive 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({bundle:C.Value($.Bundle.Empty),value:C.Numeric(.5,{min:0,max:1,step:.01},{label:"Emissive"})},e=>`Emissive (${e.value})`,{defaultValue:[{bundle:$.Bundle.Empty,value:.5}],isHidden:!0})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=ys.ofBundle(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{emissive:o},initialState:{emissive:ys.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Emissive (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.emissive,l=ys.ofBundle(r.layers,i);return ys.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.emissive=l,t.data.repr=e.data.repr,t.label=`Emissive (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),IBe=Mt.BuiltIn({name:"substance-structure-representation-3d-from-script",display:"Substance 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({script:C.Script(eo("(sel.atom.all)","mol-script")),material:ds.getParam(),clear:C.Boolean(!1)},e=>`${e.clear?"Clear":ds.toString(e.material)}`,{defaultValue:[{script:eo("(sel.atom.all)","mol-script"),material:ds({roughness:1}),clear:!1}]})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=gs.ofScript(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{substance:o},initialState:{substance:gs.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Substance (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.substance,l=gs.ofScript(r.layers,i);return gs.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.substance=l,t.data.repr=e.data.repr,t.label=`Substance (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),EBe=Mt.BuiltIn({name:"substance-structure-representation-3d-from-bundle",display:"Substance 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({bundle:C.Value($.Bundle.Empty),material:ds.getParam(),clear:C.Boolean(!1)},e=>`${e.clear?"Clear":ds.toString(e.material)}`,{defaultValue:[{bundle:$.Bundle.Empty,material:ds({roughness:1}),clear:!1}],isHidden:!0})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=e.data.repr.geometryVersion,o=gs.ofBundle(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{substance:o},initialState:{substance:gs.Empty},info:{structure:r,geometryVersion:n},repr:e.data.repr},{label:`Substance (${o.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info,i=e.data.sourceData;if(i!==o.structure)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let s=e.data.repr.geometryVersion;if(s!==o.geometryVersion&&iu(e.data.repr.props))return $e.UpdateResult.Recreate;let a=t.data.state.substance,l=gs.ofBundle(r.layers,i);return gs.areEqual(a,l)?$e.UpdateResult.Unchanged:(o.geometryVersion=s,t.data.state.substance=l,t.data.repr=e.data.repr,t.label=`Substance (${l.layers.length} Layers)`,$e.UpdateResult.Updated)}}),DBe=Mt.BuiltIn({name:"clipping-structure-representation-3d-from-script",display:"Clipping 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({script:C.Script(eo("(sel.atom.all)","mol-script")),groups:C.Converted(e=>qn.Groups.toNames(e),e=>qn.Groups.fromNames(e),C.MultiSelect(n1(qn.Groups.Names),C.objectToOptions(qn.Groups.Names)))},e=>`${qn.Groups.toNames(e.groups).length} group(s)`,{defaultValue:[{script:eo("(sel.atom.all)","mol-script"),groups:qn.Groups.Flag.None}]})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=qn.ofScript(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{clipping:n},initialState:{clipping:qn.Empty},info:r,repr:e.data.repr},{label:`Clipping (${n.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info;if(e.data.sourceData!==o)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let i=t.data.state.clipping,s=qn.ofScript(r.layers,o);return qn.areEqual(i,s)?$e.UpdateResult.Unchanged:(t.data.state.clipping=s,t.data.repr=e.data.repr,t.label=`Clipping (${s.layers.length} Layers)`,$e.UpdateResult.Updated)}}),kBe=Mt.BuiltIn({name:"clipping-structure-representation-3d-from-bundle",display:"Clipping 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({layers:C.ObjectList({bundle:C.Value($.Bundle.Empty),groups:C.Converted(e=>qn.Groups.toNames(e),e=>qn.Groups.fromNames(e),C.MultiSelect(n1(qn.Groups.Names),C.objectToOptions(qn.Groups.Names)))},e=>`${qn.Groups.toNames(e.groups).length} group(s)`,{defaultValue:[{bundle:$.Bundle.Empty,groups:qn.Groups.Flag.None}],isHidden:!0})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){let r=e.data.sourceData,n=qn.ofBundle(t.layers,r);return new ae.Molecule.Structure.Representation3DState({state:{clipping:n},initialState:{clipping:qn.Empty},info:r,repr:e.data.repr},{label:`Clipping (${n.layers.length} Layers)`})},update({a:e,b:t,newParams:r,oldParams:n}){let o=t.data.info;if(e.data.sourceData!==o)return $e.UpdateResult.Recreate;if(e.data.repr!==t.data.repr)return $e.UpdateResult.Recreate;let i=t.data.state.clipping,s=qn.ofBundle(r.layers,o);return qn.areEqual(i,s)?$e.UpdateResult.Unchanged:(t.data.state.clipping=s,t.data.repr=e.data.repr,t.label=`Clipping (${s.layers.length} Layers)`,$e.UpdateResult.Updated)}}),MBe=Mt.BuiltIn({name:"theme-strength-representation-3d",display:"Theme Strength 3D Representation",from:ae.Molecule.Structure.Representation3D,to:ae.Molecule.Structure.Representation3DState,params:()=>({overpaintStrength:C.Numeric(1,{min:0,max:1,step:.01}),transparencyStrength:C.Numeric(1,{min:0,max:1,step:.01}),emissiveStrength:C.Numeric(1,{min:0,max:1,step:.01}),substanceStrength:C.Numeric(1,{min:0,max:1,step:.01})})})({canAutoUpdate(){return!0},apply({a:e,params:t}){return new ae.Molecule.Structure.Representation3DState({state:{themeStrength:{overpaint:t.overpaintStrength,transparency:t.transparencyStrength,emissive:t.emissiveStrength,substance:t.substanceStrength}},initialState:{themeStrength:{overpaint:1,transparency:1,emissive:1,substance:1}},info:{},repr:e.data.repr},{label:"Theme Strength",description:`${t.overpaintStrength.toFixed(2)}, ${t.transparencyStrength.toFixed(2)}, ${t.emissiveStrength.toFixed(2)}, ${t.substanceStrength.toFixed(2)}`})},update({a:e,b:t,newParams:r,oldParams:n}){var o,i,s,a;return r.overpaintStrength===((o=t.data.state.themeStrength)===null||o===void 0?void 0:o.overpaint)&&r.transparencyStrength===((i=t.data.state.themeStrength)===null||i===void 0?void 0:i.transparency)&&r.emissiveStrength===((s=t.data.state.themeStrength)===null||s===void 0?void 0:s.emissive)&&r.substanceStrength===((a=t.data.state.themeStrength)===null||a===void 0?void 0:a.substance)?$e.UpdateResult.Unchanged:(t.data.state.themeStrength={overpaint:r.overpaintStrength,transparency:r.transparencyStrength,emissive:r.emissiveStrength,substance:r.substanceStrength},t.data.repr=e.data.repr,t.label="Theme Strength",t.description=`${r.overpaintStrength.toFixed(2)}, ${r.transparencyStrength.toFixed(2)}, ${r.emissiveStrength.toFixed(2)}, ${r.substanceStrength.toFixed(2)}`,$e.UpdateResult.Updated)},interpolate(e,t,r){return{overpaintStrength:Kn(e.overpaintStrength,t.overpaintStrength,r),transparencyStrength:Kn(e.transparencyStrength,t.transparencyStrength,r),emissiveStrength:Kn(e.emissiveStrength,t.emissiveStrength,r),substanceStrength:Kn(e.substanceStrength,t.substanceStrength,r)}}}),Zd;(function(e){function t(o,i,s,a,l,c,u,d){let m=o.representation.volume.registry.get(i),p=o.representation.volume.themes.colorThemeRegistry.get(l||m.defaultColorTheme.name),h=o.representation.volume.themes.sizeThemeRegistry.get(u||m.defaultSizeTheme.name),f=C.getDefaultValues(m.getParams(o.representation.volume.themes,s));return{type:{name:i,params:a?k(k({},f),a):f},colorTheme:{name:p.name,params:c?k(k({},p.defaultValues),c):p.defaultValues},sizeTheme:{name:h.name,params:d?k(k({},h.defaultValues),d):h.defaultValues}}}e.getDefaultParams=t;function r(o,i,s,a,l,c,u){let d=o.representation.volume.registry.get(i),m=o.representation.volume.themes.colorThemeRegistry.get(a||d.defaultColorTheme.name),p=o.representation.volume.themes.sizeThemeRegistry.get(c||d.defaultSizeTheme.name);return{type:{name:i,params:s?k(k({},d.defaultValues),s):d.defaultValues},colorTheme:{name:d.defaultColorTheme.name,params:l?k(k({},m.defaultValues),l):m.defaultValues},sizeTheme:{name:d.defaultSizeTheme.name,params:u?k(k({},p.defaultValues),u):p.defaultValues}}}e.getDefaultParamsStatic=r;function n(o){var i,s,a,l;if(o.isoValue)return Je.IsoValue.toString(o.isoValue);if(!((s=(i=o.renderMode)===null||i===void 0?void 0:i.params)===null||s===void 0)&&s.isoValue)return Je.IsoValue.toString((l=(a=o.renderMode)===null||a===void 0?void 0:a.params)===null||l===void 0?void 0:l.isoValue)}e.getDescription=n})(Zd||(Zd={}));var BBe=Mt.BuiltIn({name:"volume-representation-3d",display:"3D Representation",from:ae.Volume.Data,to:ae.Volume.Representation3D,params:(e,t)=>{let{registry:r,themes:n}=t.representation.volume,o=r.get(r.default.name);if(!e)return{type:C.Mapped(r.default.name,r.types,s=>C.Group(r.get(s).getParams(n,Je.One))),colorTheme:C.Mapped(o.defaultColorTheme.name,n.colorThemeRegistry.types,s=>C.Group(n.colorThemeRegistry.get(s).getParams({volume:Je.One}))),sizeTheme:C.Mapped(o.defaultSizeTheme.name,n.sizeThemeRegistry.types,s=>C.Group(n.sizeThemeRegistry.get(s).getParams({volume:Je.One})))};let i={volume:e.data};return{type:C.Mapped(r.default.name,r.types,s=>C.Group(r.get(s).getParams(n,e.data))),colorTheme:C.Mapped(o.defaultColorTheme.name,n.colorThemeRegistry.getApplicableTypes(i),s=>C.Group(n.colorThemeRegistry.get(s).getParams(i))),sizeTheme:C.Mapped(o.defaultSizeTheme.name,n.sizeThemeRegistry.getApplicableTypes(i),s=>C.Group(n.sizeThemeRegistry.get(s).getParams(i)))}}})({canAutoUpdate({oldParams:e,newParams:t}){return e.type.name===t.type.name},apply({a:e,params:t},r){return Pe.create("Volume Representation",n=>Y(this,null,function*(){var o;let i={runtime:n,assetManager:r.managers.asset},s=r.representation.volume.registry.get(t.type.name);s.ensureCustomProperties&&(yield s.ensureCustomProperties.attach(i,e.data));let a=s.factory(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.volume.themes),s.getParams);a.setTheme(Lo.create(r.representation.volume.themes,{volume:e.data},t));let l=t.type.params||{};return yield a.createOrUpdate(l,e.data).runInContext(n),new ae.Volume.Representation3D({repr:a,sourceData:e.data},{label:s.label,description:Zd.getDescription(l)})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Volume Representation",i=>Y(this,null,function*(){var s;if(n.type.name!==r.type.name)return(s=o.representation.volume.registry.get(r.type.name).ensureCustomProperties)===null||s===void 0||s.detach(e.data),$e.UpdateResult.Recreate;let a=k(k({},t.data.repr.props),n.type.params);return t.data.repr.setTheme(Lo.create(o.representation.volume.themes,{volume:e.data},n)),yield t.data.repr.createOrUpdate(a,e.data).runInContext(i),t.data.sourceData=e.data,t.description=Zd.getDescription(a),$e.UpdateResult.Updated}))}});var RBe=Mt.BuiltIn({name:"shape-representation-3d",display:"3D Representation",from:ae.Shape.Provider,to:ae.Shape.Representation3D,params:(e,t)=>e?e.data.params:We.Params})({canAutoUpdate(){return!0},apply({a:e,params:t},r){return Pe.create("Shape Representation",n=>Y(this,null,function*(){let o=k(k({},C.getDefaultValues(e.data.params)),t),i=Jo(e.data.getShape,e.data.geometryUtils);return yield i.createOrUpdate(o,e.data.data).runInContext(n),new ae.Shape.Representation3D({repr:i,sourceData:e.data},{label:e.data.label})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Shape Representation",i=>Y(this,null,function*(){let s=k(k({},t.data.repr.props),n);return yield t.data.repr.createOrUpdate(s,e.data.data).runInContext(i),t.data.sourceData=e.data,$e.UpdateResult.Updated}))}});var LBe=Mt.BuiltIn({name:"model-unitcell-3d",display:"Model Unit Cell",from:ae.Molecule.Model,to:ae.Shape.Representation3D,params:()=>k({},PO)})({isApplicable:e=>!!ao.Provider.get(e.data),canAutoUpdate({oldParams:e,newParams:t}){return!0},apply({a:e,params:t},r){return Pe.create("Model Unit Cell",n=>Y(this,null,function*(){var o;let i=ao.Provider.get(e.data);if(!i)return kn.Null;let s=IO(e.data,i,t),a=Zne(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.structure.themes),()=>PO);return yield a.createOrUpdate(t,s).runInContext(n),new ae.Shape.Representation3D({repr:a,sourceData:s},{label:"Unit Cell",description:i.spacegroup.name})}))},update({a:e,b:t,newParams:r}){return Pe.create("Model Unit Cell",n=>Y(this,null,function*(){let o=ao.Provider.get(e.data);if(!o)return $e.UpdateResult.Null;let i=k(k({},t.data.repr.props),r),s=IO(e.data,o,i);return yield t.data.repr.createOrUpdate(i,s).runInContext(n),t.data.sourceData=s,$e.UpdateResult.Updated}))}});var FBe=Mt.BuiltIn({name:"structure-bounding-box-3d",display:"Bounding Box",from:ae.Molecule.Structure,to:ae.Shape.Representation3D,params:k({radius:C.Numeric(.05,{min:.01,max:4,step:.01},{isEssential:!0}),color:C.Color(Yt.red,{isEssential:!0})},dt.Params)})({canAutoUpdate(){return!0},apply({a:e,params:t},r){return Pe.create("Bounding Box",n=>Y(this,null,function*(){let o=Jo((i,s,a,l)=>{let c=AI(s.box,s.radius,l?.geometry);return Dr.create("Bouding Box",s,c,()=>s.color,()=>1,()=>"Bounding Box")},dt.Utils);return yield o.createOrUpdate(t,{box:e.data.boundary.box,radius:t.radius,color:t.color}).runInContext(n),new ae.Shape.Representation3D({repr:o,sourceData:e.data},{label:"Bounding Box"})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Bounding Box",i=>Y(this,null,function*(){return yield t.data.repr.createOrUpdate(n,{box:e.data.boundary.box,radius:n.radius,color:n.color}).runInContext(i),t.data.sourceData=e.data,$e.UpdateResult.Updated}))}});var OBe=Mt.BuiltIn({name:"structure-selections-distance-3d",display:"3D Distance",from:ae.Molecule.Structure.Selections,to:ae.Shape.Representation3D,params:()=>k({},DO)})({canAutoUpdate({oldParams:e,newParams:t}){return!0},apply({a:e,params:t},r){return Pe.create("Structure Distance",n=>Y(this,null,function*(){var o;let i=kO(e.data),s=ooe(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.structure.themes),()=>DO);return yield s.createOrUpdate(t,i).runInContext(n),new ae.Shape.Representation3D({repr:s,sourceData:i},{label:"Distance"})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Structure Distance",i=>Y(this,null,function*(){let s=k(k({},t.data.repr.props),n),a=kO(e.data);return yield t.data.repr.createOrUpdate(s,a).runInContext(i),t.data.sourceData=a,$e.UpdateResult.Updated}))}});var NBe=Mt.BuiltIn({name:"structure-selections-angle-3d",display:"3D Angle",from:ae.Molecule.Structure.Selections,to:ae.Shape.Representation3D,params:()=>k({},VO)})({canAutoUpdate({oldParams:e,newParams:t}){return!0},apply({a:e,params:t},r){return Pe.create("Structure Angle",n=>Y(this,null,function*(){var o;let i=MO(e.data),s=yoe(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.structure.themes),()=>VO);return yield s.createOrUpdate(t,i).runInContext(n),new ae.Shape.Representation3D({repr:s,sourceData:i},{label:"Angle"})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Structure Angle",i=>Y(this,null,function*(){let s=k(k({},t.data.repr.props),n),a=MO(e.data);return yield t.data.repr.createOrUpdate(s,a).runInContext(i),t.data.sourceData=a,$e.UpdateResult.Updated}))}});var UBe=Mt.BuiltIn({name:"structure-selections-dihedral-3d",display:"3D Dihedral",from:ae.Molecule.Structure.Selections,to:ae.Shape.Representation3D,params:()=>k({},GO)})({canAutoUpdate({oldParams:e,newParams:t}){return!0},apply({a:e,params:t},r){return Pe.create("Structure Dihedral",n=>Y(this,null,function*(){var o;let i=BO(e.data),s=Soe(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.structure.themes),()=>GO);return yield s.createOrUpdate(t,i).runInContext(n),new ae.Shape.Representation3D({repr:s,sourceData:i},{label:"Dihedral"})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Structure Dihedral",i=>Y(this,null,function*(){let s=k(k({},t.data.repr.props),n),a=BO(e.data);return yield t.data.repr.createOrUpdate(s,a).runInContext(i),t.data.sourceData=a,$e.UpdateResult.Updated}))}});var zBe=Mt.BuiltIn({name:"structure-selections-label-3d",display:"3D Label",from:ae.Molecule.Structure.Selections,to:ae.Shape.Representation3D,params:()=>k({},OO)})({canAutoUpdate({oldParams:e,newParams:t}){return!0},apply({a:e,params:t},r){return Pe.create("Structure Label",n=>Y(this,null,function*(){var o,i,s;let a=RO(e.data),l=soe(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.structure.themes),()=>OO);yield l.createOrUpdate(t,a).runInContext(n);let c=!!(!((i=t.snapshotKey)===null||i===void 0)&&i.trim()||!((s=t.tooltip)===null||s===void 0)&&s.trim());return l.setState({pickable:c,markerActions:c?Fo.Highlighting:Ft.None}),new ae.Shape.Representation3D({repr:l,sourceData:a},{label:"Label"})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Structure Label",i=>Y(this,null,function*(){var s,a;let l=k(k({},t.data.repr.props),n),c=RO(e.data);yield t.data.repr.createOrUpdate(l,c).runInContext(i),t.data.sourceData=c;let u=!!(!((s=n.snapshotKey)===null||s===void 0)&&s.trim()||!((a=n.tooltip)===null||a===void 0)&&a.trim());return t.data.repr.setState({pickable:u,markerActions:u?Fo.Highlighting:Ft.None}),$e.UpdateResult.Updated}))}});var VBe=Mt.BuiltIn({name:"structure-selections-orientation-3d",display:"3D Orientation",from:ae.Molecule.Structure.Selections,to:ae.Shape.Representation3D,params:()=>k({},zO)})({canAutoUpdate({oldParams:e,newParams:t}){return!0},apply({a:e,params:t},r){return Pe.create("Structure Orientation",n=>Y(this,null,function*(){var o;let i=LO(e.data),s=moe(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.structure.themes),()=>zO);return yield s.createOrUpdate(t,i).runInContext(n),new ae.Shape.Representation3D({repr:s,sourceData:i},{label:"Orientation"})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Structure Orientation",i=>Y(this,null,function*(){let s=k(k({},t.data.repr.props),n),a=LO(e.data);return yield t.data.repr.createOrUpdate(s,a).runInContext(i),t.data.sourceData=a,$e.UpdateResult.Updated}))}});var GBe=Mt.BuiltIn({name:"structure-selections-plane-3d",display:"3D Plane",from:ae.Molecule.Structure.Selections,to:ae.Shape.Representation3D,params:()=>k({},qO)})({canAutoUpdate({oldParams:e,newParams:t}){return!0},apply({a:e,params:t},r){return Pe.create("Structure Plane",n=>Y(this,null,function*(){var o;let i=FO(e.data),s=Aoe(k({webgl:(o=r.canvas3d)===null||o===void 0?void 0:o.webgl},r.representation.structure.themes),()=>qO);return yield s.createOrUpdate(t,i).runInContext(n),new ae.Shape.Representation3D({repr:s,sourceData:i},{label:"Plane"})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Structure Plane",i=>Y(this,null,function*(){let s=k(k({},t.data.repr.props),n),a=FO(e.data);return yield t.data.repr.createOrUpdate(s,a).runInContext(i),t.data.sourceData=a,$e.UpdateResult.Updated}))}});function E0(e,t,r){return{i:e,j:t,k:r}}function $d(e,t){return{a:e,b:t}}var ts=[E0(0,0,0),E0(1,0,0),E0(1,1,0),E0(0,1,0),E0(0,0,1),E0(1,0,1),E0(1,1,1),E0(0,1,1)],Toe=[$d(ts[0],ts[1]),$d(ts[1],ts[2]),$d(ts[2],ts[3]),$d(ts[3],ts[0]),$d(ts[4],ts[5]),$d(ts[5],ts[6]),$d(ts[6],ts[7]),$d(ts[7],ts[4]),$d(ts[0],ts[4]),$d(ts[1],ts[5]),$d(ts[2],ts[6]),$d(ts[3],ts[7])],Poe=[{i:0,j:0,k:0,e:0},{i:1,j:0,k:0,e:1},{i:0,j:1,k:0,e:0},{i:0,j:0,k:0,e:1},{i:0,j:0,k:1,e:0},{i:1,j:0,k:1,e:1},{i:0,j:1,k:1,e:0},{i:0,j:0,k:1,e:1},{i:0,j:0,k:0,e:2},{i:1,j:0,k:0,e:2},{i:1,j:1,k:0,e:2},{i:0,j:1,k:0,e:2}],Ioe=[0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0],D0=[[],[0,8,3],[0,1,9],[1,8,3,9,8,1],[1,2,10],[0,8,3,1,2,10],[9,2,10,0,2,9],[2,8,3,2,10,8,10,9,8],[3,11,2],[0,11,2,8,11,0],[1,9,0,2,3,11],[1,11,2,1,9,11,9,8,11],[3,10,1,11,10,3],[0,10,1,0,8,10,8,11,10],[3,9,0,3,11,9,11,10,9],[9,8,10,10,8,11],[4,7,8],[4,3,0,7,3,4],[0,1,9,8,4,7],[4,1,9,4,7,1,7,3,1],[1,2,10,8,4,7],[3,4,7,3,0,4,1,2,10],[9,2,10,9,0,2,8,4,7],[2,10,9,2,9,7,2,7,3,7,9,4],[8,4,7,3,11,2],[11,4,7,11,2,4,2,0,4],[9,0,1,8,4,7,2,3,11],[4,7,11,9,4,11,9,11,2,9,2,1],[3,10,1,3,11,10,7,8,4],[1,11,10,1,4,11,1,0,4,7,11,4],[4,7,8,9,0,11,9,11,10,11,0,3],[4,7,11,4,11,9,9,11,10],[9,5,4],[9,5,4,0,8,3],[0,5,4,1,5,0],[8,5,4,8,3,5,3,1,5],[1,2,10,9,5,4],[3,0,8,1,2,10,4,9,5],[5,2,10,5,4,2,4,0,2],[2,10,5,3,2,5,3,5,4,3,4,8],[9,5,4,2,3,11],[0,11,2,0,8,11,4,9,5],[0,5,4,0,1,5,2,3,11],[2,1,5,2,5,8,2,8,11,4,8,5],[10,3,11,10,1,3,9,5,4],[4,9,5,0,8,1,8,10,1,8,11,10],[5,4,0,5,0,11,5,11,10,11,0,3],[5,4,8,5,8,10,10,8,11],[9,7,8,5,7,9],[9,3,0,9,5,3,5,7,3],[0,7,8,0,1,7,1,5,7],[1,5,3,3,5,7],[9,7,8,9,5,7,10,1,2],[10,1,2,9,5,0,5,3,0,5,7,3],[8,0,2,8,2,5,8,5,7,10,5,2],[2,10,5,2,5,3,3,5,7],[7,9,5,7,8,9,3,11,2],[9,5,7,9,7,2,9,2,0,2,7,11],[2,3,11,0,1,8,1,7,8,1,5,7],[11,2,1,11,1,7,7,1,5],[9,5,8,8,5,7,10,1,3,10,3,11],[5,7,0,5,0,9,7,11,0,1,0,10,11,10,0],[11,10,0,11,0,3,10,5,0,8,0,7,5,7,0],[11,10,5,7,11,5],[10,6,5],[0,8,3,5,10,6],[9,0,1,5,10,6],[1,8,3,1,9,8,5,10,6],[1,6,5,2,6,1],[1,6,5,1,2,6,3,0,8],[9,6,5,9,0,6,0,2,6],[5,9,8,5,8,2,5,2,6,3,2,8],[2,3,11,10,6,5],[11,0,8,11,2,0,10,6,5],[0,1,9,2,3,11,5,10,6],[5,10,6,1,9,2,9,11,2,9,8,11],[6,3,11,6,5,3,5,1,3],[0,8,11,0,11,5,0,5,1,5,11,6],[3,11,6,0,3,6,0,6,5,0,5,9],[6,5,9,6,9,11,11,9,8],[5,10,6,4,7,8],[4,3,0,4,7,3,6,5,10],[1,9,0,5,10,6,8,4,7],[10,6,5,1,9,7,1,7,3,7,9,4],[6,1,2,6,5,1,4,7,8],[1,2,5,5,2,6,3,0,4,3,4,7],[8,4,7,9,0,5,0,6,5,0,2,6],[7,3,9,7,9,4,3,2,9,5,9,6,2,6,9],[3,11,2,7,8,4,10,6,5],[5,10,6,4,7,2,4,2,0,2,7,11],[0,1,9,4,7,8,2,3,11,5,10,6],[9,2,1,9,11,2,9,4,11,7,11,4,5,10,6],[8,4,7,3,11,5,3,5,1,5,11,6],[5,1,11,5,11,6,1,0,11,7,11,4,0,4,11],[0,5,9,0,6,5,0,3,6,11,6,3,8,4,7],[6,5,9,6,9,11,4,7,9,7,11,9],[10,4,9,6,4,10],[4,10,6,4,9,10,0,8,3],[10,0,1,10,6,0,6,4,0],[8,3,1,8,1,6,8,6,4,6,1,10],[1,4,9,1,2,4,2,6,4],[3,0,8,1,2,9,2,4,9,2,6,4],[0,2,4,4,2,6],[8,3,2,8,2,4,4,2,6],[10,4,9,10,6,4,11,2,3],[0,8,2,2,8,11,4,9,10,4,10,6],[3,11,2,0,1,6,0,6,4,6,1,10],[6,4,1,6,1,10,4,8,1,2,1,11,8,11,1],[9,6,4,9,3,6,9,1,3,11,6,3],[8,11,1,8,1,0,11,6,1,9,1,4,6,4,1],[3,11,6,3,6,0,0,6,4],[6,4,8,11,6,8],[7,10,6,7,8,10,8,9,10],[0,7,3,0,10,7,0,9,10,6,7,10],[10,6,7,1,10,7,1,7,8,1,8,0],[10,6,7,10,7,1,1,7,3],[1,2,6,1,6,8,1,8,9,8,6,7],[2,6,9,2,9,1,6,7,9,0,9,3,7,3,9],[7,8,0,7,0,6,6,0,2],[7,3,2,6,7,2],[2,3,11,10,6,8,10,8,9,8,6,7],[2,0,7,2,7,11,0,9,7,6,7,10,9,10,7],[1,8,0,1,7,8,1,10,7,6,7,10,2,3,11],[11,2,1,11,1,7,10,6,1,6,7,1],[8,9,6,8,6,7,9,1,6,11,6,3,1,3,6],[0,9,1,11,6,7],[7,8,0,7,0,6,3,11,0,11,6,0],[7,11,6],[7,6,11],[3,0,8,11,7,6],[0,1,9,11,7,6],[8,1,9,8,3,1,11,7,6],[10,1,2,6,11,7],[1,2,10,3,0,8,6,11,7],[2,9,0,2,10,9,6,11,7],[6,11,7,2,10,3,10,8,3,10,9,8],[7,2,3,6,2,7],[7,0,8,7,6,0,6,2,0],[2,7,6,2,3,7,0,1,9],[1,6,2,1,8,6,1,9,8,8,7,6],[10,7,6,10,1,7,1,3,7],[10,7,6,1,7,10,1,8,7,1,0,8],[0,3,7,0,7,10,0,10,9,6,10,7],[7,6,10,7,10,8,8,10,9],[6,8,4,11,8,6],[3,6,11,3,0,6,0,4,6],[8,6,11,8,4,6,9,0,1],[9,4,6,9,6,3,9,3,1,11,3,6],[6,8,4,6,11,8,2,10,1],[1,2,10,3,0,11,0,6,11,0,4,6],[4,11,8,4,6,11,0,2,9,2,10,9],[10,9,3,10,3,2,9,4,3,11,3,6,4,6,3],[8,2,3,8,4,2,4,6,2],[0,4,2,4,6,2],[1,9,0,2,3,4,2,4,6,4,3,8],[1,9,4,1,4,2,2,4,6],[8,1,3,8,6,1,8,4,6,6,10,1],[10,1,0,10,0,6,6,0,4],[4,6,3,4,3,8,6,10,3,0,3,9,10,9,3],[10,9,4,6,10,4],[4,9,5,7,6,11],[0,8,3,4,9,5,11,7,6],[5,0,1,5,4,0,7,6,11],[11,7,6,8,3,4,3,5,4,3,1,5],[9,5,4,10,1,2,7,6,11],[6,11,7,1,2,10,0,8,3,4,9,5],[7,6,11,5,4,10,4,2,10,4,0,2],[3,4,8,3,5,4,3,2,5,10,5,2,11,7,6],[7,2,3,7,6,2,5,4,9],[9,5,4,0,8,6,0,6,2,6,8,7],[3,6,2,3,7,6,1,5,0,5,4,0],[6,2,8,6,8,7,2,1,8,4,8,5,1,5,8],[9,5,4,10,1,6,1,7,6,1,3,7],[1,6,10,1,7,6,1,0,7,8,7,0,9,5,4],[4,0,10,4,10,5,0,3,10,6,10,7,3,7,10],[7,6,10,7,10,8,5,4,10,4,8,10],[6,9,5,6,11,9,11,8,9],[3,6,11,0,6,3,0,5,6,0,9,5],[0,11,8,0,5,11,0,1,5,5,6,11],[6,11,3,6,3,5,5,3,1],[1,2,10,9,5,11,9,11,8,11,5,6],[0,11,3,0,6,11,0,9,6,5,6,9,1,2,10],[11,8,5,11,5,6,8,0,5,10,5,2,0,2,5],[6,11,3,6,3,5,2,10,3,10,5,3],[5,8,9,5,2,8,5,6,2,3,8,2],[9,5,6,9,6,0,0,6,2],[1,5,8,1,8,0,5,6,8,3,8,2,6,2,8],[1,5,6,2,1,6],[1,3,6,1,6,10,3,8,6,5,6,9,8,9,6],[10,1,0,10,0,6,9,5,0,5,6,0],[0,3,8,5,6,10],[10,5,6],[11,5,10,7,5,11],[11,5,10,11,7,5,8,3,0],[5,11,7,5,10,11,1,9,0],[10,7,5,10,11,7,9,8,1,8,3,1],[11,1,2,11,7,1,7,5,1],[0,8,3,1,2,7,1,7,5,7,2,11],[9,7,5,9,2,7,9,0,2,2,11,7],[7,5,2,7,2,11,5,9,2,3,2,8,9,8,2],[2,5,10,2,3,5,3,7,5],[8,2,0,8,5,2,8,7,5,10,2,5],[9,0,1,5,10,3,5,3,7,3,10,2],[9,8,2,9,2,1,8,7,2,10,2,5,7,5,2],[1,3,5,3,7,5],[0,8,7,0,7,1,1,7,5],[9,0,3,9,3,5,5,3,7],[9,8,7,5,9,7],[5,8,4,5,10,8,10,11,8],[5,0,4,5,11,0,5,10,11,11,3,0],[0,1,9,8,4,10,8,10,11,10,4,5],[10,11,4,10,4,5,11,3,4,9,4,1,3,1,4],[2,5,1,2,8,5,2,11,8,4,5,8],[0,4,11,0,11,3,4,5,11,2,11,1,5,1,11],[0,2,5,0,5,9,2,11,5,4,5,8,11,8,5],[9,4,5,2,11,3],[2,5,10,3,5,2,3,4,5,3,8,4],[5,10,2,5,2,4,4,2,0],[3,10,2,3,5,10,3,8,5,4,5,8,0,1,9],[5,10,2,5,2,4,1,9,2,9,4,2],[8,4,5,8,5,3,3,5,1],[0,4,5,1,0,5],[8,4,5,8,5,3,9,0,5,0,3,5],[9,4,5],[4,11,7,4,9,11,9,10,11],[0,8,3,4,9,7,9,11,7,9,10,11],[1,10,11,1,11,4,1,4,0,7,4,11],[3,1,4,3,4,8,1,10,4,7,4,11,10,11,4],[4,11,7,9,11,4,9,2,11,9,1,2],[9,7,4,9,11,7,9,1,11,2,11,1,0,8,3],[11,7,4,11,4,2,2,4,0],[11,7,4,11,4,2,8,3,4,3,2,4],[2,9,10,2,7,9,2,3,7,7,4,9],[9,10,7,9,7,4,10,2,7,8,7,0,2,0,7],[3,7,10,3,10,2,7,4,10,1,10,0,4,0,10],[1,10,2,8,7,4],[4,9,1,4,1,7,7,1,3],[4,9,1,4,1,7,0,8,1,8,7,1],[4,0,3,7,4,3],[4,8,7],[9,10,8,10,11,8],[3,0,9,3,9,11,11,9,10],[0,1,10,0,10,8,8,10,11],[3,1,10,11,3,10],[1,2,11,1,11,9,9,11,8],[3,0,9,3,9,11,1,2,9,2,11,9],[0,2,11,8,0,11],[3,2,11],[2,3,8,2,8,10,10,8,9],[9,10,2,0,9,2],[2,3,8,2,8,10,0,1,8,1,10,8],[1,10,2],[1,3,8,9,1,8],[0,9,1],[0,3,8],[]],TI=[[0,4,4,4,2,0,0,0,2,2,0,0],[4,0,4,4,0,8,0,0,0,8,8,0],[4,4,0,4,0,0,8,0,0,0,8,8],[4,4,4,0,0,0,0,1,1,0,0,1],[2,0,0,0,0,8,8,8,2,2,0,0],[0,8,0,0,8,0,8,8,0,8,8,0],[0,0,8,0,8,8,0,8,0,0,8,8],[0,0,0,1,8,8,8,0,1,0,0,1],[2,0,0,1,2,0,0,1,0,2,0,1],[2,8,0,0,2,8,0,0,2,0,8,0],[0,8,8,0,0,8,8,0,0,8,0,8],[0,0,8,1,0,0,8,1,1,0,8,0]];function Eoe(e,t){let r=Math.min(65536,e*4),n=je.create(Float32Array,3,e,t&&t.vertexBuffer.ref.value),o=je.create(Float32Array,3,e,t&&t.normalBuffer.ref.value),i=je.create(Float32Array,1,e,t&&t.groupBuffer.ref.value),s=je.create(Uint32Array,3,r,t&&t.indexBuffer.ref.value),a=0,l=0;return{addVertex:(c,u,d)=>(++a,je.add3(n,c,u,d)),addNormal:(c,u,d)=>{je.add3(o,c,u,d)},addGroup:c=>{je.add(i,c)},addTriangle:(c,u,d,m)=>{let p=c[u],h=c[d],f=c[m];p>=0&&h>=0&&f>=0&&(++l,je.add3(s,p,h,f))},get:()=>{let c=je.compact(n,!0),u=je.compact(o,!0),d=je.compact(s,!0),m=je.compact(i,!0);return dt.create(c,d,u,m,a,l,t)}}}function Doe(e,t){let r=je.create(Float32Array,3,e),n=je.create(Float32Array,1,e),o=je.create(Float32Array,2,e),i=0;return{addVertex:(s,a,l)=>je.add3(r,s,a,l),addNormal:()=>Ll,addGroup:s=>{je.add(n,s)},addTriangle:(s,a,l,c,u)=>{let d=s[a],m=s[l],p=s[c];d>=0&&m>=0&&p>=0&&(TI[a][l]&u&&(++i,je.add2(o,s[a],s[l])),TI[l][c]&u&&(++i,je.add2(o,s[l],s[c])),TI[a][c]&u&&(++i,je.add2(o,s[a],s[c])))},get:()=>{let s=je.compact(r,!0),a=je.compact(o,!0),l=je.compact(n,!0),c=Gs.create(i,i/10,t);for(let u=0;uY(this,null,function*(){let n=koe(e),{dX:o,dY:i,dZ:s}=Moe(n),a=Math.min(262144,Math.max(o*i*s/32,1024)),l=Eoe(a,t);return yield new PI(r,l,n).run(),l.get()}))}function zb(e,t){return Pe.create("Marching Cubes Lines",r=>Y(this,null,function*(){let n=koe(e),{dX:o,dY:i,dZ:s}=Moe(n),a=Math.min(262144,Math.max(o*i*s/32,1024)),l=Doe(a,t);return yield new PI(r,l,n).run(),l.get()}))}var PI=class{doSlices(){return Y(this,null,function*(){let t=0;this.edgeFilter=15;for(let r=this.minZ;r0)return o-1;let i=this.scalarField,s=this.scalarFieldGet,a=Toe[t],l=a.a,c=a.b,u=l.i+this.i,d=l.j+this.j,m=l.k+this.k,p=c.i+this.i,h=c.j+this.j,f=c.k+this.k,y=s(i,u,d,m),g=s(i,p,h,f),v=(this.isoLevel-y)/(y-g);if(this.idField){let M=this.idFieldGet(this.idField,u,d,m),R=this.idFieldGet(this.idField,p,h,f),U=v<.5?M:R;if(U===-1&&(U=v<.5?R:M),U===-2)return-1;this.builder.addGroup(U)}else this.builder.addGroup(0);let b=this.builder.addVertex(u+v*(u-p),d+v*(d-h),m+v*(m-f));this.verticesOnEdges[n]=b+1;let S=s(i,Math.max(0,u-1),d,m)-s(i,Math.min(this.nX-1,u+1),d,m),_=s(i,u,Math.max(0,d-1),m)-s(i,u,Math.min(this.nY-1,d+1),m),w=s(i,u,d,Math.max(0,m-1))-s(i,u,d,Math.min(this.nZ,m+1)),E=s(i,Math.max(0,p-1),h,f)-s(i,Math.min(this.nX-1,p+1),h,f),A=s(i,p,Math.max(0,h-1),f)-s(i,p,Math.min(this.nY-1,h+1),f),P=s(i,p,h,Math.max(0,f-1))-s(i,p,h,Math.min(this.nZ-1,f+1)),T=S+v*(S-E),B=_+v*(_-A),D=w+v*(w-P);return this.isoLevel>=0?this.builder.addNormal(T,B,D):this.builder.addNormal(-T,-B,-D),b}constructor(t,r){this.builder=t,this.vertList=[0,0,0,0,0,0,0,0,0,0,0,0],this.i=0,this.j=0,this.k=0;let n=r.scalarField.space.dimensions;this.nX=n[0],this.nY=n[1],this.nZ=n[2],this.isoLevel=r.isoLevel,this.scalarFieldGet=r.scalarField.space.get,this.scalarField=r.scalarField.data,r.idField&&(this.idField=r.idField.data,this.idFieldGet=r.idField.space.get),this.verticesOnEdges=new Int32Array(3*this.nX*this.nY*2)}get(t,r,n){return this.scalarFieldGet(this.scalarField,t,r,n)}processCell(t,r,n,o){let i=0;if(this.get(t,r,n)0&&(this.vertList[0]=this.interpolate(0)),(s&2)>0&&(this.vertList[1]=this.interpolate(1)),(s&4)>0&&(this.vertList[2]=this.interpolate(2)),(s&8)>0&&(this.vertList[3]=this.interpolate(3)),(s&16)>0&&(this.vertList[4]=this.interpolate(4)),(s&32)>0&&(this.vertList[5]=this.interpolate(5)),(s&64)>0&&(this.vertList[6]=this.interpolate(6)),(s&128)>0&&(this.vertList[7]=this.interpolate(7)),(s&256)>0&&(this.vertList[8]=this.interpolate(8)),(s&512)>0&&(this.vertList[9]=this.interpolate(9)),(s&1024)>0&&(this.vertList[10]=this.interpolate(10)),(s&2048)>0&&(this.vertList[11]=this.interpolate(11));let a=D0[i];for(let l=0;l=0?this.builder.addTriangle(this.vertList,c,u,d,o):this.builder.addTriangle(this.vertList,d,u,c,o)}}};function HBe(e,t,r,n,o,i){let{createValues:s,createRenderableState:a}=ii.getUtils(t),l=ub(),c=s(t,l,r,n,o),u=a(o);return Gd(t.kind,c,u,i)}function up(e,t){let{defaultProps:r,createGeometry:n,createLocationIterator:o,getLoci:i,eachLocation:s,setUpdateState:a,mustRecreate:l,dispose:c}=e,{updateValues:u,updateBoundingSphere:d,updateRenderableState:m,createPositionIterator:p}=e.geometryUtils,h=cu.create(),f,y,g,v,b,S=Object.assign({},r),_=Lo.createEmpty(),w,E,A,P=-1,T,B;function D(N,z,q,O){if(!q&&!w)throw new Error("missing volume");if(y=Object.assign({},S,z),g=N,v=q,b=O,cu.reset(h),f?(!Je.areEquivalent(v,w)||b!==E)&&(h.createNew=!0):h.createNew=!0,h.createNew){h.createGeometry=!0;return}a(h,q,y,S,g,_),Oi.areEqual(N.color,_.color)||(h.updateColor=!0),h.createGeometry&&(h.updateColor=!0),y.instanceGranularity!==S.instanceGranularity&&(h.updateTransform=!0)}function M(N){if(h.createNew)if(T=o(v,b),N)f=HBe(v,N,T,g,y,t),B=p(N,f.values);else throw new Error("expected geometry to be given");else{if(!f)throw new Error("expected renderObject to be available");if(h.updateTransform){T=o(v,b);let{instanceCount:z,groupCount:q}=T;y.instanceGranularity?Gn(z,"instance",f.values):Gn(z*q,"groupInstance",f.values)}else T.reset();if(h.createGeometry)if(N)I.updateIfChanged(f.values.drawCount,ii.getDrawCount(N)),I.updateIfChanged(f.values.uVertexCount,ii.getVertexCount(N)),I.updateIfChanged(f.values.uGroupCount,ii.getGroupCount(N));else throw new Error("expected geometry to be given");(h.updateTransform||h.createGeometry)&&(d(f.values,N||A),B=p(N||A,f.values)),h.updateSize&&"uSize"in f.values&&ja(T,g.size,f.values),h.updateColor&&Ci(T,B,g.color,f.values),u(f.values,y),m(f.state,y)}S=y,_=g,w=v,E=b,N&&(A=N,P+=1)}function R(N,z,q,O){let J=!1;if(Je.Cell.isLoci(N)){if(Je.Cell.isLociEmpty(N)||!Je.areEquivalent(N.volume,z))return!1;O(ve.ofSingleton(0))&&(J=!0)}else if(Je.Segment.isLoci(N)){if(Je.Segment.isLociEmpty(N)||!Je.areEquivalent(N.volume,z)||!Fe.has(N.segments,q))return!1;O(ve.ofSingleton(0))&&(J=!0)}return J}function U(N,z){return Fi(N)?S.instanceGranularity?z(ve.ofBounds(0,T.instanceCount)):z(ve.ofBounds(0,T.groupCount*T.instanceCount)):S.instanceGranularity?R(N,w,E,z):s(N,w,E,S,z)}return{get groupCount(){return T?T.count:0},get renderObject(){return f},get geometryVersion(){return P},createOrUpdate(J,Q){return Y(this,arguments,function*(N,z,q={},O){if(D(z,q,O?.volume||w,O?.key||E),h.createGeometry){let H=n(N,v,b,g,y,A);return vg(H)?H.then(M):M(H)}else M()})},getLoci(N){return f?i(N,w,E,S,f.id):nr},eachLocation(N){for(T.reset();T.hasNext;){let{location:z,isSecondary:q}=T.move();N(z,q)}},mark(N,z){return Sr.mark(f,N,z,U)},setVisibility(N){Sr.setVisibility(f,N)},setAlphaFactor(N){Sr.setAlphaFactor(f,N)},setPickable(N){Sr.setPickable(f,N)},setColorOnly(N){Sr.setColorOnly(f,N)},setTransform(N,z){Sr.setTransform(f,N,z)},setOverpaint(N){return Sr.setOverpaint(f,N,U,!0)},setTransparency(N){return Sr.setTransparency(f,N,U,!0)},setEmissive(N){return Sr.setEmissive(f,N,U,!0)},setSubstance(N){return Sr.setSubstance(f,N,U,!0)},setClipping(N){return Sr.setClipping(f,N,U,!0)},setThemeStrength(N){Sr.setThemeStrength(f,N)},destroy(){c?.(A),f&&(f.state.disposed=!0,f=void 0)},mustRecreate:l}}var sVt=k({},We.Params);function Rh(e,t,r,n,o,i=()=>[-1]){let s=0,{webgl:a}=t,l=new mo,c=new Nt.GeometryState,u=Ic(),d=[],m=Nt.createState(),p=new Map,h,f,y,g,v=Lo.createEmpty();function b(T,B){return Y(this,null,function*(){var D;let M=p.get(B);return M?!((D=M.mustRecreate)===null||D===void 0)&&D.call(M,{volume:h,key:B},g,a)&&(M.destroy(),M=n(u,h,B,g,a),p.set(B,M)):(M=n(u,h,B,g,a),p.set(B,M)),M.createOrUpdate({webgl:a,runtime:T},v,g,{volume:h,key:B})})}function S(T={},B){B&&B!==h&&(y=r(t,B),h=B,g||(g=C.getDefaultValues(y)));let D=S_(Object.assign({},g,T),h);return Object.assign(g,T,D),f=i(g),Pe.create("Creating or updating VolumeRepresentation",M=>Y(this,null,function*(){let R=new Set(p.keys());for(let U=0,F=f.length;U{var F;(F=p.get(U))===null||F===void 0||F.destroy(),p.delete(U)}),d.length=0,p.forEach(U=>{U.renderObject&&(d.push(U.renderObject),c.add(U.renderObject.id,U.geometryVersion))}),c.snapshot(),l.next(s++)}))}function _(T,B){let D=!1;return p.forEach(M=>{D=M.mark(T,B)||D}),D}function w(T,B){B.visible!==void 0&&T&&T.setVisibility(B.visible),B.alphaFactor!==void 0&&T&&T.setAlphaFactor(B.alphaFactor),B.pickable!==void 0&&T&&T.setPickable(B.pickable),B.overpaint!==void 0&&T&&T.setOverpaint(B.overpaint),B.transparency!==void 0&&T&&T.setTransparency(B.transparency),B.emissive!==void 0&&T&&T.setEmissive(B.emissive),B.substance!==void 0&&T&&T.setSubstance(B.substance),B.clipping!==void 0&&T&&T.setClipping(B.clipping),B.transform!==void 0&&T&&T.setTransform(B.transform),B.themeStrength!==void 0&&T&&T.setThemeStrength(B.themeStrength)}function E(T){let{visible:B,alphaFactor:D,pickable:M,overpaint:R,transparency:U,emissive:F,substance:N,clipping:z,transform:q,themeStrength:O,syncManually:J,markerActions:Q}=T,H={};B!==void 0&&(H.visible=B),D!==void 0&&(H.alphaFactor=D),M!==void 0&&(H.pickable=M),R!==void 0&&(H.overpaint=R),U!==void 0&&(H.transparency=U),F!==void 0&&(H.emissive=F),N!==void 0&&(H.substance=N),z!==void 0&&(H.clipping=z),O!==void 0&&(H.themeStrength=O),q!==void 0&&!ne.areEqual(q,m.transform,1e-6)&&(H.transform=q),J!==void 0&&(H.syncManually=J),Q!==void 0&&(H.markerActions=Q),p.forEach(W=>w(W,H)),Nt.updateState(m,T)}function A(T){v=T}function P(){p.forEach(T=>T.destroy()),p.clear()}return{label:e,get groupCount(){let T=0;return p.forEach(B=>{B.renderObject&&(T+=B.groupCount)}),T},get props(){return g},get params(){return y},get state(){return m},get theme(){return v},get geometryVersion(){return c.version},renderObjects:d,updated:l,createOrUpdate:S,setState:E,setTheme:A,getLoci:T=>{let B=nr;return p.forEach(D=>{let M=D.getLoci(T);Zo(M)||(B=M)}),B},getAllLoci:()=>[o(h,g)],eachLocation:T=>{p.forEach(B=>{B.eachLocation(T)})},mark:_,destroy:P}}var Boe=` +precision highp float; +precision highp int; + +#if __VERSION__ == 100 + precision highp sampler2D; + uniform sampler2D tTexture; +#else + precision highp isampler2D; + uniform isampler2D tTexture; +#endif + +void main(void) { + #if __VERSION__ == 100 + gl_FragColor = texture2D(tTexture, vec2(0.5)); + #else + gl_FragColor = ivec4(texture2D(tTexture, vec2(0.5)).r); + #endif +} +`;var jBe=te(k({},wn),{tTexture:Ct("texture","rgba","float","nearest")}),Jd="histopyramid-sum";function qBe(e,t){if(e.namedComputeRenderables[Jd]){let r=e.namedComputeRenderables[Jd].values;I.update(r.tTexture,t),e.namedComputeRenderables[Jd].update()}else e.namedComputeRenderables[Jd]=WBe(e,t);return e.namedComputeRenderables[Jd]}function WBe(e,t){let r=te(k({},An),{tTexture:I.create(t)}),n=k({},jBe),o=Rr("sum",Nn,Boe,{},{0:"ivec4"}),i=Jr(e,"triangles",o,n,r);return en(i,r)}function YBe(e){let{gl:t,state:r}=e;r.disable(t.CULL_FACE),r.disable(t.BLEND),r.disable(t.DEPTH_TEST),r.disable(t.SCISSOR_TEST),r.depthMask(!1),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0)}var II=new Uint8Array(4),Roe=new Int32Array(4);function Loe(e,t){ot&&e.timer.mark("getHistopyramidSum");let{gl:r,state:n,resources:o}=e,i=qBe(e,t);e.state.currentRenderItemId=-1,e.namedFramebuffers[Jd]||(e.namedFramebuffers[Jd]=o.framebuffer());let s=e.namedFramebuffers[Jd];return e.namedTextures[Jd]||(e.namedTextures[Jd]=Wt(r)?o.texture("image-int32","rgba","int","nearest"):o.texture("image-uint8","rgba","ubyte","nearest"),e.namedTextures[Jd].define(1,1)),e.namedTextures[Jd].attachFramebuffer(s,0),YBe(e),n.viewport(0,0,1,1),i.render(),r.finish(),e.readPixels(0,0,1,1,Wt(r)?Roe:II),e.unbindFramebuffer(),ot&&e.timer.markEnd("getHistopyramidSum"),Wt(r)?Roe[0]:D1(II[0],II[1],II[2])}var Foe=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tInputLevel; + +// previous level used to evaluate the new level +#if __VERSION__ == 100 + uniform sampler2D tPreviousLevel; +#else + precision highp isampler2D; + uniform isampler2D tPreviousLevel; +#endif + +// inverted size of the previous level texture. +uniform float uSize; +uniform float uTexSize; +uniform bool uFirst; + +#include common + +void main(void) { + float k = 0.5 * uSize; + vec2 position = floor((gl_FragCoord.xy / uTexSize) / uSize) * uSize; + + #if __VERSION__ == 100 + float a, b, c, d; + + if (uFirst) { + a = texture2D(tInputLevel, position).r * 255.0; + b = texture2D(tInputLevel, position + vec2(k, 0.0)).r * 255.0; + c = texture2D(tInputLevel, position + vec2(0.0, k)).r * 255.0; + d = texture2D(tInputLevel, position + vec2(k, k)).r * 255.0; + } else { + a = unpackRGBToInt(texture2D(tPreviousLevel, position).rgb); + b = unpackRGBToInt(texture2D(tPreviousLevel, position + vec2(k, 0.0)).rgb); + c = unpackRGBToInt(texture2D(tPreviousLevel, position + vec2(0.0, k)).rgb); + d = unpackRGBToInt(texture2D(tPreviousLevel, position + vec2(k, k)).rgb); + } + gl_FragColor = vec4(packIntToRGB(a + b + c + d), 1.0); + #else + int a, b, c, d; + + if (uFirst) { + a = int(texture2D(tInputLevel, position).r * 255.0); + b = int(texture2D(tInputLevel, position + vec2(k, 0.0)).r * 255.0); + c = int(texture2D(tInputLevel, position + vec2(0.0, k)).r * 255.0); + d = int(texture2D(tInputLevel, position + vec2(k, k)).r * 255.0); + } else { + a = texture2D(tPreviousLevel, position).r; + b = texture2D(tPreviousLevel, position + vec2(k, 0.0)).r; + c = texture2D(tPreviousLevel, position + vec2(0.0, k)).r; + d = texture2D(tPreviousLevel, position + vec2(k, k)).r; + } + gl_FragColor = ivec4(a + b + c + d); + #endif +} +`;var XBe=te(k({},wn),{tInputLevel:Ct("texture","rgba","float","nearest"),tPreviousLevel:Ct("texture","rgba","float","nearest"),uSize:ye("f"),uTexSize:ye("f"),uFirst:ye("b")}),k0="histogram-pyramid";function KBe(e,t,r){if(e.namedComputeRenderables[k0]){let n=e.namedComputeRenderables[k0].values;I.update(n.tInputLevel,t),I.update(n.tPreviousLevel,r),e.namedComputeRenderables[k0].update()}else e.namedComputeRenderables[k0]=QBe(e,t,r);return e.namedComputeRenderables[k0]}function QBe(e,t,r){let n=te(k({},An),{tInputLevel:I.create(t),tPreviousLevel:I.create(r),uSize:I.create(0),uTexSize:I.create(0),uFirst:I.create(!0)}),o=k({},XBe),i=Rr("reduction",Nn,Foe,{},{0:"ivec4"}),s=Jr(e,"triangles",i,o,n);return en(s,n)}function ZBe(e,t){let r=Math.pow(2,t),n=`level${t}`,o=e.isWebGL2?EI(n,e,"image-int32","alpha","int","nearest"):EI(n,e,"image-uint8","rgba","ubyte","nearest");o.define(r,r);let i=JBe(n,e);return i||(i=Ooe(n,e),o.attachFramebuffer(i,0)),{texture:o,framebuffer:i}}function $Be(e){let{gl:t,state:r}=e;r.disable(t.CULL_FACE),r.disable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0)}function Ooe(e,t){let r=`${k0}-${e}`;return t.namedFramebuffers[r]||(t.namedFramebuffers[r]=t.resources.framebuffer()),t.namedFramebuffers[r]}function EI(e,t,r,n,o,i){let s=`${k0}-${e}`;return t.namedTextures[s]||(t.namedTextures[s]=t.resources.texture(r,n,o,i)),t.namedTextures[s]}function JBe(e,t){let r=`${k0}-${e}`;return t.namedFramebuffers[r]}function Noe(e,t,r,n){ot&&e.timer.mark("createHistogramPyramid");let{gl:o,state:i}=e,s=t.getWidth(),a=t.getHeight();if(s!==a||!yg(s))throw new Error("inputTexture must be of square power-of-two size");let l=Math.ceil(Math.log(s)/Math.log(2)),c=Math.pow(2,l),u=Math.pow(2,l),d=Math.pow(2,l-1),m=e.isWebGL2?EI("pyramid",e,"image-int32","alpha","int","nearest"):EI("pyramid",e,"image-uint8","rgba","ubyte","nearest");m.define(u,d);let p=Ooe("pyramid",e);m.attachFramebuffer(p,0),i.viewport(0,0,u,d),Wt(o)?o.clearBufferiv(o.COLOR,0,[0,0,0,0]):o.clear(o.COLOR_BUFFER_BIT);let h=[];for(let b=0;b0&&(I.update(f.values.tPreviousLevel,h[l-b].texture),f.update()),i.currentRenderItemId=-1,i.viewport(0,0,w,w),i.scissor(0,0,w,w),Wt(o)?o.clearBufferiv(o.COLOR,0,[0,0,0,0]):o.clear(o.COLOR_BUFFER_BIT),i.scissor(0,0,n[0],n[1]),f.render(),m.bind(0),o.copyTexSubImage2D(o.TEXTURE_2D,0,y,0,0,0,w,w),m.unbind(0),y+=w}o.finish(),ot&&e.timer.markEnd("createHistogramPyramid");let g=Math.max(1,Loe(e,h[0].texture)),v=Math.ceil(g/Math.pow(2,l));return{pyramidTex:m,count:g,height:v,levels:l,scale:r}}var k_;function Uoe(){if(k_!==void 0)return k_;k_=Jn(16*16,1,Uint8Array);let{array:e}=k_;for(let t=0,r=D0.length;t 16777215.5 ? vec3(1.0) : packIntToRGB(group), 1.0); +} + +void main(void) { + // get 1D index + int vI = int(gl_FragCoord.x) + int(gl_FragCoord.y) * int(uSize); + + // ignore 1D indices outside of the grid + if(vI >= int(uCount)) discard; + + ivec2 offset = ivec2(int(uSize) - 2, 0); + + int start = 0; + ivec4 starts = ivec4(0); + ivec4 ends = ivec4(0); + int diff = 2; + ivec4 m = ivec4(0); + ivec2 position = ivec2(0); + ivec4 vI4 = ivec4(vI); + + ivec2 relativePosition = ivec2(0); + int end = 0; + ivec2 pos1 = ivec2(0); + ivec2 pos2 = ivec2(0); + ivec2 pos3 = ivec2(0); + ivec2 pos4 = ivec2(0); + ivec3 vI3 = ivec3(vI); + ivec3 mask = ivec3(0); + + // traverse the different levels of the pyramid + for(int i = 1; i < 14; i++) { + if(float(i) >= uLevels) break; + + offset.x -= diff; + diff *= 2; + relativePosition = position + offset; + + end = start + pyramidVoxel(vec2(relativePosition)); + pos1 = ivec2(relativePosition); + starts.x = start; + ends.x = end; + pos2 = ivec2(relativePosition + ivec2(1, 0)); + starts.y = ends.x; + ends.y = ends.x + pyramidVoxel(vec2(pos2)); + pos3 = relativePosition + ivec2(0, 1); + starts.z = ends.y; + ends.z = ends.y + pyramidVoxel(vec2(pos3)); + pos4 = relativePosition + ivec2(1, 1); + starts.w = ends.z; + mask = ivec3(greaterThanEqual(vI3, starts.rgb)) * ivec3(lessThan(vI3, ends.rgb)); + m = ivec4(mask, 1 - int(any(bvec3(mask)))); + + relativePosition = m.x * pos1 + m.y * pos2 + m.z * pos3 + m.w * pos4; + start = idot4(m, starts); + position = 2 * (relativePosition - offset); + } + + end = start + int(baseVoxel(vec2(position)).r * 255.0); + pos1 = position; + starts.x = start; + ends.x = end; + pos2 = position + ivec2(1, 0); + starts.y = ends.x; + ends.y = ends.x + int(baseVoxel(vec2(pos2)).r * 255.0); + pos3 = position + ivec2(0, 1); + starts.z = ends.y; + ends.z = ends.y + int(baseVoxel(vec2(pos3)).r * 255.0); + pos4 = position + ivec2(1, 1); + starts.w = ends.z; + mask = ivec3(greaterThanEqual(vI3, starts.rgb)) * ivec3(lessThan(vI3, ends.rgb)); + m = ivec4(mask, 1 - int(any(bvec3(mask)))); + position = m.x * pos1 + m.y * pos2 + m.z * pos3 + m.w * pos4; + + vec2 coord2d = (vec2(position) / uSize) / uScale; + vec3 coord3d = floor(index3dFrom2d(coord2d) + 0.5); + + float edgeIndex = floor(baseVoxel(vec2(position)).a * 255.0 + 0.5); + + // current vertex for the up to 15 MC cases + int currentVertex = vI - idot4(m, starts); + + // ensure winding-order is the same for negative and positive iso-levels + if (uInvert) { + int v = imod(currentVertex + 1, 3); + if (v == 1) currentVertex += 2; + else if (v == 0) currentVertex -= 2; + } + + // get index into triIndices table + int mcIndex = 16 * int(edgeIndex) + currentVertex; + vec4 mcData = texture2D(tTriIndices, vec2(imod(mcIndex, 64), mcIndex / 64) / 64.); + + // bit mask to avoid conditionals (see comment below) for getting MC case corner + vec4 m0 = vec4(floor(mcData.a * 255.0 + 0.5)); + + // get edge value masks + vec4 m1 = vec4(equal(m0, vec4(0., 1., 2., 3.))); + vec4 m2 = vec4(equal(m0, vec4(4., 5., 6., 7.))); + vec4 m3 = vec4(equal(m0, vec4(8., 9., 10., 11.))); + + // apply bit masks + vec3 b0 = coord3d + + m1.y * c1 + + m1.z * c2 + + m1.w * c3 + + m2.x * c4 + + m2.y * c5 + + m2.z * c6 + + m2.w * c7 + + m3.y * c1 + + m3.z * c2 + + m3.w * c3; + vec3 b1 = coord3d + + m1.x * c1 + + m1.y * c2 + + m1.z * c3 + + m2.x * c5 + + m2.y * c6 + + m2.z * c7 + + m2.w * c4 + + m3.x * c4 + + m3.y * c5 + + m3.z * c6 + + m3.w * c7; + + // the conditionals that are avoided by above bitmasks + // vec3 b0 = coord3d; + // vec3 b1 = coord3d; + // if (mcIndex == 0.0) { + // b1 += c1; + // } else if (mcIndex == 1.0) { + // b0 += c1; b1 += c2; + // } else if (mcIndex == 2.0) { + // b0 += c2; b1 += c3; + // } else if (mcIndex == 3.0) { + // b0 += c3; + // } else if (mcIndex == 4.0) { + // b0 += c4; b1 += c5; + // } else if (mcIndex == 5.0) { + // b0 += c5; b1 += c6; + // } else if (mcIndex == 6.0) { + // b0 += c6; b1 += c7; + // } else if (mcIndex == 7.0) { + // b0 += c7; b1 += c4; + // } else if (mcIndex == 8.0) { + // b1 += c4; + // } else if (mcIndex == 9.0) { + // b0 += c1; b1 += c5; + // } else if (mcIndex == 10.0) { + // b0 += c2; b1 += c6; + // } else if (mcIndex == 11.0) { + // b0 += c3; b1 += c7; + // } + // b0 = floor(b0 + 0.5); + // b1 = floor(b1 + 0.5); + + vec4 d0 = voxel(b0); + vec4 d1 = voxel(b1); + + float v0 = d0.a; + float v1 = d1.a; + + float t = (uIsoValue - v0) / (v0 - v1); + gl_FragData[0].xyz = (uGridTransform * vec4(b0 + t * (b0 - b1), 1.0)).xyz; + + // group id + #if __VERSION__ == 100 || defined(dConstantGroup) + // webgl1 does not support 'flat' interpolation (i.e. no interpolation) + // ensure a constant group id per triangle as needed + #ifdef dPackedGroup + gl_FragData[1] = vec4(voxel(coord3d).rgb, 1.0); + #else + gl_FragData[1] = getGroup(coord3d); + #endif + #else + #ifdef dPackedGroup + gl_FragData[1] = vec4(t < 0.5 ? d0.rgb : d1.rgb, 1.0); + #else + gl_FragData[1] = getGroup(t < 0.5 ? b0 : b1); + #endif + #endif + + // normals from gradients + vec3 n0 = -normalize(vec3( + voxelPadded(b0 - c1).a - voxelPadded(b0 + c1).a, + voxelPadded(b0 - c3).a - voxelPadded(b0 + c3).a, + voxelPadded(b0 - c4).a - voxelPadded(b0 + c4).a + )); + vec3 n1 = -normalize(vec3( + voxelPadded(b1 - c1).a - voxelPadded(b1 + c1).a, + voxelPadded(b1 - c3).a - voxelPadded(b1 + c3).a, + voxelPadded(b1 - c4).a - voxelPadded(b1 + c4).a + )); + gl_FragData[2].xyz = -vec3( + n0.x + t * (n0.x - n1.x), + n0.y + t * (n0.y - n1.y), + n0.z + t * (n0.z - n1.z) + ); + + // ensure normal-direction is the same for negative and positive iso-levels + if (uInvert) { + gl_FragData[2].xyz *= -1.0; + } + + // apply normal matrix + gl_FragData[2].xyz *= transpose3(inverse3(mat3(uGridTransform))); +} +`;var Goe=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tTriCount; +uniform sampler2D tVolumeData; + +uniform float uIsoValue; +uniform vec3 uGridDim; +uniform vec3 uGridTexDim; +uniform vec2 uScale; + +#include common + +// cube corners (excluding origin) +const vec3 c1 = vec3(1., 0., 0.); +const vec3 c2 = vec3(1., 1., 0.); +const vec3 c3 = vec3(0., 1., 0.); +const vec3 c4 = vec3(0., 0., 1.); +const vec3 c5 = vec3(1., 0., 1.); +const vec3 c6 = vec3(1., 1., 1.); +const vec3 c7 = vec3(0., 1., 1.); + +vec3 index3dFrom2d(vec2 coord) { + vec2 gridTexPos = coord * uGridTexDim.xy; + vec2 columnRow = ivec2Div(gridTexPos, uGridDim.xy); + vec2 posXY = gridTexPos - columnRow * uGridDim.xy; + float posZ = columnRow.y * intDiv(uGridTexDim.x, uGridDim.x) + columnRow.x; + return vec3(posXY, posZ); +} + +vec4 texture3dFrom2dNearest(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) { + float zSlice = floor(pos.z * gridDim.z + 0.5); // round to nearest z-slice + float column = intDiv(intMod(zSlice * gridDim.x, texDim.x), gridDim.x); + float row = intDiv(zSlice * gridDim.x, texDim.x); + vec2 coord = (vec2(column * gridDim.x, row * gridDim.y) + (pos.xy * gridDim.xy)) / (texDim / uScale); + return texture2D(tex, coord); +} + +vec4 voxel(vec3 pos) { + pos = min(max(vec3(0.0), pos), uGridDim - vec3(1.0)); + return texture3dFrom2dNearest(tVolumeData, pos / uGridDim, uGridDim, uGridTexDim.xy); +} + +void main(void) { + vec2 uv = gl_FragCoord.xy / uGridTexDim.xy; + vec3 posXYZ = index3dFrom2d(uv); + + // get MC case as the sum of corners that are below the given iso level + float c = step(voxel(posXYZ).a, uIsoValue) + + 2. * step(voxel(posXYZ + c1).a, uIsoValue) + + 4. * step(voxel(posXYZ + c2).a, uIsoValue) + + 8. * step(voxel(posXYZ + c3).a, uIsoValue) + + 16. * step(voxel(posXYZ + c4).a, uIsoValue) + + 32. * step(voxel(posXYZ + c5).a, uIsoValue) + + 64. * step(voxel(posXYZ + c6).a, uIsoValue) + + 128. * step(voxel(posXYZ + c7).a, uIsoValue); + c *= step(c, 254.); + + // handle out of bounds positions + posXYZ += 1.0; + posXYZ.xy += 1.0; // pixel padding (usually ok even if the texture has no padding) + if (posXYZ.x >= uGridDim.x || posXYZ.y >= uGridDim.y || posXYZ.z >= uGridDim.z) + c = 0.0; + + // get total triangles to generate for calculated MC case from triCount texture + float totalTrianglesToGenerate = texture2D(tTriCount, vec2(intMod(c, 16.), floor(c / 16.)) / 16.).a; + gl_FragColor = vec4(vec3(totalTrianglesToGenerate * 3.0), c / 255.0); +} +`;var eRe=te(k({},wn),{tTriCount:Ct("image-uint8","alpha","ubyte","nearest"),tVolumeData:Ct("texture","rgba","ubyte","nearest"),uIsoValue:ye("f"),uGridDim:ye("v3"),uGridTexDim:ye("v3"),uScale:ye("v2")}),dp="active-voxels";function tRe(e,t,r,n,o,i){if(e.namedComputeRenderables[dp]){let s=e.namedComputeRenderables[dp].values;I.update(s.uQuadScale,i),I.update(s.tVolumeData,t),I.updateIfChanged(s.uIsoValue,o),I.update(s.uGridDim,r),I.update(s.uGridTexDim,n),I.update(s.uScale,i),e.namedComputeRenderables[dp].update()}else e.namedComputeRenderables[dp]=rRe(e,t,r,n,o,i);return e.namedComputeRenderables[dp]}function rRe(e,t,r,n,o,i){let s=te(k({},An),{tTriCount:I.create(Uoe()),uQuadScale:I.create(i),tVolumeData:I.create(t),uIsoValue:I.create(o),uGridDim:I.create(r),uGridTexDim:I.create(n),uScale:I.create(i)}),a=k({},eRe),l=Rr("active-voxels",Nn,Goe),c=Jr(e,"triangles",l,a,s);return en(c,s)}function nRe(e){let{gl:t,state:r}=e;r.disable(t.CULL_FACE),r.disable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0)}function Hoe(e,t,r,n,o,i){ot&&e.timer.mark("calcActiveVoxels");let{gl:s,state:a,resources:l}=e,c=t.getWidth(),u=t.getHeight();e.namedFramebuffers[dp]||(e.namedFramebuffers[dp]=l.framebuffer());let d=e.namedFramebuffers[dp];d.bind(),e.namedTextures[dp]||(e.namedTextures[dp]=l.texture("image-uint8","rgba","ubyte","nearest"));let m=e.namedTextures[dp];m.define(c,u);let p=tRe(e,t,r,n,o,i);return e.state.currentRenderItemId=-1,m.attachFramebuffer(d,0),nRe(e),a.viewport(0,0,c,u),a.scissor(0,0,c,u),s.clear(s.COLOR_BUFFER_BIT),a.scissor(0,0,n[0],n[1]),p.render(),s.finish(),ot&&e.timer.markEnd("calcActiveVoxels"),m}var oRe=te(k({},wn),{tTriIndices:Ct("image-uint8","alpha","ubyte","nearest"),tActiveVoxelsPyramid:Ct("texture","rgba","float","nearest"),tActiveVoxelsBase:Ct("texture","rgba","float","nearest"),tVolumeData:Ct("texture","rgba","ubyte","nearest"),uIsoValue:ye("f"),uSize:ye("f"),uLevels:ye("f"),uCount:ye("f"),uInvert:ye("b"),uGridDim:ye("v3"),uGridTexDim:ye("v3"),uGridTransform:ye("m4"),uScale:ye("v2"),dPackedGroup:At("boolean"),dAxisOrder:At("string",["012","021","102","120","201","210"]),dConstantGroup:At("boolean")}),M0="isosurface";function iRe(e,t,r,n,o,i,s,a,l,c,u,d,m,p,h){if(e.namedComputeRenderables[M0]){let f=e.namedComputeRenderables[M0].values;I.update(f.tActiveVoxelsPyramid,t),I.update(f.tActiveVoxelsBase,r),I.update(f.tVolumeData,n),I.updateIfChanged(f.uIsoValue,a),I.updateIfChanged(f.uSize,Math.pow(2,l)),I.updateIfChanged(f.uLevels,l),I.updateIfChanged(f.uCount,u),I.updateIfChanged(f.uInvert,d),I.update(f.uGridDim,o),I.update(f.uGridTexDim,i),I.update(f.uGridTransform,s),I.update(f.uScale,c),I.updateIfChanged(f.dPackedGroup,m),I.updateIfChanged(f.dAxisOrder,p.join("")),I.updateIfChanged(f.dConstantGroup,h),e.namedComputeRenderables[M0].update()}else e.namedComputeRenderables[M0]=sRe(e,t,r,n,o,i,s,a,l,c,u,d,m,p,h);return e.namedComputeRenderables[M0]}function sRe(e,t,r,n,o,i,s,a,l,c,u,d,m,p,h){let f=te(k({},An),{tTriIndices:I.create(zoe()),tActiveVoxelsPyramid:I.create(t),tActiveVoxelsBase:I.create(r),tVolumeData:I.create(n),uIsoValue:I.create(a),uSize:I.create(Math.pow(2,l)),uLevels:I.create(l),uCount:I.create(u),uInvert:I.create(d),uGridDim:I.create(o),uGridTexDim:I.create(i),uGridTransform:I.create(s),uScale:I.create(c),dPackedGroup:I.create(m),dAxisOrder:I.create(p.join("")),dConstantGroup:I.create(h)}),y=k({},oRe),g=Rr("isosurface",Nn,Voe,{drawBuffers:"required"}),v=Jr(e,"triangles",g,y,f);return en(v,f)}function aRe(e){let{gl:t,state:r}=e;r.disable(t.CULL_FACE),r.disable(t.BLEND),r.disable(t.DEPTH_TEST),r.disable(t.SCISSOR_TEST),r.depthMask(!1),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0)}function lRe(e,t,r,n,o,i,s,a,l,c,u,d,m,p,h){let{drawBuffers:f}=e.extensions;if(!f)throw new Error("need WebGL draw buffers");ot&&e.timer.mark("createIsosurfaceBuffers");let{gl:y,state:g,resources:v,extensions:b}=e,{pyramidTex:S,height:_,levels:w,scale:E,count:A}=n,P=S.getWidth();e.namedFramebuffers[M0]||(e.namedFramebuffers[M0]=v.framebuffer());let T=e.namedFramebuffers[M0];Wt(y)?(m||(m=v.texture("image-float32","rgba","float","nearest")),p||(p=v.texture("image-uint8","rgba","ubyte","nearest")),h||(h=b.colorBufferHalfFloat&&b.textureHalfFloat?v.texture("image-float16","rgba","fp16","nearest"):v.texture("image-float32","rgba","float","nearest"))):(m||(m=v.texture("image-float32","rgba","float","nearest")),p||(p=v.texture("image-float32","rgba","float","nearest")),h||(h=v.texture("image-float32","rgba","float","nearest"))),m.define(P,_),p.define(P,_),h.define(P,_),m.attachFramebuffer(T,0),p.attachFramebuffer(T,1),h.attachFramebuffer(T,2);let B=iRe(e,S,t,r,o,i,s,a,w,E,A,l,c,u,d);return e.state.currentRenderItemId=-1,T.bind(),f.drawBuffers([f.COLOR_ATTACHMENT0,f.COLOR_ATTACHMENT1,f.COLOR_ATTACHMENT2]),aRe(e),g.viewport(0,0,P,_),y.clear(y.COLOR_BUFFER_BIT),B.render(),y.finish(),ot&&e.timer.markEnd("createIsosurfaceBuffers"),{vertexTexture:m,groupTexture:p,normalTexture:h,vertexCount:A}}function Y1(e,t,r,n,o,i,s,a,l,c,u,d,m,p){ot&&e.timer.mark("extractIsosurface");let h=Hoe(e,t,r,n,s,o),f=Noe(e,h,o,n),y=lRe(e,h,t,f,r,n,i,s,a,l,c,u,d,m,p);return ot&&e.timer.markEnd("extractIsosurface"),y}var qoe={isoValue:Je.IsoValueParam};function cRe(e){return e.extensions.colorBufferFloat&&e.extensions.textureFloat&&e.extensions.drawBuffers}var B_=1;function QO(e,t){if(e.grid.cells.data.lengthPr(t.grid.cells.data.length,1,1,()=>Qi),getLoci:ZO,eachLocation:$O,setUpdateState:(t,r,n,o)=>{Je.IsoValue.areSame(n.isoValue,o.isoValue,r.grid.stats)||(t.createGeometry=!0)},geometryUtils:dt.Utils,mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&QO(t.volume,n)},e)}var XO;(function(e){let t="volume-isosurface-texture";e.descriptor=Pi({name:t});function r(n,o){let{resources:i}=o,s=wo.getGridToCartesianTransform(n.grid),a=x.clone(n.grid.cells.space.dimensions),{width:l,height:c,powerOfTwoSize:u}=Wd(a,B_),d=x.create(l,c,0),m=Ae.create(l/u,c/u);if(u>o.maxTextureSize/2)throw new Error("volume too large for gpu isosurface extraction");if(!n._propertyData[t]){n._propertyData[t]=i.texture("image-uint8","alpha","ubyte","linear");let p=n._propertyData[t];p.define(u,u),p.load(dI(n,"data",B_),!0),n.customProperties.add(e.descriptor),n.customProperties.assets(e.descriptor,[{dispose:()=>p.destroy()}])}return a[0]+=B_,a[1]+=B_,{texture:n._propertyData[t],transform:s,gridDimension:a,gridTexDim:d,gridTexScale:m}}e.get=r})(XO||(XO={}));function pRe(e,t,r,n,o,i){return Y(this,null,function*(){if(!e.webgl)throw new Error("webgl context required to create volume isosurface texture-mesh");if(t.grid.cells.data.length<=1)return ms.createEmpty(i);let{max:s,min:a}=t.grid.stats,l=s-a,c=Je.IsoValue.toAbsolute(o.isoValue,t.grid.stats).absoluteValue,u=(c-a)/l,{texture:d,gridDimension:m,gridTexDim:p,gridTexScale:h,transform:f}=XO.get(t,e.webgl),y=t.grid.cells.space.axisOrderSlowToFast,g=i?.doubleBuffer.get(),v=Y1(e.webgl,d,m,p,h,f,u,c<0,!1,y,!0,g?.vertex,g?.group,g?.normal),b=t.grid.cells.data.length,S=Je.getBoundingSphere(t),_=ms.create(v.vertexCount,b,v.vertexTexture,v.groupTexture,v.normalTexture,S,i);return _.meta.webgl=e.webgl,_})}function fRe(e){return up({defaultProps:C.getDefaultValues(JO),createGeometry:pRe,createLocationIterator:t=>Pr(t.grid.cells.data.length,1,1,()=>Qi),getLoci:ZO,eachLocation:$O,setUpdateState:(t,r,n,o)=>{Je.IsoValue.areSame(n.isoValue,o.isoValue,r.grid.stats)||(t.createGeometry=!0)},geometryUtils:ms.Utils,mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!QO(t.volume,n),dispose:t=>{t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy()}},e)}function hRe(e,t,r,n,o,i){return Y(this,null,function*(){e.runtime.update({message:"Marching cubes..."});let s=as(new Int32Array(t.grid.cells.data.length)),a=yield zb({isoLevel:Je.IsoValue.toAbsolute(o.isoValue,t.grid.stats).absoluteValue,scalarField:t.grid.cells,idField:lr.create(t.grid.cells.space,lr.Data1(s))},i).runAsChild(e.runtime),l=wo.getGridToCartesianTransform(t.grid);return hn.transform(a,l),a.setBoundingSphere(Je.Isosurface.getBoundingSphere(t,o.isoValue)),a})}var Woe=te(k(k({},hn.Params),qoe),{quality:te(k({},hn.Params.quality),{isEssential:!1}),sizeFactor:C.Numeric(3,{min:0,max:10,step:.1})});function gRe(e){return up({defaultProps:C.getDefaultValues(Woe),createGeometry:hRe,createLocationIterator:t=>Pr(t.grid.cells.data.length,1,1,()=>Qi),getLoci:ZO,eachLocation:$O,setUpdateState:(t,r,n,o)=>{Je.IsoValue.areSame(n.isoValue,o.isoValue,r.grid.stats)||(t.createGeometry=!0)},geometryUtils:hn.Utils},e)}var Yoe={solid:(e,t)=>Rh("Isosurface mesh",e,t,uRe,joe),wireframe:(e,t)=>Rh("Isosurface wireframe",e,t,gRe,joe)},Xoe=te(k(k({},JO),Woe),{visuals:C.MultiSelect(["solid"],C.objectToOptions(Yoe)),bumpFrequency:C.Numeric(1,{min:0,max:10,step:.1},We.ShadingCategory)});function yRe(e,t){let r=C.clone(Xoe);return r.isoValue=Je.createIsoValueParam(Je.IsoValue.relative(2),t.grid.stats),r}function vRe(e,t){return Nt.createMulti("Isosurface",e,t,Nt.StateBuilder,Yoe)}var Koe={name:"isosurface",label:"Isosurface",description:"Displays a triangulated isosurface of volumetric data.",factory:vRe,getParams:yRe,defaultValues:C.getDefaultValues(Xoe),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>!Je.isEmpty(e)&&!Je.Segmentation.get(e)};function xRe(e,t,r,n,o,i){return Y(this,null,function*(){let{dimension:{name:s},isoValue:a}=o,{space:l,data:c}=t.grid.cells,{min:u,max:d}=t.grid.stats,m=Je.IsoValue.toAbsolute(a,t.grid.stats).absoluteValue,p="color"in n.color?n.color.color(Qi,!1):Oe(16777215),[h,f,y]=Oe.toRgbNormalized(p),{width:g,height:v,x:b,y:S,z:_,x0:w,y0:E,z0:A,nx:P,ny:T,nz:B}=eN(t.grid,o),D=new Float32Array(s==="x"?[b,0,0,b,S,0,b,0,_,b,S,_]:s==="y"?[0,S,0,b,S,0,0,S,_,b,S,_]:[0,0,_,0,S,_,b,0,_,b,S,_]),M=new Uint8Array(g*v*4),R=bRe(t.grid,o),U=0;for(let q=E;q=m?255:0,U+=4}let F={width:g,height:v,array:M,flipY:!0},N={width:g,height:v,array:R,flipY:!0},z=wo.getGridToCartesianTransform(t.grid);return Nd(z,D,0,4),op.create(F,D,N,i)})}function eN(e,t){let{dimension:{name:r,params:n}}=t,{space:o}=e.cells,i,s,a,l,c,u=0,d=0,m=0,[p,h,f]=o.dimensions;return r==="x"?(a=n,l=h-1,c=f-1,i=f,s=h,u=a,p=u+1):r==="y"?(a=p-1,l=n,c=f-1,i=f,s=p,d=l,h=d+1):(a=p-1,l=h-1,c=n,i=p,s=h,m=c,f=m+1),{width:i,height:s,x:a,y:l,z:c,x0:u,y0:d,z0:m,nx:p,ny:h,nz:f}}function bRe(e,t){let{space:r}=e.cells,{width:n,height:o,x0:i,y0:s,z0:a,nx:l,ny:c,nz:u}=eN(e,t),d=new Uint8Array(n*o*4),m=0;for(let p=s;pPr(t.grid.cells.data.length,1,1,()=>Qi),getLoci:CRe,eachLocation:_Re,setUpdateState:(t,r,n,o,i,s)=>{t.createGeometry=n.dimension.name!==o.dimension.name||n.dimension.params!==o.dimension.params||!Je.IsoValue.areSame(n.isoValue,o.isoValue,r.grid.stats)||!Oi.areEqual(i.color,s.color)},geometryUtils:te(k({},op.Utils),{createRenderableState:t=>{let r=op.Utils.createRenderableState(t);return Qoe(r,t),r},updateRenderableState:Qoe})},e)}function Qoe(e,t){op.Utils.updateRenderableState(e,t),e.opaque=!1,e.writeDepth=!0}function TRe(e,t){return Rh("Slice",e,t,ARe,Zoe)}var $oe={name:"slice",label:"Slice",description:"Slice of volume rendered as image with interpolation.",factory:TRe,getParams:wRe,defaultValues:C.getDefaultValues(tN),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>!Je.isEmpty(e)&&!Je.Segmentation.get(e)};function Joe(e,t){let r=ft();return ft.add(r,e),ft.transform(r,r,t),r}function PRe(e,t,r,n){let o=r.grid.cells.space.dimensions,{width:i,height:s}=Wd(o);if(Math.max(i,s)>t.maxTextureSize/2)throw new Error("volume too large for direct-volume rendering");let a=dI(r,"normals"),l=wo.getGridToCartesianTransform(r.grid),c=Joe(o,l),u=n?n.gridTexture.ref.value:t.resources.texture("image-uint8","rgba","ubyte","linear");u.load(a);let{unitToCartn:d,cellDim:m}=eie(r.grid),p=r.grid.cells.space.axisOrderSlowToFast;return Aa.create(c,o,l,d,m,u,r.grid.stats,!1,p,n)}function eie(e){if(e.transform.kind==="matrix")return{unitToCartn:ne.mul(ne(),e.transform.matrix,ne.fromScaling(ne(),e.cells.space.dimensions)),cellDim:ne.getScaling(x(),e.transform.matrix)};let t=e.transform.fractionalBox,r=ft.size(x(),t);return{unitToCartn:ne.mul3(ne(),e.transform.cell.fromFractional,ne.fromTranslation(ne(),t.min),ne.fromScaling(ne(),r)),cellDim:x.div(x(),e.transform.cell.size,e.cells.space.dimensions)}}function IRe(e,t,r,n){let o=r.grid.cells.space.dimensions;if(Math.max(...o)>t.max3dTextureSize/2)throw new Error("volume too large for direct-volume rendering");let i=ine(r),s=wo.getGridToCartesianTransform(r.grid),a=Joe(o,s),l=n?n.gridTexture.ref.value:t.resources.texture("volume-uint8","rgba","ubyte","linear");l.load(i);let{unitToCartn:c,cellDim:u}=eie(r.grid),d=r.grid.cells.space.axisOrderSlowToFast;return Aa.create(a,o,s,c,u,l,r.grid.stats,!1,d,n)}function ERe(e,t,r,n,o,i){return Y(this,null,function*(){let{runtime:s,webgl:a}=e;if(a===void 0)throw new Error("DirectVolumeVisual requires `webgl` in props");return a.isWebGL2?IRe(s,a,t,i):PRe(s,a,t,i)})}function DRe(e,t){return Je.Loci(e)}function kRe(e,t,r,n,o){let{objectId:i,groupId:s}=e;return o===i?Je.Cell.Loci(t,ve.ofSingleton(s)):nr}function MRe(e,t,r,n,o){return C0(e,t,void 0,o)}var rN=te(k({},Aa.Params),{quality:te(k({},Aa.Params.quality),{isEssential:!1})});function BRe(e,t){let r=C.clone(rN);return r.controlPoints.getVolume=()=>t,r}function RRe(e){return up({defaultProps:C.getDefaultValues(rN),createGeometry:ERe,createLocationIterator:t=>Pr(t.grid.cells.data.length,1,1,()=>Qi),getLoci:kRe,eachLocation:MRe,setUpdateState:(t,r,n,o)=>{},geometryUtils:Aa.Utils,dispose:t=>{t.gridTexture.ref.value.destroy()}},e)}function LRe(e,t){return Rh("Direct Volume",e,t,RRe,DRe)}var tie={name:"direct-volume",label:"Direct Volume",description:"Direct rendering of volumetric data.",factory:LRe,getParams:BRe,defaultValues:C.getDefaultValues(rN),defaultColorTheme:{name:"volume-value"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>!Je.isEmpty(e)&&!Je.Segmentation.get(e)};var FRe={segments:C.Converted(e=>e.map(t=>`${t}`),e=>e.map(t=>parseInt(t)),C.MultiSelect(["0"],C.arrayToOptions(["0"]),{isEssential:!0}))};function ORe(e){return e.extensions.colorBufferFloat&&e.extensions.textureFloat&&e.extensions.drawBuffers}var R_=1;function oN(e,t){if(e.grid.cells.data.length{let n=Je.Segment.Location(t,r);return Pr(t.grid.cells.data.length,1,1,()=>n)},getLoci:nie,eachLocation:oie,setUpdateState:(t,r,n,o)=>{},geometryUtils:dt.Utils,mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&oN(t.volume,n)},e)}var nN="segment-texture";function jRe(e,t,r){let n=Je.Segmentation.get(e);if(!n)throw new Error("missing volume segmentation");let{resources:o}=r,i=ft.clone(n.bounds[t]);ft.expand(i,i,x.create(2,2,2));let s=rie(e.grid,i),a=ft.size(x(),i),{width:l,height:c,powerOfTwoSize:u}=Wd(a,R_),d=x.create(l,c,0),m=Ae.create(l/u,c/u);if(u>r.maxTextureSize/2)throw new Error("volume too large for gpu segment extraction");r.namedTextures[nN]||(r.namedTextures[nN]=o.texture("image-uint8","alpha","ubyte","linear"));let p=r.namedTextures[nN];p.define(u,u);let h=Array.from(n.segments.get(t).values());return p.load(sne(e,h,i,R_),!0),a[0]+=R_,a[1]+=R_,{texture:p,transform:s,gridDimension:a,gridTexDim:d,gridTexScale:m}}function qRe(e,t,r,n,o,i){return Y(this,null,function*(){if(!e.webgl)throw new Error("webgl context required to create volume segment texture-mesh");if(t.grid.cells.data.length<=1)return ms.createEmpty(i);let{texture:s,gridDimension:a,gridTexDim:l,gridTexScale:c,transform:u}=jRe(t,r,e.webgl),d=t.grid.cells.space.axisOrderSlowToFast,m=i?.doubleBuffer.get(),p=Y1(e.webgl,s,a,l,c,u,.5,!1,!1,d,!0,m?.vertex,m?.group,m?.normal),h=t.grid.cells.data.length;return ms.create(p.vertexCount,h,p.vertexTexture,p.groupTexture,p.normalTexture,Je.Segment.getBoundingSphere(t,[r]),i)})}function WRe(e){return up({defaultProps:C.getDefaultValues(iN),createGeometry:qRe,createLocationIterator:(t,r)=>{let n=Je.Segment.Location(t,r);return Pr(t.grid.cells.data.length,1,1,()=>n)},getLoci:nie,eachLocation:oie,setUpdateState:(t,r,n,o)=>{},geometryUtils:ms.Utils,mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!oN(t.volume,n),dispose:t=>{t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy()}},e)}function YRe(e){return Fe.ofUnsortedArray(e.segments)}var iie={segment:(e,t)=>Rh("Segment mesh",e,t,URe,zRe,YRe)},sie=te(k({},iN),{visuals:C.MultiSelect(["segment"],C.objectToOptions(iie)),bumpFrequency:C.Numeric(1,{min:0,max:10,step:.1},We.ShadingCategory)});function XRe(e,t){let r=C.clone(sie),n=Je.Segmentation.get(t);if(n){let o=Array.from(n.segments.keys());r.segments=C.Converted(i=>i.map(s=>`${s}`),i=>i.map(s=>parseInt(s)),C.MultiSelect(o.map(i=>`${i}`),C.arrayToOptions(o.map(i=>`${i}`)),{isEssential:!0}))}return r}function KRe(e,t){return Nt.createMulti("Segment",e,t,Nt.StateBuilder,iie)}var aie={name:"segment",label:"Segment",description:"Displays a triangulated segment of volumetric data.",factory:KRe,getParams:XRe,defaultValues:C.getDefaultValues(sie),defaultColorTheme:{name:"volume-segment"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>!Je.isEmpty(e)&&!!Je.Segmentation.get(e)};var B0=class e extends Db{constructor(){super(),ci(e.BuiltIn,(t,r)=>{if(t.name!==r)throw new Error(`Fix BuiltInVolumeRepresentations to have matching names. ${t.name} ${r}`);this.add(t)})}};(function(e){e.BuiltIn={isosurface:Koe,slice:$oe,"direct-volume":tie,segment:aie}})(B0||(B0={}));function lie(e,t,r,n){e.push({source:t==="em"?{name:"em",params:{isoValue:Je.IsoValue.absolute(n||0)}}:{name:"x-ray",params:{}},dataId:r})}var L_=sa.build({display:{name:"Volume Streaming"},from:ae.Molecule.Structure,params(e,t){let r=DQ(e&&e.data),n=kQ(r,e&&e.data);return{method:C.Select(r,[["em","EM"],["x-ray","X-Ray"]]),entries:C.ObjectList({id:C.Text(n[0]||"")},({id:o})=>o,{defaultValue:n.map(o=>({id:o}))}),defaultView:C.Select(r==="em"?"auto":"selection-box",As.ViewTypeOptions),options:C.Group({serverUrl:C.Text(t.config.get(Tr.VolumeStreaming.DefaultServer)||"https://ds.litemol.org"),behaviorRef:C.Text("",{isHidden:!0}),emContourProvider:C.Select("emdb",[["emdb","EMDB"],["pdbe","PDBe"]],{isHidden:!0}),channelParams:C.Value({},{isHidden:!0})})}},isApplicable:(e,t,r)=>{let n=r.config.get(Tr.VolumeStreaming.CanStream);return n?n(e.data,r):e.data.models.length===1&&Ut.probablyHasDensityMap(e.data.models[0])}})(({ref:e,state:t,params:r},n)=>Pe.create("Volume Streaming",o=>Y(void 0,null,function*(){let i=[];for(let d=0,m=r.entries.length;d0&&(yield n.managers.structure.hierarchy.remove(l?.toArray()));let c=a.cell.obj,u=t.build().to(s.ref).apply(F_,C.getDefaultValues(As.createParams({data:c.data,defaultView:r.defaultView,channelParams:r.options.channelParams})),{ref:r.options.behaviorRef?r.options.behaviorRef:void 0});r.method==="em"?u.apply(DI,{channel:"em"},{state:{isGhost:!0},tags:"em"}):(u.apply(DI,{channel:"2fo-fc"},{state:{isGhost:!0},tags:"2fo-fc"}),u.apply(DI,{channel:"fo-fc(+ve)"},{state:{isGhost:!0},tags:"fo-fc(+ve)"}),u.apply(DI,{channel:"fo-fc(-ve)"},{state:{isGhost:!0},tags:"fo-fc(-ve)"})),yield t.updateTree(u).runInContext(o)}))),uie=sa.build({display:{name:"Boxify Volume Streaming",description:"Make the current box permanent."},from:As,isApplicable:e=>e.data.params.entry.params.view.name==="selection-box"})(({a:e,ref:t,state:r},n)=>{let o=e.data.params;if(o.entry.params.view.name!=="selection-box")return;let i=ft.create(x.clone(o.entry.params.view.params.bottomLeft),x.clone(o.entry.params.view.params.topRight)),s=o.entry.params.view.params.radius;ft.expand(i,i,x.create(s,s,s));let a=te(k({},o),{entry:{name:o.entry.name,params:te(k({},o.entry.params),{view:{name:"box",params:{bottomLeft:i.min,topRight:i.max}}})}});return r.updateTree(r.build().to(t).update(a))}),QRe={dataId:C.Text(""),source:C.MappedStatic("x-ray",{em:C.Group({isoValue:Je.createIsoValueParam(Je.IsoValue.relative(1))}),"x-ray":C.Group({})})};var ZRe=Mt.BuiltIn({name:"create-volume-streaming-info",display:{name:"Volume Streaming Info"},from:ae.Molecule.Structure,to:ab,params(e){return{serverUrl:C.Text("https://ds.litemol.org"),entries:C.ObjectList(QRe,({dataId:t})=>t,{defaultValue:[{dataId:"",source:{name:"x-ray",params:{}}}]})}}})({apply:({a:e,params:t},r)=>Pe.create("",n=>Y(void 0,null,function*(){let o=[];for(let s=0,a=t.entries.length;ss.dataId).join(", ")}`})}))});var F_=Mt.BuiltIn({name:"create-volume-streaming-behavior",display:{name:"Volume Streaming Behavior"},from:ab,to:As,params(e){return As.createParams({data:e&&e.data})}})({canAutoUpdate:({oldParams:e,newParams:t})=>e.entry.params.view===t.entry.params.view||t.entry.params.view.name==="selection-box"||t.entry.params.view.name==="camera-target"||t.entry.params.view.name==="off",apply:({a:e,params:t},r)=>Pe.create("Volume streaming",n=>Y(void 0,null,function*(){let o=new As.Behavior(r,e.data);return yield o.update(t),new As(o,{label:"Volume Streaming",description:o.getDescription()})})),update({a:e,b:t,oldParams:r,newParams:n}){return Pe.create("Update Volume Streaming",o=>Y(this,null,function*(){if(r.entry.name!==n.entry.name&&"em"in n.entry.params.channels){let{emDefaultContourLevel:s}=t.data.infoMap.get(n.entry.name);s&&(n.entry.params.channels.em.isoValue=s)}let i=(yield t.data.update(n))?$e.UpdateResult.Updated:$e.UpdateResult.Unchanged;return t.description=t.data.getDescription(),i}))}});var DI=Mt.BuiltIn({name:"create-volume-streaming-visual",display:{name:"Volume Streaming Visual"},from:As,to:ae.Volume.Representation3D,params:{channel:C.Select("em",As.ChannelTypeOptions,{isHidden:!0})}})({apply:({a:e,params:t,spine:r},n)=>Pe.create("Volume Representation",o=>Y(void 0,null,function*(){var i,s;let a=e.data.channels[t.channel];if(!a)return kn.Null;let l=cie(e.data,t.channel),c=B0.BuiltIn.isosurface,u=l.type.params||{},d=c.factory(k({webgl:(i=n.canvas3d)===null||i===void 0?void 0:i.webgl},n.representation.volume.themes),c.getParams);d.setTheme(Lo.create(n.representation.volume.themes,{volume:a.data},l));let m=(s=r.getAncestorOfType(ae.Molecule.Structure))===null||s===void 0?void 0:s.data,p=m?.models.length===0?void 0:Kp.get(m?.models[0]);return yield d.createOrUpdate(u,a.data).runInContext(o),p&&d.setState({transform:p}),new ae.Volume.Representation3D({repr:d,sourceData:a.data},{label:`${Math.round(a.isoValue.relativeValue*100)/100} \u03C3 [${t.channel}]`})})),update:({a:e,b:t,newParams:r,spine:n},o)=>Pe.create("Volume Representation",i=>Y(void 0,null,function*(){let s=e.data.channels[r.channel];if(!s)return $e.UpdateResult.Unchanged;let a=t.data.repr.state.visible,l=cie(e.data,r.channel),c=k(k({},t.data.repr.props),l.type.params);return t.data.repr.setTheme(Lo.create(o.representation.volume.themes,{volume:s.data},l)),yield t.data.repr.createOrUpdate(c,s.data).runInContext(i),t.data.repr.setState({visible:a}),t.data.sourceData=s.data,$e.UpdateResult.Updated}))});function cie(e,t){let r=e.channels[t];return Zd.getDefaultParamsStatic(e.plugin,"isosurface",{isoValue:r.isoValue,alpha:r.opacity,visuals:r.wireframe?["wireframe"]:["solid"]},"uniform",{value:r.color})}var Zl;(function(e){function t(n){return n}e.create=t;function r(n,o){var i,s;if(o.customDurationMs)return o.customDurationMs;let a=(s=(i=o.definition).getDuration)===null||s===void 0?void 0:s.call(i,o.params,n);if(a?.kind==="fixed")return a.durationMs}e.getDuration=r})(Zl||(Zl={}));var gN={};hi(gN,{Download:()=>mN,DownloadBlob:()=>pN,ImportJson:()=>mLe,ImportString:()=>dLe,LazyVolume:()=>fLe,ParseBlob:()=>tLe,ParseCcp4:()=>lLe,ParseCif:()=>rLe,ParseCube:()=>nLe,ParseDsn6:()=>cLe,ParseDx:()=>uLe,ParseJson:()=>pLe,ParsePly:()=>aLe,ParsePrmtop:()=>iLe,ParsePsf:()=>oLe,ParseTop:()=>sLe,RawData:()=>fN,ReadFile:()=>hN});var Dc;(function(e){function t(a){let l=new DataView(a.buffer);return Object.assign(a.subarray(0),{readInt8:c=>l.getInt8(c),readUInt8:c=>l.getUint8(c),writeInt8:(c,u)=>l.setInt8(u,c),writeUInt8:(c,u)=>l.setUint8(u,c),readInt16LE:c=>l.getInt16(c,!0),readInt32LE:c=>l.getInt32(c,!0),readUInt16LE:c=>l.getUint16(c,!0),readUInt32LE:c=>l.getUint32(c,!0),readFloatLE:c=>l.getFloat32(c,!0),readDoubleLE:c=>l.getFloat64(c,!0),writeInt16LE:(c,u)=>l.setInt16(u,c,!0),writeInt32LE:(c,u)=>l.setInt32(u,c,!0),writeUInt16LE:(c,u)=>l.setUint16(u,c,!0),writeUInt32LE:(c,u)=>l.setUint32(u,c,!0),writeFloatLE:(c,u)=>l.setFloat32(u,c,!0),writeDoubleLE:(c,u)=>l.setFloat64(u,c,!0),readInt16BE:c=>l.getInt16(c,!1),readInt32BE:c=>l.getInt32(c,!1),readUInt16BE:c=>l.getUint16(c,!1),readUInt32BE:c=>l.getUint32(c,!1),readFloatBE:c=>l.getFloat32(c,!1),readDoubleBE:c=>l.getFloat64(c,!1),writeInt16BE:(c,u)=>l.setInt16(u,c,!1),writeInt32BE:(c,u)=>l.setInt32(u,c,!1),writeUInt16BE:(c,u)=>l.setUint16(u,c,!1),writeUInt32BE:(c,u)=>l.setUint32(u,c,!1),writeFloatBE:(c,u)=>l.setFloat32(u,c,!1),writeDoubleBE:(c,u)=>l.setFloat64(u,c,!1),copy:(c,u,d,m)=>(u=Ti(u,0),d=Ti(d,0),m=Ti(m,a.length),c.set(a.subarray(d,m),u),m-d)})}e.fromUint8Array=t;function r(a){return t(new Uint8Array(a))}e.fromArrayBuffer=r;function n(a){return a}e.fromBuffer=n,e.IsNativeEndianLittle=new Uint16Array(new Uint8Array([18,52]).buffer)[0]===13330;function o(a,l,c,u,d){for(let m=0,p=c;m>8&255}}e.flipByteOrderInPlace2=i;function s(a,l,c,u,d){e.IsNativeEndianLittle||!c||u<=1||o(a,l,c,u,d)}e.ensureLittleEndian=s})(Dc||(Dc={}));var Vb;(function(e){function t(r,n){return{name:n,readBuffer:(o,i,s,a)=>{let l,c;if(typeof i=="number"){s=Ti(s,i);let u=o,d=Math.min(r.length,u+s);l=d-u,c=Dc.fromUint8Array(new Uint8Array(r.buffer,u,d-u))}else{s=Ti(s,i.length);let u=o,d=Math.min(r.length,u+s);i.set(r.subarray(u,d),a),l=d-u,c=i}return s!==l&&console.warn(`byteCount ${s} and bytesRead ${l} differ`),Promise.resolve({bytesRead:l,buffer:c})},writeBuffer:(o,i,s)=>(s=Ti(s,i.length),console.error(".writeBuffer not implemented for FileHandle.fromBuffer"),Promise.resolve(0)),writeBufferSync:(o,i,s)=>(s=Ti(s,i.length),console.error(".writeSync not implemented for FileHandle.fromBuffer"),0),close:Ll}}e.fromBuffer=t})(Vb||(Vb={}));var rl=function(e){return e.Float32="float32",e.Int8="int8",e.Int16="int16",e.Uint16="uint16",e}(rl||{});function sN(e){return e===rl.Float32?4:e===rl.Int16||e===rl.Uint16?2:1}function $Re(e,t,r=0,n){return e===rl.Float32?new Float32Array(t,r,n):e===rl.Int16?new Int16Array(t,r,n):e===rl.Uint16?new Uint16Array(t,r,n):new Int8Array(t,r,n)}function die(e,t){let r=sN(t),n=new ArrayBuffer(r*e),o=Dc.fromArrayBuffer(n),i=Dc.IsNativeEndianLittle?n:new ArrayBuffer(r*e);return{type:t,elementByteSize:r,readBuffer:o,valuesBuffer:new Uint8Array(i),values:$Re(t,i)}}function mie(e,t,r,n,o,i){return Y(this,null,function*(){return yield t.readBuffer(r,e.readBuffer,n,o),e.elementByteSize>1&&(i!==void 0&&i!==Dc.IsNativeEndianLittle||!Dc.IsNativeEndianLittle)&&Dc.flipByteOrder(e.readBuffer,e.valuesBuffer,n,e.elementByteSize,o),e.values})}function JRe(e){return Y(this,null,function*(){let{buffer:r}=yield e.readBuffer(0,1024),n=String.fromCharCode(r.readUInt8(52*4),r.readUInt8(52*4+1),r.readUInt8(52*4+2),r.readUInt8(52*4+3));if(n!=="MAP ")throw new Error('ccp4 format error, missing "MAP " string');let o=[r.readUInt8(53*4),r.readUInt8(53*4+1)],i=!1;o[0]===68&&o[1]===65?i=!0:o[0]===17&&o[1]===17?i=!1:r.readInt32LE(12)<=16&&(i=!0);let s=i?c=>r.readInt32LE(c*4):c=>r.readInt32BE(c*4),a=i?c=>r.readFloatLE(c*4):c=>r.readFloatBE(c*4);return{header:{NC:s(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:a(10),yLength:a(11),zLength:a(12),alpha:a(13),beta:a(14),gamma:a(15),MAPC:s(16),MAPR:s(17),MAPS:s(18),AMIN:a(19),AMAX:a(20),AMEAN:a(21),ISPG:s(22),NSYMBT:s(23),LSKFLG:s(24),SKWMAT:[],SKWTRN:[],userFlag1:s(39),userFlag2:s(40),originX:a(49),originY:a(50),originZ:a(51),MAP:n,MACHST:o,ARMS:a(54)},littleEndian:i}})}function e5e(e,t,r,n,o,i){return Y(this,null,function*(){if(fie(e)){let s=3*o;yield r.readBuffer(n,t.readBuffer,o,s);let a=new Int8Array(t.valuesBuffer.buffer,s),l=(e.AMAX-e.AMIN)/255,c=.5*(e.AMIN+e.AMAX+l);for(let u=0,d=o;uY(this,null,function*(){try{return Vr.success(yield r5e(e,t,r))}catch(n){return Vr.error(n)}}))}function hie(e,t){return n5e(Vb.fromBuffer(Dc.fromUint8Array(e),t),e.length)}var lN=512;function i5e(e){return{xStart:parseInt(e.substr(10,5)),yStart:parseInt(e.substr(15,5)),zStart:parseInt(e.substr(20,5)),xExtent:parseInt(e.substr(32,5)),yExtent:parseInt(e.substr(38,5)),zExtent:parseInt(e.substr(42,5)),xRate:parseInt(e.substr(52,5)),yRate:parseInt(e.substr(58,5)),zRate:parseInt(e.substr(62,5)),xlen:parseFloat(e.substr(73,10)),ylen:parseFloat(e.substr(83,10)),zlen:parseFloat(e.substr(93,10)),alpha:parseFloat(e.substr(103,10)),beta:parseFloat(e.substr(113,10)),gamma:parseFloat(e.substr(123,10)),divisor:parseFloat(e.substr(138,12)),summand:parseInt(e.substr(155,8)),sigma:parseFloat(e.substr(170,12))}}function s5e(e,t){let r=t?o=>e.readInt16LE(o*2):o=>e.readInt16BE(o*2),n=1/r(17);return{xStart:r(0),yStart:r(1),zStart:r(2),xExtent:r(3),yExtent:r(4),zExtent:r(5),xRate:r(6),yRate:r(7),zRate:r(8),xlen:r(9)*n,ylen:r(10)*n,zlen:r(11)*n,alpha:r(12)*n,beta:r(13)*n,gamma:r(14)*n,divisor:r(15)/100,summand:r(16),sigma:void 0}}function gie(e){let{xExtent:t,yExtent:r,zExtent:n}=e,o=Math.ceil(t/8),i=Math.ceil(r/8),s=Math.ceil(n/8);return{xBlocks:o,yBlocks:i,zBlocks:s}}function a5e(e){return Y(this,null,function*(){let{buffer:t}=yield e.readBuffer(0,lN),r=String.fromCharCode.apply(null,t),n=r.startsWith(":-)"),o=n||t.readInt16LE(18*2)===100;return{header:n?i5e(r):s5e(t,o),littleEndian:o}})}function l5e(e,t,r,n){return Y(this,null,function*(){n||Dc.flipByteOrderInPlace2(t.buffer);let{divisor:o,summand:i,xExtent:s,yExtent:a,zExtent:l}=e,{xBlocks:c,yBlocks:u,zBlocks:d}=gie(e),m=0;for(let p=0;pY(this,null,function*(){try{return Vr.success(yield u5e(e,t,r))}catch(n){return Vr.error(n)}}))}function yie(e,t){return d5e(Vb.fromBuffer(Dc.fromUint8Array(e),t),e.length)}var p5e={char:1,uchar:1,short:2,ushort:2,int:4,uint:4,float:4,double:8,int8:1,uint8:1,int16:2,uint16:2,int32:4,uint32:4,float32:4,float64:8},f5e=new Set(Object.keys(p5e));function kI(e){if(!f5e.has(e))throw new Error(`unknown ply type '${e}'`);return e}function vie(e,t,r){let n=new Map;for(let o=0,i=t.length;on.get(o)}}function h5e(e,t){let r=pt(e);return{data:e,tokenizer:r,runtimeCtx:t,comments:[],elementSpecs:[],elements:[]}}function g5e(e){let t=e.data.indexOf("end_header",e.position);if(t===-1)throw new Error("no 'end_header' record found");e.tokenStart=e.position,e.tokenEnd=t,e.position=t,pt.eatLine(e)}function y5e(e){let{tokenizer:t,comments:r,elementSpecs:n}=e;g5e(t);let o=pt.getTokenString(t).split(/\r?\n/);if(o[0]!=="ply")throw new Error("data not starting with 'ply'");if(o[1]!=="format ascii 1.0")throw new Error("format not 'ascii 1.0'");let i,s,a;function l(){if(i!==void 0&&s!==void 0&&a!==void 0){let c=!1;for(let u=0,d=a.length;uu.get(d)})}function b5e(e,t){let{elements:r,tokenizer:n}=e,{count:o,property:i}=t,s=Ye.create(n.data,o*2*3),a=new Uint32Array(o+1),l=0;for(let d=0,m=o;d{let m=a[d]+1,p=u.value(m-1);for(let h=m,f=m+p;hl.name),a=vie(n,s,i);return Vr.success(a)})}function bie(e){return Pe.create("Parse PLY",t=>Y(this,null,function*(){return yield S5e(e,t)}))}var{readLine:BI,skipWhitespace:Sie,eatValue:Cie,eatLine:_5e,markStart:cN}=pt,MI=/\s+/,w5e=/(^\*|REMARK)*/;function A5e(e,t){return{tokenizer:e,runtimeCtx:t}}function T5e(e,t){return Y(this,null,function*(){let{tokenizer:r}=e,n=Ye.create(r.data,t*2),o=Ye.create(r.data,t*2),i=Ye.create(r.data,t*2),s=Ye.create(r.data,t*2),a=Ye.create(r.data,t*2),l=Ye.create(r.data,t*2),c=Ye.create(r.data,t*2),u=Ye.create(r.data,t*2),{position:d}=r,m=BI(r).trim();r.position=d;let p=m.split(MI).length===7,h=p?6:8,{length:f}=r,y=0;return yield Ol(e.runtimeCtx,1e5,void 0,g=>{let v=Math.min(t-y,g);for(let b=0;bg.update({message:"Parsing...",current:r.position,max:f})),{count:t,atomId:tr(n)(re.Schema.int),segmentName:p?tr(i)(re.Schema.str):tr(o)(re.Schema.str),residueId:tr(i)(re.Schema.int),residueName:p?tr(i)(re.Schema.str):tr(s)(re.Schema.str),atomName:tr(a)(re.Schema.str),atomType:tr(l)(re.Schema.str),charge:tr(c)(re.Schema.float),mass:tr(u)(re.Schema.float)}})}function P5e(e,t){return Y(this,null,function*(){let{tokenizer:r}=e,n=Ye.create(r.data,t*2),o=Ye.create(r.data,t*2),{length:i}=r,s=0;return yield Ol(e.runtimeCtx,10,void 0,a=>{let l=Math.min(t-s,a);for(let c=0;ca.update({message:"Parsing...",current:r.position,max:i})),{count:t,atomIdA:tr(n)(re.Schema.int),atomIdB:tr(o)(re.Schema.int)}})}function I5e(e,t){let r=[];for(let n=0;nY(this,null,function*(){return yield E5e(e,t)}))}var wie=.529177210859;function D5e(e){let t=pt.readLines(e,6),r=(v,b)=>{let S=+t[v].trim().split(/\s+/g)[b];return Number.isNaN(S)?0:S},n=v=>{let b=r(v+2,0),S=wie;return[Math.abs(b),x.create(r(v+2,1)*S,r(v+2,2)*S,r(v+2,3)*S),b]},o=t[0].trim(),i=t[1].trim(),[s,a,l]=n(0),[c,u]=n(1),[d,m]=n(2),[p,h]=n(3),f=k5e(e,s,wie),y=[];if(l>=0){let v=r(2,4);v===0&&(v=1);for(let b=0;b{let c=Math.min(n,s+a);for(let u=s;ua.update({current:Math.min(c,n),max:n}))}function Aie(e,t){return Pe.create("Parse Cube",r=>Y(this,null,function*(){yield r.update("Reading header...");let n=pt(e),{header:o,atoms:i}=D5e(n),s=yield M5e(r,n,o);return Vr.success({header:o,atoms:i,values:s,name:t})}))}function Tie(e){let t={h:x()},r=0,n=0,o=/\s+/g;for(;;){let i=pt.readLine(e),s;if(i.startsWith("object 1"))s=i.split(o),t.dim=x.create(parseInt(s[5]),parseInt(s[6]),parseInt(s[7]));else if(i.startsWith("origin"))s=i.split(o),t.min=x.create(parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3]));else if(i.startsWith("delta"))s=i.split(o),n===0?t.h[0]=parseFloat(s[1]):n===1?t.h[1]=parseFloat(s[2]):n===2&&(t.h[2]=parseFloat(s[3])),n+=1;else if(i.startsWith("object 3")){r+=i.length+1;break}r+=i.length+1}return{header:t,headerByteCount:r}}function B5e(e,t,r){let n=r.dim[0]*r.dim[1]*r.dim[2],o=100*100*100,i=new Float64Array(n),s=0;return Ol(e,o,i,(a,l)=>{let c=Math.min(n,s+a);for(let u=s;ua.update({current:Math.min(c,n),max:n}))}function R5e(e,t,r){return Y(this,null,function*(){yield e.update("Reading header...");let n=pt(t),{header:o}=Tie(n);yield e.update("Reading values...");let i=yield B5e(e,n,o);return Vr.success({header:o,values:i,name:r})})}function L5e(e,t,r){return Y(this,null,function*(){yield e.update("Reading header...");let n=Tx(t,0,1e3),o=pt(n),{header:i,headerByteCount:s}=Tie(o);yield e.update("Reading values...");let a=i.dim[0]*i.dim[1]*i.dim[2],l=new DataView(t.buffer,t.byteOffset+s),c=new Float64Array(a);for(let u=0;utypeof e=="string"?R5e(r,e,t):L5e(r,e,t))}var F5e={NATOM:"",NTYPES:"",NBONH:"",MBONA:"",NTHETH:"",MTHETA:"",NPHIH:"",MPHIA:"",NHPARM:"",NPARM:"",NNB:"",NRES:"",NBONA:"",NTHETA:"",NPHIA:"",NUMBND:"",NUMANG:"",NPTRA:"",NATYP:"",NPHB:"",IFPERT:"",NBPER:"",NGPER:"",NDPER:"",MBPER:"",MGPER:"",MDPER:"",IFBOX:"",NMXRS:"",IFCAP:"",NUMEXTRA:"",NCOPY:""},Iie=Object.keys(F5e),{readLine:RI,markLine:Eie,trim:O5e}=pt;function N5e(e,t){return{tokenizer:e,runtimeCtx:t}}function U5e(e){let{tokenizer:t}=e,r=[];for(;t.tokenEnd{r[o]=0});let n=0;for(;t.tokenEnd1e5&&t.shouldUpdate&&(i=r.position,yield t.update({current:r.position,max:r.length}));let s=RI(n.tokenizer).trim();if(s.startsWith("%VERSION"))o.version=s.substring(8).trim();else if(s.startsWith("%FLAG")){let a=s.substring(5).trim();if(!RI(n.tokenizer).trim().startsWith("%FORMAT"))throw new Error("expected %FORMAT");if(a==="TITLE")o.title=U5e(n);else if(a==="POINTERS")o.pointers=z5e(n);else if(a==="ATOM_NAME"){let c=R0(n,o.pointers.NATOM,20,4);o.atomName=tr(c)(re.Schema.str)}else if(a==="CHARGE"){let c=R0(n,o.pointers.NATOM,5,16);o.charge=tr(c)(re.Schema.float)}else if(a==="MASS"){let c=R0(n,o.pointers.NATOM,5,16);o.mass=tr(c)(re.Schema.float)}else if(a==="RESIDUE_LABEL"){let c=R0(n,o.pointers.NRES,20,4);o.residueLabel=tr(c)(re.Schema.str)}else if(a==="RESIDUE_POINTER"){let c=R0(n,o.pointers.NRES,10,8);o.residuePointer=tr(c)(re.Schema.int)}else if(a==="BONDS_INC_HYDROGEN"){let c=R0(n,o.pointers.NBONH*3,10,8);o.bondsIncHydrogen=tr(c)(re.Schema.int)}else if(a==="BONDS_WITHOUT_HYDROGEN"){let c=R0(n,o.pointers.NBONA*3,10,8);o.bondsWithoutHydrogen=tr(c)(re.Schema.int)}else if(a==="RADII"){let c=R0(n,o.pointers.NATOM,5,16);o.radii=tr(c)(re.Schema.float)}else for(;r.tokenEndY(this,null,function*(){return yield V5e(e,t)}))}var G5e={nr:re.Schema.Int(),type:re.Schema.Str(),resnr:re.Schema.Int(),residu:re.Schema.Str(),atom:re.Schema.Str(),cgnr:re.Schema.Int(),charge:re.Schema.Float(),mass:re.Schema.Float()},H5e={ai:re.Schema.Int(),aj:re.Schema.Int()},j5e={compound:re.Schema.Str(),molCount:re.Schema.Int()},{readLine:uN,markLine:L0,skipWhitespace:F0,markStart:LI,eatValue:dN,eatLine:q5e}=pt;function W5e(e,t){return{tokenizer:e,runtimeCtx:t}}var Y5e=/\[ (.+) \]/,X5e=/\s+/;function K5e(e){let{tokenizer:t}=e,r;for(;t.tokenEnd=t.length));){let o=t.data[t.position];if(o==="[")break;if(o===";"||o==="*"){L0(t);continue}for(let i=0;i<2;++i)switch(F0(t),LI(t),dN(t),i){case 0:Ye.add(r,t.tokenStart,t.tokenEnd);break;case 1:Ye.add(n,t.tokenStart,t.tokenEnd);break}q5e(t),LI(t)}return cr.ofColumns(j5e,{compound:tr(r)(re.Schema.str),molCount:tr(n)(re.Schema.int)})}function eLe(e,t){return Y(this,null,function*(){let r=pt(e),n=W5e(r,t),o=Object.create(null),i=0;o.compounds={};let s={},a="";function l(){a&&s.atoms&&(o.compounds[a]=s,s={},a="")}for(;r.tokenEnd1e5&&t.shouldUpdate&&(i=r.position,yield t.update({current:r.position,max:r.length}));let c=uN(n.tokenizer).trim();if(!(!c||c[0]==="*"||c[0]===";")){if(c.startsWith("#include"))throw new Error("#include statements not allowed");if(c.startsWith("[")){let u=c.match(Y5e);if(u===null)throw new Error("expected field name");let d=u[1];if(d==="moleculetype")l(),a=K5e(n);else if(d==="atoms")s.atoms=Q5e(n);else if(d==="bonds")s.bonds=Z5e(n);else if(d==="system")o.system=$5e(n);else if(d==="molecules")l(),o.molecules=J5e(n);else for(;r.tokenEndY(this,null,function*(){return yield eLe(e,t)}))}var mN=Mt.BuiltIn({name:"download",display:{name:"Download",description:"Download string or binary data from the specified URL"},from:[ae.Root],to:[ae.Data.String,ae.Data.Binary],params:{url:C.Url("https://www.ebi.ac.uk/pdbe/static/entry/1cbs_updated.cif",{description:"Resource URL. Must be the same domain or support CORS."}),label:C.Optional(C.Text("")),isBinary:C.Optional(C.Boolean(!1,{description:"If true, download data as binary (string otherwise)"}))}})({apply({params:e,cache:t},r){return Pe.create("Download",n=>Y(this,null,function*(){let o=Or.getUrlAsset(r.managers.asset,e.url),i=yield r.managers.asset.resolve(o,e.isBinary?"binary":"string").runInContext(n);return t.asset=i,e.isBinary?new ae.Data.Binary(i.data,{label:e.label?e.label:o.url}):new ae.Data.String(i.data,{label:e.label?e.label:o.url})}))},dispose({cache:e}){var t;(t=e?.asset)===null||t===void 0||t.dispose()},update({oldParams:e,newParams:t,b:r}){return e.url!==t.url||e.isBinary!==t.isBinary?$e.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||(typeof t.url=="string"?t.url:t.url.url),$e.UpdateResult.Updated):$e.UpdateResult.Unchanged}}),pN=Mt.BuiltIn({name:"download-blob",display:{name:"Download Blob",description:"Download multiple string or binary data from the specified URLs."},from:ae.Root,to:ae.Data.Blob,params:{sources:C.ObjectList({id:C.Text("",{label:"Unique ID"}),url:C.Url("https://www.ebi.ac.uk/pdbe/static/entry/1cbs_updated.cif",{description:"Resource URL. Must be the same domain or support CORS."}),isBinary:C.Optional(C.Boolean(!1,{description:"If true, download data as binary (string otherwise)"})),canFail:C.Optional(C.Boolean(!1,{description:"Indicate whether the download can fail and not be included in the blob as a result."}))},e=>`${e.id}: ${e.url}`),maxConcurrency:C.Optional(C.Numeric(4,{min:1,max:12,step:1},{description:"The maximum number of concurrent downloads."}))}})({apply({params:e,cache:t},r){return Pe.create("Download Blob",n=>Y(this,null,function*(){let o=[],i=yield IY(n,r.managers.asset,e.sources,e.maxConcurrency||4),s=[];for(let a=0;aY(this,null,function*(){if(typeof e.data=="string")return new ae.Data.String(e.data,{label:e.label?e.label:"String"});if(Array.isArray(e.data))return new ae.Data.Binary(new Uint8Array(e.data),{label:e.label?e.label:"Binary"});if(e.data instanceof ArrayBuffer)return new ae.Data.Binary(new Uint8Array(e.data),{label:e.label?e.label:"Binary"});if(e.data instanceof Uint8Array)return new ae.Data.Binary(e.data,{label:e.label?e.label:"Binary"});_r(e.data)}))},update({oldParams:e,newParams:t,b:r}){return e.data!==t.data?$e.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||r.label,$e.UpdateResult.Updated):$e.UpdateResult.Unchanged},customSerialization:{toJSON(e){if(typeof e.data=="string"||Array.isArray(e.data))return e;if(e.data instanceof ArrayBuffer){let t=new Uint8Array(e.data),r=new Array(t.length);for(let n=0,o=t.length;nY(this,null,function*(){if(e.file===null)return r.log.error("No file(s) selected"),kn.Null;let o=yield r.managers.asset.resolve(e.file,e.isBinary?"binary":"string").runInContext(n);return t.asset=o,e.isBinary?new ae.Data.Binary(o.data,{label:e.label?e.label:e.file.name}):new ae.Data.String(o.data,{label:e.label?e.label:e.file.name})}))},dispose({cache:e}){var t;(t=e?.asset)===null||t===void 0||t.dispose()},update({oldParams:e,newParams:t,b:r}){var n;return e.label!==t.label?(r.label=t.label||((n=e.file)===null||n===void 0?void 0:n.name)||"",$e.UpdateResult.Updated):$e.UpdateResult.Unchanged},isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user loaded files."})}),tLe=Mt.BuiltIn({name:"parse-blob",display:{name:"Parse Blob",description:"Parse multiple data enties"},from:ae.Data.Blob,to:ae.Format.Blob,params:{formats:C.ObjectList({id:C.Text("",{label:"Unique ID"}),format:C.Select("cif",[["cif","cif"]])},e=>`${e.id}: ${e.format}`)}})({apply({a:e,params:t},r){return Pe.create("Parse Blob",n=>Y(this,null,function*(){let o=new Map;for(let s of t.formats)o.set(s.id,s.format);let i=[];for(let s of e.data){if(!o.has(s.id))continue;let a=yield(s.kind==="string"?Vl.parse(s.data):Vl.parseBinary(s.data)).runInContext(n);if(a.isError)throw new Error(`${s.id}: ${a.message}`);i.push({id:s.id,kind:"cif",data:a.result})}return new ae.Format.Blob(i,{label:"Format Blob",description:`${i.length} ${i.length===1?"entry":"entries"}`})}))}}),rLe=Mt.BuiltIn({name:"parse-cif",display:{name:"Parse CIF",description:"Parse CIF from String or Binary data"},from:[ae.Data.String,ae.Data.Binary],to:ae.Format.Cif})({apply({a:e}){return Pe.create("Parse CIF",t=>Y(this,null,function*(){let r=yield(typeof e.data=="string"?Vl.parse(e.data):Vl.parseBinary(e.data)).runInContext(t);if(r.isError)throw new Error(r.message);return r.result.blocks.length===0?kn.Null:new ae.Format.Cif(r.result)}))}}),nLe=Mt.BuiltIn({name:"parse-cube",display:{name:"Parse Cube",description:"Parse Cube from String data"},from:ae.Data.String,to:ae.Format.Cube})({apply({a:e}){return Pe.create("Parse Cube",t=>Y(this,null,function*(){let r=yield Aie(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Cube(r.result)}))}}),oLe=Mt.BuiltIn({name:"parse-psf",display:{name:"Parse PSF",description:"Parse PSF from String data"},from:[ae.Data.String],to:ae.Format.Psf})({apply({a:e}){return Pe.create("Parse PSF",t=>Y(this,null,function*(){let r=yield _ie(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Psf(r.result)}))}}),iLe=Mt.BuiltIn({name:"parse-prmtop",display:{name:"Parse PRMTOP",description:"Parse PRMTOP from String data"},from:[ae.Data.String],to:ae.Format.Prmtop})({apply({a:e}){return Pe.create("Parse PRMTOP",t=>Y(this,null,function*(){let r=yield Die(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Prmtop(r.result)}))}}),sLe=Mt.BuiltIn({name:"parse-top",display:{name:"Parse TOP",description:"Parse TOP from String data"},from:[ae.Data.String],to:ae.Format.Top})({apply({a:e}){return Pe.create("Parse TOP",t=>Y(this,null,function*(){let r=yield kie(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Top(r.result)}))}}),aLe=Mt.BuiltIn({name:"parse-ply",display:{name:"Parse PLY",description:"Parse PLY from String data"},from:[ae.Data.String],to:ae.Format.Ply})({apply({a:e}){return Pe.create("Parse PLY",t=>Y(this,null,function*(){let r=yield bie(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Ply(r.result,{label:r.result.comments[0]||"PLY Data"})}))}}),lLe=Mt.BuiltIn({name:"parse-ccp4",display:{name:"Parse CCP4/MRC/MAP",description:"Parse CCP4/MRC/MAP from Binary data"},from:[ae.Data.Binary],to:ae.Format.Ccp4})({apply({a:e}){return Pe.create("Parse CCP4/MRC/MAP",t=>Y(this,null,function*(){let r=yield hie(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Ccp4(r.result)}))}}),cLe=Mt.BuiltIn({name:"parse-dsn6",display:{name:"Parse DSN6/BRIX",description:"Parse CCP4/BRIX from Binary data"},from:[ae.Data.Binary],to:ae.Format.Dsn6})({apply({a:e}){return Pe.create("Parse DSN6/BRIX",t=>Y(this,null,function*(){let r=yield yie(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Dsn6(r.result)}))}}),uLe=Mt.BuiltIn({name:"parse-dx",display:{name:"Parse DX",description:"Parse DX from Binary/String data"},from:[ae.Data.Binary,ae.Data.String],to:ae.Format.Dx})({apply({a:e}){return Pe.create("Parse DX",t=>Y(this,null,function*(){let r=yield Pie(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ae.Format.Dx(r.result)}))}}),dLe=Mt.BuiltIn({name:"import-string",display:{name:"Import String",description:"Import given data as a string"},from:ae.Root,to:ae.Data.String,params:{data:C.Value(""),label:C.Optional(C.Text(""))}})({apply({params:{data:e,label:t}}){return new ae.Data.String(e,{label:t||""})},update({oldParams:e,newParams:t,b:r}){return e.data!==t.data?$e.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||"",$e.UpdateResult.Updated):$e.UpdateResult.Unchanged},isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user imported strings."})}),mLe=Mt.BuiltIn({name:"import-json",display:{name:"Import JSON",description:"Import given data as a JSON"},from:ae.Root,to:ae.Format.Json,params:{data:C.Value({}),label:C.Optional(C.Text(""))}})({apply({params:{data:e,label:t}}){return new ae.Format.Json(e,{label:t||""})},update({oldParams:e,newParams:t,b:r}){return e.data!==t.data?$e.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||"",$e.UpdateResult.Updated):$e.UpdateResult.Unchanged},isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user imported JSON."})}),pLe=Mt.BuiltIn({name:"parse-json",display:{name:"Parse JSON",description:"Parse JSON from String data"},from:[ae.Data.String],to:ae.Format.Json})({apply({a:e}){return Pe.create("Parse JSON",t=>Y(this,null,function*(){let r=yield new Response(e.data).json();return new ae.Format.Json(r)}))}}),fLe=Mt.BuiltIn({name:"lazy-volume",display:{name:"Lazy Volume",description:"A placeholder for lazy loaded volume representation"},from:ae.Root,to:ae.Volume.Lazy,params:{url:C.Url(""),isBinary:C.Boolean(!1),format:C.Text("ccp4"),entryId:C.Value("",{isHidden:!0}),isovalues:C.ObjectList({type:C.Text("relative"),value:C.Numeric(0),color:C.Color(Yt.black),alpha:C.Numeric(1,{min:0,max:1,step:.01}),volumeIndex:C.Numeric(0)},e=>`${e.type} ${e.value}`)}})({apply({a:e,params:t}){return Pe.create("Lazy Volume",r=>Y(this,null,function*(){let n=Array.isArray(t.entryId)?t.entryId.join(", "):t.entryId;return new ae.Volume.Lazy(t,{label:`${n||t.url}`,description:"Lazy Volume"})}))}});var yN={};hi(yN,{CreateGroup:()=>hLe});var hLe=Mt.BuiltIn({name:"create-group",display:{name:"Group"},from:[],to:ae.Group,params:{label:C.Text("Group"),description:C.Optional(C.Text(""))}})({apply({params:e}){return new ae.Group({},e)},update({oldParams:e,newParams:t,b:r}){return zp(e,t)?$e.UpdateResult.Unchanged:(r.label=t.label,r.description=t.description,$e.UpdateResult.Updated)}});var YN={};hi(YN,{CoordinatesFromDcd:()=>fOe,CoordinatesFromNctraj:()=>yOe,CoordinatesFromTrr:()=>gOe,CoordinatesFromXtc:()=>hOe,CustomModelProperties:()=>qN,CustomStructureProperties:()=>WN,ModelFromTrajectory:()=>jN,MultiStructureSelectionFromExpression:()=>NOe,ShapeFromPly:()=>jOe,StructureComplexElement:()=>GOe,StructureComplexElementTypes:()=>rae,StructureComponent:()=>HOe,StructureFromModel:()=>LOe,StructureFromTrajectory:()=>ROe,StructureSelectionFromBundle:()=>zOe,StructureSelectionFromExpression:()=>OOe,StructureSelectionFromScript:()=>UOe,TopologyFromPrmtop:()=>xOe,TopologyFromPsf:()=>vOe,TopologyFromTop:()=>bOe,TrajectoryFromBlob:()=>COe,TrajectoryFromCifCore:()=>kOe,TrajectoryFromCube:()=>DOe,TrajectoryFromGRO:()=>AOe,TrajectoryFromMOL:()=>POe,TrajectoryFromMOL2:()=>EOe,TrajectoryFromMmCif:()=>_Oe,TrajectoryFromModelAndCoordinates:()=>GI,TrajectoryFromPDB:()=>wOe,TrajectoryFromSDF:()=>IOe,TrajectoryFromXYZ:()=>TOe,TransformStructureConformation:()=>FOe});function gLe(e){let t=new DataView(e.buffer),r=Object.create(null),n=[],o=0,i=new Int32Array(e.buffer,0,23),s=i[0]!==t.getInt32(0);if(i[0]!==84){let f=e.byteLength;for(let y=0;y0)throw new Error("dcd format with fixed atoms unsupported, aborting");let p=r.NATOM,h=p*4;for(let f=0,y=r.NSET;fY(this,null,function*(){try{let r=gLe(e);return Vr.success(r)}catch(r){return Vr.error(r)}}))}function Bie(e){return function(t,r,n){return yLe(e,t,r,n)}}function yLe(e,t,r,n){let{data:o,indices:i,count:s}=e,{valueType:a}=n,l=a==="str"?c=>{let u=i[2*c]+t,d=i[2*c+1];if(u>=d)return"";let m=u+r;return m>d&&(m=d),EW(o,u,m)}:a==="int"?c=>{let u=i[2*c]+t;return u>i[2*c+1]?0:Zf(o,u,u+r)}:c=>{let u=i[2*c]+t;return u>i[2*c+1]?0:QG(o,u,u+r)};return{schema:n,__array:void 0,isDefined:!0,rowCount:s,value:l,valueKind:c=>0,toArray:c=>Xo.createAndFillArray(s,l,c),areValuesEqual:(c,u)=>l(c)===l(u)}}function vLe(){return{title:"",timeInPs:0,hasVelocities:!1,precision:{position:0,velocity:0},box:[0,0,0]}}function xLe(e,t){return{tokenizer:e,header:vLe(),numberOfAtoms:0,runtimeCtx:t}}function bLe(e){let{tokenizer:t,header:r}=e,n=pt.readLine(t);n.trim().length===0&&(n=pt.readLine(t));let o=n.lastIndexOf("t=");o>=0?(r.timeInPs=parseFloat(n.substring(o+2)),r.title=n.substring(0,o).trim(),r.title&&r.title[r.title.length-1]===","&&(r.title=r.title.substring(0,r.title.length-1))):r.title=n}function SLe(e){let{tokenizer:t}=e;pt.markLine(t);let r=pt.getTokenString(t);e.numberOfAtoms=parseInt(r)}function CLe(e){return Y(this,null,function*(){let{tokenizer:t,numberOfAtoms:r}=e,n=yield pt.readLinesAsync(t,r,e.runtimeCtx,1e5),i=t.data.substring(n.indices[0],n.indices[1]).substring(20).match(/\.\d+/g),s=i.length===6;e.header.hasVelocities=s,e.header.precision.position=i[0].length-1,e.header.precision.velocity=s?i[3].length-1:0;let a=20,l=e.header.precision.position+5,c=a+3*l,u=e.header.precision.velocity+4,d=Bie(n),m=re.Undefined(e.numberOfAtoms,re.Schema.float);return{count:e.numberOfAtoms,residueNumber:d(0,5,re.Schema.int),residueName:d(5,5,re.Schema.str),atomName:d(10,5,re.Schema.str),atomNumber:d(15,5,re.Schema.int),x:d(a,l,re.Schema.float),y:d(a+l,l,re.Schema.float),z:d(a+2*l,l,re.Schema.float),vx:s?d(c,u,re.Schema.float):m,vy:s?d(c+u,u,re.Schema.float):m,vz:s?d(c+2*u,u,re.Schema.float):m}})}function _Le(e){let{tokenizer:t}=e,r=pt.readLine(t).trim().split(/\s+/g);e.header.box=[+r[0],+r[1],+r[2]]}function wLe(e,t){return Y(this,null,function*(){let r=pt(e);yield t.update({message:"Parsing...",current:0,max:e.length});let n=[];for(;r.positionY(this,null,function*(){return yield wLe(e,t)}))}function Lie(e,t,r=!1){return Pe.create("Parse PDB",n=>Y(this,null,function*(){return Vr.success({lines:yield pt.readAllLinesAsync(e,n),id:t,isPdbqt:r})}))}function Uie(e){let t=e&&e.getElement("vertex"),r=e&&e.getElement("material"),n={group:"",vRed:"",vGreen:"",vBlue:"",mRed:"",mGreen:"",mBlue:""},o=[["",""]],i=[["",""]];if(t){for(let l=0,c=t.propertyNames.length;l{let h=o==="material"?p:c[p];return Oe.fromRgb(i.value(h),s.value(h),a.value(h))},()=>1,p=>`${u} ${l[p]}`,m)}function ELe(){let e,t,r,n,o,i;return(a,l,c,u)=>Y(this,null,function*(){let d=l.source.getElement("vertex");if(!d)throw new Error("missing vertex element");let m=l.source.getElement("face");if(!m)throw new Error("missing face element");let p=l.source.getElement("material"),h=!1,f=!1;return(!e||e!==e)&&(h=!0),(!t||!C.isParamEqual(Fie.grouping,t.grouping,c.grouping))&&(h=!0),(!t||!C.isParamEqual(Fie.coloring,t.coloring,c.coloring))&&(f=!0),h?(o=Oie(d,p,c),i=ILe(d,c),n=yield PLe(a,d,m,i.ids,u&&u.geometry),r=Nie(l,n,o,i)):f&&(o=Oie(d,p,c),r=Nie(l,n,o,i)),e=l,t=ba(c),r})}function zie(e,t){return Pe.create("Shape Provider",r=>Y(this,null,function*(){return{label:"Mesh",data:{source:e,transforms:t?.transforms},params:Uie(e),getShape:ELe(),geometryUtils:dt.Utils}}))}function Qu(){return Qu.empty()}(function(e){function t(o,i){return{size:o,anglesInRadians:i}}e.create=t;function r(){return t(x(),x())}e.empty=r;function n(o,i,s){let a=x.magnitude(o),l=x.magnitude(i),c=x.magnitude(s),u=Math.acos(x.dot(i,s)/(l*c)),d=Math.acos(x.dot(o,s)/(a*c)),m=Math.acos(x.dot(o,i)/(a*l));return a<=0||l<=0||c<=0||u>=Math.PI||d>=Math.PI||m>=Math.PI?r():t(x.create(a,l,c),x.create(u,d,m))}e.fromBasis=n})(Qu||(Qu={}));var DLe=20.45482949774598;function Vie(e){return Pe.create("Parse DCD",t=>Y(this,null,function*(){yield t.update("Converting to coordinates");let{header:r}=e,n=r.DELTA?La(r.DELTA*DLe,"ps"):La(1,"step"),o=r.ISTART>=1?La((r.ISTART-1)*n.value,n.unit):La(0,n.unit),i=[];for(let s=0,a=e.frames.length;s=-1&&u[1]<=1&&u[3]>=-1&&u[3]<=1&&u[4]>=-1&&u[4]<=1?c.cell=Qu.create(x.create(u[0],u[2],u[5]),x.create(Cr(90-Math.asin(u[1])*90/r1),Cr(90-Math.asin(u[3])*90/r1),Cr(90-Math.asin(u[4])*90/r1))):u[0]<0||u[1]<0||u[2]<0||u[3]<0||u[4]<0||u[5]<0||u[3]>180||u[4]>180||u[5]>180?c.cell=Qu.fromBasis(x.create(u[0],u[1],u[3]),x.create(u[1],u[2],u[4]),x.create(u[3],u[4],u[5])):c.cell=Qu.create(x.create(u[0],u[2],u[5]),x.create(Cr(jn(u[1],0,1e-6)?90:u[1]),Cr(jn(u[3],0,1e-6)?90:u[3]),Cr(jn(u[4],0,1e-6)?90:u[4])))}i.push(c)}return Cd.create(i,n,o)}))}function Gb(e,t,r,n){let o=r,i=n-1,s=t.charCodeAt(o);for(;(s===32||s>=48&&s<=57)&&o<=i;)s=t.charCodeAt(++o);for(s=t.charCodeAt(i);(s===32||s>=48&&s<=57)&&i>=o;)s=t.charCodeAt(--i);if(++i,o===i)return Ye.add(e,o,i);if(o+1===i)return Ye.add(e,o,i);if(s=t.charCodeAt(o),o+2===i){let a=t.charCodeAt(o+1);if((s===78||s===110)&&(a===65||a===97)||(s===67||s===99)&&(a===76||a===108)||(s===70||s===102)&&(a===69||a===101)||(s===83||s===115)&&(a===73||a===105)||(s===66||s===98)&&(a===82||a===114)||(s===65||s===97)&&(a===83||a===115))return Ye.add(e,o,o+2)}if(s===67||s===99||s===72||s===104||s===78||s===110||s===79||s===111||s===80||s===112||s===83||s===115)return Ye.add(e,o,o+1);Ye.add(e,o,o)}var kLe=new Set(["NA","CL","FE","SI","BR","AS","LI"]),MLe=new Set(["C","H","N","O","P","S","F","B"]),BLe=/^[\s\d]+|[\s\d]+$/g;function em(e,t){e=e.replace(BLe,"").toUpperCase();let r=e.length;if(r===0||r===1||kLe.has(e))return e;if(r===3&&t===e){if(e==="SOD")return"NA";if(e==="POT")return"K";if(e==="CES")return"CS";if(e==="CAL")return"CA";if(e==="CLA")return"CL"}return MLe.has(e[0])?e[0]:""}var vN="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function RLe(e){let t=vN.length,r=e,n=0,o=vN[r%t];for(;r>=t;)r=Math.floor(r/t),o+=vN[r%t],n+=1;return n>=5&&console.warn("getChainId overflow"),o}var Fh=gh(RLe);function LLe(e,t){let r=e.atomName,n=e.residueName,o=new Array(e.count),i=new Array(e.count),s=new Uint32Array(e.count),a=new Uint32Array(e.count),l=new Array(e.count),c=new Wi,u=new Yi(e.residueNumber,e.atomName),d="",m=0,p="",h=0,f=0,y=-1;for(let b=0,S=e.count;bb*10,Float32Array)),Cartn_y:re.ofFloatArray(re.mapToArray(e.y,b=>b*10,Float32Array)),Cartn_z:re.ofFloatArray(re.mapToArray(e.z,b=>b*10,Float32Array)),id:re.ofIntArray(a),label_asym_id:g,label_atom_id:r,label_comp_id:n,label_seq_id:re.ofIntArray(s),label_entity_id:re.ofStringArray(o),occupancy:re.ofConst(1,e.count,re.Schema.float),type_symbol:re.ofStringArray(l),pdbx_PDB_model_num:re.ofConst(t,e.count,re.Schema.int)},e.count);return us({entity:c.getEntityTable(),chem_comp:u.getChemCompTable(),atom_site:v})}var xN;(function(e){function t(n){return n?.kind==="gro"}e.is=t;function r(n){return{kind:"gro",name:n.structures[0].header.title,data:n}}e.fromGro=r})(xN||(xN={}));function Gie(e){return Pe.create("Parse GRO",t=>Y(this,null,function*(){let r=xN.fromGro(e),n=[];for(let o=0,i=e.structures.length;o(t.substr(i,s)||"").trim(),n={entry_id:gt.ofString(e),length_a:gt.ofString(r(6,9)),length_b:gt.ofString(r(15,9)),length_c:gt.ofString(r(24,9)),angle_alpha:gt.ofString(r(33,7)),angle_beta:gt.ofString(r(40,7)),angle_gamma:gt.ofString(r(47,7)),Z_PDB:gt.ofString(r(66,4)),pdbx_unique_axis:gt.ofString("?")},o={entry_id:gt.ofString(e),"space_group_name_H-M":gt.ofString(r(55,11)),Int_Tables_number:gt.ofString("?"),cell_setting:gt.ofString("?"),space_group_name_Hall:gt.ofString("?")};return[vi.ofFields("cell",n),vi.ofFields("symmetry",o)]}function Hie(e,t){return{id:e,details:t,groups:[]}}function qie(e,t,r){let n=[],o,i,s,a=1,l=1,c=f=>e.data.substring(e.indices[2*f],e.indices[2*f+1]);for(let f=t;ff.id)),details:gt.ofStrings(n.map(f=>f.details))},d=[];for(let f of n)for(let y of f.groups)d.push({assembly_id:f.id,oper_expression:y.operators.map(g=>g.id).join(","),asym_id_list:y.chains.join(",")});let m={assembly_id:gt.ofStrings(d.map(f=>f.assembly_id)),oper_expression:gt.ofStrings(d.map(f=>f.oper_expression)),asym_id_list:gt.ofStrings(d.map(f=>f.asym_id_list))},p=[];for(let f of n)for(let y of f.groups)for(let g of y.operators){let v={id:""+g.id,type:"?",name:"?",symmetry_operation:"?"};for(let b=0;b<3;b++){for(let S=0;S<3;S++)v[`matrix[${b+1}][${S+1}]`]=""+ne.getValue(g.matrix,b,S);v[`vector[${b+1}]`]=""+ne.getValue(g.matrix,b,3)}p.push(v)}let h={id:gt.ofStrings(p.map(f=>f.id)),type:gt.ofStrings(p.map(f=>f.type)),name:gt.ofStrings(p.map(f=>f.name)),symmetry_operation:gt.ofStrings(p.map(f=>f.symmetry_operation))};for(let f=0;f<3;f++){for(let g=0;g<3;g++){let v=`matrix[${f+1}][${g+1}]`;h[v]=gt.ofStrings(p.map(b=>b[v]))}let y=`vector[${f+1}]`;h[y]=gt.ofStrings(p.map(g=>g[y]))}return[vi.ofFields("pdbx_struct_assembly",u),vi.ofFields("pdbx_struct_assembly_gen",m),vi.ofFields("pdbx_struct_oper_list",h)]}function Wie(e,t,r){let n=[],o,i=c=>e.data.substring(e.indices[2*c],e.indices[2*c+1]);for(let c=t;cc.id)),code:gt.ofStrings(s.map(c=>c.code)),details:gt.ofStrings(s.map(c=>c.details))};for(let c=0;c<3;c++){for(let d=0;d<3;d++){let m=`matrix[${c+1}][${d+1}]`;l[m]=gt.ofStrings(s.map(p=>p[m]))}let u=`vector[${c+1}]`;l[u]=gt.ofStrings(s.map(d=>d[u]))}return[vi.ofFields("struct_ncs_oper",l)]}var FLe={1:"helx_rh_al_p",2:"helx_rh_om_p",3:"helx_rh_pi_p",4:"helx_rh_ga_p",5:"helx_rh_3t_p",6:"helx_lh_al_p",7:"helx_lh_om_p",8:"helx_lh_ga_p",9:"helx_rh_27_p",10:"helx_rh_pp_p"};function OLe(e){return FLe[e]||"helx_p"}function Yie(e,t,r){let n=[],o=u=>e.data.substring(e.indices[2*u],e.indices[2*u+1]);for(let u=t;uu.initChainID)),s=gt.ofStrings(n.map(u=>u.initResName)),a=gt.ofStrings(n.map(u=>u.endChainID)),l=gt.ofStrings(n.map(u=>u.endResName)),c={beg_label_asym_id:i,beg_label_comp_id:s,beg_label_seq_id:gt.ofUndefined(n.length,re.Schema.int),beg_auth_asym_id:i,beg_auth_comp_id:s,beg_auth_seq_id:gt.ofStrings(n.map(u=>u.initSeqNum)),conf_type_id:gt.ofStrings(n.map(u=>OLe(u.helixClass))),details:gt.ofStrings(n.map(u=>u.comment)),end_label_asym_id:a,end_label_comp_id:l,end_label_seq_id:gt.ofUndefined(n.length,re.Schema.int),end_auth_asym_id:a,end_auth_comp_id:l,end_auth_seq_id:gt.ofStrings(n.map(u=>u.endSeqNum)),id:gt.ofStrings(n.map(u=>u.serNum)),pdbx_beg_PDB_ins_code:gt.ofStrings(n.map(u=>u.initICode)),pdbx_end_PDB_ins_code:gt.ofStrings(n.map(u=>u.endICode)),pdbx_PDB_helix_class:gt.ofStrings(n.map(u=>u.helixClass)),pdbx_PDB_helix_length:gt.ofStrings(n.map(u=>u.length)),pdbx_PDB_helix_id:gt.ofStrings(n.map(u=>u.helixID))};return vi.ofFields("struct_conf",c)}function Xie(e,t,r){let n=[],o=m=>e.data.substring(e.indices[2*m],e.indices[2*m+1]);for(let m=t;mm.initChainID)),s=gt.ofStrings(n.map(m=>m.initResName)),a=gt.ofStrings(n.map(m=>m.initSeqNum)),l=gt.ofStrings(n.map(m=>m.endChainID)),c=gt.ofStrings(n.map(m=>m.endResName)),u=gt.ofStrings(n.map(m=>m.endSeqNum)),d={beg_label_asym_id:i,beg_label_comp_id:s,beg_label_seq_id:a,beg_auth_asym_id:i,beg_auth_comp_id:s,beg_auth_seq_id:a,end_label_asym_id:l,end_label_comp_id:l,end_label_seq_id:u,end_auth_asym_id:l,end_auth_comp_id:c,end_auth_seq_id:u,id:gt.ofStrings(n.map(m=>m.strand)),sheet_id:gt.ofStrings(n.map(m=>m.sheetID)),pdbx_beg_PDB_ins_code:gt.ofStrings(n.map(m=>m.initICode)),pdbx_end_PDB_ins_code:gt.ofStrings(n.map(m=>m.endICode))};return vi.ofFields("struct_sheet_range",d)}var NLe={MOL_ID:"",MOLECULE:"",CHAIN:"",FRAGMENT:"",SYNONYM:"",EC:"",ENGINEERED:"",MUTATION:"",OTHER_DETAILS:""};function Kie(e,t,r){let n=l=>e.data.substring(e.indices[2*l],e.indices[2*l+1]),o,i={chains:[],description:""},s=[];for(let l=t;le.data.substring(e.indices[2*i],e.indices[2*i+1]),o=new Map;for(let i=t;i[],n=()=>Ye.create(e,2*t);return{index:0,group_PDB:n(),id:r(),auth_atom_id:n(),label_alt_id:n(),auth_comp_id:n(),auth_asym_id:n(),auth_seq_id:n(),pdbx_PDB_ins_code:n(),Cartn_x:n(),Cartn_y:n(),Cartn_z:n(),occupancy:n(),B_iso_or_equiv:n(),type_symbol:n(),pdbx_PDB_model_num:r(),label_entity_id:r(),partial_charge:n()}}function $ie(e,t,r){let n=gt.ofStrings(e.pdbx_PDB_model_num),o=gt.ofTokens(e.auth_asym_id),i=gt.ofTokens(e.auth_seq_id),s=gt.ofTokens(e.pdbx_PDB_ins_code),a=gt.ofTokens(e.auth_atom_id),l=gt.ofTokens(e.auth_comp_id),c=gt.ofStrings(e.id),u=n.str(0),d=o.str(0),m=i.int(0),p=s.str(0),h=d,f=m,y=new Map,g=new Map,v=[],b=[],S=[],_=!1;for(let P=0,T=c.rowCount;P=66?Ye.addToken(e.B_iso_or_equiv,pt.trim(r,n+60,n+66)):Ye.add(e.B_iso_or_equiv,0,0),i&&Ye.addToken(e.partial_charge,pt.trim(r,n+70,n+76)),a>=78&&!i?(pt.trim(r,n+76,n+78),r.tokenStart[],n=()=>new Float32Array(t),o=()=>Ye.create(e,2*t);return{index:0,count:t,id:r(),type_symbol:o(),pdbx_label_atom_id:o(),pdbx_label_alt_id:o(),pdbx_label_comp_id:o(),pdbx_label_asym_id:o(),pdbx_label_seq_id:o(),pdbx_PDB_ins_code:o(),"U[1][1]":n(),"U[2][2]":n(),"U[3][3]":n(),"U[1][2]":n(),"U[1][3]":n(),"U[2][3]":n(),pdbx_auth_seq_id:o(),pdbx_auth_comp_id:o(),pdbx_auth_asym_id:o(),pdbx_auth_atom_id:o()}}function ese(e){let t=gt.ofTokens(e.pdbx_auth_seq_id),r=gt.ofTokens(e.pdbx_auth_comp_id),n=gt.ofTokens(e.pdbx_auth_asym_id),o=gt.ofTokens(e.pdbx_auth_atom_id),i={id:gt.ofStrings(e.id),type_symbol:gt.ofTokens(e.type_symbol),pdbx_label_atom_id:o,pdbx_label_alt_id:gt.ofTokens(e.pdbx_label_alt_id),pdbx_label_comp_id:r,pdbx_label_asym_id:n,pdbx_label_seq_id:t,pdbx_PDB_ins_code:gt.ofTokens(e.pdbx_PDB_ins_code),pdbx_auth_seq_id:t,pdbx_auth_comp_id:r,pdbx_auth_asym_id:n,pdbx_auth_atom_id:o};return i["U[1][1]"]=gt.ofNumbers(e["U[1][1]"]),i["U[2][2]"]=gt.ofNumbers(e["U[2][2]"]),i["U[3][3]"]=gt.ofNumbers(e["U[3][3]"]),i["U[1][2]"]=gt.ofNumbers(e["U[1][2]"]),i["U[1][3]"]=gt.ofNumbers(e["U[1][3]"]),i["U[2][3]"]=gt.ofNumbers(e["U[2][3]"]),i}function tse(e,t,r,n,o){let{data:i}=r,s=o-n;pt.trim(r,n+6,n+11),e.id[e.index]=i.substring(r.tokenStart,r.tokenEnd),Ye.addToken(e.pdbx_auth_atom_id,pt.trim(r,n+12,n+16)),i.charCodeAt(n+16)===32?Ye.add(e.pdbx_label_alt_id,0,0):Ye.add(e.pdbx_label_alt_id,n+16,n+17),Ye.addToken(e.pdbx_auth_comp_id,pt.trim(r,n+17,n+20)),Ye.add(e.pdbx_auth_asym_id,n+21,n+22),Ye.addToken(e.pdbx_auth_seq_id,pt.trim(r,n+22,n+26)),i.charCodeAt(n+26)===32?Ye.add(e.pdbx_PDB_ins_code,0,0):Ye.add(e.pdbx_PDB_ins_code,n+26,n+27),e["U[1][1]"][e.index]=Zf(i,n+28,n+35)/1e4,e["U[2][2]"][e.index]=Zf(i,n+35,n+42)/1e4,e["U[3][3]"][e.index]=Zf(i,n+42,n+49)/1e4,e["U[1][2]"][e.index]=Zf(i,n+49,n+56)/1e4,e["U[1][3]"][e.index]=Zf(i,n+56,n+63)/1e4,e["U[2][3]"][e.index]=Zf(i,n+63,n+70)/1e4,s>=78?(pt.trim(r,n+76,n+78),r.tokenStarte.data.substring(e.indices[2*E],e.indices[2*E+1]),s=[],a=[],l=[],c=[],u=[],d=[],m=[],p=[],h=[],f=[],y=[],g=[],v=[],b=[],S=[11,16,21,26],_=1;for(let E=t;EM||T[M]===void 0&&(s.push(`covale${_}`),a.push("covale"),l.push(n.label_asym_id.str(P)),c.push(n.label_seq_id.int(P)),u.push(n.auth_seq_id.int(P)),d.push(n.label_atom_id.str(P)),m.push(n.label_alt_id.str(P)),p.push(n.pdbx_PDB_ins_code.str(P)),h.push(n.label_asym_id.str(M)),f.push(n.label_seq_id.int(M)),y.push(n.auth_seq_id.int(M)),g.push(n.label_atom_id.str(M)),v.push(n.label_alt_id.str(M)),b.push(n.pdbx_PDB_ins_code.str(M)),_+=1))}}let w={id:gt.ofStrings(s),conn_type_id:gt.ofStrings(a),ptnr1_label_asym_id:gt.ofStrings(l),ptnr1_label_seq_id:gt.ofNumbers(c),ptnr1_auth_seq_id:gt.ofNumbers(u),ptnr1_label_atom_id:gt.ofStrings(d),pdbx_ptnr1_label_alt_id:gt.ofStrings(m),pdbx_ptnr1_PDB_ins_code:gt.ofStrings(p),ptnr2_label_asym_id:gt.ofStrings(h),ptnr2_label_seq_id:gt.ofNumbers(f),ptnr2_auth_seq_id:gt.ofNumbers(y),ptnr2_label_atom_id:gt.ofStrings(g),pdbx_ptnr2_label_alt_id:gt.ofStrings(v),pdbx_ptnr2_PDB_ins_code:gt.ofStrings(b)};return vi.ofFields("struct_conn",w)}function nse(e,t,r,n){let o=e.substring(t,r);n.id_code=o.substring(62,66).trim()||void 0,n.dep_date=o.substring(50,59).trim()||void 0,n.classification=o.substring(10,50).trim()||void 0}function ose(e){return Y(this,null,function*(){let{lines:t}=e,{data:r,indices:n}=t,o=pt(r),i=!!e.isPdbqt,s=0,a=0;for(let T=0,B=t.count;TY(this,null,function*(){var r;yield t.update("Converting to mmCIF");let n=yield ose(e),o=rn.fromFrame(n,void 0,SN.create(e)),i=us(o.data.db,!0),s=yield _a(i,o,t),a=(r=n.categories.atom_site)===null||r===void 0?void 0:r.getField("partial_charge");if(a&&s.frameCount===1){let l=s.representative,c=l.atomicHierarchy.atomSourceIndex,d=re.isIdentity(c)?void 0:c.toArray({array:Int32Array}),m=a.toFloatArray(),p=d?re.ofFloatArray(re.mapToArray(c,h=>m[h],Float32Array)):re.ofFloatArray(m);Ah.Provider.set(l,{data:p,type:"GASTEIGER"})}return s}))}function ULe(e){let t=new Array(e.count),r=new Array(e.count),n=new Uint32Array(e.count),o=new Uint32Array(e.count),i=new Array(e.count),s=new Wi,a=new Yi(e.residueId,e.atomName),l="",c=0,u="",d=0,m=e.segmentName.value(0),p=!1,h=0,f=-1;for(let g=0,v=e.count;gY(this,null,function*(){let r=CN.fromPsf(e),n=ULe(e.atoms),{atomIdA:o,atomIdB:i}=e.bonds,s={indexA:re.ofLambda({value:a=>o.value(a)-1,rowCount:o.rowCount,schema:o.schema}),indexB:re.ofLambda({value:a=>i.value(a)-1,rowCount:i.rowCount,schema:i.schema}),order:re.ofConst(1,e.bonds.count,re.Schema.int)};return xg.create(e.id,n,s,r)}))}var Hb={dynamicBonds:C.Optional(C.Boolean(!1,{description:"Ensure bonds are recalculated upon model changes. Also enables calculation of inter-unit bonds in water molecules and ions."}))},pf;(function(e){function t(l,c){let u=l&&ao.Provider.get(l),d=u?u.assemblies.map(g=>[g.id,`${g.id}: ${Us(g.details)}`]):[],m=u?!ui.isZero(u.spacegroup.cell):!0,p=[];if(u){let{operators:g}=u.spacegroup;for(let v=0,b=g.length;v{let v=g.id===g.auth_id?g.id:`${g.id} [auth ${g.auth_id}]`;h.push([g.id,v])});let f={auto:C.Group(Hb),model:C.Group(Hb),assembly:C.Group(k({id:C.Optional(l?C.Select(d.length?d[0][0]:"",d,{label:"Asm Id",description:"Assembly Id"}):C.Text("",{label:"Asm Id",description:"Assembly Id (use empty for the 1st assembly)"}))},Hb),{isFlat:!0}),"symmetry-mates":C.Group(k({radius:C.Numeric(5,{min:0,max:50,step:1})},Hb),{isFlat:!0}),symmetry:C.Group(k({ijkMin:C.Vec3(x.create(-1,-1,-1),{step:1},{label:"Min IJK",fieldLabels:{x:"I",y:"J",z:"K"}}),ijkMax:C.Vec3(x.create(1,1,1),{step:1},{label:"Max IJK",fieldLabels:{x:"I",y:"J",z:"K"}})},Hb),{isFlat:!0}),"symmetry-assembly":C.Group(k({generators:C.ObjectList({operators:C.ObjectList({index:C.Select(0,p),shift:C.Vec3(x(),{step:1},{label:"IJK",fieldLabels:{x:"I",y:"J",z:"K"}})},g=>`${g.index+1}_${g.shift.map(v=>v+5).join("")}`,{defaultValue:[]}),asymIds:C.MultiSelect([],h)},g=>`${g.asymIds.length} asym ids, ${g.operators.length} operators`,{defaultValue:[]})},Hb),{isFlat:!0})},y=[];return c==="auto"&&y.push(["auto","Auto"]),y.push(["model","Model"]),d.length>0&&y.push(["assembly","Assembly"]),m&&(y.push(["symmetry-mates","Symmetry Mates"]),y.push(["symmetry","Symmetry (indices)"]),y.push(["symmetry-assembly","Symmetry (assembly)"])),{type:C.MappedStatic(c||"model",f,{options:y})}}e.getParams=t;function r(l,c){return!(c.name==="symmetry-assembly"||c.name==="symmetry"&&l.name==="symmetry")}e.canAutoUpdate=r;function n(l,c,u,d,m){return Y(this,null,function*(){let p,h=ao.Provider.get(u);!d&&h&&h.assemblies.length!==0&&(d=h.assemblies[0].id),!h||h.assemblies.length===0?l.log.warn(`Model '${u.entryId}' has no assembly, returning model structure.`):(p=ch.findAssembly(u,d||""),p||l.log.warn(`Model '${u.entryId}' has no assembly called '${d}', returning model structure.`));let f=Me.ofModel(u,m);if(!p){let v={label:"Model",description:Me.elementDescription(f)};return new ae.Molecule.Structure(f,v)}d=p.id;let y=yield xc.buildAssembly(f,d).runInContext(c),g={label:`Assembly ${d}`,description:Me.elementDescription(y)};return new ae.Molecule.Structure(y,g)})}function o(l,c,u,d,m){return Y(this,null,function*(){let p=Me.ofModel(c,m),h=yield xc.buildSymmetryRange(p,u,d).runInContext(l),f={label:`Symmetry [${u}] to [${d}]`,description:Me.elementDescription(h)};return new ae.Molecule.Structure(h,f)})}function i(l,c,u,d){return Y(this,null,function*(){let m=Me.ofModel(c,d),p=yield xc.builderSymmetryMates(m,u).runInContext(l),h={label:"Symmetry Mates",description:Me.elementDescription(p)};return new ae.Molecule.Structure(p,h)})}function s(l,c,u,d,m){return Y(this,null,function*(){let p=Me.ofModel(c,m),h=yield xc.buildSymmetryAssembly(p,u,d).runInContext(l),f={label:"Symmetry Assembly",description:Me.elementDescription(h)};return new ae.Molecule.Structure(h,f)})}function a(l,c,u,d){return Y(this,null,function*(){let m=d?.params,p=ao.Provider.get(u);if(!p||!d||d.name==="model"){let h=Me.ofModel(u,m);return new ae.Molecule.Structure(h,{label:"Model",description:Me.elementDescription(h)})}if(d.name==="auto")if(p.assemblies.length===0){let h=Me.ofModel(u,m);return new ae.Molecule.Structure(h,{label:"Model",description:Me.elementDescription(h)})}else return n(l,c,u,void 0,m);if(d.name==="assembly")return n(l,c,u,d.params.id,m);if(d.name==="symmetry")return o(c,u,d.params.ijkMin,d.params.ijkMax,m);if(d.name==="symmetry-mates")return i(c,u,d.params.radius,m);if(d.name==="symmetry-assembly")return s(c,u,d.params.generators,p,m);_r(d)})}e.create=a})(pf||(pf={}));var nl;(function(e){function t(a,l,c){return a.currentStructure!==c?!1:eo.is(l)?!!a.script&&eo.areEqual(a.script,l):a.expression===l}e.isUnchanged=t;function r(a,l){let c=eo.is(l)?l:void 0,u=eo.is(l)?eo.toExpression(l):l,d=ip(u);return{script:c,expression:u,compiled:d,originalStructure:a,currentStructure:a}}e.create=r;function n(a,l){return a.compiled(new Mi(l))}e.run=n;function o(a,l){let c=r(a,l);return{entry:c,selection:n(c,a)}}e.createAndRun=o;function i(a,l){return a.currentStructure=l,a.compiled(new Mi(l))}e.updateStructure=i;function s(a,l,c){let u=lt.unionStructure(l);a.label=`${c||"Selection"}`,a.description=Me.elementDescription(u),a.data=u}e.updateStructureObject=s})(nl||(nl={}));var ase={H:"Hydrogen",HE:"Helium",LI:"Lithium",BE:"Beryllium",B:"Boron",C:"Carbon",N:"Nitrogen",O:"Oxygen",F:"Fluorine",NE:"Neon",NA:"Sodium",MG:"Magnesium",AL:"Aluminum",SI:"Silicon",P:"Phosphorus",S:"Sulfur",CL:"Chlorine",AR:"Argon",K:"Potassium",CA:"Calcium",SC:"Scandium",TI:"Titanium",V:"Vanadium",CR:"Chromium",MN:"Manganese",FE:"Iron",CO:"Cobalt",NI:"Nickel",CU:"Copper",ZN:"Zinc",GA:"Gallium",GE:"Germanium",AS:"Arsenic",SE:"Selenium",BR:"Bromine",KR:"Krypton",RB:"Rubidium",SR:"Strontium",Y:"Yttrium",ZR:"Zirconium",NB:"Niobium",MO:"Molybdenum",TC:"Technetium",RU:"Ruthenium",RH:"Rhodium",PD:"Palladium",AG:"Silver",CD:"Cadmium",IN:"Indium",SN:"Tin",SB:"Antimony",TE:"Tellurium",I:"Iodine",XE:"Xenon",CS:"Cesium",BA:"Barium",LA:"Lanthanum",CE:"Cerium",PR:"Praseodymium",ND:"Neodymium",PM:"Promethium",SM:"Samarium",EU:"Europium",GD:"Gadolinium",TB:"Terbium",DY:"Dysprosium",HO:"Holmium",ER:"Erbium",TM:"Thulium",YB:"Ytterbium",LU:"Lutetium",HF:"Hafnium",TA:"Tantalum",W:"Wolfram",RE:"Rhenium",OS:"Osmium",IR:"Iridium",PT:"Platinum",AU:"Gold",HG:"Mercury",TL:"Thallium",PB:"Lead",BI:"Bismuth",PO:"Polonium",AT:"Astatine",RN:"Radon",FR:"Francium",RA:"Radium",AC:"Actinium",TH:"Thorium",PA:"Protactinium",U:"Uranium",NP:"Neptunium",PU:"Plutonium",AM:"Americium",CM:"Curium",BK:"Berkelium",CF:"Californium",ES:"Einsteinium",FM:"Fermium",MD:"Mendelevium",NO:"Nobelium",LR:"Lawrencium",RF:"Rutherfordium",DB:"Dubnium",SG:"Seaborgium",BH:"Bohrium",HS:"Hassium",MT:"Meitnerium",DS:"Darmstadtium",RG:"Roentgenium",CN:"Copernicium",NH:"Nihonium",FL:"Flerovium",MC:"Moscovium",LV:"Livermorium",TS:"Tennessine",OG:"Oganesson"},zLe=new Set(["LI","NA","K","RB","CS","FR"]);function VLe(e){return zLe.has(e)}var GLe=new Set(["BE","MG","CA","SR","BA","RA"]);function HLe(e){return GLe.has(e)}var jLe=new Set(["ZN","GA","CD","IN","SN","HG","TI","PB","BI","PO","CN"]);function qLe(e){return jLe.has(e)}var WLe=new Set(["F","CL","BR","I","AT"]);function _N(e){return WLe.has(e)}function wN(e){let t=jg(e);return t>=21&&t<=29||t>=39&&t<=47||t>=72&&t<=79||t>=104&&t<=108}function YLe(e){let t=jg(e);return t>=57&&t<=71}function XLe(e){let t=jg(e);return t>=89&&t<=103}function lse(e){return VLe(e)||HLe(e)||YLe(e)||XLe(e)||wN(e)||qLe(e)}var Un=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}(Un||{});function Bn(e,t,r={}){var n;let o;return{label:e,expression:t,description:r.description||"",category:(n=r.category)!==null&&n!==void 0?n:Un.Misc,isHidden:!!r.isHidden,priority:r.priority||0,referencesCurrent:!!r.referencesCurrent,get query(){return o||(o=ip(t)),o},ensureCustomProperties:r.ensureCustomProperties,getSelection(s,a,l){return Y(this,null,function*(){let c=s.managers.structure.selection.getStructure(l),u=c?lt.Sequence(l,[c]):lt.Empty(l);return r.ensureCustomProperties&&(yield r.ensureCustomProperties({runtime:a,assetManager:s.managers.asset},l)),o||(o=ip(t)),o(new Mi(l,{currentSelection:u}))})}}}var KLe=Bn("All",oe.struct.generator.all(),{category:"",priority:1e3}),QLe=Bn("Current Selection",oe.internal.generator.current(),{category:"",referencesCurrent:!0}),ZLe=Bn("Polymer",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.logic.and([oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),oe.core.str.match([oe.re("(polypeptide|cyclic-pseudo-peptide|peptide-like|nucleotide|peptide nucleic acid)","i"),oe.ammp("entitySubtype")])])})]),{category:Un.Type}),$Le=Bn("Trace",oe.struct.modifier.union([oe.struct.combinator.merge([oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),"chain-test":oe.core.set.has([oe.set("sphere","gaussian"),oe.ammp("objectPrimitive")])})]),oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"atom-test":oe.core.set.has([oe.set("CA","P"),oe.ammp("label_atom_id")])})])])]),{category:Un.Structure}),jb=oe.core.logic.and([oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),oe.core.str.match([oe.re("(polypeptide|cyclic-pseudo-peptide|peptide-like)","i"),oe.ammp("entitySubtype")])]),OI=oe.core.logic.and([oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),oe.core.str.match([oe.re("(nucleotide|peptide nucleic acid)","i"),oe.ammp("entitySubtype")])]),X1=oe.core.str.match([oe.re("non-polymer|(amino|carboxy) terminus|peptide-like","i"),oe.ammp("chemCompType")]),JLe=Bn("Backbone",oe.struct.modifier.union([oe.struct.combinator.merge([oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":jb,"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.logic.not([X1]),"atom-test":oe.core.set.has([oe.set(...Dn.toArray(Ru)),oe.ammp("label_atom_id")])})]),oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":OI,"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.logic.not([X1]),"atom-test":oe.core.set.has([oe.set(...Dn.toArray(xx)),oe.ammp("label_atom_id")])})])])]),{category:Un.Structure}),eFe=Bn("Sidechain",oe.struct.modifier.union([oe.struct.combinator.merge([oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":jb,"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.logic.not([X1]),"atom-test":oe.core.logic.or([oe.core.logic.not([oe.core.set.has([oe.set(...Dn.toArray(Ru)),oe.ammp("label_atom_id")])])])})]),oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":OI,"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.logic.not([X1]),"atom-test":oe.core.logic.or([oe.core.logic.not([oe.core.set.has([oe.set(...Dn.toArray(xx)),oe.ammp("label_atom_id")])])])})])])]),{category:Un.Structure}),tFe=Bn("Sidechain with Trace",oe.struct.modifier.union([oe.struct.combinator.merge([oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":jb,"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.logic.not([X1]),"atom-test":oe.core.logic.or([oe.core.logic.not([oe.core.set.has([oe.set(...Dn.toArray(Ru)),oe.ammp("label_atom_id")])]),oe.core.rel.eq([oe.ammp("label_atom_id"),"CA"]),oe.core.logic.and([oe.core.rel.eq([oe.ammp("auth_comp_id"),"PRO"]),oe.core.rel.eq([oe.ammp("label_atom_id"),"N"])])])})]),oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":OI,"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.logic.not([X1]),"atom-test":oe.core.logic.or([oe.core.logic.not([oe.core.set.has([oe.set(...Dn.toArray(xx)),oe.ammp("label_atom_id")])]),oe.core.rel.eq([oe.ammp("label_atom_id"),"P"])])})])])]),{category:Un.Structure}),rFe=Bn("Protein",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":jb})]),{category:Un.Type}),nFe=Bn("Nucleic",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":OI})]),{category:Un.Type}),oFe=Bn("Helix",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":jb,"residue-test":oe.core.flags.hasAny([oe.ammp("secondaryStructureFlags"),oe.core.type.bitflags([2])])})]),{category:Un.Structure,ensureCustomProperties:(e,t)=>wa.attach(e,t)}),iFe=Bn("Beta Strand/Sheet",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":jb,"residue-test":oe.core.flags.hasAny([oe.ammp("secondaryStructureFlags"),oe.core.type.bitflags([4])])})]),{category:Un.Structure,ensureCustomProperties:(e,t)=>wa.attach(e,t)}),sFe=Bn("Water",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entityType"),"water"])})]),{category:Un.Type}),aFe=Bn("Ion",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entitySubtype"),"ion"])})]),{category:Un.Type}),lFe=Bn("Lipid",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entitySubtype"),"lipid"])})]),{category:Un.Type}),NI=Bn("Carbohydrate",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.logic.or([oe.core.rel.eq([oe.ammp("entityType"),"branched"]),oe.core.logic.and([oe.core.rel.eq([oe.ammp("entityType"),"non-polymer"]),oe.core.str.match([oe.re("oligosaccharide","i"),oe.ammp("entitySubtype")])])])})]),{category:Un.Type}),cse=Bn("Carbohydrate with Connected",oe.struct.modifier.union([oe.struct.modifier.includeConnected({0:NI.expression,"layer-count":1,"as-whole-residues":!0})]),{category:Un.Internal,isHidden:!0}),use=Bn("Connected to Carbohydrate",oe.struct.modifier.union([oe.struct.modifier.exceptBy({0:cse.expression,by:NI.expression})]),{category:Un.Internal,isHidden:!0}),TN=Bn("Ligand",oe.struct.modifier.union([oe.struct.modifier.exceptBy({0:oe.struct.modifier.union([oe.struct.combinator.merge([oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.logic.and([oe.core.logic.or([oe.core.rel.eq([oe.ammp("entityType"),"non-polymer"]),oe.core.rel.neq([oe.ammp("entityPrdId"),""])]),oe.core.logic.not([oe.core.str.match([oe.re("(oligosaccharide|lipid|ion)","i"),oe.ammp("entitySubtype")])])]),"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.logic.not([oe.core.str.match([oe.re("saccharide","i"),oe.ammp("chemCompType")])])})]),oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":X1})])])]),by:oe.struct.combinator.merge([oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.set.has([oe.set(...Dn.toArray(ih)),oe.ammp("label_comp_id")])})]),oe.struct.generator.atomGroups({"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.core.set.has([oe.set(...Dn.toArray(Sq)),oe.ammp("label_comp_id")])})])})]),{category:Un.Type}),dse=Bn("Ligand with Connected",oe.struct.modifier.union([oe.struct.modifier.exceptBy({0:oe.struct.modifier.union([oe.struct.modifier.includeConnected({0:TN.expression,"layer-count":1,"as-whole-residues":!0,"bond-test":oe.core.flags.hasAny([oe.struct.bondProperty.flags(),oe.core.type.bitflags([3])])})]),by:NI.expression})]),{category:Un.Internal,isHidden:!0}),mse=Bn("Connected to Ligand",oe.struct.modifier.union([oe.struct.modifier.exceptBy({0:dse.expression,by:TN.expression})]),{category:Un.Internal,isHidden:!0}),cFe=Bn("Connected to Ligand or Carbohydrate",oe.struct.modifier.union([oe.struct.combinator.merge([use.expression,mse.expression])]),{category:Un.Internal,isHidden:!0}),uFe=Bn("Disulfide Bridges",oe.struct.modifier.union([oe.struct.combinator.merge([oe.struct.modifier.union([oe.struct.modifier.wholeResidues([oe.struct.filter.isConnectedTo({0:oe.struct.generator.atomGroups({"residue-test":oe.core.set.has([oe.set("CYS"),oe.ammp("auth_comp_id")]),"atom-test":oe.core.set.has([oe.set("SG"),oe.ammp("label_atom_id")])}),target:oe.struct.generator.atomGroups({"residue-test":oe.core.set.has([oe.set("CYS"),oe.ammp("auth_comp_id")]),"atom-test":oe.core.set.has([oe.set("SG"),oe.ammp("label_atom_id")])}),"bond-test":!0})])]),oe.struct.modifier.union([oe.struct.modifier.wholeResidues([oe.struct.modifier.union([oe.struct.generator.bondedAtomicPairs({0:oe.core.flags.hasAny([oe.struct.bondProperty.flags(),oe.core.type.bitflags([8])])})])])])])]),{category:Un.Bond}),dFe=Bn("NOS Bridges",oe.struct.modifier.union([oe.struct.modifier.wholeResidues([oe.struct.filter.isConnectedTo({0:oe.struct.generator.atomGroups({"residue-test":oe.core.set.has([oe.set("CSO","LYS"),oe.ammp("auth_comp_id")]),"atom-test":oe.core.set.has([oe.set("OD","NZ"),oe.ammp("label_atom_id")])}),target:oe.struct.generator.atomGroups({"residue-test":oe.core.set.has([oe.set("CSO","LYS"),oe.ammp("auth_comp_id")]),"atom-test":oe.core.set.has([oe.set("OD","NZ"),oe.ammp("label_atom_id")])}),"bond-test":!0})])]),{category:Un.Bond}),mFe=Bn("Non-standard Residues in Polymers",oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.rel.eq([oe.ammp("entityType"),"polymer"]),"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":oe.ammp("isNonStandard")})]),{category:Un.Residue}),pFe=Bn("Coarse Elements",oe.struct.modifier.union([oe.struct.generator.atomGroups({"chain-test":oe.core.set.has([oe.set("sphere","gaussian"),oe.ammp("objectPrimitive")])})]),{category:Un.Type}),fFe=Bn("Rings in Residues",oe.struct.modifier.union([oe.struct.generator.rings()]),{category:Un.Residue}),hFe=Bn("Aromatic Rings in Residues",oe.struct.modifier.union([oe.struct.generator.rings({"only-aromatic":!0})]),{category:Un.Residue}),gFe=Bn("Surrounding Residues (5 \u212B) of Selection",oe.struct.modifier.union([oe.struct.modifier.exceptBy({0:oe.struct.modifier.includeSurroundings({0:oe.internal.generator.current(),radius:5,"as-whole-residues":!0}),by:oe.internal.generator.current()})]),{description:"Select residues within 5 \u212B of the current selection.",category:Un.Manipulate,referencesCurrent:!0}),yFe=Bn("Surrounding Ligands (5 \u212B) of Selection",oe.struct.modifier.union([oe.struct.modifier.surroundingLigands({0:oe.internal.generator.current(),radius:5,"include-water":!0})]),{description:"Select ligand components within 5 \u212B of the current selection.",category:Un.Manipulate,referencesCurrent:!0}),vFe=Bn("Surrounding Atoms (5 \u212B) of Selection",oe.struct.modifier.union([oe.struct.modifier.exceptBy({0:oe.struct.modifier.includeSurroundings({0:oe.internal.generator.current(),radius:5,"as-whole-residues":!1}),by:oe.internal.generator.current()})]),{description:"Select atoms within 5 \u212B of the current selection.",category:Un.Manipulate,referencesCurrent:!0}),xFe=Bn("Inverse / Complement of Selection",oe.struct.modifier.union([oe.struct.modifier.exceptBy({0:oe.struct.generator.all(),by:oe.internal.generator.current()})]),{description:"Select everything not in the current selection.",category:Un.Manipulate,referencesCurrent:!0}),bFe=Bn("Residues Covalently Bonded to Selection",oe.struct.modifier.union([oe.struct.modifier.includeConnected({0:oe.internal.generator.current(),"layer-count":1,"as-whole-residues":!0})]),{description:"Select residues covalently bonded to current selection.",category:Un.Manipulate,referencesCurrent:!0}),SFe=Bn("Covalently Bonded Component",oe.struct.modifier.union([oe.struct.modifier.includeConnected({0:oe.internal.generator.current(),"fixed-point":!0})]),{description:"Select covalently bonded component based on current selection.",category:Un.Manipulate,referencesCurrent:!0}),CFe=Bn("Residues with Cov. or Metallic Bond to Selection",oe.struct.modifier.union([oe.struct.modifier.includeConnected({0:oe.internal.generator.current(),"layer-count":1,"as-whole-residues":!0,"bond-test":oe.core.flags.hasAny([oe.struct.bondProperty.flags(),oe.core.type.bitflags([3])])})]),{description:"Select residues with covalent or metallic bond to current selection.",category:Un.Manipulate,referencesCurrent:!0}),_Fe=Bn("Whole Residues of Selection",oe.struct.modifier.union([oe.struct.modifier.wholeResidues({0:oe.internal.generator.current()})]),{description:"Expand current selection to whole residues.",category:Un.Manipulate,referencesCurrent:!0}),wFe=[[["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((e,t)=>e[1]t[1]?1:0),AFe=[[["A","DA"],"Adenosine"],[["C","DC"],"Cytidine"],[["T","DT"],"Thymidine"],[["G","DG"],"Guanosine"],[["I","DI"],"Inosine"],[["U","DU"],"Uridine"],[["N","DN"],"Unknown"]].sort((e,t)=>e[1]t[1]?1:0);function AN([e,t],r,n=0){let o=e.length===1&&!pse.has(e[0])?`[${e[0]}] ${t}`:`${t} (${e.join(", ")})`;return Bn(o,oe.struct.modifier.union([oe.struct.generator.atomGroups({"residue-test":oe.core.set.has([oe.set(...e),oe.ammp("auth_comp_id")])})]),{category:r,priority:n,description:o})}function TFe([e,t],r,n){let o=`${t} (${e.join(", ")})`;return Bn(o,oe.struct.modifier.union([oe.struct.generator.atomGroups({"atom-test":oe.core.set.has([oe.set(...e),oe.acp("elementSymbol")])})]),{category:r,priority:n,description:o})}function PFe([e,t],r,n){let o=`${t}`;return Bn(`${t}`,oe.struct.modifier.union([oe.struct.generator.atomGroups({"entity-test":oe.core.list.equal([oe.list(...e),oe.ammp("entityDescription")])})]),{category:r,priority:n,description:o})}var pse=Dn.unionMany(HA,Sx,Cx,bx);function fse(e){let t=new Set;for(let n of e)n.uniqueElementSymbols.forEach(o=>t.add(o));let r=[];return t.forEach(n=>{let o=ase[n]||n;r.push(TFe([[n],o],"Element Symbol",0))}),r}function hse(e){let t=new Map,r=new Set;for(let o of e){o.uniqueResidueNames.forEach(i=>r.add(i));for(let i of o.models)o.uniqueResidueNames.forEach(s=>{let a=i.properties.chemicalComponentMap.get(s);a&&t.set(s,a.name)})}let n=[];return Dn.difference(r,pse).forEach(o=>{let i=t.get(o)||o;n.push(AN([[o],i],"Ligand/Non-standard Residue",200))}),n}function gse(e){let t=new Map,r=$.Location.create();for(let o of e){r.structure=o;for(let i of o.unitSymmetryGroups){r.unit=i.units[0],r.element=i.elements[0];let s=Ne.entity.type(r);if(s==="polymer"||s==="branched"){let a=Ne.entity.pdbx_description(r);t.set(a.join(", "),a)}}}let n=[];return t.forEach((o,i)=>{n.push(PFe([o,i],"Polymer/Carbohydrate Entities",300))}),n}var ei={all:KLe,current:QLe,polymer:ZLe,trace:$Le,backbone:JLe,sidechain:eFe,sidechainWithTrace:tFe,protein:rFe,nucleic:nFe,helix:oFe,beta:iFe,water:sFe,ion:aFe,lipid:lFe,branched:NI,branchedPlusConnected:cse,branchedConnectedOnly:use,ligand:TN,ligandPlusConnected:dse,ligandConnectedOnly:mse,connectedOnly:cFe,disulfideBridges:uFe,nosBridges:dFe,nonStandardPolymer:mFe,coarse:pFe,ring:fFe,aromaticRing:hFe,surroundings:gFe,surroundingLigands:yFe,surroundingAtoms:vFe,complement:xFe,covalentlyBonded:bFe,covalentlyOrMetallicBonded:CFe,covalentlyBondedComponent:SFe,wholeResidues:_Fe},FI=class{add(t){this.list.push(t),this.options.push([t,t.label,t.category]),this.version+=1}remove(t){let r=this.list.indexOf(t);r!==-1&&(this.list.splice(r,1),this.options.splice(r,1),this.version+=1)}constructor(){this.list=[],this.options=[],this.version=1,this.list.push(...Object.values(ei),...wFe.map(t=>AN(t,Un.AminoAcid)),...AFe.map(t=>AN(t,Un.NucleicBase))),this.options.push(...this.list.map(t=>[t,t.label,t.category]))}};var yse=()=>({type:C.MappedStatic("static",{static:C.Text("polymer"),expression:C.Value(oe.struct.generator.all),bundle:C.Value($.Bundle.Empty),script:C.Script({language:"mol-script",expression:"(sel.atom.all)"})},{isHidden:!0}),nullIfEmpty:C.Optional(C.Boolean(!0,{isHidden:!0})),label:C.Text("",{isHidden:!0})});function vse(e,t,r){r.source=e;let n=Me.Empty,o;switch(t.type.name){case"static":{let s;switch(t.type.params){case"all":s=ei.all.query,o="All";break;case"polymer":s=ei.polymer.query,o="Polymer";break;case"protein":s=ei.protein.query,o="Protein";break;case"nucleic":s=ei.nucleic.query,o="Nucleic";break;case"water":s=bn.internal.water(),o="Water";break;case"ion":s=ei.ion.query,o="Ion";break;case"lipid":s=ei.lipid.query,o="Lipid";break;case"branched":s=ei.branchedPlusConnected.query,o="Branched";break;case"ligand":s=ei.ligandPlusConnected.query,o="Ligand";break;case"non-standard":s=ei.nonStandardPolymer.query,o="Non-standard";break;case"coarse":s=ei.coarse.query,o="Coarse";break;default:_r(t.type)}let a=s(new Mi(e));n=lt.unionStructure(a);break}case"script":case"expression":{let{selection:s,entry:a}=nl.createAndRun(e,t.type.params);r.entry=a,n=lt.unionStructure(s);break}case"bundle":{if(t.type.params.hash!==e.hashCode)break;n=$.Bundle.toStructure(t.type.params,e);break}}if(t.nullIfEmpty&&n.elementCount===0)return kn.Null;let i={label:`${t.label||o||"Component"}`,description:Me.elementDescription(n)};return new ae.Molecule.Structure(n,i)}function xse(e,t,r,n,o){if(r.type.name!==n.type.name)return $e.UpdateResult.Recreate;let i=!1;switch(n.type.name){case"static":return r.type.params!==n.type.params?$e.UpdateResult.Recreate:Me.areEquivalent(e,o.source)?t.data.model===e.model?$e.UpdateResult.Unchanged:Ut.areHierarchiesEqual(e.model,t.data.model)?(t.data=t.data.remapModel(e.model),$e.UpdateResult.Updated):$e.UpdateResult.Recreate:$e.UpdateResult.Recreate;case"script":if(!eo.areEqual(r.type.params,n.type.params))return $e.UpdateResult.Recreate;case"expression":{if(r.type.params!==n.type.params)return $e.UpdateResult.Recreate;if(e===o.source)break;let s=o.entry,a=nl.updateStructure(s,e);o.source=e,t.data=lt.unionStructure(a),nl.updateStructureObject(t,a,n.label),i=!0;break}case"bundle":{if(e===o.source&&$.Bundle.areEqual(r.type.params,n.type.params))break;o.source=e,n.type.params.hash!==e.hashCode?(i=t.data.elementCount!==0,t.data=t.data.elementCount===0?t.data:Me.Empty):(i=!0,t.data=$.Bundle.toStructure(n.type.params,e));break}}if(i){if(n.nullIfEmpty&&t.data.elementCount===0)return $e.UpdateResult.Null;t.description=Me.elementDescription(t.data)}return r.label!==n.label&&(i=!0,t.label=`${n.label||t.label}`),i?$e.UpdateResult.Updated:$e.UpdateResult.Unchanged}function bse(e){switch(e){case 7:return-3;case 6:return-2;case 5:return-1;case 0:return 0;case 3:return 1;case 2:return 2;case 1:return 3;case 4:return 0;default:return console.error(`Value ${e} is outside the 0-7 range, defaulting to 0.`),0}}function PN(e,t){let r=Ye.create(e.data,t*2),n=Ye.create(e.data,t*2),o=Ye.create(e.data,t*2),i=Ye.create(e.data,t*2),s=Ye.create(e.data,t*2);for(let a=0;aY(this,null,function*(){return EFe(e)}))}function kN(e,t,r){return Y(this,null,function*(){let{atoms:n,bonds:o,formalCharges:i}=e,s=re.ofConst("MOL",e.atoms.count,re.Schema.str),a=re.ofConst("A",e.atoms.count,re.Schema.str),l=re.asArrayColumn(n.type_symbol),c=re.ofConst(1,n.count,re.Schema.int),u=new Int32Array(e.atoms.count);if(i.atomIdx.rowCount>0)for(let y=0;y0){let y=re.ofIntArray(re.mapToArray(o.atomIdxA,S=>S-1,Int32Array)),g=re.ofIntArray(re.mapToArray(o.atomIdxB,S=>S-1,Int32Array)),v=re.asArrayColumn(o.order,Int32Array),b=yi.fromData({pairs:{indexA:y,indexB:g,order:v},count:n.count},{maxDistance:1/0});yi.Provider.set(f.representative,b)}return f})}var DN;(function(e){function t(n){return n?.kind==="mol"}e.is=t;function r(n){return{kind:"mol",name:n.title,data:n}}e.create=r})(DN||(DN={}));function Cse(e){return Pe.create("Parse MOL",t=>kN(e,void 0,t))}function DFe(e){let t=e.it_number.value(0),r=e["name_h-m_full"].value(0).replace("-"," ");return e.it_number.isDefined?(e["name_h-m_full"].isDefined,t):r}function kFe(e){let{cell:t,space_group:r}=e,n=DFe(r),o=ui.create(n,x.create(t.length_a.value(0),t.length_b.value(0),t.length_c.value(0)),x.scale(x(),x.create(t.angle_alpha.value(0),t.angle_beta.value(0),t.angle_gamma.value(0)),Math.PI/180));return{spacegroup:Os.create(o),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}function MFe(e,t,r){return Y(this,null,function*(){var n;let o=e.atom_site._rowCount,i=re.ofConst("MOL",o,re.Schema.str),s=re.ofConst("A",o,re.Schema.str),a=re.ofConst(1,o,re.Schema.int),l=kFe(e),c=l.spacegroup.cell.fromFractional,{fract_x:u,fract_y:d,fract_z:m}=e.atom_site,p=new Float32Array(o),h=new Float32Array(o),f=new Float32Array(o),y=x();for(let B=0;B0){let B=T.representative;ao.Provider.set(B,l);let D=e.geom_bond._rowCount;if(D>0){let M={},{label:R}=e.atom_site;for(let V=0,G=R.rowCount;VMFe(t.data.db,t,r))}function LFe(e,t){return Y(this,null,function*(){let{atoms:r}=e,n=re.ofConst("MOL",e.atoms.count,re.Schema.str),o=re.ofConst("A",e.atoms.count,re.Schema.str),i=re.ofArray({array:re.mapToArray(r.number,d=>mq(d)),schema:re.Schema.Aliased(re.Schema.str)}),s=re.ofConst(1,r.count,re.Schema.int),a=cr.ofPartialColumns(_o.atom_site,{auth_asym_id:o,auth_atom_id:i,auth_comp_id:n,auth_seq_id:s,Cartn_x:re.asArrayColumn(r.x,Float32Array),Cartn_y:re.asArrayColumn(r.y,Float32Array),Cartn_z:re.asArrayColumn(r.z,Float32Array),id:re.range(0,r.count-1),label_asym_id:o,label_atom_id:i,label_comp_id:n,label_seq_id:s,label_entity_id:re.ofConst("1",r.count,re.Schema.str),occupancy:re.ofConst(1,r.count,re.Schema.float),type_symbol:i,pdbx_PDB_model_num:re.ofConst(1,r.count,re.Schema.int)},r.count),l=new Wi;l.setNames([["MOL","Unknown Entity"]]),l.getEntityId("MOL",0,"A");let c=new Yi(s,i);c.setNames([["MOL","Unknown Molecule"]]),c.add("MOL",0);let u=us({entity:l.getEntityTable(),chem_comp:c.getChemCompTable(),atom_site:a});return yield _a(u,MN.create(e),t)})}var MN;(function(e){function t(n){return n?.kind==="cube"}e.is=t;function r(n){return{kind:"cube",name:n.header.comment1,data:n}}e.create=r})(MN||(MN={}));function wse(e){return Pe.create("Parse Cube",t=>LFe(e,t))}var{skipWhitespace:BN,eatValue:Ase,markLine:tm,getTokenString:rm,readLine:Tse}=pt;function FFe(){return{mol_name:"",num_atoms:0,num_bonds:0,num_subst:0,num_feat:0,num_sets:0,mol_type:"",charge_type:"",status_bits:"",mol_comment:""}}function OFe(e,t){return{tokenizer:e,molecule:FFe(),runtimeCtx:t}}var Pse=/\s+/g;function NFe(e){let{tokenizer:t,molecule:r}=e;for(;rm(t)!=="@MOLECULE"&&t.position"))return;r.mol_type=o,tm(t);let i=rm(t);if(i.startsWith("@"))return;r.charge_type=i,tm(t);let s=rm(t);if(s.startsWith("@"))return;r.status_bits=s,tm(t);let a=rm(t);a.startsWith("@")||(r.mol_comment=a)}function UFe(e){return Y(this,null,function*(){let{tokenizer:t,molecule:r}=e;for(;rm(t)!=="@ATOM"&&t.position{let P=Math.min(r.num_atoms-w,A);for(let T=0;TA.update({message:"Parsing...",current:t.position,max:_})),{count:r.num_atoms,atom_id:tr(l)(re.Schema.int),atom_name:tr(c)(re.Schema.str),x:tr(u)(re.Schema.float),y:tr(d)(re.Schema.float),z:tr(m)(re.Schema.float),atom_type:a>5?tr(p)(re.Schema.str):S,subst_id:a>6?tr(h)(re.Schema.int):b,subst_name:a>7?tr(f)(re.Schema.str):S,charge:a>8?tr(y)(re.Schema.float):v,status_bit:a>9?tr(g)(re.Schema.str):S}})}function zFe(e){return Y(this,null,function*(){let{tokenizer:t,molecule:r}=e;for(;rm(t)!=="@BOND"&&t.position{let g=Math.min(r.num_bonds-h,y);for(let v=0;vy.update({message:"Parsing...",current:t.position,max:p})),{count:r.num_bonds,bond_id:tr(l)(re.Schema.int),origin_atom_id:tr(c)(re.Schema.int),target_atom_id:tr(u)(re.Schema.int),bond_type:tr(d)(re.Schema.str),status_bits:a>4?tr(m)(re.Schema.str):re.Undefined(r.num_bonds,re.Schema.str)}})}function VFe(e){let{tokenizer:t}=e;for(;t.positionMOLECULE")return;if(n==="@CRYSIN")break;tm(t)}if(t.position>=t.data.length)return;tm(t);let r=rm(t).trim().split(Pse);return{a:parseFloat(r[0]),b:parseFloat(r[1]),c:parseFloat(r[2]),alpha:parseFloat(r[3]),beta:parseFloat(r[4]),gamma:parseFloat(r[5]),spaceGroup:parseInt(r[6],10),setting:parseInt(r[7],10)}}function GFe(e,t,r){return Y(this,null,function*(){let n=pt(t);e.update({message:"Parsing...",current:0,max:t.length});let o=[];for(;n.positionMOLECULE"&&n.positionY(this,null,function*(){return yield GFe(r,e,t)}))}function HFe(e,t){return Y(this,null,function*(){let r=[];for(let n=0,o=e.structures.length;n0){let g=re.ofIntArray(re.mapToArray(a.origin_atom_id,A=>A-1,Int32Array)),v=re.ofIntArray(re.mapToArray(a.target_atom_id,A=>A-1,Int32Array)),b=a.bond_id,S=re.ofIntArray(re.mapToArray(a.bond_type,A=>{switch(A){case"ar":case"am":case"un":return 1;case"du":case"nc":return 0;default:return parseInt(A)}},Int8Array)),_=re.ofIntArray(re.mapToArray(a.bond_type,A=>{switch(A){case"ar":case"am":return 17;case"du":case"nc":return 0;case"un":default:return 1}},Int8Array)),w=yi.fromData({pairs:{key:b,indexA:g,indexB:v,order:S,flag:_},count:s.count},{maxDistance:l?-1:1/0}),E=y.representative;if(yi.Provider.set(E,w),Ah.Provider.set(E,{data:s.charge,type:i.charge_type}),l){let A=jFe(l);A&&ao.Provider.set(E,A)}r.push(E)}}return new Sl(r)})}function jFe(e){if(e.setting!==1)return;let t=ui.create(e.spaceGroup,x.create(e.a,e.b,e.c),x.scale(x(),x.create(e.alpha,e.beta,e.gamma),Math.PI/180));return{spacegroup:Os.create(t),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}var RN;(function(e){function t(n){return n?.kind==="mol2"}e.is=t;function r(n){return{kind:"mol2",name:n.name,data:n}}e.create=r})(RN||(RN={}));function Ese(e){return Pe.create("Parse MOL2",t=>HFe(e,t))}var qb=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]),LN=9,mu;(function(e){function t(u){let d=1,m=0;for(;u>=d&&m<32;)m++,d<<=1;return m}e.sizeOfInt=t;let r=new Uint8Array(32);function n(u,d){let m=1,p=0;r[0]=1;for(let f=0;f>=8;for(;g!==0;)r[y++]=g&255,g>>=8;m=y}let h=1;for(m--;r[m]>=h;)p++,h*=2;return p+m*8}e.sizeOfInts=n;let o=new ArrayBuffer(8*3);e.buf=new Int32Array(o);let i=new Uint32Array(o);function s(u,d,m){let p=m,h=(1<=8;)y=y<<8|u[d+g++],v|=y>>f<0&&(f>f&(1<>i[1]&255}let l=[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];function c(u,d,m,p,h){let f=m,y=0;for(l[0]=0,l[1]=0,l[2]=0,l[3]=0;f>8;)l[y++]=a(u,d),f-=8;f>0&&(l[y++]=s(u,d,f));for(let g=2;g>0;g--){let v=0,b=p[g];for(let S=y-1;S>=0;S--){v=v<<8|l[S];let _=v/b|0;l[S]=_,v=v-_*b}h[g]=v}h[0]=l[0]|l[1]<<8|l[2]<<16|l[3]<<24}e.decodeInts=c})(mu||(mu={}));function qFe(){throw new Error("(xdrfile error) Undefined error.")}function WFe(e,t){return Y(this,null,function*(){let r=new DataView(t.buffer,t.byteOffset),n={frames:[],boxes:[],times:[],timeOffset:0,deltaTime:0},o=n.frames,i=n.boxes,s=n.times,a=[0,0,0,0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0],d=[.1,.1,.1],m=[.1,.1,.1],p=0,h=mu.buf;for(;;){let f,y=r.getInt32(p+4);p+=12,s.push(r.getFloat32(p)),p+=4;let g=new Float32Array(9);for(let v=0;v<9;++v)g[v]=r.getFloat32(p)*10,p+=4;if(i.push(g),y<=9){f={count:y/3,x:new Float32Array(y/3),y:new Float32Array(y/3),z:new Float32Array(y/3)};for(let v=0;v16777215?(c[0]=mu.sizeOfInt(l[0]),c[1]=mu.sizeOfInt(l[1]),c[2]=mu.sizeOfInt(l[2]),_=0):_=mu.sizeOfInts(3,l);let w=r.getInt32(p);p+=4;let E=w-1;E=LN>E?LN:E;let A=qb[E]/2|0,P=qb[w]/2|0;u[0]=u[1]=u[2]=qb[w];let T=Math.ceil(r.getInt32(p)/4)*4;p+=4;let B=1/S,D=0,M=0;for(d[0]=d[1]=d[2]=0;M0){d[0]=d[1]=d[2]=0;for(let F=0;FLN?A=qb[w-1]/2|0:A=0):U>0&&(A=P,P=qb[w]/2|0),u[0]=u[1]=u[2]=qb[w],(u[0]===0||u[1]===0||u[2]===0)&&qFe()}p+=T}for(let v=0;v=t.length)break}return s.length>=1&&(n.timeOffset=s[0]),s.length>=2&&(n.deltaTime=s[1]-s[0]),n})}function Dse(e){return Pe.create("Parse XTC",t=>Y(this,null,function*(){try{t.update({canAbort:!0,message:"Parsing trajectory..."});let r=yield WFe(t,e);return Vr.success(r)}catch(r){return Vr.error(""+r)}}))}function kse(e){return Pe.create("Parse XTC",t=>Y(this,null,function*(){yield t.update("Converting to coordinates");let r=La(e.deltaTime,"step"),n=La(e.timeOffset,r.unit),o=[];for(let i=0,s=e.frames.length;i=e.data.length-1?0:+pt.readLine(e);isNaN(t)&&(t=0);let r=pt.readLine(e),n=new Float64Array(t),o=new Float64Array(t),i=new Float64Array(t),s=new Array(t);for(let a=0;aY(this,null,function*(){return XFe(e)}))}function KFe(e,t){let{molecules:r}=e,n=0;for(let b of r)n+=b.count;let o=new Array(n),i=new Int32Array(n),s=new Float32Array(n),a=new Float32Array(n),l=new Float32Array(n),c=new Int32Array(n),u=0;for(let b=0;bKFe(e,t))}function Rse(e){return e.trim().endsWith("V3000")}function Lse(e){let t=Ye.create(e.data,1),r=Ye.create(e.data,1);return pt.eatLine(e),Nh(e),Nh(e),Nh(e),Oh(e,t),Oh(e,r),pt.eatLine(e),{atomCount:tr(t)(re.Schema.int).value(0),bondCount:tr(r)(re.Schema.int).value(0)}}function Fse(e,t){let r=Ye.create(e.data,t*2),n=Ye.create(e.data,t*2),o=Ye.create(e.data,t*2),i=Ye.create(e.data,t*2);for(let s=0;s ")){Ye.add(t,e.tokenStart+2,e.tokenEnd),pt.markLine(e);let o=e.tokenStart,i=e.tokenEnd,s=!1;for(;e.position ")){Ye.add(r,o,i),s=!0;break}i=e.tokenEnd}s||Ye.add(r,o,i)}}return{dataHeader:tr(t)(re.Schema.str),data:tr(r)(re.Schema.str)}}function ZFe(e){return{atomCount:+e.substr(0,3),bondCount:+e.substr(3,3)}}function $Fe(e){let t=pt.readLine(e).trim(),r=pt.readLine(e).trim(),n=pt.readLine(e).trim(),o=pt.readLine(e),i=Rse(o),{atomCount:s,bondCount:a}=i?Lse(e):ZFe(o);if(Number.isNaN(s)||Number.isNaN(a)){for(;e.positionY(this,null,function*(){return JFe(e)}))}var NN;(function(e){function t(n){return n?.kind==="sdf"}e.is=t;function r(n){return{kind:"sdf",name:n.molFile.title,data:n}}e.create=r})(NN||(NN={}));function Use(e){return Pe.create("Parse SDF",t=>kN(e.molFile,NN.create(e),t))}function eOe(e){return Y(this,null,function*(){let t=new DataView(e.buffer),r={frames:[],boxes:[],times:[],timeOffset:0,deltaTime:0},n=r.frames,o=r.boxes,i=r.times,s=0;for(;;){s+=8;let a=t.getInt32(s);s+=4,s+=a;let l=t.getInt32(s+8),c=t.getInt32(s+12),u=t.getInt32(s+16),d=t.getInt32(s+28),m=t.getInt32(s+32),p=t.getInt32(s+36),h=t.getInt32(s+40);s+=52;let f=l/9,y=h*3;if(f===8?i.push(t.getFloat64(s)):i.push(t.getFloat32(s)),s+=2*f,l){let g=new Float32Array(9);if(f===8)for(let v=0;v<9;++v)g[v]=t.getFloat64(s)*10,s+=8;else for(let v=0;v<9;++v)g[v]=t.getFloat32(s)*10,s+=4;o.push(g)}if(s+=c,s+=u,d){let g=new Float32Array(h),v=new Float32Array(h),b=new Float32Array(h);if(f===8)for(let S=0;S>8&65280|E>>24&255}let _=new Float32Array(e.buffer,s,y);for(let w=0;w=e.byteLength)break}return i.length>=1&&(r.timeOffset=i[0]),i.length>=2&&(r.deltaTime=i[1]-i[0]),r})}function zse(e){return Pe.create("Parse TRR",t=>Y(this,null,function*(){try{t.update({canAbort:!0,message:"Parsing trajectory..."});let r=yield eOe(e);return Vr.success(r)}catch(r){return Vr.error(""+r)}}))}function Vse(e){return Pe.create("Parse TRR",t=>Y(this,null,function*(){yield t.update("Converting to coordinates");let r=La(e.deltaTime,"step"),n=La(e.timeOffset,r.unit),o=[];for(let i=0,s=e.frames.length;i>>0:0,i=t.byteLength-o,s=o;t instanceof ArrayBuffer||(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+o),t=t.buffer),n?this._lastWrittenByte=i:this._lastWrittenByte=0,this.buffer=t,this.length=i,this.byteLength=i,this.byteOffset=s,this._data=new DataView(this.buffer,s,i)}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t){return t===void 0&&(t=1),this.offset+=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t){if(t===void 0&&(t=1),!this.available(t)){let n=(this.offset+t)*2,o=new Uint8Array(n);o.set(new Uint8Array(this.buffer)),this.buffer=o.buffer,this.length=this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t){t===void 0&&(t=1);let r=new Uint8Array(t);for(let n=0;nthis._lastWrittenByte&&(this._lastWrittenByte=this.offset)}};function nm(e,t){if(e)throw new TypeError("Not a valid NetCDF v3.x file: "+t)}function Gse(e){e.offset%4!==0&&e.skip(4-e.offset%4)}function zN(e){let t=e.readUint32(),r=e.readChars(t);return Gse(e),r}var rs={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function Hse(e){switch(Number(e)){case rs.BYTE:return"byte";case rs.CHAR:return"char";case rs.SHORT:return"short";case rs.INT:return"int";case rs.FLOAT:return"float";case rs.DOUBLE:return"double";default:return"undefined"}}function jse(e){switch(Number(e)){case rs.BYTE:return 1;case rs.CHAR:return 1;case rs.SHORT:return 2;case rs.INT:return 4;case rs.FLOAT:return 4;case rs.DOUBLE:return 8;default:return-1}}function qse(e){switch(String(e)){case"byte":return rs.BYTE;case"char":return rs.CHAR;case"short":return rs.SHORT;case"int":return rs.INT;case"float":return rs.FLOAT;case"double":return rs.DOUBLE;default:return-1}}function zI(e,t){if(e!==1){let r=new Array(e);for(let n=0;n6,"non valid type "+s);let a=e.readUint32(),l=VN(e,s,a);Gse(e),t[o]={name:i,type:Hse(s),value:l}}}return t}function cOe(e,t,r){let n=e.readUint32(),o=0,i;if(n===Wb)return nm(e.readUint32()!==Wb,"wrong empty tag for list of variables"),[];{nm(n!==iOe,"wrong tag for list of variables");let s=e.readUint32();i=new Array(s);for(let a=0;a6,"non valid type "+m);let p=e.readUint32(),h=e.readUint32();r===2&&(nm(h>0,"offsets larger than 4GB not supported"),h=e.readUint32()),u[0]===t&&(o+=p),i[a]={name:l,dimensions:u,attributes:d,type:Hse(m),size:p,offset:h,record:u[0]===t}}}return{variables:i,recordStep:o}}var VI=class{constructor(t){let r=new UI(t);r.setBigEndian(),nm(r.readChars(3)!=="CDF","should start with CDF");let n=r.readByte();nm(n>2,"unknown version"),this.header=aOe(r,n),this.buffer=r}get version(){return this.header.version===1?"classic format":"64-bit offset format"}get recordDimension(){return this.header.recordDimension}get dimensions(){return this.header.dimensions}get globalAttributes(){return this.header.globalAttributes}get variables(){return this.header.variables}hasDataVariable(t){return this.header.variables&&this.header.variables.findIndex(r=>r.name===t)!==-1}getDataVariable(t){var r;let n;if(typeof t=="string"?n=(r=this.header.variables)===null||r===void 0?void 0:r.find(o=>o.name===t):n=t,n===void 0)throw new Error("variable not found");return this.buffer.seek(n.offset),n.record?nOe(this.buffer,n,this.header.recordDimension):rOe(this.buffer,n)}};function uOe(e){return Y(this,null,function*(){let t=new VI(e),r={coordinates:[],time:[],timeOffset:0,deltaTime:1};for(let n of t.getDataVariable("coordinates"))r.coordinates.push(n);if(t.hasDataVariable("velocities")){let n=[];for(let o of t.getDataVariable("velocities"))n.push(o);r.velocities=n}if(t.hasDataVariable("forces")){let n=[];for(let o of t.getDataVariable("forces"))n.push(o);r.forces=n}if(t.hasDataVariable("cell_lengths")){let n=[];for(let o of t.getDataVariable("cell_lengths"))n.push(o);r.cell_lengths=n}if(t.hasDataVariable("cell_angles")){let n=[];for(let o of t.getDataVariable("cell_angles"))n.push(o);r.cell_angles=n}if(t.hasDataVariable("time")){let n=[];for(let o of t.getDataVariable("time"))n.push(o);r.time=n}return r.time&&(r.time.length>=1&&(r.timeOffset=r.time[0]),r.time.length>=2&&(r.deltaTime=r.time[1]-r.time[0])),r})}function Yse(e){return Pe.create("Parse NCTRAJ",t=>Y(this,null,function*(){try{t.update({canAbort:!0,message:"Parsing trajectory..."});let r=yield uOe(e);return Vr.success(r)}catch(r){return Vr.error(""+r)}}))}function Xse(e){return Pe.create("Parse NCTRAJ",t=>Y(this,null,function*(){yield t.update("Converting to coordinates");let r=La(e.deltaTime,"step"),n=La(e.timeOffset,r.unit),o=[];for(let i=0,s=e.coordinates.length;i{let F=n.value(M);for(let N=R,z=U;NY(this,null,function*(){let r=GN.fromPrmtop(e),n=dOe(e),{pointers:{NBONH:o,NBONA:i},bondsIncHydrogen:s,bondsWithoutHydrogen:a}=e,l=o+i,c={indexA:re.ofLambda({value:u=>uuY(this,null,function*(){let r=HN.fromTop(e),n=mOe(e),o=pOe(e);return xg.create(e.system||"TOP",n,o,r)}))}var fOe=Mt.BuiltIn({name:"coordinates-from-dcd",display:{name:"Parse DCD",description:"Parse DCD binary data."},from:[ae.Data.Binary],to:ae.Molecule.Coordinates})({apply({a:e}){return Pe.create("Parse DCD",t=>Y(this,null,function*(){let r=yield Mie(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield Vie(r.result).runInContext(t);return new ae.Molecule.Coordinates(n,{label:e.label,description:"Coordinates"})}))}}),hOe=Mt.BuiltIn({name:"coordinates-from-xtc",display:{name:"Parse XTC",description:"Parse XTC binary data."},from:[ae.Data.Binary],to:ae.Molecule.Coordinates})({apply({a:e}){return Pe.create("Parse XTC",t=>Y(this,null,function*(){let r=yield Dse(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield kse(r.result).runInContext(t);return new ae.Molecule.Coordinates(n,{label:e.label,description:"Coordinates"})}))}}),gOe=Mt.BuiltIn({name:"coordinates-from-trr",display:{name:"Parse TRR",description:"Parse TRR binary data."},from:[ae.Data.Binary],to:ae.Molecule.Coordinates})({apply({a:e}){return Pe.create("Parse TRR",t=>Y(this,null,function*(){let r=yield zse(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield Vse(r.result).runInContext(t);return new ae.Molecule.Coordinates(n,{label:e.label,description:"Coordinates"})}))}}),yOe=Mt.BuiltIn({name:"coordinates-from-nctraj",display:{name:"Parse NCTRAJ",description:"Parse NCTRAJ binary data."},from:[ae.Data.Binary],to:ae.Molecule.Coordinates})({apply({a:e}){return Pe.create("Parse NCTRAJ",t=>Y(this,null,function*(){let r=yield Yse(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield Xse(r.result).runInContext(t);return new ae.Molecule.Coordinates(n,{label:e.label,description:"Coordinates"})}))}}),vOe=Mt.BuiltIn({name:"topology-from-psf",display:{name:"PSF Topology",description:"Create topology from PSF."},from:[ae.Format.Psf],to:ae.Molecule.Topology})({apply({a:e}){return Pe.create("Create Topology",t=>Y(this,null,function*(){let r=yield sse(e.data).runInContext(t);return new ae.Molecule.Topology(r,{label:r.label||e.label,description:"Topology"})}))}}),xOe=Mt.BuiltIn({name:"topology-from-prmtop",display:{name:"PRMTOP Topology",description:"Create topology from PRMTOP."},from:[ae.Format.Prmtop],to:ae.Molecule.Topology})({apply({a:e}){return Pe.create("Create Topology",t=>Y(this,null,function*(){let r=yield Kse(e.data).runInContext(t);return new ae.Molecule.Topology(r,{label:r.label||e.label,description:"Topology"})}))}}),bOe=Mt.BuiltIn({name:"topology-from-top",display:{name:"TOP Topology",description:"Create topology from TOP."},from:[ae.Format.Top],to:ae.Molecule.Topology})({apply({a:e}){return Pe.create("Create Topology",t=>Y(this,null,function*(){let r=yield Qse(e.data).runInContext(t);return new ae.Molecule.Topology(r,{label:r.label||e.label,description:"Topology"})}))}});function SOe(e,t,r){return Y(this,null,function*(){if(t.type===ae.Molecule.Topology.type){let n=t.data;return yield Ut.trajectoryFromTopologyAndCoordinates(n,r).runInContext(e)}else if(t.type===ae.Molecule.Model.type){let n=t.data;return Ut.trajectoryFromModelAndCoordinates(n,r)}throw new Error("no model/topology found")})}var GI=Mt.BuiltIn({name:"trajectory-from-model-and-coordinates",display:{name:"Trajectory from Topology & Coordinates",description:"Create a trajectory from existing model/topology and coordinates."},from:ae.Root,to:ae.Molecule.Trajectory,params:{modelRef:C.Text("",{isHidden:!0}),coordinatesRef:C.Text("",{isHidden:!0})}})({apply({params:e,dependencies:t}){return Pe.create("Create trajectory from model/topology and coordinates",r=>Y(this,null,function*(){let n=t[e.coordinatesRef].data,o=yield SOe(r,t[e.modelRef],n),i={label:"Trajectory",description:`${o.frameCount} model${o.frameCount===1?"":"s"}`};return new ae.Molecule.Trajectory(o,i)}))}}),COe=Mt.BuiltIn({name:"trajectory-from-blob",display:{name:"Parse Blob",description:"Parse format blob into a single trajectory."},from:ae.Format.Blob,to:ae.Molecule.Trajectory})({apply({a:e}){return Pe.create("Parse Format Blob",t=>Y(this,null,function*(){let r=[];for(let o of e.data){if(o.kind!=="cif")continue;let i=o.data.blocks[0],s=yield TT(i).runInContext(t);if(s.frameCount===0)throw new Error("No models found.");for(let a=0;an.loadAllBlocks===!0})),blockIndex:C.Optional(C.Numeric(0,{min:0,step:1},{description:"Zero-based index of the block to parse. Only applies when Block Header parameter is not specified.",hideIf:n=>n.loadAllBlocks===!0||n.blockHeader}))};let{blocks:t}=e.data,r=t.map(n=>[n.header,n.header]);return r.push(["","[Use Block Index]"]),{loadAllBlocks:C.Optional(C.Boolean(!1,{description:"If True, ignore Block Header and Block Index parameters and parse all data blocks into a single trajectory."})),blockHeader:C.Optional(C.Select(t[0]&&t[0].header,r,{description:"Header of the block to parse. If not specifed, Block Index parameter applies.",hideIf:n=>n.loadAllBlocks===!0})),blockIndex:C.Optional(C.Numeric(0,{min:0,step:1,max:t.length-1},{description:"Zero-based index of the block to parse. Only applies when Block Header parameter is not specified.",hideIf:n=>n.loadAllBlocks===!0||n.blockHeader}))}}})({isApplicable:e=>e.data.blocks.length>0,apply({a:e,params:t}){return Pe.create("Parse mmCIF",r=>Y(this,null,function*(){var n;let o;if(t.loadAllBlocks){let s=[];for(let a of e.data.blocks){r.shouldUpdate&&(yield r.update(`Parsing ${a.header}...`));let l=yield TT(a).runInContext(r);for(let c=0;cc.header===s);if(!a)throw new Error(`Data block '${[s]}' not found.`);o=a.categoryNames.includes("chem_comp_atom")&&!a.categoryNames.includes("atom_site")&&!a.categoryNames.includes("ihm_sphere_obj_site")&&!a.categoryNames.includes("ihm_gaussian_obj_site")?yield rY(a).runInContext(r):yield TT(a,e.data).runInContext(r)}if(o.frameCount===0)throw new Error("No models found.");let i=Uh(o);return new ae.Molecule.Trajectory(o,i)}))}}),wOe=Mt.BuiltIn({name:"trajectory-from-pdb",display:{name:"Parse PDB",description:"Parse PDB string and create trajectory."},from:[ae.Data.String],to:ae.Molecule.Trajectory,params:{isPdbqt:C.Boolean(!1)}})({apply({a:e,params:t}){return Pe.create("Parse PDB",r=>Y(this,null,function*(){let n=yield Lie(e.data,e.label,t.isPdbqt).runInContext(r);if(n.isError)throw new Error(n.message);let o=yield ise(n.result).runInContext(r),i=Uh(o);return new ae.Molecule.Trajectory(o,i)}))}}),AOe=Mt.BuiltIn({name:"trajectory-from-gro",display:{name:"Parse GRO",description:"Parse GRO string and create trajectory."},from:[ae.Data.String],to:ae.Molecule.Trajectory})({apply({a:e}){return Pe.create("Parse GRO",t=>Y(this,null,function*(){let r=yield Rie(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield Gie(r.result).runInContext(t),o=Uh(n);return new ae.Molecule.Trajectory(n,o)}))}}),TOe=Mt.BuiltIn({name:"trajectory-from-xyz",display:{name:"Parse XYZ",description:"Parse XYZ string and create trajectory."},from:[ae.Data.String],to:ae.Molecule.Trajectory})({apply({a:e}){return Pe.create("Parse XYZ",t=>Y(this,null,function*(){let r=yield Mse(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield Bse(r.result).runInContext(t),o=Uh(n);return new ae.Molecule.Trajectory(n,o)}))}}),POe=Mt.BuiltIn({name:"trajectory-from-mol",display:{name:"Parse MOL",description:"Parse MOL string and create trajectory."},from:[ae.Data.String],to:ae.Molecule.Trajectory})({apply({a:e}){return Pe.create("Parse MOL",t=>Y(this,null,function*(){let r=yield Sse(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield Cse(r.result).runInContext(t),o=Uh(n);return new ae.Molecule.Trajectory(n,o)}))}}),IOe=Mt.BuiltIn({name:"trajectory-from-sdf",display:{name:"Parse SDF",description:"Parse SDF string and create trajectory."},from:[ae.Data.String],to:ae.Molecule.Trajectory})({apply({a:e}){return Pe.create("Parse SDF",t=>Y(this,null,function*(){let r=yield Nse(e.data).runInContext(t);if(r.isError)throw new Error(r.message);let n=[];for(let s of r.result.compounds){let a=yield Use(s).runInContext(t);for(let l=0;lY(this,null,function*(){let r=yield Ise(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);let n=yield Ese(r.result).runInContext(t),o=Uh(n);return new ae.Molecule.Trajectory(n,o)}))}}),DOe=Mt.BuiltIn({name:"trajectory-from-cube",display:{name:"Parse Cube",description:"Parse Cube file to create a trajectory."},from:ae.Format.Cube,to:ae.Molecule.Trajectory})({apply({a:e}){return Pe.create("Parse MOL",t=>Y(this,null,function*(){let r=yield wse(e.data).runInContext(t),n=Uh(r);return new ae.Molecule.Trajectory(r,n)}))}}),kOe=Mt.BuiltIn({name:"trajectory-from-cif-core",display:{name:"Parse CIF Core",description:"Identify and create all separate models in the specified CIF data block"},from:ae.Format.Cif,to:ae.Molecule.Trajectory,params(e){if(!e)return{blockHeader:C.Optional(C.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."}))};let{blocks:t}=e.data;return{blockHeader:C.Optional(C.Select(t[0]&&t[0].header,t.map(r=>[r.header,r.header]),{description:"Header of the block to parse"}))}}})({apply({a:e,params:t}){return Pe.create("Parse CIF Core",r=>Y(this,null,function*(){let n=t.blockHeader||e.data.blocks[0].header,o=e.data.blocks.find(a=>a.header===n);if(!o)throw new Error(`Data block '${[n]}' not found.`);let i=yield _se(o).runInContext(r);if(i.frameCount===0)throw new Error("No models found.");let s=Uh(i);return new ae.Molecule.Trajectory(i,s)}))}}),MOe=e=>e+1,BOe=e=>e-1,jN=Mt.BuiltIn({name:"model-from-trajectory",display:{name:"Molecular Model",description:"Create a molecular model from specified index in a trajectory."},from:ae.Molecule.Trajectory,to:ae.Molecule.Model,params:e=>e?{modelIndex:C.Converted(MOe,BOe,C.Numeric(1,{min:1,max:e.data.frameCount,step:1},{description:"Model Index",immediateUpdate:!0}))}:{modelIndex:C.Numeric(0,{},{description:"Zero-based index of the model",immediateUpdate:!0})}})({isApplicable:e=>e.data.frameCount>0,apply({a:e,params:t}){return Pe.create("Model from Trajectory",r=>Y(this,null,function*(){let n=t.modelIndex%e.data.frameCount;n<0&&(n+=e.data.frameCount);let o=yield Pe.resolveInContext(e.data.getFrameAtIndex(n),r),i=`Model ${n+1}`,s=e.data.frameCount===1?void 0:`of ${e.data.frameCount}`;return new ae.Molecule.Model(o,{label:i,description:s})}))},interpolate(e,t,r){return{modelIndex:r>=1?t.modelIndex:e.modelIndex+Math.floor((t.modelIndex-e.modelIndex+1)*r)}},dispose({b:e}){e?.data.customProperties.dispose()}}),ROe=Mt.BuiltIn({name:"structure-from-trajectory",display:{name:"Structure from Trajectory",description:"Create a molecular structure from a trajectory."},from:ae.Molecule.Trajectory,to:ae.Molecule.Structure})({apply({a:e}){return Pe.create("Build Structure",t=>Y(this,null,function*(){let r=yield Me.ofTrajectory(e.data,t),n={label:"Ensemble",description:Me.elementDescription(r)};return new ae.Molecule.Structure(r,n)}))},dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),LOe=Mt.BuiltIn({name:"structure-from-model",display:{name:"Structure",description:"Create a molecular structure (model, assembly, or symmetry) from the specified model."},from:ae.Molecule.Model,to:ae.Molecule.Structure,params(e){return pf.getParams(e&&e.data)}})({canAutoUpdate({oldParams:e,newParams:t}){return pf.canAutoUpdate(e.type,t.type)},apply({a:e,params:t},r){return Pe.create("Build Structure",n=>Y(this,null,function*(){return pf.create(r,n,e.data,t&&t.type)}))},update:({a:e,b:t,oldParams:r,newParams:n})=>Ra(r,n)?t.data.model===e.data?$e.UpdateResult.Unchanged:Ut.areHierarchiesEqual(e.data,t.data.model)?(t.data=t.data.remapModel(e.data),$e.UpdateResult.Updated):$e.UpdateResult.Recreate:$e.UpdateResult.Recreate,dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),Zse=x(),$se=ne(),Jse=ne(),FOe=Mt.BuiltIn({name:"transform-structure-conformation",display:{name:"Transform Conformation"},isDecorator:!0,from:ae.Molecule.Structure,to:ae.Molecule.Structure,params:{transform:C.MappedStatic("components",{components:C.Group({axis:C.Vec3(x.create(1,0,0)),angle:C.Numeric(0,{min:-180,max:180,step:.1}),translation:C.Vec3(x.create(0,0,0))},{isFlat:!0}),matrix:C.Group({data:C.Mat4(ne.identity()),transpose:C.Boolean(!1)},{isFlat:!0})},{label:"Kind"})}})({canAutoUpdate({newParams:e}){return e.transform.name!=="matrix"},apply({a:e,params:t}){let r=ne();if(t.transform.name==="components"){let{axis:o,angle:i,translation:s}=t.transform.params,a=e.data.boundary.sphere.center;ne.fromTranslation($se,x.negate(Zse,a)),ne.fromTranslation(Jse,x.add(Zse,a,s));let l=ne.fromRotation(ne(),Math.PI/180*i,x.normalize(x(),o));ne.mul3(r,Jse,l,$se)}else t.transform.name==="matrix"&&(ne.copy(r,t.transform.params.data),t.transform.params.transpose&&ne.transpose(r,r));let n=Me.transform(e.data,r);return new ae.Molecule.Structure(n,{label:e.label,description:`${e.description} [Transformed]`})},dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),OOe=Mt.BuiltIn({name:"structure-selection-from-expression",display:{name:"Selection",description:"Create a molecular structure from the specified expression."},from:ae.Molecule.Structure,to:ae.Molecule.Structure,params:()=>({expression:C.Value(oe.struct.generator.all,{isHidden:!0}),label:C.Optional(C.Text("",{isHidden:!0}))})})({apply({a:e,params:t,cache:r}){let{selection:n,entry:o}=nl.createAndRun(e.data,t.expression);if(r.entry=o,lt.isEmpty(n))return kn.Null;let i=lt.unionStructure(n),s={label:`${t.label||"Selection"}`,description:Me.elementDescription(i)};return new ae.Molecule.Structure(i,s)},update:({a:e,b:t,oldParams:r,newParams:n,cache:o})=>{if(r.expression!==n.expression)return $e.UpdateResult.Recreate;let i=o.entry;if(i.currentStructure===e.data)return $e.UpdateResult.Unchanged;let s=nl.updateStructure(i,e.data);return lt.isEmpty(s)?$e.UpdateResult.Null:(nl.updateStructureObject(t,s,n.label),$e.UpdateResult.Updated)},dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),NOe=Mt.BuiltIn({name:"structure-multi-selection-from-expression",display:{name:"Multi-structure Measurement Selection",description:"Create selection object from multiple structures."},from:ae.Root,to:ae.Molecule.Structure.Selections,params:()=>({selections:C.ObjectList({key:C.Text(void 0,{description:"A unique key."}),ref:C.Text(),groupId:C.Optional(C.Text()),expression:C.Value(oe.struct.generator.empty)},e=>e.ref,{isHidden:!0}),isTransitive:C.Optional(C.Boolean(!1,{isHidden:!0,description:"Remap the selections from the original structure if structurally equivalent."})),label:C.Optional(C.Text("",{isHidden:!0}))})})({apply({params:e,cache:t,dependencies:r}){let n=new Map,o=[],i=0;for(let a of e.selections){let{selection:l,entry:c}=nl.createAndRun(r[a.ref].data,a.expression);n.set(a.key,c);let u=lt.toLociWithSourceUnits(l);o.push({key:a.key,loci:u,groupId:a.groupId}),i+=$.Loci.size(u)}t.entries=n;let s={label:`${e.label||"Multi-selection"}`,description:`${e.selections.length} source(s), ${i} element(s) total`};return new ae.Molecule.Structure.Selections(o,s)},update:({b:e,oldParams:t,newParams:r,cache:n,dependencies:o})=>{if(!!t.isTransitive!=!!r.isTransitive)return $e.UpdateResult.Recreate;let i=n.entries,s=new Map,a=new Map;for(let d of e.data)a.set(d.key,d);let l=!1,c=0,u=[];for(let d of r.selections){let m=o[d.ref].data,p=!1;if(i.has(d.key)){let h=i.get(d.key);if(nl.isUnchanged(h,d.expression,m)&&a.has(d.key)){let f=a.get(d.key);f.groupId!==d.groupId&&(f.groupId=d.groupId,l=!0),s.set(d.key,h),u.push(f),c+=$.Loci.size(f.loci);continue}if(h.expression!==d.expression)p=!0;else{let f=!1;if(r.isTransitive)if(Me.areUnitIdsAndIndicesEqual(h.originalStructure,m)){let y=nl.run(h,h.originalStructure);h.currentStructure=m,s.set(d.key,h);let g=$.Loci.remap(lt.toLociWithSourceUnits(y),m);u.push({key:d.key,loci:g,groupId:d.groupId}),c+=$.Loci.size(g),l=!0}else f=!0;else f=!0;if(f){l=!0;let y=nl.updateStructure(h,m);s.set(d.key,h);let g=lt.toLociWithSourceUnits(y);u.push({key:d.key,loci:g,groupId:d.groupId}),c+=$.Loci.size(g)}}}else p=!0;if(p){l=!0;let{selection:h,entry:f}=nl.createAndRun(m,d.expression);s.set(d.key,f);let y=lt.toLociWithSourceUnits(h);u.push({key:d.key,loci:y}),c+=$.Loci.size(y)}}return l?(n.entries=s,e.data=u,e.label=`${r.label||"Multi-selection"}`,e.description=`${u.length} source(s), ${c} element(s) total`,$e.UpdateResult.Updated):$e.UpdateResult.Unchanged}}),UOe=Mt.BuiltIn({name:"structure-selection-from-script",display:{name:"Selection",description:"Create a molecular structure from the specified script."},from:ae.Molecule.Structure,to:ae.Molecule.Structure,params:()=>({script:C.Script({language:"mol-script",expression:"(sel.atom.atom-groups :residue-test (= atom.resname ALA))"}),label:C.Optional(C.Text(""))})})({apply({a:e,params:t,cache:r}){let{selection:n,entry:o}=nl.createAndRun(e.data,t.script);r.entry=o;let i=lt.unionStructure(n),s={label:`${t.label||"Selection"}`,description:Me.elementDescription(i)};return new ae.Molecule.Structure(i,s)},update:({a:e,b:t,oldParams:r,newParams:n,cache:o})=>{if(!eo.areEqual(r.script,n.script))return $e.UpdateResult.Recreate;let i=o.entry;if(i.currentStructure===e.data)return $e.UpdateResult.Unchanged;let s=nl.updateStructure(i,e.data);return nl.updateStructureObject(t,s,n.label),$e.UpdateResult.Updated},dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),zOe=Mt.BuiltIn({name:"structure-selection-from-bundle",display:{name:"Selection",description:"Create a molecular structure from the specified structure-element bundle."},from:ae.Molecule.Structure,to:ae.Molecule.Structure,params:()=>({bundle:C.Value($.Bundle.Empty,{isHidden:!0}),label:C.Optional(C.Text("",{isHidden:!0}))})})({apply({a:e,params:t,cache:r}){if(t.bundle.hash!==e.data.hashCode)return kn.Null;r.source=e.data;let n=$.Bundle.toStructure(t.bundle,e.data);if(n.elementCount===0)return kn.Null;let o={label:`${t.label||"Selection"}`,description:Me.elementDescription(n)};return new ae.Molecule.Structure(n,o)},update:({a:e,b:t,oldParams:r,newParams:n,cache:o})=>{if(!$.Bundle.areEqual(r.bundle,n.bundle))return $e.UpdateResult.Recreate;if(n.bundle.hash!==e.data.hashCode)return $e.UpdateResult.Null;if(o.source===e.data)return $e.UpdateResult.Unchanged;o.source=e.data;let i=$.Bundle.toStructure(n.bundle,e.data);return i.elementCount===0?$e.UpdateResult.Null:(t.label=`${n.label||"Selection"}`,t.description=Me.elementDescription(i),t.data=i,$e.UpdateResult.Updated)},dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),rae={polymer:"polymer",protein:"protein",nucleic:"nucleic",water:"water",branched:"branched",ligand:"ligand","non-standard":"non-standard",coarse:"coarse","atomic-sequence":"atomic-sequence","atomic-het":"atomic-het",spheres:"spheres"},VOe=C.objectToOptions(rae),GOe=Mt.BuiltIn({name:"structure-complex-element",display:{name:"Complex Element",description:"Create a molecular structure from the specified model."},from:ae.Molecule.Structure,to:ae.Molecule.Structure,params:{type:C.Select("atomic-sequence",VOe,{isHidden:!0})}})({apply({a:e,params:t}){let r,n;switch(t.type){case"polymer":r=ei.polymer.query,n="Polymer";break;case"protein":r=ei.protein.query,n="Protein";break;case"nucleic":r=ei.nucleic.query,n="Nucleic";break;case"water":r=bn.internal.water(),n="Water";break;case"branched":r=ei.branchedPlusConnected.query,n="Branched";break;case"ligand":r=ei.ligandPlusConnected.query,n="Ligand";break;case"non-standard":r=ei.nonStandardPolymer.query,n="Non-standard";break;case"coarse":r=ei.coarse.query,n="Coarse";break;case"atomic-sequence":r=bn.internal.atomicSequence(),n="Sequence";break;case"atomic-het":r=bn.internal.atomicHet(),n="HET Groups/Ligands";break;case"spheres":r=bn.internal.spheres(),n="Coarse Spheres";break;default:_r(t.type)}let o=r(new Mi(e.data)),i=lt.unionStructure(o);return i.elementCount===0?kn.Null:new ae.Molecule.Structure(i,{label:n,description:Me.elementDescription(i)})},dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),HOe=Mt.BuiltIn({name:"structure-component",display:{name:"Component",description:"A molecular structure component."},from:ae.Molecule.Structure,to:ae.Molecule.Structure,params:yse})({apply({a:e,params:t,cache:r}){return vse(e.data,t,r)},update:({a:e,b:t,oldParams:r,newParams:n,cache:o})=>xse(e.data,t,r,n,o),dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}}),qN=Mt.BuiltIn({name:"custom-model-properties",display:{name:"Custom Model Properties"},isDecorator:!0,from:ae.Molecule.Model,to:ae.Molecule.Model,params:(e,t)=>t.customModelProperties.getParams(e?.data)})({apply({a:e,params:t},r){return Pe.create("Custom Props",n=>Y(this,null,function*(){return yield eae(e.data,r,n,t),new ae.Molecule.Model(e.data,{label:e.label,description:e.description})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return Pe.create("Custom Props",i=>Y(this,null,function*(){t.data=e.data,t.label=e.label,t.description=e.description;for(let s of r.autoAttach){let a=o.customModelProperties.get(s);a&&e.data.customProperties.reference(a.descriptor,!1)}return yield eae(e.data,o,i,n),$e.UpdateResult.Updated}))},dispose({b:e}){e?.data.customProperties.dispose()}});function eae(e,t,r,n){return Y(this,null,function*(){let o={runtime:r,assetManager:t.managers.asset},{autoAttach:i,properties:s}=n;for(let a of Object.keys(s)){let l=t.customModelProperties.get(a),c=s[a];if(i.includes(a)||l.isHidden)try{yield l.attach(o,e,c,!0)}catch(u){t.log.warn(`Error attaching model prop '${a}': ${u}`)}else l.set(e,c)}})}var WN=Mt.BuiltIn({name:"custom-structure-properties",display:{name:"Custom Structure Properties"},isDecorator:!0,from:ae.Molecule.Structure,to:ae.Molecule.Structure,params:(e,t)=>t.customStructureProperties.getParams(e?.data.root)})({apply({a:e,params:t},r){return Pe.create("Custom Props",n=>Y(this,null,function*(){return yield tae(e.data.root,r,n,t),new ae.Molecule.Structure(e.data,{label:e.label,description:e.description})}))},update({a:e,b:t,oldParams:r,newParams:n},o){return e.data!==t.data?$e.UpdateResult.Recreate:Pe.create("Custom Props",i=>Y(this,null,function*(){t.data=e.data,t.label=e.label,t.description=e.description;for(let s of r.autoAttach){let a=o.customStructureProperties.get(s);a&&e.data.customPropertyDescriptors.reference(a.descriptor,!1)}return yield tae(e.data.root,o,i,n),$e.UpdateResult.Updated}))},dispose({b:e}){e?.data.customPropertyDescriptors.dispose()}});function tae(e,t,r,n){return Y(this,null,function*(){let o={runtime:r,assetManager:t.managers.asset},{autoAttach:i,properties:s}=n;for(let a of Object.keys(s)){let l=t.customStructureProperties.get(a),c=s[a];if(i.includes(a)||l.isHidden)try{yield l.attach(o,e,c,!0)}catch(u){t.log.warn(`Error attaching structure prop '${a}': ${u}`)}else l.set(e,c)}})}var jOe=Mt.BuiltIn({name:"shape-from-ply",display:{name:"Shape from PLY",description:"Create Shape from PLY data"},from:ae.Format.Ply,to:ae.Shape.Provider,params(e){return{transforms:C.Optional(C.Value([],{isHidden:!0})),label:C.Optional(C.Text("",{isHidden:!0}))}}})({apply({a:e,params:t}){return Pe.create("Create shape from PLY",r=>Y(this,null,function*(){let n=yield zie(e.data,t).runInContext(r),o={label:t.label||"Shape"};return new ae.Shape.Provider(n,o)}))}});var $N={};hi($N,{AssignColorVolume:()=>JOe,VolumeFromCcp4:()=>YOe,VolumeFromCube:()=>KOe,VolumeFromDensityServerCif:()=>ZOe,VolumeFromDsn6:()=>XOe,VolumeFromDx:()=>QOe,VolumeFromSegmentationCif:()=>$Oe,VolumeTransform:()=>eNe});function qOe(e){return e.originX===0&&e.originY===0&&e.originZ===0?x.create(e.NCSTART,e.NRSTART,e.NSSTART):x.create(e.originX/(e.xLength/e.NX),e.originY/(e.yLength/e.NY),e.originZ/(e.zLength/e.NZ))}function WOe(e){let t=aN(e);switch(t){case rl.Float32:return Float32Array;case rl.Int8:return Int8Array;case rl.Int16:return Int16Array;case rl.Uint16:return Uint16Array}throw Error(`${t} is not a supported value format.`)}function nae(e,t){return Pe.create("Create Volume",r=>Y(this,null,function*(){let{header:n,values:o}=e,i=x.create(n.xLength,n.yLength,n.zLength);t&&t.voxelSize&&x.mul(i,i,t.voxelSize);let s=x.create(Cr(n.alpha),Cr(n.beta),Cr(n.gamma)),a=n.ISPG>65536?0:n.ISPG,l=ui.create(a||"P 1",i,s),c=x.create(n.MAPC-1,n.MAPR-1,n.MAPS-1),u=lr.convertToCanonicalAxisIndicesFastToSlow(c),d=[n.NX,n.NY,n.NZ],m=u([n.NC,n.NR,n.NS]),p=qOe(n);t?.offset&&x.add(p,p,t.offset);let h=u(p),f=x.create(h[0]/d[0],h[1]/d[1],h[2]/d[2]),y=x.create(m[0]/d[0],m[1]/d[1],m[2]/d[2]),g=lr.Space(m,lr.invertAxisOrder(c),WOe(n)),v=lr.create(g,lr.Data1(o)),b=n.AMIN===0&&n.AMAX===0&&n.AMEAN===0&&n.ARMS===0;return{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"spacegroup",cell:l,fractionalBox:ft.create(f,x.add(x.zero(),f,y))},cells:v,stats:{min:isNaN(n.AMIN)||b?Sg(o):n.AMIN,max:isNaN(n.AMAX)||b?Js(o):n.AMAX,mean:isNaN(n.AMEAN)||b?Cg(o):n.AMEAN,sigma:isNaN(n.ARMS)||n.ARMS===0?_g(o):n.ARMS}},sourceData:XN.create(e),customProperties:new ss,_propertyData:Object.create(null)}}))}var XN;(function(e){function t(n){return n?.kind==="ccp4"}e.is=t;function r(n){return{kind:"ccp4",name:n.name,data:n}}e.create=r})(XN||(XN={}));function oae(e,t){return Pe.create("Create Volume",r=>Y(this,null,function*(){let{header:n,values:o}=e,i=x.create(n.xlen,n.ylen,n.zlen);t&&t.voxelSize&&x.mul(i,i,t.voxelSize);let s=x.create(Cr(n.alpha),Cr(n.beta),Cr(n.gamma)),a=ui.create("P 1",i,s),l=[n.xRate,n.yRate,n.zRate],c=[n.xExtent,n.yExtent,n.zExtent],u=[n.xStart,n.yStart,n.zStart],d=x.create(u[0]/l[0],u[1]/l[1],u[2]/l[2]),m=x.create(c[0]/l[0],c[1]/l[1],c[2]/l[2]),p=lr.Space(c,[0,1,2],Float32Array),h=lr.create(p,lr.Data1(o));return{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"spacegroup",cell:a,fractionalBox:ft.create(d,x.add(x.zero(),d,m))},cells:h,stats:{min:Sg(o),max:Js(o),mean:Cg(o),sigma:n.sigma!==void 0?n.sigma:_g(o)}},sourceData:KN.create(e),customProperties:new ss,_propertyData:Object.create(null)}}))}var KN;(function(e){function t(n){return n?.kind==="dsn6"}e.is=t;function r(n){return{kind:"dsn6",name:n.name,data:n}}e.create=r})(KN||(KN={}));function iae(e,t){return Pe.create("Create Volume",()=>Y(this,null,function*(){let{header:r,values:n}=e,o=lr.Space(r.dim,[0,1,2],Float64Array),i=lr.create(o,lr.Data1(n)),s=ne.fromTranslation(ne(),r.min),a=ne.fromScaling(ne(),r.h);return ne.mul(s,s,a),{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"matrix",matrix:s},cells:i,stats:{min:Sg(n),max:Js(n),mean:Cg(n),sigma:_g(n)}},sourceData:QN.create(e),customProperties:new ss,_propertyData:Object.create(null)}}))}var QN;(function(e){function t(n){return n?.kind==="dx"}e.is=t;function r(n){return{kind:"dx",name:n.name,data:n}}e.create=r})(QN||(QN={}));function sae(e,t){return Pe.create("Create Segmentation Volume",r=>Y(this,null,function*(){var n;let{volume_data_3d_info:o,segmentation_data_3d:i}=e,s=ui.create(o.spacegroup_number.value(0),x.ofArray(o.spacegroup_cell_size.value(0)),x.scale(x(),x.ofArray(o.spacegroup_cell_angles.value(0)),Math.PI/180)),a=o.axis_order.value(0),l=lr.convertToCanonicalAxisIndicesFastToSlow(a),c=l(o.sample_count.value(0)),u=lr.Space(c,lr.invertAxisOrder(a),Float32Array),d=lr.create(u,lr.Data1(i.values.toArray({array:Float32Array}))),m=x.ofArray(l(o.origin.value(0))),p=x.ofArray(l(o.dimensions.value(0))),h={label:t?.label,entryId:void 0,grid:{transform:{kind:"spacegroup",cell:s,fractionalBox:ft.create(m,x.add(x(),m,p))},cells:d,stats:{min:0,max:1,mean:0,sigma:1}},sourceData:ZN.create(e),customProperties:new ss,_propertyData:{ownerId:t?.ownerId}};Je.PickingGranularity.set(h,"object");let f=new Map,y=new Map,{segment_id:g,set_id:v}=e.segmentation_data_table;for(let R=0,U=g.rowCount;R{R.forEach(F=>{f.has(F)||f.set(F,new Set),f.get(F).add(U)})});let b=[0,0,0],S=d.space.getCoords,_=d.data,[w,E,A]=h.grid.cells.space.dimensions,P=w-1,T=E-1,B=A-1,D={};y.forEach((R,U)=>{D[U]=[P,T,B,-1,-1,-1]});for(let R=0,U=_.length;RN[3]&&(N[3]=b[0]),b[1]>N[4]&&(N[4]=b[1]),b[2]>N[5]&&(N[5]=b[2])}let M={};return f.forEach((R,U)=>{M[U]=ft.create(x.create(P,T,B),x.create(-1,-1,-1))}),ci(D,(R,U)=>{y.get(parseInt(U)).forEach(F=>{let N=M[F];R[0]N.max[0]&&(N.max[0]=R[3]),R[4]>N.max[1]&&(N.max[1]=R[4]),R[5]>N.max[2]&&(N.max[2]=R[5])})}),Je.Segmentation.set(h,{segments:f,sets:y,bounds:M,labels:(n=t?.segmentLabels)!==null&&n!==void 0?n:{}}),h}))}var ZN;(function(e){function t(n){return n?.kind==="segcif"}e.is=t;function r(n){return{kind:"segcif",name:n._name,data:n}}e.create=r})(ZN||(ZN={}));var YOe=Mt.BuiltIn({name:"volume-from-ccp4",display:{name:"Volume from CCP4/MRC/MAP",description:"Create Volume from CCP4/MRC/MAP data"},from:ae.Format.Ccp4,to:ae.Volume.Data,params(e){return{voxelSize:C.Vec3(x.create(1,1,1)),offset:C.Vec3(x.create(0,0,0)),entryId:C.Text("")}}})({apply({a:e,params:t}){return Pe.create("Create volume from CCP4/MRC/MAP",r=>Y(this,null,function*(){let n=yield nae(e.data,te(k({},t),{label:e.data.name||e.label})).runInContext(r),o={label:n.label||"Volume",description:`Volume ${e.data.header.NX}\xD7${e.data.header.NX}\xD7${e.data.header.NX}`};return new ae.Volume.Data(n,o)}))},dispose({b:e}){e?.data.customProperties.dispose()}}),XOe=Mt.BuiltIn({name:"volume-from-dsn6",display:{name:"Volume from DSN6/BRIX",description:"Create Volume from DSN6/BRIX data"},from:ae.Format.Dsn6,to:ae.Volume.Data,params(e){return{voxelSize:C.Vec3(x.create(1,1,1)),entryId:C.Text("")}}})({apply({a:e,params:t}){return Pe.create("Create volume from DSN6/BRIX",r=>Y(this,null,function*(){let n=yield oae(e.data,te(k({},t),{label:e.data.name||e.label})).runInContext(r),o={label:n.label||"Volume",description:`Volume ${e.data.header.xExtent}\xD7${e.data.header.yExtent}\xD7${e.data.header.zExtent}`};return new ae.Volume.Data(n,o)}))},dispose({b:e}){e?.data.customProperties.dispose()}}),KOe=Mt.BuiltIn({name:"volume-from-cube",display:{name:"Volume from Cube",description:"Create Volume from Cube data"},from:ae.Format.Cube,to:ae.Volume.Data,params(e){return{dataIndex:e?C.Select(0,e.data.header.dataSetIds.map((r,n)=>[n,`${r}`])):C.Numeric(0),entryId:C.Text("")}}})({apply({a:e,params:t}){return Pe.create("Create volume from Cube",r=>Y(this,null,function*(){let n=yield IQ(e.data,te(k({},t),{label:e.data.name||e.label})).runInContext(r),o={label:n.label||"Volume",description:`Volume ${e.data.header.dim[0]}\xD7${e.data.header.dim[1]}\xD7${e.data.header.dim[2]}`};return new ae.Volume.Data(n,o)}))},dispose({b:e}){e?.data.customProperties.dispose()}}),QOe=Mt.BuiltIn({name:"volume-from-dx",display:{name:"Parse DX",description:"Create volume from DX data."},from:ae.Format.Dx,to:ae.Volume.Data})({apply({a:e}){return Pe.create("Parse DX",t=>Y(this,null,function*(){let r=yield iae(e.data,{label:e.data.name||e.label}).runInContext(t),n={label:r.label||"Volume",description:`Volume ${e.data.header.dim[0]}\xD7${e.data.header.dim[1]}\xD7${e.data.header.dim[2]}`};return new ae.Volume.Data(r,n)}))},dispose({b:e}){e?.data.customProperties.dispose()}}),ZOe=Mt.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:ae.Format.Cif,to:ae.Volume.Data,params(e){if(!e)return{blockHeader:C.Optional(C.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),entryId:C.Text("")};let t=e.data.blocks.slice(1);return{blockHeader:C.Optional(C.Select(t[0]&&t[0].header,t.map(r=>[r.header,r.header]),{description:"Header of the block to parse"})),entryId:C.Text("")}}})({isApplicable:e=>e.data.blocks.length>0,apply({a:e,params:t}){return Pe.create("Parse density-server CIF",r=>Y(this,null,function*(){var n;let o=t.blockHeader||e.data.blocks[1].header,i=e.data.blocks.find(m=>m.header===o);if(!i)throw new Error(`Data block '${[o]}' not found.`);let s=Vl.schema.densityServer(i),a=yield pP(s,{entryId:t.entryId}).runInContext(r),[l,c,u]=a.grid.cells.space.dimensions,d={label:(n=t.entryId)!==null&&n!==void 0?n:s.volume_data_3d_info.name.value(0),description:`Volume ${l}\xD7${c}\xD7${u}`};return new ae.Volume.Data(a,d)}))},dispose({b:e}){e?.data.customProperties.dispose()}}),$Oe=Mt.BuiltIn({name:"volume-from-segmentation-cif",display:{name:"Volume from Segmentation CIF"},from:ae.Format.Cif,to:ae.Volume.Data,params(e){let t=e?.data.blocks.slice(1);return{blockHeader:t?C.Optional(C.Select(t[0]&&t[0].header,t.map(n=>[n.header,n.header]),{description:"Header of the block to parse"})):C.Optional(C.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),segmentLabels:C.ObjectList({id:C.Numeric(-1),label:C.Text("")},n=>`${n.id} = ${n.label}`,{description:"Mapping of segment IDs to segment labels"}),ownerId:C.Text("",{isHidden:!0,description:"Reference to the object which manages this volume"})}}})({isApplicable:e=>e.data.blocks.length>0,apply({a:e,params:t}){return Pe.create("Parse segmentation CIF",r=>Y(this,null,function*(){let n=t.blockHeader||e.data.blocks[1].header,o=e.data.blocks.find(m=>m.header===n);if(!o)throw new Error(`Data block '${[n]}' not found.`);let i=Vl.schema.segmentation(o),s={};for(let m of t.segmentLabels)s[m.id]=m.label;let a=yield sae(i,{segmentLabels:s,ownerId:t.ownerId}).runInContext(r),[l,c,u]=a.grid.cells.space.dimensions,d={label:i.volume_data_3d_info.name.value(0),description:`Segmentation ${l}\xD7${c}\xD7${u}`};return new ae.Volume.Data(a,d)}))},dispose({b:e}){e?.data.customProperties.dispose()}}),JOe=Mt.BuiltIn({name:"assign-color-volume",display:{name:"Assign Color Volume",description:"Assigns another volume to be available for coloring."},from:ae.Volume.Data,to:ae.Volume.Data,isDecorator:!0,params(e,t){if(!e)return{ref:C.Text()};let r=t.state.data.select(qt.Generators.root.subtree().ofType(ae.Volume.Data).filter(n=>{var o;return!!n.obj&&!(!((o=n.obj)===null||o===void 0)&&o.data.colorVolume)&&n.obj!==e}));return r.length===0?{ref:C.Text("",{isHidden:!0})}:{ref:C.Select(r[0].transform.ref,r.map(n=>[n.transform.ref,n.obj.label]))}}})({apply({a:e,params:t,dependencies:r}){return Pe.create("Assign Color Volume",n=>Y(this,null,function*(){if(!r||!r[t.ref])throw new Error("Dependency not available.");let o=r[t.ref].data,i=te(k({},e.data),{colorVolume:o}),s={label:e.label,description:"Volume + Colors"};return new ae.Volume.Data(i,s)}))}}),eNe=Mt.BuiltIn({name:"volume-transform",display:{name:"Transform Volume"},isDecorator:!0,from:ae.Volume.Data,to:ae.Volume.Data,params:{transform:C.MappedStatic("matrix",{matrix:C.Group({data:C.Mat4(ne.identity()),transpose:C.Boolean(!1)},{isFlat:!0})},{label:"Kind"})}})({canAutoUpdate({newParams:e}){return e.transform.name!=="matrix"},apply({a:e,params:t}){let r=ne(),n=k({},e.data.grid.transform);ne.copy(r,t.transform.params.data),t.transform.params.transpose&&ne.transpose(r,r);let o=e.data.grid.transform.kind==="matrix"?e.data.grid.transform.matrix:wo.getGridToCartesianTransform(e.data.grid);n={kind:"matrix",matrix:ne.mul(ne(),r,o)};let i=te(k({},e.data),{grid:te(k({},e.data.grid),{transform:n})});return new ae.Volume.Data(i,{label:e.label,description:`${e.description} [Transformed]`})}});var Ge={Data:gN,Misc:yN,Model:YN,Volume:$N,Representation:WO,Shape:HO};var aae=Zl.create({name:"built-in.animate-assembly-unwind",display:{name:"Unwind Assembly"},isExportable:!0,params:e=>{let t=[["all","All"]],r=e.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Structure));for(let n of r)t.push([n.transform.ref,n.obj.data.models[0].label]);return{durationInMs:C.Numeric(3e3,{min:100,max:1e4,step:100}),playOnce:C.Boolean(!1),target:C.Select(t[0][0],t)}},canApply(e){let t=e.state.data,r=ur.RootRef;return{canApply:t.select(qt.Generators.ofType(ae.Molecule.Structure.Representation3D,r)).length>0}},getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),initialState:()=>({t:0}),setup(e,t,r){let n=r.state.data,o=!e.target||e.target==="all"?ur.RootRef:e.target,i=n.select(qt.Generators.ofType(ae.Molecule.Structure.Representation3D,o)),s=n.build(),a=!1;for(let l of i)n.select(qt.Generators.ofTransformer(Ge.Representation.UnwindStructureAssemblyRepresentation3D,l.transform.ref)).length>0||(a=!0,s.to(l).apply(Ge.Representation.UnwindStructureAssemblyRepresentation3D,{t:0},{tags:"animate-assembly-unwind"}));if(a)return s.commit({doNotUpdateCurrent:!0})},teardown(e,t,r){let n=r.state.data,o=n.select(qt.Generators.ofType(ae.Molecule.Structure.Representation3DState).withTag("animate-assembly-unwind"));if(o.length===0)return;let i=n.build();for(let s of o)i.delete(s.transform.ref);return i.commit()},apply(e,t,r){return Y(this,null,function*(){let n=r.plugin.state.data,o=!r.params.target||r.params.target==="all"?ur.RootRef:r.params.target,i=n.select(qt.Generators.ofTransformer(Ge.Representation.UnwindStructureAssemblyRepresentation3D,o));if(i.length===0)return{kind:"finished"};let s=n.build(),a=(t.current-t.lastApplied)/r.params.durationInMs,l=e.t+a,c=!1;r.params.playOnce&&l>=1?(c=!0,l=1):l=l%1;for(let u of i)s.to(u).update({t:l});return yield ct.State.Update(r.plugin,{state:n,tree:s,options:{doNotLogTiming:!0}}),c?{kind:"finished"}:{kind:"next",state:{t:l}}})}});var HI=x(),lae=x(),cae=vn(),uae=Zl.create({name:"built-in.animate-camera-spin",display:{name:"Camera Spin",description:"Spin the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:C.Numeric(4e3,{min:100,max:2e4,step:100}),speed:C.Numeric(1,{min:1,max:10,step:1},{description:"How many times to spin in the specified duration."}),direction:C.Select("cw",[["cw","Clockwise"],["ccw","Counter Clockwise"]],{cycle:!0})}),initialState:(e,t)=>{var r;return{snapshot:(r=t.canvas3d)===null||r===void 0?void 0:r.camera.getSnapshot()}},getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),teardown:(e,t,r)=>{var n;(n=r.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t.snapshot,durationMs:0})},apply(e,t,r){return Y(this,null,function*(){var n,o;if(t.current===0)return{kind:"next",state:e};let i=e.snapshot;if(i.radiusMax<1e-4)return{kind:"finished"};let s=t.animation?((n=t.animation)===null||n===void 0?void 0:n.currentFrame)/(t.animation.frameCount+1):po(t.current/r.params.durationInMs,0,1),a=2*Math.PI*s*r.params.speed*(r.params.direction==="ccw"?-1:1);x.sub(HI,i.position,i.target),x.normalize(lae,i.up),vn.setAxisAngle(cae,lae,a),x.transformQuat(HI,HI,cae);let l=x.add(x(),i.target,HI);return(o=r.plugin.canvas3d)===null||o===void 0||o.requestCameraReset({snapshot:te(k({},i),{position:l}),durationMs:0}),s>=.99999?{kind:"finished"}:{kind:"next",state:e}})}});var dae=Zl.create({name:"built-in.animate-model-index",display:{name:"Animate Trajectory"},isExportable:!0,params:()=>({mode:C.MappedStatic("loop",{palindrome:C.Group({}),loop:C.Group({direction:C.Select("forward",[["forward","Forward"],["backward","Backward"]])}),once:C.Group({direction:C.Select("forward",[["forward","Forward"],["backward","Backward"]])},{isFlat:!0})},{options:[["palindrome","Palindrome"],["loop","Loop"],["once","Once"]]}),duration:C.MappedStatic("fixed",{fixed:C.Group({durationInS:C.Numeric(5,{min:1,max:120,step:.1},{description:"Duration in seconds"})},{isFlat:!0}),computed:C.Group({targetFps:C.Numeric(30,{min:5,max:250,step:1},{label:"Target FPS"})},{isFlat:!0}),sequential:C.Group({maxFps:C.Numeric(30,{min:5,max:60,step:1})},{isFlat:!0})})}),canApply(e){let t=e.state.data,r=t.select(qt.Generators.ofTransformer(Ge.Model.ModelFromTrajectory));for(let n of r){let o=qt.findAncestorOfType(t.tree,t.cells,n.transform.ref,ae.Molecule.Trajectory);if(o&&o.obj&&o.obj.data.frameCount>1)return{canApply:!0}}return{canApply:!1,reason:"No trajectory to animate"}},getDuration:(e,t)=>{var r;if(((r=e.duration)===null||r===void 0?void 0:r.name)==="fixed")return{kind:"fixed",durationMs:e.duration.params.durationInS*1e3};if(e.duration.name==="computed"){let n=t.state.data,o=n.select(qt.Generators.ofTransformer(Ge.Model.ModelFromTrajectory)),i=0;for(let s of o){let a=qt.findAncestorOfType(n.tree,n.cells,s.transform.ref,ae.Molecule.Trajectory);if(!a||!a.obj)continue;let l=a.obj;i=Math.max(Math.ceil(1e3*l.data.frameCount/e.duration.params.targetFps),i)}return{kind:"fixed",durationMs:i}}return{kind:"unknown"}},initialState:()=>({}),apply(e,t,r){return Y(this,null,function*(){if(r.params.duration.name==="sequential"&&t.current>0&&t.current-t.lastApplied<1e3/r.params.duration.params.maxFps)return{kind:"skip"};let n=r.plugin.state.data,o=n.select(qt.Generators.ofTransformer(Ge.Model.ModelFromTrajectory));if(o.length===0)return{kind:"finished"};let i=n.build(),s=r.params,a=e.palindromeDirections||{},l=!1,c=!0;for(let u of o){let d=qt.findAncestorOfType(n.tree,n.cells,u.transform.ref,ae.Molecule.Trajectory);if(!d||!d.obj)continue;let m=d.obj;m.data.frameCount<=1||i.to(u).update(p=>{let h=m.data.frameCount;if(h!==1)c=!1;else return p;if(s.duration.name==="sequential"){let f=1;if(s.mode.name==="once"){if(f=s.mode.params.direction==="backward"?-1:1,f===-1&&p.modelIndex===0||f===1&&p.modelIndex===h-1)return l=!0,p}else s.mode.name==="palindrome"&&(p.modelIndex===0?f=1:p.modelIndex===h-1?f=-1:f=a[u.transform.ref]||1);a[u.transform.ref]=f;let y=(p.modelIndex+f)%h;return y<0&&(y+=h),l=l||f===-1&&y===0||f===1&&y===h-1,{modelIndex:y}}else{let f=s.duration.name==="fixed"?s.duration.params.durationInS*1e3:Math.ceil(1e3*m.data.frameCount/s.duration.params.targetFps);if(s.mode.name==="once"&&t.current>=f)return l=!0,{modelIndex:m.data.frameCount-1};let y=t.current%f/f;return s.mode.name==="loop"&&s.mode.params.direction==="backward"&&(y=1-y),s.mode.name==="palindrome"&&(y=2*y,y>1&&(y=2-y)),{modelIndex:Math.min(Math.floor(m.data.frameCount*y),m.data.frameCount-1)}}})}return c||(yield ct.State.Update(r.plugin,{state:n,tree:i,options:{doNotLogTiming:!0}})),c||s.mode.name==="once"&&l?{kind:"finished"}:s.mode.name==="palindrome"?{kind:"next",state:{palindromeDirections:a}}:{kind:"next",state:{}}})}});function mae(e,t,r=!1){return Y(this,null,function*(){var n,o,i,s;t.snapshot.data&&(yield e.runTask(e.state.data.setSnapshot(t.snapshot.data)),(n=e.canvas3d)===null||n===void 0||n.setProps({trackball:(i=(o=t.snapshot.canvas3d)===null||o===void 0?void 0:o.props)===null||i===void 0?void 0:i.trackball})),t.snapshot.camera&&((s=e.canvas3d)===null||s===void 0||s.requestCameraReset({snapshot:t.snapshot.camera.current,durationMs:r||t.snapshot.camera.transitionStyle==="instant"?0:t.snapshot.camera.transitionDurationInMs}))})}var pae=Zl.create({name:"built-in.animate-state-snapshots",display:{name:"State Snapshots"},isExportable:!0,params:()=>({}),canApply(e){let t=e.managers.snapshot.state.entries;return t.size<2?{canApply:!1,reason:"At least 2 states required."}:t.some(r=>!!r?.snapshot.startAnimation)?{canApply:!1,reason:"Nested animations not supported."}:{canApply:e.managers.snapshot.state.entries.size>1}},setup(e,t,r){let n=r.managers.snapshot.state.entries.get(0);mae(r,n,!0)},getDuration:(e,t)=>({kind:"fixed",durationMs:t.managers.snapshot.state.entries.toArray().reduce((r,n)=>{var o;return r+((o=n.snapshot.durationInMs)!==null&&o!==void 0?o:0)},0)}),initialState:(e,t)=>{let r=t.managers.snapshot.state.entries.toArray();return{totalDuration:r.reduce((n,o)=>{var i;return n+((i=o.snapshot.durationInMs)!==null&&i!==void 0?i:0)},0),snapshots:r,currentIndex:0}},apply(e,t,r){return Y(this,null,function*(){var n;if(t.current>=e.totalDuration)return{kind:"finished"};let o=0,i=0;for(let s of e.snapshots){if(o+=(n=s.snapshot.durationInMs)!==null&&n!==void 0?n:0,t.current=e.snapshots.length?{kind:"finished"}:i===e.currentIndex?{kind:"skip"}:(yield mae(r.plugin,e.snapshots[i]),{kind:"next",state:te(k({},e),{currentIndex:i})})})}});var JN={};hi(JN,{ApplyAction:()=>Sae,ClearHighlights:()=>Tae,Highlight:()=>Aae,RemoveObject:()=>Cae,SetCurrentObject:()=>xae,Snapshots:()=>Pae,SyncBehaviors:()=>vae,ToggleExpanded:()=>_ae,ToggleVisibility:()=>wae,Update:()=>bae,registerDefault:()=>oNe,setSubtreeVisibility:()=>pp});var mp=class{constructor(){this.subs=void 0}subscribe(t,r){typeof this.subs>"u"&&(this.subs=[]);let n=t.subscribe(r);return this.subs.push(n),{unsubscribe:()=>{n&&this.subs&&_d(this.subs,n)&&(n.unsubscribe(),n=void 0)}}}get ev(){return this._ev||(this._ev=Hl.create())}dispose(){if(this._ev&&this._ev.dispose(),this.subs){for(let t of this.subs)t.unsubscribe();this.subs=void 0}}},ca=class extends mp{updateState(...t){let r=this.state,n=eH(r,t);return n!==r?(this._state=n,!0):!1}get state(){return this._state}constructor(t){super(),this._state=t}};var N_="4.3.0",fae=new Date(typeof __MOLSTAR_DEBUG_TIMESTAMP__<"u"?__MOLSTAR_DEBUG_TIMESTAMP__:1716707835175);function tNe(e,t,r,n=1){e.width=Math.round(window.devicePixelRatio*n*t),e.height=Math.round(window.devicePixelRatio*n*r),Object.assign(e.style,{width:`${t}px`,height:`${r}px`})}function hae(e,t,r=1){let n=window.innerWidth,o=window.innerHeight;t!==document.body&&(n=t.offsetWidth,o=t.offsetHeight),tNe(e,n,o,r)}function rNe(e,t,r,n){let o=atob(e.toDataURL(r,n).split(",")[1]),i=o.length,s=i>>2,a=new Uint8Array(i),l=new Uint32Array(a.buffer,0,s),c=0;for(let d=0;d{let i=s=>{s?n(s):o("no blob returned")};HTMLCanvasElement.prototype.toBlob?e.toBlob(i,t,r):rNe(e,i,t,r)})})}var O0=(()=>{class e extends ca{getIndex(r){return this.state.entries.indexOf(r)}getEntry(r){if(r)return this.entryMap.get(r)}remove(r){let n=this.entryMap.get(r);n&&(n?.image&&this.plugin.managers.asset.delete(n.image),this.entryMap.delete(r),this.updateState({current:this.state.current===r?void 0:this.state.current,entries:this.state.entries.delete(this.getIndex(n))}),this.events.changed.next(void 0))}add(r){this.entryMap.set(r.snapshot.id,r),this.updateState({current:r.snapshot.id,entries:this.state.entries.push(r)}),this.events.changed.next(void 0)}replace(r,n,o){var i,s,a;let l=this.getEntry(r);if(!l)return;this.defaultSnapshotId=void 0,l?.image&&this.plugin.managers.asset.delete(l.image);let c=this.getIndex(l),u=e.Entry(n,{key:(i=o?.key)!==null&&i!==void 0?i:l.key,name:(s=o?.name)!==null&&s!==void 0?s:l.name,description:(a=o?.description)!==null&&a!==void 0?a:l.description,image:o?.image});this.entryMap.set(n.id,u),this.updateState({current:u.snapshot.id,entries:this.state.entries.set(c,u)}),this.events.changed.next(void 0)}move(r,n){let o=this.state.entries.size;if(o<2)return;let i=this.getEntry(r);if(!i)return;let s=this.getIndex(i),a=(s+n)%o;a<0&&(a+=o);let l=this.state.entries.get(a),c=this.state.entries.asMutable();c.set(a,i),c.set(s,l),this.updateState({current:i.snapshot.id,entries:c.asImmutable()}),this.events.changed.next(void 0)}update(r,n){var o,i,s;let a=this.getIndex(r);if(a<0)return;let l=this.state.entries.set(a,te(k({},r),{key:((o=n.key)===null||o===void 0?void 0:o.trim())||void 0,name:((i=n.name)===null||i===void 0?void 0:i.trim())||void 0,description:((s=n.description)===null||s===void 0?void 0:s.trim())||void 0}));this.updateState({entries:l}),this.entryMap.set(r.snapshot.id,this.state.entries.get(a)),this.events.changed.next(void 0)}clear(){this.state.entries.size!==0&&(this.entryMap.forEach(r=>{r?.image&&this.plugin.managers.asset.delete(r.image)}),this.entryMap.clear(),this.updateState({current:void 0,entries:nf()}),this.events.changed.next(void 0))}applyKey(r){let n=this.state.entries.find(o=>o.key===r);n&&(this.updateState({current:n.snapshot.id}),this.events.changed.next(void 0),this.plugin.state.setSnapshot(n.snapshot))}setCurrent(r){let n=this.getEntry(r);return n&&(this.updateState({current:r}),this.events.changed.next(void 0)),n&&n.snapshot}getNextId(r,n){let o=this.state.entries.size;if(!r){if(o===0)return;let a=n===-1?o-1:0;return this.state.entries.get(a).snapshot.id}let i=this.getEntry(r);if(!i)return;let s=this.getIndex(i);if(!(s<0))return s=(s+n)%o,s<0&&(s+=o),this.state.entries.get(s).snapshot.id}setStateSnapshot(r){return Y(this,null,function*(){r.version,N_,this.clear();let n=nf().asMutable();for(let a of r.entries)this.entryMap.set(a.snapshot.id,a),n.push(a);let o=r.current?r.current:r.entries.length>0?r.entries[0].snapshot.id:void 0;if(this.updateState({current:o,entries:n.asImmutable(),isPlaying:!1,nextSnapshotDelayInMs:r.playback?r.playback.nextSnapshotDelayInMs:e.DefaultNextSnapshotDelayInMs}),this.events.changed.next(void 0),!o)return;let i=this.getEntry(o),s=i&&i.snapshot;if(s)return yield this.plugin.state.setSnapshot(s),r.playback&&r.playback.isPlaying&&this.play(!0),s})}syncCurrent(r){return Y(this,null,function*(){var n,o;let i=this.state.entries.size===0,s=this.state.entries.size===1&&this.state.current&&this.state.current===this.defaultSnapshotId;if(!i&&!s)return;let a=this.plugin.state.getSnapshot(r?.params),l=((o=(n=r?.params)===null||n===void 0?void 0:n.image)!==null&&o!==void 0?o:this.plugin.state.snapshotParams.value.image)?yield e.getCanvasImageAsset(this.plugin,`${a.id}-image.png`):void 0;if(i)this.add(e.Entry(a,{name:r?.name,description:r?.description,image:l}));else if(s){let c=this.getEntry(this.state.current);c?.image&&this.plugin.managers.asset.delete(c.image),this.replace(this.state.current,a,{image:l})}this.defaultSnapshotId=a.id})}getStateSnapshot(r){return Y(this,null,function*(){return yield this.syncCurrent(r),{timestamp:+new Date,version:N_,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()}})}serialize(r){return Y(this,null,function*(){let n=JSON.stringify(yield this.getStateSnapshot({params:r?.params}),null,2);if(!r?.type||r.type==="json"||r.type==="molj")return new Blob([n],{type:"application/json;charset=utf-8"});{let o=new Uint8Array(Px(n));Ng(o,0,n);let i={"state.json":o},s=[];for(let{asset:l,file:c}of this.plugin.managers.asset.assets)s.push([l.id,l]),i[`assets/${l.id}`]=new Uint8Array(yield c.arrayBuffer());if(s.length>0){let l=JSON.stringify(s,null,2),c=new Uint8Array(Px(l));Ng(c,0,l),i["assets.json"]=c}let a=yield this.plugin.runTask(xY(i));return new Blob([a],{type:"application/zip"})}})}open(r){return Y(this,null,function*(){try{let n=r.name.toLowerCase();if(n.endsWith("json")||n.endsWith("molj")){let o=yield this.plugin.runTask(Ym(r,"string")),i=JSON.parse(o);e.isStateSnapshot(i)?yield this.setStateSnapshot(i):e.isStateSnapshot(i.data)?yield this.setStateSnapshot(i.data):yield this.plugin.state.setSnapshot(i)}else{let o=yield this.plugin.runTask(Ym(r,"zip")),i=Object.create(null);ci(o,(c,u)=>{if(u==="state.json"||u==="assets.json")return;let d=u.substring(u.indexOf("/")+1);i[d]=c});let s=new File([o["state.json"]],"state.json"),a=yield this.plugin.runTask(Ym(s,"string"));if(o["assets.json"]){let c=new File([o["assets.json"]],"assets.json"),u=JSON.parse(yield this.plugin.runTask(Ym(c,"string")));for(let[d,m]of u)this.plugin.managers.asset.set(m,new File([i[d]],m.name))}let l=JSON.parse(a);yield this.setStateSnapshot(l)}this.events.opened.next(void 0)}catch(n){console.error(n),this.plugin.log.error("Error reading state")}})}play(r=!1){if(this.updateState({isPlaying:!0}),r){let n=this.getEntry(this.state.current);if(!n){this.next();return}this.events.changed.next(void 0);let o=n.snapshot,i=typeof o.durationInMs<"u"?o.durationInMs:this.state.nextSnapshotDelayInMs;this.timeoutHandle=setTimeout(this.next,i)}else this.next()}stop(){this.updateState({isPlaying:!1}),typeof this.timeoutHandle<"u"&&clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0,this.events.changed.next(void 0)}togglePlay(){this.state.isPlaying?(this.stop(),this.plugin.managers.animation.stop()):this.play()}dispose(){super.dispose(),this.entryMap.clear()}constructor(r){super({current:void 0,entries:nf(),isPlaying:!1,nextSnapshotDelayInMs:e.DefaultNextSnapshotDelayInMs}),this.plugin=r,this.entryMap=new Map,this.defaultSnapshotId=void 0,this.events={changed:this.ev(),opened:this.ev()},this.timeoutHandle=void 0,this.next=()=>Y(this,null,function*(){this.timeoutHandle=void 0;let n=this.getNextId(this.state.current,1);if(!n||n===this.state.current){this.stop();return}let o=this.setCurrent(n);yield this.plugin.state.setSnapshot(o);let i=typeof o.durationInMs<"u"?o.durationInMs:this.state.nextSnapshotDelayInMs;this.state.isPlaying&&(this.timeoutHandle=setTimeout(this.next,i))})}}return e.DefaultNextSnapshotDelayInMs=1500,e})();(function(e){function t(o,i){return k({timestamp:+new Date,snapshot:o},i)}e.Entry=t;function r(o){let i=o;return!!i&&!!i.timestamp&&!!i.entries}e.isStateSnapshot=r;function n(o,i){return Y(this,null,function*(){if(!o.helpers.viewportScreenshot)return;let s=o.helpers.viewportScreenshot.getPreview(512);if(!s)return;let a=yield U_(s.canvas,"png"),l=new File([a],i),c={kind:"file",id:qr.create22(),name:i};return o.managers.asset.set(c,l),c})}e.getCanvasImageAsset=n})(O0||(O0={}));function gae(){let e=new Date,t=e.getFullYear(),r=e.getMonth()+1,n=e.getDate(),o=e.getHours(),i=e.getMinutes(),s=e.getSeconds();return t+"-"+r+"-"+n+"-"+o+"-"+i+"-"+s}function nNe(e){window.open(e,"_blank")||(window.location.href=e)}function yae(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{let r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}}function jI(e,t="download"){if(e)if("download"in HTMLAnchorElement.prototype){let r=document.createElement("a");r.download=t,r.rel="noopener",typeof e=="string"?(r.href=e,yae(r)):(r.href=URL.createObjectURL(e),setTimeout(()=>URL.revokeObjectURL(r.href),4e4),setTimeout(()=>yae(r)))}else if(typeof navigator<"u"&&navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(e,t);else{let r=window.navigator.userAgent,n=/Safari/i.test(r),o=/CriOS\/[\d]+/.test(r),i=s=>{nNe(o?s:s.replace(/^data:[^;]*;/,"data:attachment/file;"))};if((n||o)&&FileReader)if(e instanceof Blob){let s=new FileReader;s.onloadend=()=>i(s.result),s.readAsDataURL(e)}else i(e);else{let s=URL.createObjectURL(typeof e=="string"?new Blob([e]):e);location.href=s,setTimeout(()=>URL.revokeObjectURL(s),4e4)}}}function oNe(e){vae(e),xae(e),bae(e),Sae(e),Cae(e),_ae(e),wae(e),Aae(e),Tae(e),Pae(e)}function vae(e){e.state.events.object.created.subscribe(t=>{ae.isBehavior(t.obj)&&t.obj.data.register(t.ref)}),e.state.events.object.removed.subscribe(t=>{var r,n,o,i;ae.isBehavior(t.obj)&&((n=(r=t.obj.data).unregister)===null||n===void 0||n.call(r),(i=(o=t.obj.data).dispose)===null||i===void 0||i.call(o))}),e.state.events.object.updated.subscribe(t=>{var r,n,o,i;t.action==="recreate"&&(t.oldObj&&ae.isBehavior(t.oldObj)&&((n=(r=t.oldObj.data).unregister)===null||n===void 0||n.call(r),(i=(o=t.oldObj.data).dispose)===null||i===void 0||i.call(o)),t.obj&&ae.isBehavior(t.obj)&&t.obj.data.register(t.ref))})}function xae(e){ct.State.SetCurrentObject.subscribe(e,({state:t,ref:r})=>t.setCurrent(r))}function bae(e){ct.State.Update.subscribe(e,({state:t,tree:r,options:n})=>e.runTask(t.updateTree(r,n)))}function Sae(e){ct.State.ApplyAction.subscribe(e,({state:t,action:r,ref:n})=>e.runTask(t.applyAction(r.action,r.params,n)))}function Cae(e){function t(r,n){let o=r.build().delete(n);return e.runTask(r.updateTree(o))}ct.State.RemoveObject.subscribe(e,({state:r,ref:n,removeParentGhosts:o})=>{if(o){let i=r.tree,s=i.transforms.get(n);if(s.parent===n)return t(r,n);for(;;){let a=i.children.get(s.parent);if(s.parent===s.ref||a.size>1)return t(r,s.ref);let l=i.transforms.get(s.parent);if(!l.state.isGhost)return t(r,s.ref);s=l}}else return t(r,n)})}function _ae(e){ct.State.ToggleExpanded.subscribe(e,({state:t,ref:r})=>t.updateCellState(r,({isCollapsed:n})=>({isCollapsed:!n})))}function wae(e){ct.State.ToggleVisibility.subscribe(e,({state:t,ref:r})=>pp(t,r,!t.cells.get(r).state.isHidden))}function pp(e,t,r){Go.doPreOrder(e.tree,e.transforms.get(t),{state:e,value:r},iNe)}function iNe(e,t,r){r.state.updateCellState(e.ref,{isHidden:r.value})}function Aae(e){ct.Interactivity.Object.Highlight.subscribe(e,({state:t,ref:r})=>{if(!e.canvas3d||e.isBusy)return;e.managers.interactivity.lociHighlights.clearHighlights();let n=typeof r=="string"?[r]:r;for(let o of n){let i=t.cells.get(o);if(i){if(ae.Molecule.Structure.is(i.obj))e.managers.interactivity.lociHighlights.highlight({loci:Me.Loci(i.obj.data)},!1);else if(i&&ae.isRepresentation3D(i.obj)){let{repr:s}=i.obj.data;for(let a of s.getAllLoci())e.managers.interactivity.lociHighlights.highlight({loci:a,repr:s},!1)}else if(ae.Molecule.Structure.Selections.is(i.obj))for(let s of i.obj.data)e.managers.interactivity.lociHighlights.highlight({loci:s.loci},!1)}}})}function Tae(e){ct.Interactivity.ClearHighlights.subscribe(e,()=>{e.managers.interactivity.lociHighlights.clearHighlights()})}function Pae(e){e.config.set(Tr.State.CurrentServer,e.config.get(Tr.State.DefaultServer)),ct.State.Snapshots.Clear.subscribe(e,()=>{e.managers.snapshot.clear()}),ct.State.Snapshots.Remove.subscribe(e,({id:t})=>{e.managers.snapshot.remove(t)}),ct.State.Snapshots.Add.subscribe(e,i=>Y(this,[i],function*({key:t,name:r,description:n,params:o}){var s;let a=e.state.getSnapshot(o),l=((s=o?.image)!==null&&s!==void 0?s:e.state.snapshotParams.value.image)?yield O0.getCanvasImageAsset(e,`${a.id}-image.png`):void 0,c=O0.Entry(a,{key:t,name:r,description:n,image:l});e.managers.snapshot.add(c)})),ct.State.Snapshots.Replace.subscribe(e,n=>Y(this,[n],function*({id:t,params:r}){var o;let i=e.state.getSnapshot(r),s=((o=r?.image)!==null&&o!==void 0?o:e.state.snapshotParams.value.image)?yield O0.getCanvasImageAsset(e,`${i.id}-image.png`):void 0;e.managers.snapshot.replace(t,e.state.getSnapshot(r),{image:s})})),ct.State.Snapshots.Move.subscribe(e,({id:t,dir:r})=>{e.managers.snapshot.move(t,r)}),ct.State.Snapshots.Apply.subscribe(e,({id:t})=>{let r=e.managers.snapshot.setCurrent(t);if(r)return e.state.setSnapshot(r)}),ct.State.Snapshots.Upload.subscribe(e,s=>Y(this,[s],function*({name:t,description:r,playOnLoad:n,serverUrl:o,params:i}){return fetch(o0(o,`set?name=${encodeURIComponent(t||"")}&description=${encodeURIComponent(r||"")}`),{method:"POST",mode:"cors",referrer:"no-referrer",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(yield e.managers.snapshot.getStateSnapshot({name:t,description:r,playOnLoad:n}))})})),ct.State.Snapshots.Fetch.subscribe(e,r=>Y(this,[r],function*({url:t}){let n=yield e.runTask(e.fetch({url:t,type:"json"}));yield e.managers.snapshot.setStateSnapshot(n.data)})),ct.State.Snapshots.DownloadToFile.subscribe(e,o=>Y(this,[o],function*({name:t,type:r,params:n}){let i=`mol-star_state_${t||gae()}.${r==="json"?"molj":"molx"}`,s=yield e.managers.snapshot.serialize({type:r,params:n});jI(s,`${i}`)})),ct.State.Snapshots.OpenFile.subscribe(e,({file:t})=>e.managers.snapshot.open(t)),ct.State.Snapshots.OpenUrl.subscribe(e,n=>Y(this,[n],function*({url:t,type:r}){let o=yield e.runTask(e.fetch({url:t,type:"binary"}));return e.managers.snapshot.open(new File([o],`state.${r}`))}))}var t6={};hi(t6,{SyncRepresentationToCanvas:()=>Iae,SyncStructureRepresentation3DState:()=>Eae,UpdateRepresentationVisibility:()=>Dae,registerDefault:()=>sNe});function sNe(e){Iae(e),Eae(e),Dae(e)}function Iae(e){let t=e.state.data.events;t.object.created.subscribe(r=>{var n;ae.isRepresentation3D(r.obj)&&(e6(r.state.cells.get(r.ref),r.obj.data.repr),r.obj.data.repr.setState({syncManually:!0}),(n=e.canvas3d)===null||n===void 0||n.add(r.obj.data.repr))}),t.object.updated.subscribe(r=>{var n,o;r.oldObj&&ae.isRepresentation3D(r.oldObj)&&((n=e.canvas3d)===null||n===void 0||n.remove(r.oldObj.data.repr),r.oldObj.data.repr.destroy()),ae.isRepresentation3D(r.obj)&&(e6(r.state.cells.get(r.ref),r.obj.data.repr),r.action==="recreate"&&r.obj.data.repr.setState({syncManually:!0}),(o=e.canvas3d)===null||o===void 0||o.add(r.obj.data.repr))}),t.object.removed.subscribe(r=>{var n;ae.isRepresentation3D(r.obj)&&((n=e.canvas3d)===null||n===void 0||n.remove(r.obj.data.repr),r.obj.data.repr.destroy())})}function Eae(e){let t=e.state.data.events;t.object.created.subscribe(r=>{var n;if(!ae.Molecule.Structure.Representation3DState.is(r.obj))return;let o=r.obj.data;o.repr.setState(o.state),(n=e.canvas3d)===null||n===void 0||n.update(o.repr)}),t.object.updated.subscribe(r=>{var n;if(!ae.Molecule.Structure.Representation3DState.is(r.obj))return;let o=r.obj.data;o.repr.setState(o.state),(n=e.canvas3d)===null||n===void 0||n.update(o.repr)}),t.object.removed.subscribe(r=>{var n;if(!ae.Molecule.Structure.Representation3DState.is(r.obj))return;let o=r.obj.data;o.repr.setState(o.initialState),(n=e.canvas3d)===null||n===void 0||n.update(o.repr)})}function Dae(e){e.state.data.events.cell.stateUpdated.subscribe(t=>{var r;let n=t.state.cells.get(t.ref);ae.isRepresentation3D(n.obj)&&e6(n,n.obj.data.repr)&&((r=e.canvas3d)===null||r===void 0||r.syncVisibility())})}function e6(e,t){return t.state.visible===!!e.state.isHidden?(t.setState({visible:!e.state.isHidden}),!0):!1}var r6={};hi(r6,{Focus:()=>Bae,OrientAxes:()=>Rae,Reset:()=>kae,ResetAxes:()=>Lae,SetSnapshot:()=>Mae,registerDefault:()=>aNe});function aNe(e){kae(e),Bae(e),Mae(e),Rae(e),Lae(e)}function kae(e){ct.Camera.Reset.subscribe(e,t=>{e.managers.camera.reset(t?.snapshot,t?.durationMs)})}function Mae(e){ct.Camera.SetSnapshot.subscribe(e,({snapshot:t,durationMs:r})=>{e.managers.camera.setSnapshot(t,r)})}function Bae(e){ct.Camera.Focus.subscribe(e,({center:t,radius:r,durationMs:n})=>{e.managers.camera.focusSphere({center:t,radius:r},{durationMs:n}),e.events.canvas3d.settingsUpdated.next(void 0)})}function Rae(e){ct.Camera.OrientAxes.subscribe(e,({structures:t,durationMs:r})=>{e.managers.camera.orientAxes(t,r)})}function Lae(e){ct.Camera.ResetAxes.subscribe(e,({durationMs:t})=>{e.managers.camera.resetAxes(t)})}var h6={};hi(h6,{Canvas3DSetSettings:()=>Yle,registerDefault:()=>wUe});function Io(){return Io.zero()}(function(e){function t(){return{x:0,y:0,width:0,height:0}}e.zero=t;function r(l,c,u,d){return{x:l,y:c,width:u,height:d}}e.create=r;function n(l){return k({},l)}e.clone=n;function o(l,c){return Object.assign(l,c)}e.copy=o;function i(l,c,u,d,m){return l.x=c,l.y=u,l.width=d,l.height=m,l}e.set=i;function s(l,c){return l[0]=c.x,l[1]=c.y,l[2]=c.width,l[3]=c.height,l}e.toVec4=s;function a(l,c){return l.x===c.x&&l.y===c.y&&l.width===c.width&&l.height===c.height}e.equals=a})(Io||(Io={}));var ff=Rt();function Fae(e,t,r,n){let{x:o,y:i,width:s,height:a}=r;Rt.set(ff,t[0],t[1],t[2],1),Rt.transformMat4(ff,ff,n);let l=ff[3];return l!==0&&(ff[0]/=l,ff[1]/=l,ff[2]/=l),e[0]=(ff[0]+1)*s*.5+o,e[1]=(ff[1]+1)*a*.5+i,e[2]=(ff[2]+1)*.5,e[3]=l===0?0:1/l,e}function Yb(e,t,r,n){let{x:o,y:i,width:s,height:a}=r,l=t[0]-o,c=t[1]-i,u=t[2];return e[0]=2*l/s-1,e[1]=2*c/a-1,e[2]=2*u-1,x.transformMat4(e,e,n)}function N0(e){if(typeof e=="object"){if("buttons"in e)return e.buttons;if("which"in e){let t=e.which;if(t===2)return 4;if(t===3)return 2;if(t>0)return 1<=0)return 1<!0,pixelScale:1},Pa;(function(e){e.None=o();function t(i,s){return i.shift===s.shift&&i.alt===s.alt&&i.control===s.control&&i.meta===s.meta}e.areEqual=t;function r(i){return t(i,e.None)}e.areNone=r;function n(i){if(!i)return 0;let s=0;return i.shift&&s++,i.alt&&s++,i.control&&s++,i.meta&&s++,s}e.size=n;function o(i={}){return{shift:!!i.shift,alt:!!i.alt,control:!!i.control,meta:!!i.meta}}e.create=o})(Pa||(Pa={}));var xo;(function(e){e.has=gi.has,e.create=gi.create;let t;(function(r){r[r.None=0]="None",r[r.Primary=1]="Primary",r[r.Secondary=2]="Secondary",r[r.Auxilary=4]="Auxilary",r[r.Forth=8]="Forth",r[r.Five=16]="Five"})(t=e.Flag||(e.Flag={}))})(xo||(xo={}));var n6={key:"",code:"",modifiers:Pa.None,x:-1,y:-1,pageX:-1,pageY:-1,preventDefault:Ll},K1=function(e){return e[e.Stopped=0]="Stopped",e[e.Started=1]="Started",e[e.Moving=2]="Moving",e}(K1||{});function Nae(){return{drag:new mo,interactionEnd:new mo,click:new mo,move:new mo,wheel:new mo,pinch:new mo,gesture:new mo,resize:new mo,leave:new mo,enter:new mo,modifiers:new mo,key:new mo,keyUp:new mo,keyDown:new mo,lock:new mo}}var lNe=["Backspace","Delete"],qI;(function(e){function t(n={}){let{noScroll:o,noContextMenu:i}=k(k({},Oae),n);return te(k({noScroll:o,noContextMenu:i,pointerLock:!1,width:0,height:0,pixelRatio:1},Nae()),{setPixelScale:Ll,requestPointerLock:Ll,exitPointerLock:Ll,dispose:Ll})}e.create=t;function r(n,o={}){let{noScroll:i,noMiddleClickScroll:s,noContextMenu:a,noPinchZoom:l,noTextSelect:c,mask:u,pixelScale:d,preventGestures:m}=k(k({},Oae),o),p=n.clientWidth*T(),h=n.clientHeight*T(),f=!1,y=Io(),g=0,v=0,b=Ae(),S=Ae(),_=Ae(),w=Ae(),E=Ae(),A={shift:!1,alt:!1,control:!1,meta:!1},P={x:-1,y:-1,pageX:-1,pageY:-1};function T(){return window.devicePixelRatio*d}function B(){return k({},A)}function D(He){return He.target===document.body||He.target===n}let M=K1.Stopped,R=!1,U=xo.create(xo.Flag.None),F=xo.Flag.None,N=!1,z=!1,q;typeof window.ResizeObserver<"u"&&(q=new window.ResizeObserver(vt));let O=Nae(),{drag:J,interactionEnd:Q,wheel:H,pinch:W,gesture:K,click:ce,move:V,leave:G,enter:X,resize:Z,modifiers:ie,key:de,keyUp:we,keyDown:Be,lock:Ie}=O;le();function le(){n.addEventListener("contextmenu",De,!1),n.addEventListener("wheel",bt,!1),n.addEventListener("mousedown",mt,!1),window.addEventListener("mousemove",Pt,!1),window.addEventListener("mouseup",It,!1),n.addEventListener("touchstart",nt,!1),n.addEventListener("touchmove",St,!1),n.addEventListener("touchend",ut,!1),n.addEventListener("gesturechange",et,!1),n.addEventListener("gesturestart",Se,!1),n.addEventListener("gestureend",Et,!1),window.addEventListener("blur",Xe),window.addEventListener("keyup",ee,!1),window.addEventListener("keydown",L,!1),window.addEventListener("keypress",xe,!1),document.addEventListener("pointerlockchange",ue,!1),document.addEventListener("pointerlockerror",fe,!1),q!=null?q.observe(n.parentElement):window.addEventListener("resize",vt,!1)}function j(){R||(R=!0,n.removeEventListener("contextmenu",De,!1),n.removeEventListener("wheel",bt,!1),n.removeEventListener("mousedown",mt,!1),window.removeEventListener("mousemove",Pt,!1),window.removeEventListener("mouseup",It,!1),n.removeEventListener("touchstart",nt,!1),n.removeEventListener("touchmove",St,!1),n.removeEventListener("touchend",ut,!1),n.removeEventListener("gesturechange",et,!1),n.removeEventListener("gesturestart",Se,!1),n.removeEventListener("gestureend",Et,!1),window.removeEventListener("blur",Xe),window.removeEventListener("keyup",ee,!1),window.removeEventListener("keydown",L,!1),window.removeEventListener("keypress",xe,!1),document.removeEventListener("pointerlockchange",ue,!1),document.removeEventListener("pointerlockerror",fe,!1),li.remove(),q!=null?(q.unobserve(n.parentElement),q.disconnect()):window.removeEventListener("resize",vt,!1))}function ue(){n.ownerDocument.pointerLockElement===n?f=!0:f=!1,gd(f),Ie.next(f)}function fe(){console.error("Unable to use Pointer Lock API"),f=!1,gd(f),Ie.next(f)}function De(He){u(He.clientX,He.clientY)&&a&&He.preventDefault()}function Re(He){A.alt=He.altKey,A.shift=He.shiftKey,A.control=He.ctrlKey,A.meta=He.metaKey}function Xe(){(U||A.shift||A.alt||A.meta||A.control)&&(U=0,A.shift=A.alt=A.control=A.meta=!1)}function L(He){let xr=!1;!A.alt&&He.altKey&&(xr=!0,A.alt=!0),!A.shift&&He.shiftKey&&(xr=!0,A.shift=!0),!A.control&&He.ctrlKey&&(xr=!0,A.control=!0),!A.meta&&He.metaKey&&(xr=!0,A.meta=!0),xr&&N&&ie.next(B()),D(He)&&N&&Be.next(te(k({key:He.key,code:He.code,modifiers:B()},P),{preventDefault:()=>He.preventDefault()}))}function ee(He){let xr=!1;A.alt&&!He.altKey&&(xr=!0,A.alt=!1),A.shift&&!He.shiftKey&&(xr=!0,A.shift=!1),A.control&&!He.ctrlKey&&(xr=!0,A.control=!1),A.meta&&!He.metaKey&&(xr=!0,A.meta=!1),xr&&N&&ie.next(B()),lNe.includes(He.key)&&xe(He),D(He)&&N&&we.next(te(k({key:He.key,code:He.code,modifiers:B()},P),{preventDefault:()=>He.preventDefault()}))}function xe(He){!D(He)||!N||de.next(te(k({key:He.key,code:He.code,modifiers:B()},P),{preventDefault:()=>He.preventDefault()}))}function pe(He){let xr=He.touches[0],at=He.touches[1];return{clientX:(xr.clientX+at.clientX)/2,clientY:(xr.clientY+at.clientY)/2,pageX:(xr.pageX+at.pageX)/2,pageY:(xr.pageY+at.pageY)/2,target:He.target}}function be(He){let xr=He.touches[0].pageX-He.touches[1].pageX,at=He.touches[0].pageY-He.touches[1].pageY;return Math.sqrt(xr*xr+at*at)}let ke=-1,Ve,Ke=Ae(),it=Ae();function Ue(He){ke<0||(Ae.set(it,He.touches[0].pageX,He.touches[0].pageY),ke+=Ae.distance(Ke,it),Ae.copy(Ke,it))}function nt(He){if(He.preventDefault(),Ve=void 0,ke=-1,He.touches.length===1)ke=0,Ae.set(Ke,He.touches[0].pageX,He.touches[0].pageY),Ve=He.touches[0],U=F=xo.Flag.Primary,Hr(He.touches[0]);else if(He.touches.length===2){U=xo.Flag.Secondary&xo.Flag.Auxilary,F=xo.Flag.Secondary,Hr(pe(He));let xr=be(He);g=xr,W.next({distance:xr,fraction:1,fractionDelta:0,delta:0,isStart:!0,buttons:U,button:F,modifiers:B()})}else He.touches.length===3&&(U=F=xo.Flag.Forth,Hr(pe(He)))}function ut(He){if(ar(),Ve&&ke<=4){let xr=Ve;if(!u(xr.clientX,xr.clientY))return;In(it,xr);let{pageX:at,pageY:Vt}=io(xr),[ir,uo]=it;ce.next({x:ir,y:uo,pageX:at,pageY:Vt,buttons:U,button:F,modifiers:B()})}Ve=void 0}function St(He){if(F=xo.Flag.None,l&&(He.preventDefault(),He.stopPropagation(),He.originalEvent&&(He.originalEvent.preventDefault(),He.originalEvent.stopPropagation())),Ve=void 0,He.touches.length===1)U=xo.Flag.Primary,Ve=He.touches[0],Ue(He),tt(He.touches[0]);else if(He.touches.length===2){let xr=be(He),at=g-xr;if(Math.abs(at)<4)U=xo.Flag.Secondary,tt(pe(He));else{U=xo.Flag.Auxilary,Re(He);let Vt=g/xr;W.next({delta:at,fraction:Vt,fractionDelta:v-Vt,distance:xr,isStart:!1,buttons:U,button:F,modifiers:B()}),v=Vt}g=xr}else He.touches.length===3&&(U=xo.Flag.Forth,tt(pe(He)))}function mt(He){Re(He),U=N0(He),F=Q1(He),s&&U===xo.Flag.Auxilary&&He.preventDefault,Hr(He)}function Pt(He){Re(He),U=N0(He),F=xo.Flag.None,tt(He)}function It(He){Re(He),U=N0(He),F=Q1(He),gn(He),ar()}function ar(){Q.next(void 0)}function Hr(He){u(He.clientX,He.clientY)&&(In(S,He),Ae.copy(b,S),mr(S)&&(M=K1.Started))}function gn(He){if(M=K1.Stopped,!!u(He.clientX,He.clientY)){if(In(_,He),!z&&Ae.distance(_,b)<4){let{pageX:xr,pageY:at}=io(He),[Vt,ir]=_;ce.next({x:Vt,y:ir,pageX:xr,pageY:at,buttons:U,button:F,modifiers:B()})}z=!1}}function tt(He){var xr;In(_,He);let{pageX:at,pageY:Vt}=io(He),[ir,uo]=_,{movementX:Ba,movementY:Rl}=He,gc=mr(_)&&u(He.clientX,He.clientY);if(N&&!gc?G.next(void 0):!N&&gc&&X.next(void 0),N=gc,P.x=ir,P.y=uo,P.pageX=at,P.pageY=Vt,V.next({x:ir,y:uo,pageX:at,pageY:Vt,movementX:Ba,movementY:Rl,buttons:U,button:F,modifiers:B(),inside:gc,onElement:He.target===n}),M===K1.Stopped||(c&&((xr=He.preventDefault)===null||xr===void 0||xr.call(He)),Ae.div(w,Ae.sub(w,_,S),yr(E)),Ae.magnitude(w)<1e-6))return;let yc=M===K1.Started;if(yc&&!u(He.clientX,He.clientY))return;Ae.distance(_,b)>=4&&(z=!0);let[pg,fg]=w;J.next({x:ir,y:uo,dx:pg,dy:fg,pageX:at,pageY:Vt,buttons:U,button:F,modifiers:B(),isStart:yc}),Ae.copy(S,_),M=K1.Moving}function bt(He){if(!u(He.clientX,He.clientY))return;In(_,He);let{pageX:xr,pageY:at}=io(He),[Vt,ir]=_;i&&He.preventDefault();let uo=cNe(He);U=F=xo.Flag.Auxilary,(uo.dx||uo.dy||uo.dz)&&H.next(te(k({x:Vt,y:ir,pageX:xr,pageY:at},uo),{buttons:U,button:F,modifiers:B()}))}function Tt(He){var xr,at;m&&(He.preventDefault(),(xr=He.stopImmediatePropagation)===null||xr===void 0||xr.call(He),(at=He.stopPropagation)===null||at===void 0||at.call(He))}let xt=0,me=0;function Se(He){Tt(He),xt=He.scale,me=He.rotation,K.next({scale:He.scale,rotation:He.rotation,deltaRotation:0,deltaScale:0,isStart:!0})}function he(He,xr){K.next({scale:He.scale,rotation:He.rotation,deltaRotation:me-He.rotation,deltaScale:xt-He.scale,isEnd:xr}),me=He.rotation,xt=He.scale}function et(He){Tt(He),he(He)}function Et(He){Tt(He),he(He,!0)}function vt(){p=n.clientWidth*T(),h=n.clientHeight*T(),Z.next({})}function mr(He){if(n instanceof Window||n instanceof Document||n===document.body)return!0;{let xr=n.getBoundingClientRect();return He[0]>=0&&He[1]>=0&&He[0]{d=He,p=n.clientWidth*T(),h=n.clientHeight*T()},requestPointerLock:He=>{y=He,f||n.requestPointerLock()},exitPointerLock:()=>{f&&n.ownerDocument.exitPointerLock()},dispose:j})}e.fromElement=r})(qI||(qI={}));function cNe(e){let o=0,i=0,s=0,a=0,l=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&&(o=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(o=i,i=0),s=o*10,a=i*10,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(s=e.deltaX),"deltaZ"in e&&(l=e.deltaZ),(s||a||l)&&e.deltaMode&&(e.deltaMode===1?(s*=40,a*=40,l*=40):(s*=800,a*=800,l*=800)),s&&!o&&(o=s<1?-1:1),a&&!i&&(i=a<1?-1:1),{spinX:o,spinY:i,dx:s,dy:a,dz:l}}var U0=function(e){return e[e.None=0]="None",e[e.Object=1]="Object",e[e.Instance=2]="Instance",e[e.Group=3]="Group",e}(U0||{}),WI=function(e){return e[e.None=0]="None",e[e.Depth=1]="Depth",e[e.Mask=2]="Mask",e}(WI||{}),YI={backgroundColor:C.Color(Oe(0),{description:"Background color of the 3D canvas"}),pickingAlphaThreshold:C.Numeric(.5,{min:0,max:1,step:.01},{description:"The minimum opacity value needed for an object to be pickable."}),interiorDarkening:C.Numeric(.5,{min:0,max:1,step:.01}),interiorColorFlag:C.Boolean(!0,{label:"Use Interior Color"}),interiorColor:C.Color(Oe.fromNormalizedRgb(.3,.3,.3)),colorMarker:C.Boolean(!0,{description:"Enable color marker"}),highlightColor:C.Color(Oe.fromNormalizedRgb(1,.4,.6)),selectColor:C.Color(Oe.fromNormalizedRgb(.2,1,.1)),dimColor:C.Color(Oe.fromNormalizedRgb(1,1,1)),highlightStrength:C.Numeric(.3,{min:0,max:1,step:.1}),selectStrength:C.Numeric(.3,{min:0,max:1,step:.1}),dimStrength:C.Numeric(0,{min:0,max:1,step:.1}),markerPriority:C.Select(1,[[1,"Highlight"],[2,"Select"]]),xrayEdgeFalloff:C.Numeric(1,{min:0,max:3,step:.1}),exposure:C.Numeric(1,{min:0,max:3,step:.01}),light:C.ObjectList({inclination:C.Numeric(150,{min:0,max:180,step:1}),azimuth:C.Numeric(320,{min:0,max:360,step:1}),color:C.Color(Oe.fromNormalizedRgb(1,1,1)),intensity:C.Numeric(.6,{min:0,max:5,step:.01})},e=>Oe.toHexString(e.color),{defaultValue:[{inclination:150,azimuth:320,color:Oe.fromNormalizedRgb(1,1,1),intensity:.6}]}),ambientColor:C.Color(Oe.fromNormalizedRgb(1,1,1)),ambientIntensity:C.Numeric(.4,{min:0,max:2,step:.01})},Uae=x(),o6=x();function zae(e,t){let r=e.length,{direction:n,color:o}=t||{direction:new Array(r*3).fill(0),color:new Array(r*3).fill(0)};for(let i=0;i{var De,Re,Xe;if(j.state.disposed||!j.state.visible||!j.state.pickable&&ue==="pick"||!_h.intersectsSphere3D(B,j.values.boundingSphere.ref.value))return;let[L,ee]=j.values.uLod.ref.value;if(L!==0||ee!==0){let{center:ke,radius:Ve}=j.values.boundingSphere.ref.value,Ke=Qo.distanceToPoint(P,ke);if(Ke+Veee)return}let xe=j.values.instanceGrid.ref.value.cellSize>1;xe||xe&&j.values.lodLevels?j.cull(P,B,p,r.stats):j.uncull();let pe=!1;j.values.dLightCount.ref.value!==l.count&&(I.update(j.values.dLightCount,l.count),pe=!0),j.values.dColorMarker.ref.value!==a.colorMarker&&(I.update(j.values.dColorMarker,a.colorMarker),pe=!0),pe&&j.update();let be=j.getProgram(ue);if(i.currentProgramId!==be.id&&(U=!0,be.use()),U&&(be.setUniforms(R),be.bindTextures(f,0),U=!1),j.values.dGeometryType.ref.value==="directVolume"){if(ue!=="color")return;i.disable(o.CULL_FACE),i.frontFace(o.CCW),fe===3&&(i.disable(o.DEPTH_TEST),i.depthMask(!1))}else fe===1?(i.enable(o.CULL_FACE),!((De=j.values.dFlipSided)===null||De===void 0)&&De.ref.value?(i.frontFace(o.CW),i.cullFace(o.FRONT)):(i.frontFace(o.CCW),i.cullFace(o.BACK))):fe===2?(i.enable(o.CULL_FACE),!((Re=j.values.dFlipSided)===null||Re===void 0)&&Re.ref.value?(i.frontFace(o.CW),i.cullFace(o.BACK)):(i.frontFace(o.CCW),i.cullFace(o.FRONT))):(j.values.uDoubleSided?j.values.uDoubleSided.ref.value||j.values.hasReflection.ref.value?i.disable(o.CULL_FACE):i.enable(o.CULL_FACE):i.disable(o.CULL_FACE),!((Xe=j.values.dFlipSided)===null||Xe===void 0)&&Xe.ref.value?(i.frontFace(o.CW),i.cullFace(o.FRONT)):(i.frontFace(o.CCW),i.cullFace(o.BACK)));j.render(ue,f.length)},N=(j,ue)=>{I.update(M.uView,j.view),I.update(M.uInvView,ne.invert(g,j.view)),I.update(M.uProjection,j.projection),I.update(M.uInvProjection,ne.invert(S,j.projection)),I.updateIfChanged(M.uIsOrtho,j.state.mode==="orthographic"?1:0),I.update(M.uViewOffset,j.viewOffset.enabled?Ae.set(T,j.viewOffset.offsetX*16,j.viewOffset.offsetY*16):Ae.set(T,0,0)),I.update(M.uCameraPosition,x.copy(A,j.state.position)),I.update(M.uCameraDir,x.normalize(E,x.sub(E,j.state.target,j.state.position))),I.updateIfChanged(M.uFar,j.far),I.updateIfChanged(M.uNear,j.near),I.updateIfChanged(M.uFog,j.state.fog>0),I.updateIfChanged(M.uFogFar,j.fogFar),I.updateIfChanged(M.uFogNear,j.fogNear),I.updateIfChanged(M.uTransparentBackground,m),_h.fromProjectionMatrix(B,j.projectionView),Qo.copy(P,B[5]),P.constant-=Qo.distanceToPoint(P,A),I.update(M.uCameraPlane,Qo.toArray(P,M.uCameraPlane.ref.value,0)),I.updateIfChanged(M.uMarkerAverage,ue.markerAverage)},z=(j,ue,fe,De,Re)=>{tC(f,"tDepth",fe||h),I.update(M.uModel,j.view),I.update(M.uModelView,ne.mul(v,ue.view,j.view)),I.update(M.uInvModelView,ne.invert(b,v)),I.update(M.uModelViewProjection,ne.mul(_,v,ue.projection)),I.update(M.uInvModelViewProjection,ne.invert(w,_)),I.updateIfChanged(M.uRenderMask,De),I.updateIfChanged(M.uMarkingDepthTest,Re),i.enable(o.SCISSOR_TEST),i.colorMask(!0,!0,!0,!0);let{x:Xe,y:L,width:ee,height:xe}=c;i.viewport(Xe,L,ee,xe),i.scissor(Xe,L,ee,xe),U=!0,i.currentRenderItemId=-1},q=function(j){var ue,fe,De,Re;let Xe=po(j.values.alpha.ref.value*j.state.alphaFactor,0,1),L=((ue=j.values.dXrayShaded)===null||ue===void 0?void 0:ue.ref.value)==="on"||((fe=j.values.dXrayShaded)===null||fe===void 0?void 0:fe.ref.value)==="inverted";return Xe===1&&j.values.transparencyAverage.ref.value!==1&&j.values.dGeometryType.ref.value!=="directVolume"&&((De=j.values.dPointStyle)===null||De===void 0?void 0:De.ref.value)!=="fuzzy"&&!L||((Re=j.values.dTransparentBackfaces)===null||Re===void 0?void 0:Re.ref.value)==="opaque"},O=function(j){var ue,fe,De;let Re=po(j.values.alpha.ref.value*j.state.alphaFactor,0,1),Xe=((ue=j.values.dXrayShaded)===null||ue===void 0?void 0:ue.ref.value)==="on"||((fe=j.values.dXrayShaded)===null||fe===void 0?void 0:fe.ref.value)==="inverted";return Re<1&&Re!==0||j.values.transparencyAverage.ref.value>0||j.values.dGeometryType.ref.value==="directVolume"||((De=j.values.dPointStyle)===null||De===void 0?void 0:De.ref.value)==="fuzzy"||j.values.dGeometryType.ref.value==="text"||j.values.dGeometryType.ref.value==="image"||Xe},J=(j,ue,fe,De,Re)=>{ot&&r.timer.mark("Renderer.renderPick"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,De,0,!1),I.updateIfChanged(M.uPickType,Re);let{renderables:Xe}=j;for(let L=0,ee=Xe.length;L{ot&&r.timer.mark("Renderer.renderDepth"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,0,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderDepthOpaque"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,1,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderDepthTransparent"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,2,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderMarkingDepth"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,0,!1),I.updateIfChanged(M.uMarkingType,WI.Depth);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderMarkingMask"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,0,!!fe),I.updateIfChanged(M.uMarkingType,WI.Mask);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re0&&F(De[Re],"marking",0);ot&&r.timer.markEnd("Renderer.renderMarkingMask")},V=(j,ue,fe)=>{ot&&r.timer.mark("Renderer.renderEmissive"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,1,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{j.hasOpaque&&X(j,ue,null),j.opacityAverage<1&&Z(j,ue,null)},X=(j,ue,fe)=>{ot&&r.timer.mark("Renderer.renderBlendedOpaque"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,1,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{var De,Re;ot&&r.timer.mark("Renderer.renderBlendedTransparent"),m?i.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA):i.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA),i.enable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!1),z(j,ue,fe,2,!1);let{renderables:Xe}=j;for(let L=0,ee=Xe.length;L{i.enable(o.SCISSOR_TEST),i.enable(o.DEPTH_TEST),i.colorMask(!0,!0,!0,!0),i.depthMask(!0),m&&!ue?i.clearColor(0,0,0,0):j?i.clearColor(d[0],d[1],d[2],1):i.clearColor(1,1,1,1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT)},clearDepth:(j=!1)=>{i.enable(o.SCISSOR_TEST),j?(i.colorMask(!0,!0,!0,!0),i.clearColor(1,1,1,1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT)):(i.enable(o.DEPTH_TEST),i.depthMask(!0),o.clear(o.DEPTH_BUFFER_BIT))},update:N,renderPick:J,renderDepth:Q,renderDepthOpaque:H,renderDepthTransparent:W,renderMarkingDepth:K,renderMarkingMask:ce,renderEmissive:V,renderBlended:G,renderBlendedOpaque:X,renderBlendedTransparent:Z,renderBlendedVolume:(j,ue,fe)=>{ot&&r.timer.mark("Renderer.renderBlendedVolume"),i.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),i.enable(o.BLEND),i.depthMask(!1),z(j,ue,fe,2,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderWboitOpaque"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,1,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderWboitTransparent"),z(j,ue,fe,2,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderDpoitOpaque"),i.disable(o.BLEND),i.enable(o.DEPTH_TEST),i.depthMask(!0),z(j,ue,fe,1,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{ot&&r.timer.mark("Renderer.renderDpoitTransparent"),i.enable(o.BLEND),tC(f,"tDpoitDepth",De.depth),tC(f,"tDpoitFrontColor",De.frontColor),tC(f,"tDpoitBackColor",De.backColor),z(j,ue,fe,2,!1);let{renderables:Re}=j;for(let Xe=0,L=Re.length;Xe{ot&&r.timer.mark("Renderer.renderDpoitVolume"),i.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),i.enable(o.BLEND),z(j,ue,fe,2,!1);let{renderables:De}=j;for(let Re=0,Xe=De.length;Re{j.backgroundColor!==void 0&&j.backgroundColor!==a.backgroundColor&&(a.backgroundColor=j.backgroundColor,Oe.toVec3Normalized(d,a.backgroundColor),I.update(M.uFogColor,x.copy(M.uFogColor.ref.value,d))),j.pickingAlphaThreshold!==void 0&&j.pickingAlphaThreshold!==a.pickingAlphaThreshold&&(a.pickingAlphaThreshold=j.pickingAlphaThreshold,I.update(M.uPickingAlphaThreshold,a.pickingAlphaThreshold)),j.interiorDarkening!==void 0&&j.interiorDarkening!==a.interiorDarkening&&(a.interiorDarkening=j.interiorDarkening,I.update(M.uInteriorDarkening,a.interiorDarkening)),j.interiorColorFlag!==void 0&&j.interiorColorFlag!==a.interiorColorFlag&&(a.interiorColorFlag=j.interiorColorFlag,I.update(M.uInteriorColorFlag,a.interiorColorFlag)),j.interiorColor!==void 0&&j.interiorColor!==a.interiorColor&&(a.interiorColor=j.interiorColor,I.update(M.uInteriorColor,Oe.toVec3Normalized(M.uInteriorColor.ref.value,a.interiorColor))),j.colorMarker!==void 0&&j.colorMarker!==a.colorMarker&&(a.colorMarker=j.colorMarker),j.highlightColor!==void 0&&j.highlightColor!==a.highlightColor&&(a.highlightColor=j.highlightColor,I.update(M.uHighlightColor,Oe.toVec3Normalized(M.uHighlightColor.ref.value,a.highlightColor))),j.selectColor!==void 0&&j.selectColor!==a.selectColor&&(a.selectColor=j.selectColor,I.update(M.uSelectColor,Oe.toVec3Normalized(M.uSelectColor.ref.value,a.selectColor))),j.dimColor!==void 0&&j.dimColor!==a.dimColor&&(a.dimColor=j.dimColor,I.update(M.uDimColor,Oe.toVec3Normalized(M.uDimColor.ref.value,a.dimColor))),j.highlightStrength!==void 0&&j.highlightStrength!==a.highlightStrength&&(a.highlightStrength=j.highlightStrength,I.update(M.uHighlightStrength,a.highlightStrength)),j.selectStrength!==void 0&&j.selectStrength!==a.selectStrength&&(a.selectStrength=j.selectStrength,I.update(M.uSelectStrength,a.selectStrength)),j.dimStrength!==void 0&&j.dimStrength!==a.dimStrength&&(a.dimStrength=j.dimStrength,I.update(M.uDimStrength,a.dimStrength)),j.markerPriority!==void 0&&j.markerPriority!==a.markerPriority&&(a.markerPriority=j.markerPriority,I.update(M.uMarkerPriority,a.markerPriority)),j.xrayEdgeFalloff!==void 0&&j.xrayEdgeFalloff!==a.xrayEdgeFalloff&&(a.xrayEdgeFalloff=j.xrayEdgeFalloff,I.update(M.uXrayEdgeFalloff,a.xrayEdgeFalloff)),j.exposure!==void 0&&j.exposure!==a.exposure&&(a.exposure=j.exposure,I.update(M.uExposure,a.exposure)),j.light!==void 0&&!Ra(j.light,a.light)&&(a.light=j.light,Object.assign(l,zae(j.light,l)),I.update(M.uLightDirection,l.direction),I.update(M.uLightColor,l.color)),j.ambientColor!==void 0&&j.ambientColor!==a.ambientColor&&(a.ambientColor=j.ambientColor,x.scale(D,Oe.toArrayNormalized(a.ambientColor,D,0),a.ambientIntensity),I.update(M.uAmbientColor,D)),j.ambientIntensity!==void 0&&j.ambientIntensity!==a.ambientIntensity&&(a.ambientIntensity=j.ambientIntensity,x.scale(D,Oe.toArrayNormalized(a.ambientColor,D,0),a.ambientIntensity),I.update(M.uAmbientColor,D))},setViewport:(j,ue,fe,De)=>{i.viewport(j,ue,fe,De),i.scissor(j,ue,fe,De),(j!==c.x||ue!==c.y||fe!==c.width||De!==c.height)&&(Io.set(c,j,ue,fe,De),I.update(M.uViewport,Rt.set(M.uViewport.ref.value,j,ue,fe,De)))},setTransparentBackground:j=>{m=j},setDrawingBufferSize:(j,ue)=>{(j!==u[0]||ue!==u[1])&&I.update(M.uDrawingBufferSize,Ae.set(u,j,ue))},setPixelRatio:j=>{I.update(M.uPixelRatio,j)},setOcclusionTest:j=>{p=j},props:a,get stats(){return{programCount:r.stats.resourceCounts.program,shaderCount:r.stats.resourceCounts.shader,attributeCount:r.stats.resourceCounts.attribute,elementsCount:r.stats.resourceCounts.elements,framebufferCount:r.stats.resourceCounts.framebuffer,renderbufferCount:r.stats.resourceCounts.renderbuffer,textureCount:r.stats.resourceCounts.texture,vertexArrayCount:r.stats.resourceCounts.vertexArray,drawCount:s.drawCount,instanceCount:s.instanceCount,instancedDrawCount:s.instancedDrawCount}},get light(){return l},dispose:()=>{}}}e.create=t})(XI||(XI={}));function _t(e,t="",r=""){return _t.create(e,t,r)}(function(e){function t(u,d="",m=""){return{triggers:u,action:d,description:m}}e.create=t;function r(u){return!!u&&Array.isArray(u.triggers)&&typeof u.action=="string"}e.isBinding=r,e.Empty={triggers:[],action:"",description:""};function n(u){return u.triggers.length===0||u.triggers.every(d=>d.buttons===void 0&&d.modifiers===void 0&&!d.code)}e.isEmpty=n;function o(u,d,m){return u.triggers.some(p=>l.match(p,d,m))}e.match=o;function i(u,d,m,p){return u.triggers.some(h=>l.matchKey(h,d,m,p))}e.matchKey=i;function s(u){return u.triggers.map(l.format).join(" or ")}e.formatTriggers=s;function a(u,d=""){let m=u.description||Us(d);return eq(m,{triggers:""+s(u)+""})}e.format=a;function l(u,d){return l.create(u,d)}e.Trigger=l;function c(u,d){return l.create(void 0,d,u)}e.TriggerKey=c,function(u){function d(f,y,g){return{buttons:f,modifiers:y,code:g}}u.create=d,u.Empty={};function m(f,y,g){let{buttons:v,modifiers:b}=f;return v!==void 0&&(v===y||xo.has(v,y))&&(!b||Pa.areEqual(b,g))}u.match=m;function p(f,y,g,v){let{modifiers:b,code:S}=f;return S!==void 0&&(S===y||S.length===1&&y.length===4&&y.startsWith("Key")&&!!v&&v.length===1&&v.toUpperCase()===S.toUpperCase())&&(!b||Pa.areEqual(b,g))}u.matchKey=p;function h(f){let y=[],g=uNe(f.buttons,f.code);g&&y.push(g);let v=mNe(f.code);v&&y.push(v);let b=dNe(f.modifiers);return b&&y.push(b),y.join(" + ")}u.format=h}(l=e.Trigger||(e.Trigger={}))})(_t||(_t={}));var z0=xo;function uNe(e,t){let r=[];return e===void 0&&!t?r.push("any mouse button"):e===0?r.push("mouse hover"):e!==void 0&&(z0.has(e,z0.Flag.Primary)&&r.push("left mouse button"),z0.has(e,z0.Flag.Secondary)&&r.push("right mouse button"),z0.has(e,z0.Flag.Auxilary)&&r.push("wheel/middle mouse button"),z0.has(e,z0.Flag.Forth)&&r.push("three fingers")),r.join(" + ")}function dNe(e,t){let 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&&r.length===0&&r.push("no key")):t&&r.push("any key"),r.join(" + ")}function mNe(e){return e?.startsWith("Key")&&(e=e.substring(3)),e&&ra(e).toLowerCase()}var V0=xo,Zu=Pa,G0=_t.Trigger,pu=_t.TriggerKey,Vae={dragRotate:_t([G0(V0.Flag.Primary,Zu.create())],"Rotate","Drag using ${triggers}"),dragRotateZ:_t([G0(V0.Flag.Primary,Zu.create({shift:!0,control:!0}))],"Rotate around z-axis (roll)","Drag using ${triggers}"),dragPan:_t([G0(V0.Flag.Secondary,Zu.create()),G0(V0.Flag.Primary,Zu.create({control:!0}))],"Pan","Drag using ${triggers}"),dragZoom:_t.Empty,dragFocus:_t([G0(V0.Flag.Forth,Zu.create())],"Focus","Drag using ${triggers}"),dragFocusZoom:_t([G0(V0.Flag.Auxilary,Zu.create())],"Focus and zoom","Drag using ${triggers}"),scrollZoom:_t([G0(V0.Flag.Auxilary,Zu.create())],"Zoom","Scroll using ${triggers}"),scrollFocus:_t([G0(V0.Flag.Auxilary,Zu.create({shift:!0}))],"Clip","Scroll using ${triggers}"),scrollFocusZoom:_t.Empty,keyMoveForward:_t([pu("KeyW")],"Move forward","Press ${triggers}"),keyMoveBack:_t([pu("KeyS")],"Move back","Press ${triggers}"),keyMoveLeft:_t([pu("KeyA")],"Move left","Press ${triggers}"),keyMoveRight:_t([pu("KeyD")],"Move right","Press ${triggers}"),keyMoveUp:_t([pu("KeyR")],"Move up","Press ${triggers}"),keyMoveDown:_t([pu("KeyF")],"Move down","Press ${triggers}"),keyRollLeft:_t([pu("KeyQ")],"Roll left","Press ${triggers}"),keyRollRight:_t([pu("KeyE")],"Roll right","Press ${triggers}"),keyPitchUp:_t([pu("ArrowUp",Zu.create({shift:!0}))],"Pitch up","Press ${triggers}"),keyPitchDown:_t([pu("ArrowDown",Zu.create({shift:!0}))],"Pitch down","Press ${triggers}"),keyYawLeft:_t([pu("ArrowLeft",Zu.create({shift:!0}))],"Yaw left","Press ${triggers}"),keyYawRight:_t([pu("ArrowRight",Zu.create({shift:!0}))],"Yaw right","Press ${triggers}"),boostMove:_t([pu("ShiftLeft")],"Boost move","Press ${triggers}"),enablePointerLock:_t([pu("Space",Zu.create({control:!0}))],"Enable pointer lock","Press ${triggers}")},i6={noScroll:C.Boolean(!0,{isHidden:!0}),rotateSpeed:C.Numeric(5,{min:1,max:10,step:1}),zoomSpeed:C.Numeric(7,{min:1,max:15,step:1}),panSpeed:C.Numeric(1,{min:.1,max:5,step:.1}),moveSpeed:C.Numeric(.75,{min:.1,max:3,step:.1}),boostMoveFactor:C.Numeric(5,{min:.1,max:10,step:.1}),flyMode:C.Boolean(!1),animate:C.MappedStatic("off",{off:C.EmptyGroup(),spin:C.Group({speed:C.Numeric(1,{min:-20,max:20,step:1})},{description:"Spin the 3D scene around the x-axis in view space"}),rock:C.Group({speed:C.Numeric(.3,{min:-5,max:5,step:.1}),angle:C.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:C.Boolean(!0,{isHidden:!0}),dynamicDampingFactor:C.Numeric(.2,{},{isHidden:!0}),minDistance:C.Numeric(.01,{},{isHidden:!0}),maxDistance:C.Numeric(1e150,{},{isHidden:!0}),gestureScaleFactor:C.Numeric(1,{},{isHidden:!0}),maxWheelDelta:C.Numeric(.02,{},{isHidden:!0}),bindings:C.Value(Vae,{isHidden:!0}),autoAdjustMinMaxDistance:C.MappedStatic("on",{off:C.EmptyGroup(),on:C.Group({minDistanceFactor:C.Numeric(0),minDistancePadding:C.Numeric(5),maxDistanceFactor:C.Numeric(10),maxDistanceMin:C.Numeric(20)})},{isHidden:!0})};var KI;(function(e){function t(r,n,o,i={}){let s=te(k(k({},C.getDefaultValues(i6)),i),{bindings:k(k({},Vae),i.bindings)}),a=s.bindings,l=Io.clone(n.viewport),c=!1,u=r.drag.subscribe(gn),d=r.interactionEnd.subscribe(tt),m=r.wheel.subscribe(bt),p=r.pinch.subscribe(Tt),h=r.gesture.subscribe(xt),f=r.keyDown.subscribe(Se),y=r.keyUp.subscribe(he),g=r.move.subscribe(me),v=r.lock.subscribe(vt),b=r.leave.subscribe(yr),S=!1,_=x(),w=x(),E=Ae(),A=Ae(),P=x(),T=0,B=Ae(),D=Ae(),M=0,R=0,U=0,F=Ae(),N=Ae(),z=Ae(),q=Ae(),O=Ae(),J=Ae(),Q=x.clone(n.target),H=x.clone(n.position),W=x.clone(n.up),K=Ae();function ce(at,Vt){return Ae.set(K,(at-l.x)/l.width,(Vt-l.y)/l.height)}let V=Ae();function G(at,Vt){return Ae.set(V,(at-l.width*.5-l.x)/(l.width*.5),(l.height+2*(l.y-Vt))/l.width)}function X(){let at=r.width/r.height||1;return s.rotateSpeed*r.pixelRatio*at}let Z=x(),ie=vn(),de=x(),we=x(),Be=x(),Ie=x();function le(){let at=A[0]-E[0],Vt=A[1]-E[1];x.set(Ie,at,Vt,0);let ir=x.magnitude(Ie)*X();ir?(x.sub(w,n.position,n.target),x.normalize(de,w),x.normalize(we,n.up),x.normalize(Be,x.cross(Be,we,de)),x.setMagnitude(we,we,Vt),x.setMagnitude(Be,Be,at),x.add(Ie,we,Be),x.normalize(Z,x.cross(Z,Ie,w)),vn.setAxisAngle(ie,Z,ir),x.transformQuat(w,w,ie),x.transformQuat(n.up,n.up,ie),x.copy(P,Z),T=ir):!s.staticMoving&&T&&(T*=Math.sqrt(1-s.dynamicDampingFactor),x.sub(w,n.position,n.target),vn.setAxisAngle(ie,P,T),x.transformQuat(w,w,ie),x.transformQuat(n.up,n.up,ie)),Ae.copy(E,A)}let j=vn(),ue=x();function fe(){let at=(Ue.rollRight-Ue.rollLeft)/45,Vt=(D[0]-B[0])*-Math.sign(D[1]),ir=(D[1]-B[1])*-Math.sign(D[0]),uo=-s.rotateSpeed*(-Vt+ir)+at;uo?(x.normalize(ue,w),vn.setAxisAngle(j,ue,uo),x.transformQuat(n.up,n.up,j),M=uo):!s.staticMoving&&M&&(M*=Math.sqrt(1-s.dynamicDampingFactor),x.normalize(ue,w),vn.setAxisAngle(j,ue,M),x.transformQuat(n.up,n.up,j)),Ae.copy(B,D)}let De=vn(),Re=x();function Xe(){let at=(Ue.pitchUp-Ue.pitchDown)/(s.flyMode?360:90),Vt=-s.rotateSpeed*at;Vt?(x.cross(Re,w,n.up),x.normalize(Re,Re),vn.setAxisAngle(De,Re,Vt),x.transformQuat(w,w,De),x.transformQuat(n.up,n.up,De),R=Vt):!s.staticMoving&&R&&(R*=Math.sqrt(1-s.dynamicDampingFactor),x.cross(Re,w,n.up),x.normalize(Re,Re),vn.setAxisAngle(De,Re,R),x.transformQuat(w,w,De),x.transformQuat(n.up,n.up,De))}let L=vn(),ee=x();function xe(){let at=(Ue.yawRight-Ue.yawLeft)/(s.flyMode?360:90),Vt=-s.rotateSpeed*at;Vt?(x.normalize(ee,n.up),vn.setAxisAngle(L,ee,Vt),x.transformQuat(w,w,L),x.transformQuat(n.up,n.up,L),U=Vt):!s.staticMoving&&U&&(U*=Math.sqrt(1-s.dynamicDampingFactor),x.normalize(ee,n.up),vn.setAxisAngle(L,ee,U),x.transformQuat(w,w,L),x.transformQuat(n.up,n.up,L))}function pe(){let at=1+(N[1]-F[1])*s.zoomSpeed;at!==1&&at>0&&x.scale(w,w,at),s.staticMoving?Ae.copy(F,N):F[1]+=(N[1]-F[1])*s.dynamicDampingFactor}function be(){let at=(q[1]-z[1])*s.zoomSpeed;if(at!==0){let Vt=Math.max(1,n.state.radius+n.state.radius*at);n.setState({radius:Vt})}s.staticMoving?Ae.copy(z,q):z[1]+=(q[1]-z[1])*s.dynamicDampingFactor}let ke=Ae(),Ve=x(),Ke=x();function it(){if(Ae.sub(ke,Ae.copy(ke,J),O),Ae.squaredMagnitude(ke)){let at=r.pixelRatio*s.panSpeed;ke[0]*=1/n.zoom*n.viewport.width*at,ke[1]*=1/n.zoom*n.viewport.height*at,x.cross(Ke,x.copy(Ke,w),n.up),x.setMagnitude(Ke,Ke,ke[0]),x.setMagnitude(Ve,n.up,ke[1]),x.add(Ke,Ke,Ve),x.add(n.position,n.position,Ke),x.add(n.target,n.target,Ke),s.staticMoving?Ae.copy(O,J):(Ae.sub(ke,J,O),Ae.scale(ke,ke,s.dynamicDampingFactor),Ae.add(O,O,ke))}}let Ue={moveUp:0,moveDown:0,moveLeft:0,moveRight:0,moveForward:0,moveBack:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0,boostMove:0},nt=x(),ut=x();function St(at){x.sub(ut,n.position,n.target);let Vt=Math.max(n.state.minNear,s.minDistance);x.setMagnitude(ut,ut,Vt);let ir=at*(60/1e3)*s.moveSpeed*(Ue.boostMove===1?s.boostMoveFactor:1);if(Ue.moveForward===1&&(x.normalize(nt,ut),x.scaleAndSub(n.position,n.position,nt,ir),(s.flyMode||r.pointerLock)&&x.sub(n.target,n.position,ut)),Ue.moveBack===1&&(x.normalize(nt,ut),x.scaleAndAdd(n.position,n.position,nt,ir),(s.flyMode||r.pointerLock)&&x.sub(n.target,n.position,ut)),Ue.moveLeft===1&&(x.cross(nt,ut,n.up),x.normalize(nt,nt),s.flyMode||r.pointerLock?(x.scaleAndAdd(n.position,n.position,nt,ir),x.sub(n.target,n.position,ut)):(x.scaleAndSub(n.position,n.position,nt,ir),x.sub(n.target,n.position,w))),Ue.moveRight===1&&(x.cross(nt,ut,n.up),x.normalize(nt,nt),s.flyMode||r.pointerLock?(x.scaleAndSub(n.position,n.position,nt,ir),x.sub(n.target,n.position,ut)):(x.scaleAndAdd(n.position,n.position,nt,ir),x.sub(n.target,n.position,w))),Ue.moveUp===1&&(x.normalize(nt,n.up),s.flyMode||r.pointerLock?(x.scaleAndAdd(n.position,n.position,nt,ir),x.sub(n.target,n.position,ut)):(x.scaleAndSub(n.position,n.position,nt,ir),x.sub(n.target,n.position,w))),Ue.moveDown===1&&(x.normalize(nt,n.up),s.flyMode||r.pointerLock?(x.scaleAndSub(n.position,n.position,nt,ir),x.sub(n.target,n.position,ut)):(x.scaleAndAdd(n.position,n.position,nt,ir),x.sub(n.target,n.position,w))),s.flyMode||r.pointerLock){let uo=x.distance(n.position,o.boundingSphereVisible.center);n.setState({minFar:uo+o.boundingSphereVisible.radius})}}function mt(){let at=Math.min(Math.max(n.state.radiusMax*1e3,.01),s.maxDistance);x.squaredMagnitude(w)>at*at&&(x.setMagnitude(w,w,at),x.add(n.position,n.target,w),Ae.copy(F,N),Ae.copy(z,q)),x.squaredMagnitude(w)l.x+l.width||r.height-Vt>l.y+l.height||at0&&(s.animate.name==="spin"?Ai(Vt):s.animate.name==="rock"&&gd(Vt)),x.sub(w,n.position,n.target),le(),fe(),Xe(),xe(),pe(),be(),it(),x.add(n.position,n.target,w),mt(),It>0&&St(Math.min(Vt,15*1e3/60)),x.sub(w,n.position,n.target),mt(),x.squaredDistance(_,n.position)>1e-6&&x.copy(_,n.position),It=at}function Hr(){x.copy(n.target,Q),x.copy(n.position,H),x.copy(n.up,W),x.sub(w,n.position,n.target),x.copy(_,n.position)}function gn({x:at,y:Vt,pageX:ir,pageY:uo,buttons:Ba,modifiers:Rl,isStart:gc}){let yc=Pt(at,Vt);if(gc&&yc||!gc&&!S)return;S=!0,He();let pg=_t.match(a.dragRotate,Ba,Rl),fg=_t.match(a.dragRotateZ,Ba,Rl),Jv=_t.match(a.dragPan,Ba,Rl),ex=_t.match(a.dragZoom,Ba,Rl),tx=_t.match(a.dragFocus,Ba,Rl),$y=_t.match(a.dragFocusZoom,Ba,Rl);G(ir,uo),ce(ir,uo);let rx=r.pixelRatio,nx=(at*rx-l.width/2-l.x)/l.width,ox=-(r.height-Vt*rx-l.height/2-l.y)/l.height;if(gc&&(pg&&(Ae.copy(A,V),Ae.copy(E,A)),fg&&(Ae.set(D,nx,ox),Ae.copy(B,D)),(ex||$y)&&(Ae.copy(F,K),Ae.copy(N,F)),tx&&(Ae.copy(z,K),Ae.copy(q,z)),Jv&&(Ae.copy(O,K),Ae.copy(J,O))),pg&&Ae.copy(A,V),fg&&Ae.set(D,nx,ox),(ex||$y)&&Ae.copy(N,K),tx&&Ae.copy(q,K),$y){let Jy=x.distance(n.state.position,n.state.target);n.setState({radius:Jy/5})}Jv&&Ae.copy(J,K)}function tt(){S=!1}function bt({x:at,y:Vt,spinX:ir,spinY:uo,dz:Ba,buttons:Rl,modifiers:gc}){if(Pt(at,Vt))return;let yc=YG(ir*.075,uo*.075,Ba*1e-4);yc<-s.maxWheelDelta?yc=-s.maxWheelDelta:yc>s.maxWheelDelta&&(yc=s.maxWheelDelta),_t.match(a.scrollZoom,Rl,gc)&&(N[1]+=yc),_t.match(a.scrollFocus,Rl,gc)&&(q[1]+=yc)}function Tt({fractionDelta:at,buttons:Vt,modifiers:ir}){_t.match(a.scrollZoom,Vt,ir)&&(S=!0,N[1]+=s.gestureScaleFactor*at)}function xt({deltaScale:at}){S=!0,N[1]+=s.gestureScaleFactor*at}function me({movementX:at,movementY:Vt}){if(!r.pointerLock||at===void 0||Vt===void 0)return;let ir=l.width*.5-l.x,uo=l.height*.5-l.y;Ae.copy(E,G(ir,uo)),Ae.copy(A,G(at+ir,Vt+uo))}function Se({modifiers:at,code:Vt,key:ir,x:uo,y:Ba}){Pt(uo,Ba)||(_t.matchKey(a.keyMoveForward,Vt,at,ir)?Ue.moveForward=1:_t.matchKey(a.keyMoveBack,Vt,at,ir)?Ue.moveBack=1:_t.matchKey(a.keyMoveLeft,Vt,at,ir)?Ue.moveLeft=1:_t.matchKey(a.keyMoveRight,Vt,at,ir)?Ue.moveRight=1:_t.matchKey(a.keyMoveUp,Vt,at,ir)?Ue.moveUp=1:_t.matchKey(a.keyMoveDown,Vt,at,ir)?Ue.moveDown=1:_t.matchKey(a.keyRollLeft,Vt,at,ir)?Ue.rollLeft=1:_t.matchKey(a.keyRollRight,Vt,at,ir)?Ue.rollRight=1:_t.matchKey(a.keyPitchUp,Vt,at,ir)?Ue.pitchUp=1:_t.matchKey(a.keyPitchDown,Vt,at,ir)?Ue.pitchDown=1:_t.matchKey(a.keyYawLeft,Vt,at,ir)?Ue.yawLeft=1:_t.matchKey(a.keyYawRight,Vt,at,ir)&&(Ue.yawRight=1),_t.matchKey(a.boostMove,Vt,at,ir)&&(Ue.boostMove=1),_t.matchKey(a.enablePointerLock,Vt,at,ir)&&r.requestPointerLock(l))}function he({modifiers:at,code:Vt,key:ir,x:uo,y:Ba}){var Rl,gc,yc,pg,fg,Jv,ex,tx,$y,rx,nx,ox;if(Pt(uo,Ba))return;let Jy=!1;Vt.startsWith("Alt")?(Jy=!0,at.alt=!0):Vt.startsWith("Shift")?(Jy=!0,at.shift=!0):Vt.startsWith("Control")?(Jy=!0,at.control=!0):Vt.startsWith("Meta")&&(Jy=!0,at.meta=!0);let qc=[];Jy?(Ue.moveForward&&qc.push(((Rl=a.keyMoveForward.triggers[0])===null||Rl===void 0?void 0:Rl.code)||""),Ue.moveBack&&qc.push(((gc=a.keyMoveBack.triggers[0])===null||gc===void 0?void 0:gc.code)||""),Ue.moveLeft&&qc.push(((yc=a.keyMoveLeft.triggers[0])===null||yc===void 0?void 0:yc.code)||""),Ue.moveRight&&qc.push(((pg=a.keyMoveRight.triggers[0])===null||pg===void 0?void 0:pg.code)||""),Ue.moveUp&&qc.push(((fg=a.keyMoveUp.triggers[0])===null||fg===void 0?void 0:fg.code)||""),Ue.moveDown&&qc.push(((Jv=a.keyMoveDown.triggers[0])===null||Jv===void 0?void 0:Jv.code)||""),Ue.rollLeft&&qc.push(((ex=a.keyRollLeft.triggers[0])===null||ex===void 0?void 0:ex.code)||""),Ue.rollRight&&qc.push(((tx=a.keyRollRight.triggers[0])===null||tx===void 0?void 0:tx.code)||""),Ue.pitchUp&&qc.push((($y=a.keyPitchUp.triggers[0])===null||$y===void 0?void 0:$y.code)||""),Ue.pitchDown&&qc.push(((rx=a.keyPitchDown.triggers[0])===null||rx===void 0?void 0:rx.code)||""),Ue.yawLeft&&qc.push(((nx=a.keyYawLeft.triggers[0])===null||nx===void 0?void 0:nx.code)||""),Ue.yawRight&&qc.push(((ox=a.keyYawRight.triggers[0])===null||ox===void 0?void 0:ox.code)||"")):qc.push(Vt);for(let yd of qc)_t.matchKey(a.keyMoveForward,yd,at,ir)?Ue.moveForward=0:_t.matchKey(a.keyMoveBack,yd,at,ir)?Ue.moveBack=0:_t.matchKey(a.keyMoveLeft,yd,at,ir)?Ue.moveLeft=0:_t.matchKey(a.keyMoveRight,yd,at,ir)?Ue.moveRight=0:_t.matchKey(a.keyMoveUp,yd,at,ir)?Ue.moveUp=0:_t.matchKey(a.keyMoveDown,yd,at,ir)?Ue.moveDown=0:_t.matchKey(a.keyRollLeft,yd,at,ir)?Ue.rollLeft=0:_t.matchKey(a.keyRollRight,yd,at,ir)?Ue.rollRight=0:_t.matchKey(a.keyPitchUp,yd,at,ir)?Ue.pitchUp=0:_t.matchKey(a.keyPitchDown,yd,at,ir)?Ue.pitchDown=0:_t.matchKey(a.keyYawLeft,yd,at,ir)?Ue.yawLeft=0:_t.matchKey(a.keyYawRight,yd,at,ir)&&(Ue.yawRight=0);_t.matchKey(a.boostMove,Vt,at,ir)&&(Ue.boostMove=0)}function et(){x.sub(ut,n.position,n.target);let at=Math.max(n.state.minNear,s.minDistance);x.setMagnitude(ut,ut,at),x.sub(n.target,n.position,ut);let Vt=x.distance(n.position,o.boundingSphereVisible.center);n.setState({minFar:Vt+o.boundingSphereVisible.radius})}function Et(){let{center:at,radius:Vt}=o.boundingSphereVisible;if(x.distance(n.position,at)>Vt){let uo=n.getFocus(at,Vt);n.setState(te(k({},uo),{minFar:0}))}else n.setState({minFar:0,radius:o.boundingSphereVisible.radius})}function vt(at){at?et():Et()}function mr(){Ue.moveForward=0,Ue.moveBack=0,Ue.moveLeft=0,Ue.moveRight=0,Ue.moveUp=0,Ue.moveDown=0,Ue.rollLeft=0,Ue.rollRight=0,Ue.pitchUp=0,Ue.pitchDown=0,Ue.yawLeft=0,Ue.yawRight=0,Ue.boostMove=0}function yr(){mr()}function In(){c||(c=!0,u.unsubscribe(),m.unsubscribe(),p.unsubscribe(),h.unsubscribe(),d.unsubscribe(),f.unsubscribe(),y.unsubscribe(),g.unsubscribe(),v.unsubscribe(),b.unsubscribe())}let io=Ae.create(.005,0);function Ai(at){if(s.animate.name!=="spin"||s.animate.params.speed===0||S)return;let Vt=s.animate.params.speed/1e3;io[0]=60*Math.min(Math.abs(at),1e3/8)/1e3*Vt,Ae.add(A,E,io)}let li=0,hc=Ae.create(.005,0);function gd(at){if(s.animate.name!=="rock"||s.animate.params.speed===0||S)return;let Vt=at/1e3*s.animate.params.speed,ir=Cr(s.animate.params.angle)/X(),uo=Math.sin(li*Math.PI*2)*ir,Ba=Math.sin((li+Vt)*Math.PI*2)*ir;hc[0]=Ba-uo,Ae.add(A,E,hc),li+=Vt,li>=1&&(li=0)}function He(){li=0}function xr(at){It=-1,ar(at)}return{viewport:l,get isAnimating(){return s.animate.name!=="off"},get isMoving(){return Ue.moveForward===1||Ue.moveBack===1||Ue.moveLeft===1||Ue.moveRight===1||Ue.moveUp===1||Ue.moveDown===1||Ue.rollLeft===1||Ue.rollRight===1||Ue.pitchUp===1||Ue.pitchDown===1||Ue.yawLeft===1||Ue.yawRight===1},get props(){return s},setProps:at=>{var Vt;((Vt=at.animate)===null||Vt===void 0?void 0:Vt.name)==="rock"&&s.animate.name!=="rock"&&He(),at.flyMode!==void 0&&at.flyMode!==s.flyMode&&(at.flyMode?et():Et()),Object.assign(s,at),Object.assign(a,at.bindings)},start:xr,update:ar,reset:Hr,dispose:In}}e.create=t})(KI||(KI={}));var V_;(function(e){function t(){return{view:ne.identity(),position:x.create(0,0,0),direction:x.create(0,0,-1),up:x.create(0,1,0)}}e.create=t;let r=x.zero();function n(o){x.add(r,o.position,o.direction),ne.lookAt(o.view,o.position,r,o.up)}e.update=n})(V_||(V_={}));var QI=class{constructor(){this.removeList=uC(),this.removeMap=new Map,this.addList=uC(),this.addMap=new Map}get isEmpty(){return this.removeList.count===0&&this.addList.count===0}get size(){return this.removeMap.size+this.addMap.size}add(t){if(this.removeMap.has(t)){let n=this.removeMap.get(t);this.removeMap.delete(t),this.removeList.remove(n)}if(this.addMap.has(t))return;let r=this.addList.addLast(t);this.addMap.set(t,r)}remove(t){if(this.addMap.has(t)){let n=this.addMap.get(t);this.addMap.delete(t),this.addList.remove(n)}if(this.removeMap.has(t))return;let r=this.removeList.addLast(t);this.removeMap.set(t,r)}tryGetRemove(){let t=this.removeList.removeFirst();return t&&this.removeMap.delete(t),t}tryGetAdd(){let t=this.addList.removeFirst();return t&&this.addMap.delete(t),t}};var G_=new ki("98");function Gae(e,t,r){G_.reset();for(let n=0,o=e.length;nJ)return!1}for(;;){let W=M.tryGetAdd();if(!W)break;if(P(W),++H%B===0&&On()-Q>J)return!1}return i.sort(pNe),m=!0,p=!0,h=!0,f=!0,!0}let M=new QI,R=-1;function U(){let J=23;for(let Q=0,H=i.length;Q0?Q/J:0}function z(){if(l.length===0)return 0;let J=0,Q=0;for(let H=0,W=l.length;H0?Q/J:0}function q(){var J,Q;if(l.length===0)return 0;let H=0,W=0;for(let K=0,ce=l.length;K0?W/H:0}function O(){var J;if(l.length===0)return!1;for(let Q=0,H=l.length;Q{n=J;for(let Q=0,H=i.length;QM.add(J),remove:J=>M.remove(J),commit:(J=Number.MAX_VALUE)=>D(J),get commitQueueSize(){return M.size},get needsCommit(){return!M.isEmpty},has:J=>o.has(J),clear:()=>{for(let J=0,Q=i.length;J{o.forEach(J)},get count(){return i.length},get boundingSphere(){return u&&(Gae(i,s,!1),u=!1),s},get boundingSphereVisible(){return d&&(Gae(i,a,!0),d=!1),a},get markerAverage(){return m&&(y=N(),m=!1),y},get emissiveAverage(){return p&&(g=z(),p=!1),g},get opacityAverage(){return h&&(v=q(),h=!1),v},get hasOpaque(){return f&&(b=O(),f=!1),b}}}e.create=t})(hf||(hf={}));var Xb=class e{get source(){return this._source}get target(){return this._target}apply(t,r=0,n){if((!this.inTransition||r>0)&&co.copySnapshot(this._source,this.camera.state),this.inTransition||co.copySnapshot(this._target,this.camera.state),co.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);return}this.inTransition=!0,this.func=n||e.defaultTransition,(!this.inTransition||r>0)&&(this.start=this.t,this.durationMs=r)}tick(t){this.t=t,this.update()}finish(t){co.copySnapshot(this.camera.state,t),this.inTransition=!1}update(){if(!this.inTransition)return;let t=Math.min((this.t-this.start)/this.durationMs,1);if(t===1){this.finish(this._target);return}this.func(this._current,t,this._source,this._target),co.copySnapshot(this.camera.state,this._current)}constructor(t){this.camera=t,this.t=0,this.func=e.defaultTransition,this.start=0,this.inTransition=!1,this.durationMs=0,this._source=co.createDefaultSnapshot(),this._target=co.createDefaultSnapshot(),this._current=co.createDefaultSnapshot()}};(function(e){let t=vn.identity();function r(n,o,i,s){co.copySnapshot(n,s),vn.slerp(t,vn.Identity,vn.rotationTo(t,i.up,s.up),o),x.transformQuat(n.up,i.up,t),x.lerp(n.target,i.target,s.target,o),x.lerp(n.position,i.position,s.position,o),n.radius=Kn(i.radius,s.radius,o),n.radiusMax=Kn(i.radiusMax,s.radiusMax,o),n.fov=Kn(i.fov,s.fov,o),n.fog=Kn(i.fog,s.fog,o)}e.defaultTransition=r})(Xb||(Xb={}));var Hae=x(),jae=x(),ZI=Rt(),co=class e{get position(){return this.state.position}set position(t){x.copy(this.state.position,t)}get up(){return this.state.up}set up(t){x.copy(this.state.up,t)}get target(){return this.state.target}set target(t){x.copy(this.state.target,t)}update(){let t=this.state;if(t.radiusMax===0)return!1;let r=2*Math.tan(t.fov/2)*x.distance(t.position,t.target);switch(this.zoom=this.viewport.height/r,gNe(this),this.state.mode){case"orthographic":fNe(this);break;case"perspective":hNe(this);break;default:_r(this.state.mode)}let n=!ne.areEqual(this.projection,this.prevProjection,1e-6)||!ne.areEqual(this.view,this.prevView,1e-6);if(n){if(ne.mul(this.projectionView,this.projection,this.view),!ne.tryInvert(this.inverseProjectionView,this.projectionView))return ne.copy(this.view,this.prevView),ne.copy(this.projection,this.prevProjection),ne.mul(this.projectionView,this.projection,this.view),!1;ne.copy(this.prevView,this.view),ne.copy(this.prevProjection,this.projection)}return n}setState(t,r){this.transition.apply(t,r),this.stateChanged.next(t)}getSnapshot(){return e.copySnapshot(e.createDefaultSnapshot(),this.state)}getTargetDistance(t){return e.targetDistance(t,this.state.mode,this.state.fov,this.viewport.width,this.viewport.height)}getFocus(t,r,n,o,i){var s,a;let l=Math.max(r,.01),c=this.getTargetDistance(l);x.sub(this.deltaDirection,(s=i?.target)!==null&&s!==void 0?s:this.target,(a=i?.position)!==null&&a!==void 0?a:this.position),o&&x.matchDirection(this.deltaDirection,o,this.deltaDirection),x.setMagnitude(this.deltaDirection,this.deltaDirection,c),x.sub(this.newPosition,t,this.deltaDirection);let u=e.copySnapshot(e.createDefaultSnapshot(),this.state);return u.target=x.clone(t),u.radius=l,u.position=x.clone(this.newPosition),n&&x.matchDirection(u.up,n,u.up),u}getCenter(t,r){x.sub(this.deltaDirection,this.target,this.position),x.sub(this.newPosition,t,this.deltaDirection);let n=e.copySnapshot(e.createDefaultSnapshot(),this.state);return n.target=x.clone(t),n.position=x.clone(this.newPosition),r&&(n.radius=Math.max(r,.01)),n}getInvariantFocus(t,r,n,o){let i=Math.max(r,.01),s=this.getTargetDistance(i);x.copy(this.deltaDirection,o),x.setMagnitude(this.deltaDirection,this.deltaDirection,s),x.sub(this.newPosition,t,this.deltaDirection);let a=e.copySnapshot(e.createDefaultSnapshot(),this.state);return a.target=x.clone(t),a.radius=i,a.position=x.clone(this.newPosition),x.copy(a.up,n),a}focus(t,r,n,o,i){r>0&&this.setState(this.getFocus(t,r,o,i),n)}center(t,r){this.setState(this.getCenter(t),r)}project(t,r){return Fae(t,r,this.viewport,this.projectionView)}unproject(t,r){return Yb(t,r,this.viewport,this.inverseProjectionView)}getPixelSize(t){return this.project(ZI,t),this.unproject(Hae,ZI),ZI[0]+=1,this.unproject(jae,ZI),x.distance(Hae,jae)}constructor(t,r=Io.create(0,0,128,128)){this.view=ne.identity(),this.projection=ne.identity(),this.projectionView=ne.identity(),this.inverseProjectionView=ne.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 Xb(this),this.stateChanged=new Zs(this.state),this.prevProjection=ne.identity(),this.prevView=ne.identity(),this.deltaDirection=x(),this.newPosition=x(),this.viewport=r,e.copySnapshot(this.state,t)}};(function(e){function t(){return{enabled:!1,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}}e.ViewOffset=t;function r(l,c,u,d,m,p,h){l.fullWidth=c,l.fullHeight=u,l.offsetX=d,l.offsetY=m,l.width=p,l.height=h}e.setViewOffset=r;function n(l,c){l.enabled=c.enabled,l.fullWidth=c.fullWidth,l.fullHeight=c.fullHeight,l.offsetX=c.offsetX,l.offsetY=c.offsetY,l.width=c.width,l.height=c.height}e.copyViewOffset=n;function o(l,c,u,d,m){let p=Math.max(l,.01),h=d/m,f=m{let i=this.objectsData.get(o),s=$I(this.scene,n.values.boundingSphere.ref.value,i,Yt.tomato,bNe);s&&this.objectsData.set(o,s);let a=this.instancesData.get(o),l=$I(this.scene,n.values.invariantBoundingSphere.ref.value,a,Yt.skyblue,SNe,{aTransform:o.values.aTransform,matrix:o.values.matrix,transform:o.values.transform,extraTransform:o.values.extraTransform,uInstanceCount:o.values.uInstanceCount,instanceCount:o.values.instanceCount,aInstance:o.values.aInstance,hasReflection:o.values.hasReflection,instanceGrid:o.values.instanceGrid});l&&this.instancesData.set(o,l)}),this.objectsData.forEach((n,o)=>{this.parent.has(o)||(this.scene.remove(n.renderObject),this.objectsData.delete(o))}),this.instancesData.forEach((n,o)=>{this.parent.has(o)||(this.scene.remove(n.renderObject),this.instancesData.delete(o))}),this.scene.update(void 0,!1),this.scene.commit()}syncVisibility(){this.sceneData&&(this.sceneData.renderObject.state.visible=this._props.sceneBoundingSpheres),this.visibleSceneData&&(this.visibleSceneData.renderObject.state.visible=this._props.visibleSceneBoundingSpheres),this.parent.forEach((t,r)=>{let n=this.objectsData.get(r);n&&(n.renderObject.state.visible=r.state.visible&&this._props.objectBoundingSpheres);let o=this.instancesData.get(r);o&&(o.renderObject.state.visible=r.state.visible&&this._props.instanceBoundingSpheres)})}clear(){this.sceneData=void 0,this.objectsData.clear(),this.scene.clear()}get isEnabled(){return this._props.sceneBoundingSpheres||this._props.visibleSceneBoundingSpheres||this._props.objectBoundingSpheres||this._props.instanceBoundingSpheres}get props(){return this._props}setProps(t){Object.assign(this._props,t),this.isEnabled&&this.update()}};function $I(e,t,r,n,o,i){if(!r||!ge.equals(r.boundingSphere,t)){let s=yNe(t,r&&r.mesh),a=r?r.renderObject:CNe(s,n,o,i);return r?I.updateIfChanged(a.values.drawCount,ii.getDrawCount(s)):e.add(a),{boundingSphere:ge.clone(t),renderObject:a,mesh:s}}}function yNe(e,t){let n=sp(2),o=rt.createState(n,n/2,t);if(e.radius&&(Nr(o,e.center,e.radius,2),ge.hasExtrema(e)))for(let i of e.extrema)Nr(o,i,1,0);return rt.getMesh(o)}var vNe=Ic(),xNe=Ic(),bNe=Ic(),SNe=Ic();function CNe(e,t,r,n){let o=dt.Utils.createValuesSimple(e,{alpha:.1,doubleSided:!1,cellSize:0,batchSize:0},t,1,n);return Gd("mesh",o,{disposed:!1,visible:!0,alphaFactor:1,pickable:!1,colorOnly:!1,opaque:!1,writeDepth:!1},r)}var Z1=function(e){return e[e.Move=0]="Move",e[e.Click=1]="Click",e[e.Drag=2]="Drag",e}(Z1||{}),s6=x(),a6=x(),qae=x(),l6={maxFps:C.Numeric(30,{min:10,max:60,step:10}),preferAtomPixelPadding:C.Numeric(3,{min:0,max:20,step:1},{description:"Number of extra pixels at which to prefer atoms over bonds."})},eE=class{setProps(t){Object.assign(this.props,t)}identify(t,r){let n=this.startX!==this.endX||this.startY!==this.endY||this.input.pointerLock&&!this.controls.isMoving;if(t===Z1.Drag){n&&!this.outsideViewport(this.startX,this.startY)&&(this.events.drag.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers,pageStart:Ae.create(this.startX,this.startY),pageEnd:Ae.create(this.endX,this.endY)}),this.startX=this.endX,this.startY=this.endY);return}if(n){let i=this.canvasIdentify(this.endX,this.endY);this.id=i?.id,this.position=i?.position,this.startX=this.endX,this.startY=this.endY}if(t===Z1.Click){let i=this.getLoci(this.id,this.position);this.events.click.next({current:i,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:Ae.create(this.endX,this.endY),position:this.position}),this.prevLoci=i;return}if(!this.inside||this.currentIdentifyT!==r||!n||this.outsideViewport(this.endX,this.endY))return;let o=this.getLoci(this.id,this.position);this.events.hover.next({current:o,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:Ae.create(this.endX,this.endY),position:this.position}),this.prevLoci=o}tick(t){this.inside&&t-this.prevT>1e3/this.props.maxFps&&(this.prevT=t,this.currentIdentifyT=t,this.identify(this.isInteracting?Z1.Drag:Z1.Move,t))}leave(){this.inside=!1,Nt.Loci.isEmpty(this.prevLoci)||(this.prevLoci=Nt.Loci.Empty,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers}))}move(t,r,n,o,i){this.inside=!0,this.buttons=n,this.button=o,this.modifiers=i,this.endX=t,this.endY=r}click(t,r,n,o,i){this.endX=t,this.endY=r,this.buttons=n,this.button=o,this.modifiers=i,this.identify(Z1.Click,0)}drag(t,r,n,o,i){this.endX=t,this.endY=r,this.buttons=n,this.button=o,this.modifiers=i,this.identify(Z1.Drag,0)}modify(t){Pa.areEqual(t,this.modifiers)||(this.modifiers=t,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:Ae.create(this.endX,this.endY),position:this.position}))}outsideViewport(t,r){let{input:n,camera:{viewport:o}}=this;return t*=n.pixelRatio,r*=n.pixelRatio,t>o.x+o.width||n.height-r>o.y+o.height||t{this.isInteracting=!0,this.drag(a,l,c,u,d)}),n.move.subscribe(({x:a,y:l,inside:c,buttons:u,button:d,modifiers:m,onElement:p})=>{if(!(!c||this.isInteracting)){if(!p){this.leave();return}this.move(a,l,u,d,m)}}),n.leave.subscribe(()=>{this.leave()}),n.click.subscribe(({x:a,y:l,buttons:c,button:u,modifiers:d})=>{this.outsideViewport(a,l)||this.click(a,l,c,u,d)}),n.interactionEnd.subscribe(()=>{this.isInteracting=!1}),n.modifiers.subscribe(a=>{this.modify(a)})}};var Wae=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tDepthOpaque; +uniform sampler2D tDepthTransparent; +uniform vec2 uTexSize; + +uniform float uNear; +uniform float uFar; +uniform mat4 uInvProjection; + +uniform float uOutlineThreshold; + +#include common + +float getViewZ(const in float depth) { + #if dOrthographic == 1 + return orthographicDepthToViewZ(depth, uNear, uFar); + #else + return perspectiveDepthToViewZ(depth, uNear, uFar); + #endif +} + +float getDepthOpaque(const in vec2 coords) { + #ifdef depthTextureSupport + return texture2D(tDepthOpaque, coords).r; + #else + return unpackRGBAToDepth(texture2D(tDepthOpaque, coords)); + #endif +} + +float getDepthTransparent(const in vec2 coords) { + #ifdef dTransparentOutline + return unpackRGBAToDepth(texture2D(tDepthTransparent, coords)); + #else + return 1.0; + #endif +} + +bool isBackground(const in float depth) { + return depth == 1.0; +} + +float getPixelSize(const in vec2 coords, const in float depth) { + vec3 viewPos0 = screenSpaceToViewSpace(vec3(coords, depth), uInvProjection); + vec3 viewPos1 = screenSpaceToViewSpace(vec3(coords + vec2(1.0, 0.0) / uTexSize, depth), uInvProjection); + return distance(viewPos0, viewPos1); +} + +void main(void) { + float backgroundViewZ = 2.0 * uFar; + + vec2 coords = gl_FragCoord.xy / uTexSize; + vec2 invTexSize = 1.0 / uTexSize; + + float selfDepthOpaque = getDepthOpaque(coords); + float selfViewZOpaque = isBackground(selfDepthOpaque) ? backgroundViewZ : getViewZ(selfDepthOpaque); + float pixelSizeOpaque = getPixelSize(coords, selfDepthOpaque) * uOutlineThreshold; + + float selfDepthTransparent = getDepthTransparent(coords); + float selfViewZTransparent = isBackground(selfDepthTransparent) ? backgroundViewZ : getViewZ(selfDepthTransparent); + float pixelSizeTransparent = getPixelSize(coords, selfDepthTransparent) * uOutlineThreshold; + + float outline = 1.0; + float bestDepth = 1.0; + float transparentFlag = 0.0; + + for (int y = -1; y <= 1; y++) { + for (int x = -1; x <= 1; x++) { + vec2 sampleCoords = coords + vec2(float(x), float(y)) * invTexSize; + + float sampleDepthOpaque = getDepthOpaque(sampleCoords); + float sampleDepthTransparent = getDepthTransparent(sampleCoords); + + float sampleViewZOpaque = isBackground(sampleDepthOpaque) ? backgroundViewZ : getViewZ(sampleDepthOpaque); + if (abs(selfViewZOpaque - sampleViewZOpaque) > pixelSizeOpaque && selfDepthOpaque > sampleDepthOpaque && sampleDepthOpaque <= bestDepth) { + outline = 0.0; + bestDepth = sampleDepthOpaque; + } + + if (sampleDepthTransparent < sampleDepthOpaque) { + float sampleViewZTransparent = isBackground(sampleDepthTransparent) ? backgroundViewZ : getViewZ(sampleDepthTransparent); + if (abs(selfViewZTransparent - sampleViewZTransparent) > pixelSizeTransparent && selfDepthTransparent > sampleDepthTransparent && sampleDepthTransparent <= bestDepth) { + outline = 0.0; + bestDepth = sampleDepthTransparent; + transparentFlag = 1.0; + } + } + } + } + + gl_FragColor = vec4(outline, packUnitIntervalToRG(bestDepth), transparentFlag); +} +`;var Yae=` +precision highp float; +precision highp int; +precision highp sampler2D; + +#include common + +uniform sampler2D tDepth; +uniform sampler2D tDepthHalf; +uniform sampler2D tDepthQuarter; +uniform vec2 uTexSize; +uniform vec4 uBounds; + +uniform vec3 uSamples[dNSamples]; + +uniform mat4 uProjection; +uniform mat4 uInvProjection; + +#ifdef dMultiScale + uniform float uLevelRadius[dLevels]; + uniform float uLevelBias[dLevels]; + uniform float uNearThreshold; + uniform float uFarThreshold; +#else + uniform float uRadius; +#endif +uniform float uBias; + +float smootherstep(float edge0, float edge1, float x) { + x = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); + return x * x * x * (x * (x * 6.0 - 15.0) + 10.0); +} + +float noise(const in vec2 coords) { + float a = 12.9898; + float b = 78.233; + float c = 43758.5453; + float dt = dot(coords, vec2(a,b)); + float sn = mod(dt, PI); + return abs(fract(sin(sn) * c)); // is abs necessary? +} + +vec2 getNoiseVec2(const in vec2 coords) { + return vec2(noise(coords), noise(coords + vec2(PI, 2.71828))); +} + +bool isBackground(const in float depth) { + return depth == 1.0; +} + +float getDepth(const in vec2 coords) { + vec2 c = vec2(clamp(coords.x, uBounds.x, uBounds.z), clamp(coords.y, uBounds.y, uBounds.w)); + #ifdef depthTextureSupport + return texture2D(tDepth, c).r; + #else + return unpackRGBAToDepth(texture2D(tDepth, c)); + #endif +} + +#define dQuarterThreshold 0.1 +#define dHalfThreshold 0.05 + +float getMappedDepth(const in vec2 coords, const in vec2 selfCoords) { + vec2 c = vec2(clamp(coords.x, uBounds.x, uBounds.z), clamp(coords.y, uBounds.y, uBounds.w)); + float d = distance(coords, selfCoords); + #ifdef depthTextureSupport + if (d > dQuarterThreshold) { + return texture2D(tDepthQuarter, c).r; + } else if (d > dHalfThreshold) { + return texture2D(tDepthHalf, c).r; + } else { + return texture2D(tDepth, c).r; + } + #else + if (d > dQuarterThreshold) { + return unpackRGBAToDepth(texture2D(tDepthQuarter, c)); + } else if (d > dHalfThreshold) { + return unpackRGBAToDepth(texture2D(tDepthHalf, c)); + } else { + return unpackRGBAToDepth(texture2D(tDepth, c)); + } + #endif +} + +// adapted from https://gist.github.com/bgolus/a07ed65602c009d5e2f753826e8078a0 +vec3 viewNormalAtPixelPositionAccurate(vec2 vpos) { + // current pixel's depth + float c = getDepth(vpos); + + // get current pixel's view space position + vec3 viewSpacePos_c = screenSpaceToViewSpace(vec3(vpos, c), uInvProjection); + + // get view space position at 1 pixel offsets in each major direction + vec3 viewSpacePos_l = screenSpaceToViewSpace(vec3(vpos + vec2(-1.0, 0.0) / uTexSize, getDepth(vpos + vec2(-1.0, 0.0) / uTexSize)), uInvProjection); + vec3 viewSpacePos_r = screenSpaceToViewSpace(vec3(vpos + vec2( 1.0, 0.0) / uTexSize, getDepth(vpos + vec2( 1.0, 0.0) / uTexSize)), uInvProjection); + vec3 viewSpacePos_d = screenSpaceToViewSpace(vec3(vpos + vec2( 0.0,-1.0) / uTexSize, getDepth(vpos + vec2( 0.0,-1.0) / uTexSize)), uInvProjection); + vec3 viewSpacePos_u = screenSpaceToViewSpace(vec3(vpos + vec2( 0.0, 1.0) / uTexSize, getDepth(vpos + vec2( 0.0, 1.0) / uTexSize)), uInvProjection); + + // get the difference between the current and each offset position + vec3 l = viewSpacePos_c - viewSpacePos_l; + vec3 r = viewSpacePos_r - viewSpacePos_c; + vec3 d = viewSpacePos_c - viewSpacePos_d; + vec3 u = viewSpacePos_u - viewSpacePos_c; + + // get depth values at 1 & 2 pixels offsets from current along the horizontal axis + vec4 H = vec4( + getDepth(vpos + vec2(-1.0, 0.0) / uTexSize), + getDepth(vpos + vec2( 1.0, 0.0) / uTexSize), + getDepth(vpos + vec2(-2.0, 0.0) / uTexSize), + getDepth(vpos + vec2( 2.0, 0.0) / uTexSize) + ); + + // get depth values at 1 & 2 pixels offsets from current along the vertical axis + vec4 V = vec4( + getDepth(vpos + vec2(0.0,-1.0) / uTexSize), + getDepth(vpos + vec2(0.0, 1.0) / uTexSize), + getDepth(vpos + vec2(0.0,-2.0) / uTexSize), + getDepth(vpos + vec2(0.0, 2.0) / uTexSize) + ); + + // current pixel's depth difference from slope of offset depth samples + // differs from original article because we're using non-linear depth values + // see article's comments + vec2 he = abs((2.0 * H.xy - H.zw) - c); + vec2 ve = abs((2.0 * V.xy - V.zw) - c); + + // pick horizontal and vertical diff with the smallest depth difference from slopes + vec3 hDeriv = he.x < he.y ? l : r; + vec3 vDeriv = ve.x < ve.y ? d : u; + + // get view space normal from the cross product of the best derivatives + vec3 viewNormal = normalize(cross(hDeriv, vDeriv)); + + return viewNormal; +} + +float getPixelSize(const in vec2 coords, const in float depth) { + vec3 viewPos0 = screenSpaceToViewSpace(vec3(coords, depth), uInvProjection); + vec3 viewPos1 = screenSpaceToViewSpace(vec3(coords + vec2(1.0, 0.0) / uTexSize, depth), uInvProjection); + return distance(viewPos0, viewPos1); +} + +// StarCraft II Ambient Occlusion by [Filion and McNaughton 2008] +void main(void) { + vec2 invTexSize = 1.0 / uTexSize; + vec2 selfCoords = gl_FragCoord.xy * invTexSize; + + float selfDepth = getDepth(selfCoords); + vec2 selfPackedDepth = packUnitIntervalToRG(selfDepth); + + if (isBackground(selfDepth)) { + gl_FragColor = vec4(packUnitIntervalToRG(1.0), selfPackedDepth); + return; + } + + vec3 selfViewNormal = viewNormalAtPixelPositionAccurate(selfCoords); + vec3 selfViewPos = screenSpaceToViewSpace(vec3(selfCoords, selfDepth), uInvProjection); + + vec3 randomVec = normalize(vec3(getNoiseVec2(selfCoords) * 2.0 - 1.0, 0.0)); + vec3 tangent = normalize(randomVec - selfViewNormal * dot(randomVec, selfViewNormal)); + vec3 bitangent = cross(selfViewNormal, tangent); + mat3 TBN = mat3(tangent, bitangent, selfViewNormal); + + float occlusion = 0.0; + #ifdef dMultiScale + float pixelSize = getPixelSize(selfCoords, selfDepth); + + for(int l = 0; l < dLevels; l++) { + // TODO: smooth transition + if (pixelSize * uNearThreshold > uLevelRadius[l]) continue; + if (pixelSize * uFarThreshold < uLevelRadius[l]) continue; + + float levelOcclusion = 0.0; + for(int i = 0; i < dNSamples; i++) { + // get sample position: + vec3 sampleViewPos = TBN * uSamples[i]; + sampleViewPos = selfViewPos + sampleViewPos * uLevelRadius[l]; + + // project sample position: + vec4 offset = vec4(sampleViewPos, 1.0); + offset = uProjection * offset; + offset.xyz = (offset.xyz / offset.w) * 0.5 + 0.5; + + // get sample depth: + float sampleDepth = getMappedDepth(offset.xy, selfCoords); + float sampleViewZ = screenSpaceToViewSpace(vec3(offset.xy, sampleDepth), uInvProjection).z; + levelOcclusion += step(sampleViewPos.z + 0.025, sampleViewZ) * smootherstep(0.0, 1.0, uLevelRadius[l] / abs(selfViewPos.z - sampleViewZ)) * uLevelBias[l]; + } + occlusion = max(occlusion, levelOcclusion); + } + #else + for(int i = 0; i < dNSamples; i++) { + vec3 sampleViewPos = TBN * uSamples[i]; + sampleViewPos = selfViewPos + sampleViewPos * uRadius; + + vec4 offset = vec4(sampleViewPos, 1.0); + offset = uProjection * offset; + offset.xyz = (offset.xyz / offset.w) * 0.5 + 0.5; + + float sampleDepth = getMappedDepth(offset.xy, selfCoords); + float sampleViewZ = screenSpaceToViewSpace(vec3(offset.xy, sampleDepth), uInvProjection).z; + + occlusion += step(sampleViewPos.z + 0.025, sampleViewZ) * smootherstep(0.0, 1.0, uRadius / abs(selfViewPos.z - sampleViewZ)); + } + #endif + occlusion = 1.0 - (uBias * occlusion / float(dNSamples)); + + vec2 packedOcclusion = packUnitIntervalToRG(clamp(occlusion, 0.01, 1.0)); + + gl_FragColor = vec4(packedOcclusion, selfPackedDepth); +} +`;var Xae=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tSsaoDepth; +uniform vec2 uTexSize; +uniform vec4 uBounds; + +uniform float uKernel[dOcclusionKernelSize]; + +uniform float uBlurDirectionX; +uniform float uBlurDirectionY; + +uniform mat4 uInvProjection; +uniform float uNear; +uniform float uFar; + +#include common + +float getViewZ(const in float depth) { + #if dOrthographic == 1 + return orthographicDepthToViewZ(depth, uNear, uFar); + #else + return perspectiveDepthToViewZ(depth, uNear, uFar); + #endif +} + +bool isBackground(const in float depth) { + return depth == 1.0; +} + +bool outsideBounds(const in vec2 p) { + return p.x < uBounds.x || p.y < uBounds.y || p.x > uBounds.z || p.y > uBounds.w; +} + +float getPixelSize(const in vec2 coords, const in float depth) { + vec3 viewPos0 = screenSpaceToViewSpace(vec3(coords, depth), uInvProjection); + vec3 viewPos1 = screenSpaceToViewSpace(vec3(coords + vec2(1.0, 0.0) / uTexSize, depth), uInvProjection); + return distance(viewPos0, viewPos1); +} + +void main(void) { + vec2 coords = gl_FragCoord.xy / uTexSize; + + vec2 packedDepth = texture2D(tSsaoDepth, coords).zw; + + if (outsideBounds(coords)) { + gl_FragColor = vec4(packUnitIntervalToRG(1.0), packedDepth); + return; + } + + float selfDepth = unpackRGToUnitInterval(packedDepth); + // if background and if second pass + if (isBackground(selfDepth) && uBlurDirectionY != 0.0) { + gl_FragColor = vec4(packUnitIntervalToRG(1.0), packedDepth); + return; + } + + float selfViewZ = getViewZ(selfDepth); + float pixelSize = getPixelSize(coords, selfDepth); + // max diff depth between two pixels + float maxDiffViewZ = 1.0; + + vec2 offset = vec2(uBlurDirectionX, uBlurDirectionY) / uTexSize; + + float sum = 0.0; + float kernelSum = 0.0; + // only if kernelSize is odd + for (int i = -dOcclusionKernelSize / 2; i <= dOcclusionKernelSize / 2; i++) { + if (abs(float(i)) > 1.0 && abs(float(i)) * pixelSize > 0.8) continue; + + vec2 sampleCoords = coords + float(i) * offset; + if (outsideBounds(sampleCoords)) { + continue; + } + + vec4 sampleSsaoDepth = texture2D(tSsaoDepth, sampleCoords); + + float sampleDepth = unpackRGToUnitInterval(sampleSsaoDepth.zw); + if (isBackground(sampleDepth)) { + continue; + } + + float sampleViewZ = getViewZ(sampleDepth); + if (abs(selfViewZ - sampleViewZ) > maxDiffViewZ) { + continue; + } + + float kernel = uKernel[int(abs(float(i)))]; // abs is not defined for int in webgl1 + float sampleValue = unpackRGToUnitInterval(sampleSsaoDepth.xy); + + sum += kernel * sampleValue; + kernelSum += kernel; + } + gl_FragColor = vec4(packUnitIntervalToRG(sum / kernelSum), packedDepth); +} +`;var Kae=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tSsaoDepth; +uniform sampler2D tColor; +uniform sampler2D tDepthOpaque; +uniform sampler2D tDepthTransparent; +uniform sampler2D tShadows; +uniform sampler2D tOutlines; +uniform vec2 uTexSize; + +uniform float uNear; +uniform float uFar; +uniform float uFogNear; +uniform float uFogFar; +uniform vec3 uFogColor; +uniform vec3 uOutlineColor; +uniform vec3 uOcclusionColor; +uniform bool uTransparentBackground; +uniform vec2 uOcclusionOffset; + +#include common + +float getViewZ(const in float depth) { + #if dOrthographic == 1 + return orthographicDepthToViewZ(depth, uNear, uFar); + #else + return perspectiveDepthToViewZ(depth, uNear, uFar); + #endif +} + +float getDepthOpaque(const in vec2 coords) { + #ifdef depthTextureSupport + return texture2D(tDepthOpaque, coords).r; + #else + return unpackRGBAToDepth(texture2D(tDepthOpaque, coords)); + #endif +} + +float getDepthTransparent(const in vec2 coords) { + #ifdef dTransparentOutline + return unpackRGBAToDepth(texture2D(tDepthTransparent, coords)); + #else + return 1.0; + #endif +} + +bool isBackground(const in float depth) { + return depth == 1.0; +} + +float getOutline(const in vec2 coords, const in float opaqueDepth, out float closestTexel) { + float backgroundViewZ = 2.0 * uFar; + vec2 invTexSize = 1.0 / uTexSize; + + float transparentDepth = getDepthTransparent(coords); + float opaqueSelfViewZ = isBackground(opaqueDepth) ? backgroundViewZ : getViewZ(opaqueDepth); + float transparentSelfViewZ = isBackground(transparentDepth) ? backgroundViewZ : getViewZ(transparentDepth); + float selfDepth = min(opaqueDepth, transparentDepth); + + float outline = 1.0; + closestTexel = 1.0; + for (int y = -dOutlineScale; y <= dOutlineScale; y++) { + for (int x = -dOutlineScale; x <= dOutlineScale; x++) { + if (x * x + y * y > dOutlineScale * dOutlineScale) { + continue; + } + + vec2 sampleCoords = coords + vec2(float(x), float(y)) * invTexSize; + + vec4 sampleOutlineCombined = texture2D(tOutlines, sampleCoords); + float sampleOutline = sampleOutlineCombined.r; + float sampleOutlineDepth = unpackRGToUnitInterval(sampleOutlineCombined.gb); + float sampleOutlineViewZ = isBackground(sampleOutlineDepth) ? backgroundViewZ : getViewZ(sampleOutlineDepth); + + float selfViewZ = sampleOutlineCombined.a == 0.0 ? opaqueSelfViewZ : transparentSelfViewZ; + if (sampleOutline == 0.0 && sampleOutlineDepth < closestTexel) { + outline = 0.0; + closestTexel = sampleOutlineDepth; + } + } + } + return closestTexel < opaqueDepth ? outline : 1.0; +} + +float getSsao(vec2 coords) { + float rawSsao = unpackRGToUnitInterval(texture2D(tSsaoDepth, coords).xy); + if (rawSsao > 0.999) { + return 1.0; + } else if (rawSsao > 0.001) { + return rawSsao; + } + // treat values close to 0.0 as errors and return no occlusion + return 1.0; +} + +void main(void) { + vec2 coords = gl_FragCoord.xy / uTexSize; + vec4 color = texture2D(tColor, coords); + + float viewDist; + float fogFactor; + float opaqueDepth = getDepthOpaque(coords); + + #ifdef dOcclusionEnable + if (!isBackground(opaqueDepth)) { + viewDist = abs(getViewZ(opaqueDepth)); + fogFactor = smoothstep(uFogNear, uFogFar, viewDist); + float occlusionFactor = getSsao(coords + uOcclusionOffset); + if (!uTransparentBackground) { + color.rgb = mix(mix(uOcclusionColor, uFogColor, fogFactor), color.rgb, occlusionFactor); + } else { + color.rgb = mix(uOcclusionColor * (1.0 - fogFactor), color.rgb, occlusionFactor); + } + } + #endif + + #ifdef dShadowEnable + if (!isBackground(opaqueDepth)) { + viewDist = abs(getViewZ(opaqueDepth)); + fogFactor = smoothstep(uFogNear, uFogFar, viewDist); + vec4 shadow = texture2D(tShadows, coords); + if (!uTransparentBackground) { + color.rgb = mix(mix(vec3(0), uFogColor, fogFactor), color.rgb, shadow.a); + } else { + color.rgb = mix(vec3(0) * (1.0 - fogFactor), color.rgb, shadow.a); + } + } + #endif + + // outline needs to be handled after occlusion and shadow to keep them clean + #ifdef dOutlineEnable + float closestTexel; + float outline = getOutline(coords, opaqueDepth, closestTexel); + if (outline == 0.0) { + viewDist = abs(getViewZ(closestTexel)); + fogFactor = smoothstep(uFogNear, uFogFar, viewDist); + if (!uTransparentBackground) { + color.rgb = mix(uOutlineColor, uFogColor, fogFactor); + } else { + color.a = 1.0 - fogFactor; + color.rgb = mix(uOutlineColor, color.rgb, fogFactor); + } + } + #endif + + gl_FragColor = color; +} +`;var Qae=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tColor; +uniform vec2 uTexSizeInv; + +// adapted from https://github.com/kosua20/Rendu +// MIT License Copyright (c) 2017 Simon Rodriguez + +#define QUALITY(q) ((q) < 5 ? 1.0 : ((q) > 5 ? ((q) < 10 ? 2.0 : ((q) < 11 ? 4.0 : 8.0)) : 1.5)) + +float rgb2luma(vec3 rgb){ + return sqrt(dot(rgb, vec3(0.299, 0.587, 0.114))); +} + +float sampleLuma(vec2 uv) { + return rgb2luma(texture2D(tColor, uv).rgb); +} + +float sampleLuma(vec2 uv, float uOffset, float vOffset) { + uv += uTexSizeInv * vec2(uOffset, vOffset); + return sampleLuma(uv); +} + +void main(void) { + vec2 coords = gl_FragCoord.xy * uTexSizeInv; + vec2 inverseScreenSize = uTexSizeInv; + + vec4 colorCenter = texture2D(tColor, coords); + + // Luma at the current fragment + float lumaCenter = rgb2luma(colorCenter.rgb); + + // Luma at the four direct neighbours of the current fragment. + float lumaDown = sampleLuma(coords, 0.0, -1.0); + float lumaUp = sampleLuma(coords, 0.0, 1.0); + float lumaLeft = sampleLuma(coords, -1.0, 0.0); + float lumaRight = sampleLuma(coords, 1.0, 0.0); + + // Find the maximum and minimum luma around the current fragment. + float lumaMin = min(lumaCenter, min(min(lumaDown, lumaUp), min(lumaLeft, lumaRight))); + float lumaMax = max(lumaCenter, max(max(lumaDown, lumaUp), max(lumaLeft, lumaRight))); + + // Compute the delta. + float lumaRange = lumaMax - lumaMin; + + // If the luma variation is lower that a threshold (or if we are in a really dark area), + // we are not on an edge, don't perform any AA. + if (lumaRange < max(dEdgeThresholdMin, lumaMax * dEdgeThresholdMax)) { + gl_FragColor = colorCenter; + return; + } + + // Query the 4 remaining corners lumas. + float lumaDownLeft = sampleLuma(coords, -1.0, -1.0); + float lumaUpRight = sampleLuma(coords, 1.0, 1.0); + float lumaUpLeft = sampleLuma(coords, -1.0, 1.0); + float lumaDownRight = sampleLuma(coords, 1.0, -1.0); + + // Combine the four edges lumas (using intermediary variables for future computations + // with the same values). + float lumaDownUp = lumaDown + lumaUp; + float lumaLeftRight = lumaLeft + lumaRight; + + // Same for corners + float lumaLeftCorners = lumaDownLeft + lumaUpLeft; + float lumaDownCorners = lumaDownLeft + lumaDownRight; + float lumaRightCorners = lumaDownRight + lumaUpRight; + float lumaUpCorners = lumaUpRight + lumaUpLeft; + + // Compute an estimation of the gradient along the horizontal and vertical axis. + float edgeHorizontal = abs(-2.0 * lumaLeft + lumaLeftCorners) + abs(-2.0 * lumaCenter + lumaDownUp) * 2.0 + abs(-2.0 * lumaRight + lumaRightCorners); + float edgeVertical = abs(-2.0 * lumaUp + lumaUpCorners) + abs(-2.0 * lumaCenter + lumaLeftRight) * 2.0 + abs(-2.0 * lumaDown + lumaDownCorners); + + // Is the local edge horizontal or vertical ? + bool isHorizontal = (edgeHorizontal >= edgeVertical); + + // Choose the step size (one pixel) accordingly. + float stepLength = isHorizontal ? inverseScreenSize.y : inverseScreenSize.x; + + // Select the two neighboring texels lumas in the opposite direction to the local edge. + float luma1 = isHorizontal ? lumaDown : lumaLeft; + float luma2 = isHorizontal ? lumaUp : lumaRight; + // Compute gradients in this direction. + float gradient1 = luma1 - lumaCenter; + float gradient2 = luma2 - lumaCenter; + + // Which direction is the steepest ? + bool is1Steepest = abs(gradient1) >= abs(gradient2); + + // Gradient in the corresponding direction, normalized. + float gradientScaled = 0.25 * max(abs(gradient1), abs(gradient2)); + + // Average luma in the correct direction. + float lumaLocalAverage = 0.0; + if(is1Steepest){ + // Switch the direction + stepLength = -stepLength; + lumaLocalAverage = 0.5 * (luma1 + lumaCenter); + } else { + lumaLocalAverage = 0.5 * (luma2 + lumaCenter); + } + + // Shift UV in the correct direction by half a pixel. + vec2 currentUv = coords; + if(isHorizontal){ + currentUv.y += stepLength * 0.5; + } else { + currentUv.x += stepLength * 0.5; + } + + // Compute offset (for each iteration step) in the right direction. + vec2 offset = isHorizontal ? vec2(inverseScreenSize.x, 0.0) : vec2(0.0, inverseScreenSize.y); + // Compute UVs to explore on each side of the edge, orthogonally. + // The QUALITY allows us to step faster. + vec2 uv1 = currentUv - offset * QUALITY(0); + vec2 uv2 = currentUv + offset * QUALITY(0); + + // Read the lumas at both current extremities of the exploration segment, + // and compute the delta wrt to the local average luma. + float lumaEnd1 = sampleLuma(uv1); + float lumaEnd2 = sampleLuma(uv2); + lumaEnd1 -= lumaLocalAverage; + lumaEnd2 -= lumaLocalAverage; + + // If the luma deltas at the current extremities is larger than the local gradient, + // we have reached the side of the edge. + bool reached1 = abs(lumaEnd1) >= gradientScaled; + bool reached2 = abs(lumaEnd2) >= gradientScaled; + bool reachedBoth = reached1 && reached2; + + // If the side is not reached, we continue to explore in this direction. + if(!reached1){ + uv1 -= offset * QUALITY(1); + } + if(!reached2){ + uv2 += offset * QUALITY(1); + } + + // If both sides have not been reached, continue to explore. + if(!reachedBoth){ + for(int i = 2; i < dIterations; i++){ + // If needed, read luma in 1st direction, compute delta. + if(!reached1){ + lumaEnd1 = sampleLuma(uv1); + lumaEnd1 = lumaEnd1 - lumaLocalAverage; + } + // If needed, read luma in opposite direction, compute delta. + if(!reached2){ + lumaEnd2 = sampleLuma(uv2); + lumaEnd2 = lumaEnd2 - lumaLocalAverage; + } + // If the luma deltas at the current extremities is larger than the local gradient, + // we have reached the side of the edge. + reached1 = abs(lumaEnd1) >= gradientScaled; + reached2 = abs(lumaEnd2) >= gradientScaled; + reachedBoth = reached1 && reached2; + + // If the side is not reached, we continue to explore in this direction, + // with a variable quality. + if(!reached1){ + uv1 -= offset * QUALITY(i); + } + if(!reached2){ + uv2 += offset * QUALITY(i); + } + + // If both sides have been reached, stop the exploration. + if(reachedBoth){ + break; + } + } + } + + // Compute the distances to each side edge of the edge (!). + float distance1 = isHorizontal ? (coords.x - uv1.x) : (coords.y - uv1.y); + float distance2 = isHorizontal ? (uv2.x - coords.x) : (uv2.y - coords.y); + + // In which direction is the side of the edge closer ? + bool isDirection1 = distance1 < distance2; + float distanceFinal = min(distance1, distance2); + + // Thickness of the edge. + float edgeThickness = (distance1 + distance2); + + // Is the luma at center smaller than the local average ? + bool isLumaCenterSmaller = lumaCenter < lumaLocalAverage; + + // If the luma at center is smaller than at its neighbour, + // the delta luma at each end should be positive (same variation). + bool correctVariation1 = (lumaEnd1 < 0.0) != isLumaCenterSmaller; + bool correctVariation2 = (lumaEnd2 < 0.0) != isLumaCenterSmaller; + + // Only keep the result in the direction of the closer side of the edge. + bool correctVariation = isDirection1 ? correctVariation1 : correctVariation2; + + // UV offset: read in the direction of the closest side of the edge. + float pixelOffset = - distanceFinal / edgeThickness + 0.5; + + // If the luma variation is incorrect, do not offset. + float finalOffset = correctVariation ? pixelOffset : 0.0; + + // Sub-pixel shifting + // Full weighted average of the luma over the 3x3 neighborhood. + float lumaAverage = (1.0 / 12.0) * (2.0 * (lumaDownUp + lumaLeftRight) + lumaLeftCorners + lumaRightCorners); + // Ratio of the delta between the global average and the center luma, + // over the luma range in the 3x3 neighborhood. + float subPixelOffset1 = clamp(abs(lumaAverage - lumaCenter) / lumaRange, 0.0, 1.0); + float subPixelOffset2 = (-2.0 * subPixelOffset1 + 3.0) * subPixelOffset1 * subPixelOffset1; + // Compute a sub-pixel offset based on this delta. + float subPixelOffsetFinal = subPixelOffset2 * subPixelOffset2 * float(dSubpixelQuality); + + // Pick the biggest of the two offsets. + finalOffset = max(finalOffset, subPixelOffsetFinal); + + // Compute the final UV coordinates. + vec2 finalUv = coords; + if(isHorizontal){ + finalUv.y += finalOffset * stepLength; + } else { + finalUv.x += finalOffset * stepLength; + } + + // Read the color at the new UV coordinates, and use it. + gl_FragColor = texture2D(tColor, finalUv); +} +`;var Zae={edgeThresholdMin:C.Numeric(.0312,{min:.0312,max:.0833,step:1e-4},{description:"Trims the algorithm from processing darks."}),edgeThresholdMax:C.Numeric(.063,{min:.063,max:.333,step:.001},{description:"The minimum amount of local contrast required to apply algorithm."}),iterations:C.Numeric(12,{min:0,max:16,step:1},{description:"Number of edge exploration steps."}),subpixelQuality:C.Numeric(.3,{min:0,max:1,step:.01},{description:"Choose the amount of sub-pixel aliasing removal."})},tE=class{constructor(t,r){this.webgl=t,this.renderable=ANe(t,r)}updateState(t){let{gl:r,state:n}=this.webgl;n.enable(r.SCISSOR_TEST),n.disable(r.BLEND),n.disable(r.DEPTH_TEST),n.depthMask(!1);let{x:o,y:i,width:s,height:a}=t;n.viewport(o,i,s,a),n.scissor(o,i,s,a),n.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)}setSize(t,r){I.update(this.renderable.values.uTexSizeInv,Ae.set(this.renderable.values.uTexSizeInv.ref.value,1/t,1/r))}update(t,r){let{values:n}=this.renderable,{edgeThresholdMin:o,edgeThresholdMax:i,iterations:s,subpixelQuality:a}=r,l=!1;n.tColor.ref.value!==t&&(I.update(this.renderable.values.tColor,t),l=!0),n.dEdgeThresholdMin.ref.value!==o&&(l=!0),I.updateIfChanged(n.dEdgeThresholdMin,o),n.dEdgeThresholdMax.ref.value!==i&&(l=!0),I.updateIfChanged(n.dEdgeThresholdMax,i),n.dIterations.ref.value!==s&&(l=!0),I.updateIfChanged(n.dIterations,s),n.dSubpixelQuality.ref.value!==a&&(l=!0),I.updateIfChanged(n.dSubpixelQuality,a),l&&this.renderable.update()}render(t,r){ot&&this.webgl.timer.mark("FxaaPass.render"),r?r.bind():this.webgl.unbindFramebuffer(),this.updateState(t),this.renderable.render(),ot&&this.webgl.timer.markEnd("FxaaPass.render")}},_Ne=te(k({},wn),{tColor:Ct("texture","rgba","ubyte","linear"),uTexSizeInv:ye("v2"),dEdgeThresholdMin:At("number"),dEdgeThresholdMax:At("number"),dIterations:At("number"),dSubpixelQuality:At("number")}),wNe=Rr("fxaa",Nn,Qae);function ANe(e,t){let r=t.getWidth(),n=t.getHeight(),o=te(k({},An),{tColor:I.create(t),uTexSizeInv:I.create(Ae.create(1/r,1/n)),dEdgeThresholdMin:I.create(.0312),dEdgeThresholdMax:I.create(.125),dIterations:I.create(12),dSubpixelQuality:I.create(.3)}),i=k({},_Ne),s=Jr(e,"triangles",wNe,i,o);return en(s,o)}var $ae=` +precision highp float; + +attribute vec2 aPosition; +uniform vec2 uQuadScale; + +uniform vec2 uTexSizeInv; +uniform vec4 uViewport; + +varying vec2 vUv; +varying vec4 vOffset[2]; + +void SMAANeighborhoodBlendingVS(vec2 texCoord) { + vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-1.0, 0.0, 0.0, 1.0); // WebGL port note: Changed sign in W component + vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // WebGL port note: Changed sign in W component +} + +void main() { + vec2 scale = uViewport.zw * uTexSizeInv; + vec2 shift = uViewport.xy * uTexSizeInv; + vUv = (aPosition + 1.0) * 0.5 * scale + shift; + SMAANeighborhoodBlendingVS(vUv); + vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale; + gl_Position = vec4(position, 0.0, 1.0); +} +`;var Jae=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tWeights; +uniform sampler2D tColor; +uniform vec2 uTexSizeInv; + +varying vec2 vUv; +varying vec4 vOffset[2]; + +vec4 SMAANeighborhoodBlendingPS(vec2 texCoord, vec4 offset[2], sampler2D colorTex, sampler2D blendTex) { + // Fetch the blending weights for current pixel: + vec4 a; + a.xz = texture2D(blendTex, texCoord).xz; + a.y = texture2D(blendTex, offset[1].zw).g; + a.w = texture2D(blendTex, offset[1].xy).a; + + // Is there any blending weight with a value greater than 0.0? + if (dot(a, vec4(1.0, 1.0, 1.0, 1.0)) < 1e-5) { + return texture2D(colorTex, texCoord, 0.0); + } else { + // Up to 4 lines can be crossing a pixel (one through each edge). We + // favor blending by choosing the line with the maximum weight for each + // direction: + vec2 offset; + offset.x = a.a > a.b ? a.a : -a.b; // left vs. right + offset.y = a.g > a.r ? -a.g : a.r; // top vs. bottom // WebGL port note: Changed signs + + // Then we go in the direction that has the maximum weight: + if (abs(offset.x) > abs(offset.y)) { // horizontal vs. vertical + offset.y = 0.0; + } else { + offset.x = 0.0; + } + + // Fetch the opposite color and lerp by hand: + vec4 C = texture2D(colorTex, texCoord, 0.0); + texCoord += sign(offset) * uTexSizeInv; + vec4 Cop = texture2D(colorTex, texCoord, 0.0); + float s = abs(offset.x) > abs(offset.y) ? abs(offset.x) : abs(offset.y); + + // WebGL port note: Added gamma correction + C.xyz = pow(C.xyz, vec3(2.2)); + Cop.xyz = pow(Cop.xyz, vec3(2.2)); + vec4 mixed = mix(C, Cop, s); + mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2)); + + return mixed; + } +} + +void main() { + gl_FragColor = SMAANeighborhoodBlendingPS(vUv, vOffset, tColor, tWeights); +} +`;var ele=` +precision highp float; + +attribute vec2 aPosition; +uniform vec2 uQuadScale; + +uniform vec2 uTexSizeInv; +uniform vec4 uViewport; + +varying vec2 vUv; +varying vec4 vOffset[3]; +varying vec2 vPixCoord; + +void SMAABlendingWeightCalculationVS(vec2 texCoord) { + vPixCoord = texCoord / uTexSizeInv; + + // We will use these offsets for the searches later on (see @PSEUDO_GATHER4): + 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 + 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 + + // And these for the searches, they indicate the ends of the loops: + vOffset[2] = vec4(vOffset[0].xz, vOffset[1].yw) + vec4(-2.0, 2.0, -2.0, 2.0) * uTexSizeInv.xxyy * float(dMaxSearchSteps); +} + +void main() { + vec2 scale = uViewport.zw * uTexSizeInv; + vec2 shift = uViewport.xy * uTexSizeInv; + vUv = (aPosition + 1.0) * 0.5 * scale + shift; + SMAABlendingWeightCalculationVS(vUv); + vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale; + gl_Position = vec4(position, 0.0, 1.0); +} +`;var tle=` +precision highp float; +precision highp int; +precision highp sampler2D; + +#define SMAASampleLevelZeroOffset(tex, coord, offset) texture2D(tex, coord + float(offset) * uTexSizeInv, 0.0) + +#define SMAA_AREATEX_MAX_DISTANCE 16 +#define SMAA_AREATEX_PIXEL_SIZE (1.0 / vec2(160.0, 560.0)) +#define SMAA_AREATEX_SUBTEX_SIZE (1.0 / 7.0) + +uniform sampler2D tEdges; +uniform sampler2D tArea; +uniform sampler2D tSearch; +uniform vec2 uTexSizeInv; + +varying vec2 vUv; +varying vec4 vOffset[3]; +varying vec2 vPixCoord; + +#if __VERSION__ == 100 + vec2 round(vec2 x) { + return sign(x) * floor(abs(x) + 0.5); + } +#endif + +float SMAASearchLength(sampler2D searchTex, vec2 e, float bias, float scale) { + // Not required if searchTex accesses are set to point: + // float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0); + // e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE + + // e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE; + e.r = bias + e.r * scale; + return 255.0 * texture2D(searchTex, e, 0.0).r; +} + +float SMAASearchXLeft(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) { + /** + * @PSEUDO_GATHER4 + * This texCoord has been offset by (-0.25, -0.125) in the vertex shader to + * sample between edge, thus fetching four edges in a row. + * Sampling with different offsets in each direction allows to disambiguate + * which edges are active from the four fetched ones. + */ + vec2 e = vec2(0.0, 1.0); + + for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for + e = texture2D( edgesTex, texCoord, 0.0).rg; + texCoord -= vec2(2.0, 0.0) * uTexSizeInv; + if (!(texCoord.x > end && e.g > 0.8281 && e.r == 0.0)) break; + } + + // We correct the previous (-0.25, -0.125) offset we applied: + texCoord.x += 0.25 * uTexSizeInv.x; + + // The searches are bias by 1, so adjust the coords accordingly: + texCoord.x += uTexSizeInv.x; + + // Disambiguate the length added by the last step: + texCoord.x += 2.0 * uTexSizeInv.x; // Undo last step + texCoord.x -= uTexSizeInv.x * SMAASearchLength(searchTex, e, 0.0, 0.5); + + return texCoord.x; +} + +float SMAASearchXRight(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) { + vec2 e = vec2( 0.0, 1.0 ); + + for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for + e = texture2D(edgesTex, texCoord, 0.0).rg; + texCoord += vec2(2.0, 0.0) * uTexSizeInv; + if (!(texCoord.x < end && e.g > 0.8281 && e.r == 0.0)) break; + } + + texCoord.x -= 0.25 * uTexSizeInv.x; + texCoord.x -= uTexSizeInv.x; + texCoord.x -= 2.0 * uTexSizeInv.x; + texCoord.x += uTexSizeInv.x * SMAASearchLength( searchTex, e, 0.5, 0.5 ); + + return texCoord.x; +} + +float SMAASearchYUp(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) { + vec2 e = vec2( 1.0, 0.0 ); + + for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for + e = texture2D(edgesTex, texCoord, 0.0).rg; + texCoord += vec2(0.0, 2.0) * uTexSizeInv; // WebGL port note: Changed sign + if (!(texCoord.y > end && e.r > 0.8281 && e.g == 0.0)) break; + } + + texCoord.y -= 0.25 * uTexSizeInv.y; // WebGL port note: Changed sign + texCoord.y -= uTexSizeInv.y; // WebGL port note: Changed sign + texCoord.y -= 2.0 * uTexSizeInv.y; // WebGL port note: Changed sign + texCoord.y += uTexSizeInv.y * SMAASearchLength(searchTex, e.gr, 0.0, 0.5); // WebGL port note: Changed sign + + return texCoord.y; +} + +float SMAASearchYDown(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) { + vec2 e = vec2( 1.0, 0.0 ); + + for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for + e = texture2D(edgesTex, texCoord, 0.0).rg; + texCoord -= vec2( 0.0, 2.0 ) * uTexSizeInv; // WebGL port note: Changed sign + if (!(texCoord.y < end && e.r > 0.8281 && e.g == 0.0)) break; + } + + texCoord.y += 0.25 * uTexSizeInv.y; // WebGL port note: Changed sign + texCoord.y += uTexSizeInv.y; // WebGL port note: Changed sign + texCoord.y += 2.0 * uTexSizeInv.y; // WebGL port note: Changed sign + texCoord.y -= uTexSizeInv.y * SMAASearchLength(searchTex, e.gr, 0.5, 0.5); // WebGL port note: Changed sign + + return texCoord.y; +} + +vec2 SMAAArea(sampler2D areaTex, vec2 dist, float e1, float e2, float offset) { + // Rounding prevents precision errors of bilinear filtering: + vec2 texCoord = float(SMAA_AREATEX_MAX_DISTANCE) * round(4.0 * vec2(e1, e2)) + dist; + + // We do a scale and bias for mapping to texel space: + texCoord = SMAA_AREATEX_PIXEL_SIZE * texCoord + (0.5 * SMAA_AREATEX_PIXEL_SIZE); + + // Move to proper place, according to the subpixel offset: + texCoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset; + + return texture2D(areaTex, texCoord, 0.0).rg; +} + +vec4 SMAABlendingWeightCalculationPS(vec2 texCoord, vec2 pixCoord, vec4 offset[3], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices) { + vec4 weights = vec4(0.0, 0.0, 0.0, 0.0); + + vec2 e = texture2D(edgesTex, texCoord).rg; + + if (e.g > 0.0) { // Edge at north + vec2 d; + + // Find the distance to the left: + vec2 coords; + coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x ); + coords.y = offset[1].y; // offset[1].y = texCoord.y - 0.25 * uTexSizeInv.y (@CROSSING_OFFSET) + d.x = coords.x; + + // Now fetch the left crossing edges, two at a time using bilinear + // filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to + // discern what value each edge has: + float e1 = texture2D(edgesTex, coords, 0.0).r; + + // Find the distance to the right: + coords.x = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y); + d.y = coords.x; + + // We want the distances to be in pixel units (doing this here allow to + // better interleave arithmetic and memory accesses): + d = d / uTexSizeInv.x - pixCoord.x; + + // SMAAArea below needs a sqrt, as the areas texture is compressed + // quadratically: + vec2 sqrt_d = sqrt(abs(d)); + + // Fetch the right crossing edges: + coords.y -= 1.0 * uTexSizeInv.y; // WebGL port note: Added + float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, ivec2(1, 0)).r; + + // Ok, we know how this pattern looks like, now it is time for getting + // the actual area: + weights.rg = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.y)); + } + + if (e.r > 0.0) { // Edge at west + vec2 d; + + // Find the distance to the top: + vec2 coords; + + coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z ); + coords.x = offset[0].x; // offset[1].x = texCoord.x - 0.25 * uTexSizeInv.x; + d.x = coords.y; + + // Fetch the top crossing edges: + float e1 = texture2D(edgesTex, coords, 0.0).g; + + // Find the distance to the bottom: + coords.y = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w); + d.y = coords.y; + + // We want the distances to be in pixel units: + d = d / uTexSizeInv.y - pixCoord.y; + + // SMAAArea below needs a sqrt, as the areas texture is compressed + // quadratically: + vec2 sqrt_d = sqrt(abs(d)); + + // Fetch the bottom crossing edges: + coords.y -= 1.0 * uTexSizeInv.y; // WebGL port note: Added + float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, ivec2(0, 1)).g; + + // Get the area for this direction: + weights.ba = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.x)); + } + + return weights; +} + +void main() { + gl_FragColor = SMAABlendingWeightCalculationPS(vUv, vPixCoord, vOffset, tEdges, tArea, tSearch, ivec4(0.0)); +} +`;var rle=` +precision highp float; + +attribute vec2 aPosition; +uniform vec2 uQuadScale; + +uniform vec2 uTexSizeInv; +uniform vec4 uViewport; + +varying vec2 vUv; +varying vec4 vOffset[3]; + +void SMAAEdgeDetectionVS(vec2 texCoord) { + vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-1.0, 0.0, 0.0, 1.0); // WebGL port note: Changed sign in W component + vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // WebGL port note: Changed sign in W component + vOffset[2] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-2.0, 0.0, 0.0, 2.0); // WebGL port note: Changed sign in W component +} + +void main() { + vec2 scale = uViewport.zw * uTexSizeInv; + vec2 shift = uViewport.xy * uTexSizeInv; + vUv = (aPosition + 1.0) * 0.5 * scale + shift; + SMAAEdgeDetectionVS(vUv); + vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale; + gl_Position = vec4(position, 0.0, 1.0); +} +`;var nle=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tColor; +uniform vec2 uTexSizeInv; + +varying vec2 vUv; +varying vec4 vOffset[3]; + +vec4 SMAAColorEdgeDetectionPS(vec2 texcoord, vec4 offset[3], sampler2D colorTex) { + vec2 threshold = vec2(dEdgeThreshold, dEdgeThreshold); + + // Calculate color deltas: + vec4 delta; + vec3 C = texture2D(colorTex, texcoord).rgb; + + vec3 Cleft = texture2D(colorTex, offset[0].xy).rgb; + vec3 t = abs(C - Cleft); + delta.x = max(max(t.r, t.g), t.b); + + vec3 Ctop = texture2D(colorTex, offset[0].zw).rgb; + t = abs(C - Ctop); + delta.y = max(max(t.r, t.g), t.b); + + // We do the usual threshold: + vec2 edges = step(threshold, delta.xy); + + // Then discard if there is no edge: + if (dot(edges, vec2(1.0, 1.0 )) == 0.0) + discard; + + // Calculate right and bottom deltas: + vec3 Cright = texture2D(colorTex, offset[1].xy).rgb; + t = abs( C - Cright ); + delta.z = max(max(t.r, t.g), t.b); + + vec3 Cbottom = texture2D(colorTex, offset[1].zw).rgb; + t = abs(C - Cbottom); + delta.w = max(max(t.r, t.g), t.b); + + // Calculate the maximum delta in the direct neighborhood: + float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w ); + + // Calculate left-left and top-top deltas: + vec3 Cleftleft = texture2D(colorTex, offset[2].xy).rgb; + t = abs( C - Cleftleft ); + delta.z = max(max(t.r, t.g), t.b); + + vec3 Ctoptop = texture2D(colorTex, offset[2].zw).rgb; + t = abs(C - Ctoptop); + delta.w = max(max(t.r, t.g), t.b); + + // Calculate the final maximum delta: + maxDelta = max(max(maxDelta, delta.z), delta.w); + + // Local contrast adaptation in action: + edges.xy *= step(0.5 * maxDelta, delta.xy); + + return vec4(edges, 0.0, 0.0); +} + +void main() { + gl_FragColor = SMAAColorEdgeDetectionPS(vUv, vOffset, tColor); +} +`;var ole={edgeThreshold:C.Numeric(.1,{min:.05,max:.15,step:.01}),maxSearchSteps:C.Numeric(16,{min:0,max:32,step:1})},rE=class{get supported(){return this._supported}constructor(t,r){if(this.webgl=t,this._supported=!1,typeof HTMLImageElement>"u"){$t&&console.log('Missing "HTMLImageElement" required for "SMAA"');return}let n=r.getWidth(),o=r.getHeight();this.edgesTarget=t.createRenderTarget(n,o,!1,"uint8","linear"),this.weightsTarget=t.createRenderTarget(n,o,!1,"uint8","linear"),this.edgesRenderable=INe(t,r),this.weightsRenderable=kNe(t,this.edgesTarget.texture),this.blendRenderable=RNe(t,r,this.weightsTarget.texture),this._supported=!0}updateState(t){let{gl:r,state:n}=this.webgl;n.enable(r.SCISSOR_TEST),n.disable(r.BLEND),n.disable(r.DEPTH_TEST),n.depthMask(!1);let{x:o,y:i,width:s,height:a}=t;n.viewport(o,i,s,a),n.scissor(o,i,s,a),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT),I.update(this.edgesRenderable.values.uViewport,Io.toVec4(this.edgesRenderable.values.uViewport.ref.value,t)),I.update(this.weightsRenderable.values.uViewport,Io.toVec4(this.weightsRenderable.values.uViewport.ref.value,t)),I.update(this.blendRenderable.values.uViewport,Io.toVec4(this.blendRenderable.values.uViewport.ref.value,t))}setSize(t,r){let n=this.edgesTarget.getWidth(),o=this.edgesTarget.getHeight();(t!==n||r!==o)&&(this.edgesTarget.setSize(t,r),this.weightsTarget.setSize(t,r),I.update(this.edgesRenderable.values.uTexSizeInv,Ae.set(this.edgesRenderable.values.uTexSizeInv.ref.value,1/t,1/r)),I.update(this.weightsRenderable.values.uTexSizeInv,Ae.set(this.weightsRenderable.values.uTexSizeInv.ref.value,1/t,1/r)),I.update(this.blendRenderable.values.uTexSizeInv,Ae.set(this.blendRenderable.values.uTexSizeInv.ref.value,1/t,1/r)))}update(t,r){let n=!1;this.edgesRenderable.values.tColor.ref.value!==t&&(I.update(this.edgesRenderable.values.tColor,t),n=!0),this.edgesRenderable.values.dEdgeThreshold.ref.value!==r.edgeThreshold&&(I.update(this.edgesRenderable.values.dEdgeThreshold,r.edgeThreshold),n=!0),n&&this.edgesRenderable.update(),this.weightsRenderable.values.dMaxSearchSteps.ref.value!==r.maxSearchSteps&&(I.update(this.weightsRenderable.values.dMaxSearchSteps,r.maxSearchSteps),this.weightsRenderable.update()),this.blendRenderable.values.tColor.ref.value!==t&&(I.update(this.blendRenderable.values.tColor,t),this.blendRenderable.update())}render(t,r){ot&&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(),ot&&this.webgl.timer.markEnd("SmaaPass.render")}},TNe=te(k({},wn),{tColor:Ct("texture","rgba","ubyte","linear"),uTexSizeInv:ye("v2"),uViewport:ye("v4"),dEdgeThreshold:At("number")}),PNe=Rr("smaa-edges",rle,nle);function INe(e,t){let r=t.getWidth(),n=t.getHeight(),o=te(k({},An),{tColor:I.create(t),uTexSizeInv:I.create(Ae.create(1/r,1/n)),uViewport:I.create(Rt()),dEdgeThreshold:I.create(.1)}),i=k({},TNe),s=Jr(e,"triangles",PNe,i,o);return en(s,o)}var ENe=te(k({},wn),{tEdges:Ct("texture","rgba","ubyte","linear"),tArea:Ct("texture","rgb","ubyte","linear"),tSearch:Ct("texture","rgba","ubyte","nearest"),uTexSizeInv:ye("v2"),uViewport:ye("v4"),dMaxSearchSteps:At("number")}),DNe=Rr("smaa-weights",ele,tle);function kNe(e,t){let r=t.getWidth(),n=t.getHeight(),o=e.resources.texture("image-uint8","rgb","ubyte","linear"),i=e.resources.texture("image-uint8","rgba","ubyte","nearest"),s=te(k({},An),{tEdges:I.create(t),tArea:I.create(o),tSearch:I.create(i),uTexSizeInv:I.create(Ae.create(1/r,1/n)),uViewport:I.create(Rt()),dMaxSearchSteps:I.create(16)});aF(LNe(),s.tArea,o),aF(FNe(),s.tSearch,i);let a=k({},ENe),l=Jr(e,"triangles",DNe,a,s);return en(l,s)}var MNe=te(k({},wn),{tColor:Ct("texture","rgba","ubyte","linear"),tWeights:Ct("texture","rgba","ubyte","linear"),uTexSizeInv:ye("v2"),uViewport:ye("v4")}),BNe=Rr("smaa-blend",$ae,Jae);function RNe(e,t,r){let n=t.getWidth(),o=t.getHeight(),i=te(k({},An),{tColor:I.create(t),tWeights:I.create(r),uTexSizeInv:I.create(Ae.create(1/n,1/o)),uViewport:I.create(Rt())}),s=k({},MNe),a=Jr(e,"triangles",BNe,s,i);return en(a,i)}function LNe(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="}function FNe(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}var ile=` +precision mediump float; +precision mediump samplerCube; +precision mediump sampler2D; + +#if defined(dVariant_skybox) + uniform samplerCube tSkybox; + uniform mat4 uViewDirectionProjectionInverse; + uniform float uBlur; + uniform float uOpacity; + uniform float uSaturation; + uniform float uLightness; + uniform mat3 uRotation; +#elif defined(dVariant_image) + uniform sampler2D tImage; + uniform vec2 uImageScale; + uniform vec2 uImageOffset; + uniform float uBlur; + uniform float uOpacity; + uniform float uSaturation; + uniform float uLightness; +#elif defined(dVariant_horizontalGradient) || defined(dVariant_radialGradient) + uniform vec3 uGradientColorA; + uniform vec3 uGradientColorB; + uniform float uGradientRatio; +#endif + +uniform vec2 uTexSize; +uniform vec4 uViewport; +uniform bool uViewportAdjusted; +varying vec4 vPosition; + +// TODO: add as general pp option to remove banding? +// Iestyn's RGB dither from http://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf +vec3 ScreenSpaceDither(vec2 vScreenPos) { + vec3 vDither = vec3(dot(vec2(171.0, 231.0), vScreenPos.xy)); + vDither.rgb = fract(vDither.rgb / vec3(103.0, 71.0, 97.0)); + return vDither.rgb / 255.0; +} + +vec3 saturateColor(vec3 c, float amount) { + // https://www.w3.org/TR/WCAG21/#dfn-relative-luminance + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + vec3 intensity = vec3(dot(c, W)); + return mix(intensity, c, 1.0 + amount); +} + +vec3 lightenColor(vec3 c, float amount) { + return c + amount; +} + +void main() { + #if defined(dVariant_skybox) + vec4 t = uViewDirectionProjectionInverse * vPosition; + #ifdef enabledShaderTextureLod + gl_FragColor = textureCubeLodEXT(tSkybox, uRotation * normalize(t.xyz / t.w), uBlur * 8.0); + #else + gl_FragColor = textureCube(tSkybox, uRotation * normalize(t.xyz / t.w)); + #endif + gl_FragColor.a = uOpacity; + gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness); + #elif defined(dVariant_image) + vec2 coords; + if (uViewportAdjusted) { + coords = ((gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uImageScale) + uImageOffset; + } else { + coords = (gl_FragCoord.xy / uImageScale) + uImageOffset; + } + #ifdef enabledShaderTextureLod + gl_FragColor = texture2DLodEXT(tImage, vec2(coords.x, 1.0 - coords.y), uBlur * 8.0); + #else + gl_FragColor = texture2D(tImage, vec2(coords.x, 1.0 - coords.y)); + #endif + gl_FragColor.a = uOpacity; + gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness); + #elif defined(dVariant_horizontalGradient) + float d; + if (uViewportAdjusted) { + d = ((gl_FragCoord.y - uViewport.y) * (uTexSize.y / uViewport.w) / uTexSize.y) + 1.0 - (uGradientRatio * 2.0); + } else { + d = (gl_FragCoord.y / uTexSize.y) + 1.0 - (uGradientRatio * 2.0); + } + gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, clamp(d, 0.0, 1.0)), 1.0); + gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy); + #elif defined(dVariant_radialGradient) + float d; + if (uViewportAdjusted) { + d = distance(vec2(0.5), (gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uTexSize) + uGradientRatio - 0.5; + } else { + d = distance(vec2(0.5), gl_FragCoord.xy / uTexSize) + uGradientRatio - 0.5; + } + gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, 1.0 - clamp(d, 0.0, 1.0)), 1.0); + gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy); + #endif +} +`;var sle=` +precision mediump float; + +attribute vec2 aPosition; + +varying vec4 vPosition; + +void main() { + vPosition = vec4(aPosition, 1.0, 1.0); + gl_Position = vec4(aPosition, 1.0, 1.0); +} +`;function j_(){return j_.zero()}(function(e){function t(){let p=[.1,0,0];return p[0]=0,p}e.zero=t;function r(p,h,f){let y=t();return y[0]=p,y[1]=h,y[2]=f,y}e.create=r;function n(p,h,f,y){return p[0]=h,p[0]=f,p[0]=y,p}e.set=n;function o(p){let h=t();return h[0]=p[0],h[1]=p[1],h[2]=p[2],h}e.clone=o;function i(p,h){return p[0]=h[0],p[1]=h[1],p[2]=h[2],p}e.copy=i;function s(p,h,f){let y=h[0],g=h[4],v=h[8],b=h[1],S=h[5],_=h[9],w=h[2],E=h[6],A=h[10];switch(f){case"XYZ":p[1]=Math.asin(po(v,-1,1)),Math.abs(v)<.9999999?(p[0]=Math.atan2(-_,A),p[2]=Math.atan2(-g,y)):(p[0]=Math.atan2(E,S),p[2]=0);break;case"YXZ":p[0]=Math.asin(-po(_,-1,1)),Math.abs(_)<.9999999?(p[1]=Math.atan2(v,A),p[2]=Math.atan2(b,S)):(p[1]=Math.atan2(-w,y),p[2]=0);break;case"ZXY":p[0]=Math.asin(po(E,-1,1)),Math.abs(E)<.9999999?(p[1]=Math.atan2(-w,A),p[2]=Math.atan2(-g,S)):(p[1]=0,p[2]=Math.atan2(b,y));break;case"ZYX":p[1]=Math.asin(-po(w,-1,1)),Math.abs(w)<.9999999?(p[0]=Math.atan2(E,A),p[2]=Math.atan2(b,y)):(p[0]=0,p[2]=Math.atan2(-g,S));break;case"YZX":p[2]=Math.asin(po(b,-1,1)),Math.abs(b)<.9999999?(p[0]=Math.atan2(-_,S),p[1]=Math.atan2(-w,y)):(p[0]=0,p[1]=Math.atan2(v,A));break;case"XZY":p[2]=Math.asin(-po(g,-1,1)),Math.abs(g)<.9999999?(p[0]=Math.atan2(E,S),p[1]=Math.atan2(v,y)):(p[0]=Math.atan2(-_,A),p[1]=0);break;default:_r(f)}return p}e.fromMat4=s;let a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function l(p,h,f){return ne.fromQuat(a,h),s(p,a,f)}e.fromQuat=l;function c(p,h){return n(p,h[0],h[1],h[2])}e.fromVec3=c;function u(p,h){return p[0]===h[0]&&p[1]===h[1]&&p[2]===h[2]}e.exactEquals=u;function d(p,h,f){return p[0]=h[f+0],p[1]=h[f+1],p[2]=h[f+2],p}e.fromArray=d;function m(p,h,f){return h[f+0]=p[0],h[f+1]=p[1],h[f+2]=p[2],h}e.toArray=m})(j_||(j_={}));var dle={opacity:C.Numeric(1,{min:0,max:1,step:.01}),saturation:C.Numeric(0,{min:-1,max:1,step:.01}),lightness:C.Numeric(0,{min:-1,max:1,step:.01})},ONe=k({faces:C.MappedStatic("urls",{urls:C.Group({nx:C.Text("",{label:"Negative X / Left"}),ny:C.Text("",{label:"Negative Y / Bottom"}),nz:C.Text("",{label:"Negative Z / Back"}),px:C.Text("",{label:"Positive X / Right"}),py:C.Text("",{label:"Positive Y / Top"}),pz:C.Text("",{label:"Positive Z / Front"})},{isExpanded:!0,label:"URLs"}),files:C.Group({nx:C.File({label:"Negative X / Left",accept:"image/*"}),ny:C.File({label:"Negative Y / Bottom",accept:"image/*"}),nz:C.File({label:"Negative Z / Back",accept:"image/*"}),px:C.File({label:"Positive X / Right",accept:"image/*"}),py:C.File({label:"Positive Y / Top",accept:"image/*"}),pz:C.File({label:"Positive Z / Front",accept:"image/*"})},{isExpanded:!0,label:"Files"})}),blur:C.Numeric(0,{min:0,max:1,step:.01},{description:'Note, this only works in WebGL2 or when "EXT_shader_texture_lod" is available.'}),rotation:C.Group({x:C.Numeric(0,{min:0,max:360,step:1},{immediateUpdate:!0}),y:C.Numeric(0,{min:0,max:360,step:1},{immediateUpdate:!0}),z:C.Numeric(0,{min:0,max:360,step:1},{immediateUpdate:!0})})},dle),NNe=te(k({source:C.MappedStatic("url",{url:C.Text(""),file:C.File({accept:"image/*"})}),blur:C.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.'})},dle),{coverage:C.Select("viewport",C.arrayToOptions(["viewport","canvas"]))}),UNe={topColor:C.Color(Oe(14540253)),bottomColor:C.Color(Oe(15658734)),ratio:C.Numeric(.5,{min:0,max:1,step:.01}),coverage:C.Select("viewport",C.arrayToOptions(["viewport","canvas"]))},zNe={centerColor:C.Color(Oe(14540253)),edgeColor:C.Color(Oe(15658734)),ratio:C.Numeric(.5,{min:0,max:1,step:.01}),coverage:C.Select("viewport",C.arrayToOptions(["viewport","canvas"]))},mle={variant:C.MappedStatic("off",{off:C.EmptyGroup(),skybox:C.Group(ONe,{isExpanded:!0}),image:C.Group(NNe,{isExpanded:!0}),horizontalGradient:C.Group(UNe,{isExpanded:!0}),radialGradient:C.Group(zNe,{isExpanded:!0})},{label:"Environment"})},nE=class{constructor(t,r,n,o){this.webgl=t,this.assetManager=r,this.camera=new co,this.target=x(),this.position=x(),this.dir=x(),this.renderable=KNe(t,n,o)}setSize(t,r){let[n,o]=this.renderable.values.uTexSize.ref.value;(t!==n||r!==o)&&I.update(this.renderable.values.uTexSize,Ae.set(this.renderable.values.uTexSize.ref.value,t,r))}clearSkybox(){this.skybox!==void 0&&(this.skybox.texture.destroy(),this.skybox.assets.forEach(t=>this.assetManager.release(t)),this.skybox=void 0)}updateSkybox(t,r,n){var o;let i=(o=this.skybox)===null||o===void 0?void 0:o.props.faces,s=r.faces.params;if(!s.nx||!s.ny||!s.nz||!s.px||!s.py||!s.pz){this.clearSkybox(),n?.(!1);return}if(!this.skybox||!i||!HNe(r.faces,this.skybox.props.faces)){this.clearSkybox();let{texture:u,assets:d}=jNe(this.webgl,this.assetManager,r.faces,m=>{this.skybox&&(this.skybox.loaded=!m),n?.(!0)});this.skybox={texture:u,props:k({},r),assets:d,loaded:!1},I.update(this.renderable.values.tSkybox,u),this.renderable.update()}else n?.(!1);if(!this.skybox)return;let a=t;t.state.mode==="orthographic"&&(this.camera.setState(te(k({},t.state),{mode:"perspective"})),this.camera.update(),a=this.camera);let l=this.renderable.values.uViewDirectionProjectionInverse.ref.value;x.sub(this.dir,a.state.position,a.state.target),x.setMagnitude(this.dir,this.dir,.1),x.copy(this.position,this.dir),ne.lookAt(l,this.position,this.target,a.state.up),ne.mul(l,a.projection,l),ne.invert(l,l),I.update(this.renderable.values.uViewDirectionProjectionInverse,l);let c=this.renderable.values.uRotation.ref.value;Kt.fromEuler(c,j_.create(Cr(r.rotation.x),Cr(r.rotation.y),Cr(r.rotation.z)),"XYZ"),I.update(this.renderable.values.uRotation,c),I.updateIfChanged(this.renderable.values.uBlur,r.blur),I.updateIfChanged(this.renderable.values.uOpacity,r.opacity),I.updateIfChanged(this.renderable.values.uSaturation,r.saturation),I.updateIfChanged(this.renderable.values.uLightness,r.lightness),I.updateIfChanged(this.renderable.values.dVariant,"skybox"),this.renderable.update()}clearImage(){this.image!==void 0&&(this.image.texture.destroy(),this.assetManager.release(this.image.asset),this.image=void 0)}updateImage(t,r){if(!t.source.params){this.clearImage(),r?.(!1);return}if(!this.image||!this.image.props.source.params||!qNe(t.source,this.image.props.source)){this.clearImage();let{texture:n,asset:o}=WNe(this.webgl,this.assetManager,t.source,i=>{this.image&&(this.image.loaded=!i),r?.(!0)});this.image={texture:n,props:k({},t),asset:o,loaded:!1},I.update(this.renderable.values.tImage,n),this.renderable.update()}else r?.(!1);this.image&&(I.updateIfChanged(this.renderable.values.uBlur,t.blur),I.updateIfChanged(this.renderable.values.uOpacity,t.opacity),I.updateIfChanged(this.renderable.values.uSaturation,t.saturation),I.updateIfChanged(this.renderable.values.uLightness,t.lightness),I.updateIfChanged(this.renderable.values.uViewportAdjusted,t.coverage==="viewport"),I.updateIfChanged(this.renderable.values.dVariant,"image"),this.renderable.update())}updateImageScaling(){var t,r;let n=this.renderable.values,[o,i]=n.uTexSize.ref.value,s=((t=this.image)===null||t===void 0?void 0:t.texture.getWidth())||0,a=((r=this.image)===null||r===void 0?void 0:r.texture.getHeight())||0,l=o/i,c=s/a;ll?I.update(n.uImageOffset,Ae.set(n.uImageOffset.ref.value,(1-l/m)/2,0)):I.update(n.uImageOffset,Ae.set(n.uImageOffset.ref.value,0,(1-m/l)/2))}updateGradient(t,r,n,o,i){I.update(this.renderable.values.uGradientColorA,Oe.toVec3Normalized(this.renderable.values.uGradientColorA.ref.value,t)),I.update(this.renderable.values.uGradientColorB,Oe.toVec3Normalized(this.renderable.values.uGradientColorB.ref.value,r)),I.updateIfChanged(this.renderable.values.uGradientRatio,n),I.updateIfChanged(this.renderable.values.uViewportAdjusted,i),I.updateIfChanged(this.renderable.values.dVariant,o),this.renderable.update()}update(t,r,n){if(r.variant.name==="off"){this.clearSkybox(),this.clearImage(),n?.(!1);return}else r.variant.name==="skybox"?(this.clearImage(),this.updateSkybox(t,r.variant.params,n)):r.variant.name==="image"?(this.clearSkybox(),this.updateImage(r.variant.params,n)):r.variant.name==="horizontalGradient"?(this.clearSkybox(),this.clearImage(),this.updateGradient(r.variant.params.topColor,r.variant.params.bottomColor,r.variant.params.ratio,r.variant.name,r.variant.params.coverage==="viewport"),n?.(!1)):r.variant.name==="radialGradient"&&(this.clearSkybox(),this.clearImage(),this.updateGradient(r.variant.params.centerColor,r.variant.params.edgeColor,r.variant.params.ratio,r.variant.name,r.variant.params.coverage==="viewport"),n?.(!1));let{x:o,y:i,width:s,height:a}=t.viewport;I.update(this.renderable.values.uViewport,Rt.set(this.renderable.values.uViewport.ref.value,o,i,s,a))}isEnabled(t){return!!(this.skybox&&this.skybox.loaded||this.image&&this.image.loaded||t.variant.name==="horizontalGradient"||t.variant.name==="radialGradient")}isReady(){return!!(this.skybox&&this.skybox.loaded||this.image&&this.image.loaded||this.renderable.values.dVariant.ref.value==="horizontalGradient"||this.renderable.values.dVariant.ref.value==="radialGradient")}render(){this.isReady()&&(this.renderable.values.dVariant.ref.value==="image"&&this.updateImageScaling(),ot&&this.webgl.timer.mark("BackgroundPass.render"),this.renderable.render(),ot&&this.webgl.timer.markEnd("BackgroundPass.render"))}dispose(){this.clearSkybox(),this.clearImage()}},ale="background-skybox";function VNe(e,t){return t.name==="urls"?{nx:Or.getUrlAsset(e,t.params.nx),ny:Or.getUrlAsset(e,t.params.ny),nz:Or.getUrlAsset(e,t.params.nz),px:Or.getUrlAsset(e,t.params.px),py:Or.getUrlAsset(e,t.params.py),pz:Or.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}}function GNe(e,t){let r=n=>e.resolve(n,"binary").run().then(o=>new Blob([o.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)}}function lle(e){var t,r,n,o,i,s;return e.name==="urls"?`${ale}_${e.params.nx}|${e.params.ny}|${e.params.nz}|${e.params.px}|${e.params.py}|${e.params.pz}`:`${ale}_${(t=e.params.nx)===null||t===void 0?void 0:t.id}|${(r=e.params.ny)===null||r===void 0?void 0:r.id}|${(n=e.params.nz)===null||n===void 0?void 0:n.id}|${(o=e.params.px)===null||o===void 0?void 0:o.id}|${(i=e.params.py)===null||i===void 0?void 0:i.id}|${(s=e.params.pz)===null||s===void 0?void 0:s.id}`}function HNe(e,t){return lle(e)===lle(t)}function jNe(e,t,r,n){let o=VNe(t,r),i=GNe(t,o),s=[o.nx,o.ny,o.nz,o.px,o.py,o.pz];return typeof HTMLImageElement>"u"?(console.error('Missing "HTMLImageElement" required for background skybox'),n?.(!0),{texture:fo(),assets:s}):{texture:e.resources.cubeTexture(i,!0,n),assets:s}}var cle="background-image";function ule(e){var t;return e.name==="url"?`${cle}_${e.params}`:`${cle}_${(t=e.params)===null||t===void 0?void 0:t.id}`}function qNe(e,t){return ule(e)===ule(t)}function WNe(e,t,r,n){let o=r.name==="url"?Or.getUrlAsset(t,r.params):r.params;if(typeof HTMLImageElement>"u")return console.error('Missing "HTMLImageElement" required for background image'),n?.(!0),{texture:fo(),asset:o};let i=e.resources.texture("image-uint8","rgba","ubyte","linear"),s=new Image;return s.onload=()=>{i.load(s),(e.isWebGL2||yg(s.width)&&yg(s.height))&&i.mipmap(),n?.()},s.onerror=()=>{n?.(!0)},t.resolve(o,"binary").run().then(a=>{let l=new Blob([a.data]);s.src=URL.createObjectURL(l)}),{texture:i,asset:o}}var YNe={drawCount:Mn("number"),instanceCount:Mn("number"),aPosition:nn("float32",2,0),tSkybox:Ct("texture","rgba","ubyte","linear"),tImage:Ct("texture","rgba","ubyte","linear"),uImageScale:ye("v2"),uImageOffset:ye("v2"),uTexSize:ye("v2"),uViewport:ye("v4"),uViewportAdjusted:ye("b"),uViewDirectionProjectionInverse:ye("m4"),uGradientColorA:ye("v3"),uGradientColorB:ye("v3"),uGradientRatio:ye("f"),uBlur:ye("f"),uOpacity:ye("f"),uSaturation:ye("f"),uLightness:ye("f"),uRotation:ye("m3"),dVariant:At("string",["skybox","image","verticalGradient","horizontalGradient","radialGradient"])},XNe=Rr("background",sle,ile,{shaderTextureLod:"optional"});function KNe(e,t,r){let n={drawCount:I.create(6),instanceCount:I.create(1),aPosition:I.create(c_),tSkybox:I.create(fo()),tImage:I.create(fo()),uImageScale:I.create(Ae()),uImageOffset:I.create(Ae()),uTexSize:I.create(Ae.create(t,r)),uViewport:I.create(Rt()),uViewportAdjusted:I.create(!0),uViewDirectionProjectionInverse:I.create(ne()),uGradientColorA:I.create(x()),uGradientColorB:I.create(x()),uGradientRatio:I.create(.5),uBlur:I.create(0),uOpacity:I.create(1),uSaturation:I.create(0),uLightness:I.create(0),uRotation:I.create(Kt.identity()),dVariant:I.create("skybox")},o=k({},YNe),i=Jr(e,"triangles",XNe,o,n);return en(i,n)}var ple=` +precision highp float; +precision highp int; +precision highp sampler2D; + +#include common + +uniform sampler2D tDepth; +uniform vec2 uTexSize; +uniform vec4 uBounds; + +uniform float uNear; +uniform float uFar; + +#if dLightCount != 0 + uniform vec3 uLightDirection[dLightCount]; + uniform vec3 uLightColor[dLightCount]; +#endif + +uniform mat4 uProjection; +uniform mat4 uInvProjection; + +uniform float uMaxDistance; +uniform float uTolerance; +uniform float uBias; + +bool isBackground(const in float depth) { + return depth == 1.0; +} + +bool outsideBounds(const in vec2 p) { + return p.x < uBounds.x || p.y < uBounds.y || p.x > uBounds.z || p.y > uBounds.w; +} + +float getViewZ(const in float depth) { + #if dOrthographic == 1 + return orthographicDepthToViewZ(depth, uNear, uFar); + #else + return perspectiveDepthToViewZ(depth, uNear, uFar); + #endif +} + +float getDepth(const in vec2 coords) { + #ifdef depthTextureSupport + return texture2D(tDepth, coords).r; + #else + return unpackRGBAToDepth(texture2D(tDepth, coords)); + #endif +} + +float screenFade(const in vec2 coords) { + vec2 c = (coords - uBounds.xy) / (uBounds.zw - uBounds.xy); + vec2 fade = max(12.0 * abs(c - 0.5) - 5.0, vec2(0.0)); + return saturate(1.0 - dot(fade, fade)); +} + +// based on https://panoskarabelas.com/posts/screen_space_shadows/ +float screenSpaceShadow(const in vec3 position, const in vec3 lightDirection, const in float stepLength) { + // Ray position and direction (in view-space) + vec3 rayPos = position; + vec3 rayDir = -lightDirection; + + // Compute ray step + vec3 rayStep = rayDir * stepLength; + + // Ray march towards the light + float occlusion = 0.0; + vec4 rayCoords = vec4(0.0); + for (int i = 0; i < dSteps; ++i) { + // Step the ray + rayPos += rayStep; + + rayCoords = uProjection * vec4(rayPos, 1.0); + rayCoords.xyz = (rayCoords.xyz / rayCoords.w) * 0.5 + 0.5; + + if (outsideBounds(rayCoords.xy)) + return 1.0; + + // Compute the difference between the ray's and the camera's depth + float depth = getDepth(rayCoords.xy); + float viewZ = getViewZ(depth); + float zDelta = rayPos.z - viewZ; + + if (zDelta < uTolerance) { + occlusion = 1.0; + + // Fade out as we approach the edges of the screen + occlusion *= screenFade(rayCoords.xy); + + break; + } + } + + return 1.0 - (uBias * occlusion); +} + +void main(void) { + vec2 invTexSize = 1.0 / uTexSize; + vec2 selfCoords = gl_FragCoord.xy * invTexSize; + + float selfDepth = getDepth(selfCoords); + + if (isBackground(selfDepth)) { + gl_FragColor = vec4(0.0); + return; + } + + vec3 selfViewPos = screenSpaceToViewSpace(vec3(selfCoords, selfDepth), uInvProjection); + float stepLength = uMaxDistance / float(dSteps); + + float o = 1.0; + #if dLightCount != 0 + float sh[dLightCount]; + #pragma unroll_loop_start + for (int i = 0; i < dLightCount; ++i) { + sh[i] = screenSpaceShadow(selfViewPos, uLightDirection[i], stepLength); + o = min(o, sh[i]); + } + #pragma unroll_loop_end + #endif + + gl_FragColor = vec4(o); +} +`;var fle=` +precision mediump float; +precision mediump sampler2D; + +uniform sampler2D tColor; +uniform vec2 uTexSizeInv; + +uniform float uSharpness; + +// adapted from https://www.shadertoy.com/view/stXSWB + +/* +* FidelityFX Super Resolution scales up a low resolution +* image, while adding fine detail. +* +* MIT Open License +* +* https://gpuopen.com/fsr +* +* Left: FSR processed +* Right: Original texture, bilinear interpolation +* +* Mouse at top: Sharpness 0 stops (maximum) +* Mouse at bottom: Sharpness 2 stops (minimum) +* +* It works in two passes- +* EASU upsamples the image with a clamped Lanczos kernel. +* RCAS sharpens the image at the target resolution. +* +* I needed to make a few changes to improve readability and +* WebGL compatibility in an algorithm I don't fully understand. +* Expect bugs. +* +* Shader not currently running for WebGL1 targets (eg. mobile Safari) +* +* There is kind of no point to using FSR in Shadertoy, as it renders buffers +* at full target resolution. But this might be useful for WebGL based demos +* running smaller-than-target render buffers. +* +* For sharpening with a full resolution render buffer, +* FidelityFX CAS is a better option. +* https://www.shadertoy.com/view/ftsXzM +* +* For readability and compatibility, these optimisations have been removed: +* * Fast approximate inverse and inversesqrt +* * textureGather fetches (not WebGL compatible) +* * Multiplying by reciprocal instead of division +* +* Apologies to AMD for the numerous slowdowns and errors I have introduced. +* +*/ + +/***** RCAS *****/ +#define FSR_RCAS_LIMIT (0.25-(1.0/16.0)) + +// Input callback prototypes that need to be implemented by calling shader +vec4 FsrRcasLoadF(vec2 p); +//------------------------------------------------------------------------------------------------------------------------------ +void FsrRcasCon( + out float con, + // The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}. + float sharpness +) { + // Transform from stops to linear value. + con = exp2(-sharpness); +} + +vec3 FsrRcasF( + vec2 ip, // Integer pixel position in output. + float con +) { + // Constant generated by RcasSetup(). + // Algorithm uses minimal 3x3 pixel neighborhood. + // b + // d e f + // h + vec2 sp = vec2(ip); + vec3 b = FsrRcasLoadF(sp + vec2( 0,-1)).rgb; + vec3 d = FsrRcasLoadF(sp + vec2(-1, 0)).rgb; + vec3 e = FsrRcasLoadF(sp).rgb; + vec3 f = FsrRcasLoadF(sp + vec2( 1, 0)).rgb; + vec3 h = FsrRcasLoadF(sp + vec2( 0, 1)).rgb; + + // Luma times 2. + float bL = b.g + .5 * (b.b + b.r); + float dL = d.g + .5 * (d.b + d.r); + float eL = e.g + .5 * (e.b + e.r); + float fL = f.g + .5 * (f.b + f.r); + float hL = h.g + .5 * (h.b + h.r); + + // Noise detection. + #ifdef dDenoise + float nz = .25 * (bL + dL + fL + hL) - eL; + nz=clamp( + abs(nz) + /( + max(max(bL,dL),max(eL,max(fL,hL))) + -min(min(bL,dL),min(eL,min(fL,hL))) + ), + 0., 1. + ); + nz=1.-.5*nz; + #endif + + // Min and max of ring. + vec3 mn4 = min(b, min(f, h)); + vec3 mx4 = max(b, max(f, h)); + + // Immediate constants for peak range. + vec2 peakC = vec2(1., -4.); + + // Limiters, these need to be high precision RCPs. + vec3 hitMin = mn4 / (4. * mx4); + vec3 hitMax = (peakC.x - mx4) / (4.* mn4 + peakC.y); + vec3 lobeRGB = max(-hitMin, hitMax); + float lobe = max( + -FSR_RCAS_LIMIT, + min(max(lobeRGB.r, max(lobeRGB.g, lobeRGB.b)), 0.) + )*con; + + // Apply noise removal. + #ifdef dDenoise + lobe *= nz; + #endif + + // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes. + return (lobe * (b + d + h + f) + e) / (4. * lobe + 1.); +} + + +vec4 FsrRcasLoadF(vec2 p) { + return texture2D(tColor, p * uTexSizeInv); +} + +void main() { + // Set up constants + float con; + FsrRcasCon(con, uSharpness); + + // Perform RCAS pass + vec3 col = FsrRcasF(gl_FragCoord.xy, con); + + gl_FragColor = vec4(col, FsrRcasLoadF(gl_FragCoord.xy).a); +} +`;var hle={sharpness:C.Numeric(.5,{min:0,max:1,step:.05}),denoise:C.Boolean(!0)},oE=class{constructor(t,r){this.webgl=t,this.renderable=$Ne(t,r)}updateState(t){let{gl:r,state:n}=this.webgl;n.enable(r.SCISSOR_TEST),n.disable(r.BLEND),n.disable(r.DEPTH_TEST),n.depthMask(!1);let{x:o,y:i,width:s,height:a}=t;n.viewport(o,i,s,a),n.scissor(o,i,s,a),n.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)}setSize(t,r){I.update(this.renderable.values.uTexSizeInv,Ae.set(this.renderable.values.uTexSizeInv.ref.value,1/t,1/r))}update(t,r){let{values:n}=this.renderable,{sharpness:o,denoise:i}=r,s=!1;n.tColor.ref.value!==t&&(I.update(this.renderable.values.tColor,t),s=!0),I.updateIfChanged(n.uSharpness,2-2*Math.pow(o,.25)),n.dDenoise.ref.value!==i&&(s=!0),I.updateIfChanged(n.dDenoise,i),s&&this.renderable.update()}render(t,r){ot&&this.webgl.timer.mark("CasPass.render"),r?r.bind():this.webgl.unbindFramebuffer(),this.updateState(t),this.renderable.render(),ot&&this.webgl.timer.markEnd("CasPass.render")}},QNe=te(k({},wn),{tColor:Ct("texture","rgba","ubyte","linear"),uTexSizeInv:ye("v2"),uSharpness:ye("f"),dDenoise:At("boolean")}),ZNe=Rr("cas",Nn,fle);function $Ne(e,t){let r=t.getWidth(),n=t.getHeight(),o=te(k({},An),{tColor:I.create(t),uTexSizeInv:I.create(Ae.create(1/r,1/n)),uSharpness:I.create(.5),dDenoise:I.create(!0)}),i=k({},QNe),s=Jr(e,"triangles",ZNe,i,o);return en(s,o)}var gle=` +precision highp float; +precision highp int; +precision highp sampler2D; + +#include common + +uniform sampler2D tColor; +uniform sampler2D tDepthOpaque; +uniform sampler2D tDepthTransparent; + +uniform vec2 uTexSize; +uniform vec4 uBounds; + +uniform float uBlurSpread; +uniform float uInFocus; +uniform float uPPM; + +uniform float uNear; // Near plane +uniform float uFar; // Far plane + +uniform mat4 uInvProjection; // Inverse projection +uniform mat4 uProjection; // projection + +uniform int uMode; // 0-planar, 1-spherical +uniform vec3 uCenter; // Center of focus sphere in view space + +// Function to convert depth value from depth buffer to view space Z +float getViewZ(const in float depth) { + #if dOrthographic == 1 + return orthographicDepthToViewZ(depth, uNear, uFar); + #else + return perspectiveDepthToViewZ(depth, uNear, uFar); + #endif +} + +// Retrieve depth from opaque depth texture +float getDepthOpaque(const in vec2 coords) { + #ifdef depthTextureSupport + return texture2D(tDepthOpaque, coords).r; + #else + return unpackRGBAToDepth(texture2D(tDepthOpaque, coords)); + #endif +} + +// Retrieve depth from transparent depth texture +float getDepthTransparent(const in vec2 coords) { + return unpackRGBAToDepth(texture2D(tDepthTransparent, coords)); +} + +bool isBackground(const in float depth) { + return depth == 1.0; +} + +float getDepth(const in vec2 coords) { + return min(getDepthOpaque(coords), getDepthTransparent(coords)); +} + +float getCOC(vec2 uv) { + float depth = getDepth(uv); + float viewDist = getViewZ(depth); + vec3 aposition = screenSpaceToViewSpace(vec3(uv.xy, depth), uInvProjection); + float focusDist = length(aposition - uCenter); + float coc = 0.0; // Circle of Confusion + if (uMode == 0) { // planar Depth of field + coc = (abs(viewDist) - uInFocus) / uPPM; //focus distance, focus range + } else if(uMode == 1) { // spherical Depth of field + coc = focusDist / uPPM ; + } + coc = clamp(coc, -1.0, 1.0); + return coc; +} + +// Simple box blur for blurring the image +vec3 getBlurredImage(vec2 coords) { + vec4 blurColor = vec4(0); + vec2 texelSize = vec2(1.0 / uTexSize.x, 1.0 / uTexSize.y); + float count = 0.0; + for (int x = 0; x < int(dBlurSize); x++) { + for (int y = 0; y < int(dBlurSize); y++) { + vec2 offset = vec2(float(x) - float(dBlurSize) / 2.0, float(y) - float(dBlurSize) / 2.0); + vec2 uvPixel = coords.xy + offset * texelSize * uBlurSpread; + float coc = getCOC(uvPixel); + coc = smoothstep(0.0, 1.0, abs(coc)); + // mix blurColor with new color with weight coc + blurColor.rgb = blurColor.rgb + texture2D(tColor, uvPixel).xyz * coc; + count+=coc; + } + } + blurColor = blurColor / count; + return blurColor.rgb; +} + +// simplification from https://catlikecoding.com/unity/tutorials/advanced-rendering/depth-of-field/ +void main() { + vec2 uv = gl_FragCoord.xy / uTexSize; + vec4 color = texture2D(tColor, uv); + float depth = getDepth(uv); + + float viewDist = getViewZ(depth); + + vec3 aposition = screenSpaceToViewSpace(vec3(uv.xy, depth), uInvProjection); + float focusDist = length(aposition - uCenter); + vec3 blurColor = getBlurredImage(uv); + + float coc = getCOC(uv); // Circle of Confusion + + // for debugging the coc + // color.rgb = (coc < 0.0) ? (1.0 - abs(coc)) * vec3(1.0,0.0,0.0) : vec3(0.0, 1.0 - coc, 0.0) ;//mix(color.rgb, blurColor.rgb, abs(coc)); + color.rgb = mix(color.rgb, blurColor, smoothstep(0.0, 1.0, abs(coc))); // Smooth blending based on CoC + gl_FragColor = color; +} +`;var yle={blurSize:C.Numeric(9,{min:1,max:32,step:1}),blurSpread:C.Numeric(1,{min:0,max:10,step:.1}),inFocus:C.Numeric(0,{min:-5e3,max:5e3,step:1},{description:"Distance from the scene center that will be in focus"}),PPM:C.Numeric(20,{min:0,max:5e3,step:.1},{description:"Size of the area that will be in focus"}),center:C.Select("camera-target",C.arrayToOptions(["scene-center","camera-target"])),mode:C.Select("plane",C.arrayToOptions(["plane","sphere"]))},gf=class{static isEnabled(t){return t.dof.name!=="off"}constructor(t,r,n){this.webgl=t,this.target=t.createRenderTarget(r,n,!1);let o=fo();this.renderable=t6e(t,o,o,o)}updateState(t){let{gl:r,state:n}=this.webgl;n.enable(r.SCISSOR_TEST),n.disable(r.BLEND),n.disable(r.DEPTH_TEST),n.depthMask(!1);let{x:o,y:i,width:s,height:a}=t;n.viewport(o,i,s,a),n.scissor(o,i,s,a),n.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)}setSize(t,r){let n=this.target.texture.getWidth(),o=this.target.texture.getHeight();(t!==n||r!==o)&&(this.target.setSize(t,r),I.update(this.renderable.values.uTexSize,Ae.set(this.renderable.values.uTexSize.ref.value,t,r)))}update(t,r,n,o,i,s){let a=!1;this.renderable.values.tColor.ref.value!==r&&(I.update(this.renderable.values.tColor,r),a=!0),this.renderable.values.tDepthOpaque.ref.value!==n&&(I.update(this.renderable.values.tDepthOpaque,n),a=!0),this.renderable.values.tDepthTransparent.ref.value!==o&&(I.update(this.renderable.values.tDepthTransparent,o),a=!0);let l=t.state.mode==="orthographic"?1:0,c=this.renderable.values.uInvProjection.ref.value;ne.invert(c,t.projection);let[u,d]=this.renderable.values.uTexSize.ref.value,m=t.viewport;I.update(this.renderable.values.uProjection,t.projection),I.update(this.renderable.values.uInvProjection,c),I.update(this.renderable.values.uMode,i.mode==="sphere"?1:0),Rt.set(this.renderable.values.uBounds.ref.value,m.x/u,m.y/d,(m.x+m.width)/u,(m.y+m.height)/d),I.update(this.renderable.values.uBounds,this.renderable.values.uBounds.ref.value),I.updateIfChanged(this.renderable.values.uNear,t.near),I.updateIfChanged(this.renderable.values.uFar,t.far),I.updateIfChanged(this.renderable.values.dOrthographic,l),this.renderable.values.dBlurSize.ref.value!==i.blurSize&&(I.update(this.renderable.values.dBlurSize,i.blurSize),a=!0);let p=i.center==="scene-center"?s.center:t.state.target,f=x.distance(t.state.position,p)+i.inFocus;I.updateIfChanged(this.renderable.values.uInFocus,f);let y=this.renderable.values.uCenter.ref.value;x.transformMat4(y,p,t.view),I.update(this.renderable.values.uCenter,y),I.updateIfChanged(this.renderable.values.uBlurSpread,i.blurSpread),I.updateIfChanged(this.renderable.values.uPPM,i.PPM),a&&this.renderable.update()}render(t,r){ot&&this.webgl.timer.mark("DofPass.render"),r?r.bind():this.webgl.unbindFramebuffer(),this.updateState(t),this.renderable.render(),ot&&this.webgl.timer.markEnd("DofPass.render")}},JNe=te(k({},wn),{tDepthOpaque:Ct("texture","rgba","ubyte","nearest"),tDepthTransparent:Ct("texture","rgba","ubyte","nearest"),tColor:Ct("texture","rgba","ubyte","nearest"),uTexSize:ye("v2"),uProjection:ye("m4"),uInvProjection:ye("m4"),uBounds:ye("v4"),uCenter:ye("v3"),uMode:ye("i"),dOrthographic:At("number"),uNear:ye("f"),uFar:ye("f"),dBlurSize:At("number"),uBlurSpread:ye("f"),uInFocus:ye("f"),uPPM:ye("f")}),e6e=Rr("dof",Nn,gle);function t6e(e,t,r,n){let o=t.getWidth(),i=t.getHeight(),s=te(k({},An),{tDepthOpaque:I.create(r),tDepthTransparent:I.create(n),tColor:I.create(t),uTexSize:I.create(Ae.create(o,i)),uProjection:I.create(ne.identity()),uInvProjection:I.create(ne.identity()),uBounds:I.create(Rt()),uCenter:I.create(x()),uMode:I.create(0),dOrthographic:I.create(0),uNear:I.create(1),uFar:I.create(1e4),dBlurSize:I.create(5),uBlurSpread:I.create(300),uInFocus:I.create(20),uPPM:I.create(20)}),a=k({},JNe),l=Jr(e,"triangles",e6e,a,s);return en(l,s)}var vle=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform vec2 uTexSizeInv; + +uniform sampler2D tBlur1; +uniform sampler2D tBlur2; +uniform sampler2D tBlur3; +uniform sampler2D tBlur4; +uniform sampler2D tBlur5; +uniform float uBloomStrength; +uniform float uBloomRadius; +uniform float uBloomFactors[5]; +uniform vec3 uBloomTints[5]; + +float lerpBloomFactor(const in float factor) { + float mirrorFactor = 1.2 - factor; + return mix(factor, mirrorFactor, uBloomRadius); +} + +void main(void) { + vec2 coords = gl_FragCoord.xy * uTexSizeInv; + + gl_FragColor = uBloomStrength * ( + lerpBloomFactor(uBloomFactors[0]) * vec4(uBloomTints[0], 1.0) * texture2D(tBlur1, coords) + + lerpBloomFactor(uBloomFactors[1]) * vec4(uBloomTints[1], 1.0) * texture2D(tBlur2, coords) + + lerpBloomFactor(uBloomFactors[2]) * vec4(uBloomTints[2], 1.0) * texture2D(tBlur3, coords) + + lerpBloomFactor(uBloomFactors[3]) * vec4(uBloomTints[3], 1.0) * texture2D(tBlur4, coords) + + lerpBloomFactor(uBloomFactors[4]) * vec4(uBloomTints[4], 1.0) * texture2D(tBlur5, coords) + ); +} +`;var xle=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tColor; +uniform sampler2D tEmissive; +uniform sampler2D tDepth; +uniform vec2 uTexSizeInv; + +uniform vec3 uDefaultColor; +uniform float uDefaultOpacity; +uniform float uLuminosityThreshold; +uniform float uSmoothWidth; + +#include common + +float getDepth(const in vec2 coords) { + #ifdef depthTextureSupport + return texture2D(tDepth, coords).r; + #else + return unpackRGBAToDepth(texture2D(tDepth, coords)); + #endif +} + +bool isBackground(const in float depth) { + return depth == 1.0; +} + +void main(void) { + vec2 coords = gl_FragCoord.xy * uTexSizeInv; + vec4 texel = texture2D(tColor, coords); + float emissive = texture2D(tEmissive, coords).a; + float depth = getDepth(coords); + + if (isBackground(depth)) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + return; + } + + vec4 outputColor = vec4(uDefaultColor.rgb, uDefaultOpacity); + + #if defined(dMode_luminosity) + vec3 luma = vec3(0.299, 0.587, 0.114); + float v = dot(texel.xyz, luma); + float alpha = smoothstep(uLuminosityThreshold, uLuminosityThreshold + uSmoothWidth, v); + + gl_FragColor = mix(outputColor, texel, alpha); + #elif defined(dMode_emissive) + gl_FragColor = mix(outputColor, texel, emissive); + #endif +} +`;var ble=` +precision highp float; +precision highp int; +precision highp sampler2D; + +uniform sampler2D tInput; +uniform vec2 uTexSizeInv; + +uniform vec2 uDirection; +uniform float uGaussianCoefficients[dKernelRadius]; + +void main(void) { + vec2 coords = gl_FragCoord.xy * uTexSizeInv; + float weightSum = uGaussianCoefficients[0]; + vec4 diffuseSum = texture2D(tInput, coords) * weightSum; + + for(int i = 1; i < dKernelRadius; ++i) { + float x = float(i); + float w = uGaussianCoefficients[i]; + vec2 offset = uDirection * uTexSizeInv * x; + vec4 sample1 = texture2D(tInput, coords + offset); + vec4 sample2 = texture2D(tInput, coords - offset); + diffuseSum += (sample1 + sample2) * w; + weightSum += 2.0 * w; + } + + gl_FragColor = diffuseSum / weightSum; +} +`;var c6=5,Sle={strength:C.Numeric(1,{min:0,max:3,step:.1}),radius:C.Numeric(0,{min:0,max:1,step:.01}),threshold:C.Numeric(0,{min:0,max:1,step:.01},{description:"Luminosity threshold",hideIf:e=>e.mode==="emissive"}),mode:C.Select("emissive",[["luminosity","Luminosity"],["emissive","Emissive"]])},iE=class{static isEnabled(t){return t.bloom.name==="on"}constructor(t,r,n){this.webgl=t,this.horizontalBlurTargets=[],this.verticalBlurTargets=[],this.emissiveTarget=t.createRenderTarget(r,n,!0,"uint8","linear","rgba"),this.luminosityTarget=t.createRenderTarget(r,n,!1,"uint8","linear"),this.compositeTarget=t.createRenderTarget(r,n,!1,"uint8","linear");let o=Math.round(r/2),i=Math.round(n/2);for(let a=0;a`${e.radius}, ${e.bias}`,{defaultValue:[{radius:2,bias:1},{radius:5,bias:1},{radius:8,bias:1},{radius:11,bias:1}]}),nearThreshold:C.Numeric(10,{min:0,max:50,step:1}),farThreshold:C.Numeric(1500,{min:0,max:1e4,step:100})}),off:C.Group({})},{cycle:!0}),radius:C.Numeric(5,{min:0,max:20,step:.1},{description:"Final occlusion radius is 2^x",hideIf:e=>e?.multiScale.name==="on"}),bias:C.Numeric(.8,{min:0,max:3,step:.1}),blurKernelSize:C.Numeric(15,{min:1,max:25,step:2}),resolutionScale:C.Numeric(1,{min:.1,max:1,step:.05},{description:"Adjust resolution of occlusion calculation"}),color:C.Color(Oe(0))}),off:C.Group({})},{cycle:!0,description:"Darken occluded crevices with the ambient occlusion effect"}),shadow:C.MappedStatic("off",{on:C.Group({steps:C.Numeric(1,{min:1,max:64,step:1}),bias:C.Numeric(.6,{min:0,max:1,step:.01}),maxDistance:C.Numeric(3,{min:0,max:256,step:1}),tolerance:C.Numeric(1,{min:0,max:10,step:.1})}),off:C.Group({})},{cycle:!0,description:"Simplistic shadows"}),outline:C.MappedStatic("off",{on:C.Group({scale:C.Numeric(1,{min:1,max:5,step:1}),threshold:C.Numeric(.33,{min:.01,max:1,step:.01}),color:C.Color(Oe(0)),includeTransparent:C.Boolean(!0,{description:"Whether to show outline for transparent objects"})}),off:C.Group({})},{cycle:!0,description:"Draw outline around 3D objects"}),dof:C.MappedStatic("off",{on:C.Group(yle),off:C.Group({})},{cycle:!0,description:"DOF"}),antialiasing:C.MappedStatic("smaa",{fxaa:C.Group(Zae),smaa:C.Group(ole),off:C.Group({})},{options:[["fxaa","FXAA"],["smaa","SMAA"],["off","Off"]],description:"Smooth pixel edges"}),sharpening:C.MappedStatic("off",{on:C.Group(hle),off:C.Group({})},{cycle:!0,description:"Contrast Adaptive Sharpening"}),background:C.Group(mle,{isFlat:!0}),bloom:C.MappedStatic("on",{on:C.Group(Sle),off:C.Group({})},{cycle:!0,description:"Bloom"})};function w6e(e,t){let r=e.length,{radius:n,bias:o}=t||{radius:new Array(r*3).fill(0),bias:new Array(r*3).fill(0)};e=e.slice().sort((i,s)=>i.radius-s.radius);for(let i=0;i=p.length)return-2;let{x:h,y:f,width:y,height:g}=i.viewport,v=1/p.length;if(t===-1)c.render(r,n,!1),I.update(s.values.uWeight,1),I.update(s.values.tColor,c.getColorTarget(n.postprocessing).texture),s.update(),l.bind(),m.disable(d.BLEND),m.disable(d.DEPTH_TEST),m.depthMask(!1),m.viewport(h,f,y,g),m.scissor(h,f,y,g),s.render(),t+=1;else{i.viewOffset.enabled=!0,I.update(s.values.tColor,c.getColorTarget(n.postprocessing).texture),I.update(s.values.uWeight,v),s.update();let S=Math.pow(2,Math.max(0,n.multiSample.sampleLevel-2));for(let _=0;_=p.length)break}}c.postprocessing.setOcclusionOffset(0,0),this.bindOutputTarget(o),m.viewport(h,f,y,g),m.scissor(h,f,y,g);let b=t*v;return b>0&&(I.update(s.values.uWeight,1),I.update(s.values.tColor,a.texture),s.update(),m.disable(d.BLEND),s.render()),b<1&&(I.update(s.values.uWeight,1-b),I.update(s.values.tColor,l.texture),s.update(),b===0?m.disable(d.BLEND):m.enable(d.BLEND),s.render()),i.viewOffset.enabled=!1,i.update(),ot&&u.timer.markEnd("MultiSamplePass.renderTemporalMultiSample"),t>=p.length?-2:t}},d6=[[[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]]];d6.forEach(e=>{e.forEach(t=>{t[0]*=.0625,t[1]*=.0625})});var Qb=class{update(t,r){return t&&(this.sampleIndex=-1),r.mode==="temporal"?this.sampleIndex!==-2:!1}render(t,r,n,o){return this.sampleIndex=this.multiSamplePass.render(this.sampleIndex,t,r,n,!!o),this.sampleIndex<0}constructor(t){this.multiSamplePass=t,this.sampleIndex=-2}};var m6={eyeSeparation:C.Numeric(.062,{min:.02,max:.1,step:.001},{description:"Distance between left and right camera."}),focus:C.Numeric(10,{min:1,max:20,step:.1},{description:"Apparent object distance."})},I6e=C.getDefaultValues(m6);var fp=class{get viewport(){return this.parent.viewport}get viewOffset(){return this.parent.viewOffset}constructor(t,r={}){this.parent=t,this.left=new lE,this.right=new lE,this.props=k(k({},I6e),r)}setProps(t){Object.assign(this.props,t)}update(){this.parent.update(),E6e(this.parent,this.props,this.left,this.right)}};(function(e){function t(r){return"left"in r&&"right"in r}e.is=t})(fp||(fp={}));var lE=class{constructor(){this.viewport=Io.create(0,0,0,0),this.view=ne(),this.projection=ne(),this.projectionView=ne(),this.inverseProjectionView=ne(),this.state=co.createDefaultSnapshot(),this.viewOffset=co.ViewOffset(),this.far=0,this.near=0,this.fogFar=0,this.fogNear=0}},Tle=ne.identity(),Ple=ne.identity();function E6e(e,t,r,n){Io.copy(r.viewport,e.viewport),ne.copy(r.view,e.view),ne.copy(r.projection,e.projection),co.copySnapshot(r.state,e.state),co.copyViewOffset(r.viewOffset,e.viewOffset),r.far=e.far,r.near=e.near,r.fogFar=e.fogFar,r.fogNear=e.fogNear,Io.copy(n.viewport,e.viewport),ne.copy(n.view,e.view),ne.copy(n.projection,e.projection),co.copySnapshot(n.state,e.state),co.copyViewOffset(n.viewOffset,e.viewOffset),n.far=e.far,n.near=e.near,n.fogFar=e.fogFar,n.fogNear=e.fogNear;let o=Math.floor(e.viewport.width/2),i=o/e.viewport.height;r.viewport.width=o,n.viewport.x+=o,n.viewport.width-=o;let s=t.eyeSeparation/2,a=s*e.near/t.focus,l=e.near*Math.tan(e.state.fov*.5),c,u;Tle[12]=-s,Ple[12]=s,c=-l*i+a,u=l*i+a,r.projection[0]=2*e.near/(u-c),r.projection[8]=(u+c)/(u-c),ne.mul(r.view,r.view,Tle),ne.mul(r.projectionView,r.projection,r.view),ne.invert(r.inverseProjectionView,r.projectionView),c=-l*i-a,u=l*i-a,n.projection[0]=2*e.near/(u-c),n.projection[8]=(u+c)/(u-c),ne.mul(n.view,n.view,Ple),ne.mul(n.projectionView,n.projection,n.view),ne.invert(n.inverseProjectionView,n.projectionView)}var p6=Math.pow(2,24)-2,cE=class{constructor(t,r,n){this.webgl=t,this.drawPass=r,this.pickScale=n;let o=n/t.pixelRatio;this.pickWidth=Math.ceil(r.colorTarget.getWidth()*o),this.pickHeight=Math.ceil(r.colorTarget.getHeight()*o);let{resources:i,extensions:{drawBuffers:s},gl:a}=t;s?(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(),s.drawBuffers([s.COLOR_ATTACHMENT0,s.COLOR_ATTACHMENT1,s.COLOR_ATTACHMENT2,s.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=Wt(a)?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))}get pickRatio(){return this.pickScale/this.webgl.pixelRatio}setPickScale(t){this.pickScale=t,this.syncSize()}bindObject(){this.webgl.extensions.drawBuffers?this.objectPickFramebuffer.bind():this.objectPickTarget.bind()}bindInstance(){this.webgl.extensions.drawBuffers?this.instancePickFramebuffer.bind():this.instancePickTarget.bind()}bindGroup(){this.webgl.extensions.drawBuffers?this.groupPickFramebuffer.bind():this.groupPickTarget.bind()}bindDepth(){this.webgl.extensions.drawBuffers?this.depthPickFramebuffer.bind():this.depthPickTarget.bind()}get drawingBufferHeight(){return this.drawPass.colorTarget.getHeight()}syncSize(){let t=this.pickScale/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)))}renderVariant(t,r,n,o,i,s){t.clear(!1),t.update(r,n),t.renderPick(n.primitives,r,i,null,s),o.handle.isEnabled&&t.renderPick(o.handle.scene,r,i,null,s),o.camera.isEnabled&&(o.camera.update(r),t.update(o.camera.camera,o.camera.scene),t.renderPick(o.camera.scene,o.camera.camera,i,null,s))}render(t,r,n,o){this.webgl.extensions.drawBuffers?(this.framebuffer.bind(),this.renderVariant(t,r,n,o,"pick",U0.None)):(this.objectPickTarget.bind(),this.renderVariant(t,r,n,o,"pick",U0.Object),this.instancePickTarget.bind(),this.renderVariant(t,r,n,o,"pick",U0.Instance),this.groupPickTarget.bind(),this.renderVariant(t,r,n,o,"pick",U0.Group),this.depthPickTarget.bind(),this.renderVariant(t,r,n,o,"depth",U0.None))}},uE=class{setupBuffers(){let 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))}setViewport(t,r,n,o){Io.set(this.viewport,t,r,n,o),this.pickRatio=this.pickPass.pickRatio,this.pickX=Math.ceil(t*this.pickRatio),this.pickY=Math.ceil(r*this.pickRatio);let i=Math.floor(n*this.pickRatio),s=Math.floor(o*this.pickRatio);(i!==this.pickWidth||s!==this.pickHeight)&&(this.pickWidth=i,this.pickHeight=s,this.halfPickWidth=Math.floor(this.pickWidth/2),this.setupBuffers()),this.spiral=XG(Math.round(this.pickRatio*this.pickPadding))}syncBuffers(){ot&&this.webgl.timer.mark("PickHelper.syncBuffers");let{pickX:t,pickY:r,pickWidth:n,pickHeight:o}=this;this.pickPass.bindObject(),this.webgl.readPixels(t,r,n,o,this.objectBuffer),this.pickPass.bindInstance(),this.webgl.readPixels(t,r,n,o,this.instanceBuffer),this.pickPass.bindGroup(),this.webgl.readPixels(t,r,n,o,this.groupBuffer),this.pickPass.bindDepth(),this.webgl.readPixels(t,r,n,o,this.depthBuffer),ot&&this.webgl.timer.markEnd("PickHelper.syncBuffers")}getBufferIdx(t,r){return(r*this.pickWidth+t)*4}getDepth(t,r){let n=this.getBufferIdx(t,r),o=this.depthBuffer;return HJ(o[n],o[n+1],o[n+2],o[n+3])}getId(t,r,n){let o=this.getBufferIdx(t,r);return D1(n[o],n[o+1],n[o+2])}render(t){ot&&this.webgl.timer.mark("PickHelper.render",!0);let{pickX:r,pickY:n,pickWidth:o,pickHeight:i,halfPickWidth:s}=this,{renderer:a,scene:l,helper:c}=this;a.setTransparentBackground(!1),a.setDrawingBufferSize(o,i),a.setPixelRatio(this.pickRatio),fp.is(t)?(a.setViewport(r,n,s,i),this.pickPass.render(a,t.left,l,c),a.setViewport(r+s,n,o-s,i),this.pickPass.render(a,t.right,l,c)):(a.setViewport(r,n,o,i),this.pickPass.render(a,t,l,c)),this.dirty=!1,ot&&this.webgl.timer.markEnd("PickHelper.render")}identifyInternal(t,r,n){let{webgl:o,pickRatio:i}=this;if(o.isContextLost)return;t*=o.pixelRatio,r*=o.pixelRatio,r=this.pickPass.drawingBufferHeight-r;let{viewport:s}=this;if(ts.x+s.width||r>s.y+s.height)return;this.dirty&&(ot&&this.webgl.timer.mark("PickHelper.identify"),this.render(n),this.syncBuffers(),ot&&this.webgl.timer.markEnd("PickHelper.identify"));let a=t-s.x,l=r-s.y,c=Math.floor(a*i),u=Math.floor(l*i),d=this.getId(c,u,this.objectBuffer);if(d===-1||d===p6)return;let m=this.getId(c,u,this.instanceBuffer);if(m===-1||m===p6)return;let p=this.getId(c,u,this.groupBuffer);if(p===-1||p===p6)return;let h=this.getDepth(c,u),f=x.create(t,r,h);if(fp.is(n)){let y=Math.floor(s.width/2);t>s.x+y?(f[0]=s.x+(a-y)*2,Yb(f,f,s,n.right.inverseProjectionView)):(f[0]=s.x+a*2,Yb(f,f,s,n.left.inverseProjectionView))}else Yb(f,f,s,n.inverseProjectionView);return{id:{objectId:d,instanceId:m,groupId:p},position:f}}identify(t,r,n){for(let o of this.spiral){let i=this.identifyInternal(t+o[0],r+o[1],n);if(i)return i}}constructor(t,r,n,o,i,s,a=1){this.webgl=t,this.renderer=r,this.scene=n,this.helper=o,this.pickPass=i,this.pickPadding=a,this.dirty=!0,this.viewport=Io(),this.setViewport(s.x,s.y,s.width,s.height)}};var Ile=` +precision highp float; + +uniform sampler2D tWboitA; +uniform sampler2D tWboitB; +uniform vec2 uTexSize; + +void main() { + vec2 coords = gl_FragCoord.xy / uTexSize; + + vec4 accum = texture2D(tWboitA, coords); + float r = 1.0 - accum.a; + + accum.a = texture2D(tWboitB, coords).r; + // divisor needs to allow very small values for nice fading + gl_FragColor = vec4(accum.rgb / clamp(accum.a, 0.00000001, 50000.0), r); +} +`;var D6e=te(k({},wn),{tWboitA:Ct("texture","rgba","float","nearest"),tWboitB:Ct("texture","rgba","float","nearest"),uTexSize:ye("v2")}),k6e=Rr("evaluate-wboit",Nn,Ile);function M6e(e,t,r){let n=te(k({},An),{tWboitA:I.create(t),tWboitB:I.create(r),uTexSize:I.create(Ae.create(t.getWidth(),t.getHeight()))}),o=k({},D6e),i=Jr(e,"triangles",k6e,o,n);return en(i,n)}var dE=class e{get supported(){return this._supported}bind(){let{state:t,gl:r}=this.webgl;this.framebuffer.bind(),t.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT),t.disable(r.DEPTH_TEST),t.blendFuncSeparate(r.ONE,r.ONE,r.ZERO,r.ONE_MINUS_SRC_ALPHA),t.enable(r.BLEND)}render(){ot&&this.webgl.timer.mark("WboitPass.render");let{state:t,gl:r}=this.webgl;t.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),t.enable(r.BLEND),this.renderable.update(),this.renderable.render(),ot&&this.webgl.timer.markEnd("WboitPass.render")}setSize(t,r){let[n,o]=this.renderable.values.uTexSize.ref.value;(t!==n||r!==o)&&(this.textureA.define(t,r),this.textureB.define(t,r),this.depthRenderbuffer.setSize(t,r),I.update(this.renderable.values.uTexSize,Ae.set(this.renderable.values.uTexSize.ref.value,t,r)))}reset(){this._supported&&this._init()}_init(){let{extensions:{drawBuffers:t}}=this.webgl;this.framebuffer.bind(),t.drawBuffers([t.COLOR_ATTACHMENT0,t.COLOR_ATTACHMENT1]),this.textureA.attachFramebuffer(this.framebuffer,"color0"),this.textureB.attachFramebuffer(this.framebuffer,"color1"),this.depthRenderbuffer.attachFramebuffer(this.framebuffer)}static isSupported(t){let{extensions:{drawBuffers:r,textureFloat:n,colorBufferFloat:o,depthTexture:i}}=t;if(!n||!o||!i||!r){if($t){let s=[];n||s.push("textureFloat"),o||s.push("colorBufferFloat"),i||s.push("depthTexture"),r||s.push("drawBuffers"),console.log(`Missing "${s.join('", "')}" extensions required for "wboit"`)}return!1}else return!0}constructor(t,r,n){if(this.webgl=t,this._supported=!1,!e.isSupported(t))return;let{resources:o,gl:i}=t;this.textureA=o.texture("image-float32","rgba","float","nearest"),this.textureA.define(r,n),this.textureB=o.texture("image-float32","rgba","float","nearest"),this.textureB.define(r,n),this.depthRenderbuffer=Wt(i)?o.renderbuffer("depth32f","depth",r,n):o.renderbuffer("depth16","depth",r,n),this.renderable=M6e(t,this.textureA,this.textureB),this.framebuffer=o.framebuffer(),this._supported=!0,this._init()}};var Ele=` +precision highp float; + +uniform sampler2D tDpoitFrontColor; +uniform vec2 uTexSize; + +void main() { + vec2 coords = gl_FragCoord.xy / uTexSize; + gl_FragColor = texture2D(tDpoitFrontColor, coords); +} +`;var Dle=` + precision highp float; + + uniform sampler2D tDpoitBackColor; + uniform vec2 uTexSize; + + void main() { + vec2 coords = gl_FragCoord.xy / uTexSize; + gl_FragColor = texture2D(tDpoitBackColor, coords); + if (gl_FragColor.a == 0.0) { + discard; + } + } +`;var B6e=te(k({},wn),{tDpoitBackColor:Ct("texture","rgba","float","nearest"),uTexSize:ye("v2")}),R6e=Rr("blend-back-dpoit",Nn,Dle);function L6e(e,t){let r=te(k({},An),{tDpoitBackColor:I.create(t),uTexSize:I.create(Ae.create(t.getWidth(),t.getHeight()))}),n=k({},B6e),o=Jr(e,"triangles",R6e,n,r);return en(o,r)}var F6e=te(k({},wn),{tDpoitFrontColor:Ct("texture","rgba","float","nearest"),uTexSize:ye("v2")}),O6e=Rr("evaluate-dpoit",Nn,Ele);function N6e(e,t){let r=te(k({},An),{tDpoitFrontColor:I.create(t),uTexSize:I.create(Ae.create(t.getWidth(),t.getHeight()))}),n=k({},F6e),o=Jr(e,"triangles",O6e,n,r);return en(o,r)}var mE=class e{get supported(){return this._supported}bind(){let{state:t,gl:r,extensions:{blendMinMax:n}}=this.webgl;return this.passCount=0,this.depthFramebuffers[0].bind(),t.clearColor(this.DEPTH_CLEAR_VALUE,this.DEPTH_CLEAR_VALUE,0,0),r.clear(r.COLOR_BUFFER_BIT),this.depthFramebuffers[1].bind(),t.clearColor(-this.MIN_DEPTH,this.MAX_DEPTH,0,0),r.clear(r.COLOR_BUFFER_BIT),this.colorFramebuffers[0].bind(),t.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),this.colorFramebuffers[1].bind(),t.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),this.depthFramebuffers[0].bind(),t.blendEquation(n.MAX),t.depthMask(!1),{depth:this.depthTextures[1],frontColor:this.colorFrontTextures[1],backColor:this.colorBackTextures[1]}}bindDualDepthPeeling(){let{state:t,gl:r,extensions:{blendMinMax:n}}=this.webgl;return this.readId=this.passCount%2,this.writeId=1-this.readId,this.passCount+=1,this.depthFramebuffers[this.writeId].bind(),t.clearColor(this.DEPTH_CLEAR_VALUE,this.DEPTH_CLEAR_VALUE,0,0),r.clear(r.COLOR_BUFFER_BIT),this.colorFramebuffers[this.writeId].bind(),t.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),this.depthFramebuffers[this.writeId].bind(),t.blendEquation(n.MAX),t.depthMask(!1),{depth:this.depthTextures[this.readId],frontColor:this.colorFrontTextures[this.readId],backColor:this.colorBackTextures[this.readId]}}renderBlendBack(){ot&&this.webgl.timer.mark("DpoitPass.renderBlendBack");let{state:t,gl:r}=this.webgl;t.blendEquation(r.FUNC_ADD),t.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),I.update(this.blendBackRenderable.values.tDpoitBackColor,this.colorBackTextures[this.writeId]),this.blendBackRenderable.update(),this.blendBackRenderable.render(),ot&&this.webgl.timer.markEnd("DpoitPass.renderBlendBack")}render(){ot&&this.webgl.timer.mark("DpoitPass.render");let{state:t,gl:r}=this.webgl;t.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),I.update(this.renderable.values.tDpoitFrontColor,this.colorFrontTextures[this.writeId]),this.renderable.update(),this.renderable.render(),ot&&this.webgl.timer.markEnd("DpoitPass.render")}setSize(t,r){let[n,o]=this.renderable.values.uTexSize.ref.value;if(t!==n||r!==o){for(let i=0;i<2;i++)this.depthTextures[i].define(t,r),this.colorFrontTextures[i].define(t,r),this.colorBackTextures[i].define(t,r);I.update(this.renderable.values.uTexSize,Ae.set(this.renderable.values.uTexSize.ref.value,t,r)),I.update(this.blendBackRenderable.values.uTexSize,Ae.set(this.blendBackRenderable.values.uTexSize.ref.value,t,r))}}reset(){this._supported&&this._init()}_init(){let{extensions:{drawBuffers:t}}=this.webgl;for(let r=0;r<2;r++)this.depthFramebuffers[r].bind(),t.drawBuffers([t.COLOR_ATTACHMENT0,t.COLOR_ATTACHMENT1,t.COLOR_ATTACHMENT2]),this.colorFrontTextures[r].attachFramebuffer(this.depthFramebuffers[r],"color0"),this.colorBackTextures[r].attachFramebuffer(this.depthFramebuffers[r],"color1"),this.depthTextures[r].attachFramebuffer(this.depthFramebuffers[r],"color2"),this.colorFramebuffers[r].bind(),t.drawBuffers([t.COLOR_ATTACHMENT0,t.COLOR_ATTACHMENT1]),this.colorFrontTextures[r].attachFramebuffer(this.colorFramebuffers[r],"color0"),this.colorBackTextures[r].attachFramebuffer(this.colorFramebuffers[r],"color1")}static isSupported(t){let{extensions:{drawBuffers:r,textureFloat:n,colorBufferFloat:o,depthTexture:i,blendMinMax:s}}=t;if(!n||!o||!i||!r||!s){if($t){let a=[];n||a.push("textureFloat"),o||a.push("colorBufferFloat"),i||a.push("depthTexture"),r||a.push("drawBuffers"),s||a.push("blendMinMax"),console.log(`Missing "${a.join('", "')}" extensions required for "dpoit"`)}return!1}else return!0}constructor(t,r,n){if(this.webgl=t,this.DEPTH_CLEAR_VALUE=-99999,this.MAX_DEPTH=1,this.MIN_DEPTH=0,this.passCount=0,this._supported=!1,!e.isSupported(t))return;let{resources:o,extensions:{colorBufferHalfFloat:i,textureHalfFloat:s}}=t;Wt(t.gl)?(this.depthTextures=[o.texture("image-float32","rg","float","nearest"),o.texture("image-float32","rg","float","nearest")],this.colorFrontTextures=i&&s?[o.texture("image-float16","rgba","fp16","nearest"),o.texture("image-float16","rgba","fp16","nearest")]:[o.texture("image-float32","rgba","float","nearest"),o.texture("image-float32","rgba","float","nearest")],this.colorBackTextures=i&&s?[o.texture("image-float16","rgba","fp16","nearest"),o.texture("image-float16","rgba","fp16","nearest")]:[o.texture("image-float32","rgba","float","nearest"),o.texture("image-float32","rgba","float","nearest")]):(this.depthTextures=[o.texture("image-float32","rgba","float","nearest"),o.texture("image-float32","rgba","float","nearest")],this.colorFrontTextures=[o.texture("image-float32","rgba","float","nearest"),o.texture("image-float32","rgba","float","nearest")],this.colorBackTextures=[o.texture("image-float32","rgba","float","nearest"),o.texture("image-float32","rgba","float","nearest")]),this.depthTextures[0].define(r,n),this.depthTextures[1].define(r,n),this.colorFrontTextures[0].define(r,n),this.colorFrontTextures[1].define(r,n),this.colorBackTextures[0].define(r,n),this.colorBackTextures[1].define(r,n),this.depthFramebuffers=[o.framebuffer(),o.framebuffer()],this.colorFramebuffers=[o.framebuffer(),o.framebuffer()],this.blendBackRenderable=L6e(t,this.colorBackTextures[0]),this.renderable=N6e(t,this.colorFrontTextures[0]),this._supported=!0,this._init()}};var kle=` +precision highp float; +precision highp sampler2D; + +uniform vec2 uTexSizeInv; +uniform sampler2D tEdgeTexture; +uniform vec3 uHighlightEdgeColor; +uniform vec3 uSelectEdgeColor; +uniform float uHighlightEdgeStrength; +uniform float uSelectEdgeStrength; +uniform float uGhostEdgeStrength; +uniform float uInnerEdgeFactor; + +void main() { + vec2 coords = gl_FragCoord.xy * uTexSizeInv; + vec4 edgeValue = texture2D(tEdgeTexture, coords); + if (edgeValue.a > 0.0) { + vec3 edgeColor = edgeValue.b == 1.0 ? uHighlightEdgeColor : uSelectEdgeColor; + gl_FragColor.rgb = edgeValue.g > 0.0 ? edgeColor : edgeColor * uInnerEdgeFactor; + gl_FragColor.a = (edgeValue.r == 1.0 ? uGhostEdgeStrength : 1.0) * edgeValue.a; + float edgeStrength = edgeValue.b == 1.0 ? uHighlightEdgeStrength : uSelectEdgeStrength; + gl_FragColor.a *= edgeStrength; + } else { + gl_FragColor = vec4(0.0); + } +} +`;var Mle=` +precision highp float; +precision highp sampler2D; + +uniform sampler2D tMaskTexture; +uniform vec2 uTexSizeInv; + +void main() { + vec2 coords = gl_FragCoord.xy * uTexSizeInv; + vec4 offset = vec4(float(dEdgeScale), 0.0, 0.0, float(dEdgeScale)) * vec4(uTexSizeInv, uTexSizeInv); + vec4 c0 = texture2D(tMaskTexture, coords); + vec4 c1 = texture2D(tMaskTexture, coords + offset.xy); + vec4 c2 = texture2D(tMaskTexture, coords - offset.xy); + vec4 c3 = texture2D(tMaskTexture, coords + offset.yw); + vec4 c4 = texture2D(tMaskTexture, coords - offset.yw); + float diff1 = (c1.r - c2.r) * 0.5; + float diff2 = (c3.r - c4.r) * 0.5; + float d = length(vec2(diff1, diff2)); + if (d <= 0.0) + discard; + float a1 = min(c1.g, c2.g); + float a2 = min(c3.g, c4.g); + float visibility = min(a1, a2) > 0.001 ? 1.0 : 0.0; + float mask = c0.r; + float marker = min(c1.b, min(c2.b, min(c3.b, c4.b))); + float fogAlpha = min(c1.a, min(c2.a, min(c3.a, c4.a))); + gl_FragColor = vec4(visibility, mask, marker, fogAlpha); +} +`;var pE={enabled:C.Boolean(!0),highlightEdgeColor:C.Color(Oe.darken(Oe.fromNormalizedRgb(1,.4,.6),1)),selectEdgeColor:C.Color(Oe.darken(Oe.fromNormalizedRgb(.2,1,.1),1)),edgeScale:C.Numeric(1,{min:1,max:3,step:1},{description:"Thickness of the edge."}),highlightEdgeStrength:C.Numeric(1,{min:0,max:1,step:.1}),selectEdgeStrength:C.Numeric(1,{min:0,max:1,step:.1}),ghostEdgeStrength:C.Numeric(.3,{min:0,max:1,step:.1},{description:"Opacity of the hidden edges that are covered by other geometry. When set to 1, one less geometry render pass is done."}),innerEdgeFactor:C.Numeric(1.5,{min:0,max:3,step:.1},{description:"Factor to multiply the inner edge color with - for added contrast."})},q_=class{static isEnabled(t){return t.enabled}constructor(t,r,n){this.webgl=t,this.depthTarget=t.createRenderTarget(r,n),this.maskTarget=t.createRenderTarget(r,n),this.edgesTarget=t.createRenderTarget(r,n),this.edge=V6e(t,this.maskTarget.texture),this.overlay=j6e(t,this.edgesTarget.texture)}setEdgeState(t){let{gl:r,state:n}=this.webgl;n.enable(r.SCISSOR_TEST),n.enable(r.BLEND),n.blendFunc(r.ONE,r.ONE),n.blendEquation(r.FUNC_ADD),n.disable(r.DEPTH_TEST),n.depthMask(!1);let{x:o,y:i,width:s,height:a}=t;n.viewport(o,i,s,a),n.scissor(o,i,s,a),n.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT)}setOverlayState(t){let{gl:r,state:n}=this.webgl;n.enable(r.SCISSOR_TEST),n.enable(r.BLEND),n.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),n.blendEquation(r.FUNC_ADD),n.disable(r.DEPTH_TEST),n.depthMask(!1);let{x:o,y:i,width:s,height:a}=t;n.viewport(o,i,s,a),n.scissor(o,i,s,a)}setSize(t,r){let n=this.depthTarget.getWidth(),o=this.depthTarget.getHeight();(t!==n||r!==o)&&(this.depthTarget.setSize(t,r),this.maskTarget.setSize(t,r),this.edgesTarget.setSize(t,r),I.update(this.edge.values.uTexSizeInv,Ae.set(this.edge.values.uTexSizeInv.ref.value,1/t,1/r)),I.update(this.overlay.values.uTexSizeInv,Ae.set(this.overlay.values.uTexSizeInv.ref.value,1/t,1/r)))}update(t){let{highlightEdgeColor:r,selectEdgeColor:n,edgeScale:o,innerEdgeFactor:i,ghostEdgeStrength:s,highlightEdgeStrength:a,selectEdgeStrength:l}=t,{values:c}=this.edge,u=Math.max(1,Math.round(o*this.webgl.pixelRatio));c.dEdgeScale.ref.value!==u&&(I.update(c.dEdgeScale,u),this.edge.update());let{values:d}=this.overlay;I.update(d.uHighlightEdgeColor,Oe.toVec3Normalized(d.uHighlightEdgeColor.ref.value,r)),I.update(d.uSelectEdgeColor,Oe.toVec3Normalized(d.uSelectEdgeColor.ref.value,n)),I.updateIfChanged(d.uInnerEdgeFactor,i),I.updateIfChanged(d.uGhostEdgeStrength,s),I.updateIfChanged(d.uHighlightEdgeStrength,a),I.updateIfChanged(d.uSelectEdgeStrength,l)}render(t,r){ot&&this.webgl.timer.mark("MarkingPass.render"),this.edgesTarget.bind(),this.setEdgeState(t),this.edge.render(),r?r.bind():this.webgl.unbindFramebuffer(),this.setOverlayState(t),this.overlay.render(),ot&&this.webgl.timer.markEnd("MarkingPass.render")}},U6e=te(k({},wn),{tMaskTexture:Ct("texture","rgba","ubyte","linear"),uTexSizeInv:ye("v2"),dEdgeScale:At("number")}),z6e=Rr("edge",Nn,Mle);function V6e(e,t){let r=t.getWidth(),n=t.getHeight(),o=te(k({},An),{tMaskTexture:I.create(t),uTexSizeInv:I.create(Ae.create(1/r,1/n)),dEdgeScale:I.create(1)}),i=k({},U6e),s=Jr(e,"triangles",z6e,i,o);return en(s,o)}var G6e=te(k({},wn),{tEdgeTexture:Ct("texture","rgba","ubyte","linear"),uTexSizeInv:ye("v2"),uHighlightEdgeColor:ye("v3"),uSelectEdgeColor:ye("v3"),uHighlightEdgeStrength:ye("f"),uSelectEdgeStrength:ye("f"),uGhostEdgeStrength:ye("f"),uInnerEdgeFactor:ye("f")}),H6e=Rr("overlay",Nn,kle);function j6e(e,t){let r=t.getWidth(),n=t.getHeight(),o=te(k({},An),{tEdgeTexture:I.create(t),uTexSizeInv:I.create(Ae.create(1/r,1/n)),uHighlightEdgeColor:I.create(x()),uSelectEdgeColor:I.create(x()),uHighlightEdgeStrength:I.create(1),uSelectEdgeStrength:I.create(1),uGhostEdgeStrength:I.create(0),uInnerEdgeFactor:I.create(0)}),i=k({},G6e),s=Jr(e,"triangles",H6e,i,o);return en(s,o)}var Zb=class{setTransparency(t){t==="wboit"?(this.transparencyMode=this.wboit.supported?"wboit":"blended",$t&&!this.wboit.supported&&console.log('Missing "wboit" support, falling back to "blended".')):t==="dpoit"?(this.transparencyMode=this.dpoit.supported?"dpoit":"blended",$t&&!this.dpoit.supported&&console.log('Missing "dpoit" support, falling back to "blended".')):this.transparencyMode="blended",this.depthTextureOpaque.detachFramebuffer(this.postprocessing.target.framebuffer,"depth")}get transparency(){return this.transparencyMode}constructor(t,r,n,o,i){this.webgl=t,this.transparencyMode="blended";let{extensions:s,resources:a,isWebGL2:l}=t;this.drawTarget=Z$(t.gl),this.colorTarget=t.createRenderTarget(n,o,!0,"uint8","linear"),this.packedDepth=!s.depthTexture,this.depthTargetTransparent=t.createRenderTarget(n,o),this.depthTextureTransparent=this.depthTargetTransparent.texture,this.depthTargetOpaque=this.packedDepth?t.createRenderTarget(n,o):null,this.depthTextureOpaque=this.depthTargetOpaque?this.depthTargetOpaque.texture:a.texture("image-depth","depth",l?"float":"ushort","nearest"),this.packedDepth||this.depthTextureOpaque.define(n,o),this.wboit=new dE(t,n,o),this.dpoit=new mE(t,n,o),this.marking=new q_(t,n,o),this.postprocessing=new Il(t,r,this),this.antialiasing=new H0(t,n,o),this.bloom=new iE(t,n,o),this.dof=new gf(t,n,o),this.copyFboTarget=wh(t,this.colorTarget.texture),this.copyFboPostprocessing=wh(t,this.postprocessing.target.texture),this.setTransparency(i)}reset(){this.wboit.reset(),this.dpoit.reset()}setSize(t,r){let n=this.colorTarget.getWidth(),o=this.colorTarget.getHeight();(t!==n||r!==o)&&(this.colorTarget.setSize(t,r),this.depthTargetTransparent.setSize(t,r),this.depthTargetOpaque?this.depthTargetOpaque.setSize(t,r):this.depthTextureOpaque.define(t,r),I.update(this.copyFboTarget.values.uTexSize,Ae.set(this.copyFboTarget.values.uTexSize.ref.value,t,r)),I.update(this.copyFboPostprocessing.values.uTexSize,Ae.set(this.copyFboPostprocessing.values.uTexSize.ref.value,t,r))),this.wboit.supported&&this.wboit.setSize(t,r),this.dpoit.supported&&this.dpoit.setSize(t,r),this.marking.setSize(t,r),this.postprocessing.setSize(t,r),this.antialiasing.setSize(t,r),this.dof.setSize(t,r),this.bloom.setSize(t,r)}_renderDpoit(t,r,n,o,i,s){if(!this.dpoit.supported)throw new Error("expected dpoit to be supported");if(this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer,"depth"),t.clear(!0),n.hasOpaque&&t.renderDpoitOpaque(n.primitives,r,null),Il.isEnabled(s)&&((Il.isTransparentOutlineEnabled(s)||gf.isEnabled(s))&&(this.depthTargetTransparent.bind(),t.clearDepth(!0),n.opacityAverage<1&&t.renderDepthTransparent(n.primitives,r,this.depthTextureOpaque)),this.postprocessing.render(r,!1,i,t.props.backgroundColor,s,t.light)),this.depthTextureOpaque.detachFramebuffer(this.colorTarget.framebuffer,"depth"),n.opacityAverage<1){let a=Il.isEnabled(s)?this.postprocessing.target:this.colorTarget,l=this.dpoit.bind();t.renderDpoitTransparent(n.primitives,r,this.depthTextureOpaque,l);for(let c=0;c0&&t.renderDpoitVolume(n.volumes,r,this.depthTextureOpaque)}_renderWboit(t,r,n,o,i){if(!this.wboit.supported)throw new Error("expected wboit to be supported");this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer,"depth"),t.clear(!0),n.hasOpaque&&t.renderWboitOpaque(n.primitives,r,null),Il.isEnabled(i)&&((Il.isTransparentOutlineEnabled(i)||gf.isEnabled(i))&&(this.depthTargetTransparent.bind(),t.clearDepth(!0),n.opacityAverage<1&&t.renderDepthTransparent(n.primitives,r,this.depthTextureOpaque)),this.postprocessing.render(r,!1,o,t.props.backgroundColor,i,t.light)),(n.opacityAverage<1||n.volumes.renderables.length>0)&&(this.wboit.bind(),n.opacityAverage<1&&t.renderWboitTransparent(n.primitives,r,this.depthTextureOpaque),n.volumes.renderables.length>0&&t.renderWboitTransparent(n.volumes,r,this.depthTextureOpaque),Il.isEnabled(i)?this.postprocessing.target.bind():this.colorTarget.bind(),this.wboit.render())}_renderBlended(t,r,n,o,i,s){var a,l,c,u;if(o?this.drawTarget.bind():this.packedDepth?this.colorTarget.bind():this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer,"depth"),t.clear(!0),n.hasOpaque&&t.renderBlendedOpaque(n.primitives,r,null),!o&&(this.depthTargetOpaque&&(this.depthTargetOpaque.bind(),t.clearDepth(!0),t.renderDepthOpaque(n.primitives,r,null),this.colorTarget.bind()),Il.isEnabled(s)&&(this.packedDepth?(a=this.colorTarget.depthRenderbuffer)===null||a===void 0||a.detachFramebuffer(this.postprocessing.target.framebuffer):this.depthTextureOpaque.detachFramebuffer(this.postprocessing.target.framebuffer,"depth"),(Il.isTransparentOutlineEnabled(s)||gf.isEnabled(s))&&(this.depthTargetTransparent.bind(),t.clearDepth(!0),n.opacityAverage<1&&t.renderDepthTransparent(n.primitives,r,this.depthTextureOpaque)),this.postprocessing.render(r,!1,i,t.props.backgroundColor,s,t.light),this.packedDepth?(l=this.colorTarget.depthRenderbuffer)===null||l===void 0||l.attachFramebuffer(this.postprocessing.target.framebuffer):this.depthTextureOpaque.attachFramebuffer(this.postprocessing.target.framebuffer,"depth")),n.volumes.renderables.length>0)){let d=Il.isEnabled(s)?this.postprocessing.target:this.colorTarget;this.packedDepth?(c=this.colorTarget.depthRenderbuffer)===null||c===void 0||c.detachFramebuffer(d.framebuffer):this.depthTextureOpaque.detachFramebuffer(d.framebuffer,"depth"),d.bind(),t.renderBlendedVolume(n.volumes,r,this.depthTextureOpaque),this.packedDepth?(u=this.colorTarget.depthRenderbuffer)===null||u===void 0||u.attachFramebuffer(d.framebuffer):this.depthTextureOpaque.attachFramebuffer(d.framebuffer,"depth"),d.bind()}n.opacityAverage<1&&t.renderBlendedTransparent(n.primitives,r,null)}_render(t,r,n,o,i,s,a){var l,c;let u=n.volumes.renderables.length>0,d=Il.isEnabled(a.postprocessing),m=H0.isEnabled(a.postprocessing),p=q_.isEnabled(a.marking),h=gf.isEnabled(a.postprocessing),{x:f,y,width:g,height:v}=r.viewport;t.setViewport(f,y,g,v),t.update(r,n),s&&!m&&i&&(this.drawTarget.bind(),t.clear(!1));let b=!1;this.transparencyMode==="wboit"&&this.wboit.supported?(this._renderWboit(t,r,n,s,a.postprocessing),b=!0):this.transparencyMode==="dpoit"&&this.dpoit.supported?(this._renderDpoit(t,r,n,a.dpoitIterations,s,a.postprocessing),b=!0):this._renderBlended(t,r,n,!u&&!d&&!m&&i,s,a.postprocessing);let S=d?this.postprocessing.target:!i||u||b?this.colorTarget:this.drawTarget;if(p&&n.markerAverage>0){let w=a.marking.ghostEdgeStrength<1;w&&n.markerAverage!==1&&(this.marking.depthTarget.bind(),t.clear(!1,!0),t.renderMarkingDepth(n.primitives,r,null)),this.marking.maskTarget.bind(),t.clear(!1,!0),t.renderMarkingMask(n.primitives,r,w?this.marking.depthTarget.texture:null),this.marking.update(a.marking),this.marking.render(r.viewport,S)}else S.bind();o.debug.isEnabled&&(o.debug.syncVisibility(),t.renderBlended(o.debug.scene,r)),o.handle.isEnabled&&t.renderBlended(o.handle.scene,r),o.camera.isEnabled&&(o.camera.update(r),t.update(o.camera.camera,o.camera.scene),t.renderBlended(o.camera.scene,o.camera.camera));let _=!1;if(m){let w=Il.isEnabled(a.postprocessing)?this.postprocessing.target.texture:this.colorTarget.texture;this.antialiasing.render(r,w,i&&!h,a.postprocessing)}else i&&!gf.isEnabled(a.postprocessing)&&(_=!0);if(a.postprocessing.dof.name==="on"){let w=H0.isEnabled(a.postprocessing)?this.antialiasing.target.texture:Il.isEnabled(a.postprocessing)?this.postprocessing.target.texture:this.colorTarget.texture;this.dof.update(r,w,((l=this.depthTargetOpaque)===null||l===void 0?void 0:l.texture)||this.depthTextureOpaque,this.depthTextureTransparent,a.postprocessing.dof.params,n.boundingSphereVisible),this.dof.render(r.viewport,i?void 0:this.getColorTarget(a.postprocessing))}else i&&!H0.isEnabled(a.postprocessing)&&(_=!0);if(_&&(this.drawTarget.bind(),this.webgl.state.disable(this.webgl.gl.DEPTH_TEST),d?this.copyFboPostprocessing.render():(u||b)&&this.copyFboTarget.render()),a.postprocessing.bloom.name==="on"){let w=a.postprocessing.bloom.params.mode==="emissive";w&&n.emissiveAverage>0&&(this.bloom.emissiveTarget.bind(),t.clear(!1,!0),t.update(r,n),t.renderEmissive(n.primitives,r,null)),(!w||n.emissiveAverage>0)&&(this.bloom.update(this.colorTarget.texture,this.bloom.emissiveTarget.texture,((c=this.depthTargetOpaque)===null||c===void 0?void 0:c.texture)||this.depthTextureOpaque,a.postprocessing.bloom.params),this.bloom.render(r.viewport,i?void 0:this.getColorTarget(a.postprocessing)))}this.webgl.gl.flush()}render(t,r,n){ot&&this.webgl.timer.mark("DrawPass.render");let{renderer:o,camera:i,scene:s,helper:a}=t;this.postprocessing.setTransparentBackground(r.transparentBackground);let l=r.transparentBackground||this.postprocessing.background.isEnabled(r.postprocessing.background);o.setTransparentBackground(l),o.setDrawingBufferSize(this.colorTarget.getWidth(),this.colorTarget.getHeight()),o.setPixelRatio(this.webgl.pixelRatio),fp.is(i)?(ot&&this.webgl.timer.mark("StereoCamera.left"),this._render(o,i.left,s,a,n,l,r),ot&&this.webgl.timer.markEnd("StereoCamera.left"),ot&&this.webgl.timer.mark("StereoCamera.right"),this._render(o,i.right,s,a,n,l,r),ot&&this.webgl.timer.markEnd("StereoCamera.right")):this._render(o,i,s,a,n,l,r),ot&&this.webgl.timer.markEnd("DrawPass.render")}getColorTarget(t){return gf.isEnabled(t)?this.dof.target:H0.isEnabled(t)?this.antialiasing.target:Il.isEnabled(t)?this.postprocessing.target:this.colorTarget}};var q6e={alpha:C.Numeric(.51,{min:0,max:1,step:.01},{isEssential:!0,label:"Opacity"}),colorX:C.Color(Yt.red,{isEssential:!0}),colorY:C.Color(Yt.green,{isEssential:!0}),colorZ:C.Color(Yt.blue,{isEssential:!0}),scale:C.Numeric(.33,{min:.1,max:2,step:.1},{isEssential:!0}),location:C.Select("bottom-left",C.arrayToOptions(["bottom-left","bottom-right","top-left","top-right"])),locationOffsetX:C.Numeric(0),locationOffsetY:C.Numeric(0),originColor:C.Color(Yt.grey),radiusScale:C.Numeric(.075,{min:.01,max:.3,step:.001}),showPlanes:C.Boolean(!0),planeColorXY:C.Color(Yt.grey,{label:"Plane Color XY"}),planeColorXZ:C.Color(Yt.grey,{label:"Plane Color XZ"}),planeColorYZ:C.Color(Yt.grey,{label:"Plane Color YZ"}),showLabels:C.Boolean(!1),labelX:C.Text("X"),labelY:C.Text("Y"),labelZ:C.Text("Z"),labelColorX:C.Color(Yt.grey),labelColorY:C.Color(Yt.grey),labelColorZ:C.Color(Yt.grey),labelOpacity:C.Numeric(1,{min:0,max:1,step:.01}),labelScale:C.Numeric(.25,{min:.1,max:1,step:.01})},j0={axes:C.MappedStatic("on",{on:C.Group(q6e),off:C.Group({})},{cycle:!0,description:"Show camera orientation axes"})},$b=class{constructor(t,r={}){this.webgl=t,this.props={axes:{name:"off",params:{}}},this.pixelRatio=1,this.eachGroup=(n,o)=>{if(!fE(n))return!1;let i=!1;if(this.meshRenderObject){let s=this.meshRenderObject.values.uGroupCount.ref.value;for(let{groupId:a,instanceId:l}of n.elements){let c=l*s+a;o(ve.ofSingleton(c))&&(i=!0)}}if(this.textRenderObject){let s=this.textRenderObject.values.uGroupCount.ref.value;for(let{groupId:a,instanceId:l}of n.elements){let c=l*s+a;o(ve.ofSingleton(c))&&(i=!0)}}return i},this.scene=hf.create(t,"blended"),this.camera=new co,x.set(this.camera.up,0,1,0),x.set(this.camera.target,0,0,0),this.setProps(r)}setProps(t){this.props=wl(this.props,r=>{if(t.axes!==void 0&&(r.axes.name=t.axes.name,t.axes.name==="on")){this.scene.clear(),this.pixelRatio=this.webgl.pixelRatio;let n=te(k({},t.axes.params),{scale:t.axes.params.scale*this.pixelRatio,labelScale:t.axes.params.labelScale*this.pixelRatio});this.meshRenderObject=Z6e(n),this.scene.add(this.meshRenderObject),t.axes.params.showLabels?(this.textRenderObject=eUe(n),this.scene.add(this.textRenderObject)):this.textRenderObject=void 0,this.scene.commit(),x.set(this.camera.position,0,0,n.scale*200),ne.lookAt(this.camera.view,this.camera.position,this.camera.target,this.camera.up),r.axes.params=k({},t.axes.params)}})}get isEnabled(){return this.props.axes.name==="on"}getLoci(t){let{objectId:r,groupId:n,instanceId:o}=t;return(!this.meshRenderObject||r!==this.meshRenderObject.id)&&(!this.textRenderObject||r!==this.textRenderObject.id)||n===Wn.None?nr:Y6e(this,n,o)}mark(t,r){return!Fo.is(Fo.Highlighting,r)||!Fi(t)&&(!fE(t)||t.data!==this)?!1:Sr.mark(this.meshRenderObject,t,r,this.eachGroup)||Sr.mark(this.textRenderObject,t,r,this.eachGroup)}update(t){if(!this.meshRenderObject||this.props.axes.name==="off")return;this.pixelRatio!==this.webgl.pixelRatio&&this.setProps(this.props),X6e(this.camera,t.viewport,t.viewOffset),ne.extractRotation(this.scene.view,t.view);let r=this.textRenderObject?this.textRenderObject.values.boundingSphere.ref.value.radius:this.meshRenderObject.values.boundingSphere.ref.value.radius,n=this.props.axes.params.location,o=this.props.axes.params.locationOffsetX*this.pixelRatio,i=this.props.axes.params.locationOffsetY*this.pixelRatio;n==="bottom-left"?ne.setTranslation(this.scene.view,x.create(-t.viewport.width/2+r+o,-t.viewport.height/2+r+i,0)):n==="bottom-right"?ne.setTranslation(this.scene.view,x.create(t.viewport.width/2-r-o,-t.viewport.height/2+r+i,0)):n==="top-left"?ne.setTranslation(this.scene.view,x.create(-t.viewport.width/2+r+o,t.viewport.height/2-r-i,0)):n==="top-right"?ne.setTranslation(this.scene.view,x.create(t.viewport.width/2-r-o,t.viewport.height/2-r-i,0)):_r(n)}},Wn=function(e){return e[e.None=0]="None",e[e.X=1]="X",e[e.Y=2]="Y",e[e.Z=3]="Z",e[e.XY=4]="XY",e[e.XZ=5]="XZ",e[e.YZ=6]="YZ",e[e.Origin=7]="Origin",e}(Wn||{});function W6e(e,t){let r=t.props.axes,n=r.name==="on"?r.params.labelX:"X",o=r.name==="on"?r.params.labelY:"Y",i=r.name==="on"?r.params.labelZ:"Z";switch(e){case Wn.X:return`${n} Axis`;case Wn.Y:return`${o} Axis`;case Wn.Z:return`${i} Axis`;case Wn.XY:return`${n}${o} Plane`;case Wn.XZ:return`${n}${i} Plane`;case Wn.YZ:return`${o}${i} Plane`;case Wn.Origin:return"Origin";default:return"Axes"}}function Y6e(e,t,r){return l0("camera-axes",e,[{groupId:t,instanceId:r}],void 0,()=>W6e(t,e))}function fE(e){return e.kind==="data-loci"&&e.tag==="camera-axes"}function X6e(e,t,r){let{near:n,far:o}=e,i=-t.width/2,s=t.width/2,a=t.height/2,l=-t.height/2,c=(s-i)/2,u=(a-l)/2,d=(s+i)/2,m=(a+l)/2,p=d-c,h=d+c,f=m+u,y=m-u;if(r.enabled){let g=(s-i)/r.width,v=(a-l)/r.height;p+=g*r.offsetX,h=p+g*r.width,f-=v*r.offsetY,y=f-v*r.height}ne.ortho(e.projection,p,h,f,y,n,o)}function K6e(e,t){let r=rt.createState(512,256,t),n=100*e.scale,o=e.radiusScale*n,i=e.showLabels?100*e.labelScale/3:0,s=x.scale(x(),x.unitX,n-i),a=x.scale(x(),x.unitY,n-i),l=x.scale(x(),x.unitZ,n-i),c={radiusTop:o,radiusBottom:o,radialSegments:32};if(r.currentGroup=Wn.Origin,Nr(r,x.origin,o,2),r.currentGroup=Wn.X,Nr(r,s,o,2),Gr(r,x.origin,s,1,c),r.currentGroup=Wn.Y,Nr(r,a,o,2),Gr(r,x.origin,a,1,c),r.currentGroup=Wn.Z,Nr(r,l,o,2),Gr(r,x.origin,l,1,c),e.showPlanes){x.scale(s,s,.5),x.scale(a,a,.5),x.scale(l,l,.5),r.currentGroup=Wn.XY,rt.addTriangle(r,x.origin,s,a),rt.addTriangle(r,x.origin,a,s);let u=x.add(x(),s,a);rt.addTriangle(r,u,s,a),rt.addTriangle(r,u,a,s),r.currentGroup=Wn.XZ,rt.addTriangle(r,x.origin,s,l),rt.addTriangle(r,x.origin,l,s);let d=x.add(x(),s,l);rt.addTriangle(r,d,s,l),rt.addTriangle(r,d,l,s),r.currentGroup=Wn.YZ,rt.addTriangle(r,x.origin,a,l),rt.addTriangle(r,x.origin,l,a);let m=x.add(x(),a,l);rt.addTriangle(r,m,a,l),rt.addTriangle(r,m,l,a)}return rt.getMesh(r)}function Q6e(e,t){let r=100*e.scale,n=K6e(e,t?.geometry);n.setBoundingSphere(ge.create(x.create(r/2,r/2,r/2),r+r/4));let o=i=>{switch(i){case Wn.X:return e.colorX;case Wn.Y:return e.colorY;case Wn.Z:return e.colorZ;case Wn.XY:return e.planeColorXY;case Wn.XZ:return e.planeColorXZ;case Wn.YZ:return e.planeColorYZ;case Wn.Origin:return e.originColor;default:return Yt.grey}};return Dr.create("axes-mesh",{},n,o,()=>1,()=>"")}function Z6e(e){let t=Q6e(e);return Dr.createRenderObject(t,te(k(k({},C.getDefaultValues(dt.Params)),e),{ignoreLight:!0,cellSize:0}))}function $6e(e,t){let r=Kl.create(e,8,8,t),n=100*e.scale,o=x.scale(x(),x.unitX,n),i=x.scale(x(),x.unitY,n),s=x.scale(x(),x.unitZ,n),a=100*e.labelScale;return r.add(e.labelX,o[0],o[1],o[2],0,a,Wn.X),r.add(e.labelY,i[0],i[1],i[2],0,a,Wn.Y),r.add(e.labelZ,s[0],s[1],s[2],0,a,Wn.Z),r.getText()}function J6e(e,t){let r=100*e.scale,n=$6e(e,t?.geometry);n.setBoundingSphere(ge.create(x.create(r/2,r/2,r/2),r));let o=i=>{switch(i){case Wn.X:return e.labelColorX;case Wn.Y:return e.labelColorY;case Wn.Z:return e.labelColorZ;default:return Yt.grey}};return Dr.create("axes-text",{},n,o,()=>1,()=>"")}function eUe(e){let t=J6e(e);return Dr.createRenderObject(t,te(k(k({},C.getDefaultValues(Zi.Params)),e),{alpha:e.labelOpacity,cellSize:0}))}var tUe={transparentBackground:C.Boolean(!1),dpoitIterations:C.Numeric(2,{min:1,max:10,step:1}),multiSample:C.Group(aE),postprocessing:C.Group(Kb),marking:C.Group(pE),cameraHelper:C.Group(j0)},hE=class{get colorTarget(){return this._colorTarget}get width(){return this._width}get height(){return this._height}constructor(t,r,n,o,i,s,a,l){this.webgl=t,this.renderer=n,this.scene=o,this.camera=i,this._width=0,this._height=0,this._camera=new co,this.props=k(k({},C.getDefaultValues(tUe)),l),this.drawPass=new Zb(t,r,128,128,a),this.multiSamplePass=new zh(t,this.drawPass),this.multiSampleHelper=new Qb(this.multiSamplePass),this.helper={camera:new $b(t,this.props.cameraHelper),debug:s.debug,handle:s.handle},this.setSize(1024,768)}updateBackground(){return new Promise(t=>{this.drawPass.postprocessing.background.update(this.camera,this.props.postprocessing.background,()=>{t()})})}setSize(t,r){t===this._width&&r===this._height||(this._width=t,this._height=r,this.drawPass.setSize(t,r),this.multiSamplePass.syncSize())}setProps(t={}){Object.assign(this.props,t),t.cameraHelper&&this.helper.camera.setProps(t.cameraHelper)}render(){co.copySnapshot(this._camera.state,this.camera.state),Io.set(this._camera.viewport,0,0,this._width,this._height),this._camera.update();let t={renderer:this.renderer,camera:this._camera,scene:this.scene,helper:this.helper};zh.isEnabled(this.props.multiSample)?(this.multiSampleHelper.render(t,this.props,!1),this._colorTarget=this.multiSamplePass.colorTarget):(this.drawPass.render(t,this.props,!1),this._colorTarget=this.drawPass.getColorTarget(this.props.postprocessing))}getImageData(t,r,n){var o,i;this.setSize(t,r),this.render(),this.colorTarget.bind();let s=(o=n?.width)!==null&&o!==void 0?o:t,a=(i=n?.height)!==null&&i!==void 0?i:r,l=new Uint8Array(s*a*4);n?this.webgl.readPixels(n.x,r-n.y-n.height,s,a,l):this.webgl.readPixels(0,0,s,a,l);let c=vh.create(l,s,a);return vh.flipY(c),vh.divideByAlpha(c),new ImageData(new Uint8ClampedArray(l),s,a)}};var rUe=te(k({},dt.Params),{alpha:te(k({},dt.Params.alpha),{defaultValue:1}),ignoreLight:te(k({},dt.Params.ignoreLight),{defaultValue:!0}),colorX:C.Color(Yt.red,{isEssential:!0}),colorY:C.Color(Yt.green,{isEssential:!0}),colorZ:C.Color(Yt.blue,{isEssential:!0}),scale:C.Numeric(.33,{min:.1,max:2,step:.1},{isEssential:!0})}),yE={handle:C.MappedStatic("off",{on:C.Group(rUe),off:C.Group({})},{cycle:!0,description:"Show handle tool"})},gE=class{getBoundingSphere(t,r){return this.renderObject&&(ge.copy(t,this.renderObject.values.invariantBoundingSphere.ref.value),ne.fromArray(this._transform,this.renderObject.values.aTransform.ref.value,r*16),ge.transform(t,t,this._transform)),t}setProps(t){this.props=wl(this.props,r=>{if(t.handle!==void 0&&(r.handle.name=t.handle.name,t.handle.name==="on")){this.scene.clear(),this.pixelRatio=this.webgl.pixelRatio;let n=te(k({},t.handle.params),{scale:t.handle.params.scale*this.webgl.pixelRatio,cellSize:0});this.renderObject=sUe(n),this.scene.add(this.renderObject),this.scene.commit(),r.handle.params=k({},t.handle.params)}})}get isEnabled(){return this.props.handle.name==="on"}update(t,r,n){this.renderObject&&(this.pixelRatio!==this.webgl.pixelRatio&&this.setProps(this.props),ne.setTranslation(this.renderObject.values.aTransform.ref.value,r),ne.fromMat3(this.renderObject.values.aTransform.ref.value,n),I.update(this.renderObject.values.aTransform,this.renderObject.values.aTransform.ref.value),this.scene.update([this.renderObject],!0))}getLoci(t){let{objectId:r,groupId:n,instanceId:o}=t;return!this.renderObject||r!==this.renderObject.id?nr:oUe(this,n,o)}mark(t,r){return!Fo.is(Fo.Highlighting,r)||!Fi(t)&&(!Ble(t)||t.data!==this)?!1:Sr.mark(this.renderObject,t,r,this.eachGroup)}constructor(t,r={}){this.webgl=t,this.props={handle:{name:"off",params:{}}},this.pixelRatio=1,this._transform=ne(),this.eachGroup=(n,o)=>{if(!this.renderObject||!Ble(n))return!1;let i=!1,s=this.renderObject.values.uGroupCount.ref.value,{elements:a}=n;for(let{groupId:l,instanceId:c}of a){let u=c*s+l;o(ve.ofSingleton(u))&&(i=!0)}return i},this.scene=hf.create(t,"blended"),this.setProps(r)}};function nUe(e,t){let r=rt.createState(512,256,t),n=.05*e,o=x.scale(x(),x.unitX,e),i=x.scale(x(),x.unitY,e),s=x.scale(x(),x.unitZ,e),a={radiusTop:n,radiusBottom:n,radialSegments:32};return r.currentGroup=$1.TranslateScreenXY,Nr(r,x.origin,n*3,2),r.currentGroup=$1.TranslateObjectX,Nr(r,o,n,2),Gr(r,x.origin,o,1,a),r.currentGroup=$1.TranslateObjectY,Nr(r,i,n,2),Gr(r,x.origin,i,1,a),r.currentGroup=$1.TranslateObjectZ,Nr(r,s,n,2),Gr(r,x.origin,s,1,a),rt.getMesh(r)}var $1={None:0,TranslateScreenXY:1,TranslateObjectX:3,TranslateObjectY:4,TranslateObjectZ:5};function oUe(e,t,r){return l0("handle",e,[{groupId:t,instanceId:r}],n=>e.getBoundingSphere(n,r),()=>`Handle Helper | Group Id ${t} | Instance Id ${r}`)}function Ble(e){return e.kind==="data-loci"&&e.tag==="handle"}function iUe(e,t){let r=10*e.scale,n=nUe(r,t?.geometry);n.setBoundingSphere(ge.create(x.create(r/2,r/2,r/2),r+r/4));let o=i=>{switch(i){case $1.TranslateObjectX:return e.colorX;case $1.TranslateObjectY:return e.colorY;case $1.TranslateObjectZ:return e.colorZ;default:return Yt.grey}};return Dr.create("handle",{},n,o,()=>1,()=>"")}function sUe(e){let t=iUe(e);return Dr.createRenderObject(t,e)}var aUe={debug:C.Group(H_),camera:C.Group({helper:C.Group(j0)}),handle:C.Group(yE)},lUe=C.getDefaultValues(aUe),vE=class{constructor(t,r,n={}){let o=k(k({},lUe),n);this.debug=new JI(t,r,o.debug),this.camera=new $b(t,o.camera.helper),this.handle=new gE(t,o.handle)}};var xE=class{constructor(t,r,n={}){this.webgl=t;let{gl:o}=t;this.draw=new Zb(t,r,o.drawingBufferWidth,o.drawingBufferHeight,n.transparency||"blended"),this.pick=new cE(t,this.draw,n.pickScale||.25),this.multiSample=new zh(t,this.draw)}setPickScale(t){this.pick.setPickScale(t)}setTransparency(t){this.draw.setTransparency(t)}updateSize(){let{gl:t}=this.webgl,r=Math.max(t.drawingBufferWidth,2),n=Math.max(t.drawingBufferHeight,2);this.draw.setSize(r,n),this.pick.syncSize(),this.multiSample.syncSize()}};var Rle=` +precision highp float; +precision highp sampler2D; + +uniform sampler2D tPreviousLevel; +uniform vec2 uInvSize; +uniform vec2 uOffset; + +void main(void) { + vec2 position = gl_FragCoord.xy * uInvSize + uOffset; + + float x = texture(tPreviousLevel, position).r; + float y = textureOffset(tPreviousLevel, position, ivec2(-1, 0)).r; + float z = textureOffset(tPreviousLevel, position, ivec2(-1, -1)).r; + float w = textureOffset(tPreviousLevel, position, ivec2(0, -1)).r; + + gl_FragColor = vec4(max(max(x, y), max(z, w))); +} +`;var cUe=te(k({},wn),{tPreviousLevel:Ct("texture","alpha","float","nearest"),uInvSize:ye("v2"),uOffset:ye("v2")}),uUe=Rr("hi-z",Nn,Rle);function Lle(e,t){let r=te(k({},An),{tPreviousLevel:I.create(t),uInvSize:I.create(Ae()),uOffset:I.create(Ae())}),n=k({},cUe),o=Jr(e,"triangles",uUe,n,r);return en(o,r)}var Fle=new ArrayBuffer(4),lir=new Int32Array(Fle),cir=new Float32Array(Fle);var Ole=new ArrayBuffer(4),dUe=new Int32Array(Ole),mUe=new Float32Array(Ole);function pUe(e){let t=e<-126?-126:e;return dUe[0]=(1<<23)*(t+126.94269504),mUe[0]}function Nle(e){return pUe(1.44269504*e)}var Ule=new ArrayBuffer(8),uir=new Int32Array(Ule),dir=new Float32Array(Ule);var zle=new ArrayBuffer(4),fUe=new Int32Array(zle),hUe=new Float32Array(zle);function Vle(e){return hUe[0]=e,fUe[0]*11920928955078125e-23-126.94269504}var mir=Math.PI/2,pir=2*Math.PI,fir=1/(2*Math.PI),hir=2/Math.PI,gir=4/Math.PI,yir=4/(Math.PI*Math.PI),vir=Math.PI/2-2*Math.PI;var Gle=new ArrayBuffer(16),xir=new Int32Array(Gle),bir=new Float32Array(Gle);var Hle=new ArrayBuffer(8),Sir=new Int32Array(Hle),Cir=new Float32Array(Hle);var jle=new ArrayBuffer(4),_ir=new Int32Array(jle),wir=new Float32Array(jle);var Air=Math.PI/4;var gUe=x.transformMat4,qle=Rt.set,yUe=Vle;function vUe(e,t,r){return t*r/((r-t)*e-r)}function xUe(e,t,r){return e*(t-r)-t}function bE(e,t,r,n){return n[11]===-1?vUe(e,t,r):xUe(e,t,r)}function bUe(e,t,r,n){let o=t[0]*r,i=t[1]*r,s=t[2]*r,a=t[2]*t[2]-r*r,l=Math.sqrt(t[0]*t[0]+a),c=(l*t[0]-s)/(l*t[2]+o)*n[0],u=(l*t[0]+s)/(l*t[2]-o)*n[0],d=Math.sqrt(t[1]*t[1]+a),m=(d*t[1]-s)/(d*t[2]+i)*n[5],p=(d*t[1]+s)/(d*t[2]-i)*n[5];return qle(e,u*-.5+.5,m*.5+.5,c*-.5+.5,p*.5+.5)}function SUe(e,t,r,n){let o=n[0],i=n[5],s=(t[0]+r)*o,a=(t[0]-r)*o,l=(t[1]+r)*i,c=(t[1]-r)*i;return qle(e,a*.5+.5,l*-.5+.5,s*.5+.5,c*-.5+.5)}function CUe(e,t,r,n){return n[11]===-1?bUe(e,t,r,n):SUe(e,t,r,n)}var f6={enabled:C.Boolean(!1,{description:"Hierarchical Z-buffer occlusion culling. Only available for WebGL2."}),maxFrameLag:C.Numeric(10,{min:1,max:30,step:1},{description:"Maximum number of frames to wait for Z-buffer data."}),minLevel:C.Numeric(3,{min:1,max:10,step:1})},SE=class{clear(){if(!this.supported)return;let{gl:t}=this.webgl;Wt(t)&&(this.sync!==null&&(t.deleteSync(this.sync),this.sync=null),this.frameLag=0,this.ready=!1,this.debug&&(this.debug.rect.style.display="none",this.debug.container.style.display="none"))}render(t){if(!this.supported||!this.props.enabled)return;let{gl:r,state:n}=this.webgl;if(!Wt(r)||this.sync!==null)return;this.nextNear=t.near,this.nextFar=t.far,ne.copy(this.nextView,t.view),ne.copy(this.nextProjection,t.projection),ot&&this.webgl.timer.mark("hi-Z"),n.disable(r.CULL_FACE),n.disable(r.BLEND),n.disable(r.DEPTH_TEST),n.disable(r.SCISSOR_TEST),n.depthMask(!1),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0);let o=this.renderable.values,i=Math.pow(2,Math.ceil(Math.log(Math.max(r.drawingBufferWidth,r.drawingBufferHeight))/Math.log(2))-1);for(let l=0,c=this.levelData.length;l0?(I.update(o.uInvSize,u.invSize),I.update(o.uOffset,Ae.set(o.uOffset.ref.value,0,0)),I.update(o.tPreviousLevel,this.levelData[l-1].texture)):(I.update(o.uInvSize,Ae.set(o.uInvSize.ref.value,1/i,1/i)),I.update(o.uOffset,Ae.set(o.uOffset.ref.value,this.viewport.x/r.drawingBufferWidth,this.viewport.y/r.drawingBufferHeight)),I.update(o.tPreviousLevel,this.drawPass.depthTextureOpaque)),n.currentRenderItemId=-1,n.viewport(0,0,u.size[0],u.size[1]),r.clear(r.COLOR_BUFFER_BIT),this.renderable.update(),this.renderable.render(),l>=this.props.minLevel&&(this.tex.bind(0),r.copyTexSubImage2D(r.TEXTURE_2D,0,u.offset,0,0,0,u.size[0],u.size[1]),this.tex.unbind(0))}this.tex.attachFramebuffer(this.fb,0);let s=this.tex.getWidth(),a=this.tex.getHeight();r.bindBuffer(r.PIXEL_PACK_BUFFER,this.buf),r.bufferData(r.PIXEL_PACK_BUFFER,this.buffer.byteLength,r.STREAM_READ),r.readPixels(0,0,s,a,r.RED,r.FLOAT,0),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),this.sync=r.fenceSync(r.SYNC_GPU_COMMANDS_COMPLETE,0),r.flush(),ot&&this.webgl.timer.markEnd("hi-Z")}tick(){if(!this.supported||!this.props.enabled||this.sync===null)return;let{gl:t}=this.webgl;if(!Wt(t))return;let r=t.clientWaitSync(this.sync,0,0);r===t.WAIT_FAILED||this.frameLag>=this.props.maxFrameLag?(t.deleteSync(this.sync),this.sync=null,this.frameLag=0,this.ready=!1):r===t.TIMEOUT_EXPIRED?this.frameLag+=1:(t.bindBuffer(t.PIXEL_PACK_BUFFER,this.buf),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this.buffer),t.bindBuffer(t.PIXEL_PACK_BUFFER,null),t.deleteSync(this.sync),this.sync=null,this.frameLag=0,this.ready=!0,this.near=this.nextNear,this.far=this.nextFar,ne.copy(this.view,this.nextView),ne.copy(this.projection,this.nextProjection))}transform(t){let{view:r,vp:n}=this;gUe(n,t.center,r);let o=t.radius*1.2+1.52;return{vp:n,r:o}}project(t,r){let{projection:n,aabb:o,viewport:i}=this;CUe(o,t,r,n);let s=o[2]-o[0],a=o[3]-o[1],l=Math.max(s*i.width,a*i.height),c=Math.ceil(yUe(l/2));return{aabb:o,w:s,h:a,pr:l,lod:c}}setViewport(t,r,n,o){if(!this.supported)return;n=Math.max(n,2),o=Math.max(o,2),Io.set(this.viewport,t,r,n,o);let i=Math.ceil(Math.log(Math.max(n,o))/Math.log(2));if(i===this.levelData.length)return;let{minLevel:s}=this.props;this.buffer=new Float32Array(Math.pow(2,i-s)*Math.pow(2,i-1-s)),this.tex.define(Math.pow(2,i-s),Math.pow(2,i-1-s));for(let l of this.levelData)l.framebuffer.destroy(),l.texture.destroy();this.levelData.length=0;for(let l=0;l=s&&(this.levelData[l].offset=a,a+=u.size[0])}this.clear()}setProps(t){if(this.supported)if(this.props.minLevel!==t.minLevel){Object.assign(this.props,t);let{x:r,y:n,width:o,height:i}=this.viewport;this.setViewport(r,n,o,i)}else Object.assign(this.props,t),this.props.enabled||this.clear()}initDebug(t){if(!t.parentElement)return;let r=document.createElement("div");Object.assign(r.style,{display:"block",position:"absolute",pointerEvents:"none"}),t.parentElement.appendChild(r);let n=document.createElement("canvas"),o=n.getContext("2d");if(!o)throw new Error("Could not create canvas 2d context");Object.assign(n.style,{width:"100%",height:"100%",imageRendering:"pixelated",position:"relative",pointerEvents:"none"}),r.appendChild(n);let i=document.createElement("div");Object.assign(i.style,{display:"none",position:"absolute",pointerEvents:"none"}),t.parentElement.appendChild(i),this.debug={container:r,canvas:n,ctx:o,rect:i}}canDebug(t){return this.supported&&this.props.enabled&&this.ready&&!!this.debug}showRect(t,r){if(!this.canDebug(this.debug))return;let{gl:{drawingBufferHeight:n},pixelRatio:o}=this.webgl,{viewport:{x:i,y:s,width:a,height:l}}=this,c=(t[0]*a+i)/o,u=(t[1]*l-s)/o,d=(t[2]*a+i)/o,m=(t[3]*l-s)/o,p=(n-l)/o;Object.assign(this.debug.rect.style,{border:r?"solid red":"solid green",display:"block",left:`${c}px`,top:`${u+p}px`,width:`${d-c}px`,height:`${m-u}px`})}showBuffer(t){if(!this.canDebug(this.debug))return;if(t>=this.levelData.length||t{if(!this.supported||!this.props.enabled||!this.ready)return!1;let{vp:u,r:d}=this.transform(c),{near:m,far:p,projection:h}=this,f=u[2]+d;if(-f=this.levelData.length||b=A||D+1>=A)return!1;let R=(A-D-1)*M+B+S;if(f>bE(this.buffer[R],m,p,h)||f>bE(this.buffer[R+1],m,p,h))return!1;let U=(A-D+1-1)*M+B+S;return!(f>bE(this.buffer[U],m,p,h)||f>bE(this.buffer[U+1],m,p,h))};let{gl:i,extensions:s}=t;if(!Wt(i)||!s.colorBufferFloat){$t&&console.log('Missing webgl2 and/or colorBufferFloat support required for "Hi-Z"'),this.supported=!1;return}this.fb=t.resources.framebuffer(),this.tex=t.resources.texture("image-float32","alpha","float","nearest"),this.tex.attachFramebuffer(this.fb,0);let a=i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT),l=i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE);if(a!==i.RED||l!==i.FLOAT){$t&&console.log('Missing red/float reading support required for "Hi-Z"'),this.supported=!1;return}this.supported=!0,this.props=k(k({},C.getDefaultValues(f6)),o),this.buf=SP(i),this.renderable=Lle(t,this.drawPass.depthTextureOpaque),$t&&n&&this.initDebug(n)}};var ol={camera:C.Group({mode:C.Select("perspective",C.arrayToOptions(["perspective","orthographic"]),{label:"Camera"}),helper:C.Group(j0,{isFlat:!0}),stereo:C.MappedStatic("off",{on:C.Group(m6),off:C.Group({})},{cycle:!0,hideIf:e=>e?.mode!=="perspective"}),fov:C.Numeric(45,{min:10,max:130,step:1},{label:"Field of View"}),manualReset:C.Boolean(!1,{isHidden:!0})},{pivot:"mode"}),cameraFog:C.MappedStatic("on",{on:C.Group({intensity:C.Numeric(15,{min:1,max:100,step:1})}),off:C.Group({})},{cycle:!0,description:"Show fog in the distance"}),cameraClipping:C.Group({radius:C.Numeric(100,{min:0,max:99,step:1},{label:"Clipping",description:"How much of the scene to show."}),far:C.Boolean(!0,{description:"Hide scene in the distance"}),minNear:C.Numeric(5,{min:.1,max:100,step:.1},{description:"Note, may cause performance issues rendering impostors when set too small and cause issues with outline rendering when too close to 0."})},{pivot:"radius"}),viewport:C.MappedStatic("canvas",{canvas:C.Group({}),"static-frame":C.Group({x:C.Numeric(0),y:C.Numeric(0),width:C.Numeric(128),height:C.Numeric(128)}),"relative-frame":C.Group({x:C.Numeric(.33,{min:0,max:1,step:.01}),y:C.Numeric(.33,{min:0,max:1,step:.01}),width:C.Numeric(.5,{min:.01,max:1,step:.01}),height:C.Numeric(.5,{min:.01,max:1,step:.01})})}),cameraResetDurationMs:C.Numeric(250,{min:0,max:1e3,step:1},{description:"The time it takes to reset the camera."}),sceneRadiusFactor:C.Numeric(1,{min:1,max:10,step:.1}),transparentBackground:C.Boolean(!1),dpoitIterations:C.Numeric(2,{min:1,max:10,step:1}),pickPadding:C.Numeric(3,{min:0,max:10,step:1},{description:"extra pixels to around target to check in case target is empty"}),multiSample:C.Group(aE),postprocessing:C.Group(Kb),marking:C.Group(pE),hiZ:C.Group(f6),renderer:C.Group(YI),trackball:C.Group(i6),interaction:C.Group(l6),debug:C.Group(H_),handle:C.Group(yE)},W_=C.getDefaultValues(ol);var hp;(function(e){e.DefaultAttribs={powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,antialias:!0,preserveDrawingBuffer:!0,preferWebGl1:!1,handleResize:()=>{}},e.Params={pixelScale:C.Numeric(1,{min:.1,max:2,step:.05}),pickScale:C.Numeric(.25,{min:.1,max:1,step:.05}),transparency:C.Select("wboit",[["blended","Blended"],["wboit","Weighted, Blended"],["dpoit","Depth Peeling"]])},e.DefaultProps=C.getDefaultValues(e.Params);function t(r,n,o={},i={}){let s=k(k({},e.DefaultAttribs),o),a=k(k({},e.DefaultProps),i),{powerPreference:l,failIfMajorPerformanceCaveat:c,antialias:u,preserveDrawingBuffer:d,preferWebGl1:m}=s,p=eJ(r,{powerPreference:l,failIfMajorPerformanceCaveat:c,antialias:u,preserveDrawingBuffer:d,alpha:!0,depth:!0,premultipliedAlpha:!0,preferWebGl1:m});if(p===null)throw new Error("Could not create a WebGL rendering context");let{pixelScale:h,pickScale:f,transparency:y}=a,g=qI.fromElement(r,{pixelScale:h,preventGestures:!0}),v=iJ(p,{pixelScale:h}),b=new xE(v,n,{pickScale:f,transparency:y});if($t){let A=p.getExtension("WEBGL_lose_context");A&&r.addEventListener("mousedown",P=>{v.isContextLost||!P.shiftKey||!P.ctrlKey||!P.altKey||($t&&console.log("lose context"),A.loseContext(),setTimeout(()=>{v.isContextLost&&($t&&console.log("restore context"),A.restoreContext())},1e3))},!1)}let S=new Zs(0),_=A=>{v.setContextLost(),A.preventDefault(),$t&&console.log("context lost"),S.next(On())},w=()=>{v.isContextLost&&(v.handleContextRestored(()=>{b.draw.reset()}),$t&&console.log("context restored"))};r.addEventListener("webglcontextlost",_,!1),r.addEventListener("webglcontextrestored",w,!1);let E=new Zs(void 0);return{canvas:r,webgl:v,input:g,passes:b,attribs:s,get props(){return k({},a)},contextLost:S,contextRestored:v.contextRestored,assetManager:n,changed:E,setProps:A=>{if(!A)return;let P=!1;A.pixelScale!==void 0&&A.pixelScale!==a.pixelScale&&(a.pixelScale=A.pixelScale,g.setPixelScale(A.pixelScale),v.setPixelScale(A.pixelScale),s.handleResize(),P=!0),A.pickScale!==void 0&&A.pickScale!==a.pickScale&&(a.pickScale=A.pickScale,b.setPickScale(A.pickScale),P=!0),A.transparency!==void 0&&A.transparency!==a.transparency&&(a.transparency=A.transparency,b.setTransparency(A.transparency),P=!0),P&&E.next(void 0)},dispose:A=>{g.dispose(),r.removeEventListener("webglcontextlost",_,!1),r.removeEventListener("webglcontextrestored",w,!1),v.destroy(A)}}}e.fromCanvas=t})(hp||(hp={}));var _Ue=typeof window<"u"?window.requestAnimationFrame:e=>setImmediate(()=>e(Date.now())),Wle=typeof window<"u"?window.cancelAnimationFrame:e=>clearImmediate(e),CE;(function(e){function t(r,n={}){var o;let{webgl:i,input:s,passes:a,assetManager:l,canvas:c}=r,u=k(k({},ba(W_)),ba(n)),d=new Map,m=new Map,p=new Zs(0),h=On(),f=new Zs(0),y=new Zs(0),g=new Zs(0),{gl:v,contextRestored:b}=i,S=0,_=0,w=128,E=128,A=!1,P=0;Hr();let T=hf.create(i,a.draw.transparency);function B(){return T.boundingSphere.radius*u.sceneRadiusFactor}let D=new co({position:x.create(0,0,100),mode:u.camera.mode,fog:u.cameraFog.name==="on"?u.cameraFog.params.intensity:0,clipFar:u.cameraClipping.far,minNear:u.cameraClipping.minNear,fov:Cr(u.camera.fov)},{x:S,y:_,width:w,height:E}),M=new fp(D,u.camera.stereo.params),R=KI.create(s,D,T,u.trackball),U=new vE(i,T,u),F=new SE(i,a.draw,c,u.hiZ),N=XI.create(i,u.renderer);N.setOcclusionTest(F.isOccluded);let z=new uE(i,N,T,U,a.pick,{x:S,y:_,width:w,height:E},u.pickPadding),q=new eE(Xe,ce,s,D,R,u.interaction),O=new Qb(a.multiSample);a.draw.postprocessing.background.update(D,u.postprocessing.background,tt=>{tt&&Ie()});let J=!1,Q,H,W=!1,K=!0;function ce(tt){let bt=nr,Tt=Nt.Empty;if(tt){let xt=U.camera.getLoci(tt);if(xt!==nr)return{loci:xt,repr:Tt};bt=U.handle.getLoci(tt),d.forEach((me,Se)=>{let he=Se.getLoci(tt);Zo(he)||(Zo(bt)||console.warn("found another loci, this should not happen"),bt=he,Tt=Se)})}return{loci:bt,repr:Tt}}let V=[];function G(tt,bt){V.push([tt,bt])}function X(){let tt=!1;for(let[bt,Tt]of V)tt=Z(bt,Tt)||tt;return V=[],tt&&(T.update(void 0,!0),U.handle.scene.update(void 0,!0),U.camera.scene.update(void 0,!0)),tt}function Z(tt,bt){let{repr:Tt,loci:xt}=tt,me=!1;return Tt?me=Tt.mark(xt,bt)||me:d.forEach((Se,he)=>{me=he.mark(xt,bt)||me}),me=U.handle.mark(xt,bt)||me,me=U.camera.mark(xt,bt)||me,me}function ie(tt){if(i.isContextLost)return!1;let bt=!1;if(W&&(It(!1),W=!1,bt=!0),S>v.drawingBufferWidth||S+w<0||_>v.drawingBufferHeight||_+E<0)return!1;let Tt=X()&&(N.props.colorMarker||u.marking.enabled),xt=!1;R.update(P);let me=D.update(),Se=tt||me||bt||A;A=!1;let he=O.update(Tt||Se,u.multiSample);if(Se||he||Tt){let et=D;u.camera.stereo.name==="on"&&(M.update(),et=M),ot&&i.timer.mark("Canvas3D.render",!0);let Et={renderer:N,camera:et,scene:T,helper:U};if(zh.isEnabled(u.multiSample)){let vt=u.multiSample.reduceFlicker&&!me&&Tt&&!R.isAnimating;O.render(Et,u,!0,vt)}else a.draw.render(Et,u,!0);F.render(D),ot&&i.timer.markEnd("Canvas3D.render"),z.dirty=z.dirty||Se,xt=!0}return xt}let de=!1,we=!1;function Be(tt){we||ie(!!tt?.force)&&K&&f.next(On()-h)}function Ie(){A=!0}let le=0;function j(tt,bt){P=tt,L(bt?.isSynchronous),bt?.updateControls&&R.update(P),D.transition.tick(P),F.tick(),!bt?.manualDraw&&(Be(),!D.transition.inTransition&&!i.isContextLost&&q.tick(P))}function ue(){j(On()),le=_Ue(ue)}function fe(tt){h=tt,R.start(tt)}function De(){we=!1,R.start(On()),le===0&&ue()}function Re(tt=!1){we=tt,Wle(le),le=0}function Xe(tt,bt){let Tt=u.camera.stereo.name==="on"?M:D;return i.isContextLost?void 0:z.identify(tt,bt,Tt)}function L(tt=!1){Ve(tt)&&(ee(),de&&(U.debug.isEnabled&&U.debug.update(),Be({force:!0}),de=!1),y.next(On()))}function ee(){if(!J)return;let tt=T.boundingSphereVisible,{center:bt,radius:Tt}=tt,xt=R.props.autoAdjustMinMaxDistance;if(xt.name==="on"){let me=xt.params.minDistanceFactor*Tt+xt.params.minDistancePadding,Se=Math.max(xt.params.maxDistanceFactor*Tt,xt.params.maxDistanceMin);R.setProps({minDistance:me,maxDistance:Se})}if(Tt>0){let me=Q===void 0?u.cameraResetDurationMs:Q,Se=D.getFocus(bt,Tt),he=typeof H=="function"?H(T,D):H,et=he?k(k({},Se),he):Se;D.setState(te(k({},et),{radiusMax:B()}),me)}Q=void 0,H=void 0,J=!1}let xe=ge(),pe=ge();function be(){if(D.state.radiusMax===0)return!0;if(D.transition.inTransition||H)return!1;let tt=!0,bt=!0;ge.set(pe,D.state.target,D.state.radius);for(let Tt of T.renderables){if(!Tt.state.visible)continue;let xt=Tt.values.boundingSphere.ref.value;if(!xt.radius)continue;bt=!1;let me=x.distance(pe.center,xt.center);if((me>pe.radius||me>xt.radius||xt.radius>D.state.radiusMax)&&!ge.includes(xe,xt))return!0;ge.overlaps(pe,xt)&&(tt=!1)}return tt||!bt&&pe.radius<=.1}let ke=250;function Ve(tt){return T.needsCommit?(ge.copy(xe,T.boundingSphereVisible),F.clear(),T.commit(tt?void 0:ke)?(g.next(0),U.debug.isEnabled&&U.debug.update(),!u.camera.manualReset&&(p.value===0||be())&&(J=!0),xe.radius===0&&(Q=0),u.camera.manualReset||D.setState({radiusMax:B()},0),p.next(d.size),$t&&Ke(),!0):(g.next(T.commitQueueSize),!1)):!0}function Ke(){let tt=T.renderables.map(me=>({drawCount:me.values.drawCount.ref.value,instanceCount:me.values.instanceCount.ref.value,materialId:me.materialId,renderItemId:me.id}));console.groupCollapsed(`${tt.length} RenderItems`),tt.length<50?console.table(tt):console.log(tt),console.log(JSON.stringify(i.stats,void 0,4));let{texture:bt,attribute:Tt,elements:xt}=i.resources.getByteCounts();console.log(JSON.stringify({texture:`${(bt/1024/1024).toFixed(3)} MiB`,attribute:`${(Tt/1024/1024).toFixed(3)} MiB`,elements:`${(xt/1024/1024).toFixed(3)} MiB`},void 0,4)),console.log(JSON.stringify(i.timer.formatedStats(),void 0,4)),console.groupEnd()}function it(tt){nt(tt);let bt=d.get(tt),Tt=new Set;tt.renderObjects.forEach(xt=>Tt.add(xt)),bt?Dn.areEqual(Tt,bt)||(Tt.forEach(xt=>{bt.has(xt)||T.add(xt)}),bt.forEach(xt=>{Tt.has(xt)||T.remove(xt)})):tt.renderObjects.forEach(xt=>T.add(xt)),d.set(tt,Tt),T.update(tt.renderObjects,!1),de=!0,$t&&Ke()}function Ue(tt){ut(tt);let bt=d.get(tt);bt&&(bt.forEach(Tt=>T.remove(Tt)),d.delete(tt),de=!0,$t&&Ke())}function nt(tt){m.has(tt)||m.set(tt,tt.updated.subscribe(bt=>{tt.state.syncManually||it(tt)}))}function ut(tt){let bt=m.get(tt);bt&&(bt.unsubscribe(),m.delete(tt))}function St(){let tt=T.boundingSphere.radius>0?100-Math.round(D.transition.target.radius/B()*100):0;return{camera:{mode:D.state.mode,helper:k({},U.camera.props),stereo:k({},u.camera.stereo),fov:Math.round(Fs(D.state.fov)),manualReset:!!u.camera.manualReset},cameraFog:D.state.fog>0?{name:"on",params:{intensity:D.state.fog}}:{name:"off",params:{}},cameraClipping:{far:D.state.clipFar,radius:tt,minNear:D.state.minNear},cameraResetDurationMs:u.cameraResetDurationMs,sceneRadiusFactor:u.sceneRadiusFactor,transparentBackground:u.transparentBackground,dpoitIterations:u.dpoitIterations,pickPadding:u.pickPadding,viewport:u.viewport,postprocessing:k({},u.postprocessing),marking:k({},u.marking),multiSample:k({},u.multiSample),hiZ:k({},F.props),renderer:k({},N.props),trackball:k({},R.props),interaction:k({},q.props),debug:k({},U.debug.props),handle:k({},U.handle.props)}}let mt=b.subscribe(()=>{z.dirty=!0,Be({force:!0}),Be({force:!0})}),Pt=new Zs(0);function It(tt=!0){a.updateSize(),Hr(),gn(),tt&&Ie(),Pt.next(+new Date)}oH(Ke);let ar=(o=r.changed)===null||o===void 0?void 0:o.subscribe(()=>{T.setTransparency(a.draw.transparency),Ie()});if($t&&c){let tt,bt=Tt=>{let xt=Tt&&Ht.getBoundingSphere(Ht.normalize(Tt,"residue"));F.debugOcclusion(xt)};s.click.subscribe(Tt=>{if(!Tt.modifiers.control||Tt.button!==2)return;let xt=Xe(Tt.x,Tt.y);if(!xt){tt=void 0,bt(tt);return}tt=ce(xt.id).loci,bt(tt)}),f.subscribe(()=>{setTimeout(()=>{bt(tt)},100)})}return{webgl:i,add:it,remove:Ue,commit:L,update:(tt,bt)=>{if(tt){if(!d.has(tt))return;T.update(tt.renderObjects,!!bt)}else T.update(void 0,!!bt);de=!0},clear:()=>{m.forEach(tt=>tt.unsubscribe()),m.clear(),d.clear(),T.clear(),U.debug.clear(),Ie(),p.next(d.size)},syncVisibility:()=>{D.state.radiusMax===0&&(J=!0,Q=0),T.syncVisibility()&&U.debug.isEnabled&&U.debug.update(),Ie()},requestDraw:Ie,tick:j,animate:De,resetTime:fe,pause:Re,resume:()=>{we=!1},identify:Xe,mark:G,getLoci:ce,handleResize:It,requestResize:()=>{W=!0},requestCameraReset:tt=>{Q=tt?.durationMs,H=tt?.snapshot,J=!0},camera:D,boundingSphere:T.boundingSphere,boundingSphereVisible:T.boundingSphereVisible,get notifyDidDraw(){return K},set notifyDidDraw(tt){K=tt},didDraw:f,commited:y,commitQueueSize:g,reprCount:p,resized:Pt,setProps:(tt,bt=!1)=>{var Tt,xt,me,Se;let he=typeof tt=="function"?wl(St(),tt):tt;he.sceneRadiusFactor!==void 0&&(u.sceneRadiusFactor=he.sceneRadiusFactor,D.setState({radiusMax:B()},0));let et=Object.create(null);he.camera&&he.camera.mode!==void 0&&he.camera.mode!==D.state.mode&&(et.mode=he.camera.mode);let Et=Math.round(Fs(D.state.fov));if(he.camera&&he.camera.fov!==void 0&&he.camera.fov!==Et&&(et.fov=Cr(he.camera.fov)),he.cameraFog!==void 0&&he.cameraFog.params){let vt=he.cameraFog.name==="on"?he.cameraFog.params.intensity:0;vt!==D.state.fog&&(et.fog=vt)}if(he.cameraClipping!==void 0&&(he.cameraClipping.far!==void 0&&he.cameraClipping.far!==D.state.clipFar&&(et.clipFar=he.cameraClipping.far),he.cameraClipping.minNear!==void 0&&he.cameraClipping.minNear!==D.state.minNear&&(et.minNear=he.cameraClipping.minNear),he.cameraClipping.radius!==void 0)){let vt=B()/100*(100-he.cameraClipping.radius);vt>0&&vt!==et.radius&&(et.radius=Math.max(vt,.01))}Object.keys(et).length>0&&D.setState(et),!((Tt=he.camera)===null||Tt===void 0)&&Tt.helper&&U.camera.setProps(he.camera.helper),((xt=he.camera)===null||xt===void 0?void 0:xt.manualReset)!==void 0&&(u.camera.manualReset=he.camera.manualReset),((me=he.camera)===null||me===void 0?void 0:me.stereo)!==void 0&&(Object.assign(u.camera.stereo,he.camera.stereo),M.setProps(u.camera.stereo.params)),he.cameraResetDurationMs!==void 0&&(u.cameraResetDurationMs=he.cameraResetDurationMs),he.transparentBackground!==void 0&&(u.transparentBackground=he.transparentBackground),he.dpoitIterations!==void 0&&(u.dpoitIterations=he.dpoitIterations),he.pickPadding!==void 0&&(u.pickPadding=he.pickPadding),he.viewport!==void 0&&(u.viewport===he.viewport||u.viewport.name===he.viewport.name&&Qf(u.viewport.params,he.viewport.params)||(u.viewport=he.viewport,Hr(),gn())),!((Se=he.postprocessing)===null||Se===void 0)&&Se.background&&(Object.assign(u.postprocessing.background,he.postprocessing.background),a.draw.postprocessing.background.update(D,u.postprocessing.background,vt=>{vt&&!bt&&Ie()})),he.postprocessing&&Object.assign(u.postprocessing,he.postprocessing),he.marking&&Object.assign(u.marking,he.marking),he.multiSample&&Object.assign(u.multiSample,he.multiSample),he.hiZ&&F.setProps(he.hiZ),he.renderer&&N.setProps(he.renderer),he.trackball&&R.setProps(he.trackball),he.interaction&&q.setProps(he.interaction),he.debug&&U.debug.setProps(he.debug),he.handle&&U.handle.setProps(he.handle),et.mode==="orthographic"&&(u.camera.stereo.name="off"),bt||Ie()},getImagePass:(tt={})=>new hE(i,l,N,T,D,U,a.draw.transparency,tt),getRenderObjects(){let tt=[];return T.forEach((bt,Tt)=>tt.push(Tt)),tt},get props(){return St()},get input(){return s},get stats(){return N.stats},get interaction(){return q.events},dispose:()=>{mt.unsubscribe(),ar?.unsubscribe(),Wle(le),V=[],T.clear(),U.debug.clear(),R.dispose(),N.dispose(),q.dispose(),F.dispose(),iH(Ke)}};function Hr(){let tt=S,bt=_,Tt=w,xt=E;u.viewport.name==="canvas"?(S=0,_=0,w=v.drawingBufferWidth,E=v.drawingBufferHeight):u.viewport.name==="static-frame"?(S=u.viewport.params.x*i.pixelRatio,E=u.viewport.params.height*i.pixelRatio,_=v.drawingBufferHeight-E-u.viewport.params.y*i.pixelRatio,w=u.viewport.params.width*i.pixelRatio):u.viewport.name==="relative-frame"&&(S=Math.round(u.viewport.params.x*v.drawingBufferWidth),E=Math.round(u.viewport.params.height*v.drawingBufferHeight),_=Math.round(v.drawingBufferHeight-E-u.viewport.params.y*v.drawingBufferHeight),w=Math.round(u.viewport.params.width*v.drawingBufferWidth)),(tt!==S||bt!==_||Tt!==w||xt!==E)&&(A=!0)}function gn(){z.setViewport(S,_,w,E),N.setViewport(S,_,w,E),Io.set(D.viewport,S,_,w,E),Io.set(R.viewport,S,_,w,E),F.setViewport(S,_,w,E)}}e.create=t})(CE||(CE={}));function wUe(e){Yle(e)}function Yle(e){ct.Canvas3D.ResetSettings.subscribe(e,()=>{var t;(t=e.canvas3d)===null||t===void 0||t.setProps(W_),e.events.canvas3d.settingsUpdated.next(void 0)}),ct.Canvas3D.SetSettings.subscribe(e,t=>{var r;e.canvas3d&&((r=e.canvas3d)===null||r===void 0||r.setProps(t.settings),e.events.canvas3d.settingsUpdated.next(void 0))})}var y6={};hi(y6,{DefaultFocusLociBindings:()=>Kle,DefaultLociLabelProvider:()=>EUe,DefaultSelectLociBindings:()=>Xle,FocusLoci:()=>tv,HighlightLoci:()=>PUe,SelectLoci:()=>g6});var J1=xo,q0=Pa,ev=_t.Trigger,AUe={hoverHighlightOnly:_t([ev(J1.Flag.None)],"Highlight","Hover element using ${triggers}"),hoverHighlightOnlyExtend:_t([ev(J1.Flag.None,q0.create({shift:!0}))],"Extend highlight","From selected to hovered element along polymer using ${triggers}")},TUe={bindings:C.Value(AUe,{isHidden:!0}),ignore:C.Value([],{isHidden:!0}),preferAtoms:C.Boolean(!1,{description:"Always prefer atoms over bonds"}),mark:C.Boolean(!0)},PUe=Ur.create({name:"representation-highlight-loci",category:"interaction",ctor:class extends Ur.Handler{constructor(){super(...arguments),this.lociMarkProvider=(e,t)=>{!this.ctx.canvas3d||!this.params.mark||this.ctx.canvas3d.mark(e,t)}}getLoci(e){return this.params.preferAtoms&&yt.isLoci(e)&&e.bonds.length===2?yt.toFirstStructureElementLoci(e):e}register(){this.subscribeObservable(this.ctx.behaviors.interaction.hover,({current:e,buttons:t,modifiers:r})=>{if(!this.ctx.canvas3d||this.ctx.isBusy)return;let n=this.getLoci(e.loci);if(this.params.ignore.includes(n.kind)){this.ctx.managers.interactivity.lociHighlights.highlightOnly({repr:e.repr,loci:nr});return}let o=!1;_t.match(this.params.bindings.hoverHighlightOnly,t,r)&&(this.ctx.managers.interactivity.lociHighlights.highlightOnly({loci:n}),o=!0),_t.match(this.params.bindings.hoverHighlightOnlyExtend,t,r)&&(this.ctx.managers.interactivity.lociHighlights.highlightOnlyExtend({loci:n}),o=!0),o||this.ctx.managers.interactivity.lociHighlights.highlightOnly({repr:e.repr,loci:nr})}),this.ctx.managers.interactivity.lociHighlights.addProvider(this.lociMarkProvider)}unregister(){this.ctx.managers.interactivity.lociHighlights.removeProvider(this.lociMarkProvider)}},params:()=>TUe,display:{name:"Highlight Loci on Canvas"}}),Xle={clickSelect:_t.Empty,clickToggleExtend:_t([ev(J1.Flag.Primary,q0.create({shift:!0}))],"Toggle extended selection","Click on element using ${triggers} to extend selection along polymer"),clickSelectOnly:_t.Empty,clickToggle:_t([ev(J1.Flag.Primary,q0.create())],"Toggle selection","Click on element using ${triggers}"),clickDeselect:_t.Empty,clickDeselectAllOnEmpty:_t([ev(J1.Flag.Primary,q0.create())],"Deselect all","Click on nothing using ${triggers}")},IUe={bindings:C.Value(Xle,{isHidden:!0}),ignore:C.Value([],{isHidden:!0}),preferAtoms:C.Boolean(!1,{description:"Always prefer atoms over bonds"}),mark:C.Boolean(!0)},g6=Ur.create({name:"representation-select-loci",category:"interaction",ctor:class extends Ur.Handler{getLoci(e){return this.params.preferAtoms&&yt.isLoci(e)&&e.bonds.length===2?yt.toFirstStructureElementLoci(e):e}applySelectMark(e,t){let r=this.ctx.state.data.cells.get(e);if(r&&ae.isRepresentation3D(r.obj)){this.spine.current=r;let n=this.spine.getRootOfType(ae.Molecule.Structure);if(n){t&&this.lociMarkProvider({loci:Me.Loci(n.data)},Ft.Deselect);let o=this.ctx.managers.structure.selection.getLoci(n.data);this.lociMarkProvider({loci:o},Ft.Select)}}}register(){let e=n=>Ht.isEmpty(n),t=n=>!Ht.isEmpty(n),r=[["clickSelect",n=>this.ctx.managers.interactivity.lociSelects.select(n),t],["clickToggle",n=>this.ctx.managers.interactivity.lociSelects.toggle(n),t],["clickToggleExtend",n=>this.ctx.managers.interactivity.lociSelects.toggleExtend(n),t],["clickSelectOnly",n=>this.ctx.managers.interactivity.lociSelects.selectOnly(n),t],["clickDeselect",n=>this.ctx.managers.interactivity.lociSelects.deselect(n),t],["clickDeselectAllOnEmpty",()=>this.ctx.managers.interactivity.lociSelects.deselectAll(),e]];r.sort((n,o)=>{let i=this.params.bindings[n[0]],s=this.params.bindings[o[0]],a=i.triggers.length===0?0:Js(i.triggers.map(c=>q0.size(c.modifiers)));return(s.triggers.length===0?0:Js(s.triggers.map(c=>q0.size(c.modifiers))))-a}),this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:n,button:o,modifiers:i})=>{if(!this.ctx.canvas3d||this.ctx.isBusy||!this.ctx.selectionMode)return;let s=this.getLoci(n.loci);if(!this.params.ignore.includes(s.kind)){for(let[a,l,c]of r)if(_t.match(this.params.bindings[a],o,i)&&(!c||c(s))){l({repr:n.repr,loci:s});break}}}),this.ctx.managers.interactivity.lociSelects.addProvider(this.lociMarkProvider),this.subscribeObservable(this.ctx.state.events.object.created,({ref:n})=>this.applySelectMark(n)),this.subscribeObservable(this.ctx.state.events.object.updated,({ref:n,obj:o,oldObj:i,oldData:s,action:a})=>{let l=this.ctx.state.data.cells.get(n);if(l&&ae.Molecule.Structure.is(l.obj)){let c=o.data,u=a==="recreate"?i?.data:a==="in-place"?s:void 0;if(u&&Me.areEquivalent(c,u)&&Me.areHierarchiesEqual(c,u))return;let d=this.ctx.state.data.select(qt.children(n).ofType(ae.Molecule.Structure.Representation3D));for(let m of d)this.applySelectMark(m.transform.ref,!0)}})}unregister(){this.ctx.managers.interactivity.lociSelects.removeProvider(this.lociMarkProvider)}constructor(e,t){super(e,t),this.lociMarkProvider=(r,n)=>{!this.ctx.canvas3d||!this.params.mark||this.ctx.canvas3d.mark({loci:r.loci},n)},this.spine=new n0.Impl(e.state.data.cells)}},params:()=>IUe,display:{name:"Select Loci on Canvas"}}),EUe=Ur.create({name:"default-loci-label-provider",category:"interaction",ctor:class{register(){this.ctx.managers.lociLabels.addProvider(this.f)}unregister(){this.ctx.managers.lociLabels.removeProvider(this.f)}constructor(e){this.ctx=e,this.f={label:t=>{let r=[];if($.Loci.is(t)){let n=new Set;for(let{unit:o}of t.elements){let i=$.Location.create(t.structure,o,o.elements[0]),s=Ne.entity.pdbx_description(i).join(", ");n.add(s)}n.size===1&&n.forEach(o=>r.push(o))}return r.push(Qd(t)),r.filter(n=>!!n).join("
")},group:t=>t.toString().replace(/Model [0-9]+/g,"Models"),priority:100}}},display:{name:"Provide Default Loci Label"}}),Kle={clickFocus:_t([ev(J1.Flag.Primary,q0.create())],"Representation Focus","Click element using ${triggers}"),clickFocusAdd:_t([ev(J1.Flag.Primary,q0.create({shift:!0}))],"Representation Focus Add","Click element using ${triggers}"),clickFocusSelectMode:_t([],"Representation Focus","Click element using ${triggers}"),clickFocusAddSelectMode:_t([],"Representation Focus Add","Click element using ${triggers}")},DUe={bindings:C.Value(Kle,{isHidden:!0})},tv=Ur.create({name:"representation-focus-loci",category:"interaction",ctor:class extends Ur.Handler{register(){this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:e,button:t,modifiers:r})=>{var n,o,i,s,a;let{clickFocus:l,clickFocusAdd:c,clickFocusSelectMode:u,clickFocusAddSelectMode:d}=this.params.bindings,m=this.ctx.selectionMode?u:l,p=_t.match(m,t,r),h=(s=(i=(o=(n=e.repr)===null||n===void 0?void 0:n.props)===null||o===void 0?void 0:o.snapshotKey)===null||i===void 0?void 0:i.trim())!==null&&s!==void 0?s:"";if(!this.ctx.selectionMode&&p&&h){this.ctx.managers.snapshot.applyKey(h);return}let{granularity:f}=this.ctx.managers.interactivity.props;if(f!=="residue"&&f!=="element")return;let y=this.ctx.selectionMode?d:c,g=_t.match(y,t,r);if(!p&&!g)return;let v=Ht.normalize(e.loci,"residue"),b=this.ctx.managers.structure.focus.current;if(b&&Ht.areEqual(b.loci,v))this.ctx.managers.structure.focus.clear();else if(p)this.ctx.managers.structure.focus.setFromLoci(v);else{this.ctx.managers.structure.focus.addFromLoci(v);let S=(a=this.ctx.managers.structure.focus.current)===null||a===void 0?void 0:a.loci;S&&this.ctx.managers.camera.focusLoci(S)}})}},params:()=>DUe,display:{name:"Representation Focus Loci on Canvas"}});var b6={};hi(b6,{CameraAxisHelper:()=>BUe,CameraControls:()=>LUe,DefaultClickResetCameraOnEmpty:()=>v6,DefaultClickResetCameraOnEmptySelectMode:()=>x6,DefaultFocusLociBindings:()=>Qle,FocusLoci:()=>MUe});var yf=xo,gp=Pa,vf=_t.Trigger,_E=_t.TriggerKey,v6=_t([vf(yf.Flag.Primary,gp.create()),vf(yf.Flag.Secondary,gp.create()),vf(yf.Flag.Primary,gp.create({control:!0}))],"Reset camera focus","Click on nothing using ${triggers}"),x6=_t([vf(yf.Flag.Secondary,gp.create()),vf(yf.Flag.Primary,gp.create({control:!0}))],"Reset camera focus","Click on nothing using ${triggers}"),Qle={clickCenterFocus:_t([vf(yf.Flag.Primary,gp.create()),vf(yf.Flag.Secondary,gp.create()),vf(yf.Flag.Primary,gp.create({control:!0}))],"Camera center and focus","Click element using ${triggers}"),clickCenterFocusSelectMode:_t([vf(yf.Flag.Secondary,gp.create()),vf(yf.Flag.Primary,gp.create({control:!0}))],"Camera center and focus","Click element using ${triggers}"),clickResetCameraOnEmpty:v6,clickResetCameraOnEmptySelectMode:x6},kUe={minRadius:C.Numeric(8,{min:1,max:50,step:1}),extraRadius:C.Numeric(4,{min:1,max:50,step:1},{description:"Value added to the bounding-sphere radius of the Loci"}),durationMs:C.Numeric(250,{min:0,max:1e3,step:1},{description:"Camera transition duration"}),bindings:C.Value(Qle,{isHidden:!0})},MUe=Ur.create({name:"camera-focus-loci",category:"interaction",ctor:class extends Ur.Handler{register(){this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:e,button:t,modifiers:r})=>{var n,o;if(!this.ctx.canvas3d)return;let i=this.ctx.selectionMode?this.params.bindings.clickCenterFocusSelectMode:this.params.bindings.clickCenterFocus,s=this.ctx.selectionMode?(n=this.params.bindings.clickResetCameraOnEmptySelectMode)!==null&&n!==void 0?n:x6:(o=this.params.bindings.clickResetCameraOnEmpty)!==null&&o!==void 0?o:v6;if(Ht.isEmpty(e.loci)&&_t.match(s,t,r)){ct.Camera.Reset(this.ctx,{});return}if(_t.match(i,t,r)){let a=Ht.normalize(e.loci,this.ctx.managers.interactivity.props.granularity);this.ctx.managers.camera.focusLoci(a,this.params)}})}},params:()=>kUe,display:{name:"Camera Focus Loci on Canvas"}}),BUe=Ur.create({name:"camera-axis-helper",category:"interaction",ctor:class extends Ur.Handler{register(){let e=Wn.None,t=0;this.subscribeObservable(this.ctx.behaviors.interaction.click,({current:r})=>{if(!this.ctx.canvas3d||!fE(r.loci))return;let n=r.loci.elements[0].groupId;if(n===Wn.None){e=Wn.None,t=0;return}let{camera:o}=this.ctx.canvas3d,i,s;if(n>=Wn.X&&n<=Wn.Z){e=Wn.None,t=0;let a=x.sub(x(),o.target,o.position),l=x.cross(x(),a,o.up);s=x(),s[n-1]=1,i=x.cross(x(),s,l),x.magnitude(i)===0&&(i=a)}else e===n?t=(t+1)%2:(e=n,t=0),n===Wn.XY?(s=t?x.unitX:x.unitY,i=x.negUnitZ):n===Wn.XZ?(s=t?x.unitX:x.unitZ,i=x.negUnitY):(s=t?x.unitY:x.unitZ,i=x.negUnitX);this.ctx.canvas3d.requestCameraReset({snapshot:(a,l)=>l.getInvariantFocus(a.boundingSphereVisible.center,a.boundingSphereVisible.radius,s,i)})})}},params:()=>({}),display:{name:"Camera Axis Helper"}}),Zle={keySpinAnimation:_t([_E("I")],"Spin Animation","Press ${triggers}"),keyRockAnimation:_t([_E("O")],"Rock Animation","Press ${triggers}"),keyToggleFlyMode:_t([_E("Space",gp.create({shift:!0}))],"Toggle Fly Mode","Press ${triggers}"),keyResetView:_t([_E("T")],"Reset View","Press ${triggers}")},RUe={bindings:C.Value(Zle,{isHidden:!0})},LUe=Ur.create({name:"camera-controls",category:"interaction",ctor:class extends Ur.Handler{register(){this.subscribeObservable(this.ctx.behaviors.interaction.key,({code:e,key:t,modifiers:r})=>{var n;if(!this.ctx.canvas3d)return;let o=k(k({},Zle),this.params.bindings),i=this.ctx.canvas3d.props.trackball;if(_t.matchKey(o.keySpinAnimation,e,r,t)){let s=i.animate.name!=="spin"?"spin":"off";s==="off"?this.ctx.canvas3d.setProps({trackball:{animate:{name:s,params:{}}}}):this.ctx.canvas3d.setProps({trackball:{animate:{name:s,params:{speed:1}}}})}if(_t.matchKey(o.keyRockAnimation,e,r,t)){let s=i.animate.name!=="rock"?"rock":"off";s==="off"?this.ctx.canvas3d.setProps({trackball:{animate:{name:s,params:{}}}}):this.ctx.canvas3d.setProps({trackball:{animate:{name:s,params:{speed:.3,angle:10}}}})}if(_t.matchKey(o.keyToggleFlyMode,e,r,t)){let s=!i.flyMode;this.ctx.canvas3d.setProps({trackball:{flyMode:s}}),!((n=this.ctx.canvas3dContext)===null||n===void 0)&&n.canvas&&(this.ctx.canvas3dContext.canvas.style.cursor=s?"crosshair":"unset")}_t.matchKey(o.keyResetView,e,r,t)&&ct.Camera.Reset(this.ctx,{})})}},params:()=>RUe,display:{name:"Camera Controls on Canvas"}});var oU={};hi(oU,{AccessibleSurfaceArea:()=>ace,BestDatabaseSequenceMapping:()=>que,CrossLinkRestraint:()=>Jue,Interactions:()=>zue,SecondaryStructure:()=>Vue,StructureInfo:()=>$le,ValenceModel:()=>Gue});var $le=Ur.create({name:"structure-info-prop",category:"custom-props",display:{name:"Structure Info"},ctor:class extends Ur.Handler{get maxModelIndex(){var e,t;let r=-1,n=this.ctx.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Model));for(let o of n){let i=((e=o.obj)===null||e===void 0?void 0:e.data)&&Ut.Index.get((t=o.obj)===null||t===void 0?void 0:t.data).value;i!==void 0&&i>r&&(r=i)}return r}get maxStructureIndex(){var e,t;let r=-1,n=this.ctx.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Structure));for(let o of n){let i=((e=o.obj)===null||e===void 0?void 0:e.data)&&Me.Index.get((t=o.obj)===null||t===void 0?void 0:t.data).value;i!==void 0&&i>r&&(r=i)}return r}get asymIdOffset(){var e;let t=0,r=0,n=this.ctx.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Model));for(let o of n){let i=(e=o.obj)===null||e===void 0?void 0:e.data;if(i){let s=Ut.AsymIdCount.get(i),a=Ut.AsymIdOffset.get(i).value;s!==void 0&&a!==void 0&&(t=Math.max(t,a.auth+s.auth),r=Math.max(r,a.label+s.label))}}return{auth:t,label:r}}setModelMaxIndex(){var e;let t=this.maxModelIndex,r=this.ctx.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Model));for(let n of r){let o=(e=n.obj)===null||e===void 0?void 0:e.data;o&&Ut.MaxIndex.get(o).value!==t&&Ut.MaxIndex.set(o,{value:t},t)}}setStructureMaxIndex(){var e;let t=this.maxModelIndex,r=this.ctx.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Structure));for(let n of r){let o=(e=n.obj)===null||e===void 0?void 0:e.data;o&&Me.MaxIndex.get(o).value!==t&&Me.MaxIndex.set(o,{value:t},t)}}handleModel(e,t){if(Ut.Index.get(e).value===void 0){let r=t&&Ut.Index.get(t).value,n=r??this.maxModelIndex+1;Ut.Index.set(e,{value:n},n)}if(Ut.AsymIdOffset.get(e).value===void 0){let r=t&&Ut.AsymIdOffset.get(t).value,n=r??k({},this.asymIdOffset);Ut.AsymIdOffset.set(e,{value:n},n)}}handleStructure(e,t){if(e.parent!==void 0||Me.Index.get(e).value!==void 0)return;let r=t&&Me.Index.get(t).value,n=r??this.maxStructureIndex+1;Me.Index.set(e,{value:n},n)}handle(e,t,r){ae.Molecule.Structure.is(t)?!this.ctx.state.data.tree.transforms.get(e).transformer.definition.isDecorator&&t.data.parent===void 0&&this.handleStructure(t.data,r?.data):ae.Molecule.Model.is(t)&&(this.ctx.state.data.tree.transforms.get(e).transformer.definition.isDecorator||this.handleModel(t.data,r?.data))}register(){this.ctx.customModelProperties.register(Ut.AsymIdOffset,!0),this.ctx.customModelProperties.register(Ut.Index,!0),this.ctx.customModelProperties.register(Ut.MaxIndex,!0),this.ctx.customStructureProperties.register(Me.Index,!0),this.ctx.customStructureProperties.register(Me.MaxIndex,!0),this.subscribeObservable(this.ctx.state.data.events.object.created,e=>{this.handle(e.ref,e.obj),this.setModelMaxIndex(),this.setStructureMaxIndex()}),this.subscribeObservable(this.ctx.state.data.events.object.updated,e=>{this.handle(e.ref,e.obj,e.oldObj)})}unregister(){this.ctx.customModelProperties.unregister(Ut.AsymIdOffset.descriptor.name),this.ctx.customModelProperties.unregister(Ut.Index.descriptor.name),this.ctx.customModelProperties.unregister(Ut.MaxIndex.descriptor.name),this.ctx.customStructureProperties.unregister(Me.Index.descriptor.name),this.ctx.customStructureProperties.unregister(Me.MaxIndex.descriptor.name)}}});var yp=[-1,1.76,1.87,1.65,1.5,1.4,1.85,1.8,1.6,1.4],wE={ALA:121,ARG:265,ASN:187,ASP:187,CYS:148,GLU:214,GLN:214,GLY:97,HIS:216,ILE:195,LEU:191,LYS:230,MET:203,PHE:228,PRO:154,SER:143,THR:163,TRP:264,TYR:255,VAL:165},Jle=121;function ece(e){let{key:t}=Ne.residue,{type_symbol:r,label_atom_id:n,label_comp_id:o}=Ne.atom,{structure:i,atomRadiusType:s,serialResidueIndex:a}=e,l=$.Location.create(i),c=0,u=0,d=-1;l.structure=i;for(let m=0,p=0,h=i.units.length;mN[0]-z[0]);let F=0;e:for(let N=0;NQ)continue e}++F}s[i[v]]+=l*F*M*M}}var C6={numberOfSpherePoints:C.Numeric(92,{min:12,max:360,step:1},{description:"Number of sphere points to sample per atom: 92 (original paper), 960 (BioJava), 3000 (EPPIC) - see Shrake A, Rupley JA: Environment and exposure to solvent of protein atoms. Lysozyme and insulin. J Mol Biol 1973."}),probeSize:C.Numeric(1.4,{min:.1,max:4,step:.01},{description:"Corresponds to the size of a water molecule: 1.4 (original paper), 1.5 (occassionally used)"}),nonPolymer:C.Boolean(!1,{description:"Include non-polymer atoms as occluders."}),traceOnly:C.Boolean(!1,{description:"Compute only using alpha-carbons, if true increase probeSize accordingly (e.g., 4 A). Considers only canonical amino acids."})};var W0;(function(e){function t(c,u={}){let d=k(k({},C.getDefaultValues(C6)),u);return Pe.create("Compute Accessible Surface Area",m=>Y(this,null,function*(){return yield r(m,c,d)}))}e.compute=t;function r(c,u,d){return Y(this,null,function*(){let m=n(u,d);ece(m),yield rce(c,m);let{area:p,serialResidueIndex:h}=m;return{area:p,serialResidueIndex:h}})}function n(c,u){let{elementCount:d,atomicResidueCount:m}=c,{probeSize:p,nonPolymer:h,traceOnly:f,numberOfSpherePoints:y}=u;return{structure:c,probeSize:p,nonPolymer:h,traceOnly:f,spherePoints:o(y),scalingConstant:4*Math.PI/y,maxLookupRadius:2*u.probeSize+2*yp[2],atomRadiusType:new Int8Array(d),serialResidueIndex:new Int32Array(d),area:new Float32Array(m)}}function o(c){let u=[],d=Math.PI*(3-Math.sqrt(5)),m=2/c;for(let p=0;p{if(!_e.isAtomic(e.element.unit))return!1;let t=fu.get(e.element.structure).value;return t?W0.getFlag(e.element,t)===1:!1}),isAccessible:S0.Dynamic(SR("computed","accessible-surface-area.is-accessible",Ee.Bool),e=>{if(!_e.isAtomic(e.element.unit))return!1;let t=fu.get(e.element.structure).value;return t?W0.getFlag(e.element,t)===2:!1})},fu=Sc.createProvider({label:"Accessible Surface Area",descriptor:Pi({name:"molstar_accessible_surface_area",symbols:AE}),type:"root",defaultParams:_6,getParams:e=>_6,isApplicable:e=>!0,obtain:(e,t,r)=>Y(void 0,null,function*(){let n=k(k({},C.getDefaultValues(_6)),r);return{value:yield W0.compute(t,n).runInContext(e.runtime)}})});var w6=Oe(16448250),UUe="Assigns a color based on the relative accessible surface area of a residue.",nce={list:C.ColorList("rainbow",{presetKind:"scale"})};function zUe(e){return nce}function oce(e,t){let r,n=cs.create({listOrName:t.list.colors,minLabel:"buried",maxLabel:"exposed",domain:[0,1]}),o=e.structure&&fu.get(e.structure),i=o?Wc(o.id,o.version):-1;if(o?.value&&e.structure){let s=$.Location.create(e.structure),a=o.value,l=c=>{let u=W0.getNormalizedValue(c,a);return u===-1?w6:n.color(u)};r=c=>$.Location.is(c)&&_e.isAtomic(c.unit)?l(c):yt.isLocation(c)?(s.unit=c.aUnit,s.element=c.aUnit.elements[c.aIndex],l(s)):w6}else r=()=>w6;return{factory:oce,granularity:"group",preferSmoothing:!0,color:r,props:t,contextHash:i,description:UUe,legend:n?n.legend:void 0}}var A6={name:"accessible-surface-area",label:"Accessible Surface Area",category:Oi.Category.Residue,factory:oce,getParams:zUe,defaultValues:C.getDefaultValues(nce),isApplicable:e=>!!e.structure,ensureCustomProperties:{attach:(e,t)=>t.structure?fu.attach(e,t.structure,void 0,!0):Promise.resolve(),detach:e=>e.structure&&fu.ref(e.structure,!1)}};var ace=Ur.create({name:"computed-accessible-surface-area-prop",category:"custom-props",display:{name:"Accessible Surface Area"},ctor:class extends Ur.Handler{constructor(){super(...arguments),this.provider=fu,this.labelProvider={label:e=>{if(this.params.showTooltip)return VUe(e)}}}update(e){let t=this.params.autoAttach!==e.autoAttach||this.params.showTooltip!==e.showTooltip;return this.params.autoAttach=e.autoAttach,this.params.showTooltip=e.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),t}register(){Tb.addCustomProp(this.provider.descriptor),this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach),this.ctx.representation.structure.themes.colorThemeRegistry.add(A6),this.ctx.managers.lociLabels.addProvider(this.labelProvider),this.ctx.query.structure.registry.add(ice),this.ctx.query.structure.registry.add(sce)}unregister(){Tb.removeCustomProp(this.provider.descriptor),this.ctx.customStructureProperties.unregister(this.provider.descriptor.name),this.ctx.representation.structure.themes.colorThemeRegistry.remove(A6),this.ctx.managers.lociLabels.removeProvider(this.labelProvider),this.ctx.query.structure.registry.remove(ice),this.ctx.query.structure.registry.remove(sce)}},params:()=>({autoAttach:C.Boolean(!1),showTooltip:C.Boolean(!0)})});function VUe(e){if(e.kind==="element-loci"){if(e.elements.length===0)return;let t=fu.get(e.structure).value;if(!t||e.structure.customPropertyDescriptors.hasReference(fu.descriptor))return;let{getSerialIndex:r}=e.structure.root.serialMapping,{area:n,serialResidueIndex:o}=t,i=new Set,s=0;for(let{indices:l,unit:c}of e.elements){let{elements:u}=c;Te.forEach(l,d=>{let m=o[r(c,u[d])];m!==-1&&!i.has(m)&&(s+=n[m],i.add(m))})}return i.size===0?void 0:`Accessible Surface Area ${`(${i.size} ${i.size>1?"Residues sum":"Residue"})`}: ${s.toFixed(2)} \u212B2`}else if(e.kind==="structure-loci"){let t=fu.get(e.structure).value;return!t||e.structure.customPropertyDescriptors.hasReference(fu.descriptor)?void 0:`Accessible Surface Area (Whole Structure): ${FB(t.area).toFixed(2)} \u212B2`}}var ice=Bn("Buried Protein Residues",oe.struct.modifier.union([oe.struct.modifier.wholeResidues([oe.struct.modifier.union([oe.struct.generator.atomGroups({"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":AE.isBuried.symbol()})])])]),{description:"Select buried protein residues.",category:Un.Residue,ensureCustomProperties:(e,t)=>fu.attach(e,t)}),sce=Bn("Accessible Protein Residues",oe.struct.modifier.union([oe.struct.modifier.wholeResidues([oe.struct.modifier.union([oe.struct.generator.atomGroups({"chain-test":oe.core.rel.eq([oe.ammp("objectPrimitive"),"atomistic"]),"residue-test":AE.isAccessible.symbol()})])])]),{description:"Select accessible protein residues.",category:Un.Residue,ensureCustomProperties:(e,t)=>fu.attach(e,t)});function Zr(e,t){return e.model.atomicHierarchy.atoms.type_symbol.value(e.elements[t])}function TE(e,t){return e.model.atomicHierarchy.atoms.pdbx_formal_charge.value(e.elements[t])}function Y0(e,t){return e.model.atomicHierarchy.atoms.label_atom_id.value(e.elements[t])}function Y_(e,t){return e.model.atomicHierarchy.atoms.label_alt_id.value(e.elements[t])}function X_(e,t){return e.model.atomicHierarchy.atoms.label_comp_id.value(e.elements[t])}function GUe(e,t,r){let n=0,o=e.interUnitBonds.getEdgeIndices(r,t.id);for(let i=0,s=o.length;i{Zr(i,s)===n&&(o+=1)}),o}function jUe(e,t,r){let{offset:n,b:o,edgeProps:{flags:i}}=e.bonds;Er.is;for(let s=n[t],a=n[t+1];s{Zr(s,a)!=="H"&&(s.conformation.position(s.elements[a],Jb),x.sub(EE,Jb,rv),i.push(x.angle(IE,EE)))}),i}function P6(e,t,r,n,o){t.conformation.position(t.elements[r],rv),n.conformation.position(n.elements[o],DE),x.sub(IE,DE,rv);let i=[x(),x()],s=0,a,l;if(js(e,t,r,(c,u)=>{s>1||Zr(c,u)!=="H"&&(a=c,l=u,c.conformation.position(c.elements[u],Jb),x.sub(i[s++],Jb,rv))}),s===1&&a&&l&&js(e,a,l,(c,u)=>{s>1||c===t&&u===r||Zr(c,u)!=="H"&&(c.conformation.position(c.elements[u],Jb),x.sub(i[s++],Jb,rv))}),s===2)return x.cross(EE,i[0],i[1]),Math.abs(Math.PI/2-x.angle(EE,IE))}var I6=new yt.ElementBondIterator,E6=new yt.ElementBondIterator;function YUe(e,t,r){let n=Zr(t,r),o=n==="O"||n==="N";if(o&&hu(e,t,r)===4)return!1;for(I6.setElement(e,t,r);I6.hasNext;){let i=I6.move();if(i.order>1)return!0;if(o){let s=Zr(i.otherUnit,i.otherIndex);for(E6.setElement(e,i.otherUnit,i.otherIndex);E6.hasNext;){let a=E6.move();if(a.order>1){if((s==="P"||s==="S")&&Zr(a.otherUnit,a.otherIndex)==="O")continue;return!0}}}}return!1}function XUe(e,t,r){let n=0,{offset:o,edgeProps:{flags:i,order:s}}=t.bonds;for(let a=o[r],l=o[r+1];a{let l=e.interUnitBonds.edges[a];Er.isCovalent(l.props.flag)&&(n+=l.props.order)}),n}var tS=new yt.ElementBondIterator,D6=new yt.ElementBondIterator;function KUe(e,t,r,n){let o=il(e,t,r,"H"),i=Zr(t,r),s=TE(t,r),a=n.assignCharge==="always"||n.assignCharge==="auto"&&s===0,l=n.assignH==="always"||n.assignH==="auto"&&o===0,c=hu(e,t,r),u=XUe(e,t,r),d=YUe(e,t,r),m=u-c>0,p=0,h=qo.Unknown;switch(i){case"H":a&&(c===0?(s=1,h=qo.Spherical):c===1&&(s=0,h=qo.Terminal));break;case"C":a&&(s=0),l&&(p=Math.max(0,4-u-Math.abs(s))),h=nv(c+p+Math.max(0,-s));break;case"N":if(a)if(!l)s=u-3;else if(d&&u<4)c-o===1&&u-o===2?s=1:s=0;else for(tS.setElement(e,t,r);tS.hasNext;){let f=tS.move(),y=Zr(f.otherUnit,f.otherIndex);if(y==="S"||lse(y)){s=0;break}else s=1}l&&(p=Math.max(0,3-u+s)),d&&!m?h=nv(c+p-s):h=nv(c+p+1-s);break;case"O":if(a&&(l||(s=u-2),u===1)){tS.setElement(e,t,r);e:for(;tS.hasNext;){let f=tS.move();for(D6.setElement(e,f.otherUnit,f.otherIndex);D6.hasNext;){let y=D6.move();if(!(y.otherUnit===t&&y.otherIndex===r)&&Zr(y.otherUnit,y.otherIndex)==="O"&&y.order===2){s=-1;break e}}}}l&&(p=Math.max(0,2-u+s)),d&&!m?h=nv(c+p-s+1):h=nv(c+p-s+2);break;case"S":a&&(l||(u<=3&&il(e,t,r,"O")===0?s=u-2:s=0)),l&&u<2&&(p=Math.max(0,2-u+s)),u<=3&&(h=nv(c+p-s+2));break;case"F":case"CL":case"BR":case"I":case"AT":a&&(s=u-1);break;case"LI":case"NA":case"K":case"RB":case"CS":case"FR":a&&(s=1-u);break;case"BE":case"MG":case"CA":case"SR":case"BA":case"RA":a&&(s=2-u);break;default:$t&&console.warn("Requested charge, protonation for an unhandled element",i)}return[s,p,p+o,h]}function QUe(e,t,r){let n=t.elements.length,o=new Int8Array(n),i=new Int8Array(n),s=new Int8Array(n),a=new Int8Array(n),l=!!e.parent,c;if(l){let u=e.root.unitMap.get(t.id);if(c=Fe.indicesOf(u.elements,t.elements),c.length!==t.elements.length)throw new Error("expected to find an index for every element");t=u,e=e.root}for(let u=0;uM6,isApplicable:e=>!0,obtain:(e,t,r)=>Y(void 0,null,function*(){let n=k(k({},C.getDefaultValues(M6)),r);return{value:yield uce(e.runtime,t,n)}})});var ro;(function(e){function t(d,m,p,h){return x.set(d,h.x[p],h.y[p],h.z[p]),x.transformMat4(d,d,m.conformation.operator.matrix),d}e.setPosition=t;function r(d,m){let p=new Int32Array(m+1),h=new Int32Array(m),f=new Int32Array(m),{members:y,count:g,offsets:v}=d;for(let _=0,w=v[g];_o(m,f)})}e.create=n;function o(d,m){let p,{count:h,types:f}=d,y=[];for(let v=0;v{m.x=0,m.y=0,m.z=0,m.offset=d.elementCount,m.count=0},pushMember:(p,h,f,y)=>{je.add(d,y),m.x+=p,m.y+=h,m.z+=f,m.count+=1},finishState:(p,h)=>{let{count:f}=m;f!==0&&(je.add(l,p),je.add(c,h),je.add(i,m.x/f),je.add(s,m.y/f),je.add(a,m.z/f),je.add(u,m.offset))},add:(p,h,f,y,g,v)=>{je.add(l,p),je.add(c,h),je.add(i,f),je.add(s,y),je.add(a,g),je.add(u,d.elementCount),je.add(d,v)},getFeatures:p=>{je.add(u,d.elementCount);let h=je.compact(i,!0),f=je.compact(s,!0),y=je.compact(a,!0),g=i.elementCount;return ro.create(p,{x:h,y:f,z:y,count:g,types:je.compact(l,!0),groups:je.compact(c,!0),offsets:je.compact(u,!0),members:je.compact(d,!0)})}}}e.create=t})(kE||(kE={}));var ME;(function(e){function t(r,n,o){let i=new Int32Array(o+1),s=new Int32Array(o),a=new Int32Array(o),{members:l,offsets:c}=n;for(let m=0,p=r.edgeCount*2;mf)){for(let y=c[h],g=c[h+1];yf)){for(let y=c[h],g=c[h+1];yd||(d=ME.createElementsIndex(u,r,n))})}}}e.create=t})(RE||(RE={}));var LE;(function(e){function t(){let r=new Lu.Builder;return{startUnitPair(n,o){r.startUnitPair(n.id,o.id)},finishUnitPair(){r.finishUnitPair()},add(n,o,i){r.add(n,o,{type:i,flag:gu.None})},getContacts(n){return new BE(r.getMap(),n)}}}e.create=t})(LE||(LE={}));var hce={lineOfSightDistFactor:C.Numeric(1,{min:0,max:3,step:.1})},ZUe=3;function gce(e,t,r){let n=t.members[t.offsets[t.feature]],o=r.members[r.offsets[r.feature]];if(n===o&&t.unit===r.unit)return!1;let i=Y_(t.unit,n),s=Y_(r.unit,o);return!(i&&s&&i!==s||t.unit===r.unit&&t.unit.model.atomicHierarchy.residueAtomSegments.count>1&&t.unit.residueIndex[t.unit.elements[n]]===r.unit.residueIndex[r.unit.elements[o]]||lce(e,t.unit,n,r.unit,o))}function pce(e,t,r,n){let o=Y_(e,t),i=Y_(r,n);return o&&i&&o!==i}function fce(e,t){let{feature:r,offsets:n,members:o}=t;for(let i=n[r],s=n[r+1];iE.maxDistance)),{center:g,radius:v}=m.boundary.sphere,b=(v+y)*(v+y),S=a.lineOfSightDistFactor,_=ro.Info(e,t,r),w=ro.Info(e,n,o);i.startUnitPair(t,n);for(let E=0;Eb)continue;let{indices:A,count:P,squaredDistances:T}=m.find(f[0],f[1],f[2],y);if(P!==0){_.feature=E;for(let B=0;B{i8e.includes(Zr(d,m))&&(u=!0)}),u&&r.add(7,Rn.None,o[n[a]],i[n[a]],s[n[a]],a)}}}function a8e(e,t){return e===7&&t===6||e===6&&t===7}var l8e=Cr(180),c8e=Cr(120);function u8e(e){return{angleMax:Cr(e.angleMax)}}function d8e(e,t,r,n){let o=t.types[t.feature],i=r.types[r.feature];if(!a8e(o,i))return;let[s,a]=o===6?[t,r]:[r,t],l=s.members[s.offsets[s.feature]],c=a.members[a.offsets[a.feature]],u=eS(e,s.unit,l,a.unit,c);if(u.length!==1||l8e-u[0]>n.angleMax)return;let d=eS(e,a.unit,c,s.unit,l);if(d.length!==0&&!d.some(m=>c8e-m>n.angleMax))return Fr.HalogenBond}var bce=ro.Provider([6],n8e),Sce=ro.Provider([7],s8e),Cce={name:"halogen-bonds",params:t8e,createTester:e=>{let t=u8e(e);return{maxDistance:e.distanceMax,requiredFeatures:new Set([6,7]),getType:(r,n,o)=>d8e(r,n,o,t)}}};var Tce={distanceMax:C.Numeric(3.5,{min:1,max:5,step:.1}),backbone:C.Boolean(!0,{description:"Include backbone-to-backbone hydrogen bonds"}),accAngleDevMax:C.Numeric(45,{min:0,max:180,step:1},{description:"Max deviation from ideal acceptor angle"}),donAngleDevMax:C.Numeric(45,{min:0,max:180,step:1},{description:"Max deviation from ideal donor angle"}),accOutOfPlaneAngleMax:C.Numeric(90,{min:0,max:180,step:1}),donOutOfPlaneAngleMax:C.Numeric(45,{min:0,max:180,step:1})},m8e=te(k({},Tce),{water:C.Boolean(!1,{description:"Include water-to-water hydrogen bonds"}),sulfurDistanceMax:C.Numeric(4.1,{min:1,max:5,step:.1})}),p8e=k({},Tce);function F6(e,t){let r=xf.get(e).value;if(!r)throw Error("expected valence model to be available");let n=r.get(t.id);if(!n)throw Error("expected valence model for unit to be available");return n}function f8e(e,t,r){let{totalH:n}=F6(e,t),{elements:o}=t,{x:i,y:s,z:a}=t.model.atomicConformation;for(let l=0,c=o.length;l0&&(u==="N"||u==="O"||u==="S"))&&r.add(4,Rn.None,i[o[l]],s[o[l]],a[o[l]],l)}}function h8e(e,t,r){let{totalH:n}=F6(e,t),{elements:o}=t,{x:i,y:s,z:a}=t.model.atomicConformation;for(let l=0,c=o.length;l0&&(il(e,t,l,"N")>0||il(e,t,l,"O")>0||g8e(t,l))&&r.add(9,Rn.None,i[o[l]],s[o[l]],a[o[l]],l)}function g8e(e,t){let{elementAromaticRingIndices:r,all:n}=e.rings,o=r.get(t);if(o===void 0)return!1;for(let i=0,s=o.length;i{r.add(5,Rn.None,a[s[d]],l[s[d]],c[s[d]],d)};for(let d=0,m=s.length;dMath.abs(a-u)>n.maxDonAngleDev))return;if(t.idealGeometry[o]===qo.Trigonal){let u=P6(e,t.unit,o,r.unit,i);if(u!==void 0&&u>n.maxDonOutOfPlaneAngle)return}let l=eS(e,r.unit,i,t.unit,o),c=T6.get(r.idealGeometry[i])||Ace;if(!l.some(u=>c-u>n.maxAccAngleDev)){if(r.idealGeometry[i]===qo.Trigonal){let u=P6(e,r.unit,i,t.unit,o);if(u!==void 0&&u>n.maxAccOutOfPlaneAngle)return}return!0}}function w8e(e,t,r,n,o){let i=t.types[t.feature],s=r.types[r.feature];if(!S8e(i,s))return;let[a,l]=s===5?[t,r]:[r,t],c=a.members[a.offsets[a.feature]],u=l.members[l.offsets[l.feature]],d=Zr(a.unit,c)==="S"||Zr(l.unit,u)==="S"?o.maxSulfurDistSq:o.maxDistSq;if(!(n>d)&&!(!o.includeWater&&b8e(a.unit,c,l.unit,u))&&Ece(e,a,l,o))return Fr.HydrogenBond}function A8e(e,t,r,n,o){let i=t.types[t.feature],s=r.types[r.feature];if(!C8e(i,s))return;let[a,l]=s===5?[t,r]:[r,t];if(Ece(e,a,l,o))return Fr.WeakHydrogenBond}var Dce=ro.Provider([4],f8e),kce=ro.Provider([9],h8e),Mce=ro.Provider([5],y8e),Bce={name:"hydrogen-bonds",params:m8e,createTester:e=>{let t=Math.max(e.distanceMax,e.sulfurDistanceMax),r=_8e(e);return{maxDistance:t,requiredFeatures:new Set([4,5]),getType:(n,o,i,s)=>w8e(n,o,i,s,r)}}},Rce={name:"weak-hydrogen-bonds",params:p8e,createTester:e=>{let t=Ice(e);return{maxDistance:e.distanceMax,requiredFeatures:new Set([9,5]),getType:(r,n,o,i)=>A8e(r,n,o,i,t)}}};function Lce(e,t,r){return Zr(t,r)==="S"&&il(e,t,r,"O")===3}function Fce(e,t,r){return Zr(t,r)==="S"&&il(e,t,r,"O")===4}function O6(e,t,r){return Zr(t,r)==="P"&&il(e,t,r,"O")===hu(e,t,r)}function Oce(e,t,r){let n=0;return Zr(t,r)==="C"&&il(e,t,r,"O")===2&&il(e,t,r,"C")===1&&js(e,t,r,(o,i)=>{Zr(o,i)==="O"&&hu(e,o,i)-il(e,o,i,"H")===1&&(n+=1)}),n===2}function Nce(e,t,r){let n=0;return Zr(t,r)==="C"&&hu(e,t,r)===3&&il(e,t,r,"N")===3&&js(e,t,r,(o,i)=>{hu(e,o,i)-il(e,o,i,"H")===1&&(n+=1)}),n===2}function Uce(e,t,r){let n=0;return Zr(t,r)==="C"&&hu(e,t,r)===3&&il(e,t,r,"N")===2&&il(e,t,r,"C")===1&&js(e,t,r,(o,i)=>{hu(e,o,i)-il(e,o,i,"H")===1&&(n+=1)}),n===2}var T8e=new Set(["N","O","S","F","CL","BR","I"]);function P8e(e){return T8e.has(e)}function zce(e,t,r){let n=!1;return js(e,t,r,(o,i)=>{P8e(Zr(o,i))&&(n=!0)}),n}var I8e={distanceMax:C.Numeric(5,{min:0,max:8,step:.1})},E8e={distanceMax:C.Numeric(5.5,{min:1,max:8,step:.1}),offsetMax:C.Numeric(2,{min:0,max:4,step:.1}),angleDevMax:C.Numeric(30,{min:0,max:180,step:1})},D8e={distanceMax:C.Numeric(6,{min:1,max:8,step:.1}),offsetMax:C.Numeric(2,{min:0,max:4,step:.1})},k8e=["ARG","HIS","LYS"],M8e=["GLU","ASP"];function jce(e,t){let r=xf.get(e).value;if(!r)throw Error("expected valence model to be available");let n=r.get(t.id);if(!n)throw Error("expected valence model for unit to be available");return n}function B8e(e,t,r){let{charge:n}=jce(e,t),{elements:o}=t,{x:i,y:s,z:a}=t.model.atomicConformation,l=new Set,{label_comp_id:c}=t.model.atomicHierarchy.atoms,u=Bt.transientSegments(t.model.atomicHierarchy.residueAtomSegments,o);for(;u.hasNext;){let{index:d,start:m,end:p}=u.move(),h=c.value(t.model.atomicHierarchy.residueAtomSegments.offsets[d]);if(k8e.includes(h)){r.startState();for(let f=m;f{Zr(t,v)==="N"&&(l.add(v),r.pushMember(i[o[v]],s[o[v]],a[o[v]],v))}),r.finishState(1,y))}for(let f=m;f0&&!l.has(f)&&r.add(1,Rn.None,i[o[f]],s[o[f]],a[o[f]],f)}}}function R8e(e,t,r){let{charge:n}=jce(e,t),{elements:o}=t,{x:i,y:s,z:a}=t.model.atomicConformation,l=new Set,{label_comp_id:c}=t.model.atomicHierarchy.atoms,u=Bt.transientSegments(t.model.atomicHierarchy.residueAtomSegments,o);for(;u.hasNext;){let{index:d,start:m,end:p}=u.move(),h=c.value(t.model.atomicHierarchy.residueAtomSegments.offsets[d]);if(M8e.includes(h)){r.startState();for(let f=m;f{Zr(t,g)==="O"&&r.pushMember(i[o[g]],s[o[g]],a[o[g]],g)}),r.finishState(2,Rn.Phosphate));else if(!ih.has(h)){for(let f=m;f{Zr(t,v)==="O"&&(l.add(v),r.pushMember(i[o[v]],s[o[v]],a[o[v]],v))}),r.finishState(2,y))}for(let f=m;f=H8e-o.angleDevMax)return Fr.PiStacking;if(a<=o.angleDevMax+Hce&&a>=Hce-o.angleDevMax)return Fr.PiStacking}}}function W8e(e,t,r,n,o){let i=t.types[t.feature],s=r.types[r.feature];if(N8e(i,s)){let[a,l]=i===3?[t,r]:[r,t];if(U6(K_,a),z6(l,a,K_)<=o.offsetMax)return Fr.CationPi}}var qce=ro.Provider([2],R8e),Wce=ro.Provider([1],B8e),Yce=ro.Provider([3],L8e),Xce={name:"ionic",params:I8e,createTester:e=>{let t=z8e(e);return{maxDistance:e.distanceMax,requiredFeatures:new Set([2,1]),getType:(r,n,o,i)=>j8e(r,n,o,i,t)}}},Kce={name:"pi-stacking",params:E8e,createTester:e=>{let t=V8e(e);return{maxDistance:e.distanceMax,requiredFeatures:new Set([3]),getType:(r,n,o,i)=>q8e(r,n,o,i,t)}}},Qce={name:"cation-pi",params:D8e,createTester:e=>{let t=G8e(e);return{maxDistance:e.distanceMax,requiredFeatures:new Set([3,1]),getType:(r,n,o,i)=>W8e(r,n,o,i,t)}}};var Y8e={distanceMax:C.Numeric(4,{min:1,max:5,step:.1})};function X8e(e,t,r){let{elements:n}=t,{x:o,y:i,z:s}=t.model.atomicConformation;for(let a=0,l=n.length;a{let p=Zr(d,m);p!=="C"&&p!=="H"&&(u=!1)})):c==="F"&&(u=!0),u&&r.add(8,Rn.None,o[n[a]],i[n[a]],s[n[a]],a)}}function K8e(e,t){return e===8&&t===8}function Q8e(e,t,r,n){let o=t.types[t.feature],i=r.types[r.feature];if(!K8e(o,i))return;let s=t.members[t.offsets[t.feature]],a=r.members[r.offsets[r.feature]];if(!(Zr(t.unit,s)==="F"&&Zr(r.unit,a)==="F"))return Fr.Hydrophobic}var Zce=ro.Provider([8],X8e),$ce={name:"hydrophobic",params:Y8e,createTester:e=>({maxDistance:e.distanceMax,requiredFeatures:new Set([8]),getType:(t,r,n,o)=>Q8e(t,r,n,o)})};var Z8e={distanceMax:C.Numeric(3,{min:1,max:5,step:.1})},$8e=["LI","NA","K","RB","CS","MG","CA","SR","BA","AL","GA","IN","TL","SC","SN","PB","BI","SB","HG"];function J8e(e,t,r){let{elements:n}=t,{x:o,y:i,z:s}=t.model.atomicConformation;for(let a=0,l=n.length;a({maxDistance:e.distanceMax,requiredFeatures:new Set([13,12,10,11]),getType:(t,r,n,o)=>nze(t,r,n,o)})};function oue(e,t){let{contacts:r,unitsContacts:n,unitsFeatures:o}=t,i=[oze(e,t),ize(e,t),sze(e,t),aze(e,t),lze(e,t)];for(let a=0,l=r.edgeCount;ar.edges[c].props.flag=gu.Filtered,a,l;return{isApplicable:c=>c===Fr.Hydrophobic,handleInterContact:(c,u,d)=>{o(c,u,d,i,s)},startUnit:(c,u,d)=>{a=new Map,l=m=>u.edgeProps.flag[m]=gu.Filtered},handleIntraContact:(c,u,d)=>{o(c,u,d,a,l)}}}function ize(e,t){let{contacts:r}=t,n=(o,i)=>{let s=o.types[o.feature]===9?i:o,a=s.members[s.offsets[s.feature]],{edgeProps:{type:l},elementsIndex:{offsets:c,indices:u}}=t.unitsContacts.get(s.unit.id);for(let m=c[a],p=c[a+1];mo===Fr.WeakHydrogenBond,handleInterContact:(o,i,s)=>{n(i,s)&&(r.edges[o].props.flag=gu.Filtered)},startUnit:()=>{},handleIntraContact:(o,i,s)=>{if(n(i,s)){let{flag:a}=t.unitsContacts.get(i.unit.id).edgeProps;a[o]=gu.Filtered}}}}function V6(e,t,r,n,o){let{offsets:i,feature:s}=r,{offsets:a,feature:l}=n;for(let c=i[s],u=i[s+1];cn===Fr.Ionic,handleInterContact:(n,o,i)=>{V6([Fr.HydrogenBond,Fr.WeakHydrogenBond],n,o,i,r)},startUnit:()=>{},handleIntraContact:(n,o,i)=>{G6([Fr.HydrogenBond,Fr.WeakHydrogenBond],n,o,i,t.unitsContacts.get(o.unit.id))}}}function aze(e,t){let{contacts:r}=t;return{isApplicable:n=>n===Fr.Hydrophobic||n===Fr.CationPi,handleInterContact:(n,o,i)=>{V6([Fr.PiStacking],n,o,i,r)},startUnit:()=>{},handleIntraContact:(n,o,i)=>{G6([Fr.PiStacking],n,o,i,t.unitsContacts.get(o.unit.id))}}}function lze(e,t){let{contacts:r}=t;return{isApplicable:n=>n===Fr.Ionic,handleInterContact:(n,o,i)=>{V6([Fr.MetalCoordination],n,o,i,r)},startUnit:()=>{},handleIntraContact:(n,o,i)=>{G6([Fr.MetalCoordination],n,o,i,t.unitsContacts.get(o.unit.id))}}}var om;(function(e){function t(u,d,m,p,h,f){return vP("interactions",{structure:d,interactions:u},{unitA:m,indexA:p,unitB:h,indexB:f})}e.Location=t;function r(u){return!!u&&u.kind==="data-location"&&u.tag==="interactions"}e.isLocation=r;function n(u,d){return u.data.structure===d.data.structure&&u.data.interactions===d.data.interactions&&u.element.indexA===d.element.indexA&&u.element.indexB===d.element.indexB&&u.element.unitA===d.element.unitA&&u.element.unitB===d.element.unitB}e.areLocationsEqual=n;function o(u,d){let{unitA:m,indexA:p,unitB:h,indexB:f}=d,{contacts:y,unitsContacts:g}=u;if(m===h){let v=g.get(m.id),b=v.getDirectedEdgeIndex(p,f);return B6(v.edgeProps.type[b])}else{let v=y.getEdgeIndex(p,m.id,f,h.id);return B6(y.edges[v].props.type)}}function i(u){return o(u.data.interactions,u.element)}e.locationLabel=i;function s(u,d,m){return l0("interactions",{structure:u,interactions:d},m,p=>l(d,m,p),()=>c(u,d,m))}e.Loci=s;function a(u){return!!u&&u.kind==="data-loci"&&u.tag==="interactions"}e.isLoci=a;function l(u,d,m){let{unitsFeatures:p}=u;return xl.fromPairProvider(d.length,(h,f,y)=>{let g=d[h];ro.setPosition(f,g.unitA,g.indexA,p.get(g.unitA.id)),ro.setPosition(y,g.unitB,g.indexB,p.get(g.unitB.id))},m)}e.getBoundingSphere=l;function c(u,d,m){let p=m[0];if(p===void 0)return"";let{unitA:h,indexA:f,unitB:y,indexB:g}=p,{unitsFeatures:v}=d,{members:b,offsets:S}=v.get(h.id),{members:_,offsets:w}=v.get(y.id),E={granularity:"element"};return(S[f+1]-S[f]>1||w[g+1]-w[g]>1)&&(E.granularity="residue"),[o(d,p),P_(yt.Location(u,h,b[S[f]],u,y,_[w[g]]),E)].join("
")}e.getLabel=c})(om||(om={}));var cze=[Dce,kce,Mce,qce,Wce,Yce,bce,Sce,Zce,tue,rue],UE={ionic:Xce,"pi-stacking":Kce,"cation-pi":Qce,"halogen-bonds":Cce,"hydrogen-bonds":Bce,"weak-hydrogen-bonds":Rce,hydrophobic:$ce,"metal-coordination":nue};function uze(e=[]){let t=Object.create(null);return Object.keys(UE).forEach(r=>{t[r]=C.MappedStatic(e.includes(r)?"on":"off",{on:C.Group(UE[r].params),off:C.Group({})},{cycle:!0})}),t}var dze=uze(["cation-pi","pi-stacking","hydrogen-bonds","halogen-bonds","metal-coordination"]),H6={providers:C.Group(dze,{isFlat:!0}),contacts:C.Group(hce,{label:"Advanced Options"})};function iue(e,t,r){return Y(this,null,function*(){let n=k(k({},C.getDefaultValues(H6)),r);yield xf.attach(e,t);let o=[];n1(UE).forEach(d=>{let{name:m,params:p}=n.providers[d];m==="on"&&o.push(UE[d].createTester(p))});let i=new Set;o.forEach(d=>Dn.add(i,d.requiredFeatures));let s=cze.filter(d=>Dn.areIntersecting(i,d.types)),a=Sa.Mutable(),l=Sa.Mutable();for(let d=0,m=t.unitSymmetryGroups.length;d{let a=t.get(i.id),l=t.get(s.id);xce(e,i,a,s,l,o,r,n)},{maxRadius:Math.max(...r.map(i=>i.maxDistance)),validUnit:i=>_e.isAtomic(i),validUnitPair:(i,s)=>Me.validUnitPair(e,i,s)}),o.getContacts(t)}var j6=k({},H6),Oo=Sc.createProvider({label:"Interactions",descriptor:Pi({name:"molstar_computed_interactions"}),type:"local",defaultParams:j6,getParams:e=>j6,isApplicable:e=>!e.isCoarseGrained,obtain:(e,t,r)=>Y(void 0,null,function*(){let n=k(k({},C.getDefaultValues(j6)),r);return{value:yield iue(e,t,n)}})});var q6=Oe(13421772),hze="Assigns colors according the interaction type of a link.",$l={HydrogenBond:2851770,Hydrophobic:8421504,HalogenBond:4259775,Ionic:15779860,MetalCoordination:9191577,CationPi:16744448,PiStacking:9220966,WeakHydrogenBond:12967404},gze=[["Hydrogen Bond",$l.HydrogenBond],["Hydrophobic",$l.Hydrophobic],["Halogen Bond",$l.HalogenBond],["Ionic",$l.Ionic],["Metal Coordination",$l.MetalCoordination],["Cation Pi",$l.CationPi],["Pi Stacking",$l.PiStacking],["Weak HydrogenBond",$l.WeakHydrogenBond]];function sue(e){switch(e){case Fr.HydrogenBond:return $l.HydrogenBond;case Fr.Hydrophobic:return $l.Hydrophobic;case Fr.HalogenBond:return $l.HalogenBond;case Fr.Ionic:return $l.Ionic;case Fr.MetalCoordination:return $l.MetalCoordination;case Fr.CationPi:return $l.CationPi;case Fr.PiStacking:return $l.PiStacking;case Fr.WeakHydrogenBond:return $l.WeakHydrogenBond;case Fr.Unknown:return q6}}var aue={};function yze(e){return aue}function lue(e,t){let r,n=e.structure?Oo.get(e.structure):void 0,o=n?Wc(n.id,n.version):-1;return n&&n.value?r=i=>{if(om.isLocation(i)){let{unitsContacts:s,contacts:a}=i.data.interactions,{unitA:l,unitB:c,indexA:u,indexB:d}=i.element;if(l===c){let m=s.get(l.id),p=m.getDirectedEdgeIndex(u,d);return sue(m.edgeProps.type[p])}else{let m=a.getEdgeIndex(u,l.id,d,c.id);return sue(a.edges[m].props.type)}}return q6}:r=()=>q6,{factory:lue,granularity:"group",color:r,props:t,contextHash:o,description:hze,legend:Nl(gze)}}var Q_={name:"interaction-type",label:"Interaction Type",category:Oi.Category.Misc,factory:lue,getParams:yze,defaultValues:C.getDefaultValues(aue),isApplicable:e=>!!e.structure,ensureCustomProperties:{attach:(e,t)=>t.structure?Oo.attach(e,t.structure,void 0,!0):Promise.resolve(),detach:e=>e.structure&&Oo.ref(e.structure,!1)}};function Ni(e,t,r,n){let o=0,{webgl:i}=t,s=new mo,a=new Nt.GeometryState,l=Ic(),c=[],u=Yn.create(),d,m,p,h,f=Lo.createEmpty();function y(A={},P){return P&&P!==m&&(p=r(t,P),m=P,h||(h=C.getDefaultValues(p))),h=Object.assign({},h,A),Pe.create("Creating or updating ComplexRepresentation",T=>Y(this,null,function*(){var B;let D=!1;d?!((B=d.mustRecreate)===null||B===void 0)&&B.call(d,m,h,i)&&(d.destroy(),d=n(l,m,h,i),D=!0):(d=n(l,m,h,i),D=!0);let M=d.createOrUpdate({webgl:i,runtime:T},f,h,P);M&&(yield M),D&&_(u),c.length=0,d&&d.renderObject&&(c.push(d.renderObject),a.add(d.renderObject.id,d.geometryVersion)),a.snapshot(),o+=1,s.next(o)}))}function g(A){return d?d.getLoci(A):nr}function v(){var A;return[Me.Loci((A=m.child)!==null&&A!==void 0?A:m)]}function b(A){d?.eachLocation(A)}function S(A,P){if(!m||!Fo.is(u.markerActions,P))return!1;if(Me.isLoci(A)||$.Loci.is(A)||yt.isLoci(A)){if(!Me.areRootsEquivalent(A.structure,m))return!1;A=Ht.remap(A,m),(Me.isLoci(A)||$.Loci.is(A)&&$.Loci.isWholeStructure(A))&&(A=a0)}else if(!Fi(A)&&!M1(A))return!1;return Ht.isEmpty(A)?!1:d?d.mark(A,P):!1}function _(A){if(Yn.update(u,A),A.visible!==void 0&&d&&d.setVisibility(A.visible&&(u.unitTransforms===null||u.unitTransforms.isIdentity)),A.alphaFactor!==void 0&&d&&d.setAlphaFactor(A.alphaFactor),A.pickable!==void 0&&d&&d.setPickable(A.pickable),A.overpaint!==void 0&&d){let P=ai.remap(A.overpaint,m);d.setOverpaint(P,i)}if(A.transparency!==void 0&&d){let P=hs.remap(A.transparency,m);d.setTransparency(P,i)}if(A.emissive!==void 0&&d){let P=ys.remap(A.emissive,m);d.setEmissive(P,i)}if(A.substance!==void 0&&d){let P=gs.remap(A.substance,m);d.setSubstance(P,i)}if(A.clipping!==void 0&&d){let P=qn.remap(A.clipping,m);d.setClipping(P)}A.themeStrength!==void 0&&d&&d.setThemeStrength(A.themeStrength),A.transform!==void 0&&d&&d.setTransform(A.transform),A.unitTransforms!==void 0&&d&&d.setVisibility(u.visible&&(A.unitTransforms===null||A.unitTransforms.isIdentity))}function w(A){f=A}function E(){d&&d.destroy()}return{label:e,get groupCount(){return d?d.groupCount:0},get props(){return h},get params(){return p},get state(){return u},get theme(){return f},get geometryVersion(){return a.version},renderObjects:c,updated:s,createOrUpdate:y,setState:_,setTheme:w,getLoci:g,getAllLoci:v,eachLocation:b,mark:S,destroy:E}}var vze=ne.toArray;function zE(e,t,r){let{elements:n,model:o}=t;if(Te.indexOf(n,r)!==-1){let{index:i,offsets:s}=o.atomicHierarchy.residueAtomSegments,a=i[r],l=[];for(let u=s[a],d=s[a+1];us.unitMap.has(d.id)):e.group.units,l=a.length,c=l*16,u=i&&i.aTransform.ref.value.length>=c?i.aTransform.ref.value:new Float32Array(c);for(let d=0;dl-a);let o=Math.floor(Math.cbrt(r)*Math.cbrt(r)),i=n[0]*n[1],s=Math.ceil(i/(t*t));return{area:i,areaCells:s,maxAreaCells:o}}function bf(e,t,r=mue){let{area:n,areaCells:o,maxAreaCells:i}=Y6(e,t.resolution,r),s=o>i?Math.sqrt(n/i):t.resolution;return te(k({},t),{resolution:s})}function bze(e){switch(e.kind){case 0:return e.model.atomicConformation;case 1:return e.model.coarseConformation.spheres;case 2:return e.model.coarseConformation.gaussians}}var ov={ignoreHydrogens:C.Boolean(!1,{description:"Whether or not to include hydrogen atoms in the surface calculation."}),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),traceOnly:C.Boolean(!1,{description:"Whether or not to only use trace atoms in the surface calculation."}),includeParent:C.Boolean(!1,{description:"Include elements of the parent structure in surface calculation to get a surface patch of the current structure."})},Jur=C.getDefaultValues(ov),Sze=x();function pue(e,t,r,n){return x.squaredDistance(x.set(Sze,e,t,r),n)}function Cze(e,t,r){let n=0,o=t.length;for(let i=0,s=r.length;ig||(A.push(D),P.push(T))}v=Fe.ofSortedArray(A),b=P}else v=p,b=as(new Int32Array(v.length));a&&l!==t&&Cze(b,t.elements,v);let S={indices:v,x:u,y:d,z:m,id:b},_=c?Zc(S):t.boundary,w=$.Location.create(e,l);return{position:S,boundary:_,radius:A=>(w.element=A,r.size(w))}}function oS(e,t,r){let{ignoreHydrogens:n,ignoreHydrogensVariant:o,traceOnly:i,includeParent:s}=r,a=s&&!!e.parent,l=$.Location.create(e.root),{center:c,radius:u}=e.boundary.sphere,d=(4+1.5)*2,m=(u+d)*(u+d),p,h,f,y,g,v;if(n||i||a){let{getSerialIndex:w}=e.serialMapping,E=a?e.root.units:e.units,A=[],P=[],T=[],B=[],D=[];for(let M=0,R=E.length;Mm||(A.push(Q),P.push(H),T.push(W),l.element=J,B.push(t.size(l)),a?(z?Fe.indexOf(z.elements,J):-1)===-1?D.push(-2):D.push(w(z,J)):D.push(w(U,J)))}}p=A,h=P,f=T,y=B,g=D,v=Te.ofRange(0,g.length)}else{let{elementCount:w}=e,E=new Float32Array(w),A=new Float32Array(w),P=new Float32Array(w),T=new Float32Array(w);for(let B=0,D=0,M=e.units.length;By[w]}}var fue=_C.H;function kc(e,t,r,n){if(_e.isCoarse(t)||t.model.atomicHierarchy.derived.atom.atomicNumber[r]!==fue)return!1;if(n==="all")return!0;let o=zce(e,t,Fe.indexOf(t.elements,r));return!!(o&&n==="polar"||!o&&n==="non-polar")}function hue(e,t){return e[t]===fue}function VE(e,t){if(_e.isCoarse(e))return!0;let r=e.model.atomicHierarchy.atoms.label_atom_id.value(t);return r==="CA"||r==="BB"||r==="P"}function Vh(e){return C.MultiSelect(e,uue,{description:"For which kinds of units/chains to show the representation visuals."})}var El={unitKinds:Vh(["atomic","spheres"]),includeParent:C.Boolean(!1,{isHidden:!0})},GE=k({},dt.Params),HE=k({},aa.Params),jE=k({},Li.Params),gue=k({},su.Params),qE=k({},hn.Params),WE=k({},Zi.Params),YE=k({},Aa.Params),XE=k({},ms.Params);function _ze(e,t,r,n,o,i){let{createValues:s,createRenderableState:a}=ii.getUtils(t),l=ub(),c=s(t,l,r,n,o),u=a(o);return Gd(t.kind,c,u,i)}function Q0(e,t){let{defaultProps:r,createGeometry:n,createLocationIterator:o,getLoci:i,eachLocation:s,setUpdateState:a,mustRecreate:l,processValues:c,dispose:u}=e,{updateValues:d,updateBoundingSphere:m,updateRenderableState:p,createPositionIterator:h}=e.geometryUtils,f=cu.create(),y={loci:nr,action:Ft.None,status:-1},g,v,b,S,_=Object.assign({},r),w=Lo.createEmpty(),E,A,P=-1,T,B;function D(z,q,O){if(!O&&!E)throw new Error("missing structure");if(v=Object.assign({},_,q),b=z,S=O,cu.reset(f),!g||!E){f.createNew=!0,f.createGeometry=!0;return}a(f,v,_,b,w,S,E),Me.areEquivalent(S,E)||(f.createGeometry=!0),Me.areHierarchiesEqual(S,E)||(f.updateTransform=!0,f.createGeometry=!0),Oi.areEqual(z.color,w.color)||(f.updateColor=!0),Ra(v.unitKinds,_.unitKinds)||(f.createGeometry=!0),E.child!==S.child&&(f.createGeometry=!0),v.instanceGranularity!==_.instanceGranularity&&(f.updateTransform=!0),f.updateSize&&!("uSize"in g.values)&&(f.createGeometry=!0),f.createGeometry&&(f.updateColor=!0,f.updateSize=!0)}function M(z){if(f.createNew)if(T=o(S,v),z)g=_ze(S,z,T,b,v,t),B=h(z,g.values);else throw new Error("expected geometry to be given");else{if(!g)throw new Error("expected renderObject to be available");if(f.updateTransform){T=o(S,v);let{instanceCount:q,groupCount:O}=T;v.instanceGranularity?Gn(q,"instance",g.values):Gn(q*O,"groupInstance",g.values)}if(f.createGeometry)if(z)I.updateIfChanged(g.values.drawCount,ii.getDrawCount(z)),I.updateIfChanged(g.values.uVertexCount,ii.getVertexCount(z)),I.updateIfChanged(g.values.uGroupCount,ii.getGroupCount(z));else throw new Error("expected geometry to be given");(f.updateTransform||f.createGeometry)&&(m(g.values,z||A),B=h(A,g.values)),f.updateSize&&"uSize"in g.values&&ja(T,b.size,g.values),f.updateColor&&Ci(T,B,b.color,g.values),d(g.values,v),p(g.state,v)}_=v,w=b,E=S,z&&(A=z,P+=1)}function R(z){return!!(Fi(z)||Me.isLoci(z)&&Me.areRootsEquivalent(z.structure,E)||$.Loci.is(z)&&Me.areRootsEquivalent(z.structure,E)&&$.Loci.isWholeStructure(z))}function U(z,q,O){let J=!1;return!$.Loci.is(z)&&!yt.isLoci(z)||!Me.areEquivalent(z.structure,q)?!1:(O(ve.ofSingleton(0))&&(J=!0),J)}function F(z,q,O){return R(z)?_.instanceGranularity?q(ve.ofBounds(0,T.instanceCount)):q(ve.ofBounds(0,T.groupCount*T.instanceCount)):_.instanceGranularity?U(z,E,q):s(z,E,q,O)}function N(z){g&&c?.(g.values,A,_,w,z.webgl)}return{get groupCount(){return T?T.count:0},get renderObject(){return T&&T.count?g:void 0},get geometryVersion(){return P},createOrUpdate(z,q,O={},J){if(D(q,O,J||E),f.createGeometry){let Q=n(z,S,b,v,A);if(vg(Q))return Q.then(H=>{M(H),N(z)});M(Q)}else M();N(z)},getLoci(z){return g?i(z,E,g.id):nr},eachLocation(z){for(T.reset();T.hasNext;){let{location:q,isSecondary:O}=T.move();z(q,O)}},mark(z,q){return Sr.mark(g,z,q,F,y)},setVisibility(z){Sr.setVisibility(g,z)},setAlphaFactor(z){Sr.setAlphaFactor(g,z)},setPickable(z){Sr.setPickable(g,z)},setColorOnly(z){Sr.setColorOnly(g,z)},setTransform(z,q){Sr.setTransform(g,z,q)},setOverpaint(z,q){let O={geometry:A,props:_,webgl:q};Sr.setOverpaint(g,z,F,!0,O)},setTransparency(z,q){let O={geometry:A,props:_,webgl:q};Sr.setTransparency(g,z,F,!0,O)},setEmissive(z,q){let O={geometry:A,props:_,webgl:q};Sr.setEmissive(g,z,F,!0,O)},setSubstance(z,q){let O={geometry:A,props:_,webgl:q};Sr.setSubstance(g,z,F,!0,O)},setClipping(z){Sr.setClipping(g,z,F,!0)},setThemeStrength(z){Sr.setThemeStrength(g,z)},destroy(){u?.(A),g&&(g.state.disposed=!0,g=void 0)},mustRecreate:l}}var im=k(k({},GE),El);function sl(e,t){return Q0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.createGeometry=!0)},geometryUtils:dt.Utils}),t)}var yue=k(k({},HE),El);function vue(e,t){return Q0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0)},geometryUtils:aa.Utils}),t)}var xue=k(k({},jE),El);function bue(e,t){return Q0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0)},geometryUtils:Li.Utils}),t)}var Sue=k(k({},qE),El);function Cue(e,t){return Q0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0)},geometryUtils:hn.Utils}),t)}var _ue=k(k({},WE),El);function wue(e,t){return Q0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0),n.background!==o.background&&(r.createGeometry=!0),n.backgroundMargin!==o.backgroundMargin&&(r.createGeometry=!0),n.tether!==o.tether&&(r.createGeometry=!0),n.tetherLength!==o.tetherLength&&(r.createGeometry=!0),n.tetherBaseWidth!==o.tetherBaseWidth&&(r.createGeometry=!0),n.attachment!==o.attachment&&(r.createGeometry=!0),n.fontFamily!==o.fontFamily&&(r.createGeometry=!0),n.fontQuality!==o.fontQuality&&(r.createGeometry=!0),n.fontStyle!==o.fontStyle&&(r.createGeometry=!0),n.fontVariant!==o.fontVariant&&(r.createGeometry=!0),n.fontWeight!==o.fontWeight&&(r.createGeometry=!0)},geometryUtils:Zi.Utils}),t)}var Aue=k(k({},YE),El);function Tue(e,t){return Q0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.createGeometry=!0)},geometryUtils:Aa.Utils}),t)}var Pue=k(k({},XE),El);function Iue(e,t){return Q0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.createGeometry=!0)},geometryUtils:ms.Utils}),t)}function Tn(e,t,r,n){let o=0,{webgl:i}=t,s=new mo,a=Ic(),l=[],c=new Nt.GeometryState,u=Yn.create(),d=new Map,m,p,h,f,y=Lo.createEmpty();function g(T={},B){return B&&B!==m&&(h=r(t,B),f||(f=C.getDefaultValues(h))),f=Object.assign({},f,T),Pe.create("Creating or updating UnitsRepresentation",D=>Y(this,null,function*(){var M,R,U;if(!m&&!B)throw new Error("missing structure");if(B&&!m){p=B.unitSymmetryGroups;for(let F=0;F{N.destroy()})}else if(B&&B!==m&&Me.areUnitIdsAndIndicesEqual(B,m)){p=B.unitSymmetryGroups;for(let F=0;FF.push(N));for(let N=0,z=F.length;N{F.renderObject&&(l.push(F.renderObject),c.add(F.renderObject.id,F.geometryVersion))}),c.snapshot(),B&&(m=B),s.next(o++)}))}function v(T){let B=nr;return d.forEach(({visual:D})=>{let M=D.getLoci(T);Zo(M)||(B=M)}),B}function b(T){d.forEach(({visual:B})=>{B.eachLocation(T)})}function S(){var T;return[Me.Loci((T=m.child)!==null&&T!==void 0?T:m)]}function _(T,B){if(!m||!Fo.is(u.markerActions,B))return!1;if(Me.isLoci(T)||$.Loci.is(T)||yt.isLoci(T)){if(!Me.areRootsEquivalent(T.structure,m))return!1;T=Ht.remap(T,m),(Me.isLoci(T)||$.Loci.is(T)&&$.Loci.isWholeStructure(T))&&(T=a0)}else if(!Fi(T)&&!M1(T))return!1;if(Ht.isEmpty(T))return!1;let D=!1;return d.forEach(({visual:M})=>{D=M.mark(T,B)||D}),D}function w(T,B,D){let{visible:M,alphaFactor:R,pickable:U,overpaint:F,transparency:N,emissive:z,substance:q,clipping:O,themeStrength:J,transform:Q,unitTransforms:H}=D;M!==void 0&&T.setVisibility(M),R!==void 0&&T.setAlphaFactor(R),U!==void 0&&T.setPickable(U),F!==void 0&&T.setOverpaint(F,i),N!==void 0&&T.setTransparency(N,i),z!==void 0&&T.setEmissive(z,i),q!==void 0&&T.setSubstance(q,i),O!==void 0&&T.setClipping(O),J!==void 0&&T.setThemeStrength(J),Q!==void 0&&(Q!==u.transform||!ne.areEqual(Q,u.transform,1e-6))&&T.setTransform(Q),H!==void 0&&(H?T.setTransform(void 0,H.getSymmetryGroupTransforms(B)):H!==u.unitTransforms&&T.setTransform(void 0,null))}function E(T){let{visible:B,alphaFactor:D,pickable:M,overpaint:R,transparency:U,emissive:F,substance:N,clipping:z,themeStrength:q,transform:O,unitTransforms:J,syncManually:Q,markerActions:H}=T,W={};B!==void 0&&(W.visible=B),D!==void 0&&(W.alphaFactor=D),M!==void 0&&(W.pickable=M),R!==void 0&&m&&(W.overpaint=ai.remap(R,m)),U!==void 0&&m&&(W.transparency=hs.remap(U,m)),F!==void 0&&m&&(W.emissive=ys.remap(F,m)),N!==void 0&&m&&(W.substance=gs.remap(N,m)),z!==void 0&&m&&(W.clipping=qn.remap(z,m)),q!==void 0&&(W.themeStrength=q),O!==void 0&&!ne.areEqual(O,u.transform,1e-6)&&(W.transform=O),(J!==u.unitTransforms||J?.version!==u.unitTransformsVersion)&&(W.unitTransforms=J,u.unitTransformsVersion=J?J?.version:-1),Q!==void 0&&(W.syncManually=Q),H!==void 0&&(W.markerActions=H),d.forEach(({visual:K,group:ce})=>w(K,ce,W)),Yn.update(u,W)}function A(T){y=T}function P(){d.forEach(({visual:T})=>T.destroy()),d.clear()}return{label:e,get groupCount(){let T=0;return d.forEach(({visual:B})=>{B.renderObject&&(T+=B.groupCount)}),T},get geometryVersion(){return c.version},get props(){return f},get params(){return h},get state(){return u},get theme(){return y},renderObjects:l,updated:s,createOrUpdate:g,setState:E,setTheme:A,getLoci:v,getAllLoci:S,eachLocation:b,mark:_,destroy:P}}function wze(e,t,r,n,o,i){let{createValues:s,createRenderableState:a}=ii.getUtils(t),l=W6(e,o.includeParent,t.boundingSphere,o.cellSize,o.batchSize),c=s(t,l,r,n,o),u=a(o);return Gd(t.kind,c,u,i)}function Z0(e,t){let{defaultProps:r,createGeometry:n,createLocationIterator:o,getLoci:i,eachLocation:s,setUpdateState:a,mustRecreate:l,processValues:c,dispose:u}=e,{createEmpty:d,updateValues:m,updateBoundingSphere:p,updateRenderableState:h,createPositionIterator:f}=e.geometryUtils,y=cu.create(),g={loci:nr,action:Ft.None,status:-1},v,b=Object.assign({},r),S=Lo.createEmpty(),_,w,E,A,P,T=-1,B,D;function M(O,J,Q){if(!Q&&!A)throw new Error("missing structureGroup");if(b=J,S=O,_=Q,cu.reset(y),!v||!A){y.createNew=!0,y.createGeometry=!0;return}a(y,b,w,S,E,_,A),Me.areHierarchiesEqual(A.structure,_.structure)||(y.updateTransform=!0,y.updateColor=!0,y.updateSize=!0),Oi.areEqual(S.color,E.color)||(y.updateColor=!0),A.structure.child!==_.structure.child&&(y.createGeometry=!0),(b.instanceGranularity!==w.instanceGranularity||b.cellSize!==w.cellSize||b.batchSize!==w.batchSize)&&(y.updateTransform=!0),Ra(b.unitKinds,w.unitKinds)||(y.createGeometry=!0),_.group.transformHash!==A.group.transformHash&&(_.group.units.length!==A.group.units.length||y.updateColor?y.updateTransform=!0:y.updateMatrix=!0);let H=_.group.units[0],W=A.group.units[0];_e.areOperatorsEqual(H,W)||(y.updateTransform=!0),_e.areConformationsEqual(H,W)||(y.createGeometry=!0),y.updateTransform&&(y.updateMatrix=!0),y.updateSize&&!("uSize"in v.values)&&(y.createGeometry=!0),(y.createGeometry||y.updateTransform)&&(A.structure.hashCode!==_.structure.hashCode&&(y.updateColor=!0,y.updateSize=!0),(S.color.granularity.startsWith("vertex")||v.values.dColorType.ref.value.startsWith("vertex")||S.color.granularity.startsWith("volume")||v.values.dColorType.ref.value.startsWith("volume"))&&(y.updateColor=!0))}function R(O){if(y.createNew)if(B=o(_,b),O)v=wze(_,O,B,S,b,t),D=f(O,v.values);else throw new Error("expected geometry to be given");else{if(!v)throw new Error("expected renderObject to be available");if(y.updateTransform){B=o(_,b);let{instanceCount:J,groupCount:Q}=B;b.instanceGranularity?Gn(J,"instance",v.values):Gn(J*Q,"groupInstance",v.values)}if(y.updateMatrix&&(W6(_,b.includeParent,v.values.invariantBoundingSphere.ref.value,b.cellSize,b.batchSize,v.values),"lodLevels"in v.values&&I.update(v.values.lodLevels,v.values.lodLevels.ref.value)),y.createGeometry)if(O)I.updateIfChanged(v.values.drawCount,ii.getDrawCount(O)),I.updateIfChanged(v.values.uVertexCount,ii.getVertexCount(O)),I.updateIfChanged(v.values.uGroupCount,ii.getGroupCount(O));else throw new Error("expected geometry to be given");(y.updateTransform||y.createGeometry)&&(p(v.values,O||P),D=f(O||P,v.values)),y.updateSize&&"uSize"in v.values&&ja(B,S.size,v.values),y.updateColor&&Ci(B,D,S.color,v.values),m(v.values,b),h(v.state,b)}w=b,E=S,A=_,O&&(P=O,T+=1)}function U(O,J,Q,H,W,K){return due(W.unitKinds,J)?n(O,J,Q,H,W,K):d(K)}function F(O){return!!(Fi(O)||Me.isLoci(O)&&Me.areRootsEquivalent(O.structure,A.structure)||$.Loci.is(O)&&Me.areRootsEquivalent(O.structure,A.structure)&&$.Loci.isWholeStructure(O))}function N(O,J,Q){let H=!1;if(yt.isLoci(O)){let{structure:W,group:K}=J;if(!Me.areEquivalent(O.structure,W))return!1;for(let ce of O.bonds){if(ce.aUnit!==ce.bUnit)continue;let V=K.unitIndexMap.get(ce.aUnit.id);V!==void 0&&Q(ve.ofSingleton(V))&&(H=!0)}}else if($.Loci.is(O)){let{structure:W,group:K}=J;if(!Me.areEquivalent(O.structure,W))return!1;for(let ce of O.elements){let V=K.unitIndexMap.get(ce.unit.id);V!==void 0&&Q(ve.ofSingleton(V))&&(H=!0)}}return H}function z(O,J,Q){return F(O)?w.instanceGranularity?J(ve.ofBounds(0,B.instanceCount)):J(ve.ofBounds(0,B.groupCount*B.instanceCount)):w.instanceGranularity?N(O,A,J):s(O,A,J,Q)}function q(O){v&&c?.(v.values,P,w,E,O.webgl)}return{get groupCount(){return B?B.count:0},get renderObject(){return B&&B.count?v:void 0},get geometryVersion(){return T},createOrUpdate(O,J,Q,H){if(M(J,Q,H||A),y.createGeometry){let W=U(O,_.group.units[0],_.structure,S,b,P);if(vg(W))return W.then(K=>{R(K),q(O)});R(W)}else R();q(O)},getLoci(O){return v?i(O,A,v.id):nr},eachLocation(O){for(B.reset();B.hasNext;){let{location:J,isSecondary:Q}=B.move();O(J,Q)}},mark(O,J){let Q=!0;if($.Loci.is(O)){Q=!1;let{invariantId:H}=A.group.units[0];for(let W of O.elements)if(W.unit.invariantId===H){Q=!0;break}}return Q?Sr.mark(v,O,J,z,g):!1},setVisibility(O){Sr.setVisibility(v,O)},setAlphaFactor(O){Sr.setAlphaFactor(v,O)},setPickable(O){Sr.setPickable(v,O)},setColorOnly(O){Sr.setColorOnly(v,O)},setTransform(O,J){Sr.setTransform(v,O,J)},setOverpaint(O,J){let Q={geometry:P,props:w,webgl:J};Sr.setOverpaint(v,O,z,!0,Q)},setTransparency(O,J){let Q={geometry:P,props:w,webgl:J};Sr.setTransparency(v,O,z,!0,Q)},setEmissive(O,J){let Q={geometry:P,props:w,webgl:J};Sr.setEmissive(v,O,z,!0,Q)},setSubstance(O,J){let Q={geometry:P,props:w,webgl:J};Sr.setSubstance(v,O,z,!0,Q)},setClipping(O){Sr.setClipping(v,O,z,!0)},setThemeStrength(O){Sr.setThemeStrength(v,O)},destroy(){u?.(P),v&&(v.state.disposed=!0,v=void 0)},mustRecreate:l}}var zn=k(k({},GE),El);function no(e,t){return Z0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.createGeometry=!0)},geometryUtils:dt.Utils}),t)}var iS=k(k({},HE),El);function sS(e,t){return Z0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0)},geometryUtils:aa.Utils}),t)}var aS=k(k({},jE),El);function lS(e,t){return Z0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0)},geometryUtils:Li.Utils}),t)}var Eue=k(k({},gue),El);function Due(e,t){return Z0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0)},geometryUtils:su.Utils}),t)}var $0=k(k({},qE),El);function J0(e,t){return Z0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.updateSize=!0)},geometryUtils:hn.Utils}),t)}var Mmr=k(k({},WE),El);var kue=k(k({},YE),El);function Mue(e,t){return Z0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.createGeometry=!0)},geometryUtils:Aa.Utils}),t)}var Bue=k(k({},XE),El);function Rue(e,t){return Z0(te(k({},e),{setUpdateState:(r,n,o,i,s,a,l)=>{e.setUpdateState(r,n,o,i,s,a,l),mi.areEqual(i.size,s.size)||(r.createGeometry=!0)},geometryUtils:ms.Utils}),t)}var Yn={create:()=>te(k({},Nt.createState()),{unitTransforms:null,unitTransformsVersion:-1}),update:(e,t)=>{Nt.updateState(e,t),t.unitTransforms!==void 0&&(e.unitTransforms=t.unitTransforms)}};var Gh=x(),cS=x(),Z_=x(),KE=je.add,Lue=je.add3,ey;(function(e){function t(r=2048,n=1024,o){let i=je.create(Float32Array,1,n,o?o.groupBuffer.ref.value:r),s=je.create(Float32Array,3,n,o?o.startBuffer.ref.value:r),a=je.create(Float32Array,3,n,o?o.endBuffer.ref.value:r),l=je.create(Float32Array,1,n,o?o.scaleBuffer.ref.value:r),c=je.create(Float32Array,1,n,o?o.capBuffer.ref.value:r),u=je.create(Float32Array,1,n,o?o.colorModeBuffer.ref.value:r),d=(p,h,f,y,g,v,b,S,_,w,E)=>{for(let A=0;A<6;++A)Lue(s,p,h,f),Lue(a,y,g,v),KE(i,E),KE(l,b),KE(c,(S?1:0)+(_?2:0)),KE(u,w)},m=(p,h,f,y,g,v,b,S,_)=>{let w=x.distance(p,h),E=f%2!==0,A=Math.floor((f+1)/2),P=w/(f+.5),T=2;x.setMagnitude(Z_,x.sub(Z_,h,p),P),x.copy(Gh,p);for(let B=0;B{let _=x.distance(p,h);m(p,h,_/f,y,g,v,!0,b,S)},getCylinders:()=>{let p=i.elementCount/6,h=je.compact(i,!0),f=je.compact(s,!0),y=je.compact(a,!0),g=je.compact(l,!0),v=je.compact(c,!0),b=je.compact(u,!0),S=o&&p<=o.cylinderCount?o.mappingBuffer.ref.value:new Float32Array(p*18),_=o&&p<=o.cylinderCount?o.indexBuffer.ref.value:new Uint32Array(p*12);return(!o||p>o.cylinderCount)&&Aze(p,S,_),Li.create(S,_,h,f,y,g,v,b,p,o)}}}e.create=t})(ey||(ey={}));function Aze(e,t,r){for(let n=0;n0,q=l(F),O=a?a(F):0,J=_&&(u?u(F):!1),[Q,H]=z?[J,h]:[h,J];if(E.currentGroup=F,O===0)M.radiusTop=M.radiusBottom=q,M.topCap=Q,M.bottomCap=H,Gr(E,A,P,.5,M);else if(O===1)M.radiusTop=M.radiusBottom=q*b,M.topCap=M.bottomCap=S,Mh(E,A,P,.5,v,J,M);else if(O===2||O===3||O===4||O===5||O===7||O===8){let W=O===2||O===3?2:O===4||O===5?3:1.5,K=q*(d/(.5*W)),ce=(q-K)*m;if(K6(T,A,P,i?i(F):null),M.topCap=Q,M.bottomCap=H,O===7||O===8){M.radiusTop=M.radiusBottom=q,Gr(E,A,P,.5,M);let V=q+f*q+f*q*y;al(ho,vs(ho,P,A),q*.5),fi(A,A,ho),vs(P,P,ho),M.radiusTop=M.radiusBottom=q*f,M.topCap=M.bottomCap=S,al(T,T,V),vs(A,A,T),vs(P,P,T),Mh(E,A,P,.5,g,J,M),O===8&&(al(T,T,V*2),fi(A,A,T),fi(P,P,T),Mh(E,A,P,.5,g,J,M))}else if(O===3||O===5){let V=q+K+d*q*m;al(T,T,V),M.radiusTop=M.radiusBottom=q,Gr(E,A,P,.5,M),vp(ho,ho,m*d*.2),fi(A,A,ho),vs(P,P,ho),M.radiusTop=M.radiusBottom=K,M.topCap=z?J:S,M.bottomCap=z?S:J,al(T,T,V),vs(A,A,T),vs(P,P,T),Gr(E,A,P,.5,M),W===3&&(al(T,T,V*2),fi(A,A,T),fi(P,P,T),Gr(E,A,P,.5,M))}else al(T,T,ce),M.radiusTop=M.radiusBottom=K,W===3&&Gr(E,A,P,.5,M),qne(E,A,P,.5,T,M)}else O===6&&(vp(ho,ho,.475),fi(A,A,ho),vs(P,P,ho),M.radiusTop=M.radiusBottom=q,M.topCap=Q,M.bottomCap=H,Gr(E,A,P,.5,M))}let R=n?ge.clone(n.boundingSphere):void 0,U=rt.getMesh(E);return D===0?{mesh:U}:(x.scale(B,B,1/D),R&&x.distance(B,R.center)/R.radius<.1?{mesh:U,boundingSphere:R}:{mesh:U})}function QE(e,t,r,n){let{linkCount:o,referencePosition:i,position:s,style:a,radius:l,ignore:c,stub:u}=t;if(!o)return{cylinders:Li.createEmpty(n)};let{linkScale:d,linkSpacing:m,linkCap:p,aromaticScale:h,aromaticSpacing:f,aromaticDashCount:y,dashCount:g,dashScale:v,dashCap:b,stubCap:S,colorMode:_}=r,w=_==="interpolate",E=w===!0?3:2,A=o*2,P=ey.create(A,A/4,n),T=x(),B=x(),D=x(),M=x(),R=x(),U=0;for(let z=0,q=o;z{let J=_[O];if((!E||A!=="all")&&(J===Fr.HydrogenBond||J===Fr.WeakHydrogenBond)){let Q=f[y[v[O]]],H=f[y[b[O]]];B.invariantPosition(T[Q],M),B.invariantPosition(T[H],R);let W=x.distance(M,R),K=W;x.copy(z,M),x.copy(q,R),PE(t,Q,(ce,V)=>{if(kc(r,t,T[V],"polar")){B.invariantPosition(T[V],D);let G=x.distance(D,R);G{if(kc(r,t,T[V],"polar")){B.invariantPosition(T[V],D);let G=x.distance(D,M);G1,radius:z=>{l.element=T[f[y[v[z]]]];let q=n.size.size(l);l.element=T[f[y[b[z]]]];let O=n.size.size(l);return Math.min(q,O)*w},ignore:z=>{if(S[z]===gu.Filtered)return!0;if(a)if(P==="stub"){let q=v[z];for(let O=y[q],J=y[q+1];O0){let z=ge.expand(ge(),(a??t).boundary.sphere,1*w);F.setBoundingSphere(z)}return F})}var Z6=k(k(k({},zn),$u),$E);function Fue(e){return no({defaultProps:C.getDefaultValues(Z6),createGeometry:Ize,createLocationIterator:kze,getLoci:Eze,eachLocation:Dze,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.dashCount!==n.dashCount||r.dashScale!==n.dashScale||r.dashCap!==n.dashCap||r.radialSegments!==n.radialSegments||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.parentDisplay!==n.parentDisplay;let l=Oo.get(s.structure).version;t.info.interactionsHash!==l&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.info.interactionsHash=l)}},e)}function Eze(e,t,r){let{objectId:n,instanceId:o,groupId:i}=e;if(r===n){let{structure:s,group:a}=t,l=s.unitMap.get(a.units[o].id),c=Oo.get(s).value,{a:u,b:d}=c.unitsContacts.get(l.id);return om.Loci(s,c,[{unitA:l,indexA:u[i],unitB:l,indexB:d[i]},{unitA:l,indexA:d[i],unitB:l,indexB:u[i]}])}return nr}var Q6=new Set;function Dze(e,t,r,n){let o=!1;if(om.isLoci(e)){let{structure:i,group:s}=t;if(!Me.areEquivalent(e.data.structure,i))return!1;let a=Oo.get(i).value;if(e.data.interactions!==a)return!1;let l=s.units[0],c=a.unitsContacts.get(l.id),u=c.edgeCount*2;for(let d of e.elements){if(d.unitA!==d.unitB)continue;let m=s.unitIndexMap.get(d.unitA.id);if(m!==void 0){let p=c.getDirectedEdgeIndex(d.indexA,d.indexB);p!==-1&&r(ve.ofSingleton(m*u+p))&&(o=!0)}}}else if($.Loci.is(e)){let{structure:i,group:s}=t;if(!Me.areEquivalent(e.structure,i))return!1;let a=Oo.get(i).value;if(!a)return!1;let l=s.units[0],c=a.unitsContacts.get(l.id),u=a.unitsFeatures.get(l.id),d=c.edgeCount*2,{offset:m}=c,{offsets:p,indices:h}=u.elementsIndex,{members:f,offsets:y}=u;for(let g of e.elements){let v=s.unitIndexMap.get(g.unit.id);v!==void 0&&(Te.forEach(g.indices,b=>{for(let S=p[b],_=p[b+1];S<_;++S){let w=h[S];for(let E=m[w],A=m[w+1];E{if(n){let S=c.a[b];for(let w=y[S],E=y[S+1];w{let p=r.units[m];return c.unitA=p,c.indexA=i.a[d],c.unitB=p,c.indexB=i.b[d],l})}function Mze(e,t,r,n,o){if(!t.hasAtomic)return dt.createEmpty(o);let i=$.Location.create(t),s=Oo.get(t).value,{contacts:a,unitsFeatures:l}=s,{edgeCount:c,edges:u}=a,{sizeFactor:d,ignoreHydrogens:m,ignoreHydrogensVariant:p,parentDisplay:h}=n;if(!c)return dt.createEmpty(o);let{child:f}=t,y=x(),g=x(),v=x(),b={linkCount:c,position:(w,E,A)=>{let{unitA:P,indexA:T,unitB:B,indexB:D,props:{type:M}}=u[A],R=l.get(P),U=l.get(B),F=t.unitMap.get(P),N=t.unitMap.get(B);if((!m||p!=="all")&&(M===Fr.HydrogenBond||M===Fr.WeakHydrogenBond)){let z=R.members[R.offsets[T]],q=U.members[U.offsets[D]];F.conformation.position(F.elements[z],g),N.conformation.position(N.elements[q],v);let O=x.distance(g,v),J=O;x.copy(w,g),x.copy(E,v),js(t,F,z,(Q,H)=>{let W=Q.elements[H];if(kc(t,Q,W,"polar")){Q.conformation.position(W,y);let K=x.distance(y,v);K{let W=Q.elements[H];if(kc(t,Q,W,"polar")){Q.conformation.position(W,y);let K=x.distance(y,g);K1,radius:w=>{let E=u[w],A=l.get(E.unitA);i.unit=t.unitMap.get(E.unitA),i.element=i.unit.elements[A.members[A.offsets[E.indexA]]];let P=r.size.size(i),T=l.get(E.unitB);i.unit=t.unitMap.get(E.unitB),i.element=i.unit.elements[T.members[T.offsets[E.indexB]]];let B=r.size.size(i);return Math.min(P,B)*d},ignore:w=>{if(u[w].props.flag===gu.Filtered)return!0;if(f){let E=u[w];if(h==="stub"){let A=f.unitMap.get(E.unitA);if(!A)return!0;let P=t.unitMap.get(E.unitA),{offsets:T,members:B}=l.get(E.unitA);for(let D=T[E.indexA],M=T[E.indexA+1];D0){let{child:w}=t,E=ge.expand(ge(),(w??t).boundary.sphere,1*d);S.setBoundingSphere(E)}return S}var J6=k(k(k({},im),$u),$E);function Oue(e){return sl({defaultProps:C.getDefaultValues(J6),createGeometry:Mze,createLocationIterator:Lze,getLoci:Bze,eachLocation:Rze,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.dashCount!==n.dashCount||r.dashScale!==n.dashScale||r.dashCap!==n.dashCap||r.radialSegments!==n.radialSegments||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.parentDisplay!==n.parentDisplay;let l=Oo.get(s).version;t.info.interactionsHash!==l&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.info.interactionsHash=l)}},e)}function Bze(e,t,r){let{objectId:n,groupId:o}=e;if(r===n){let i=Oo.get(t).value,s=i.contacts.edges[o],a=t.unitMap.get(s.unitA),l=t.unitMap.get(s.unitB);return om.Loci(t,i,[{unitA:a,indexA:s.indexA,unitB:l,indexB:s.indexB},{unitA:l,indexA:s.indexB,unitB:a,indexB:s.indexA}])}return nr}var JE=new Map,$6=new Set;function Rze(e,t,r,n){let o=!1;if(om.isLoci(e)){if(!Me.areEquivalent(e.data.structure,t))return!1;let i=Oo.get(t).value;if(e.data.interactions!==i)return!1;let{contacts:s}=i;for(let a of e.elements){let l=s.getEdgeIndex(a.indexA,a.unitA.id,a.indexB,a.unitB.id);l!==-1&&r(ve.ofSingleton(l))&&(o=!0)}}else if($.Loci.is(e)){if(!Me.areEquivalent(e.structure,t)||n&&e.elements.length===1)return!1;let i=Oo.get(t).value;if(!i)return!1;let{contacts:s,unitsFeatures:a}=i;for(let l of e.elements)JE.set(l.unit.id,l.indices);for(let l of e.elements){let{unit:c}=l;_e.isAtomic(c)&&Te.forEach(l.indices,u=>{for(let d of s.getContactIndicesForElement(u,c))$6.add(d)})}$6.forEach(l=>{if(n){let{indexA:c,unitA:u,indexB:d,unitB:m}=s.edges[l],p=JE.get(u),h=JE.get(m);if(!p||!h)return;let{offsets:f,members:y}=a.get(u);for(let b=f[c],S=f[c+1];b{let c=r.edges[l];return s.unitA=e.unitMap.get(c.unitA),s.indexA=c.indexA,s.unitB=e.unitMap.get(c.unitB),s.indexB=c.indexB,i},!0)}var Nue={"intra-unit":(e,t)=>Tn("Intra-unit interactions cylinder",e,t,Fue),"inter-unit":(e,t)=>Ni("Inter-unit interactions cylinder",e,t,Oue)},Uue=te(k(k({},Z6),J6),{unitKinds:Vh(["atomic"]),sizeFactor:C.Numeric(.2,{min:.01,max:1,step:.01}),visuals:C.MultiSelect(["intra-unit","inter-unit"],C.objectToOptions(Nue))});function Fze(e,t){return C.clone(Uue)}function Oze(e,t){return Nt.createMulti("Interactions",e,t,Yn,Nue)}var uS={name:"interactions",label:"Non-covalent Interactions",description:"Displays non-covalent interactions as dashed cylinders.",factory:Oze,getParams:Fze,defaultValues:C.getDefaultValues(Uue),defaultColorTheme:{name:"interaction-type"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0&&Oo.isApplicable(e),ensureCustomProperties:{attach:(e,t)=>Oo.attach(e,t,void 0,!0),detach:e=>Oo.ref(e,!1)},getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent};var zue=Ur.create({name:"computed-interactions-prop",category:"custom-props",display:{name:"Interactions"},ctor:class extends Ur.Handler{constructor(){super(...arguments),this.provider=Oo,this.labelProvider={label:e=>{if(this.params.showTooltip)switch(e.kind){case"element-loci":if(e.elements.length===0)return;let t=[],r=this.getStructures(e.structure);for(let n of r){let o=this.provider.get(n).value;if(!o)continue;let i=$.Loci.remap(e,n);if(i.elements.length!==1)continue;let s=i.elements[0];if(Te.size(s.indices)!==1)continue;let a=o.unitsFeatures.get(s.unit.id);if(!a)continue;let l=[],c=[],u=[],d=Te.start(s.indices),{types:m,groups:p,elementsIndex:{indices:h,offsets:f}}=a;for(let y=f[d],g=f[d+1];yTypes ${l.join(", ")}`),c.length&&u.push(`Groups ${c.join(", ")}`),u.length&&t.push(`Interaction Feature: ${u.join(" | ")}`)}return t.length?t.join("
"):void 0;default:return}}}}getStructures(e){let t=[],r=this.ctx.helpers.substructureParent.get(e);if(r){let o=this.ctx.state.data.select(qt.Generators.ofType(ae.Molecule.Structure,r.transform.ref));for(let i of o)i.obj&&So(t,i.obj.data)}return t}update(e){let t=this.params.autoAttach!==e.autoAttach||this.params.showTooltip!==e.showTooltip;return this.params.autoAttach=e.autoAttach,this.params.showTooltip=e.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),t}register(){this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach),this.ctx.representation.structure.themes.colorThemeRegistry.add(Q_),this.ctx.managers.lociLabels.addProvider(this.labelProvider),this.ctx.representation.structure.registry.add(uS)}unregister(){this.ctx.customStructureProperties.unregister(this.provider.descriptor.name),this.ctx.representation.structure.themes.colorThemeRegistry.remove(Q_),this.ctx.managers.lociLabels.removeProvider(this.labelProvider),this.ctx.representation.structure.registry.remove(uS)}},params:()=>({autoAttach:C.Boolean(!1),showTooltip:C.Boolean(!0)})});var Vue=Ur.create({name:"computed-secondary-structure-prop",category:"custom-props",display:{name:"Secondary Structure"},ctor:class extends Ur.Handler{constructor(){super(...arguments),this.provider=wa}update(e){let t=this.params.autoAttach!==e.autoAttach;return this.params.autoAttach=e.autoAttach,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),t}register(){this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach)}unregister(){this.ctx.customStructureProperties.unregister(this.provider.descriptor.name)}},params:()=>({autoAttach:C.Boolean(!1)})});var Gue=Ur.create({name:"computed-valence-model-prop",category:"custom-props",display:{name:"Valence Model"},ctor:class extends Ur.Handler{constructor(){super(...arguments),this.provider=xf,this.labelProvider={label:e=>{if(this.params.showTooltip)switch(e.kind){case"element-loci":if(e.elements.length===0)return;let t=[],r=this.getStructures(e.structure);for(let n of r){let o=this.provider.get(n).value;if(!o)continue;let i=$.Loci.remap(e,n);if(i.elements.length!==1)continue;let s=i.elements[0];if(Te.size(s.indices)!==1)continue;let a=o.get(s.unit.id);if(!a)continue;let l=Te.start(s.indices),c=a.charge[l],u=a.idealGeometry[l],d=a.implicitH[l],m=a.totalH[l];t.push(`Valence Model: Charge ${c} | Ideal Geometry ${cce(u)} | Implicit H ${d} | Total H ${m}`)}return t.length?t.join("
"):void 0;default:return}}}}getStructures(e){let t=[],r=this.ctx.helpers.substructureParent.get(e);if(r){let o=this.ctx.state.data.select(qt.Generators.ofType(ae.Molecule.Structure,r.transform.ref));for(let i of o)i.obj&&So(t,i.obj.data)}return t}update(e){let t=this.params.autoAttach!==e.autoAttach||this.params.showTooltip!==e.showTooltip;return this.params.autoAttach=e.autoAttach,this.params.showTooltip=e.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),t}register(){this.ctx.customStructureProperties.register(this.provider,this.params.autoAttach),this.ctx.managers.lociLabels.addProvider(this.labelProvider)}unregister(){this.ctx.customStructureProperties.unregister(this.provider.descriptor.name),this.ctx.managers.lociLabels.removeProvider(this.labelProvider)}},params:()=>({autoAttach:C.Boolean(!1),showTooltip:C.Boolean(!0)})});var eU=Oe(16448250),Nze="Assigns a color based on SIFTS mapping.",$_=new Map,Hue=k({},Ro({type:"colors",colorList:"set-1"}));function Uze(e){return Hue}function jue(e,t){let r;if(e.structure){for(let a of e.structure.models){let l=Cl.Provider.get(a).value;if(l)for(let c of l.accession)!c||$_.has(c)||$_.set(c,$_.size)}let n=$.Location.create(e.structure),o=jo($_.size+1,t,{valueLabel:a=>`${a}`}),i=new Map,s=a=>{let l=Cl.getKey(a);if(!l)return eU;if(i.has(l))return i.get(l);let c=o.color($_.get(l));return i.set(l,c),c};r=a=>$.Location.is(a)&&_e.isAtomic(a.unit)?s(a):yt.isLocation(a)?(n.unit=a.aUnit,n.element=a.aUnit.elements[a.aIndex],s(n)):eU}else r=()=>eU;return{factory:jue,granularity:"group",preferSmoothing:!0,color:r,props:t,description:Nze}}var tU={name:"sifts-mapping",label:"SIFTS Mapping",category:Oi.Category.Residue,factory:jue,getParams:Uze,defaultValues:C.getDefaultValues(Hue),isApplicable:e=>{var t;return!!(!((t=e.structure)===null||t===void 0)&&t.models.some(r=>Cl.Provider.isApplicable(r)))},ensureCustomProperties:{attach:(e,t)=>Y(void 0,null,function*(){if(t.structure)for(let r of t.structure.models)yield Cl.Provider.attach(e,r,void 0,!0)}),detach:e=>{if(e.structure)for(let t of e.structure.models)Cl.Provider.ref(t,!1)}}};var que=Ur.create({name:"sifts-mapping-prop",category:"custom-props",display:{name:"SIFTS Mapping"},ctor:class extends Ur.Handler{constructor(){super(...arguments),this.provider=Cl.Provider,this.labelProvider={label:e=>{if(this.params.showTooltip)return zze(e)}}}update(e){let t=this.params.autoAttach!==e.autoAttach||this.params.showTooltip!==e.showTooltip;return this.params.autoAttach=e.autoAttach,this.params.showTooltip=e.showTooltip,this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name,this.params.autoAttach),t}register(){this.ctx.customModelProperties.register(this.provider,this.params.autoAttach),this.ctx.representation.structure.themes.colorThemeRegistry.add(tU),this.ctx.managers.lociLabels.addProvider(this.labelProvider)}unregister(){this.ctx.customModelProperties.unregister(this.provider.descriptor.name),this.ctx.representation.structure.themes.colorThemeRegistry.remove(tU),this.ctx.managers.lociLabels.removeProvider(this.labelProvider)}},params:()=>({autoAttach:C.Boolean(!0),showTooltip:C.Boolean(!0)})});function zze(e){if(e.kind==="element-loci"){if(e.elements.length===0)return;let t=e.elements[0],r=t.unit,n=$.Location.create(e.structure,r,r.elements[Te.getAt(t.indices,0)]);return Cl.getLabel(n)}}var xp;(function(e){e.Descriptor={name:"ihm_cross_link_restraint"},e.Provider=ta.create(e.Descriptor);function t(r,n){let o={entity_id:r.entity_id_1,asym_id:r.asym_id_1,seq_id:r.seq_id_1,atom_id:r.atom_id_1},i={entity_id:r.entity_id_2,asym_id:r.asym_id_2,seq_id:r.seq_id_2,atom_id:r.atom_id_2};function s(p,h,f){let y=p.get(h);y?y.push(f):p.set(h,[f])}function a(p,h){let f=h.entity_id.value(p),y=h.asym_id.value(p),g=h.seq_id.value(p);if(r.model_granularity.value(p)==="by-atom"){let v=n.atomicHierarchy.index.findAtom({auth_seq_id:g,label_asym_id:y,label_atom_id:h.atom_id.value(p),label_entity_id:f});v>=0&&s(c,v,p)}else if(n.coarseHierarchy.isDefined){let v=n.coarseHierarchy.spheres.findSequenceKey(f,y,g);if(v>=0)s(u,v,p);else{let b=n.coarseHierarchy.gaussians.findSequenceKey(f,y,g);b>=0&&s(d,b,p)}}}function l(p){switch(p){case 0:return c;case 1:return u;case 2:return d}}let c=new Map,u=new Map,d=new Map,m=[];for(let p=0;p{let y=l(h).get(p);return y!==void 0?y:m},data:r}}e.fromTable=t})(xp||(xp={}));var Vze=[];function Wue(e,t,r,n){return`${e}|${t.id}|${r}|${n.id}`}var J_=class{getPairIndices(t,r,n,o){let i=Wue(t,r,n,o);return this.pairKeyIndices.get(i)||Vze}getPairs(t,r,n,o){return this.getPairIndices(t,r,n,o).map(s=>this.pairs[s])}constructor(t){this.pairs=t;let r=new Map;this.pairs.forEach((n,o)=>{let i=Wue(n.indexA,n.unitA,n.indexB,n.unitB),s=r.get(i);s?s.push(o):r.set(i,[o])}),this.count=t.length,this.pairKeyIndices=r}};var bp=Sc.createProvider({label:"Cross Link Restraint",descriptor:Pi({name:"integrative-cross-link-restraint"}),type:"local",defaultParams:{},getParams:e=>({}),isApplicable:e=>e.models.some(t=>!!xp.Provider.get(t)),obtain:(e,t,r)=>Y(void 0,null,function*(){return{value:jze(t)}})});var Ju;(function(e){let t;(function(f){f.CrossLinkRestraint="cross-link-restraint"})(t=e.Tag||(e.Tag={}));function r(f){return f.models.some(y=>!!xp.Provider.get(y))}e.isApplicable=r;let n=x(),o=x();function i(f){return f.unitA.conformation.position(f.unitA.elements[f.indexA],n),f.unitB.conformation.position(f.unitB.elements[f.indexB],o),x.distance(n,o)}e.distance=i;function s(f,y,g){return vP("cross-link-restraints",{structure:y,crossLinkRestraints:f},g)}e.Location=s;function a(f){return!!f&&f.kind==="data-location"&&f.tag==="cross-link-restraints"}e.isLocation=a;function l(f,y){return f.data.structure===y.data.structure&&f.data.crossLinkRestraints===y.data.crossLinkRestraints&&f.element===y.element}e.areLocationsEqual=l;function c(f,y){let g=f.pairs[y];return`Cross Link Restraint | Type: ${g.restraintType} | Threshold: ${g.distanceThreshold} \u212B | Psi: ${g.psi} | Sigma 1: ${g.sigma1} | Sigma 2: ${g.sigma2} | Distance: ${i(g).toFixed(2)} \u212B`}function u(f){return c(f.data.crossLinkRestraints,f.element)}e.locationLabel=u;function d(f,y,g){return l0("cross-link-restraints",{structure:f,crossLinkRestraints:y},g,v=>p(y,g,v),()=>h(f,y,g))}e.Loci=d;function m(f){return!!f&&f.kind==="data-loci"&&f.tag==="interactions"}e.isLoci=m;function p(f,y,g){return xl.fromPairProvider(y.length,(v,b,S)=>{let _=f.pairs[y[v]];_.unitA.conformation.position(_.unitA.elements[_.indexA],b),_.unitB.conformation.position(_.unitB.elements[_.indexB],S)},g)}e.getBoundingSphere=p;function h(f,y,g){let v=g[0];if(v===void 0)return"";let b=y.pairs[v];return[c(y,v),P_(yt.Location(f,b.unitA,b.indexA,f,b.unitB,b.indexB))].join("
")}e.getLabel=h})(Ju||(Ju={}));function Yue(e,t,r){let{elements:n}=t,o=n.length,i=t.kind;for(let s=0;se.set(l,s))}}function Gze(e,t,r){if(t.model!==r.model||t.model.sourceData.kind!=="mmCIF")return;let n=xp.Provider.get(t.model);if(!n)return;let o=new Map,i=new Map;Yue(o,t,n),Yue(i,r,n),o.forEach((s,a)=>{let l=i.get(a);l!==void 0&&e.push(eD(t,s,r,l,n,a),eD(r,l,t,s,n,a))})}function Hze(e,t){if(t.model.sourceData.kind!=="mmCIF")return;let r=xp.Provider.get(t.model);if(!r)return;let{elements:n}=t,o=n.length,i=t.kind,s=new Map;for(let a=0;a{let u=s.get(c);u?u.push(a):s.set(c,[a])})}s.forEach((a,l)=>{if(a.length<2)return;let[c,u]=a;e.push(eD(t,c,t,u,r,l),eD(t,u,t,c,r,l))})}function eD(e,t,r,n,o,i){return{unitA:e,indexA:t,unitB:r,indexB:n,restraintType:o.data.restraint_type.value(i),distanceThreshold:o.data.distance_threshold.value(i),psi:o.data.psi.value(i),sigma1:o.data.sigma_1.value(i),sigma2:o.data.sigma_2.value(i)}}function jze(e){let t=[];if(!e.models.some(n=>xp.Provider.get(n)))return new J_(t);let r=e.units.length;for(let n=0;n{let h=i.pairs[p],f=h.unitA,y=h.unitB;f.conformation.position(f.elements[h.indexA],d),y.conformation.position(y.elements[h.indexB],m)},radius:d=>{let m=i.pairs[d];return a.unit=m.unitA,a.element=m.unitA.elements[m.indexA],r.size.size(a)*s}},{mesh:c,boundingSphere:u}=yu(e,l,n,o);if(u)c.setBoundingSphere(u);else if(c.triangleCount>0){let d=ge.expand(ge(),t.boundary.sphere,1*s);c.setBoundingSphere(d)}return c}var Xue=te(k(k({},im),$u),{sizeFactor:C.Numeric(.5,{min:0,max:10,step:.1})});function Wze(e){return sl({defaultProps:C.getDefaultValues(Xue),createGeometry:qze,createLocationIterator:Yze,getLoci:Xze,eachLocation:Kze,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.radialSegments!==n.radialSegments||r.linkCap!==n.linkCap}},e)}function Yze(e){let t=bp.get(e).value,{pairs:r}=t,n=r.length,o=1,i=Ju.Location(t,e);return Pr(n,o,1,a=>(i.element=a,i),!0)}function Xze(e,t,r){let{objectId:n,groupId:o}=e;if(r===n){let i=bp.get(t).value;if(i.pairs[o])return Ju.Loci(t,i,[o])}return nr}function Kze(e,t,r){let n=!1;if(Ju.isLoci(e)){if(!Me.areEquivalent(e.data.structure,t))return!1;let o=bp.get(t).value;if(e.data.crossLinkRestraints!==o)return!1;for(let i of e.elements)r(ve.ofSingleton(i))&&(n=!0)}return n}var Qze={"cross-link-restraint":(e,t)=>Ni("Cross-link restraint",e,t,Wze)},Kue=k({},Xue);function Zze(e,t){return C.clone(Kue)}function $ze(e,t){return Nt.createMulti("CrossLinkRestraint",e,t,Yn,Qze)}var rU={name:Ju.Tag.CrossLinkRestraint,label:"Cross Link Restraint",description:"Displays cross-link restraints.",factory:$ze,getParams:Zze,defaultValues:C.getDefaultValues(Kue),defaultColorTheme:{name:Ju.Tag.CrossLinkRestraint},defaultSizeTheme:{name:"uniform"},isApplicable:e=>Ju.isApplicable(e),ensureCustomProperties:{attach:(e,t)=>bp.attach(e,t,void 0,!0),detach:e=>bp.ref(e,!1)}};var Que=Oe(13421772),Jze="Colors cross-links by the deviation of the observed distance versus the modeled distance (e.g. modeled / `ihm_cross_link_restraint.distance_threshold`).",Zue={domain:C.Interval([.5,1.5],{step:.01}),list:C.ColorList("red-grey",{presetKind:"scale"})};function eVe(e){return Zue}function $ue(e,t){let r,n,o=e.structure&&bp.get(e.structure).value;if(o){n=cs.create({domain:t.domain,listOrName:t.list.colors});let i=n.color;r=s=>{if(Ju.isLocation(s)){let a=o.pairs[s.element];if(a)return i(Ju.distance(a)/a.distanceThreshold)}return Que}}else r=()=>Que;return{factory:$ue,granularity:"group",color:r,props:t,description:Jze,legend:n?n.legend:void 0}}var nU={name:"cross-link",label:"Cross Link",category:Oi.Category.Misc,factory:$ue,getParams:eVe,defaultValues:C.getDefaultValues(Zue),isApplicable:e=>!!e.structure&&Ju.isApplicable(e.structure),ensureCustomProperties:{attach:(e,t)=>t.structure?bp.attach(e,t.structure,void 0,!0):Promise.resolve(),detach:e=>e.structure&&bp.ref(e.structure,!1)}};var Jue=Ur.create({name:"integrative-cross-link-restraint",category:"custom-props",display:{name:"Cross Link Restraint"},ctor:class extends Ur.Handler{constructor(){super(...arguments),this.provider=xp.Provider}register(){this.provider.formatRegistry.add("mmCIF",tVe),this.ctx.representation.structure.themes.colorThemeRegistry.add(nU),this.ctx.representation.structure.registry.add(rU)}unregister(){this.provider.formatRegistry.remove("mmCIF"),this.ctx.representation.structure.themes.colorThemeRegistry.remove(nU),this.ctx.representation.structure.registry.remove(rU)}}});function tVe(e){if(!rn.is(e.sourceData))return;let{ihm_cross_link_restraint:t}=e.sourceData.data.db;if(t._rowCount!==0)return xp.fromTable(t,e)}var ew={State:JN,Representation:t6,Camera:r6,Misc:h6},Bc={Representation:y6,Camera:b6,CustomProps:oU};function dS(e,t,r={}){let n=r;return typeof n.type=="string"||typeof n.color=="string"||typeof n.size=="string"?rVe(e,t||Me.Empty,r):tde(e,t||Me.Empty,r)}function ede(e,t){let{themes:r}=e.representation.structure;return t?r.colorThemeRegistry.getApplicableTypes({structure:t}):r.colorThemeRegistry.types}function tw(e,t,r,n,o){let{registry:i,themes:s}=e.representation.structure,a=i.get(r||i.default.name),l=s.colorThemeRegistry.get(n||a.defaultColorTheme.name),c=C.getDefaultValues(l.getParams({structure:t||Me.Empty}));return l.name===a.defaultColorTheme.name&&Object.assign(c,a.defaultColorTheme.props),{name:l.name,params:Object.assign(c,o)}}function iU(e,t,r,n,o){let{registry:i,themes:s}=e.representation.structure,a=i.get(r||i.default.name),l=s.sizeThemeRegistry.get(n||a.defaultSizeTheme.name),c=C.getDefaultValues(l.getParams({structure:t||Me.Empty}));return l.name===a.defaultSizeTheme.name&&Object.assign(c,a.defaultSizeTheme.props),{name:l.name,params:Object.assign(c,o)}}function rVe(e,t,r){let n=r.type&&e.representation.structure.registry.get(r.type)||e.representation.structure.registry.default.provider,o=r.color&&e.representation.structure.themes.colorThemeRegistry.get(r.color)||e.representation.structure.themes.colorThemeRegistry.get(n.defaultColorTheme.name),i=r.size&&e.representation.structure.themes.sizeThemeRegistry.get(r.size)||e.representation.structure.themes.sizeThemeRegistry.get(n.defaultSizeTheme.name);return tde(e,t,{type:n,typeParams:r.typeParams,color:o,colorParams:r.colorParams,size:i,sizeParams:r.sizeParams})}function tde(e,t,r={}){let{themes:n}=e.representation.structure,o={structure:t},i=r.type||e.representation.structure.registry.default.provider,s=C.getDefaultValues(i.getParams(n,t)),a=Object.assign(s,r.typeParams),l=r.color||n.colorThemeRegistry.get(i.defaultColorTheme.name),c=C.getDefaultValues(l.getParams(o));l.name===i.defaultColorTheme.name&&Object.assign(c,i.defaultColorTheme.props);let u=Object.assign(c,r.colorParams),d=r.size||n.sizeThemeRegistry.get(i.defaultSizeTheme.name),m=C.getDefaultValues(d.getParams(o));d.name===i.defaultSizeTheme.name&&Object.assign(m,i.defaultSizeTheme.props);let p=Object.assign(m,r.sizeParams);return{type:{name:i.name,params:a},colorTheme:{name:l.name,params:u},sizeTheme:{name:d.name,params:p}}}var nVe=e=>{let t=Ge.Representation.StructureRepresentation3D.definition.params(void 0,e);return{expandRadius:C.Numeric(5,{min:1,max:10,step:1}),targetParams:C.Group(t,{label:"Target",customDefault:dS(e,void 0,{type:"ball-and-stick",size:"physical",typeParams:{sizeFactor:.22,sizeAspectRatio:.73,adjustCylinderLength:!0,xrayShaded:!0,aromaticBonds:!1,multipleBonds:"off",excludeTypes:["hydrogen-bond","metal-coordination"]}})}),surroundingsParams:C.Group(t,{label:"Surroundings",customDefault:dS(e,void 0,{type:"ball-and-stick",size:"physical",typeParams:{sizeFactor:.16,excludeTypes:["hydrogen-bond","metal-coordination"]}})}),nciParams:C.Group(t,{label:"Non-covalent Int.",customDefault:dS(e,void 0,{type:uS,color:Q_,size:mi.BuiltIn.uniform})}),components:C.MultiSelect(rde,C.arrayToOptions(rde)),excludeTargetFromSurroundings:C.Boolean(!1,{label:"Exclude Target",description:'Exclude the focus "target" from the surroudings component.'}),ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),ignoreLight:C.Boolean(!1),material:ds.getParam(),clip:C.Group(tp.Params)}},rde=["target","surroundings","interactions"],No=function(e){return e.TargetSel="structure-focus-target-sel",e.TargetRepr="structure-focus-target-repr",e.SurrSel="structure-focus-surr-sel",e.SurrRepr="structure-focus-surr-repr",e.SurrNciRepr="structure-focus-surr-nci-repr",e}(No||{}),oVe=new Set([No.TargetSel,No.TargetRepr,No.SurrSel,No.SurrRepr,No.SurrNciRepr]),sU=class extends Ur.WithSubscribers{constructor(){super(...arguments),this.currentSource=void 0}get surrLabel(){return`[Focus] Surroundings (${this.params.expandRadius} \xC5)`}getReprParams(t){return te(k({},t),{type:{name:t.type.name,params:te(k({},t.type.params),{ignoreHydrogens:this.params.ignoreHydrogens,ignoreHydrogensVariant:this.params.ignoreHydrogensVariant,ignoreLight:this.params.ignoreLight,material:this.params.material,clip:this.params.clip})}})}ensureShape(t){var r;let n=this.plugin.state.data,o=n.tree,i=n.build(),s=qt.findUniqueTagsInSubtree(o,t.transform.ref,oVe);s[No.TargetSel]||(s[No.TargetSel]=i.to(t).apply(Ge.Model.StructureSelectionFromBundle,{bundle:$.Bundle.Empty,label:"[Focus] Target"},{tags:No.TargetSel}).ref),s[No.SurrSel]||(s[No.SurrSel]=i.to(t).apply(Ge.Model.StructureSelectionFromExpression,{expression:oe.struct.generator.empty(),label:this.surrLabel},{tags:No.SurrSel}).ref);let a=this.params.components;return a.indexOf("target")>=0&&!s[No.TargetRepr]&&(s[No.TargetRepr]=i.to(s[No.TargetSel]).apply(Ge.Representation.StructureRepresentation3D,this.getReprParams(this.params.targetParams),{tags:No.TargetRepr}).ref),a.indexOf("surroundings")>=0&&!s[No.SurrRepr]&&(s[No.SurrRepr]=i.to(s[No.SurrSel]).apply(Ge.Representation.StructureRepresentation3D,this.getReprParams(this.params.surroundingsParams),{tags:No.SurrRepr}).ref),a.indexOf("interactions")>=0&&!s[No.SurrNciRepr]&&t.obj&&uS.isApplicable((r=t.obj)===null||r===void 0?void 0:r.data)&&(s[No.SurrNciRepr]=i.to(s[No.SurrSel]).apply(Ge.Representation.StructureRepresentation3D,this.getReprParams(this.params.nciParams),{tags:No.SurrNciRepr}).ref),{state:n,builder:i,refs:s}}clear(t){let r=this.plugin.state.data;this.currentSource=void 0;let n=r.select(qt.Generators.byRef(t).subtree().withTag(No.TargetSel)),o=r.select(qt.Generators.byRef(t).subtree().withTag(No.SurrSel));if(n.length===0&&o.length===0)return;let i=r.build(),s=$.Bundle.Empty;for(let l of n)i.to(l).update(Ge.Model.StructureSelectionFromBundle,c=>te(k({},c),{bundle:s}));let a=oe.struct.generator.empty();for(let l of o)i.to(l).update(Ge.Model.StructureSelectionFromExpression,c=>te(k({},c),{expression:a}));return ct.State.Update(this.plugin,{state:r,tree:i,options:{doNotLogTiming:!0,doNotUpdateCurrent:!0}})}focus(t){return Y(this,null,function*(){let r=this.plugin.helpers.substructureParent.get(t.structure);if(!r||!r.obj)return;this.currentSource=t;let n=$.Loci.remap(t,r.obj.data),o=$.Loci.extendToWholeResidues(n),i=$.Bundle.fromLoci(o),s=$.Bundle.toExpression(i),a=oe.struct.modifier.includeSurroundings({0:s,radius:this.params.expandRadius,"as-whole-residues":!0});this.params.excludeTargetFromSurroundings&&(a=oe.struct.modifier.exceptBy({0:a,by:s}));let{state:l,builder:c,refs:u}=this.ensureShape(r);c.to(u[No.TargetSel]).update(Ge.Model.StructureSelectionFromBundle,d=>te(k({},d),{bundle:i})),c.to(u[No.SurrSel]).update(Ge.Model.StructureSelectionFromExpression,d=>te(k({},d),{expression:a,label:this.surrLabel})),yield ct.State.Update(this.plugin,{state:l,tree:c,options:{doNotLogTiming:!0,doNotUpdateCurrent:!0}})})}register(t){this.subscribeObservable(this.plugin.managers.structure.focus.behaviors.current,r=>{r?this.focus(r.loci):this.clear(ur.RootRef)})}update(t){return Y(this,null,function*(){let r=this.params;if(this.params=t,r.excludeTargetFromSurroundings!==t.excludeTargetFromSurroundings)return this.currentSource&&this.focus(this.currentSource),!0;let n=this.plugin.state.data,o=n.build(),i=qt.Generators.root.subtree(),s=this.params.components,a=s.indexOf("target")>=0;for(let l of n.select(i.withTag(No.TargetRepr)))a?o.to(l).update(this.getReprParams(this.params.targetParams)):o.delete(l.transform.ref);a=s.indexOf("surroundings")>=0;for(let l of n.select(i.withTag(No.SurrRepr)))a?o.to(l).update(this.getReprParams(this.params.surroundingsParams)):o.delete(l.transform.ref);a=s.indexOf("interactions")>=0;for(let l of n.select(i.withTag(No.SurrNciRepr)))a?o.to(l).update(this.getReprParams(this.params.nciParams)):o.delete(l.transform.ref);return yield ct.State.Update(this.plugin,{state:n,tree:o,options:{doNotLogTiming:!0,doNotUpdateCurrent:!0}}),t.expandRadius!==r.expandRadius&&this.currentSource&&this.focus(this.currentSource),!0})}},iv=Ur.create({name:"create-structure-focus-representation",display:{name:"Structure Focus Representation"},category:"interaction",ctor:sU,params:(e,t)=>nVe(t)});var lU={};hi(lU,{AddTrajectory:()=>RVe,DownloadStructure:()=>IVe,EnableModelCustomProps:()=>MVe,EnableStructureCustomProps:()=>BVe,LoadTrajectory:()=>LVe,PdbDownloadProvider:()=>ude,UpdateTrajectory:()=>nw});function Ia(e){return e}(function(e){e.CommonParams={ignoreHydrogens:C.Optional(C.Boolean(!1)),ignoreHydrogensVariant:C.Optional(C.Select("all",C.arrayToOptions(["all","non-polar"]))),ignoreLight:C.Optional(C.Boolean(!1)),quality:C.Optional(C.Select("auto",a_)),theme:C.Optional(C.Group({globalName:C.Optional(C.Text("")),globalColorParams:C.Optional(C.Value({},{isHidden:!0})),carbonColor:C.Optional(C.Select("chain-id",C.arrayToOptions(["chain-id","operator-name","element-symbol"]))),symmetryColor:C.Optional(C.Text("")),symmetryColorParams:C.Optional(C.Value({},{isHidden:!0})),focus:C.Optional(C.Group({name:C.Optional(C.Text("")),params:C.Optional(C.Value({}))}))}))};function t(i){return i==="chain-id"?{name:i,params:VP.defaultValues}:i==="operator-name"?{name:i,params:gb.defaultValues}:{name:i,params:{}}}function r(i){return i.units.some(s=>!s.conformation.operator.assembly&&s.conformation.operator.spgrOp>=0)}function n(i,s,a){var l,c,u,d,m,p,h,f,y,g,v,b,S,_;let w=i.state.data.build(),E=i.builders.structure.representation,A=i.managers.structure.component.state.options.hydrogens,P={quality:i.managers.structure.component.state.options.visualQuality,ignoreHydrogens:A!=="all",ignoreHydrogensVariant:A==="only-polar"?"non-polar":"all",ignoreLight:i.managers.structure.component.state.options.ignoreLight};s.quality&&s.quality!=="auto"&&(P.quality=s.quality),s.ignoreHydrogens!==void 0&&(P.ignoreHydrogens=!!s.ignoreHydrogens),s.ignoreHydrogensVariant!==void 0&&(P.ignoreHydrogensVariant=s.ignoreHydrogensVariant),s.ignoreLight!==void 0&&(P.ignoreLight=!!s.ignoreLight);let T=!((l=s.theme)===null||l===void 0)&&l.globalName?(c=s.theme)===null||c===void 0?void 0:c.globalName:void 0,B=((u=s.theme)===null||u===void 0?void 0:u.carbonColor)!==void 0?k({carbonColor:t((d=s.theme)===null||d===void 0?void 0:d.carbonColor)},(m=s.theme)===null||m===void 0?void 0:m.globalColorParams):k({},(p=s.theme)===null||p===void 0?void 0:p.globalColorParams),D=a&&(!((h=s.theme)===null||h===void 0)&&h.symmetryColor)&&r(a)?(f=s.theme)===null||f===void 0?void 0:f.symmetryColor:T,M=!((y=s.theme)===null||y===void 0)&&y.symmetryColorParams?k(k({},(g=s.theme)===null||g===void 0?void 0:g.globalColorParams),(v=s.theme)===null||v===void 0?void 0:v.symmetryColorParams):k({},(b=s.theme)===null||b===void 0?void 0:b.globalColorParams),R=!((S=s.theme)===null||S===void 0)&&S.globalColorParams?k({},(_=s.theme)===null||_===void 0?void 0:_.globalColorParams):void 0;return{update:w,builder:E,color:T,symmetryColor:D,symmetryColorParams:M,globalColorParams:R,typeParams:P,ballAndStickColor:B}}e.reprBuilder=n;function o(i,s,a,l){if(i.state.hasBehavior(iv))return i.state.updateBehavior(iv,c=>{let u=tw(i,s,"ball-and-stick",a||"element-symbol",l);c.surroundingsParams.colorTheme=u,c.targetParams.colorTheme=u})}e.updateFocusRepr=o})(Ia||(Ia={}));var ry=Ia.CommonParams,sv=Ia.reprBuilder,av=Ia.updateFocusRepr,iVe=Ia({id:"preset-structure-representation-auto",display:{name:"Automatic",description:"Show representations based on the size of the structure. Smaller structures are shown with more detail than larger ones, ranging from atomistic display to coarse surfaces."},params:()=>ry,apply(e,t,r){var n,o;let i=(o=(n=Vo.resolveAndCheck(r.state.data,e))===null||n===void 0?void 0:n.obj)===null||o===void 0?void 0:o.data;if(!i)return{};let s=r.config.get(Tr.Structure.SizeThresholds)||Me.DefaultSizeThresholds,a=Me.getSize(i,s),l=i.polymerResidueCount/i.polymerGapCount;switch(a){case Me.Size.Gigantic:case Me.Size.Huge:return ide.apply(e,t,r);case Me.Size.Large:return sde.apply(e,t,r);case Me.Size.Medium:if(l>3)return ode.apply(e,t,r);case Me.Size.Small:return ade.apply(e,te(k({},t),{showCarbohydrateSymbol:!0}),r);default:_r(a)}}}),sVe=Ia({id:"preset-structure-representation-empty",display:{name:"Empty",description:"Removes all existing representations."},apply(e,t,r){return Y(this,null,function*(){return{}})}}),rw="Basic",ode=Ia({id:"preset-structure-representation-polymer-and-ligand",display:{name:"Polymer & Ligand",group:rw,description:"Shows polymers as Cartoon, ligands as Ball & Stick, carbohydrates as 3D-SNFG and water molecules semi-transparent."},params:()=>ry,apply(e,t,r){return Y(this,null,function*(){var n,o,i,s,a,l,c,u,d,m;let p=Vo.resolveAndCheck(r.state.data,e);if(!p)return{};let h={polymer:yield Rc(r,p,"polymer"),ligand:yield Rc(r,p,"ligand"),nonStandard:yield Rc(r,p,"non-standard"),branched:yield Rc(r,p,"branched",{label:"Carbohydrate"}),water:yield Rc(r,p,"water"),ion:yield Rc(r,p,"ion"),lipid:yield Rc(r,p,"lipid"),coarse:yield Rc(r,p,"coarse")},f=p.obj.data,y={sizeFactor:f.isCoarseGrained?.8:.2},g=(((i=(o=(n=h.water)===null||n===void 0?void 0:n.obj)===null||o===void 0?void 0:o.data)===null||i===void 0?void 0:i.elementCount)||0)>5e4?"line":"ball-and-stick",v=(((l=(a=(s=h.lipid)===null||s===void 0?void 0:s.obj)===null||a===void 0?void 0:a.data)===null||l===void 0?void 0:l.elementCount)||0)>2e4?"line":"ball-and-stick",{update:b,builder:S,typeParams:_,color:w,symmetryColor:E,symmetryColorParams:A,globalColorParams:P,ballAndStickColor:T}=sv(r,t,f),B={polymer:S.buildRepresentation(b,h.polymer,{type:"cartoon",typeParams:k(k({},_),y),color:E,colorParams:A},{tag:"polymer"}),ligand:S.buildRepresentation(b,h.ligand,{type:"ball-and-stick",typeParams:_,color:w,colorParams:T},{tag:"ligand"}),nonStandard:S.buildRepresentation(b,h.nonStandard,{type:"ball-and-stick",typeParams:_,color:w,colorParams:T},{tag:"non-standard"}),branchedBallAndStick:S.buildRepresentation(b,h.branched,{type:"ball-and-stick",typeParams:te(k({},_),{alpha:.3}),color:w,colorParams:T},{tag:"branched-ball-and-stick"}),branchedSnfg3d:S.buildRepresentation(b,h.branched,{type:"carbohydrate",typeParams:_,color:w,colorParams:P},{tag:"branched-snfg-3d"}),water:S.buildRepresentation(b,h.water,{type:g,typeParams:te(k({},_),{alpha:.6,visuals:g==="line"?["intra-bond","element-point"]:void 0}),color:w,colorParams:k({carbonColor:{name:"element-symbol",params:{}}},P)},{tag:"water"}),ion:S.buildRepresentation(b,h.ion,{type:"ball-and-stick",typeParams:_,color:w,colorParams:k({carbonColor:{name:"element-symbol",params:{}}},P)},{tag:"ion"}),lipid:S.buildRepresentation(b,h.lipid,{type:v,typeParams:te(k({},_),{alpha:.6,visuals:v==="line"?["intra-bond"]:void 0}),color:w,colorParams:k({carbonColor:{name:"element-symbol",params:{}}},P)},{tag:"lipid"}),coarse:S.buildRepresentation(b,h.coarse,{type:"spacefill",typeParams:_,color:w||"chain-id",colorParams:P},{tag:"coarse"})};return yield b.commit({revertOnError:!1}),yield av(r,f,(u=(c=t.theme)===null||c===void 0?void 0:c.focus)===null||u===void 0?void 0:u.name,(m=(d=t.theme)===null||d===void 0?void 0:d.focus)===null||m===void 0?void 0:m.params),{components:h,representations:B}})}}),aVe=Ia({id:"preset-structure-representation-protein-and-nucleic",display:{name:"Protein & Nucleic",group:rw,description:"Shows proteins as Cartoon and RNA/DNA as Gaussian Surface."},params:()=>ry,apply(e,t,r){return Y(this,null,function*(){var n,o,i,s;let a=Vo.resolveAndCheck(r.state.data,e);if(!a)return{};let l={protein:yield nde(r,a,"protein"),nucleic:yield nde(r,a,"nucleic")},c=a.obj.data,u={sizeFactor:c.isCoarseGrained?.8:.2},d={radiusOffset:c.isCoarseGrained?2:0,smoothness:c.isCoarseGrained?1:1.5},{update:m,builder:p,typeParams:h,symmetryColor:f,symmetryColorParams:y}=sv(r,t,c),g={protein:p.buildRepresentation(m,l.protein,{type:"cartoon",typeParams:k(k({},h),u),color:f,colorParams:y},{tag:"protein"}),nucleic:p.buildRepresentation(m,l.nucleic,{type:"gaussian-surface",typeParams:k(k({},h),d),color:f,colorParams:y},{tag:"nucleic"})};return yield m.commit({revertOnError:!0}),yield av(r,c,(o=(n=t.theme)===null||n===void 0?void 0:n.focus)===null||o===void 0?void 0:o.name,(s=(i=t.theme)===null||i===void 0?void 0:i.focus)===null||s===void 0?void 0:s.params),{components:l,representations:g}})}}),ide=Ia({id:"preset-structure-representation-coarse-surface",display:{name:"Coarse Surface",group:rw,description:"Shows polymers and lipids as coarse Gaussian Surface."},params:()=>ry,apply(e,t,r){return Y(this,null,function*(){var n,o,i,s;let a=Vo.resolveAndCheck(r.state.data,e);if(!a)return{};let l={polymer:yield Rc(r,a,"polymer"),lipid:yield Rc(r,a,"lipid")},c=a.obj.data,u=r.config.get(Tr.Structure.SizeThresholds)||Me.DefaultSizeThresholds,d=Me.getSize(c,u),m=Object.create(null);d===Me.Size.Gigantic?Object.assign(m,{traceOnly:!c.isCoarseGrained,radiusOffset:2,smoothness:1,visuals:["structure-gaussian-surface-mesh"]}):d===Me.Size.Huge?Object.assign(m,{radiusOffset:c.isCoarseGrained?2:0,smoothness:1}):c.isCoarseGrained&&Object.assign(m,{radiusOffset:2,smoothness:1});let{update:p,builder:h,typeParams:f,symmetryColor:y,symmetryColorParams:g}=sv(r,t,c),v={polymer:h.buildRepresentation(p,l.polymer,{type:"gaussian-surface",typeParams:k(k({},f),m),color:y,colorParams:g},{tag:"polymer"}),lipid:h.buildRepresentation(p,l.lipid,{type:"gaussian-surface",typeParams:k(k({},f),m),color:y,colorParams:g},{tag:"lipid"})};return yield p.commit({revertOnError:!0}),yield av(r,c,(o=(n=t.theme)===null||n===void 0?void 0:n.focus)===null||o===void 0?void 0:o.name,(s=(i=t.theme)===null||i===void 0?void 0:i.focus)===null||s===void 0?void 0:s.params),{components:l,representations:v}})}}),sde=Ia({id:"preset-structure-representation-polymer-cartoon",display:{name:"Polymer Cartoon",group:rw,description:"Shows polymers as Cartoon."},params:()=>ry,apply(e,t,r){return Y(this,null,function*(){var n,o,i,s;let a=Vo.resolveAndCheck(r.state.data,e);if(!a)return{};let l={polymer:yield Rc(r,a,"polymer")},c=a.obj.data,u={sizeFactor:c.isCoarseGrained?.8:.2},{update:d,builder:m,typeParams:p,symmetryColor:h,symmetryColorParams:f}=sv(r,t,c),y={polymer:m.buildRepresentation(d,l.polymer,{type:"cartoon",typeParams:k(k({},p),u),color:h,colorParams:f},{tag:"polymer"})};return yield d.commit({revertOnError:!0}),yield av(r,c,(o=(n=t.theme)===null||n===void 0?void 0:n.focus)===null||o===void 0?void 0:o.name,(s=(i=t.theme)===null||i===void 0?void 0:i.focus)===null||s===void 0?void 0:s.params),{components:l,representations:y}})}}),ade=Ia({id:"preset-structure-representation-atomic-detail",display:{name:"Atomic Detail",group:rw,description:"Shows everything in atomic detail with Ball & Stick."},params:()=>te(k({},ry),{showCarbohydrateSymbol:C.Boolean(!1)}),apply(e,t,r){return Y(this,null,function*(){var n,o,i,s,a,l;let c=Vo.resolveAndCheck(r.state.data,e);if(!c)return{};let u={all:yield Rc(r,c,"all"),branched:void 0},d=c.obj.data,m=d.elementCount>1e5,p=d.atomicResidueCount&&d.elementCount>1e3&&d.atomicResidueCount/d.elementCount<3,h=d.models[0],f=!!yi.Provider.get(h)||bl.isExhaustive(h),y="ball-and-stick";d.isCoarseGrained?y=d.elementCount>1e6?"point":"spacefill":p&&!f?y="spacefill":m&&(y="line");let g=t.showCarbohydrateSymbol&&!m&&!p;g&&Object.assign(u,{branched:yield Rc(r,c,"branched",{label:"Carbohydrate"})});let{update:v,builder:b,typeParams:S,color:_,ballAndStickColor:w,globalColorParams:E}=sv(r,t,d),A=p&&!f?k({carbonColor:{name:"element-symbol",params:{}}},E):w,P={all:b.buildRepresentation(v,u.all,{type:y,typeParams:S,color:_,colorParams:A},{tag:"all"})};return g&&Object.assign(P,{snfg3d:b.buildRepresentation(v,u.branched,{type:"carbohydrate",typeParams:te(k({},S),{alpha:.4,visuals:["carbohydrate-symbol"]}),color:_,colorParams:E},{tag:"snfg-3d"})}),yield v.commit({revertOnError:!0}),yield av(r,d,(i=(o=(n=t.theme)===null||n===void 0?void 0:n.focus)===null||o===void 0?void 0:o.name)!==null&&i!==void 0?i:_,(l=(a=(s=t.theme)===null||s===void 0?void 0:s.focus)===null||a===void 0?void 0:a.params)!==null&&l!==void 0?l:A),{components:u,representations:P}})}}),lVe=Ia({id:"preset-structure-representation-illustrative",display:{name:"Illustrative",group:"Miscellaneous",description:"..."},params:()=>te(k({},ry),{showCarbohydrateSymbol:C.Boolean(!1)}),apply(e,t,r){return Y(this,null,function*(){var n,o,i,s,a;let l=Vo.resolveAndCheck(r.state.data,e);if(!l)return{};let c={all:yield Rc(r,l,"all"),branched:void 0},u=l.obj.data,{update:d,builder:m,typeParams:p,color:h}=sv(r,t,u),f={all:m.buildRepresentation(d,c.all,{type:"spacefill",typeParams:te(k({},p),{ignoreLight:!0}),color:"illustrative"},{tag:"all"})};return yield d.commit({revertOnError:!0}),yield av(r,u,(i=(o=(n=t.theme)===null||n===void 0?void 0:n.focus)===null||o===void 0?void 0:o.name)!==null&&i!==void 0?i:h,(a=(s=t.theme)===null||s===void 0?void 0:s.focus)===null||a===void 0?void 0:a.params),{components:c,representations:f}})}}),cVe=Ia({id:"preset-structure-representation-auto-lod",display:{name:"Automatic Detail",group:"Miscellaneous",description:"Shows more (or less) detailed representations automatically based on camera distance."},params:()=>ry,apply(e,t,r){return Y(this,null,function*(){var n,o,i,s;let a=Vo.resolveAndCheck(r.state.data,e);if(!a)return{};let l={all:yield Rc(r,a,"all")},c=a.obj.data,u={sizeFactor:c.isCoarseGrained?.8:.2},{update:d,builder:m,typeParams:p,color:h,symmetryColor:f,symmetryColorParams:y,ballAndStickColor:g}=sv(r,t,c),v={gaussianSurface:m.buildRepresentation(d,l.all,{type:"gaussian-surface",typeParams:te(k({},p),{lod:x.create(30,1e7,100)}),color:f,colorParams:y},{tag:"gaussian-surface"}),cartoon:m.buildRepresentation(d,l.all,{type:"cartoon",typeParams:te(k(k({},p),u),{lod:x.create(-20,300,100)}),color:f,colorParams:y},{tag:"cartoon"}),ballAndStick:m.buildRepresentation(d,l.all,{type:"ball-and-stick",typeParams:te(k({},p),{lod:x.create(-20,40,20)}),color:h,colorParams:g},{tag:"ball-and-stick"})};return yield d.commit({revertOnError:!1}),yield av(r,c,(o=(n=t.theme)===null||n===void 0?void 0:n.focus)===null||o===void 0?void 0:o.name,(s=(i=t.theme)===null||i===void 0?void 0:i.focus)===null||s===void 0?void 0:s.params),{components:l,representations:v}})}});function Rc(e,t,r,n){return e.builders.structure.tryCreateComponentStatic(t,r,n)}function nde(e,t,r,n){return e.builders.structure.tryCreateComponentFromSelection(t,ei[r],`selection-${r}`,n)}var Jl={empty:sVe,auto:iVe,"atomic-detail":ade,"polymer-cartoon":sde,"polymer-and-ligand":ode,"protein-and-nucleic":aVe,"coarse-surface":ide,illustrative:lVe,"auto-lod":cVe};function mS(e,t){if(e.ext==="bcif")try{let{encoder:r}=vT(t);if(r.startsWith("VolumeServer"))return"dscif";if(r.startsWith("volseg-volume-server"))return"segcif"}catch(r){console.error(r)}else if(e.ext==="cif"){let r=t;if(r.startsWith(`data_SERVER +# +_density_server_result`))return"dscif";if(r.startsWith(`data_SERVER +# +data_SEGMENTATION_DATA`))return"segcif";if(r.includes("atom_site_fract_x")||r.includes("atom_site.fract_x"))return"coreCif"}return-1}var am="Trajectory";function Hh(e,t){return e.builders.structure.hierarchy.applyPreset(t.trajectory,"default")}var uVe={label:"mmCIF",description:"mmCIF",category:am,stringExtensions:["cif","mmcif","mcif"],binaryExtensions:["bcif"],isApplicable:(e,t)=>e.ext==="mmcif"||e.ext==="mcif"?!0:e.ext==="cif"||e.ext==="bcif"?mS(e,t)===-1:!1,parse:(e,t,r)=>Y(void 0,null,function*(){var n,o;let s=e.state.data.build().to(t).apply(Ge.Data.ParseCif,void 0,{state:{isGhost:!0}}),a=yield s.apply(Ge.Model.TrajectoryFromMmCif,void 0,{tags:r?.trajectoryTags}).commit({revertOnError:!0});return(((o=(n=s.selector.cell)===null||n===void 0?void 0:n.obj)===null||o===void 0?void 0:o.data.blocks.length)||0)>1&&e.state.data.updateCellState(s.ref,{isGhost:!1}),{trajectory:a}}),visuals:Hh},dVe={label:"cifCore",description:"CIF Core",category:am,stringExtensions:["cif"],isApplicable:(e,t)=>e.ext==="cif"?mS(e,t)==="coreCif":!1,parse:(e,t,r)=>Y(void 0,null,function*(){var n,o;let s=e.state.data.build().to(t).apply(Ge.Data.ParseCif,void 0,{state:{isGhost:!0}}),a=yield s.apply(Ge.Model.TrajectoryFromCifCore,void 0,{tags:r?.trajectoryTags}).commit({revertOnError:!0});return(((o=(n=s.selector.cell)===null||n===void 0?void 0:n.obj)===null||o===void 0?void 0:o.data.blocks.length)||0)>1&&e.state.data.updateCellState(s.ref,{isGhost:!1}),{trajectory:a}}),visuals:Hh};function lv(e,t){return(r,n,o)=>Y(this,null,function*(){return{trajectory:yield r.state.data.build().to(n).apply(e,t,{tags:o?.trajectoryTags}).commit({revertOnError:!0})}})}var mVe={label:"PDB",description:"PDB",category:am,stringExtensions:["pdb","ent"],parse:lv(Ge.Model.TrajectoryFromPDB),visuals:Hh},pVe={label:"PDBQT",description:"PDBQT",category:am,stringExtensions:["pdbqt"],parse:lv(Ge.Model.TrajectoryFromPDB,{isPdbqt:!0}),visuals:Hh},fVe={label:"XYZ",description:"XYZ",category:am,stringExtensions:["xyz"],parse:lv(Ge.Model.TrajectoryFromXYZ),visuals:Hh},hVe={label:"GRO",description:"GRO",category:am,stringExtensions:["gro"],binaryExtensions:[],parse:lv(Ge.Model.TrajectoryFromGRO),visuals:Hh},gVe={label:"MOL",description:"MOL",category:am,stringExtensions:["mol"],parse:lv(Ge.Model.TrajectoryFromMOL),visuals:Hh},yVe={label:"SDF",description:"SDF",category:am,stringExtensions:["sdf","sd"],parse:lv(Ge.Model.TrajectoryFromSDF),visuals:Hh},vVe={label:"MOL2",description:"MOL2",category:am,stringExtensions:["mol2"],parse:lv(Ge.Model.TrajectoryFromMOL2),visuals:Hh},tD=[["mmcif",uVe],["cifCore",dVe],["pdb",mVe],["pdbqt",pVe],["gro",hVe],["xyz",fVe],["mol",gVe],["sdf",yVe],["mol2",vVe]];var xVe=["gz","zip"];function jh(e){let t=e,r="",n=t.lastIndexOf("?"),o=n!==-1?t.substring(n):"";t=t.substring(0,n===-1?t.length:n);let i=t.replace(/^.*[\\/]/,""),s=i.substring(0,i.lastIndexOf(".")),a=i.split("."),l=a.length>1?(a.pop()||"").toLowerCase():"",c=t.match(/^(.+):\/\/(.+)$/);c&&(r=c[1].toLowerCase(),t=c[2]||"");let u=t.substring(0,t.lastIndexOf("/")+1);if(xVe.includes(l)){let d=t.length-l.length-1;l=(t.substr(0,d).split(".").pop()||"").toLowerCase();let m=s.length-l.length-1;s=s.substr(0,m)}return{path:t,name:i,ext:l,base:s,dir:u,protocol:r,query:o}}var pS="Topology";var bVe={label:"PSF",description:"PSF",category:pS,stringExtensions:["psf"],parse:(e,t)=>Y(void 0,null,function*(){let r=e.state.data.build().to(t).apply(Ge.Data.ParsePsf,{},{state:{isGhost:!0}}),n=r.apply(Ge.Model.TopologyFromPsf);return yield r.commit(),{format:r.selector,topology:n.selector}})};var SVe={label:"PRMTOP",description:"PRMTOP",category:pS,stringExtensions:["prmtop","parm7"],parse:(e,t)=>Y(void 0,null,function*(){let r=e.state.data.build().to(t).apply(Ge.Data.ParsePrmtop,{},{state:{isGhost:!0}}),n=r.apply(Ge.Model.TopologyFromPrmtop);return yield r.commit(),{format:r.selector,topology:n.selector}})};var CVe={label:"TOP",description:"TOP",category:pS,stringExtensions:["top"],parse:(e,t)=>Y(void 0,null,function*(){let r=e.state.data.build().to(t).apply(Ge.Data.ParseTop,{},{state:{isGhost:!0}}),n=r.apply(Ge.Model.TopologyFromTop);return yield r.commit(),{format:r.selector,topology:n.selector}})},lde=[["psf",bVe],["prmtop",SVe],["top",CVe]];var cv="Coordinates";var _Ve={label:"DCD",description:"DCD",category:cv,binaryExtensions:["dcd"],parse:(e,t)=>e.state.data.build().to(t).apply(Ge.Model.CoordinatesFromDcd).commit()};var wVe={label:"XTC",description:"XTC",category:cv,binaryExtensions:["xtc"],parse:(e,t)=>e.state.data.build().to(t).apply(Ge.Model.CoordinatesFromXtc).commit()};var AVe={label:"TRR",description:"TRR",category:cv,binaryExtensions:["trr"],parse:(e,t)=>e.state.data.build().to(t).apply(Ge.Model.CoordinatesFromTrr).commit()};var TVe={label:"NCTRAJ",description:"NCTRAJ",category:cv,binaryExtensions:["nc","nctraj"],parse:(e,t)=>e.state.data.build().to(t).apply(Ge.Model.CoordinatesFromNctraj).commit()},cde=[["dcd",_Ve],["xtc",wVe],["trr",AVe],["nctraj",TVe]];var PVe=e=>{let t=e.config.get(Tr.Structure.DefaultRepresentationPreset)||Jl.auto.id;return C.Group({type:pf.getParams(void 0,"auto").type,representation:C.Select(t,e.builders.structure.representation.getPresets().map(r=>[r.id,r.display.name,r.display.group]),{description:"Which representation preset to use."}),representationParams:C.Group(Ia.CommonParams,{isHidden:!0}),asTrajectory:C.Optional(C.Boolean(!1,{description:"Load all entries into a single trajectory."}))},{isExpanded:!1})},ude={rcsb:C.Group({encoding:C.Select("bcif",C.arrayToOptions(["cif","bcif"]))},{label:"RCSB PDB",isFlat:!0}),pdbe:C.Group({variant:C.Select("updated-bcif",[["updated-bcif","Updated (bcif)"],["updated","Updated"],["archival","Archival"]])},{label:"PDBe",isFlat:!0}),pdbj:C.EmptyGroup({label:"PDBj"})};var IVe=sa.build({from:ae.Root,display:{name:"Download Structure",description:"Load a structure from the provided source and create its representation."},params:(e,t)=>{let r=PVe(t),n=t.config.get(Tr.Download.DefaultPdbProvider)||"pdbe";return{source:C.MappedStatic("pdb",{pdb:C.Group({provider:C.Group({id:C.Text("1tqn",{label:"PDB Id(s)",description:"One or more comma/space separated PDB ids."}),server:C.MappedStatic(n,ude)},{pivot:"id"}),options:r},{isFlat:!0,label:"PDB"}),"pdb-dev":C.Group({provider:C.Group({id:C.Text("PDBDEV_00000001",{label:"PDB-Dev Id(s)",description:"One or more comma/space separated ids."}),encoding:C.Select("bcif",C.arrayToOptions(["cif","bcif"]))},{pivot:"id"}),options:r},{isFlat:!0,label:"PDB-Dev"}),swissmodel:C.Group({id:C.Text("Q9Y2I8",{label:"UniProtKB AC(s)",description:"One or more comma/space separated ACs."}),options:r},{isFlat:!0,label:"SWISS-MODEL",description:"Loads the best homology model or experimental structure"}),alphafolddb:C.Group({id:C.Text("Q8W3K0",{label:"UniProtKB AC(s)",description:"One or more comma/space separated ACs."}),options:r},{isFlat:!0,label:"AlphaFold DB",description:"Loads the predicted model if available"}),modelarchive:C.Group({id:C.Text("ma-bak-cepc-0003",{label:"Accession Code(s)",description:"One or more comma/space separated ACs."}),options:r},{isFlat:!0,label:"Model Archive"}),pubchem:C.Group({id:C.Text("2244,2245",{label:"PubChem ID",description:"One or more comma/space separated IDs."}),options:r},{isFlat:!0,label:"PubChem",description:"Loads 3D conformer from PubChem."}),url:C.Group({url:C.Url(""),format:C.Select("mmcif",C.arrayToOptions(tD.map(o=>o[0]),o=>o)),isBinary:C.Boolean(!1),label:C.Optional(C.Text("")),options:r},{isFlat:!0,label:"URL"})})}}})(({params:e,state:t},r)=>Pe.create("Download Structure",n=>Y(void 0,null,function*(){r.behaviors.layout.leftPanelTabName.next("data");let o=e.source,i,s=!1,a="mmcif";switch(o.name){case"url":i=[{url:o.params.url,isBinary:o.params.isBinary,label:o.params.label||void 0}],a=o.params.format;break;case"pdb":i=yield o.params.provider.server.name==="pdbe"?EVe(o):o.params.provider.server.name==="pdbj"?DVe(o):o.params.provider.server.name==="rcsb"?kVe(o):_r(o),s=!!o.params.options.asTrajectory;break;case"pdb-dev":i=yield Sp(o.params.provider.id,d=>{let m=d.toUpperCase().startsWith("PDBDEV_")?d:`PDBDEV_${d.padStart(8,"0")}`;return o.params.provider.encoding==="bcif"?`https://pdb-dev.wwpdb.org/bcif/${m.toUpperCase()}.bcif`:`https://pdb-dev.wwpdb.org/cif/${m.toUpperCase()}.cif`},d=>d.toUpperCase().startsWith("PDBDEV_")?d:`PDBDEV_${d.padStart(8,"0")}`,o.params.provider.encoding==="bcif"),s=!!o.params.options.asTrajectory;break;case"swissmodel":i=yield Sp(o.params.id,d=>`https://swissmodel.expasy.org/repository/uniprot/${d.toUpperCase()}.pdb`,d=>`SWISS-MODEL: ${d}`,!1),s=!!o.params.options.asTrajectory,a="pdb";break;case"alphafolddb":i=yield Sp(o.params.id,d=>Y(void 0,null,function*(){let m=`https://www.alphafold.ebi.ac.uk/api/prediction/${d.toUpperCase()}`,p=yield r.runTask(r.fetch({url:m,type:"json"}));if(Array.isArray(p)&&p.length>0)return p[0].cifUrl;throw new Error(`No AlphaFold DB entry for '${d}'`)}),d=>`AlphaFold DB: ${d}`,!1),s=!!o.params.options.asTrajectory,a="mmcif";break;case"modelarchive":i=yield Sp(o.params.id,d=>`https://www.modelarchive.org/doi/10.5452/${d.toLowerCase()}.cif`,d=>`Model Archive: ${d}`,!1),s=!!o.params.options.asTrajectory,a="mmcif";break;case"pubchem":i=yield Sp(o.params.id,d=>`https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/CID/${d.trim()}/record/SDF/?record_type=3d`,d=>`PubChem: ${d}`,!1),s=!!o.params.options.asTrajectory,a="mol";break;default:_r(o)}let l=e.source.params.options.representation||r.config.get(Tr.Structure.DefaultRepresentationPreset)||Jl.auto.id,c=l!==Jl.empty.id,u=o.params.options.type.name==="auto"?void 0:o.params.options.type;yield t.transaction(()=>Y(void 0,null,function*(){if(i.length>0&&s){let d=yield r.builders.data.downloadBlob({sources:i.map((p,h)=>({id:""+h,url:p.url,isBinary:p.isBinary})),maxConcurrency:6},{state:{isGhost:!0}}),m=yield r.builders.structure.parseTrajectory(d,{formats:i.map((p,h)=>({id:""+h,format:"cif"}))});yield r.builders.structure.hierarchy.applyPreset(m,"default",{structure:u,showUnitcell:c,representationPreset:l,representationPresetParams:e.source.params.options.representationParams})}else for(let d of i){let m=yield r.builders.data.download(d,{state:{isGhost:!0}}),p=r.dataFormats.get(a);if(!p)throw new Error("unknown file format");let h=yield r.builders.structure.parseTrajectory(m,p);yield r.builders.structure.hierarchy.applyPreset(h,"default",{structure:u,showUnitcell:c,representationPreset:l,representationPresetParams:e.source.params.options.representationParams})}})).runInContext(n)})));function Sp(e,t,r,n){return Y(this,null,function*(){let o=e.split(/[,\s]/).map(s=>s.trim()).filter(s=>!!s&&(s.length>=4||/^[1-9][0-9]*$/.test(s))),i=[];for(let s of o)i.push({url:Or.Url(yield t(s)),isBinary:n,label:r(s)});return i})}function EVe(e){return Y(this,null,function*(){if(e.name!=="pdb"||e.params.provider.server.name!=="pdbe")throw new Error("expected pdbe");return e.params.provider.server.params.variant==="updated"?Sp(e.params.provider.id,t=>`https://www.ebi.ac.uk/pdbe/static/entry/${t.toLowerCase()}_updated.cif`,t=>`PDBe: ${t} (updated cif)`,!1):e.params.provider.server.params.variant==="updated-bcif"?Sp(e.params.provider.id,t=>`https://www.ebi.ac.uk/pdbe/entry-files/download/${t.toLowerCase()}.bcif`,t=>`PDBe: ${t} (updated cif)`,!0):Sp(e.params.provider.id,t=>`https://www.ebi.ac.uk/pdbe/static/entry/${t.toLowerCase()}.cif`,t=>`PDBe: ${t} (cif)`,!1)})}function DVe(e){return Y(this,null,function*(){if(e.name!=="pdb"||e.params.provider.server.name!=="pdbj")throw new Error("expected pdbj");return Sp(e.params.provider.id,t=>`https://data.pdbjbk1.pdbj.org/pub/pdb/data/structures/divided/mmCIF/${t.toLowerCase().substring(1,3)}/${t.toLowerCase()}.cif`,t=>`PDBj: ${t} (cif)`,!1)})}function kVe(e){return Y(this,null,function*(){if(e.name!=="pdb"||e.params.provider.server.name!=="rcsb")throw new Error("expected rcsb");return e.params.provider.server.params.encoding==="cif"?Sp(e.params.provider.id,t=>`https://files.rcsb.org/download/${t.toUpperCase()}.cif`,t=>`RCSB PDB: ${t} (cif)`,!1):Sp(e.params.provider.id,t=>`https://models.rcsb.org/${t.toUpperCase()}.bcif`,t=>`RCSB PDB: ${t} (bcif)`,!0)})}var nw=sa.build({display:{name:"Update Trajectory"},params:{action:C.Select("advance",C.arrayToOptions(["advance","reset"])),by:C.Optional(C.Numeric(1,{min:-1,max:1,step:1}))}})(({params:e,state:t})=>{let r=t.selectQ(o=>o.ofTransformer(Ge.Model.ModelFromTrajectory)),n=t.build();if(e.action==="reset")for(let o of r)n.to(o).update({modelIndex:0});else for(let o of r){let i=qt.findAncestorOfType(t.tree,t.cells,o.transform.ref,ae.Molecule.Trajectory);if(!i||!i.obj)continue;let s=i.obj;n.to(o).update(a=>{let l=(a.modelIndex+e.by)%s.data.frameCount;return l<0&&(l+=s.data.frameCount),{modelIndex:l}})}return t.updateTree(n)}),MVe=sa.build({display:{name:"Custom Model Properties",description:"Enable parameters for custom properties of the model."},from:ae.Molecule.Model,params(e,t){return t.customModelProperties.getParams(e?.data)},isApplicable(e,t,r){return t.transformer!==qN}})(({ref:e,params:t},r)=>r.builders.structure.insertModelProperties(e,t)),BVe=sa.build({display:{name:"Custom Structure Properties",description:"Enable parameters for custom properties of the structure."},from:ae.Molecule.Structure,params(e,t){return t.customStructureProperties.getParams(e?.data)},isApplicable(e,t,r){return t.transformer!==WN}})(({ref:e,params:t},r)=>r.builders.structure.insertStructureProperties(e,t)),RVe=sa.build({display:{name:"Add Trajectory",description:"Add trajectory from existing model/topology and coordinates."},from:ae.Root,params(e,t){let r=t.state.data,o=[...r.selectQ(a=>a.rootsOfType(ae.Molecule.Model)),...r.selectQ(a=>a.rootsOfType(ae.Molecule.Topology))].map(a=>[a.transform.ref,a.obj.label]),s=r.selectQ(a=>a.rootsOfType(ae.Molecule.Coordinates)).map(a=>[a.transform.ref,a.obj.label]);return{model:C.Select(o.length?o[0][0]:"",o),coordinates:C.Select(s.length?s[0][0]:"",s)}}})(({params:e,state:t},r)=>Pe.create("Add Trajectory",n=>t.transaction(()=>Y(void 0,null,function*(){let o=[e.model,e.coordinates],i=t.build().toRoot().apply(GI,{modelRef:e.model,coordinatesRef:e.coordinates},{dependsOn:o}).apply(Ge.Model.ModelFromTrajectory,{modelIndex:0});yield t.updateTree(i).runInContext(n);let s=yield r.builders.structure.createStructure(i.selector);yield r.builders.structure.representation.applyPreset(s,"auto")})).runInContext(n))),LVe=sa.build({display:{name:"Load Trajectory",description:"Load trajectory of model/topology and coordinates from URL or file."},from:ae.Root,params(e,t){let{options:r}=t.dataFormats,n=r.filter(a=>a[2]===am||a[2]===pS),o=r.filter(a=>a[2]===cv),i=[],s=[];for(let{provider:a}of t.dataFormats.list)a.category===am||a.category===pS?(a.binaryExtensions&&i.push(...a.binaryExtensions),a.stringExtensions&&i.push(...a.stringExtensions)):a.category===cv&&(a.binaryExtensions&&s.push(...a.binaryExtensions),a.stringExtensions&&s.push(...a.stringExtensions));return{source:C.MappedStatic("file",{url:C.Group({model:C.Group({url:C.Url(""),format:C.Select(n[0][0],n),isBinary:C.Boolean(!1)},{isExpanded:!0}),coordinates:C.Group({url:C.Url(""),format:C.Select(o[0][0],o)},{isExpanded:!0})},{isFlat:!0}),file:C.Group({model:C.File({accept:i.map(a=>`.${a}`).join(","),label:"Model"}),coordinates:C.File({accept:s.map(a=>`.${a}`).join(","),label:"Coordinates"})},{isFlat:!0})},{options:[["url","URL"],["file","File"]]})}}})(({params:e,state:t},r)=>Pe.create("Load Trajectory",n=>t.transaction(()=>Y(void 0,null,function*(){let o=e.source;if(o.name==="file"&&(o.params.model===null||o.params.coordinates===null)){r.log.error("No file(s) selected");return}if(o.name==="url"&&(!o.params.model||!o.params.coordinates)){r.log.error("No URL(s) given");return}let i=(a,l,c)=>Y(void 0,null,function*(){let u=yield r.builders.data.download({url:a,isBinary:c}),d=r.dataFormats.get(l);if(!d){r.log.warn(`LoadTrajectory: could not find data provider for '${l}'`);return}return d.parse(r,u)}),s=a=>Y(void 0,null,function*(){var l,c,u;if(!a)throw new Error("No file selected");let d=jh((c=(l=a.file)===null||l===void 0?void 0:l.name)!==null&&c!==void 0?c:""),m=r.dataFormats.binaryExtensions.has(d.ext),{data:p}=yield r.builders.data.readFile({file:a,isBinary:m}),h=r.dataFormats.auto(d,(u=p.cell)===null||u===void 0?void 0:u.obj);if(!h){r.log.warn(`LoadTrajectory: could not find data provider for '${d.ext}'`),yield r.state.data.build().delete(p).commit();return}return h.parse(r,p)});try{let a=o.name==="url"?yield i(o.params.model.url,o.params.model.format,o.params.model.isBinary):yield s(o.params.model),l;"trajectory"in a?l=yield t.build().to(a.trajectory).apply(jN,{modelIndex:0}).commit():l=a.topology;let c=o.name==="url"?yield i(o.params.coordinates.url,o.params.coordinates.format,!0):yield s(o.params.coordinates),u=[l.ref,c.ref],d=t.build().toRoot().apply(GI,{modelRef:l.ref,coordinatesRef:c.ref},{dependsOn:u}).apply(Ge.Model.ModelFromTrajectory,{modelIndex:0});yield t.updateTree(d).runInContext(n);let m=yield r.builders.structure.createStructure(d.selector);yield r.builders.structure.representation.applyPreset(m,"auto")}catch(a){console.error(a),r.log.error("Error loading trajectory")}})).runInContext(n)));var uU={};hi(uU,{AssignColorVolume:()=>cU,DownloadDensity:()=>FVe});var FVe=sa.build({from:ae.Root,display:{name:"Download Density",description:"Load a density from the provided source and create its default visual."},params:(e,t)=>{let{options:r}=t.dataFormats;return{source:C.MappedStatic("pdb-xray",{"pdb-xray":C.Group({provider:C.Group({id:C.Text("1tqn",{label:"Id"}),server:C.Select("rcsb",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),type:C.Select("2fofc",[["2fofc","2Fo-Fc"],["fofc","Fo-Fc"]])},{isFlat:!0}),"pdb-xray-ds":C.Group({provider:C.Group({id:C.Text("1tqn",{label:"Id"}),server:C.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:C.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),"pdb-emd-ds":C.Group({provider:C.Group({id:C.Text("emd-8004",{label:"Id"}),server:C.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:C.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),url:C.Group({url:C.Url(""),isBinary:C.Boolean(!1),format:C.Select("auto",r)},{isFlat:!0})},{options:[["pdb-xray","PDB X-ray maps"],["pdb-emd-ds","PDB EMD Density Server"],["pdb-xray-ds","PDB X-ray Density Server"],["url","URL"]]})}}})(({params:e},t)=>Pe.create("Download Density",r=>Y(void 0,null,function*(){var n,o;let i=e.source,s,a;switch(i.name){case"url":s=i.params;break;case"pdb-xray":s=i.params.provider.server==="pdbe"?{url:Or.Url(i.params.type==="2fofc"?`https://www.ebi.ac.uk/pdbe/coordinates/files/${i.params.provider.id.toLowerCase()}.ccp4`:`https://www.ebi.ac.uk/pdbe/coordinates/files/${i.params.provider.id.toLowerCase()}_diff.ccp4`),isBinary:!0,label:`PDBe X-ray map: ${i.params.provider.id}`}:{url:Or.Url(i.params.type==="2fofc"?`https://edmaps.rcsb.org/maps/${i.params.provider.id.toLowerCase()}_2fofc.dsn6`:`https://edmaps.rcsb.org/maps/${i.params.provider.id.toLowerCase()}_fofc.dsn6`),isBinary:!0,label:`RCSB X-ray map: ${i.params.provider.id}`};break;case"pdb-emd-ds":s=i.params.provider.server==="pdbe"?{url:Or.Url(`https://www.ebi.ac.uk/pdbe/densities/emd/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`PDBe EMD Density Server: ${i.params.provider.id}`}:{url:Or.Url(`https://maps.rcsb.org/em/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`RCSB PDB EMD Density Server: ${i.params.provider.id}`};break;case"pdb-xray-ds":s=i.params.provider.server==="pdbe"?{url:Or.Url(`https://www.ebi.ac.uk/pdbe/densities/x-ray/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`PDBe X-ray Density Server: ${i.params.provider.id}`}:{url:Or.Url(`https://maps.rcsb.org/x-ray/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`RCSB PDB X-ray Density Server: ${i.params.provider.id}`};break;default:_r(i)}let l=yield t.builders.data.download(s),c;switch(i.name){case"url":s=i.params,a=i.params.format==="auto"?t.dataFormats.auto(jh(Or.getUrl(s.url)),(n=l.cell)===null||n===void 0?void 0:n.obj):t.dataFormats.get(i.params.format);break;case"pdb-xray":c=i.params.provider.id,a=i.params.provider.server==="pdbe"?t.dataFormats.get("ccp4"):t.dataFormats.get("dsn6");break;case"pdb-emd-ds":case"pdb-xray-ds":c=i.params.provider.id,a=t.dataFormats.get("dscif");break;default:_r(i)}if(!a){t.log.warn("DownloadDensity: Format provider not found.");return}let u=yield a.parse(t,l,{entryId:c});yield(o=a.visuals)===null||o===void 0?void 0:o.call(a,t,u)}))),cU=sa.build({display:{name:"Assign Volume Colors",description:"Assigns another volume to be available for coloring."},from:ae.Volume.Data,isApplicable(e){return!e.data.colorVolume},params(e,t){let r=t.state.data.select(qt.Generators.root.subtree().ofType(ae.Volume.Data).filter(n=>{var o;return!!n.obj&&!(!((o=n.obj)===null||o===void 0)&&o.data.colorVolume)&&n.obj!==e}));return r.length===0?{ref:C.Text("",{isHidden:!0,label:"Volume"})}:{ref:C.Select(r[0].transform.ref,r.map(n=>[n.transform.ref,n.obj.label]),{label:"Volume"})}}})(({ref:e,params:t,state:r},n)=>n.build().to(e).apply(Ge.Volume.AssignColorVolume,{ref:t.ref},{dependsOn:[t.ref]}).commit());var dU={};hi(dU,{DownloadFile:()=>OVe,OpenFiles:()=>ow});function rD(e,t,r,n){return Y(this,null,function*(){var o,i,s,a;let l=jh((i=(o=e.file)===null||o===void 0?void 0:o.name)!==null&&i!==void 0?i:""),c=t.dataFormats.binaryExtensions.has(l.ext),{data:u}=yield t.builders.data.readFile({file:e,isBinary:c}),d=r==="auto"?t.dataFormats.auto(l,(s=u.cell)===null||s===void 0?void 0:s.obj):t.dataFormats.get(r);if(!d){t.log.warn(`OpenFiles: could not find data provider for '${l.ext}'`),yield t.state.data.build().delete(u).commit();return}let m=yield d.parse(t,u);n&&(yield(a=d.visuals)===null||a===void 0?void 0:a.call(d,t,m))})}var ow=sa.build({display:{name:"Open Files",description:"Load one or more files and optionally create default visuals"},from:ae.Root,params:(e,t)=>{let{extensions:r,options:n}=t.dataFormats;return{files:C.FileList({accept:Array.from(r.values()).map(o=>`.${o}`).join(",")+",.gz,.zip",multiple:!0}),format:C.MappedStatic("auto",{auto:C.EmptyGroup(),specific:C.Select(n[0][0],n)}),visuals:C.Boolean(!0,{description:"Add default visuals"})}}})(({params:e,state:t},r)=>Pe.create("Open Files",n=>Y(void 0,null,function*(){r.behaviors.layout.leftPanelTabName.next("data"),yield t.transaction(()=>Y(void 0,null,function*(){if(e.files===null){r.log.error("No file(s) selected");return}for(let o of e.files)try{if(o.file&&o.name.toLowerCase().endsWith(".zip")){let i=yield Ux(n,yield o.file.arrayBuffer());for(let[s,a]of Object.entries(i)){if(!(a instanceof Uint8Array)||a.length===0)continue;let l=Or.File(new File([a],s));yield rD(l,r,"auto",e.visuals)}}else{let i=e.format.name==="auto"?"auto":e.format.params;yield rD(o,r,i,e.visuals)}}catch(i){console.error(i),r.log.error(`Error opening file '${o.name}'`)}})).runInContext(n)}))),OVe=sa.build({display:{name:"Download File",description:"Load one or more file from an URL"},from:ae.Root,params:(e,t)=>{let r=[...t.dataFormats.options,["zip","Zip"],["gzip","Gzip"]];return{url:C.Url(""),format:C.Select(r[0][0],r),isBinary:C.Boolean(!1),visuals:C.Boolean(!0,{description:"Add default visuals"})}}})(({params:e,state:t},r)=>Pe.create("Open Files",n=>Y(void 0,null,function*(){r.behaviors.layout.leftPanelTabName.next("data"),yield t.transaction(()=>Y(void 0,null,function*(){var o,i,s;try{if(e.format==="zip"||e.format==="gzip"){let a=yield r.builders.data.download({url:e.url,isBinary:!0});if(e.format==="zip"){let l=yield Ux(n,((o=a.obj)===null||o===void 0?void 0:o.data).buffer);for(let[c,u]of Object.entries(l)){if(!(u instanceof Uint8Array)||u.length===0)continue;let d=Or.File(new File([u],c));yield rD(d,r,"auto",e.visuals)}}else{let l=Or.getUrl(e.url),c=jh(l).name;yield rD(Or.File(new File([(i=a.obj)===null||i===void 0?void 0:i.data],c)),r,"auto",e.visuals)}}else{let a=r.dataFormats.get(e.format);if(!a){r.log.warn(`DownloadFile: could not find data provider for '${e.format}'`);return}let l=yield r.builders.data.download({url:e.url,isBinary:e.isBinary}),c=yield a.parse(r,l);e.visuals&&(yield(s=a.visuals)===null||s===void 0?void 0:s.call(a,r,c))}}catch(a){console.error(a),r.log.error(`Error downloading '${typeof e.url=="string"?e.url:e.url.url}'`)}})).runInContext(n)})));var ny={Structure:lU,Volume:uU,DataFormat:dU};var dde=Zl.create({name:"built-in.animate-state-interpolation",display:{name:"Animate State (experimental)"},params:()=>({transtionDurationInMs:C.Numeric(2e3,{min:100,max:3e4,step:10})}),canApply(e){return{canApply:e.managers.snapshot.state.entries.size>1}},initialState:()=>({}),apply(e,t,r){return Y(this,null,function*(){let n=r.plugin.managers.snapshot.state.entries;if(n.size<2)return{kind:"finished"};let o=t.current%r.params.transtionDurationInMs/r.params.transtionDurationInMs,i=Math.floor(t.current/r.params.transtionDurationInMs)%n.size,s=Math.ceil(t.current/r.params.transtionDurationInMs);s===i&&s++,s=s%n.size;let a=n.get(i).snapshot,l=n.get(s).snapshot;if(!a.data||!l.data)return{kind:"skip"};let c=a.data.tree.transforms,u=l.data.tree.transforms,d=r.plugin.state.data,m=d.build();for(let p of c)for(let h of u){if(h.ref!==p.ref||h.version===p.version)continue;let f=ur.fromJSON(p),y=ur.fromJSON(h),g=d.cells.get(p.ref);if(!g)continue;let v;f.transformer.definition.interpolate?v=f.transformer.definition.interpolate(f.params,y.params,o,r.plugin):v=o<=.5?f.params:y.params,Qf(g,v)||m.to(p.ref).update(v)}return yield ct.State.Update(r.plugin,{state:d,tree:m,options:{doNotLogTiming:!0}}),{kind:"next",state:{}}})}});var mde=Zl.create({name:"built-in.animate-structure-spin",display:{name:"Spin Structure"},isExportable:!0,params:()=>({durationInMs:C.Numeric(3e3,{min:100,max:1e4,step:100})}),initialState:()=>({t:0}),getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),setup(e,t,r){return Y(this,null,function*(){let n=r.state.data,o=n.select(qt.Generators.ofType(ae.Molecule.Structure.Representation3D)),i=n.build(),s=!1;for(let a of o)n.select(qt.Generators.ofTransformer(Ge.Representation.SpinStructureRepresentation3D,a.transform.ref)).length>0||(s=!0,i.to(a.transform.ref).apply(Ge.Representation.SpinStructureRepresentation3D,{t:0},{tags:"animate-structure-spin"}));if(s)return i.commit({doNotUpdateCurrent:!0})})},teardown(e,t,r){let n=r.state.data,o=n.select(qt.Generators.ofType(ae.Molecule.Structure.Representation3DState).withTag("animate-structure-spin"));if(o.length===0)return;let i=n.build();for(let s of o)i.delete(s.transform.ref);return i.commit()},apply(e,t,r){return Y(this,null,function*(){var n;let o=r.plugin.state.data,i=o.select(qt.Generators.ofTransformer(Ge.Representation.SpinStructureRepresentation3D));if(i.length===0)return{kind:"finished"};let s=o.build(),a=(t.current-t.lastApplied)/r.params.durationInMs,l=(e.t+a)%1;for(let c of i)s.to(c).update(te(k({},(n=c.params)===null||n===void 0?void 0:n.values),{t:l}));return yield ct.State.Update(r.plugin,{state:o,tree:s,options:{doNotLogTiming:!0}}),{kind:"next",state:{t:l}}})}});var nD=x(),pde=x(),fde=vn(),hde=Zl.create({name:"built-in.animate-camera-rock",display:{name:"Camera Rock",description:"Rock the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:C.Numeric(4e3,{min:100,max:2e4,step:100}),speed:C.Numeric(1,{min:1,max:10,step:1},{description:"How many times to rock from side to side."}),angle:C.Numeric(10,{min:0,max:180,step:1},{description:"How many degrees to rotate in each direction."})}),initialState:(e,t)=>({snapshot:t.canvas3d.camera.getSnapshot()}),getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),teardown:(e,t,r)=>{var n;(n=r.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t.snapshot,durationMs:0})},apply(e,t,r){return Y(this,null,function*(){var n,o;if(t.current===0)return{kind:"next",state:e};let i=e.snapshot;if(i.radiusMax<1e-4)return{kind:"finished"};let s=t.animation?((n=t.animation)===null||n===void 0?void 0:n.currentFrame)/(t.animation.frameCount+1):po(t.current/r.params.durationInMs,0,1),a=Math.sin(s*r.params.speed*Math.PI*2)*Cr(r.params.angle);x.sub(nD,i.position,i.target),x.normalize(pde,i.up),vn.setAxisAngle(fde,pde,a),x.transformQuat(nD,nD,fde);let l=x.add(x(),i.target,nD);return(o=r.plugin.canvas3d)===null||o===void 0||o.requestCameraReset({snapshot:te(k({},i),{position:l}),durationMs:0}),s>=.99999?{kind:"finished"}:{kind:"next",state:e}})}});var Ir;(function(e){function t(n,o){return{action:n,customControl:o&&o.customControl,autoUpdate:o&&o.autoUpdate}}e.Action=t;function r(n,o={}){return{transformer:n,defaultParams:o}}e.Behavior=r})(Ir||(Ir={}));var gde=()=>({actions:[Ir.Action(ny.Structure.DownloadStructure),Ir.Action(ny.Volume.DownloadDensity),Ir.Action(ny.DataFormat.DownloadFile),Ir.Action(ny.DataFormat.OpenFiles),Ir.Action(ny.Structure.LoadTrajectory),Ir.Action(ny.Structure.EnableModelCustomProps),Ir.Action(ny.Structure.EnableStructureCustomProps),Ir.Action(L_),Ir.Action(uie),Ir.Action(F_),Ir.Action(Ge.Data.Download),Ir.Action(Ge.Data.ParseCif),Ir.Action(Ge.Data.ParseCcp4),Ir.Action(Ge.Data.ParseDsn6),Ir.Action(Ge.Model.TrajectoryFromMmCif),Ir.Action(Ge.Model.TrajectoryFromCifCore),Ir.Action(Ge.Model.TrajectoryFromPDB),Ir.Action(Ge.Model.TransformStructureConformation),Ir.Action(Ge.Model.StructureFromModel),Ir.Action(Ge.Model.StructureFromTrajectory),Ir.Action(Ge.Model.ModelFromTrajectory),Ir.Action(Ge.Model.StructureSelectionFromScript),Ir.Action(Ge.Representation.StructureRepresentation3D),Ir.Action(Ge.Representation.StructureSelectionsDistance3D),Ir.Action(Ge.Representation.StructureSelectionsAngle3D),Ir.Action(Ge.Representation.StructureSelectionsDihedral3D),Ir.Action(Ge.Representation.StructureSelectionsLabel3D),Ir.Action(Ge.Representation.StructureSelectionsOrientation3D),Ir.Action(Ge.Representation.ModelUnitcell3D),Ir.Action(Ge.Representation.StructureBoundingBox3D),Ir.Action(Ge.Representation.ExplodeStructureRepresentation3D),Ir.Action(Ge.Representation.SpinStructureRepresentation3D),Ir.Action(Ge.Representation.UnwindStructureAssemblyRepresentation3D),Ir.Action(Ge.Representation.OverpaintStructureRepresentation3DFromScript),Ir.Action(Ge.Representation.TransparencyStructureRepresentation3DFromScript),Ir.Action(Ge.Representation.ClippingStructureRepresentation3DFromScript),Ir.Action(Ge.Representation.SubstanceStructureRepresentation3DFromScript),Ir.Action(Ge.Representation.ThemeStrengthRepresentation3D),Ir.Action(cU),Ir.Action(Ge.Volume.VolumeFromCcp4),Ir.Action(Ge.Volume.VolumeFromDsn6),Ir.Action(Ge.Volume.VolumeFromCube),Ir.Action(Ge.Volume.VolumeFromDx),Ir.Action(Ge.Representation.VolumeRepresentation3D)],behaviors:[Ir.Behavior(Bc.Representation.HighlightLoci),Ir.Behavior(Bc.Representation.SelectLoci),Ir.Behavior(Bc.Representation.DefaultLociLabelProvider),Ir.Behavior(Bc.Representation.FocusLoci),Ir.Behavior(Bc.Camera.FocusLoci),Ir.Behavior(Bc.Camera.CameraAxisHelper),Ir.Behavior(Bc.Camera.CameraControls),Ir.Behavior(iv),Ir.Behavior(Bc.CustomProps.StructureInfo),Ir.Behavior(Bc.CustomProps.AccessibleSurfaceArea),Ir.Behavior(Bc.CustomProps.BestDatabaseSequenceMapping),Ir.Behavior(Bc.CustomProps.Interactions),Ir.Behavior(Bc.CustomProps.SecondaryStructure),Ir.Behavior(Bc.CustomProps.ValenceModel),Ir.Behavior(Bc.CustomProps.CrossLinkRestraint)],animations:[dae,uae,hde,pae,aae,mde,dde]});var nc=vr(Ln());var dv=vr(Ln()),hS=vr(Ui());var Xn=vr(Ln()),Wh=vr(Ui());var Qe=vr(Ln());function tn(e){return e.svg?(0,Qe.jsx)("span",{className:`msp-icon msp-material-icon${e.inline?" msp-icon-inline":""}`,title:e.title,style:e.style,children:(0,Qe.jsx)(e.svg,{})}):null}var lD=(0,Qe.jsx)("circle",{r:"6px",id:"circle-left",cy:"12px",cx:"8px",strokeWidth:"1px"}),cD=(0,Qe.jsx)("circle",{r:"6px",id:"circle-right",cy:"12px",cx:"16px",strokeWidth:"1px"}),i9e=(0,Qe.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,Qe.jsxs)("defs",{children:[lD,cD]}),(0,Qe.jsxs)("g",{children:[(0,Qe.jsx)("use",{href:"#circle-left",className:"msp-shape-filled"}),(0,Qe.jsx)("use",{href:"#circle-right",className:"msp-shape-filled"}),(0,Qe.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"})]})]});function sw(){return i9e}var s9e=(0,Qe.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,Qe.jsxs)("defs",{children:[lD,cD,(0,Qe.jsxs)("mask",{id:"mask-left",children:[(0,Qe.jsx)("use",{href:"#circle-left",fill:"white",stroke:"white"}),(0,Qe.jsx)("use",{href:"#circle-right",fill:"black",strokeWidth:"0px",stroke:"white"})]})]}),(0,Qe.jsxs)("g",{children:[(0,Qe.jsx)("use",{href:"#circle-left",className:"msp-shape-filled",mask:"url(#mask-left)"}),(0,Qe.jsx)("use",{href:"#circle-right",className:"msp-shape-empty"})]})]});function aw(){return s9e}var a9e=(0,Qe.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,Qe.jsxs)("defs",{children:[lD,cD,(0,Qe.jsx)("clipPath",{id:"clip-left",children:(0,Qe.jsx)("use",{href:"#circle-right"})})]}),(0,Qe.jsxs)("g",{children:[(0,Qe.jsx)("use",{href:"#circle-left",className:"msp-shape-filled",clipPath:"url(#clip-left)"}),(0,Qe.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"}),(0,Qe.jsx)("use",{href:"#circle-right",className:"msp-shape-empty"})]})]});function lw(){return a9e}var l9e=(0,Qe.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,Qe.jsxs)("defs",{children:[lD,cD]}),(0,Qe.jsxs)("g",{children:[(0,Qe.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"}),(0,Qe.jsx)("use",{href:"#circle-right",className:"msp-shape-filled"})]})]});function uv(){return l9e}var c9e=(0,Qe.jsx)("svg",{width:"17px",height:"17px",viewBox:"0 0 299.463 299.463",strokeWidth:"6px",children:(0,Qe.jsx)("g",{children:(0,Qe.jsx)("path",{d:"M256.851,173.832v-48.201c22.916-4.918,34.151-30.668,22.556-50.771c-11.547-20.004-39.486-23.251-55.242-5.844 l-41.746-24.106C189.618,22.603,172.861,0,149.734,0c-23.132,0-39.881,22.609-32.685,44.911L75.305,69.016 C59.522,51.586,31.597,54.88,20.061,74.863c-11.63,20.163-0.298,45.862,22.557,50.769v48.2 c-22.821,4.898-34.195,30.591-22.556,50.771c11.529,19.972,39.454,23.285,55.242,5.845l41.746,24.106 c-7.199,22.308,9.559,44.911,32.685,44.911c23.132,0,39.88-22.609,32.685-44.911l41.745-24.106 c15.817,17.469,43.73,14.099,55.242-5.844c0,0,0-0.001,0.001-0.002c4.587-7.953,5.805-17.213,3.431-26.076 C279.392,185.657,269.129,176.461,256.851,173.832z M249.62,72.088c20.568,0,27.428,27.191,10.008,37.239 c-0.003,0.002-0.006,0.003-0.009,0.005c-10.04,5.81-22.85,1.762-27.877-8.475C225.206,87.548,234.938,72.088,249.62,72.088z M149.734,14.4c11.005,0,19.958,8.954,19.958,19.959c0,11.127-9.077,19.958-19.958,19.958c-10.95,0-19.958-8.9-19.958-19.958 C129.776,23.354,138.729,14.4,149.734,14.4z M39.84,109.328c-17.451-10.067-10.534-37.24,10.01-37.24 c15.311,0,24.922,16.653,17.251,29.942C61.681,111.397,49.517,114.925,39.84,109.328z M59.802,224.702 c-9.535,5.503-21.768,2.229-27.268-7.298c-7.639-13.242,1.887-29.945,17.236-29.945c0.013,0,0.027,0,0.04,0 C70.07,187.48,77.49,214.469,59.802,224.702z M149.734,285.062c-11.005,0-19.958-8.954-19.958-19.958 c0-11.127,9.077-19.958,19.958-19.958c10.954,0,19.958,8.903,19.958,19.958C169.693,276.109,160.74,285.062,149.734,285.062z M216.953,217.982l-41.727,24.095c-13.778-15.22-37.459-14.94-50.983,0l-41.728-24.096c6.196-19.289-5.541-39.835-25.498-44.149 V125.63c19.752-4.268,31.762-24.65,25.498-44.149l41.727-24.095c13.629,15.055,37.32,15.093,50.983,0l41.728,24.096 c-6.196,19.29,5.534,39.835,25.498,44.149v48.202C222.61,178.123,210.721,198.581,216.953,217.982z M266.935,217.404 c-5.501,9.528-17.732,12.802-27.261,7.302c-17.682-10.23-10.301-37.247,10.032-37.247 C264.984,187.459,274.602,204.112,266.935,217.404z"})})});function Bde(){return c9e}var u9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{d:"M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L6.04,7.5L12,10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z"})});function cw(){return u9e}var iyr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{d:"M17,22V20H20V17H22V20.5C22,20.89 21.84,21.24 21.54,21.54C21.24,21.84 20.89,22 20.5,22H17M7,22H3.5C3.11,22 2.76,21.84 2.46,21.54C2.16,21.24 2,20.89 2,20.5V17H4V20H7V22M17,2H20.5C20.89,2 21.24,2.16 21.54,2.46C21.84,2.76 22,3.11 22,3.5V7H20V4H17V2M7,2V4H4V7H2V3.5C2,3.11 2.16,2.76 2.46,2.46C2.76,2.16 3.11,2 3.5,2H7M13,17.25L17,14.95V10.36L13,12.66V17.25M12,10.92L16,8.63L12,6.28L8,8.63L12,10.92M7,14.95L11,17.25V12.66L7,10.36V14.95M18.23,7.59C18.73,7.91 19,8.34 19,8.91V15.23C19,15.8 18.73,16.23 18.23,16.55L12.75,19.73C12.25,20.05 11.75,20.05 11.25,19.73L5.77,16.55C5.27,16.23 5,15.8 5,15.23V8.91C5,8.34 5.27,7.91 5.77,7.59L11.25,4.41C11.5,4.28 11.75,4.22 12,4.22C12.25,4.22 12.5,4.28 12.75,4.41L18.23,7.59Z"})});var syr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{d:"M16,4L9,8.04V15.96L16,20L23,15.96V8.04M16,6.31L19.8,8.5L16,10.69L12.21,8.5M0,7V9H7V7M11,10.11L15,12.42V17.11L11,14.81M21,10.11V14.81L17,17.11V12.42M2,11V13H7V11M4,15V17H7V15"})});var d9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"})});function m9e(){return d9e}var ayr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{fill:"currentColor",d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"})});var lyr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{fill:"currentColor",d:"M20,11H23V13H20V11M1,11H4V13H1V11M13,1V4H11V1H13M4.92,3.5L7.05,5.64L5.63,7.05L3.5,4.93L4.92,3.5M16.95,5.63L19.07,3.5L20.5,4.93L18.37,7.05L16.95,5.63M12,6A6,6 0 0,1 18,12C18,14.22 16.79,16.16 15,17.2V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V17.2C7.21,16.16 6,14.22 6,12A6,6 0 0,1 12,6M14,21V22A1,1 0 0,1 13,23H11A1,1 0 0,1 10,22V21H14M11,18H13V15.87C14.73,15.43 16,13.86 16,12A4,4 0 0,0 12,8A4,4 0 0,0 8,12C8,13.86 9.27,15.43 11,15.87V18Z"})});var p9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{fill:"currentColor",d:"M7.5,5.6L5,7L6.4,4.5L5,2L7.5,3.4L10,2L8.6,4.5L10,7L7.5,5.6M19.5,15.4L22,14L20.6,16.5L22,19L19.5,17.6L17,19L18.4,16.5L17,14L19.5,15.4M22,2L20.6,4.5L22,7L19.5,5.6L17,7L18.4,4.5L17,2L19.5,3.4L22,2M13.34,12.78L15.78,10.34L13.66,8.22L11.22,10.66L13.34,12.78M14.37,7.29L16.71,9.63C17.1,10 17.1,10.65 16.71,11.04L5.04,22.71C4.65,23.1 4,23.1 3.63,22.71L1.29,20.37C0.9,20 0.9,19.35 1.29,18.96L12.96,7.29C13.35,6.9 14,6.9 14.37,7.29Z"})});function Rde(){return p9e}var f9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{d:"M3 17.25V21H6.75L17.81 9.93L14.06 6.18L3 17.25M22.61 18.36L18.36 22.61L13.16 17.41L14.93 15.64L15.93 16.64L18.4 14.16L19.82 15.58L18.36 17L19.42 18L20.84 16.6L22.61 18.36M6.61 10.83L1.39 5.64L5.64 1.39L7.4 3.16L4.93 5.64L6 6.7L8.46 4.22L9.88 5.64L8.46 7.05L9.46 8.05L6.61 10.83M20.71 7C21.1 6.61 21.1 6 20.71 5.59L18.37 3.29C18 2.9 17.35 2.9 16.96 3.29L15.12 5.12L18.87 8.87L20.71 7Z"})});function Lde(){return f9e}var h9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3h7zM7 9H4V5h3v4zm10 6h3v4h-3v-4zm0-10h3v4h-3V5z"})});function yU(){return h9e}var g9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})});function Cp(){return g9e}var y9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})});function oy(){return y9e}var v9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M7 10l5 5 5-5z"})});function ec(){return v9e}var x9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M10 17l5-5-5-5v10z"})});function tc(){return x9e}var b9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})});function iy(){return b9e}var S9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"})});function Fde(){return S9e}var C9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M6 13c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-3 .5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM6 5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm15 5.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zM14 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0-3.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zm-11 10c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm7 7c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm0-17c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zM10 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0 5.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm8 .5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm3 8.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM14 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 3.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm-4-12c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0 8.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm4-4.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-4c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"})});function vU(){return C9e}var _9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M15 7v12.97l-4.21-1.81-.79-.34-.79.34L5 19.97V7h10m4-6H8.99C7.89 1 7 1.9 7 3h10c1.1 0 2 .9 2 2v13l2 1V3c0-1.1-.9-2-2-2zm-4 4H5c-1.1 0-2 .9-2 2v16l7-3 7 3V7c0-1.1-.9-2-2-2z"})});function qh(){return _9e}var w9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37l-1.34-1.34a.9959.9959 0 00-1.41 0L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41z"})});function uD(){return w9e}var A9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M22.61 18.99l-9.08-9.08c.93-2.34.45-5.1-1.44-7C9.79.61 6.21.4 3.66 2.26L7.5 6.11 6.08 7.52 2.25 3.69C.39 6.23.6 9.82 2.9 12.11c1.86 1.86 4.57 2.35 6.89 1.48l9.11 9.11c.39.39 1.02.39 1.41 0l2.3-2.3c.4-.38.4-1.01 0-1.41zm-3 1.6l-9.46-9.46c-.61.45-1.29.72-2 .82-1.36.2-2.79-.21-3.83-1.25C3.37 9.76 2.93 8.5 3 7.26l3.09 3.09 4.24-4.24-3.09-3.09c1.24-.07 2.49.37 3.44 1.31 1.08 1.08 1.49 2.57 1.24 3.96-.12.71-.42 1.37-.88 1.96l9.45 9.45-.88.89z"})});function Ode(){return A9e}var T9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"})});function Nde(){return T9e}var P9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M14.25 2.26l-.08-.04-.01.02C13.46 2.09 12.74 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-4.75-3.31-8.72-7.75-9.74zM19.41 9h-7.99l2.71-4.7c2.4.66 4.35 2.42 5.28 4.7zM13.1 4.08L10.27 9l-1.15 2L6.4 6.3C7.84 4.88 9.82 4 12 4c.37 0 .74.03 1.1.08zM5.7 7.09L8.54 12l1.15 2H4.26C4.1 13.36 4 12.69 4 12c0-1.85.64-3.55 1.7-4.91zM4.59 15h7.98l-2.71 4.7c-2.4-.67-4.34-2.42-5.27-4.7zm6.31 4.91L14.89 13l2.72 4.7C16.16 19.12 14.18 20 12 20c-.38 0-.74-.04-1.1-.09zm7.4-3l-4-6.91h5.43c.17.64.27 1.31.27 2 0 1.85-.64 3.55-1.7 4.91z"})});function Ude(){return P9e}var I9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M9.4 10.5l4.77-8.26C13.47 2.09 12.75 2 12 2c-2.4 0-4.6.85-6.32 2.25l3.66 6.35.06-.1zM21.54 9c-.92-2.92-3.15-5.26-6-6.34L11.88 9h9.66zm.26 1h-7.49l.29.5 4.76 8.25C21 16.97 22 14.61 22 12c0-.69-.07-1.35-.2-2zM8.54 12l-3.9-6.75C3.01 7.03 2 9.39 2 12c0 .69.07 1.35.2 2h7.49l-1.15-2zm-6.08 3c.92 2.92 3.15 5.26 6 6.34L12.12 15H2.46zm11.27 0l-3.9 6.76c.7.15 1.42.24 2.17.24 2.4 0 4.6-.85 6.32-2.25l-3.66-6.35-.93 1.6z"})});function zde(){return I9e}var E9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"})});function uw(){return E9e}var D9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"})});function dD(){return D9e}var k9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-7 7H3v4c0 1.1.9 2 2 2h4v-2H5v-4zM5 5h4V3H5c-1.1 0-2 .9-2 2v4h2V5zm14-2h-4v2h4v4h2V5c0-1.1-.9-2-2-2zm0 16h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4z"})});function Vde(){return k9e}var M9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})});function ed(){return M9e}var B9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})});function xU(){return B9e}var R9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})});function Fc(){return R9e}var L9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"})});function Gde(){return L9e}var F9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})});function Hde(){return F9e}var O9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"})});function jde(){return O9e}var N9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"})});function qde(){return N9e}var U9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"})});function Wde(){return U9e}var z9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-5.04-6.71l-2.75 3.54-1.96-2.36L6.5 17h11l-3.54-4.71z"})});function Yde(){return z9e}var V9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})});function ua(){return V9e}var cyr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})});var G9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})});function bU(){return G9e}var uyr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"})});var H9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{d:"M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"})});function j9e(){return H9e}var q9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})});function Xde(){return q9e}var W9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})});function dw(){return W9e}var Y9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"})});function rc(){return Y9e}var X9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z"})});function mw(){return X9e}var dyr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"})});var K9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19.5 9.5c-1.03 0-1.9.62-2.29 1.5h-2.92c-.39-.88-1.26-1.5-2.29-1.5s-1.9.62-2.29 1.5H6.79c-.39-.88-1.26-1.5-2.29-1.5C3.12 9.5 2 10.62 2 12s1.12 2.5 2.5 2.5c1.03 0 1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5s1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5z"})});function Q9e(){return K9e}var Z9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})});function lm(){return Z9e}var $9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})});function SU(){return $9e}var J9e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})});function CU(){return J9e}var e7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z"})});function Kde(){return e7e}var t7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M8 5v14l11-7z"})});function mD(){return t7e}var r7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})});function pw(){return r7e}var n7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M19 13H5v-2h14v2z"})});function fw(){return n7e}var o7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})});function hw(){return o7e}var i7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,Qe.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm2 16H5V5h11.17L19 7.83V19zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zM6 6h9v4H6z"})});function pD(){return i7e}var s7e=(0,Qe.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,Qe.jsx)("circle",{cx:"7",cy:"14",r:"3"}),(0,Qe.jsx)("circle",{cx:"11",cy:"6",r:"3"}),(0,Qe.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"})]});function a7e(){return s7e}var myr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})});var l7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M6 6h2v12H6zm3.5 6l8.5 6V6z"})});function Qde(){return l7e}var c7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M6 6h12v12H6z"})});function _U(){return c7e}var u7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M4 6h16v2H4zm2-4h12v2H6zm14 8H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm0 10H4v-8h16v8zm-10-7.27v6.53L16 16z"})});function Zde(){return u7e}var d7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z"})});function $de(){return d7e}var m7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"})});function Oc(){return m7e}var p7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53z"})});function td(){return p7e}var f7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"})});function rd(){return f7e}var h7e=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})});function fD(){return h7e}var pyr=(0,Qe.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{d:"M 9.64 7.64 c 0.23 -0.5 0.36 -1.05 0.36 -1.64 c 0 -2.21 -1.79 -4 -4 -4 S 2 3.79 2 6 s 1.79 4 4 4 c 0.59 0 1.14 -0.13 1.64 -0.36 L 10 12 l -2.36 2.36 C 7.14 14.13 6.59 14 6 14 c -2.21 0 -4 1.79 -4 4 s 1.79 4 4 4 s 4 -1.79 4 -4 c 0 -0.59 -0.13 -1.14 -0.36 -1.64 L 12 14 l 7 7 h 3 v -1 L 9.64 7.64 Z M 6 8 c -1.1 0 -2 -0.89 -2 -2 s 0.9 -2 2 -2 s 2 0.89 2 2 s -0.9 2 -2 2 Z m 0 12 c -1.1 0 -2 -0.89 -2 -2 s 0.9 -2 2 -2 s 2 0.89 2 2 s -0.9 2 -2 2 Z m 6 -7.5 c -0.28 0 -0.5 -0.22 -0.5 -0.5 s 0.22 -0.5 0.5 -0.5 s 0.5 0.22 0.5 0.5 s -0.22 0.5 -0.5 0.5 Z M 19 3 l -6 6 l 2 2 l 7 -7 V 3 Z"})});var Jde=m9e,eme=a7e,wU=Q9e,tme=j9e;var ll=class extends Wh.Component{constructor(){super(...arguments),this.state={isExpanded:!!this.props.initialExpanded},this.headerClicked=()=>{this.props.onHeaderClick?this.props.onHeaderClick():this.setState({isExpanded:!this.state.isExpanded})}}render(){let t=this.props.hideOffset?"msp-control-group-children":"msp-control-group-children msp-control-offset";return this.props.childrenClassName&&(t+=" "+this.props.childrenClassName),(0,Xn.jsxs)("div",{className:"msp-control-group-wrapper",style:{position:"relative",marginTop:this.props.noTopMargin?0:void 0},children:[(0,Xn.jsx)("div",{className:"msp-control-group-header",style:{marginLeft:this.props.headerLeftMargin},title:this.props.title,children:(0,Xn.jsxs)(Jt,{onClick:this.headerClicked,children:[!this.props.hideExpander&&(0,Xn.jsx)(tn,{svg:this.state.isExpanded?tc:ec}),this.props.topRightIcon&&(0,Xn.jsx)(tn,{svg:this.props.topRightIcon,style:{position:"absolute",right:"2px",top:0}}),(0,Xn.jsx)("b",{children:this.props.header})]})}),this.state.isExpanded&&(0,Xn.jsx)("div",{className:t,style:{display:this.state.isExpanded?"block":"none",maxHeight:this.props.maxHeight,overflow:"hidden",overflowY:"auto"},children:this.props.children})]})}};function rme(e){return e}var Nc=class extends Wh.PureComponent{constructor(){super(...arguments),this.input=Wh.createRef(),this.delayHandle=void 0,this.pendingValue=void 0,this.state={originalValue:"",value:""},this.onBlur=()=>{this.setState({value:""+this.state.originalValue}),this.props.onBlur&&this.props.onBlur()},this.raiseOnChange=()=>{this.pendingValue!==void 0&&(this.props.onChange(this.pendingValue),this.pendingValue=void 0)},this.onChange=t=>{let r=t.target.value;if(this.props.isValid&&!this.props.isValid(r)||this.props.numeric&&Number.isNaN(+r)){this.clearTimeout(),this.setState({value:r});return}if(this.props.numeric)this.setState({value:r},()=>this.triggerChanged(r,+r));else{let o=(this.props.toValue||rme)(r),i=(this.props.fromValue||rme)(o);this.setState({value:i},()=>this.triggerChanged(i,o))}},this.onKeyUp=t=>{(t.charCode===27||t.keyCode===27||t.key==="Escape")&&this.props.blurOnEscape&&this.input.current&&this.input.current.blur()},this.onKeyPress=t=>{(t.keyCode===13||t.charCode===13||t.key==="Enter")&&(this.isPending&&(this.clearTimeout(),this.raiseOnChange()),this.props.blurOnEnter&&this.input.current&&this.input.current.blur(),this.props.onEnter&&this.props.onEnter()),t.stopPropagation()}}get isPending(){return typeof this.delayHandle<"u"}clearTimeout(){this.isPending&&(clearTimeout(this.delayHandle),this.delayHandle=void 0)}triggerChanged(t,r){this.clearTimeout(),t!==this.state.originalValue&&(this.props.delayMs?(this.pendingValue=r,this.delayHandle=setTimeout(this.raiseOnChange,this.props.delayMs)):this.props.onChange(r))}static getDerivedStateFromProps(t,r){let n=t.fromValue?t.fromValue(t.value):t.value;return n===r.originalValue?null:{originalValue:n,value:n}}render(){return(0,Xn.jsx)("input",{type:"text",className:this.props.className,style:this.props.style,ref:this.input,onBlur:this.onBlur,value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onKeyPress:this.props.onEnter||this.props.blurOnEnter||this.props.blurOnEscape?this.onKeyPress:void 0,onKeyDown:this.props.blurOnEscape?this.onKeyUp:void 0,disabled:!!this.props.isDisabled})}},hD=class extends Wh.Component{constructor(){super(...arguments),this.state={isExpanded:!1},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){let{label:t,pivot:r,controls:n}=this.props;return(0,Xn.jsxs)(Xn.Fragment,{children:[(0,Xn.jsx)(cl,{label:(0,Xn.jsxs)(Xn.Fragment,{children:[t,(0,Xn.jsx)("button",{className:"msp-btn-link msp-btn-icon msp-control-group-expander",onClick:this.toggleExpanded,title:`${this.state.isExpanded?"Less":"More"} options`,style:{background:"transparent",textAlign:"left",padding:"0"},children:(0,Xn.jsx)(tn,{svg:this.state.isExpanded?fw:Cp,style:{display:"inline-block"}})})]}),control:r,children:this.props.colorStripe&&(0,Xn.jsx)("div",{className:"msp-expandable-group-color-stripe",style:{backgroundColor:Oe.toStyle(this.props.colorStripe)}})}),this.state.isExpanded&&(0,Xn.jsx)("div",{className:"msp-control-offset",children:n})]})}};function _p(e){return(0,Xn.jsxs)("div",{className:`msp-section-header${e.accent?" msp-transform-header-brand-"+e.accent:""}`,children:[e.icon&&(0,Xn.jsx)(tn,{svg:e.icon}),e.title," ",(0,Xn.jsx)("small",{children:e.desc})]})}function Jt(e){let t="msp-btn";e.inline||(t+=" msp-btn-block"),e.noOverflow&&(t+=" msp-no-overflow"),e.flex&&(t+=" msp-flex-item"),(e.commit==="on"||e.commit)&&(t+=" msp-btn-commit msp-btn-commit-on"),e.commit==="off"&&(t+=" msp-btn-commit msp-btn-commit-off"),e.children||(t+=" msp-btn-childless"),e.className&&(t+=" "+e.className);let r;return e.flex&&(typeof e.flex=="number"?r={flex:`0 0 ${e.flex}px`,padding:0,maxWidth:`${e.flex}px`}:typeof e.flex=="string"&&(r={flex:`0 0 ${e.flex}`,padding:0,maxWidth:e.flex})),e.style&&(r?Object.assign(r,e.style):r=e.style),(0,Xn.jsxs)("button",{onClick:e.onClick,title:e.title,disabled:e.disabled,style:r,className:t,"data-id":e["data-id"],"data-color":e["data-color"],onContextMenu:e.onContextMenu,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,children:[e.icon&&(0,Xn.jsx)(tn,{svg:e.icon}),e.children]})}function Qt(e){let t=`msp-btn msp-btn-icon${e.small?"-small":""}${e.className?" "+e.className:""}`;typeof e.toggleState<"u"&&(t+=` msp-btn-link-toggle-${e.toggleState?"on":"off"}`),e.transparent&&(t+=" msp-transparent-bg");let r;return e.flex&&(typeof e.flex=="boolean"?r={flex:"0 0 32px",padding:0}:typeof e.flex=="number"?r={flex:`0 0 ${e.flex}px`,padding:0,maxWidth:`${e.flex}px`}:r={flex:`0 0 ${e.flex}`,padding:0,maxWidth:e.flex}),e.style&&(r?Object.assign(r,e.style):r=e.style),(0,Xn.jsxs)("button",{className:t,onClick:e.onClick,title:e.title,disabled:e.disabled,"data-id":e["data-id"],style:r,children:[e.svg&&(0,Xn.jsx)(tn,{svg:e.svg}),e.extraContent]})}var Wo=class extends Wh.PureComponent{constructor(){super(...arguments),this.onClick=t=>{t.currentTarget.blur(),this.props.toggle()}}render(){let t=this.props,r=t.label,n=t.isSelected?`${t.className||""} msp-control-current`:t.className;return(0,Xn.jsx)(Jt,{icon:this.props.icon,onClick:this.onClick,title:this.props.title,inline:this.props.inline,disabled:t.disabled,style:t.style,className:n,children:r&&this.props.isSelected?(0,Xn.jsx)("b",{children:r}):r})}},qs=class extends Wh.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!!this.props.initiallyExpanded},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){return(0,Xn.jsxs)(Xn.Fragment,{children:[(0,Xn.jsx)("div",{className:"msp-control-group-header",style:{marginTop:this.props.marginTop!==void 0?this.props.marginTop:"1px",marginLeft:this.props.headerLeftMargin},children:(0,Xn.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleExpanded,style:this.props.headerStyle,children:[(0,Xn.jsx)(tn,{svg:this.state.isExpanded?ec:tc}),this.props.header]})}),this.state.isExpanded&&(this.props.noOffset?this.props.children:(0,Xn.jsx)("div",{className:this.props.accent?"msp-accent-offset":"msp-control-offset",children:this.props.children}))]})}};function cl(e){let t="msp-control-row";return e.className&&(t+=" "+e.className),(0,Xn.jsxs)("div",{className:t,children:[(0,Xn.jsx)("span",{className:"msp-control-row-label",title:e.title,children:e.label}),(0,Xn.jsx)("div",{className:"msp-control-row-ctrl",children:e.control}),e.children]})}var vu=hS.createContext(void 0),pr=(()=>{class e extends hS.Component{subscribe(r,n){typeof this.subs>"u"&&(this.subs=[]),this.subs.push(r.subscribe(n))}componentWillUnmount(){if(this.subs){for(let r of this.subs)r.unsubscribe();this.subs=void 0}}constructor(r,n){super(r),this.subs=void 0,this.plugin=n,this.init&&this.init()}}return e.contextType=vu,e})(),ti=(()=>{class e extends hS.PureComponent{subscribe(r,n){typeof this.subs>"u"&&(this.subs=[]),this.subs.push(r.subscribe(n))}componentWillUnmount(){if(this.subs){for(let r of this.subs)r.unsubscribe();this.subs=void 0}}constructor(r,n){super(r,n),this.subs=void 0,this.plugin=n,this.init&&this.init()}}return e.contextType=vu,e})(),Uc=class extends pr{componentDidUpdate(t){this.props.initiallyCollapsed!==void 0&&t.initiallyCollapsed!==this.props.initiallyCollapsed&&this.setState({isCollapsed:this.props.initiallyCollapsed})}render(){var t;if(this.state.isHidden)return null;let r=this.state.isCollapsed?"msp-transform-wrapper msp-transform-wrapper-collapsed":"msp-transform-wrapper";return(0,dv.jsxs)("div",{className:r,children:[(0,dv.jsx)("div",{className:"msp-transform-header",children:(0,dv.jsxs)(Jt,{icon:this.state.brand?void 0:this.state.isCollapsed?tc:ec,noOverflow:!0,onClick:this.toggleCollapsed,className:this.state.brand?`msp-transform-header-brand msp-transform-header-brand-${this.state.brand.accent}`:void 0,title:`Click to ${this.state.isCollapsed?"expand":"collapse"}`,children:[(0,dv.jsx)(tn,{svg:(t=this.state.brand)===null||t===void 0?void 0:t.svg,inline:!0}),this.state.header,(0,dv.jsx)("small",{style:{margin:"0 6px"},children:this.state.isCollapsed?"":this.state.description})]})}),!this.state.isCollapsed&&this.renderControls()]})}constructor(t,r){super(t,r),this.toggleCollapsed=()=>{this.setState({isCollapsed:!this.state.isCollapsed})};let n=this.defaultState();t.initiallyCollapsed!==void 0&&(n.isCollapsed=t.initiallyCollapsed),t.header!==void 0&&(n.header=t.header),this.state=n}};var Ze=vr(Ln()),ri=vr(Ui());var Is=vr(Ln()),IU=vr(Ui());var sr=class extends IU.PureComponent{constructor(){super(...arguments),this.hide=()=>this.props.onSelect(void 0)}render(){let t=this.props,r=(0,Is.jsx)(TU,{items:t.items,onSelect:t.onSelect,current:t.current,multiselect:this.props.multiselect,noOffset:this.props.noOffset,noAccent:this.props.noAccent});return(0,Is.jsxs)("div",{className:`msp-action-menu-options${t.header?"":" msp-action-menu-options-no-header"}`,children:[t.header&&(0,Is.jsx)(ll,{header:t.header,title:t.title,initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.hide,topRightIcon:Fc,children:r}),!t.header&&r]})}};(function(e){function t(c,u){return u?k({kind:"header",label:c},u):{kind:"header",label:c}}e.Header=t;function r(c,u,d){return k({kind:"item",label:c,value:u},d)}e.Item=r;function n(c,u){let{label:d,value:m,category:p,selected:h,icon:f,addOn:y,description:g}=u||{},v,b=[];for(let S=0;Sc[0],label:c=>c[1],category:c=>c[2]};function i(c,u){return n(c,u?k(k({},o),u):o)}e.createItemsFromSelectOptions=i;function s(c){if(Yh(c))return!1;if(gS(c))return!!c.selected;for(let u of c)if(s(u))return!0;return!1}e.hasSelectedItem=s;function a(c,u){if(!Yh(c)){if(gS(c))return c.value===u?c:void 0;for(let d of c){let m=a(d,u);if(m)return m}}}e.findItem=a;function l(c){if(!Yh(c)){if(gS(c))return c;for(let u of c){let d=l(u);if(d)return d}}}e.getFirstItem=l})(sr||(sr={}));var TU=class e extends IU.PureComponent{constructor(){super(...arguments),this.state=e.createState(this.props),this.toggleExpanded=t=>{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()},this.selectAll=()=>{let t=PU(this.props.items,[]).filter(r=>!r.selected);this.props.onSelect(t)},this.selectNone=()=>{let t=PU(this.props.items,[]).filter(r=>!!r.selected);this.props.onSelect(t)}}static createState(t,r){let n=AU(t.items)&&Yh(t.items[0])?t.items[0]:void 0,o=n?.isIndependent?!1:t.multiselect?sr.hasSelectedItem(t.items):!!t.current&&!!sr.findItem(t.items,t.current.value)||sr.hasSelectedItem(t.items);return{header:n,hasCurrent:o,isExpanded:o||(r??!!n?.initiallyExpanded)}}componentDidUpdate(t){if(this.props.items!==t.items||this.props.current!==t.current){let r=AU(this.props.items)&&AU(t.items)&&Yh(this.props.items[0])&&Yh(t.items[0])&&this.props.items[0].label===t.items[0].label?this.state.isExpanded:void 0;this.setState(e.createState(this.props,r))}}get multiselectHeader(){let{header:t,hasCurrent:r}=this.state;return(0,Is.jsxs)("div",{className:"msp-flex-row msp-control-group-header",children:[(0,Is.jsx)(Jt,{icon:this.state.isExpanded?ec:tc,flex:!0,noOverflow:!0,onClick:this.toggleExpanded,title:`Click to ${this.state.isExpanded?"collapse":"expand"}.${t?.description?` ${t?.description}`:""}`,children:r?(0,Is.jsx)("b",{children:t?.label}):t?.label}),(0,Is.jsx)(Jt,{icon:ed,flex:!0,onClick:this.selectAll,style:{flex:"0 0 50px",textAlign:"right"},children:"All"}),(0,Is.jsx)(Jt,{icon:Fc,flex:!0,onClick:this.selectNone,style:{flex:"0 0 50px",textAlign:"right"},children:"None"})]})}get basicHeader(){let{header:t,hasCurrent:r}=this.state;return(0,Is.jsx)("div",{className:"msp-control-group-header",style:{marginTop:"1px"},children:(0,Is.jsx)(Jt,{noOverflow:!0,icon:this.state.isExpanded?ec:tc,onClick:this.toggleExpanded,title:`Click to ${this.state.isExpanded?"collapse":"expand"}. ${t?.description?t?.description:""}`,children:r?(0,Is.jsx)("b",{children:t?.label}):t?.label})})}render(){let{items:t,onSelect:r,current:n}=this.props;if(Yh(t))return null;if(gS(t))return(0,Is.jsx)(nme,{item:t,onSelect:r,current:n,multiselect:this.props.multiselect});let{header:o}=this.state;return(0,Is.jsxs)(Is.Fragment,{children:[o&&(this.props.multiselect&&this.state.isExpanded?this.multiselectHeader:this.basicHeader),(0,Is.jsx)("div",{className:this.props.noOffset?void 0:this.props.noAccent?"msp-control-offset":"msp-accent-offset",children:(!o||this.state.isExpanded)&&t.map((i,s)=>Yh(i)?null:gS(i)?(0,Is.jsx)(nme,{item:i,onSelect:r,current:n,multiselect:this.props.multiselect},s):(0,Is.jsx)(e,{items:i,onSelect:r,current:n,multiselect:this.props.multiselect,noAccent:!0},s))})]})}},nme=({item:e,onSelect:t,current:r,multiselect:n})=>{let o=r===e,i=e.addOn?{position:"relative"}:void 0;return(0,Is.jsxs)(Jt,{icon:e.icon,noOverflow:!0,className:"msp-action-menu-button",onClick:s=>t(n?[e]:e,s),disabled:e.disabled,style:i,title:e.description,children:[o||e.selected?(0,Is.jsx)("b",{children:e.label}):e.label,e.addOn]})};function AU(e){return!!e&&Array.isArray(e)}function gS(e){let t=e;return t&&t.kind==="item"}function Yh(e){let t=e;return t&&t.kind==="header"}function PU(e,t){if(Yh(e))return t;if(gS(e))return t.push(e),t;for(let r of e)PU(r,t);return t}var Ws=vr(Ln());var ome=vr(Ui());var EU=[["black",0],["gray",8421504],["white",16777215],["red",13840661],["orange",14840576],["yellow",16565248],["green",6863872],["cyan",1484197],["blue",40160],["purple",8086783],["magenta",16394495],["violet",8200583]];var yS=class extends ome.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!!this.props.param.isExpanded||!!this.props.hideNameRow,lightness:0},this.toggleExpanded=t=>{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()},this.onClickSwatch=t=>{let r=Oe.fromHexString(t.currentTarget.getAttribute("data-color")||"0");r!==this.props.value&&(this.props.param.isExpanded||this.setState({isExpanded:!1}),this.update(r))},this.onR=t=>{let[,r,n]=Oe.toRgb(this.props.value),o=Oe.fromRgb(t,r,n);o!==this.props.value&&this.update(o)},this.onG=t=>{let[r,,n]=Oe.toRgb(this.props.value),o=Oe.fromRgb(r,t,n);o!==this.props.value&&this.update(o)},this.onB=t=>{let[r,n]=Oe.toRgb(this.props.value),o=Oe.fromRgb(r,n,t);o!==this.props.value&&this.update(o)},this.onRGB=t=>{let r=Oe.fromHexStyle(t.currentTarget.value||"0");r!==this.props.value&&this.update(r)},this.onLighten=()=>{this.update(Oe.lighten(this.props.value,.1))},this.onDarken=()=>{this.update(Oe.darken(this.props.value,.1))}}update(t){this.props.onChange({param:this.props.param,name:this.props.name,value:t})}swatch(){return(0,Ws.jsx)("div",{className:"msp-combined-color-swatch",children:EU.map(t=>(0,Ws.jsx)(Jt,{inline:!0,"data-color":t[1],onClick:this.onClickSwatch,style:{background:Oe.toStyle(t[1])}},t[1]))})}render(){let t=this.props.param.label||ra(this.props.name),[r,n,o]=Oe.toRgb(this.props.value),i=(0,Ws.jsxs)(Ws.Fragment,{children:[this.swatch(),(0,Ws.jsx)(cl,{label:"RGB",className:"msp-control-label-short",control:(0,Ws.jsxs)("div",{style:{display:"flex",textAlignLast:"center",left:"80px"},children:[(0,Ws.jsx)(Nc,{onChange:this.onR,numeric:!0,value:r,delayMs:250,style:{order:1,flex:"1 1 auto",minWidth:0},className:"msp-form-control",onEnter:this.props.onEnter,blurOnEnter:!0,blurOnEscape:!0}),(0,Ws.jsx)(Nc,{onChange:this.onG,numeric:!0,value:n,delayMs:250,style:{order:2,flex:"1 1 auto",minWidth:0},className:"msp-form-control",onEnter:this.props.onEnter,blurOnEnter:!0,blurOnEscape:!0}),(0,Ws.jsx)(Nc,{onChange:this.onB,numeric:!0,value:o,delayMs:250,style:{order:3,flex:"1 1 auto",minWidth:0},className:"msp-form-control",onEnter:this.props.onEnter,blurOnEnter:!0,blurOnEscape:!0}),(0,Ws.jsx)("input",{onInput:this.onRGB,type:"color",value:Oe.toHexStyle(this.props.value),style:{order:4,flex:"1 1 auto",minWidth:"32px",width:"32px",height:"32px",padding:"0 2px 0 2px",background:"none",border:"none",cursor:"pointer"}})]})}),(0,Ws.jsxs)("div",{style:{display:"flex",textAlignLast:"center"},children:[(0,Ws.jsx)(Jt,{onClick:this.onLighten,style:{order:1,flex:"1 1 auto",minWidth:0},className:"msp-form-control",children:"Lighten"}),(0,Ws.jsx)(Jt,{onClick:this.onDarken,style:{order:1,flex:"1 1 auto",minWidth:0},className:"msp-form-control",children:"Darken"})]})]});return this.props.hideNameRow?i:(0,Ws.jsxs)(Ws.Fragment,{children:[(0,Ws.jsx)(cl,{title:this.props.param.description,label:t,control:(0,Ws.jsx)(Jt,{onClick:this.toggleExpanded,inline:!0,className:"msp-combined-color-button",style:{background:Oe.toStyle(this.props.value)}})}),this.state.isExpanded&&(0,Ws.jsx)("div",{className:"msp-control-offset",children:i})]})}};var Myr=function(){let e=new Map;for(let t of EU)e.set(t[1],t[0]);return e}();var Sf=vr(Ln());var MU=vr(Ui());function ime(e){switch(e.kind){case"scale-legend":return DU;case"table-legend":return kU;default:console.warn(`${e} has no associated UI component`);return}}var DU=class extends MU.PureComponent{render(){let{legend:t}=this.props,r=t.colors.map(n=>Array.isArray(n)?`${Oe.toStyle(n[0])} ${100*n[1]}%`:Oe.toStyle(n)).join(", ");return(0,Sf.jsx)("div",{className:"msp-scale-legend",children:(0,Sf.jsxs)("div",{style:{background:`linear-gradient(to right, ${r})`},children:[(0,Sf.jsx)("span",{style:{float:"left"},children:t.minLabel}),(0,Sf.jsx)("span",{style:{float:"right"},children:t.maxLabel})]})})}},kU=class extends MU.PureComponent{render(){let{legend:t}=this.props;return(0,Sf.jsx)("div",{className:"msp-table-legend",children:t.table.map((r,n)=>{let[o,i]=r;return(0,Sf.jsxs)("div",{children:[(0,Sf.jsx)("div",{className:"msp-table-legend-color",style:{backgroundColor:Oe.toStyle(i)}}),(0,Sf.jsx)("div",{className:"msp-table-legend-text",children:o})]},n)})})}};var Cf=vr(Ln());var sme=vr(Ln()),ame=vr(Ui());var gD=class extends ame.Component{constructor(t){super(t),this.state={show:!1},this.handleHover=this.handleHover.bind(this),this.handleHoverOff=this.handleHoverOff.bind(this),this.deletePoint=this.deletePoint.bind(this)}handleHover(){this.setState({show:!0});let t=Ae.create(this.props.nX,this.props.nY);this.props.onmouseover(t)}handleHoverOff(){this.setState({show:!1}),this.props.onmouseover(void 0)}deletePoint(){this.props.delete(this.props.id)}render(){return[(0,sme.jsx)("circle",{r:"10",id:`${this.props.id}`,cx:this.props.x,cy:this.props.y,onClick:this.props.onclick,onDoubleClick:this.props.delete(this.props.id),onMouseEnter:this.handleHover,onMouseLeave:this.handleHoverOff,onMouseDown:this.props.onmousedown,fill:"black"},`${this.props.id}circle`)]}};var vD=vr(Ui());var yD=class extends vD.Component{constructor(t){super(t),this.handleKeyDown=r=>{},this.handleKeyUp=r=>{},this.handleClick=r=>n=>{},this.handleMouseDown=r=>n=>{if(r===0||r===this.state.points.length-1||this.state.canSelectMultiple)return;let o=this.normalizePoint(Ae.create(this.state.points[r][0],this.state.points[r][1]));this.ghostPoints.push(document.createElementNS(this.namespace,"circle")),this.ghostPoints[0].setAttribute("r","10"),this.ghostPoints[0].setAttribute("fill","orange"),this.ghostPoints[0].setAttribute("cx",`${o[0]}`),this.ghostPoints[0].setAttribute("cy",`${o[1]}`),this.ghostPoints[0].setAttribute("style","display: none"),this.gElement.appendChild(this.ghostPoints[0]),this.updatedX=o[0],this.updatedY=o[1],this.selected=[r]},this.deletePoint=r=>n=>{if(r===0||r===this.state.points.length-1)return;let o=this.state.points.filter((i,s)=>s!==r);o.sort((i,s)=>i[0]===s[0]?i[0]===0?i[1]-s[1]:i[1]===1?s[1]-i[1]:i[1]-s[1]:i[0]-s[0]),this.setState({points:o}),this.change(o),n.stopPropagation()},this.myRef=vD.createRef(),this.state={points:[Ae.create(0,0),Ae.create(1,0)],copyPoint:void 0,canSelectMultiple:!1},this.height=400,this.width=600,this.padding=70,this.selected=void 0,this.ghostPoints=[],this.namespace="http://www.w3.org/2000/svg";for(let r of this.props.data)this.state.points.push(r);this.state.points.sort((r,n)=>r[0]===n[0]?r[0]===0?r[1]-n[1]:r[1]===1?n[1]-r[1]:r[1]-n[1]:r[0]-n[0]),this.handleDrag=this.handleDrag.bind(this),this.handleMultipleDrag=this.handleMultipleDrag.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.refCallBack=this.refCallBack.bind(this),this.handlePointUpdate=this.handlePointUpdate.bind(this),this.change=this.change.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleLeave=this.handleLeave.bind(this),this.handleEnter=this.handleEnter.bind(this)}render(){let t=this.renderPoints(),r=this.renderLines(),n=this.renderHistogram();return[(0,Cf.jsx)("div",{children:(0,Cf.jsxs)("svg",{className:"msp-canvas",ref:this.refCallBack,viewBox:`0 0 ${this.width+this.padding} ${this.height+this.padding}`,onMouseMove:this.handleDrag,onMouseUp:this.handlePointUpdate,onMouseLeave:this.handleLeave,onMouseEnter:this.handleEnter,tabIndex:0,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onDoubleClick:this.handleDoubleClick,children:[(0,Cf.jsxs)("g",{stroke:"black",fill:"black",children:[n,r,t]}),(0,Cf.jsx)("g",{className:"ghost-points",stroke:"black",fill:"black"})]})},"LineGraph"),(0,Cf.jsx)("div",{id:"modal-root"},"modal")]}componentDidMount(){this.gElement=document.getElementsByClassName("ghost-points")[0]}change(t){let r=t.slice();r.shift(),r.pop(),this.props.onChange(r)}handleDrag(t){if(this.selected===void 0)return;let r=this.myRef.createSVGPoint(),n,o=this.padding/2;r.x=t.clientX,r.y=t.clientY;let i=r.matrixTransform(this.myRef.getScreenCTM().inverse());n=Ae.create(i.x,i.y),(i.xthis.width+o)&&(i.y>this.height+o||i.ythis.width+o?n=Ae.create(this.width+o,i.y):i.y>this.height+o?n=Ae.create(i.x,this.height+o):i.ys!==r[0]);o.push(n),o.sort((i,s)=>i[0]===s[0]?i[0]===0?i[1]-s[1]:i[1]===1?s[1]-i[1]:i[1]-s[1]:i[0]-s[0]),this.setState({points:o}),this.change(o),this.gElement.innerHTML="",this.ghostPoints=[],document.removeEventListener("mousemove",this.handleDrag,!0),document.removeEventListener("mouseup",this.handlePointUpdate,!0)}handleDoubleClick(t){let r=this.myRef.createSVGPoint();r.x=t.clientX,r.y=t.clientY;let n=r.matrixTransform(this.myRef.getScreenCTM().inverse()),o=this.state.points,i=this.padding/2;if(n.xthis.width+i||n.y>this.height+i||n.ya[0]===l[0]?a[0]===0?a[1]-l[1]:a[1]===1?l[1]-a[1]:a[1]-l[1]:a[0]-l[0]),this.setState({points:o}),this.change(o)}handleLeave(){this.selected!==void 0&&(document.addEventListener("mousemove",this.handleDrag,!0),document.addEventListener("mouseup",this.handlePointUpdate,!0))}handleEnter(){document.removeEventListener("mousemove",this.handleDrag,!0),document.removeEventListener("mouseup",this.handlePointUpdate,!0)}normalizePoint(t){let r=this.padding/2,n=this.width+r,o=this.height+r,i=t[0]*(n-r)+r,s=t[1]*(o-r)+r,a=this.height+this.padding-s;return Ae.create(i,a)}unNormalizePoint(t){let r=this.padding/2,n=this.width+r,o=this.height+r,i=(t[0]-r)/(n-r),s=(this.height+this.padding-t[1]-r)/(o-r);return Ae.create(i,s)}refCallBack(t){t&&(this.myRef=t)}renderHistogram(){if(!this.props.volume)return null;let t=wo.getHistogram(this.props.volume.grid,40),r=[],n=t.counts.length,o=this.width/n,i=this.padding/2,s=Js(t.counts)||1;for(let a=0;a{this.setState({isChanging:!0})},this.end=t=>{this.setState({isChanging:!1}),this.props.onChange(t)},this.updateCurrent=t=>{var r,n;this.setState({current:t}),(n=(r=this.props).onChangeImmediate)===null||n===void 0||n.call(r,t)},this.updateManually=t=>{this.setState({isChanging:!0});let r=t;this.props.step===1&&(r=Math.round(r)),rthis.props.max&&(r=this.props.max),this.setState({current:r,isChanging:!0})},this.onManualBlur=()=>{this.setState({isChanging:!1}),this.props.onChange(this.state.current)}}static getDerivedStateFromProps(t,r){return r.isChanging||t.value===r.current?null:{current:t.value}}render(){let t=this.props.step;return t===void 0&&(t=1),(0,ul.jsxs)("div",{className:"msp-slider",children:[(0,ul.jsx)("div",{children:(0,ul.jsx)(gw,{min:this.props.min,max:this.props.max,step:t,value:this.state.current,disabled:this.props.disabled,onBeforeChange:this.begin,onChange:this.updateCurrent,onAfterChange:this.end})}),(0,ul.jsx)("div",{children:(0,ul.jsx)(Nc,{numeric:!0,delayMs:50,value:this.state.current,blurOnEnter:!0,onBlur:this.onManualBlur,isDisabled:this.props.disabled,onChange:this.updateManually})})]})}},xD=class extends _f.Component{constructor(){super(...arguments),this.state={isChanging:!1,current:[0,1]},this.begin=()=>{this.setState({isChanging:!0})},this.end=t=>{this.setState({isChanging:!1}),this.props.onChange(t)},this.updateCurrent=t=>{this.setState({current:t})},this.updateMax=t=>{let r=t;this.props.step===1&&(r=Math.round(r)),rthis.props.max&&(r=this.props.max),this.props.onChange([this.state.current[0],r])},this.updateMin=t=>{let r=t;this.props.step===1&&(r=Math.round(r)),rthis.state.current[1]?r=this.state.current[1]:r>this.props.max&&(r=this.props.max),this.props.onChange([r,this.state.current[1]])}}static getDerivedStateFromProps(t,r){return r.isChanging||t.value[0]===r.current[0]&&t.value[1]===r.current[1]?null:{current:t.value}}render(){let t=this.props.step;return t===void 0&&(t=1),(0,ul.jsxs)("div",{className:"msp-slider2",children:[(0,ul.jsx)("div",{children:(0,ul.jsx)(Nc,{numeric:!0,delayMs:50,value:this.state.current[0],onEnter:this.props.onEnter,blurOnEnter:!0,isDisabled:this.props.disabled,onChange:this.updateMin})}),(0,ul.jsx)("div",{children:(0,ul.jsx)(gw,{min:this.props.min,max:this.props.max,step:t,value:this.state.current,disabled:this.props.disabled,onBeforeChange:this.begin,onChange:this.updateCurrent,onAfterChange:this.end,range:!0,allowCross:!0})}),(0,ul.jsx)("div",{children:(0,ul.jsx)(Nc,{numeric:!0,delayMs:50,value:this.state.current[1],onEnter:this.props.onEnter,blurOnEnter:!0,isDisabled:this.props.disabled,onChange:this.updateMax})})]})}};function RU(e){let t=[],r={}.hasOwnProperty;for(let n=0;n1||e.type.toLowerCase()==="touchend"&&e.touches.length>0}function cme(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function ume(e,t){return e?t.clientY:t.pageX}function dme(e,t){let r=t.getBoundingClientRect();return e?r.top+r.height*.5:r.left+r.width*.5}function BU(e){e.stopPropagation(),e.preventDefault()}var LU=class extends _f.Component{render(){let{className:t,tipFormatter:r,vertical:n,offset:o,value:i,index:s}=this.props,a=n?{bottom:`${o}%`}:{left:`${o}%`};return(0,ul.jsx)("div",{className:t,style:a,title:r(i,s)})}},gw=class extends _f.Component{constructor(t){super(t),this.sliderElement=_f.createRef(),this.handleElements=[],this.dragOffset=0,this.startPosition=0,this.startValue=0,this._getPointsCache=void 0,this.onMouseDown=u=>{if(u.button!==0)return;let d=ume(this.props.vertical,u);if(!this.isEventFromHandle(u))this.dragOffset=0;else{let m=dme(this.props.vertical,u.target);this.dragOffset=d-m,d=m}this.onStart(d),this.addDocumentEvents("mouse"),BU(u)},this.onTouchMove=u=>{if(lme(u)){this.end("touch");return}let d=cme(this.props.vertical,u);this.onMove(u,d-this.dragOffset)},this.onTouchStart=u=>{if(lme(u))return;let d=cme(this.props.vertical,u);if(!this.isEventFromHandle(u))this.dragOffset=0;else{let m=dme(this.props.vertical,u.target);this.dragOffset=d-m,d=m}this.onStart(d),this.addDocumentEvents("touch"),BU(u)},this.eventHandlers={touchmove:u=>this.onTouchMove(u),touchend:u=>this.end("touch"),mousemove:u=>this.onMouseMove(u),mouseup:u=>this.end("mouse")},this.calcOffset=u=>{let{min:d,max:m}=this.props;return(u-d)/(m-d)*100};let{range:r,min:n,max:o}=t,i=r?Array.apply(null,Array(+r+1)).map(()=>n):n,s="defaultValue"in t?t.defaultValue:i,a=t.value!==void 0?t.value:s,l=(r?a:[n,a]).map(u=>this.trimAlignValue(u)),c;r&&l[0]===l[l.length-1]&&l[0]===o?c=0:c=l.length-1,this.state={handle:null,recent:c,bounds:l}}componentDidUpdate(t){if(!("value"in this.props||"min"in this.props||"max"in this.props))return;let{bounds:r}=this.state;if(t.range){let o=(this.props.value||r).map(i=>this.trimAlignValue(i,this.props));if(o.every((i,s)=>i===r[s]))return;this.setState({bounds:o}),r.some(i=>this.isValueOutOfBounds(i,this.props))&&this.props.onChange(o)}else{let n=this.props.value!==void 0?this.props.value:r[1],o=this.trimAlignValue(n,this.props);if(o===r[1]&&r[0]===t.min)return;this.setState({bounds:[t.min,o]}),this.isValueOutOfBounds(r[1],this.props)&&this.props.onChange(o)}}onChange(t){let r=this.props;!("value"in r)?this.setState(t):t.handle!==void 0&&this.setState({handle:t.handle});let o=k(k({},this.state),t),i=r.range?o.bounds:o.bounds[1];r.onChange(i)}onMouseMove(t){let r=ume(this.props.vertical,t);this.onMove(t,r-this.dragOffset)}onMove(t,r){BU(t);let n=this.props,o=this.state,i=r-this.startPosition;i=this.props.vertical?-i:i;let s=i/this.getSliderLength()*(n.max-n.min),a=this.trimAlignValue(this.startValue+s),l=o.bounds[o.handle];if(a===l)return;let c=[...o.bounds];c[o.handle]=a;let u=o.handle;if(n.pushable){let d=o.bounds[u];this.pushSurroundingHandles(c,u,d)}else n.allowCross&&(c.sort((d,m)=>d-m),u=c.indexOf(a));this.onChange({handle:u,bounds:c})}onStart(t){this.props.onBeforeChange(this.getValue());let n=this.calcValueByPos(t);this.startValue=n,this.startPosition=t;let o=this.state,{bounds:i}=o,s=1;if(this.props.range){let c=0;for(let d=1;di[d]&&(c=d);Math.abs(i[c+1]-n)l-c),this._getPointsCache={marks:t,step:r,points:a}}return this._getPointsCache.points}getPrecision(t){let r=t.toString(),n=0;return r.indexOf(".")>=0&&(n=r.length-r.indexOf(".")-1),n}getSliderLength(){let t=this.sliderElement.current;return t?this.props.vertical?t.clientHeight:t.clientWidth:0}getSliderStart(){let r=this.sliderElement.current.getBoundingClientRect();return this.props.vertical?r.top:r.left}getValue(){let{bounds:t}=this.state;return this.props.range?t:t[1]}addDocumentEvents(t){t==="touch"?(document.addEventListener("touchmove",this.eventHandlers.touchmove),document.addEventListener("touchend",this.eventHandlers.touchend)):t==="mouse"&&(document.addEventListener("mousemove",this.eventHandlers.mousemove),document.addEventListener("mouseup",this.eventHandlers.mouseup))}calcValue(t){let{vertical:r,min:n,max:o}=this.props,i=Math.abs(t/this.getSliderLength());return r?(1-i)*(o-n)+n:i*(o-n)+n}calcValueByPos(t){let r=t-this.getSliderStart();return this.trimAlignValue(this.calcValue(r))}end(t){this.removeEvents(t),this.props.onAfterChange(this.getValue()),this.setState({handle:null})}isEventFromHandle(t){for(let r of this.handleElements)if(r.current===t.target)return!0;return!1}isValueOutOfBounds(t,r){return tr.max}pushHandle(t,r,n,o){let i=t[r],s=t[r];for(;n*(s-i)=o.length||s<0)return!1;let a=r+n,l=o[s],{pushable:c}=this.props,u=n*(t[a]-l);return this.pushHandle(t,a,n,+c-u)?(t[r]=l,!0):!1}pushSurroundingHandles(t,r,n){let{pushable:o}=this.props,i=t[r],s=0;if(t[r+1]-i<+o?s=1:i-t[r-1]<+o&&(s=-1),s===0)return;let a=r+s,l=s*(t[a]-i);this.pushHandle(t,a,s,+o-l)||(t[r]=n)}removeEvents(t){t==="touch"?(document.removeEventListener("touchmove",this.eventHandlers.touchmove),document.removeEventListener("touchend",this.eventHandlers.touchend)):t==="mouse"&&(document.removeEventListener("mousemove",this.eventHandlers.mousemove),document.removeEventListener("mouseup",this.eventHandlers.mouseup))}trimAlignValue(t,r){let{handle:n,bounds:o}=this.state||{},{marks:i,step:s,min:a,max:l,allowCross:c}=k(k({},this.props),r||{}),u=t;u<=a&&(u=a),u>=l&&(u=l),!c&&n!=null&&n>0&&u<=o[n-1]&&(u=o[n-1]),!c&&n!=null&&n=o[n+1]&&(u=o[n+1]);let d=Object.keys(i).map(parseFloat);if(s!==null){let h=Math.round((u-a)/s)*s+a;d.push(h)}let m=d.map(h=>Math.abs(u-h)),p=d[m.indexOf(Math.min.apply(Math,m))];return s!==null?parseFloat(p.toFixed(this.getPrecision(s))):p}render(){let{handle:t,bounds:r}=this.state,{className:n,prefixCls:o,disabled:i,vertical:s,range:a,step:l,marks:c,tipFormatter:u}=this.props,d=this.props.handle,m=r.map(this.calcOffset),p=`${o}-handle`,h=r.map((b,S)=>RU({[p]:!0,[`${p}-${S+1}`]:!0,[`${p}-lower`]:S===0,[`${p}-upper`]:S===r.length-1})),y={prefixCls:o,noTip:l===null||u===null,tipFormatter:u,vertical:s};if(this.handleElements.length!==r.length){this.handleElements=[];for(let b=0;b_f.cloneElement(d,te(k({},y),{className:h[S],value:b,offset:m[S],dragging:t===S,index:S,key:S,ref:this.handleElements[S]})));a||g.shift();let v=RU({[o]:!0,[`${o}-with-marks`]:Object.keys(c).length,[`${o}-disabled`]:i,[`${o}-vertical`]:this.props.vertical,[n]:!!n});return(0,ul.jsxs)("div",{ref:this.sliderElement,className:v,onTouchStart:i?Ll:this.onTouchStart,onMouseDown:i?Ll:this.onMouseDown,children:[(0,ul.jsx)("div",{className:`${o}-rail`}),g]})}};gw.defaultProps={prefixCls:"msp-slider-base",className:"",min:0,max:100,step:1,marks:{},handle:(0,ul.jsx)(LU,{className:"",vertical:!1,offset:0,tipFormatter:e=>e,value:0,index:0}),onBeforeChange:Ll,onChange:Ll,onAfterChange:Ll,tipFormatter:(e,t)=>e,disabled:!1,range:!1,vertical:!1,allowCross:!0,pushable:!1};var Hn=class extends ri.PureComponent{constructor(){super(...arguments),this.onChange=t=>{var r,n;if((n=(r=this.props).onChange)===null||n===void 0||n.call(r,t,this.props.values),this.props.onChangeValues){let o=te(k({},this.props.values),{[t.name]:t.value});this.props.onChangeValues(o,this.props.values)}},this.paramGroups=_c(t=>g7e(t))}renderGroup(t){var r;if(t.length===0)return null;let n=this.props.values,o=null,i;for(let[s,a,l]of t)!((r=a.hideIf)===null||r===void 0)&&r.call(a,n)||(o||(o=[]),i=a.category,o.push((0,Ze.jsx)(l,{param:a,onChange:this.onChange,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled,name:s,value:n[s]},s)));return o?i?[(0,Ze.jsx)(qs,{header:i,children:o},i)]:o:null}renderPart(t){let r=null;for(let n of t){let o=this.renderGroup(n);if(o){r||(r=[]);for(let i of o)r.push(i)}}return r}render(){let t=this.paramGroups(this.props.params),r=this.renderPart(t.essentials),n=this.renderPart(t.advanced);return r&&n?(0,Ze.jsxs)(Ze.Fragment,{children:[r,(0,Ze.jsx)(qs,{header:"Advanced Options",children:n})]}):r||n}},SD=class extends pr{constructor(){super(...arguments),this.state={isDisabled:!1},this.setSettings=(t,r)=>{let n=te(k({},r),{[t.name]:t.value}),o=this.props.mapping.update(n,this.plugin);this.props.mapping.apply(o,this.plugin)}}componentDidMount(){this.subscribe(this.plugin.state.data.behaviors.isUpdating,t=>{this.setState({isDisabled:t})})}render(){let t=this.props.mapping.getTarget(this.plugin),r=this.props.mapping.getValues(t,this.plugin),n=this.props.mapping.params(this.plugin);return(0,Ze.jsx)(Hn,{params:n,values:r,onChange:this.setSettings,isDisabled:this.state.isDisabled})}};function g7e(e){function t(s,a,l){let c=Sw(a);if(c)if(!a.category)l.params[0].push([s,a,c]);else{l.map||(l.map=new Map);let u=l.map.get(a.category);u||(u=[],l.map.set(a.category,u),l.params.push(u)),u.push([s,a,c])}}function r(s,a){let l=s[0],c=a[0];return!l||!l[1].category?-1:!c||!c[1].category?1:l[1].categorythis.setState({showHelp:!this.state.showHelp})}update(t){this.props.onChange({param:this.props.param,name:this.props.name,value:t})}renderAddOn(){return null}render(){return pv({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderAddOn()})}},xw=class extends mv{constructor(){super(...arguments),this.onClick=t=>{this.update(!this.props.value),t.currentTarget.blur()}}renderControl(){return(0,Ze.jsxs)("button",{onClick:this.onClick,disabled:this.props.isDisabled,children:[(0,Ze.jsx)(tn,{svg:this.props.value?ed:xU}),this.props.value?"On":"Off"]})}},FU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1,isOverPoint:!1,message:`${this.props.param.defaultValue.length} points`},this.onHover=t=>{this.setState({isOverPoint:!this.state.isOverPoint}),t?this.setState({message:this.pointToLabel(t)}):this.setState({message:`${this.props.value.length} points`})},this.onDrag=t=>{this.setState({message:this.pointToLabel(t)})},this.onChange=t=>{this.props.onChange({name:this.props.name,param:this.props.param,value:t})},this.toggleExpanded=t=>{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()}}pointToLabel(t){var r,n;if(!t)return"";let o=(n=(r=this.props.param).getVolume)===null||n===void 0?void 0:n.call(r);if(o){let{min:i,max:s,mean:a,sigma:l}=o.grid.stats,c=i+(s-i)*t[0],u=(c-a)/l;return`(${c.toFixed(2)} | ${u.toFixed(2)}\u03C3, ${t[1].toFixed(2)})`}else return`(${t[0].toFixed(2)}, ${t[1].toFixed(2)})`}render(){var t,r;let n=this.props.param.label||ra(this.props.name);return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(cl,{label:n,control:(0,Ze.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:`${this.state.message}`})}),(0,Ze.jsx)("div",{className:"msp-control-offset",style:{display:this.state.isExpanded?"block":"none",marginTop:1},children:(0,Ze.jsx)(yD,{data:this.props.value,volume:(r=(t=this.props.param).getVolume)===null||r===void 0?void 0:r.call(t),onChange:this.onChange,onHover:this.onHover,onDrag:this.onDrag})})]})}},OU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={value:"0"},this.update=t=>{let r=mC(this.props.param.step||.01);t=parseFloat(t.toFixed(r)),this.props.onChange({param:this.props.param,name:this.props.name,value:t})}}render(){let t=this.props.param.label||ra(this.props.name),r=this.props.param.label||ra(this.props.name),n=mC(this.props.param.step||.01);return(0,Ze.jsx)(cl,{title:this.props.param.description,label:r,control:(0,Ze.jsx)(Nc,{numeric:!0,value:parseFloat(this.props.value.toFixed(n)),onEnter:this.props.onEnter,placeholder:t,isDisabled:this.props.isDisabled,onChange:this.update})})}},NU=class extends mv{constructor(){super(...arguments),this.onChange=t=>{this.update(t)}}renderControl(){let t=typeof this.props.value>"u"?this.props.param.defaultValue:this.props.value;return(0,Ze.jsx)(vS,{value:t,min:this.props.param.min,max:this.props.param.max,step:this.props.param.step,onChange:this.onChange,onChangeImmediate:this.props.param.immediateUpdate?this.onChange:void 0,disabled:this.props.isDisabled,onEnter:this.props.onEnter})}},CD=class extends mv{constructor(){super(...arguments),this.updateValue=t=>{t!==this.props.value&&this.update(t)}}renderControl(){let t=this.props.param.placeholder||this.props.param.label||ra(this.props.name);return(0,Ze.jsx)(y7e,{props:this.props,placeholder:t,update:this.updateValue})}};function y7e({props:e,placeholder:t,update:r}){let[n,o]=ri.useState(e.value);return ri.useEffect(()=>o(e.value),[e.value]),e.param.multiline?(0,Ze.jsx)("div",{className:"msp-control-text-area-wrapper",children:(0,Ze.jsx)("textarea",{value:e.param.disableInteractiveUpdates?n||"":e.value,placeholder:t,onChange:i=>{e.param.disableInteractiveUpdates?o(i.target.value):r(i.target.value)},onBlur:i=>{e.param.disableInteractiveUpdates&&r(i.target.value)},onKeyDown:i=>{i.key==="Enter"&&(i.shiftKey||i.ctrlKey||i.metaKey)&&i.currentTarget.blur()},disabled:e.isDisabled})}):(0,Ze.jsx)("input",{type:"text",value:e.param.disableInteractiveUpdates?n||"":e.value,placeholder:t,onChange:i=>{e.param.disableInteractiveUpdates?o(i.target.value):r(i.target.value)},onBlur:i=>{e.param.disableInteractiveUpdates&&r(i.target.value)},disabled:e.isDisabled,onKeyDown:i=>{i.key==="Enter"&&(e.onEnter?(i.stopPropagation(),e.onEnter()):i.key==="Enter"&&(i.shiftKey||i.ctrlKey||i.metaKey)?i.currentTarget.blur():e.param.disableInteractiveUpdates&&r(n))}})}var wf=class extends ri.PureComponent{constructor(){super(...arguments),this.onChange=t=>{typeof this.props.param.defaultValue=="number"?this.update(parseInt(t.target.value,10)):this.update(t.target.value)}}update(t){this.props.onChange({param:this.props.param,name:this.props.name,value:t})}render(){let t=this.props.value!==void 0&&!this.props.param.options.some(r=>r[0]===this.props.value);return(0,Ze.jsxs)("select",{className:"msp-form-control",title:this.props.title,value:this.props.value!==void 0?this.props.value:this.props.param.defaultValue,onChange:this.onChange,disabled:this.props.isDisabled,children:[t&&(0,Ze.jsx)("option",{value:this.props.value,children:`[Invalid] ${this.props.value}`},this.props.value),this.props.param.options.map(([r,n])=>(0,Ze.jsx)("option",{value:r,children:n},r))]})}},xS=class extends ri.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,showOptions:!1},this.onSelect=t=>{!t||t.value===this.props.value?this.setState({showOptions:!1}):this.setState({showOptions:!1},()=>{this.props.onChange({param:this.props.param,name:this.props.name,value:t.value})})},this.toggle=()=>this.setState({showOptions:!this.state.showOptions}),this.cycle=()=>{let{options:t}=this.props.param,r=t.findIndex(o=>o[0]===this.props.value),n=r===t.length-1?0:r+1;this.props.onChange({param:this.props.param,name:this.props.name,value:t[n][0]})},this.items=_c(t=>sr.createItemsFromSelectOptions(t.options)),this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}renderControl(){var t;let r=this.items(this.props.param),n=this.props.value!==void 0?sr.findItem(r,this.props.value):void 0,o=n?n.label:typeof this.props.value>"u"?`${((t=sr.getFirstItem(r))===null||t===void 0?void 0:t.label)||""} [Default]`:`[Invalid] ${this.props.value}`,i=this.props.param.cycle?this.cycle:this.toggle,s=this.props.param.cycle?"center":"left",a=this.props.param.cycle?this.props.value==="on"?ed:this.props.value==="off"?xU:void 0:void 0;return(0,Ze.jsx)(Wo,{disabled:this.props.isDisabled,style:{textAlign:s,overflow:"hidden",textOverflow:"ellipsis"},label:o,title:o,icon:a,toggle:i,isSelected:this.state.showOptions})}renderAddOn(){if(!this.state.showOptions)return null;let t=this.items(this.props.param),r=sr.findItem(t,this.props.value);return(0,Ze.jsx)(sr,{items:t,current:r,onSelect:this.onSelect})}render(){return pv({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderAddOn()})}},v7e=(()=>{class e extends ri.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,showOptions:!1},this.onSelect=r=>{!r||r.value===this.props.value?this.setState({showOptions:!1}):this.setState({showOptions:!1},()=>{this.props.onChange({param:this.props.param,name:this.props.name,value:{ref:r.value}})})},this.toggle=()=>this.setState({showOptions:!this.state.showOptions}),this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}get items(){return sr.createItemsFromSelectOptions(this.props.param.getOptions(this.context))}renderControl(){var r;let n=this.items,o=this.props.value.ref?sr.findItem(n,this.props.value.ref):void 0,i=o?o.label:`[Ref] ${(r=this.props.value.ref)!==null&&r!==void 0?r:""}`;return(0,Ze.jsx)(Wo,{disabled:this.props.isDisabled,style:{textAlign:"left",overflow:"hidden",textOverflow:"ellipsis"},label:i,title:i,toggle:this.toggle,isSelected:this.state.showOptions})}renderAddOn(){if(!this.state.showOptions)return null;let r=this.items,n=sr.findItem(r,this.props.value.ref);return(0,Ze.jsx)(sr,{items:r,current:n,onSelect:this.onSelect})}render(){return pv({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderAddOn()})}}return e.contextType=vu,e})(),UU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.components={0:C.Numeric(0,{step:this.props.param.step},{label:"Min"}),1:C.Numeric(0,{step:this.props.param.step},{label:"Max"})},this.componentChange=({name:t,value:r})=>{let n=[...this.props.value];n[+t]=r,this.change(n)},this.toggleExpanded=t=>{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()}}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}render(){let t=this.props.value,r=this.props.param.label||ra(this.props.name),n=mC(this.props.param.step||.01),o=`[${t[0].toFixed(n)}, ${t[1].toFixed(n)}]`;return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(cl,{label:r,control:(0,Ze.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:o})}),this.state.isExpanded&&(0,Ze.jsx)("div",{className:"msp-control-offset",children:(0,Ze.jsx)(Hn,{params:this.components,values:t,onChange:this.componentChange,onEnter:this.props.onEnter})})]})}},zU=class extends mv{constructor(){super(...arguments),this.onChange=t=>{this.update(t)}}renderControl(){return(0,Ze.jsx)(xD,{value:this.props.value,min:this.props.param.min,max:this.props.param.max,step:this.props.param.step,onChange:this.onChange,disabled:this.props.isDisabled,onEnter:this.props.onEnter})}};function yw(e,t=!1){return Array.isArray(e)?t?`${Oe.toStyle(e[0])} ${(100*e[1]).toFixed(2)}%`:Oe.toStyle(e[0]):Oe.toStyle(e)}var x7e=gh(e=>`linear-gradient(to right, ${e.map(r=>yw(r,!0)).join(", ")})`),b7e=gh(e=>{let t=e.length,r=[`${yw(e[0])} ${100*(1/t)}%`];for(let n=1,o=t-1;n{let r=zs(t[0]);return(0,Ze.jsx)("div",{style:t8({kind:r.type!=="qualitative"?"interpolate":"set",colors:r.list})})};return{ColorPresets:{all:sr.createItemsFromSelectOptions(VA,{addOn:e}),scale:sr.createItemsFromSelectOptions(tq,{addOn:e}),set:sr.createItemsFromSelectOptions(rq,{addOn:e})},ColorsParam:C.ObjectList({color:C.Color(0)},({color:t})=>Oe.toHexString(t).toUpperCase()),OffsetColorsParam:C.ObjectList({color:C.Color(0),offset:C.Numeric(0,{min:0,max:1,step:.01})},({color:t,offset:r})=>`${Oe.toHexString(t).toUpperCase()} [${r.toFixed(2)}]`),IsInterpolatedParam:C.Boolean(!1,{label:"Interpolated"})}}var bD;function mme(){return bD||(bD=C7e(),bD)}var VU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,show:void 0},this.toggleEdit=()=>this.setState({show:this.state.show==="edit"?void 0:"edit"}),this.togglePresets=()=>this.setState({show:this.state.show==="presets"?void 0:"presets"}),this.selectPreset=t=>{if(!t)return;this.setState({show:void 0});let r=zs(t.value);this.update({kind:r.type!=="qualitative"?"interpolate":"set",colors:r.list})},this.colorsChanged=({value:t})=>{this.update({kind:this.props.value.kind,colors:t.map(r=>r.color)})},this.isInterpolatedChanged=({value:t})=>{this.update({kind:t?"interpolate":"set",colors:this.props.value.colors})},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}update(t){this.props.onChange({param:this.props.param,name:this.props.name,value:t})}renderControl(){let{value:t}=this.props;return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsxs)("button",{onClick:this.toggleEdit,style:{position:"relative",paddingRight:"33px"},children:[t.colors.length===1?"1 color":`${t.colors.length} colors`,(0,Ze.jsx)("div",{style:t8(t,"33px")})]}),(0,Ze.jsx)(Qt,{svg:qh,onClick:this.togglePresets,toggleState:this.state.show==="presets",title:"Color Presets",style:{padding:0,position:"absolute",right:0,top:0,width:"32px"}})]})}renderColors(){if(!this.state.show)return null;let{ColorPresets:t,ColorsParam:r,IsInterpolatedParam:n}=mme(),o=t[this.props.param.presetKind];if(this.state.show==="presets")return(0,Ze.jsx)(sr,{items:o,onSelect:this.selectPreset});let i=this.props.value.colors.map(s=>({color:s}));return(0,Ze.jsxs)("div",{className:"msp-control-offset",children:[(0,Ze.jsx)(bw,{name:"colors",param:r,value:i,onChange:this.colorsChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter}),(0,Ze.jsx)(xw,{name:"isInterpolated",param:n,value:this.props.value.kind==="interpolate",onChange:this.isInterpolatedChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter})]})}render(){return pv({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderColors()})}},GU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1,show:void 0},this.toggleEdit=()=>this.setState({show:this.state.show==="edit"?void 0:"edit"}),this.togglePresets=()=>this.setState({show:this.state.show==="presets"?void 0:"presets"}),this.selectPreset=t=>{if(!t)return;this.setState({show:void 0});let r=zs(t.value);this.update({kind:r.type!=="qualitative"?"interpolate":"set",colors:r.list})},this.colorsChanged=({value:t})=>{let r=t.map(n=>[n.color,n.offset]);r.sort((n,o)=>n[1]-o[1]),this.update({kind:this.props.value.kind,colors:r})},this.isInterpolatedChanged=({value:t})=>{this.update({kind:t?"interpolate":"set",colors:this.props.value.colors})},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}update(t){this.props.onChange({param:this.props.param,name:this.props.name,value:t})}renderControl(){let{value:t}=this.props;return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsxs)("button",{onClick:this.toggleEdit,style:{position:"relative",paddingRight:"33px"},children:[t.colors.length===1?"1 color":`${t.colors.length} colors`,(0,Ze.jsx)("div",{style:t8(t,"33px")})]}),(0,Ze.jsx)(Qt,{svg:qh,onClick:this.togglePresets,toggleState:this.state.show==="presets",title:"Color Presets",style:{padding:0,position:"absolute",right:0,top:0,width:"32px"}})]})}renderColors(){if(!this.state.show)return null;let{ColorPresets:t,OffsetColorsParam:r,IsInterpolatedParam:n}=mme(),o=t[this.props.param.presetKind];if(this.state.show==="presets")return(0,Ze.jsx)(sr,{items:o,onSelect:this.selectPreset});let i=this.props.value.colors,s=i.map((a,l)=>Array.isArray(a)?{color:a[0],offset:a[1]}:{color:a,offset:l/i.length});return s.sort((a,l)=>a.offset-l.offset),(0,Ze.jsxs)("div",{className:"msp-control-offset",children:[(0,Ze.jsx)(bw,{name:"colors",param:r,value:s,onChange:this.colorsChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter}),(0,Ze.jsx)(xw,{name:"isInterpolated",param:n,value:this.props.value.kind==="interpolate",onChange:this.isInterpolatedChanged,isDisabled:this.props.isDisabled,onEnter:this.props.onEnter})]})}render(){return pv({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:this.renderColors()})}},HU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.components={0:C.Numeric(0,{step:this.props.param.step},{label:this.props.param.fieldLabels&&this.props.param.fieldLabels.x||"X"}),1:C.Numeric(0,{step:this.props.param.step},{label:this.props.param.fieldLabels&&this.props.param.fieldLabels.y||"Y"}),2:C.Numeric(0,{step:this.props.param.step},{label:this.props.param.fieldLabels&&this.props.param.fieldLabels.z||"Z"})},this.componentChange=({name:t,value:r})=>{let n=x.copy(x.zero(),this.props.value);n[+t]=r,this.change(n)},this.toggleExpanded=t=>{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()}}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}render(){let t=this.props.value,r=this.props.param.label||ra(this.props.name),n=mC(this.props.param.step||.01),o=`[${t[0].toFixed(n)}, ${t[1].toFixed(n)}, ${t[2].toFixed(n)}]`;return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(cl,{label:r,control:(0,Ze.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:o})}),this.state.isExpanded&&(0,Ze.jsx)("div",{className:"msp-control-offset",children:(0,Ze.jsx)(Hn,{params:this.components,values:t,onChange:this.componentChange,onEnter:this.props.onEnter})})]})}},jU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.components={json:C.Text(JSON.stringify(ne()),{description:"JSON array with 4x4 matrix in a column major (j * 4 + i indexing) format"})},this.componentChange=({name:t,value:r})=>{let n=ne.copy(ne(),this.props.value);t==="json"?ne.copy(n,JSON.parse(r)):n[+t]=r,this.change(n)},this.toggleExpanded=t=>{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()}}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}changeValue(t){return r=>{let n=ne.copy(ne(),this.props.value);n[t]=r,this.change(n)}}get grid(){let t=this.props.value,r=[];for(let n=0;n<4;n++){let o=[];for(let i=0;i<4;i++)o.push((0,Ze.jsx)(Nc,{numeric:!0,delayMs:50,value:ne.getValue(t,n,i),onChange:this.changeValue(4*i+n),className:"msp-form-control",blurOnEnter:!0,isDisabled:this.props.isDisabled},i));r.push((0,Ze.jsx)("div",{className:"msp-flex-row",children:o},n))}return(0,Ze.jsx)("div",{className:"msp-parameter-matrix",children:r})}render(){let t={json:JSON.stringify(this.props.value)},r=this.props.param.label||ra(this.props.name);return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(cl,{label:r,control:(0,Ze.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:"4\xD74 Matrix"})}),this.state.isExpanded&&(0,Ze.jsxs)("div",{className:"msp-control-offset",children:[this.grid,(0,Ze.jsx)(Hn,{params:this.components,values:t,onChange:this.componentChange,onEnter:this.props.onEnter})]})]})}},qU=class extends mv{constructor(){super(...arguments),this.onChange=t=>{let r=t.target.value;r!==Or.getUrl(this.props.value||"")&&this.update(Or.Url(r))},this.onKeyPress=t=>{(t.keyCode===13||t.charCode===13||t.key==="Enter")&&this.props.onEnter&&this.props.onEnter(),t.stopPropagation()}}renderControl(){let t=this.props.param.label||ra(this.props.name);return(0,Ze.jsx)("input",{type:"text",value:Or.getUrl(this.props.value||""),placeholder:t,onChange:this.onChange,onKeyPress:this.props.onEnter?this.onKeyPress:void 0,disabled:this.props.isDisabled})}},WU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1},this.onChangeFile=t=>{this.change(t.target.files[0])},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:Or.File(t)})}renderControl(){let t=this.props.value;return(0,Ze.jsxs)("div",{className:"msp-btn msp-btn-block msp-btn-action msp-loader-msp-btn-file",style:{marginTop:"1px"},children:[t?t.name:"Select a file..."," ",(0,Ze.jsx)("input",{disabled:this.props.isDisabled,onChange:this.onChangeFile,type:"file",multiple:!1,accept:this.props.param.accept})]})}render(){return this.props.param.label?pv({props:this.props,state:this.state,control:this.renderControl(),toggleHelp:this.toggleHelp,addOn:null}):this.renderControl()}},YU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={showHelp:!1},this.onChangeFileList=t=>{this.change(t.target.files)},this.toggleHelp=()=>this.setState({showHelp:!this.state.showHelp})}change(t){let r=[];if(t)for(let n=0,o=t.length;n{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()}}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}toggle(t){return r=>{this.props.value.indexOf(t)<0?this.change(this.props.value.concat(t)):this.change(this.props.value.filter(n=>n!==t)),r.currentTarget.blur()}}render(){let t=this.props.value,r=this.props.param.emptyValue,n=this.props.param.label||ra(this.props.name);return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(cl,{label:n,control:(0,Ze.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:t.length===0&&r?r:`${t.length} of ${this.props.param.options.length}`})}),this.state.isExpanded&&(0,Ze.jsx)("div",{className:"msp-control-offset",children:this.props.param.options.map(([o,i])=>{let s=t.indexOf(o)>=0;return(0,Ze.jsx)(Jt,{onClick:this.toggle(o),disabled:this.props.isDisabled,style:{marginTop:"1px"},children:(0,Ze.jsx)("span",{style:{float:s?"left":"right"},children:s?`\u2713 ${i}`:`${i} \u2717`})},o)})})]})}},_D=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!!this.props.param.isExpanded,showPresets:!1,showHelp:!1},this.onChangeParam=t=>{this.change(te(k({},this.props.value),{[t.name]:t.value}))},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded}),this.toggleShowPresets=()=>this.setState({showPresets:!this.state.showPresets}),this.presetItems=_c(t=>{var r;return sr.createItemsFromSelectOptions((r=t.presets)!==null&&r!==void 0?r:[])}),this.onSelectPreset=t=>{this.setState({showPresets:!1}),this.change(t?.value)}}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}pivotedPresets(){if(!this.props.param.presets)return null;let t=this.props.param.label||ra(this.props.name);return(0,Ze.jsxs)("div",{className:"msp-control-group-wrapper",children:[(0,Ze.jsx)("div",{className:"msp-control-group-header",children:(0,Ze.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleShowPresets,children:[(0,Ze.jsx)(tn,{svg:qh}),t," Presets"]})}),this.state.showPresets&&(0,Ze.jsx)(sr,{items:this.presetItems(this.props.param),onSelect:this.onSelectPreset})]})}presets(){return this.props.param.presets?(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)("div",{className:"msp-control-group-presets-wrapper",children:(0,Ze.jsx)("div",{className:"msp-control-group-header",children:(0,Ze.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleShowPresets,children:[(0,Ze.jsx)(tn,{svg:qh}),"Presets"]})})}),this.state.showPresets&&(0,Ze.jsx)(sr,{items:this.presetItems(this.props.param),onSelect:this.onSelectPreset})]}):null}pivoted(){let t=this.props.param.pivot,r=this.props.param.params,n=r[t],o=Sw(n),i=(0,Ze.jsx)(o,{name:t,param:n,value:this.props.value[t],onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled});if(!this.state.isExpanded)return(0,Ze.jsxs)("div",{className:"msp-mapped-parameter-group",children:[i,(0,Ze.jsx)(Qt,{svg:lm,onClick:this.toggleExpanded,toggleState:this.state.isExpanded,title:"More Options"})]});let s=Object.create(null);for(let a of Object.keys(r))a!==t&&(s[a]=r[a]);return(0,Ze.jsxs)("div",{className:"msp-mapped-parameter-group",children:[i,(0,Ze.jsx)(Qt,{svg:lm,onClick:this.toggleExpanded,toggleState:this.state.isExpanded,title:"More Options"}),(0,Ze.jsxs)("div",{className:"msp-control-offset",children:[this.pivotedPresets(),(0,Ze.jsx)(Hn,{params:s,onEnter:this.props.onEnter,values:this.props.value,onChange:this.onChangeParam,isDisabled:this.props.isDisabled})]})]})}render(){let t=this.props.param.params;if(Object.keys(t).length===0)return null;if(this.props.param.pivot)return this.pivoted();let r=this.props.param.label||ra(this.props.name),n=(0,Ze.jsx)(Hn,{params:t,onChange:this.onChangeParam,values:this.props.value,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled});return this.props.inMapped?(0,Ze.jsx)("div",{className:"msp-control-offset",children:n}):this.props.param.isFlat?n:(0,Ze.jsxs)("div",{className:"msp-control-group-wrapper",style:{position:"relative"},children:[(0,Ze.jsx)("div",{className:"msp-control-group-header",children:(0,Ze.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleExpanded,children:[(0,Ze.jsx)(tn,{svg:this.state.isExpanded?ec:tc}),r]})}),this.presets(),this.state.isExpanded&&(0,Ze.jsx)("div",{className:"msp-control-offset",children:n})]})}},KU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.valuesCache={},this.onChangeName=t=>{this.change({name:t.value,params:this.getValues(t.value)})},this.onChangeParam=t=>{this.setValues(this.props.value.name,t.value),this.change({name:this.props.value.name,params:t.value})},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}setValues(t,r){this.valuesCache[t]=r}getValues(t){return t in this.valuesCache?this.valuesCache[t]:this.props.param.map(t).defaultValue}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}areParamsEmpty(t){for(let r of Object.keys(t))if(!t[r].isHidden)return!1;return!0}render(){let t=this.props.value||this.props.param.defaultValue,r=this.props.param.map(t.name),n=this.props.param.label||ra(this.props.name),o=Sw(r),i=this.props.param.help,s=i?te(k({},this.props.param.select),{help:l=>i({name:l,params:this.getValues(l)})}):this.props.param.select,a=(0,Ze.jsx)(xS,{param:s,isDisabled:this.props.isDisabled,onChange:this.onChangeName,onEnter:this.props.onEnter,name:n,value:t.name});return o?r.type==="group"&&!r.isFlat?this.areParamsEmpty(r.params)?a:(0,Ze.jsxs)("div",{className:"msp-mapped-parameter-group",children:[a,(0,Ze.jsx)(Qt,{svg:lm,onClick:this.toggleExpanded,toggleState:this.state.isExpanded,title:`${n} Properties`}),this.state.isExpanded&&(0,Ze.jsx)(_D,{inMapped:!0,param:r,value:t.params,name:t.name,onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled})]}):(0,Ze.jsxs)(Ze.Fragment,{children:[a,(0,Ze.jsx)(o,{param:r,value:t.params,name:t.name,onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled})]}):a}},wD=class extends ri.PureComponent{constructor(){super(...arguments),this.state={current:this.props.value},this.onChangeParam=t=>{this.setState({current:te(k({},this.state.current),{[t.name]:t.value})})},this.apply=()=>{this.props.apply(this.state.current)}}componentDidUpdate(t){(this.props.params!==t.params||this.props.value!==t.value)&&this.setState({current:this.props.value})}render(){return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(Hn,{params:this.props.params,onChange:this.onChangeParam,values:this.state.current,onEnter:this.apply,isDisabled:this.props.isDisabled}),(0,Ze.jsx)("button",{className:"msp-btn msp-btn-block msp-form-control msp-control-top-offset",onClick:this.apply,disabled:this.props.isDisabled,children:this.props.isUpdate?"Update":"Add"})]})}},QU=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.update=t=>{this.props.actions.update(t,this.props.index)},this.moveUp=()=>{this.props.actions.move(this.props.index,-1)},this.moveDown=()=>{this.props.actions.move(this.props.index,1)},this.remove=()=>{this.setState({isExpanded:!1}),this.props.actions.remove(this.props.index)},this.toggleExpanded=t=>{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()}}render(){return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsxs)("div",{className:"msp-param-object-list-item",children:[(0,Ze.jsxs)("button",{className:"msp-btn msp-btn-block msp-form-control",onClick:this.toggleExpanded,children:[(0,Ze.jsx)("span",{children:`${this.props.index+1}: `}),this.props.param.getLabel(this.props.value)]}),(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)(Qt,{svg:oy,title:"Move Up",onClick:this.moveUp,small:!0}),(0,Ze.jsx)(Qt,{svg:iy,title:"Move Down",onClick:this.moveDown,small:!0}),(0,Ze.jsx)(Qt,{svg:ua,title:"Remove",onClick:this.remove,small:!0})]})]}),this.state.isExpanded&&(0,Ze.jsx)("div",{className:"msp-control-offset",children:(0,Ze.jsx)(wD,{params:this.props.param.element,apply:this.update,value:this.props.value,isUpdate:!0,isDisabled:this.props.isDisabled})})]})}},bw=class extends ri.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!1},this.add=t=>{this.change([...this.props.value,t])},this.actions={update:(t,r)=>{let n=this.props.value.slice(0);n[r]=t,this.change(n)},move:(t,r)=>{let n=this.props.value;if(n.length===1)return;let o=(t+r)%n.length;o<0&&(o+=n.length),n=n.slice(0);let i=n[t];n[t]=n[o],n[o]=i,this.change(n)},remove:t=>{let r=this.props.value,n=[];for(let o=0;o{this.setState({isExpanded:!this.state.isExpanded}),t.currentTarget.blur()}}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}render(){let t=this.props.value,r=this.props.param.label||ra(this.props.name),n=`${t.length} item${t.length!==1?"s":""}`;return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(cl,{label:r,control:(0,Ze.jsx)("button",{onClick:this.toggleExpanded,disabled:this.props.isDisabled,children:n})}),this.state.isExpanded&&(0,Ze.jsxs)("div",{className:"msp-control-offset",children:[this.props.value.map((o,i)=>(0,Ze.jsx)(QU,{param:this.props.param,value:o,index:i,actions:this.actions,isDisabled:this.props.isDisabled},i)),(0,Ze.jsx)(ll,{header:"New Item",children:(0,Ze.jsx)(wD,{params:this.props.param.element,apply:this.add,value:this.props.param.ctor(),isDisabled:this.props.isDisabled})})]})]})}},ZU=class extends ri.PureComponent{constructor(){super(...arguments),this.onChangeCondition=t=>{this.change(this.props.param.conditionedValue(this.props.value,t.value))},this.onChangeParam=t=>{this.change(t.value)}}change(t){this.props.onChange({name:this.props.name,param:this.props.param,value:t})}render(){let t=this.props.value,r=this.props.param.conditionForValue(t),n=this.props.param.conditionParams[r],o=this.props.param.label||ra(this.props.name),i=Sw(n),s=(0,Ze.jsx)(xS,{param:this.props.param.select,isDisabled:this.props.isDisabled,onChange:this.onChangeCondition,onEnter:this.props.onEnter,name:`${o} Kind`,value:r});return i?(0,Ze.jsxs)(Ze.Fragment,{children:[s,(0,Ze.jsx)(i,{param:n,value:t,name:o,onChange:this.onChangeParam,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled})]}):s}},$U=class extends ri.PureComponent{constructor(){super(...arguments),this.onChange=t=>{this.props.onChange({name:this.props.name,param:this.props.param,value:this.props.param.toValue(t.value)})}}render(){let t=this.props.param.fromValue(this.props.value),r=Sw(this.props.param.converted);return r?(0,Ze.jsx)(r,{param:this.props.param.converted,value:t,name:this.props.name,onChange:this.onChange,onEnter:this.props.onEnter,isDisabled:this.props.isDisabled}):null}},JU=class extends ri.PureComponent{constructor(){super(...arguments),this.onChange=({name:t,value:r})=>{let n=t;r!==this.props.value[n]&&this.props.onChange({param:this.props.param,name:this.props.name,value:te(k({},this.props.value),{[n]:r})})}}render(){let t={defaultValue:this.props.value.language,options:C.objectToOptions(eo.Info),type:"select"},r=(0,Ze.jsx)(xS,{param:t,isDisabled:this.props.isDisabled,onChange:this.onChange,onEnter:this.props.onEnter,name:"language",value:this.props.value.language}),n={defaultValue:this.props.value.language,type:"text"},o=(0,Ze.jsx)(CD,{param:n,isDisabled:this.props.isDisabled,onChange:this.onChange,name:"expression",value:this.props.value.expression});return(0,Ze.jsxs)(Ze.Fragment,{children:[r,this.props.value.language!=="mol-script"&&(0,Ze.jsxs)("div",{className:"msp-help-text",style:{padding:"10px"},children:[(0,Ze.jsx)(tn,{svg:fD})," Support for PyMOL, VMD, and Jmol selections is an experimental feature and may not always work as intended."]}),o]})}};var _7e={color:C.Color(Yt.black,{description:"Display color of the volume."}),wireframe:C.Boolean(!1,{description:"Control display of the volume as a wireframe."}),opacity:C.Numeric(.3,{min:0,max:1,step:.01},{description:"Opacity of the volume."})},w7e=new Map([["em",[-5,5]],["2fo-fc",[0,3]],["fo-fc(+ve)",[1,5]],["fo-fc(-ve)",[-5,-1]]]),bS=class extends pr{constructor(){super(...arguments),this.ref=qt.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name),this.getVisible=()=>{let t=this.plugin.state.data,r=this.ref;return r?!t.cells.get(r).state.isHidden:!1},this.toggleVisible=()=>{let t=this.plugin.state.data,r=this.ref;r&&pp(t,r,!t.cells.get(r).state.isHidden)}}componentDidUpdate(){this.ref=qt.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name)}componentDidMount(){this.subscribe(this.plugin.state.data.events.cell.stateUpdated,t=>{this.ref===t.ref&&this.forceUpdate()})}render(){let t=this.props,{isRelative:r,stats:n}=t,o=t.channels[t.name],{min:i,max:s,mean:a,sigma:l}=n,c=Math.round(100*(o.isoValue.kind==="relative"?o.isoValue.relativeValue:o.isoValue.absoluteValue))/100,u=(i-a)/l,d=(s-a)/l;if(!this.props.isUnbounded){let g=w7e.get(this.props.name);this.props.name==="em"?(u=Math.max(g[0],u),d=Math.min(g[1],d)):(u=g[0],d=g[1])}let m=a+l*u,p=a+l*d,h=pC(r?Math.round((p-m)/l)/100:l/100,2),f=r?u:m,y=r?d:p;return(0,nc.jsx)(hD,{label:t.label+(t.isRelative?" \u03C3":""),colorStripe:o.color,pivot:(0,nc.jsxs)("div",{className:"msp-volume-channel-inline-controls",children:[(0,nc.jsx)(vS,{value:c,min:f,max:y,step:h,onChange:g=>t.changeIso(t.name,g,r),onChangeImmediate:g=>t.changeIso(t.name,g,r),disabled:t.params.isDisabled,onEnter:t.params.events.onEnter}),(0,nc.jsx)(Qt,{svg:this.getVisible()?rd:td,onClick:this.toggleVisible,toggleState:!1,disabled:t.params.isDisabled})]}),controls:(0,nc.jsx)(Hn,{onChange:({name:g,value:v})=>t.changeParams(t.name,g,v),params:_7e,values:o,onEnter:t.params.events.onEnter,isDisabled:t.params.isDisabled})})}},AD=class extends pr{constructor(){super(...arguments),this.changeIso=(t,r,n)=>{let o=this.props.params;this.newParams(te(k({},o),{entry:{name:o.entry.name,params:te(k({},o.entry.params),{channels:te(k({},o.entry.params.channels),{[t]:te(k({},o.entry.params.channels[t]),{isoValue:n?Je.IsoValue.relative(r):Je.IsoValue.absolute(r)})})})}}))},this.changeParams=(t,r,n)=>{let o=this.props.params;this.newParams(te(k({},o),{entry:{name:o.entry.name,params:te(k({},o.entry.params),{channels:te(k({},o.entry.params.channels),{[t]:te(k({},o.entry.params.channels[t]),{[r]:n})})})}}))},this.changeOption=({name:t,value:r})=>{let n=this.props.params;if(t==="entry")this.newParams(te(k({},n),{entry:{name:r,params:n.entry.params}}));else{let o=this.props.b.data,i=o.info.kind==="em",s=r.params.isRelative,a=o.info.header.sampling[0],l=n.entry.params.channels,c=n.entry.params.view.name===r.name?n.entry.params.view.params:this.props.info.params.entry.map(n.entry.name).params.view.map(r.name).defaultValue,u=k({},c);r.name==="selection-box"?u.radius=r.params.radius:r.name==="camera-target"?(u.radius=r.params.radius,u.dynamicDetailLevel=r.params.dynamicDetailLevel):r.name==="box"?(u.bottomLeft=r.params.bottomLeft,u.topRight=r.params.topRight):r.name==="auto"&&(u.radius=r.params.radius,u.selectionDetailLevel=r.params.selectionDetailLevel),u.isUnbounded=!!r.params.isUnbounded,this.newParams(te(k({},n),{entry:{name:n.entry.name,params:te(k({},n.entry.params),{view:{name:r.name,params:u},detailLevel:r.params.detailLevel,channels:i?{em:this.convert(l.em,a.valuesInfo[0],s)}:{"2fo-fc":this.convert(l["2fo-fc"],a.valuesInfo[0],s),"fo-fc(+ve)":this.convert(l["fo-fc(+ve)"],a.valuesInfo[1],s),"fo-fc(-ve)":this.convert(l["fo-fc(-ve)"],a.valuesInfo[1],s)}})}}))}}}areInitial(t){return C.areEqual(this.props.info.params,t,this.props.info.initialValues)}newParams(t){this.props.events.onChange(t,this.areInitial(t))}convert(t,r,n){return te(k({},t),{isoValue:n?Je.IsoValue.toRelative(t.isoValue,r):Je.IsoValue.toAbsolute(t.isoValue,r)})}render(){if(!this.props.b)return null;let t=this.props.b.data,r=t.info.kind==="em",n=r?"em":"2fo-fc",o=this.props.params,i=this.props.info.params.entry.map(o.entry.name),s=i.params.detailLevel,a=te(k({},s),{label:"Dynamic Detail",defaultValue:i.params.view.map("camera-target").params.dynamicDetailLevel.defaultValue}),l=te(k({},s),{label:"Selection Detail",defaultValue:i.params.view.map("auto").params.selectionDetailLevel.defaultValue}),c=t.info.header.sampling[0],u=o.entry.params.channels[n].isoValue.kind==="relative",d=C.Boolean(u,{description:"Use normalized or absolute isocontour scale.",label:"Normalized"}),m=!!o.entry.params.view.params.isUnbounded,p=C.Boolean(m,{description:"Show full/limited range of iso-values for more fine-grained control.",label:"Unbounded"}),h=o.entry.params.view.name==="off",f={entry:C.Select(o.entry.name,t.data.entries.map(g=>[g.dataId,g.dataId]),{isHidden:h,description:"Which entry with volume data to display."}),view:C.MappedStatic(o.entry.params.view.name,{off:C.Group({isRelative:C.Boolean(u,{isHidden:!0}),isUnbounded:C.Boolean(m,{isHidden:!0})},{description:"Display off."}),box:C.Group({bottomLeft:C.Vec3(x.zero()),topRight:C.Vec3(x.zero()),detailLevel:s,isRelative:d,isUnbounded:p},{description:"Static box defined by cartesian coords."}),"selection-box":C.Group({radius:C.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),detailLevel:s,isRelative:d,isUnbounded:p},{description:"Box around focused element."}),"camera-target":C.Group({radius:C.Numeric(.5,{min:0,max:1,step:.05},{description:"Radius within which the volume is shown (relative to the field of view)."}),detailLevel:te(k({},s),{isHidden:!0}),dynamicDetailLevel:a,isRelative:d,isUnbounded:p},{description:"Box around camera target."}),cell:C.Group({detailLevel:s,isRelative:d,isUnbounded:p},{description:"Box around the structure's bounding box."}),auto:C.Group({radius:C.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),detailLevel:s,selectionDetailLevel:l,isRelative:d,isUnbounded:p},{description:"Box around focused element."})},{options:As.ViewTypeOptions,description:'Controls what of the volume is displayed. "Off" hides the volume alltogether. "Bounded box" shows the volume inside the given box. "Around Focus" shows the volume around the element/atom last interacted with. "Around Camera" shows the volume around the point the camera is targeting. "Whole Structure" shows the volume for the whole structure.'})},y={entry:o.entry.name,view:{name:o.entry.params.view.name,params:{detailLevel:o.entry.params.detailLevel,radius:o.entry.params.view.params.radius,bottomLeft:o.entry.params.view.params.bottomLeft,topRight:o.entry.params.view.params.topRight,selectionDetailLevel:o.entry.params.view.params.selectionDetailLevel,dynamicDetailLevel:o.entry.params.view.params.dynamicDetailLevel,isRelative:u,isUnbounded:m}}};return h?(0,nc.jsx)(Hn,{onChange:this.changeOption,params:f,values:y,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled}):(0,nc.jsxs)(nc.Fragment,{children:[!r&&(0,nc.jsx)(bS,{label:"2Fo-Fc",name:"2fo-fc",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[0],isUnbounded:m}),!r&&(0,nc.jsx)(bS,{label:"Fo-Fc(+ve)",name:"fo-fc(+ve)",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[1],isUnbounded:m}),!r&&(0,nc.jsx)(bS,{label:"Fo-Fc(-ve)",name:"fo-fc(-ve)",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[1],isUnbounded:m}),r&&(0,nc.jsx)(bS,{label:"EM",name:"em",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[0],isUnbounded:m}),(0,nc.jsx)(Hn,{onChange:this.changeOption,params:f,values:y,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled})]})}};var pme=()=>te(k({},gde()),{customParamEditors:[[F_,AD]]});var Cw;(function(e){class t{constructor(){this.providers=ia().asMutable(),this.defaultAutoAttachValues=new Map}getParams(n){let o={},i=[],s=[];if(n){let a=this.providers.values();for(;;){let l=a.next();if(l.done)break;let c=l.value;c.isApplicable(n)&&(c.isHidden||(i.push([c.descriptor.name,c.label]),this.defaultAutoAttachValues.get(c.descriptor.name)&&s.push(c.descriptor.name)),o[c.descriptor.name]=C.Group(k({},c.getParams(n)),{label:c.label,isHidden:c.isHidden}))}}return{autoAttach:C.MultiSelect(s,i),properties:C.Group(o,{isFlat:!0})}}setDefaultAutoAttach(n,o){this.defaultAutoAttachValues.set(n,o)}get(n){if(!this.providers.get(n))throw new Error(`Custom property '${n}' is not registered.`);return this.providers.get(n)}register(n,o){this.providers.set(n.descriptor.name,n),this.defaultAutoAttachValues.set(n.descriptor.name,o)}unregister(n){this.providers.delete(n),this.defaultAutoAttachValues.delete(n)}}e.Registry=t})(Cw||(Cw={}));var TD=class{get dataState(){return this.plugin.state.data}rawData(t,r){return this.dataState.build().toRoot().apply(fN,t,r).commit({revertOnError:!0})}download(t,r){return this.dataState.build().toRoot().apply(mN,t,r).commit({revertOnError:!0})}downloadBlob(t,r){return this.dataState.build().toRoot().apply(pN,t,r).commit({revertOnError:!0})}readFile(t,r){return Y(this,null,function*(){var n,o,i;let s=yield this.dataState.build().toRoot().apply(hN,t,r).commit({revertOnError:!0}),a=jh((i=(o=(n=t.file)===null||n===void 0?void 0:n.file)===null||o===void 0?void 0:o.name)!==null&&i!==void 0?i:"");return{data:s,fileInfo:a}})}constructor(t){this.plugin=t}};var PD=class{get dataState(){return this.plugin.state.data}resolveProvider(t){var r;return typeof t=="string"?(r=Jl[t])!==null&&r!==void 0?r:ux(this._providers,n=>n.id===t):t}hasPreset(t){for(let r of this._providers)if(!r.isApplicable||r.isApplicable(t,this.plugin))return!0;return!1}get providers(){return this._providers}getPresets(t){if(!t)return this.providers;let r=[];for(let n of this._providers)n.isApplicable&&!n.isApplicable(t,this.plugin)||r.push(n);return r}getPresetSelect(t){let r=[];for(let n of this._providers)t&&n.isApplicable&&!n.isApplicable(t,this.plugin)||r.push([n.id,n.display.name,n.display.group]);return C.Select("auto",r)}getPresetsWithOptions(t){let r=[],n=Object.create(null);for(let o of this._providers)o.isApplicable&&!o.isApplicable(t,this.plugin)||(r.push([o.id,o.display.name]),n[o.id]=o.params?C.Group(o.params(t,this.plugin)):C.EmptyGroup());return r.length===0?C.MappedStatic("",{"":C.EmptyGroup()}):C.MappedStatic(r[0][0],n,{options:r})}registerPreset(t){if(this.providerMap.has(t.id))throw new Error(`Representation provider with id '${t.id}' already registered.`);this._providers.push(t),this.providerMap.set(t.id,t)}unregisterPreset(t){this.providerMap.delete(t.id),eh(this._providers,t)}applyPreset(t,r,n){var o;let i=this.resolveProvider(r);if(!i)return;let s=this.plugin.state.data,a=Vo.resolveAndCheck(s,t);if(!a){Ag||console.warn("Applying structure repr. provider to bad cell.");return}let l=((o=i.params)===null||o===void 0?void 0:o.call(i,a.obj,this.plugin))||{},c=n||(i.params?C.getDefaultValues(l):{}),u=this.plugin.config.get(Tr.Structure.DefaultRepresentationPresetParams);c=C.merge(l,u,c);let d=Pe.create(`${i.display.name}`,()=>i.apply(a,c,this.plugin));return this.plugin.runTask(d)}addRepresentation(t,r,n){return Y(this,null,function*(){let o=this.dataState.build(),i=this.buildRepresentation(o,t,r,n);if(i)return yield o.commit(),i})}buildRepresentation(t,r,n,o){var i,s;if(!r)return;let a=(s=(i=Vo.resolveAndCheck(this.dataState,r))===null||i===void 0?void 0:i.obj)===null||s===void 0?void 0:s.data;if(!a)return;let l=dS(this.plugin,a,n);return o?.tag?t.to(r).applyOrUpdateTagged(o.tag,Ub,l,{state:o?.initialState}).selector:t.to(r).apply(Ub,l,{state:o?.initialState}).selector}constructor(t){this.plugin=t,this._providers=[],this.providerMap=new Map,this.defaultProvider=Jl.auto,ci(Jl,r=>this.registerPreset(r))}};function sy(e){return e}(function(e){e.CommonParams=(t,r)=>({modelProperties:C.Optional(C.Group($e.getParamDefinition(Ge.Model.CustomModelProperties,void 0,r))),structureProperties:C.Optional(C.Group($e.getParamDefinition(Ge.Model.CustomStructureProperties,void 0,r))),representationPreset:C.Optional(C.Text("auto"))})})(sy||(sy={}));var ID=sy.CommonParams,A7e=(e,t)=>k({model:C.Optional(C.Group($e.getParamDefinition(Ge.Model.ModelFromTrajectory,e,t))),showUnitcell:C.Optional(C.Boolean(!1)),structure:C.Optional(pf.getParams(void 0,"assembly").type),representationPresetParams:C.Optional(C.Group(Ia.CommonParams))},ID(e,t)),fme=sy({id:"preset-trajectory-default",display:{name:"Default (Assembly)",group:"Preset",description:"Shows the first assembly or, if that is unavailable, the first model."},isApplicable:e=>!0,params:A7e,apply(e,t,r){return Y(this,null,function*(){let n=r.builders.structure,o=yield n.createModel(e,t.model),i=yield n.insertModelProperties(o,t.modelProperties),s=yield n.createStructure(i||o,t.structure),a=yield n.insertStructureProperties(s,t.structureProperties),l=t.showUnitcell===void 0||t.showUnitcell?yield n.tryCreateUnitcell(i,void 0,{isHidden:!0}):void 0,c=t.representationPreset||r.config.get(Tr.Structure.DefaultRepresentationPreset)||Jl.auto.id,u=yield r.builders.structure.representation.applyPreset(a,c,t.representationPresetParams);return{model:o,modelProperties:i,unitcell:l,structure:s,structureProperties:a,representation:u}})}}),T7e=(e,t)=>k({useDefaultIfSingleModel:C.Optional(C.Boolean(!1)),representationPresetParams:C.Optional(C.Group(Ia.CommonParams))},ID(e,t)),P7e=sy({id:"preset-trajectory-all-models",display:{name:"All Models",group:"Preset",description:"Shows all models; colored by trajectory-index."},isApplicable:e=>e.data.frameCount>1,params:T7e,apply(e,t,r){return Y(this,null,function*(){var n,o;let i=(o=(n=Vo.resolveAndCheck(r.state.data,e))===null||n===void 0?void 0:n.obj)===null||o===void 0?void 0:o.data;if(!i)return{};if(i.frameCount===1&&t.useDefaultIfSingleModel)return fme.apply(e,t,r);let s=r.builders.structure,a=[],l=[];for(let c=0;ck({model:C.Optional(C.Group($e.getParamDefinition(Ge.Model.ModelFromTrajectory,e,t)))},ID(e,t));function gme(e,t,r,n){return Y(this,null,function*(){let o=n.builders.structure,i=yield o.createModel(t,r.model),s=yield o.insertModelProperties(i,r.modelProperties),a=yield o.createStructure(s||i,{name:"symmetry",params:e}),l=yield o.insertStructureProperties(a,r.structureProperties),c=yield o.tryCreateUnitcell(s,void 0,{isHidden:!1}),u=r.representationPreset||n.config.get(Tr.Structure.DefaultRepresentationPreset)||Jl.auto.id,d=yield n.builders.structure.representation.applyPreset(l,u,{theme:{globalName:e.theme}});return{model:i,modelProperties:s,unitcell:c,structure:a,structureProperties:l,representation:d}})}var I7e=sy({id:"preset-trajectory-unitcell",display:{name:"Unit Cell",group:"Preset",description:"Shows the fully populated unit cell."},isApplicable:e=>Ut.hasCrystalSymmetry(e.data.representative),params:hme,apply(e,t,r){return Y(this,null,function*(){return yield gme({ijkMin:x.create(0,0,0),ijkMax:x.create(0,0,0)},e,t,r)})}}),E7e=sy({id:"preset-trajectory-supercell",display:{name:"Super Cell",group:"Preset",description:"Shows the super cell, i.e. the central unit cell and all adjacent unit cells."},isApplicable:e=>Ut.hasCrystalSymmetry(e.data.representative),params:hme,apply(e,t,r){return Y(this,null,function*(){return yield gme({ijkMin:x.create(-1,-1,-1),ijkMax:x.create(1,1,1),theme:"operator-hkl"},e,t,r)})}}),D7e=(e,t)=>k({model:C.Optional(C.Group($e.getParamDefinition(Ge.Model.ModelFromTrajectory,e,t)))},ID(e,t)),k7e=sy({id:"preset-trajectory-crystal-contacts",display:{name:"Crystal Contacts",group:"Preset",description:"Showsasymetric unit and chains from neighbours within 5 \u212B, i.e., symmetry mates."},isApplicable:e=>Ut.hasCrystalSymmetry(e.data.representative),params:D7e,apply(e,t,r){return Y(this,null,function*(){let n=r.builders.structure,o=yield n.createModel(e,t.model),i=yield n.insertModelProperties(o,t.modelProperties),s=yield n.createStructure(i||o,{name:"symmetry-mates",params:{radius:5}}),a=yield n.insertStructureProperties(s,t.structureProperties),l=yield n.tryCreateUnitcell(i,void 0,{isHidden:!0}),c=t.representationPreset||r.config.get(Tr.Structure.DefaultRepresentationPreset)||Jl.auto.id,u=yield r.builders.structure.representation.applyPreset(a,c,{theme:{globalName:"operator-name",carbonColor:"operator-name",focus:{name:"element-symbol",params:{carbonColor:{name:"operator-name",params:gb.defaultValues}}}}});return{model:o,modelProperties:i,unitcell:l,structure:s,structureProperties:a,representation:u}})}}),ED={default:fme,"all-models":P7e,unitcell:I7e,supercell:E7e,crystalContacts:k7e};var DD=class{resolveProvider(t){var r;return typeof t=="string"?(r=ED[t])!==null&&r!==void 0?r:ux(this._providers,n=>n.id===t):t}hasPreset(t){for(let r of this._providers)if(!r.isApplicable||r.isApplicable(t,this.plugin))return!0;return!1}get providers(){return this._providers}getPresets(t){if(!t)return this.providers;let r=[];for(let n of this._providers)n.isApplicable&&!n.isApplicable(t,this.plugin)||r.push(n);return r}getPresetSelect(t){let r=[];for(let n of this._providers)t&&n.isApplicable&&!n.isApplicable(t,this.plugin)||r.push([n.id,n.display.name]);return C.Select("auto",r)}getPresetsWithOptions(t){let r=[],n=Object.create(null);for(let o of this._providers)o.isApplicable&&!o.isApplicable(t,this.plugin)||(r.push([o.id,o.display.name]),n[o.id]=o.params?C.Group(o.params(t,this.plugin)):C.EmptyGroup());return r.length===0?C.MappedStatic("",{"":C.EmptyGroup()}):C.MappedStatic(r[0][0],n,{options:r})}registerPreset(t){if(this.providerMap.has(t.id))throw new Error(`Hierarchy provider with id '${t.id}' already registered.`);this._providers.push(t),this.providerMap.set(t.id,t)}unregisterPreset(t){this.providerMap.delete(t.id),eh(this._providers,t)}applyPreset(t,r,n){let o=this.resolveProvider(r);if(!o)return;let i=this.plugin.state.data,s=Vo.resolveAndCheck(i,t);if(!s){Ag||console.warn("Applying hierarchy preset provider to bad cell.");return}let a=n||(o.params?C.getDefaultValues(o.params(s.obj,this.plugin)):{}),l=Pe.create(`${o.display.name}`,()=>o.apply(s,a,this.plugin));return this.plugin.runTask(l)}constructor(t){this.plugin=t,this._providers=[],this.providerMap=new Map,this.defaultProvider=ED.default,ci(ED,r=>this.registerPreset(r))}};var kD=class{get dataState(){return this.plugin.state.data}parseTrajectoryData(t,r){return Y(this,null,function*(){let n=typeof r=="string"?this.plugin.dataFormats.get(r):r;if(!n)throw new Error(`'${r}' is not a supported data format.`);let{trajectory:o}=yield n.parse(this.plugin,t);return o})}parseTrajectoryBlob(t,r){return this.dataState.build().to(t).apply(Ge.Data.ParseBlob,r,{state:{isGhost:!0}}).apply(Ge.Model.TrajectoryFromBlob,void 0).commit({revertOnError:!0})}parseTrajectory(t,r){let n=Vo.resolveAndCheck(this.dataState,t);if(!n)throw new Error("Invalid data cell.");return ae.Data.Blob.is(n.obj)?this.parseTrajectoryBlob(t,r):this.parseTrajectoryData(t,r)}createModel(t,r,n){return this.dataState.build().to(t).apply(Ge.Model.ModelFromTrajectory,r||{modelIndex:0},{state:n}).commit({revertOnError:!0})}insertModelProperties(t,r,n){return this.dataState.build().to(t).apply(Ge.Model.CustomModelProperties,r,{state:n}).commit({revertOnError:!0})}tryCreateUnitcell(t,r,n){var o,i,s;let a=this.dataState,l=(i=(o=Vo.resolveAndCheck(a,t))===null||o===void 0?void 0:o.obj)===null||i===void 0?void 0:i.data;if(!l)return;let c=(s=ao.Provider.get(l))===null||s===void 0?void 0:s.spacegroup.cell;return ui.isZero(c)?void 0:a.build().to(t).apply(Ge.Representation.ModelUnitcell3D,r,{state:n}).commit({revertOnError:!0})}createStructure(t,r,n,o){var i;let s=this.dataState;if(!r){let l=Vo.resolveAndCheck(s,t);if(l){let c=ao.Provider.get((i=l.obj)===null||i===void 0?void 0:i.data);(!c||c?.assemblies.length===0)&&(r={name:"model",params:{}})}}return s.build().to(t).apply(Ge.Model.StructureFromModel,{type:r||{name:"assembly",params:{}}},{state:n,tags:o}).commit({revertOnError:!0})}insertStructureProperties(t,r){return this.dataState.build().to(t).apply(Ge.Model.CustomStructureProperties,r).commit({revertOnError:!0})}isComponentTransform(t){return t.transform.transformer===Ge.Model.StructureComponent}tryCreateComponent(t,r,n,o){return Y(this,null,function*(){var i,s;let a=this.dataState,l=a.build().to(t),c=`structure-component-${n}`,u=l.applyOrUpdateTagged(c,Ge.Model.StructureComponent,r,{tags:o?[...o,c]:[c]});yield u.commit();let d=u.selector;if(!d.isOk||((s=(i=d.cell)===null||i===void 0?void 0:i.obj)===null||s===void 0?void 0:s.data.elementCount)===0){yield a.build().delete(d.ref).commit();return}return d})}tryCreateComponentFromExpression(t,r,n,o){return this.tryCreateComponent(t,{type:{name:"expression",params:r},nullIfEmpty:!0,label:(o?.label||"").trim()},n,o?.tags)}tryCreateComponentStatic(t,r,n){return this.tryCreateComponent(t,{type:{name:"static",params:r},nullIfEmpty:!0,label:(n?.label||"").trim()},`static-${r}`,n?.tags)}tryCreateComponentFromSelection(t,r,n,o){return this.plugin.runTask(Pe.create("Query Component",i=>Y(this,null,function*(){var s,a;let{label:l,tags:c}=o||{};l=(l||"").trim();let u=(a=(s=Vo.resolveAndCheck(this.dataState,t))===null||s===void 0?void 0:s.obj)===null||a===void 0?void 0:a.data;if(!u)return;let d=r.referencesCurrent?{type:{name:"bundle",params:$.Bundle.fromSelection(yield r.getSelection(this.plugin,i,u))},nullIfEmpty:!0,label:l||r.label}:{type:{name:"expression",params:r.expression},nullIfEmpty:!0,label:l||r.label};return r.ensureCustomProperties&&(yield r.ensureCustomProperties({runtime:i,assetManager:this.plugin.managers.asset},u)),this.tryCreateComponent(t,d,n,c)})))}constructor(t){this.plugin=t,this.hierarchy=new DD(this.plugin),this.representation=new PD(this.plugin)}};function Xh(e,t,r={}){let n=r;return typeof n.type=="string"||typeof n.color=="string"||typeof n.size=="string"?M7e(e,t||Je.One,r):yme(e,t||Je.One,r)}function M7e(e,t,r){let n=r.type&&e.representation.volume.registry.get(r.type)||e.representation.volume.registry.default.provider,o=r.color&&e.representation.volume.themes.colorThemeRegistry.get(r.color)||e.representation.volume.themes.colorThemeRegistry.get(n.defaultColorTheme.name),i=r.size&&e.representation.volume.themes.sizeThemeRegistry.get(r.size)||e.representation.volume.themes.sizeThemeRegistry.get(n.defaultSizeTheme.name);return yme(e,t,{type:n,typeParams:r.typeParams,color:o,colorParams:r.colorParams,size:i,sizeParams:r.sizeParams})}function yme(e,t,r={}){let{themes:n}=e.representation.volume,o={volume:t},i=r.type||e.representation.volume.registry.default.provider,s=C.getDefaultValues(i.getParams(n,t)),a=Object.assign(s,r.typeParams),l=r.color||n.colorThemeRegistry.get(i.defaultColorTheme.name),c=C.getDefaultValues(l.getParams(o));l.name===i.defaultColorTheme.name&&Object.assign(c,i.defaultColorTheme.props);let u=Object.assign(c,r.colorParams),d=r.size||n.sizeThemeRegistry.get(i.defaultSizeTheme.name),m=C.getDefaultValues(d.getParams(o));d.name===i.defaultSizeTheme.name&&Object.assign(m,i.defaultSizeTheme.props);let p=Object.assign(m,r.sizeParams);return{type:{name:i.name,params:a},colorTheme:{name:l.name,params:u},sizeTheme:{name:d.name,params:p}}}var r8;(function(e){function t(r){let{name:n}=r;return{descriptor:r,get(o){return o._propertyData[n]},set(o,i){o.customProperties.add(r),o._propertyData[n]=i}}}e.create=t})(r8||(r8={}));var _w;(function(e){e.Descriptor={name:"recommended_iso_value"},e.Provider=r8.create(e.Descriptor)})(_w||(_w={}));var SS="Volume";function ww(e,t){return Y(this,null,function*(){if(!t)return;let{entryId:r}=t;if(!(!r||!r.toLowerCase().startsWith("emd")))return e.runTask(Pe.create("Try Set Recommended IsoValue",n=>Y(this,null,function*(){try{let o=yield XL(e,n,r);_w.Provider.set(t,Je.IsoValue.absolute(o))}catch(o){console.warn(o)}})))})}function vme(e){let t=_w.Provider.get(e);if(t)return t.kind==="relative"?t:Je.adjustedIsoValue(e,t.absoluteValue,"absolute")}function n8(e,t){return Y(this,null,function*(){let r={},n=t.volume.data&&vme(t.volume.data);return n&&(r.isoValue=n),[yield e.build().to(t.volume).apply(Ge.Representation.VolumeRepresentation3D,Xh(e,t.volume.data,{type:"isosurface",typeParams:r})).commit()]})}var B7e={label:"CCP4/MRC/MAP",description:"CCP4/MRC/MAP",category:SS,binaryExtensions:["ccp4","mrc","map"],parse:(e,t,r)=>Y(void 0,null,function*(){let n=e.build().to(t).apply(Ge.Data.ParseCcp4,{},{state:{isGhost:!0}}),o=n.apply(Ge.Volume.VolumeFromCcp4,{entryId:r?.entryId});return yield n.commit({revertOnError:!0}),yield ww(e,o.selector.data),{format:n.selector,volume:o.selector}}),visuals:n8},R7e={label:"DSN6/BRIX",description:"DSN6/BRIX",category:SS,binaryExtensions:["dsn6","brix"],parse:(e,t,r)=>Y(void 0,null,function*(){let n=e.build().to(t).apply(Ge.Data.ParseDsn6,{},{state:{isGhost:!0}}),o=n.apply(Ge.Volume.VolumeFromDsn6,{entryId:r?.entryId});return yield n.commit({revertOnError:!0}),yield ww(e,o.selector.data),{format:n.selector,volume:o.selector}}),visuals:n8},L7e={label:"DX",description:"DX",category:SS,stringExtensions:["dx"],binaryExtensions:["dxbin"],parse:(e,t,r)=>Y(void 0,null,function*(){let o=e.build().to(t).apply(Ge.Data.ParseDx,{},{state:{isGhost:!0}}).apply(Ge.Volume.VolumeFromDx,{entryId:r?.entryId});return yield o.commit({revertOnError:!0}),yield ww(e,o.selector.data),{volume:o.selector}}),visuals:n8},F7e={label:"Cube",description:"Cube",category:SS,stringExtensions:["cub","cube"],parse:(e,t,r)=>Y(void 0,null,function*(){let n=e.build().to(t).apply(Ge.Data.ParseCube,{},{state:{isGhost:!0}}),o=n.apply(Ge.Volume.VolumeFromCube,{entryId:r?.entryId}),i=n.apply(Ge.Model.TrajectoryFromCube,void 0,{state:{isGhost:!0}}).apply(Ge.Model.ModelFromTrajectory).apply(Ge.Model.StructureFromModel);return yield n.commit({revertOnError:!0}),yield ww(e,o.selector.data),{format:n.selector,volume:o.selector,structure:i.selector}}),visuals:(e,t)=>Y(void 0,null,function*(){var r,n;let o=e.build(),i=[],s=(n=(r=t.volume.cell)===null||r===void 0?void 0:r.obj)===null||n===void 0?void 0:n.data;if(s&&Je.isOrbitals(s)){let c=o.to(t.volume).apply(Ge.Representation.VolumeRepresentation3D,Xh(e,s,{type:"isosurface",typeParams:{isoValue:Je.IsoValue.relative(1),alpha:.4},color:"uniform",colorParams:{value:Yt.blue}})),u=o.to(t.volume).apply(Ge.Representation.VolumeRepresentation3D,Xh(e,s,{type:"isosurface",typeParams:{isoValue:Je.IsoValue.relative(-1),alpha:.4},color:"uniform",colorParams:{value:Yt.red}}));i.push(c.selector,u.selector)}else{let c=o.to(t.volume).apply(Ge.Representation.VolumeRepresentation3D,Xh(e,s,{type:"isosurface",typeParams:{isoValue:Je.IsoValue.relative(2),alpha:.4},color:"uniform",colorParams:{value:Yt.grey}}));i.push(c.selector)}let a=yield e.builders.structure.representation.applyPreset(t.structure,"auto");yield o.commit();let l=[];return ci(a?.representations,c=>{c&&l.push(c)}),[...i,...l]})},O7e={label:"DensityServer CIF",description:"DensityServer CIF",category:SS,stringExtensions:["cif"],binaryExtensions:["bcif"],isApplicable:(e,t)=>mS(e,t)==="dscif",parse:(e,t,r)=>Y(void 0,null,function*(){var n;let o=yield e.build().to(t).apply(Ge.Data.ParseCif).commit(),i=e.build().to(o),s=o.obj.data.blocks;if(s.length===0)throw new Error("no data blocks");let a=[],l=0;for(let c of s){if(c.header.toUpperCase()==="SERVER")continue;let u=Array.isArray(r?.entryId)?r?.entryId[l]:r?.entryId;((n=c.categories.volume_data_3d_info)===null||n===void 0?void 0:n.rowCount)>0&&(a.push(i.apply(Ge.Volume.VolumeFromDensityServerCif,{blockHeader:c.header,entryId:u}).selector),l++)}yield i.commit();for(let c of a)yield ww(e,c.data);return{volumes:a}}),visuals:(e,t)=>Y(void 0,null,function*(){let{volumes:r}=t,n=e.build(),o=[];if(r.length>0){let i=r[0].data&&vme(r[0].data)||Je.IsoValue.relative(1.5);o[0]=n.to(r[0]).apply(Ge.Representation.VolumeRepresentation3D,Zd.getDefaultParamsStatic(e,"isosurface",{isoValue:i,alpha:1},"uniform",{value:Yt.teal})).selector}if(r.length>1){let i=Zd.getDefaultParamsStatic(e,"isosurface",{isoValue:Je.IsoValue.relative(3),alpha:.3},"uniform",{value:Yt.green}),s=Zd.getDefaultParamsStatic(e,"isosurface",{isoValue:Je.IsoValue.relative(-3),alpha:.3},"uniform",{value:Yt.red});o[o.length]=n.to(r[1]).apply(Ge.Representation.VolumeRepresentation3D,i).selector,o[o.length]=n.to(r[1]).apply(Ge.Representation.VolumeRepresentation3D,s).selector}return yield n.commit(),o})},N7e={label:"Segmentation CIF",description:"Segmentation CIF",category:SS,stringExtensions:["cif"],binaryExtensions:["bcif"],isApplicable:(e,t)=>mS(e,t)==="segcif",parse:(e,t)=>Y(void 0,null,function*(){var r;let n=yield e.build().to(t).apply(Ge.Data.ParseCif).commit(),o=e.build().to(n),i=n.obj.data.blocks;if(i.length===0)throw new Error("no data blocks");let s=[];for(let a of i)a.header.toUpperCase()!=="SERVER"&&((r=a.categories.volume_data_3d_info)===null||r===void 0?void 0:r.rowCount)>0&&s.push(o.apply(Ge.Volume.VolumeFromSegmentationCif,{blockHeader:a.header}).selector);return yield o.commit(),{volumes:s}}),visuals:(e,t)=>Y(void 0,null,function*(){let{volumes:r}=t,n=e.build(),o=[];return r.length>0&&Je.Segmentation.get(r[0].data)&&(o[o.length]=n.to(r[0]).apply(Ge.Representation.VolumeRepresentation3D,Zd.getDefaultParams(e,"segment",r[0].data,{alpha:1,instanceGranularity:!0},"volume-segment",{})).selector),yield n.commit(),o})},xme=[["ccp4",B7e],["dsn6",R7e],["cube",F7e],["dx",L7e],["dscif",O7e],["segcif",N7e]];var U7e="Shape",z7e={label:"PLY",description:"PLY",category:U7e,stringExtensions:["ply"],parse:(e,t)=>Y(void 0,null,function*(){let r=e.state.data.build().to(t).apply(Ge.Data.ParsePly,{},{state:{isGhost:!0}}),n=r.apply(Ge.Model.ShapeFromPly);return yield r.commit(),{format:r.selector,shape:n.selector}}),visuals(e,t){return e.state.data.build().to(t.shape).apply(Ge.Representation.ShapeRepresentation3D).commit()}},bme=[["ply",z7e]];var MD=class{get types(){return this._list.map(t=>[t.name,t.provider.label])}get extensions(){if(this._extensions)return this._extensions;let t=new Set;return this._list.forEach(({provider:r})=>{var n,o;(n=r.stringExtensions)===null||n===void 0||n.forEach(i=>t.add(i)),(o=r.binaryExtensions)===null||o===void 0||o.forEach(i=>t.add(i))}),this._extensions=t,t}get binaryExtensions(){if(this._binaryExtensions)return this._binaryExtensions;let t=new Set;return this._list.forEach(({provider:r})=>{var n;return(n=r.binaryExtensions)===null||n===void 0?void 0:n.forEach(o=>t.add(o))}),this._binaryExtensions=t,t}get options(){if(this._options)return this._options;let t=[];return this._list.forEach(({name:r,provider:n})=>t.push([r,n.label,n.category||""])),this._options=t,t}constructor(){this._list=[],this._map=new Map,this._extensions=void 0,this._binaryExtensions=void 0,this._options=void 0;for(let[t,r]of xme)this.add(t,r);for(let[t,r]of lde)this.add(t,r);for(let[t,r]of cde)this.add(t,r);for(let[t,r]of bme)this.add(t,r);for(let[t,r]of tD)this.add(t,r)}_clear(){this._extensions=void 0,this._binaryExtensions=void 0,this._options=void 0}add(t,r){this._clear(),this._list.push({name:t,provider:r}),this._map.set(t,r)}remove(t){this._clear(),this._list.splice(this._list.findIndex(r=>r.name===t),1),this._map.delete(t)}auto(t,r){var n,o;for(let i=0,s=this.list.length;i[t.name,t.display.name]),{label:"Animation"})}),this._params}updateParams(t){if(this.isEmpty)return;this.updateState({params:k(k({},this.state.params),t)});let r=this.map.get(this.state.params.current),n=r.params(this.context);this._current={anim:r,params:n,paramValues:C.getDefaultValues(n),state:{},startedTime:-1,lastTime:0},this.triggerUpdate()}updateCurrentParams(t){this.isEmpty||(this._current.paramValues=k(k({},this._current.paramValues),t),this.triggerUpdate())}register(t){if(this.map.has(t.name)){this.context.log.error(`Animation '${t.name}' is already registered.`);return}this._params=void 0,this.map.set(t.name,t),this._animations.push(t),this._animations.length===1?this.updateParams({current:t.name}):this.triggerUpdate()}play(t,r){return Y(this,null,function*(){yield this.stop(),this.map.has(t.name)||this.register(t),this.updateParams({current:t.name}),this.updateCurrentParams(r),yield this.start()})}tick(t,r,n){return Y(this,null,function*(){this.currentTime=t,!this.isStopped&&(r||n?yield this.applyFrame(n):this.applyAsync())})}start(){return Y(this,null,function*(){this.updateState({animationState:"playing"}),this.context.behaviors.state.isAnimating.value||this.context.behaviors.state.isAnimating.next(!0),this.triggerUpdate();let t=this._current.anim,r=this._current.anim.initialState(this._current.paramValues,this.context);if(t.setup){let n=yield t.setup(this._current.paramValues,r,this.context);n&&(r=n)}this._current.lastTime=0,this._current.startedTime=-1,this._current.state=r,this.isStopped=!1})}stop(){return Y(this,null,function*(){if(this.isStopped=!0,this.state.animationState!=="stopped"){let t=this._current.anim;t.teardown&&(yield t.teardown(this._current.paramValues,this._current.state,this.context)),this.updateState({animationState:"stopped"}),this.triggerUpdate()}this.context.behaviors.state.isAnimating.value&&this.context.behaviors.state.isAnimating.next(!1)})}get isAnimating(){return this.state.animationState==="playing"}applyAsync(){return Y(this,null,function*(){if(!this.isApplying){this.isApplying=!0;try{yield this.applyFrame()}finally{this.isApplying=!1}}})}applyFrame(t){return Y(this,null,function*(){let r=this.currentTime;this._current.startedTime<0&&(this._current.startedTime=r);let n=yield this._current.anim.apply(this._current.state,{lastApplied:this._current.lastTime,current:r-this._current.startedTime,animation:t},{params:this._current.paramValues,plugin:this.context});n.kind==="finished"?this.stop():n.kind==="next"&&(this._current.state=n.state,this._current.lastTime=r-this._current.startedTime),this.triggerApply()})}getSnapshot(){return this.current?{state:this.state,current:{paramValues:this._current.paramValues,state:this._current.anim.stateSerialization?this._current.anim.stateSerialization.toJSON(this._current.state):this._current.state}}:{state:this.state}}setSnapshot(t){this.isEmpty||(this.updateState({animationState:t.state.animationState}),this.updateParams(t.state.params),t.current&&(this.current.paramValues=t.current.paramValues,this.current.state=this._current.anim.stateSerialization?this._current.anim.stateSerialization.fromJSON(t.current.state):t.current.state,this.triggerUpdate(),this.state.animationState==="playing"&&this.resume()))}resume(){return Y(this,null,function*(){this._current.lastTime=0,this._current.startedTime=-1;let t=this._current.anim;this.context.behaviors.state.isAnimating.value||this.context.behaviors.state.isAnimating.next(!0),t.setup&&(yield t.setup(this._current.paramValues,this._current.state,this.context)),this.isStopped=!1})}constructor(t){super({params:{current:""},animationState:"stopped"}),this.context=t,this.map=new Map,this._animations=[],this.currentTime=0,this._params=void 0,this.events={updated:this.ev(),applied:this.ev()},this.isStopped=!0,this.isApplying=!1}};function Sme(e,t,r){let n=r[0],o=r[1],i=r[2],s=-n*t[0]-o*t[1]-i*t[2],a=e[0],l=e[1],c=e[2];return(n*a+o*l+i*c+s)/Math.sqrt(n*n+o*o+i*i)}function V7e(e,t,r,n){let o=Sme(e,t,n);return{aroundX:Sme(e,t,r)<0,aroundY:o<0}}function Cme(e,t,r){if(!e.canvas3d)return;let{origin:n,dirA:o,dirB:i,dirC:s}=r.principalAxes.boxAxes,a=x.clone(o),l=x.clone(s);if(r.positionToFlip){let{aroundX:u,aroundY:d}=V7e(r.positionToFlip,n,a,i);u&&(x.negate(l,l),x.negate(a,a)),d&&x.negate(l,l)}let c=x.scale(x(),n,-100);return x.dot(c,a)<=0&&x.negate(l,l),x.dot(x.unitY,l)<=0&&x.negate(a,a),e.canvas3d.camera.getFocus(n,t,a,l,co.createDefaultSnapshot())}var G7e=3,Af={identity:Kt.create(1,0,0,0,1,0,0,0,1),rotX90:Kt.create(1,0,0,0,0,1,0,-1,0),rotY90:Kt.create(0,0,-1,0,1,0,1,0,0),rotZ90:Kt.create(0,1,0,-1,0,0,0,0,1),rotX270:Kt.create(1,0,0,0,0,-1,0,1,0),rotY270:Kt.create(0,0,1,0,1,0,-1,0,0),rotZ270:Kt.create(0,-1,0,1,0,0,0,0,1),rotX180:Kt.create(1,0,0,0,-1,0,0,0,-1),rotY180:Kt.create(-1,0,0,0,1,0,0,0,-1),rotZ180:Kt.create(-1,0,0,0,-1,0,0,0,1)};function _me(e,t){let r=j7e(e,G7e);return H7e(r,t)}function H7e(e,t){if(e.length===0)return console.warn("Skipping PCA, no atoms"),{rotation:Af.identity,origin:x.zero()};let r=Fa.calculateMomentsAxes(e),n=Fa.calculateNormalizedAxes(r),o=X7e(n.dirA,n.dirB,n.dirC);K7e(o);let i=t?q7e(o,t):W7e(e,o,r.origin);return Kt.mul(o,i,o),{rotation:o,origin:n.origin}}function j7e(e,t){let r;return r=o8(e,{onlyTrace:!0}),r.length>=3*t||(r=o8(e,{skipHydrogens:!0,skipWater:!0}),r.length>=3*t)||(r=o8(e,{})),r}function o8(e,t){let{onlyTrace:r,skipHydrogens:n,skipWater:o}=t,{x:i,y:s,z:a,type_symbol:l,label_comp_id:c}=Ne.atom,u=[];for(let d of e){let m=$.Location.create(d);for(let p of d.units){m.unit=p;let h=r?p.polymerElements:p.elements;for(let f=0;fn&&(r=i,n=s)}return r}function W7e(e,t,r){let n=x.create(Kt.getValue(t,0,0),Kt.getValue(t,0,1),Kt.getValue(t,0,2)),o=x.create(Kt.getValue(t,1,0),Kt.getValue(t,1,1),Kt.getValue(t,1,2)),i=x.create(Kt.getValue(t,2,0),Kt.getValue(t,2,1),Kt.getValue(t,2,2)),s=Math.floor(e.length/3),a=x(),l=0,c=0,u=0;for(let p=0;po,r)}focusLoci(t,r){let n;if(Array.isArray(t)&&t.length>1){let o=[];for(let i of t){let s=Ht.getBoundingSphere(this.transformedLoci(i));s&&o.push(s)}if(o.length===0)return;this.boundaryHelper.reset();for(let i of o)this.boundaryHelper.includeSphere(i);this.boundaryHelper.finishedIncludeStep();for(let i of o)this.boundaryHelper.radiusSphere(i);n=this.boundaryHelper.getSphere()}else if(Array.isArray(t)){if(t.length===0)return;n=Ht.getBoundingSphere(this.transformedLoci(t[0]))}else n=Ht.getBoundingSphere(this.transformedLoci(t));n&&this.focusSphere(n,r)}focusSpheres(t,r,n){let o=[];for(let i of t){let s=r(i);s&&o.push(s)}if(o.length!==0){if(o.length===1)return this.focusSphere(o[0],n);this.boundaryHelper.reset();for(let i of o)this.boundaryHelper.includeSphere(i);this.boundaryHelper.finishedIncludeStep();for(let i of o)this.boundaryHelper.radiusSphere(i);this.focusSphere(this.boundaryHelper.getSphere(),n)}}focusSphere(t,r){var n;let{canvas3d:o}=this.plugin;if(!o)return;let{extraRadius:i,minRadius:s,durationMs:a}=k(k({},Q7e),r),l=Math.max(t.radius+i,s);if(r?.principalAxes){let c=Cme(this.plugin,l,r);(n=this.plugin.canvas3d)===null||n===void 0||n.requestCameraReset({durationMs:a,snapshot:c})}else{let c=o.camera.getFocus(t.center,l);o.requestCameraReset({durationMs:a,snapshot:c})}}orientAxes(t,r){if(!this.plugin.canvas3d)return;t||(t=this.plugin.state.data.selectQ(a=>a.ofType(ae.Molecule.Structure)).filter(a=>a.obj&&!a.transform.transformer.definition.isDecorator&&!a.obj.data.parent).map(a=>{var l;return(l=a.obj)===null||l===void 0?void 0:l.data}).filter(a=>!!a));let{rotation:n}=_me(t),o=i8(this.plugin.canvas3d.camera.getSnapshot(),n);this.setSnapshot(o,r)}resetAxes(t){if(!this.plugin.canvas3d)return;let r=i8(this.plugin.canvas3d.camera.getSnapshot(),Kt.Identity);this.setSnapshot(r,t)}setSnapshot(t,r){var n;(n=this.plugin.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t,durationMs:r})}reset(t,r){var n;(n=this.plugin.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t,durationMs:r})}constructor(t){this.plugin=t,this.boundaryHelper=new ki("98")}};var ay=class e extends ca{get props(){return k({},this.state.props)}setProps(t){let r=this.props,n=k(k({},this.state.props),t);bg(r,n)||(this.updateState({props:n}),this.lociSelects.setProps(n),this.lociHighlights.setProps(n),this.events.propsUpdated.next(void 0))}dispose(){super.dispose(),this.lociSelects.dispose(),this.lociHighlights.dispose()}constructor(t,r={}){super({props:k(k({},C.getDefaultValues(e.Params)),r)}),this.plugin=t,this._props=C.getDefaultValues(e.Params),this.events={propsUpdated:this.ev()},this.lociSelects=new e.LociSelectManager(t,this._props),this.lociHighlights=new e.LociHighlightManager(t,this._props)}};(function(e){e.Params={granularity:C.Select("residue",Ht.GranularityOptions,{label:"Picking Level",description:"Controls if selections are expanded upon picking to whole residues, chains, structures, instances, or left as atoms and coarse elements"})};class t{setProps(i){Object.assign(this.props,i)}addProvider(i){this.providers.push(i)}removeProvider(i){this.providers=this.providers.filter(s=>s!==i)}normalizedLoci(i,s,a=!1){let{loci:l,repr:c}=i,u=s?this.props.granularity:void 0;return{loci:Ht.normalize(l,u,a),repr:c}}mark(i,s,a=!1){if(!Ht.isEmpty(i.loci))for(let l of this.providers)l(i,s,a)}dispose(){this.providers.length=0,this.sel.dispose()}constructor(i,s={}){this.ctx=i,this.providers=[],this.props=C.getDefaultValues(e.Params),this.sel=i.managers.structure.selection,this.setProps(s)}}e.LociMarkManager=t;class r extends t{constructor(){super(...arguments),this.prev=[],this.clearHighlights=(i=!1)=>{for(let s of this.prev)this.mark(s,Ft.RemoveHighlight,i);this.prev.length=0}}isHighlighted(i){for(let s of this.prev)if(Nt.Loci.areEqual(s,i))return!0;return!1}addHighlight(i){this.mark(i,Ft.Highlight),this.prev.push(i)}highlight(i,s=!0){let a=this.normalizedLoci(i,s);this.isHighlighted(a)||this.addHighlight(a)}highlightOnly(i,s=!0){let a=this.normalizedLoci(i,s);this.isHighlighted(a)||(Ht.isEmpty(a.loci)?this.clearHighlights():(this.clearHighlights(!0),this.addHighlight(a)))}highlightOnlyExtend(i,s=!0){let a=this.normalizedLoci(i,s);if($.Loci.is(a.loci)){let l={loci:this.sel.tryGetRange(a.loci)||a.loci,repr:a.repr};this.isHighlighted(l)||(Ht.isEmpty(l.loci)?this.clearHighlights():(this.clearHighlights(!0),this.addHighlight(l)))}}dispose(){super.dispose(),this.prev.length=0}}e.LociHighlightManager=r;class n extends t{toggle(i,s=!0){if(Ht.isEmpty(i.loci))return;let a=this.normalizedLoci(i,s,!0);$.Loci.is(a.loci)?this.toggleSel(a):super.mark(a,Ft.Toggle)}toggleExtend(i,s=!0){if(Ht.isEmpty(i.loci))return;let a=this.normalizedLoci(i,s,!0);if($.Loci.is(a.loci)){let l=this.sel.tryGetRange(a.loci)||a.loci;this.toggleSel({loci:l,repr:a.repr})}}select(i,s=!0){let a=this.normalizedLoci(i,s,!0);$.Loci.is(a.loci)&&this.sel.modify("add",a.loci),this.mark(a,Ft.Select)}selectJoin(i,s=!0){let a=this.normalizedLoci(i,s,!0);$.Loci.is(a.loci)&&this.sel.modify("intersect",a.loci),this.mark(a,Ft.Select)}selectOnly(i,s=!0){let a=this.normalizedLoci(i,s,!0);$.Loci.is(a.loci)&&(this.mark({loci:Me.Loci(a.loci.structure),repr:a.repr},Ft.Deselect),this.sel.modify("set",a.loci)),this.mark(a,Ft.Select)}deselect(i,s=!0){let a=this.normalizedLoci(i,s,!0);$.Loci.is(a.loci)&&this.sel.modify("remove",a.loci),this.mark(a,Ft.Deselect)}deselectAll(){this.sel.clear(),this.mark({loci:a0},Ft.Deselect)}deselectAllOnEmpty(i){Zo(i.loci)&&this.deselectAll()}mark(i,s){let{loci:a}=i;if(!Ht.isEmpty(a))if($.Loci.is(a)){let l=this.sel.getLoci(a.structure);super.mark({loci:Me.Loci(a.structure)},Ft.Deselect,!Ht.isEmpty(l)),super.mark({loci:l},Ft.Select)}else super.mark(i,s)}toggleSel(i){this.sel.has(i.loci)?(this.sel.modify("remove",i.loci),this.mark(i,Ft.Deselect)):(this.sel.modify("add",i.loci),this.mark(i,Ft.Select))}}e.LociSelectManager=n})(ay||(ay={}));var LD=class{clearProviders(){this.providers=[],this.isDirty=!0,this.showLabels()}addProvider(t){this.providers.push(t),this.providers.sort((r,n)=>(n.priority||0)-(r.priority||0)),this.isDirty=!0,this.showLabels()}removeProvider(t){this.providers=this.providers.filter(r=>r!==t),this.isDirty=!0,this.showLabels()}mark(t,r){let n=this.locis.findIndex(o=>Nt.Loci.areEqual(t,o));n===-1&&r===Ft.Highlight?(this.locis.push(t),this.isDirty=!0):n!==-1&&r===Ft.RemoveHighlight&&(wg(this.locis,n),this.isDirty=!0)}showLabels(){this.ctx.behaviors.labels.highlight.next({labels:this.getLabels()})}getLabels(){if(this.isDirty){this.groupedLabels.clear(),this.labels.length=0;for(let t of this.providers)for(let r of this.locis){if(Ht.isEmpty(r.loci))continue;let n=t.label(r.loci,r.repr);if(n){let o=t.group?t.group(n):n.toString(),i=this.groupedLabels.get(o);i?i.push(n):this.groupedLabels.set(o,[n])}}this.labels.length=0,this.groupedLabels.forEach((t,r)=>{let n=t.length,o=n>1&&t[0]!==t[1]?r:t[0];this.labels.push(n===1?o:`${o} || \xD7 ${n}`)}),this.isDirty=!1}return this.labels}constructor(t){this.ctx=t,this.providers=[],this.locis=[],this.isDirty=!1,this.labels=[],this.groupedLabels=new Map,t.managers.interactivity.lociHighlights.addProvider((r,n,o)=>{this.providers.length!==0&&(this.mark(r,n),o||this.showLabels())})}};var Ame="overpaint-controls";function s8(e,t,r,n,o){return Y(this,null,function*(){yield Z7e(e,t,(i,s,a)=>Y(this,null,function*(){if(o&&o.length>0&&!o.includes(s.params.values.type.name))return;let l=s.obj.data.sourceData,c=yield n(l.root);if(Ht.isEmpty(c)||Zo(c))return;let u={bundle:$.Bundle.fromLoci(c),color:r===-1?Oe(0):r,clear:r===-1};if(a){let d=[...a.params.values.layers,u],m=wme(d,l);i.to(a).update(ai.toBundle(m))}else{let d=wme([u],l);i.to(s.transform.ref).apply(Ge.Representation.OverpaintStructureRepresentation3DFromBundle,ai.toBundle(d),{tags:Ame})}}))})}function Z7e(e,t,r){return Y(this,null,function*(){let n=e.state.data,o=n.build();for(let i of t)for(let s of i.representations){let a=n.select(qt.Generators.ofTransformer(Ge.Representation.OverpaintStructureRepresentation3DFromBundle,s.cell.transform.ref).withTag(Ame));yield r(o,s.cell,a[0])}return o.commit({doNotUpdateCurrent:!0})})}function wme(e,t){let r=ai.ofBundle(e,t.root),n=ai.merge(r);return ai.filter(n,t)}var Pme="clipping-controls";function Ime(e,t,r,n,o){return Y(this,null,function*(){yield $7e(e,t,(i,s,a)=>Y(this,null,function*(){if(o&&o.length>0&&!o.includes(s.params.values.type.name))return;let l=s.obj.data.sourceData,c=yield n(l.root);if(Ht.isEmpty(c)||Zo(c))return;let u={bundle:$.Bundle.fromLoci(c),groups:r};if(a){let d=[...a.params.values.layers,u],m=Tme(d,l);i.to(a).update(qn.toBundle(m))}else{let d=Tme([u],l);i.to(s.transform.ref).apply(Ge.Representation.ClippingStructureRepresentation3DFromBundle,qn.toBundle(d),{tags:Pme})}}))})}function $7e(e,t,r){return Y(this,null,function*(){let n=e.state.data,o=n.build();for(let i of t)for(let s of i.representations){let a=n.select(qt.Generators.ofTransformer(Ge.Representation.ClippingStructureRepresentation3DFromBundle,s.cell.transform.ref).withTag(Pme));yield r(o,s.cell,a[0])}return o.commit({doNotUpdateCurrent:!0})})}function Tme(e,t){let r=qn.ofBundle(e,t.root),n=qn.merge(r);return qn.filter(n,t)}var Dme="transparency-controls";function kme(e,t,r,n,o){return Y(this,null,function*(){yield J7e(e,t,(i,s,a)=>Y(this,null,function*(){if(o&&o.length>0&&!o.includes(s.params.values.type.name))return;let l=s.obj.data.sourceData,c=yield n(l.root);if(Ht.isEmpty(c)||Zo(c))return;let u={bundle:$.Bundle.fromLoci(c),value:r};if(a){let d=[...a.params.values.layers,u],m=Eme(d,l);i.to(a).update(hs.toBundle(m))}else{let d=Eme([u],l);i.to(s.transform.ref).apply(Ge.Representation.TransparencyStructureRepresentation3DFromBundle,hs.toBundle(d),{tags:Dme})}}))})}function J7e(e,t,r){return Y(this,null,function*(){let n=e.state.data,o=n.build();for(let i of t)for(let s of i.representations){let a=n.select(qt.Generators.ofTransformer(Ge.Representation.TransparencyStructureRepresentation3DFromBundle,s.cell.transform.ref).withTag(Dme));yield r(o,s.cell,a[0])}return o.commit({doNotUpdateCurrent:!0})})}function Eme(e,t){let r=hs.ofBundle(e,t.root),n=hs.merge(r);return hs.filter(n,t)}var Bme="substance-controls";function a8(e,t,r,n,o){return Y(this,null,function*(){yield eGe(e,t,(i,s,a)=>Y(this,null,function*(){if(o&&o.length>0&&!o.includes(s.params.values.type.name))return;let l=s.obj.data.sourceData,c=yield n(l.root);if(Ht.isEmpty(c)||Zo(c))return;let u={bundle:$.Bundle.fromLoci(c),material:r??ds(),clear:!r};if(a){let d=[...a.params.values.layers,u],m=Mme(d,l);i.to(a).update(gs.toBundle(m))}else{let d=Mme([u],l);i.to(s.transform.ref).apply(Ge.Representation.SubstanceStructureRepresentation3DFromBundle,gs.toBundle(d),{tags:Bme})}}))})}function eGe(e,t,r){return Y(this,null,function*(){let n=e.state.data,o=n.build();for(let i of t)for(let s of i.representations){let a=n.select(qt.Generators.ofTransformer(Ge.Representation.SubstanceStructureRepresentation3DFromBundle,s.cell.transform.ref).withTag(Bme));yield r(o,s.cell,a[0])}return o.commit({doNotUpdateCurrent:!0})})}function Mme(e,t){let r=gs.ofBundle(e,t.root),n=gs.merge(r);return gs.filter(n,t)}var Lme="emissive-controls";function Fme(e,t,r,n,o){return Y(this,null,function*(){yield tGe(e,t,(i,s,a)=>Y(this,null,function*(){if(o&&o.length>0&&!o.includes(s.params.values.type.name))return;let l=s.obj.data.sourceData,c=yield n(l.root);if(Ht.isEmpty(c)||Zo(c))return;let u={bundle:$.Bundle.fromLoci(c),value:r};if(a){let d=[...a.params.values.layers,u],m=Rme(d,l);i.to(a).update(ys.toBundle(m))}else{let d=Rme([u],l);i.to(s.transform.ref).apply(Ge.Representation.EmissiveStructureRepresentation3DFromBundle,ys.toBundle(d),{tags:Lme})}}))})}function tGe(e,t,r){return Y(this,null,function*(){let n=e.state.data,o=n.build();for(let i of t)for(let s of i.representations){let a=n.select(qt.Generators.ofTransformer(Ge.Representation.EmissiveStructureRepresentation3DFromBundle,s.cell.transform.ref).withTag(Lme));yield r(o,s.cell,a[0])}return o.commit({doNotUpdateCurrent:!0})})}function Rme(e,t){let r=ys.ofBundle(e,t.root),n=ys.merge(r);return ys.filter(n,t)}var xu=class e extends ca{get currentStructures(){return this.plugin.managers.structure.hierarchy.selection.structures}get pivotStructure(){return this.currentStructures[0]}_setSnapshotState(t){this.updateState({options:t}),this.events.optionsUpdated.next(void 0)}setOptions(t){return Y(this,null,function*(){let r=t.interactions!==this.state.options.interactions;this.updateState({options:t}),this.events.optionsUpdated.next(void 0);let n=this.dataState.build();for(let o of this.currentStructures)for(let i of o.components)this.updateReprParams(n,i);return this.plugin.dataTransaction(()=>Y(this,null,function*(){yield n.commit(),yield this.plugin.state.updateBehavior(iv,o=>{o.ignoreHydrogens=t.hydrogens!=="all",o.ignoreHydrogensVariant=t.hydrogens==="only-polar"?"non-polar":"all",o.ignoreLight=t.ignoreLight,o.material=t.materialStyle,o.clip=t.clipObjects}),r&&(yield this.updateInterationProps())}))})}updateReprParams(t,r){let{hydrogens:n,visualQuality:o,ignoreLight:i,materialStyle:s,clipObjects:a}=this.state.options,l=n!=="all",c=n==="only-polar"?"non-polar":"all";for(let u of r.representations){if(u.cell.transform.transformer!==Ub)continue;let d=u.cell.transform.params;(!!d.type.params.ignoreHydrogens!==l||d.type.params.ignoreHydrogensVariant!==c||d.type.params.quality!==o||d.type.params.ignoreLight!==i||!Qf(d.type.params.material,s)||!C.areEqual(tp.Params,d.type.params.clip,a))&&t.to(u.cell).update(m=>{m.type.params.ignoreHydrogens=l,m.type.params.ignoreHydrogensVariant=c,m.type.params.quality=o,m.type.params.ignoreLight=i,m.type.params.material=s,m.type.params.clip=a})}}updateInterationProps(){return Y(this,null,function*(){var t,r,n;for(let o of this.currentStructures){let i=Oo.getParams((t=o.cell.obj)===null||t===void 0?void 0:t.data);if(o.properties){let s=(r=o.properties.cell.transform.params)===null||r===void 0?void 0:r.properties[Oo.descriptor.name];if(C.areEqual(i,s,this.state.options.interactions))continue;yield this.dataState.build().to(o.properties.cell).update(a=>{a.properties[Oo.descriptor.name]=this.state.options.interactions}).commit()}else{let s=this.plugin.customStructureProperties.getParams((n=o.cell.obj)===null||n===void 0?void 0:n.data),a=C.getDefaultValues(s);if(C.areEqual(i,a.properties[Oo.descriptor.name],this.state.options.interactions))continue;a.properties[Oo.descriptor.name]=this.state.options.interactions,yield this.plugin.builders.structure.insertStructureProperties(o.cell,a)}}})}applyPreset(t,r,n){return this.plugin.dataTransaction(()=>Y(this,null,function*(){for(let o of t){let i=yield this.plugin.builders.structure.representation.applyPreset(o.cell,r,n);yield this.syncPreset(o,i)}}),{canUndo:"Preset"})}syncPreset(t,r){if(!r||!r.components)return this.clearComponents([t]);let n=new Set;if(ci(r.components,a=>{a&&n.add(a.ref)}),r.representations&&ci(r.representations,a=>{a&&n.add(a.ref)}),n.size===0)return this.clearComponents([t]);let o=!1,i=this.dataState.build(),s=a=>{n.has(a.cell.transform.ref)||(o=!0,i.delete(a.cell))};for(let a of t.components){s(a);for(let l of a.representations)s(l);if(a.genericRepresentations)for(let l of a.genericRepresentations)s(l)}if(t.genericRepresentations)for(let a of t.genericRepresentations)s(a);if(o)return i.commit()}clear(t){return this.clearComponents(t)}selectThis(t){var r;let n=this.plugin.managers.structure.selection;n.clear();for(let o of t){let i=Me.toSubStructureElementLoci(o.structure.cell.obj.data,(r=o.cell.obj)===null||r===void 0?void 0:r.data);n.fromLoci("set",i)}}canBeModified(t){return this.plugin.builders.structure.isComponentTransform(t.cell)}modifyByCurrentSelection(t,r){return this.plugin.runTask(Pe.create("Modify Component",n=>Y(this,null,function*(){let o=this.dataState.build();for(let i of t){if(!this.canBeModified(i))continue;let s=this.plugin.managers.structure.selection.getStructure(i.structure.cell.obj.data);!s||s.elementCount===0||this.modifyComponent(o,i,s,r)}yield this.dataState.updateTree(o,{canUndo:"Modify Selection"}).runInContext(n)})))}toggleVisibility(t,r){if(t.length!==0)if(r){let n=t[0].representations.indexOf(r),o=!r.cell.state.isHidden;for(let i of t){let s=i.representations[n];s&&pp(this.dataState,s.cell.transform.ref,o)}}else{let n=!t[0].cell.state.isHidden;for(let o of t)pp(this.dataState,o.cell.transform.ref,n)}}removeRepresentations(t,r){if(t.length===0)return;let n=[];if(r){let o=t[0].representations.indexOf(r);if(o<0)return;for(let i of t)i.representations[o]&&n.push(i.representations[o])}else for(let o of t)for(let i of o.representations)n.push(i);return this.plugin.managers.structure.hierarchy.remove(n,!0)}updateRepresentations(t,r,n){if(t.length===0)return Promise.resolve();let o=t[0].representations.indexOf(r);if(o<0)return Promise.resolve();let i=this.dataState.build();for(let s of t){let a=s.representations[o];a&&a.cell.transform.transformer===r.cell.transform.transformer&&i.to(a.cell).update(n)}return i.commit({canUndo:"Update Representation"})}updateRepresentationsTheme(t,r){var n,o,i,s;if(t.length===0)return;let a=this.dataState.build();for(let l of t)for(let c of l.representations){let u=c.cell.transform.params,d=typeof r=="function"?r(l,c):r,m=d.color==="default"?tw(this.plugin,(n=l.structure.cell.obj)===null||n===void 0?void 0:n.data,u?.type.name):d.color?tw(this.plugin,(o=l.structure.cell.obj)===null||o===void 0?void 0:o.data,u?.type.name,d.color,d.colorParams):void 0,p=d.size==="default"?iU(this.plugin,(i=l.structure.cell.obj)===null||i===void 0?void 0:i.data,u?.type.name):d.color?iU(this.plugin,(s=l.structure.cell.obj)===null||s===void 0?void 0:s.data,u?.type.name,d.size,d.sizeParams):void 0;(m||p)&&a.to(c.cell).update(h=>{m&&(h.colorTheme=m),p&&(h.sizeTheme=p)})}return a.commit({canUndo:"Update Theme"})}addRepresentation(t,r){if(t.length===0)return;let{hydrogens:n,visualQuality:o,ignoreLight:i,materialStyle:s,clipObjects:a}=this.state.options,u={ignoreHydrogens:n!=="all",ignoreHydrogensVariant:n==="only-polar"?"non-polar":"all",quality:o,ignoreLight:i,material:s,clip:a};return this.plugin.dataTransaction(()=>Y(this,null,function*(){for(let d of t)yield this.plugin.builders.structure.representation.addRepresentation(d.cell,{type:this.plugin.representation.structure.registry.get(r),typeParams:u})}),{canUndo:"Add Representation"})}tryFindComponent(t,r){if(t.components.length!==0)return this.plugin.runTask(Pe.create("Find Component",n=>Y(this,null,function*(){var o,i;let s=(o=t.cell.obj)===null||o===void 0?void 0:o.data;if(!s)return;let a=lt.unionStructure(yield r.getSelection(this.plugin,n,s));for(let l of t.components){let c=(i=l.cell.obj)===null||i===void 0?void 0:i.data;if(!(!c||!l.cell.parent)&&PW(a,c))return l.cell}})))}add(t,r){return Y(this,null,function*(){return this.plugin.dataTransaction(()=>Y(this,null,function*(){let n=r||this.currentStructures;if(n.length===0)return;let{hydrogens:o,visualQuality:i,ignoreLight:s,materialStyle:a,clipObjects:l}=this.state.options,d={ignoreHydrogens:o!=="all",ignoreHydrogensVariant:o==="only-polar"?"non-polar":"all",quality:i,ignoreLight:s,material:a,clip:l},m=qr.create22();for(let p of n){let h;t.options.checkExisting&&(h=yield this.tryFindComponent(p,t.selection)),h||(h=yield this.plugin.builders.structure.tryCreateComponentFromSelection(p.cell,t.selection,m,{label:t.options.label||(t.selection===ei.current?"Custom Selection":"")})),!(t.representation==="none"||!h)&&(yield this.plugin.builders.structure.representation.addRepresentation(h,{type:this.plugin.representation.structure.registry.get(t.representation),typeParams:d}))}}),{canUndo:"Add Selection"})})}applyTheme(t,r){return Y(this,null,function*(){return this.plugin.dataTransaction(n=>Y(this,null,function*(){let o=r||this.currentStructures;if(o.length===0)return;let i=s=>Y(this,null,function*(){return lt.toLociWithSourceUnits(yield t.selection.getSelection(this.plugin,n,s))});for(let s of o)if(t.action.name==="color"){let a=t.action.params;yield s8(this.plugin,s.components,a.color,i,t.representations)}else if(t.action.name==="resetColor")yield s8(this.plugin,s.components,-1,i,t.representations);else if(t.action.name==="transparency"){let a=t.action.params;yield kme(this.plugin,s.components,a.value,i,t.representations)}else if(t.action.name==="emissive"){let a=t.action.params;yield Fme(this.plugin,s.components,a.value,i,t.representations)}else if(t.action.name==="material"){let a=t.action.params;yield a8(this.plugin,s.components,a.material,i,t.representations)}else if(t.action.name==="resetMaterial")yield a8(this.plugin,s.components,void 0,i,t.representations);else if(t.action.name==="clipping"){let a=t.action.params;yield Ime(this.plugin,s.components,qn.Groups.fromNames(a.excludeGroups),i,t.representations)}}),{canUndo:"Apply Theme"})})}modifyComponent(t,r,n,o){var i,s,a;let l=(i=r.cell.obj)===null||i===void 0?void 0:i.data;if(!l||(o==="subtract"||o==="intersect")&&!kx(l,n))return;let c=(s=r.structure.cell.obj)===null||s===void 0?void 0:s.data,u=o==="union"?uh(c,[l,n]):o==="intersect"?uT(l,n):Mx(l,n);if(u.elementCount===0)t.delete(r.cell.transform.ref);else{let m={type:{name:"bundle",params:$.Bundle.fromSubStructure(c,u)},nullIfEmpty:!0,label:(a=r.cell.obj)===null||a===void 0?void 0:a.label};t.to(r.cell).update(m)}}updateLabel(t,r){var n,o;let i={type:(n=t.cell.params)===null||n===void 0?void 0:n.values.type,nullIfEmpty:(o=t.cell.params)===null||o===void 0?void 0:o.values.nullIfEmpty,label:r};this.dataState.build().to(t.cell).update(i).commit()}get dataState(){return this.plugin.state.data}clearComponents(t){let r=this.dataState.build();for(let n of t)for(let o of n.components)r.delete(o.cell.transform.ref);return r.commit({canUndo:"Clear Selections"})}constructor(t){super({options:C.getDefaultValues(e.OptionsParams)}),this.plugin=t,this.events={optionsUpdated:this.ev()}}};(function(e){e.OptionsParams={hydrogens:C.Select("all",[["all","Show All"],["hide-all","Hide All"],["only-polar","Only Polar"]],{description:"Determine display of hydrogen atoms in representations"}),visualQuality:C.Select("auto",a_,{description:"Control the visual/rendering quality of representations"}),ignoreLight:C.Boolean(!1,{description:"Ignore light for stylized rendering of representations"}),materialStyle:ds.getParam(),clipObjects:C.Group(tp.Params),interactions:C.Group(Oo.defaultParams,{label:"Non-covalent Interactions"})};function t(i,s){let{options:a}=i.query.structure.registry;return s=k({pivot:i.managers.structure.component.pivotStructure,allowNone:!0,hideSelection:!1,checkExisting:!1},s),{selection:C.Select(a[1][0],a,{isHidden:s?.hideSelection}),representation:o(i,s?.pivot,s?.allowNone?[["none","< Create Later >"]]:[]),options:C.Group({label:C.Text(""),checkExisting:C.Boolean(!!s?.checkExisting,{help:()=>({description:"Checks if a selection with the specifield elements already exists to avoid creating duplicate components."})})})}}e.getAddParams=t;function r(i,s){let{options:a}=i.query.structure.registry;return{selection:C.Select(a[1][0],a,{isHidden:!1}),action:C.MappedStatic("color",{color:C.Group({color:C.Color(Yt.blue,{isExpanded:!0})},{isFlat:!0}),resetColor:C.EmptyGroup({label:"Reset Color"}),transparency:C.Group({value:C.Numeric(.5,{min:0,max:1,step:.01})},{isFlat:!0}),emissive:C.Group({value:C.Numeric(.5,{min:0,max:1,step:.01})},{isFlat:!0}),material:C.Group({material:ds.getParam({isFlat:!0})},{isFlat:!0}),resetMaterial:C.EmptyGroup({label:"Reset Material"}),clipping:C.Group({excludeGroups:C.MultiSelect([],C.objectToOptions(qn.Groups.Names))},{isFlat:!0})}),representations:C.MultiSelect([],n(i,s),{emptyValue:"All"})}}e.getThemeParams=r;function n(i,s){var a,l;return!((a=s?.cell.obj)===null||a===void 0)&&a.data?i.representation.structure.registry.getApplicableTypes((l=s.cell.obj)===null||l===void 0?void 0:l.data):i.representation.structure.registry.types}e.getRepresentationTypes=n;function o(i,s,a,l){let c=[...a,...n(i,s)];return C.Select(c[0][0],c,{label:l})}})(xu||(xu={}));var rGe=8,FD=class extends ca{get current(){return this.state.current}get history(){return this.state.history}tryAddHistory(t){if($.Loci.isEmpty(t.loci))return;let r=0,n;for(let o of this.state.history){if($.Loci.areEqual(o.loci,t.loci)){n=o;break}r++}if(n){wg(this.state.history,r),this.state.history.unshift(t),this.events.historyUpdated.next(void 0);return}this.state.history.unshift(t),this.state.history.length>rGe&&this.state.history.pop(),this.events.historyUpdated.next(void 0)}set(t){this.tryAddHistory(t),(!this.state.current||!$.Loci.areEqual(this.state.current.loci,t.loci))&&(this.state.current=t,this.behaviors.current.next(t))}setFromLoci(t){let r=Ht.normalize(t);if(!$.Loci.is(r)||$.Loci.isEmpty(r)){this.clear();return}this.set({loci:r,label:Qd(r,{reverse:!0,hidePrefix:!0,htmlStyling:!1})})}addFromLoci(t){let r=this.state.current&&$.Loci.is(t)&&t.structure===this.state.current.loci.structure?$.Loci.union(t,this.state.current.loci):t;this.setFromLoci(r)}clear(){this.state.current&&(this.state.current=void 0,this.behaviors.current.next(void 0))}getSnapshot(){if(!this.current)return{};let t=this.plugin.helpers.substructureParent.get(this.current.loci.structure),r=t?.transform.ref;return r?{current:{label:this.current.label,ref:r,bundle:$.Bundle.fromLoci(this.current.loci),category:this.current.category}}:{}}setSnapshot(t){var r,n;if(!t.current){this.clear();return}let{label:o,ref:i,bundle:s,category:a}=t.current,l=(n=(r=this.plugin.state.data.select(qt.Generators.byRef(i))[0])===null||r===void 0?void 0:r.obj)===null||n===void 0?void 0:n.data;if(!l)return;let c=$.Bundle.toLoci(s,l);this.set({label:o,loci:c,category:a})}constructor(t){super({history:[]}),this.plugin=t,this.events={historyUpdated:this.ev()},this.behaviors={current:this.ev.behavior(void 0)},t.state.data.events.object.removed.subscribe(({obj:n})=>{var o;if(!ae.Molecule.Structure.is(n))return;((o=this.current)===null||o===void 0?void 0:o.loci.structure)===n.data&&this.clear();let i=[];for(let s of this.history)s.loci.structure===n.data&&i.push(s);i.length!==this.history.length&&(this.history.length=0,this.history.push(...i),this.events.historyUpdated.next(void 0))});let r=ge();t.state.data.events.object.updated.subscribe(({oldData:n,obj:o,action:i})=>{var s;if(ae.Molecule.Structure.is(o)&&n!==o.data&&i==="in-place"){let a=this.state.current,l=o.data;if(a&&a.loci.structure===n){let c=$.Loci.remap(a.loci,l);this.state.current=te(k({},a),{loci:c}),this.behaviors.current.next(this.state.current),Ht.getBoundingSphere(c,r);let u=(s=this.plugin.canvas3d)===null||s===void 0?void 0:s.camera,d=u.getTargetDistance(r.radius+4);(x.distance(u.target,r.center)>r.radius||d>u.viewport.height/u.zoom)&&this.plugin.managers.camera.focusSphere(r,{durationMs:0})}}})}};function Vme(e,t){let r=pGe(e,t||ND());return yGe(e.tree,r),t&&t.refs.forEach(hGe,r),{hierarchy:r.hierarchy,added:r.added,changed:r.changed}}function ND(){return{trajectories:[],models:[],structures:[],refs:new Map}}function nGe(e){return{kind:"trajectory",cell:e,version:e.transform.version,models:[]}}function Ome(e,t){return{kind:"model",cell:e,version:e.transform.version,trajectory:t,structures:[]}}function oGe(e,t){return{kind:"model-properties",cell:e,version:e.transform.version,model:t}}function iGe(e,t){return{kind:"model-unitcell",cell:e,version:e.transform.version,model:t}}function Nme(e,t){return{kind:"structure",cell:e,version:e.transform.version,model:t,components:[]}}function sGe(e,t){return{kind:"structure-properties",cell:e,version:e.transform.version,structure:t}}function aGe(e,t){return{kind:"structure-transform",cell:e,version:e.transform.version,structure:t}}function lGe(e,t){return{kind:"structure-volume-streaming",cell:e,version:e.transform.version,structure:t}}function cGe(e){return e.transform.tags?[...e.transform.tags].sort().join():e.transform.ref}function uGe(e,t){return{kind:"structure-component",cell:e,version:e.transform.version,structure:t,key:cGe(e),representations:[]}}function dGe(e,t){return{kind:"structure-representation",cell:e,version:e.transform.version,component:t}}function mGe(e,t){return{kind:"generic-representation",cell:e,version:e.transform.version,parent:t}}function pGe(e,t){return{state:e,oldHierarchy:t,hierarchy:ND(),changed:!1,added:new Set}}function CS(e,t,r,n,...o){let i=n(...o);r.push(i),e.hierarchy.refs.set(t.transform.ref,i);let s=e.oldHierarchy.refs.get(t.transform.ref);return s?s.version!==t.transform.version&&(e.changed=!0):(e.added.add(i.cell.transform.ref),e.changed=!0),i}function fv(e,t,r,...n){let o=r(...n);e.hierarchy.refs.set(t.transform.ref,o);let i=e.oldHierarchy.refs.get(t.transform.ref);return i?i.version!==t.transform.version&&(e.changed=!0):(e.added.add(o.cell.transform.ref),e.changed=!0),o}function Ume(e){return t=>e.is(t.obj)}function zme(e,t){return(r,n)=>!t(n)&&e.is(r.obj)}function OD(e){return t=>t.transform.transformer===e}function hv(){}var fGe=[[Ume(ae.Molecule.Trajectory),(e,t)=>{e.currentTrajectory=CS(e,t,e.hierarchy.trajectories,nGe,t)},e=>e.currentTrajectory=void 0],[zme(ae.Molecule.Model,e=>e.currentModel),(e,t)=>{e.currentTrajectory?e.currentModel=CS(e,t,e.currentTrajectory.models,Ome,t,e.currentTrajectory):e.currentModel=fv(e,t,Ome,t),e.hierarchy.models.push(e.currentModel)},e=>e.currentModel=void 0],[OD(Ge.Model.CustomModelProperties),(e,t)=>{if(!e.currentModel)return!1;e.currentModel.properties=fv(e,t,oGe,t,e.currentModel)},hv],[OD(Ge.Representation.ModelUnitcell3D),(e,t)=>{if(!e.currentModel)return!1;e.currentModel.unitcell=fv(e,t,iGe,t,e.currentModel)},hv],[zme(ae.Molecule.Structure,e=>e.currentStructure),(e,t)=>{e.currentModel?e.currentStructure=CS(e,t,e.currentModel.structures,Nme,t,e.currentModel):e.currentStructure=fv(e,t,Nme,t),e.hierarchy.structures.push(e.currentStructure)},e=>e.currentStructure=void 0],[OD(Ge.Model.CustomStructureProperties),(e,t)=>{if(!e.currentStructure)return!1;e.currentStructure.properties=fv(e,t,sGe,t,e.currentStructure)},hv],[OD(Ge.Model.TransformStructureConformation),(e,t)=>{if(!e.currentStructure)return!1;e.currentStructure.transform=fv(e,t,aGe,t,e.currentStructure)},hv],[Ume(As),(e,t)=>(e.currentStructure&&(e.currentStructure.volumeStreaming=fv(e,t,lGe,t,e.currentStructure)),!1),hv],[(e,t)=>t.currentComponent||!t.currentStructure||e.transform.transformer.definition.isDecorator?!1:ae.Molecule.Structure.is(e.obj),(e,t)=>{e.currentStructure&&(e.currentComponent=CS(e,t,e.currentStructure.components,uGe,t,e.currentStructure))},e=>e.currentComponent=void 0],[(e,t)=>!e.state.isGhost&&!!t.currentComponent&&ae.Molecule.Structure.Representation3D.is(e.obj),(e,t)=>(e.currentComponent&&CS(e,t,e.currentComponent.representations,dGe,t,e.currentComponent),!1),hv],[e=>!e.state.isGhost&&ae.isRepresentation3D(e.obj),(e,t)=>{let r=e.currentComponent||e.currentStructure||e.currentModel;r&&(r.genericRepresentations||(r.genericRepresentations=[]),CS(e,t,r.genericRepresentations,mGe,t,r))},hv]];function Gme(e){if(!e||!e?.parent||!e.parent.cells.has(e.transform.ref))return!1;let{obj:t}=e;return!(!t||t===kn.Null||e.status!=="ok"&&e.status!=="error")}function hGe(e){let{cell:t}=e;Gme(t)||(this.changed=!0)}function gGe(e){Hme(this,this.tree.transforms.get(e))}function Hme(e,t){let{state:r}=e,n=r.state.cells.get(t.ref);if(!Gme(n))return;let o,i=!1;for(let[a,l,c]of fGe)if(a(n,r)){if(l(r,n)===!1){i=!0;break}o=c;break}if(i)return;let s=e.tree.children.get(t.ref);s&&s.size&&s.forEach(gGe,e),o&&o(r)}function yGe(e,t){let r={tree:e,state:t};return Hme(r,e.root),r.state}var Tf=class e extends mp{get dataState(){return this.plugin.state.data}get currentComponentGroups(){return this._currentComponentGroups?this._currentComponentGroups:(this._currentComponentGroups=e.getComponentGroups(this.selection.structures),this._currentComponentGroups)}get seletionSet(){if(this._currentSelectionSet)return this._currentSelectionSet;this._currentSelectionSet=new Set;for(let t of this.selection.trajectories)this._currentSelectionSet.add(t.cell.transform.ref);for(let t of this.selection.models)this._currentSelectionSet.add(t.cell.transform.ref);for(let t of this.selection.structures)this._currentSelectionSet.add(t.cell.transform.ref);return this._currentSelectionSet}get current(){return this.sync(!1),this.state.hierarchy}get selection(){return this.sync(!1),this.state.selection}getStructuresWithSelection(){let t=this.plugin.managers.structure.hierarchy.current.structures,r=[];for(let n of t)this.plugin.managers.structure.selection.structureHasSelection(n)&&r.push(n);return r}findStructure(t){if(!t)return;let r=this.plugin.helpers.substructureParent.get(t);if(!r)return;let n=this.plugin.state.data.selectQ(o=>o.byValue(r).rootOfType(ae.Molecule.Structure))[0];if(n)return this.behaviors.selection.value.structures.find(o=>o.cell===n)}syncCurrent(t,r){let n=this.seletionSet,o=[];for(let i of t){let s=i.cell.transform.ref;(n.has(s)||r.has(s))&&o.push(i)}return o.length===0?t.length>0?[t[0]]:[]:o}sync(t){if(!t&&this.dataState.inUpdate)return;if(this.state.syncedTree===this.dataState.tree){t&&!this.state.notified&&(this.state.notified=!0,this.behaviors.selection.next(k({hierarchy:this.state.hierarchy},this.state.selection)));return}this.state.syncedTree=this.dataState.tree;let r=Vme(this.plugin.state.data,this.current);if(!r.changed)return;let{hierarchy:n}=r,o=this.syncCurrent(n.trajectories,r.added),i=this.syncCurrent(n.models,r.added),s=this.syncCurrent(n.structures,r.added);this._currentComponentGroups=void 0,this._currentSelectionSet=void 0,this.state.hierarchy=n,this.state.selection.trajectories=o,this.state.selection.models=i,this.state.selection.structures=s,t?(this.state.notified=!0,this.behaviors.selection.next({hierarchy:n,trajectories:o,models:i,structures:s})):this.state.notified=!1}updateCurrent(t,r){let n=this.current,o=r==="add"?Dn.union(this.seletionSet,new Set(t.map(l=>l.cell.transform.ref))):Dn.difference(this.seletionSet,new Set(t.map(l=>l.cell.transform.ref))),i=[],s=[],a=[];for(let l of n.trajectories)o.has(l.cell.transform.ref)&&i.push(l);for(let l of n.models)o.has(l.cell.transform.ref)&&s.push(l);for(let l of n.structures)o.has(l.cell.transform.ref)&&a.push(l);this._currentComponentGroups=void 0,this._currentSelectionSet=void 0,this.state.selection.trajectories=i,this.state.selection.models=s,this.state.selection.structures=a,this.behaviors.selection.next({hierarchy:n,trajectories:i,models:s,structures:a})}remove(t,r){if(t.length===0)return;let n=this.plugin.state.data.build();for(let o of t)n.delete(typeof o=="string"?o:o.cell.transform.ref);return n.commit({canUndo:r?"Remove":!1})}toggleVisibility(t,r){if(t.length===0)return;let n=r!==void 0?r!=="show":!t[0].cell.state.isHidden;for(let o of t)pp(this.dataState,o.cell.transform.ref,n)}applyPreset(t,r,n){return this.plugin.dataTransaction(()=>Y(this,null,function*(){for(let o of t)o.models.length>0&&(yield this.clearTrajectory(o)),yield this.plugin.builders.structure.hierarchy.applyPreset(o.cell,r,n)}))}updateStructure(t,r){return Y(this,null,function*(){yield this.plugin.dataTransaction(()=>Y(this,null,function*(){let n=Go.getDecoratorRoot(this.dataState.tree,t.cell.transform.ref),o=this.dataState.tree.children.get(n).toArray();yield this.remove(o,!1),yield this.plugin.state.updateTransform(this.plugin.state.data,t.cell.transform.ref,r,"Structure Type"),yield this.plugin.builders.structure.representation.applyPreset(t.cell.transform.ref,"auto")}),{canUndo:"Structure Type"}),ct.Camera.Reset(this.plugin)})}clearTrajectory(t){let r=this.dataState.build();for(let n of t.models)r.delete(n.cell);return r.commit()}constructor(t){super(),this.plugin=t,this.state={syncedTree:this.dataState.tree,notified:!1,hierarchy:ND(),selection:{trajectories:[],models:[],structures:[]}},this.behaviors={selection:this.ev.behavior({hierarchy:this.current,trajectories:this.selection.trajectories,models:this.selection.models,structures:this.selection.structures})},this._currentComponentGroups=void 0,this._currentSelectionSet=void 0,this.subscribe(t.state.data.events.changed,r=>{r.inTransaction||t.behaviors.state.isAnimating.value||this.sync(!0)}),this.subscribe(t.behaviors.state.isAnimating,r=>{!r&&!t.behaviors.state.isUpdating.value&&this.sync(!0)})}};(function(e){function t(n){if(!n.length)return[];if(n.length===1)return n[0].components.map(s=>[s]);let o=[],i=new Map;for(let s of n)for(let a of s.components){let l=a.key;if(!l)continue;let c=i.get(l);c||(c=[],i.set(l,c),o.push(c)),c.push(a)}return o}e.getComponentGroups=t;function r(n){var o,i,s,a,l,c,u,d,m;let{structures:p}=n.managers.structure.hierarchy.selection;if(p.length===0)return"";if(p.length===1){let g=p[0],v=(o=g.cell.obj)===null||o===void 0?void 0:o.data;if(!v)return((i=g.cell.obj)===null||i===void 0?void 0:i.label)||"Structure";let b=v.models[0]||v.representativeModel||v.masterModel;if(!b)return((s=g.cell.obj)===null||s===void 0?void 0:s.label)||"Structure";let S=b.entryId;return!((l=(a=g.model)===null||a===void 0?void 0:a.trajectory)===null||l===void 0)&&l.models&&g.model.trajectory.models.length===1?S:g.model?`${(c=g.model.cell.obj)===null||c===void 0?void 0:c.label} | ${S}`:S}let h=p[0],f=(u=h?.model)===null||u===void 0?void 0:u.trajectory,y=!0;for(let g of p)if(((d=g?.model)===null||d===void 0?void 0:d.trajectory)!==f){y=!1;break}return y&&f?`${(m=f.cell.obj)===null||m===void 0?void 0:m.label} | ${p.length} structures`:`${p.length} structures`}e.getSelectedStructuresDescription=r})(Tf||(Tf={}));var l8="measurement-group",UD="measurement-order-label",c8={distanceUnitLabel:C.Text("\u212B",{isEssential:!0}),textColor:EO.textColor},vGe=C.getDefaultValues(c8),zD=class extends ca{stateUpdated(){this.behaviors.state.next(this.state)}getGroup(){let t=this.plugin.state.data,r=qt.findTagInSubtree(t.tree,ur.RootRef,l8),n=this.plugin.state.data.build();return r?n.to(r):n.toRoot().group(Ge.Misc.CreateGroup,{label:"Measurements"},{tags:l8})}setOptions(t){return Y(this,null,function*(){this.updateState({options:t})&&this.stateUpdated();let r=this.plugin.state.data.build();for(let n of this.state.distances)r.to(n).update(o=>{o.unitLabel=t.distanceUnitLabel,o.textColor=t.textColor});for(let n of this.state.labels)r.to(n).update(o=>{o.textColor=t.textColor});for(let n of this.state.angles)r.to(n).update(o=>{o.textColor=t.textColor});for(let n of this.state.dihedrals)r.to(n).update(o=>{o.textColor=t.textColor});r.editInfo.count!==0&&(yield ct.State.Update(this.plugin,{state:this.plugin.state.data,tree:r,options:{doNotLogTiming:!0}}))})}addDistance(t,r,n){return Y(this,null,function*(){let o=this.plugin.helpers.substructureParent.get(t.structure),i=this.plugin.helpers.substructureParent.get(r.structure);if(!o||!i)return;let s=[o.transform.ref];So(s,i.transform.ref);let l=this.getGroup().apply(Ge.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",groupId:"a",ref:o.transform.ref,expression:$.Loci.toExpression(t)},{key:"b",groupId:"b",ref:i.transform.ref,expression:$.Loci.toExpression(r)}],isTransitive:!0,label:"Distance"},{dependsOn:s,tags:n?.selectionTags}),c=l.apply(Ge.Representation.StructureSelectionsDistance3D,k(k(k({customText:n?.customText||"",unitLabel:this.state.options.distanceUnitLabel,textColor:this.state.options.textColor},n?.lineParams),n?.labelParams),n?.visualParams),{tags:n?.reprTags}),u=this.plugin.state.data;return yield ct.State.Update(this.plugin,{state:u,tree:c,options:{doNotLogTiming:!0}}),{selection:l.selector,representation:c.selector}})}addAngle(t,r,n,o){return Y(this,null,function*(){let i=this.plugin.helpers.substructureParent.get(t.structure),s=this.plugin.helpers.substructureParent.get(r.structure),a=this.plugin.helpers.substructureParent.get(n.structure);if(!i||!s||!a)return;let l=[i.transform.ref];So(l,s.transform.ref),So(l,a.transform.ref);let u=this.getGroup().apply(Ge.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",ref:i.transform.ref,expression:$.Loci.toExpression(t)},{key:"b",ref:s.transform.ref,expression:$.Loci.toExpression(r)},{key:"c",ref:a.transform.ref,expression:$.Loci.toExpression(n)}],isTransitive:!0,label:"Angle"},{dependsOn:l,tags:o?.selectionTags}),d=u.apply(Ge.Representation.StructureSelectionsAngle3D,k(k(k({customText:o?.customText||"",textColor:this.state.options.textColor},o?.lineParams),o?.labelParams),o?.visualParams),{tags:o?.reprTags}),m=this.plugin.state.data;return yield ct.State.Update(this.plugin,{state:m,tree:d,options:{doNotLogTiming:!0}}),{selection:u.selector,representation:d.selector}})}addDihedral(t,r,n,o,i){return Y(this,null,function*(){let s=this.plugin.helpers.substructureParent.get(t.structure),a=this.plugin.helpers.substructureParent.get(r.structure),l=this.plugin.helpers.substructureParent.get(n.structure),c=this.plugin.helpers.substructureParent.get(o.structure);if(!s||!a||!l||!c)return;let u=[s.transform.ref];So(u,a.transform.ref),So(u,l.transform.ref),So(u,c.transform.ref);let m=this.getGroup().apply(Ge.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",ref:s.transform.ref,expression:$.Loci.toExpression(t)},{key:"b",ref:a.transform.ref,expression:$.Loci.toExpression(r)},{key:"c",ref:l.transform.ref,expression:$.Loci.toExpression(n)},{key:"d",ref:c.transform.ref,expression:$.Loci.toExpression(o)}],isTransitive:!0,label:"Dihedral"},{dependsOn:u,tags:i?.selectionTags}),p=m.apply(Ge.Representation.StructureSelectionsDihedral3D,k(k(k({customText:i?.customText||"",textColor:this.state.options.textColor},i?.lineParams),i?.labelParams),i?.visualParams),{tags:i?.reprTags}),h=this.plugin.state.data;return yield ct.State.Update(this.plugin,{state:h,tree:p,options:{doNotLogTiming:!0}}),{selection:m.selector,representation:p.selector}})}addLabel(t,r){return Y(this,null,function*(){let n=this.plugin.helpers.substructureParent.get(t.structure);if(!n)return;let o=[n.transform.ref],s=this.getGroup().apply(Ge.Model.MultiStructureSelectionFromExpression,{selections:[{key:"a",ref:n.transform.ref,expression:$.Loci.toExpression(t)}],isTransitive:!0,label:"Label"},{dependsOn:o,tags:r?.selectionTags}),a=s.apply(Ge.Representation.StructureSelectionsLabel3D,k(k({textColor:this.state.options.textColor},r?.labelParams),r?.visualParams),{tags:r?.reprTags}),l=this.plugin.state.data;return yield ct.State.Update(this.plugin,{state:l,tree:a,options:{doNotLogTiming:!0}}),{selection:s.selector,representation:a.selector}})}addOrientation(t){return Y(this,null,function*(){let r=[],n=[];for(let l=0,c=t.length;l{r.inTransaction||t.behaviors.state.isAnimating.value||this.sync()}),t.behaviors.state.isAnimating.subscribe(r=>{!r&&!t.behaviors.state.isUpdating.value&&this.sync()})}};var Aw=new ki("98"),xGe=24,VD=class extends ca{get entries(){return this.state.entries}get additionsHistory(){return this.state.additionsHistory}get stats(){return this.state.stats?this.state.stats:(this.state.stats=this.calcStats(),this.state.stats)}getEntry(t){let r=this.plugin.helpers.substructureParent.get(t,!0);if(!r)return;let n=r.transform.ref;if(!this.entries.has(n)){let o=new Tw($.Loci(t,[]));return this.entries.set(n,o),o}return this.entries.get(n)}calcStats(){let t=0,r=0,n=$.Stats.create();this.entries.forEach(i=>{let{elements:s}=i.selection;if(s.length){t+=1;for(let a=0,l=s.length;axGe&&this.additionsHistory.pop(),this.events.additionsHistoryUpdated.next(void 0)}clearHistory(){this.state.additionsHistory.length!==0&&(this.state.additionsHistory=[],this.events.additionsHistoryUpdated.next(void 0))}clearHistoryForStructure(t){let r=[];for(let n of this.state.additionsHistory)n.loci.structure.root===t.root&&r.push(n);for(let n of r)this.modifyHistory(n,"remove");r.length!==0&&this.events.additionsHistoryUpdated.next(void 0)}onRemove(t,r){var n;this.entries.has(t)&&(this.entries.delete(t),r?.data&&this.clearHistoryForStructure(r.data),((n=this.referenceLoci)===null||n===void 0?void 0:n.structure)===r?.data&&(this.referenceLoci=void 0),this.state.stats=void 0,this.events.changed.next(void 0))}onUpdate(t,r,n){var o,i,s,a;if(r===n||r?.data===n.data)return;let l=this.plugin.helpers.substructureParent.get(n.data,!0);if(!l||t!==l.transform.ref||!this.entries.has(t))return;let c=(i=(o=this.plugin.helpers.substructureParent.get(n.data))===null||o===void 0?void 0:o.obj)===null||i===void 0?void 0:i.data;if(c)if(!r?.data||Me.areUnitIdsAndIndicesEqual(r.data,n.data)){this.entries.set(t,SGe(this.entries.get(t),c)),((s=this.referenceLoci)===null||s===void 0?void 0:s.structure.root)===c.root&&(this.referenceLoci=$.Loci.remap(this.referenceLoci,c));let u=!1;for(let d of this.state.additionsHistory)d.loci.structure.root===c.root&&(d.loci=$.Loci.remap(d.loci,c),u=!0);u&&this.events.additionsHistoryUpdated.next(void 0)}else this.entries.set(t,new Tw($.Loci(c,[]))),((a=this.referenceLoci)===null||a===void 0?void 0:a.structure.root)===c.root&&(this.referenceLoci=void 0),this.clearHistoryForStructure(c),this.state.stats=void 0,this.events.changed.next(void 0)}clear(){let t=this.entries.keys(),r=[];for(;;){let n=t.next();if(n.done)break;let o=this.entries.get(n.value);$.Loci.isEmpty(o.selection)||r.push(o.selection),o.selection=$.Loci(o.selection.structure,[])}return this.referenceLoci=void 0,this.state.stats=void 0,this.events.changed.next(void 0),this.events.loci.clear.next(void 0),this.clearHistory(),r}getLoci(t){let r=this.getEntry(t);return r?r.selection:nr}getStructure(t){let r=this.getEntry(t);if(r)return r.structure}structureHasSelection(t){var r,n;let o=(n=(r=t.cell)===null||r===void 0?void 0:r.obj)===null||n===void 0?void 0:n.data;if(!o)return!1;let i=this.getEntry(o);return!!i&&!$.Loci.isEmpty(i.selection)}has(t){if($.Loci.is(t)){let r=this.getEntry(t.structure);if(r)return $.Loci.isSubset(r.selection,t)}return!1}tryGetRange(t){if(!$.Loci.is(t)||t.elements.length!==1||!this.getEntry(t.structure))return;let n=t.elements[0];if(!n)return;let o=this.referenceLoci;if(!o||!$.Loci.is(o)||o.structure!==t.structure)return;let i;for(let s of o.elements)if(n.unit===s.unit){i=s;break}if(i&&n.unit===i.unit)return CGe(t.structure,i,n)}elementCount(){let t=0;return this.entries.forEach(r=>{t+=$.Loci.size(r.selection)}),t}getBoundary(){let t=x.create(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=x.create(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);Aw.reset();let n=[];this.entries.forEach(o=>{let i=o.selection;$.Loci.isEmpty(i)||n.push($.Loci.getBoundary(i))});for(let o=0,i=n.length;or.selection))}modify(t,r){let n=!1;switch(t){case"add":n=this.add(r);break;case"remove":n=this.remove(r);break;case"intersect":n=this.intersect(r);break;case"set":n=this.set(r);break}n&&(this.state.stats=void 0,this.events.changed.next(void 0))}get applicableStructures(){return this.plugin.managers.structure.hierarchy.selection.structures.filter(t=>!!t.cell.obj).map(t=>t.cell.obj.data)}triggerInteraction(t,r,n=!0){switch(t){case"add":this.plugin.managers.interactivity.lociSelects.select({loci:r},n);break;case"remove":this.plugin.managers.interactivity.lociSelects.deselect({loci:r},n);break;case"intersect":this.plugin.managers.interactivity.lociSelects.selectJoin({loci:r},n);break;case"set":this.plugin.managers.interactivity.lociSelects.selectOnly({loci:r},n);break}}fromLoci(t,r,n=!0){this.triggerInteraction(t,r,n)}fromCompiledQuery(t,r,n=!0){for(let o of this.applicableStructures){let i=r(new Mi(o));this.triggerInteraction(t,lt.toLociWithSourceUnits(i),n)}}fromSelectionQuery(t,r,n=!0){this.plugin.runTask(Pe.create("Structure Selection",o=>Y(this,null,function*(){for(let i of this.applicableStructures){let s=yield r.getSelection(this.plugin,o,i);this.triggerInteraction(t,lt.toLociWithSourceUnits(s),n)}})))}fromSelections(t){var r;let n=Vo.resolveAndCheck(this.plugin.state.data,t);if(!(!n||!n.obj)){if(!ae.Molecule.Structure.Selections.is(n.obj)){console.warn("fromSelections applied to wrong object type.",n.obj);return}this.clear();for(let o of(r=n.obj)===null||r===void 0?void 0:r.data)this.fromLoci("set",o.loci)}}getSnapshot(){let t=[];return this.entries.forEach((r,n)=>{t.push({ref:n,bundle:$.Bundle.fromLoci(r.selection)})}),{entries:t}}setSnapshot(t){var r,n;this.entries.clear();for(let{ref:o,bundle:i}of t.entries){let s=(n=(r=this.plugin.state.data.select(qt.Generators.byRef(o))[0])===null||r===void 0?void 0:r.obj)===null||n===void 0?void 0:n.data;if(!s)continue;let a=$.Bundle.toLoci(i,s);this.fromLoci("set",a,!1)}}constructor(t){super({entries:new Map,additionsHistory:[],stats:bGe()}),this.plugin=t,this.events={changed:this.ev(),additionsHistoryUpdated:this.ev(),loci:{add:this.ev(),remove:this.ev(),clear:this.ev()}},t.helpers.substructureParent.events.removed.subscribe(r=>this.onRemove(r.ref,r.obj)),t.helpers.substructureParent.events.updated.subscribe(r=>this.onUpdate(r.ref,r.oldObj,r.obj))}};function bGe(){return{structureCount:0,elementCount:0,label:"Nothing Selected"}}var Tw=class{get selection(){return this._selection}set selection(t){this._selection=t,this._structure=void 0}get structure(){return this._structure?this._structure:(Ht.isEmpty(this._selection)?this._structure=void 0:this._structure=$.Loci.toStructure(this._selection),this._structure)}constructor(t){this._structure=void 0,this._selection=t}};function SGe(e,t){return new Tw($.Loci.remap(e.selection,t))}function CGe(e,t,r){let n=Math.min(Te.min(t.indices),Te.min(r.indices)),o=Math.max(Te.max(t.indices),Te.max(r.indices));return $.Loci(e,[{unit:t.unit,indices:Te.ofRange(n,o)}])}function qme(e,t){let r=TGe(e,t||GD());return kGe(e.tree,r),t&&t.refs.forEach(EGe,r),{hierarchy:r.hierarchy,added:r.added,changed:r.changed}}function GD(){return{volumes:[],lazyVolumes:[],refs:new Map}}function _Ge(e){return{kind:"volume",cell:e,version:e.transform.version,representations:[]}}function wGe(e){return{kind:"lazy-volume",cell:e,version:e.transform.version}}function AGe(e,t){return{kind:"volume-representation",cell:e,version:e.transform.version,volume:t}}function TGe(e,t){return{state:e,oldHierarchy:t,hierarchy:GD(),changed:!1,added:new Set}}function u8(e,t,r,n,...o){let i=n(...o);r.push(i),e.hierarchy.refs.set(t.transform.ref,i);let s=e.oldHierarchy.refs.get(t.transform.ref);return s?s.version!==t.transform.version&&(e.changed=!0):(e.added.add(i.cell.transform.ref),e.changed=!0),i}function PGe(e,t){return(r,n)=>!t(n)&&e.is(r.obj)}function jme(){}var IGe=[[PGe(ae.Volume.Data,e=>e.currentVolume),(e,t)=>{e.currentVolume=u8(e,t,e.hierarchy.volumes,_Ge,t)},e=>e.currentVolume=void 0],[e=>ae.Volume.Lazy.is(e.obj),(e,t)=>{u8(e,t,e.hierarchy.lazyVolumes,wGe,t)},jme],[(e,t)=>!e.state.isGhost&&!!t.currentVolume&&ae.Volume.Representation3D.is(e.obj),(e,t)=>(e.currentVolume&&u8(e,t,e.currentVolume.representations,AGe,t,e.currentVolume),!1),jme]];function Wme(e){if(!e||!e?.parent||!e.parent.cells.has(e.transform.ref))return!1;let{obj:t}=e;return!(!t||t===kn.Null||e.status!=="ok"&&e.status!=="error")}function EGe(e){let{cell:t}=e;Wme(t)||(this.changed=!0)}function DGe(e){Yme(this,this.tree.transforms.get(e))}function Yme(e,t){let{state:r}=e,n=r.state.cells.get(t.ref);if(!Wme(n))return;let o,i=!1;for(let[a,l,c]of IGe)if(a(n,r)){if(l(r,n)===!1){i=!0;break}o=c;break}if(i)return;let s=e.tree.children.get(t.ref);s&&s.size&&s.forEach(DGe,e),o&&o(r)}function kGe(e,t){let r={tree:e,state:t};return Yme(r,e.root),r.state}var ly=class extends mp{get dataState(){return this.plugin.state.data}get current(){return this.sync(!1),this.state.hierarchy}get selection(){return this.sync(!1),this.state.selection}sync(t){if(!t&&this.dataState.inUpdate)return;if(this.state.syncedTree===this.dataState.tree){t&&!this.state.notified&&(this.state.notified=!0,this.behaviors.selection.next({hierarchy:this.state.hierarchy,volume:this.state.selection}));return}this.state.syncedTree=this.dataState.tree;let r=qme(this.plugin.state.data,this.current);if(!r.changed)return;let{hierarchy:n}=r;this.state.hierarchy=n,this.state.selection?this.state.selection=n.refs.has(this.state.selection.cell.transform.ref)?n.refs.get(this.state.selection.cell.transform.ref):n.volumes[0]:this.state.selection=n.volumes[0],t?(this.state.notified=!0,this.behaviors.selection.next({hierarchy:n,volume:this.state.selection})):this.state.notified=!1}setCurrent(t){this.state.selection=t||this.state.hierarchy.volumes[0],this.behaviors.selection.next({hierarchy:this.state.hierarchy,volume:t||this.state.hierarchy.volumes[0]})}remove(t,r){if(t.length===0)return;let n=this.plugin.state.data.build();for(let o of t)n.delete(typeof o=="string"?o:o.cell.transform.ref);return n.commit({canUndo:r?"Remove":!1})}toggleVisibility(t,r){if(t.length===0)return;let n=r!==void 0?r!=="show":!t[0].cell.state.isHidden;for(let o of t)pp(this.dataState,o.cell.transform.ref,n)}addRepresentation(t,r){var n;return this.dataState.build().to(t.cell).apply(Ge.Representation.VolumeRepresentation3D,Xh(this.plugin,(n=t.cell.obj)===null||n===void 0?void 0:n.data,{type:r})).commit({canUndo:"Add Representation"})}constructor(t){super(),this.plugin=t,this.state={syncedTree:this.dataState.tree,notified:!1,hierarchy:GD(),selection:void 0},this.behaviors={selection:this.ev.behavior({hierarchy:this.current,volume:this.selection})},this.subscribe(t.state.data.events.changed,r=>{r.inTransaction||t.behaviors.state.isAnimating.value||this.sync(!0)}),this.subscribe(t.behaviors.state.isAnimating,r=>{!r&&!t.behaviors.state.isUpdating.value&&this.sync(!0)})}};(function(e){function t(r,n){var o,i;return!((o=n?.cell.obj)===null||o===void 0)&&o.data?r.representation.volume.registry.getApplicableTypes((i=n.cell.obj)===null||i===void 0?void 0:i.data):r.representation.volume.registry.types}e.getRepresentationTypes=t})(ly||(ly={}));var MGe=[["full","Full"],["collapsed","Collapsed"],["hidden","Hidden"]],d8=[["full","Full"],["hidden","Hidden"]],BGe={isExpanded:C.Boolean(!1),showControls:C.Boolean(!0),regionState:C.Group({left:C.Select("full",MGe),top:C.Select("full",d8),right:C.Select("full",d8),bottom:C.Select("full",d8)}),controlsDisplay:C.Value("outside",{isHidden:!0})},HD=class extends ca{updateProps(t){let r=!!this.state.isExpanded;this.updateState(t),this.root&&typeof t.isExpanded=="boolean"&&t.isExpanded!==r&&this.handleExpand(),this.events.updated.next(void 0)}setProps(t){this.updateState(t)}setRoot(t){this.root=t,this.state.isExpanded&&this.handleExpand()}getScrollElement(){return document.scrollingElement?document.scrollingElement:document.documentElement?document.documentElement:document.body}handleExpand(){try{let t=document.getElementsByTagName("body")[0],r=document.getElementsByTagName("head")[0];if(!t||!r||!this.root)return;if(this.state.isExpanded){let n=r.children,o=[],i=!1;for(let u=0;uthis.updateProps(r.state)),typeof document<"u"&&(this.expandedViewport=document.createElement("meta"),this.expandedViewport.name="viewport",this.expandedViewport.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0")}};var p8={includeTypes:C.MultiSelect(n1(Er.Names),C.objectToOptions(Er.Names)),excludeTypes:C.MultiSelect([],C.objectToOptions(Er.Names)),ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),aromaticBonds:C.Boolean(!0,{description:"Display aromatic bonds with dashes"}),multipleBonds:C.Select("symmetric",C.arrayToOptions(["off","symmetric","offset"]))},g2r=C.getDefaultValues(p8),Pw=te(k(k({},$u),p8),{adjustCylinderLength:C.Boolean(!1,{description:"Shorten cylinders to reduce overlap with spheres. Useful for for transparent bonds. Not working well with aromatic bonds."})}),y2r=C.getDefaultValues(Pw),Iw=k(k({},X6),p8),v2r=C.getDefaultValues(Iw);function _S(e,t,r){return!Er.is(e,r)||Er.is(t,r)}function jD(e,t,r){let n=t.elements,o=t.bonds,{a:i,b:s,edgeProps:a}=o,{flags:l}=a,{ignoreHydrogens:c,ignoreHydrogensVariant:u,includeTypes:d,excludeTypes:m}=r,p=Er.fromNames(d),h=Er.fromNames(m),f=Er.isAll(p)&&h===0,{child:y}=e,g=y?.unitMap.get(t.id);if(y&&!g)throw new Error("expected childUnit to exist if child exists");if(!(f&&!c&&!y))return v=>{let b=i[v],S=s[v];return g&&!Fe.has(g.elements,n[b])||!f&&_S(p,h,l[v])?!0:c?!!(kc(e,t,n[b],u)||kc(e,t,n[S],u)):!1}}function qD(e,t){let r=e.interUnitBonds,{edges:n}=r,{ignoreHydrogens:o,ignoreHydrogensVariant:i,includeTypes:s,excludeTypes:a}=t,l=Er.fromNames(s),c=Er.fromNames(a),u=Er.isAll(l)&&c===0,{child:d}=e;if(!(u&&!o&&!d))return m=>{if(d){let p=n[m],h=d.unitMap.get(p.unitA);if(!h)return!0;let y=e.unitMap.get(p.unitA).elements[p.indexA];if(!Fe.has(h.elements,y))return!0}if(o){let p=n[m],h=e.unitMap.get(p.unitA),f=e.unitMap.get(p.unitB);if(kc(e,h,h.elements[p.indexA],i)||kc(e,f,f.elements[p.indexB],i))return!0}return!!(!u&&_S(l,c,n[m].props.flag))}}var cm;(function(e){function t(n,o){let{group:i,structure:s}=n,a=i.units[0],l=_e.isAtomic(a)?a.bonds.edgeCount*2:0,c=i.units.length,u=yt.Location(s,void 0,void 0,s,void 0,void 0),d=(m,p)=>{let h=i.units[p];return u.aUnit=h,u.bUnit=h,u.aIndex=h.bonds.a[m],u.bIndex=h.bonds.b[m],u};if(o?.includeLocation2){let m=yt.Location(s,void 0,void 0,s,void 0,void 0);return Pr(l,c,1,d,!1,()=>!1,(h,f)=>{let y=i.units[f];return m.aUnit=y,m.bUnit=y,m.aIndex=y.bonds.b[h],m.bIndex=y.bonds.a[h],m})}return Pr(l,c,1,d)}e.fromGroup=t;function r(n,o){let i=n.interUnitBonds.edgeCount,s=1,a=yt.Location(n,void 0,void 0,n,void 0,void 0),l=c=>{let u=n.interUnitBonds.edges[c];return a.aUnit=n.unitMap.get(u.unitA),a.aIndex=u.indexA,a.bUnit=n.unitMap.get(u.unitB),a.bIndex=u.indexB,a};if(o?.includeLocation2){let c=yt.Location(n,void 0,void 0,n,void 0,void 0);return Pr(i,s,1,l,!0,()=>!1,d=>{let m=n.interUnitBonds.edges[d];return c.aUnit=n.unitMap.get(m.unitB),c.aIndex=m.indexB,c.bUnit=n.unitMap.get(m.unitA),c.bIndex=m.indexA,c})}return Pr(i,s,1,l,!0)}e.fromStructure=r})(cm||(cm={}));function Ew(e,t,r){let{objectId:n,instanceId:o,groupId:i}=e;if(r===n){let{structure:s,group:a}=t,l=a.units[o];if(_e.isAtomic(l)){let{target:c}=s,u=l.bonds.a[i],d=l.bonds.b[i];return yt.Loci(c,[yt.Location(c,l,u,c,l,d),yt.Location(c,l,d,c,l,u)])}}return nr}function Dw(e,t,r,n){let o=!1;if(yt.isLoci(e)){let{structure:i,group:s}=t;if(!Me.areEquivalent(e.structure,i))return!1;let a=s.units[0];if(!_e.isAtomic(a))return!1;let l=a.bonds.edgeCount*2;for(let c of e.bonds){if(c.aUnit!==c.bUnit)continue;let u=s.unitIndexMap.get(c.aUnit.id);if(u!==void 0){let d=a.bonds.getDirectedEdgeIndex(c.aIndex,c.bIndex);d!==-1&&r(ve.ofSingleton(u*l+d))&&(o=!0)}}}else if($.Loci.is(e)){let{structure:i,group:s}=t;if(!Me.areEquivalent(e.structure,i))return!1;let a=s.units[0];if(!_e.isAtomic(a))return!1;let l=a.bonds.edgeCount*2;for(let c of e.elements){let u=s.unitIndexMap.get(c.unit.id);if(u!==void 0){let{offset:d,b:m}=a.bonds;Te.forEach(c.indices,p=>{for(let h=d[p],f=d[p+1];h{let l=m8.get(a.unitB);(!n||l)&&Te.forEach(i.indices,c=>{a.connectedIndices.includes(c)&&a.getEdges(c).forEach(u=>{if(!n||l&&Te.has(l,u.indexB)){let d=t.interUnitBonds.getEdgeIndex(c,s.id,u.indexB,a.unitB);r(ve.ofSingleton(d))&&(o=!0)}})})})}m8.clear()}return o}var f8=Er.is;function Xme(e,t,r,n){let o=e.elements,i=e.bonds,{edgeCount:s,a,b:l,edgeProps:c,offset:u}=i,{order:d,flags:m}=c,{sizeFactor:p,sizeAspectRatio:h,adjustCylinderLength:f,aromaticBonds:y,includeTypes:g,excludeTypes:v,multipleBonds:b}=n,S=b==="off",_=b==="symmetric",w=Er.fromNames(g),E=Er.fromNames(v),A=_S(w,E,32),P=x(),T=x(),B=e.conformation,D,M=$.Location.create(t,e),R=yt.Location(t,e,void 0,t,e,void 0),{child:U}=t;if(n.includeParent&&U){let Q=U.unitMap.get(e.id);if(!Q)throw new Error("expected childUnit to exist");D=H=>{let W=o[a[H]],K=o[l[H]];return Fe.has(Q.elements,W)&&!Fe.has(Q.elements,K)}}let F=Q=>(R.aIndex=a[Q],R.bIndex=l[Q],r.size.size(R)*p),N=Q=>(M.element=o[a[Q]],r.size.size(M)*p),z=Q=>(M.element=o[l[Q]],r.size.size(M)*p),{elementRingIndices:q,elementAromaticRingIndices:O}=e.rings,J=y?e.resonance.delocalizedTriplets:void 0;return{linkCount:s*2,referencePosition:Q=>{let H=a[Q],W=l[Q],K=J?.getThirdElement(H,W);if(K!==void 0)return B.invariantPosition(o[K],P);H>W&&([H,W]=[W,H]),u[H+1]-u[H]===1&&([H,W]=[W,H]);let ce=O.get(H)||q.get(H),V=0;for(let G=u[H],X=u[H+1];GV&&(V=de,B.invariantPosition(o[Z],P))}else return B.invariantPosition(o[Z],P)}return V>0?P:null},position:(Q,H,W)=>{if(B.invariantPosition(o[a[W]],Q),B.invariantPosition(o[l[W]],H),f){let K=N(W),ce=z(W),V=Math.min(K,ce)*h,G=Math.sqrt(Math.max(0,K*K-V*V))-.05,X=Math.sqrt(Math.max(0,ce*ce-V*V))-.05;if(G<=.01&&X<=.01)return;x.normalize(T,x.sub(T,H,Q)),x.scaleAndAdd(Q,Q,T,G),x.scaleAndAdd(H,H,T,-X)}},style:Q=>{let H=d[Q],W=m[Q];if(f8(W,2)||f8(W,4))return 1;if(H===3)return S?0:_?4:5;if(y){let K=a[Q],ce=l[Q],V=O.get(K),G=O.get(ce),X=V&&G?ax(V,G):0;if(f8(W,16)||X&&!A)return X===2?8:7}return H!==2||S?0:_?2:3},radius:Q=>F(Q)*h,ignore:jD(t,e,n),stub:D}}function RGe(e,t,r,n,o,i){if(!_e.isAtomic(t))return Li.createEmpty(i);if(!t.bonds.edgeCount)return Li.createEmpty(i);let{child:s}=r,a=s?.unitMap.get(t.id);if(s&&!a)return Li.createEmpty(i);let l=Xme(t,r,n,o),{cylinders:c,boundingSphere:u}=QE(e,l,o,i);if(u)c.setBoundingSphere(u);else if(c.cylinderCount>0){let d=ge.expand(ge(),(a??t).boundary.sphere,1*o.sizeFactor);c.setBoundingSphere(d)}return c}function LGe(e,t,r,n,o,i){if(!_e.isAtomic(t))return dt.createEmpty(i);if(!t.bonds.edgeCount)return dt.createEmpty(i);let{child:s}=r,a=s?.unitMap.get(t.id);if(s&&!a)return dt.createEmpty(i);let l=Xme(t,r,n,o),{mesh:c,boundingSphere:u}=yu(e,l,o,i);if(u)c.setBoundingSphere(u);else if(c.triangleCount>0){let d=ge.expand(ge(),(a??t).boundary.sphere,1*o.sizeFactor);c.setBoundingSphere(d)}return c}var wS=te(k(k(k({},zn),aS),Pw),{sizeFactor:C.Numeric(.3,{min:0,max:10,step:.01}),sizeAspectRatio:C.Numeric(2/3,{min:0,max:3,step:.01}),tryUseImpostor:C.Boolean(!0),includeParent:C.Boolean(!1)});function WD(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth?FGe(e):OGe(e)}function FGe(e){return lS({defaultProps:C.getDefaultValues(wS),createGeometry:RGe,createLocationIterator:(t,r)=>cm.fromGroup(t,{includeLocation2:r.colorMode==="interpolate"}),getLoci:Ew,eachLocation:Dw,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.sizeAspectRatio!==n.sizeAspectRatio||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.linkCap!==n.linkCap||r.aromaticScale!==n.aromaticScale||r.aromaticSpacing!==n.aromaticSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.dashScale!==n.dashScale||r.dashCap!==n.dashCap||r.stubCap!==n.stubCap||!Ls(r.includeTypes,n.includeTypes)||!Ls(r.excludeTypes,n.excludeTypes)||r.adjustCylinderLength!==n.adjustCylinderLength||r.aromaticBonds!==n.aromaticBonds||r.multipleBonds!==n.multipleBonds,r.colorMode!==n.colorMode&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0);let l=s.group.units[0],c=a.group.units[0];_e.isAtomic(l)&&_e.isAtomic(c)&&(ls.areEqual(l.bonds,c.bonds)||(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0))},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function OGe(e){return no({defaultProps:C.getDefaultValues(wS),createGeometry:LGe,createLocationIterator:t=>cm.fromGroup(t),getLoci:Ew,eachLocation:Dw,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.sizeAspectRatio!==n.sizeAspectRatio||r.radialSegments!==n.radialSegments||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.linkCap!==n.linkCap||r.aromaticScale!==n.aromaticScale||r.aromaticSpacing!==n.aromaticSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.dashScale!==n.dashScale||r.dashCap!==n.dashCap||r.stubCap!==n.stubCap||!Ls(r.includeTypes,n.includeTypes)||!Ls(r.excludeTypes,n.excludeTypes)||r.adjustCylinderLength!==n.adjustCylinderLength||r.aromaticBonds!==n.aromaticBonds||r.multipleBonds!==n.multipleBonds;let l=s.group.units[0],c=a.group.units[0];_e.isAtomic(l)&&_e.isAtomic(c)&&(ls.areEqual(l.bonds,c.bonds)||(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0))},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var h8=new yt.ElementBondIterator;function Kme(e,t,r,n){for(h8.setElement(t,r,n);h8.hasNext;){let o=h8.move();return o.otherUnit.conformation.position(o.otherUnit.elements[o.otherIndex],e),e}return null}var Qme=x();function Zme(e,t,r){let n=$.Location.create(e),o=yt.Location(e,void 0,void 0,e,void 0,void 0),i=e.interUnitBonds,{edgeCount:s,edges:a}=i,{sizeFactor:l,sizeAspectRatio:c,adjustCylinderLength:u,aromaticBonds:d,multipleBonds:m}=r,p=m==="off",h=m==="symmetric",f=x(),y,{child:g}=e;r.includeParent&&g&&(y=_=>{let w=a[_],E=g.unitMap.get(w.unitA),A=g.unitMap.get(w.unitB),T=e.unitMap.get(w.unitA).elements[w.indexA],D=e.unitMap.get(w.unitB).elements[w.indexB];return E&&Fe.has(E.elements,T)&&(!A||!Fe.has(A.elements,D))});let v=_=>{let w=a[_];return o.aUnit=e.unitMap.get(w.unitA),o.aIndex=w.indexA,o.bUnit=e.unitMap.get(w.unitB),o.bIndex=w.indexB,t.size.size(o)*l},b=_=>{let w=a[_];return n.unit=e.unitMap.get(w.unitA),n.element=n.unit.elements[w.indexA],t.size.size(n)*l},S=_=>{let w=a[_];return n.unit=e.unitMap.get(w.unitB),n.element=n.unit.elements[w.indexB],t.size.size(n)*l};return{linkCount:s,referencePosition:_=>{let w=a[_],E,A,P,T;if(w.unitAw.unitB)E=e.unitMap.get(w.unitB),A=e.unitMap.get(w.unitA),P=w.indexB,T=w.indexA;else throw new Error("same units in createInterUnitBondCylinderMesh");return Kme(Qme,e,E,P)||Kme(Qme,e,A,T)},position:(_,w,E)=>{let A=a[E],P=e.unitMap.get(A.unitA),T=e.unitMap.get(A.unitB);if(P.conformation.position(P.elements[A.indexA],_),T.conformation.position(T.elements[A.indexB],w),u){let B=b(E),D=S(E),M=Math.min(B,D)*c,R=Math.sqrt(Math.max(0,B*B-M*M))-.05,U=Math.sqrt(Math.max(0,D*D-M*M))-.05;if(R<=.01&&U<=.01)return;x.normalize(f,x.sub(f,w,_)),x.scaleAndAdd(_,_,f,R),x.scaleAndAdd(w,w,f,-U)}},style:_=>{let w=a[_].props.order,E=gi.create(a[_].props.flag);return Er.is(E,2)||Er.is(E,4)?1:w===3?p?0:h?4:5:d&&Er.is(E,16)?7:w!==2||p?0:h?2:3},radius:_=>v(_)*c,ignore:qD(e,r),stub:y}}function NGe(e,t,r,n,o){if(!t.interUnitBonds.edgeCount)return Li.createEmpty(o);let i=Zme(t,r,n),{cylinders:s,boundingSphere:a}=QE(e,i,n,o);if(a)s.setBoundingSphere(a);else if(s.cylinderCount>0){let{child:l}=t,c=ge.expand(ge(),(l??t).boundary.sphere,1*n.sizeFactor);s.setBoundingSphere(c)}return s}function UGe(e,t,r,n,o){if(!t.interUnitBonds.edgeCount)return dt.createEmpty(o);let i=Zme(t,r,n),{mesh:s,boundingSphere:a}=yu(e,i,n,o);if(a)s.setBoundingSphere(a);else if(s.triangleCount>0){let{child:l}=t,c=ge.expand(ge(),(l??t).boundary.sphere,1*n.sizeFactor);s.setBoundingSphere(c)}return s}var AS=te(k(k(k({},im),xue),Pw),{sizeFactor:C.Numeric(.3,{min:0,max:10,step:.01}),sizeAspectRatio:C.Numeric(2/3,{min:0,max:3,step:.01}),tryUseImpostor:C.Boolean(!0),includeParent:C.Boolean(!1)});function YD(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth?zGe(e):VGe(e)}function zGe(e){return bue({defaultProps:C.getDefaultValues(AS),createGeometry:NGe,createLocationIterator:(t,r)=>cm.fromStructure(t,{includeLocation2:r.colorMode==="interpolate"}),getLoci:kw,eachLocation:Mw,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.sizeAspectRatio!==n.sizeAspectRatio||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.linkCap!==n.linkCap||r.aromaticScale!==n.aromaticScale||r.aromaticSpacing!==n.aromaticSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.dashScale!==n.dashScale||r.dashCap!==n.dashCap||r.stubCap!==n.stubCap||!Ls(r.includeTypes,n.includeTypes)||!Ls(r.excludeTypes,n.excludeTypes)||r.adjustCylinderLength!==n.adjustCylinderLength||r.multipleBonds!==n.multipleBonds,r.colorMode!==n.colorMode&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0),s.interUnitBonds!==a.interUnitBonds&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0)},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function VGe(e){return sl({defaultProps:C.getDefaultValues(AS),createGeometry:UGe,createLocationIterator:t=>cm.fromStructure(t),getLoci:kw,eachLocation:Mw,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.sizeAspectRatio!==n.sizeAspectRatio||r.radialSegments!==n.radialSegments||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.linkCap!==n.linkCap||r.aromaticScale!==n.aromaticScale||r.aromaticSpacing!==n.aromaticSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.dashScale!==n.dashScale||r.dashCap!==n.dashCap||r.stubCap!==n.stubCap||!Ls(r.includeTypes,n.includeTypes)||!Ls(r.excludeTypes,n.excludeTypes)||r.adjustCylinderLength!==n.adjustCylinderLength||r.multipleBonds!==n.multipleBonds,s.interUnitBonds!==a.interUnitBonds&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0)},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var GGe=je.add3,HGe=je.add,Kh;(function(e){function t(r=2048,n=1024,o){let i=je.create(Float32Array,3,n,o?o.centerBuffer.ref.value:r),s=je.create(Float32Array,1,n,o?o.groupBuffer.ref.value:r);return{add:(a,l,c,u)=>{GGe(i,a,l,c),HGe(s,u)},getSpheres:()=>{let a=je.compact(i,!0),l=je.compact(s,!0);return aa.create(a,l,i.elementCount,o)}}}e.create=t})(Kh||(Kh={}));var TS=x.add;function Pf(e,t,r){let{ignoreHydrogens:n,ignoreHydrogensVariant:o,traceOnly:i}=r,s=_e.isCoarse(t),{child:a}=e,l=a?.unitMap.get(t.id);if(a&&!l)throw new Error("expected childUnit to exist if child exists");if(!(!a&&!n&&!i))return c=>!!l&&!Fe.has(l.elements,c)||!s&&n&&kc(e,t,c,o)||i&&!VE(t,c)}function $me(e,t,r,n,o,i){let{child:s}=r,a=s?.unitMap.get(t.id);if(s&&!a)return dt.createEmpty(i);let{detail:l,sizeFactor:c,stride:u}=o,{elements:d,conformation:m}=t,p=d.length,h=p*sp(l),f=rt.createState(h,h/2,i),y=x(),g=Pf(r,t,o),v=$.Location.create(r,t),b=n.size.size,S=x(),_=0,w=0;for(let T=0;T_&&(_=B),f.currentGroup=T,Nr(f,y,B*c,l)}let E=i?ge.clone(i.boundingSphere):void 0,A=rt.getMesh(f);if(w===0)return A;let P;return x.scale(S,S,1/w),E&&x.distance(S,E.center)/E.radius<.1?P=E:P=ge.expand(ge(),(a??t).boundary.sphere,_*c+.05),A.setBoundingSphere(P),A}function Jme(e,t,r,n,o,i){let{child:s}=r,a=s?.unitMap.get(t.id);if(s&&!a)return aa.createEmpty(i);let{sizeFactor:l,stride:c}=o,{elements:u,conformation:d}=t,m=u.length,p=Kh.create(m,m/2,i),h=x(),f=Pf(r,t,o),y=$.Location.create(r,t),g=n.size.size,v=x(),b=0,S=0;if(c&&c>1||f||n.size.granularity!=="uniform")for(let A=0;Ab&&(b=P)}else{for(let A=0;Af&&(f=R),m.currentGroup=c(S,M),Nr(m,P,R*a,s)}}let g=o?ge.clone(o.boundingSphere):void 0,v=rt.getMesh(m);if(y===0)return v;let b;return x.scale(h,h,1/y),g&&x.distance(h,g.center)/g.radius<1?b=g:b=ge.expand(ge(),(i??t).boundary.sphere,f*a+.05),v.setBoundingSphere(b),v}function tpe(e,t,r,n,o){let{child:i}=t,{sizeFactor:s,stride:a}=n,{getSerialIndex:l}=t.serialMapping,c=t.elementCount,u=Kh.create(c,c/2,o),d=r.size.size,m=x(),p=0,h=0;for(let v of t.units){let b=i?.unitMap.get(v.id);if(i&&!b)return aa.createEmpty(o);let{elements:S,conformation:_}=v,w=S.length,E=x(),A=Pf(t,v,n),P=$.Location.create(t,v);if(a&&a>1||A||r.size.granularity!=="uniform")for(let T=0;Tp&&(p=D)}else{for(let T=0;T{let m=o.units[d];return l.unit=m,l.element=m.elements[u],l})}e.fromGroup=t;function r(n){let{units:o,elementCount:i}=n,s=i,a=1,{unitIndices:l,elementIndices:c}=n.serialMapping,u=$.Location.create(n);return Pr(s,a,1,m=>(u.unit=o[l[m]],u.element=c[m],u),!0)}e.fromStructure=r})(Yo||(Yo={}));var rpe={sizeFactor:C.Numeric(1,{min:0,max:10,step:.1}),detail:C.Numeric(0,{min:0,max:3,step:1},We.CustomQualityParamInfo),ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),traceOnly:C.Boolean(!1),tryUseImpostor:C.Boolean(!0),stride:C.Numeric(1,{min:1,max:100,step:1})},PS=k(k(k({},zn),iS),rpe);function XD(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth&&n.extensions.textureFloat?jGe(e):qGe(e)}function jGe(e){return sS({defaultProps:C.getDefaultValues(PS),createGeometry:Jme,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function qGe(e){return no({defaultProps:C.getDefaultValues(PS),createGeometry:$me,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var npe=k(k(k({},im),yue),rpe);function ope(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth&&n.extensions.textureFloat?WGe(e):YGe(e)}function WGe(e){return vue({defaultProps:C.getDefaultValues(npe),createGeometry:tpe,createLocationIterator:Yo.fromStructure,getLoci:dm,eachLocation:um,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function YGe(e){return sl({defaultProps:C.getDefaultValues(npe),createGeometry:epe,createLocationIterator:Yo.fromStructure,getLoci:dm,eachLocation:um,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var ipe={"element-sphere":(e,t)=>Tn("Element sphere",e,t,XD),"intra-bond":(e,t)=>Tn("Intra-unit bond cylinder",e,t,WD),"inter-bond":(e,t)=>Ni("Inter-unit bond cylinder",e,t,YD)},g8=te(k(k(te(k({},PS),{traceOnly:C.Boolean(!1,{isHidden:!0})}),wS),AS),{includeParent:C.Boolean(!1),unitKinds:Vh(["atomic"]),sizeFactor:C.Numeric(.15,{min:.01,max:10,step:.01}),sizeAspectRatio:C.Numeric(2/3,{min:.01,max:3,step:.01}),visuals:C.MultiSelect(["element-sphere","intra-bond","inter-bond"],C.objectToOptions(ipe)),bumpFrequency:C.Numeric(0,{min:0,max:10,step:.1},We.ShadingCategory)});function XGe(e,t){if(Me.getSize(t)>=Me.Size.Huge){let n=C.clone(g8);return n.visuals.defaultValue=["element-sphere","intra-bond"],n}else return g8}function KGe(e,t){return Nt.createMulti("Ball & Stick",e,t,Yn,ipe)}var spe={name:"ball-and-stick",label:"Ball & Stick",description:"Displays atoms as spheres and bonds as cylinders.",factory:KGe,getParams:XGe,defaultValues:C.getDefaultValues(g8),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0,getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent};function QGe(e,t,r,n,o){let{links:i,elements:s}=t.carbohydrates,{linkSizeFactor:a}=n,l=$.Location.create(t),c={linkCount:i.length,position:(m,p,h)=>{let f=i[h];x.copy(m,s[f.carbohydrateIndexA].geometry.center),x.copy(p,s[f.carbohydrateIndexB].geometry.center)},radius:m=>{let p=i[m],h=s[p.carbohydrateIndexA],f=h.unit.rings.all[h.ringIndex];return l.unit=h.unit,l.element=h.unit.elements[f[0]],r.size.size(l)*a}},{mesh:u,boundingSphere:d}=yu(e,c,n,o);if(d)u.setBoundingSphere(d);else if(u.triangleCount>0){let m=ge.expand(ge(),t.boundary.sphere,1*a);u.setBoundingSphere(m)}return u}var v8=te(k(k({},zn),$u),{linkSizeFactor:C.Numeric(.3,{min:0,max:3,step:.01})});function ape(e){return sl({defaultProps:C.getDefaultValues(v8),createGeometry:QGe,createLocationIterator:ZGe,getLoci:$Ge,eachLocation:JGe,setUpdateState:(t,r,n)=>{t.createGeometry=r.linkSizeFactor!==n.linkSizeFactor||r.radialSegments!==n.radialSegments||r.linkCap!==n.linkCap}},e)}function ZGe(e){let{elements:t,links:r}=e.carbohydrates,n=r.length,o=1,i=$.Location.create(e);return Pr(n,o,1,a=>{let l=r[a],c=t[l.carbohydrateIndexA],u=c.unit.rings.all[c.ringIndex];return i.unit=c.unit,i.element=c.unit.elements[u[0]],i},!0)}function $Ge(e,t,r){let{objectId:n,groupId:o}=e;if(r===n){let{links:i,elements:s}=t.carbohydrates,a=i[o],l=s[a.carbohydrateIndexA],c=s[a.carbohydrateIndexB];return $.Loci.union(K0(t,l.unit,l.residueIndex,l.altId),K0(t,c.unit,c.residueIndex,c.altId))}return nr}var y8=new Set;function JGe(e,t,r){let n=!1;if(!$.Loci.is(e)||!Me.areEquivalent(e.structure,t))return!1;let{getLinkIndices:o}=t.carbohydrates;for(let{unit:i,indices:s}of e.elements)_e.isAtomic(i)&&(y8.clear(),Te.forEach(s,a=>{let l=o(i,i.elements[a]);for(let c=0,u=l.length;c{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail}},e)}function gHe(e){let t=e.carbohydrates.elements,r=t.length*2,n=1,o=$.Location.create(e);function i(a,l){let c=t[Math.floor(a/2)],u=c.unit.rings.all[c.ringIndex];return o.unit=c.unit,o.element=c.unit.elements[u[0]],o}function s(a,l){return a%2===1}return Pr(r,n,1,i,!0,s)}function yHe(e,t,r){let{objectId:n,groupId:o}=e;if(r===n){let i=t.carbohydrates.elements[Math.floor(o/2)];return K0(t,i.unit,i.residueIndex,i.altId)}return nr}var I8=new Set;function vHe(e,t,r){let{getElementIndices:n}=t.carbohydrates,o=!1;if(!$.Loci.is(e)||!Me.areEquivalent(e.structure,t))return!1;for(let{unit:i,indices:s}of e.elements)_e.isAtomic(i)&&(I8.clear(),Te.forEach(s,a=>{let l=n(i,i.elements[a]);for(let c=0,u=l.length;c{let f=i[h];f.fromCarbohydrate?(x.copy(m,s[f.carbohydrateIndex].geometry.center),f.elementUnit.conformation.position(f.elementUnit.elements[f.elementIndex],p)):(f.elementUnit.conformation.position(f.elementUnit.elements[f.elementIndex],m),x.copy(p,s[f.carbohydrateIndex].geometry.center))},radius:m=>{let p=i[m];if(p.fromCarbohydrate){let h=s[p.carbohydrateIndex],f=h.unit.rings.all[h.ringIndex];l.unit=h.unit,l.element=h.unit.elements[f[0]]}else l.unit=p.elementUnit,l.element=p.elementUnit.elements[p.elementIndex];return r.size.size(l)*a},style:m=>{let p=i[m],h=p.elementUnit.elements[p.elementIndex],f=Kc(p.elementUnit.model.atomicHierarchy.atoms.type_symbol.value(h));return Fg.has(f)?1:0}},{mesh:u,boundingSphere:d}=yu(e,c,n,o);if(d)u.setBoundingSphere(d);else if(u.triangleCount>0){let m=ge.expand(ge(),t.boundary.sphere,1*a);u.setBoundingSphere(m)}return u}var k8=te(k(k({},zn),$u),{terminalLinkSizeFactor:C.Numeric(.2,{min:0,max:3,step:.01})});function Spe(e){return sl({defaultProps:C.getDefaultValues(k8),createGeometry:xHe,createLocationIterator:bHe,getLoci:SHe,eachLocation:CHe,setUpdateState:(t,r,n)=>{t.createGeometry=r.terminalLinkSizeFactor!==n.terminalLinkSizeFactor||r.radialSegments!==n.radialSegments||r.linkCap!==n.linkCap}},e)}function bHe(e){let{elements:t,terminalLinks:r}=e.carbohydrates,n=r.length,o=1,i=$.Location.create(e);return Pr(n,o,1,a=>{let l=r[a];if(l.fromCarbohydrate){let c=t[l.carbohydrateIndex],u=c.unit.rings.all[c.ringIndex];i.unit=c.unit,i.element=c.unit.elements[u[0]]}else i.unit=l.elementUnit,i.element=l.elementUnit.elements[l.elementIndex];return i},!0)}function SHe(e,t,r){let{objectId:n,groupId:o}=e;if(r===n){let{terminalLinks:i,elements:s}=t.carbohydrates,a=i[o],l=s[a.carbohydrateIndex];return $.Loci.union(K0(t,l.unit,l.residueIndex,l.altId),cue(t,a.elementUnit,a.elementUnit.elements[a.elementIndex]))}return nr}var D8=new Set;function CHe(e,t,r){let n=!1;if(!$.Loci.is(e)||!Me.areEquivalent(e.structure,t))return!1;let{getTerminalLinkIndices:o}=t.carbohydrates;for(let{unit:i,indices:s}of e.elements)_e.isAtomic(i)&&(D8.clear(),Te.forEach(s,a=>{let l=o(i,i.elements[a]);for(let c=0,u=l.length;cNi("Carbohydrate symbol mesh",e,t,bpe),"carbohydrate-link":(e,t)=>Ni("Carbohydrate link cylinder",e,t,ape),"carbohydrate-terminal-link":(e,t)=>Ni("Carbohydrate terminal link cylinder",e,t,Spe)},_pe=te(k(k(k({},E8),v8),k8),{visuals:C.MultiSelect(["carbohydrate-symbol","carbohydrate-link","carbohydrate-terminal-link"],C.objectToOptions(Cpe)),bumpFrequency:C.Numeric(0,{min:0,max:10,step:.1},We.ShadingCategory)});function _He(e,t){return _pe}function wHe(e,t){return Nt.createMulti("Carbohydrate",e,t,Yn,Cpe)}var wpe={name:"carbohydrate",label:"Carbohydrate",description:"Displays carbohydrate symbols (3D SNFG).",factory:wHe,getParams:_He,defaultValues:C.getDefaultValues(_pe),defaultColorTheme:{name:"carbohydrate-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.models.some(t=>Ut.hasCarbohydrate(t))};function M8(e,t){switch(e.kind){case 0:return AHe(e,t);case 1:case 2:return THe(e,t)}}function AHe(e,t){let r=e.model.atomicRanges.cyclicPolymerMap,n=fn.transientSegments(gv(e),e.elements),o=Bt.transientSegments(e.model.atomicHierarchy.residueAtomSegments,e.elements),i=e.model.atomicHierarchy.derived.residue.traceElementIndex,{moleculeType:s}=e.model.atomicHierarchy.derived.residue,a=-1,l=-1,c=!0,u=-1,d=0;for(;n.hasNext;){for(c=!0,u=d,o.setSegment(n.move());o.hasNext;){if(c){let p=o.move().index;if(++d,!o.hasNext)continue;c=!1,l=p}let m=o.move().index;a=l,l=m,t(i[a],i[l],d-1,d,s[a]),++d}r.has(l)&&(a=l,l=r.get(a),t(i[a],i[l],d-1,u,s[a]))}}function THe(e,t){let r=fn.transientSegments(gv(e),e.elements),{elements:n}=e,o=!0,i=0;for(;r.hasNext;){o=!0;let s=r.move(),a=s.start,l=s.end;for(let c=a,u=l;cu)continue;o=!1}t(n[c-1],n[c],i-1,i,0),++i}}}function B8(e,t){switch(e.kind){case 0:return PHe(e,t);case 1:case 2:return IHe(e,t)}}function PHe(e,t){let r=fn.transientSegments(gv(e),e.elements),n=Bt.transientSegments(e.model.atomicHierarchy.residueAtomSegments,e.elements),o=e.model.atomicHierarchy.derived.residue.traceElementIndex,i=0;for(;r.hasNext;)for(n.setSegment(r.move());n.hasNext;){let s=n.move().index;t(o[s],i),++i}}function IHe(e,t){let r=fn.transientSegments(gv(e),e.elements),{elements:n}=e,o=0;for(;r.hasNext;){let i=r.move(),s=i.start,a=i.end;for(let l=s,c=a;l({}),isApplicable:e=>!0,obtain:(e,t)=>Y(void 0,null,function*(){return{value:Ppe(t)}})});function wp(e){return pn.is(e,2)}function EHe(e){return pn.is(e,4)}function IS(e,t,r={}){switch(e.kind){case 0:return new O8(e,t,r);case 1:case 2:return new N8(e,t)}}var $D=pn.create(536870912);function Ipe(e,t){return{center:$.Location.create(e,t),centerPrev:$.Location.create(e,t),centerNext:$.Location.create(e,t),first:!1,last:!1,initial:!1,final:!1,secStrucFirst:!1,secStrucLast:!1,secStrucType:$D,moleculeType:0,coarseBackboneFirst:!1,coarseBackboneLast:!1,isCoarseBackbone:!1,p0:x(),p1:x(),p2:x(),p3:x(),p4:x(),d12:x(),d23:x()}}var Ar=x(),QD=x(),ZD=x(),O8=class{atomicPos(t,r){r!==-1&&(t[0]=this.atomicConformation.x[r],t[1]=this.atomicConformation.y[r],t[2]=this.atomicConformation.z[r])}pos(t,r,n){let o=this.traceElementIndex[r];this.helixOrientationCenters&&wp(n)?x.fromArray(t,this.helixOrientationCenters,r*3):this.atomicPos(t,o)}updateResidueSegmentRange(t){let{index:r}=this.residueAtomSegments;this.residueSegmentMin=r[this.polymerRanges[t.index*2]],this.residueSegmentMax=r[this.polymerRanges[t.index*2+1]]}getResidueIndex(t){if(tthis.residueSegmentMax){let r=this.cyclicPolymerMap.get(this.residueSegmentMax);r!==void 0?t=r+(t-this.residueSegmentMax-1):t=this.residueSegmentMax}return t}getSecStruc(t){if(this.secondaryStructure){let{type:r,getIndex:n}=this.secondaryStructure,o=r[n(t)];return wp(o)?2:o}else return $D}setControlPoint(t,r,n,o,i){EHe(i)||this.helixOrientationCenters&&wp(i)?x.scale(t,x.add(t,r,x.add(t,o,x.add(t,n,n))),1/4):x.copy(t,n)}setFromToVector(t,r,n){this.value.isCoarseBackbone||this.helixOrientationCenters&&wp(n)?x.set(t,1,0,0):(this.atomicPos(QD,this.directionFromElementIndex[r]),this.atomicPos(ZD,this.directionToElementIndex[r]),x.sub(t,ZD,QD))}setDirection(t,r,n,o){x.matchDirection(QD,r,n),x.matchDirection(ZD,o,n),x.scale(t,x.add(t,QD,x.add(t,ZD,x.add(t,n,n))),1/4)}move(){let{residueIt:t,polymerIt:r,value:n}=this;if(this.state===0){for(;r.hasNext;)if(this.polymerSegment=r.move(),t.setSegment(this.polymerSegment),this.updateResidueSegmentRange(this.polymerSegment),t.hasNext){this.state=1;let o=this.residueAtomSegments.index[this.unit.elements[this.polymerSegment.start]],i=this.getResidueIndex(o-1);this.currSecStrucType=o===i?$D:this.getSecStruc(i),this.nextSecStrucType=this.getSecStruc(o),this.currCoarseBackbone=this.directionFromElementIndex[i]===-1||this.directionToElementIndex[i]===-1,this.nextCoarseBackbone=this.directionFromElementIndex[o]===-1||this.directionToElementIndex[o]===-1;break}}if(this.state===1){let{index:o}=t.move(),i=this.getResidueIndex(o-3),s=this.getResidueIndex(o-2),a=this.getResidueIndex(o-1),l=this.getResidueIndex(o+1),c=this.getResidueIndex(o+2),u=this.getResidueIndex(o+3);this.prevSecStrucType=this.getSecStruc(a),this.currSecStrucType=this.getSecStruc(o),this.nextSecStrucType=o===l?$D:this.getSecStruc(l),this.prevCoarseBackbone=this.currCoarseBackbone,this.currCoarseBackbone=this.nextCoarseBackbone,this.nextCoarseBackbone=this.directionFromElementIndex[l]===-1||this.directionToElementIndex[l]===-1,n.secStrucType=this.currSecStrucType,n.secStrucFirst=this.prevSecStrucType!==this.currSecStrucType,n.secStrucLast=this.currSecStrucType!==this.nextSecStrucType,n.isCoarseBackbone=this.currCoarseBackbone,n.coarseBackboneFirst=this.prevCoarseBackbone!==this.currCoarseBackbone,n.coarseBackboneLast=this.currCoarseBackbone!==this.nextCoarseBackbone,n.first=o===this.residueSegmentMin,n.last=o===this.residueSegmentMax,n.moleculeType=this.moleculeType[o],n.initial=o===a,n.final=o===l,n.centerPrev.element=this.traceElementIndex[a],n.center.element=this.traceElementIndex[o],n.centerNext.element=this.traceElementIndex[l];let d=this.getSecStruc(i),m=this.getSecStruc(s),p=this.getSecStruc(a),h=this.getSecStruc(o),f=this.getSecStruc(l),y=this.getSecStruc(c),g=this.getSecStruc(u);this.pos(this.p0,i,d),this.pos(this.p1,s,m),this.pos(this.p2,a,p),this.pos(this.p3,o,h),this.pos(this.p4,l,f),this.pos(this.p5,c,y),this.pos(this.p6,u,g);let v=wp(d),b=wp(m),S=wp(p),_=wp(h),w=wp(f),E=wp(y),A=wp(g);this.helixOrientationCenters&&(_!==S?_?(x.copy(this.p0,this.p3),x.copy(this.p1,this.p3),x.copy(this.p2,this.p3)):S&&(x.scale(Ar,x.sub(Ar,this.p2,this.p3),2),x.add(this.p2,this.p3,Ar),x.add(this.p1,this.p2,Ar),x.add(this.p0,this.p1,Ar)):_!==b?_?(x.copy(this.p0,this.p2),x.copy(this.p1,this.p2)):b&&(x.scale(Ar,x.sub(Ar,this.p1,this.p2),2),x.add(this.p1,this.p2,Ar),x.add(this.p0,this.p1,Ar)):_!==v&&(_?x.copy(this.p0,this.p1):v&&(x.scale(Ar,x.sub(Ar,this.p0,this.p1),2),x.add(this.p0,this.p1,Ar))),_!==w?_?(x.copy(this.p4,this.p3),x.copy(this.p5,this.p3),x.copy(this.p6,this.p3)):w&&(x.scale(Ar,x.sub(Ar,this.p4,this.p3),2),x.add(this.p4,this.p3,Ar),x.add(this.p5,this.p4,Ar),x.add(this.p6,this.p5,Ar)):_!==E?_?(x.copy(this.p5,this.p4),x.copy(this.p6,this.p4)):E&&(x.scale(Ar,x.sub(Ar,this.p5,this.p4),2),x.add(this.p5,this.p4,Ar),x.add(this.p6,this.p5,Ar)):_!==A&&(_?x.copy(this.p6,this.p5):A&&(x.scale(Ar,x.sub(Ar,this.p6,this.p5),2),x.add(this.p6,this.p5,Ar)))),this.setFromToVector(this.d01,a,p),this.setFromToVector(this.d12,o,h),this.setFromToVector(this.d23,l,f),this.setFromToVector(this.d34,c,y);let P=_&&this.helixOrientationCenters,T=1.5;o===a||h!==p&&P?(x.setMagnitude(Ar,x.sub(Ar,this.p3,this.p4),T),x.add(this.p2,this.p3,Ar),x.add(this.p1,this.p2,Ar),x.add(this.p0,this.p1,Ar)):a===s||h!==m&&P?(x.setMagnitude(Ar,x.sub(Ar,this.p2,this.p3),T),x.add(this.p1,this.p2,Ar),x.add(this.p0,this.p1,Ar)):(s===i||h!==d&&P)&&(x.setMagnitude(Ar,x.sub(Ar,this.p1,this.p2),T),x.add(this.p0,this.p1,Ar)),o===l||h!==f&&P?(x.setMagnitude(Ar,x.sub(Ar,this.p3,this.p2),T),x.add(this.p4,this.p3,Ar),x.add(this.p5,this.p4,Ar),x.add(this.p6,this.p5,Ar)):l===c||h!==y&&P?(x.setMagnitude(Ar,x.sub(Ar,this.p4,this.p3),T),x.add(this.p5,this.p4,Ar),x.add(this.p6,this.p5,Ar)):(c===u||h!==g&&P)&&(x.setMagnitude(Ar,x.sub(Ar,this.p5,this.p4),T),x.add(this.p6,this.p5,Ar)),this.setControlPoint(n.p0,this.p0,this.p1,this.p2,m),this.setControlPoint(n.p1,this.p1,this.p2,this.p3,p),this.setControlPoint(n.p2,this.p2,this.p3,this.p4,h),this.setControlPoint(n.p3,this.p3,this.p4,this.p5,f),this.setControlPoint(n.p4,this.p4,this.p5,this.p6,y),this.setDirection(n.d12,this.d01,this.d12,this.d23),this.setDirection(n.d23,this.d12,this.d23,this.d34),t.hasNext||(this.state=0)}return this.hasNext=t.hasNext||r.hasNext,this.value}constructor(t,r,n={}){var o;if(this.unit=t,this.state=0,this.p0=x(),this.p1=x(),this.p2=x(),this.p3=x(),this.p4=x(),this.p5=x(),this.p6=x(),this.d01=x(),this.d12=x(),this.d23=x(),this.d34=x(),this.hasNext=!1,this.atomicConformation=t.model.atomicConformation,this.residueAtomSegments=t.model.atomicHierarchy.residueAtomSegments,this.polymerRanges=t.model.atomicRanges.polymerRanges,this.traceElementIndex=t.model.atomicHierarchy.derived.residue.traceElementIndex,this.directionFromElementIndex=t.model.atomicHierarchy.derived.residue.directionFromElementIndex,this.directionToElementIndex=t.model.atomicHierarchy.derived.residue.directionToElementIndex,this.moleculeType=t.model.atomicHierarchy.derived.residue.moleculeType,this.cyclicPolymerMap=t.model.atomicRanges.cyclicPolymerMap,this.polymerIt=fn.transientSegments(this.polymerRanges,t.elements),this.residueIt=Bt.transientSegments(this.residueAtomSegments,t.elements),this.value=Ipe(r,t),this.hasNext=this.residueIt.hasNext&&this.polymerIt.hasNext,n.ignoreSecondaryStructure||(this.secondaryStructure=(o=wa.get(r).value)===null||o===void 0?void 0:o.get(t.invariantId)),n.useHelixOrientation){let i=Rw.get(t.model).value;if(!i)throw new Error("missing helix-orientation");this.helixOrientationCenters=i.centers}}},N8=class{getElementIndex(t){return Math.min(Math.max(this.polymerSegment.start,t),this.polymerSegment.end-1)}pos(t,r){let n=this.unit.elements[r];t[0]=this.conformation.x[n],t[1]=this.conformation.y[n],t[2]=this.conformation.z[n]}move(){if(this.state===0){for(;this.polymerIt.hasNext;)if(this.polymerSegment=this.polymerIt.move(),this.elementIndex=this.polymerSegment.start,this.elementIndex=this.polymerSegment.end&&(this.state=0)}return this.hasNext=this.elementIndex+1{let f=o.units[h];return c.unit=f,c.element=s[p],c},d=!!n?.asSecondary;function m(p,h){return d}return Pr(a,l,1,u,!1,m)}e.fromGroup=t})(bu||(bu={}));var ek;(function(e){function t(r){let{group:n,structure:o}=r,i=n.units[0].gapElements,s=i.length,a=n.units.length,l=$.Location.create(o);return Pr(s,a,1,(u,d)=>{let m=n.units[d];return l.unit=m,l.element=i[u],l})}e.fromGroup=t})(ek||(ek={}));function mm(e,t,r){let{objectId:n,instanceId:o,groupId:i}=e;if(r===n){let{structure:s,group:a}=t,l=a.units[o];if(_e.isAtomic(l))return zE(s,l,l.polymerElements[i]);{let{elements:c}=l,u=l.polymerElements[i],d=Te.indexOf(c,u);if(d!==-1){let m=Te.ofSingleton(d);return $.Loci(s,[{unit:l,indices:m}])}}}return nr}function Lpe(e,t,r,n,o,i){let s=-1,a=-1;for(let c=o;c<=i;c++){let u=r[c];if(!(u<0)&&(s=Te.indexOf(t,u),s>=0)){a=c;break}}if(s<0)return!1;let l=s;for(let c=i;c>a;c--){let u=r[c];if(u<0)continue;let d=Te.indexOf(t,u);if(d>=0){l=d;break}}return n(ve.ofRange(e+s,e+l))}function q8(e,t,r,n,o){let i=!1,{elements:s}=o.unit,{traceElementIndex:a}=o.unit.model.atomicHierarchy.derived.residue,{index:l}=o.unit.model.atomicHierarchy.residueAtomSegments,c=r(o.unit);if(ve.is(o.indices))if(ve.start(o.indices)===0&&ve.end(o.indices)===o.unit.elements.length)i=n(ve.ofBounds(e,e+t))||i;else{let u=l[s[ve.min(o.indices)]],d=l[s[ve.max(o.indices)]];i=Lpe(e,c,a,n,u,d)||i}else{let{indices:u}=o;for(let d=0,m=u.length;d1)break;h=y,f++}d=f-1,i=Lpe(e,c,a,n,p,h)||i}}return i}function OHe(e){return e.polymerElements}function pm(e,t,r){let n=!1;if(!$.Loci.is(e))return!1;let{structure:o,group:i}=t;if(!Me.areEquivalent(e.structure,o))return!1;let s=i.units[0].polymerElements.length;for(let a of e.elements){if(!i.unitIndexMap.has(a.unit.id))continue;let l=i.unitIndexMap.get(a.unit.id)*s;if(_e.isAtomic(a.unit))n=q8(l,s,OHe,r,a)||n;else if(ve.is(a.indices)){let c=l+ve.start(a.indices),u=l+ve.end(a.indices);n=r(ve.ofBounds(c,u))||n}else for(let c=0,u=a.indices.length;c{let u=Te.indexOf(a.unit.gapElements,a.unit.elements[c]);u!==-1&&r(ve.ofSingleton(l*s+u))&&(n=!0)})}}return n}var Su;(function(e){function t(r){let{group:n,structure:o}=r,i=n.units[0],s=_e.isAtomic(i)?i.nucleotideElements:[],a=s.length,l=n.units.length,c=$.Location.create(o);return Pr(a,l,1,(d,m)=>{let p=n.units[m];return c.unit=p,c.element=s[d],c})}e.fromGroup=t})(Su||(Su={}));function fm(e,t,r){let{objectId:n,instanceId:o,groupId:i}=e;if(r===n){let{structure:s,group:a}=t,l=a.units[o];if(_e.isAtomic(l))return zE(s,l,l.nucleotideElements[i])}return nr}function NHe(e){return e.nucleotideElements}function hm(e,t,r){let n=!1;if(!$.Loci.is(e))return!1;let{structure:o,group:i}=t;if(!Me.areEquivalent(e.structure,o))return!1;let s=i.units[0];if(!_e.isAtomic(s))return!1;let{nucleotideElements:a}=s,l=a.length;for(let c of e.elements){if(!_e.isAtomic(c.unit)||!i.unitIndexMap.has(c.unit.id))continue;let u=i.unitIndexMap.get(c.unit.id)*l;_e.isAtomic(c.unit)&&(n=q8(u,l,NHe,r,c)||n)}return n}var UHe=x(),zHe=x();function gm(e,t){let{model:r,conformation:n}=e,{residueAtomSegments:o,atoms:i,index:s}=r.atomicHierarchy,{label_comp_id:a}=i,l=a.value(o.offsets[t]),c=Cq(l),u=_q(l);if(!c&&!u){let d=s.findAtomOnResidue(t,"C4"),m=s.findAtomOnResidue(t,"N9");d!==-1&&m!==-1&&x.distance(n.invariantPosition(d,UHe),n.invariantPosition(m,zHe))<1.6?c=!0:u=!0}return{isPurine:c,isPyrimidine:u}}function ym(){return{trace:-1,N1:-1,C2:-1,N3:-1,C4:-1,C5:-1,C6:-1,N7:-1,C8:-1,N9:-1,C1_1:-1,C2_1:-1,C3_1:-1,C4_1:-1,O4_1:-1}}function vm(e,t,r){let n=t.model.atomicHierarchy.index,{traceElementIndex:o}=t.model.atomicHierarchy.derived.residue;return e.trace=o[r],e.N1=n.findAtomOnResidue(r,"N1"),e.C2=n.findAtomOnResidue(r,"C2"),e.N3=n.findAtomOnResidue(r,"N3"),e.C4=n.findAtomOnResidue(r,"C4"),e.C5=n.findAtomOnResidue(r,"C5"),e.C5===-1&&(e.C5=n.findAtomOnResidue(r,"N5")),e.C6=n.findAtomOnResidue(r,"C6"),e.N7=n.findAtomOnResidue(r,"N7"),e.N7===-1&&(e.N7=n.findAtomOnResidue(r,"C7")),e.C8=n.findAtomOnResidue(r,"C8"),e.N9=n.findAtomOnResidue(r,"N9"),e}function If(e){return e.trace!==-1&&e.N1!==-1&&e.C2!==-1&&e.N3!==-1&&e.C4!==-1&&e.C5!==-1&&e.C6!==-1&&e.N7!==-1&&e.C8!==-1&&e.N9!==-1}function xm(e,t,r){let n=t.model.atomicHierarchy.index,{traceElementIndex:o}=t.model.atomicHierarchy.derived.residue;return e.trace=o[r],e.N1=n.findAtomOnResidue(r,"N1"),e.N1===-1&&(e.N1=n.findAtomOnResidue(r,"C1")),e.C2=n.findAtomOnResidue(r,"C2"),e.N3=n.findAtomOnResidue(r,"N3"),e.C4=n.findAtomOnResidue(r,"C4"),e.C5=n.findAtomOnResidue(r,"C5"),e.C6=n.findAtomOnResidue(r,"C6"),e}function Ef(e){return e.trace!==-1&&e.N1!==-1&&e.C2!==-1&&e.N3!==-1&&e.C4!==-1&&e.C5!==-1&&e.C6!==-1}function my(e,t,r){let n=t.model.atomicHierarchy.index,{traceElementIndex:o}=t.model.atomicHierarchy.derived.residue;return e.trace=o[r],e.C1_1=n.findAtomOnResidue(r,"C1'"),e.C2_1=n.findAtomOnResidue(r,"C2'"),e.C3_1=n.findAtomOnResidue(r,"C3'"),e.C4_1=n.findAtomOnResidue(r,"C4'"),e.O4_1=n.findAtomOnResidue(r,"O4'"),e}function py(e){return e.trace!==-1&&e.C1_1!==-1&&e.C2_1!==-1&&e.C3_1!==-1&&e.C4_1!==-1&&e.O4_1!==-1}var rk=x(),W8=x(),Upe=x(),zpe=x(),Vpe=x(),Gpe=x(),nk=x(),Y8=x(),X8=x(),Hpe=x(),Ow=ne.identity(),VHe=x(),jpe=fb(),qpe={sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01}),thicknessFactor:C.Numeric(1,{min:0,max:2,step:.01}),radialSegments:C.Numeric(16,{min:2,max:56,step:2},We.CustomQualityParamInfo)},r3r=C.getDefaultValues(qpe);function GHe(e,t,r,n,o,i){if(!_e.isAtomic(t))return dt.createEmpty(i);let s=t.nucleotideElements.length;if(!s)return dt.createEmpty(i);let{sizeFactor:a,thicknessFactor:l,radialSegments:c}=o,u=s*(jpe.vertices.length/3+c*2),d=rt.createState(u,u/4,i),{elements:m,model:p,conformation:h}=t,{chainAtomSegments:f,residueAtomSegments:y}=p.atomicHierarchy,{moleculeType:g}=p.atomicHierarchy.derived.residue,v=Bt.transientSegments(f,m),b=Bt.transientSegments(y,m),S=1*a,_=4.5,w=l*a*2,E={radiusTop:S,radiusBottom:S,radialSegments:c,bottomCap:!0},A=0;for(;v.hasNext;)for(b.setSegment(v.move());b.hasNext;){let{index:B}=b.move();if(xi(g[B])){let D=ym(),M=-1,R=-1,U=-1,F=-1,N=-1,z=4.5,{isPurine:q,isPyrimidine:O}=gm(t,B);q?(z=4.5,vm(D,t,B),M=D.N1,R=D.C4,U=D.C6,F=D.C2,N=D.N9):O&&(z=3,xm(D,t,B),M=D.N3,R=D.C6,U=D.C4,F=D.C2,N=D.N1),N!==-1&&D.trace!==-1&&(h.invariantPosition(N,Vpe),h.invariantPosition(D.trace,Gpe),d.currentGroup=A,Gr(d,Vpe,Gpe,1,E),M!==-1&&R!==-1&&U!==-1&&F!==-1&&(h.invariantPosition(M,rk),h.invariantPosition(R,W8),h.invariantPosition(U,Upe),h.invariantPosition(F,zpe),x.normalize(nk,x.sub(nk,W8,rk)),x.normalize(Y8,x.sub(Y8,zpe,Upe)),x.normalize(X8,x.cross(X8,nk,Y8)),ne.targetTo(Ow,rk,W8,X8),x.scaleAndAdd(Hpe,rk,nk,z/2-.2),ne.scale(Ow,Ow,x.set(VHe,_,w,z)),ne.setTranslation(Ow,Hpe),rt.addPrimitive(d,Ow,jpe))),++A}}let P=rt.getMesh(d),T=ge.expand(ge(),t.boundary.sphere,S);return P.setBoundingSphere(T),P}var K8=k(k({},zn),qpe);function Wpe(e){return no({defaultProps:C.getDefaultValues(K8),createGeometry:GHe,createLocationIterator:Su.fromGroup,getLoci:fm,eachLocation:hm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.thicknessFactor!==n.thicknessFactor||r.radialSegments!==n.radialSegments}},e)}var ok=x(),fy=x(),ik=x(),sk=x(),LS=x(),FS=x(),ak=x(),Ype=x(),Xpe=x(),lk=x(),hy=x(),Zpe={sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01}),thicknessFactor:C.Numeric(1,{min:0,max:2,step:.01}),radialSegments:C.Numeric(16,{min:2,max:56,step:2},We.CustomQualityParamInfo),detail:C.Numeric(0,{min:0,max:3,step:1},We.CustomQualityParamInfo)},v3r=C.getDefaultValues(Zpe),ck=new Float32Array(2*9*3),HHe=new Uint32Array([0,1,2,3,4,5,6,7,16,17,14,15,12,13,8,9,10,11,0,1]),jHe=new Uint32Array([8,12,14,16,6,4,2,0,10]),qHe=new Uint32Array([9,11,1,3,5,7,17,15,13]),uk=new Float32Array(2*6*3),WHe=new Uint32Array([0,1,2,3,4,5,6,7,8,9,10,11,0,1]),YHe=new Uint32Array([0,10,8,6,4,2]),XHe=new Uint32Array([1,3,5,7,9,11]),Kpe=x();function Qpe(e,t,...r){for(let n=0,o=r.length;n{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.thicknessFactor!==n.thicknessFactor||r.radialSegments!==n.radialSegments}},e)}var OS=x(),dk=x(),mk=x(),NS=x(),US=x(),pk=x(),Jpe=x(),efe=x(),tfe=x(),fk=x(),Z8=x(),hk=x(),gk=x(),$8=x(),zS=x(),dl=x(),VS=x(),nfe={sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01}),thicknessFactor:C.Numeric(1,{min:0,max:2,step:.01})},k3r=C.getDefaultValues(nfe),yk=new Float32Array(2*9*3),QHe=new Uint32Array([0,1,2,3,4,5,6,7,16,17,14,15,12,13,8,9,10,11,0,1]),ZHe=new Uint32Array([8,12,14,16,6,4,2,0,10]),$He=new Uint32Array([9,11,1,3,5,7,17,15,13]),vk=new Float32Array(2*6*3),JHe=new Uint32Array([2,3,4,5,6,7,8,9,10,11,2,3]),eje=new Uint32Array([0,10,8,6,4,2,10]),tje=new Uint32Array([1,3,5,7,9,11,3]),xk=new Float32Array(2*6*3),rje=new Uint32Array([0,1,2,3,4,5,6,7,8,9,10,11,0,1]),nje=new Uint32Array([0,10,8,6,4,2]),oje=new Uint32Array([1,3,5,7,9,11]),rfe=x();function J8(e,t,...r){for(let n=0,o=r.length;n{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.thicknessFactor!==n.thicknessFactor}},e)}var ml=x(),Eo=x(),pa=x(),fa=x(),ns=x(),os=x(),ha=x(),Df=x(),kf=x(),Es=x(),Ds=x(),Mf=x(),Cu=x(),Bf=x(),Rf=x(),bk=te(k(k({},zn),aS),{sizeFactor:C.Numeric(.3,{min:0,max:10,step:.01}),radialSegments:C.Numeric(16,{min:2,max:56,step:2},We.CustomQualityParamInfo),tryUseImpostor:C.Boolean(!0)});function ife(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth?aje(e):cje(e)}function sje(e,t,r,n,o,i){if(!_e.isAtomic(t))return Li.createEmpty(i);let s=t.nucleotideElements.length;if(!s)return Li.createEmpty(i);let a=s*15,l=ey.create(a,a/4,i),{elements:c,model:u,conformation:d}=t,{chainAtomSegments:m,residueAtomSegments:p}=u.atomicHierarchy,{moleculeType:h}=u.atomicHierarchy.derived.residue,f=Bt.transientSegments(m,c),y=Bt.transientSegments(p,c),g=0,v=2;for(;f.hasNext;)for(y.setSegment(f.move());y.hasNext;){let{index:_}=y.move();if(xi(h[_])){let w=ym();my(w,t,_),py(w)&&(d.invariantPosition(w.C1_1,Ds),d.invariantPosition(w.C2_1,Mf),d.invariantPosition(w.C3_1,Cu),d.invariantPosition(w.C4_1,Bf),d.invariantPosition(w.O4_1,Rf),d.invariantPosition(w.trace,ml),l.add(Cu[0],Cu[1],Cu[2],ml[0],ml[1],ml[2],1,!0,!0,v,g),l.add(Cu[0],Cu[1],Cu[2],Bf[0],Bf[1],Bf[2],1,!0,!0,v,g),l.add(Bf[0],Bf[1],Bf[2],Rf[0],Rf[1],Rf[2],1,!0,!0,v,g),l.add(Rf[0],Rf[1],Rf[2],Ds[0],Ds[1],Ds[2],1,!0,!0,v,g),l.add(Ds[0],Ds[1],Ds[2],Mf[0],Mf[1],Mf[2],1,!0,!0,v,g),l.add(Mf[0],Mf[1],Mf[2],Cu[0],Cu[1],Cu[2],1,!0,!0,v,g));let{isPurine:E,isPyrimidine:A}=gm(t,_);E?(vm(w,t,_),w.C1_1!==-1&&w.N9!==-1?(d.invariantPosition(w.C1_1,Ds),d.invariantPosition(w.N9,Es),l.add(Es[0],Es[1],Es[2],Ds[0],Ds[1],Ds[2],1,!0,!0,v,g)):w.N9!==-1&&w.trace!==-1&&(d.invariantPosition(w.N9,Es),d.invariantPosition(w.trace,ml),l.add(Es[0],Es[1],Es[2],ml[0],ml[1],ml[2],1,!0,!0,v,g)),If(w)&&(d.invariantPosition(w.N1,Eo),d.invariantPosition(w.C2,pa),d.invariantPosition(w.N3,fa),d.invariantPosition(w.C4,ns),d.invariantPosition(w.C5,os),d.invariantPosition(w.C6,ha),d.invariantPosition(w.N7,Df),d.invariantPosition(w.C8,kf),d.invariantPosition(w.N9,Es),l.add(Es[0],Es[1],Es[2],kf[0],kf[1],kf[2],1,!0,!0,v,g),l.add(kf[0],kf[1],kf[2],Df[0],Df[1],Df[2],1,!0,!0,v,g),l.add(Df[0],Df[1],Df[2],os[0],os[1],os[2],1,!0,!0,v,g),l.add(os[0],os[1],os[2],ha[0],ha[1],ha[2],1,!0,!0,v,g),l.add(ha[0],ha[1],ha[2],Eo[0],Eo[1],Eo[2],1,!0,!0,v,g),l.add(Eo[0],Eo[1],Eo[2],pa[0],pa[1],pa[2],1,!0,!0,v,g),l.add(pa[0],pa[1],pa[2],fa[0],fa[1],fa[2],1,!0,!0,v,g),l.add(fa[0],fa[1],fa[2],ns[0],ns[1],ns[2],1,!0,!0,v,g),l.add(ns[0],ns[1],ns[2],os[0],os[1],os[2],1,!0,!0,v,g),l.add(ns[0],ns[1],ns[2],Es[0],Es[1],Es[2],1,!0,!0,v,g))):A&&(xm(w,t,_),w.C1_1!==-1&&w.N1!==-1?(d.invariantPosition(w.N1,Eo),d.invariantPosition(w.C1_1,Ds),l.add(Eo[0],Eo[1],Eo[2],Ds[0],Ds[1],Ds[2],1,!0,!0,v,g)):w.N1!==-1&&w.trace!==-1&&(d.invariantPosition(w.N1,Eo),d.invariantPosition(w.trace,ml),l.add(Eo[0],Eo[1],Eo[2],ml[0],ml[1],ml[2],1,!0,!0,v,g)),Ef(w)&&(d.invariantPosition(w.N1,Eo),d.invariantPosition(w.C2,pa),d.invariantPosition(w.N3,fa),d.invariantPosition(w.C4,ns),d.invariantPosition(w.C5,os),d.invariantPosition(w.C6,ha),l.add(Eo[0],Eo[1],Eo[2],ha[0],ha[1],ha[2],1,!0,!0,v,g),l.add(ha[0],ha[1],ha[2],os[0],os[1],os[2],1,!0,!0,v,g),l.add(os[0],os[1],os[2],ns[0],ns[1],ns[2],1,!0,!0,v,g),l.add(ns[0],ns[1],ns[2],fa[0],fa[1],fa[2],1,!0,!0,v,g),l.add(fa[0],fa[1],fa[2],pa[0],pa[1],pa[2],1,!0,!0,v,g),l.add(pa[0],pa[1],pa[2],Eo[0],Eo[1],Eo[2],1,!0,!0,v,g))),++g}}let b=l.getCylinders(),S=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return b.setBoundingSphere(S),b}function aje(e){return lS({defaultProps:C.getDefaultValues(bk),createGeometry:sje,createLocationIterator:Su.fromGroup,getLoci:fm,eachLocation:hm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function lje(e,t,r,n,o,i){if(!_e.isAtomic(t))return dt.createEmpty(i);let s=t.nucleotideElements.length;if(!s)return dt.createEmpty(i);let{sizeFactor:a,radialSegments:l}=o,c=s*(l*15),u=rt.createState(c,c/4,i),{elements:d,model:m,conformation:p}=t,{chainAtomSegments:h,residueAtomSegments:f}=m.atomicHierarchy,{moleculeType:y}=m.atomicHierarchy.derived.residue,g=Bt.transientSegments(h,d),v=Bt.transientSegments(f,d),b={radiusTop:1*a,radiusBottom:1*a,radialSegments:l},S=0;for(;g.hasNext;)for(v.setSegment(g.move());v.hasNext;){let{index:E}=v.move();if(xi(y[E])){let A=ym();u.currentGroup=S,my(A,t,E),py(A)&&(p.invariantPosition(A.C1_1,Ds),p.invariantPosition(A.C2_1,Mf),p.invariantPosition(A.C3_1,Cu),p.invariantPosition(A.C4_1,Bf),p.invariantPosition(A.O4_1,Rf),p.invariantPosition(A.trace,ml),Gr(u,Cu,ml,1,b),Gr(u,Cu,Bf,1,b),Gr(u,Bf,Rf,1,b),Gr(u,Rf,Ds,1,b),Gr(u,Ds,Mf,1,b),Gr(u,Mf,Cu,1,b));let{isPurine:P,isPyrimidine:T}=gm(t,E);P?(vm(A,t,E),A.C1_1!==-1&&A.N9!==-1?(p.invariantPosition(A.C1_1,Ds),p.invariantPosition(A.N9,Es),Gr(u,Es,Ds,1,b)):A.N9!==-1&&A.trace!==-1&&(p.invariantPosition(A.N9,Es),p.invariantPosition(A.trace,ml),Gr(u,Es,ml,1,b)),If(A)&&(p.invariantPosition(A.N1,Eo),p.invariantPosition(A.C2,pa),p.invariantPosition(A.N3,fa),p.invariantPosition(A.C4,ns),p.invariantPosition(A.C5,os),p.invariantPosition(A.C6,ha),p.invariantPosition(A.N7,Df),p.invariantPosition(A.C8,kf),p.invariantPosition(A.N9,Es),Gr(u,Es,kf,1,b),Gr(u,kf,Df,1,b),Gr(u,Df,os,1,b),Gr(u,os,ha,1,b),Gr(u,ha,Eo,1,b),Gr(u,Eo,pa,1,b),Gr(u,pa,fa,1,b),Gr(u,fa,ns,1,b),Gr(u,ns,os,1,b),Gr(u,ns,Es,1,b))):T&&(xm(A,t,E),A.C1_1!==-1&&A.N1!==-1?(p.invariantPosition(A.N1,Eo),p.invariantPosition(A.C1_1,Ds),Gr(u,Eo,Ds,1,b)):A.N1!==-1&&A.trace!==-1&&(p.invariantPosition(A.N1,Eo),p.invariantPosition(A.trace,ml),Gr(u,Eo,ml,1,b)),Ef(A)&&(p.invariantPosition(A.N1,Eo),p.invariantPosition(A.C2,pa),p.invariantPosition(A.N3,fa),p.invariantPosition(A.C4,ns),p.invariantPosition(A.C5,os),p.invariantPosition(A.C6,ha),Gr(u,Eo,ha,1,b),Gr(u,ha,os,1,b),Gr(u,os,ns,1,b),Gr(u,ns,fa,1,b),Gr(u,fa,pa,1,b),Gr(u,pa,Eo,1,b))),++S}}let _=rt.getMesh(u),w=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return _.setBoundingSphere(w),_}function cje(e){return no({defaultProps:C.getDefaultValues(bk),createGeometry:lje,createLocationIterator:Su.fromGroup,getLoci:fm,eachLocation:hm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.radialSegments!==n.radialSegments},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var GS=x(),bm=x(),Sm=x(),Cm=x(),_m=x(),nd=x(),wm=x(),HS=x(),jS=x(),qS=x(),WS=x(),YS=x(),XS=x(),KS=x(),QS=x(),Sk=te(k(k({},zn),iS),{sizeFactor:C.Numeric(.3,{min:0,max:10,step:.01}),detail:C.Numeric(0,{min:0,max:3,step:1},We.CustomQualityParamInfo),tryUseImpostor:C.Boolean(!0)});function sfe(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth?dje(e):pje(e)}function uje(e,t,r,n,o,i){if(!_e.isAtomic(t))return aa.createEmpty(i);let s=t.nucleotideElements.length;if(!s)return aa.createEmpty(i);let a=s*15,l=Kh.create(a,a/4,i),{elements:c,model:u,conformation:d}=t,{chainAtomSegments:m,residueAtomSegments:p}=u.atomicHierarchy,{moleculeType:h}=u.atomicHierarchy.derived.residue,f=Bt.transientSegments(m,c),y=Bt.transientSegments(p,c),g=0;for(;f.hasNext;)for(y.setSegment(f.move());y.hasNext;){let{index:S}=y.move();if(xi(h[S])){let _=ym();my(_,t,S),py(_)&&(d.invariantPosition(_.C1_1,WS),d.invariantPosition(_.C2_1,YS),d.invariantPosition(_.C3_1,XS),d.invariantPosition(_.C4_1,KS),d.invariantPosition(_.O4_1,QS),d.invariantPosition(_.trace,GS),l.add(GS[0],GS[1],GS[2],g),l.add(XS[0],XS[1],XS[2],g),l.add(KS[0],KS[1],KS[2],g),l.add(QS[0],QS[1],QS[2],g),l.add(WS[0],WS[1],WS[2],g),l.add(YS[0],YS[1],YS[2],g));let{isPurine:w,isPyrimidine:E}=gm(t,S);w?(vm(_,t,S),If(_)&&(d.invariantPosition(_.N1,bm),d.invariantPosition(_.C2,Sm),d.invariantPosition(_.N3,Cm),d.invariantPosition(_.C4,_m),d.invariantPosition(_.C5,nd),d.invariantPosition(_.C6,wm),d.invariantPosition(_.N7,HS),d.invariantPosition(_.C8,jS),d.invariantPosition(_.N9,qS),l.add(qS[0],qS[1],qS[2],g),l.add(jS[0],jS[1],jS[2],g),l.add(HS[0],HS[1],HS[2],g),l.add(nd[0],nd[1],nd[2],g),l.add(wm[0],wm[1],wm[2],g),l.add(bm[0],bm[1],bm[2],g),l.add(Sm[0],Sm[1],Sm[2],g),l.add(Cm[0],Cm[1],Cm[2],g),l.add(_m[0],_m[1],_m[2],g))):E&&(xm(_,t,S),Ef(_)&&(d.invariantPosition(_.N1,bm),d.invariantPosition(_.C2,Sm),d.invariantPosition(_.N3,Cm),d.invariantPosition(_.C4,_m),d.invariantPosition(_.C5,nd),d.invariantPosition(_.C6,wm),l.add(bm[0],bm[1],bm[2],g),l.add(wm[0],wm[1],wm[2],g),l.add(nd[0],nd[1],nd[2],g),l.add(_m[0],_m[1],_m[2],g),l.add(Cm[0],Cm[1],Cm[2],g),l.add(Sm[0],Sm[1],Sm[2],g))),++g}}let v=l.getSpheres(),b=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return v.setBoundingSphere(b),v}function dje(e){return sS({defaultProps:C.getDefaultValues(Sk),createGeometry:uje,createLocationIterator:Su.fromGroup,getLoci:fm,eachLocation:hm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function mje(e,t,r,n,o,i){if(!_e.isAtomic(t))return dt.createEmpty(i);let s=t.nucleotideElements.length;if(!s)return dt.createEmpty(i);let{sizeFactor:a,detail:l}=o,c=s*sp(l),u=rt.createState(c,c/2,i),{elements:d,model:m,conformation:p}=t,{chainAtomSegments:h,residueAtomSegments:f}=m.atomicHierarchy,{moleculeType:y}=m.atomicHierarchy.derived.residue,g=Bt.transientSegments(h,d),v=Bt.transientSegments(f,d),b=1*a,S=0;for(;g.hasNext;)for(v.setSegment(g.move());v.hasNext;){let{index:E}=v.move();if(xi(y[E])){let A=ym();u.currentGroup=S,my(A,t,E),py(A)&&(p.invariantPosition(A.C1_1,WS),p.invariantPosition(A.C2_1,YS),p.invariantPosition(A.C3_1,XS),p.invariantPosition(A.C4_1,KS),p.invariantPosition(A.O4_1,QS),p.invariantPosition(A.trace,GS),Nr(u,GS,b,l),Nr(u,KS,b,l),Nr(u,QS,b,l),Nr(u,WS,b,l),Nr(u,YS,b,l),Nr(u,XS,b,l));let{isPurine:P,isPyrimidine:T}=gm(t,E);P?(vm(A,t,E),If(A)&&(p.invariantPosition(A.N1,bm),p.invariantPosition(A.C2,Sm),p.invariantPosition(A.N3,Cm),p.invariantPosition(A.C4,_m),p.invariantPosition(A.C5,nd),p.invariantPosition(A.C6,wm),p.invariantPosition(A.N7,HS),p.invariantPosition(A.C8,jS),p.invariantPosition(A.N9,qS),Nr(u,jS,b,l),Nr(u,HS,b,l),Nr(u,nd,b,l),Nr(u,wm,b,l),Nr(u,bm,b,l),Nr(u,Sm,b,l),Nr(u,Cm,b,l),Nr(u,_m,b,l),Nr(u,nd,b,l),Nr(u,qS,b,l))):T&&(xm(A,t,E),Ef(A)&&(p.invariantPosition(A.N1,bm),p.invariantPosition(A.C2,Sm),p.invariantPosition(A.N3,Cm),p.invariantPosition(A.C4,_m),p.invariantPosition(A.C5,nd),p.invariantPosition(A.C6,wm),Nr(u,wm,b,l),Nr(u,nd,b,l),Nr(u,_m,b,l),Nr(u,Cm,b,l),Nr(u,Sm,b,l),Nr(u,bm,b,l))),++S}}let _=rt.getMesh(u),w=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return _.setBoundingSphere(w),_}function pje(e){return no({defaultProps:C.getDefaultValues(Sk),createGeometry:mje,createLocationIterator:Su.fromGroup,getLoci:fm,eachLocation:hm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var bv=x.zero(),ZS=x.zero(),Sv=x.zero(),afe=x.zero(),ga=Pc(3,!1);function fje(){let e=np(8);for(let t=0;t<3;++t){let r=(t+1)%3;x.set(bv,ga[t*3],ga[t*3+1],-.5),x.set(ZS,ga[r*3],ga[r*3+1],-.5),x.set(Sv,ga[r*3],ga[r*3+1],.5),x.set(afe,ga[t*3],ga[t*3+1],.5),e.add(bv,ZS,Sv),e.add(Sv,afe,bv)}return x.set(bv,ga[0],ga[1],-.5),x.set(ZS,ga[3],ga[4],-.5),x.set(Sv,ga[6],ga[7],-.5),e.add(Sv,ZS,bv),x.set(bv,ga[0],ga[1],.5),x.set(ZS,ga[3],ga[4],.5),x.set(Sv,ga[6],ga[7],.5),e.add(bv,ZS,Sv),e.getPrimitive()}var tz;function lfe(){return tz||(tz=fje()),tz}var Cv=ne.identity(),hje=x.zero(),cfe=x.zero(),ufe=x.zero(),rz=x.zero(),gje=4,yje=4,vje=6,xje=lfe(),dfe={sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01})},IAr=C.getDefaultValues(dfe);function bje(e,t,r,n,o,i){let s=t.polymerElements.length;if(!s)return dt.createEmpty(i);let{sizeFactor:a}=o,l=s*24,c=rt.createState(l,l/10,i),d=MS(1),{normalVectors:m,binormalVectors:p}=d,h=0,f=IS(t,r);for(;f.hasNext;){let v=f.move();c.currentGroup=h;let b=xi(v.moleculeType),S=pn.is(v.secStrucType,4);if(BS(d,v,b||S?.5:.9,b?.3:.5),S&&!v.secStrucLast||!S){let E=n.size.size(v.center)*a,A=gje*E,P=yje*E,T=vje*E,B=b?p:m;x.fromArray(cfe,B,0),x.fromArray(ufe,B,3),x.normalize(rz,x.add(rz,cfe,ufe)),ne.targetTo(Cv,v.p3,v.p1,rz),ne.mul(Cv,Cv,ne.rotY90Z180),ne.scale(Cv,Cv,x.set(hje,T,P,A)),ne.setTranslation(Cv,v.p2),rt.addPrimitive(c,Cv,xje)}++h}let y=rt.getMesh(c),g=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return y.setBoundingSphere(g),y}var nz=k(k({},zn),dfe);function mfe(e){return no({defaultProps:C.getDefaultValues(nz),createGeometry:bje,createLocationIterator:t=>bu.fromGroup(t),getLoci:mm,eachLocation:pm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor}},e)}var oz=10,pfe={sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01}),radialSegments:C.Numeric(16,{min:2,max:56,step:2},We.CustomQualityParamInfo)},zAr=C.getDefaultValues(pfe);function Sje(e,t,r,n,o,i){let s=t.gapElements.length;if(!s)return dt.createEmpty(i);let{sizeFactor:a,radialSegments:l}=o,c=oz*l*2*s*2,u=rt.createState(c,c/10,i),d=x(),m=x(),p={radiusTop:1,radiusBottom:1,topCap:!0,bottomCap:!0,radialSegments:l},h=0,f=Ape(r,t);for(;f.hasNext;){let{centerA:v,centerB:b}=f.move();v.element===b.element||(t.conformation.invariantPosition(v.element,d),t.conformation.invariantPosition(b.element,m),p.radiusTop=p.radiusBottom=n.size.size(v)*a,u.currentGroup=h,Mh(u,d,m,.5,oz,!1,p),p.radiusTop=p.radiusBottom=n.size.size(b)*a,u.currentGroup=h+1,Mh(u,m,d,.5,oz,!1,p)),h+=2}let y=rt.getMesh(u),g=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return y.setBoundingSphere(g),y}var _v=k(k({},zn),pfe);function $S(e){return no({defaultProps:C.getDefaultValues(_v),createGeometry:Sje,createLocationIterator:ek.fromGroup,getLoci:Ope,eachLocation:Npe,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.radialSegments!==n.radialSegments}},e)}var En=x(),oo=x(),Cje=x(),od=x(),Lf=x(),Ck=x(),_k=x(),Nw=x(),Tp=x(),Ff=x(),iz=x(),gy=x(),yy=x(),vy=x(),xy=x(),Am=x.fromArray,JS=x.scale,Tm=x.add,Zh=x.sub,_je=x.magnitude,ffe=x.negate,sz=x.copy,hfe=x.cross,wje=x.set,go=je.add3,Aje=je.add;function wk(e,t,r,n,o,i,s,a,l){let{vertices:c,normals:u,indices:d}=t,m=c.elementCount;if(Am(En,n,e),JS(_k,En,s),JS(Ck,En,a),Am(oo,o,e),JS(od,oo,i),hfe(Ff,oo,En),Am(Tp,r,e),Tm(gy,Tm(gy,Tp,od),Ck),Zh(yy,Tm(yy,Tp,od),_k),Zh(vy,Zh(vy,Tp,od),_k),Tm(xy,Zh(xy,Tp,od),Ck),s0?(Am(En,t,0),Am(oo,t,o*3),y=a/_je(Zh(Cje,oo,En))):wje(Nw,0,0,0);for(let v=0;v<=o;++v){let b=i[v],S=s[v],_=a===0?S:a*(1-v/o),w=v*3;Am(Lf,r,w),JS(Lf,Lf,_),Am(od,n,w),JS(od,od,b),a>0&&(Am(En,r,w),Am(oo,n,w),JS(Nw,hfe(Nw,En,oo),y)),Am(Tp,t,w),Am(Ff,r,w),Am(iz,n,w),Tm(En,Tm(En,Tp,od),Lf),Tm(oo,Ff,Nw),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2]),Tm(En,Zh(En,Tp,od),Lf),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2]),ffe(oo,iz),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2]),Zh(En,Zh(En,Tp,od),Lf),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2]),Tm(oo,ffe(oo,Ff),Nw),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2]),Zh(En,Tm(En,Tp,od),Lf),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2]),sz(oo,iz),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2]),Tm(En,Tm(En,Tp,od),Lf),go(d,En[0],En[1],En[2]),go(m,oo[0],oo[1],oo[2])}for(let v=0;v0){let v=i[0],b=s[0];wk(0,e,t,r,n,v,a,-b,!1),wk(0,e,t,r,n,v,-a,b,!1)}if(c&&a===0){let v=i[o],b=s[o];wk(o*3,e,t,r,n,v,b,b,!0)}let g=(o+1)*8+(l?4:a>0?8:0)+(c&&a===0?4:0);for(let v=0,b=g;vP;for(let D=0;D=S?T-P:-T+P:D>=b&&DP;B&&(T-=P),y=m.elementCount;for(let D=0;D=S?T:-T)):t2(Ys,pl,oc,zc,T*g[D],P*v[D]),ic(m,Ys[0],Ys[1],Ys[2]),ic(p,xs[0],xs[1],xs[2]),ic(h,y+(D+1)%i,y+D,A)}if(c){let E=o*3,A=m.elementCount;$h(pl,r,E),$h(oc,n,E),$h(zc,t,E),gfe(xs,pl,oc),ic(m,zc[0],zc[1],zc[2]),ic(p,xs[0],xs[1],xs[2]);let P=s[o],T=a[o],B=u==="rounded"&&T>P;B&&(T-=P),y=m.elementCount;for(let D=0;D=S?T:-T)):t2(Ys,pl,oc,zc,T*g[D],P*v[D]),ic(m,Ys[0],Ys[1],Ys[2]),ic(p,xs[0],xs[1],xs[2]),ic(h,y+D,y+(D+1)%i,A)}let w=(o+1)*i+(l?i+1:0)+(c?i+1:0);je.addRepeat(f,w,d)}var Jh=x.fromArray,Dje=x.magnitude,cz=x.sub,yfe=x.add,uz=x.scale,kje=x.negate,Mje=x.copy,Bje=x.cross,Pm=je.add3,Rje=je.add,ya=x(),fl=x(),Lje=x(),dz=x(),wv=x(),vfe=x(),zw=x(),Fje=x(),mz=x();function r2(e,t,r,n,o,i,s,a){let{currentGroup:l,vertices:c,normals:u,indices:d,groups:m}=e,p=c.elementCount,h=0;a>0&&(Jh(ya,t,0),Jh(fl,t,o*3),h=a/Dje(cz(Lje,fl,ya)));for(let y=0;y<=o;++y){let g=i[y],v=s[y],b=a===0?v:a*(1-y/o),S=y*3;Jh(wv,r,S),uz(wv,wv,b),Jh(dz,n,S),uz(dz,dz,g),a>0&&(Jh(ya,r,S),Jh(fl,n,S),uz(vfe,Bje(vfe,ya,fl),h)),Jh(zw,t,S),Jh(Fje,r,S),Jh(mz,n,S),yfe(ya,zw,wv),kje(fl,mz),Pm(c,ya[0],ya[1],ya[2]),Pm(u,fl[0],fl[1],fl[2]),cz(ya,zw,wv),Pm(c,ya[0],ya[1],ya[2]),Pm(u,fl[0],fl[1],fl[2]),yfe(ya,zw,wv),Mje(fl,mz),Pm(c,ya[0],ya[1],ya[2]),Pm(u,fl[0],fl[1],fl[2]),cz(ya,zw,wv),Pm(c,ya[0],ya[1],ya[2]),Pm(u,fl[0],fl[1],fl[2])}for(let y=0;ybu.fromGroup(t,{asSecondary:!0}),getLoci:mm,eachLocation:pm,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.tubularHelices!==n.tubularHelices||r.detail!==n.detail||r.linearSegments!==n.linearSegments||r.radialSegments!==n.radialSegments||r.aspectRatio!==n.aspectRatio||r.arrowFactor!==n.arrowFactor||r.helixProfile!==n.helixProfile||r.nucleicProfile!==n.nucleicProfile;let l=wa.get(s.structure).version;t.info.secondaryStructureHash!==l&&(t.info.secondaryStructureHash!==void 0&&(t.createGeometry=!0),t.info.secondaryStructureHash=l)}},e)}var Sfe={"polymer-trace":(e,t)=>Tn("Polymer trace mesh",e,t,bfe),"polymer-gap":(e,t)=>Tn("Polymer gap cylinder",e,t,$S),"nucleotide-block":(e,t)=>Tn("Nucleotide block mesh",e,t,Wpe),"nucleotide-ring":(e,t)=>Tn("Nucleotide ring mesh",e,t,$pe),"nucleotide-atomic-ring-fill":(e,t)=>Tn("Nucleotide atomic ring fill",e,t,ofe),"nucleotide-atomic-bond":(e,t)=>Tn("Nucleotide atomic bond",e,t,ife),"nucleotide-atomic-element":(e,t)=>Tn("Nucleotide atomic element",e,t,sfe),"direction-wedge":(e,t)=>Tn("Polymer direction wedge",e,t,mfe)},Cfe=te(k(k(k(k(k(k(k(k({},pz),_v),K8),Q8),bk),Sk),ez),nz),{sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01}),visuals:C.MultiSelect(["polymer-trace","polymer-gap","nucleotide-ring","nucleotide-atomic-ring-fill","nucleotide-atomic-bond","nucleotide-atomic-element"],C.objectToOptions(Sfe)),bumpFrequency:C.Numeric(2,{min:0,max:10,step:.1},We.ShadingCategory),colorMode:C.Select("default",C.arrayToOptions(["default","interpolate"]),te(k({},We.ShadingCategory),{isHidden:!0}))});function Nje(e,t){let r=C.clone(Cfe),n=!1,o=!1;return t.units.forEach(i=>{!n&&_e.isAtomic(i)&&i.nucleotideElements.length&&(n=!0),!o&&i.gapElements.length&&(o=!0)}),r.visuals.defaultValue=["polymer-trace"],n&&r.visuals.defaultValue.push("nucleotide-ring"),o&&r.visuals.defaultValue.push("polymer-gap"),r}function Uje(e,t){return Nt.createMulti("Cartoon",e,t,Yn,Sfe)}var _fe={name:"cartoon",label:"Cartoon",description:"Displays ribbons, planks, tubes smoothly following the trace atoms of polymers.",factory:Uje,getParams:Nje,defaultValues:C.getDefaultValues(Cfe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.polymerResidueCount>0,ensureCustomProperties:{attach:(e,t)=>Y(void 0,null,function*(){yield wa.attach(e,t,void 0,!0);for(let r of t.models)yield Rw.attach(e,r,void 0,!0)}),detach:e=>{wa.ref(e,!1);for(let t of e.models)Rw.ref(t,!1)}}};var fz=te(k({},zn),{sizeFactor:C.Numeric(1,{min:0,max:10,step:.1}),detail:C.Numeric(0,{min:0,max:3,step:1},We.CustomQualityParamInfo),ignoreHydrogens:C.Boolean(!1)});function wfe(e){return no({defaultProps:C.getDefaultValues(fz),createGeometry:zje,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail||r.ignoreHydrogens!==n.ignoreHydrogens}},e)}function zje(e,t,r,n,o,i){let{child:s}=r,a=s?.unitMap.get(t.id);if(s&&!a)return dt.createEmpty(i);let{detail:l,sizeFactor:c,ignoreHydrogens:u}=o,{elements:d,model:m}=t,{atomicNumber:p}=t.model.atomicHierarchy.derived.atom,h=d.length,f=h*sp(l),y=rt.createState(f,f/2,i),g=$c.Provider.get(m);if(!g)return dt.createEmpty(i);let v=x(),b=Kt(),S=x(),_=x(),w=x(),{elementToAnsiotrop:E,data:A}=g,{U:P}=A,T=A._schema.U.space,B=t.conformation,D=$.Location.create(r);D.unit=t;for(let U=0;UTn("Ellipsoid Mesh",e,t,wfe),"intra-bond":(e,t)=>Tn("Intra-unit bond cylinder",e,t,WD),"inter-bond":(e,t)=>Ni("Inter-unit bond cylinder",e,t,YD)},Tfe=te(k(k(k({},fz),wS),AS),{includeParent:C.Boolean(!1),adjustCylinderLength:C.Boolean(!1,{isHidden:!0}),unitKinds:Vh(["atomic"]),sizeFactor:C.Numeric(1,{min:.01,max:10,step:.01}),sizeAspectRatio:C.Numeric(.1,{min:.01,max:3,step:.01}),linkCap:C.Boolean(!0),visuals:C.MultiSelect(["ellipsoid-mesh","intra-bond","inter-bond"],C.objectToOptions(Afe)),bumpFrequency:C.Numeric(0,{min:0,max:10,step:.1},We.ShadingCategory)});function Vje(e,t){return Tfe}function Gje(e,t){return Nt.createMulti("Ellipsoid",e,t,Yn,Afe)}var Pfe={name:"ellipsoid",label:"Ellipsoid",description:"Displays anisotropic displacement ellipsoids of atomic elements plus bonds as cylinders.",factory:Gje,getParams:Vje,defaultValues:C.getDefaultValues(Tfe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0&&e.models.some(t=>$c.Provider.isApplicable(t)),getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent};var Ife=` +precision highp float; + +attribute vec3 aPosition; +attribute float aRadius; + +varying vec3 vPosition; +varying float vRadiusSqInv; + +#if defined(dCalcType_groupId) + attribute float aGroup; + varying float vGroup; +#endif + +uniform vec3 uBboxSize; +uniform vec3 uBboxMin; +uniform float uResolution; + +void main() { + vRadiusSqInv = 1.0 / (aRadius * aRadius); + #if defined(dCalcType_groupId) + vGroup = aGroup; + #endif + gl_PointSize = ceil(((aRadius * 3.0) / uResolution) + uResolution); + vPosition = (aPosition - uBboxMin) / uResolution; + gl_Position = vec4(((aPosition - uBboxMin) / uBboxSize) * 2.0 - 1.0, 1.0); +} +`;var Efe=` +precision highp float; + +varying vec3 vPosition; +varying float vRadiusSqInv; +#if defined(dCalcType_groupId) + #if defined(dGridTexType_2d) + precision highp sampler2D; + uniform sampler2D tMinDistanceTex; + uniform vec3 uGridTexDim; + #elif defined(dGridTexType_3d) + precision highp sampler3D; + uniform sampler3D tMinDistanceTex; + #endif + varying float vGroup; +#endif + +#include common + +uniform vec3 uGridDim; +uniform vec2 uGridTexScale; +uniform float uCurrentSlice; +uniform float uCurrentX; +uniform float uCurrentY; +uniform float uAlpha; +uniform float uResolution; +uniform float uRadiusFactorInv; + +void main() { + vec2 v = gl_FragCoord.xy - vec2(uCurrentX, uCurrentY) - 0.5; + vec3 fragPos = vec3(v.x, v.y, uCurrentSlice); + float dist = distance(fragPos, vPosition) * uResolution; + + #if defined(dCalcType_density) + float density = exp(-uAlpha * ((dist * dist) * vRadiusSqInv)); + gl_FragColor.a = density * uRadiusFactorInv; + #elif defined(dCalcType_minDistance) + gl_FragColor.a = 1.0 - dist * uRadiusFactorInv; + #elif defined(dCalcType_groupId) + #if defined(dGridTexType_2d) + float minDistance = 1.0 - texture2D(tMinDistanceTex, (gl_FragCoord.xy) / (uGridTexDim.xy / uGridTexScale)).a; + #elif defined(dGridTexType_3d) + float minDistance = 1.0 - texelFetch(tMinDistanceTex, ivec3(gl_FragCoord.xy, uCurrentSlice), 0).a; + #endif + if (dist * uRadiusFactorInv > minDistance + uResolution * 0.05) + discard; + gl_FragColor.rgb = packIntToRGB(vGroup); + #endif +} +`;var Hje={drawCount:Mn("number"),instanceCount:Mn("number"),aRadius:nn("float32",1,0),aPosition:nn("float32",3,0),aGroup:nn("float32",1,0),uCurrentSlice:ye("f"),uCurrentX:ye("f"),uCurrentY:ye("f"),uBboxMin:ye("v3","material"),uBboxSize:ye("v3","material"),uGridDim:ye("v3","material"),uGridTexDim:ye("v3","material"),uGridTexScale:ye("v2","material"),uAlpha:ye("f","material"),uResolution:ye("f","material"),uRadiusFactorInv:ye("f","material"),tMinDistanceTex:Ct("texture","rgba","float","nearest","material"),dGridTexType:At("string",["2d","3d"]),dCalcType:At("string",["density","minDistance","groupId"])},Of="gaussian-density";function Dfe(e){return e.namedFramebuffers[Of]||(e.namedFramebuffers[Of]=e.resources.framebuffer()),e.namedFramebuffers[Of]}function kfe(e,t,r,n,o,i){let s=`${Of}-${e}`;return t.namedTextures[s]||(t.namedTextures[s]=t.resources.texture(r,n,o,i)),t.namedTextures[s]}function hz(e,t,r,n,o,i){return e.isWebGL2?jje(e,t,r,n,o,i):Tk(e,t,r,n,!1,o,i)}function Tk(e,t,r,n,o,i,s){ot&&e.timer.mark("GaussianDensityTexture2d");let a=Wje(e,t,r,n,o,i,s);return ot&&e.timer.markEnd("GaussianDensityTexture2d"),Mfe(a)}function jje(e,t,r,n,o,i){ot&&e.timer.mark("GaussianDensityTexture3d");let s=Yje(e,t,r,n,o,i);return ot&&e.timer.markEnd("GaussianDensityTexture3d"),Mfe(s)}function Mfe({texture:e,scale:t,bbox:r,gridDim:n,gridTexDim:o,gridTexScale:i,radiusFactor:s,resolution:a,maxRadius:l}){return{transform:qje(t,r),texture:e,bbox:r,gridDim:n,gridTexDim:o,gridTexScale:i,radiusFactor:s,resolution:a,maxRadius:l}}function qje(e,t){let r=ne.identity();return ne.fromScaling(r,e),ne.setTranslation(r,t.min),r}function Wje(e,t,r,n,o,i,s){let{gl:a,resources:l,state:c,extensions:{colorBufferFloat:u,textureFloat:d,colorBufferHalfFloat:m,textureHalfFloat:p,blendMinMax:h}}=e,{smoothness:f,resolution:y}=i,{drawCount:g,positions:v,radii:b,groups:S,scale:_,expandedBox:w,dim:E,maxRadius:A}=Bfe(t,r,n,i),[P,T,B]=E,{texDimX:D,texDimY:M,texCols:R,powerOfTwoSize:U}=Kje(E),F=x.create(D,M,0),N=Ae.create(D/U,M/U),z=A*2,q=o?U:D,O=o?U:M,J=kfe("min-dist-2d",e,"image-uint8","rgba","ubyte","nearest");J.define(q,O);let Q=Rfe(e,g,v,b,S,J,w,E,F,N,f,y,z),{uCurrentSlice:H,uCurrentX:W,uCurrentY:K}=Q.values,ce=Dfe(e);ce.bind(),Lfe(e),s||(s=m&&p?l.texture("image-float16","rgba","fp16","linear"):u&&d?l.texture("image-float32","rgba","float","linear"):l.texture("image-uint8","rgba","ubyte","linear")),s.define(q,O);function V(G,X){c.currentRenderItemId=-1,G.attachFramebuffer(ce,0),X&&(c.viewport(0,0,q,O),c.scissor(0,0,q,O),a.clear(a.COLOR_BUFFER_BIT)),I.update(K,0);let Z=0,ie=0,de=0;for(let we=0;we=R&&(Z-=R,ie+=T,de=0,I.update(K,ie)),I.update(W,de),I.update(H,we),c.viewport(de,ie,P,T),c.scissor(de,ie,P,T),Q.render(),++Z,de+=P;a.flush()}return Ofe(e,Q),V(s,!0),h&&(Ffe(e,Q),V(J,!0),Nfe(e,Q),V(s,!1)),{texture:s,scale:_,bbox:w,gridDim:E,gridTexDim:F,gridTexScale:N,radiusFactor:z,resolution:y,maxRadius:A}}function Yje(e,t,r,n,o,i){let{gl:s,resources:a,state:l,extensions:{colorBufferFloat:c,textureFloat:u,colorBufferHalfFloat:d,textureHalfFloat:m}}=e,{smoothness:p,resolution:h}=o,{drawCount:f,positions:y,radii:g,groups:v,scale:b,expandedBox:S,dim:_,maxRadius:w}=Bfe(t,r,n,o),[E,A,P]=_,T=kfe("min-dist-3d",e,"volume-uint8","rgba","ubyte","nearest");T.define(E,A,P);let B=Ae.create(1,1),D=w*2,M=Rfe(e,f,y,g,v,T,S,_,_,B,p,h,D),{uCurrentSlice:R}=M.values,U=Dfe(e);U.bind(),Lfe(e),l.viewport(0,0,E,A),l.scissor(0,0,E,A),i||(i=d&&m?a.texture("volume-float16","rgba","fp16","linear"):c&&u?a.texture("volume-float32","rgba","float","linear"):a.texture("volume-uint8","rgba","ubyte","linear")),i.define(E,A,P);function F(N,z){l.currentRenderItemId=-1;for(let q=0;q0?"3d":"2d"),I.updateIfChanged(h.dCalcType,"density"),e.namedComputeRenderables[Of].update()}else e.namedComputeRenderables[Of]=Xje(e,t,r,n,o,i,s,a,l,c,u,d,m);return e.namedComputeRenderables[Of]}function Xje(e,t,r,n,o,i,s,a,l,c,u,d,m){let p=x.sub(x(),s.max,s.min),h={drawCount:I.create(t),instanceCount:I.create(1),aRadius:I.create(n),aPosition:I.create(r),aGroup:I.create(o),uCurrentSlice:I.create(0),uCurrentX:I.create(0),uCurrentY:I.create(0),uBboxMin:I.create(s.min),uBboxSize:I.create(p),uGridDim:I.create(a),uGridTexDim:I.create(l),uGridTexScale:I.create(c),uAlpha:I.create(u),uResolution:I.create(d),uRadiusFactorInv:I.create(1/m),tMinDistanceTex:I.create(i),dGridTexType:I.create(i.getDepth()>0?"3d":"2d"),dCalcType:I.create("density")},f=k({},Hje),y=Rr(Of,Ife,Efe),g=Jr(e,"points",y,f,h);return en(g,h)}function Lfe(e){let{gl:t,state:r}=e;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)}function Ffe(e,t){let{gl:r,state:n}=e;if(I.update(t.values.dCalcType,"minDistance"),t.update(),n.colorMask(!1,!1,!1,!0),n.blendFunc(r.ONE,r.ONE),!e.extensions.blendMinMax)throw new Error("GPU gaussian surface calculation requires EXT_blend_minmax");n.blendEquation(e.extensions.blendMinMax.MAX)}function Ofe(e,t){let{gl:r,state:n}=e;I.update(t.values.dCalcType,"density"),t.update(),n.colorMask(!1,!1,!1,!0),n.blendFunc(r.ONE,r.ONE),n.blendEquation(r.FUNC_ADD)}function Nfe(e,t){let{gl:r,state:n}=e;I.update(t.values.dCalcType,"groupId"),t.update(),n.colorMask(!0,!0,!0,!1),n.blendFunc(r.ONE,r.ZERO),n.blendEquation(r.FUNC_ADD)}function Kje(e){let t=e[0]*e[1]*e[2],r=Math.sqrt(t),n=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))),o=0,i=e[1],s=1,a=e[2];return nO[ar]&&(O[ar]=It,P[ar]=p?p[G]:G)}}}}}}function W(){return Y(this,null,function*(){for(let ce=0;ceY(this,null,function*(){return yield gz(l,o,i.box,s,a)}))}function zfe(e,t,r,n,o,i){let{position:s,boundary:a,radius:l}=nS(e,t,r,n),c=bf(a.box,n,Ufe(o,e));return Pe.create("Gaussian Density",u=>Y(this,null,function*(){return hz(o,s,a.box,l,c,i)}))}function Vfe(e,t,r,n,o,i,s){let{position:a,boundary:l,radius:c}=nS(e,t,r,o),u=bf(l.box,o,Ufe(i,e));return Pe.create("Gaussian Density",d=>Y(this,null,function*(){return Tk(i,a,l.box,c,n,u,s)}))}function Gfe(e,t,r){let{position:n,boundary:o,radius:i}=oS(e,t,r),s=bf(o.box,r);return Pe.create("Gaussian Density",a=>Y(this,null,function*(){return yield gz(a,n,o.box,i,s)}))}function Hfe(e,t,r,n,o){let{position:i,boundary:s,radius:a}=oS(e,t,r),l=bf(s.box,r);return Pe.create("Gaussian Density",c=>Y(this,null,function*(){return hz(n,i,s.box,a,l,o)}))}function jfe(e,t,r,n,o,i){let{box:s}=e.lookup3d.boundary,{position:a,boundary:l,radius:c}=oS(e,t,n),u=bf(l.box,n);return Pe.create("Gaussian Density",d=>Y(this,null,function*(){return Tk(o,a,s,c,r,u,i)}))}var qfe=te(k(k({},by),IP),{ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),tryUseGpu:C.Boolean(!0),includeParent:C.Boolean(!1,{isHidden:!0})}),Ik=k(k(k({},zn),Bue),qfe),Wfe=k(k(k({},im),Pue),qfe);function Yfe(e){return e.extensions.colorBufferFloat&&e.extensions.textureFloat&&e.extensions.textureFloatLinear&&e.extensions.blendMinMax&&e.extensions.drawBuffers}function o2(e,t,r){if(t.resolution>1)return!1;let n=r.maxTextureSize/3,{areaCells:o,maxAreaCells:i}=Y6(e.boundary.box,t.resolution,n*n);return o{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&o2(t.structure,r,n),processValues:(t,r,n,o,i)=>{let{resolution:s,colorTexture:a}=r.meta,l=Tl(n.smoothColors,o.color.preferSmoothing,s);l&&(Pb(t,l.resolution,l.stride,i,a),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function $je(e,t,r,n,o){return Y(this,null,function*(){let{smoothness:i}=n,{transform:s,field:a,idField:l,radiusFactor:c,resolution:u,maxRadius:d}=yield Gfe(t,r.size,n).runInContext(e.runtime),m={isoLevel:Math.exp(-i)/c,scalarField:a,idField:l},p=yield mf(m,o).runAsChild(e.runtime);p.meta.resolution=u,dt.transform(p,s),e.webgl&&!e.webgl.isWebGL2?(dt.uniformTriangleGroup(p),I.updateIfChanged(p.varyingGroup,!1)):I.updateIfChanged(p.varyingGroup,!0);let h=ge.expand(ge(),t.boundary.sphere,d);return p.setBoundingSphere(h),p})}function Jje(e){return sl({defaultProps:C.getDefaultValues(Wfe),createGeometry:$je,createLocationIterator:Yo.fromStructure,getLoci:dm,eachLocation:um,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&o2(t,r,n),processValues:(t,r,n,o,i)=>{let{resolution:s,colorTexture:a}=r.meta,l=Tl(n.smoothColors,o.color.preferSmoothing,s);l&&(Pb(t,l.resolution,l.stride,i,a),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}var n2="gaussian-surface";function eqe(e,t,r,n,o,i){return Y(this,null,function*(){if(!e.webgl)throw new Error("webgl context required to create gaussian surface texture-mesh");ot&&e.webgl.timer.mark("createGaussianSurfaceTextureMesh");let{namedTextures:s,resources:a,extensions:{colorBufferFloat:l,textureFloat:c,colorBufferHalfFloat:u,textureHalfFloat:d}}=e.webgl;s[n2]||(s[n2]=u&&d?a.texture("image-float16","rgba","fp16","linear"):l&&c?a.texture("image-float32","rgba","float","linear"):a.texture("image-uint8","rgba","ubyte","linear"));let m=yield Vfe(r,t,n.size,!0,o,e.webgl,s[n2]).runInContext(e.runtime),p=Math.exp(-o.smoothness)/m.radiusFactor,h=x.create(0,1,2),f=i?.doubleBuffer.get(),y=Y1(e.webgl,m.texture,m.gridDim,m.gridTexDim,m.gridTexScale,m.transform,p,!1,!0,h,!0,f?.vertex,f?.group,f?.normal);ot&&e.webgl.timer.markEnd("createGaussianSurfaceTextureMesh");let g=t.elements.length,v=ge.expand(ge(),t.boundary.sphere,m.maxRadius),b=ms.create(y.vertexCount,g,y.vertexTexture,y.groupTexture,y.normalTexture,v,i);return b.meta.resolution=m.resolution,b.meta.webgl=e.webgl,b})}function tqe(e){return Rue({defaultProps:C.getDefaultValues(Ik),createGeometry:eqe,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!o2(t.structure,r,n),processValues:(t,r,n,o,i)=>{let{resolution:s,colorTexture:a}=r.meta,l=Tl(n.smoothColors,o.color.preferSmoothing,s);l&&i&&(fO(t,l.resolution,l.stride,i,a),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy(),(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function rqe(e,t,r,n,o){return Y(this,null,function*(){if(!e.webgl)throw new Error("webgl context required to create structure gaussian surface texture-mesh");ot&&e.webgl.timer.mark("createStructureGaussianSurfaceTextureMesh");let{namedTextures:i,resources:s,extensions:{colorBufferFloat:a,textureFloat:l,colorBufferHalfFloat:c,textureHalfFloat:u}}=e.webgl;i[n2]||(i[n2]=c&&u?s.texture("image-float16","rgba","fp16","linear"):a&&l?s.texture("image-float32","rgba","float","linear"):s.texture("image-uint8","rgba","ubyte","linear"));let d=yield jfe(t,r.size,!0,n,e.webgl,i[n2]).runInContext(e.runtime),m=Math.exp(-n.smoothness)/d.radiusFactor,p=x.create(0,1,2),h=o?.doubleBuffer.get(),f=Y1(e.webgl,d.texture,d.gridDim,d.gridTexDim,d.gridTexScale,d.transform,m,!1,!0,p,!0,h?.vertex,h?.group,h?.normal);ot&&e.webgl.timer.markEnd("createStructureGaussianSurfaceTextureMesh");let y=t.elementCount,g=ge.expand(ge(),t.boundary.sphere,d.maxRadius),v=ms.create(f.vertexCount,y,f.vertexTexture,f.groupTexture,f.normalTexture,g,o);return v.meta.resolution=d.resolution,v.meta.webgl=e.webgl,v})}function nqe(e){return Iue({defaultProps:C.getDefaultValues(Wfe),createGeometry:rqe,createLocationIterator:Yo.fromStructure,getLoci:dm,eachLocation:um,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!o2(t,r,n),processValues:(t,r,n,o,i)=>{let{resolution:s,colorTexture:a}=r.meta,l=Tl(n.smoothColors,o.color.preferSmoothing,s);l&&i&&(fO(t,l.resolution,l.stride,i,a),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy(),(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function oqe(e,t,r,n,o,i){return Y(this,null,function*(){let{smoothness:s}=o,{transform:a,field:l,idField:c,maxRadius:u}=yield Pk(r,t,n.size,o).runInContext(e.runtime),d={isoLevel:Math.exp(-s),scalarField:l,idField:c},m=yield zb(d,i).runAsChild(e.runtime);hn.transform(m,a);let p=ge.expand(ge(),t.boundary.sphere,u);return m.setBoundingSphere(p),m})}var yz=te(k(k({},$0),by),{sizeFactor:C.Numeric(3,{min:0,max:10,step:.1}),lineSizeAttenuation:C.Boolean(!1),ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),includeParent:C.Boolean(!1,{isHidden:!0})});function Qfe(e){return J0({defaultProps:C.getDefaultValues(yz),createGeometry:oqe,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)}},e)}var Zfe={"gaussian-surface-mesh":(e,t)=>Tn("Gaussian surface mesh",e,t,Xfe),"structure-gaussian-surface-mesh":(e,t)=>Ni("Structure-Gaussian surface mesh",e,t,Kfe),"gaussian-surface-wireframe":(e,t)=>Tn("Gaussian surface wireframe",e,t,Qfe)},$fe=te(k(k({},Ik),yz),{visuals:C.MultiSelect(["gaussian-surface-mesh"],C.objectToOptions(Zfe)),bumpFrequency:C.Numeric(1,{min:0,max:10,step:.1},We.ShadingCategory)});function iqe(e,t){return $fe}function sqe(e,t){return Nt.createMulti("Gaussian Surface",e,t,Yn,Zfe)}var Jfe={name:"gaussian-surface",label:"Gaussian Surface",description:"Displays a gaussian molecular surface.",factory:sqe,getParams:iqe,defaultValues:C.getDefaultValues($fe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0};var vz=te(k({},_ue),{background:C.Boolean(!1),backgroundMargin:C.Numeric(0,{min:0,max:1,step:.01}),backgroundColor:C.Color(Yt.black),backgroundOpacity:C.Numeric(.5,{min:0,max:1,step:.01}),borderWidth:C.Numeric(.25,{min:0,max:.5,step:.01}),level:C.Select("residue",[["chain","Chain"],["residue","Residue"],["element","Element"]],{isEssential:!0}),ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),chainScale:C.Numeric(10,{min:0,max:20,step:.1}),residueScale:C.Numeric(1,{min:0,max:20,step:.1}),elementScale:C.Numeric(.5,{min:0,max:20,step:.1})});function ehe(e){return wue({defaultProps:C.getDefaultValues(vz),createGeometry:aqe,createLocationIterator:Yo.fromStructure,getLoci:dm,eachLocation:um,setUpdateState:(t,r,n)=>{t.createGeometry=r.level!==n.level||r.level==="chain"&&r.chainScale!==n.chainScale||r.level==="residue"&&r.residueScale!==n.residueScale||r.level==="element"&&r.elementScale!==n.elementScale||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant}},e)}function aqe(e,t,r,n,o){switch(n.level){case"chain":return lqe(e,t,r,n,o);case"residue":return cqe(e,t,r,n,o);case"element":return uqe(e,t,r,n,o)}}var Im=x(),Vw=new ki("98");function lqe(e,t,r,n,o){let i=$.Location.create(t),{units:s,serialMapping:a}=t,{auth_asym_id:l,label_asym_id:c}=Ne.chain,{cumulativeUnitElementCount:u}=a,d=s.length,{chainScale:m}=n,p=Kl.create(n,d,d/2,o);for(let h=0,f=s.length;hNi("Label text",e,t,ehe)},rhe=te(k({},vz),{visuals:C.MultiSelect(["label-text"],C.objectToOptions(the))});function dqe(e,t){return rhe}function mqe(e,t){let r=Nt.createMulti("Label",e,t,Yn,the);return r.setState({pickable:!1,markerActions:Ft.None}),r}var nhe={name:"label",label:"Label",description:"Displays labels.",factory:mqe,getParams:dqe,defaultValues:C.getDefaultValues(rhe),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0};function pqe(e,t){return e[0]=e[1]=e[2]=1,t[0]!==0?e[0]=(t[1]+t[2])/-t[0]:t[1]!==0?e[1]=(t[0]+t[2])/-t[1]:t[2]!==0&&(e[2]=(t[0]+t[1])/-t[2]),e}function fqe(e){let t=0,r=2*Math.PI/e,n=new Float32Array(e),o=new Float32Array(e);for(let i=0;i0&&hcY(this,null,function*(){return yield she(l,o,i,s,i.box,a)}))}function gqe(e,t,r){let{probeRadius:n}=r,{position:o,boundary:i,radius:s}=oS(e,t,r),{indices:a}=o,l=Te.size(a),c=new Float32Array(Te.end(a)),u=0;for(let d=0;dY(this,null,function*(){return yield she(a,n,o,i,o.box,s)}))}function she(e,t,r,n,o,i){return Y(this,null,function*(){return ohe(e,t,r,n,o,i)})}var Dk=k(k(k(k({},zn),Gw),ov),IP);function yqe(e,t,r,n,o,i){return Y(this,null,function*(){let{transform:s,field:a,idField:l,resolution:c,maxRadius:u}=yield Ek(r,t,n.size,o).runInContext(e.runtime),d={isoLevel:o.probeRadius,scalarField:a,idField:l},m=yield mf(d,i).runAsChild(e.runtime);if(o.includeParent){let h=Math.ceil(2/o.resolution);dt.smoothEdges(m,{iterations:h,maxNewEdgeLength:Math.sqrt(2)})}dt.transform(m,s),e.webgl&&!e.webgl.isWebGL2?(dt.uniformTriangleGroup(m),I.updateIfChanged(m.varyingGroup,!1)):I.updateIfChanged(m.varyingGroup,!0);let p=ge.expand(ge(),t.boundary.sphere,u);return m.setBoundingSphere(p),m.meta.resolution=c,m})}function ahe(e){return no({defaultProps:C.getDefaultValues(Dk),createGeometry:yqe,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},processValues:(t,r,n,o,i)=>{let{resolution:s,colorTexture:a}=r.meta,l=Tl(n.smoothColors,o.color.preferSmoothing,s);l&&(Pb(t,l.resolution,l.stride,i,a),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function vqe(e,t,r,n,o){return Y(this,null,function*(){let{transform:i,field:s,idField:a,resolution:l,maxRadius:c}=yield ihe(t,r.size,n).runInContext(e.runtime),u={isoLevel:n.probeRadius,scalarField:s,idField:a},d=yield mf(u,o).runAsChild(e.runtime);if(n.includeParent){let p=Math.ceil(2/n.resolution);dt.smoothEdges(d,{iterations:p,maxNewEdgeLength:Math.sqrt(2)})}dt.transform(d,i),e.webgl&&!e.webgl.isWebGL2?(dt.uniformTriangleGroup(d),I.updateIfChanged(d.varyingGroup,!1)):I.updateIfChanged(d.varyingGroup,!0);let m=ge.expand(ge(),t.boundary.sphere,c);return d.setBoundingSphere(m),d.meta.resolution=l,d})}function lhe(e){return sl({defaultProps:C.getDefaultValues(Dk),createGeometry:vqe,createLocationIterator:Yo.fromStructure,getLoci:dm,eachLocation:um,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},processValues:(t,r,n,o,i)=>{let{resolution:s,colorTexture:a}=r.meta,l=Tl(n.smoothColors,o.color.preferSmoothing,s);l&&(Pb(t,l.resolution,l.stride,i,a),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}var xz=te(k(k(k({},$0),Gw),ov),{sizeFactor:C.Numeric(1.5,{min:0,max:10,step:.1})});function xqe(e,t,r,n,o,i){return Y(this,null,function*(){let{transform:s,field:a,idField:l,maxRadius:c}=yield Ek(r,t,n.size,o).runInContext(e.runtime),u={isoLevel:o.probeRadius,scalarField:a,idField:l},d=yield zb(u,i).runAsChild(e.runtime);hn.transform(d,s);let m=ge.expand(ge(),t.boundary.sphere,c);return d.setBoundingSphere(m),d})}function che(e){return J0({defaultProps:C.getDefaultValues(xz),createGeometry:xqe,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)}},e)}var uhe={"molecular-surface-mesh":(e,t)=>Tn("Molecular surface mesh",e,t,ahe),"structure-molecular-surface-mesh":(e,t)=>Ni("Structure Molecular surface mesh",e,t,lhe),"molecular-surface-wireframe":(e,t)=>Tn("Molecular surface wireframe",e,t,che)},dhe=te(k(k({},Dk),xz),{visuals:C.MultiSelect(["molecular-surface-mesh"],C.objectToOptions(uhe)),bumpFrequency:C.Numeric(1,{min:0,max:10,step:.1},We.ShadingCategory)});function bqe(e,t){return dhe}function Sqe(e,t){return Nt.createMulti("Molecular Surface",e,t,Yn,uhe)}var mhe={name:"molecular-surface",label:"Molecular Surface",description:"Displays a molecular surface.",factory:Sqe,getParams:bqe,defaultValues:C.getDefaultValues(dhe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0};var bz=te(k({},zn),{sizeFactor:C.Numeric(1,{min:0,max:2,step:.1}),detail:C.Numeric(0,{min:0,max:3,step:1},We.CustomQualityParamInfo)});function phe(e){return no({defaultProps:C.getDefaultValues(bz),createGeometry:_qe,createLocationIterator:wqe,getLoci:Aqe,eachLocation:Tqe,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail}},e)}function Cqe(e){if(_e.Traits.is(e.traits,_e.Trait.MultiChain)||_e.Traits.is(e.traits,_e.Trait.Partitioned))return!1;if(_e.isCoarse(e))return!0;if(e.elements.length===0)return!1;e.model.atomicHierarchy.derived.residue.moleculeType;let t=e.residueIndex[e.elements[0]],r=e.model.atomicHierarchy.derived.residue.moleculeType[t];return!(r===3||r===2)}function _qe(e,t,r,n,o,i){if(!Cqe(t))return dt.createEmpty(i);let{detail:s,sizeFactor:a}=o,l=256,c=rt.createState(l,l/2,i),u=t.principalAxes.boxAxes,{origin:d,dirA:m,dirB:p}=u,h=Ei.size(x(),u);x.scale(h,h,a/2);let f=x.create(h[2],h[1],h[0]);c.currentGroup=0,Nb(c,d,m,p,f,s+1);let y=rt.getMesh(c),g=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return y.setBoundingSphere(g),y}function wqe(e){let{group:t,structure:r}=e,n=1,o=t.units.length,i=$.Location.create(r);return Pr(n,o,1,(a,l)=>{let c=t.units[l];return i.unit=c,i.element=c.elements[a],i})}function Aqe(e,t,r){let{objectId:n,instanceId:o}=e;if(r===n){let{structure:i,group:s}=t,a=s.units[o],l=Te.ofBounds(0,a.elements.length);return $.Loci(i,[{unit:a,indices:l}])}return nr}function Tqe(e,t,r){let n=!1;if(!$.Loci.is(e))return!1;let{structure:o,group:i}=t;if(!Me.areEquivalent(e.structure,o))return!1;let s=i.elements.length;for(let a of e.elements){let l=i.unitIndexMap.get(a.unit.id);l!==void 0&&Te.size(a.indices)===s&&r(ve.ofSingleton(l))&&(n=!0)}return n}var fhe={"orientation-ellipsoid-mesh":(e,t)=>Tn("Orientation ellipsoid mesh",e,t,phe)},hhe=te(k({},bz),{visuals:C.MultiSelect(["orientation-ellipsoid-mesh"],C.objectToOptions(fhe)),bumpFrequency:C.Numeric(1,{min:0,max:10,step:.1},We.ShadingCategory)});function Pqe(e,t){return hhe}function Iqe(e,t){return Nt.createMulti("Orientation",e,t,Yn,fhe)}var ghe={name:"orientation",label:"Orientation",description:"Displays orientation ellipsoids for polymer chains.",factory:Iqe,getParams:Pqe,defaultValues:C.getDefaultValues(hhe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0};var Eqe=je.add3,Dqe=je.add,kk;(function(e){function t(r=2048,n=1024,o){let i=je.create(Float32Array,3,n,o?o.centerBuffer.ref.value:r),s=je.create(Float32Array,1,n,o?o.groupBuffer.ref.value:r);return{add:(a,l,c,u)=>{Eqe(i,a,l,c),Dqe(s,u)},getPoints:()=>{let a=je.compact(i,!0),l=je.compact(s,!0);return su.create(a,l,i.elementCount,o)}}}e.create=t})(kk||(kk={}));var yhe=x.add,Hw=te(k({},Eue),{pointSizeAttenuation:C.Boolean(!1),ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),traceOnly:C.Boolean(!1),stride:C.Numeric(1,{min:1,max:100,step:1})});function kqe(e,t,r,n,o,i){let{child:s}=r;if(s&&!s.unitMap.get(t.id))return su.createEmpty(i);let a=t.elements,l=a.length,c=kk.create(l,l/10,i),u=x(),d=t.conformation,m=Pf(r,t,o),p=x(),h=0;if(m)for(let v=0;v{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride}},e)}var Mqe={"element-point":(e,t)=>Tn("Points",e,t,Mk)},vhe=k({},Hw);function Bqe(e,t){return vhe}function Rqe(e,t){return Nt.createMulti("Point",e,t,Yn,Mqe)}var xhe={name:"point",label:"Point",description:"Displays elements (atoms, coarse spheres) as points.",factory:Rqe,getParams:Bqe,defaultValues:C.getDefaultValues(vhe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0};var bhe={sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01}),detail:C.Numeric(0,{min:0,max:3,step:1},We.CustomQualityParamInfo),linearSegments:C.Numeric(8,{min:1,max:48,step:1},We.CustomQualityParamInfo),radialSegments:C.Numeric(16,{min:2,max:56,step:2},We.CustomQualityParamInfo)},ODr=C.getDefaultValues(bhe),wu=x();function Lqe(e,t,r,n,o,i){let s=t.polymerElements.length;if(!s)return dt.createEmpty(i);let{sizeFactor:a,detail:l,linearSegments:c,radialSegments:u}=o,d=c*u*s+(u+1)*s*2,m=rt.createState(d,d/10,i),p=MS(c),{curvePoints:h,normalVectors:f,binormalVectors:y,widthValues:g,heightValues:v}=p,b=0,S=IS(t,r,{ignoreSecondaryStructure:!0});for(;S.hasNext;){let E=S.move();m.currentGroup=b;let P=xi(E.moleculeType)?xv:vv;BS(p,E,tk,P);let T=E.coarseBackboneFirst||E.first,B=E.coarseBackboneLast||E.last,D=n.size.size(E.centerPrev)*a,M=n.size.size(E.center)*a,R=n.size.size(E.centerNext)*a;Fw(p,D,M,R,D,M,R,P);let U=c;if(E.initial){U=Math.max(Math.round(c*P),1);let F=c-U;h.copyWithin(0,F*3),y.copyWithin(0,F*3),f.copyWithin(0,F*3),g.copyWithin(0,F*3),v.copyWithin(0,F*3),x.fromArray(wu,h,3),x.normalize(wu,x.sub(wu,E.p2,wu)),x.scaleAndAdd(wu,E.p2,wu,M*RS),x.toArray(wu,h,0)}else E.final&&(U=Math.max(Math.round(c*(1-P)),1),x.fromArray(wu,h,U*3-3),x.normalize(wu,x.sub(wu,E.p2,wu)),x.scaleAndAdd(wu,E.p2,wu,M*RS),x.toArray(wu,h,U*3));E.initial===!0&&E.final===!0?Nr(m,E.p2,M*2,l):u===2?r2(m,h,f,y,U,g,v,0):u===4?e2(m,h,f,y,U,g,v,0,T,B):Uw(m,h,f,y,U,u,g,v,T,B,"elliptical"),++b}let _=rt.getMesh(m),w=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return _.setBoundingSphere(w),_}var Sz=k(k({},zn),bhe);function She(e){return no({defaultProps:C.getDefaultValues(Sz),createGeometry:Lqe,createLocationIterator:t=>bu.fromGroup(t,{asSecondary:!0}),getLoci:mm,eachLocation:pm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail||r.linearSegments!==n.linearSegments||r.radialSegments!==n.radialSegments}},e)}var Che={"polymer-tube":(e,t)=>Tn("Polymer tube mesh",e,t,She),"polymer-gap":(e,t)=>Tn("Polymer gap cylinder",e,t,$S)},_he=te(k(k({},Sz),_v),{sizeFactor:C.Numeric(.2,{min:0,max:10,step:.01}),visuals:C.MultiSelect(["polymer-tube","polymer-gap"],C.objectToOptions(Che)),bumpFrequency:C.Numeric(2,{min:0,max:10,step:.1},We.ShadingCategory)});function Fqe(e,t){let r=C.clone(_he),n=!1,o=!1;return t.units.forEach(i=>{!n&&_e.isAtomic(i)&&i.nucleotideElements.length&&(n=!0),!o&&i.gapElements.length&&(o=!0)}),r.visuals.defaultValue=["polymer-tube"],o&&r.visuals.defaultValue.push("polymer-gap"),r}function Oqe(e,t){return Nt.createMulti("Putty",e,t,Yn,Che)}var whe={name:"putty",label:"Putty",description:"Displays a tube smoothly following the trace atoms of polymers.",factory:Oqe,getParams:Fqe,defaultValues:C.getDefaultValues(_he),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uncertainty"},isApplicable:e=>e.polymerResidueCount>0};var Ahe={"element-sphere":(e,t)=>Tn("Sphere mesh/impostor",e,t,XD),"structure-element-sphere":(e,t)=>Ni("Structure sphere mesh/impostor",e,t,ope)},Cz=te(k({},PS),{bumpFrequency:C.Numeric(1,{min:0,max:10,step:.1},We.ShadingCategory),visuals:C.MultiSelect(["element-sphere"],C.objectToOptions(Ahe))}),Bk;function Nqe(e,t){return t.isCoarseGrained?(Bk||(Bk=C.clone(Cz),Bk.sizeFactor.defaultValue=2),Bk):Cz}function Uqe(e,t){return Nt.createMulti("Spacefill",e,t,Yn,Ahe)}var The={name:"spacefill",label:"Spacefill",description:"Displays atomic/coarse elements as spheres.",factory:Uqe,getParams:Nqe,defaultValues:C.getDefaultValues(Cz),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0};var _z=Er.is;function zqe(e,t,r,n,o,i){if(!_e.isAtomic(t))return hn.createEmpty(i);let{child:s}=r,a=s?.unitMap.get(t.id);if(s&&!a)return hn.createEmpty(i);let l=$.Location.create(r,t),c=t.elements,u=t.bonds,{edgeCount:d,a:m,b:p,edgeProps:h,offset:f}=u;if(!d)return hn.createEmpty(i);let{order:y,flags:g}=h,{sizeFactor:v,aromaticBonds:b,includeTypes:S,excludeTypes:_,multipleBonds:w}=o,E=w==="off",A=w==="symmetric",P=Er.fromNames(S),T=Er.fromNames(_),B=_S(P,T,32),D=x(),M=t.conformation,{elementRingIndices:R,elementAromaticRingIndices:U}=t.rings,F=b?t.resonance.delocalizedTriplets:void 0,N={linkCount:d*2,referencePosition:O=>{let J=m[O],Q=p[O],H=F?.getThirdElement(J,Q);if(H!==void 0)return M.invariantPosition(c[H],D);J>Q&&([J,Q]=[Q,J]),f[J+1]-f[J]===1&&([J,Q]=[Q,J]);let W=U.get(J)||R.get(J),K=0;for(let ce=f[J],V=f[J+1];ceK&&(K=Z,M.invariantPosition(c[G],D))}else return M.invariantPosition(c[G],D)}return K>0?D:null},position:(O,J,Q)=>{M.invariantPosition(c[m[Q]],O),M.invariantPosition(c[p[Q]],J)},style:O=>{let J=y[O],Q=g[O];if(_z(Q,2)||_z(Q,4))return 1;if(J===3)return E?0:A?4:5;if(b){let H=m[O],W=p[O],K=U.get(H),ce=U.get(W),V=K&&ce?ax(K,ce):0;if(_z(Q,16)||V&&!B)return V===2?8:7}return J!==2||E?0:A?2:3},radius:O=>{l.element=c[m[O]];let J=n.size.size(l);l.element=c[p[O]];let Q=n.size.size(l);return Math.min(J,Q)*v},ignore:jD(r,t,o)},{lines:z,boundingSphere:q}=ZE(e,N,o,i);if(q)z.setBoundingSphere(q);else if(z.lineCount>0){let O=ge.expand(ge(),(a??t).boundary.sphere,1*v);z.setBoundingSphere(O)}return z}var wz=te(k(k({},$0),Iw),{includeParent:C.Boolean(!1)});function Phe(e){return J0({defaultProps:C.getDefaultValues(wz),createGeometry:zqe,createLocationIterator:t=>cm.fromGroup(t),getLoci:Ew,eachLocation:Dw,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!Ls(r.includeTypes,n.includeTypes)||!Ls(r.excludeTypes,n.excludeTypes)||r.aromaticBonds!==n.aromaticBonds||r.multipleBonds!==n.multipleBonds;let l=s.group.units[0],c=a.group.units[0];_e.isAtomic(l)&&_e.isAtomic(c)&&(ls.areEqual(l.bonds,c.bonds)||(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0))}},e)}var Az=new yt.ElementBondIterator;function Ihe(e,t,r,n){for(Az.setElement(t,r,n);Az.hasNext;){let o=Az.move();return o.otherUnit.conformation.position(o.otherUnit.elements[o.otherIndex],e),e}return null}function Vqe(e,t,r,n,o){let i=t.interUnitBonds,{edgeCount:s,edges:a}=i;if(!s)return hn.createEmpty(o);let{sizeFactor:l,aromaticBonds:c,multipleBonds:u}=n,d=u==="off",m=u==="symmetric",p=x(),h=$.Location.create(),f={linkCount:s,referencePosition:v=>{let b=a[v],S,_,w,E;if(b.unitAb.unitB)S=t.unitMap.get(b.unitB),_=t.unitMap.get(b.unitA),w=b.indexB,E=b.indexA;else throw new Error("same units in createInterUnitBondLines");return Ihe(p,t,S,w)||Ihe(p,t,_,E)},position:(v,b,S)=>{let _=a[S],w=t.unitMap.get(_.unitA),E=t.unitMap.get(_.unitB);w.conformation.position(w.elements[_.indexA],v),E.conformation.position(E.elements[_.indexB],b)},style:v=>{let b=a[v].props.order,S=gi.create(a[v].props.flag);return Er.is(S,2)||Er.is(S,4)?1:b===3?d?0:m?4:5:c&&Er.is(S,16)?7:b!==2||d?0:m?2:3},radius:v=>{let b=a[v];h.structure=t,h.unit=t.unitMap.get(b.unitA),h.element=h.unit.elements[b.indexA];let S=r.size.size(h);h.unit=t.unitMap.get(b.unitB),h.element=h.unit.elements[b.indexB];let _=r.size.size(h);return Math.min(S,_)*l},ignore:qD(t,n)},{lines:y,boundingSphere:g}=ZE(e,f,n,o);if(g)y.setBoundingSphere(g);else if(y.lineCount>0){let{child:v}=t,b=ge.expand(ge(),(v??t).boundary.sphere,1*l);y.setBoundingSphere(b)}return y}var Tz=te(k(k({},Sue),Iw),{includeParent:C.Boolean(!1)});function Ehe(e){return Cue({defaultProps:C.getDefaultValues(Tz),createGeometry:Vqe,createLocationIterator:t=>cm.fromStructure(t),getLoci:kw,eachLocation:Mw,setUpdateState:(t,r,n,o,i,s,a)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!Ls(r.includeTypes,n.includeTypes)||!Ls(r.excludeTypes,n.excludeTypes)||r.multipleBonds!==n.multipleBonds,s.interUnitBonds!==a.interUnitBonds&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0)}},e)}var i2=x.scaleAndAdd,Dhe=x.unitX,khe=x.unitY,Mhe=x.unitZ,Pz=te(k({},$0),{lineSizeAttenuation:C.Boolean(!1),ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),traceOnly:C.Boolean(!1),crosses:C.Select("lone",C.arrayToOptions(["lone","all"])),crossSize:C.Numeric(.35,{min:0,max:2,step:.01})});function Gqe(e,t,r,n,o,i){let{child:s}=r;if(s&&!s.unitMap.get(t.id))return hn.createEmpty(i);let a=t.elements,l=a.length,c=Gs.create(l,l/10,i),u=x(),d=x(),m=x(),p=t.conformation,h=Pf(r,t,o),f=o.crossSize/2,y=o.crosses==="lone";for(let b=0;b{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.crosses!==n.crosses||r.crossSize!==n.crossSize}},e)}var Rhe={"intra-bond":(e,t)=>Tn("Intra-unit bond line",e,t,Phe),"inter-bond":(e,t)=>Ni("Inter-unit bond line",e,t,Ehe),"element-point":(e,t)=>Tn("Points",e,t,Mk),"element-cross":(e,t)=>Tn("Crosses",e,t,Bhe)},Iz=te(k(k(k(k({},wz),Tz),Hw),Pz),{pointStyle:C.Select("circle",C.objectToOptions(su.StyleTypes)),multipleBonds:C.Select("offset",C.arrayToOptions(["off","symmetric","offset"])),includeParent:C.Boolean(!1),sizeFactor:C.Numeric(2,{min:.01,max:10,step:.01}),unitKinds:Vh(["atomic"]),visuals:C.MultiSelect(["intra-bond","inter-bond","element-point","element-cross"],C.objectToOptions(Rhe))});function Hqe(e,t){if(Me.getSize(t)>=Me.Size.Huge){let n=C.clone(Iz);return n.visuals.defaultValue=["intra-bond","element-point","element-cross"],n}else return Iz}function jqe(e,t){return Nt.createMulti("Line",e,t,Yn,Rhe)}var Lhe={name:"line",label:"Line",description:"Displays bonds as lines and atoms as points or croses.",factory:jqe,getParams:Hqe,defaultValues:C.getDefaultValues(Iz),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0,getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent};function qqe(e,t,r,n,o){return Y(this,null,function*(){let{runtime:i,webgl:s}=e;if(!s||!s.extensions.blendMinMax)throw new Error("GaussianDensityVolume requires `webgl` and `blendMinMax` extension");let a=o?o.gridTexture.ref.value:void 0,l=yield Hfe(t,r.size,n,s,a).runInContext(i),{transform:c,texture:u,bbox:d,gridDim:m}=l,p={min:0,max:1,mean:.04,sigma:.01},h=ne.mul(ne(),c,ne.fromScaling(ne(),m)),f=ne.getScaling(x(),c),y=x.create(0,1,2),g=Aa.create(d,m,c,h,f,u,p,!0,y,o),v=ge.expand(ge(),t.boundary.sphere,l.maxRadius);return g.setBoundingSphere(v),g})}var Ez=te(k(k({},Aue),by),{ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),includeParent:C.Boolean(!1,{isHidden:!0})});function Fhe(e){return Tue({defaultProps:C.getDefaultValues(Ez),createGeometry:qqe,createLocationIterator:Yo.fromStructure,getLoci:dm,eachLocation:um,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)},dispose:t=>{t.gridTexture.ref.value.destroy()}},e)}function Wqe(e,t,r,n,o,i){return Y(this,null,function*(){let{runtime:s,webgl:a}=e;if(!a)throw new Error("GaussianDensityVolume requires `webgl`");let l=i?i.gridTexture.ref.value:void 0,c=yield zfe(r,t,n.size,o,a,l).runInContext(s),{transform:u,texture:d,bbox:m,gridDim:p}=c,h={min:0,max:1,mean:.04,sigma:.01},f=ne.mul(ne(),u,ne.fromScaling(ne(),p)),y=ne.getScaling(x(),u),g=x.create(0,1,2),v=Aa.create(m,p,u,f,y,d,h,!0,g,i),b=ge.expand(ge(),t.boundary.sphere,c.maxRadius);return v.setBoundingSphere(b),v})}var Yqe=te(k(k({},kue),by),{ignoreHydrogens:C.Boolean(!1),ignoreHydrogensVariant:C.Select("all",C.arrayToOptions(["all","non-polar"])),includeParent:C.Boolean(!1,{isHidden:!0})});function Ohe(e){return Mue({defaultProps:C.getDefaultValues(Yqe),createGeometry:Wqe,createLocationIterator:Yo.fromGroup,getLoci:ma,eachLocation:da,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)},dispose:t=>{t.gridTexture.ref.value.destroy()}},e)}var Nhe={"gaussian-volume":(e,t)=>Ni("Gaussian volume",e,t,Fhe),"units-gaussian-volume":(e,t)=>Tn("Units-Gaussian volume",e,t,Ohe)},Uhe=te(k({},Ez),{jumpLength:C.Numeric(4,{min:0,max:20,step:.1}),visuals:C.MultiSelect(["gaussian-volume"],C.objectToOptions(Nhe))});function Xqe(e,t){return Uhe}function Kqe(e,t){return Nt.createMulti("Gaussian Volume",e,t,Yn,Nhe)}var zhe={name:"gaussian-volume",label:"Gaussian Volume",description:"Displays a gaussian molecular density using direct volume rendering.",factory:Kqe,getParams:Xqe,defaultValues:C.getDefaultValues(Uhe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0};var Qqe=x.scale,Zqe=x.add,$qe=x.sub,Rk=te(k(k({},zn),aS),{sizeFactor:C.Numeric(.3,{min:0,max:10,step:.01}),radialSegments:C.Numeric(16,{min:2,max:56,step:2},We.CustomQualityParamInfo),tryUseImpostor:C.Boolean(!0)});function Vhe(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth?eWe(e):rWe(e)}function Jqe(e,t,r,n,o,i){let s=t.polymerElements.length;if(!s)return Li.createEmpty(i);let a=s*2,l=ey.create(a,a/4,i),c=t.conformation,u=x(),d=x(),m=x();M8(t,function(y,g,v,b,S){c.invariantPosition(y,u),c.invariantPosition(g,d);let w=xi(S)?xv:vv;Zqe(m,u,Qqe(m,$qe(m,d,u),w)),l.add(u[0],u[1],u[2],m[0],m[1],m[2],1,!1,!1,2,v),l.add(m[0],m[1],m[2],d[0],d[1],d[2],1,!1,!1,2,b)});let h=l.getCylinders(),f=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return h.setBoundingSphere(f),h}function eWe(e){return lS({defaultProps:C.getDefaultValues(Rk),createGeometry:Jqe,createLocationIterator:t=>bu.fromGroup(t),getLoci:mm,eachLocation:pm,setUpdateState:(t,r,n)=>{},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function tWe(e,t,r,n,o,i){let s=t.polymerElements.length;if(!s)return dt.createEmpty(i);let{radialSegments:a,sizeFactor:l}=o,c=a*2*s*2,u=rt.createState(c,c/10,i),d=t.conformation,m=x(),p=x(),h={radiusTop:1,radiusBottom:1,radialSegments:a},f=$.Location.create(r,t),y=$.Location.create(r,t);M8(t,function(S,_,w,E,A){f.element=S,y.element=_,d.invariantPosition(f.element,m),d.invariantPosition(y.element,p);let T=xi(A)?xv:vv;h.radiusTop=h.radiusBottom=n.size.size(f)*l,u.currentGroup=w,Gr(u,m,p,T,h),h.radiusTop=h.radiusBottom=n.size.size(y)*l,u.currentGroup=E,Gr(u,p,m,1-T,h)});let v=rt.getMesh(u),b=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return v.setBoundingSphere(b),v}function rWe(e){return no({defaultProps:C.getDefaultValues(Rk),createGeometry:tWe,createLocationIterator:t=>bu.fromGroup(t),getLoci:mm,eachLocation:pm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.radialSegments!==n.radialSegments},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var Lk=te(k(k({},zn),iS),{sizeFactor:C.Numeric(.3,{min:0,max:10,step:.01}),detail:C.Numeric(0,{min:0,max:3,step:1},We.CustomQualityParamInfo),tryUseImpostor:C.Boolean(!0)});function Ghe(e,t,r,n){return r.tryUseImpostor&&n&&n.extensions.fragDepth&&n.extensions.textureFloat?oWe(e):sWe(e)}function nWe(e,t,r,n,o,i){let s=t.polymerElements.length;if(!s)return aa.createEmpty(i);let a=Kh.create(s,s/2,i),l=t.conformation,c=x();B8(t,(p,h)=>{l.invariantPosition(p,c),a.add(c[0],c[1],c[2],h)});let d=a.getSpheres(),m=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return d.setBoundingSphere(m),d}function oWe(e){return sS({defaultProps:C.getDefaultValues(Lk),createGeometry:nWe,createLocationIterator:t=>bu.fromGroup(t),getLoci:mm,eachLocation:pm,setUpdateState:(t,r,n)=>{},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function iWe(e,t,r,n,o,i){let s=t.polymerElements.length;if(!s)return dt.createEmpty(i);let{detail:a,sizeFactor:l}=o,c=s*sp(a),u=rt.createState(c,c/2,i),d=t.conformation,m=x(),p=$.Location.create(r,t);B8(t,(g,v)=>{p.element=g,d.invariantPosition(p.element,m),u.currentGroup=v,Nr(u,m,n.size.size(p)*l,a)});let f=rt.getMesh(u),y=ge.expand(ge(),t.boundary.sphere,1*o.sizeFactor);return f.setBoundingSphere(y),f}function sWe(e){return no({defaultProps:C.getDefaultValues(Lk),createGeometry:iWe,createLocationIterator:t=>bu.fromGroup(t),getLoci:mm,eachLocation:pm,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var Hhe={"polymer-backbone-cylinder":(e,t)=>Tn("Polymer backbone cylinder",e,t,Vhe),"polymer-backbone-sphere":(e,t)=>Tn("Polymer backbone sphere",e,t,Ghe),"polymer-gap":(e,t)=>Tn("Polymer gap cylinder",e,t,$S)},jhe=te(k(k(k({},Lk),Rk),_v),{sizeAspectRatio:C.Numeric(1,{min:.1,max:3,step:.1}),visuals:C.MultiSelect(["polymer-backbone-cylinder","polymer-backbone-sphere","polymer-gap"],C.objectToOptions(Hhe)),bumpFrequency:C.Numeric(0,{min:0,max:10,step:.1},We.ShadingCategory),colorMode:C.Select("default",C.arrayToOptions(["default","interpolate"]),te(k({},We.ShadingCategory),{isHidden:!0}))});function aWe(e,t){let r=C.clone(jhe),n=!1;return t.units.forEach(o=>{!n&&o.gapElements.length&&(n=!0)}),r.visuals.defaultValue=["polymer-backbone-cylinder","polymer-backbone-sphere"],n&&r.visuals.defaultValue.push("polymer-gap"),r}function lWe(e,t){return Nt.createMulti("Backbone",e,t,Yn,Hhe)}var qhe={name:"backbone",label:"Backbone",description:"Displays polymer backbone with cylinders and spheres.",factory:lWe,getParams:aWe,defaultValues:C.getDefaultValues(jhe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.polymerResidueCount>0};var s2=class e extends Db{constructor(){super(),ci(e.BuiltIn,(t,r)=>{if(t.name!==r)throw new Error(`Fix BuiltInStructureRepresentations to have matching names. ${t.name} ${r}`);this.add(t)})}};(function(e){e.BuiltIn={cartoon:_fe,backbone:qhe,"ball-and-stick":spe,carbohydrate:wpe,ellipsoid:Pfe,"gaussian-surface":Jfe,"gaussian-volume":zhe,label:nhe,line:Lhe,"molecular-surface":mhe,orientation:ghe,point:xhe,putty:whe,spacefill:The}})(s2||(s2={}));var Fk=class{get isAnimating(){return this._isAnimating}tick(t,r){return Y(this,null,function*(){var n,o;if(yield this.plugin.managers.animation.tick(t,r?.isSynchronous,r?.animation),(n=this.plugin.canvas3d)===null||n===void 0||n.tick(t,r),ot){let i=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.webgl.timer.resolve();if(i)for(let s of i)tF([s])}})}resetTime(t=On()){var r;(r=this.plugin.canvas3d)===null||r===void 0||r.resetTime(t)}start(t){var r;(r=this.plugin.canvas3d)===null||r===void 0||r.resume(),this._isAnimating=!0,this.resetTime(),t?.immediate?this.frame():this.currentFrame=requestAnimationFrame(this.frame)}stop(t){var r;this._isAnimating=!1,this.currentFrame!==void 0&&(cancelAnimationFrame(this.currentFrame),this.currentFrame=void 0),t?.noDraw&&((r=this.plugin.canvas3d)===null||r===void 0||r.pause(t?.noDraw))}constructor(t){this.plugin=t,this.currentFrame=void 0,this._isAnimating=!1,this.frame=()=>{this.tick(On()),this._isAnimating&&(this.currentFrame=requestAnimationFrame(this.frame))}}};var Sy=class e extends mp{get animation(){return this.plugin.managers.animation}getSnapshot(t){var r,n,o;let i=k(k({},this.snapshotParams.value),t);return{id:qr.create22(),data:i.data?this.data.getSnapshot():void 0,behaviour:i.behavior?this.behaviors.getSnapshot():void 0,animation:i.animation?this.animation.getSnapshot():void 0,startAnimation:i.startAnimation?!!i.startAnimation:void 0,camera:i.camera?{current:this.plugin.canvas3d.camera.getSnapshot(),transitionStyle:i.cameraTransition.name,transitionDurationInMs:((r=i?.cameraTransition)===null||r===void 0?void 0:r.name)==="animate"?i.cameraTransition.params.durationInMs:void 0}:void 0,canvas3dContext:i.canvas3dContext?{props:(n=this.plugin.canvas3dContext)===null||n===void 0?void 0:n.props}:void 0,canvas3d:i.canvas3d?{props:(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.props}:void 0,interactivity:i.interactivity?{props:this.plugin.managers.interactivity.props}:void 0,structureFocus:this.plugin.managers.structure.focus.getSnapshot(),structureSelection:i.structureSelection?this.plugin.managers.structure.selection.getSnapshot():void 0,structureComponentManager:i.componentManager?{options:this.plugin.managers.structure.component.state.options}:void 0,durationInMs:i?.durationInMs}}setSnapshot(t){return Y(this,null,function*(){var r,n,o,i,s;if(yield this.animation.stop(),!((r=t.structureComponentManager)===null||r===void 0)&&r.options&&this.plugin.managers.structure.component._setSnapshotState((n=t.structureComponentManager)===null||n===void 0?void 0:n.options),t.behaviour&&(yield this.plugin.runTask(this.behaviors.setSnapshot(t.behaviour))),t.data&&(yield this.plugin.runTask(this.data.setSnapshot(t.data))),!((o=t.canvas3d)===null||o===void 0)&&o.props){let a=C.normalizeParams(ol,t.canvas3d.props,"children");yield ct.Canvas3D.SetSettings(this.plugin,{settings:a})}if(!((i=t.canvas3dContext)===null||i===void 0)&&i.props){let a=C.normalizeParams(hp.Params,t.canvas3dContext.props,"children");(s=this.plugin.canvas3dContext)===null||s===void 0||s.setProps(a)}t.interactivity&&t.interactivity.props&&this.plugin.managers.interactivity.setProps(t.interactivity.props),t.structureFocus&&this.plugin.managers.structure.focus.setSnapshot(t.structureFocus),t.structureSelection&&this.plugin.managers.structure.selection.setSnapshot(t.structureSelection),t.animation&&this.animation.setSnapshot(t.animation),t.camera&&ct.Camera.Reset(this.plugin,{snapshot:t.camera.current,durationMs:t.camera.transitionStyle==="animate"?t.camera.transitionDurationInMs:void 0}),t.startAnimation&&this.animation.start()})}updateTransform(t,r,n,o){let i=t.build().to(r).update(n);return ct.State.Update(this.plugin,{state:t,tree:i,options:{canUndo:o}})}hasBehavior(t){return this.behaviors.tree.transforms.has(t.id)}updateBehavior(t,r){let n=this.behaviors.build();if(this.behaviors.tree.transforms.has(t.id))n.to(t.id).update(r);else{let o=t.createDefaultParams(void 0,this.plugin);n.to(Ur.getCategoryId(t)).apply(t,wl(o,r),{ref:t.id})}return this.plugin.runTask(this.behaviors.updateTree(n))}dispose(){this.behaviors.cells.forEach(t=>{var r,n,o,i;Ur.Behavior.is(t.obj)&&((n=(r=t.obj.data).unregister)===null||n===void 0||n.call(r),(i=(o=t.obj.data).dispose)===null||i===void 0||i.call(o))}),super.dispose(),this.data.dispose(),this.behaviors.dispose(),this.animation.dispose()}constructor(t){super(),this.plugin=t,this.data=ru.create(new ae.Root({}),{runTask:this.plugin.runTask,globalContext:this.plugin,historyCapacity:this.plugin.config.get(Tr.State.HistoryCapacity)}),this.behaviors=ru.create(new Ur.Root({}),{runTask:this.plugin.runTask,globalContext:this.plugin,rootState:{isLocked:!0}}),this.events={cell:{stateUpdated:zm(this.data.events.cell.stateUpdated,this.behaviors.events.cell.stateUpdated),created:zm(this.data.events.cell.created,this.behaviors.events.cell.created),removed:zm(this.data.events.cell.removed,this.behaviors.events.cell.removed)},object:{created:zm(this.data.events.object.created,this.behaviors.events.object.created),removed:zm(this.data.events.object.removed,this.behaviors.events.object.removed),updated:zm(this.data.events.object.updated,this.behaviors.events.object.updated)}},this.snapshotParams=this.ev.behavior(e.DefaultSnapshotParams),this.setSnapshotParams=r=>{this.snapshotParams.next(k(k({},e.DefaultSnapshotParams),r))}}};(function(e){e.SnapshotParams={durationInMs:C.Numeric(1500,{min:100,max:15e3,step:100},{label:"Duration in ms"}),data:C.Boolean(!0),behavior:C.Boolean(!1),structureSelection:C.Boolean(!1),componentManager:C.Boolean(!0),animation:C.Boolean(!0),startAnimation:C.Boolean(!1),canvas3d:C.Boolean(!0),canvas3dContext:C.Boolean(!0),interactivity:C.Boolean(!0),camera:C.Boolean(!0),cameraTransition:C.MappedStatic("animate",{animate:C.Group({durationInMs:C.Numeric(250,{min:100,max:5e3,step:500},{label:"Duration in ms"})}),instant:C.Group({})},{options:[["animate","Animate"],["instant","Instant"]]}),image:C.Boolean(!1)},e.DefaultSnapshotParams=C.getDefaultValues(e.SnapshotParams)})(Sy||(Sy={}));var Ok=class{getDecorator(t){let r=this.plugin.state.data.tree,n=r.children.get(t);if(n.size!==1)return t;let o=n.first();return r.transforms.get(o).transformer.definition.isDecorator?this.getDecorator(o):t}get(t,r=!1){let n=this.root.get(t);if(n)return r?this.plugin.state.data.cells.get(n.ref):this.plugin.state.data.cells.get(this.getDecorator(n.ref))}addMapping(t,r,n){if(!ae.Molecule.Structure.is(n))return!1;if(this.tracked.set(r,n.data),this.root.has(n.data)){let o=this.root.get(n.data);o.count++}else{let o=t.select(qt.Generators.byRef(r).rootOfType([ae.Molecule.Structure]))[0];o?this.root.set(n.data,{ref:o.transform.ref,count:1}):this.root.set(n.data,{ref:r,count:1})}return!0}removeMapping(t){if(!this.tracked.has(t))return!1;let r=this.tracked.get(t);this.tracked.delete(t);let n=this.root.get(r);return n.count>1?n.count--:this.root.delete(r),!0}updateMapping(t,r,n,o){return ae.Molecule.Structure.is(o)?(this.removeMapping(r),this.addMapping(t,r,o),!0):!1}dispose(){this.ev.dispose()}constructor(t){this.plugin=t,this.ev=Hl.create(),this.events={updated:this.ev(),removed:this.ev()},this.root=new Map,this.tracked=new Map,t.state.data.events.object.created.subscribe(r=>{this.addMapping(r.state,r.ref,r.obj)}),t.state.data.events.object.removed.subscribe(r=>{this.removeMapping(r.ref)&&this.events.removed.next({ref:r.ref,obj:r.obj})}),t.state.data.events.object.updated.subscribe(r=>{this.updateMapping(r.state,r.ref,r.oldObj,r.obj)&&this.events.updated.next({ref:r.ref,oldObj:r.oldObj,obj:r.obj})})}};var a2=class{constructor(){this.ev=Hl.create(),this.id=0,this.runningTasks=new Set,this.abortRequests=new Map,this.options=new Map,this.currentContext=[],this.events={progress:this.ev(),finished:this.ev()}}tryGetAbortTaskId(t){if(this.abortRequests.has(t.progress.taskId))return t.progress.taskId;for(let r of t.children){let n=this.tryGetAbortTaskId(r);if(n!==void 0)return n}}track(t,r){return n=>{var o;if(n.canAbort&&n.requestAbort){let s=this.tryGetAbortTaskId(n.root);s!==void 0&&n.requestAbort(this.abortRequests.get(s))}let i=On()-n.root.progress.startedTime;this.events.progress.next({id:t,useOverlay:(o=this.options.get(r))===null||o===void 0?void 0:o.useOverlay,level:i<250?"none":"background",progress:n})}}run(t,r){return Y(this,null,function*(){let n=this.id++,o;r?.createNewContext||this.currentContext.length===0?o={ctx:aH(t,this.track(n,t.id),100),refCount:1}:(o=this.currentContext[this.currentContext.length-1],o.refCount++);try{return this.options.set(t.id,{useOverlay:!!r?.useOverlay}),this.runningTasks.add(t.id),yield _A(o.ctx,t)}finally{this.options.delete(t.id),this.runningTasks.delete(t.id),this.events.finished.next({id:n}),this.abortRequests.delete(t.id),o.refCount--,o.refCount===0&&eh(this.currentContext,o)}})}requestAbortAll(t){this.runningTasks.forEach(r=>this.abortRequests.set(r,t))}requestAbort(t,r){let n=typeof t=="number"?t:t.root.progress.taskId;this.abortRequests.set(n,r)}dispose(){this.ev.dispose()}};(function(e){function t(n){return new Promise(o=>setTimeout(o,n))}function r(n){return Pe.create("Test",o=>Y(this,null,function*(){let i=0;for(;i!!r&&r.key===t)}show(t){let r=this.state.entries,n,o=++this.serialId,i;t.key&&(n=this.findByKey(t.key))?(n.timeout!==void 0&&clearTimeout(n.timeout),i=n.serialNumber,r=r.remove(n.id)):i=++this.serialNumber,n={id:o,serialNumber:i,key:t.key,title:t.title,message:t.message,timeout:this.timeout(o,t.timeoutMs),hide:()=>this.hideId(o)},this.updateState({entries:r.set(o,n)})&&this.events.changed.next(void 0)}timeout(t,r){if(r!==void 0)return r<0&&(r=500),setTimeout(()=>{let n=this.state.entries.get(t);n.timeout=void 0,this.hide(n)},r)}hideId(t){this.hide(this.state.entries.get(t))}hide(t){t&&(t.timeout!==void 0&&clearTimeout(t.timeout),t.hide=void 0,this.updateState({entries:this.state.entries.delete(t.id)})&&this.events.changed.next(void 0))}constructor(t){super({entries:ia()}),this.events={changed:this.ev()},this.serialNumber=0,this.serialId=0,ct.Toast.Show.subscribe(t,r=>this.show(r)),ct.Toast.Hide.subscribe(t,r=>this.hide(this.findByKey(r.key)))}};var Uk=class extends mp{createParams(){let t=Math.min(this.plugin.canvas3d?this.plugin.canvas3d.webgl.maxRenderbufferSize:4096,4096);return{resolution:C.MappedStatic("viewport",{viewport:C.Group({}),hd:C.Group({}),"full-hd":C.Group({}),"ultra-hd":C.Group({}),custom:C.Group({width:C.Numeric(1920,{min:128,max:t,step:1}),height:C.Numeric(1080,{min:128,max:t,step:1})},{isFlat:!0})},{options:[["viewport","Viewport"],["hd","HD (1280 x 720)"],["full-hd","Full HD (1920 x 1080)"],["ultra-hd","Ultra HD (3840 x 2160)"],["custom","Custom"]]}),transparent:C.Boolean(!1),axes:j0.axes}}get params(){return this._params?this._params:this._params=this.createParams()}get values(){return this.behaviors.values.value}get cropParams(){return this.behaviors.cropParams.value}get relativeCrop(){return this.behaviors.relativeCrop.value}getCanvasSize(){var t,r;return{width:((t=this.plugin.canvas3d)===null||t===void 0?void 0:t.webgl.gl.drawingBufferWidth)||0,height:((r=this.plugin.canvas3d)===null||r===void 0?void 0:r.webgl.gl.drawingBufferHeight)||0}}getSize(){let t=this.values;switch(t.resolution.name){case"viewport":return this.getCanvasSize();case"hd":return{width:1280,height:720};case"full-hd":return{width:1920,height:1080};case"ultra-hd":return{width:3840,height:2160};default:return{width:t.resolution.params.width,height:t.resolution.params.height}}}createPass(t){let r=this.plugin.canvas3d,{colorBufferFloat:n,textureFloat:o}=r.webgl.extensions,i=r.props.postprocessing.occlusion;return r.getImagePass({transparentBackground:this.values.transparent,cameraHelper:{axes:this.values.axes},multiSample:te(k({},r.props.multiSample),{mode:t?"on":"off",sampleLevel:n&&o?4:2}),postprocessing:te(k({},r.props.postprocessing),{occlusion:i.name==="on"?{name:"on",params:te(k({},i.params),{samples:128,resolutionScale:r.webgl.pixelRatio})}:i}),marking:k({},r.props.marking)})}get previewPass(){return this._previewPass||(this._previewPass=this.createPass(!1))}get imagePass(){if(this._imagePass){let t=this.plugin.canvas3d,r=t.props.postprocessing.occlusion;return this._imagePass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:te(k({},t.props.postprocessing),{occlusion:r.name==="on"?{name:"on",params:te(k({},r.params),{samples:128,resolutionScale:t.webgl.pixelRatio})}:r}),marking:k({},t.props.marking)}),this._imagePass}return this._imagePass=this.createPass(!0)}getFilename(t=".png"){let r=this.plugin.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Model)).map(i=>i.obj.data),n=new Set;return r.forEach(i=>n.add(i.entryId.toUpperCase())),`${Dn.toArray(n).join("-")||"molstar-image"}${t}`}resetCrop(){this.behaviors.relativeCrop.next({x:0,y:0,width:1,height:1})}toggleAutocrop(){this.cropParams.auto?(this.behaviors.cropParams.next(te(k({},this.cropParams),{auto:!1})),this.resetCrop()):this.behaviors.cropParams.next(te(k({},this.cropParams),{auto:!0}))}get isFullFrame(){let t=this.relativeCrop;return jn(t.x,0,1e-5)&&jn(t.y,0,1e-5)&&jn(t.width,1,1e-5)&&jn(t.height,1,1e-5)}autocrop(t=this.cropParams.relativePadding){let{data:r,width:n,height:o}=this.previewData.image,i=this.previewData.transparent,s=i?this.previewData.background:4278190080|this.previewData.background,a=n,l=0,c=o,u=0;for(let h=0;hl&&(l=y),hu&&(u=h)}}if(a>l){let h=a;a=l,l=h}if(c>u){let h=c;c=u,u=h}let d=l-a+1,m=u-c+1;a-=t*d,l+=t*d,c-=t*m,u+=t*m;let p={x:Math.max(0,a/n),y:Math.max(0,c/o),width:Math.min(1,(l-a+1)/n),height:Math.min(1,(u-c+1)/o)};this.behaviors.relativeCrop.next(p)}getPreview(t=320){let{width:r,height:n}=this.getSize();if(r<=0||n<=0)return;let o=r/n,i=0,s=0;o>1?(i=t,s=Math.round(t/o)):(s=t,i=Math.round(t*o));let a=this.plugin.canvas3d.props;this.previewPass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:a.postprocessing,marking:a.marking});let l=this.previewPass.getImageData(i,s),c=this.previewCanvas;c.width=l.width,c.height=l.height,this.previewData.image=l,this.previewData.background=a.renderer.backgroundColor,this.previewData.transparent=this.values.transparent;let u=c.getContext("2d");if(!u)throw new Error("Could not create canvas 2d context");return u.putImageData(l,0,0),this.cropParams.auto&&this.autocrop(),this.events.previewed.next(void 0),{canvas:c,width:i,height:s}}getSizeAndViewport(){let{width:t,height:r}=this.getSize(),n=this.relativeCrop,o={x:Math.floor(n.x*t),y:Math.floor(n.y*r),width:Math.ceil(n.width*t),height:Math.ceil(n.height*r)};return o.width+o.x>t&&(o.width=t-o.x),o.height+o.y>r&&(o.height=r-o.y),{width:t,height:r,viewport:o}}draw(t){return Y(this,null,function*(){let{width:r,height:n,viewport:o}=this.getSizeAndViewport();if(r<=0||n<=0)return;yield t.update("Rendering image...");let i=this.imagePass;yield i.updateBackground();let s=i.getImageData(r,n,o);yield t.update("Encoding image...");let a=this.canvas;a.width=s.width,a.height=s.height;let l=a.getContext("2d");if(!l)throw new Error("Could not create canvas 2d context");l.putImageData(s,0,0)})}copyToClipboardTask(){let t=navigator.clipboard;if(!t?.write){this.plugin.log.error("clipboard.write not supported!");return}return Pe.create("Copy Image",r=>Y(this,null,function*(){yield this.draw(r),yield r.update("Converting image...");let n=yield U_(this.canvas,"png"),o=new ClipboardItem({"image/png":n});yield t.write([o]),this.plugin.log.message("Image copied to clipboard.")}))}getImageDataUri(){return this.plugin.runTask(Pe.create("Generate Image",t=>Y(this,null,function*(){return yield this.draw(t),yield t.update("Converting image..."),this.canvas.toDataURL("png")})))}copyToClipboard(){let t=this.copyToClipboardTask();if(t)return this.plugin.runTask(t)}downloadTask(t){return Pe.create("Download Image",r=>Y(this,null,function*(){yield this.draw(r),yield r.update("Downloading image...");let n=yield U_(this.canvas,"png");jI(n,t??this.getFilename())}))}download(t){this.plugin.runTask(this.downloadTask(t))}constructor(t){super(),this.plugin=t,this._params=void 0,this.behaviors={values:this.ev.behavior({transparent:this.params.transparent.defaultValue,axes:{name:"off",params:{}},resolution:this.params.resolution.defaultValue}),cropParams:this.ev.behavior({auto:!0,relativePadding:.1}),relativeCrop:this.ev.behavior({x:0,y:0,width:1,height:1})},this.events={previewed:this.ev()},this.canvas=function(){return document.createElement("canvas")}(),this.previewCanvas=function(){return document.createElement("canvas")}(),this.previewData={image:{data:new Uint8ClampedArray(1),width:1,height:0},background:Oe(0),transparent:!1}}};var zk=class{addHandler(t,r){let n=this.handlers.findIndex(o=>o[0]===t);n<0?this.handlers.push([t,r]):this.handlers[n][1]=r}removeHandler(t){let r=this.handlers.findIndex(n=>n[0]===t);r>=0&&this.handlers.splice(r,1)}handle(t){return Y(this,null,function*(){for(let r=this.handlers.length-1;r>=0;r--){let n=this.handlers[r][1];if(yield n(t,this.plugin))return}cWe(this.plugin,t)})}dispose(){this.handlers.length=0}constructor(t){this.plugin=t,this.handlers=[]}};function cWe(e,t){let r=t.filter(n=>{let o=n.name.toLowerCase();return o.endsWith(".molx")||o.endsWith(".molj")});r.length>0?ct.State.Snapshots.OpenFile(e,{file:r[0]}):e.runTask(e.state.data.applyAction(ow,{files:t.map(n=>Or.File(n)),format:{name:"auto",params:{}},visuals:!0}))}var Vk=class{get isInitialized(){return this._isInitialized}build(){return this.state.data.build()}initContainer(t){var r;if(this.canvasContainer)return!0;let n=document.createElement("div");Object.assign(n.style,{position:"absolute",left:0,top:0,right:0,bottom:0,"-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none","touch-action":"manipulation"});let o=(r=t?.canvas3dContext)===null||r===void 0?void 0:r.canvas;return o||(o=document.createElement("canvas"),t?.checkeredCanvasBackground&&Object.assign(o.style,{"background-image":"linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey), linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey)","background-size":"60px 60px","background-position":"0 0, 30px 30px"}),n.appendChild(o)),this.initViewer(o,n,t?.canvas3dContext)?(this.canvasContainer=n,!0):!1}mount(t,r){var n;if(this.disposed)throw new Error("Cannot mount a disposed context");return this.initContainer(r)?(this.canvasContainer.parentElement!==t&&((n=this.canvasContainer.parentElement)===null||n===void 0||n.removeChild(this.canvasContainer)),t.appendChild(this.canvasContainer),this.handleResize(),!0):!1}unmount(){var t,r;(r=(t=this.canvasContainer)===null||t===void 0?void 0:t.parentElement)===null||r===void 0||r.removeChild(this.canvasContainer)}initViewer(t,r,n){var o,i,s,a,l,c;try{this.layout.setRoot(r),this.spec.layout&&this.spec.layout.initial&&this.layout.setProps(this.spec.layout.initial),n||(n=hp.fromCanvas(t,this.managers.asset,{antialias:!((o=this.config.get(Tr.General.DisableAntialiasing))!==null&&o!==void 0&&o),preserveDrawingBuffer:!((i=this.config.get(Tr.General.DisablePreserveDrawingBuffer))!==null&&i!==void 0&&i),preferWebGl1:this.config.get(Tr.General.PreferWebGl1)||!1,failIfMajorPerformanceCaveat:!((s=this.config.get(Tr.General.AllowMajorPerformanceCaveat))!==null&&s!==void 0&&s),powerPreference:this.config.get(Tr.General.PowerPreference)||"high-performance",handleResize:this.handleResize},{pixelScale:this.config.get(Tr.General.PixelScale)||1,pickScale:this.config.get(Tr.General.PickScale)||.25,transparency:this.config.get(Tr.General.Transparency)||"wboit"})),this.canvas3dContext=n,this.canvas3d=CE.create(this.canvas3dContext),this.canvas3dInit.next(!0);let u=this.spec.canvas3d,d=Oe(16579577);return u?(((l=u.renderer)===null||l===void 0?void 0:l.backgroundColor)===void 0&&(u=wl(u,m=>{m.renderer?m.renderer.backgroundColor=d:m.renderer={backgroundColor:d}})),(c=this.canvas3d)===null||c===void 0||c.setProps(u)):(a=this.canvas3d)===null||a===void 0||a.setProps({renderer:{backgroundColor:d}}),this.animationLoop.start(),this.helpers.viewportScreenshot=new Uk(this),this.subs.push(this.canvas3d.interaction.click.subscribe(m=>this.behaviors.interaction.click.next(m))),this.subs.push(this.canvas3d.interaction.drag.subscribe(m=>this.behaviors.interaction.drag.next(m))),this.subs.push(this.canvas3d.interaction.hover.subscribe(m=>this.behaviors.interaction.hover.next(m))),this.subs.push(this.canvas3d.input.resize.pipe(cA(50),xd(100,void 0,{leading:!1,trailing:!0})).subscribe(()=>this.handleResize())),this.subs.push(this.canvas3d.input.keyDown.subscribe(m=>this.behaviors.interaction.key.next(m))),this.subs.push(this.canvas3d.input.keyUp.subscribe(m=>this.behaviors.interaction.keyReleased.next(m))),this.subs.push(this.layout.events.updated.subscribe(()=>requestAnimationFrame(()=>this.handleResize()))),this.handleResize(),th.setImmediate(()=>this.initCanvas3dPromiseCallbacks[0]()),!0}catch(u){return this.log.error(""+u),console.error(u),th.setImmediate(()=>this.initCanvas3dPromiseCallbacks[1](u)),!1}}get isBusy(){return this.behaviors.state.isAnimating.value||this.behaviors.state.isUpdating.value}get selectionMode(){return this.behaviors.interaction.selectionMode.value}set selectionMode(t){this.behaviors.interaction.selectionMode.next(t)}dataTransaction(t,r){return this.runTask(this.state.data.transaction(t,r))}clear(t=!1){var r;return t&&((r=this.canvas3d)===null||r===void 0||r.setProps(W_)),ct.State.RemoveObject(this,{state:this.state.data,ref:ur.RootRef})}dispose(t){var r,n;if(!this.disposed){for(let o of this.subs)o.unsubscribe();this.subs=[],this.animationLoop.stop(),this.commands.dispose(),(r=this.canvas3d)===null||r===void 0||r.dispose(),(n=this.canvas3dContext)===null||n===void 0||n.dispose(t),this.ev.dispose(),this.state.dispose(),this.helpers.substructureParent.dispose(),ci(this.managers,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),ci(this.managers.structure,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),ci(this.managers.volume,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),this.unmount(),this.canvasContainer=void 0,this.customState={},this.disposed=!0}}initBehaviorEvents(){this.subs.push(zm(this.state.data.behaviors.isUpdating,this.state.behaviors.behaviors.isUpdating).subscribe(s=>{this.behaviors.state.isUpdating.value!==s&&this.behaviors.state.isUpdating.next(s)}));let t=this.config.get(Tr.General.IsBusyTimeoutMs)||750,r=this.behaviors.state.isBusy,n,o=()=>{r.value||r.next(!0)},i=()=>{n!==void 0&&clearTimeout(n),n=void 0};this.subs.push(zm(this.behaviors.state.isUpdating,this.behaviors.state.isAnimating).subscribe(s=>{let a=this.behaviors.state.isUpdating.value,l=this.behaviors.state.isAnimating.value;a||l?r.value||(i(),n=setTimeout(o,t)):(i(),r.next(!1))})),this.subs.push(this.behaviors.interaction.selectionMode.subscribe(s=>{var a;s||(a=this.managers.interactivity)===null||a===void 0||a.lociSelects.deselectAll()}))}initBuiltInBehavior(){ew.State.registerDefault(this),ew.Representation.registerDefault(this),ew.Camera.registerDefault(this),ew.Misc.registerDefault(this),this.subs.push(zm(this.state.data.events.log,this.state.behaviors.events.log).subscribe(t=>this.events.log.next(t)))}initBehaviors(){return Y(this,null,function*(){let t=this.state.behaviors.build();for(let r of Object.keys(Ur.Categories))t.toRoot().apply(Ur.CreateCategory,{label:Ur.Categories[r]},{ref:r,state:{isLocked:!0}});for(let r of this.spec.behaviors)Ur.getCategoryId(r.transformer)==="custom-props"&&t.to(Ur.getCategoryId(r.transformer)).apply(r.transformer,r.defaultParams,{ref:r.transformer.id});yield this.runTask(this.state.behaviors.updateTree(t,{doNotUpdateCurrent:!0,doNotLogTiming:!0})),t=this.state.behaviors.build();for(let r of this.spec.behaviors)Ur.getCategoryId(r.transformer)!=="custom-props"&&t.to(Ur.getCategoryId(r.transformer)).apply(r.transformer,r.defaultParams,{ref:r.transformer.id});yield this.runTask(this.state.behaviors.updateTree(t,{doNotUpdateCurrent:!0,doNotLogTiming:!0}))})}initCustomFormats(){if(this.spec.customFormats)for(let t of this.spec.customFormats)this.dataFormats.add(t[0],t[1])}initAnimations(){if(this.spec.animations)for(let t of this.spec.animations)this.managers.animation.register(t)}initDataActions(){if(this.spec.actions)for(let t of this.spec.actions)this.state.data.actions.add(t.action)}init(){return Y(this,null,function*(){try{this.subs.push(this.events.log.subscribe(t=>this.log.entries=this.log.entries.push(t))),this.initCustomFormats(),this.initBehaviorEvents(),this.initBuiltInBehavior(),this.managers.interactivity=new ay(this),this.managers.lociLabels=new LD(this),this.builders.structure=new kD(this),this.initAnimations(),this.initDataActions(),yield this.initBehaviors(),this.log.message(`Mol* Plugin ${N_} [${fae.toLocaleString()}]`),Ag||this.log.message("Development mode enabled"),$t&&this.log.message("Debug mode enabled"),this._isInitialized=!0,this.initializedPromiseCallbacks[0]()}catch(t){throw this.initializedPromiseCallbacks[1](t),t}})}constructor(t){var r;this.spec=t,this.runTask=(n,o)=>this.managers.task.run(n,o),this.resolveTask=n=>{if(n)return Pe.is(n)?this.runTask(n):n},this.subs=[],this.initCanvas3dPromiseCallbacks=[()=>{},()=>{}],this._isInitialized=!1,this.initializedPromiseCallbacks=[()=>{},()=>{}],this.disposed=!1,this.canvasContainer=void 0,this.ev=Hl.create(),this.config=new fP(this.spec.config),this.state=new Sy(this),this.commands=new hP,this.canvas3dInit=this.ev.behavior(!1),this.behaviors={state:{isAnimating:this.ev.behavior(!1),isUpdating:this.ev.behavior(!1),isBusy:this.ev.behavior(!1)},interaction:{hover:this.ev.behavior({current:Nt.Loci.Empty,modifiers:Pa.None,buttons:0,button:0}),click:this.ev.behavior({current:Nt.Loci.Empty,modifiers:Pa.None,buttons:0,button:0}),drag:this.ev.behavior({current:Nt.Loci.Empty,modifiers:Pa.None,buttons:0,button:0,pageStart:Ae(),pageEnd:Ae()}),key:this.ev.behavior(n6),keyReleased:this.ev.behavior(n6),selectionMode:this.ev.behavior(!1)},labels:{highlight:this.ev.behavior({labels:[]})},layout:{leftPanelTabName:this.ev.behavior("root")},canvas3d:{initialized:this.canvas3dInit.pipe(Np(n=>!!n),PG(1))}},this.canvas3dInitialized=new Promise((n,o)=>{this.initCanvas3dPromiseCallbacks=[n,o]}),this.initialized=new Promise((n,o)=>{this.initializedPromiseCallbacks=[n,o]}),this.layout=new HD(this),this.animationLoop=new Fk(this),this.representation={structure:{registry:new s2,themes:{colorThemeRegistry:Oi.createRegistry(),sizeThemeRegistry:mi.createRegistry()}},volume:{registry:new B0,themes:{colorThemeRegistry:Oi.createRegistry(),sizeThemeRegistry:mi.createRegistry()}}},this.query={structure:{registry:new FI}},this.dataFormats=new MD,this.builders={data:new TD(this),structure:void 0},this.helpers={substructureParent:new Ok(this),viewportScreenshot:void 0},this.managers={structure:{hierarchy:new Tf(this),component:new xu(this),measurement:new zD(this),selection:new VD(this),focus:new FD(this)},volume:{hierarchy:new ly(this)},interactivity:void 0,camera:new RD(this),animation:new BD(this),snapshot:new O0(this),lociLabels:void 0,toast:new Nk(this),asset:new ET,task:new a2,dragAndDrop:new zk(this)},this.events={log:this.ev(),task:this.managers.task.events,canvas3d:{settingsUpdated:this.ev()}},this.customModelProperties=new Cw.Registry,this.customStructureProperties=new Cw.Registry,this.customStructureControls=new Map,this.customImportControls=new Map,this.genericRepresentationControls=new Map,this.customState=Object.create(null),this.handleResize=()=>{var n,o;let i=(n=this.canvas3dContext)===null||n===void 0?void 0:n.canvas,s=this.layout.root;s&&i&&(hae(i,s,this.canvas3dContext.props.pixelScale),(o=this.canvas3d)===null||o===void 0||o.requestResize())},this.log={entries:nf(),entry:n=>this.events.log.next(n),error:n=>this.events.log.next(Fd.error(n)),message:n=>this.events.log.next(Fd.message(n)),info:n=>this.events.log.next(Fd.info(n)),warn:n=>this.events.log.next(Fd.warning(n))},this.fetch=IC,vQ(!1),uq((r=this.config.get(Tr.Structure.SaccharideCompIdMapType))!==null&&r!==void 0?r:"default")}};var Gk=class extends Vk{initCustomParamEditors(){if(this.spec.customParamEditors)for(let[t,r]of this.spec.customParamEditors)this.customParamEditors.set(t.id,r)}dispose(t){super.dispose(t),this.layout.dispose()}constructor(t){super(t),this.spec=t,this.customParamEditors=new Map,this.initCustomParamEditors()}};var hl=(()=>{let t=class t{constructor(){this.specs=te(k({},pme()),{config:[[Tr.VolumeStreaming.Enabled,!1]],canvas3d:{renderer:{backgroundColor:Oe(0)}}}),this.plugin=new Gk(this.specs),this.plugin$=Kf(this.plugin.init()).pipe(Rs(()=>this.plugin),vd(1))}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=bd({token:t,factory:t.\u0275fac});let e=t;return e})();var Em=(()=>{let t=class t{set source(n){this.source$.next(n)}constructor(n){this.pluginService=n,this.source$=new Zs(null),this.structure$=this.pluginService.plugin$.pipe(hg(o=>this.source$.pipe(Np(i=>i!=null),Rs(i=>({plugin:o,source:i})))),hg(({source:o})=>Kf(Y(this,null,function*(){return o.type==="local"?{data:yield this.parseLocalSource(o),source:o}:{data:yield this.parseRemoteSource(o),source:o}}))),hg(({data:o,source:i})=>Kf(Y(this,null,function*(){let s=this.pluginService.plugin,a=yield s.builders.structure.parseTrajectory(o,i.format),l=yield s.builders.structure.createModel(a,{modelIndex:0});return s.builders.structure.createStructure(l,{name:"model",params:{}})}))),DG(o=>{let i=0;this.residues=[];let s=this.r2i=new Map,a=this.i2r=new Map;Me.eachAtomicHierarchyElement(o.cell?.obj?.data,{residue:l=>{let c=Ne.residue.auth_seq_id(l),u=Ne.residue.pdbx_PDB_ins_code(l),d=Ne.chain.auth_asym_id(l),m=Ne.atom.auth_comp_id(l),p=(d+c+u).trim();s.set(p,i),a.set(i,p),this.residues.push({pdbInsCode:u,authSeqId:c,authAsymId:d,authCompId3:UT.has(m)?m:"XXX",authCompId1:UT.get(m)||"X"}),i++}})}),vd(1))}parseRemoteSource(n){return Y(this,null,function*(){let o=Or.Url(n.link),i=n.label,s=n.binary;return this.pluginService.plugin.builders.data.download({url:o,label:i,isBinary:s})})}parseLocalSource(n){return Y(this,null,function*(){let o=n.binary,i=n.label,s=this.pluginService.plugin;if(typeof n.data=="string")return s.builders.data.rawData({data:n.data,label:i});let a;if(n.data instanceof File)a=Or.File(n.data);else{let c=n.format==="mmcif"?"cif":"ent",u=`${i}.${c}`;a=Or.File(new File([n.data],u))}let{data:l}=yield s.builders.data.readFile({file:a,label:i,isBinary:o});return l})}};t.\u0275fac=function(o){return new(o||t)(Bu(hl))},t.\u0275prov=bd({token:t,factory:t.\u0275fac});let e=t;return e})();function Av(e){let t;e=e.replace(/^#/,""),[t,e]=[e.slice(6,8),e.slice(0,6)];let r=Oe.fromHexStyle("#"+e),n=+("0x"+(t||"ff"))/255;return[r,1-n]}function uWe(e){let t=rt.createState(512,512);for(let r=0;re[r].color,()=>1,r=>e[r].label)}var dWe=$e.builderFactory("interactions"),Whe=dWe({name:"interactions",from:ae.Root,to:ae.Shape.Provider,params:{data:C.Value(void 0,{isHidden:!1})}})({apply({params:e}){return new ae.Shape.Provider({label:"",data:e.data,params:dt.Params,geometryUtils:dt.Utils,getShape:(t,r)=>uWe(r)},{label:""})}});var Cy=(()=>{let t=class t{constructor(){this.settings$=new Xf}set settings(n){this.settings$.next(this._settings=n)}get settings(){return this._settings}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=bd({token:t,factory:t.\u0275fac});let e=t;return e})();var Fn=vr(Ln()),Ov=vr(Ui());var ln=vr(Ln()),Rv=vr(Ui());function Yhe(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var mWe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pWe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fWe={};function Hk(e,t){return((t||fWe).jsx?pWe:mWe).test(e)}var hWe=/[ \t\n\f\r]/g;function Mz(e){return typeof e=="object"?e.type==="text"?Xhe(e.value):!1:Xhe(e)}function Xhe(e){return e.replace(hWe,"")===""}var eg=class{constructor(t,r,n){this.property=t,this.normal=r,n&&(this.space=n)}};eg.prototype.property={};eg.prototype.normal={};eg.prototype.space=null;function Bz(e,t){let r={},n={},o=-1;for(;++oCn,booleanish:()=>ks,commaOrSpaceSeparated:()=>Au,commaSeparated:()=>_y,number:()=>zt,overloadedBoolean:()=>Rz,spaceSeparated:()=>ni});var gWe=0,Cn=Tv(),ks=Tv(),Rz=Tv(),zt=Tv(),ni=Tv(),_y=Tv(),Au=Tv();function Tv(){return 2**++gWe}var Lz=Object.keys(Ww),Pv=class extends sc{constructor(t,r,n,o){let i=-1;if(super(t,r),Khe(this,"space",o),typeof n=="number")for(;++i4&&r.slice(0,4)==="data"&&vWe.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace($he,SWe);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!$he.test(i)){let s=i.replace(xWe,bWe);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Pv}return new o(n,t)}function bWe(e){return"-"+e.toLowerCase()}function SWe(e){return e.charAt(1).toUpperCase()}var Vz={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Jhe=Bz([Oz,Fz,Nz,Uz,Qhe],"html"),Wk=Bz([Oz,Fz,Nz,Uz,Zhe],"svg");function ege(e){return e.join(" ").trim()}var Gz=vr(age(),1),lge=Gz.default.default||Gz.default;var Yk=cge("end"),c2=cge("start");function cge(e){return t;function t(r){let n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Hz(e){let t=c2(e),r=Yk(e);if(t&&r)return{start:t,end:r}}function wy(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?uge(e.position):"start"in e||"end"in e?uge(e):"line"in e||"column"in e?jz(e):""}function jz(e){return dge(e&&e.line)+":"+dge(e&&e.column)}function uge(e){return jz(e&&e.start)+"-"+jz(e&&e.end)}function dge(e){return e&&typeof e=="number"?e:1}var Xs=class extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let o="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i=k({},r)),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof n=="string"){let l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){let l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=wy(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}};Xs.prototype.file="";Xs.prototype.name="";Xs.prototype.reason="";Xs.prototype.message="";Xs.prototype.stack="";Xs.prototype.column=void 0;Xs.prototype.line=void 0;Xs.prototype.ancestors=void 0;Xs.prototype.cause=void 0;Xs.prototype.fatal=void 0;Xs.prototype.place=void 0;Xs.prototype.ruleId=void 0;Xs.prototype.source=void 0;var qz={}.hasOwnProperty,LWe=new Map,FWe=/[A-Z]/g,OWe=/-([a-z])/g,NWe=new Set(["table","tbody","thead","tfoot","tr"]),UWe=new Set(["td","th"]),mge="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Wz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=YWe(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=WWe(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Wk:Jhe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=pge(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function pge(e,t,r){if(t.type==="element")return zWe(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return VWe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return HWe(e,t,r);if(t.type==="mdxjsEsm")return GWe(e,t);if(t.type==="root")return jWe(e,t,r);if(t.type==="text")return qWe(e,t)}function zWe(e,t,r){let n=e.schema,o=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(o=Wk,e.schema=o),e.ancestors.push(t);let i=hge(e,t.tagName,!1),s=XWe(e,t),a=Xz(e,t);return NWe.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Mz(l):!0})),fge(e,s,i,t),Yz(s,a),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function VWe(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Xw(e,t.position)}function GWe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Xw(e,t.position)}function HWe(e,t,r){let n=e.schema,o=n;t.name==="svg"&&n.space==="html"&&(o=Wk,e.schema=o),e.ancestors.push(t);let i=t.name===null?e.Fragment:hge(e,t.name,!0),s=KWe(e,t),a=Xz(e,t);return fge(e,s,i,t),Yz(s,a),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function jWe(e,t,r){let n={};return Yz(n,Xz(e,t)),e.create(t,e.Fragment,n,r)}function qWe(e,t){return t.value}function fge(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function Yz(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function WWe(e,t,r){return n;function n(o,i,s,a){let c=Array.isArray(s.children)?r:t;return a?c(i,s,a):c(i,s)}}function YWe(e,t){return r;function r(n,o,i,s){let a=Array.isArray(i.children),l=c2(n);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function XWe(e,t){let r={},n,o;for(o in t.properties)if(o!=="children"&&qz.call(t.properties,o)){let i=QWe(e,o,t.properties[o]);if(i){let[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&UWe.has(t.tagName)?n=a:r[s]=a}}if(n){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function KWe(e,t){let r={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let i=n.data.estree.body[0];i.type;let s=i.expression;s.type;let a=s.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else Xw(e,t.position);else{let o=n.name,i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let a=n.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Xw(e,t.position);else i=n.value===null?!0:n.value;r[o]=i}return r}function Xz(e,t){let r=[],n=-1,o=e.passKeys?new Map:LWe;for(;++no?0:o+t:t=t>o?o:t,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(t,r),e.splice(...s);else for(r&&e.splice(t,r);i0?(ac(e,e.length,0,t),e):t}var xge={}.hasOwnProperty;function bge(e){let t={},r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function tg(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var id=Ay(/[A-Za-z]/),gl=Ay(/[\dA-Za-z]/),Sge=Ay(/[#-'*+\--9=?A-Z^-~]/);function Qw(e){return e!==null&&(e<32||e===127)}var Zw=Ay(/\d/),Cge=Ay(/[\dA-Fa-f]/),_ge=Ay(/[!-/:-@[-`{-~]/);function fr(e){return e!==null&&e<-2}function Ks(e){return e!==null&&(e<0||e===32)}function _n(e){return e===-2||e===-1||e===32}var wge=Ay(new RegExp("\\p{P}|\\p{S}","u")),Age=Ay(/\s/);function Ay(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function km(e){let t=[],r=-1,n=0,o=0;for(;++r55295&&i<57344){let a=e.charCodeAt(r+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="\uFFFD"}else s=String.fromCharCode(i);s&&(t.push(e.slice(n,r),encodeURIComponent(s)),n=r+o+1,s=""),o&&(r+=o,o=0)}return t.join("")+e.slice(n)}function Pn(e,t,r,n){let o=n?n-1:Number.POSITIVE_INFINITY,i=0;return s;function s(l){return _n(l)?(e.enter(r),a(l)):t(l)}function a(l){return _n(l)&&i++s))return;let E=t.events.length,A=E,P,T;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(P){T=t.events[A][1].end;break}P=!0}for(g(n),w=E;wb;){let _=r[S];t.containerState=_[1],_[0].exit.call(t,e)}r.length=b}function v(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function lYe(e,t,r){return Pn(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qz(e){if(e===null||Ks(e)||Age(e))return 1;if(wge(e))return 2}function d2(e,t,r){let n=[],o=-1;for(;++o1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let d=Object.assign({},e[n][1].end),m=Object.assign({},e[r][1].start);Ege(d,-l),Ege(m,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[r][1].start),end:m},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[r][1].start)},o={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[n][1].end=Object.assign({},s.start),e[r][1].start=Object.assign({},a.end),c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=Vc(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=Vc(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Vc(c,d2(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=Vc(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,c=Vc(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,ac(e,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r0&&_n(w)?Pn(e,v,"linePrefix",i+1)(w):v(w)}function v(w){return w===null||fr(w)?e.check(Dge,f,S)(w):(e.enter("codeFlowValue"),b(w))}function b(w){return w===null||fr(w)?(e.exit("codeFlowValue"),v(w)):(e.consume(w),b)}function S(w){return e.exit("codeFenced"),t(w)}function _(w,E,A){let P=0;return T;function T(U){return w.enter("lineEnding"),w.consume(U),w.exit("lineEnding"),B}function B(U){return w.enter("codeFencedFence"),_n(U)?Pn(w,D,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):D(U)}function D(U){return U===a?(w.enter("codeFencedFenceSequence"),M(U)):A(U)}function M(U){return U===a?(P++,w.consume(U),M):P>=s?(w.exit("codeFencedFenceSequence"),_n(U)?Pn(w,R,"whitespace")(U):R(U)):A(U)}function R(U){return U===null||fr(U)?(w.exit("codeFencedFence"),E(U)):A(U)}}}function xYe(e,t,r){let n=this;return o;function o(s){return s===null?r(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}var Jw={name:"codeIndented",tokenize:SYe},bYe={tokenize:CYe,partial:!0};function SYe(e,t,r){let n=this;return o;function o(c){return e.enter("codeIndented"),Pn(e,i,"linePrefix",5)(c)}function i(c){let u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):r(c)}function s(c){return c===null?l(c):fr(c)?e.attempt(bYe,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||fr(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function CYe(e,t,r){let n=this;return o;function o(s){return n.parser.lazy[n.now().line]?r(s):fr(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):Pn(e,i,"linePrefix",5)(s)}function i(s){let a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):fr(s)?o(s):r(s)}}var $z={name:"codeText",tokenize:AYe,resolve:_Ye,previous:wYe};function _Ye(e){let t=e.length-4,r=3,n,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){let o=r||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return n&&e3(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),e3(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),e3(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(n.parser.constructs.flow,r,t)(s)}}function tM(e,t,r,n,o,i,s,a,l){let c=l||Number.POSITIVE_INFINITY,u=0;return d;function d(g){return g===60?(e.enter(n),e.enter(o),e.enter(i),e.consume(g),e.exit(i),m):g===null||g===32||g===41||Qw(g)?r(g):(e.enter(n),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(g))}function m(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(o),e.exit(n),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(a),m(g)):g===null||g===60||fr(g)?r(g):(e.consume(g),g===92?h:p)}function h(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function f(g){return!u&&(g===null||g===41||Ks(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(n),t(g)):u999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?r(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(n),t):fr(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||fr(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!_n(p)),p===92?m:d)}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function nM(e,t,r,n,o,i){let s;return a;function a(m){return m===34||m===39||m===40?(e.enter(n),e.enter(o),e.consume(m),e.exit(o),s=m===40?41:m,l):r(m)}function l(m){return m===s?(e.enter(o),e.consume(m),e.exit(o),e.exit(n),t):(e.enter(i),c(m))}function c(m){return m===s?(e.exit(i),l(s)):m===null?r(m):fr(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Pn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(m))}function u(m){return m===s||m===null||fr(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?d:u)}function d(m){return m===s||m===92?(e.consume(m),u):u(m)}}function Ev(e,t){let r;return n;function n(o){return fr(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,n):_n(o)?Pn(e,n,r?"linePrefix":"lineSuffix")(o):t(o)}}var eV={name:"definition",tokenize:MYe},kYe={tokenize:BYe,partial:!0};function MYe(e,t,r){let n=this,o;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return rM.call(n,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return o=tg(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):r(p)}function l(p){return Ks(p)?Ev(e,c)(p):c(p)}function c(p){return tM(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(kYe,d,d)(p)}function d(p){return _n(p)?Pn(e,m,"whitespace")(p):m(p)}function m(p){return p===null||fr(p)?(e.exit("definition"),n.parser.defined.push(o),t(p)):r(p)}}function BYe(e,t,r){return n;function n(a){return Ks(a)?Ev(e,o)(a):r(a)}function o(a){return nM(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return _n(a)?Pn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||fr(a)?t(a):r(a)}}var tV={name:"hardBreakEscape",tokenize:RYe};function RYe(e,t,r){return n;function n(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return fr(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var rV={name:"headingAtx",tokenize:FYe,resolve:LYe};function LYe(e,t){let r=e.length-2,n=3,o,i;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(o={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},i={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},ac(e,n,r-n+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function FYe(e,t,r){let n=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&n++<6?(e.consume(u),s):u===null||Ks(u)?(e.exit("atxHeadingSequence"),a(u)):r(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||fr(u)?(e.exit("atxHeading"),t(u)):_n(u)?Pn(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Ks(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}var kge=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nV=["pre","script","style","textarea"];var oV={name:"htmlFlow",tokenize:zYe,resolveTo:UYe,concrete:!0},OYe={tokenize:GYe,partial:!0},NYe={tokenize:VYe,partial:!0};function UYe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zYe(e,t,r){let n=this,o,i,s,a,l;return c;function c(H){return u(H)}function u(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),d}function d(H){return H===33?(e.consume(H),m):H===47?(e.consume(H),i=!0,f):H===63?(e.consume(H),o=3,n.interrupt?t:O):id(H)?(e.consume(H),s=String.fromCharCode(H),y):r(H)}function m(H){return H===45?(e.consume(H),o=2,p):H===91?(e.consume(H),o=5,a=0,h):id(H)?(e.consume(H),o=4,n.interrupt?t:O):r(H)}function p(H){return H===45?(e.consume(H),n.interrupt?t:O):r(H)}function h(H){let W="CDATA[";return H===W.charCodeAt(a++)?(e.consume(H),a===W.length?n.interrupt?t:D:h):r(H)}function f(H){return id(H)?(e.consume(H),s=String.fromCharCode(H),y):r(H)}function y(H){if(H===null||H===47||H===62||Ks(H)){let W=H===47,K=s.toLowerCase();return!W&&!i&&nV.includes(K)?(o=1,n.interrupt?t(H):D(H)):kge.includes(s.toLowerCase())?(o=6,W?(e.consume(H),g):n.interrupt?t(H):D(H)):(o=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(H):i?v(H):b(H))}return H===45||gl(H)?(e.consume(H),s+=String.fromCharCode(H),y):r(H)}function g(H){return H===62?(e.consume(H),n.interrupt?t:D):r(H)}function v(H){return _n(H)?(e.consume(H),v):T(H)}function b(H){return H===47?(e.consume(H),T):H===58||H===95||id(H)?(e.consume(H),S):_n(H)?(e.consume(H),b):T(H)}function S(H){return H===45||H===46||H===58||H===95||gl(H)?(e.consume(H),S):_(H)}function _(H){return H===61?(e.consume(H),w):_n(H)?(e.consume(H),_):b(H)}function w(H){return H===null||H===60||H===61||H===62||H===96?r(H):H===34||H===39?(e.consume(H),l=H,E):_n(H)?(e.consume(H),w):A(H)}function E(H){return H===l?(e.consume(H),l=null,P):H===null||fr(H)?r(H):(e.consume(H),E)}function A(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Ks(H)?_(H):(e.consume(H),A)}function P(H){return H===47||H===62||_n(H)?b(H):r(H)}function T(H){return H===62?(e.consume(H),B):r(H)}function B(H){return H===null||fr(H)?D(H):_n(H)?(e.consume(H),B):r(H)}function D(H){return H===45&&o===2?(e.consume(H),F):H===60&&o===1?(e.consume(H),N):H===62&&o===4?(e.consume(H),J):H===63&&o===3?(e.consume(H),O):H===93&&o===5?(e.consume(H),q):fr(H)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(OYe,Q,M)(H)):H===null||fr(H)?(e.exit("htmlFlowData"),M(H)):(e.consume(H),D)}function M(H){return e.check(NYe,R,Q)(H)}function R(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),U}function U(H){return H===null||fr(H)?M(H):(e.enter("htmlFlowData"),D(H))}function F(H){return H===45?(e.consume(H),O):D(H)}function N(H){return H===47?(e.consume(H),s="",z):D(H)}function z(H){if(H===62){let W=s.toLowerCase();return nV.includes(W)?(e.consume(H),J):D(H)}return id(H)&&s.length<8?(e.consume(H),s+=String.fromCharCode(H),z):D(H)}function q(H){return H===93?(e.consume(H),O):D(H)}function O(H){return H===62?(e.consume(H),J):H===45&&o===2?(e.consume(H),O):D(H)}function J(H){return H===null||fr(H)?(e.exit("htmlFlowData"),Q(H)):(e.consume(H),J)}function Q(H){return e.exit("htmlFlow"),t(H)}}function VYe(e,t,r){let n=this;return o;function o(s){return fr(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):r(s)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}function GYe(e,t,r){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ty,t,r)}}var iV={name:"htmlText",tokenize:HYe};function HYe(e,t,r){let n=this,o,i,s;return a;function a(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),l}function l(O){return O===33?(e.consume(O),c):O===47?(e.consume(O),_):O===63?(e.consume(O),b):id(O)?(e.consume(O),A):r(O)}function c(O){return O===45?(e.consume(O),u):O===91?(e.consume(O),i=0,h):id(O)?(e.consume(O),v):r(O)}function u(O){return O===45?(e.consume(O),p):r(O)}function d(O){return O===null?r(O):O===45?(e.consume(O),m):fr(O)?(s=d,N(O)):(e.consume(O),d)}function m(O){return O===45?(e.consume(O),p):d(O)}function p(O){return O===62?F(O):O===45?m(O):d(O)}function h(O){let J="CDATA[";return O===J.charCodeAt(i++)?(e.consume(O),i===J.length?f:h):r(O)}function f(O){return O===null?r(O):O===93?(e.consume(O),y):fr(O)?(s=f,N(O)):(e.consume(O),f)}function y(O){return O===93?(e.consume(O),g):f(O)}function g(O){return O===62?F(O):O===93?(e.consume(O),g):f(O)}function v(O){return O===null||O===62?F(O):fr(O)?(s=v,N(O)):(e.consume(O),v)}function b(O){return O===null?r(O):O===63?(e.consume(O),S):fr(O)?(s=b,N(O)):(e.consume(O),b)}function S(O){return O===62?F(O):b(O)}function _(O){return id(O)?(e.consume(O),w):r(O)}function w(O){return O===45||gl(O)?(e.consume(O),w):E(O)}function E(O){return fr(O)?(s=E,N(O)):_n(O)?(e.consume(O),E):F(O)}function A(O){return O===45||gl(O)?(e.consume(O),A):O===47||O===62||Ks(O)?P(O):r(O)}function P(O){return O===47?(e.consume(O),F):O===58||O===95||id(O)?(e.consume(O),T):fr(O)?(s=P,N(O)):_n(O)?(e.consume(O),P):F(O)}function T(O){return O===45||O===46||O===58||O===95||gl(O)?(e.consume(O),T):B(O)}function B(O){return O===61?(e.consume(O),D):fr(O)?(s=B,N(O)):_n(O)?(e.consume(O),B):P(O)}function D(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),o=O,M):fr(O)?(s=D,N(O)):_n(O)?(e.consume(O),D):(e.consume(O),R)}function M(O){return O===o?(e.consume(O),o=void 0,U):O===null?r(O):fr(O)?(s=M,N(O)):(e.consume(O),M)}function R(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||Ks(O)?P(O):(e.consume(O),R)}function U(O){return O===47||O===62||Ks(O)?P(O):r(O)}function F(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):r(O)}function N(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),z}function z(O){return _n(O)?Pn(e,q,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):q(O)}function q(O){return e.enter("htmlTextData"),s(O)}}var Dv={name:"labelEnd",tokenize:KYe,resolveTo:XYe,resolveAll:YYe},jYe={tokenize:QYe},qYe={tokenize:ZYe},WYe={tokenize:$Ye};function YYe(e){let t=-1;for(;++t=3&&(c===null||fr(c))?(e.exit("thematicBreak"),t(c)):r(c)}function l(c){return c===o?(e.consume(c),n++,l):(e.exit("thematicBreakSequence"),_n(c)?Pn(e,a,"whitespace")(c):a(c))}}var lc={name:"list",tokenize:iXe,continuation:{tokenize:sXe},exit:lXe},nXe={tokenize:cXe,partial:!0},oXe={tokenize:aXe,partial:!0};function iXe(e,t,r){let n=this,o=n.events[n.events.length-1],i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(p){let h=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Zw(p)){if(n.containerState.type||(n.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(kv,r,c)(p):c(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return r(p)}function l(p){return Zw(p)&&++s<10?(e.consume(p),l):(!n.interrupt||s<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):r(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(Ty,n.interrupt?r:u,e.attempt(nXe,m,d))}function u(p){return n.containerState.initialBlankLine=!0,i++,m(p)}function d(p){return _n(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):r(p)}function m(p){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function sXe(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(Ty,o,i);function o(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Pn(e,t,"listItemIndent",n.containerState.size+1)(a)}function i(a){return n.containerState.furtherBlankLines||!_n(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(oXe,t,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,Pn(e,e.attempt(lc,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function aXe(e,t,r){let n=this;return Pn(e,o,"listItemIndent",n.containerState.size+1);function o(i){let s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?t(i):r(i)}}function lXe(e){e.exit(this.containerState.type)}function cXe(e,t,r){let n=this;return Pn(e,o,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){let s=n.events[n.events.length-1];return!_n(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var oM={name:"setextUnderline",tokenize:dXe,resolveTo:uXe};function uXe(e,t){let r=e.length,n,o,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);let s={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=s,e.push(["exit",s,t]),e}function dXe(e,t,r){let n=this,o;return i;function i(c){let u=n.events.length,d;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){d=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),o=c,s(c)):r(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),_n(c)?Pn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||fr(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}var Mge={tokenize:mXe};function mXe(e){let t=this,r=e.attempt(Ty,n,e.attempt(this.parser.constructs.flowInitial,o,Pn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Jz,o)),"linePrefix")));return r;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var Bge={resolveAll:Oge()},Rge=Fge("string"),Lge=Fge("text");function Fge(e){return{tokenize:t,resolveAll:Oge(e==="text"?pXe:void 0)};function t(r){let n=this,o=this.parser.constructs[e],i=r.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),i(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let d=o[u],m=-1;if(d)for(;++m-1){let a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function hXe(e,t){let r=-1,n=[],o;for(;++r_Xe,contentInitial:()=>yXe,disable:()=>wXe,document:()=>gXe,flow:()=>xXe,flowInitial:()=>vXe,insideSpan:()=>CXe,string:()=>bXe,text:()=>SXe});var gXe={42:lc,43:lc,45:lc,48:lc,49:lc,50:lc,51:lc,52:lc,53:lc,54:lc,55:lc,56:lc,57:lc,62:Kk},yXe={91:eV},vXe={[-2]:Jw,[-1]:Jw,32:Jw},xXe={35:rV,42:kv,45:[oM,kv],60:oV,61:oM,95:kv,96:$k,126:$k},bXe={38:Zk,92:Qk},SXe={[-5]:t3,[-4]:t3,[-3]:t3,33:sV,38:Zk,42:$w,60:[Zz,iV],91:aV,92:[tV,Qk],93:Dv,95:$w,96:$z},CXe={null:[$w,Bge]},_Xe={null:[42,95]},wXe={null:[]};function cV(e){let r=bge([lV,...(e||{}).extensions||[]]),n={defined:[],lazy:{},constructs:r,content:o(Tge),document:o(Ige),flow:o(Mge),string:o(Rge),text:o(Lge)};return n;function o(i){return s;function s(a){return Nge(n,i,a)}}}function uV(e){for(;!eM(e););return e}var Uge=/[\0\t\n\r]/g;function dV(){let e=1,t="",r=!0,n;return o;function o(i,s,a){let l=[],c,u,d,m,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,t="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d0){let it=ke.tokenStack[ke.tokenStack.length-1];(it[1]||Vge).call(ke,void 0,it[0])}for(be.position={start:Py(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Py(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);let c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Qge(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Zge(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function sM(e,t){let r=t.referenceType,n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];let o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});let s=o[o.length-1];return s&&s.type==="text"?s.value+=n:o.push({type:"text",value:n}),o}function $ge(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return sM(e,t);let o={src:km(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(o.title=n.title);let i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function Jge(e,t){let r={src:km(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function e0e(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function t0e(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return sM(e,t);let o={href:km(n.url||"")};n.title!==null&&n.title!==void 0&&(o.title=n.title);let i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function r0e(e,t){let r={href:km(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);let n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n0e(e,t,r){let n=e.all(t),o=r?EXe(r):o0e(t),i={},s=[];if(typeof t.checked=="boolean"){let u=n[0],d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a1}function i0e(e,t){let r={},n=e.all(t),o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o0){let s={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},a=c2(t.children[1]),l=Yk(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function u0e(e,t,r){let n=r?r.children:void 0,i=(n?n.indexOf(t):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,a=s?s.length:t.children.length,l=-1,c=[];for(;++l0,!0),n[0]),o=n.index+n[0].length,n=r.exec(t);return i.push(m0e(t.slice(o),o>0,!1)),i.join("")}function m0e(e,t,r){let n=0,o=e.length;if(t){let i=e.codePointAt(n);for(;i===9||i===32;)n++,i=e.codePointAt(n)}if(r){let i=e.codePointAt(o-1);for(;i===9||i===32;)o--,i=e.codePointAt(o-1)}return o>n?e.slice(n,o):""}function f0e(e,t){let r={type:"text",value:p0e(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function h0e(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}var g0e={blockquote:jge,break:qge,code:Wge,delete:Yge,emphasis:Xge,footnoteReference:Kge,heading:Qge,html:Zge,imageReference:$ge,image:Jge,inlineCode:e0e,linkReference:t0e,link:r0e,listItem:n0e,list:i0e,paragraph:s0e,root:a0e,strong:l0e,table:c0e,tableCell:d0e,tableRow:u0e,text:f0e,thematicBreak:h0e,toml:aM,yaml:aM,definition:aM,footnoteDefinition:aM};function aM(){}var y0e=typeof self=="object"?self:globalThis,DXe=(e,t)=>{let r=(o,i)=>(e.set(i,o),o),n=o=>{if(e.has(o))return e.get(o);let[i,s]=t[o];switch(i){case 0:case-1:return r(s,o);case 1:{let a=r([],o);for(let l of s)a.push(n(l));return a}case 2:{let a=r({},o);for(let[l,c]of s)a[n(l)]=n(c);return a}case 3:return r(new Date(s),o);case 4:{let{source:a,flags:l}=s;return r(new RegExp(a,l),o)}case 5:{let a=r(new Map,o);for(let[l,c]of s)a.set(n(l),n(c));return a}case 6:{let a=r(new Set,o);for(let l of s)a.add(n(l));return a}case 7:{let{name:a,message:l}=s;return r(new y0e[a](l),o)}case 8:return r(BigInt(s),o);case"BigInt":return r(Object(BigInt(s)),o)}return r(new y0e[i](s),o)};return n},gV=e=>DXe(new Map,e)(0);var m2="",{toString:kXe}={},{keys:MXe}=Object,i3=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let r=kXe.call(e).slice(8,-1);switch(r){case"Array":return[1,m2];case"Object":return[2,m2];case"Date":return[3,m2];case"RegExp":return[4,m2];case"Map":return[5,m2];case"Set":return[6,m2]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},mM=([e,t])=>e===0&&(t==="function"||t==="symbol"),BXe=(e,t,r,n)=>{let o=(s,a)=>{let l=n.push(s)-1;return r.set(a,l),l},i=s=>{if(r.has(s))return r.get(s);let[a,l]=i3(s);switch(a){case 0:{let u=s;switch(l){case"bigint":a=8,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([-1],s)}return o([a,u],s)}case 1:{if(l)return o([l,[...s]],s);let u=[],d=o([a,u],s);for(let m of s)u.push(i(m));return d}case 2:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());let u=[],d=o([a,u],s);for(let m of MXe(s))(e||!mM(i3(s[m])))&&u.push([i(m),i(s[m])]);return d}case 3:return o([a,s.toISOString()],s);case 4:{let{source:u,flags:d}=s;return o([a,{source:u,flags:d}],s)}case 5:{let u=[],d=o([a,u],s);for(let[m,p]of s)(e||!(mM(i3(m))||mM(i3(p))))&&u.push([i(m),i(p)]);return d}case 6:{let u=[],d=o([a,u],s);for(let m of s)(e||!mM(i3(m)))&&u.push(i(m));return d}}let{message:c}=s;return o([a,{name:l,message:c}],s)};return i},yV=(e,{json:t,lossy:r}={})=>{let n=[];return BXe(!(t||r),!!t,new Map,n)(e),n};var p2=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gV(yV(e,t)):structuredClone(e):(e,t)=>gV(yV(e,t));function RXe(e,t){let r=[{type:"text",value:"\u21A9"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function LXe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function v0e(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||RXe,n=e.options.footnoteBackLabel||LXe,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],l=-1;for(;++l0&&h.push({type:"text",value:" "});let v=typeof r=="string"?r:r(l,p);typeof v=="string"&&(v={type:"text",value:v}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}let y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){let v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...h)}else u.push(...h);let g={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(u,!0)};e.patch(c,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:te(k({},p2(s)),{id:"footnote-label"}),children:[{type:"text",value:o}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` +`}]}}var pM=function(e){if(e==null)return UXe;if(typeof e=="function")return fM(e);if(typeof e=="object")return Array.isArray(e)?FXe(e):OXe(e);if(typeof e=="string")return NXe(e);throw new Error("Expected function, string, or object as test")};function FXe(e){let t=[],r=-1;for(;++r":""))+")"})}return m;function m(){let p=x0e,h,f,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=VXe(r(l,u)),p[0]===hM))return p;if("children"in l&&l.children){let g=l;if(g.children&&p[0]!==xV)for(f=(n?g.children.length:-1)+s,y=u.concat(g);f>-1&&f0&&r.push({type:"text",value:` +`}),r}function b0e(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function gM(e,t){let r=S0e(e,t),n=r.one(e,void 0),o=v0e(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return o&&("children"in i,i.children.push({type:"text",value:` +`},o)),i}function yM(e,t){return e&&"run"in e?function(r,n){return Y(this,null,function*(){let o=gM(r,k({file:n},t));yield e.run(o,n)})}:function(r,n){return gM(r,k({file:n},t||e))}}function CV(e){if(e)throw e}var bM=vr(D0e(),1);function a3(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function _V(){let e=[],t={run:r,use:n};return t;function r(...o){let i=-1,s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){let u=e[++i],d=-1;if(l){s(l);return}for(;++ds.length,l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){let u=c;if(a&&r)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){r||(r=!0,t(s,...a))}function i(s){o(null,s)}}var Pp={basename:YXe,dirname:XXe,extname:KXe,join:QXe,sep:"/"};function YXe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');l3(e);let r=0,n=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else n<0&&(i=!0,n=o+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(n=o):(a=-1,n=s));return r===n?n=s:n<0&&(n=e.length),e.slice(r,n)}function XXe(e){if(l3(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function KXe(e){l3(e);let t=e.length,r=-1,n=0,o=-1,i=0,s;for(;t--;){let a=e.codePointAt(t);if(a===47){if(s){n=t+1;break}continue}r<0&&(s=!0,r=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||r<0||i===0||i===1&&o===r-1&&o===n+1?"":e.slice(o,r)}function QXe(...e){let t=-1,r;for(;++t0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function $Xe(e,t){let r="",n=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),o=s,i=0;continue}}else if(r.length>0){r="",n=0,o=s,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(o+1,s):r=e.slice(o+1,s),n=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return r}function l3(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var M0e={cwd:JXe};function JXe(){return"/"}function f2(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function B0e(e){if(typeof e=="string")e=new URL(e);else if(!f2(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return eKe(e)}function eKe(e){if(e.hostname!==""){let n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,r=-1;for(;++r0){let[p,...h]=u,f=n[m][1];a3(f)&&a3(p)&&(p=(0,bM.default)(!0,f,p)),n[m]=[c,p,...h]}}}},kV=new DV().freeze();function PV(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function IV(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function EV(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function F0e(e){if(!a3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function O0e(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xM(e){return nKe(e)?e:new Mv(e)}function nKe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oKe(e){return typeof e=="string"||iKe(e)}function iKe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var sKe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",N0e=[],U0e={allowDangerousHtml:!0},aKe=/^(https?|ircs?|mailto|xmpp)$/i,lKe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function SM(e){let t=e.allowedElements,r=e.allowElement,n=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||N0e,l=e.remarkPlugins||N0e,c=e.remarkRehypeOptions?k(k({},e.remarkRehypeOptions),U0e):U0e,u=e.skipHtml,d=e.unwrapDisallowed,m=e.urlTransform||z0e,p=kV().use(iM).use(l).use(yM,c).use(a),h=new Mv;typeof n=="string"?h.value=n:(""+n,void 0),t&&s&&void 0;for(let v of lKe)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+sKe+v.id,void 0);let f=p.parse(h),y=p.runSync(f,h);return o&&(y={type:"element",tagName:"div",properties:{className:o},children:y.type==="root"?y.children:[y]}),s3(y,g),Wz(y,{Fragment:h2.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h2.jsx,jsxs:h2.jsxs,passKeys:!0,passNode:!0});function g(v,b,S){if(v.type==="raw"&&S&&typeof b=="number")return u?S.children.splice(b,1):S.children[b]={type:"text",value:v.value},b;if(v.type==="element"){let _;for(_ in Kw)if(Object.hasOwn(Kw,_)&&Object.hasOwn(v.properties,_)){let w=v.properties[_],E=Kw[_];(E===null||E.includes(v.tagName))&&(v.properties[_]=m(String(w||""),_,v))}}if(v.type==="element"){let _=t?!t.includes(v.tagName):s?s.includes(v.tagName):!1;if(!_&&r&&typeof b=="number"&&(_=!r(v,b,S)),_&&S&&typeof b=="number")return d&&v.children?S.children.splice(b,1,...v.children):S.children.splice(b,1),b}}}function z0e(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||r>-1&&t>r||n>-1&&t>n||aKe.test(e.slice(0,t))?e:""}var rg=vr(Ln());var CM=class extends pr{constructor(){super(...arguments),this.updateParams=t=>{this.plugin.managers.animation.updateParams({[t.name]:t.value})},this.updateCurrentParams=t=>{this.plugin.managers.animation.updateCurrentParams({[t.name]:t.value})},this.startOrStop=()=>{let t=this.plugin.managers.animation;t.state.animationState==="playing"?t.stop():(this.props.onStart&&this.props.onStart(),t.start())}}componentDidMount(){this.subscribe(this.plugin.managers.animation.events.updated,()=>this.forceUpdate())}render(){var t,r;let n=this.plugin.managers.animation;if(n.isEmpty)return null;let o=n.state.animationState==="playing",i=(r=(t=n.current.anim).canApply)===null||r===void 0?void 0:r.call(t,this.plugin);return(0,rg.jsxs)(rg.Fragment,{children:[(0,rg.jsx)(Hn,{params:n.getParams(),values:n.state.params,onChange:this.updateParams,isDisabled:o}),(0,rg.jsx)(Hn,{params:n.current.params,values:n.current.paramValues,onChange:this.updateCurrentParams,isDisabled:o}),(0,rg.jsx)("div",{className:"msp-flex-row",children:(0,rg.jsx)(Jt,{icon:n.state.animationState!=="playing"?void 0:mD,onClick:this.startOrStop,disabled:i!==void 0&&i.canApply===!1,children:n.state.animationState==="playing"?"Stop":i===void 0||i.canApply?"Start":i.reason||"Start"})})]})}};var $r=vr(Ln());var cKe=vr(Ln());var Ms=vr(Ln());var Ip=class extends ti{constructor(){super(...arguments),this.onChange=({name:t,value:r})=>{let n=te(k({},this.props.params),{[t]:r});this.props.events.onChange(n,this.areInitial(n),this.validate(n))}}validate(t){}areInitial(t){return C.areEqual(this.props.info.params,t,this.props.info.initialValues)}render(){return(0,Ms.jsx)(Hn,{params:this.props.info.params,values:this.props.params,onChange:this.onChange,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled})}};(function(e){function t(o){let i=Object.keys(o);for(let s of i)if(!o[s].isHidden)return!1;return!0}function r(o,i,s,a){let l=i.cells.get(a).obj,c=s.definition.params?s.definition.params(l,o):{};return{initialValues:C.getDefaultValues(c),params:c,isEmpty:t(c)}}e.infoFromAction=r;function n(o,i,s){let a=i.cells.get(s.ref),l=a.params&&a.params.definition||{};return{initialValues:a.params&&a.params.values||{},params:l,isEmpty:t(l)}}e.infoFromTransform=n})(Ip||(Ip={}));var g2=class extends ti{constructor(){super(...arguments),this.busy=new Zs(!1),this.onEnter=()=>{this.state.error||this.apply()},this.autoApplyHandle=void 0,this.events={onEnter:this.onEnter,onChange:(t,r,n)=>{this.clearAutoApply(),this.setState({params:t,isInitial:r,error:n&&n[0]},()=>{!r&&!this.state.error&&this.canAutoApply(t)&&(this.clearAutoApply(),this.autoApplyHandle=setTimeout(this.apply,50))})}},this.apply=()=>Y(this,null,function*(){var t,r;this.clearAutoApply(),this.setState({busy:!0});try{yield this.applyAction()}catch(n){console.error(n)}finally{(r=(t=this.props).onApply)===null||r===void 0||r.call(t),this.busy.next(!1)}}),this.refresh=()=>{this.setState({params:this.getInfo().initialValues,isInitial:!0,error:void 0})},this.setDefault=()=>{let t=this.getInfo(),r=C.getDefaultValues(t.params);this.setState({params:r,isInitial:C.areEqual(t.params,r,t.initialValues),error:void 0})},this.toggleExpanded=()=>{this.setState({isCollapsed:!this.state.isCollapsed})}}clearAutoApply(){this.autoApplyHandle!==void 0&&(clearTimeout(this.autoApplyHandle),this.autoApplyHandle=void 0)}componentDidMount(){this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.busy.value!==t&&this.busy.next(t)}),this.subscribe(this.busy.pipe(uA(1)),t=>{this.setState({busy:t})})}renderApply(){let t=this.canApply();return this.props.autoHideApply&&(!t||this.canAutoApply(this.state.params))?null:(0,Ms.jsxs)("div",{className:"msp-transform-apply-wrap",children:[(0,Ms.jsx)(Qt,{svg:pw,className:"msp-transform-default-params",onClick:this.setDefault,disabled:this.state.busy,title:"Set default params"}),(0,Ms.jsx)("div",{className:"msp-transform-apply-wider",children:(0,Ms.jsx)(Jt,{icon:t?ed:void 0,className:`msp-btn-commit msp-btn-commit-${t?"on":"off"}`,onClick:this.apply,disabled:!t,children:this.props.applyLabel||this.applyText()})})]})}renderDefault(){let t=this.getInfo(),r=t.isEmpty&&this.isUpdate(),n=this.getHeader(),o=this.getTransformerId(),i=this.plugin.customParamEditors.has(o)?this.plugin.customParamEditors.get(o):Ip,s=this.state.isCollapsed?"msp-transform-wrapper msp-transform-wrapper-collapsed":"msp-transform-wrapper",a=null;if(!r&&!this.state.isCollapsed){let{a:c,b:u,bCell:d}=this.getSourceAndTarget(),m=this.renderApply();a=(0,Ms.jsxs)(Ms.Fragment,{children:[(0,Ms.jsx)(i,{info:t,a:c,b:u,bCell:d,events:this.events,params:this.state.params,isDisabled:this.state.busy}),m]})}let l=(0,Ms.jsxs)("div",{className:s,style:{marginBottom:this.props.noMargin?0:void 0},children:[n!=="none"&&!this.props.wrapInExpander&&(0,Ms.jsx)("div",{className:"msp-transform-header",children:(0,Ms.jsxs)(Jt,{onClick:this.toggleExpanded,title:n.description,children:[!r&&(0,Ms.jsx)(tn,{svg:this.state.isCollapsed?tc:ec}),n.name]})}),a]});return r||!this.props.wrapInExpander?l:(0,Ms.jsx)(qs,{header:this.isUpdate()?`Update ${n==="none"?"":n.name}`:`Apply ${n==="none"?"":n.name}`,headerLeftMargin:this.props.expanderHeaderLeftMargin,children:l})}renderSimple(){var t,r,n;let o=this.getInfo(),i=this.canApply(),s=(0,Ms.jsxs)("div",{className:"msp-flex-row",children:[(0,Ms.jsx)(Jt,{icon:(t=this.props.simpleApply)===null||t===void 0?void 0:t.icon,title:(r=this.props.simpleApply)===null||r===void 0?void 0:r.title,disabled:this.state.busy||!i,onClick:this.apply,className:"msp-btn-apply-simple",children:(n=this.props.simpleApply)===null||n===void 0?void 0:n.header}),!o.isEmpty&&(0,Ms.jsx)(Wo,{icon:Oc,label:"",title:"Options",toggle:this.toggleExpanded,isSelected:!this.state.isCollapsed,disabled:this.state.busy,style:{flex:"0 0 40px",padding:0}})]});if(this.state.isCollapsed)return s;let a=this.getTransformerId(),l=this.plugin.customParamEditors.has(a)?this.plugin.customParamEditors.get(a):Ip,{a:c,b:u,bCell:d}=this.getSourceAndTarget();return(0,Ms.jsxs)(Ms.Fragment,{children:[s,(0,Ms.jsx)(l,{info:o,a:c,b:u,bCell:d,events:this.events,params:this.state.params,isDisabled:this.state.busy})]})}render(){return this.props.simpleApply?this.renderSimple():this.renderDefault()}};var cc=class extends g2{constructor(){super(...arguments),this._getInfo=_c(t=>Ip.infoFromTransform(this.plugin,this.props.state,t)),this.state={error:void 0,isInitial:!0,params:this.getInfo().initialValues,busy:!1,isCollapsed:this.props.initiallyCollapsed}}applyAction(){return this.props.customUpdate?this.props.customUpdate(this.state.params):this.plugin.state.updateTransform(this.props.state,this.props.transform.ref,this.state.params)}getInfo(){return this._getInfo(this.props.transform)}getTransformerId(){return this.props.transform.transformer.id}getHeader(){return this.props.customHeader||this.props.transform.transformer.definition.display}canApply(){let{state:t}=this.props,r=t.cells.get(this.props.transform.ref);if(!r)return!1;if(r.status==="error"){let n=t.cells.get(this.props.transform.parent);return n?n.status==="ok":!1}return!this.state.error&&!this.state.busy&&!this.state.isInitial}applyText(){return this.canApply()?"Update":"Nothing to Update"}isUpdate(){return!0}getSourceAndTarget(){let t=this.props.state.cells.get(this.props.transform.ref);return{a:this.props.state.cells.get(this.props.transform.parent).obj,b:t?.obj,bCell:t}}canAutoApply(t){let r=this.props.transform.transformer.definition.canAutoUpdate;if(!r)return!1;let{state:n}=this.props,o=n.cells.get(this.props.transform.ref);if(!o||!o.sourceRef||o.status!=="ok")return!1;let i=n.cells.get(o.sourceRef);return r({a:i.obj,b:o.obj,oldParams:this.getInfo().initialValues,newParams:t},this.plugin)}componentDidMount(){super.componentDidMount(),this.props.toggleCollapsed&&this.subscribe(this.props.toggleCollapsed,()=>this.setState({isCollapsed:!this.state.isCollapsed})),this.subscribe(this.plugin.state.events.object.updated,({ref:t,state:r})=>{this.props.transform.ref!==t||this.props.state!==r||this.state.params!==this.props.transform.params&&(this._getInfo=_c(n=>Ip.infoFromTransform(this.plugin,this.props.state,n)),this.setState({params:this.props.transform.params,isInitial:!0}))})}componentDidUpdate(t){var r;if(this.props.transform!==t.transform){let n=this.props.state.cells.get(this.props.transform.ref);this.setState({params:((r=n.params)===null||r===void 0?void 0:r.values)||{},isInitial:!0,error:void 0,simpleOnly:this.state.simpleOnly})}}};var va=vr(Ln());var _M=class extends ti{get current(){return this.plugin.managers.structure.hierarchy.behaviors.selection}componentDidMount(){this.subscribe(this.current,()=>this.forceUpdate())}get unitcell(){var t;let{selection:r}=this.plugin.managers.structure.hierarchy;if(r.structures.length===0)return null;let n=[];for(let o of r.structures){let i=o.model;i?.unitcell&&(!((t=i.unitcell)===null||t===void 0)&&t.cell.obj)&&n.push(i.unitcell)}return n.length===0?null:(0,va.jsx)(wM,{refs:n,labelMultiple:"Unit Cells"})}get customControls(){let t=[];return this.plugin.genericRepresentationControls.forEach((r,n)=>{let[o,i]=r(this.plugin.managers.structure.hierarchy.selection);o.length>0&&t.push((0,va.jsx)("div",{children:(0,va.jsx)(wM,{refs:o,labelMultiple:i})},n))}),t.length>0?t:null}render(){return(0,va.jsx)(va.Fragment,{children:(0,va.jsxs)("div",{style:{marginTop:"6px"},children:[this.unitcell,this.customControls]})})}},wM=class extends ti{constructor(){super(...arguments),this.state={showOptions:!1},this.toggleVisibility=t=>{t.preventDefault(),this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.refs),t.currentTarget.blur()},this.highlight=t=>{t.preventDefault(),this.pivot.cell.parent&&ct.Interactivity.Object.Highlight(this.plugin,{state:this.pivot.cell.parent,ref:this.props.refs.map(r=>r.cell.transform.ref)})},this.clearHighlight=t=>{t.preventDefault(),ct.Interactivity.ClearHighlights(this.plugin)},this.focus=t=>{var r;t.preventDefault();let n=!0;for(let i of this.props.refs)if(!i.cell.state.isHidden){n=!1;break}n&&this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.refs,"show");let o=[];for(let i of this.props.refs){if(i.cell.state.isHidden)continue;let s=(r=i.cell.obj)===null||r===void 0?void 0:r.data.repr.getLoci();s&&o.push(s)}this.plugin.managers.camera.focusLoci(o)},this.toggleOptions=()=>this.setState({showOptions:!this.state.showOptions})}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,t=>{var r;ru.ObjectEvent.isCell(t,(r=this.pivot)===null||r===void 0?void 0:r.cell)&&this.forceUpdate()})}get pivot(){return this.props.refs[0]}render(){let{refs:t,labelMultiple:r}=this.props;if(t.length===0)return null;let n=t[0],o,i;if(t.length===1){let{obj:s}=n.cell;if(!s)return null;o=s?.label,i=s?.description}else o=`${t.length} ${r||"Objects"}`;return(0,va.jsxs)(va.Fragment,{children:[(0,va.jsxs)("div",{className:"msp-flex-row",children:[(0,va.jsxs)("button",{className:"msp-form-control msp-control-button-label",title:`${o}. Click to focus.`,onClick:this.focus,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlign:"left"},children:[o," ",(0,va.jsx)("small",{children:i})]}),(0,va.jsx)(Qt,{svg:n.cell.state.isHidden?td:rd,toggleState:!1,className:"msp-form-control",onClick:this.toggleVisibility,title:`${n.cell.state.isHidden?"Show":"Hide"}`,small:!0,flex:!0}),t.length===1&&(0,va.jsx)(Qt,{svg:lm,className:"msp-form-control",onClick:this.toggleOptions,title:"Options",toggleState:this.state.showOptions,flex:!0})]}),t.length===1&&this.state.showOptions&&n.cell.parent&&(0,va.jsx)(va.Fragment,{children:(0,va.jsx)("div",{className:"msp-control-offset",children:(0,va.jsx)(cc,{state:n.cell.parent,transform:n.cell.transform,customHeader:"none",autoHideApply:!0})})})]})}};var AM=class extends Uc{defaultState(){return{header:"Components",isCollapsed:!1,isDisabled:!1,brand:{accent:"blue",svg:cw}}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,t=>this.setState({description:Tf.getSelectedStructuresDescription(this.plugin)}))}renderControls(){return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(MV,{}),(0,$r.jsx)(RV,{}),(0,$r.jsx)(_M,{})]})}},MV=class extends ti{constructor(){super(...arguments),this.state={isEmpty:!0,isBusy:!1,canUndo:!1},this.togglePreset=this.toggleAction("preset"),this.toggleAdd=this.toggleAction("add"),this.toggleOptions=this.toggleAction("options"),this.hideAction=()=>this.setState({action:void 0}),this.applyPreset=t=>{if(this.hideAction(),!t)return;let r=this.plugin.managers.structure,{structures:n}=r.hierarchy.selection;t.value===null?r.component.clear(n):r.component.applyPreset(n,t.value)},this.undo=()=>{let t=this.plugin.state.data.undo();t&&this.plugin.runTask(t)}}get isDisabled(){return this.state.isBusy||this.state.isEmpty}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,t=>this.setState({action:this.state.action!=="options"||t.structures.length===0?void 0:"options",isEmpty:t.structures.length===0})),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t,action:this.state.action!=="options"?void 0:"options"})}),this.subscribe(this.plugin.state.data.events.historyUpdated,({state:t})=>{this.setState({canUndo:t.canUndo})})}toggleAction(t){return()=>this.setState({action:this.state.action===t?void 0:t})}get presetControls(){return(0,$r.jsx)(sr,{items:this.presetActions,onSelect:this.applyPreset})}get presetActions(){let t=this.plugin.managers.structure.component.pivotStructure,r=this.plugin.builders.structure.representation.getPresets(t?.cell.obj);return sr.createItems(r,{label:n=>n.display.name,category:n=>n.display.group,description:n=>n.display.description})}render(){let t=this.state.canUndo?`Undo ${this.plugin.state.data.latestUndoLabel}`:"Some mistakes of the past can be undone.";return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsxs)("div",{className:"msp-flex-row",children:[(0,$r.jsx)(Wo,{icon:qh,label:"Preset",title:"Apply a representation preset for the current structure(s).",toggle:this.togglePreset,isSelected:this.state.action==="preset",disabled:this.isDisabled}),(0,$r.jsx)(Wo,{icon:Cp,label:"Add",title:"Add a new representation component for a selection.",toggle:this.toggleAdd,isSelected:this.state.action==="add",disabled:this.isDisabled}),(0,$r.jsx)(Wo,{icon:Oc,label:"",title:"Options that are applied to all applicable representations.",style:{flex:"0 0 40px",padding:0},toggle:this.toggleOptions,isSelected:this.state.action==="options",disabled:this.isDisabled}),(0,$r.jsx)(Qt,{svg:hw,className:"msp-flex-item",flex:"40px",onClick:this.undo,disabled:!this.state.canUndo||this.isDisabled,title:t})]}),this.state.action==="preset"&&this.presetControls,this.state.action==="add"&&(0,$r.jsx)("div",{className:"msp-control-offset",children:(0,$r.jsx)(c3,{onApply:this.hideAction})}),this.state.action==="options"&&(0,$r.jsx)("div",{className:"msp-control-offset",children:(0,$r.jsx)(BV,{isDisabled:this.isDisabled})})]})}},c3=class extends ti{constructor(){super(...arguments),this.state=this.createState(),this.apply=()=>{let t=this.props.forSelection?this.currentStructures:this.selectedStructures;this.props.onApply(),this.plugin.managers.structure.component.add(this.state.values,t)},this.paramsChanged=t=>this.setState({values:t})}createState(){let t=xu.getAddParams(this.plugin);return{params:t,values:C.getDefaultValues(t)}}get selectedStructures(){return this.plugin.managers.structure.component.currentStructures}get currentStructures(){return this.plugin.managers.structure.hierarchy.current.structures}render(){return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(Hn,{params:this.state.params,values:this.state.values,onChangeValues:this.paramsChanged}),(0,$r.jsx)(Jt,{icon:Cp,title:"Use Selection and optional Representation to create a new Component.",className:"msp-btn-commit msp-btn-commit-on",onClick:this.apply,style:{marginTop:"1px"},children:"Create Component"})]})}},BV=class extends ti{constructor(){super(...arguments),this.update=t=>this.plugin.managers.structure.component.setOptions(t)}componentDidMount(){this.subscribe(this.plugin.managers.structure.component.events.optionsUpdated,()=>this.forceUpdate())}render(){return(0,$r.jsx)(Hn,{params:xu.OptionsParams,values:this.plugin.managers.structure.component.state.options,onChangeValues:this.update,isDisabled:this.props.isDisabled})}},RV=class extends ti{componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,()=>{this.forceUpdate()})}render(){let t=this.plugin.managers.structure.hierarchy.currentComponentGroups;return t.length===0?null:(0,$r.jsx)("div",{style:{marginTop:"6px"},children:t.map(r=>(0,$r.jsx)(LV,{group:r},r[0].cell.transform.ref))})}},LV=class extends ti{constructor(){super(...arguments),this.state={action:void 0},this.toggleVisible=t=>{t.preventDefault(),t.currentTarget.blur(),this.plugin.managers.structure.component.toggleVisibility(this.props.group)},this.selectAction=t=>{t&&(0,t?.value)()},this.remove=()=>this.plugin.managers.structure.hierarchy.remove(this.props.group,!0),this.toggleAction=()=>this.setState({action:this.state.action==="action"?void 0:"action"}),this.toggleLabel=()=>this.setState({action:this.state.action==="label"?void 0:"label"}),this.highlight=t=>{t.preventDefault(),this.props.group[0].cell.parent&&ct.Interactivity.Object.Highlight(this.plugin,{state:this.props.group[0].cell.parent,ref:this.props.group.map(r=>r.cell.transform.ref)})},this.clearHighlight=t=>{t.preventDefault(),ct.Interactivity.ClearHighlights(this.plugin)},this.focus=()=>{let t=!0;for(let r of this.props.group)if(!r.cell.state.isHidden){t=!1;break}t&&this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.group,"show"),this.plugin.managers.camera.focusSpheres(this.props.group,r=>{var n;if(!r.cell.state.isHidden)return(n=r.cell.obj)===null||n===void 0?void 0:n.data.boundary.sphere})},this.updateLabel=t=>{this.plugin.managers.structure.component.updateLabel(this.pivot,t)}}get pivot(){return this.props.group[0]}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,t=>{ru.ObjectEvent.isCell(t,this.pivot.cell)&&this.forceUpdate()})}get colorByActions(){var t,r;let n=this.plugin.managers.structure.component,i=(t=this.pivot.representations[0].cell.transform.params)===null||t===void 0?void 0:t.colorTheme.name,s=ede(this.plugin,(r=this.pivot.cell.obj)===null||r===void 0?void 0:r.data);return sr.createItemsFromSelectOptions(s,{value:a=>()=>n.updateRepresentationsTheme(this.props.group,{color:a[0]}),selected:a=>a[0]===i})}get actions(){let t=this.plugin.managers.structure.component,r=[[sr.Header("Add Representation"),...xu.getRepresentationTypes(this.plugin,this.props.group[0]).map(n=>sr.Item(n[1],()=>t.addRepresentation(this.props.group,n[0])))]];return this.pivot.representations.length>0&&r.push([sr.Header("Set Coloring",{isIndependent:!0}),...this.colorByActions]),t.canBeModified(this.props.group[0])&&r.push([sr.Header("Modify by Selection"),sr.Item("Include",()=>t.modifyByCurrentSelection(this.props.group,"union"),{icon:sw}),sr.Item("Subtract",()=>t.modifyByCurrentSelection(this.props.group,"subtract"),{icon:aw}),sr.Item("Intersect",()=>t.modifyByCurrentSelection(this.props.group,"intersect"),{icon:lw})]),r.push(sr.Item("Select This",()=>t.selectThis(this.props.group),{icon:uv})),t.canBeModified(this.props.group[0])&&r.push(sr.Item("Edit Label",this.toggleLabel)),r}get reprLabel(){var t;let r=this.pivot;return r.representations.length===0?"No repr.":r.representations.length===1?(t=r.representations[0].cell.obj)===null||t===void 0?void 0:t.label:`${r.representations.length} reprs`}render(){var t;let r=this.pivot,n=r.cell,o=(t=n.obj)===null||t===void 0?void 0:t.label,i=this.reprLabel;return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsxs)("div",{className:"msp-flex-row",children:[(0,$r.jsxs)(Jt,{noOverflow:!0,className:"msp-control-button-label",title:`${o}. Click to focus.`,onClick:this.focus,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlign:"left"},children:[o,(0,$r.jsx)("small",{className:"msp-25-lower-contrast-text",style:{float:"right"},children:i})]}),(0,$r.jsx)(Qt,{svg:n.state.isHidden?td:rd,toggleState:!1,onClick:this.toggleVisible,title:`${n.state.isHidden?"Show":"Hide"} component`,small:!0,className:"msp-form-control",flex:!0}),(0,$r.jsx)(Qt,{svg:ua,toggleState:!1,onClick:this.remove,title:"Remove",small:!0,className:"msp-form-control",flex:!0}),(0,$r.jsx)(Qt,{svg:lm,onClick:this.toggleAction,title:"Actions",toggleState:this.state.action==="action",className:"msp-form-control",flex:!0})]}),this.state.action==="label"&&(0,$r.jsx)("div",{className:"msp-control-offset",style:{marginBottom:"6px"},children:(0,$r.jsx)(cl,{label:"Label",control:(0,$r.jsxs)("div",{style:{display:"flex",textAlignLast:"center"},children:[(0,$r.jsx)(Nc,{onChange:this.updateLabel,value:o,style:{flex:"1 1 auto",minWidth:0},className:"msp-form-control",blurOnEnter:!0,blurOnEscape:!0}),(0,$r.jsx)(Qt,{svg:ed,onClick:this.toggleLabel,className:"msp-form-control msp-control-button-label",flex:!0})]})})}),this.state.action==="action"&&(0,$r.jsxs)("div",{className:"msp-accent-offset",children:[(0,$r.jsx)("div",{style:{marginBottom:"6px"},children:(0,$r.jsx)(sr,{items:this.actions,onSelect:this.selectAction,noOffset:!0})}),(0,$r.jsx)("div",{style:{marginBottom:"6px"},children:r.representations.map(s=>(0,$r.jsx)(FV,{group:this.props.group,representation:s},s.cell.transform.ref))})]})]})}},FV=class extends ti{constructor(){super(...arguments),this.remove=()=>this.plugin.managers.structure.component.removeRepresentations(this.props.group,this.props.representation),this.toggleVisible=t=>{t.preventDefault(),t.currentTarget.blur(),this.plugin.managers.structure.component.toggleVisibility(this.props.group,this.props.representation)},this.update=t=>this.plugin.managers.structure.component.updateRepresentations(this.props.group,this.props.representation,t)}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,t=>{ru.ObjectEvent.isCell(t,this.props.representation.cell)&&this.forceUpdate()})}render(){var t;let r=this.props.representation.cell;return(0,$r.jsxs)("div",{className:"msp-representation-entry",children:[r.parent&&(0,$r.jsx)(qs,{header:`${((t=r.obj)===null||t===void 0?void 0:t.label)||""} Representation`,noOffset:!0,children:(0,$r.jsx)(cc,{state:r.parent,transform:r.transform,customHeader:"none",customUpdate:this.update,noMargin:!0})}),(0,$r.jsx)(Qt,{svg:ua,onClick:this.remove,title:"Remove",small:!0,className:"msp-default-bg",toggleState:!1,style:{position:"absolute",top:0,right:"32px",lineHeight:"24px",height:"24px",textAlign:"right",width:"44px",paddingRight:"6px",background:"none"}}),(0,$r.jsx)(Qt,{svg:this.props.representation.cell.state.isHidden?td:rd,toggleState:!1,onClick:this.toggleVisible,title:"Toggle Visibility",small:!0,className:"msp-default-bg",style:{position:"absolute",top:0,right:0,lineHeight:"24px",height:"24px",textAlign:"right",width:"32px",paddingRight:"6px",background:"none"}})]})}};var on=vr(Ln());var kr=vr(Ln()),G0e=vr(Ui());function uKe(e,t){var r;let n=[],o=t==="auth"?"auth_asym_id":"label_asym_id",i=t==="auth"?"auth_seq_id":"label_seq_id";for(let a of e)if(a.kind==="range")n.push(oe.struct.generator.atomGroups({"chain-test":oe.core.rel.eq([oe.ammp(o),a.asym_id]),"residue-test":oe.core.rel.inRange([oe.ammp(i),a.seq_id_beg,a.seq_id_end])}));else{let l=((r=a.ins_code)!==null&&r!==void 0?r:"").trim();n.push(oe.struct.generator.atomGroups({"chain-test":oe.core.rel.eq([oe.ammp(o),a.asym_id]),"residue-test":oe.core.logic.and([oe.core.rel.eq([oe.ammp(i),a.seq_id]),oe.core.rel.eq([oe.ammp("pdbx_PDB_ins_code"),l])])}))}let s=oe.struct.combinator.merge(n);return ip(s)}function dKe(e){let t=cn.create();for(let[n,o]of e)for(let i=n;i<=o;i++)cn.add(t,i,i);let r=oe.struct.generator.atomGroups({"atom-test":oe.core.set.has([oe.set(...t.array),oe.ammp("id")])});return ip(r)}function mKe(e,t,r){if(!(!e||t.length===0||Number.isNaN(+t[0])))return Number.isNaN(r)?{kind:"single",asym_id:e,seq_id:+t[0],ins_code:t[1]}:{kind:"range",asym_id:e,seq_id_beg:+t[0],seq_id_end:r}}function pKe(e){return e?e.split(":"):[]}function fKe(e){return e.split(",").map(t=>t.trim().split(/\s+|[-]/g).filter(r=>!!r)).map(t=>mKe(t[0],pKe(t[1]),+t[2])).filter(t=>!!t)}function hKe(e){return e.split(",").map(t=>t.trim().split(/\s+|[-]/g).filter(r=>!!r)).filter(t=>t.length===1||t.length===2).map(t=>t.length===1?[+t[0],+t[0]]:[+t[0],+t[1]])}function V0e(e,t){if(t==="atom-id"){let r=hKe(e);return dKe(r)}else{let r=fKe(e);return uKe(r,t)}}var hr=vr(Ln()),PM=vr(Ui());function gKe(e){return Object.keys(e).map(t=>[t,e[t]]).filter(t=>_t.isBinding(t[1]))}var y2=class extends PM.PureComponent{getBindingComponents(){let t=gKe(this.props.bindings);return(0,hr.jsx)(hr.Fragment,{children:t.map(r=>{let[n,o]=r;return _t.isEmpty(o)?null:(0,hr.jsxs)("div",{style:{marginBottom:"6px"},children:[(0,hr.jsx)("b",{children:o.action}),(0,hr.jsx)("br",{}),(0,hr.jsx)("span",{dangerouslySetInnerHTML:{__html:_t.format(o,n)}})]},n)})})}render(){return(0,hr.jsx)(sd,{children:this.getBindingComponents()})}},sd=class extends PM.PureComponent{render(){return(0,hr.jsx)("div",{className:"msp-help-text",children:(0,hr.jsx)("div",{children:this.props.children})})}},ad=class extends PM.PureComponent{constructor(){super(...arguments),this.state={header:this.props.header,isExpanded:!!this.props.initiallyExpanded},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){return(0,hr.jsxs)("div",{className:"msp-control-group-wrapper",children:[(0,hr.jsx)("div",{className:"msp-control-group-header",children:(0,hr.jsxs)(Jt,{onClick:this.toggleExpanded,children:[(0,hr.jsx)(tn,{svg:this.state.isExpanded?ec:tc}),this.props.header]})}),this.state.isExpanded&&(0,hr.jsx)("div",{className:"msp-control-offset",style:{display:this.state.isExpanded?"block":"none"},children:this.props.children})]})}};function OV(e){return(0,hr.jsx)("div",{className:"msp-simple-help-section",children:e.header})}var Bv=class extends pr{constructor(){super(...arguments),this.getInteractionBindings=_c(t=>{let r;return t.forEach(n=>{var o;let i=(o=n.params)===null||o===void 0?void 0:o.values;i?.bindings&&Object.keys(i.bindings).length>0&&(r||(r={}),Object.assign(r,i.bindings))}),r})}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate())}render(){let t=this.getInteractionBindings(this.plugin.state.behaviors.cells);return(0,hr.jsxs)(hr.Fragment,{children:[!this.props.selectOnly&&this.plugin.canvas3d&&(0,hr.jsx)(ad,{header:"Moving in 3D",children:(0,hr.jsx)(y2,{bindings:this.plugin.canvas3d.props.trackball.bindings})},"trackball"),!!t&&(0,hr.jsx)(ad,{header:"Mouse & Key Controls",children:(0,hr.jsx)(y2,{bindings:t})},"interactions")]})}},TM=class extends pr{componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate())}formatTriggers(t){return t.triggers.map(r=>_t.Trigger.format(r)).join(" or ")}getTriggerFor(t,r){let o=this.plugin.state.behaviors.select(qt.Generators.ofTransformer(t)),i=o.length===1?o[0].params:void 0,s=i?i.values.bindings:{},a=r in s?s[r]:_t.Empty;return this.formatTriggers(a)}render(){let t=this.getTriggerFor(g6,"clickSelectToggle"),r=this.getTriggerFor(tv,"clickFocus");return(0,hr.jsxs)("div",{children:[(0,hr.jsx)(OV,{header:"Interface Controls"}),(0,hr.jsxs)(ad,{header:"Inline Help",children:[(0,hr.jsx)(sd,{children:"Many user interface elements show a little questionmark icon when hovered over. Clicking the icon toggles the display of an inline help text."}),(0,hr.jsx)(sd,{children:"Tooltips may provide additional information on a user interface element and are shown when hovering over it with the mouse."})]}),(0,hr.jsx)(ad,{header:"Selections",children:(0,hr.jsxs)(sd,{children:["The viewer allows changing colors and representations for selections of atoms, residues or chains. Selections can be created by",(0,hr.jsxs)("ul",{style:{paddingLeft:"20px"},children:[(0,hr.jsxs)("li",{children:["picking elements on the 3D canvas or the sequence view using the mouse, e.g. toggle selection using ",t," (for more see help section on ",(0,hr.jsx)("i",{children:"Mouse Controls"}),")"]}),(0,hr.jsxs)("li",{children:["using the ",(0,hr.jsx)("i",{children:"Add"}),", ",(0,hr.jsx)("i",{children:"Remove"})," and ",(0,hr.jsx)("i",{children:"Only"})," dropdown buttons in the ",(0,hr.jsx)("i",{children:"Manage Selection"})," panel which allow modifing the current selection by predefined sets"]})]})]})}),(0,hr.jsx)(ad,{header:"Coloring",children:(0,hr.jsxs)(sd,{children:["There are two ways to color structures. Every representation (e.g. cartoon or spacefill) has a color theme which can be changed using the dropdown for each representation in the ",(0,hr.jsx)("i",{children:"Structure Settings"})," panel. Additionally any selection atoms, residues or chains can by given a custom color. For that, first select the parts of the structure to be colored (see help section on ",(0,hr.jsx)("i",{children:"Selections"}),") and, second, choose a color from the color dropdown botton in the ",(0,hr.jsx)("i",{children:"Selection"})," row of the ",(0,hr.jsx)("i",{children:"Change Representation"})," panel. The theme color can be seen as a base color that is overpainted by the custom color. Custom colors can be removed for a selection with the 'Clear' option in the color dropdown."]})}),(0,hr.jsx)(ad,{header:"Representations",children:(0,hr.jsxs)(sd,{children:["Structures can be shown with many different representations (e.g. cartoon or spacefill). The ",(0,hr.jsx)("i",{children:"Change Representation"})," panel offers a collection of predefined styles which can be applied using the ",(0,hr.jsx)("i",{children:"Preset"})," dropdown button. Additionally any selection atoms, residues or chains can by shown with a custom representation. For that, first select the parts of the structure to be mofified (see help section on ",(0,hr.jsx)("i",{children:"Selections"}),") and, second, choose a representation to hide or show from the ",(0,hr.jsx)("i",{children:"Show"})," and ",(0,hr.jsx)("i",{children:"Hide"})," dropdown bottons in the ",(0,hr.jsx)("i",{children:"Selection"})," row of the ",(0,hr.jsx)("i",{children:"Change Representation"})," panel. The ",(0,hr.jsx)("i",{children:"Everything"})," row applies the action to the whole structure instead of the current selection."]})}),(0,hr.jsx)(ad,{header:"Surroundings",children:(0,hr.jsxs)(sd,{children:["To show the surroundings of a residue or ligand, click it in the 3D scene or in the sequence widget using ",r,"."]})}),(0,hr.jsx)(OV,{header:"How-to Guides"}),(0,hr.jsx)(ad,{header:"Create an Image",children:(0,hr.jsxs)(sd,{children:[(0,hr.jsxs)("p",{children:["Use the ",(0,hr.jsx)(tn,{svg:zde})," icon in the viewport to bring up the screenshot controls."]}),(0,hr.jsxs)("p",{children:["To adjust the size of the image, use the ",(0,hr.jsx)("i",{children:"Resolution"})," dropdown."]})]})}),(0,hr.jsx)(OV,{header:"Mouse Controls"}),(0,hr.jsx)(Bv,{})]})}};var Iy=class extends ti{constructor(){super(...arguments),this._toggleSelMode=()=>{this.plugin.selectionMode=!this.plugin.selectionMode}}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.layout.events.updated,()=>this.forceUpdate()),this.subscribe(this.plugin.behaviors.interaction.selectionMode,()=>this.forceUpdate())}render(){let t=this.props.inline?{background:"transparent",width:"auto",height:"auto",lineHeight:"unset"}:{background:"transparent"};return(0,kr.jsx)(Qt,{svg:Jde,onClick:this._toggleSelMode,title:"Toggle Selection Mode",style:t,toggleState:this.plugin.selectionMode})}},yKe={granularity:ay.Params.granularity},v2=new Map([["add","Add/Union Selection"],["remove","Remove/Subtract Selection"],["intersect","Intersect Selection"],["set","Set Selection"]]),IM=class extends pr{constructor(){super(...arguments),this.state={action:void 0,helper:void 0,isEmpty:!0,isBusy:!1,canUndo:!1},this.set=(t,r)=>{this.plugin.managers.structure.selection.fromSelectionQuery(t,r,!1)},this.selectQuery=(t,r)=>{if(!t||!this.state.action){this.setState({action:void 0});return}let n=this.state.action;r?.shiftKey?this.set(n,t.value):this.setState({action:void 0},()=>{this.set(n,t.value)})},this.selectHelper=(t,r)=>{if(console.log(t),!t||!this.state.action){this.setState({action:void 0,helper:void 0});return}this.setState({helper:t.value.kind})},this.queriesItems=[],this.queriesVersion=-1,this.helpersItems=void 0,this.toggleAdd=this.showAction("add"),this.toggleRemove=this.showAction("remove"),this.toggleIntersect=this.showAction("intersect"),this.toggleSet=this.showAction("set"),this.toggleTheme=this.showAction("theme"),this.toggleAddComponent=this.showAction("add-component"),this.toggleHelp=this.showAction("help"),this.setGranuality=({value:t})=>{this.plugin.managers.interactivity.setProps({granularity:t})},this.turnOff=()=>this.plugin.selectionMode=!1,this.undo=()=>{let t=this.plugin.state.data.undo();t&&this.plugin.runTask(t)},this.subtract=()=>{let t=this.plugin.managers.structure.hierarchy.getStructuresWithSelection(),r=[];for(let n of t)r.push(...n.components);r.length!==0&&this.plugin.managers.structure.component.modifyByCurrentSelection(r,"subtract")}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,t=>{let r=t.hierarchy.structures.length===0;this.state.isEmpty!==r&&this.setState({isEmpty:r}),this.queriesVersion=-1,this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t,action:void 0})}),this.subscribe(this.plugin.managers.interactivity.events.propsUpdated,()=>{this.forceUpdate()}),this.subscribe(this.plugin.state.data.events.historyUpdated,({state:t})=>{this.setState({canUndo:t.canUndo})})}get isDisabled(){return this.state.isBusy||this.state.isEmpty}get structures(){var t;let r=[];for(let n of this.plugin.managers.structure.hierarchy.selection.structures){let o=(t=n.cell.obj)===null||t===void 0?void 0:t.data;o&&r.push(o)}return r}get queries(){let{registry:t}=this.plugin.query.structure;if(t.version!==this.queriesVersion){let r=this.structures,n=[...t.list,...gse(r),...hse(r),...fse(r)].sort((o,i)=>i.priority-o.priority);this.queriesItems=sr.createItems(n,{filter:o=>o!==ei.current&&!o.isHidden,label:o=>o.label,category:o=>o.category,description:o=>o.description}),this.queriesVersion=t.version}return this.queriesItems}get helpers(){if(this.helpersItems)return this.helpersItems;let t=[{kind:"residue-list",category:"Helpers",label:"Atom/Residue Identifier List",description:"Create a selection from a list of atom/residue ranges."}];return this.helpersItems=sr.createItems(t,{label:r=>r.label,category:r=>r.category,description:r=>r.description}),this.helpersItems}showAction(t){return()=>this.setState({action:this.state.action===t?void 0:t,helper:void 0})}render(){let t=this.plugin.managers.interactivity.props.granularity,r=this.state.canUndo?`Undo ${this.plugin.state.data.latestUndoLabel}`:"Some mistakes of the past can be undone.",n;if(this.state.action&&!this.state.helper)n=(0,kr.jsxs)(kr.Fragment,{children:[this.state.action&&this.state.action!=="theme"&&this.state.action!=="add-component"&&this.state.action!=="help"&&(0,kr.jsxs)("div",{className:"msp-selection-viewport-controls-actions",children:[(0,kr.jsx)(sr,{header:v2.get(this.state.action),title:"Click to close.",items:this.queries,onSelect:this.selectQuery,noOffset:!0}),(0,kr.jsx)(sr,{items:this.helpers,onSelect:this.selectHelper,noOffset:!0})]}),this.state.action==="theme"&&(0,kr.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,kr.jsx)(ll,{header:"Theme",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleTheme,topRightIcon:Fc,children:(0,kr.jsx)(NV,{onApply:this.toggleTheme})})}),this.state.action==="add-component"&&(0,kr.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,kr.jsx)(ll,{header:"Add Component",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleAddComponent,topRightIcon:Fc,children:(0,kr.jsx)(c3,{onApply:this.toggleAddComponent,forSelection:!0})})}),this.state.action==="help"&&(0,kr.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,kr.jsxs)(ll,{header:"Help",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleHelp,topRightIcon:Fc,maxHeight:"300px",children:[(0,kr.jsx)(ad,{header:"Selection Operations",children:(0,kr.jsxs)(sd,{children:["Use ",(0,kr.jsx)(tn,{svg:sw,inline:!0})," ",(0,kr.jsx)(tn,{svg:aw,inline:!0})," ",(0,kr.jsx)(tn,{svg:lw,inline:!0})," ",(0,kr.jsx)(tn,{svg:uv,inline:!0})," to modify the selection."]})}),(0,kr.jsx)(ad,{header:"Representation Operations",children:(0,kr.jsxs)(sd,{children:["Use ",(0,kr.jsx)(tn,{svg:uD,inline:!0})," ",(0,kr.jsx)(tn,{svg:cw,inline:!0})," ",(0,kr.jsx)(tn,{svg:fw,inline:!0})," ",(0,kr.jsx)(tn,{svg:hw,inline:!0})," to color, create components, remove from components, or undo actions."]})}),(0,kr.jsx)(Bv,{selectOnly:!0})]})})]});else if(v2.has(this.state.action)&&this.state.helper==="residue-list"){let o=()=>this.setState({action:void 0,helper:void 0});n=(0,kr.jsx)("div",{className:"msp-selection-viewport-controls-actions",children:(0,kr.jsx)(ll,{header:"Atom/Residue Identifier List",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:o,topRightIcon:Fc,children:(0,kr.jsx)(xKe,{modifier:this.state.action,plugin:this.plugin,close:o})})})}return(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsxs)("div",{className:"msp-flex-row",style:{background:"none"},children:[(0,kr.jsx)(wf,{title:"Picking Level for selecting and highlighting",param:yKe.granularity,name:"granularity",value:t,onChange:this.setGranuality,isDisabled:this.isDisabled}),(0,kr.jsx)(Wo,{icon:sw,title:`${v2.get("add")}. Hold shift key to keep menu open.`,toggle:this.toggleAdd,isSelected:this.state.action==="add",disabled:this.isDisabled}),(0,kr.jsx)(Wo,{icon:aw,title:`${v2.get("remove")}. Hold shift key to keep menu open.`,toggle:this.toggleRemove,isSelected:this.state.action==="remove",disabled:this.isDisabled}),(0,kr.jsx)(Wo,{icon:lw,title:`${v2.get("intersect")}. Hold shift key to keep menu open.`,toggle:this.toggleIntersect,isSelected:this.state.action==="intersect",disabled:this.isDisabled}),(0,kr.jsx)(Wo,{icon:uv,title:`${v2.get("set")}. Hold shift key to keep menu open.`,toggle:this.toggleSet,isSelected:this.state.action==="set",disabled:this.isDisabled}),(0,kr.jsx)(Wo,{icon:uD,title:"Apply Theme to Selection",toggle:this.toggleTheme,isSelected:this.state.action==="theme",disabled:this.isDisabled,style:{marginLeft:"10px"}}),(0,kr.jsx)(Wo,{icon:cw,title:"Create Component of Selection with Representation",toggle:this.toggleAddComponent,isSelected:this.state.action==="add-component",disabled:this.isDisabled}),(0,kr.jsx)(Qt,{svg:fw,title:"Remove/subtract Selection from all Components",onClick:this.subtract,disabled:this.isDisabled}),(0,kr.jsx)(Qt,{svg:hw,onClick:this.undo,disabled:!this.state.canUndo||this.isDisabled,title:r}),(0,kr.jsx)(Wo,{icon:rc,title:"Show/hide help",toggle:this.toggleHelp,style:{marginLeft:"10px"},isSelected:this.state.action==="help"}),this.plugin.config.get(Tr.Viewport.ShowSelectionMode)&&(0,kr.jsx)(Qt,{svg:uw,title:"Turn selection mode off",onClick:this.turnOff})]}),n]})}},EM=class extends pr{constructor(){super(...arguments),this.state={isEmpty:!0,isBusy:!1},this.clear=()=>this.plugin.managers.interactivity.lociSelects.deselectAll(),this.focus=()=>{if(this.plugin.managers.structure.selection.stats.elementCount===0)return;let{sphere:t}=this.plugin.managers.structure.selection.getBoundary();this.plugin.managers.camera.focusSphere(t)},this.highlight=t=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights(),this.plugin.managers.structure.selection.entries.forEach(r=>{this.plugin.managers.interactivity.lociHighlights.highlight({loci:r.selection},!1)})},this.clearHighlight=()=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights()}}componentDidMount(){this.subscribe(this.plugin.managers.structure.selection.events.changed,()=>{this.forceUpdate()}),this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,t=>{let r=t.structures.length===0;this.state.isEmpty!==r&&this.setState({isEmpty:r})}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t})})}get isDisabled(){return this.state.isBusy||this.state.isEmpty}get stats(){let t=this.plugin.managers.structure.selection.stats;return t.structureCount===0||t.elementCount===0?"Nothing Selected":`${Hm(t.label)} Selected`}render(){let t=this.plugin.managers.structure.selection.stats,r=t.structureCount===0||t.elementCount===0;return r&&this.props.hideOnEmpty?null:(0,kr.jsx)(kr.Fragment,{children:(0,kr.jsxs)("div",{className:"msp-flex-row",children:[(0,kr.jsx)(Jt,{noOverflow:!0,onClick:this.focus,title:"Click to Focus Selection",disabled:r,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlignLast:r?void 0:"left"},children:this.stats}),!r&&(0,kr.jsx)(Qt,{svg:uw,onClick:this.clear,title:"Clear",className:"msp-form-control",flex:!0})]})})}},NV=class extends ti{constructor(){super(...arguments),this._params=_c(t=>xu.getThemeParams(this.plugin,t)),this.state={values:C.getDefaultValues(this.params)},this.apply=()=>{var t,r;this.plugin.managers.structure.component.applyTheme(this.state.values,this.plugin.managers.structure.hierarchy.current.structures),(r=(t=this.props).onApply)===null||r===void 0||r.call(t)},this.paramsChanged=t=>this.setState({values:t})}get params(){return this._params(this.plugin.managers.structure.component.pivotStructure)}render(){return(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(Hn,{params:this.params,values:this.state.values,onChangeValues:this.paramsChanged}),(0,kr.jsx)(Jt,{icon:uD,className:"msp-btn-commit msp-btn-commit-on",onClick:this.apply,style:{marginTop:"1px"},children:"Apply Theme"})]})}},H0e={idType:C.Select("auth",C.arrayToOptions(["auth","label","atom-id"])),identifiers:C.Text("",{description:"A comma separated list of atom identifiers (e.g. 10, 15-25) or residue ranges in given chain (e.g. A 10-15, B 25, C 30:i)"})},vKe=C.getDefaultValues(H0e);function xKe({modifier:e,plugin:t,close:r}){let[n,o]=G0e.useState(vKe),i=()=>{if(n.identifiers.trim().length!==0)try{r();let s=V0e(n.identifiers,n.idType);t.managers.structure.selection.fromCompiledQuery(e,s,!1)}catch(s){console.error(s),t.log.error("Failed to create selection")}};return(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(Hn,{params:H0e,values:n,onChangeValues:o,onEnter:i}),(0,kr.jsxs)(Jt,{className:"msp-btn-commit msp-btn-commit-on",disabled:n.identifiers.trim().length===0,onClick:i,style:{marginTop:"1px"},children:[Gp(e)," Selection"]})]})}var DM=class extends Uc{defaultState(){return{isCollapsed:!1,header:"Measurements",brand:{accent:"gray",svg:Lde}}}renderControls(){return(0,on.jsxs)(on.Fragment,{children:[(0,on.jsx)(zV,{}),(0,on.jsx)(UV,{})]})}},UV=class extends ti{componentDidMount(){this.subscribe(this.plugin.managers.structure.measurement.behaviors.state,()=>{this.forceUpdate()})}renderGroup(t,r){let n=[];for(let o of t)o.obj&&n.push((0,on.jsx)(GV,{cell:o},o.obj.id));return n.length?(0,on.jsx)(qs,{header:r,initiallyExpanded:!0,children:n}):null}render(){let t=this.plugin.managers.structure.measurement.state;return(0,on.jsxs)("div",{style:{marginTop:"6px"},children:[this.renderGroup(t.labels,"Labels"),this.renderGroup(t.distances,"Distances"),this.renderGroup(t.angles,"Angles"),this.renderGroup(t.dihedrals,"Dihedrals"),this.renderGroup(t.orientations,"Orientations"),this.renderGroup(t.planes,"Planes")]})}},zV=class extends ti{constructor(){super(...arguments),this.state={isBusy:!1,action:void 0},this.measureDistance=()=>{let t=this.plugin.managers.structure.selection.additionsHistory;this.plugin.managers.structure.measurement.addDistance(t[0].loci,t[1].loci)},this.measureAngle=()=>{let t=this.plugin.managers.structure.selection.additionsHistory;this.plugin.managers.structure.measurement.addAngle(t[0].loci,t[1].loci,t[2].loci)},this.measureDihedral=()=>{let t=this.plugin.managers.structure.selection.additionsHistory;this.plugin.managers.structure.measurement.addDihedral(t[0].loci,t[1].loci,t[2].loci,t[3].loci)},this.addLabel=()=>{let t=this.plugin.managers.structure.selection.additionsHistory;this.plugin.managers.structure.measurement.addLabel(t[0].loci)},this.addOrientation=()=>{let t=[];this.plugin.managers.structure.selection.entries.forEach(r=>{t.push(r.selection)}),this.plugin.managers.structure.measurement.addOrientation(t)},this.addPlane=()=>{let t=[];this.plugin.managers.structure.selection.entries.forEach(r=>{t.push(r.selection)}),this.plugin.managers.structure.measurement.addPlane(t)},this.selectAction=t=>{this.toggleAdd(),t&&(0,t?.value)()},this.toggleAdd=()=>this.setState({action:this.state.action==="add"?void 0:"add"}),this.toggleOptions=()=>this.setState({action:this.state.action==="options"?void 0:"options"})}componentDidMount(){this.subscribe(this.selection.events.additionsHistoryUpdated,()=>{this.forceUpdate(),this.updateOrderLabels()}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t})})}componentWillUnmount(){this.clearOrderLabels(),super.componentWillUnmount()}componentDidUpdate(t,r){this.state.action!==r.action&&this.updateOrderLabels()}clearOrderLabels(){this.plugin.managers.structure.measurement.addOrderLabels([])}updateOrderLabels(){if(this.state.action!=="add"){this.clearOrderLabels();return}let t=[],r=this.selection.additionsHistory;for(let n=0;nthis.highlight(t.loci),onMouseLeave:()=>this.plugin.managers.interactivity.lociHighlights.clearHighlights(),children:[(0,on.jsxs)(Jt,{noOverflow:!0,title:"Click to focus. Hover to highlight.",onClick:()=>this.focusLoci(t.loci),style:{width:"auto",textAlign:"left"},children:[r,". ",(0,on.jsx)("span",{dangerouslySetInnerHTML:{__html:t.label}})]}),n.length>1&&(0,on.jsx)(Qt,{svg:iy,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(t,"up"),flex:"20px",title:"Move up"}),n.length>1&&(0,on.jsx)(Qt,{svg:oy,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(t,"down"),flex:"20px",title:"Move down"}),(0,on.jsx)(Qt,{svg:ua,small:!0,className:"msp-form-control",onClick:()=>this.plugin.managers.structure.selection.modifyHistory(t,"remove"),flex:!0,title:"Remove"})]},t.id)}add(){let t=this.plugin.managers.structure.selection.additionsHistory,r=[];for(let i=0,s=Math.min(t.length,4);i0&&(0,on.jsx)("div",{className:"msp-control-offset",children:r}),r.length===0&&(0,on.jsx)("div",{className:"msp-control-offset msp-help-text",children:(0,on.jsxs)("div",{className:"msp-help-description",children:[(0,on.jsx)(tn,{svg:rc,inline:!0}),"Add one or more selections",o]})})]})}render(){return(0,on.jsxs)(on.Fragment,{children:[(0,on.jsxs)("div",{className:"msp-flex-row",children:[(0,on.jsx)(Wo,{icon:Cp,label:"Add",toggle:this.toggleAdd,isSelected:this.state.action==="add",disabled:this.state.isBusy,className:"msp-btn-apply-simple"}),(0,on.jsx)(Wo,{icon:Oc,label:"",title:"Options",toggle:this.toggleOptions,isSelected:this.state.action==="options",disabled:this.state.isBusy,style:{flex:"0 0 40px",padding:0}})]}),this.state.action==="add"&&this.add(),this.state.action==="options"&&(0,on.jsx)(VV,{})]})}},VV=class extends ti{constructor(){super(...arguments),this.state={isDisabled:!1},this.changed=t=>{this.plugin.managers.structure.measurement.setOptions(t)}}componentDidMount(){this.subscribe(this.plugin.managers.structure.measurement.behaviors.state,()=>{this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isDisabled:t})})}render(){let t=this.plugin.managers.structure.measurement.state;return(0,on.jsx)("div",{className:"msp-control-offset",children:(0,on.jsx)(Hn,{params:c8,values:t.options,onChangeValues:this.changed,isDisabled:this.state.isDisabled})})}},GV=class extends ti{constructor(){super(...arguments),this.state={showUpdate:!1},this.delete=()=>{ct.State.RemoveObject(this.plugin,{state:this.props.cell.parent,ref:this.props.cell.transform.parent,removeParentGhosts:!0})},this.toggleVisibility=t=>{t.preventDefault(),ct.State.ToggleVisibility(this.plugin,{state:this.props.cell.parent,ref:this.props.cell.transform.parent}),t.currentTarget.blur()},this.highlight=()=>{var t;if(!this.selections)return;this.plugin.managers.interactivity.lociHighlights.clearHighlights();for(let o of this.lociArray)this.plugin.managers.interactivity.lociHighlights.highlight({loci:o},!1);let n=(t=this.props.cell.obj)===null||t===void 0?void 0:t.data.repr.getAllLoci();if(n)for(let o of n)this.plugin.managers.interactivity.lociHighlights.highlight({loci:o},!1)},this.clearHighlight=()=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights()},this.toggleUpdate=()=>this.setState({showUpdate:!this.state.showUpdate}),this.focus=()=>{if(!this.selections)return;let r=Ht.getBundleBoundingSphere({loci:this.lociArray});r&&this.plugin.managers.camera.focusSphere(r)},this.selectAction=t=>{t&&(this.setState({showUpdate:!1}),(0,t?.value)())}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,t=>{this.forceUpdate()})}get selections(){var t;return(t=this.props.cell.obj)===null||t===void 0?void 0:t.data.sourceData}get lociArray(){let t=this.selections;return t?t.infos?[t.infos[0].loci]:t.pairs?t.pairs[0].loci:t.triples?t.triples[0].loci:t.quads?t.quads[0].loci:t.locis?t.locis:[]:[]}get label(){let t=this.selections;return t?t.infos?Qd(t.infos[0].loci,{condensed:!0}):t.pairs?Lb(t.pairs[0],{condensed:!0,unitLabel:this.plugin.managers.structure.measurement.state.options.distanceUnitLabel}):t.triples?Fb(t.triples[0],{condensed:!0}):t.quads?Ob(t.quads[0],{condensed:!0}):t.locis?w0(t.locis,{countsOnly:!0}):"":""}get actions(){return this.props.cell.sourceRef,[sr.Item("Select This",()=>this.plugin.managers.structure.selection.fromSelections(this.props.cell.sourceRef),{icon:uv})]}render(){let{cell:t}=this.props,{obj:r}=t;return r?(0,on.jsxs)(on.Fragment,{children:[(0,on.jsxs)("div",{className:"msp-flex-row",onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,children:[(0,on.jsx)("button",{className:"msp-form-control msp-control-button-label msp-no-overflow",title:"Click to focus. Hover to highlight.",onClick:this.focus,style:{width:"auto",textAlign:"left"},children:(0,on.jsx)("span",{dangerouslySetInnerHTML:{__html:this.label}})}),(0,on.jsx)(Qt,{svg:t.state.isHidden?td:rd,toggleState:!1,small:!0,className:"msp-form-control",onClick:this.toggleVisibility,flex:!0,title:t.state.isHidden?"Show":"Hide"}),(0,on.jsx)(Qt,{svg:ua,small:!0,className:"msp-form-control",onClick:this.delete,flex:!0,title:"Delete",toggleState:!1}),(0,on.jsx)(Qt,{svg:lm,className:"msp-form-control",onClick:this.toggleUpdate,flex:!0,title:"Actions",toggleState:this.state.showUpdate})]},r.id),this.state.showUpdate&&t.parent&&(0,on.jsx)(on.Fragment,{children:(0,on.jsxs)("div",{className:"msp-accent-offset",children:[(0,on.jsx)(sr,{items:this.actions,onSelect:this.selectAction,noOffset:!0}),(0,on.jsx)(qs,{header:"Options",noOffset:!0,children:(0,on.jsx)(cc,{state:t.parent,transform:t.transform,customHeader:"none",autoHideApply:!0})})]})})]}):null}};var Dl=vr(Ln());var Nf=vr(Ln());function HV(e,t,r,n){let o=Fe.indexOf(t.unit.elements,t.element),i=$.Loci(t.structure,[{unit:t.unit,indices:Te.ofSingleton(o)}]),s=n==="residue"?$.Loci.extendToWholeResidues(i):$.Loci.extendToWholeChains(i),a=Ne.entity.pdbx_description(t).join(", ");for(let l of r.units){let c=$.Loci(s.structure,[{unit:l,indices:s.elements[0].indices}]),u=Qd(c,{reverse:!0,hidePrefix:!0,htmlStyling:!1,granularity:n});u||(u=Qd(c,{hidePrefix:!1,htmlStyling:!1})),r.units.length>1&&(u+=` | ${c.elements[0].unit.conformation.operator.name}`);let d={label:u,category:a,loci:c};e.has(a)?e.get(a).push(d):e.set(a,[d])}}function bKe(e){let t=new Map,r=$.Location.create(e);for(let o of e.unitSymmetryGroups){if(!_e.isAtomic(o.units[0]))continue;r.unit=o.units[0],r.element=o.elements[0];let i=_e.Traits.is(r.unit.traits,_e.Trait.MultiChain),s=Ne.entity.type(r),a=s==="non-polymer",l=s==="branched";if(!!Ne.entity.prd_id(r))HV(t,r,o,"chain");else if(a&&!i)HV(t,r,o,"residue");else if(l||a&&i){let u=r.unit,{index:d}=u.model.atomicHierarchy.residueAtomSegments,m=-1;for(let p=0,h=u.elements.length;p{o.length===1?n.push({label:`${i}: ${o[0].label}`,loci:o[0].loci}):o.length<2e3&&n.push(...o)}),n}var kM=class extends pr{constructor(){super(...arguments),this.state={isBusy:!1,showAction:!1},this.getSelectionItems=_c(t=>{var r;let n=[];for(let o of t){let i=(r=o.cell.obj)===null||r===void 0?void 0:r.data;if(i){let s=bKe(i);s.length>0&&n.push([sr.Header(i.label,{description:i.label}),...sr.createItems(s,{label:a=>a.label,category:a=>a.category,description:a=>a.label})])}}return n}),this.selectAction=(t,r)=>{if(!t||!this.state.showAction){this.setState({showAction:!1});return}let n=t.value;r?.shiftKey?this.plugin.managers.structure.focus.addFromLoci(n.loci):this.plugin.managers.structure.focus.set(n),this.focusCamera()},this.toggleAction=()=>this.setState({showAction:!this.state.showAction}),this.focusCamera=()=>{let{current:t}=this.plugin.managers.structure.focus;t&&this.plugin.managers.camera.focusLoci(t.loci)},this.clear=()=>{this.plugin.managers.structure.focus.clear(),this.plugin.managers.camera.reset()},this.highlightCurrent=()=>{let{current:t}=this.plugin.managers.structure.focus;t&&this.plugin.managers.interactivity.lociHighlights.highlightOnly({loci:t.loci},!1)},this.clearHighlights=()=>{this.plugin.managers.interactivity.lociHighlights.clearHighlights()}}componentDidMount(){this.subscribe(this.plugin.managers.structure.focus.behaviors.current,t=>{this.getSelectionItems([]),this.forceUpdate()}),this.subscribe(this.plugin.managers.structure.focus.events.historyUpdated,t=>{this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t,showAction:!1})})}get isDisabled(){return this.state.isBusy||this.plugin.managers.structure.hierarchy.selection.structures.length===0}get actionItems(){let t=[],{history:r}=this.plugin.managers.structure.focus;r.length>0&&t.push([sr.Header("History",{description:"Previously focused on items."}),...sr.createItems(r,{label:i=>i.label,description:i=>i.category&&i.label!==i.category?`${i.category} | ${i.label}`:i.label})]);let n=this.getSelectionItems(this.plugin.managers.structure.hierarchy.selection.structures);if(n.length===1){let s=n[0][0];s.initiallyExpanded=!0}let o=[];return n.length>0&&o.push(...n),t.length>0&&o.push(...t),o}getToggleBindingLabel(){var t;let r=this.plugin.state.behaviors.transforms.get(tv.id);if(!r)return"";let n=(t=r.params)===null||t===void 0?void 0:t.bindings.clickFocus;return!n||_t.isEmpty(n)?"":_t.formatTriggers(n)}render(){let{current:t}=this.plugin.managers.structure.focus,r=t?.label||"Nothing Focused",n="Click to Center Camera";if(!t){n="Select focus using the menu";let o=this.getToggleBindingLabel();o&&(n+=` +or use '${o}' on element`)}return(0,Nf.jsxs)(Nf.Fragment,{children:[(0,Nf.jsxs)("div",{className:"msp-flex-row",children:[(0,Nf.jsx)(Jt,{noOverflow:!0,onClick:this.focusCamera,title:n,onMouseEnter:this.highlightCurrent,onMouseLeave:this.clearHighlights,disabled:this.isDisabled||!t,style:{textAlignLast:t?"left":void 0},children:r}),t&&(0,Nf.jsx)(Qt,{svg:uw,onClick:this.clear,title:"Clear",className:"msp-form-control",flex:!0,disabled:this.isDisabled}),(0,Nf.jsx)(Wo,{icon:Vde,title:"Select a focus target to center on an show its surroundings. Hold shift to focus on multiple targets.",toggle:this.toggleAction,isSelected:this.state.showAction,disabled:this.isDisabled,style:{flex:"0 0 40px",padding:0}})]}),this.state.showAction&&(0,Nf.jsx)(sr,{items:this.actionItems,onSelect:this.selectAction})]})}};var MM=class extends Uc{constructor(){super(...arguments),this.item=t=>{var r,n,o,i,s,a,l,c,u;let d=this.plugin.managers.structure.hierarchy.seletionSet,m;switch(t.kind){case"model":{let h=(r=t.cell.obj)===null||r===void 0?void 0:r.data;h&&Ut.TrajectoryInfo.get(h).size>1&&(m=`${(n=t.cell.obj)===null||n===void 0?void 0:n.data.entryId} | Model ${Ut.TrajectoryInfo.get(h).index+1} of ${Ut.TrajectoryInfo.get(h).size}`),m=`${(o=t.cell.obj)===null||o===void 0?void 0:o.data.entryId} | ${(i=t.cell.obj)===null||i===void 0?void 0:i.label}`;break}case"structure":{let h=(s=t.cell.obj)===null||s===void 0?void 0:s.data.models[0];if(h&&Ut.TrajectoryInfo.get(h).size>1){m=`${h.entryId} | ${(a=t.cell.obj)===null||a===void 0?void 0:a.label} (Model ${Ut.TrajectoryInfo.get(h).index+1} of ${Ut.TrajectoryInfo.get(h).size})`;break}else if(h){m=`${h.entryId} | ${(l=t.cell.obj)===null||l===void 0?void 0:l.label}`;break}else{m=`${(c=t.cell.obj)===null||c===void 0?void 0:c.label}`;break}}default:m=(u=t.cell.obj)===null||u===void 0?void 0:u.label;break}return{kind:"item",label:m||t.kind,selected:d.has(t.cell.transform.ref),value:[t]}},this.getTrajectoryItems=t=>{var r;return t.models.length===0?this.item(t):[sr.Header((r=t.cell.obj)===null||r===void 0?void 0:r.label),...t.models.map(this.getModelItems)]},this.getModelItems=t=>{var r,n,o;if(t.structures.length===0)return this.item(t);if(t.structures.length===1){let i=this.plugin.managers.structure.hierarchy.seletionSet,s=t.structures[0];return{label:`${(r=t.cell.obj)===null||r===void 0?void 0:r.label} | ${(n=s.cell.obj)===null||n===void 0?void 0:n.label}`,selected:i.has(s.cell.transform.ref),value:[t,s]}}return[sr.Header((o=t.cell.obj)===null||o===void 0?void 0:o.label),...t.structures.map(this.item)]},this.selectHierarchy=t=>{if(!t||t.length===0)return;let r=[];for(let n of t)for(let o of n.value)r.push(o);this.plugin.managers.structure.hierarchy.updateCurrent(r,t[0].selected?"remove":"add")},this.toggleHierarchy=()=>this.setState({show:this.state.show!=="hierarchy"?"hierarchy":void 0}),this.togglePreset=()=>this.setState({show:this.state.show!=="presets"?"presets":void 0}),this.applyPreset=t=>{if(this.setState({show:void 0}),!t)return;let r=this.plugin.managers.structure,{trajectories:n}=r.hierarchy.selection;r.hierarchy.applyPreset(n,t.value)},this.updateModelQueueParams=void 0,this.isUpdatingModel=!1,this.updateStructureModel=t=>{this.updateModelQueueParams=t,this._updateStructureModel()},this.updateStructure=t=>{let{selection:r}=this.plugin.managers.structure.hierarchy,n=r.structures[0];return this.plugin.managers.structure.hierarchy.updateStructure(n,t)}}defaultState(){return{header:"Structure",isCollapsed:!1,isBusy:!1,brand:{accent:"purple",svg:Bde}}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,()=>this.forceUpdate()),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t})})}get hierarchyItems(){let t=this.plugin.managers.structure.hierarchy,{current:r}=t,n=[];return r.trajectories.length>1&&n.push([sr.Header("Trajectories"),...r.trajectories.map(this.item)]),(r.models.length>1||r.trajectories.length>1)&&n.push([sr.Header("Models"),...r.models.map(this.item)]),r.trajectories.length===1&&r.models.length===1?n.push(...r.structures.map(this.item)):r.structures.length>0&&n.push([sr.Header("Structures"),...r.structures.map(this.item)]),n}get isEmpty(){let{structures:t,models:r,trajectories:n}=this.plugin.managers.structure.hierarchy.current;return n.length===0&&r.length===0&&t.length===0}get label(){var t,r,n,o,i,s,a,l,c,u,d,m,p,h;let{structures:f,models:y,trajectories:g}=this.plugin.managers.structure.hierarchy.selection;if(f.length===1){let v=f[0];return!((r=(t=v.model)===null||t===void 0?void 0:t.trajectory)===null||r===void 0)&&r.models&&v.model.trajectory.models.length===1?(n=v.cell.obj)===null||n===void 0?void 0:n.data.label:v.model?`${(o=v.model.cell.obj)===null||o===void 0?void 0:o.label} | ${(i=v.cell.obj)===null||i===void 0?void 0:i.data.label}`:(s=v.cell.obj)===null||s===void 0?void 0:s.data.label}if(f.length>1){let v=f[0],b=(a=v?.model)===null||a===void 0?void 0:a.trajectory,S=!0;for(let _ of f)if(((l=_?.model)===null||l===void 0?void 0:l.trajectory)!==b){S=!1;break}return S&&b?`${(c=b.cell.obj)===null||c===void 0?void 0:c.label} | ${f.length} structures`:`${f.length} structures`}if(y.length>0){let v=y[0].trajectory;if(y.length===1){let S=(u=y[0].cell.obj)===null||u===void 0?void 0:u.data;return S&&Ut.TrajectoryInfo.get(S).size>1?`${(d=v?.cell.obj)===null||d===void 0?void 0:d.label} | Model ${Ut.TrajectoryInfo.get(S).index+1} of ${Ut.TrajectoryInfo.get(S).size}`:`${(m=v?.cell.obj)===null||m===void 0?void 0:m.label} | Model`}let b=!0;for(let S of y)if(S.trajectory!==v){b=!1;break}return b?`${(p=v?.cell.obj)===null||p===void 0?void 0:p.label} | ${y.length} models`:`${y.length} models`}return g.length>0?g.length===1?`${(h=g[0].cell.obj)===null||h===void 0?void 0:h.label} trajectory`:`${g.length} trajectories`:g.length===0&&y.length===0&&f.length===0?"Nothing Loaded":"Nothing Selected"}get presetActions(){let t=[],{trajectories:r}=this.plugin.managers.structure.hierarchy.selection;if(r.length===0)return t;let n=this.plugin.builders.structure.hierarchy.getPresets(r[0].cell.obj);if(r.length>1){let o=new Set(n);for(let i=1;io.has(i))}for(let o of n)t.push(sr.Item(o.display.name,o,{description:o.display.description}));return t}_updateStructureModel(){return Y(this,null,function*(){if(!this.updateModelQueueParams||this.isUpdatingModel)return;let t=this.updateModelQueueParams;this.updateModelQueueParams=void 0;try{this.isUpdatingModel=!0;let{selection:r}=this.plugin.managers.structure.hierarchy,n=r.structures[0].model;yield this.plugin.state.updateTransform(this.plugin.state.data,n.cell.transform.ref,t,"Model Index")}finally{this.isUpdatingModel=!1,this._updateStructureModel()}})}get modelIndex(){var t,r;let{selection:n}=this.plugin.managers.structure.hierarchy;if(n.structures.length!==1)return null;let o=n.structures[0].model;if(!o||o.cell.transform.transformer!==Ge.Model.ModelFromTrajectory||!o.cell.obj||Ut.TrajectoryInfo.get(o.cell.obj.data).size<=1)return null;let i=(t=o.cell.params)===null||t===void 0?void 0:t.definition;return i?(0,Dl.jsx)(Hn,{params:i,values:(r=o.cell.params)===null||r===void 0?void 0:r.values,onChangeValues:this.updateStructureModel,isDisabled:this.state.isBusy}):null}get structureType(){var t;let{selection:r}=this.plugin.managers.structure.hierarchy;if(r.structures.length!==1)return null;let n=r.structures[0];return!((t=n.cell.params)===null||t===void 0?void 0:t.definition)||!n.cell.parent?null:(0,Dl.jsx)(cc,{state:n.cell.parent,transform:n.cell.transform,customHeader:"none",customUpdate:this.updateStructure,noMargin:!0,autoHideApply:!0})}get transform(){let{selection:t}=this.plugin.managers.structure.hierarchy;if(t.structures.length!==1)return null;let r=t.structures[0];if(!r.cell.parent)return null;let n=qt.tryFindDecorator(this.plugin.state.data,r.cell.transform.ref,Ge.Model.TransformStructureConformation);if(n)return(0,Dl.jsx)(qs,{header:"Conformation Transform",children:(0,Dl.jsx)(cc,{state:n.parent,transform:n.transform,customHeader:"none",noMargin:!0,autoHideApply:!0})})}renderControls(){let t=this.state.isBusy||this.isEmpty,r=this.presetActions,n=this.label;return(0,Dl.jsxs)(Dl.Fragment,{children:[(0,Dl.jsxs)("div",{className:"msp-flex-row",style:{marginTop:"1px"},children:[(0,Dl.jsx)(Jt,{noOverflow:!0,flex:!0,onClick:this.toggleHierarchy,disabled:t,title:n,children:n}),r.length>0&&(0,Dl.jsx)(Qt,{svg:qh,className:"msp-form-control",flex:"40px",onClick:this.togglePreset,title:"Apply a structure presets to the current hierarchy.",toggleState:this.state.show==="presets",disabled:t})]}),this.state.show==="hierarchy"&&(0,Dl.jsx)(sr,{items:this.hierarchyItems,onSelect:this.selectHierarchy,multiselect:!0}),this.state.show==="presets"&&(0,Dl.jsx)(sr,{items:r,onSelect:this.applyPreset}),this.modelIndex,this.structureType,this.transform,(0,Dl.jsxs)("div",{style:{marginTop:"6px"},children:[(0,Dl.jsx)(kM,{}),(0,Dl.jsx)(EM,{hideOnEmpty:!0})]})]})}};var Do=vr(Ln());var Ey=class extends g2{constructor(){super(...arguments),this._getInfo=_c((t,r,n)=>Ip.infoFromAction(this.plugin,this.props.state,this.props.action,this.props.nodeRef)),this.state={plugin:this.plugin,ref:this.props.nodeRef,version:this.props.state.transforms.get(this.props.nodeRef).version,error:void 0,isInitial:!0,params:this.getInfo().initialValues,busy:!1,isCollapsed:this.props.initiallyCollapsed}}applyAction(){return ct.State.ApplyAction(this.plugin,{state:this.props.state,action:this.props.action.create(this.state.params),ref:this.props.nodeRef})}getInfo(){var t;return this._getInfo(this.props.nodeRef,this.props.state.transforms.get(this.props.nodeRef).version,(t=this.state)===null||t===void 0?void 0:t.isCollapsed)}getTransformerId(){return this.props.state.transforms.get(this.props.nodeRef).transformer.id}getHeader(){return this.props.hideHeader?"none":this.props.action.definition.display}canApply(){return!this.state.error&&!this.state.busy}canAutoApply(){return!1}applyText(){return"Apply"}isUpdate(){return!1}getSourceAndTarget(){return{a:this.props.state.cells.get(this.props.nodeRef).obj}}static getDerivedStateFromProps(t,r){let n=t.state.transforms.get(t.nodeRef).version;if(t.nodeRef===r.ref&&n===r.version)return null;let o=t.state.cells.get(t.nodeRef).obj,i=t.action.definition.params?C.getDefaultValues(t.action.definition.params(o,r.plugin)):{};return{plugin:r.plugin,ref:t.nodeRef,version:n,params:i,isInitial:!0,error:void 0}}};var BM=class extends Uc{defaultState(){return{header:"Volume Streaming",isCollapsed:!1,isBusy:!1,isHidden:!0,brand:{accent:"cyan",svg:vU}}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,()=>{this.setState({isHidden:!this.canEnable(),description:Tf.getSelectedStructuresDescription(this.plugin)})}),this.subscribe(this.plugin.state.events.cell.stateUpdated,t=>{ur.hasTag(t.cell.transform,As.RootTag)&&this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t})})}get pivot(){return this.plugin.managers.structure.hierarchy.selection.structures[0]}canEnable(){var t,r;let{selection:n}=this.plugin.managers.structure.hierarchy;if(n.structures.length!==1)return!1;let o=this.pivot.cell;return o.obj?!!(!((r=(t=L_.definition).isApplicable)===null||r===void 0)&&r.call(t,o.obj,o.transform,this.plugin)):!1}renderEnable(){var t,r;let n=this.pivot;if(!n.cell.parent)return null;let o=qt.findTagInSubtree(n.cell.parent.tree,this.pivot.cell.transform.ref,As.RootTag),i=o&&n.cell.parent.cells.get(o),s=i&&i.status==="error"?{header:i.errorText&&(!((t=i.errorText)===null||t===void 0)&&t.includes("404"))?"No Density Data Available":"Error Enabling",icon:bU,title:i.errorText}:i&&((r=i.obj)===null||r===void 0?void 0:r.data.entries.length)===0?{header:"Error Enabling",icon:bU,title:"No Entry for Streaming Found"}:{header:"Enable",icon:ed,title:"Enable"};return(0,Do.jsx)(Ey,{state:n.cell.parent,action:L_,initiallyCollapsed:!0,nodeRef:n.cell.transform.ref,simpleApply:s})}renderParams(){var t,r,n,o,i;let s=this.pivot;if(!s.cell.parent)return null;let a=((r=(t=s.volumeStreaming)===null||t===void 0?void 0:t.cell.transform.params)===null||r===void 0?void 0:r.entry.params.view.name)==="selection-box"&&((i=(o=(n=this.plugin.state.behaviors.cells.get(tv.id))===null||n===void 0?void 0:n.params)===null||o===void 0?void 0:o.values)===null||i===void 0?void 0:i.bindings);return(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsx)(cc,{state:s.cell.parent,transform:s.volumeStreaming.cell.transform,customHeader:"none",noMargin:!0}),a&&(0,Do.jsx)(qs,{header:"Controls Help",children:(0,Do.jsx)(y2,{bindings:a})})]})}renderControls(){let t=this.pivot;return t?t.volumeStreaming?this.renderParams():this.renderEnable():null}},RM=class extends Uc{constructor(){super(...arguments),this.item=t=>{var r;let n=this.plugin.managers.volume.hierarchy.selection,o=((r=t.cell.obj)===null||r===void 0?void 0:r.label)||"Volume";return{kind:"item",label:(t.kind==="lazy-volume"?"Load ":"")+(o||t.kind),selected:n===t,value:t}},this.selectCurrent=t=>{if(this.toggleHierarchy(),!t)return;let r=t.value;r.kind==="volume"?this.plugin.managers.volume.hierarchy.setCurrent(r):this.lazyLoad(r.cell)},this.selectAdd=t=>{t&&(this.setState({show:void 0}),t.value())},this.toggleHierarchy=()=>this.setState({show:this.state.show!=="hierarchy"?"hierarchy":void 0}),this.toggleAddRepr=()=>this.setState({show:this.state.show!=="add-repr"?"add-repr":void 0})}defaultState(){return{header:"Volume",isCollapsed:!1,isBusy:!1,isHidden:!0,brand:{accent:"purple",svg:vU}}}componentDidMount(){this.subscribe(this.plugin.managers.volume.hierarchy.behaviors.selection,t=>{this.setState({isHidden:t.hierarchy.volumes.length===0&&t.hierarchy.lazyVolumes.length===0})}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t})})}get hierarchyItems(){let t=this.plugin.managers.volume.hierarchy,{current:r}=t,n=[];for(let o of r.volumes)n.push(this.item(o));for(let o of r.lazyVolumes)n.push(this.item(o));return n}get addActions(){let t=this.plugin.managers.volume.hierarchy,r=t.selection;return[...ly.getRepresentationTypes(this.plugin,r).map(o=>sr.Item(o[1],()=>t.addRepresentation(r,o[0])))]}get isEmpty(){let{volumes:t,lazyVolumes:r}=this.plugin.managers.volume.hierarchy.current;return t.length===0&&r.length===0}get label(){var t;if(this.state.loadingLabel)return`Loading ${this.state.loadingLabel}...`;let r=this.plugin.managers.volume.hierarchy.selection;return r?((t=r?.cell.obj)===null||t===void 0?void 0:t.label)||"Volume":"Nothing Selected"}lazyLoad(t){return Y(this,null,function*(){let{url:r,isBinary:n,format:o,entryId:i,isovalues:s}=t.obj.data;this.setState({isBusy:!0,loadingLabel:t.obj.label});try{let a=this.plugin;yield a.dataTransaction(()=>Y(this,null,function*(){var l,c,u,d;let m=yield a.builders.data.download({url:r,isBinary:n},{state:{isGhost:!0}}),p=yield a.dataFormats.get(o).parse(a,m,{entryId:i}),h=p.volume||p.volumes[0];if(!h?.isOk)throw new Error("Failed to parse any volume.");let f=a.build();for(let y of s)f.to((u=(l=p.volumes)===null||l===void 0?void 0:l[(c=y.volumeIndex)!==null&&c!==void 0?c:0])!==null&&u!==void 0?u:p.volume).apply(Ge.Representation.VolumeRepresentation3D,Xh(this.plugin,h.data,{type:"isosurface",typeParams:{alpha:(d=y.alpha)!==null&&d!==void 0?d:1,isoValue:y.type==="absolute"?{kind:"absolute",absoluteValue:y.value}:{kind:"relative",relativeValue:y.value}},color:"uniform",colorParams:{value:y.color}}));yield f.commit(),yield a.build().delete(t).commit()}))}finally{this.setState({isBusy:!1,loadingLabel:void 0})}})}renderControls(){let t=this.state.isBusy||this.isEmpty,r=this.label,n=this.plugin.managers.volume.hierarchy.selection;return(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsxs)("div",{className:"msp-flex-row",style:{marginTop:"1px"},children:[(0,Do.jsx)(Jt,{noOverflow:!0,flex:!0,onClick:this.toggleHierarchy,disabled:t,title:r,children:r}),!this.isEmpty&&n&&(0,Do.jsx)(Qt,{svg:Cp,onClick:this.toggleAddRepr,title:"Apply a structure presets to the current hierarchy.",toggleState:this.state.show==="add-repr",disabled:t})]}),this.state.show==="hierarchy"&&(0,Do.jsx)(sr,{items:this.hierarchyItems,onSelect:this.selectCurrent}),this.state.show==="add-repr"&&(0,Do.jsx)(sr,{items:this.addActions,onSelect:this.selectAdd}),n&&n.representations.length>0&&(0,Do.jsx)("div",{style:{marginTop:"6px"},children:n.representations.map(o=>(0,Do.jsx)(jV,{representation:o},o.cell.transform.ref))})]})}},jV=class extends ti{constructor(){super(...arguments),this.state={action:void 0},this.remove=()=>this.plugin.managers.volume.hierarchy.remove([this.props.representation],!0),this.toggleVisible=t=>{t.preventDefault(),t.currentTarget.blur(),this.plugin.managers.volume.hierarchy.toggleVisibility([this.props.representation])},this.toggleColor=()=>{this.setState({action:this.state.action==="select-color"?void 0:"select-color"})},this.toggleUpdate=()=>this.setState({action:this.state.action==="update"?void 0:"update"}),this.highlight=t=>{t.preventDefault(),this.props.representation.cell.parent&&ct.Interactivity.Object.Highlight(this.plugin,{state:this.props.representation.cell.parent,ref:this.props.representation.cell.transform.ref})},this.clearHighlight=t=>{t.preventDefault(),ct.Interactivity.ClearHighlights(this.plugin)},this.focus=()=>{var t;let r=this.props.representation,n=(t=r.cell.obj)===null||t===void 0?void 0:t.data.repr.getAllLoci();r.cell.state.isHidden&&this.plugin.managers.volume.hierarchy.toggleVisibility([this.props.representation],"show"),n&&this.plugin.managers.camera.focusLoci(n,{extraRadius:1})},this.updateColor=({value:t})=>{let r=this.props.representation.cell.transform;return this.plugin.build().to(r.ref).update(te(k({},r.params),{colorTheme:{name:"uniform",params:{value:t}}})).commit()}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,t=>{ru.ObjectEvent.isCell(t,this.props.representation.cell)&&this.forceUpdate()})}get color(){var t,r;let n=this.props.representation.cell;if(((t=n.transform.params)===null||t===void 0?void 0:t.colorTheme.name)==="uniform")return(r=n.transform.params)===null||r===void 0?void 0:r.colorTheme.params.value}render(){var t,r,n;let o=this.props.representation.cell,i=this.color;return(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsxs)("div",{className:"msp-flex-row",children:[i!==void 0&&(0,Do.jsx)(Jt,{style:{backgroundColor:Oe.toStyle(i),minWidth:32,width:32},onClick:this.toggleColor}),(0,Do.jsxs)(Jt,{noOverflow:!0,className:"msp-control-button-label",title:`${(t=o.obj)===null||t===void 0?void 0:t.label}. Click to focus.`,onClick:this.focus,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:{textAlign:"left"},children:[(r=o.obj)===null||r===void 0?void 0:r.label,(0,Do.jsx)("small",{className:"msp-25-lower-contrast-text",style:{float:"right"},children:(n=o.obj)===null||n===void 0?void 0:n.description})]}),(0,Do.jsx)(Qt,{svg:o.state.isHidden?td:rd,toggleState:!1,onClick:this.toggleVisible,title:`${o.state.isHidden?"Show":"Hide"} component`,small:!0,className:"msp-form-control",flex:!0}),(0,Do.jsx)(Qt,{svg:ua,onClick:this.remove,title:"Remove",small:!0}),(0,Do.jsx)(Qt,{svg:lm,onClick:this.toggleUpdate,title:"Actions",toggleState:this.state.action==="update"})]}),this.state.action==="update"&&!!o.parent&&(0,Do.jsx)("div",{style:{marginBottom:"6px"},className:"msp-accent-offset",children:(0,Do.jsx)(cc,{state:o.parent,transform:o.transform,customHeader:"none",noMargin:!0})}),this.state.action==="select-color"&&i!==void 0&&(0,Do.jsx)("div",{style:{marginBottom:"6px",marginTop:1},className:"msp-accent-offset",children:(0,Do.jsx)(ll,{header:"Select Color",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleColor,topRightIcon:Fc,noTopMargin:!0,childrenClassName:"msp-viewport-controls-panel-controls",children:(0,Do.jsx)(yS,{param:SKe,value:this.color,onChange:this.updateColor,name:"color",hideNameRow:!0})})})]})}},SKe=C.Color(Oe(1184274));var an=vr(Ln());var u3;(function(e){function t(n){return{size:n,matrix:sn.create(n,n),eigenValues:new Float64Array(n),D:new Float64Array(n),E:new Float64Array(n)}}e.createCache=t;function r(n){CKe(n.size,n.matrix.data,n.eigenValues,n.D,n.E)}e.compute=r})(u3||(u3={}));function CKe(e,t,r,n,o){for(let s=0;s0;o--){let i=0,s=0;for(let a=0;a0&&(l=-l),r[o]=i*l,s=s-a*l,t[o-1]=a-l;for(let u=0;ul){let u=0;do{u=u+1;let d=t[l],m=(t[l+1]-d)/(2*r[l]),p=j0e(m,1);m<0&&(p=-p),t[l]=r[l]/(m+p),t[l+1]=r[l]*(m+p);let h=t[l+1],f=d-t[l];for(let w=l+2;w=l;w--){v=g,g=y,_=S,d=y*r[w],f=y*m,p=j0e(m,r[w]),r[w+1]=S*p,S=r[w]/p,y=m/p,m=y*t[w]-S*d,t[w+1]=f+S*(y*d+S*t[w]);for(let E=0;E=1e3)throw new Error("SVD: Not converging.")}while(Math.abs(r[l])>a*s)}t[l]=t[l]+i,r[l]=0}for(let l=0;lMath.abs(t)){let r=t/e;return Math.abs(e)*Math.sqrt(1+r*r)}if(t!==0){let r=e/t;return Math.abs(t)*Math.sqrt(1+r*r)}return 0}var Ep;(function(e){let t;(function(n){function o(i){return{x:new Float64Array(i),y:new Float64Array(i),z:new Float64Array(i)}}n.empty=o})(t=e.Positions||(e.Positions={}));function r(n,o){return typeof o>"u"&&(o={bTransform:ne.zero(),rmsd:0}),PKe(new qV(n,o)),o}e.compute=r})(Ep||(Ep={}));var qV=class{constructor(t,r){this.evdCache=u3.createCache(4),this.translateB=ne.identity(),this.rotateB=ne.identity(),this.tempMatrix=ne.identity(),this.a=t.a,this.b=t.b,t.centerA?this.centerA=t.centerA:this.centerA=t.centerA=xl.fromArrays(t.a,ge()).center,t.centerB?this.centerB=t.centerB:this.centerB=t.centerB=xl.fromArrays(t.b,ge()).center,this.result=r}};function AKe(e){let t=e.evdCache.matrix;sn.makeZero(t);let r=e.a.x,n=e.a.y,o=e.a.z,i=e.b.x,s=e.b.y,a=e.b.z,l=e.centerA,c=e.centerB,u=0,d=Math.min(e.a.x.length,e.b.x.length);for(let m=0;m{r=0;let s={};i.forEach(a=>s[e[r++]]=a),o[e[n++]]=s}),o}var W0e={blosum62:q0e(EKe,kKe),blosum62x:q0e(IKe,DKe)};var MKe={gapPenalty:-11,gapExtensionPenalty:-1,substMatrix:"default"};function Y0e(e,t,r={}){let n=k(k({},MKe),r),o=new WV(e,t,n);return o.calculate(),o.trace()}var WV=class{constructor(t,r,n){this.seqA=t,this.seqB=r,this.S=[],this.V=[],this.H=[],this.gapPenalty=n.gapPenalty,this.gapExtensionPenalty=n.gapExtensionPenalty,this.substMatrix=n.substMatrix==="default"?void 0:W0e[n.substMatrix],this.n=this.seqA.length,this.m=this.seqB.length}initMatrices(){let{n:t,m:r,gapPenalty:n,S:o,V:i,H:s}=this;for(let a=0;a<=t;++a){o[a]=[],i[a]=[],s[a]=[];for(let l=0;l<=r;++l)o[a][l]=0,i[a][l]=0,s[a][l]=0}for(let a=0;a<=t;++a)o[a][0]=n,s[a][0]=-1/0;for(let a=0;a<=r;++a)o[0][a]=n,i[0][a]=-1/0;o[0][0]=0}makeScoreFn(){let{seqA:t,seqB:r,substMatrix:n}=this;return n?function(i,s){var a,l;let c=t[i],u=r[s];return(l=(a=n[c])===null||a===void 0?void 0:a[u])!==null&&l!==void 0?l:-4}:function(i,s){let a=t[i],l=r[s];return a===l?5:-3}}calculate(){this.initMatrices();let t=this.makeScoreFn(),{V:r,H:n,S:o,n:i,m:s,gapExtensionPenalty:a,gapPenalty:l}=this,c,u,d,m,p;for(let h=1;h<=i;++h){u=o[h-1],c=r[h-1],d=r[h],m=n[h],p=o[h];for(let f=1;f<=s;++f)d[f]=Math.max(u[f]+l,c[f]+a),m[f]=Math.max(p[f-1]+l,m[f-1]+a),p[f]=Math.max(u[f-1]+t(h-1,f-1),d[f],m[f])}}trace(){let t=this.makeScoreFn(),{V:r,H:n,S:o,seqA:i,seqB:s,gapExtensionPenalty:a,gapPenalty:l}=this,c=this.n,u=this.m,d,m,p="",h="";for(o[c][u]>=r[c][u]?(d="S",m=o[c][u]):r[c][u]>=n[c][u]?(d="V",m=r[c][u]):(d="H",m=n[c][u]);c>0&&u>0;)d==="S"?o[c][u]===o[c-1][u-1]+t(c-1,u-1)?(p=i[c-1]+p,h=s[u-1]+h,--c,--u,d="S"):o[c][u]===r[c][u]?d="V":o[c][u]===n[c][u]?d="H":(--c,--u):d==="V"?r[c][u]===r[c-1][u]+a?(p=i[c-1]+p,h="-"+h,--c,d="V"):r[c][u]===o[c-1][u]+l?(p=i[c-1]+p,h="-"+h,--c,d="S"):--c:d==="H"&&(n[c][u]===n[c][u-1]+a?(p="-"+p,h=s[u-1]+h,--u,d="H"):n[c][u]===o[c][u-1]+l?(p="-"+p,h=s[u-1]+h,--u,d="S"):--u);for(;c>0;)p=i[c-1]+p,h="-"+h,--c;for(;u>0;)p="-"+p,h=s[u-1]+h,--u;return{aliA:p,aliB:h,score:m}}};var LM;(function(e){function t(n){let o=new Map;if(_e.isAtomic(n.unit)){let{label_seq_id:i}=n.unit.model.atomicHierarchy.residues,{residueIndex:s}=n.unit;for(let a=0,l=Te.size(n.indices);a=t)break}if(n>=t)break}return r}function LKe(e){if(e.length===0)return 0;let t=$.Loci.size(e[0]);for(let r=1;r=0?b:S,!o(i,v,S,_))continue;let w=`${u[v]}-${d[v]}-${m[v]}`;if(!t.has(w))t.set(w,{key:w,pivots:{[r]:[s,S,_]}});else{let E=t.get(w);E.pivots[r]||(E.pivots[r]=[s,S,_])}}}}}var FM=class extends Uc{defaultState(){return{isCollapsed:!1,header:"Superposition",brand:{accent:"gray",svg:tme},isHidden:!0}}componentDidMount(){this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,t=>{this.setState({isHidden:t.structures.length<2})})}renderControls(){return(0,an.jsx)(an.Fragment,{children:(0,an.jsx)(XV,{})})}},Z0e={alignSequences:C.Boolean(!0,{isEssential:!0,description:"For Chain-based 3D superposition, perform a sequence alignment and use the aligned residue pairs to guide the 3D superposition."}),traceOnly:C.Boolean(!0,{description:"For Chain- and Uniprot-based 3D superposition, base superposition only on CA (and equivalent) atoms."})},zKe=C.getDefaultValues(Z0e),VKe="SuperpositionTransform",XV=class extends ti{constructor(){super(...arguments),this.state={isBusy:!1,canUseDb:!1,action:void 0,options:zKe},this.superposeChains=()=>Y(this,null,function*(){var t,r,n;let{query:o}=this.state.options.traceOnly?ei.trace:ei.polymer,i=this.chainEntries,s=i.map(d=>{let m=$.Loci.toStructure(d.loci),p=lt.toLociWithSourceUnits(o(new Mi(m)));return $.Loci.remap(p,this.getRootStructure(d.loci.structure))}),a=this.plugin.managers.structure.hierarchy.findStructure((t=s[0])===null||t===void 0?void 0:t.structure),l=(n=(r=a?.transform)===null||r===void 0?void 0:r.cell.obj)===null||n===void 0?void 0:n.data.coordinateSystem,c=this.state.options.alignSequences?K0e(s):YV(s),u=i[0];for(let d=1,m=s.length;dY(this,null,function*(){var t,r,n;let o=this.atomEntries,i=o.map(u=>$.Loci.remap(u.loci,this.getRootStructure(u.loci.structure))),s=YV(i),a=this.plugin.managers.structure.hierarchy.findStructure((t=i[0])===null||t===void 0?void 0:t.structure),l=(n=(r=a?.transform)===null||r===void 0?void 0:r.cell.obj)===null||n===void 0?void 0:n.data.coordinateSystem,c=o[0];for(let u=1,d=i.length;uY(this,null,function*(){var t,r,n;let o=this.plugin.managers.structure.hierarchy.behaviors.selection.value.structures,i=this.state.options.traceOnly,s=o.map(p=>{var h;return(h=p.cell.obj)===null||h===void 0?void 0:h.data}),{entries:a,failedPairs:l,zeroOverlapPairs:c}=Q0e(s,{traceOnly:i}),u=(n=(r=(t=o[0])===null||t===void 0?void 0:t.transform)===null||r===void 0?void 0:r.cell.obj)===null||n===void 0?void 0:n.data.coordinateSystem,d=0;for(let p of a)yield this.transform(o[p.other].cell,p.transform.bTransform,u),d+=p.transform.rmsd;d/=Math.max(a.length-1,1);let m=p=>`[${p.map(([h,f])=>`(${s[h].models[0].entryId}, ${s[f].models[0].entryId})`).join(", ")}]`;c.length&&this.plugin.log.warn(`Superposition: No UNIPROT mapping overlap between structures ${m(c)}.`),l.length&&this.plugin.log.error(`Superposition: Failed to superpose structures ${m(l)}.`),a.length&&(this.plugin.log.info(`Superposed ${a.length+1} structures with avg. RMSD ${d.toFixed(2)} \xC5.`),yield this.cameraReset())}),this.toggleByChains=()=>this.setState({action:this.state.action==="byChains"?void 0:"byChains"}),this.toggleByAtoms=()=>this.setState({action:this.state.action==="byAtoms"?void 0:"byAtoms"}),this.toggleOptions=()=>this.setState({action:this.state.action==="options"?void 0:"options"}),this.setOptions=t=>{this.setState({options:t})}}componentDidMount(){this.subscribe(this.selection.events.changed,()=>{this.forceUpdate()}),this.subscribe(this.selection.events.additionsHistoryUpdated,()=>{this.forceUpdate()}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{this.setState({isBusy:t})}),this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection,t=>{this.setState({canUseDb:t.structures.every(r=>{var n;return!!(!((n=r.cell.obj)===null||n===void 0)&&n.data)&&r.cell.obj.data.models.some(o=>Cl.Provider.isApplicable(o))})})})}get selection(){return this.plugin.managers.structure.selection}transform(t,r,n){return Y(this,null,function*(){let o=Vo.resolveAndCheck(this.plugin.state.data,t);if(!o)return;let i=this.plugin.state.data.selectQ(c=>c.byRef(o.transform.ref).subtree().withTransformer(Ge.Model.TransformStructureConformation))[0],a={transform:{name:"matrix",params:{data:n&&!ne.isIdentity(n.matrix)?ne.mul(ne(),n.matrix,r):r,transpose:!1}}},l=i?this.plugin.state.data.build().to(i).update(a):this.plugin.state.data.build().to(t).insert(Ge.Model.TransformStructureConformation,a,{tags:VKe});yield this.plugin.runTask(this.plugin.state.data.updateTree(l))})}getRootStructure(t){var r;let n=this.plugin.helpers.substructureParent.get(t);return(r=this.plugin.state.data.selectQ(o=>o.byValue(n).rootOfType(ae.Molecule.Structure))[0].obj)===null||r===void 0?void 0:r.data}cameraReset(){return Y(this,null,function*(){yield new Promise(t=>requestAnimationFrame(t)),ct.Camera.Reset(this.plugin)})}highlight(t){this.plugin.managers.interactivity.lociHighlights.highlightOnly({loci:t},!1)}moveHistory(t,r){this.plugin.managers.structure.selection.modifyHistory(t,r,void 0,!0)}focusLoci(t){this.plugin.managers.camera.focusLoci(t)}lociEntry(t,r){return(0,an.jsx)("div",{className:"msp-flex-row",children:(0,an.jsx)(Jt,{noOverflow:!0,title:"Click to focus. Hover to highlight.",onClick:()=>this.focusLoci(t.loci),style:{width:"auto",textAlign:"left"},onMouseEnter:()=>this.highlight(t.loci),onMouseLeave:()=>this.plugin.managers.interactivity.lociHighlights.clearHighlights(),children:(0,an.jsx)("span",{dangerouslySetInnerHTML:{__html:t.label}})})},r)}historyEntry(t,r){let n=this.plugin.managers.structure.selection.additionsHistory;return(0,an.jsxs)("div",{className:"msp-flex-row",children:[(0,an.jsxs)(Jt,{noOverflow:!0,title:"Click to focus. Hover to highlight.",onClick:()=>this.focusLoci(t.loci),style:{width:"auto",textAlign:"left"},onMouseEnter:()=>this.highlight(t.loci),onMouseLeave:()=>this.plugin.managers.interactivity.lociHighlights.clearHighlights(),children:[r,". ",(0,an.jsx)("span",{dangerouslySetInnerHTML:{__html:t.label}})]}),n.length>1&&(0,an.jsx)(Qt,{svg:iy,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(t,"up"),flex:"20px",title:"Move up"}),n.length>1&&(0,an.jsx)(Qt,{svg:oy,small:!0,className:"msp-form-control",onClick:()=>this.moveHistory(t,"down"),flex:"20px",title:"Move down"}),(0,an.jsx)(Qt,{svg:ua,small:!0,className:"msp-form-control",onClick:()=>this.plugin.managers.structure.selection.modifyHistory(t,"remove"),flex:!0,title:"Remove"})]},t.id)}atomsLociEntry(t,r){return(0,an.jsxs)("div",{children:[(0,an.jsx)("div",{className:"msp-control-group-header",children:(0,an.jsx)("div",{className:"msp-no-overflow",title:t.label,children:t.label})}),(0,an.jsx)("div",{className:"msp-control-offset",children:t.atoms.map((n,o)=>this.historyEntry(n,o))})]},r)}get chainEntries(){let t=$.Location.create(),r=[];return this.plugin.managers.structure.selection.entries.forEach(({selection:n},o)=>{let i=Vo.resolveAndCheck(this.plugin.state.data,o);if(!i||$.Loci.isEmpty(n))return;let s=$.Loci.getFirstLocation(n,t);if(n.elements.length>1||Ne.entity.type(s)!=="polymer")return;let a=$.Stats.ofLoci(n),l=G1(a,{countsOnly:!0}),c=Ku(s,{reverse:!0,granularity:"chain"}).split("|"),u=`${l} | ${c[0]} | ${c[c.length-1]}`;r.push({loci:n,label:u,cell:i})}),r}get atomEntries(){let t=new Map,r=this.plugin.managers.structure.selection.additionsHistory;for(let o=0,i=r.length;o{let s=this.plugin.helpers.substructureParent.get(i),a=[];for(let u=0,d=o.length;u0&&(0,an.jsx)("div",{className:"msp-control-offset",children:t.map((r,n)=>this.lociEntry(r,n))}),t.length<2&&(0,an.jsx)("div",{className:"msp-control-offset msp-help-text",children:(0,an.jsxs)("div",{className:"msp-help-description",children:[(0,an.jsx)(tn,{svg:rc,inline:!0}),"Add 2 or more selections",this.toggleHint()," from separate structures. Selections must be limited to single polymer chains or residues therein."]})}),t.length>1&&(0,an.jsx)(Jt,{title:"Superpose structures by selected chains.",className:"msp-btn-commit msp-btn-commit-on",onClick:this.superposeChains,style:{marginTop:"1px"},children:"Superpose"})]})}addByAtoms(){let t=this.atomEntries;return(0,an.jsxs)(an.Fragment,{children:[t.length>0&&(0,an.jsx)("div",{className:"msp-control-offset",children:t.map((r,n)=>this.atomsLociEntry(r,n))}),t.length<2&&(0,an.jsx)("div",{className:"msp-control-offset msp-help-text",children:(0,an.jsxs)("div",{className:"msp-help-description",children:[(0,an.jsx)(tn,{svg:rc,inline:!0}),"Add 1 or more selections",this.toggleHint()," from separate structures. Selections must be limited to single atoms."]})}),t.length>1&&(0,an.jsx)(Jt,{title:"Superpose structures by selected atoms.",className:"msp-btn-commit msp-btn-commit-on",onClick:this.superposeAtoms,style:{marginTop:"1px"},children:"Superpose"})]})}superposeByDbMapping(){return(0,an.jsx)(an.Fragment,{children:(0,an.jsx)(Jt,{icon:wU,title:"Superpose structures using intersection of residues from SIFTS UNIPROT mapping.",className:"msp-btn msp-btn-block",onClick:this.superposeDb,style:{marginTop:"1px"},disabled:this.state.isBusy,children:"Uniprot"})})}render(){return(0,an.jsxs)(an.Fragment,{children:[(0,an.jsxs)("div",{className:"msp-flex-row",children:[(0,an.jsx)(Wo,{icon:wU,label:"Chains",toggle:this.toggleByChains,isSelected:this.state.action==="byChains",disabled:this.state.isBusy}),(0,an.jsx)(Wo,{icon:eme,label:"Atoms",toggle:this.toggleByAtoms,isSelected:this.state.action==="byAtoms",disabled:this.state.isBusy}),this.state.canUseDb&&this.superposeByDbMapping(),(0,an.jsx)(Wo,{icon:Oc,label:"",title:"Options",toggle:this.toggleOptions,isSelected:this.state.action==="options",disabled:this.state.isBusy,style:{flex:"0 0 40px",padding:0}})]}),this.state.action==="byChains"&&this.addByChains(),this.state.action==="byAtoms"&&this.addByAtoms(),this.state.action==="options"&&(0,an.jsx)("div",{className:"msp-control-offset",children:(0,an.jsx)(Hn,{params:Z0e,values:this.state.options,onChangeValues:this.setOptions,isDisabled:this.state.isBusy})})]})}};var Uf=vr(Ln());var OM=class extends Uc{defaultState(){return{isCollapsed:!1,header:"Quick Styles",brand:{accent:"gray",svg:Rde}}}renderControls(){return(0,Uf.jsx)(Uf.Fragment,{children:(0,Uf.jsx)(KV,{})})}},KV=class extends ti{default(){return Y(this,null,function*(){let{structures:t}=this.plugin.managers.structure.hierarchy.selection,r=this.plugin.config.get(Tr.Structure.DefaultRepresentationPreset)||Jl.auto.id,n=this.plugin.builders.structure.representation.resolveProvider(r);if(yield this.plugin.managers.structure.component.applyPreset(t,n),this.plugin.managers.structure.component.setOptions(C.getDefaultValues(xu.OptionsParams)),this.plugin.canvas3d){let o=C.getDefaultValues(Kb);this.plugin.canvas3d.setProps({postprocessing:{outline:o.outline,occlusion:o.occlusion}})}})}illustrative(){return Y(this,null,function*(){let{structures:t}=this.plugin.managers.structure.hierarchy.selection;yield this.plugin.managers.structure.component.applyPreset(t,Jl.illustrative),this.plugin.canvas3d&&this.plugin.canvas3d.setProps({postprocessing:{outline:{name:"on",params:{scale:1,color:Oe(0),threshold:.25,includeTransparent:!0}},occlusion:{name:"on",params:{multiScale:{name:"off",params:{}},radius:5,bias:.8,blurKernelSize:15,samples:32,resolutionScale:1,color:Oe(0)}},shadow:{name:"off",params:{}}}})})}stylized(){return Y(this,null,function*(){if(this.plugin.managers.structure.component.setOptions(te(k({},this.plugin.managers.structure.component.state.options),{ignoreLight:!0})),this.plugin.canvas3d){let t=this.plugin.canvas3d.props.postprocessing;this.plugin.canvas3d.setProps({postprocessing:{outline:{name:"on",params:t.outline.name==="on"?t.outline.params:{scale:1,color:Oe(0),threshold:.33,includeTransparent:!0}},occlusion:{name:"on",params:t.occlusion.name==="on"?t.occlusion.params:{multiScale:{name:"off",params:{}},radius:5,bias:.8,blurKernelSize:15,samples:32,resolutionScale:1,color:Oe(0)}},shadow:{name:"off",params:{}}}})}})}render(){return(0,Uf.jsxs)("div",{className:"msp-flex-row",children:[(0,Uf.jsx)(Jt,{noOverflow:!0,title:"Applies default representation preset. Set outline and occlusion effects to defaults.",onClick:()=>this.default(),style:{width:"auto"},children:"Default"}),(0,Uf.jsx)(Jt,{noOverflow:!0,title:"Applies no representation preset. Enables outline and occlusion effects. Enables ignore-light representation parameter.",onClick:()=>this.stylized(),style:{width:"auto"},children:"Stylized"}),(0,Uf.jsx)(Jt,{noOverflow:!0,title:"Applies illustrative representation preset. Enables outline and occlusion effects. Enables ignore-light parameter.",onClick:()=>this.illustrative(),style:{width:"auto"},children:"Illustrative"})]})}};var NM=class extends pr{constructor(){super(...arguments),this.state={show:!1,label:""},this.update=()=>{let t=this.plugin.state.data,r=t.selectQ(s=>s.ofTransformer(Ge.Model.ModelFromTrajectory));if(r.length===0){this.setState({show:!1});return}let n="",o=0,i=new Set;for(let s of r){if(!s.sourceRef)continue;let a=t.cells.get(s.sourceRef).obj;if(a&&a.data.frameCount>1){if(i.has(s.sourceRef)){this.setState({show:!1});return}i.add(s.sourceRef),o++,n||(n=`Model ${s.transform.params.modelIndex+1} / ${a.data.frameCount}`)}}o>1&&(n=""),this.setState({show:o>0,label:n})},this.reset=()=>ct.State.ApplyAction(this.plugin,{state:this.plugin.state.data,action:nw.create({action:"reset"})}),this.prev=()=>ct.State.ApplyAction(this.plugin,{state:this.plugin.state.data,action:nw.create({action:"advance",by:-1})}),this.next=()=>ct.State.ApplyAction(this.plugin,{state:this.plugin.state.data,action:nw.create({action:"advance",by:1})})}componentDidMount(){this.subscribe(this.plugin.state.data.events.changed,this.update),this.subscribe(this.plugin.behaviors.state.isAnimating,this.update)}render(){let t=this.plugin.behaviors.state.isAnimating.value;return!this.state.show||t&&!this.state.label||!this.plugin.config.get(Tr.Viewport.ShowTrajectoryControls)?null:(0,ln.jsxs)("div",{className:"msp-traj-controls",children:[!t&&(0,ln.jsx)(Qt,{svg:Qde,title:"First Model",onClick:this.reset,disabled:t}),!t&&(0,ln.jsx)(Qt,{svg:SU,title:"Previous Model",onClick:this.prev,disabled:t}),!t&&(0,ln.jsx)(Qt,{svg:CU,title:"Next Model",onClick:this.next,disabled:t}),!!this.state.label&&(0,ln.jsx)("span",{children:this.state.label})]})}},UM=class extends pr{constructor(){super(...arguments),this.state={isBusy:!1,show:!0},this.keyUp=t=>{if(!t.ctrlKey||this.state.isBusy||t.target!==document.body)return;let r=this.plugin.managers.snapshot;if(t.keyCode===37||t.key==="ArrowLeft")r.state.isPlaying&&r.stop(),this.prev();else if(t.keyCode===38||t.key==="ArrowUp"){if(r.state.isPlaying&&r.stop(),r.state.entries.size===0)return;let n=r.state.entries.get(0);this.update(n.snapshot.id)}else if(t.keyCode===39||t.key==="ArrowRight")r.state.isPlaying&&r.stop(),this.next();else if(t.keyCode===40||t.key==="ArrowDown"){if(r.state.isPlaying&&r.stop(),r.state.entries.size===0)return;let n=r.state.entries.get(r.state.entries.size-1);this.update(n.snapshot.id)}},this.change=t=>{t.target.value!=="none"&&this.update(t.target.value)},this.prev=()=>{let t=this.plugin.managers.snapshot,r=t.getNextId(t.state.current,-1);r&&this.update(r)},this.next=()=>{let t=this.plugin.managers.snapshot,r=t.getNextId(t.state.current,1);r&&this.update(r)},this.togglePlay=()=>{this.plugin.managers.snapshot.togglePlay()}}componentDidMount(){this.subscribe(this.plugin.managers.snapshot.events.changed,()=>this.forceUpdate()),this.subscribe(this.plugin.behaviors.state.isBusy,t=>this.setState({isBusy:t})),this.subscribe(this.plugin.behaviors.state.isAnimating,t=>this.setState({isBusy:t})),window.addEventListener("keyup",this.keyUp,!1)}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener("keyup",this.keyUp,!1)}update(t){return Y(this,null,function*(){this.setState({isBusy:!0}),yield ct.State.Snapshots.Apply(this.plugin,{id:t}),this.setState({isBusy:!1})})}render(){let t=this.plugin.managers.snapshot,r=t.state.entries.size;if(r<2||!this.state.show)return null;let n=t.state.current,o=t.state.isPlaying;return(0,ln.jsxs)("div",{className:"msp-state-snapshot-viewport-controls",children:[(0,ln.jsxs)("select",{className:"msp-form-control",value:n||"none",onChange:this.change,disabled:this.state.isBusy||o,children:[!n&&(0,ln.jsx)("option",{value:"none"},"none"),t.state.entries.valueSeq().map((i,s)=>(0,ln.jsxs)("option",{value:i.snapshot.id,children:[`[${s+1}/${r}]`," ",i.name||new Date(i.timestamp).toLocaleString()]},i.snapshot.id))]}),(0,ln.jsx)(Qt,{svg:o?_U:mD,title:o?"Pause":"Cycle States",onClick:this.togglePlay,disabled:o?!1:this.state.isBusy}),!o&&(0,ln.jsxs)(ln.Fragment,{children:[(0,ln.jsx)(Qt,{svg:SU,title:"Previous State",onClick:this.prev,disabled:this.state.isBusy||o}),(0,ln.jsx)(Qt,{svg:CU,title:"Next State",onClick:this.next,disabled:this.state.isBusy||o})]})]})}};function $0e(){var e;let t=Rv.useContext(vu),[r,n]=Rv.useState(0);Rv.useEffect(()=>{let s=t.managers.snapshot.events.changed.subscribe(()=>n(a=>a+1));return()=>s.unsubscribe()},[t]);let o=t.managers.snapshot.state.current;if(!o)return null;let i=t.managers.snapshot.getEntry(o);return!((e=i?.description)===null||e===void 0)&&e.trim()?(0,ln.jsx)("div",{className:"msp-snapshot-description-wrapper",children:(0,ln.jsx)(SM,{skipHtml:!0,components:{a:GKe},children:i.description})}):null}function GKe({href:e,children:t,element:r}){let n=Rv.useContext(vu);return e&&e[0]==="#"?(0,ln.jsx)("a",{href:"#",onClick:o=>{o.preventDefault(),n.managers.snapshot.applyKey(e.substring(1))},children:t}):r}var zM=class extends pr{constructor(){super(...arguments),this.state={isEmpty:!0,isExpanded:!1,isBusy:!1,isAnimating:!1,isPlaying:!1},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded}),this.stop=()=>{this.plugin.managers.animation.stop(),this.plugin.managers.snapshot.stop()}}componentDidMount(){this.subscribe(this.plugin.managers.snapshot.events.changed,()=>{this.plugin.managers.snapshot.state.isPlaying?this.setState({isPlaying:!0,isExpanded:!1}):this.setState({isPlaying:!1})}),this.subscribe(this.plugin.behaviors.state.isBusy,t=>{t?this.setState({isBusy:!0,isExpanded:!1,isEmpty:this.plugin.state.data.tree.transforms.size<2}):this.setState({isBusy:!1,isEmpty:this.plugin.state.data.tree.transforms.size<2})}),this.subscribe(this.plugin.behaviors.state.isAnimating,t=>{t?this.setState({isAnimating:!0,isExpanded:!1}):this.setState({isAnimating:!1})})}render(){let t=this.plugin.managers.snapshot.state.isPlaying;if(t||this.state.isEmpty||this.plugin.managers.animation.isEmpty||!this.plugin.config.get(Tr.Viewport.ShowAnimation))return null;let r=this.state.isAnimating;return(0,ln.jsxs)("div",{className:"msp-animation-viewport-controls",children:[(0,ln.jsxs)("div",{children:[(0,ln.jsx)("div",{className:"msp-semi-transparent-background"}),(0,ln.jsx)(Qt,{svg:r||t?_U:Zde,transparent:!0,title:r?"Stop":"Select Animation",onClick:r||t?this.stop:this.toggleExpanded,toggleState:this.state.isExpanded,disabled:r||t?!1:this.state.isBusy||this.state.isPlaying||this.state.isEmpty})]}),this.state.isExpanded&&!this.state.isBusy&&(0,ln.jsx)("div",{className:"msp-animation-viewport-controls-select",children:(0,ln.jsx)(CM,{onStart:this.toggleExpanded})})]})}},VM=class extends pr{componentDidMount(){this.subscribe(this.plugin.behaviors.interaction.selectionMode,()=>this.forceUpdate())}render(){return this.plugin.selectionMode?(0,ln.jsx)("div",{className:"msp-selection-viewport-controls",children:(0,ln.jsx)(IM,{})}):null}},GM=class extends pr{constructor(){super(...arguments),this.state={labels:[]}}componentDidMount(){this.subscribe(this.plugin.behaviors.labels.highlight,t=>this.setState({labels:t.labels}))}render(){return this.state.labels.length===0?null:(0,ln.jsx)("div",{className:"msp-highlight-info",children:this.state.labels.map((t,r)=>t.indexOf(` +`)>0?(0,ln.jsx)("div",{className:"msp-highlight-markdown-row",children:(0,ln.jsx)(SM,{skipHtml:!0,children:t})},""+r):(0,ln.jsx)("div",{className:"msp-highlight-simple-row",dangerouslySetInnerHTML:{__html:t}},""+r))})}},QV=class extends pr{componentDidMount(){this.subscribe(this.plugin.state.behaviors.events.changed,()=>this.forceUpdate())}render(){let t=[];return this.plugin.customStructureControls.forEach((r,n)=>{t.push((0,ln.jsx)(r,{initiallyCollapsed:this.props.initiallyCollapsed},n))}),t.length>0?(0,ln.jsx)(ln.Fragment,{children:t}):null}},HM=class extends pr{render(){return(0,ln.jsxs)(ln.Fragment,{children:[(0,ln.jsxs)("div",{className:"msp-section-header",children:[(0,ln.jsx)(tn,{svg:Nde}),"Structure Tools"]}),(0,ln.jsx)(MM,{}),(0,ln.jsx)(DM,{}),(0,ln.jsx)(FM,{}),(0,ln.jsx)(OM,{}),(0,ln.jsx)(AM,{}),this.plugin.config.get(Tr.VolumeStreaming.Enabled)&&(0,ln.jsx)(BM,{}),(0,ln.jsx)(RM,{}),(0,ln.jsx)(QV,{})]})}};var Kr=vr(Ln());var x2=vr(Ln());var jM=class extends pr{get current(){return this.props.state.behaviors.currentObject.value}componentDidMount(){this.subscribe(this.plugin.state.events.object.updated,({ref:t,state:r})=>{let n=this.current;n.ref!==t||n.state!==r||this.forceUpdate()}),this.subscribe(this.plugin.state.data.actions.events.added,()=>this.forceUpdate()),this.subscribe(this.plugin.state.data.actions.events.removed,()=>this.forceUpdate())}render(){let{state:t,nodeRef:r}=this.props,n=t.cells.get(r),o=t.actions.fromCell(n,this.plugin);if(o.length===0)return null;let i=n.transform.transformer.definition,s=n.obj?n.obj.label:i.display&&i.display.name||i.name;return(0,x2.jsxs)("div",{className:"msp-state-actions",children:[!this.props.hideHeader&&(0,x2.jsxs)("div",{className:"msp-section-header",children:[(0,x2.jsx)(tn,{svg:Hde})," ",`Actions (${s})`]}),o.map((a,l)=>(0,x2.jsx)(Ey,{state:t,action:a,nodeRef:r,initiallyCollapsed:l===0?!this.props.alwaysExpandFirst&&this.props.initiallyCollapsed:this.props.initiallyCollapsed},`${a.id}`))]})}};var Xt=vr(Ln());var Lv=vr(Ui());var qM=class extends pr{render(){var t;return(0,Xt.jsxs)("div",{children:[(0,Xt.jsx)(_p,{icon:pD,title:"Plugin State"}),(0,Xt.jsx)("div",{style:{marginBottom:"10px"},children:(0,Xt.jsx)(qs,{header:"Save Options",initiallyExpanded:!1,children:(0,Xt.jsx)(p3,{})})}),(0,Xt.jsx)(WM,{}),(0,Xt.jsx)(ZV,{}),(0,Xt.jsx)(_p,{title:"Save as File",accent:"blue"}),(0,Xt.jsx)(m3,{}),((t=this.plugin.spec.components)===null||t===void 0?void 0:t.remoteState)!=="none"&&(0,Xt.jsx)(f3,{})]})}},m3=class extends pr{constructor(){super(...arguments),this.downloadToFileJson=()=>{var t,r;(r=(t=this.props).onAction)===null||r===void 0||r.call(t),ct.State.Snapshots.DownloadToFile(this.plugin,{type:"json"})},this.downloadToFileZip=()=>{var t,r;(r=(t=this.props).onAction)===null||r===void 0||r.call(t),ct.State.Snapshots.DownloadToFile(this.plugin,{type:"zip"})},this.open=t=>{var r,n;if(!t.target.files||!t.target.files[0]){this.plugin.log.error("No state file selected");return}(n=(r=this.props).onAction)===null||n===void 0||n.call(r),ct.State.Snapshots.OpenFile(this.plugin,{file:t.target.files[0]})}}render(){return(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsxs)("div",{className:"msp-flex-row",children:[(0,Xt.jsx)(Jt,{icon:dw,onClick:this.downloadToFileJson,title:"Save the state description. Input data are loaded using the provided sources. Does not work if local files are used as input.",children:"State"}),(0,Xt.jsx)(Jt,{icon:dw,onClick:this.downloadToFileZip,title:"Save the state including the input data.",children:"Session"}),(0,Xt.jsxs)("div",{className:"msp-btn msp-btn-block msp-btn-action msp-loader-msp-btn-file",children:[(0,Xt.jsx)(tn,{svg:Kde,inline:!0})," Open ",(0,Xt.jsx)("input",{onChange:this.open,type:"file",multiple:!1,accept:".molx,.molj"})]})]}),(0,Xt.jsxs)("div",{className:"msp-help-text",style:{padding:"10px"},children:[(0,Xt.jsx)(tn,{svg:fD})," This is an experimental feature and stored states/sessions might not be openable in a future version."]})]})}},p3=class extends pr{componentDidMount(){this.subscribe(this.plugin.state.snapshotParams,()=>this.forceUpdate())}render(){return(0,Xt.jsx)(Hn,{params:Sy.SnapshotParams,values:this.plugin.state.snapshotParams.value,onChangeValues:this.plugin.state.setSnapshotParams})}},WM=class e extends pr{constructor(){super(...arguments),this.state={params:C.getDefaultValues(e.Params)},this.add=()=>{ct.State.Snapshots.Add(this.plugin,{name:this.state.params.name,description:this.state.params.description})},this.updateParams=t=>this.setState({params:t}),this.clear=()=>{ct.State.Snapshots.Clear(this.plugin,{})}}shouldComponentUpdate(t,r){return!zp(this.props,t)||!zp(this.state,r)}render(){return(0,Xt.jsx)("div",{children:(0,Xt.jsx)(HKe,{parent:this})})}};WM.Params={name:C.Text(),description:C.Text()};function J0e(e,t,r){return t?e.managers.snapshot.state.entries.some(n=>(!r||n.snapshot.id!==r)&&n.key===t):!1}function HKe({parent:e}){let[t,r]=Lv.useState({key:"",name:"",description:""}),n=()=>{ct.State.Snapshots.Add(e.plugin,{key:t.key,name:t.name,description:t.description}),r({key:"",name:"",description:""})},o=J0e(e.plugin,t.key);return(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(eye,{state:t,setState:r,apply:n}),(0,Xt.jsxs)("div",{className:"msp-flex-row",children:[(0,Xt.jsx)(Qt,{onClick:e.clear,svg:ua,title:"Remove All"}),(0,Xt.jsx)(Jt,{onClick:n,icon:o?void 0:Cp,style:{textAlign:"right"},commit:o?"off":"on",disabled:o,children:o?"Key must be unique":"Add"})]})]})}var ZV=class extends pr{constructor(){super(...arguments),this.state={editingId:void 0},this.edit=t=>{let r=t.currentTarget.getAttribute("data-id");if(!r)return;let n=this.state.editingId;this.setState({editingId:r===n?void 0:r})},this.doneEdit=()=>this.setState({editingId:void 0}),this.apply=t=>{let r=t.currentTarget.getAttribute("data-id");r&&ct.State.Snapshots.Apply(this.plugin,{id:r})},this.remove=t=>{let r=t.currentTarget.getAttribute("data-id");r&&ct.State.Snapshots.Remove(this.plugin,{id:r})},this.moveUp=t=>{let r=t.currentTarget.getAttribute("data-id");r&&ct.State.Snapshots.Move(this.plugin,{id:r,dir:-1})},this.moveDown=t=>{let r=t.currentTarget.getAttribute("data-id");r&&ct.State.Snapshots.Move(this.plugin,{id:r,dir:1})},this.replace=t=>{let r=t.currentTarget.getAttribute("data-id");r&&ct.State.Snapshots.Replace(this.plugin,{id:r})}}componentDidMount(){this.subscribe(this.plugin.managers.snapshot.events.changed,()=>this.forceUpdate())}render(){let t=this.plugin.managers.snapshot.state.current,r=[];return this.plugin.managers.snapshot.state.entries.forEach(n=>{var o;r.push((0,Xt.jsxs)("li",{className:"msp-flex-row",children:[(0,Xt.jsxs)(Jt,{"data-id":n.snapshot.id,onClick:this.apply,className:"msp-no-overflow",children:[(0,Xt.jsxs)("span",{style:{fontWeight:n.snapshot.id===t?"bold":void 0},children:[!!n.key&&`[${n.key}] `,n.name||new Date(n.timestamp).toLocaleString()]})," ",(0,Xt.jsx)("small",{children:`${n.snapshot.durationInMs?ix(n.snapshot.durationInMs,!1):""}`})]}),(0,Xt.jsx)(Qt,{svg:Oc,"data-id":n.snapshot.id,title:"Edit",onClick:this.edit,flex:"28px"}),(0,Xt.jsx)(Qt,{svg:iy,"data-id":n.snapshot.id,title:"Move Up",onClick:this.moveUp,flex:"20px"}),(0,Xt.jsx)(Qt,{svg:oy,"data-id":n.snapshot.id,title:"Move Down",onClick:this.moveDown,flex:"20px"}),(0,Xt.jsx)(Qt,{svg:$de,"data-id":n.snapshot.id,title:"Replace",onClick:this.replace,flex:"20px"}),(0,Xt.jsx)(Qt,{svg:ua,"data-id":n.snapshot.id,title:"Remove",onClick:this.remove,flex:"20px"})]},n.snapshot.id)),this.state.editingId===n.snapshot.id&&r.push((0,Xt.jsx)(jKe,{entry:n,plugin:this.plugin,done:this.doneEdit},`${n.snapshot.id}-edit`));let i=n.image&&((o=this.plugin.managers.asset.get(n.image))===null||o===void 0?void 0:o.file);i&&r.push((0,Xt.jsx)("li",{className:"msp-state-image-row",children:(0,Xt.jsx)(Jt,{"data-id":n.snapshot.id,onClick:this.apply,children:(0,Xt.jsx)("img",{draggable:!1,src:URL.createObjectURL(i)})})},`${n.snapshot.id}-image`))}),(0,Xt.jsx)(Xt.Fragment,{children:(0,Xt.jsx)("ul",{style:{listStyle:"none",marginTop:"10px"},className:"msp-state-list",children:r})})}};function eye({state:e,setState:t,apply:r}){let n=Lv.useRef(),o=Lv.useRef(),[i,s]=Lv.useState(!1);return(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(cl,{label:"Name",control:(0,Xt.jsx)("input",{type:"text",value:e.name,placeholder:"Name",onChange:a=>t(te(k({},e),{name:a.target.value})),onKeyUp:a=>{var l;a.key==="Enter"&&((l=n.current)===null||l===void 0||l.focus())}})}),(0,Xt.jsx)(cl,{label:(0,Xt.jsxs)(Xt.Fragment,{children:["Key",(0,Xt.jsx)(e8,{show:i,toggle:()=>s(a=>!a)})]}),control:(0,Xt.jsx)("input",{type:"text",ref:n,value:e.key,placeholder:"Key (optional)",onChange:a=>t(te(k({},e),{key:a.target.value})),onKeyUp:a=>{var l;a.key==="Enter"&&((l=o.current)===null||l===void 0||l.focus())}})}),i&&(0,Xt.jsx)("div",{className:"msp-control-offset",children:(0,Xt.jsx)(vw,{description:"Optional snapshot key used to activate snapshots from descriptions, labels, etc."})}),(0,Xt.jsx)("div",{className:"msp-flex-row msp-text-area-wrapper",style:{marginBottom:1},children:(0,Xt.jsx)("textarea",{ref:o,placeholder:`Markdown Description + +- Use [title](#key) to link to a snapshot`,className:"msp-form-control",value:e.description,onChange:a=>t(te(k({},e),{description:a.target.value})),onKeyUp:a=>{a.key==="Enter"&&a.ctrlKey&&r(e)}})})]})}function jKe({entry:e,plugin:t,done:r}){var n,o,i;let[s,a]=Lv.useState({key:(n=e.key)!==null&&n!==void 0?n:"",name:(o=e.name)!==null&&o!==void 0?o:"",description:(i=e.description)!==null&&i!==void 0?i:""}),l=()=>{t.managers.snapshot.update(e,s),r()},c=J0e(t,s.key,e.snapshot.id);return(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(eye,{state:s,setState:a,apply:l}),(0,Xt.jsx)("div",{className:"msp-flex-row",style:{marginBottom:1},children:(0,Xt.jsx)(Jt,{onClick:l,icon:c?void 0:ed,style:{textAlign:"right"},commit:c?"off":"on",disabled:c,children:c?"Key must be unique":"Apply"})})]})}var f3=class extends pr{constructor(){super(...arguments),this.Params={name:C.Text(),options:C.Group({description:C.Text(),playOnLoad:C.Boolean(!1),serverUrl:C.Text(this.plugin.config.get(Tr.State.CurrentServer))})},this.state={params:C.getDefaultValues(this.Params),entries:ia(),isBusy:!1},this.ListOnlyParams={options:C.Group({serverUrl:C.Text(this.plugin.config.get(Tr.State.CurrentServer))},{isFlat:!0})},this._mounted=!1,this.refresh=()=>Y(this,null,function*(){try{this.setState({isBusy:!0}),this.plugin.config.set(Tr.State.CurrentServer,this.state.params.options.serverUrl);let t=(yield this.plugin.runTask(this.plugin.fetch({url:this.serverUrl("list"),type:"json"})))||[];t.sort((n,o)=>n.isSticky===o.isSticky?n.timestamp-o.timestamp:n.isSticky?-1:1);let r=ia().asMutable();for(let n of t)r.set(n.id,te(k({},n),{url:this.serverUrl(`get/${n.id}`),removeUrl:this.serverUrl(`remove/${n.id}`)}));this._mounted&&this.setState({entries:r.asImmutable(),isBusy:!1})}catch(t){console.error(t),this.plugin.log.error("Error fetching remote snapshots"),this._mounted&&this.setState({entries:ia(),isBusy:!1})}}),this.upload=()=>Y(this,null,function*(){this.setState({isBusy:!0}),this.plugin.config.set(Tr.State.CurrentServer,this.state.params.options.serverUrl),yield ct.State.Snapshots.Upload(this.plugin,{name:this.state.params.name,description:this.state.params.options.description,playOnLoad:this.state.params.options.playOnLoad,serverUrl:this.state.params.options.serverUrl}),this.plugin.log.message("Snapshot uploaded."),this._mounted&&(this.setState({isBusy:!1}),this.refresh())}),this.fetch=t=>Y(this,null,function*(){let r=t.currentTarget.getAttribute("data-id");if(!r)return;let n=this.state.entries.get(r);if(n){this.setState({isBusy:!0});try{yield ct.State.Snapshots.Fetch(this.plugin,{url:n.url})}finally{this._mounted&&this.setState({isBusy:!1})}}}),this.remove=t=>Y(this,null,function*(){let r=t.currentTarget.getAttribute("data-id");if(!r)return;let n=this.state.entries.get(r);if(n){this.setState({entries:this.state.entries.remove(r)});try{yield fetch(n.removeUrl)}catch(o){console.error(o)}}})}componentDidMount(){this.refresh(),this._mounted=!0}componentWillUnmount(){super.componentWillUnmount(),this._mounted=!1}serverUrl(t){return t?o0(this.state.params.options.serverUrl,t):this.state.params.options.serverUrl}render(){return(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(_p,{title:"Remote States",accent:"blue"}),!this.props.listOnly&&(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(Hn,{params:this.Params,values:this.state.params,onEnter:this.upload,onChange:t=>{this.setState({params:te(k({},this.state.params),{[t.name]:t.value})})},isDisabled:this.state.isBusy}),(0,Xt.jsxs)("div",{className:"msp-flex-row",children:[(0,Xt.jsx)(Qt,{onClick:this.refresh,disabled:this.state.isBusy,svg:pw}),(0,Xt.jsx)(Jt,{icon:Gde,onClick:this.upload,disabled:this.state.isBusy,commit:!0,children:"Upload"})]})]}),(0,Xt.jsx)($V,{entries:this.state.entries,isBusy:this.state.isBusy,serverUrl:this.state.params.options.serverUrl,fetch:this.fetch,remove:this.props.listOnly?void 0:this.remove}),this.props.listOnly&&(0,Xt.jsxs)("div",{style:{marginTop:"10px"},children:[(0,Xt.jsx)(Hn,{params:this.ListOnlyParams,values:this.state.params,onEnter:this.upload,onChange:t=>{this.setState({params:te(k({},this.state.params),{[t.name]:t.value})})},isDisabled:this.state.isBusy}),(0,Xt.jsx)("div",{className:"msp-flex-row",children:(0,Xt.jsx)(Jt,{onClick:this.refresh,disabled:this.state.isBusy,icon:pw,children:"Refresh"})})]})]})}},$V=class extends ti{constructor(){super(...arguments),this.open=t=>Y(this,null,function*(){let r=t.currentTarget.getAttribute("data-id");if(!r)return;let n=this.props.entries.get(r);if(!n)return;t.preventDefault();let o=`${window.location}`,i=o.indexOf("?");i>0&&(o=o.substr(0,i)),window.open(`${o}?snapshot-url=${encodeURIComponent(n.url)}`,"_blank")})}render(){return(0,Xt.jsx)("ul",{style:{listStyle:"none",marginTop:"10px"},className:"msp-state-list",children:this.props.entries.valueSeq().map(t=>(0,Xt.jsxs)("li",{className:"msp-flex-row",children:[(0,Xt.jsxs)(Jt,{"data-id":t.id,onClick:this.props.fetch,disabled:this.props.isBusy,onContextMenu:this.open,title:"Click to download, right-click to open in a new tab.",children:[t.name||new Date(t.timestamp).toLocaleString()," ",(0,Xt.jsx)("small",{children:t.description})]}),!t.isSticky&&this.props.remove&&(0,Xt.jsx)(Qt,{svg:ua,"data-id":t.id,title:"Remove",onClick:this.props.remove,disabled:this.props.isBusy,small:!0})]},t.id))})}};var yo=vr(Ln());var h3=class extends pr{constructor(){super(...arguments),this.state={showActions:!0}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.created,t=>{t.cell.transform.parent===ur.RootRef&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.removed,t=>{t.parent===ur.RootRef&&this.forceUpdate()})}static getDerivedStateFromProps(t,r){let n=t.state.tree.root.ref,i=t.state.tree.children.get(n).size===0;return r.showActions===i?null:{showActions:i}}render(){let t=this.props.state.tree.root.ref;return this.state.showActions?(0,yo.jsxs)("div",{style:{margin:"10px",cursor:"default"},children:[(0,yo.jsx)("p",{children:"Nothing to see here yet."}),(0,yo.jsxs)("p",{children:["Structures and Volumes can be loaded from the ",(0,yo.jsx)(tn,{svg:mw})," tab."]})]}):(0,yo.jsx)(JV,{cell:this.props.state.cells.get(t),depth:0})}},JV=class e extends pr{constructor(){super(...arguments),this.state={isCollapsed:!!this.props.cell.state.isCollapsed,isNull:e.isNull(this.props.cell),showLabel:e.showLabel(this.props.cell)}}is(t){return t.ref===this.ref&&t.state===this.props.cell.parent}get ref(){return this.props.cell.transform.ref}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated,t=>{this.props.cell===t.cell&&this.is(t)&&t.state.cells.has(this.ref)&&(this.state.isCollapsed!==!!t.cell.state.isCollapsed||this.state.isNull!==e.isNull(t.cell)||this.state.showLabel!==e.showLabel(t.cell))&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.created,t=>{this.props.cell.parent===t.state&&this.ref===t.cell.transform.parent&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.removed,t=>{this.props.cell.parent===t.state&&this.ref===t.parent&&this.forceUpdate()})}static getDerivedStateFromProps(t,r){let n=e.isNull(t.cell),o=e.showLabel(t.cell);return!!t.cell.state.isCollapsed===r.isCollapsed&&r.isNull===n&&r.showLabel===o?null:{isCollapsed:!!t.cell.state.isCollapsed,isNull:n,showLabel:o}}static hasDecorator(t){var r;let n=t.parent.tree.children.get(t.transform.ref);return n.size!==1?!1:!!(!((r=t.parent)===null||r===void 0)&&r.tree.transforms.get(n.first()).transformer.definition.isDecorator)}static isNull(t){return!t||!t.parent||t.obj===kn.Null||!t.parent.tree.transforms.has(t.transform.ref)}static showLabel(t){return t.transform.ref!==ur.RootRef&&(t.status!=="ok"||!t.state.isGhost&&!e.hasDecorator(t))}render(){if(this.state.isNull)return null;let t=this.props.cell,r=t.parent.tree.children.get(this.ref);if(!this.state.showLabel)return r.size===0?null:(0,yo.jsx)(yo.Fragment,{children:r.map(o=>(0,yo.jsx)(e,{cell:t.parent.cells.get(o),depth:this.props.depth},o))});let n=this.props.depth+1;return(0,yo.jsxs)(yo.Fragment,{children:[(0,yo.jsx)(e9,{cell:t,depth:this.props.depth}),r.size===0?void 0:(0,yo.jsx)("div",{style:{display:this.state.isCollapsed?"none":"block"},children:r.map(o=>(0,yo.jsx)(e,{cell:t.parent.cells.get(o),depth:n},o))})]})}},e9=class extends pr{constructor(){super(...arguments),this.state={isCurrent:this.props.cell.parent.current===this.ref,isCollapsed:!!this.props.cell.state.isCollapsed,action:void 0,currentAction:void 0},this.setCurrent=t=>{t?.preventDefault(),t?.currentTarget.blur(),ct.State.SetCurrentObject(this.plugin,{state:this.props.cell.parent,ref:this.ref})},this.setCurrentRoot=t=>{t?.preventDefault(),t?.currentTarget.blur(),ct.State.SetCurrentObject(this.plugin,{state:this.props.cell.parent,ref:ur.RootRef})},this.remove=t=>{t?.preventDefault(),ct.State.RemoveObject(this.plugin,{state:this.props.cell.parent,ref:this.ref,removeParentGhosts:!0})},this.toggleVisible=t=>{t.preventDefault(),ct.State.ToggleVisibility(this.plugin,{state:this.props.cell.parent,ref:this.ref}),t.currentTarget.blur()},this.toggleExpanded=t=>{t.preventDefault(),ct.State.ToggleExpanded(this.plugin,{state:this.props.cell.parent,ref:this.ref}),t.currentTarget.blur()},this.highlight=t=>{t.preventDefault(),ct.Interactivity.Object.Highlight(this.plugin,{state:this.props.cell.parent,ref:this.ref}),t.currentTarget.blur()},this.clearHighlight=t=>{t.preventDefault(),ct.Interactivity.ClearHighlights(this.plugin),t.currentTarget.blur()},this.hideApply=()=>{this.setCurrentRoot()},this.selectAction=t=>{t&&(0,t?.value)()}}is(t){return t.ref===this.ref&&t.state===this.props.cell.parent}get ref(){return this.props.cell.transform.ref}componentDidMount(){this.subscribe(this.plugin.state.events.cell.stateUpdated.pipe(Np(t=>this.is(t)),cA(33)),t=>{this.forceUpdate()}),this.subscribe(this.props.cell.parent.behaviors.currentObject,t=>{if(!this.is(t)){this.state.isCurrent&&t.state.transforms.has(this.ref)&&this._setCurrent(this.props.cell.parent.current===this.ref,this.state.isCollapsed);return}t.state.transforms.has(this.ref)&&this._setCurrent(this.props.cell.parent.current===this.ref,!!this.props.cell.state.isCollapsed)})}_setCurrent(t,r){t?this.setState({isCurrent:t,action:"options",currentAction:void 0,isCollapsed:r}):this.setState({isCurrent:t,action:void 0,currentAction:void 0,isCollapsed:r})}static getDerivedStateFromProps(t,r){let n=t.cell.parent.current===t.cell.transform.ref,o=!!t.cell.state.isCollapsed;return r.isCollapsed===o&&r.isCurrent===n?null:{isCurrent:n,isCollapsed:o,action:void 0,currentAction:void 0}}get actions(){let t=this.props.cell,r=[...t.parent.actions.fromCell(t,this.plugin)];if(r.length!==0)return r.sort((n,o)=>n.definition.display.namesr.Item(n.definition.display.name,()=>this.setState({action:"apply",currentAction:n})))]}updates(t){let r=this.props.cell,n=n0.getDecoratorChain(r.parent,r.transform.ref),o=[];for(let i=n.length-1;i>=0;i--){let s=n[i];o.push((0,yo.jsx)(cc,{state:r.parent,transform:s.transform,noMargin:!0,wrapInExpander:!0,expanderHeaderLeftMargin:t},`${s.transform.transformer.id}-${i}`))}return(0,yo.jsx)("div",{className:"msp-tree-updates-wrapper",children:o})}render(){let t=this.props.cell,r=t.transform;if(!t)return null;let n=this.is(t.parent.behaviors.currentObject.value),o=t.status!=="error"&&t.status!=="ok",i;if(t.status==="error"||!t.obj){let p=t.status==="error"?t.errorText:r.transformer.definition.display.name;i=(0,yo.jsxs)(Jt,{className:"msp-btn-tree-label msp-no-hover-outline",noOverflow:!0,title:p,onClick:this.state.isCurrent?this.setCurrentRoot:this.setCurrent,disabled:o,children:[t.status==="error"&&(0,yo.jsxs)("b",{children:["[",t.status,"]"]})," ",(0,yo.jsx)("span",{children:p})]})}else{let p=t.obj,h=`${p.label} ${p.description?p.description:""}`;i=(0,yo.jsxs)(Jt,{className:`msp-btn-tree-label msp-type-class-${p.type.typeClass}`,noOverflow:!0,disabled:o,title:h,onClick:this.state.isCurrent?this.setCurrentRoot:this.setCurrent,children:[(0,yo.jsx)("span",{children:p.label})," ",p.description?(0,yo.jsx)("small",{children:p.description}):void 0]})}let s=t.parent.tree.children.get(this.ref),a=t.state,l=(0,yo.jsx)(Qt,{svg:a.isCollapsed?tc:ec,flex:"20px",disabled:o,onClick:this.toggleExpanded,transparent:!0,className:"msp-no-hover-outline",style:{visibility:s.size>0?"visible":"hidden"}}),c=t.state.isLocked?void 0:(0,yo.jsx)(Qt,{svg:ua,onClick:this.remove,disabled:o,small:!0,toggleState:!1}),u=(0,yo.jsx)(Qt,{svg:a.isHidden?td:rd,toggleState:!1,disabled:o,small:!0,onClick:this.toggleVisible}),d={marginLeft:`${this.props.depth*8}px`},m=(0,yo.jsxs)("div",{className:`msp-flex-row msp-tree-row${n?" msp-tree-row-current":""}`,onMouseEnter:this.highlight,onMouseLeave:this.clearHighlight,style:d,children:[l,i,c,u]});if(!n)return m;if(this.state.action==="apply"&&this.state.currentAction)return(0,yo.jsxs)("div",{style:{marginBottom:"1px"},children:[m,(0,yo.jsx)(ll,{header:`Apply ${this.state.currentAction.definition.display.name}`,initialExpanded:!0,hideExpander:!0,hideOffset:!1,onHeaderClick:this.hideApply,topRightIcon:Fc,headerLeftMargin:`${this.props.depth*8+21}px`,children:(0,yo.jsx)(Ey,{onApply:this.hideApply,state:this.props.cell.parent,action:this.state.currentAction,nodeRef:this.props.cell.transform.ref,hideHeader:!0,noMargin:!0})})]});if(this.state.action==="options"){let p=this.actions,h=this.updates(`${this.props.depth*8+21}px`);return(0,yo.jsxs)("div",{style:{marginBottom:"1px"},children:[m,h,p&&(0,yo.jsx)("div",{style:{marginLeft:`${this.props.depth*8+21}px`,marginTop:"-1px"},children:(0,yo.jsx)(sr,{items:p,onSelect:this.selectAction})})]})}return m}};var t9=class extends pr{componentDidMount(){this.subscribe(this.plugin.state.behaviors.events.changed,()=>this.forceUpdate())}render(){let t=[];return this.plugin.customImportControls.forEach((r,n)=>{t.push((0,Kr.jsx)(r,{initiallyCollapsed:this.props.initiallyCollapsed},n))}),t.length>0?(0,Kr.jsx)(Kr.Fragment,{children:t}):null}},YM=class extends pr{constructor(){var t;super(...arguments),this.state={tab:this.plugin.behaviors.layout.leftPanelTabName.value},this.set=r=>{if(this.state.tab===r){this.setState({tab:"none"},()=>this.plugin.behaviors.layout.leftPanelTabName.next("none")),ct.Layout.Update(this.plugin,{state:{regionState:te(k({},this.plugin.layout.state.regionState),{left:"collapsed"})}});return}this.setState({tab:r},()=>this.plugin.behaviors.layout.leftPanelTabName.next(r)),this.plugin.layout.state.regionState.left!=="full"&&ct.Layout.Update(this.plugin,{state:{regionState:te(k({},this.plugin.layout.state.regionState),{left:"full"})}})},this.tabs={none:(0,Kr.jsx)(Kr.Fragment,{}),root:(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(_p,{icon:mw,title:"Home"}),(0,Kr.jsx)(jM,{state:this.plugin.state.data,nodeRef:ur.RootRef,hideHeader:!0,initiallyCollapsed:!0,alwaysExpandFirst:!0}),(0,Kr.jsx)(t9,{}),((t=this.plugin.spec.components)===null||t===void 0?void 0:t.remoteState)!=="none"&&(0,Kr.jsx)(f3,{listOnly:!0})]}),data:(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(_p,{icon:yU,title:(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(o9,{})," State Tree"]})}),(0,Kr.jsx)(h3,{state:this.plugin.state.data})]}),states:(0,Kr.jsx)(qM,{}),settings:(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(_p,{icon:Oc,title:"Plugin Settings"}),(0,Kr.jsx)(n9,{})]}),help:(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(_p,{icon:rc,title:"Help"}),(0,Kr.jsx)(TM,{})]})}}componentDidMount(){this.subscribe(this.plugin.behaviors.layout.leftPanelTabName,t=>{this.state.tab!==t&&this.setState({tab:t}),t==="none"&&this.plugin.layout.state.regionState.left!=="collapsed"&&ct.Layout.Update(this.plugin,{state:{regionState:te(k({},this.plugin.layout.state.regionState),{left:"collapsed"})}})}),this.subscribe(this.plugin.state.data.events.changed,({state:t})=>{this.state.tab==="data"&&t.cells.size===1&&this.set("root")})}render(){let t=this.state.tab;return(0,Kr.jsxs)("div",{className:"msp-left-panel-controls",children:[(0,Kr.jsxs)("div",{className:"msp-left-panel-controls-buttons",children:[(0,Kr.jsx)(Qt,{svg:mw,toggleState:t==="root",transparent:!0,onClick:()=>this.set("root"),title:"Home"}),(0,Kr.jsx)(r9,{set:this.set}),(0,Kr.jsx)(Qt,{svg:pD,toggleState:t==="states",transparent:!0,onClick:()=>this.set("states"),title:"Plugin State"}),(0,Kr.jsx)(Qt,{svg:rc,toggleState:t==="help",transparent:!0,onClick:()=>this.set("help"),title:"Help"}),(0,Kr.jsx)("div",{className:"msp-left-panel-controls-buttons-bottom",children:(0,Kr.jsx)(Qt,{svg:Oc,toggleState:t==="settings",transparent:!0,onClick:()=>this.set("settings"),title:"Settings"})})]}),(0,Kr.jsx)("div",{className:"msp-scrollable-container",children:this.tabs[t]})]})}},r9=class extends pr{constructor(){super(...arguments),this.state={changed:!1}}get tab(){return this.plugin.behaviors.layout.leftPanelTabName.value}componentDidMount(){this.subscribe(this.plugin.behaviors.layout.leftPanelTabName,t=>{this.tab==="data"?this.setState({changed:!1}):this.forceUpdate()}),this.subscribe(this.plugin.state.data.events.changed,t=>{this.tab!=="data"&&this.setState({changed:!0})})}render(){return(0,Kr.jsx)(Qt,{svg:yU,toggleState:this.tab==="data",transparent:!0,onClick:()=>this.props.set("data"),title:"State Tree",style:{position:"relative"},extraContent:this.state.changed?(0,Kr.jsx)("div",{className:"msp-left-panel-controls-button-data-dirty"}):void 0})}},n9=class extends pr{constructor(){super(...arguments),this.setSettings=t=>{ct.Canvas3D.SetSettings(this.plugin,{settings:{[t.name]:t.value}})},this.setCanvas3DContextProps=t=>{var r;(r=this.plugin.canvas3dContext)===null||r===void 0||r.setProps({[t.name]:t.value}),this.plugin.events.canvas3d.settingsUpdated.next(void 0)}}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.layout.events.updated,()=>this.forceUpdate()),this.plugin.canvas3d&&this.subscribe(this.plugin.canvas3d.camera.stateChanged.pipe(xd(500,void 0,{leading:!0,trailing:!0})),t=>{(t.radiusMax!==void 0||t.radius!==void 0)&&this.forceUpdate()})}render(){return(0,Kr.jsxs)(Kr.Fragment,{children:[this.plugin.canvas3d&&this.plugin.canvas3dContext&&(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(_p,{title:"Viewport"}),(0,Kr.jsx)(Hn,{params:ol,values:this.plugin.canvas3d.props,onChange:this.setSettings}),(0,Kr.jsx)(Hn,{params:hp.Params,values:this.plugin.canvas3dContext.props,onChange:this.setCanvas3DContextProps})]}),(0,Kr.jsx)(_p,{title:"Behavior"}),(0,Kr.jsx)(h3,{state:this.plugin.state.behaviors})]})}},o9=class extends pr{constructor(){super(...arguments),this.remove=t=>{t.preventDefault(),ct.State.RemoveObject(this.plugin,{state:this.plugin.state.data,ref:ur.RootRef})}}componentDidMount(){this.subscribe(this.plugin.state.events.cell.created,t=>{t.cell.transform.parent===ur.RootRef&&this.forceUpdate()}),this.subscribe(this.plugin.state.events.cell.removed,t=>{t.parent===ur.RootRef&&this.forceUpdate()})}render(){return this.plugin.state.data.tree.children.get(ur.RootRef).size===0?null:(0,Kr.jsx)(Qt,{svg:ua,onClick:this.remove,title:"Remove All",style:{display:"inline-block"},small:!0,className:"msp-no-hover-outline",transparent:!0})}};var zi=vr(Ln()),sye=vr(Ui());var XM=vr(Ln()),rye=vr(Ui());var tye=5,KM=class extends pr{constructor(){super(...arguments),this.parentDiv=rye.createRef(),this.lastMouseOverSeqIdx=-1,this.highlightQueue=new mo,this.lociHighlightProvider=(t,r)=>{this.props.sequenceWrapper.markResidue(t.loci,r)&&this.updateMarker()},this.lociSelectionProvider=(t,r)=>{this.props.sequenceWrapper.markResidue(t.loci,r)&&this.updateMarker()},this.contextMenu=t=>{t.preventDefault()},this.mouseDownLoci=void 0,this.mouseDown=t=>{t.stopPropagation();let r=this.getSeqIdx(t),n=this.getLoci(r),o=N0(t.nativeEvent),i=Q1(t.nativeEvent),s=z_(t.nativeEvent);this.click(n,o,i,s),this.mouseDownLoci=n},this.mouseUp=t=>{if(t.stopPropagation(),this.mouseDownLoci===void 0)return;let r=this.getSeqIdx(t),n=this.getLoci(r);if(n&&!$.Loci.areEqual(this.mouseDownLoci,n)){let o=N0(t.nativeEvent),i=Q1(t.nativeEvent),s=z_(t.nativeEvent),a=this.mouseDownLoci.elements[0],l=n.elements[0],c=Math.min(Te.min(a.indices),Te.min(l.indices)),u=Math.max(Te.max(a.indices),Te.max(l.indices)),d=$.Loci(n.structure,[{unit:a.unit,indices:Te.ofRange(c,u)}]);this.click($.Loci.subtract(d,this.mouseDownLoci),o,i,s)}this.mouseDownLoci=void 0},this.location=$.Location.create(void 0),this.mouseMove=t=>{t.stopPropagation();let r=N0(t.nativeEvent),n=Q1(t.nativeEvent),o=z_(t.nativeEvent),i=t.target;if(!i||!i.getAttribute){if(this.lastMouseOverSeqIdx===-1)return;this.lastMouseOverSeqIdx=-1,this.highlightQueue.next({seqIdx:-1,buttons:r,button:n,modifiers:o});return}let s=i.hasAttribute("data-seqid")?+i.getAttribute("data-seqid"):-1;if(this.lastMouseOverSeqIdx!==s)if(this.lastMouseOverSeqIdx=s,this.mouseDownLoci!==void 0){let a=this.getLoci(s);this.hover(a,xo.Flag.None,xo.Flag.None,te(k({},o),{shift:!0}))}else this.highlightQueue.next({seqIdx:s,buttons:r,button:n,modifiers:o})},this.mouseLeave=t=>{if(t.stopPropagation(),this.mouseDownLoci=void 0,this.lastMouseOverSeqIdx===-1)return;this.lastMouseOverSeqIdx=-1;let r=N0(t.nativeEvent),n=Q1(t.nativeEvent),o=z_(t.nativeEvent);this.highlightQueue.next({seqIdx:-1,buttons:r,button:n,modifiers:o})}}get sequenceNumberPeriod(){return this.props.sequenceNumberPeriod!==void 0?this.props.sequenceNumberPeriod:this.props.sequenceWrapper.length>10?10:this.getSequenceNumber(this.props.sequenceWrapper.length-1).length>1?5:1}componentDidMount(){this.plugin.managers.interactivity.lociHighlights.addProvider(this.lociHighlightProvider),this.plugin.managers.interactivity.lociSelects.addProvider(this.lociSelectionProvider),this.subscribe(this.highlightQueue.pipe(xd(3*16.666,void 0,{leading:!0,trailing:!0})),t=>{let r=this.getLoci(t.seqIdx<0?void 0:t.seqIdx);this.hover(r,t.buttons,t.button,t.modifiers)})}componentWillUnmount(){super.componentWillUnmount(),this.plugin.managers.interactivity.lociHighlights.removeProvider(this.lociHighlightProvider),this.plugin.managers.interactivity.lociSelects.removeProvider(this.lociSelectionProvider)}getLoci(t){if(t!==void 0){let r=this.props.sequenceWrapper.getLoci(t);if(!$.Loci.isEmpty(r))return r}}getSeqIdx(t){let r,n=t.target;return n&&n.getAttribute&&(r=n.hasAttribute("data-seqid")?+n.getAttribute("data-seqid"):void 0),r}hover(t,r,n,o){let i={current:Nt.Loci.Empty,buttons:r,button:n,modifiers:o};t!==void 0&&!$.Loci.isEmpty(t)&&(i.current={loci:t}),this.plugin.behaviors.interaction.hover.next(i)}click(t,r,n,o){let i={current:Nt.Loci.Empty,buttons:r,button:n,modifiers:o};t!==void 0&&!$.Loci.isEmpty(t)&&(i.current={loci:t}),this.plugin.behaviors.interaction.click.next(i)}getBackgroundColor(t){return typeof t>"u"&&console.error("unexpected marker value"),t===0?"":t%2===0?"rgb(51, 255, 25)":"rgb(255, 102, 153)"}getResidueClass(t,r){return r.length>1?this.props.sequenceWrapper.residueClass(t)+(t===0?" msp-sequence-residue-long-begin":" msp-sequence-residue-long"):this.props.sequenceWrapper.residueClass(t)}residue(t,r,n){return(0,XM.jsx)("span",{"data-seqid":t,style:{backgroundColor:this.getBackgroundColor(n)},className:this.getResidueClass(t,r),children:`\u200B${r}\u200B`},t)}getSequenceNumberClass(t,r,n){let o=["msp-sequence-number"];return r.startsWith("-")?n.length>1&&t>0?o.push("msp-sequence-number-long-negative"):o.push("msp-sequence-number-negative"):n.length>1&&t>0&&o.push("msp-sequence-number-long"),o.join(" ")}getSequenceNumber(t){let r="",n=this.props.sequenceWrapper.getLoci(t),o=$.Loci.getFirstLocation(n,this.location);if(o)if(_e.isAtomic(o.unit)){let i=Ne.residue.auth_seq_id(o),s=Ne.residue.pdbx_PDB_ins_code(o);r=`${i}${s||""}`}else _e.isCoarse(o.unit)&&(r=`${t+1}`);return r}padSeqNum(t){return t.lengththis.sequence.index(s);if($.Loci.is(t)){if(!Me.areRootsEquivalent(t.structure,o))return!1;t=$.Loci.remap(t,o);for(let s of t.elements)this.unitMap.has(s.unit.id)&&(_e.isAtomic(s.unit)?n=WKe(s,r,this.markerArray,i)||n:n=YKe(s,r,this.markerArray,i)||n)}else if(Me.isLoci(t)){if(!Me.areRootsEquivalent(t.structure,o))return!1;Za(this.markerArray,this.observed,r)&&(n=!0)}return n}getLoci(t){let r=qKe(this.data.units[0].chainGroupId,this.data.units[0].conformation.operator.name,this.seqId(t));return lt.toLociWithSourceUnits(xC.run(r,this.data.structure))}constructor(t){let r=$.Location.create(t.structure,t.units[0],t.units[0].elements[0]),n=t.units[0].model.sequence.byEntityKey[Ne.entity.key(r)],o=n.sequence.length,i=new Uint8Array(o);super(t,i,o),this.unitMap=new Map;for(let a of t.units)this.unitMap.set(a.id,a);this.sequence=n.sequence,this.missing=t.units[0].model.properties.missingResidues,this.modelNum=t.units[0].model.modelNum,this.asymId=_e.isAtomic(t.units[0])?Ne.chain.label_asym_id(r):Ne.coarse.asym_id(r);let s=[];for(let a=0;aNe.unit.chainGroupId(n.element)===e&&Ne.unit.operator_name(n.element)===t,residueTest:n=>n.element.unit.kind===0?Ne.residue.label_seq_id(n.element)===r:Ne.coarse.seq_id_begin(n.element)<=r&&Ne.coarse.seq_id_end(n.element)>=r})}function WKe(e,t,r,n){let{model:o,elements:i}=e.unit,{index:s}=o.atomicHierarchy.residueAtomSegments,{label_seq_id:a}=o.atomicHierarchy.residues;return Te.forEachSegment(e.indices,l=>s[i[l]],l=>{let c=a.value(l);bb(r,n(c),t)}),!0}function YKe(e,t,r,n){let{model:o,elements:i}=e.unit,s=_e.isSpheres(e.unit)?o.coarseHierarchy.spheres.seq_id_begin:o.coarseHierarchy.gaussians.seq_id_begin,a=_e.isSpheres(e.unit)?o.coarseHierarchy.spheres.seq_id_end:o.coarseHierarchy.gaussians.seq_id_end;return Te.forEach(e.indices,l=>{let c=i[l];for(let u=n(s.value(c)),d=n(a.value(c));u<=d;u++)bb(r,u,t)}),!0}var ZM=class extends zf{residueLabel(t){return this.sequence[t]}residueColor(t){return Yt.black}residueClass(t){return"msp-sequence-present"}mark(t,r){let n=!1,{structure:o}=this.data;if($.Loci.is(t)){if(!Me.areRootsEquivalent(t.structure,o))return!1;t=$.Loci.remap(t,o);for(let i of t.elements){let s=this.unitMap.get(i.unit.id);if(s){let{index:a}=i.unit.model.atomicHierarchy.residueAtomSegments;Te.forEach(i.indices,l=>{let c=this.sequenceIndices.get(a[s.elements[l]]);c!==void 0&&Za(this.markerArray,ve.ofSingleton(c),r)&&(n=!0)})}}}else if(Me.isLoci(t)){if(!Me.areRootsEquivalent(t.structure,o))return!1;Za(this.markerArray,ve.ofBounds(0,this.length),r)&&(n=!0)}return n}getLoci(t){let r=[],n=this.residueIndices.get(t);if(n!==void 0){let o=this.seqToUnit.get(t),{offsets:i}=o.model.atomicHierarchy.residueAtomSegments,s=Fe.findPredecessorIndex(o.elements,i[n]),a=Fe.findPredecessorIndex(o.elements,i[n+1]);r.push({unit:o,indices:ve.ofBounds(s,a)})}return $.Loci(this.data.structure,r)}constructor(t){let r=[],n=new Map,o=new Map,i=new Map;for(let l=0,c=t.units.length;l0&&o.push(`${r} residues`),o.push(`${n} elements`);let l=1,c=new Uint8Array(l);super(t,c,l),this.label=`Whole Chain (${o.join(", ")})`,this.unitIndices=s,this.loci=$.Loci(this.data.structure,a)}};var $M=class extends zf{residueLabel(t){return"X"}residueColor(t){return Yt.black}residueClass(t){return"msp-sequence-present"}mark(t,r){let n=!1,{structure:o,units:i}=this.data;if($.Loci.is(t)){if(!Me.areRootsEquivalent(t.structure,o))return!1;t=$.Loci.remap(t,o);for(let s of t.elements){let a=this.unitIndices.get(s.unit.id);a&&Te.isSubset(a,s.indices)&&Za(this.markerArray,s.indices,r)&&(n=!0)}}else if(Me.isLoci(t)){if(!Me.areRootsEquivalent(t.structure,o))return!1;for(let s=0,a=i.length;s0){let u={structure:r,units:c},d=c[0],m;if(d.polymerElements.length){let p=$.Location.create(r,d,d.elements[0]),h=d.model.sequence.byEntityKey[Ne.entity.key(p)];if(h&&h.sequence.length<=i9)m=new QM(u);else{let f=c.reduce((y,g)=>y+g.polymerElements.length,0);_e.isAtomic(d)||f>i9?m=new b2(u):m=new $M(u)}}else _e.isAtomic(d)?c.reduce((h,f)=>h+f.residueCount,0)>i9?m=new b2(u):m=new ZM(u):(console.warn("should not happen, expecting coarse units to be polymeric"),m=new b2(u));return m.markResidue(t.getLoci(r),Ft.Select),m}else return"No sequence available"}function JM(e,t=!1){let r=[],n=$.Location.create(e),o=new Set;for(let i of e.units){$.Location.set(n,e,i,i.elements[0]);let s=Ne.entity.id(n),a=e.getModelIndex(i.model),l=`${a}|${s}`;if(o.has(l)||t&&Ne.entity.type(n)!=="polymer")continue;let c=Ne.entity.pdbx_description(n).join(", ");e.models.length&&(e.representativeModel?c+=` (Model ${e.models[a].modelNum})`:c.startsWith("Polymer ")&&(c+=` (${e.models[a].entry})`));let u=`${s}: ${c}`;if(r.push([l,u]),o.add(l),r.length>s9)return[["","Too many entities"]]}return r.length===0&&r.push(["","No entities"]),r}function g3(e,t){let r=[],n=$.Location.create(e),o=new Set,[i,s]=a9(t);for(let a of e.units){if($.Location.set(n,e,a,a.elements[0]),e.getModelIndex(a.model)!==i||Ne.entity.id(n)!==s)continue;let l=a.chainGroupId;if(o.has(l))continue;let c=Ku(n,{granularity:"chain",hidePrefix:!0,htmlStyling:!1});if(r.push([l,c]),o.add(l),r.length>s9)return[[-1,"Too many chains"]]}return r.length===0&&r.push([-1,"No chains"]),r}function S2(e,t,r){let n=[],o=$.Location.create(e),i=new Set,[s,a]=a9(t);for(let l of e.units){if($.Location.set(o,e,l,l.elements[0]),e.getModelIndex(l.model)!==s||Ne.entity.id(o)!==a||l.chainGroupId!==r)continue;let c=aye(o);if(i.has(c))continue;let u=l.conformation.operator.name;if(n.push([c,u]),i.add(c),n.length>s9)return[["","Too many operators"]]}return n.length===0&&n.push(["","No operators"]),n}function oye(e){var t;let r=[],n=[],o=e.select(qt.Generators.rootsOfType(ae.Molecule.Structure));for(let i of o)!((t=i.obj)===null||t===void 0)&&t.data&&(n.push(i.obj.data),r.push([i.transform.ref,i.obj.data.label]));return r.length===0&&r.push(["","No structure"]),{options:r,all:n}}var iye=C.Select("single",[["single","Chain"],["polymers","Polymers"],["all","Everything"]]),e4=class extends pr{constructor(){super(...arguments),this.state={structureOptions:{options:[],all:[]},structure:Me.Empty,structureRef:"",modelEntityId:"",chainGroupId:-1,operatorKey:"",mode:"single"},this.setParamProps=t=>{let r=k({},this.state);switch(t.name){case"mode":if(r.mode=t.value,this.state.mode===r.mode)return;if(r.mode==="all"||r.mode==="polymers")break;case"structure":t.name==="structure"&&(r.structureRef=t.value),r.structure=this.getStructure(r.structureRef),r.modelEntityId=JM(r.structure)[0][0],r.chainGroupId=g3(r.structure,r.modelEntityId)[0][0],r.operatorKey=S2(r.structure,r.modelEntityId,r.chainGroupId)[0][0];break;case"entity":r.modelEntityId=t.value,r.chainGroupId=g3(r.structure,r.modelEntityId)[0][0],r.operatorKey=S2(r.structure,r.modelEntityId,r.chainGroupId)[0][0];break;case"chain":r.chainGroupId=t.value,r.operatorKey=S2(r.structure,r.modelEntityId,r.chainGroupId)[0][0];break;case"operator":r.operatorKey=t.value;break}this.setState(r)}}componentDidMount(){this.plugin.state.data.select(qt.Generators.rootsOfType(ae.Molecule.Structure)).length>0&&this.setState(this.getInitialState()),this.subscribe(this.plugin.state.events.object.updated,({ref:t,obj:r})=>{t===this.state.structureRef&&r&&r.type===ae.Molecule.Structure.type&&r.data!==this.state.structure&&this.sync()}),this.subscribe(this.plugin.state.events.object.created,({obj:t})=>{t&&t.type===ae.Molecule.Structure.type&&this.sync()}),this.subscribe(this.plugin.state.events.object.removed,({obj:t})=>{t&&t.type===ae.Molecule.Structure.type&&t.data===this.state.structure&&this.sync()})}sync(){let t=oye(this.plugin.state.data);lx(t.all,this.state.structureOptions.all)||this.setState(this.getInitialState())}getStructure(t){let n=this.plugin.state.data.select(t)[0];return!t||!n||!n.obj?Me.Empty:n.obj.data}getSequenceWrapper(t){return{wrapper:nye(this.state,this.plugin.managers.structure.selection),label:`${C.optionLabel(t.chain,this.state.chainGroupId)} | ${C.optionLabel(t.entity,this.state.modelEntityId)}`}}getSequenceWrappers(t){if(this.state.mode==="single")return[this.getSequenceWrapper(t)];let r=this.getStructure(this.state.structureRef),n=[];for(let[o,i]of JM(r,this.state.mode==="polymers"))for(let[s,a]of g3(r,o))for(let[l]of S2(r,o,s))if(n.push({wrapper:nye({structure:r,modelEntityId:o,chainGroupId:s,operatorKey:l},this.plugin.managers.structure.selection),label:`${a} | ${i}`}),n.length>XKe)return[];return n}getInitialState(){var t;let r=oye(this.plugin.state.data),n=r.options[0][0],o=this.getStructure(n),i=JM(o)[0][0],s=g3(o,i)[0][0],a=S2(o,i,s)[0][0];return this.state.structure&&this.state.structure===o&&(i=this.state.modelEntityId,s=this.state.chainGroupId,a=this.state.operatorKey),{structureOptions:r,structure:o,structureRef:n,modelEntityId:i,chainGroupId:s,operatorKey:a,mode:(t=this.props.defaultMode)!==null&&t!==void 0?t:"single"}}get params(){let{structureOptions:t,structure:r,modelEntityId:n,chainGroupId:o}=this.state,i=JM(r),s=g3(r,n),a=S2(r,n,o);return{structure:C.Select(t.options[0][0],t.options,{shortLabel:!0}),entity:C.Select(i[0][0],i,{shortLabel:!0}),chain:C.Select(s[0][0],s,{shortLabel:!0,twoColumns:!0,label:"Chain"}),operator:C.Select(a[0][0],a,{shortLabel:!0,twoColumns:!0}),mode:iye}}get values(){return{structure:this.state.structureRef,entity:this.state.modelEntityId,chain:this.state.chainGroupId,operator:this.state.operatorKey,mode:this.state.mode}}render(){if(this.getStructure(this.state.structureRef)===Me.Empty)return(0,zi.jsx)("div",{className:"msp-sequence",children:(0,zi.jsxs)("div",{className:"msp-sequence-select",children:[(0,zi.jsx)(tn,{svg:rc,style:{cursor:"help",position:"absolute",right:0,top:0},title:"Shows a sequence of one or more chains. Use the controls to alter selection."}),(0,zi.jsx)("span",{children:"Sequence"}),(0,zi.jsx)("span",{style:{fontWeight:"normal"},children:"No structure available"})]})});let t=this.params,r=this.values,n=this.getSequenceWrappers(t);return(0,zi.jsxs)("div",{className:"msp-sequence",children:[(0,zi.jsxs)("div",{className:"msp-sequence-select",children:[(0,zi.jsx)(tn,{svg:rc,style:{cursor:"help",position:"absolute",right:0,top:0},title:"This shows a single sequence. Use the controls to show a different sequence."}),(0,zi.jsx)("span",{children:"Sequence of"}),(0,zi.jsx)(wf,{title:`[Structure] ${C.optionLabel(t.structure,r.structure)}`,param:t.structure,name:"structure",value:r.structure,onChange:this.setParamProps}),(0,zi.jsx)(wf,{title:"[Mode]",param:iye,name:"mode",value:r.mode,onChange:this.setParamProps}),r.mode==="single"&&(0,zi.jsx)(wf,{title:`[Entity] ${C.optionLabel(t.entity,r.entity)}`,param:t.entity,name:"entity",value:r.entity,onChange:this.setParamProps}),r.mode==="single"&&(0,zi.jsx)(wf,{title:`[Chain] ${C.optionLabel(t.chain,r.chain)}`,param:t.chain,name:"chain",value:r.chain,onChange:this.setParamProps}),t.operator.options.length>1&&(0,zi.jsx)(zi.Fragment,{children:(0,zi.jsx)(wf,{title:`[Instance] ${C.optionLabel(t.operator,r.operator)}`,param:t.operator,name:"operator",value:r.operator,onChange:this.setParamProps})})]}),(0,zi.jsx)(KKe,{children:n.map((o,i)=>{let s=typeof o.wrapper=="string"?(0,zi.jsx)("div",{className:"msp-sequence-wrapper",children:o.wrapper},i):(0,zi.jsx)(KM,{sequenceWrapper:o.wrapper},i);return r.mode==="single"?s:(0,zi.jsxs)(sye.Fragment,{children:[(0,zi.jsx)("div",{className:"msp-sequence-chain-label",children:o.label}),s]},i)})})]})}};function KKe({children:e}){return(0,zi.jsx)("div",{className:"msp-sequence-wrapper-non-empty",children:e})}var Ea=vr(Ln());var Vf=vr(Ui());var Dy=vr(Ui());function QKe(e){let[,t]=Dy.default.useState({}),r=Dy.default.useRef();return r.current=e?.value,Dy.default.useEffect(()=>{if(!e)return;let n=e.subscribe(o=>{r.current!==o&&t({})});return()=>n.unsubscribe()},[e]),e?.value}function ZKe(e){return Dy.default.useSyncExternalStore(Dy.default.useCallback(t=>{let r=e?.pipe(uA(1)).subscribe(t);return()=>r?.unsubscribe()},[e]),Dy.default.useCallback(()=>e?.value,[e]))}var $Ke=Dy.default.useSyncExternalStore?ZKe:QKe;function ld(e){return $Ke(e)}function lye(){let e=(0,Vf.useContext)(vu),[t,r]=(0,Vf.useState)(ia());return(0,Vf.useEffect)(()=>{let n=e.events.task.progress.subscribe(i=>{var s;let a=!!(!((s=e.spec.components)===null||s===void 0)&&s.hideTaskOverlay);i.level==="background"&&(a||!i.useOverlay)&&r(l=>l.set(i.id,i))}),o=e.events.task.finished.subscribe(({id:i})=>{r(s=>s.delete(i))});return()=>{n.unsubscribe(),o.unsubscribe()}},[e]),(0,Ea.jsxs)("div",{className:"msp-background-tasks",children:[t.valueSeq().map(n=>(0,Ea.jsx)(t4,{event:n},n.id)),(0,Ea.jsx)(JKe,{})]})}function JKe(){var e;let t=(0,Vf.useContext)(vu),r=ld((e=t.canvas3d)===null||e===void 0?void 0:e.commitQueueSize);return r?(0,Ea.jsx)("div",{className:"msp-task-state",children:(0,Ea.jsx)("div",{children:(0,Ea.jsxs)("div",{children:["Commiting renderables... ",r," remaining"]})})}):null}var t4=class extends pr{constructor(){super(...arguments),this.abort=()=>{this.plugin.managers.task.requestAbort(this.props.event.progress.root.progress.taskId,"User Request")}}render(){let t=this.props.event.progress.root,r=cye(this.props.event.progress.root)-1,n=t.progress.isIndeterminate?void 0:(0,Ea.jsxs)(Ea.Fragment,{children:["[",t.progress.current,"/",t.progress.max,"]"]}),o=r>0?(0,Ea.jsxs)(Ea.Fragment,{children:["[",r," subtask(s)]"]}):void 0;return(0,Ea.jsx)("div",{className:"msp-task-state",children:(0,Ea.jsxs)("div",{children:[t.progress.canAbort&&(0,Ea.jsx)(Qt,{svg:dD,onClick:this.abort,title:"Abort"}),(0,Ea.jsxs)("div",{children:[t.progress.message," ",n," ",o]})]})})}};function cye(e){if(e.children.length===0)return 1;let t=0;for(let r of e.children)t+=cye(r);return t}function uye(){let e=(0,Vf.useContext)(vu),[t,r]=(0,Vf.useState)(ia());return(0,Vf.useEffect)(()=>{let n=e.events.task.progress.subscribe(i=>{i.useOverlay&&r(s=>s.set(i.id,i))}),o=e.events.task.finished.subscribe(({id:i})=>{r(s=>s.delete(i))});return()=>{n.unsubscribe(),o.unsubscribe()}},[e]),t.size===0?null:(0,Ea.jsx)("div",{className:"msp-overlay-tasks",children:t.valueSeq().map(n=>(0,Ea.jsx)(t4,{event:n},n.id))})}var cd=vr(Ln());var l9=class extends pr{constructor(){super(...arguments),this.hide=()=>{(this.props.entry.hide||function(){}).call(null)}}render(){let t=this.props.entry,r=typeof t.message=="string"?(0,cd.jsx)("div",{dangerouslySetInnerHTML:{__html:t.message}}):(0,cd.jsx)("div",{children:(0,cd.jsx)(t.message,{})});return(0,cd.jsxs)("div",{className:"msp-toast-entry",children:[(0,cd.jsx)("div",{className:"msp-toast-title",onClick:()=>this.hide(),children:t.title}),(0,cd.jsx)("div",{className:"msp-toast-message",children:r}),(0,cd.jsx)("div",{className:"msp-toast-clear"}),(0,cd.jsx)("div",{className:"msp-toast-hide",children:(0,cd.jsx)(Qt,{svg:dD,onClick:this.hide,title:"Hide",className:"msp-no-hover-outline"})})]})}},r4=class extends pr{componentDidMount(){this.subscribe(this.plugin.managers.toast.events.changed,()=>this.forceUpdate())}render(){let t=this.plugin.managers.toast.state;if(!t.entries.count())return null;let r=[];return t.entries.forEach((n,o)=>r.push(n)),r.sort(function(n,o){return n.serialNumber-o.serialNumber}),(0,cd.jsx)("div",{className:"msp-toast-container",children:r.map(n=>(0,cd.jsx)(l9,{entry:n},n.serialNumber))})}};var Uo=vr(Ln());var Mm=vr(Ln()),dye=vr(Ui());var n4=class extends pr{constructor(){super(...arguments),this.container=dye.createRef(),this.state={noWebGl:!1,showLogo:!0},this.handleLogo=()=>{var t;this.setState({showLogo:!(!((t=this.plugin.canvas3d)===null||t===void 0)&&t.reprCount.value)})}}componentDidMount(){if(!this.container.current||!this.plugin.mount(this.container.current,{checkeredCanvasBackground:!0})){this.setState({noWebGl:!0});return}this.handleLogo(),this.subscribe(this.plugin.canvas3d.reprCount,this.handleLogo)}componentWillUnmount(){super.componentWillUnmount(),this.plugin.unmount()}renderMissing(){if(this.props.noWebGl){let t=this.props.noWebGl;return(0,Mm.jsx)(t,{})}return(0,Mm.jsx)("div",{className:"msp-no-webgl",children:(0,Mm.jsxs)("div",{children:[(0,Mm.jsx)("p",{children:(0,Mm.jsx)("b",{children:"WebGL does not seem to be available."})}),(0,Mm.jsx)("p",{children:"This can be caused by an outdated browser, graphics card driver issue, or bad weather. Sometimes, just restarting the browser helps. Also, make sure hardware acceleration is enabled in your browser."}),(0,Mm.jsxs)("p",{children:["For a list of supported browsers, refer to ",(0,Mm.jsx)("a",{href:"http://caniuse.com/#feat=webgl",target:"_blank",children:"http://caniuse.com/#feat=webgl"}),"."]})]})})}render(){if(this.state.noWebGl)return this.renderMissing();let t=this.props.logo;return(0,Mm.jsx)("div",{className:this.props.parentClassName||"msp-viewport",style:this.props.parentStyle,ref:this.container,children:this.state.showLogo&&t&&(0,Mm.jsx)(t,{})})}};var bs=vr(Ln());var Da=vr(Ln()),o4=vr(Ui()),Tu=vr(Ui());var eQe=e=>{let{plugin:t,cropFrameColor:r}=e,n=t.helpers.viewportScreenshot,[o,i]=(0,Tu.useState)(null),s=(0,Tu.useRef)(null),a=(0,Tu.useRef)(e);return(0,Tu.useEffect)(()=>{a.current=e},Object.values(e)),(0,Tu.useEffect)(()=>{o!==s.current&&i(s.current)}),(0,Tu.useEffect)(()=>{var l;let c=!1,u=[];function d(y,g){y&&u.push(y.subscribe(g))}function m(){let y=a.current;!y.suspend&&s.current&&mye(n,s.current,y.customBackground,y.borderColor,y.borderWidth),s.current||(c=!0)}let p=setInterval(()=>{c&&(c=!1,m())},1e3/8);d(t.events.canvas3d.settingsUpdated,()=>c=!0),d((l=t.canvas3d)===null||l===void 0?void 0:l.didDraw,()=>c=!0),d(t.state.data.behaviors.isUpdating,y=>{y||(c=!0)}),d(n?.behaviors.values,()=>c=!0),d(n?.behaviors.cropParams,()=>c=!0);let h;typeof ResizeObserver<"u"&&(h=new ResizeObserver(()=>c=!0));let f=s.current;return h?.observe(f),m(),()=>{clearInterval(p),u.forEach(y=>y.unsubscribe()),h?.unobserve(f)}},[n]),(0,Tu.useLayoutEffect)(()=>{s.current&&mye(n,s.current,e.customBackground,e.borderColor,e.borderWidth)},[...Object.values(e)]),(0,Da.jsx)(Da.Fragment,{children:(0,Da.jsxs)("div",{style:{position:"relative",width:"100%",height:"100%"},children:[(0,Da.jsx)("canvas",{ref:s,onContextMenu:l=>{l.preventDefault(),l.stopPropagation()},style:{display:"block",width:"100%",height:"100%"}}),(0,Da.jsx)(tQe,{plugin:t,canvas:o,color:r})]})})},fye=o4.memo(eQe,(e,t)=>bg(e,t));function mye(e,t,r,n,o){if(!e)return;let{canvas:i,width:s,height:a}=e.getPreview(),l=t.getContext("2d");if(!l)return;let c=t.clientWidth,u=t.clientHeight;t.width=c,t.height=u,l.clearRect(0,0,c,u);let d=hye(s,a,c,u);if(r)l.fillStyle=r,l.fillRect(d.x,d.y,d.width,d.height);else if(e.values.transparent)for(let p=0;pd.width?d.width-p:13,v=h+13>d.height?d.height-h:13;l.fillRect(f,y,g,v)}if(l.drawImage(i,d.x,d.y,d.width,d.height),n&&o){let m=o;l.rect(d.x,d.y,d.width,d.height),l.rect(d.x+m,d.y+m,d.width-2*m,d.height-2*m),l.fillStyle=n,l.fill("evenodd")}}function tQe({plugin:e,canvas:t,color:r="rgba(255, 87, 45, 0.75)"}){var n;let o=e.helpers.viewportScreenshot,i=ld(o?.behaviors.values),s=ld(o?.behaviors.cropParams),a=ld(o?.behaviors.relativeCrop),l=(0,Tu.useRef)({x:0,y:0,width:0,height:0});ld(i?.resolution.name==="viewport"?(n=e.canvas3d)===null||n===void 0?void 0:n.resized:void 0);let[c,u]=o4.useState(""),[d,m]=(0,Tu.useState)([0,0]),[p,h]=(0,Tu.useState)([0,0]);if(!o||!t||!a)return null;let{width:f,height:y}=o.getSizeAndViewport(),g=hye(f,y,t.clientWidth,t.clientHeight),v={x:g.x+Math.floor(g.width*a.x),y:g.y+Math.floor(g.height*a.y),width:Math.ceil(g.width*a.width),height:Math.ceil(g.height*a.height)},b=pye(v),S=pye(g);if(c==="move"?(b.l+=p[0]-d[0],b.r+=p[0]-d[0],b.t+=p[1]-d[1],b.b+=p[1]-d[1]):c&&(c.indexOf("left")>=0?b.l+=p[0]-d[0]:c.indexOf("right")>=0&&(b.r+=p[0]-d[0]),c.indexOf("top")>=0?b.t+=p[1]-d[1]:c.indexOf("bottom")>=0&&(b.b+=p[1]-d[1])),b.l>b.r){let N=b.l;b.l=b.r,b.r=N}if(b.t>b.b){let N=b.t;b.t=b.b,b.b=N}let _=40;b.l=Math.min(S.r-_,Math.max(S.l,b.l)),b.r=Math.max(S.l+_,Math.min(S.r,b.r)),b.t=Math.min(S.b-_,Math.max(S.t,b.t)),b.b=Math.max(S.t+_,Math.min(S.b,b.b)),v.x=b.l,v.y=b.t,v.width=b.r-b.l+1,v.height=b.b-b.t+1,l.current=v;let w=N=>{N.preventDefault(),h([N.pageX,N.pageY])},E=N=>{N.preventDefault();let z=N.touches[0];h([z.pageX,z.pageY])},A=N=>{N.preventDefault(),u(N.currentTarget.getAttribute("data-drag"));let z=N.touches[0],q=[z.pageX,z.pageY];m(q),h(q),window.addEventListener("touchend",B),window.addEventListener("touchmove",E)},P=N=>{N.preventDefault(),u(N.currentTarget.getAttribute("data-drag"));let z=[N.pageX,N.pageY];m(z),h(z),window.addEventListener("mouseup",T),window.addEventListener("mousemove",w)},T=()=>{window.removeEventListener("mouseup",T),window.removeEventListener("mousemove",w),D()},B=()=>{window.removeEventListener("touchend",B),window.removeEventListener("touchmove",E),D()};function D(){let N=l.current;s?.auto&&o?.behaviors.cropParams.next(te(k({},s),{auto:!1})),o?.behaviors.relativeCrop.next({x:(N.x-g.x)/g.width,y:(N.y-g.y)/g.height,width:N.width/g.width,height:N.height/g.height}),u("");let z=[0,0];m(z),h(z)}let M=N=>{N.preventDefault(),N.stopPropagation()},R=4,U=`3px solid ${r}`,F="transparent";return(0,Da.jsxs)(Da.Fragment,{children:[(0,Da.jsx)("div",{"data-drag":"move",style:{position:"absolute",left:v.x,top:v.y,width:v.width,height:v.height,border:U,cursor:"move"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"left",style:{position:"absolute",left:v.x-R,top:v.y+R,width:4*R,height:v.height-R,background:F,cursor:"w-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"right",style:{position:"absolute",left:b.r-2*R,top:v.y,width:4*R,height:v.height-R,background:F,cursor:"w-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"top",style:{position:"absolute",left:v.x-R,top:v.y-R,width:v.width+2*R,height:4*R,background:F,cursor:"n-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"bottom",style:{position:"absolute",left:v.x-R,top:b.b-2*R,width:v.width+2*R,height:4*R,background:F,cursor:"n-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"top, left",style:{position:"absolute",left:b.l-R,top:b.t-R,width:4*R,height:4*R,background:F,cursor:"nw-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"bottom, right",style:{position:"absolute",left:b.r-2*R,top:b.b-2*R,width:4*R,height:4*R,background:F,cursor:"nw-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"top, right",style:{position:"absolute",left:b.r-2*R,top:b.t-R,width:4*R,height:4*R,background:F,cursor:"ne-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M}),(0,Da.jsx)("div",{"data-drag":"bottom, left",style:{position:"absolute",left:b.l-R,top:b.b-2*R,width:4*R,height:4*R,background:F,cursor:"ne-resize"},onMouseDown:P,onTouchStart:A,draggable:!1,onContextMenu:M})]})}function pye(e){return{l:e.x,t:e.y,r:e.x+e.width-1,b:e.y+e.height-1}}function hye(e,t,r,n){let o=e/t,i=r/n;if(o<=i){let s=n*o;return{x:Math.round((r-s)/2),y:0,width:Math.round(s),height:n}}else{let s=r/o;return{x:0,y:Math.round((n-s)/2),width:r,height:Math.round(s)}}}var i4=class extends pr{constructor(){super(...arguments),this.state={showPreview:!0,isDisabled:!1},this.download=()=>{var t;(t=this.plugin.helpers.viewportScreenshot)===null||t===void 0||t.download(),this.props.close()},this.copy=()=>Y(this,null,function*(){var t;try{yield(t=this.plugin.helpers.viewportScreenshot)===null||t===void 0?void 0:t.copyToClipboard(),ct.Toast.Show(this.plugin,{message:"Copied to clipboard.",title:"Screenshot",timeoutMs:1500})}catch{return this.copyImg()}}),this.copyImg=()=>Y(this,null,function*(){var t;let r=yield(t=this.plugin.helpers.viewportScreenshot)===null||t===void 0?void 0:t.getImageDataUri();this.setState({imageData:r})}),this.open=t=>{!t.target.files||!t.target.files[0]||ct.State.Snapshots.OpenFile(this.plugin,{file:t.target.files[0]})}}componentDidMount(){this.subscribe(this.plugin.state.data.behaviors.isUpdating,t=>{this.setState({isDisabled:t})})}componentWillUnmount(){super.componentWillUnmount(),this.setState({imageData:void 0})}render(){var t;let r=!!(!((t=navigator.clipboard)===null||t===void 0)&&t.write);return(0,bs.jsxs)("div",{children:[this.state.showPreview&&(0,bs.jsxs)("div",{className:"msp-image-preview",children:[(0,bs.jsx)(fye,{plugin:this.plugin}),(0,bs.jsx)(nQe,{plugin:this.plugin})]}),(0,bs.jsxs)("div",{className:"msp-flex-row",children:[!this.state.imageData&&(0,bs.jsx)(Jt,{icon:jde,onClick:r?this.copy:this.copyImg,disabled:this.state.isDisabled,children:"Copy"}),this.state.imageData&&(0,bs.jsx)(Jt,{onClick:()=>this.setState({imageData:void 0}),disabled:this.state.isDisabled,children:"Clear"}),(0,bs.jsx)(Jt,{icon:dw,onClick:this.download,disabled:this.state.isDisabled,children:"Download"})]}),this.state.imageData&&(0,bs.jsxs)("div",{className:"msp-row msp-copy-image-wrapper",children:[(0,bs.jsx)("div",{children:"Right click below + Copy Image"}),(0,bs.jsx)("img",{src:this.state.imageData,style:{width:"100%",height:32,display:"block"}})]}),(0,bs.jsx)(rQe,{plugin:this.plugin,isDisabled:this.state.isDisabled}),(0,bs.jsxs)(qs,{header:"State",children:[(0,bs.jsx)(m3,{onAction:this.props.close}),(0,bs.jsx)(qs,{header:"Save Options",initiallyExpanded:!1,noOffset:!0,children:(0,bs.jsx)(p3,{})})]})]})}};function rQe({plugin:e,isDisabled:t}){let r=e.helpers.viewportScreenshot,n=ld(r?.behaviors.values);return r?(0,bs.jsx)(Hn,{params:r.params,values:n,onChangeValues:o=>r.behaviors.values.next(o),isDisabled:t}):null}function nQe({plugin:e}){let t=e.helpers.viewportScreenshot,r=ld(t?.behaviors.cropParams);return ld(t?.behaviors.relativeCrop),!t||!r?null:(0,bs.jsxs)("div",{style:{width:"100%",height:"24px",marginTop:"8px"},children:[(0,bs.jsx)(Wo,{icon:Yde,title:"Auto-crop",inline:!0,isSelected:r.auto,style:{background:"transparent",float:"left",width:"auto",height:"24px",lineHeight:"24px"},toggle:()=>t.toggleAutocrop(),label:"Auto-crop "+(r.auto?"On":"Off")}),!r.auto&&(0,bs.jsx)(Jt,{icon:qde,title:"Crop",style:{background:"transparent",float:"right",height:"24px",lineHeight:"24px",width:"24px",padding:"0"},onClick:()=>t.autocrop()}),!r.auto&&!t.isFullFrame&&(0,bs.jsx)(Jt,{icon:Wde,title:"Reset Crop",style:{background:"transparent",float:"right",height:"24px",lineHeight:"24px",width:"24px",padding:"0"},onClick:()=>t.resetCrop()})]})}var Fv=vr(Ln());function gye(e){return({values:t,update:r,apply:n})=>({params:typeof e.params=="function"?e.params:o=>e.params,getTarget:e.target,getValues:t,update(o,i){let s=e.target(i);return wl(s,a=>r(o,a,i))},apply:n||(()=>{})})}var s4=class extends pr{componentDidMount(){this.plugin.canvas3d&&(this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.canvas3d.camera.stateChanged.pipe(xd(500,void 0,{leading:!0,trailing:!0})),t=>{(t.radiusMax!==void 0||t.radius!==void 0)&&this.forceUpdate()}))}render(){return this.plugin.canvas3d?(0,Fv.jsxs)(Fv.Fragment,{children:[(0,Fv.jsx)(SD,{mapping:iQe}),(0,Fv.jsx)(Bv,{})]}):null}},y3={sequence:"Sequence",log:"Log",left:"Left Panel",right:"Right Panel"},oQe={animate:ol.trackball.params.animate,camera:ol.camera,background:C.Group({color:C.Color(Oe(16579577),{label:"Background",description:"Custom background color"}),transparent:C.Boolean(!1),style:ol.postprocessing.params.background},{pivot:"color"}),lighting:C.Group({occlusion:ol.postprocessing.params.occlusion,shadow:ol.postprocessing.params.shadow,outline:ol.postprocessing.params.outline,dof:ol.postprocessing.params.dof,fog:ol.cameraFog},{isFlat:!0}),clipping:C.Group(k({},ol.cameraClipping.params),{pivot:"radius"}),layout:C.MultiSelect([],C.objectToOptions(y3)),advanced:C.Group({multiSample:ol.multiSample,hiZ:ol.hiZ,sharpening:ol.postprocessing.params.sharpening,pixelScale:hp.Params.pixelScale,transparency:hp.Params.transparency})},iQe=gye({params:e=>{var t;let r=C.clone(oQe),n=(t=e.spec.components)===null||t===void 0?void 0:t.controls;if(n){let i=[];n.top!=="none"&&i.push(["sequence",y3.sequence]),n.bottom!=="none"&&i.push(["log",y3.log]),n.left!=="none"&&i.push(["left",y3.left]),n.right!=="none"&&i.push(["right",y3.right]),r.layout.options=i}let o=e.config.get(Tr.Background.Styles)||[];return o.length>0&&Object.assign(r.background.params.style,{presets:ba(o),isFlat:!1}),r},target(e){var t,r,n;let o=(t=e.spec.components)===null||t===void 0?void 0:t.controls,i=e.layout.state.regionState,s=[];i.top!=="hidden"&&(!o||o.top!=="none")&&s.push("sequence"),i.bottom!=="hidden"&&(!o||o.bottom!=="none")&&s.push("log"),i.left!=="hidden"&&(!o||o.left!=="none")&&s.push("left"),i.right!=="hidden"&&(!o||o.right!=="none")&&s.push("right");let{pixelScale:a,transparency:l}=(r=e.canvas3dContext)===null||r===void 0?void 0:r.props;return{canvas:(n=e.canvas3d)===null||n===void 0?void 0:n.props,layout:s,pixelScale:a,transparency:l}}})({values(e,t){let{canvas:r}=e,n=r.renderer;return{layout:e.layout,animate:r.trackball.animate,camera:r.camera,background:{color:n.backgroundColor,transparent:r.transparentBackground,style:r.postprocessing.background},lighting:{occlusion:r.postprocessing.occlusion,shadow:r.postprocessing.shadow,outline:r.postprocessing.outline,dof:r.postprocessing.dof,fog:r.cameraFog},clipping:k({},r.cameraClipping),advanced:{multiSample:r.multiSample,hiZ:r.hiZ,sharpening:r.postprocessing.sharpening,pixelScale:e.pixelScale,transparency:e.transparency}}},update(e,t){let r=t.canvas;r.trackball.animate=e.animate,r.camera=e.camera,r.transparentBackground=e.background.transparent,r.renderer.backgroundColor=e.background.color,r.postprocessing.occlusion=e.lighting.occlusion,r.postprocessing.shadow=e.lighting.shadow,r.postprocessing.outline=e.lighting.outline,r.postprocessing.background=e.background.style,r.cameraFog=e.lighting.fog,r.cameraClipping={radius:e.clipping.radius,far:e.clipping.far,minNear:e.clipping.minNear},r.multiSample=e.advanced.multiSample,r.hiZ=e.advanced.hiZ,r.postprocessing.sharpening=e.advanced.sharpening,r.postprocessing.dof=e.lighting.dof,t.layout=e.layout,t.pixelScale=e.advanced.pixelScale,t.transparency=e.advanced.transparency},apply(e,t){return Y(this,null,function*(){var r;yield ct.Canvas3D.SetSettings(t,{settings:e.canvas});let n=e.layout.indexOf("left")<0,o=wl(t.layout.state,i=>{i.regionState.top=e.layout.indexOf("sequence")>=0?"full":"hidden",i.regionState.bottom=e.layout.indexOf("log")>=0?"full":"hidden",i.regionState.left=n?"hidden":t.behaviors.layout.leftPanelTabName.value==="none"?"collapsed":"full",i.regionState.right=e.layout.indexOf("right")>=0?"full":"hidden"});yield ct.Layout.Update(t,{state:o}),n&&ct.State.SetCurrentObject(t,{state:t.state.data,ref:ur.RootRef}),(r=t.canvas3dContext)===null||r===void 0||r.setProps({pixelScale:e.pixelScale,transparency:e.transparency})})}});var a4=class extends pr{constructor(){super(...arguments),this.allCollapsedState={isSettingsExpanded:!1,isScreenshotExpanded:!1},this.state=te(k({},this.allCollapsedState),{isCameraResetEnabled:!0}),this.resetCamera=()=>{ct.Camera.Reset(this.plugin,{})},this.toggleSettingsExpanded=this.toggle("isSettingsExpanded"),this.toggleScreenshotExpanded=this.toggle("isScreenshotExpanded"),this.toggleControls=()=>{ct.Layout.Update(this.plugin,{state:{showControls:!this.plugin.layout.state.showControls}})},this.toggleExpanded=()=>{ct.Layout.Update(this.plugin,{state:{isExpanded:!this.plugin.layout.state.isExpanded}})},this.setSettings=t=>{ct.Canvas3D.SetSettings(this.plugin,{settings:{[t.name]:t.value}})},this.setLayout=t=>{ct.Layout.Update(this.plugin,{state:{[t.name]:t.value}})},this.screenshot=()=>{var t;(t=this.plugin.helpers.viewportScreenshot)===null||t===void 0||t.download()},this.enableCameraReset=t=>{this.setState(r=>te(k({},r),{isCameraResetEnabled:t}))}}toggle(t){return r=>{this.setState(n=>te(k(k({},n),this.allCollapsedState),{[t]:!this.state[t]})),r?.currentTarget.blur()}}componentDidMount(){this.subscribe(this.plugin.events.canvas3d.settingsUpdated,()=>this.forceUpdate()),this.subscribe(this.plugin.layout.events.updated,()=>this.forceUpdate()),this.plugin.canvas3d&&this.subscribe(this.plugin.canvas3d.camera.stateChanged.pipe(xd(500,void 0,{leading:!0,trailing:!0})),t=>this.enableCameraReset(t.radius!==0&&t.radiusMax!==0))}icon(t,r,n,o=!0){return(0,Uo.jsx)(Qt,{svg:t,toggleState:o,onClick:r,title:n,style:{background:"transparent"}})}render(){return(0,Uo.jsxs)("div",{className:"msp-viewport-controls",children:[(0,Uo.jsxs)("div",{className:"msp-viewport-controls-buttons",children:[(0,Uo.jsxs)("div",{className:"msp-hover-box-wrapper",children:[(0,Uo.jsx)("div",{className:"msp-semi-transparent-background"}),this.icon(Fde,this.resetCamera,"Reset Zoom"),(0,Uo.jsx)("div",{className:"msp-hover-box-body",children:(0,Uo.jsxs)("div",{className:"msp-flex-column",children:[(0,Uo.jsx)("div",{className:"msp-flex-row",children:(0,Uo.jsx)(Jt,{onClick:()=>this.resetCamera(),disabled:!this.state.isCameraResetEnabled,title:"Set camera zoom to fit the visible scene into view",children:"Reset Zoom"})}),(0,Uo.jsx)("div",{className:"msp-flex-row",children:(0,Uo.jsx)(Jt,{onClick:()=>ct.Camera.OrientAxes(this.plugin),disabled:!this.state.isCameraResetEnabled,title:"Align principal component axes of the loaded structures to the screen axes (\u201Clay flat\u201D)",children:"Orient Axes"})}),(0,Uo.jsx)("div",{className:"msp-flex-row",children:(0,Uo.jsx)(Jt,{onClick:()=>ct.Camera.ResetAxes(this.plugin),disabled:!this.state.isCameraResetEnabled,title:"Align Cartesian axes to the screen axes",children:"Reset Axes"})})]})}),(0,Uo.jsx)("div",{className:"msp-hover-box-spacer"})]}),(0,Uo.jsxs)("div",{children:[(0,Uo.jsx)("div",{className:"msp-semi-transparent-background"}),this.icon(Ude,this.toggleScreenshotExpanded,"Screenshot / State Snapshot",this.state.isScreenshotExpanded)]}),(0,Uo.jsxs)("div",{children:[(0,Uo.jsx)("div",{className:"msp-semi-transparent-background"}),this.plugin.config.get(Tr.Viewport.ShowControls)&&this.icon(Ode,this.toggleControls,"Toggle Controls Panel",this.plugin.layout.state.showControls),this.plugin.config.get(Tr.Viewport.ShowExpand)&&this.icon(Xde,this.toggleExpanded,"Toggle Expanded Viewport",this.plugin.layout.state.isExpanded),this.plugin.config.get(Tr.Viewport.ShowSettings)&&this.icon(Oc,this.toggleSettingsExpanded,"Settings / Controls Info",this.state.isSettingsExpanded)]}),this.plugin.config.get(Tr.Viewport.ShowSelectionMode)&&(0,Uo.jsxs)("div",{children:[(0,Uo.jsx)("div",{className:"msp-semi-transparent-background"}),(0,Uo.jsx)(Iy,{})]})]}),this.state.isScreenshotExpanded&&(0,Uo.jsx)("div",{className:"msp-viewport-controls-panel",children:(0,Uo.jsx)(ll,{header:"Screenshot / State",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleScreenshotExpanded,topRightIcon:Fc,noTopMargin:!0,childrenClassName:"msp-viewport-controls-panel-controls",children:(0,Uo.jsx)(i4,{close:this.toggleScreenshotExpanded})})}),this.state.isSettingsExpanded&&(0,Uo.jsx)("div",{className:"msp-viewport-controls-panel",children:(0,Uo.jsx)(ll,{header:"Settings / Controls Info",title:"Click to close.",initialExpanded:!0,hideExpander:!0,hideOffset:!0,onHeaderClick:this.toggleSettingsExpanded,topRightIcon:Fc,noTopMargin:!0,childrenClassName:"msp-viewport-controls-panel-controls",children:(0,Uo.jsx)(s4,{})})})]})}},sQe=()=>(0,Uo.jsx)("a",{className:"msp-logo",href:"https://molstar.org",target:"_blank"}),yye=()=>(0,Uo.jsx)(n4,{logo:sQe});function vye({plugin:e}){return e.isInitialized?(0,Fn.jsx)(vu.Provider,{value:e,children:(0,Fn.jsx)(l4,{})}):(0,Fn.jsx)(aQe,{plugin:e})}function aQe({plugin:e}){let[t,r]=Ov.useState({kind:"pending"});return Ov.useEffect(()=>{r({kind:"pending"});let n=!0;return e.initialized.then(()=>{n&&r({kind:"initialized"})}).catch(o=>{n&&r({kind:"error",message:`${o}`})}),()=>{n=!1}},[e]),t.kind==="pending"?null:t.kind==="error"?(0,Fn.jsx)("div",{className:"msp-plugin",children:(0,Fn.jsxs)("div",{className:"msp-plugin-init-error",children:["Initialization error: ",t.message]})}):(0,Fn.jsx)(vu.Provider,{value:e,children:(0,Fn.jsx)(l4,{})})}var l4=class extends pr{constructor(){super(...arguments),this.onDrop=t=>{t.preventDefault();let r=[];if(t.dataTransfer.items)for(let o=0;o{let i=o.name.toLowerCase();return i.endsWith(".molx")||i.endsWith(".molj")});n.length>0?ct.State.Snapshots.OpenFile(this.plugin,{file:n[0]}):this.plugin.runTask(this.plugin.state.data.applyAction(ow,{files:r.map(o=>Or.File(o)),format:{name:"auto",params:{}},visuals:!0}))},this.onDragOver=t=>{t.preventDefault()},this.showDragOverlay=new Zs(!1),this.onDragEnter=t=>{let r=!1;if(t.dataTransfer.items&&t.dataTransfer.items.length>0){for(let n=0;nthis.forceUpdate())}region(t,r){return(0,Fn.jsx)("div",{className:`msp-layout-region msp-layout-${t}`,children:(0,Fn.jsx)("div",{className:"msp-layout-static",children:r?(0,Fn.jsx)(r,{}):null})})}get layoutVisibilityClassName(){var t,r;let n=this.plugin.layout.state,o=(r=(t=this.plugin.spec.components)===null||t===void 0?void 0:t.controls)!==null&&r!==void 0?r:{},i=[];return(o.top==="none"||!n.showControls||n.regionState.top==="hidden")&&i.push("msp-layout-hide-top"),o.left==="none"||!n.showControls||n.regionState.left==="hidden"?i.push("msp-layout-hide-left"):n.regionState.left==="collapsed"&&i.push("msp-layout-collapse-left"),(o.right==="none"||!n.showControls||n.regionState.right==="hidden")&&i.push("msp-layout-hide-right"),(o.bottom==="none"||!n.showControls||n.regionState.bottom==="hidden")&&i.push("msp-layout-hide-bottom"),i.join(" ")}get layoutClassName(){let t=this.plugin.layout.state,r=["msp-plugin-content"];return t.isExpanded?r.push("msp-layout-expanded"):r.push("msp-layout-standard",`msp-layout-standard-${t.controlsDisplay}`),r.join(" ")}render(){var t,r,n,o,i,s,a;let l=this.plugin.layout.state,c=((t=this.plugin.spec.components)===null||t===void 0?void 0:t.controls)||{},u=((n=(r=this.plugin.spec.components)===null||r===void 0?void 0:r.viewport)===null||n===void 0?void 0:n.view)||u9,d=((i=(o=this.plugin.spec.components)===null||o===void 0?void 0:o.sequenceViewer)===null||i===void 0?void 0:i.view)||e4;return(0,Fn.jsx)("div",{className:"msp-plugin",children:(0,Fn.jsxs)("div",{className:this.layoutClassName,onDragEnter:this.onDragEnter,children:[(0,Fn.jsxs)("div",{className:this.layoutVisibilityClassName,children:[this.region("main",u),l.showControls&&c.top!=="none"&&this.region("top",c.top||d),l.showControls&&c.left!=="none"&&this.region("left",c.left||YM),l.showControls&&c.right!=="none"&&this.region("right",c.right||c9),l.showControls&&c.bottom!=="none"&&this.region("bottom",c.bottom||d9)]}),!(!((s=this.plugin.spec.components)===null||s===void 0)&&s.hideTaskOverlay)&&(0,Fn.jsx)(uye,{}),!(!((a=this.plugin.spec.components)===null||a===void 0)&&a.disableDragOverlay)&&(0,Fn.jsx)(cQe,{plugin:this.plugin,showDragOverlay:this.showDragOverlay})]})})}};function lQe(e,t,r){e.preventDefault(),e.stopPropagation(),r.next(!1);let n=[];if(e.dataTransfer.items)for(let o=0;o{o.dataTransfer.dropEffect="copy",o.preventDefault(),o.stopPropagation()};return(0,Fn.jsx)("div",{className:"msp-drag-drop-overlay",style:{display:r?"flex":"none"},onDragEnter:n,onDragOver:n,onDragLeave:()=>t.next(!1),onDrop:o=>lQe(o,e,t),children:"Load File(s)"})}var c9=class extends pr{render(){var t;let r=((t=this.plugin.spec.components)===null||t===void 0?void 0:t.structureTools)||HM;return(0,Fn.jsx)("div",{className:"msp-scrollable-container",children:(0,Fn.jsx)(r,{})})}},u9=class extends pr{render(){var t,r;let n=((r=(t=this.plugin.spec.components)===null||t===void 0?void 0:t.viewport)===null||r===void 0?void 0:r.controls)||a4;return(0,Fn.jsxs)(Fn.Fragment,{children:[(0,Fn.jsx)(yye,{}),(0,Fn.jsxs)("div",{className:"msp-viewport-top-left-controls",children:[(0,Fn.jsx)(zM,{}),(0,Fn.jsx)(NM,{}),(0,Fn.jsx)(UM,{}),(0,Fn.jsx)($0e,{})]}),(0,Fn.jsx)(VM,{}),(0,Fn.jsx)(n,{}),(0,Fn.jsx)(lye,{}),(0,Fn.jsxs)("div",{className:"msp-highlight-toast-wrapper",children:[(0,Fn.jsx)(GM,{}),(0,Fn.jsx)(r4,{})]})]})}},d9=class extends pr{constructor(){super(...arguments),this.wrapper=Ov.createRef(),this.state={entries:this.plugin.log.entries}}componentDidMount(){this.subscribe(this.plugin.events.log,()=>this.setState({entries:this.plugin.log.entries}))}componentDidUpdate(){this.scrollToBottom()}scrollToBottom(){let t=this.wrapper.current;t&&(t.scrollTop=t.scrollHeight-t.clientHeight-1)}render(){let r=this.state.entries,n=r.size,o=[];for(let i=Math.max(0,n-10),s=0;i{let t=class t{set container(n){this.initialize$.next(n)}constructor(n,o){this.settingsService=n,this.pluginService=o,this.initialize$=new Xf(1);let i=this.pluginService.plugin$,s=this.settingsService.settings$;this.initialized$=this.initialize$.pipe(Rs(a=>{let l=a.nativeElement,c=l.firstElementChild;return{div:l,canvas:c}}),Vm(i),Vm(s),Rs(([[{div:a},l],c])=>{let[u,d]=Av(c["background-color"]);return this.pluginService.specs.canvas3d={renderer:{backgroundColor:u,pickingAlphaThreshold:d}},(0,zxe.createRoot)(a).render((0,Vxe.createElement)(vye,{plugin:l})),l}),vd(1))}};t.\u0275fac=function(o){return new(o||t)(Bu(Cy),Bu(hl))},t.\u0275prov=bd({token:t,factory:t.\u0275fac});let e=t;return e})();function m$e(e,t){let r=eo.getStructureSelection(e,t);return lt.toLociWithSourceUnits(r)}function IB(e,t){let r=oe.struct.generator.atomGroups({"residue-test":oe.core.set.has([oe.set(...e),oe.core.str.concat([oe.ammp("auth_asym_id"),oe.ammp("auth_seq_id"),oe.ammp("pdbx_PDB_ins_code")])])});return m$e(r,t)}function p$e(e,t){let r=ai.ofBundle(e,t.root),n=ai.merge(r);return ai.filter(n,t)}var EB=(()=>{let t=class t{set loci(n){this.loci$.next(n)}set interactions(n){this.interactions$.next(n)}constructor(n,o,i,s){this.structureService=n,this.settingsService=o,this.pluginService=i,this.canvasService=s,this.loci$=new Xf(1),this.interactions$=new Xf(1);let a=this.structureService.source$.pipe(Np(u=>u!=null));this.structure$=this.structureService.structure$.pipe(kG(a),hg(([u,d])=>Kf(Y(this,null,function*(){let m=this.pluginService.plugin,p=yield m.builders.structure.tryCreateComponentStatic(u,"polymer",{label:d.label}),[h]=Av(this.settingsService.settings["backbone-color"]);return yield m.builders.structure.representation.addRepresentation(p,{type:"cartoon",color:"uniform",colorParams:{value:h}}),u.cell.obj.data}))),vd(1));let l=this.getLociRepresentation(),c=this.getInteractionsRepresentation();this.representation$=this.structure$.pipe(Vm(this.canvasService.initialized$),Vm(l),Vm(c),Rs(()=>{}),vd(1)),this._representation=this.representation$.subscribe()}ngOnDestroy(){this._representation.unsubscribe()}getLociRepresentation(){return this.structure$.pipe(Vm(this.loci$),Rs(([n,o])=>({structure:n,loci:o})),Rs(({structure:n,loci:o})=>{let i=[...this.structureService.i2r.values()],s=o.map(a=>{if(a.start){a=te(k({},a),{end:a.end||a.start});let l=this.structureService.r2i.get(a.chain+a.start),c=this.structureService.r2i.get(a.chain+a.end);return te(k({},a),{ids:i.slice(l,c+1)})}else return te(k({},a),{ids:i.filter(l=>l.startsWith(a.chain))})});return{structure:n,loci:s}}),hg(({structure:n,loci:o})=>{let i=[];for(let{ids:c,color:u}of o){let d=IB(c,n),m=$.Bundle.fromLoci(d),[p]=Av(u||this.settingsService.settings["backbone-color"]);i.push({bundle:m,color:p,clear:!1})}let s=this.pluginService.plugin,a=s.state.data.build(),l=p$e(i,n);for(let c of s.managers.structure.hierarchy.current.structures)for(let u of c.components)for(let d of u.representations){a.to(d.cell.transform.ref).apply(Ge.Representation.OverpaintStructureRepresentation3DFromBundle,ai.toBundle(l));let m=IB([...this.structureService.i2r.values()],n),p=$.Bundle.fromLoci(m),[h,f]=Av(this.settingsService.settings["backbone-color"]);a.to(d.cell.transform.ref).apply(Ge.Representation.TransparencyStructureRepresentation3DFromBundle,{layers:[{bundle:p,value:f}]})}return Kf(a.commit({doNotUpdateCurrent:!0}))}))}getInteractionsRepresentation(){let n;return this.structure$.pipe(Vm(this.interactions$),Rs(([o,i])=>({structure:o,interactions:i})),Rs(({structure:o,interactions:i})=>{let s=i.reduce((a,{from:l,to:c})=>[...a,l,c],[]);return Me.eachAtomicHierarchyElement(o,{atom:a=>{let l=x.create(Ne.atom.x(a),Ne.atom.y(a),Ne.atom.z(a));for(let c of s)c.coordinates||(c["atom.id"]===Ne.atom.id(a)||c["chain.id"]===Ne.chain.auth_asym_id(a)&&c["residue.id"]===Ne.residue.auth_seq_id(a)+Ne.residue.pdbx_PDB_ins_code(a)&&c["atom.name"]===Ne.atom.auth_atom_id(a))&&(c.coordinates=l)}}),i=i.filter(({from:a,to:l})=>a.coordinates&&l.coordinates),{structure:o,interactions:i}}),hg(({interactions:o})=>{let s=this.pluginService.plugin.state.data.build(),a=o.map(({from:c,to:u,color:d,label:m,size:p})=>({from:c.coordinates,to:u.coordinates,color:Av(d||this.settingsService.settings["interaction-color"]).at(0),size:p||this.settingsService.settings["interaction-size"],label:m}));return n&&s.delete(n),n=s.toRoot().apply(Whe,{data:a}).apply(Ge.Representation.ShapeRepresentation3D).ref,Kf(s.commit({doNotUpdateCurrent:!0}))}),vd(1))}};t.\u0275fac=function(o){return new(o||t)(Bu(Em),Bu(Cy),Bu(hl),Bu(Z2))},t.\u0275prov=bd({token:t,factory:t.\u0275fac});let e=t;return e})();var DB=(()=>{let t=class t{set highlights(n){this.input$.next(n)}constructor(n,o){this.structureService=n,this.pluginService=o,this.input$=new Xf(1);let i=this.pluginService.plugin,s=i.behaviors.interaction.hover,a=this.structureService.structure$.pipe(Vm(this.input$),Rs(([c,u])=>({structure:c,highlights:u})),Rs(({structure:c,highlights:u})=>{if(u){let d=[...this.structureService.i2r.values()],m=this.structureService.r2i.get(u.chain+u.start),p=this.structureService.r2i.get(u.chain+u.end);return{structure:c,highlights:te(k({},u),{ids:d.slice(m,p+1)})}}return{structure:c,highlights:{start:"",end:"",chain:"",ids:[]}}}),Rs(({structure:c,highlights:u})=>{if(u.ids.length>0){let d=IB(u.ids,c);i.managers.interactivity.lociHighlights.highlightOnly({loci:d})}}));this.output$=s.pipe(Rs(c=>{if(c&&c.current.loci.kind==="element-loci"&&$.Loci.is(c.current.loci)){let u=$.Loci.getFirstLocation(c.current.loci);if(u){let d=Ne.chain.auth_asym_id(u),m=Ne.residue.auth_seq_id(u),p=Ne.residue.pdbx_PDB_ins_code(u),h=m+p,f=h+"";return{start:h,end:f,chain:d}}}}),vd(1));let l=a.pipe(EG(this.output$),Rs(()=>{}));this._highlights=l.subscribe()}ngOnDestroy(){this._highlights.unsubscribe()}};t.\u0275fac=function(o){return new(o||t)(Bu(Em),Bu(hl))},t.\u0275prov=bd({token:t,factory:t.\u0275fac});let e=t;return e})();var g$e=["container"],y$e=(()=>{let t=class t{set container(n){this.canvasService.container=n}set source(n){this.structureService.source=n}set loci(n){this.representationService.loci=n}set interactions(n){this.representationService.interactions=n}set settings(n){this.settingsService.settings=n}set highlights(n){this.highlightService.highlights=n}constructor(n,o,i,s,a,l){this.representationService=n,this.highlightService=o,this.structureService=i,this.settingsService=s,this.pluginService=a,this.canvasService=l,this.highlights$=this.highlightService.output$}};t.\u0275fac=function(o){return new(o||t)(e1(EB),e1(DB),e1(Em),e1(Cy),e1(hl),e1(Z2))},t.\u0275cmp=MG({type:t,selectors:[["ngx-structure-viewer"]],viewQuery:function(o,i){if(o&1&&FG(g$e,5),o&2){let s;OG(s=NG())&&(i.container=s.first)}},inputs:{source:"source",loci:"loci",interactions:"interactions",settings:"settings",highlights:"highlights"},outputs:{highlights$:"highlights"},standalone:!0,features:[UG([EB,DB,Cy,Z2,{provide:Em,deps:[$2,hl,[new kB,new MB,Em]],useFactory:(n,o,i)=>(i||(i=$2.create({providers:[Em,{provide:hl,useValue:o}],parent:n}).get(Em)),i)},{provide:hl,deps:[$2,[new kB,new MB,hl]],useFactory:(n,o)=>(o||(o=$2.create({providers:[hl],parent:n}).get(hl)),o)}]),zG],decls:4,vars:0,consts:[["container",""],["canvas",""],[1,"ngx-structure-viewer-container"],[1,"ngx-structure-viewer-canvas"]],template:function(o,i){o&1&&(BG(0,"div",2,0),LG(2,"canvas",3,1),RG())},dependencies:[VG],styles:[`.msp-plugin{font-family:Helvetica Neue,Segoe UI,Helvetica,Source Sans Pro,Arial,sans-serif;font-size:14px;line-height:1.42857143;position:absolute;inset:0;background:#111318}.msp-plugin *{box-sizing:border-box}.msp-plugin [hidden],.msp-plugin template{display:none}.msp-plugin a{background-color:transparent}.msp-plugin a:active,.msp-plugin a:hover{outline:0}.msp-plugin abbr[title]{border-bottom:1px dotted}.msp-plugin b,.msp-plugin strong{font-weight:700}.msp-plugin small{font-size:80%}.msp-plugin img{border:0}.msp-plugin svg:not(:root){overflow:hidden}.msp-plugin button,.msp-plugin input,.msp-plugin optgroup,.msp-plugin select,.msp-plugin textarea{color:inherit;font:inherit;margin:0}.msp-plugin button{overflow:visible}.msp-plugin button,.msp-plugin select{text-transform:none}.msp-plugin button,.msp-plugin html input[type=button],.msp-plugin input[type=reset],.msp-plugin input[type=submit]{-webkit-appearance:button;cursor:pointer}.msp-plugin button[disabled],.msp-plugin html input[disabled]{cursor:default}.msp-plugin button::-moz-focus-inner,.msp-plugin input::-moz-focus-inner{border:0;padding:0}.msp-plugin input{line-height:normal}.msp-plugin input[type=checkbox],.msp-plugin input[type=radio]{box-sizing:border-box;padding:0}.msp-plugin input[type=number]::-webkit-inner-spin-button,.msp-plugin input[type=number]::-webkit-outer-spin-button{height:auto}.msp-plugin textarea{overflow:auto}.msp-plugin .msp-layout-expanded,.msp-plugin .msp-layout-standard{inset:0}.msp-plugin .msp-layout-standard{border:1px solid #313645}.msp-plugin .msp-layout-region{overflow:hidden}.msp-plugin .msp-layout-static,.msp-plugin .msp-layout-scrollable{position:absolute}.msp-plugin .msp-scrollable{overflow-y:auto}.msp-plugin .msp-scrollable-container{position:absolute;inset:0;overflow-y:auto}.msp-plugin .msp-layout-static{overflow:hidden}.msp-plugin .msp-layout-top .msp-layout-static,.msp-plugin .msp-layout-main .msp-layout-static,.msp-plugin .msp-layout-bottom .msp-layout-static,.msp-plugin .msp-layout-right .msp-layout-static{inset:0}.msp-plugin .msp-layout-right .msp-layout-scrollable{inset:43px 0 0}.msp-plugin .msp-layout-left .msp-layout-static{inset:0}.msp-plugin .msp-layout-standard-outside{position:absolute}.msp-plugin .msp-layout-standard-outside .msp-layout-main{position:absolute;inset:0}.msp-plugin .msp-layout-standard-outside .msp-layout-top{position:absolute;right:0;height:97px;top:-97px;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;top:-97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-right{position:absolute;width:50%;right:0;bottom:-295px;height:295px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-left{position:absolute;width:50%;left:0;bottom:-295px;height:295px;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-standard-outside .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-outside .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-outside .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-standard-landscape{position:absolute}.msp-plugin .msp-layout-standard-landscape .msp-layout-main{position:absolute;inset:100px 300px 70px 330px}.msp-plugin .msp-layout-standard-landscape .msp-layout-top{position:absolute;left:330px;right:300px;height:100px;top:0;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-bottom{position:absolute;left:330px;right:300px;height:70px;bottom:0;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-right{position:absolute;width:300px;right:0;bottom:0;top:0;border-left:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-left{position:absolute;width:330px;left:0;bottom:0;top:0;border-right:1px solid #313645}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-main,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-top,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-right .msp-layout-bottom{right:0}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-main,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-top,.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-left .msp-layout-bottom{left:0}.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-main,.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-top,.msp-plugin .msp-layout-standard-landscape .msp-layout-collapse-left .msp-layout-bottom{left:32px}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-bottom .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-landscape .msp-layout-hide-top .msp-layout-main{top:0}.msp-plugin .msp-layout-standard-portrait{position:absolute}.msp-plugin .msp-layout-standard-portrait .msp-layout-main{position:absolute;inset:97px 0 361px}.msp-plugin .msp-layout-standard-portrait .msp-layout-top{position:absolute;right:0;height:97px;top:0;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-right{position:absolute;width:50%;right:0;bottom:0;height:361px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-left{position:absolute;width:50%;left:0;bottom:0;height:361px;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-right.msp-layout-hide-left .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-portrait .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-portrait .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-standard-portrait .msp-layout-hide-top.msp-layout-hide-bottom .msp-layout-main{top:0}.msp-plugin .msp-layout-standard-reactive{position:absolute}@media (orientation: landscape),(min-width: 1000px){.msp-plugin .msp-layout-standard-reactive .msp-layout-main{position:absolute;inset:100px 300px 70px 330px}.msp-plugin .msp-layout-standard-reactive .msp-layout-top{position:absolute;left:330px;right:300px;height:100px;top:0;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-bottom{position:absolute;left:330px;right:300px;height:70px;bottom:0;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-right{position:absolute;width:300px;right:0;bottom:0;top:0;border-left:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-left{position:absolute;width:330px;left:0;bottom:0;top:0;border-right:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-main,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-top,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-bottom{right:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-main,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-top,.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-bottom{left:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-main,.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-top,.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-bottom{left:32px}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-main{top:0}}@media (orientation: portrait) and (max-width: 1000px){.msp-plugin .msp-layout-standard-reactive .msp-layout-main{position:absolute;inset:97px 0 361px}.msp-plugin .msp-layout-standard-reactive .msp-layout-top{position:absolute;right:0;height:97px;top:0;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-right{position:absolute;width:50%;right:0;bottom:0;height:361px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-left{position:absolute;width:50%;left:0;bottom:0;height:361px;border-top:1px solid #313645}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-right.msp-layout-hide-left .msp-layout-main{bottom:0}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-standard-reactive .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-standard-reactive .msp-layout-hide-top.msp-layout-hide-bottom .msp-layout-main{top:0}}.msp-plugin .msp-layout-expanded{position:fixed}@media (orientation: landscape){.msp-plugin .msp-layout-expanded .msp-layout-main{position:absolute;inset:100px 300px 70px 330px}.msp-plugin .msp-layout-expanded .msp-layout-top{position:absolute;left:330px;right:300px;height:100px;top:0;border-bottom:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-bottom{position:absolute;left:330px;right:300px;height:70px;bottom:0;border-top:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-right{position:absolute;width:300px;right:0;bottom:0;top:0;border-left:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-left{position:absolute;width:330px;left:0;bottom:0;top:0;border-right:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-main,.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-top,.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-bottom{right:0}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-main,.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-top,.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-bottom{left:0}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-main,.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-top,.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-bottom{left:32px}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-main{bottom:0}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-main{top:0}}@media (orientation: portrait){.msp-plugin .msp-layout-expanded .msp-layout-main{position:absolute;inset:97px 0 361px}.msp-plugin .msp-layout-expanded .msp-layout-top{position:absolute;right:0;height:97px;top:0;width:50%;border-left:1px solid #313645;border-bottom:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-bottom{position:absolute;left:0;right:0;height:97px;width:50%;border-bottom:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-right{position:absolute;width:50%;right:0;bottom:0;height:361px;border-left:1px solid #313645;border-top:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-left{position:absolute;width:50%;left:0;bottom:0;height:361px;border-top:1px solid #313645}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-right{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-right .msp-layout-left{width:100%}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-left{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-left .msp-layout-right{width:100%;border-left:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-right.msp-layout-hide-left .msp-layout-main{bottom:0}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-left{width:32px}.msp-plugin .msp-layout-expanded .msp-layout-collapse-left .msp-layout-right{left:32px;width:auto}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-top{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-top .msp-layout-bottom{width:100%;border-left:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-bottom{display:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-bottom .msp-layout-top{width:100%;border-left:none}.msp-plugin .msp-layout-expanded .msp-layout-hide-top.msp-layout-hide-bottom .msp-layout-main{top:0}}.msp-plugin ::-webkit-scrollbar{width:10px;height:10px}.msp-plugin ::-webkit-scrollbar-track{border-radius:0;background-color:#16191f}.msp-plugin ::-webkit-scrollbar-thumb{border-radius:0;background-color:#0e0f14}.msp-plugin .msp-form-control,.msp-plugin .msp-control-row select,.msp-plugin .msp-control-row button,.msp-plugin .msp-control-row input[type=text],.msp-plugin .msp-btn{display:block;width:100%;background:#0c0d11;border:none;padding:0 10px;line-height:30px;height:32px;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-shadow:none;box-shadow:none;background-image:none}.msp-plugin .msp-form-control::-moz-placeholder,.msp-plugin .msp-control-row select::-moz-placeholder,.msp-plugin .msp-control-row button::-moz-placeholder,.msp-plugin .msp-control-row input[type=text]::-moz-placeholder,.msp-plugin .msp-btn::-moz-placeholder{color:#637ca0;opacity:1}.msp-plugin .msp-form-control:-ms-input-placeholder,.msp-plugin .msp-control-row select:-ms-input-placeholder,.msp-plugin .msp-control-row button:-ms-input-placeholder,.msp-plugin .msp-control-row input[type=text]:-ms-input-placeholder,.msp-plugin .msp-btn:-ms-input-placeholder{color:#637ca0}.msp-plugin .msp-form-control::-webkit-input-placeholder,.msp-plugin .msp-control-row select::-webkit-input-placeholder,.msp-plugin .msp-control-row button::-webkit-input-placeholder,.msp-plugin .msp-control-row input[type=text]::-webkit-input-placeholder,.msp-plugin .msp-btn::-webkit-input-placeholder{color:#637ca0}.msp-plugin .msp-form-control:hover,.msp-plugin .msp-control-row select:hover,.msp-plugin .msp-control-row button:hover,.msp-plugin .msp-control-row input[type=text]:hover,.msp-plugin .msp-btn:hover{color:#51a2fb;background-color:#16191f;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-form-control:active,.msp-plugin .msp-control-row select:active,.msp-plugin .msp-control-row button:active,.msp-plugin .msp-control-row input[type=text]:active,.msp-plugin .msp-btn:active,.msp-plugin .msp-form-control:focus,.msp-plugin .msp-control-row select:focus,.msp-plugin .msp-control-row button:focus,.msp-plugin .msp-control-row input[type=text]:focus,.msp-plugin .msp-btn:focus{color:#ccd4e0;background-color:#0c0d11;border:none;outline-offset:0;outline:none}.msp-plugin .msp-form-control[disabled],.msp-plugin .msp-control-row select[disabled],.msp-plugin .msp-control-row button[disabled],.msp-plugin .msp-control-row input[disabled][type=text],.msp-plugin [disabled].msp-btn,.msp-plugin .msp-form-control[readonly],.msp-plugin .msp-control-row select[readonly],.msp-plugin .msp-control-row button[readonly],.msp-plugin .msp-control-row input[readonly][type=text],.msp-plugin [readonly].msp-btn,fieldset[disabled] .msp-plugin .msp-form-control,fieldset[disabled] .msp-plugin .msp-control-row select,fieldset[disabled] .msp-plugin .msp-control-row button,fieldset[disabled] .msp-plugin .msp-control-row input[type=text],fieldset[disabled] .msp-plugin .msp-btn{background:#111318;opacity:.35}.msp-plugin .msp-btn,.msp-plugin .msp-control-row button{display:inline-block;margin-bottom:0;text-align:center;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:0 10px;line-height:32px;border:none;-moz-box-sizing:border-box;box-sizing:border-box}.msp-plugin .msp-btn[disabled],.msp-plugin .msp-control-row button[disabled]{background:#111318;opacity:.35}.msp-plugin .msp-btn-block,.msp-plugin .msp-control-row button{display:block;width:100%}.msp-plugin .msp-btn,.msp-plugin .msp-control-row button,.msp-plugin .msp-btn:active,.msp-plugin .msp-btn-link:focus,.msp-plugin .msp-btn:hover{outline:none}.msp-plugin .msp-material-icon svg{display:inline-flex;vertical-align:middle;font-size:1.2em;margin-bottom:3px;fill:currentColor;width:1em;height:1em;flex-shrink:0;-webkit-user-select:none;user-select:none}.msp-plugin .msp-btn-block>.msp-material-icon,.msp-plugin .msp-control-row button>.msp-material-icon{margin-left:0;margin-right:.4em}.msp-plugin .msp-btn-childless>.msp-material-icon{margin-left:0;margin-right:0}.msp-plugin .msp-btn-icon{border:none;height:32px;width:32px;line-height:32px;padding:0;text-align:center}.msp-plugin .msp-btn-icon:hover{color:#51a2fb;background-color:#16191f;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-btn-icon[disabled],.msp-plugin .msp-btn-icon[disabled]:hover,.msp-plugin .msp-btn-icon[disabled]:active{color:#637ca0}.msp-plugin .msp-btn-icon-small{border:none;height:32px;width:20px;line-height:32px;padding:0;text-align:center}.msp-plugin .msp-btn-icon-small:hover{color:#51a2fb;background-color:#16191f;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-btn-icon-small[disabled],.msp-plugin .msp-btn-icon-small[disabled]:hover,.msp-plugin .msp-btn-icon-small[disabled]:active{color:#637ca0}.msp-plugin .msp-btn-link{font-weight:400;border-radius:0}.msp-plugin .msp-btn-link,.msp-plugin .msp-btn-link:active,.msp-plugin .msp-btn-link.active,.msp-plugin .msp-btn-link[disabled],fieldset[disabled] .msp-plugin .msp-btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.msp-plugin .msp-btn-link,.msp-plugin .msp-btn-link:hover,.msp-plugin .msp-btn-link:focus,.msp-plugin .msp-btn-link:active{border-color:transparent}.msp-plugin .msp-btn-link:hover,.msp-plugin .msp-btn-link:focus{text-decoration:none;background-color:transparent}.msp-plugin .msp-btn-link[disabled]:hover,.msp-plugin .msp-btn-link[disabled]:focus,fieldset[disabled] .msp-plugin .msp-btn-link:hover,fieldset[disabled] .msp-plugin .msp-btn-link:focus{text-decoration:none}.msp-plugin .msp-btn-link .msp-icon{font-size:100%}.msp-plugin .msp-btn-link,.msp-plugin .msp-btn-link:active,.msp-plugin .msp-btn-link:focus{color:#ccd4e0;text-decoration:none}.msp-plugin .msp-btn-link:hover{color:#51a2fb;text-decoration:none}.msp-plugin .msp-btn-link-toggle-on{color:#ccd4e0}.msp-plugin .msp-btn-link-toggle-off,.msp-plugin .msp-btn-link-toggle-off:active,.msp-plugin .msp-btn-link-toggle-off:focus{color:#637ca0!important}.msp-plugin .msp-btn-link-toggle-off:hover,.msp-plugin .msp-btn-link-toggle-on:hover{color:#51a2fb!important}.msp-plugin .msp-btn-action,.msp-plugin .msp-btn-action:active,.msp-plugin .msp-btn-action:focus{color:#ccd4e0;background:#0c0d11}.msp-plugin .msp-btn-action:hover{color:#51a2fb;background:#060709}.msp-plugin .msp-btn-action[disabled],.msp-plugin .msp-btn-action[disabled]:hover,.msp-plugin .msp-btn-action[disabled]:active,.msp-plugin .msp-btn-action[disabled]:focus{color:#c9d1de}.msp-plugin .msp-btn-commit-on,.msp-plugin .msp-btn-commit-on:active,.msp-plugin .msp-btn-commit-on:focus{color:#68befd;background:#0d0e12}.msp-plugin .msp-btn-commit-on:hover{color:#51a2fb;background:#07080b}.msp-plugin .msp-btn-commit-on[disabled],.msp-plugin .msp-btn-commit-on[disabled]:hover,.msp-plugin .msp-btn-commit-on[disabled]:active,.msp-plugin .msp-btn-commit-on[disabled]:focus{color:#63bcfd}.msp-plugin .msp-btn-commit-off,.msp-plugin .msp-btn-commit-off:active,.msp-plugin .msp-btn-commit-off:focus{color:#ccd4e0;background:#090a0c}.msp-plugin .msp-btn-commit-off:hover{color:#51a2fb;background:#030405}.msp-plugin .msp-btn-commit-off[disabled],.msp-plugin .msp-btn-commit-off[disabled]:hover,.msp-plugin .msp-btn-commit-off[disabled]:active,.msp-plugin .msp-btn-commit-off[disabled]:focus{color:#c9d1de}.msp-plugin .msp-btn-remove:hover{color:#f2f4f7}.msp-plugin .msp-btn-commit-on:hover{color:#0393fc}.msp-plugin .msp-btn-action{height:32px;line-height:32px}.msp-plugin input[type=file]{display:block}.msp-plugin input[type=range]{display:block;width:100%}.msp-plugin select[multiple],.msp-plugin select[size],.msp-plugin textarea.msp-form-control,.msp-plugin textarea.msp-btn{height:auto}.msp-plugin .msp-control-top-offset{margin-top:1px}.msp-plugin .msp-btn-commit{text-align:right;padding:0 10px 0 0;line-height:32px;border:none;overflow:hidden;font-weight:700}.msp-plugin .msp-btn-commit .msp-icon{display:block-inline;line-height:32px;width:32px;text-align:center}.msp-plugin select.msp-form-control,.msp-plugin .msp-control-row select,.msp-plugin select.msp-btn{background:none;background-color:#0c0d11;background-size:8px 12px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAMAAACzvE1FAAAADFBMVEUzMzMzMzMzMzMzMzMKAG/3AAAAA3RSTlMAf4C/aSLHAAAAPElEQVR42q3NMQ4AIAgEQTn//2cLdRKppSGzBYwzVXvznNWs8C58CiussPJj8h6NwgorrKRdTvuV9v16Afn0AYFOB7aYAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right 10px center;padding-right:24px}.msp-plugin select.msp-form-control:-moz-focusring,.msp-plugin .msp-control-row select:-moz-focusring,.msp-plugin select.msp-btn:-moz-focusring{color:transparent;text-shadow:0 0 0 #ccd4e0}.msp-plugin .msp-default-bg{background:#111318}.msp-plugin .msp-transparent-bg{background:transparent}.msp-plugin .msp-no-hover-outline:hover{color:#51a2fb;background-color:inherit;border:none;outline-offset:0!important;outline:none!important}.msp-plugin .msp-icon-inline{margin-right:8px}.msp-plugin .msp-control-row{position:relative;height:32px;background:#111318;margin-top:1px}.msp-plugin .msp-control-row>span.msp-control-row-label,.msp-plugin .msp-control-row>button.msp-control-button-label{line-height:32px;display:block;width:120px;text-align:right;padding:0 10px;color:#9cacc3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-control-row>button.msp-control-button-label{background:#111318;cursor:pointer}.msp-plugin .msp-control-row .msp-control-current{background:#111318}.msp-plugin .msp-control-row>div.msp-control-row-ctrl{position:absolute;inset:0 0 0 120px}.msp-plugin .msp-control-row>div{background:#0c0d11}.msp-plugin .msp-control-row>.msp-flex-row,.msp-plugin .msp-control-row>.msp-state-image-row{background:#111318}.msp-plugin .msp-control-label-short>span{width:80px!important}.msp-plugin .msp-control-label-short>div:nth-child(2){left:80px!important}.msp-plugin .msp-control-col-2{float:left;width:50%}.msp-plugin .msp-control-twoline{height:64px!important}.msp-plugin .msp-control-group{position:relative}.msp-plugin .msp-toggle-button .msp-icon{display:inline-block;margin-right:6px}.msp-plugin .msp-toggle-button>div>button:hover{border-color:#16191f!important;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-slider>div:first-child{position:absolute;inset:0 62px 0 18px;display:flex}.msp-plugin .msp-slider>div:last-child{position:absolute;height:32px;line-height:32px;text-align:center;right:0;width:50px;top:0;bottom:0}.msp-plugin .msp-slider input[type=text]{padding-right:6px;padding-left:4px;font-size:80%;text-align:right}.msp-plugin .msp-slider2>div:first-child{position:absolute;height:32px;line-height:32px;text-align:center;left:0;width:25px;top:0;bottom:0;font-size:80%}.msp-plugin .msp-slider2>div:nth-child(2){position:absolute;inset:0 37px 0 35px;display:flex}.msp-plugin .msp-slider2>div:last-child{position:absolute;height:32px;line-height:32px;text-align:center;right:0;width:25px;top:0;bottom:0;font-size:80%}.msp-plugin .msp-slider2 input[type=text]{padding-right:4px;padding-left:4px;font-size:80%;text-align:center}.msp-plugin .msp-toggle-color-picker button{border:10px solid #0c0d11!important;margin:0;text-align:center;padding-right:10px;padding-left:10px}.msp-plugin .msp-toggle-color-picker button:hover{border-color:#16191f!important;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-toggle-color-picker .msp-color-picker{position:absolute;z-index:100000;background:#111318;border-top:1px solid #111318;padding-bottom:5px;width:100%}.msp-plugin .msp-toggle-color-picker-above .msp-color-picker{top:-85px;height:85px}.msp-plugin .msp-toggle-color-picker-below .msp-color-picker{top:32px;height:80px}.msp-plugin .msp-control-offset{padding-left:10px}.msp-plugin .msp-accent-offset{padding-left:1px;margin-left:8px;border-left:2px solid #d67118}.msp-plugin .msp-control-group-wrapper{margin-bottom:0;margin-top:1px}.msp-plugin .msp-control-group-header{background:#111318}.msp-plugin .msp-control-group-header>button,.msp-plugin .msp-control-group-header div{padding-left:4px;text-align:left;height:24px!important;line-height:24px!important;font-size:85%!important;background:#111318!important;color:#9cacc3}.msp-plugin .msp-control-group-header .msp-icon{height:24px!important;line-height:24px!important}.msp-plugin .msp-control-group-header>span{padding-left:5px;line-height:21.3333333333px;font-size:70%;background:#111318;color:#9cacc3}.msp-plugin .msp-control-current{background:#111318}.msp-plugin .msp-control-group-footer{background:#1c1f27;height:5px;font-size:1px;margin-top:1px}.msp-plugin .msp-control-group-expander{display:block;position:absolute;line-height:32px;padding:0;left:0;top:0;width:120px;text-align:left;background:transparent}.msp-plugin .msp-control-group-expander .msp-icon{line-height:29px;width:31px;text-align:center;font-size:100%}.msp-plugin .msp-plugin-layout_controls{position:absolute;left:10px;top:10px}.msp-plugin .msp-plugin-layout_controls>button:first-child{margin-right:6px}.msp-plugin .msp-empty-control{display:none}.msp-plugin .msp-control .msp-btn-block,.msp-plugin .msp-control .msp-control-row button,.msp-plugin .msp-control-row .msp-control button{margin-bottom:0;margin-top:0}.msp-plugin .msp-row-text{height:32px;position:relative;background:#111318;margin-top:1px}.msp-plugin .msp-row-text>div{line-height:32px;text-align:center;color:#9cacc3}.msp-plugin .msp-help span{display:none}.msp-plugin .msp-help:hover span{display:inline-block;background:linear-gradient(#111318,#111318cc)}.msp-plugin .msp-help-text{position:relative;background:#111318;margin-top:1px}.msp-plugin .msp-help-text>div{padding:5px 10px;text-align:left;color:#9cacc3}.msp-plugin .msp-help-description{font-style:italic}.msp-plugin .msp-help-legend{padding-top:10px}.msp-plugin .msp-scale-legend>div{width:100%;height:30px}.msp-plugin .msp-scale-legend>div>span{padding:5px;color:#fff;font-weight:700;background-color:#0003}.msp-plugin .msp-table-legend>div{margin-right:5px;display:inline-flex}.msp-plugin .msp-table-legend>div .msp-table-legend-color{width:30px;height:20px}.msp-plugin .msp-table-legend>div .msp-table-legend-text{margin:0 5px}.msp-plugin .msp-image-preview{position:relative;background:#111318;margin-top:1px;padding:10px}.msp-plugin .msp-image-preview canvas{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.msp-plugin .msp-image-preview>span{margin-top:6px;display:block;text-align:center;font-size:80%;line-height:15px}.msp-plugin .msp-copy-image-wrapper{position:relative}.msp-plugin .msp-copy-image-wrapper div{font-weight:700;padding:3px;margin:1px 0;width:100%;background:#0c0d11;text-align:center}.msp-plugin .msp-copy-image-wrapper img{margin-top:1px}.msp-plugin .msp-control-text-area-wrapper,.msp-plugin .msp-text-area-wrapper{position:relative}.msp-plugin .msp-control-text-area-wrapper textarea,.msp-plugin .msp-text-area-wrapper textarea{border:none;width:100%;height:100%;background:#0c0d11;padding:5px 10px;resize:none;font-size:12px;line-height:16px}.msp-plugin .msp-control-text-area-wrapper{height:64px!important}.msp-plugin .msp-text-area-wrapper{height:96px!important}.msp-plugin .msp-slider-base{position:relative;height:14px;padding:5px 0;width:100%;border-radius:6px;align-self:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.msp-plugin .msp-slider-base *{box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.msp-plugin .msp-slider-base-rail{position:absolute;width:100%;background-color:#1f222b;height:4px;border-radius:2px}.msp-plugin .msp-slider-base-track{position:absolute;left:0;height:4px;border-radius:6px;background-color:tint(#ccd4e0,60%)}.msp-plugin .msp-slider-base-handle{position:absolute;margin-left:-11px;margin-top:-9px;width:22px;height:22px;cursor:pointer;border-radius:50%;background-color:#ccd4e0;border:4px solid #1f222b}.msp-plugin .msp-slider-base-handle:hover{background-color:#51a2fb}.msp-plugin .msp-slider-base-mark{position:absolute;top:18px;left:0;width:100%;font-size:12px}.msp-plugin .msp-slider-base-mark-text{position:absolute;display:inline-block;vertical-align:middle;text-align:center;cursor:pointer;color:#999}.msp-plugin .msp-slider-base-mark-text-active{color:#666}.msp-plugin .msp-slider-base-step{position:absolute;width:100%;height:4px;background:transparent}.msp-plugin .msp-slider-base-dot{position:absolute;bottom:-2px;margin-left:-4px;width:8px;height:8px;border:2px solid #e9e9e9;background-color:#fff;cursor:pointer;border-radius:50%;vertical-align:middle}.msp-plugin .msp-slider-base-dot:first-child{margin-left:-4px}.msp-plugin .msp-slider-base-dot:last-child{margin-left:-4px}.msp-plugin .msp-slider-base-dot-active{border-color:tint(#ccd4e0,50%)}.msp-plugin .msp-slider-base-disabled{background:#111318;opacity:.35}.msp-plugin .msp-slider-base-disabled .msp-slider-base-handle,.msp-plugin .msp-slider-base-disabled .msp-slider-base-dot{cursor:not-allowed}.msp-plugin .msp-slider-base-disabled .msp-slider-base-mark-text,.msp-plugin .msp-slider-base-disabled .msp-slider-base-dot{cursor:not-allowed!important}.msp-plugin .msp-description{padding:10px;font-size:85%;background:#111318;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;font-weight:light;cursor:default}.msp-plugin .msp-description:not(:first-child){border-top:1px solid #1f222b}.msp-plugin .msp-color-picker input{color:#000!important}.msp-plugin .msp-no-webgl{position:absolute;width:100%;height:100%;left:0;top:0;display:table;text-align:center;background:#111318}.msp-plugin .msp-no-webgl>div{display:table-cell;vertical-align:middle;text-align:center;width:100%;height:100%}.msp-plugin .msp-no-webgl>div b{font-size:120%}.msp-plugin .msp-loader-msp-btn-file{position:relative;overflow:hidden}.msp-plugin .msp-loader-msp-btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block}.msp-plugin .msp-controls-section{margin-bottom:10px}.msp-plugin .msp-combined-color-button{border:4px solid #0c0d11!important;margin:0;text-align:center;padding-right:10px;padding-left:10px}.msp-plugin .msp-combined-color-button:hover{border-color:#16191f!important;border:none;outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-combined-color-swatch{width:100%;display:grid;grid-gap:1px;grid-template-columns:repeat(6,auto)}.msp-plugin .msp-combined-color-swatch .msp-btn:hover,.msp-plugin .msp-combined-color-swatch .msp-control-row button:hover,.msp-plugin .msp-control-row .msp-combined-color-swatch button:hover{outline-offset:-1px!important;outline:1px solid #363c4c!important}.msp-plugin .msp-action-select{position:relative}.msp-plugin .msp-action-select select{padding-left:42px}.msp-plugin .msp-action-select option:first-child{color:#9cacc3}.msp-plugin .msp-action-select>.msp-icon{display:block;top:0;left:10px;position:absolute;line-height:32px}.msp-plugin .msp-simple-help-section{height:28px;line-height:28px;margin-top:5px;margin-bottom:5px;padding:0 10px;font-weight:500;background:#111318;color:#ccd4e0}.msp-plugin .msp-left-panel-controls-buttons{position:absolute;width:32px;top:0;bottom:0;padding-top:10px;background:#111318}.msp-plugin .msp-left-panel-controls-buttons-bottom{position:absolute;bottom:0}.msp-plugin .msp-left-panel-controls-button-data-dirty{position:absolute;width:6px;height:6px;background:#d67118;border-radius:3px;right:6px;bottom:6px}.msp-plugin .msp-left-panel-controls .msp-scrollable-container{left:33px}.msp-plugin .msp-mapped-parameter-group{position:relative}.msp-plugin .msp-mapped-parameter-group>.msp-control-row:first-child>div:nth-child(2){right:33px}.msp-plugin .msp-mapped-parameter-group>button:first-child{right:33px}.msp-plugin .msp-mapped-parameter-group>.msp-btn-icon{position:absolute;right:0;width:32px;top:0;padding:0}.msp-plugin .msp-shape-filled{fill:#ccd4e0;stroke:#ccd4e0}.msp-plugin .msp-shape-empty{fill:none;stroke:#ccd4e0}.msp-plugin .msp-no-overflow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.msp-plugin .msp-25-lower-contrast-text{color:#7d91b0}.msp-plugin .msp-expandable-group-color-stripe{position:absolute;left:0;top:30px;width:120px;height:2px}.msp-plugin .msp-section-header{height:32px;line-height:32px;margin-top:10px;margin-bottom:10px;text-align:right;padding:0 10px;font-weight:700;background:#111318;overflow:hidden;cursor:default}.msp-plugin .msp-section-header>.msp-icon{display:block;float:left}.msp-plugin .msp-section-header>small{font-weight:400}.msp-plugin .msp-current-header{height:32px;line-height:32px;margin-bottom:10px;text-align:center;font-weight:700;background:#111318}.msp-plugin .msp-flex-row,.msp-plugin .msp-state-image-row{margin-top:1px;background:#111318;display:flex;flex-direction:row;width:inherit;height:32px}.msp-plugin .msp-flex-row>.msp-flex-item,.msp-plugin .msp-state-image-row>.msp-flex-item{margin:0 1px 0 0;flex:1 1 auto;overflow:hidden}.msp-plugin .msp-flex-row>.msp-flex-item:last-child,.msp-plugin .msp-state-image-row>.msp-flex-item:last-child{margin-right:0}.msp-plugin .msp-flex-row>select,.msp-plugin .msp-state-image-row>select,.msp-plugin .msp-flex-row>button,.msp-plugin .msp-state-image-row>button{margin:0 1px 0 0;flex:1 1 auto;height:32px;overflow:hidden}.msp-plugin .msp-flex-row .msp-btn-icon,.msp-plugin .msp-state-image-row .msp-btn-icon,.msp-plugin .msp-flex-row .msp-btn-icon-small,.msp-plugin .msp-state-image-row .msp-btn-icon-small{flex:0 0 32px;max-width:32px}.msp-plugin .msp-flex-row>select,.msp-plugin .msp-state-image-row>select{background:none}.msp-plugin .msp-flex-row>select>option[value=_],.msp-plugin .msp-state-image-row>select>option[value=_]{display:none}.msp-plugin .msp-flex-row>select:last-child,.msp-plugin .msp-state-image-row>select:last-child,.msp-plugin .msp-flex-row>button:last-child,.msp-plugin .msp-state-image-row>button:last-child{margin-right:0}.msp-plugin .msp-flex-row>button.msp-control-button-label,.msp-plugin .msp-state-image-row>button.msp-control-button-label{background:#111318}.msp-plugin .msp-state-list{list-style:none}.msp-plugin .msp-state-list>li{position:relative;overflow:hidden}.msp-plugin .msp-state-list>li>button:first-child{text-align:left;border-left:10px solid #2a2f3c!important}.msp-plugin .msp-state-list>li>div{position:absolute;right:0;top:0}.msp-plugin .msp-state-image-row{height:96px;margin-top:0}.msp-plugin .msp-state-image-row>button{height:96px;padding:0}.msp-plugin .msp-state-image-row>button>img{min-height:96px;width:inherit;transform:translateY(-50%);top:50%;position:relative}.msp-plugin .msp-tree-row{position:relative;margin-top:0;margin-bottom:1px;background:transparent}.msp-plugin .msp-tree-row-current .msp-btn-tree-label{border-radius:0!important}.msp-plugin .msp-tree-row-current .msp-btn-tree-label>span{font-weight:700}.msp-plugin .msp-tree-row .msp-btn-tree-label{text-align:left;border-radius:0 0 0 8px;border-left-width:4px;border-left-style:solid}.msp-plugin .msp-tree-row .msp-btn-tree-label>small{color:#8d9fb9}.msp-plugin .msp-tree-updates-wrapper .msp-control-group-header:last-child{margin-bottom:1px}.msp-plugin .msp-viewport-top-left-controls{position:absolute;left:10px;top:10px}.msp-plugin .msp-viewport-top-left-controls .msp-traj-controls{line-height:32px;float:left;margin-right:10px;background-color:#0c0d11}.msp-plugin .msp-viewport-top-left-controls .msp-traj-controls>span{color:#ccd4e0;margin-left:10px;margin-right:10px;font-size:85%;display:inline-block}.msp-plugin .msp-viewport-top-left-controls .msp-state-snapshot-viewport-controls{line-height:32px;float:left;margin-right:10px}.msp-plugin .msp-viewport-top-left-controls .msp-state-snapshot-viewport-controls>button{background-color:#0c0d11}.msp-plugin .msp-viewport-top-left-controls .msp-state-snapshot-viewport-controls>select{display:inline-block;width:200px;margin-right:10px}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls{line-height:32px;float:left;margin-right:10px;position:relative}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls>div:first-child{position:relative;display:inline-block}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls>div:first-child>button{position:relative}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls .msp-animation-viewport-controls-select{width:290px;position:absolute;left:0;margin-top:10px;background:#1f222b}.msp-plugin .msp-viewport-top-left-controls .msp-animation-viewport-controls .msp-animation-viewport-controls-select .msp-control-row:first-child{margin-top:0}.msp-plugin .msp-selection-viewport-controls{position:relative;margin:10px auto 0;width:430px}.msp-plugin .msp-selection-viewport-controls-actions{position:absolute;width:100%;top:32px;background:#1f222b}.msp-plugin .msp-selection-viewport-controls>.msp-flex-row .msp-btn,.msp-plugin .msp-selection-viewport-controls>.msp-state-image-row .msp-btn,.msp-plugin .msp-selection-viewport-controls>.msp-flex-row .msp-control-row button,.msp-plugin .msp-control-row .msp-selection-viewport-controls>.msp-flex-row button,.msp-plugin .msp-selection-viewport-controls>.msp-state-image-row .msp-control-row button,.msp-plugin .msp-control-row .msp-selection-viewport-controls>.msp-state-image-row button{padding:0 5px}.msp-plugin .msp-selection-viewport-controls select.msp-form-control,.msp-plugin .msp-selection-viewport-controls select.msp-btn,.msp-plugin .msp-selection-viewport-controls .msp-control-row select,.msp-plugin .msp-control-row .msp-selection-viewport-controls select{padding:0 5px;text-align:center;background:#0c0d11;flex:0 0 80px;text-overflow:ellipsis}.msp-plugin .msp-param-object-list-item{margin-top:1px;position:relative}.msp-plugin .msp-param-object-list-item>button{text-align:left}.msp-plugin .msp-param-object-list-item>button>span{font-weight:700}.msp-plugin .msp-param-object-list-item>div{position:absolute;right:0;top:0}.msp-plugin .msp-state-actions .msp-transform-wrapper:last-child{margin-bottom:10px}.msp-plugin .msp-button-row{display:flex;flex-direction:row;height:32px;width:inherit}.msp-plugin .msp-button-row>button{margin:0 1px 0 0;flex:1 1 auto;height:32px;text-align-last:center;background:none;padding:0 10px;overflow:hidden}.msp-plugin .msp-action-menu-options-no-header,.msp-plugin .msp-action-menu-options .msp-control-group-children{max-height:300px;overflow:hidden;overflow-y:auto}.msp-plugin .msp-action-menu-options .msp-control-row,.msp-plugin .msp-action-menu-options button,.msp-plugin .msp-action-menu-options .msp-icon,.msp-plugin .msp-action-menu-options .msp-flex-row,.msp-plugin .msp-action-menu-options .msp-state-image-row{height:24px;line-height:24px}.msp-plugin .msp-action-menu-options button{text-align:left}.msp-plugin .msp-action-menu-options .msp-action-menu-button{margin-top:1px;display:flex}.msp-plugin .msp-action-menu-options .msp-action-menu-button .msp-icon{margin-right:6px}.msp-plugin .msp-representation-entry{position:relative}.msp-plugin .msp-representation-entry>.msp-control-group-header>.msp-btn,.msp-plugin .msp-control-row .msp-representation-entry>.msp-control-group-header>button{font-weight:700}.msp-plugin .msp-representation-entry>.msp-control-group-header>.msp-icon,.msp-plugin .msp-representation-entry>.msp-control-group-header>.msp-btn-link{line-height:24px;height:24px}.msp-plugin .msp-control-group-presets-wrapper{position:absolute;right:0;top:0}.msp-plugin .msp-control-group-presets-wrapper .msp-control-group-header{background:transparent}.msp-plugin .msp-control-group-presets-wrapper button{background:transparent!important}.msp-plugin .msp-parameter-matrix input{flex:1 1 auto;min-width:0}.msp-plugin .msp-btn-apply-simple{text-align:left}.msp-plugin .msp-btn-apply-simple .msp-icon{margin-right:10px}.msp-plugin .msp-type-class-Root{border-left-color:#111318}.msp-plugin .msp-type-class-Group{border-left-color:#d67118}.msp-plugin .msp-type-class-Data{border-left-color:#6d8082}.msp-plugin .msp-type-class-Object{border-left-color:#25a25a}.msp-plugin .msp-type-class-Representation3D{border-left-color:#258cd1}.msp-plugin .msp-type-class-Behavior{border-left-color:#804399}.msp-plugin .msp-accent-color-cyan{color:#6d8082}.msp-plugin .msp-accent-bg-cyan{background:#6d8082}.msp-plugin .msp-transform-header-brand-cyan{border-bottom:1px solid #6d8082}.msp-plugin .msp-transform-header-brand-cyan:active,.msp-plugin .msp-transform-header-brand-cyan:focus{border-bottom:1px solid #6d8082}.msp-plugin .msp-accent-color-red{color:#bf2718}.msp-plugin .msp-accent-bg-red{background:#bf2718}.msp-plugin .msp-transform-header-brand-red{border-bottom:1px solid #bf2718}.msp-plugin .msp-transform-header-brand-red:active,.msp-plugin .msp-transform-header-brand-red:focus{border-bottom:1px solid #bf2718}.msp-plugin .msp-accent-color-gray{color:#22303d}.msp-plugin .msp-accent-bg-gray{background:#22303d}.msp-plugin .msp-transform-header-brand-gray{border-bottom:1px solid #22303d}.msp-plugin .msp-transform-header-brand-gray:active,.msp-plugin .msp-transform-header-brand-gray:focus{border-bottom:1px solid #22303d}.msp-plugin .msp-accent-color-green{color:#25a25a}.msp-plugin .msp-accent-bg-green{background:#25a25a}.msp-plugin .msp-transform-header-brand-green{border-bottom:1px solid #25a25a}.msp-plugin .msp-transform-header-brand-green:active,.msp-plugin .msp-transform-header-brand-green:focus{border-bottom:1px solid #25a25a}.msp-plugin .msp-accent-color-purple{color:#804399}.msp-plugin .msp-accent-bg-purple{background:#804399}.msp-plugin .msp-transform-header-brand-purple{border-bottom:1px solid #804399}.msp-plugin .msp-transform-header-brand-purple:active,.msp-plugin .msp-transform-header-brand-purple:focus{border-bottom:1px solid #804399}.msp-plugin .msp-accent-color-blue{color:#258cd1}.msp-plugin .msp-accent-bg-blue{background:#258cd1}.msp-plugin .msp-transform-header-brand-blue{border-bottom:1px solid #258cd1}.msp-plugin .msp-transform-header-brand-blue:active,.msp-plugin .msp-transform-header-brand-blue:focus{border-bottom:1px solid #258cd1}.msp-plugin .msp-accent-color-orange{color:#d67118}.msp-plugin .msp-accent-bg-orange{background:#d67118}.msp-plugin .msp-transform-header-brand-orange{border-bottom:1px solid #d67118}.msp-plugin .msp-transform-header-brand-orange:active,.msp-plugin .msp-transform-header-brand-orange:focus{border-bottom:1px solid #d67118}.msp-plugin .msp-volume-channel-inline-controls>:first-child{position:absolute;left:0;top:0;height:32px;right:32px}.msp-plugin .msp-volume-channel-inline-controls .msp-slider>div:first-child{right:42px}.msp-plugin .msp-volume-channel-inline-controls .msp-slider>div:last-child{width:30px}.msp-plugin .msp-volume-channel-inline-controls>button{position:absolute;right:0;width:32px;top:0;padding:0}.msp-plugin .msp-volume-channel-inline-controls>button .msp-material-icon{margin-right:0}.msp-plugin .msp-list-unstyled{padding-left:0;list-style:none}.msp-plugin .msp-drag-drop-overlay{border:12px dashed #ccd4e0;background:#0000005c;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;font-size:48px;font-weight:700}.msp-plugin .msp-task-state{line-height:32px}.msp-plugin .msp-task-state>span{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-overlay-tasks{position:absolute;display:flex;inset:0;height:100%;width:100%;z-index:1000;justify-content:center;align-items:center;background:#00000040}.msp-plugin .msp-overlay-tasks .msp-task-state>div{height:32px;margin-top:1px;position:relative;width:100%;background:#111318}.msp-plugin .msp-overlay-tasks .msp-task-state>div>div{height:32px;line-height:32px;display:inline-block;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default;white-space:nowrap;background:#111318;position:absolute}.msp-plugin .msp-overlay-tasks .msp-task-state>div>button{display:inline-block;margin-top:-3px}.msp-plugin .msp-background-tasks{position:absolute;left:0;bottom:0;z-index:1000}.msp-plugin .msp-background-tasks .msp-task-state>div{height:32px;margin-top:1px;position:relative;width:100%;background:#111318}.msp-plugin .msp-background-tasks .msp-task-state>div>div{height:32px;line-height:32px;display:inline-block;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default;white-space:nowrap;background:#111318;position:absolute}.msp-plugin .msp-background-tasks .msp-task-state>div>button{display:inline-block;margin-top:-3px}.msp-plugin .msp-viewport{position:absolute;inset:0;background:#111318}.msp-plugin .msp-viewport .msp-btn-link{background:#0003}.msp-plugin .msp-viewport-expanded{position:fixed;z-index:1000}.msp-plugin .msp-viewport-host3d{position:absolute;inset:0;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none;touch-action:manipulation}.msp-plugin .msp-viewport-host3d>canvas{background-color:#111318;background-image:linear-gradient(45deg,lightgrey 25%,transparent 25%,transparent 75%,lightgrey 75%,lightgrey),linear-gradient(45deg,lightgrey 25%,transparent 25%,transparent 75%,lightgrey 75%,lightgrey);background-size:60px 60px;background-position:0 0,30px 30px}.msp-plugin .msp-viewport-controls{position:absolute;right:10px;top:10px;width:32px}.msp-plugin .msp-viewport-controls-buttons{text-align:right;position:relative}.msp-plugin .msp-viewport-controls-buttons>div{position:relative;margin-bottom:4px}.msp-plugin .msp-viewport-controls-buttons button{padding:0;text-align:center;width:32px;position:relative}.msp-plugin .msp-viewport-controls-buttons .msp-btn-link-toggle-off{color:#637ca0}.msp-plugin .msp-viewport-controls-buttons .msp-btn-link:hover{color:#51a2fb}.msp-plugin .msp-semi-transparent-background{background:#111318;opacity:.5;position:absolute;top:0;left:0;width:100%;height:100%}.msp-plugin .msp-hover-box-wrapper{position:relative}.msp-plugin .msp-hover-box-wrapper .msp-hover-box-body{visibility:hidden;position:absolute;right:36px;top:0;width:100px;background-color:#111318}.msp-plugin .msp-hover-box-wrapper .msp-hover-box-spacer{visibility:hidden;position:absolute;right:32px;top:0;width:4px;height:32px}.msp-plugin .msp-hover-box-wrapper:hover .msp-hover-box-body,.msp-plugin .msp-hover-box-wrapper:hover .msp-hover-box-spacer{visibility:visible}.msp-plugin .msp-viewport-controls-panel{width:290px;top:0;right:36px;position:absolute;background:#1f222b}.msp-plugin .msp-viewport-controls-panel .msp-control-group-wrapper:first-child{padding-top:0}.msp-plugin .msp-viewport-controls-panel .msp-viewport-controls-panel-controls{overflow-y:auto;max-height:400px}.msp-plugin .msp-highlight-toast-wrapper{position:absolute;right:10px;bottom:10px;max-width:95%;z-index:10000}.msp-plugin .msp-highlight-info{color:#51a2fb;padding:3px 10px;background:#111318;opacity:90%;max-width:400px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-highlight-markdown-row{padding-left:10px}.msp-plugin .msp-highlight-simple-row{text-align:right}.msp-plugin .msp-highlight-info-hr{margin-inline:0px;margin-block:3px;border:none;height:1px;background-color:#51a2fb}.msp-plugin .msp-highlight-info-additional{font-size:85%;display:inline-block;color:#056ee1}.msp-plugin .msp-snapshot-description-wrapper{background:#11131880;position:absolute;left:0;top:42px;padding:6.6px 10px;max-height:224px;overflow:hidden;overflow-y:auto;max-width:400px}.msp-plugin .msp-snapshot-description-wrapper a{text-decoration:underline;cursor:pointer;color:#ccd4e0}.msp-plugin .msp-snapshot-description-wrapper ul,.msp-plugin .msp-snapshot-description-wrapper ol{padding-left:14px}.msp-plugin .msp-log-wrap{position:absolute;inset:0;overflow:hidden}.msp-plugin .msp-log{position:absolute;inset:0 -20px 0 0;overflow-y:scroll;overflow-x:hidden;font-size:90%;background:#1f222b}.msp-plugin .msp-log{font-size:90%;color:#bcc7d6}.msp-plugin .msp-log ul{padding:0;margin:0}.msp-plugin .msp-log li{clear:both;margin:0;background:#111318;position:relative}.msp-plugin .msp-log li:not(:last-child){border-bottom:1px solid #313645}.msp-plugin .msp-log .msp-log-entry{margin-left:110px;background:#14171c;padding:3px 25px 3px 10px}.msp-plugin .msp-log .msp-log-timestamp{padding:3px 10px;float:left;text-align:right;width:110px;color:#8d9fb9;font-size:100%}.msp-plugin .msp-log .msp-log-timestamp small{font-size:100%}.msp-plugin .msp-log .label{margin-top:-3px;font-size:7pt}.msp-plugin .msp-log-entry-badge{position:absolute;left:0;top:0;bottom:0;width:6px}.msp-plugin .msp-log-entry-message{background:#0cca5d}.msp-plugin .msp-log-entry-info{background:#5e3673}.msp-plugin .msp-log-entry-error{background:#fd354b}.msp-plugin .msp-log-entry-warning{background:#fcc937}.msp-plugin .msp-sequence{position:absolute;inset:0;background:#111318}.msp-plugin .msp-sequence-select{position:relative;height:24px;width:100%;margin-bottom:1px;background:#1f222b;text-align:left}.msp-plugin .msp-sequence-select>span{display:inline-block;line-height:24px;padding:0 10px;font-size:85%;font-weight:700;cursor:default}.msp-plugin .msp-sequence-select>select{display:inline-block;max-width:120px;width:auto;text-overflow:ellipsis;font-size:85%;height:24px;line-height:24px;background-size:6px 8px;background-color:#1f222b}.msp-plugin .msp-sequence-wrapper{word-break:break-word;padding:10px 10px 3px;-webkit-user-select:none;user-select:none}.msp-plugin .msp-sequence-wrapper-non-empty{font-size:85%;line-height:180%;font-family:Courier New,monospace;background:#0c0d11;width:100%;overflow-y:auto;overflow-x:hidden;position:absolute;inset:25px 0 0}.msp-plugin .msp-sequence-chain-label{margin-left:10px;margin-top:10px;-webkit-user-select:none;user-select:none;color:#51a2fb;font-size:90%;line-height:90%;padding-left:.2em}.msp-plugin .msp-sequence-wrapper span{cursor:pointer}.msp-plugin .msp-sequence-wrapper .msp-sequence-residue-long{margin:0 .2em}.msp-plugin .msp-sequence-wrapper .msp-sequence-residue-long-begin{margin:0 .2em 0 0}.msp-plugin .msp-sequence-wrapper .msp-sequence-label{color:#51a2fb;font-size:90%;line-height:90%;padding-bottom:1em;padding-left:.2em}.msp-plugin .msp-sequence-wrapper .msp-sequence-number{color:#51a2fb;word-break:keep-all;cursor:default;position:relative;top:-1.1em;left:3.1em;padding:0;margin-left:-3em;font-size:80%}.msp-plugin .msp-sequence-wrapper .msp-sequence-number-long{left:3.3em}.msp-plugin .msp-sequence-wrapper .msp-sequence-number-long-negative{left:2.7em}.msp-plugin .msp-sequence-wrapper .msp-sequence-number-negative{left:2.5em}.msp-plugin .msp-sequence-wrapper .msp-sequence-present{color:#ccd4e0}.msp-plugin .msp-sequence-wrapper .msp-sequence-missing{color:#637ca0}.msp-plugin .msp-transformer .msp-entity-badge{position:absolute;top:0;right:0;height:32px;line-height:32px;width:32px}.msp-plugin .msp-layout-right,.msp-plugin .msp-layout-left{background:#1f222b}.msp-plugin .msp-transformer-wrapper{position:relative}.msp-plugin .msp-transformer-wrapper .msp-entity-badge{left:0;top:0}.msp-plugin .msp-transformer-wrapper:first-child .msp-panel-description-content{top:33px}.msp-plugin .msp-transformer-wrapper:not(:first-child) .msp-panel-description-content{bottom:33px}.msp-plugin .msp-transform-wrapper{margin-bottom:10px}.msp-plugin .msp-transform-wrapper-collapsed,.msp-plugin .msp-transform-update-wrapper,.msp-plugin .msp-transform-update-wrapper-collapsed{margin-bottom:1px}.msp-plugin .msp-transform-update-wrapper>.msp-transform-header>button,.msp-plugin .msp-transform-update-wrapper-collapsed>.msp-transform-header>button{text-align:left;padding-left:32px;line-height:24px;background:#16191f}.msp-plugin .msp-transform-wrapper>.msp-transform-header>button{text-align:left;background:#111318;font-weight:700;padding-right:5px}.msp-plugin .msp-transform-header{position:relative}.msp-plugin .msp-transform-header>button>small{font-weight:400;float:right}.msp-plugin .msp-transform-header>button>span:first-child{margin-right:10px}.msp-plugin .msp-transform-header>button:hover{color:#9cacc3}.msp-plugin .msp-transform-header-brand{margin-bottom:-1px}.msp-plugin .msp-transform-header-brand svg{fill:#ccd4e0;stroke:#ccd4e0}.msp-plugin .msp-transform-default-params{background:#111318;position:absolute;left:0;top:0;width:32px;padding:0}.msp-plugin .msp-transform-default-params:hover{background:#000}.msp-plugin .msp-transform-apply-wrap{position:relative;margin-top:1px;width:100%;height:32px}.msp-plugin .msp-transform-refresh{width:87px;margin-left:33px;background:#111318;text-align:right}.msp-plugin .msp-transform-apply{display:block;position:absolute;left:120px;right:0;top:0}.msp-plugin .msp-transform-apply-wider{margin-left:33px}.msp-plugin .msp-data-beh{margin:10px 0!important}.msp-plugin .msp-toast-container{position:relative;z-index:1001}.msp-plugin .msp-toast-container .msp-toast-entry{color:#ccd4e0;background:#1f222b;position:relative;float:right;min-height:32px;margin-top:10px;border:1px solid #313645;display:table}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-title{height:100%;line-height:32px;padding:0 10px;background:#111318;font-weight:700;display:table-cell;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;font-weight:light;cursor:pointer}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message{padding:3px 42px 3px 10px;display:table-cell}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a{text-decoration:none;color:#68befd;font-weight:700}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a:hover{text-decoration:underline;color:#0393fc}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a:active,.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-message a:focus{color:#68befd;outline-offset:0;outline:none}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-hide{position:absolute;width:42px;right:0;top:0;bottom:0}.msp-plugin .msp-toast-container .msp-toast-entry .msp-toast-hide .msp-btn-icon{background:transparent;position:absolute;inset:1px 0 0;width:100%;text-align:right;padding-right:5px}.msp-plugin .msp-help-row{position:relative;height:32px;background:#111318;margin-top:1px;display:table;width:100%}.msp-plugin .msp-help-row>span{width:120px;text-align:right;padding:3px 10px;color:#9cacc3;display:table-cell;font-weight:700;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:default}.msp-plugin .msp-help-row>div{background:#0c0d11;position:relative;padding:3px 10px;display:table-cell}.msp-plugin .msp-canvas{width:100%;height:100%;background-color:#f3f2ee}.msp-plugin .msp-canvas text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.msp-plugin .msp-canvas circle{stroke:#000;stroke-width:10;stroke-opacity:.3}.msp-plugin .msp-canvas circle:hover{fill:#ae5d04;stroke:#000;stroke-width:10px}.msp-plugin .msp-canvas .info{fill:#fff;stroke:#000;stroke-width:3}.msp-plugin .msp-canvas .show{visibility:visible}.msp-plugin .msp-canvas .hide{visibility:hidden}.msp-plugin .msp-canvas .delete-button rect{fill:#ed4337;stroke:#000}.msp-plugin .msp-canvas .delete-button text{stroke:#fff;fill:#fff}.msp-plugin .msp-canvas .delete-button:hover{stroke:#000;stroke-width:3;fill:#ff6961}.msp-plugin .msp-canvas .infoCircle:hover{fill:#4c66b2}.msp-plugin .msp-canvas:focus{outline:none}.msp-plugin .msp-logo{display:block;position:absolute;bottom:10px;right:10px;height:32px;width:100px;background-repeat:no-repeat;background-position:bottom right;background-size:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAgCAYAAABn7+QVAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTACUobeu8AA0nuTXkVhmBlgKAMOMzSxIaICEUVEmiJIUMSA0VAkVkSxEBRUsAckCCgxGEVULG9G1ouurLz38vL746xv7bP3ufvsvc9aFwCSpy+XlwZLAZDKE/CDPJzpEZFRdOwAgAEeYIApAExWRrpfsHsIEMnLzYWeIXICXwQB8HpYvAJw09AzgE4H/5+kWel8geiYABGbszkZLBEXiDglS5Auts+KmBqXLGYYJWa+KEERy4k5YZENPvsssqOY2ak8tojFOaezU9li7hXxtkwhR8SIr4gLM7mcLBHfErFGijCVK+I34thUDjMDABRJbBdwWIkiNhExiR8S5CLi5QDgSAlfcdxXLOBkC8SXcklLz+FzExIFdB2WLt3U2ppB9+RkpXAEAsMAJiuZyWfTXdJS05m8HAAW7/xZMuLa0kVFtjS1trQ0NDMy/apQ/3Xzb0rc20V6Gfi5ZxCt/4vtr/zSGgBgzIlqs/OLLa4KgM4tAMjd+2LTOACApKhvHde/ug9NPC+JAkG6jbFxVlaWEZfDMhIX9A/9T4e/oa++ZyQ+7o/y0F058UxhioAurhsrLSVNyKdnpDNZHLrhn4f4Hwf+dR4GQZx4Dp/DE0WEiaaMy0sQtZvH5gq4aTw6l/efmvgPw/6kxbkWidL4EVBjjIDUdSpAfu0HKAoRINH7xV3/o2+++DAgfnnhKpOLc//vN/1nwaXiJYOb8DnOJSiEzhLyMxf3xM8SoAEBSAIqkAfKQB3oAENgBqyALXAEbsAb+IMQEAlWAxZIBKmAD7JAHtgECkEx2An2gGpQBxpBM2gFx0EnOAXOg0vgGrgBboP7YBRMgGdgFrwGCxAEYSEyRIHkIRVIE9KHzCAGZA+5Qb5QEBQJxUIJEA8SQnnQZqgYKoOqoXqoGfoeOgmdh65Ag9BdaAyahn6H3sEITIKpsBKsBRvDDNgJ9oFD4FVwArwGzoUL4B1wJdwAH4U74PPwNfg2PAo/g+cQgBARGqKKGCIMxAXxR6KQeISPrEeKkAqkAWlFupE+5CYyiswgb1EYFAVFRxmibFGeqFAUC7UGtR5VgqpGHUZ1oHpRN1FjqFnURzQZrYjWR9ugvdAR6AR0FroQXYFuQrejL6JvoyfQrzEYDA2jjbHCeGIiMUmYtZgSzD5MG+YcZhAzjpnDYrHyWH2sHdYfy8QKsIXYKuxR7FnsEHYC+wZHxKngzHDuuCgcD5ePq8AdwZ3BDeEmcQt4Kbwm3gbvj2fjc/Cl+EZ8N/46fgK/QJAmaBPsCCGEJMImQiWhlXCR8IDwkkgkqhGtiYFELnEjsZJ4jHiZOEZ8S5Ih6ZFcSNEkIWkH6RDpHOku6SWZTNYiO5KjyALyDnIz+QL5EfmNBEXCSMJLgi2xQaJGokNiSOK5JF5SU9JJcrVkrmSF5AnJ65IzUngpLSkXKabUeqkaqZNSI1Jz0hRpU2l/6VTpEukj0lekp2SwMloybjJsmQKZgzIXZMYpCEWd4kJhUTZTGikXKRNUDFWb6kVNohZTv6MOUGdlZWSXyYbJZsvWyJ6WHaUhNC2aFy2FVko7ThumvVuitMRpCWfJ9iWtS4aWzMstlXOU48gVybXJ3ZZ7J0+Xd5NPlt8l3yn/UAGloKcQqJClsF/hosLMUupS26WspUVLjy+9pwgr6ikGKa5VPKjYrzinpKzkoZSuVKV0QWlGmabsqJykXK58RnlahaJir8JVKVc5q/KULkt3oqfQK+m99FlVRVVPVaFqveqA6oKatlqoWr5am9pDdYI6Qz1evVy9R31WQ0XDTyNPo0XjniZek6GZqLlXs09zXktbK1xrq1an1pS2nLaXdq52i/YDHbKOg84anQadW7oYXYZusu4+3Rt6sJ6FXqJejd51fVjfUp+rv09/0ABtYG3AM2gwGDEkGToZZhq2GI4Z0Yx8jfKNOo2eG2sYRxnvMu4z/mhiYZJi0mhy31TG1Ns037Tb9HczPTOWWY3ZLXOyubv5BvMu8xfL9Jdxlu1fdseCYuFnsdWix+KDpZUl37LVctpKwyrWqtZqhEFlBDBKGJet0dbO1husT1m/tbG0Edgct/nN1tA22faI7dRy7eWc5Y3Lx+3U7Jh29Xaj9nT7WPsD9qMOqg5MhwaHx47qjmzHJsdJJ12nJKejTs+dTZz5zu3O8y42Lutczrkirh6uRa4DbjJuoW7Vbo/c1dwT3FvcZz0sPNZ6nPNEe/p47vIc8VLyYnk1e816W3mv8+71IfkE+1T7PPbV8+X7dvvBft5+u/0erNBcwVvR6Q/8vfx3+z8M0A5YE/BjICYwILAm8EmQaVBeUF8wJTgm+Ejw6xDnkNKQ+6E6ocLQnjDJsOiw5rD5cNfwsvDRCOOIdRHXIhUiuZFdUdiosKimqLmVbiv3rJyItogujB5epb0qe9WV1QqrU1afjpGMYcaciEXHhsceiX3P9Gc2MOfivOJq42ZZLqy9rGdsR3Y5e5pjxynjTMbbxZfFTyXYJexOmE50SKxInOG6cKu5L5I8k+qS5pP9kw8lf0oJT2lLxaXGpp7kyfCSeb1pymnZaYPp+umF6aNrbNbsWTPL9+E3ZUAZqzK6BFTRz1S/UEe4RTiWaZ9Zk/kmKyzrRLZ0Ni+7P0cvZ3vOZK577rdrUWtZa3vyVPM25Y2tc1pXvx5aH7e+Z4P6hoINExs9Nh7eRNiUvOmnfJP8svxXm8M3dxcoFWwsGN/isaWlUKKQXziy1XZr3TbUNu62ge3m26u2fyxiF10tNimuKH5fwiq5+o3pN5XffNoRv2Og1LJ0/07MTt7O4V0Ouw6XSZfllo3v9tvdUU4vLyp/tSdmz5WKZRV1ewl7hXtHK30ru6o0qnZWva9OrL5d41zTVqtYu712fh9739B+x/2tdUp1xXXvDnAP3Kn3qO9o0GqoOIg5mHnwSWNYY9+3jG+bmxSaips+HOIdGj0cdLi32aq5+YjikdIWuEXYMn00+uiN71y/62o1bK1vo7UVHwPHhMeefh/7/fBxn+M9JxgnWn/Q/KG2ndJe1AF15HTMdiZ2jnZFdg2e9D7Z023b3f6j0Y+HTqmeqjkte7r0DOFMwZlPZ3PPzp1LPzdzPuH8eE9Mz/0LERdu9Qb2Dlz0uXj5kvulC31OfWcv210+dcXmysmrjKud1yyvdfRb9Lf/ZPFT+4DlQMd1q+tdN6xvdA8uHzwz5DB0/qbrzUu3vG5du73i9uBw6PCdkeiR0TvsO1N3U+6+uJd5b+H+xgfoB0UPpR5WPFJ81PCz7s9to5ajp8dcx/ofBz++P84af/ZLxi/vJwqekJ9UTKpMNk+ZTZ2adp++8XTl04ln6c8WZgp/lf619rnO8x9+c/ytfzZiduIF/8Wn30teyr889GrZq565gLlHr1NfL8wXvZF/c/gt423fu/B3kwtZ77HvKz/ofuj+6PPxwafUT5/+BQOY8/xvJtwPAAAACXBIWXMAAC4iAAAuIgGq4t2SAAANMElEQVRoQ92aB1xURx7H/69sY5eOFBELCipESsSC0RCMJRZMrICHGiMmGjWaqDk7YEsuGok5TS6xi56KGtsFG6jBiAYLKhqVc8GGBZG+fd97N+/twNJWFksS7/v5DG/nN/OG/fze/838Z4CA/wMCE9d9W8oQ3mUMBSojBTqWAuBQAweHIC56lanXHw8xJixM6qhQNcX1KuQykluyKzMPVxvF5XUh3hIpgFSiQz8AJBItSKU6sCsX55P9byLxxRKwYl3W5O6dg5o62IMRmcpyBBz87wNYcyH3R4iL+gh3+8MhHaTqYJKUKO2dPYTigIqza1MlLZLnzh3arQ/uZzVn14YOIGRyJWXrqgR5U6VI1kRJS92VBEEry+wrAnC3F04XL3cY4OMF7/p6weC2zSDQzQG3/IlM7dspdPmU0VxtLqYf5haM6HYOBYLVUwcXByQy92JxXioexUzFhT5cySn3TrjrC4WP3EsPHuPfZGJVZg4HCdt/wF0aT8LWUHT/jTpl4fZU3KNBSHytQ0D33uDR0qfjoqg3hmOpQU65d4u2cW4X6NCyJ1ZeIeKSFRC3p1q4kzYdmzr6Zk98p6rsj+rhi0KoFe5gIm53M/ypDhbNJQgC3kbTFUGSi+LiwmgsWyQ5zk9McESCZ8gEVHvF1kneWJI5CJT2SHWDbUQ0vNbEvqr4OClwCyZ+RzSQ+psomqOwUgOL5vL4BIdCi/aBvtJb3AdYsoirs0usnWfH1vbNOmPlFWHmWlve2DFB3t0nhvh0qm2wRRZuG+ksFyUlDe4qcbYRJ0H8v6NxSxVPNZcnPPJDIAlY8PWnXWVYqsPhZb3lDAfzW3T50xbmZ+MfyFhbRcr7yNj1EZ1gdb+O8DFvMKk7it4+ywYjY11k0s1po8KpmA4tITUmnHaWS5HBKJKr0aC5zXw6QJvgNzyhXDIZS3UgCN3UJq3fdLd188PKs3H8+Bjpvn2x/jv2TwnbsOezt3/YPavTss3TXXHzi4U3Vic/+H5gq+7rkLEkmgb5yWwVb3CnNiFAcD+aOtaGaMobmzrqLaoyIwlC11RkNB/JvPGCiGjQXJ43h8QCSRGzEqeG1Xmah77u48QCPdM7NBYrjSPveJg069i7H2UcjUpndWSZrZ3bFRfHlic8nL1TnezcM2Vyh0dLtsbnzdu8JHHW5qVt8G3Pj9qOT4RYluOE/UYllQZPCvFxMik1cbGRSKsbWwlKUPhxhDGxZJ25Ls28oX2X3k60HmZiqQqDTj+rqX8fB7lTC6xYT2569zA9Jb5m7xz8r3aB03uE9fpOFP7WYujZ/TPo22MSDOs1FT4ePBfG9ZvQsod/12kUJf190prli4YnJ6Mt2HOSMKICGLL/5su3Tn6wPxMYZE4lvMH/RAZP6NjaJGBsJSJIi3mrTg6d9bAYem05YSxS6WJgQdR2LFtnLk9oxFigRaKpq2aEuWMJDizu6UlQosltuo3FivU8zgyOkEhkRzz941u2CogDxyYhgMzDrWb4rMXN0Q36vN4TZr43XuTt0WyeoiR/MwqV509JqgzOSx+77zcw8nGM4UMx2r+5qYJpqpByHVztcc3E+QdFXJWx8dE78MgCDaZYldi5eIB/jwj577/+NB9VJ/GajmHj2nYZKpPZNW5aVJ9v2ULDwlaXdsvFYlvzpo1l9PD4yXUoKStAY3MgFjuAexNvcFA4C+32NgqY3HcofHFg18ioH1adRSHyjdBgCQJaQ/y2SFyzAIMKuSkp+1YAepIOGwZ1Bgo9UGu4gCK2z9ZfoEit3yMI1X8XxZwh+B2al2/7jOnfbsKqGaNeB7RYgmsAmvJi2LHkbwaC0baXyElKKpVe7f/JVlpsY4978Abp0PxsvqcSVVZfMGoud3Z44+HZ8vOeG2m3GWOkntNwK8CTgky4eiWJK9fqflUZJRe0jFirZmgvDSPu29or2PmdzhEgpkVC3/ziIpiRvL1ETUua74+NLed3aEnRg4IC3F2Edp6DNx/AmqxcXLMeFK0w3M8L1yxToTfCtCNZUKTRY8VMZv4TyC/VxFiM3OM7N0BudiaMW/g9VgBkto7QIWyYKDstaSEYGdo3dEQNY/n5/EbKJHBq2QPcOozBWk24K00UGgM3QuI2GisA5cVXIOdyYqHeKBo0cEDSaSwLLNu8TJ5968o6LQORI3oMETRPRycI9GrhkHH7Di/UjQpEvzYeQnlZKMQ0rB1Y/25+xO4M2Fl61/KcazTo4W5ONuRcOIUVEx3CI0Fqax8lljsO9w2tuTMuyksHVcHvwKHX2xIcU9aFsgmQEbR5MX50aztQYJzWu19NY3lmjp6pekIrxmbfvv6woLQQqwCBzZujn0SYqfbX5KkLGprVL51IXgMcW5VdgFgqh4DwkaR/WAxBi837Co5j4Hbmj3wucglL9cJy4ENKzRkVf5+q9Bqnpol9WKpDYuR0DfoKabcL8rGCotfBEQ0GLy41ewk81VyWIfYV3lNmXj2NNizVaNvtPfBBc2B1Hl07BKqi2xkkyf0HSxYg0D7eFn9G5rJ69EAYfXj4zgos1QtaYoq16G2qRCYWA0dw5oFqcb9cAyfvPG50ufq4FI/wdPg5t777+VKoNh1ZPzVbIAiWIwl69qm9G9Lad+kJFF5QKFosXCthjXrI/W0jsCw5G62+Tz0D5p8mU3sxrp7FWwClZKYcHWMawvKqvuf6PZh86HwBusW6VY0g/FzlEru0mHAsPB05mnN3X7sHKzNz+K91Df2o+VQIorDBVGz2lpPHvhobdvRy+v7ewT2HYrUmdy/tBU3po5Ren55MP7e+a6MP2F8aHLHXqr9ExO8Y46oQr08bFS6cflkD/1gT+wYLH1aeydGCSD8Q5ox5Ymo1YdUmgqTI2ZkpWziDToMVM0adCpRntrAERc/B0qvFImSsrWAsWdvYx/j1rkRtYNBGo+bbk9gnGKZ19Q0GgzgVlm4yJeQYq8ydsfb4eW158a6LaTuxYkaZuQN0mrLtb39y/KkL2V+Shdved7URrz9Wj7Fn7xfBuAOZuGbiTqkKRu09Y8HgtkFg5A3+qcpgq8zloUT0vItpyUZthXlq0amKQfnbTgNw5AIsvTos3o2SYGL10vAA0r8eY/mdV4nWgBUz26/eqWMwz7JeQeDrbIcM1idgyXpzp6xOyzHoVBuyUrdiBeD6ySQw6DVr+n9+XImlBmE5ggHOiGs8wleg0G7e8urEQwBNEuavywjpYY2BGse8oQ9QHjgM7bK0/ApfiWDslhOGEq1+NZZqwnH526/cOVbdYP7K13OelKcBY/O5ICKsNpeHFJMJ1zL2aVQlBaAqfgDKswdUKIFYhJutAqVqDznDI1xDdbRVFkkc6YzDQ9piqX448HNSmE+jitVq/mkU4OqzERd9sEJnGNJ/W7pgcGalsTp9FDLRdF5QGwJ0wNpEoAhOi0GGao0M8Fe+DkzpIEgYpMY9G2fuxMRj+axBvyrryEbITtsIjNGwcuDnvzzEzVahJ+gsVnURfTK/Vg6uYUDSNH8gVG/0Ltqy6E2FVNajjYf5WFNZ8AhQcvb88zxvsIEZzBvcV4hYYyQsiP4Jt9YPbyAycgcytM2qn4G/moz9qMpYnkaZK0CIv8y9cKQk72JqkYqAZVi1GmlAxXVGX3DdWHYGKwDurSLBxrb1yLRDo/ftTxkflpQyxW5lyhTJ97vm+azYNneWiCJ+HtxtICnCeTZ/wH0m9yaQHHNAEJ6X+ZGHeINLtLpIiIusP2JrwxspJyLyyzVL+WttY3kabe74xCNFBMd+xXDcl2MTfinBcqPggP5Kfe+bqimTomTwWkg8tPaNjLC3bX5CxtKljjqxViGzyfFrFfTFB/3GK3w9zTvd49eyobCsNGPvlCl1ziKeGWQwxI2sYWx2QamwsFWWcQfO4hbM9EgNLIiaK1zrofGRy8PQ34o1mmf+Hyz5/nub9Kprh4qVS4WzBR6SFEOLVv3hze7zYOiAFTDqveUQ03829O0yDJrYm8+Lr9+/AztOn1SxHPNy/xoqklxEi9qAo7kPq0rGvcIBaOIah3s0yDOZO/rro6rIxDP1Pi1rIBKABb3tiIqCw0fzL38GmvKbuMUyOoMODmf9Ct8d3l3CsfpByR9Pu4KbXg5zhjxBUZlSp8yPPoF7NIhwWG5jb5/h16kbltBrShLw+K4SCvOVCYt2no7HslWg7e9iW5fWcxVNvIGmGVMRGYEoO4zmykLhsBx3heTk4VSgW+lENSObQ8n9POSOHUEi90L97dHOlQKtXg9FFSVwu+A+XLmbx5Tp2F1qhvr7d7Ezb+MhBPjD8tdbNA+SSGSgYwmUGpFwo7AczuYX/an/iEdM6B3qKqbZAbguIKJQEZEosYSLi3efzsKyVZxd3/V1Cc0FisQMGsMAUqkBXfXoqgXChjlgF/LAfCiLOXfuQ5G2tDRcY5CGaRhxO41R4qJlRJSaEZVrjOLbapY6Z9BASkJswn18Sw2CVqx/t5ghncoZElQsBTqm8u+X3A0UaRm48gcD8D/XZskfp8IFSwAAAABJRU5ErkJggg==)}.msp-plugin .msp-plugin-content{color:#ccd4e0}.msp-plugin .msp-plugin-init-error{white-space:pre;margin:10px} +`,`.ngx-structure-viewer-container{position:relative;height:100%;width:100%}.ngx-structure-viewer-canvas{position:absolute;height:100%;width:100%;left:0;top:0} +`],encapsulation:2});let e=t;return e})();export{x as a,hl as b,Em as c,y$e as d}; diff --git a/docs/chunk-M6PASJEJ.js b/docs/chunk-M6PASJEJ.js new file mode 100644 index 0000000..ad0edee --- /dev/null +++ b/docs/chunk-M6PASJEJ.js @@ -0,0 +1,7 @@ +var ul=Object.create;var rn=Object.defineProperty,cl=Object.defineProperties,ll=Object.getOwnPropertyDescriptor,dl=Object.getOwnPropertyDescriptors,fl=Object.getOwnPropertyNames,nn=Object.getOwnPropertySymbols,pl=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable;var hs=(e,t,n)=>t in e?rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_t=(e,t)=>{for(var n in t||={})Fr.call(t,n)&&hs(e,n,t[n]);if(nn)for(var n of nn(t))gs.call(t,n)&&hs(e,n,t[n]);return e},xt=(e,t)=>cl(e,dl(t));var sy=(e,t)=>{var n={};for(var r in e)Fr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nn)for(var r of nn(e))t.indexOf(r)<0&&gs.call(e,r)&&(n[r]=e[r]);return n};var ay=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uy=(e,t)=>{for(var n in t)rn(e,n,{get:t[n],enumerable:!0})},hl=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fl(t))!Fr.call(e,o)&&o!==n&&rn(e,o,{get:()=>t[o],enumerable:!(r=ll(t,o))||r.enumerable});return e};var cy=(e,t,n)=>(n=e!=null?ul(pl(e)):{},hl(t||!e||!e.__esModule?rn(n,"default",{value:e,enumerable:!0}):n,e));var gl=(e,t,n)=>new Promise((r,o)=>{var i=u=>{try{a(n.next(u))}catch(c){o(c)}},s=u=>{try{a(n.throw(u))}catch(c){o(c)}},a=u=>u.done?r(u.value):Promise.resolve(u.value).then(i,s);a((n=n.apply(e,t)).next())});var ms=null;var Rr=1,ys=Symbol("SIGNAL");function E(e){let t=ms;return ms=e,t}var Ds={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function ml(e){if(!(Lr(e)&&!e.dirty)&&!(!e.dirty&&e.lastCleanEpoch===Rr)){if(!e.producerMustRecompute(e)&&!Pr(e)){e.dirty=!1,e.lastCleanEpoch=Rr;return}e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=Rr}}function vs(e){return e&&(e.nextProducerIndex=0),E(e)}function ws(e,t){if(E(t),!(!e||e.producerNode===void 0||e.producerIndexOfThis===void 0||e.producerLastReadVersion===void 0)){if(Lr(e))for(let n=e.nextProducerIndex;ne.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function Pr(e){on(e);for(let t=0;t0}function on(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function yl(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function Dl(){throw new Error}var vl=Dl;function Es(e){vl=e}function w(e){return typeof e=="function"}function rt(e){let n=e(r=>{Error.call(r),r.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var sn=rt(e=>function(n){e(this),this.message=n?`${n.length} errors occurred during unsubscription: +${n.map((r,o)=>`${o+1}) ${r.toString()}`).join(` + `)}`:"",this.name="UnsubscriptionError",this.errors=n});function Se(e,t){if(e){let n=e.indexOf(t);0<=n&&e.splice(n,1)}}var R=class e{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let i of n)i.remove(this);else n.remove(this);let{initialTeardown:r}=this;if(w(r))try{r()}catch(i){t=i instanceof sn?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{Cs(i)}catch(s){t=t??[],s instanceof sn?t=[...t,...s.errors]:t.push(s)}}if(t)throw new sn(t)}}add(t){var n;if(t&&t!==this)if(this.closed)Cs(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}}_hasParent(t){let{_parentage:n}=this;return n===t||Array.isArray(n)&&n.includes(t)}_addParent(t){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t}_removeParent(t){let{_parentage:n}=this;n===t?this._parentage=null:Array.isArray(n)&&Se(n,t)}remove(t){let{_finalizers:n}=this;n&&Se(n,t),t instanceof e&&t._removeParent(this)}};R.EMPTY=(()=>{let e=new R;return e.closed=!0,e})();var jr=R.EMPTY;function an(e){return e instanceof R||e&&"closed"in e&&w(e.remove)&&w(e.add)&&w(e.unsubscribe)}function Cs(e){w(e)?e():e.unsubscribe()}var ne={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var ot={setTimeout(e,t,...n){let{delegate:r}=ot;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){let{delegate:t}=ot;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function un(e){ot.setTimeout(()=>{let{onUnhandledError:t}=ne;if(t)t(e);else throw e})}function Ne(){}var bs=Vr("C",void 0,void 0);function Ms(e){return Vr("E",void 0,e)}function _s(e){return Vr("N",e,void 0)}function Vr(e,t,n){return{kind:e,value:t,error:n}}var Ae=null;function it(e){if(ne.useDeprecatedSynchronousErrorHandling){let t=!Ae;if(t&&(Ae={errorThrown:!1,error:null}),e(),t){let{errorThrown:n,error:r}=Ae;if(Ae=null,n)throw r}}else e()}function xs(e){ne.useDeprecatedSynchronousErrorHandling&&Ae&&(Ae.errorThrown=!0,Ae.error=e)}var Oe=class extends R{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,an(t)&&t.add(this)):this.destination=El}static create(t,n,r){return new ge(t,n,r)}next(t){this.isStopped?$r(_s(t),this):this._next(t)}error(t){this.isStopped?$r(Ms(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?$r(bs,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()}}},wl=Function.prototype.bind;function Br(e,t){return wl.call(e,t)}var Hr=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:n}=this;if(n.next)try{n.next(t)}catch(r){cn(r)}}error(t){let{partialObserver:n}=this;if(n.error)try{n.error(t)}catch(r){cn(r)}else cn(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(n){cn(n)}}},ge=class extends Oe{constructor(t,n,r){super();let o;if(w(t)||!t)o={next:t??void 0,error:n??void 0,complete:r??void 0};else{let i;this&&ne.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),o={next:t.next&&Br(t.next,i),error:t.error&&Br(t.error,i),complete:t.complete&&Br(t.complete,i)}):o=t}this.destination=new Hr(o)}};function cn(e){ne.useDeprecatedSynchronousErrorHandling?xs(e):un(e)}function Il(e){throw e}function $r(e,t){let{onStoppedNotification:n}=ne;n&&ot.setTimeout(()=>n(e,t))}var El={closed:!0,next:Ne,error:Il,complete:Ne};var st=typeof Symbol=="function"&&Symbol.observable||"@@observable";function k(e){return e}function Ur(...e){return Gr(e)}function Gr(e){return e.length===0?k:e.length===1?e[0]:function(n){return e.reduce((r,o)=>o(r),n)}}var x=(()=>{class e{constructor(n){n&&(this._subscribe=n)}lift(n){let r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,o){let i=bl(n)?n:new ge(n,r,o);return it(()=>{let{operator:s,source:a}=this;i.add(s?s.call(i,a):a?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return r=Ts(r),new r((o,i)=>{let s=new ge({next:a=>{try{n(a)}catch(u){i(u),s.unsubscribe()}},error:i,complete:o});this.subscribe(s)})}_subscribe(n){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(n)}[st](){return this}pipe(...n){return Gr(n)(this)}toPromise(n){return n=Ts(n),new n((r,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>r(i))})}}return e.create=t=>new e(t),e})();function Ts(e){var t;return(t=e??ne.Promise)!==null&&t!==void 0?t:Promise}function Cl(e){return e&&w(e.next)&&w(e.error)&&w(e.complete)}function bl(e){return e&&e instanceof Oe||Cl(e)&&an(e)}function Wr(e){return w(e?.lift)}function g(e){return t=>{if(Wr(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function D(e,t,n,r,o){return new zr(e,t,n,r,o)}var zr=class extends Oe{constructor(t,n,r,o,i,s){super(t),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(u){t.error(u)}}:super._next,this._error=o?function(a){try{o(a)}catch(u){t.error(u)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){t.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}}};function qr(){return g((e,t)=>{let n=null;e._refCount++;let r=D(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount){n=null;return}let o=e._connection,i=n;n=null,o&&(!i||o===i)&&o.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}var Yr=class extends x{constructor(t,n){super(),this.source=t,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,Wr(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){let t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new R;let n=this.getSubject();t.add(this.source.subscribe(D(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),t.closed&&(this._connection=null,t=R.EMPTY)}return t}refCount(){return qr()(this)}};var Ss=rt(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Z=(()=>{class e extends x{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){let r=new ln(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new Ss}next(n){it(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(n)}})}error(n){it(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;let{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){it(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){let{hasError:r,isStopped:o,observers:i}=this;return r||o?jr:(this.currentObservers=null,i.push(n),new R(()=>{this.currentObservers=null,Se(i,n)}))}_checkFinalizedStatuses(n){let{hasError:r,thrownError:o,isStopped:i}=this;r?n.error(o):i&&n.complete()}asObservable(){let n=new x;return n.source=this,n}}return e.create=(t,n)=>new ln(t,n),e})(),ln=class extends Z{constructor(t,n){super(),this.destination=t,this.source=n}next(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,t)}error(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,t)}complete(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)}_subscribe(t){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&r!==void 0?r:jr}};var Tt=class extends Z{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){let n=super._subscribe(t);return!n.closed&&t.next(this._value),n}getValue(){let{hasError:t,thrownError:n,_value:r}=this;if(t)throw n;return this._throwIfClosed(),r}next(t){super.next(this._value=t)}};var St={now(){return(St.delegate||Date).now()},delegate:void 0};var Nt=class extends Z{constructor(t=1/0,n=1/0,r=St){super(),this._bufferSize=t,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,n)}next(t){let{isStopped:n,_buffer:r,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;n||(r.push(t),!o&&r.push(i.now()+s)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();let n=this._innerSubscribe(t),{_infiniteTimeWindow:r,_buffer:o}=this,i=o.slice();for(let s=0;se.complete());function hn(e){return e&&w(e.schedule)}function Qr(e){return e[e.length-1]}function ut(e){return w(Qr(e))?e.pop():void 0}function K(e){return hn(Qr(e))?e.pop():void 0}function gn(e,t){return typeof Qr(e)=="number"?e.pop():t}function Os(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(l){try{c(r.next(l))}catch(d){s(d)}}function u(l){try{c(r.throw(l))}catch(d){s(d)}}function c(l){l.done?i(l.value):o(l.value).then(a,u)}c((r=r.apply(e,t||[])).next())})}function As(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pe(e){return this instanceof Pe?(this.v=e,this):new Pe(e)}function Fs(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),o,i=[];return o={},a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(f){return function(h){return Promise.resolve(h).then(f,d)}}function a(f,h){r[f]&&(o[f]=function(y){return new Promise(function(T,M){i.push([f,y,T,M])>1||u(f,y)})},h&&(o[f]=h(o[f])))}function u(f,h){try{c(r[f](h))}catch(y){p(i[0][3],y)}}function c(f){f.value instanceof Pe?Promise.resolve(f.value.v).then(l,d):p(i[0][2],f)}function l(f){u("next",f)}function d(f){u("throw",f)}function p(f,h){f(h),i.shift(),i.length&&u(i[0][0],i[0][1])}}function Rs(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof As=="function"?As(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(s){return new Promise(function(a,u){s=e[i](s),o(a,u,s.done,s.value)})}}function o(i,s,a,u){Promise.resolve(u).then(function(c){i({value:c,done:a})},s)}}var mn=e=>e&&typeof e.length=="number"&&typeof e!="function";function yn(e){return w(e?.then)}function Dn(e){return w(e[st])}function vn(e){return Symbol.asyncIterator&&w(e?.[Symbol.asyncIterator])}function wn(e){return new TypeError(`You provided ${e!==null&&typeof e=="object"?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Ml(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var In=Ml();function En(e){return w(e?.[In])}function Cn(e){return Fs(this,arguments,function*(){let n=e.getReader();try{for(;;){let{value:r,done:o}=yield Pe(n.read());if(o)return yield Pe(void 0);yield yield Pe(r)}}finally{n.releaseLock()}})}function bn(e){return w(e?.getReader)}function N(e){if(e instanceof x)return e;if(e!=null){if(Dn(e))return _l(e);if(mn(e))return xl(e);if(yn(e))return Tl(e);if(vn(e))return Ps(e);if(En(e))return Sl(e);if(bn(e))return Nl(e)}throw wn(e)}function _l(e){return new x(t=>{let n=e[st]();if(w(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function xl(e){return new x(t=>{for(let n=0;n{e.then(n=>{t.closed||(t.next(n),t.complete())},n=>t.error(n)).then(null,un)})}function Sl(e){return new x(t=>{for(let n of e)if(t.next(n),t.closed)return;t.complete()})}function Ps(e){return new x(t=>{Al(e,t).catch(n=>t.error(n))})}function Nl(e){return Ps(Cn(e))}function Al(e,t){var n,r,o,i;return Os(this,void 0,void 0,function*(){try{for(n=Rs(e);r=yield n.next(),!r.done;){let s=r.value;if(t.next(s),t.closed)return}}catch(s){o={error:s}}finally{try{r&&!r.done&&(i=n.return)&&(yield i.call(n))}finally{if(o)throw o.error}}t.complete()})}function W(e,t,n,r=0,o=!1){let i=t.schedule(function(){n(),o?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(i),!o)return i}function Mn(e,t=0){return g((n,r)=>{n.subscribe(D(r,o=>W(r,e,()=>r.next(o),t),()=>W(r,e,()=>r.complete(),t),o=>W(r,e,()=>r.error(o),t)))})}function _n(e,t=0){return g((n,r)=>{r.add(e.schedule(()=>n.subscribe(r),t))})}function ks(e,t){return N(e).pipe(_n(t),Mn(t))}function Ls(e,t){return N(e).pipe(_n(t),Mn(t))}function js(e,t){return new x(n=>{let r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Vs(e,t){return new x(n=>{let r;return W(n,t,()=>{r=e[In](),W(n,t,()=>{let o,i;try{({value:o,done:i}=r.next())}catch(s){n.error(s);return}i?n.complete():n.next(o)},0,!0)}),()=>w(r?.return)&&r.return()})}function xn(e,t){if(!e)throw new Error("Iterable cannot be null");return new x(n=>{W(n,t,()=>{let r=e[Symbol.asyncIterator]();W(n,t,()=>{r.next().then(o=>{o.done?n.complete():n.next(o.value)})},0,!0)})})}function Bs(e,t){return xn(Cn(e),t)}function $s(e,t){if(e!=null){if(Dn(e))return ks(e,t);if(mn(e))return js(e,t);if(yn(e))return Ls(e,t);if(vn(e))return xn(e,t);if(En(e))return Vs(e,t);if(bn(e))return Bs(e,t)}throw wn(e)}function J(e,t){return t?$s(e,t):N(e)}function Ol(...e){let t=K(e);return J(e,t)}function Fl(e,t){let n=w(e)?e:()=>e,r=o=>o.error(n());return new x(t?o=>t.schedule(r,0,o):r)}function Rl(e){return!!e&&(e instanceof x||w(e.lift)&&w(e.subscribe))}var ke=rt(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function Hs(e){return e instanceof Date&&!isNaN(e)}function ce(e,t){return g((n,r)=>{let o=0;n.subscribe(D(r,i=>{r.next(e.call(t,i,o++))}))})}var{isArray:Pl}=Array;function kl(e,t){return Pl(t)?e(...t):e(t)}function Tn(e){return ce(t=>kl(e,t))}var{isArray:Ll}=Array,{getPrototypeOf:jl,prototype:Vl,keys:Bl}=Object;function Us(e){if(e.length===1){let t=e[0];if(Ll(t))return{args:t,keys:null};if($l(t)){let n=Bl(t);return{args:n.map(r=>t[r]),keys:n}}}return{args:e,keys:null}}function $l(e){return e&&typeof e=="object"&&jl(e)===Vl}function Gs(e,t){return e.reduce((n,r,o)=>(n[r]=t[o],n),{})}function Hl(...e){let t=K(e),n=ut(e),{args:r,keys:o}=Us(e);if(r.length===0)return J([],t);let i=new x(Zr(r,t,o?s=>Gs(o,s):k));return n?i.pipe(Tn(n)):i}function Zr(e,t,n=k){return r=>{Ws(t,()=>{let{length:o}=e,i=new Array(o),s=o,a=o;for(let u=0;u{let c=J(e[u],t),l=!1;c.subscribe(D(r,d=>{i[u]=d,l||(l=!0,a--),a||r.next(n(i.slice()))},()=>{--s||r.complete()}))},r)},r)}}function Ws(e,t,n){e?W(n,e,t):t()}function zs(e,t,n,r,o,i,s,a){let u=[],c=0,l=0,d=!1,p=()=>{d&&!u.length&&!c&&t.complete()},f=y=>c{i&&t.next(y),c++;let T=!1;N(n(y,l++)).subscribe(D(t,M=>{o?.(M),i?f(M):t.next(M)},()=>{T=!0},void 0,()=>{if(T)try{for(c--;u.length&&ch(M)):h(M)}p()}catch(M){t.error(M)}}))};return e.subscribe(D(t,f,()=>{d=!0,p()})),()=>{a?.()}}function Le(e,t,n=1/0){return w(t)?Le((r,o)=>ce((i,s)=>t(r,i,o,s))(N(e(r,o))),n):(typeof t=="number"&&(n=t),g((r,o)=>zs(r,o,e,n)))}function je(e=1/0){return Le(k,e)}function qs(){return je(1)}function Sn(...e){return qs()(J(e,K(e)))}function Ul(e){return new x(t=>{N(e()).subscribe(t)})}function Nn(e=0,t,n=Ns){let r=-1;return t!=null&&(hn(t)?n=t:r=t),new x(o=>{let i=Hs(e)?+e-n.now():e;i<0&&(i=0);let s=0;return n.schedule(function(){o.closed||(o.next(s++),0<=r?this.schedule(void 0,r):o.complete())},i)})}function Gl(e=0,t=Fe){return e<0&&(e=0),Nn(e,e,t)}function Wl(...e){let t=K(e),n=gn(e,1/0),r=e;return r.length?r.length===1?N(r[0]):je(n)(J(r,t)):Re}var{isArray:zl}=Array;function An(e){return e.length===1&&zl(e[0])?e[0]:e}function we(e,t){return g((n,r)=>{let o=0;n.subscribe(D(r,i=>e.call(t,i,o++)&&r.next(i)))})}function Ys(e){return g((t,n)=>{let r=null,o=!1,i;r=t.subscribe(D(n,void 0,void 0,s=>{i=N(e(s,Ys(e)(t))),r?(r.unsubscribe(),r=null,i.subscribe(n)):o=!0})),o&&(r.unsubscribe(),r=null,i.subscribe(n))})}function Qs(e,t,n,r,o){return(i,s)=>{let a=n,u=t,c=0;i.subscribe(D(s,l=>{let d=c++;u=a?e(u,l,d):(a=!0,l),r&&s.next(u)},o&&(()=>{a&&s.next(u),s.complete()})))}}function Kr(...e){let t=ut(e);return t?Ur(Kr(...e),Tn(t)):g((n,r)=>{Zr([n,...An(e)])(r)})}function ql(...e){return Kr(...e)}function Yl(e,t){return w(t)?Le(e,t,1):Le(e,1)}function Ql(e,t=Fe){return g((n,r)=>{let o=null,i=null,s=null,a=()=>{if(o){o.unsubscribe(),o=null;let c=i;i=null,r.next(c)}};function u(){let c=s+e,l=t.now();if(l{i=c,s=t.now(),o||(o=t.schedule(u,e),r.add(o))},()=>{a(),r.complete()},void 0,()=>{i=o=null}))})}function Ot(e){return g((t,n)=>{let r=!1;t.subscribe(D(n,o=>{r=!0,n.next(o)},()=>{r||n.next(e),n.complete()}))})}function Jr(e){return e<=0?()=>Re:g((t,n)=>{let r=0;t.subscribe(D(n,o=>{++r<=e&&(n.next(o),e<=r&&n.complete())}))})}function Zl(e){return ce(()=>e)}function Kl(e,t=k){return e=e??Jl,g((n,r)=>{let o,i=!0;n.subscribe(D(r,s=>{let a=t(s);(i||!e(o,a))&&(i=!1,o=a,r.next(s))}))})}function Jl(e,t){return e===t}function On(e=Xl){return g((t,n)=>{let r=!1;t.subscribe(D(n,o=>{r=!0,n.next(o)},()=>r?n.complete():n.error(e())))})}function Xl(){return new ke}function ed(e){return g((t,n)=>{try{t.subscribe(n)}finally{n.add(e)}})}function Zs(e,t){let n=arguments.length>=2;return r=>r.pipe(e?we((o,i)=>e(o,i,r)):k,Jr(1),n?Ot(t):On(()=>new ke))}function Xr(e){return e<=0?()=>Re:g((t,n)=>{let r=[];t.subscribe(D(n,o=>{r.push(o),e{for(let o of r)n.next(o);n.complete()},void 0,()=>{r=null}))})}function td(e,t){let n=arguments.length>=2;return r=>r.pipe(e?we((o,i)=>e(o,i,r)):k,Xr(1),n?Ot(t):On(()=>new ke))}function Ks(...e){let t=K(e),n=gn(e,1/0);return e=An(e),g((r,o)=>{je(n)(J([r,...e],t)).subscribe(o)})}function nd(...e){return Ks(...e)}function rd(e,t){return g(Qs(e,t,arguments.length>=2,!0))}function Js(e={}){let{connector:t=()=>new Z,resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:o=!0}=e;return i=>{let s,a,u,c=0,l=!1,d=!1,p=()=>{a?.unsubscribe(),a=void 0},f=()=>{p(),s=u=void 0,l=d=!1},h=()=>{let y=s;f(),y?.unsubscribe()};return g((y,T)=>{c++,!d&&!l&&p();let M=u=u??t();T.add(()=>{c--,c===0&&!d&&!l&&(a=eo(h,o))}),M.subscribe(T),!s&&c>0&&(s=new ge({next:Q=>M.next(Q),error:Q=>{d=!0,p(),a=eo(f,n,Q),M.error(Q)},complete:()=>{l=!0,p(),a=eo(f,r),M.complete()}}),N(y).subscribe(s))})(i)}}function eo(e,t,...n){if(t===!0){e();return}if(t===!1)return;let r=new ge({next:()=>{r.unsubscribe(),e()}});return N(t(...n)).subscribe(r)}function od(e,t,n){let r,o=!1;return e&&typeof e=="object"?{bufferSize:r=1/0,windowTime:t=1/0,refCount:o=!1,scheduler:n}=e:r=e??1/0,Js({connector:()=>new Nt(r,t,n),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function id(e){return we((t,n)=>e<=n)}function Xs(...e){let t=K(e);return g((n,r)=>{(t?Sn(e,n,t):Sn(e,n)).subscribe(r)})}function ea(e,t){return g((n,r)=>{let o=null,i=0,s=!1,a=()=>s&&!o&&r.complete();n.subscribe(D(r,u=>{o?.unsubscribe();let c=0,l=i++;N(e(u,l)).subscribe(o=D(r,d=>r.next(t?t(u,d,l,c++):d),()=>{o=null,a()}))},()=>{s=!0,a()}))})}function sd(e){return g((t,n)=>{N(e).subscribe(D(n,()=>n.complete(),Ne)),!n.closed&&t.subscribe(n)})}function ta(e,t,n){let r=w(e)||t||n?{next:e,error:t,complete:n}:e;return r?g((o,i)=>{var s;(s=r.subscribe)===null||s===void 0||s.call(r);let a=!0;o.subscribe(D(i,u=>{var c;(c=r.next)===null||c===void 0||c.call(r,u),i.next(u)},()=>{var u;a=!1,(u=r.complete)===null||u===void 0||u.call(r),i.complete()},u=>{var c;a=!1,(c=r.error)===null||c===void 0||c.call(r,u),i.error(u)},()=>{var u,c;a&&((u=r.unsubscribe)===null||u===void 0||u.call(r)),(c=r.finalize)===null||c===void 0||c.call(r)}))}):k}function na(e,t){return g((n,r)=>{let{leading:o=!0,trailing:i=!1}=t??{},s=!1,a=null,u=null,c=!1,l=()=>{u?.unsubscribe(),u=null,i&&(f(),c&&r.complete())},d=()=>{u=null,c&&r.complete()},p=h=>u=N(e(h)).subscribe(D(r,l,d)),f=()=>{if(s){s=!1;let h=a;a=null,r.next(h),!c&&p(h)}};n.subscribe(D(r,h=>{s=!0,a=h,!(u&&!u.closed)&&(o?f():p(h))},()=>{c=!0,!(i&&s&&u&&!u.closed)&&r.complete()}))})}function ra(e,t=Fe,n){let r=Nn(e,t);return na(()=>r,n)}function ad(...e){let t=ut(e);return g((n,r)=>{let o=e.length,i=new Array(o),s=e.map(()=>!1),a=!1;for(let u=0;u{i[u]=c,!a&&!s[u]&&(s[u]=!0,(a=s.every(k))&&(s=null))},Ne));n.subscribe(D(r,u=>{if(a){let c=[u,...i];r.next(t?t(...c):c)}}))})}var Ba="https://g.co/ng/security#xss",_=class extends Error{constructor(t,n){super($a(t,n)),this.code=t}};function $a(e,t){return`${`NG0${Math.abs(e)}`}${t?": "+t:""}`}function Yt(e){return{toString:e}.toString()}var Fn="__parameters__";function ud(e){return function(...n){if(e){let r=e(...n);for(let o in r)this[o]=r[o]}}}function Ha(e,t,n){return Yt(()=>{let r=ud(t);function o(...i){if(this instanceof o)return r.apply(this,i),this;let s=new o(...i);return a.annotation=s,a;function a(u,c,l){let d=u.hasOwnProperty(Fn)?u[Fn]:Object.defineProperty(u,Fn,{value:[]})[Fn];for(;d.length<=l;)d.push(null);return(d[l]=d[l]||[]).push(s),u}}return n&&(o.prototype=Object.create(n.prototype)),o.prototype.ngMetadataName=e,o.annotationCls=o,o})}var pt=globalThis;function A(e){for(let t in e)if(e[t]===A)return t;throw Error("Could not find renamed property on target object.")}function q(e){if(typeof e=="string")return e;if(Array.isArray(e))return"["+e.map(q).join(", ")+"]";if(e==null)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;let t=e.toString();if(t==null)return""+t;let n=t.indexOf(` +`);return n===-1?t:t.substring(0,n)}function oa(e,t){return e==null||e===""?t===null?"":t:t==null||t===""?e:e+" "+t}var cd=A({__forward_ref__:A});function Ua(e){return e.__forward_ref__=Ua,e.toString=function(){return q(this())},e}function H(e){return Ga(e)?e():e}function Ga(e){return typeof e=="function"&&e.hasOwnProperty(cd)&&e.__forward_ref__===Ua}function F(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Wa(e){return{providers:e.providers||[],imports:e.imports||[]}}function dr(e){return ia(e,za)||ia(e,qa)}function Ub(e){return dr(e)!==null}function ia(e,t){return e.hasOwnProperty(t)?e[t]:null}function ld(e){let t=e&&(e[za]||e[qa]);return t||null}function sa(e){return e&&(e.hasOwnProperty(aa)||e.hasOwnProperty(dd))?e[aa]:null}var za=A({\u0275prov:A}),aa=A({\u0275inj:A}),qa=A({ngInjectableDef:A}),dd=A({ngInjectorDef:A}),O=class{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,typeof n=="number"?this.__NG_ELEMENT_ID__=n:n!==void 0&&(this.\u0275prov=F({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Ya(e){return e&&!!e.\u0275providers}var fd=A({\u0275cmp:A}),pd=A({\u0275dir:A}),hd=A({\u0275pipe:A}),gd=A({\u0275mod:A}),Hn=A({\u0275fac:A}),Ft=A({__NG_ELEMENT_ID__:A}),ua=A({__NG_ENV_ID__:A});function fr(e){return typeof e=="string"?e:e==null?"":String(e)}function md(e){return typeof e=="function"?e.name||e.toString():typeof e=="object"&&e!=null&&typeof e.type=="function"?e.type.name||e.type.toString():fr(e)}function yd(e,t){let n=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new _(-200,e)}function Di(e,t){throw new _(-201,!1)}var C=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}(C||{}),Do;function Qa(){return Do}function z(e){let t=Do;return Do=e,t}function Za(e,t,n){let r=dr(e);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(n&C.Optional)return null;if(t!==void 0)return t;Di(e,"Injector")}var Dd={},Rt=Dd,vo="__NG_DI_FLAG__",Un="ngTempTokenPath",vd="ngTokenPath",wd=/\n/gm,Id="\u0275",ca="__source",ht;function Ed(){return ht}function Ie(e){let t=ht;return ht=e,t}function Cd(e,t=C.Default){if(ht===void 0)throw new _(-203,!1);return ht===null?Za(e,void 0,t):ht.get(e,t&C.Optional?null:void 0,t)}function $(e,t=C.Default){return(Qa()||Cd)(H(e),t)}function S(e,t=C.Default){return $(e,pr(t))}function pr(e){return typeof e>"u"||typeof e=="number"?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function wo(e){let t=[];for(let n=0;n ");else if(typeof t=="object"){let i=[];for(let s in t)if(t.hasOwnProperty(s)){let a=t[s];i.push(s+":"+(typeof a=="string"?JSON.stringify(a):q(a)))}o=`{${i.join(", ")}}`}return`${n}${r?"("+r+")":""}[${o}]: ${e.replace(wd,` + `)}`}var xd=Ka(Ha("Optional"),8);var Td=Ka(Ha("SkipSelf"),4);function He(e,t){let n=e.hasOwnProperty(Hn);return n?e[Hn]:null}function Sd(e,t,n){if(e.length!==t.length)return!1;for(let r=0;rArray.isArray(n)?vi(n,t):t(n))}function Ja(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Gn(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Ad(e,t,n,r){let o=e.length;if(o==t)e.push(n,r);else if(o===1)e.push(r,e[0]),e[0]=n;else{for(o--,e.push(e[o-1],e[o]);o>t;){let i=o-2;e[o]=e[i],o--}e[t]=n,e[t+1]=r}}function Od(e,t,n){let r=Qt(e,t);return r>=0?e[r|1]=n:(r=~r,Ad(e,r,t,n)),r}function to(e,t){let n=Qt(e,t);if(n>=0)return e[n|1]}function Qt(e,t){return Fd(e,t,1)}function Fd(e,t,n){let r=0,o=e.length>>n;for(;o!==r;){let i=r+(o-r>>1),s=e[i<t?o=i:r=i+1}return~(o<t){s=i-1;break}}}for(;i-1){let i;for(;++oi?d="":d=o[l+1].toLowerCase(),r&2&&c!==d){if(re(r))return!1;s=!0}}}}return re(r)||s}function re(e){return(e&1)===0}function Vd(e,t,n,r){if(t===null)return-1;let o=0;if(r||!n){let i=!1;for(;o-1)for(n++;n0?'="'+a+'"':"")+"]"}else r&8?o+="."+s:r&4&&(o+=" "+s);else o!==""&&!re(s)&&(t+=da(i,o),o=""),r=s,i=i||!re(r);n++}return o!==""&&(t+=da(i,o)),t}function Gd(e){return e.map(Ud).join(",")}function Wd(e){let t=[],n=[],r=1,o=2;for(;r{let t=cu(e),n=xt(_t({},t),{decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===tu.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||kt.Emulated,styles:e.styles||oe,_:null,schemas:e.schemas||null,tView:null,id:""});lu(n);let r=e.dependencies;return n.directiveDefs=pa(r,!1),n.pipeDefs=pa(r,!0),n.id=Qd(n),n})}function zd(e){return Ce(e)||su(e)}function qd(e){return e!==null}function ou(e){return Yt(()=>({type:e.type,bootstrap:e.bootstrap||oe,declarations:e.declarations||oe,imports:e.imports||oe,exports:e.exports||oe,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function fa(e,t){if(e==null)return Pt;let n={};for(let r in e)if(e.hasOwnProperty(r)){let o=e[r],i,s,a=Ue.None;Array.isArray(o)?(a=o[0],i=o[1],s=o[2]??i):(i=o,s=o),t?(n[i]=a!==Ue.None?[r,a]:r,t[i]=s):n[i]=r}return n}function iu(e){return Yt(()=>{let t=cu(e);return lu(t),t})}function hr(e){return{type:e.type,name:e.name,factory:null,pure:e.pure!==!1,standalone:e.standalone===!0,onDestroy:e.type.prototype.ngOnDestroy||null}}function Ce(e){return e[fd]||null}function su(e){return e[pd]||null}function au(e){return e[hd]||null}function Yd(e){let t=Ce(e)||su(e)||au(e);return t!==null?t.standalone:!1}function uu(e,t){let n=e[gd]||null;if(!n&&t===!0)throw new Error(`Type ${q(e)} does not have '\u0275mod' property.`);return n}function cu(e){let 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||Pt,exportAs:e.exportAs||null,standalone:e.standalone===!0,signals:e.signals===!0,selectors:e.selectors||oe,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:fa(e.inputs,t),outputs:fa(e.outputs),debugInfo:null}}function lu(e){e.features?.forEach(t=>t(e))}function pa(e,t){if(!e)return null;let n=t?au:zd;return()=>(typeof e=="function"?e():e).map(r=>n(r)).filter(qd)}function Qd(e){let t=0,n=[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(let o of n)t=Math.imul(31,t)+o.charCodeAt(0)<<0;return t+=2147483648,"c"+t}function Zd(e){return{\u0275providers:e}}function Kd(...e){return{\u0275providers:du(!0,e),\u0275fromNgModule:!0}}function du(e,...t){let n=[],r=new Set,o,i=s=>{n.push(s)};return vi(t,s=>{let a=s;Eo(a,i,[],r)&&(o||=[],o.push(a))}),o!==void 0&&fu(o,i),n}function fu(e,t){for(let n=0;n{t(i,r)})}}function Eo(e,t,n,r){if(e=H(e),!e)return!1;let o=null,i=sa(e),s=!i&&Ce(e);if(!i&&!s){let u=e.ngModule;if(i=sa(u),i)o=u;else return!1}else{if(s&&!s.standalone)return!1;o=e}let a=r.has(o);if(s){if(a)return!1;if(r.add(o),s.dependencies){let u=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let c of u)Eo(c,t,n,r)}}else if(i){if(i.imports!=null&&!a){r.add(o);let c;try{vi(i.imports,l=>{Eo(l,t,n,r)&&(c||=[],c.push(l))})}finally{}c!==void 0&&fu(c,t)}if(!a){let c=He(o)||(()=>new o);t({provide:o,useFactory:c,deps:oe},o),t({provide:eu,useValue:o,multi:!0},o),t({provide:Wn,useValue:()=>$(o),multi:!0},o)}let u=i.providers;if(u!=null&&!a){let c=e;Ei(u,l=>{t(l,c)})}}else return!1;return o!==e&&e.providers!==void 0}function Ei(e,t){for(let n of e)Ya(n)&&(n=n.\u0275providers),Array.isArray(n)?Ei(n,t):t(n)}var Jd=A({provide:String,useValue:A});function pu(e){return e!==null&&typeof e=="object"&&Jd in e}function Xd(e){return!!(e&&e.useExisting)}function ef(e){return!!(e&&e.useFactory)}function mt(e){return typeof e=="function"}function tf(e){return!!e.useClass}var hu=new O(""),kn={},nf={},no;function Ci(){return no===void 0&&(no=new zn),no}var be=class{},Lt=class extends be{get destroyed(){return this._destroyed}constructor(t,n,r,o){super(),this.parent=n,this.source=r,this.scopes=o,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,bo(t,s=>this.processProvider(s)),this.records.set(Xa,ct(void 0,this)),o.has("environment")&&this.records.set(be,ct(void 0,this));let i=this.records.get(hu);i!=null&&typeof i.value=="string"&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(eu,oe,C.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;let t=E(null);try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),E(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();let n=Ie(this),r=z(void 0),o;try{return t()}finally{Ie(n),z(r)}}get(t,n=Rt,r=C.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(ua))return t[ua](this);r=pr(r);let o,i=Ie(this),s=z(void 0);try{if(!(r&C.SkipSelf)){let u=this.records.get(t);if(u===void 0){let c=uf(t)&&dr(t);c&&this.injectableDefInScope(c)?u=ct(Co(t),kn):u=null,this.records.set(t,u)}if(u!=null)return this.hydrate(t,u)}let a=r&C.Self?Ci():this.parent;return n=r&C.Optional&&n===Rt?null:n,a.get(t,n)}catch(a){if(a.name==="NullInjectorError"){if((a[Un]=a[Un]||[]).unshift(q(t)),i)throw a;return Md(a,t,"R3InjectorError",this.source)}else throw a}finally{z(s),Ie(i)}}resolveInjectorInitializers(){let t=E(null),n=Ie(this),r=z(void 0),o;try{let i=this.get(Wn,oe,C.Self);for(let s of i)s()}finally{Ie(n),z(r),E(t)}}toString(){let t=[],n=this.records;for(let r of n.keys())t.push(q(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new _(205,!1)}processProvider(t){t=H(t);let n=mt(t)?t:H(t&&t.provide),r=of(t);if(!mt(t)&&t.multi===!0){let o=this.records.get(n);o||(o=ct(void 0,kn,!0),o.factory=()=>wo(o.multi),this.records.set(n,o)),n=t,o.multi.push(t)}this.records.set(n,r)}hydrate(t,n){let r=E(null);try{return n.value===kn&&(n.value=nf,n.value=n.factory()),typeof n.value=="object"&&n.value&&af(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{E(r)}}injectableDefInScope(t){if(!t.providedIn)return!1;let n=H(t.providedIn);return typeof n=="string"?n==="any"||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(t){let n=this._onDestroyHooks.indexOf(t);n!==-1&&this._onDestroyHooks.splice(n,1)}};function Co(e){let t=dr(e),n=t!==null?t.factory:He(e);if(n!==null)return n;if(e instanceof O)throw new _(204,!1);if(e instanceof Function)return rf(e);throw new _(204,!1)}function rf(e){if(e.length>0)throw new _(204,!1);let n=ld(e);return n!==null?()=>n.factory(e):()=>new e}function of(e){if(pu(e))return ct(void 0,e.useValue);{let t=gu(e);return ct(t,kn)}}function gu(e,t,n){let r;if(mt(e)){let o=H(e);return He(o)||Co(o)}else if(pu(e))r=()=>H(e.useValue);else if(ef(e))r=()=>e.useFactory(...wo(e.deps||[]));else if(Xd(e))r=()=>$(H(e.useExisting));else{let o=H(e&&(e.useClass||e.provide));if(sf(e))r=()=>new o(...wo(e.deps));else return He(o)||Co(o)}return r}function ct(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function sf(e){return!!e.deps}function af(e){return e!==null&&typeof e=="object"&&typeof e.ngOnDestroy=="function"}function uf(e){return typeof e=="function"||typeof e=="object"&&e instanceof O}function bo(e,t){for(let n of e)Array.isArray(n)?bo(n,t):n&&Ya(n)?bo(n.\u0275providers,t):t(n)}function cf(e,t){e instanceof Lt&&e.assertNotDestroyed();let n,r=Ie(e),o=z(void 0);try{return t()}finally{Ie(r),z(o)}}function mu(){return Qa()!==void 0||Ed()!=null}function lf(e){if(!mu())throw new _(-203,!1)}function df(e){return typeof e=="function"}var ye=0,v=1,m=2,L=3,ie=4,ue=5,jt=6,Vt=7,V=8,yt=9,se=10,P=11,Bt=12,ha=13,Et=14,ae=15,Zt=16,lt=17,me=18,gr=19,yu=20,Ee=21,ro=22,Ge=23,Y=25,Du=1;var We=7,qn=8,Dt=9,B=10,bi=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(bi||{});function Be(e){return Array.isArray(e)&&typeof e[Du]=="object"}function De(e){return Array.isArray(e)&&e[Du]===!0}function Mi(e){return(e.flags&4)!==0}function mr(e){return e.componentOffset>-1}function yr(e){return(e.flags&1)===1}function Ct(e){return!!e.template}function ff(e){return(e[m]&512)!==0}var Mo=class{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}};function vu(e,t,n,r){t!==null?t.applyValueToInputSignal(t,r):e[n]=r}function _i(){return wu}function wu(e){return e.type.prototype.ngOnChanges&&(e.setInput=hf),pf}_i.ngInherit=!0;function pf(){let e=Eu(this),t=e?.current;if(t){let n=e.previous;if(n===Pt)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function hf(e,t,n,r,o){let i=this.declaredInputs[r],s=Eu(e)||gf(e,{previous:Pt,current:null}),a=s.current||(s.current={}),u=s.previous,c=u[i];a[i]=new Mo(c&&c.currentValue,n,u===Pt),vu(e,t,o,n)}var Iu="__ngSimpleChanges__";function Eu(e){return e[Iu]||null}function gf(e,t){return e[Iu]=t}var ga=null;var le=function(e,t,n){ga?.(e,t,n)},mf="svg",yf="math",Df=!1;function vf(){return Df}function fe(e){for(;Array.isArray(e);)e=e[ye];return e}function Cu(e,t){return fe(t[e])}function ee(e,t){return fe(t[e.index])}function xi(e,t){return e.data[t]}function wf(e,t){return e[t]}function xe(e,t){let n=t[e];return Be(n)?n:n[ye]}function If(e){return(e[m]&4)===4}function Ti(e){return(e[m]&128)===128}function Ef(e){return De(e[L])}function vt(e,t){return t==null?null:e[t]}function bu(e){e[lt]=0}function Cf(e){e[m]&1024||(e[m]|=1024,Ti(e)&&$t(e))}function bf(e,t){for(;e>0;)t=t[Et],e--;return t}function Si(e){return!!(e[m]&9216||e[Ge]?.dirty)}function _o(e){e[se].changeDetectionScheduler?.notify(1),Si(e)?$t(e):e[m]&64&&(vf()?(e[m]|=1024,$t(e)):e[se].changeDetectionScheduler?.notify())}function $t(e){e[se].changeDetectionScheduler?.notify();let t=Ht(e);for(;t!==null&&!(t[m]&8192||(t[m]|=8192,!Ti(t)));)t=Ht(t)}function Mu(e,t){if((e[m]&256)===256)throw new _(911,!1);e[Ee]===null&&(e[Ee]=[]),e[Ee].push(t)}function Mf(e,t){if(e[Ee]===null)return;let n=e[Ee].indexOf(t);n!==-1&&e[Ee].splice(n,1)}function Ht(e){let t=e[L];return De(t)?t[L]:t}var I={lFrame:Ou(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function _f(){return I.lFrame.elementDepthCount}function xf(){I.lFrame.elementDepthCount++}function Tf(){I.lFrame.elementDepthCount--}function _u(){return I.bindingsEnabled}function Sf(){return I.skipHydrationRootTNode!==null}function Nf(e){return I.skipHydrationRootTNode===e}function Af(){I.skipHydrationRootTNode=null}function b(){return I.lFrame.lView}function j(){return I.lFrame.tView}function Wb(e){return I.lFrame.contextLView=e,e[V]}function zb(e){return I.lFrame.contextLView=null,e}function U(){let e=xu();for(;e!==null&&e.type===64;)e=e.parent;return e}function xu(){return I.lFrame.currentTNode}function Of(){let e=I.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function Je(e,t){let n=I.lFrame;n.currentTNode=e,n.isParent=t}function Ni(){return I.lFrame.isParent}function Tu(){I.lFrame.isParent=!1}function Ai(){let e=I.lFrame,t=e.bindingRootIndex;return t===-1&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Ff(e){return I.lFrame.bindingIndex=e}function Kt(){return I.lFrame.bindingIndex++}function Rf(e){let t=I.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function Pf(){return I.lFrame.inI18n}function kf(e,t){let n=I.lFrame;n.bindingIndex=n.bindingRootIndex=e,xo(t)}function Lf(){return I.lFrame.currentDirectiveIndex}function xo(e){I.lFrame.currentDirectiveIndex=e}function jf(e){let t=I.lFrame.currentDirectiveIndex;return t===-1?null:e[t]}function Su(){return I.lFrame.currentQueryIndex}function Oi(e){I.lFrame.currentQueryIndex=e}function Vf(e){let t=e[v];return t.type===2?t.declTNode:t.type===1?e[ue]:null}function Nu(e,t,n){if(n&C.SkipSelf){let o=t,i=e;for(;o=o.parent,o===null&&!(n&C.Host);)if(o=Vf(i),o===null||(i=i[Et],o.type&10))break;if(o===null)return!1;t=o,e=i}let r=I.lFrame=Au();return r.currentTNode=t,r.lView=e,!0}function Fi(e){let t=Au(),n=e[v];I.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function Au(){let e=I.lFrame,t=e===null?null:e.child;return t===null?Ou(e):t}function Ou(e){let 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 e!==null&&(e.child=t),t}function Fu(){let e=I.lFrame;return I.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var Ru=Fu;function Ri(){let e=Fu();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 Bf(e){return(I.lFrame.contextLView=bf(e,I.lFrame.contextLView))[V]}function Xe(){return I.lFrame.selectedIndex}function ze(e){I.lFrame.selectedIndex=e}function Pu(){let e=I.lFrame;return xi(e.tView,e.selectedIndex)}function $f(){return I.lFrame.currentNamespace}var ku=!0;function Dr(){return ku}function vr(e){ku=e}function Hf(e,t,n){let{ngOnChanges:r,ngOnInit:o,ngDoCheck:i}=t.type.prototype;if(r){let s=wu(t);(n.preOrderHooks??=[]).push(e,s),(n.preOrderCheckHooks??=[]).push(e,s)}o&&(n.preOrderHooks??=[]).push(0-e,o),i&&((n.preOrderHooks??=[]).push(e,i),(n.preOrderCheckHooks??=[]).push(e,i))}function wr(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[u]<0&&(e[lt]+=65536),(a>14>16&&(e[m]&3)===t&&(e[m]+=16384,ma(a,i)):ma(a,i)}var gt=-1,qe=class{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}};function Gf(e){return e instanceof qe}function Wf(e){return(e.flags&8)!==0}function zf(e){return(e.flags&16)!==0}function ju(e){return e!==gt}function Yn(e){return e&32767}function qf(e){return e>>16}function Qn(e,t){let n=qf(e),r=t;for(;n>0;)r=r[Et],n--;return r}var To=!0;function Zn(e){let t=To;return To=e,t}var Yf=256,Vu=Yf-1,Bu=5,Qf=0,de={};function Zf(e,t,n){let r;typeof n=="string"?r=n.charCodeAt(0)||0:n.hasOwnProperty(Ft)&&(r=n[Ft]),r==null&&(r=n[Ft]=Qf++);let o=r&Vu,i=1<>Bu)]|=i}function Kn(e,t){let n=$u(e,t);if(n!==-1)return n;let r=t[v];r.firstCreatePass&&(e.injectorIndex=t.length,io(r.data,e),io(t,null),io(r.blueprint,null));let o=Pi(e,t),i=e.injectorIndex;if(ju(o)){let s=Yn(o),a=Qn(o,t),u=a[v].data;for(let c=0;c<8;c++)t[i+c]=a[s+c]|u[s+c]}return t[i+8]=o,i}function io(e,t){e.push(0,0,0,0,0,0,0,0,t)}function $u(e,t){return e.injectorIndex===-1||e.parent&&e.parent.injectorIndex===e.injectorIndex||t[e.injectorIndex+8]===null?-1:e.injectorIndex}function Pi(e,t){if(e.parent&&e.parent.injectorIndex!==-1)return e.parent.injectorIndex;let n=0,r=null,o=t;for(;o!==null;){if(r=zu(o),r===null)return gt;if(n++,o=o[Et],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return gt}function So(e,t,n){Zf(e,t,n)}function Kf(e,t){if(t==="class")return e.classes;if(t==="style")return e.styles;let n=e.attrs;if(n){let r=n.length,o=0;for(;o>20,d=r?a:a+l,p=o?a+l:c;for(let f=d;f=u&&h.type===n)return f}if(o){let f=s[u];if(f&&Ct(f)&&f.type===n)return u}return null}function Ye(e,t,n,r){let o=e[n],i=t.data;if(Gf(o)){let s=o;s.resolving&&yd(md(i[n]));let a=Zn(s.canSeeViewProviders);s.resolving=!0;let u,c=s.injectImpl?z(s.injectImpl):null,l=Nu(e,r,C.Default);try{o=e[n]=s.factory(void 0,i,e,r),t.firstCreatePass&&n>=r.directiveStart&&Hf(n,i[n],t)}finally{c!==null&&z(c),Zn(a),s.resolving=!1,Ru()}}return o}function Xf(e){if(typeof e=="string")return e.charCodeAt(0)||0;let t=e.hasOwnProperty(Ft)?e[Ft]:void 0;return typeof t=="number"?t>=0?t&Vu:ep:t}function ya(e,t,n){let r=1<>Bu)]&r)}function Da(e,t){return!(e&C.Self)&&!(e&C.Host&&t)}var $e=class{constructor(t,n){this._tNode=t,this._lView=n}get(t,n,r){return Gu(this._tNode,this._lView,t,pr(r),n)}};function ep(){return new $e(U(),b())}function qb(e){return Yt(()=>{let t=e.prototype.constructor,n=t[Hn]||No(t),r=Object.prototype,o=Object.getPrototypeOf(e.prototype).constructor;for(;o&&o!==r;){let i=o[Hn]||No(o);if(i&&i!==n)return i;o=Object.getPrototypeOf(o)}return i=>new i})}function No(e){return Ga(e)?()=>{let t=No(H(e));return t&&t()}:He(e)}function tp(e,t,n,r,o){let i=e,s=t;for(;i!==null&&s!==null&&s[m]&2048&&!(s[m]&512);){let a=Wu(i,s,n,r|C.Self,de);if(a!==de)return a;let u=i.parent;if(!u){let c=s[yu];if(c){let l=c.get(n,de,r);if(l!==de)return l}u=zu(s),s=s[Et]}i=u}return o}function zu(e){let t=e[v],n=t.type;return n===2?t.declTNode:n===1?e[ue]:null}function np(e){return Kf(U(),e)}function va(e,t=null,n=null,r){let o=qu(e,t,n,r);return o.resolveInjectorInitializers(),o}function qu(e,t=null,n=null,r,o=new Set){let i=[n||oe,Kd(e)];return r=r||(typeof e=="object"?void 0:q(e)),new Lt(i,t||Ci(),r||null,o)}var Jt=(()=>{let t=class t{static create(r,o){if(Array.isArray(r))return va({name:""},o,r,"");{let i=r.name??"";return va({name:i},r.parent,r.providers,i)}}};t.THROW_IF_NOT_FOUND=Rt,t.NULL=new zn,t.\u0275prov=F({token:t,providedIn:"any",factory:()=>$(Xa)}),t.__NG_ELEMENT_ID__=-1;let e=t;return e})();var rp="ngOriginalError";function so(e){return e[rp]}var Qe=class{constructor(){this._console=console}handleError(t){let n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&so(t);for(;n&&so(n);)n=so(n);return n||null}},Yu=new O("",{providedIn:"root",factory:()=>S(Qe).handleError.bind(void 0)}),ki=(()=>{let t=class t{};t.__NG_ELEMENT_ID__=op,t.__NG_ENV_ID__=r=>r;let e=t;return e})(),Ao=class extends ki{constructor(t){super(),this._lView=t}onDestroy(t){return Mu(this._lView,t),()=>Mf(this._lView,t)}};function op(){return new Ao(b())}function ip(){return bt(U(),b())}function bt(e,t){return new Mt(ee(e,t))}var Mt=(()=>{let t=class t{constructor(r){this.nativeElement=r}};t.__NG_ELEMENT_ID__=ip;let e=t;return e})();function sp(e){return e instanceof Mt?e.nativeElement:e}var Oo=class extends Z{constructor(t=!1){super(),this.destroyRef=void 0,this.__isAsync=t,mu()&&(this.destroyRef=S(ki,{optional:!0})??void 0)}emit(t){let n=E(null);try{super.next(t)}finally{E(n)}}subscribe(t,n,r){let o=t,i=n||(()=>null),s=r;if(t&&typeof t=="object"){let u=t;o=u.next?.bind(u),i=u.error?.bind(u),s=u.complete?.bind(u)}this.__isAsync&&(i=ao(i),o&&(o=ao(o)),s&&(s=ao(s)));let a=super.subscribe({next:o,error:i,complete:s});return t instanceof R&&t.add(a),a}};function ao(e){return t=>{setTimeout(e,void 0,t)}}var Ve=Oo;function ap(){return this._results[Symbol.iterator]()}var Fo=class e{get changes(){return this._changes??=new Ve}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;let n=e.prototype;n[Symbol.iterator]||(n[Symbol.iterator]=ap)}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,n){return this._results.reduce(t,n)}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,n){this.dirty=!1;let r=Nd(t);(this._changesDetected=!Sd(this._results,r,n))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.emit(this)}onDirty(t){this._onDirty=t}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}};function Qu(e){return(e.flags&128)===128}var Zu=new Map,up=0;function cp(){return up++}function lp(e){Zu.set(e[gr],e)}function dp(e){Zu.delete(e[gr])}var wa="__ngContext__";function Me(e,t){Be(t)?(e[wa]=t[gr],lp(t)):e[wa]=t}function Ku(e){return Xu(e[Bt])}function Ju(e){return Xu(e[ie])}function Xu(e){for(;e!==null&&!De(e);)e=e[ie];return e}var Ro;function Yb(e){Ro=e}function fp(){if(Ro!==void 0)return Ro;if(typeof document<"u")return document;throw new _(210,!1)}var Qb=new O("",{providedIn:"root",factory:()=>pp}),pp="ng",hp=new O(""),Li=new O("",{providedIn:"platform",factory:()=>"unknown"});var Zb=new O("",{providedIn:"root",factory:()=>fp().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var gp="h",mp="b";var yp=()=>null;function ji(e,t,n=!1){return yp(e,t,n)}var ec=!1,Dp=new O("",{providedIn:"root",factory:()=>ec});var Rn;function vp(){if(Rn===void 0&&(Rn=null,pt.trustedTypes))try{Rn=pt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Rn}function Ia(e){return vp()?.createScriptURL(e)||e}var Jn=class{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Ba})`}};function Ir(e){return e instanceof Jn?e.changingThisBreaksApplicationSecurity:e}function tc(e,t){let n=wp(e);if(n!=null&&n!==t){if(n==="ResourceURL"&&t==="URL")return!0;throw new Error(`Required a safe ${t}, got a ${n} (see ${Ba})`)}return n===t}function wp(e){return e instanceof Jn&&e.getTypeName()||null}var Ip=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Ep(e){return e=String(e),e.match(Ip)?e:"unsafe:"+e}var Vi=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}(Vi||{});function Cp(e){let t=nc();return t?t.sanitize(Vi.URL,e)||"":tc(e,"URL")?Ir(e):Ep(fr(e))}function bp(e){let t=nc();if(t)return Ia(t.sanitize(Vi.RESOURCE_URL,e)||"");if(tc(e,"ResourceURL"))return Ia(Ir(e));throw new _(904,!1)}function Mp(e,t){return t==="src"&&(e==="embed"||e==="frame"||e==="iframe"||e==="media"||e==="script")||t==="href"&&(e==="base"||e==="link")?bp:Cp}function Kb(e,t,n){return Mp(t,n)(e)}function nc(){let e=b();return e&&e[se].sanitizer}var _p=/^>|^->||--!>|)/g,Tp="\u200B$1\u200B";function Sp(e){return e.replace(_p,t=>t.replace(xp,Tp))}function Jb(e){return e.ownerDocument.defaultView}function rc(e){return e instanceof Function?e():e}function Np(e){return(e??S(Jt)).get(Li)==="browser"}var Xn=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Xn||{}),Ap;function Bi(e,t){return Ap(e,t)}function dt(e,t,n,r,o){if(r!=null){let i,s=!1;De(r)?i=r:Be(r)&&(s=!0,r=r[ye]);let a=fe(r);e===0&&n!==null?o==null?ac(t,n,a):er(t,n,a,o||null,!0):e===1&&n!==null?er(t,n,a,o||null,!0):e===2?Qp(t,a,s):e===3&&t.destroyNode(a),i!=null&&Kp(t,e,i,n,o)}}function Op(e,t){return e.createText(t)}function Fp(e,t,n){e.setValue(t,n)}function Rp(e,t){return e.createComment(Sp(t))}function oc(e,t,n){return e.createElement(t,n)}function Pp(e,t){ic(e,t),t[ye]=null,t[ue]=null}function kp(e,t,n,r,o,i){r[ye]=o,r[ue]=t,br(e,r,n,1,o,i)}function ic(e,t){t[se].changeDetectionScheduler?.notify(1),br(e,t,t[P],2,null,null)}function Lp(e){let t=e[Bt];if(!t)return uo(e[v],e);for(;t;){let n=null;if(Be(t))n=t[Bt];else{let r=t[B];r&&(n=r)}if(!n){for(;t&&!t[ie]&&t!==e;)Be(t)&&uo(t[v],t),t=t[L];t===null&&(t=e),Be(t)&&uo(t[v],t),n=t&&t[ie]}t=n}}function jp(e,t,n,r){let o=B+r,i=n.length;r>0&&(n[o-1][ie]=t),r0&&(e[n-1][ie]=r[ie]);let i=Gn(e,B+t);Pp(r[v],r);let s=i[me];s!==null&&s.detachView(i[v]),r[L]=null,r[ie]=null,r[m]&=-129}return r}function Er(e,t){if(!(t[m]&256)){let n=t[P];n.destroyNode&&br(e,t,n,3,null,null),Lp(t)}}function uo(e,t){if(t[m]&256)return;let n=E(null);try{t[m]&=-129,t[m]|=256,t[Ge]&&Is(t[Ge]),$p(e,t),Bp(e,t),t[v].type===1&&t[P].destroy();let r=t[Zt];if(r!==null&&De(t[L])){r!==t[L]&&sc(r,t);let o=t[me];o!==null&&o.detachView(e)}dp(t)}finally{E(n)}}function Bp(e,t){let n=e.cleanup,r=t[Vt];if(n!==null)for(let i=0;i=0?r[s]():r[-s].unsubscribe(),i+=2}else{let s=r[n[i+1]];n[i].call(s)}r!==null&&(t[Vt]=null);let o=t[Ee];if(o!==null){t[Ee]=null;for(let i=0;i-1){let{encapsulation:i}=e.data[r.directiveStart+o];if(i===kt.None||i===kt.Emulated)return null}return ee(r,n)}}function er(e,t,n,r,o){e.insertBefore(t,n,r,o)}function ac(e,t,n){e.appendChild(t,n)}function Ea(e,t,n,r,o){r!==null?er(e,t,n,r,o):ac(e,t,n)}function Gp(e,t,n,r){e.removeChild(t,n,r)}function $i(e,t){return e.parentNode(t)}function Wp(e,t){return e.nextSibling(t)}function zp(e,t,n){return Yp(e,t,n)}function qp(e,t,n){return e.type&40?ee(e,n):null}var Yp=qp,Ca;function Cr(e,t,n,r){let o=Hp(e,r,t),i=t[P],s=r.parent||t[ue],a=zp(s,r,t);if(o!=null)if(Array.isArray(n))for(let u=0;uY&&dc(e,t,Y,!1),le(s?2:0,o),n(r,o)}finally{ze(i),le(s?3:1,o)}}function Ui(e,t,n){if(Mi(t)){let r=E(null);try{let o=t.directiveStart,i=t.directiveEnd;for(let s=o;snull;function sh(e,t,n,r){let o=wc(t);o.push(n),e.firstCreatePass&&Ic(e).push(r,o.length-1)}function ah(e,t,n,r,o,i){let s=t?t.injectorIndex:-1,a=0;return Sf()&&(a|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:o,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}}function ba(e,t,n,r,o){for(let i in t){if(!t.hasOwnProperty(i))continue;let s=t[i];if(s===void 0)continue;r??={};let a,u=Ue.None;Array.isArray(s)?(a=s[0],u=s[1]):a=s;let c=i;if(o!==null){if(!o.hasOwnProperty(i))continue;c=o[i]}e===0?Ma(r,n,c,a,u):Ma(r,n,c,a)}return r}function Ma(e,t,n,r,o){let i;e.hasOwnProperty(n)?(i=e[n]).push(t,r):i=e[n]=[t,r],o!==void 0&&i.push(o)}function uh(e,t,n){let r=t.directiveStart,o=t.directiveEnd,i=e.data,s=t.attrs,a=[],u=null,c=null;for(let l=r;l0;){let n=e[--t];if(typeof n=="number"&&n<0)return n}return 0}function hh(e,t,n,r){let o=n.directiveStart,i=n.directiveEnd;mr(n)&&Ih(t,n,e.data[o+n.componentOffset]),e.firstCreatePass||Kn(n,t),Me(r,t);let s=n.initialInputs;for(let a=o;a{$t(e.lView)},consumerOnSignalRead(){this.lView[Ge]=this}}),_c=100;function xc(e,t=!0,n=0){let r=e[se],o=r.rendererFactory,i=!1;i||o.begin?.();try{Ph(e,n)}catch(s){throw t&&Ec(e,s),s}finally{i||(o.end?.(),r.inlineEffectRunner?.flush())}}function Ph(e,t){jo(e,t);let n=0;for(;Si(e);){if(n===_c)throw new _(103,!1);n++,jo(e,1)}}function kh(e,t,n,r){let o=t[m];if((o&256)===256)return;let i=!1;!i&&t[se].inlineEffectRunner?.flush(),Fi(t);let s=null,a=null;!i&&Lh(e)&&(a=Ah(t),s=vs(a));try{bu(t),Ff(e.bindingStartIndex),n!==null&&hc(e,t,n,2,r);let u=(o&3)===3;if(!i)if(u){let d=e.preOrderCheckHooks;d!==null&&Ln(t,d,null)}else{let d=e.preOrderHooks;d!==null&&jn(t,d,0,null),oo(t,0)}if(jh(t),Tc(t,0),e.contentQueries!==null&&vc(e,t),!i)if(u){let d=e.contentCheckHooks;d!==null&&Ln(t,d)}else{let d=e.contentHooks;d!==null&&jn(t,d,1),oo(t,1)}eh(e,t);let c=e.components;c!==null&&Nc(t,c,0);let l=e.viewQuery;if(l!==null&&Lo(2,l,r),!i)if(u){let d=e.viewCheckHooks;d!==null&&Ln(t,d)}else{let d=e.viewHooks;d!==null&&jn(t,d,2),oo(t,2)}if(e.firstUpdatePass===!0&&(e.firstUpdatePass=!1),t[ro]){for(let d of t[ro])d();t[ro]=null}i||(t[m]&=-73)}catch(u){throw $t(t),u}finally{a!==null&&(ws(a,s),Fh(a)),Ri()}}function Lh(e){return e.type!==2}function Tc(e,t){for(let n=Ku(e);n!==null;n=Ju(n))for(let r=B;r-1&&(Ut(t,r),Gn(n,r))}this._attachedToViewContainer=!1}Er(this._lView[v],this._lView)}onDestroy(t){Mu(this._lView,t)}markForCheck(){Zi(this._cdRefInjectingView||this._lView)}detach(){this._lView[m]&=-129}reattach(){_o(this._lView),this._lView[m]|=128}detectChanges(){this._lView[m]|=1024,xc(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new _(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,ic(this._lView[v],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new _(902,!1);this._appRef=t,_o(this._lView)}},Wt=(()=>{let t=class t{};t.__NG_ELEMENT_ID__=Hh;let e=t;return e})(),Bh=Wt,$h=class extends Bh{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,n){return this.createEmbeddedViewImpl(t,n)}createEmbeddedViewImpl(t,n,r){let o=xr(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:n,dehydratedView:r});return new Ze(o)}};function Hh(){return Ki(U(),b())}function Ki(e,t){return e.type&4?new $h(t,e,bt(e,t)):null}var n0=new RegExp(`^(\\d+)*(${mp}|${gp})*(.*)`);var Uh=()=>null;function zt(e,t){return Uh(e,t)}var nr=class{},Vo=class{},rr=class{};function Gh(e){let t=Error(`No component factory found for ${q(e)}.`);return t[Wh]=e,t}var Wh="ngComponent";var Bo=class{resolveComponentFactory(t){throw Gh(t)}},Sr=(()=>{let t=class t{};t.NULL=new Bo;let e=t;return e})(),$o=class{},Ac=(()=>{let t=class t{constructor(){this.destroyNode=null}};t.__NG_ELEMENT_ID__=()=>zh();let e=t;return e})();function zh(){let e=b(),t=U(),n=xe(t.index,e);return(Be(n)?n:e)[P]}var qh=(()=>{let t=class t{};t.\u0275prov=F({token:t,providedIn:"root",factory:()=>null});let e=t;return e})(),co={};var _a=new Set;function en(e){_a.has(e)||(_a.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}function xa(...e){}function Yh(){let e=typeof pt.requestAnimationFrame=="function",t=pt[e?"requestAnimationFrame":"setTimeout"],n=pt[e?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&t&&n){let r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r);let o=n[Zone.__symbol__("OriginalDelegate")];o&&(n=o)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:n}}var X=class e{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Ve(!1),this.onMicrotaskEmpty=new Ve(!1),this.onStable=new Ve(!1),this.onError=new Ve(!1),typeof Zone>"u")throw new _(908,!1);Zone.assertZonePatched();let o=this;o._nesting=0,o._outer=o._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(o._inner=o._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(o._inner=o._inner.fork(Zone.longStackTraceZoneSpec)),o.shouldCoalesceEventChangeDetection=!r&&n,o.shouldCoalesceRunChangeDetection=r,o.lastRequestAnimationFrameId=-1,o.nativeRequestAnimationFrame=Yh().nativeRequestAnimationFrame,Kh(o)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get("isAngularZone")===!0}static assertInAngularZone(){if(!e.isInAngularZone())throw new _(909,!1)}static assertNotInAngularZone(){if(e.isInAngularZone())throw new _(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,o){let i=this._inner,s=i.scheduleEventTask("NgZoneEvent: "+o,t,Qh,xa,xa);try{return i.runTask(s,n,r)}finally{i.cancelTask(s)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}},Qh={};function Ji(e){if(e._nesting==0&&!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 Zh(e){e.isCheckStableRunning||e.lastRequestAnimationFrameId!==-1||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(pt,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Ho(e),e.isCheckStableRunning=!0,Ji(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Ho(e))}function Kh(e){let t=()=>{Zh(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,o,i,s,a)=>{if(Jh(a))return n.invokeTask(o,i,s,a);try{return Ta(e),n.invokeTask(o,i,s,a)}finally{(e.shouldCoalesceEventChangeDetection&&i.type==="eventTask"||e.shouldCoalesceRunChangeDetection)&&t(),Sa(e)}},onInvoke:(n,r,o,i,s,a,u)=>{try{return Ta(e),n.invoke(o,i,s,a,u)}finally{e.shouldCoalesceRunChangeDetection&&t(),Sa(e)}},onHasTask:(n,r,o,i)=>{n.hasTask(o,i),r===o&&(i.change=="microTask"?(e._hasPendingMicrotasks=i.microTask,Ho(e),Ji(e)):i.change=="macroTask"&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(n,r,o,i)=>(n.handleError(o,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}function Ho(e){e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&e.lastRequestAnimationFrameId!==-1?e.hasPendingMicrotasks=!0:e.hasPendingMicrotasks=!1}function Ta(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function Sa(e){e._nesting--,Ji(e)}function Jh(e){return!Array.isArray(e)||e.length!==1?!1:e[0].data?.__ignore_ng_zone__===!0}var ft=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(ft||{}),Xh={destroy(){}};function eg(e,t){!t&&lf(eg);let n=t?.injector??S(Jt);if(!Np(n))return Xh;en("NgAfterNextRender");let r=n.get(Xi),o=r.handler??=new Go,i=t?.phase??ft.MixedReadWrite,s=()=>{o.unregister(u),a()},a=n.get(ki).onDestroy(s),u=cf(n,()=>new Uo(i,()=>{s(),e()}));return o.register(u),{destroy:s}}var Uo=class{constructor(t,n){this.phase=t,this.callbackFn=n,this.zone=S(X),this.errorHandler=S(Qe,{optional:!0}),S(nr,{optional:!0})?.notify(1)}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(t){this.errorHandler?.handleError(t)}}},Go=class{constructor(){this.executingCallbacks=!1,this.buckets={[ft.EarlyRead]:new Set,[ft.Write]:new Set,[ft.MixedReadWrite]:new Set,[ft.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(){this.executingCallbacks=!0;for(let t of Object.values(this.buckets))for(let n of t)n.invoke();this.executingCallbacks=!1;for(let t of this.deferredCallbacks)this.buckets[t.phase].add(t);this.deferredCallbacks.clear()}destroy(){for(let t of Object.values(this.buckets))t.clear();this.deferredCallbacks.clear()}},Xi=(()=>{let t=class t{constructor(){this.handler=null,this.internalCallbacks=[]}execute(){this.executeInternalCallbacks(),this.handler?.execute()}executeInternalCallbacks(){let r=[...this.internalCallbacks];this.internalCallbacks.length=0;for(let o of r)o()}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}};t.\u0275prov=F({token:t,providedIn:"root",factory:()=>new t});let e=t;return e})();function or(e,t,n){let r=n?e.styles:null,o=n?e.classes:null,i=0;if(t!==null)for(let s=0;s0&&cc(e,n,i.join(" "))}}function ag(e,t,n){let r=e.projection=[];for(let o=0;o{let t=class t{};t.__NG_ELEMENT_ID__=cg;let e=t;return e})();function cg(){let e=U();return Fc(e,b())}var lg=tn,Oc=class extends lg{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return bt(this._hostTNode,this._hostLView)}get injector(){return new $e(this._hostTNode,this._hostLView)}get parentInjector(){let t=Pi(this._hostTNode,this._hostLView);if(ju(t)){let n=Qn(t,this._hostLView),r=Yn(t),o=n[v].data[r+8];return new $e(o,n)}else return new $e(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){let n=Aa(this._lContainer);return n!==null&&n[t]||null}get length(){return this._lContainer.length-B}createEmbeddedView(t,n,r){let o,i;typeof r=="number"?o=r:r!=null&&(o=r.index,i=r.injector);let s=zt(this._lContainer,t.ssrId),a=t.createEmbeddedViewImpl(n||{},i,s);return this.insertImpl(a,o,Gt(this._hostTNode,s)),a}createComponent(t,n,r,o,i){let s=t&&!df(t),a;if(s)a=n;else{let h=n||{};a=h.index,r=h.injector,o=h.projectableNodes,i=h.environmentInjector||h.ngModuleRef}let u=s?t:new wt(Ce(t)),c=r||this.parentInjector;if(!i&&u.ngModule==null){let y=(s?c:this.parentInjector).get(be,null);y&&(i=y)}let l=Ce(u.componentType??{}),d=zt(this._lContainer,l?.id??null),p=d?.firstChild??null,f=u.create(c,o,p,i);return this.insertImpl(f.hostView,a,Gt(this._hostTNode,d)),f}insert(t,n){return this.insertImpl(t,n,!0)}insertImpl(t,n,r){let o=t._lView;if(Ef(o)){let a=this.indexOf(t);if(a!==-1)this.detach(a);else{let u=o[L],c=new Oc(u,u[ue],u[L]);c.detach(c.indexOf(t))}}let i=this._adjustIndex(n),s=this._lContainer;return Tr(s,o,i,r),t.attachToViewContainerRef(),Ja(lo(s),i,t),t}move(t,n){return this.insert(t,n)}indexOf(t){let n=Aa(this._lContainer);return n!==null?n.indexOf(t):-1}remove(t){let n=this._adjustIndex(t,-1),r=Ut(this._lContainer,n);r&&(Gn(lo(this._lContainer),n),Er(r[v],r))}detach(t){let n=this._adjustIndex(t,-1),r=Ut(this._lContainer,n);return r&&Gn(lo(this._lContainer),n)!=null?new Ze(r):null}_adjustIndex(t,n=0){return t??this.length+n}};function Aa(e){return e[qn]}function lo(e){return e[qn]||(e[qn]=[])}function Fc(e,t){let n,r=t[e.index];return De(r)?n=r:(n=Dc(r,t,null,e),t[e.index]=n,_r(t,n)),fg(n,t,e,r),new Oc(n,e,t)}function dg(e,t){let n=e[P],r=n.createComment(""),o=ee(t,e),i=$i(n,o);return er(n,i,r,Wp(n,o),!1),r}var fg=gg,pg=()=>!1;function hg(e,t,n){return pg(e,t,n)}function gg(e,t,n,r){if(e[We])return;let o;n.type&8?o=fe(r):o=dg(t,n),e[We]=o}var qo=class e{constructor(t){this.queryList=t,this.matches=null}clone(){return new e(this.queryList)}setDirty(){this.queryList.setDirty()}},Yo=class e{constructor(t=[]){this.queries=t}createEmbeddedView(t){let n=t.queries;if(n!==null){let r=t.contentQueries!==null?t.contentQueries[0]:n.length,o=[];for(let i=0;i0)r.push(s[a/2]);else{let c=i[a+1],l=t[-u];for(let d=B;dt.trim())}function kc(e,t,n){e.queries===null&&(e.queries=new Qo),e.queries.track(new Zo(t,n))}function bg(e,t){let n=e.contentQueries||(e.contentQueries=[]),r=n.length?n[n.length-1]:-1;t!==r&&n.push(e.queries.length-1,t)}function es(e,t){return e.queries.getByIndex(t)}function Mg(e,t){let n=e[v],r=es(n,t);return r.crossesNgTemplate?Ko(n,e,t,[]):Rc(n,e,r,t)}function _g(e){let t=e.inputConfig,n={};for(let r in t)if(t.hasOwnProperty(r)){let o=t[r];Array.isArray(o)&&o[3]&&(n[r]=o[3])}e.inputTransforms=n}var _e=class{},Jo=class{};var Xo=class extends _e{constructor(t,n,r){super(),this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new ir(this);let o=uu(t);this._bootstrapComponents=rc(o.bootstrap),this._r3Injector=qu(t,n,[{provide:_e,useValue:this},{provide:Sr,useValue:this.componentFactoryResolver},...r],q(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){let t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}},ei=class extends Jo{constructor(t){super(),this.moduleType=t}create(t){return new Xo(this.moduleType,t,[])}};var ar=class extends _e{constructor(t){super(),this.componentFactoryResolver=new ir(this),this.instance=null;let n=new Lt([...t.providers,{provide:_e,useValue:this},{provide:Sr,useValue:this.componentFactoryResolver}],t.parent||Ci(),t.debugName,new Set(["environment"]));this.injector=n,t.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}};function xg(e,t,n=null){return new ar({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}var Lc=(()=>{let t=class t{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Tt(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);let r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),this.pendingTasks.size===0&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function jc(e){return e!==null&&(typeof e=="function"||typeof e=="object")}function Vc(e,t,n){return e[t]=n}function pe(e,t,n){let r=e[t];return Object.is(r,n)?!1:(e[t]=n,!0)}function Tg(e,t,n,r){let o=pe(e,t,n);return pe(e,t+1,r)||o}function Sg(e,t,n,r,o){let i=Tg(e,t,n,r);return pe(e,t+2,o)||i}function Ng(e){return(e.flags&32)===32}function Ag(e,t,n,r,o,i,s,a,u){let c=t.consts,l=Xt(t,e,4,s||null,vt(c,a));qi(t,n,l,vt(c,u)),wr(t,l);let d=l.tView=zi(2,l,r,o,i,t.directiveRegistry,t.pipeRegistry,null,t.schemas,c,null);return t.queries!==null&&(t.queries.template(t,l),d.queries=t.queries.embeddedTView(l)),l}function ti(e,t,n,r,o,i,s,a){let u=b(),c=j(),l=e+Y,d=c.firstCreatePass?Ag(l,c,u,t,n,r,o,i,s):c.data[l];Je(d,!1);let p=Og(c,u,d,e);Dr()&&Cr(c,u,p,d),Me(p,u);let f=Dc(p,u,p,d);return u[l]=f,_r(u,f),hg(f,d,u),yr(d)&&Gi(c,u,d),s!=null&&Wi(u,d,a),ti}var Og=Fg;function Fg(e,t,n,r){return vr(!0),t[P].createComment("")}function Rg(e,t,n,r){let o=b(),i=Kt();if(pe(o,i,t)){let s=j(),a=Pu();Eh(a,o,e,t,n,r)}return Rg}function Pg(e,t,n,r){return pe(e,Kt(),n)?t+fr(n)+r:et}function Pn(e,t){return e<<17|t<<2}function Ke(e){return e>>17&32767}function kg(e){return(e&2)==2}function Lg(e,t){return e&131071|t<<17}function ni(e){return e|2}function It(e){return(e&131068)>>2}function fo(e,t){return e&-131069|t<<2}function jg(e){return(e&1)===1}function ri(e){return e|1}function Vg(e,t,n,r,o,i){let s=i?t.classBindings:t.styleBindings,a=Ke(s),u=It(s);e[r]=n;let c=!1,l;if(Array.isArray(n)){let d=n;l=d[1],(l===null||Qt(d,l)>0)&&(c=!0)}else l=n;if(o)if(u!==0){let p=Ke(e[a+1]);e[r+1]=Pn(p,a),p!==0&&(e[p+1]=fo(e[p+1],r)),e[a+1]=Lg(e[a+1],r)}else e[r+1]=Pn(a,0),a!==0&&(e[a+1]=fo(e[a+1],r)),a=r;else e[r+1]=Pn(u,0),a===0?a=r:e[u+1]=fo(e[u+1],r),u=r;c&&(e[r+1]=ni(e[r+1])),Oa(e,l,r,!0),Oa(e,l,r,!1),Bg(t,l,e,r,i),s=Pn(a,u),i?t.classBindings=s:t.styleBindings=s}function Bg(e,t,n,r,o){let i=o?e.residualClasses:e.residualStyles;i!=null&&typeof t=="string"&&Qt(i,t)>=0&&(n[r+1]=ri(n[r+1]))}function Oa(e,t,n,r){let o=e[n+1],i=t===null,s=r?Ke(o):It(o),a=!1;for(;s!==0&&(a===!1||i);){let u=e[s],c=e[s+1];$g(u,t)&&(a=!0,e[s+1]=r?ri(c):ni(c)),s=r?Ke(c):It(c)}a&&(e[n+1]=r?ni(o):ri(o))}function $g(e,t){return e===null||t==null||(Array.isArray(e)?e[1]:e)===t?!0:Array.isArray(e)&&typeof t=="string"?Qt(e,t)>=0:!1}function Hg(e,t,n){let r=b(),o=Kt();if(pe(r,o,t)){let i=j(),s=Pu();lh(i,s,r,e,t,r[P],n,!1)}return Hg}function Fa(e,t,n,r,o){let i=t.inputs,s=o?"class":"style";Yi(e,n,i[s],s,r)}function Bc(e,t,n){return $c(e,t,n,!1),Bc}function Ug(e,t){return $c(e,t,null,!0),Ug}function $c(e,t,n,r){let o=b(),i=j(),s=Rf(2);if(i.firstUpdatePass&&Wg(i,e,s,r),t!==et&&pe(o,s,t)){let a=i.data[Xe()];Zg(i,a,o,o[P],e,o[s+1]=Kg(t,n),r,s)}}function Gg(e,t){return t>=e.expandoStartIndex}function Wg(e,t,n,r){let o=e.data;if(o[n+1]===null){let i=o[Xe()],s=Gg(e,n);Jg(i,r)&&t===null&&!s&&(t=!1),t=zg(o,i,t,r),Vg(o,i,t,n,s,r)}}function zg(e,t,n,r){let o=jf(e),i=r?t.residualClasses:t.residualStyles;if(o===null)(r?t.classBindings:t.styleBindings)===0&&(n=po(null,e,t,n,r),n=qt(n,t.attrs,r),i=null);else{let s=t.directiveStylingLast;if(s===-1||e[s]!==o)if(n=po(o,e,t,n,r),i===null){let u=qg(e,t,r);u!==void 0&&Array.isArray(u)&&(u=po(null,e,t,u[1],r),u=qt(u,t.attrs,r),Yg(e,t,r,u))}else i=Qg(e,t,r)}return i!==void 0&&(r?t.residualClasses=i:t.residualStyles=i),n}function qg(e,t,n){let r=n?t.classBindings:t.styleBindings;if(It(r)!==0)return e[Ke(r)]}function Yg(e,t,n,r){let o=n?t.classBindings:t.styleBindings;e[Ke(o)]=r}function Qg(e,t,n){let r,o=t.directiveEnd;for(let i=1+t.directiveStylingLast;i0;){let u=e[o],c=Array.isArray(u),l=c?u[1]:u,d=l===null,p=n[o+1];p===et&&(p=d?oe:void 0);let f=d?to(p,r):l===r?p:void 0;if(c&&!ur(f)&&(f=to(u,r)),ur(f)&&(a=f,s))return a;let h=e[o+1];o=s?Ke(h):It(h)}if(t!==null){let u=i?t.residualClasses:t.residualStyles;u!=null&&(a=to(u,r))}return a}function ur(e){return e!==void 0}function Kg(e,t){return e==null||e===""||(typeof t=="string"?e=e+t:typeof e=="object"&&(e=q(Ir(e)))),e}function Jg(e,t){return(e.flags&(t?8:16))!==0}var oi=class{destroy(t){}updateValue(t,n){}swap(t,n){let r=Math.min(t,n),o=Math.max(t,n),i=this.detach(o);if(o-r>1){let s=this.detach(r);this.attach(r,i),this.attach(o,s)}else this.attach(r,i)}move(t,n){this.attach(n,this.detach(t))}};function ho(e,t,n,r,o){return e===n&&Object.is(t,r)?1:Object.is(o(e,t),o(n,r))?-1:0}function Xg(e,t,n){let r,o,i=0,s=e.length-1;if(Array.isArray(t)){let a=t.length-1;for(;i<=s&&i<=a;){let u=e.at(i),c=t[i],l=ho(i,u,i,c,n);if(l!==0){l<0&&e.updateValue(i,c),i++;continue}let d=e.at(s),p=t[a],f=ho(s,d,a,p,n);if(f!==0){f<0&&e.updateValue(s,p),s--,a--;continue}let h=n(i,u),y=n(s,d),T=n(i,c);if(Object.is(T,y)){let M=n(a,p);Object.is(M,h)?(e.swap(i,s),e.updateValue(s,p),a--,s--):e.move(s,i),e.updateValue(i,c),i++;continue}if(r??=new cr,o??=ka(e,i,s,n),ii(e,r,i,T))e.updateValue(i,c),i++,s++;else if(o.has(T))r.set(h,e.detach(i)),s--;else{let M=e.create(i,t[i]);e.attach(i,M),i++,s++}}for(;i<=a;)Pa(e,r,n,i,t[i]),i++}else if(t!=null){let a=t[Symbol.iterator](),u=a.next();for(;!u.done&&i<=s;){let c=e.at(i),l=u.value,d=ho(i,c,i,l,n);if(d!==0)d<0&&e.updateValue(i,l),i++,u=a.next();else{r??=new cr,o??=ka(e,i,s,n);let p=n(i,l);if(ii(e,r,i,p))e.updateValue(i,l),i++,s++,u=a.next();else if(!o.has(p))e.attach(i,e.create(i,l)),i++,s++,u=a.next();else{let f=n(i,c);r.set(f,e.detach(i)),s--}}}for(;!u.done;)Pa(e,r,n,e.length,u.value),u=a.next()}for(;i<=s;)e.destroy(e.detach(s--));r?.forEach(a=>{e.destroy(a)})}function ii(e,t,n,r){return t!==void 0&&t.has(r)?(e.attach(n,t.get(r)),t.delete(r),!0):!1}function Pa(e,t,n,r,o){if(ii(e,t,r,n(r,o)))e.updateValue(r,o);else{let i=e.create(r,o);e.attach(r,i)}}function ka(e,t,n,r){let o=new Set;for(let i=t;i<=n;i++)o.add(r(i,e.at(i)));return o}var cr=class{constructor(){this.kvMap=new Map,this._vMap=void 0}has(t){return this.kvMap.has(t)}delete(t){if(!this.has(t))return!1;let n=this.kvMap.get(t);return this._vMap!==void 0&&this._vMap.has(n)?(this.kvMap.set(t,this._vMap.get(n)),this._vMap.delete(n)):this.kvMap.delete(t),!0}get(t){return this.kvMap.get(t)}set(t,n){if(this.kvMap.has(t)){let r=this.kvMap.get(t);this._vMap===void 0&&(this._vMap=new Map);let o=this._vMap;for(;o.has(r);)r=o.get(r);o.set(r,n)}else this.kvMap.set(t,n)}forEach(t){for(let[n,r]of this.kvMap)if(t(r,n),this._vMap!==void 0){let o=this._vMap;for(;o.has(r);)r=o.get(r),t(r,n)}}};function o0(e,t,n){en("NgControlFlow");let r=b(),o=Kt(),i=ci(r,Y+e),s=0;if(pe(r,o,t)){let a=E(null);try{if(bc(i,s),t!==-1){let u=li(r[v],Y+t),c=zt(i,u.tView.ssrId),l=xr(r,u,n,{dehydratedView:c});Tr(i,l,s,Gt(u,c))}}finally{E(a)}}else{let a=Cc(i,s);a!==void 0&&(a[V]=n)}}var si=class{constructor(t,n,r){this.lContainer=t,this.$implicit=n,this.$index=r}get $count(){return this.lContainer.length-B}};function i0(e){return e}var ai=class{constructor(t,n,r){this.hasEmptyBlock=t,this.trackByFn=n,this.liveCollection=r}};function s0(e,t,n,r,o,i,s,a,u,c,l,d,p){en("NgControlFlow");let f=u!==void 0,h=b(),y=a?s.bind(h[ae][V]):s,T=new ai(f,y);h[Y+e]=T,ti(e+1,t,n,r,o,i),f&&ti(e+2,u,c,l,d,p)}var ui=class extends oi{constructor(t,n,r){super(),this.lContainer=t,this.hostLView=n,this.templateTNode=r,this.needsIndexUpdate=!1}get length(){return this.lContainer.length-B}at(t){return this.getLView(t)[V].$implicit}attach(t,n){let r=n[jt];this.needsIndexUpdate||=t!==this.length,Tr(this.lContainer,n,t,Gt(this.templateTNode,r))}detach(t){return this.needsIndexUpdate||=t!==this.length-1,em(this.lContainer,t)}create(t,n){let r=zt(this.lContainer,this.templateTNode.tView.ssrId);return xr(this.hostLView,this.templateTNode,new si(this.lContainer,n,t),{dehydratedView:r})}destroy(t){Er(t[v],t)}updateValue(t,n){this.getLView(t)[V].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let t=0;t(vr(!0),oc(r,o,$f()));function im(e,t,n,r,o){let i=t.consts,s=vt(i,r),a=Xt(t,e,8,"ng-container",s);s!==null&&or(a,s,!0);let u=vt(i,o);return qi(t,n,a,u),t.queries!==null&&t.queries.elementStart(t,a),a}function Gc(e,t,n){let r=b(),o=j(),i=e+Y,s=o.firstCreatePass?im(i,o,r,t,n):o.data[i];Je(s,!0);let a=am(o,r,s,e);return r[i]=a,Dr()&&Cr(o,r,a,s),Me(a,r),yr(s)&&(Gi(o,r,s),Ui(o,s,r)),n!=null&&Wi(r,s),Gc}function Wc(){let e=U(),t=j();return Ni()?Tu():(e=e.parent,Je(e,!1)),t.firstCreatePass&&(wr(t,e),Mi(e)&&t.queries.elementEnd(e)),Wc}function sm(e,t,n){return Gc(e,t,n),Wc(),sm}var am=(e,t,n,r)=>(vr(!0),Rp(t[P],""));function u0(){return b()}var lr="en-US";var um=lr;function cm(e){typeof e=="string"&&(um=e.toLowerCase().replace(/_/g,"-"))}function lm(e,t,n,r){let o=b(),i=j(),s=U();return fm(i,o,o[P],s,e,t,r),lm}function dm(e,t,n,r){let o=e.cleanup;if(o!=null)for(let i=0;iu?a[u]:null}typeof s=="string"&&(i+=2)}return null}function fm(e,t,n,r,o,i,s){let a=yr(r),c=e.firstCreatePass&&Ic(e),l=t[V],d=wc(t),p=!0;if(r.type&3||s){let y=ee(r,t),T=s?s(y):y,M=d.length,Q=s?he=>s(fe(he[r.index])):r.index,G=null;if(!s&&a&&(G=dm(e,t,o,r.index)),G!==null){let he=G.__ngLastListenerFn__||G;he.__ngNextListenerFn__=i,G.__ngLastListenerFn__=i,p=!1}else{i=ja(r,t,l,i,!1);let he=n.listen(T,o,i);d.push(i,he),c&&c.push(o,Q,M,M+1)}}else i=ja(r,t,l,i,!1);let f=r.outputs,h;if(p&&f!==null&&(h=f[o])){let y=h.length;if(y)for(let T=0;T-1?xe(e.index,t):t;Zi(a);let u=La(t,n,r,s),c=i.__ngNextListenerFn__;for(;c;)u=La(t,n,c,s)&&u,c=c.__ngNextListenerFn__;return o&&u===!1&&s.preventDefault(),u}}function c0(e=1){return Bf(e)}function l0(e,t,n,r){Eg(e,t,n,r)}function d0(e,t,n){Ig(e,t,n)}function f0(e){let t=b(),n=j(),r=Su();Oi(r+1);let o=es(n,r);if(e.dirty&&If(t)===((o.metadata.flags&2)===2)){if(o.matches===null)e.reset([]);else{let i=Mg(t,r);e.reset(i,sp),e.notifyOnChanges()}return!0}return!1}function p0(){return wg(b(),Su())}function pm(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}function h0(e,t=""){let n=b(),r=j(),o=e+Y,i=r.firstCreatePass?Xt(r,o,1,t,null):r.data[o],s=hm(r,n,i,t,e);n[o]=s,Dr()&&Cr(r,n,s,i),Je(i,!1)}var hm=(e,t,n,r,o)=>(vr(!0),Op(t[P],r));function gm(e){return zc("",e,""),gm}function zc(e,t,n){let r=b(),o=Pg(r,e,t,n);return o!==et&&_h(r,Xe(),o),zc}function mm(e,t,n){let r=j();if(r.firstCreatePass){let o=Ct(e);di(n,r.data,r.blueprint,o,!0),di(t,r.data,r.blueprint,o,!1)}}function di(e,t,n,r,o){if(e=H(e),Array.isArray(e))for(let i=0;i>20;if(mt(e)||!e.multi){let f=new qe(c,o,Te),h=mo(u,t,o?l:l+p,d);h===-1?(So(Kn(a,s),i,u),go(i,e,t.length),t.push(u),a.directiveStart++,a.directiveEnd++,o&&(a.providerIndexes+=1048576),n.push(f),s.push(f)):(n[h]=f,s[h]=f)}else{let f=mo(u,t,l+p,d),h=mo(u,t,l,l+p),y=f>=0&&n[f],T=h>=0&&n[h];if(o&&!T||!o&&!y){So(Kn(a,s),i,u);let M=vm(o?Dm:ym,n.length,o,r,c);!o&&T&&(n[h].providerFactory=M),go(i,e,t.length,0),t.push(u),a.directiveStart++,a.directiveEnd++,o&&(a.providerIndexes+=1048576),n.push(M),s.push(M)}else{let M=qc(n[o?h:f],c,!o&&r);go(i,e,f>-1?f:h,M)}!o&&r&&T&&n[h].componentProviders++}}}function go(e,t,n,r){let o=mt(t),i=tf(t);if(o||i){let u=(i?H(t.useClass):t).prototype.ngOnDestroy;if(u){let c=e.destroyHooks||(e.destroyHooks=[]);if(!o&&t.multi){let l=c.indexOf(n);l===-1?c.push(n,[r,u]):c[l+1].push(r,u)}else c.push(n,u)}}}function qc(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function mo(e,t,n,r){for(let o=n;o{n.providersResolver=(r,o)=>mm(r,o?o(e):e,t)}}var wm=(()=>{let t=class t{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){let o=du(!1,r.type),i=o.length>0?xg([o],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,i)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(let r of this.cachedInjectors.values())r!==null&&r.destroy()}finally{this.cachedInjectors.clear()}}};t.\u0275prov=F({token:t,providedIn:"environment",factory:()=>new t($(be))});let e=t;return e})();function m0(e){en("NgStandalone"),e.getStandaloneInjector=t=>t.get(wm).getOrCreateStandaloneInjector(e)}function y0(e,t,n,r){return Qc(b(),Ai(),e,t,n,r)}function D0(e,t,n,r,o,i){return Im(b(),Ai(),e,t,n,r,o,i)}function Yc(e,t){let n=e[t];return n===et?void 0:n}function Qc(e,t,n,r,o,i){let s=t+n;return pe(e,s,o)?Vc(e,s+1,i?r.call(i,o):r(o)):Yc(e,s+1)}function Im(e,t,n,r,o,i,s,a){let u=t+n;return Sg(e,u,o,i,s)?Vc(e,u+3,a?r.call(a,o,i,s):r(o,i,s)):Yc(e,u+3)}function v0(e,t){let n=j(),r,o=e+Y;n.firstCreatePass?(r=Em(t,n.pipeRegistry),n.data[o]=r,r.onDestroy&&(n.destroyHooks??=[]).push(o,r.onDestroy)):r=n.data[o];let i=r.factory||(r.factory=He(r.type,!0)),s,a=z(Te);try{let u=Zn(!1),c=i();return Zn(u),pm(n,b(),o,c),c}finally{z(a)}}function Em(e,t){if(t)for(let n=t.length-1;n>=0;n--){let r=t[n];if(e===r.name)return r}}function w0(e,t,n){let r=e+Y,o=b(),i=wf(o,r);return Cm(o,r)?Qc(o,Ai(),t,i.transform,n,i):i.transform(n)}function Cm(e,t){return e[v].data[t].pure}var I0=(()=>{let t=class t{log(r){console.log(r)}warn(r){console.warn(r)}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"platform"});let e=t;return e})();var bm=new O("");function Nr(e){return!!e&&typeof e.then=="function"}function ts(e){return!!e&&typeof e.subscribe=="function"}var Mm=new O(""),Zc=(()=>{let t=class t{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,o)=>{this.resolve=r,this.reject=o}),this.appInits=S(Mm,{optional:!0})??[]}runInitializers(){if(this.initialized)return;let r=[];for(let i of this.appInits){let s=i();if(Nr(s))r.push(s);else if(ts(s)){let a=new Promise((u,c)=>{s.subscribe({complete:u,error:c})});r.push(a)}}let o=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{o()}).catch(i=>{this.reject(i)}),r.length===0&&o(),this.initialized=!0}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})(),_m=new O("");function xm(){Es(()=>{throw new _(600,!1)})}function Tm(e){return e.isBoundToModule}function Sm(e,t,n){try{let r=n();return Nr(r)?r.catch(o=>{throw t.runOutsideAngular(()=>e.handleError(o)),o}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}var Kc=(()=>{let t=class t{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=S(Yu),this.afterRenderEffectManager=S(Xi),this.externalTestViews=new Set,this.beforeRender=new Z,this.afterTick=new Z,this.componentTypes=[],this.components=[],this.isStable=S(Lc).hasPendingTasks.pipe(ce(r=>!r)),this._injector=S(be)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(r,o){let i=r instanceof rr;if(!this._injector.get(Zc).done){let f=!i&&Yd(r),h=!1;throw new _(405,h)}let a;i?a=r:a=this._injector.get(Sr).resolveComponentFactory(r),this.componentTypes.push(a.componentType);let u=Tm(a)?void 0:this._injector.get(_e),c=o||a.selector,l=a.create(Jt.NULL,[],c,u),d=l.location.nativeElement,p=l.injector.get(bm,null);return p?.registerApplication(d),l.onDestroy(()=>{this.detachView(l.hostView),yo(this.components,l),p?.unregisterApplication(d)}),this._loadComponent(l),l}tick(){this._tick(!0)}_tick(r){if(this._runningTick)throw new _(101,!1);let o=E(null);try{this._runningTick=!0,this.detectChangesInAttachedViews(r)}catch(i){this.internalErrorHandler(i)}finally{this.afterTick.next(),this._runningTick=!1,E(o)}}detectChangesInAttachedViews(r){let o=0,i=this.afterRenderEffectManager;for(;;){if(o===_c)throw new _(103,!1);if(r){let s=o===0;this.beforeRender.next(s);for(let{_lView:a,notifyErrorHandler:u}of this._views)Nm(a,s,u)}if(o++,i.executeInternalCallbacks(),![...this.externalTestViews.keys(),...this._views].some(({_lView:s})=>pi(s))&&(i.execute(),![...this.externalTestViews.keys(),...this._views].some(({_lView:s})=>pi(s))))break}}attachView(r){let o=r;this._views.push(o),o.attachToAppRef(this)}detachView(r){let o=r;yo(this._views,o),o.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);let o=this._injector.get(_m,[]);[...this._bootstrapListeners,...o].forEach(i=>i(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),()=>yo(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new _(406,!1);let r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function yo(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Nm(e,t,n){!t&&!pi(e)||Am(e,n,t)}function pi(e){return Si(e)}function Am(e,t,n){let r;n?(r=0,e[m]|=1024):e[m]&64?r=0:r=1,xc(e,t,r)}var hi=class{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}},E0=(()=>{let t=class t{compileModuleSync(r){return new ei(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){let o=this.compileModuleSync(r),i=uu(r),s=rc(i.declarations).reduce((a,u)=>{let c=Ce(u);return c&&a.push(new wt(c)),a},[]);return new hi(o,s)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Om=(()=>{let t=class t{constructor(){this.zone=S(X),this.applicationRef=S(Kc)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function Fm(e){return[{provide:X,useFactory:e},{provide:Wn,multi:!0,useFactory:()=>{let t=S(Om,{optional:!0});return()=>t.initialize()}},{provide:Wn,multi:!0,useFactory:()=>{let t=S(Lm);return()=>{t.initialize()}}},{provide:Yu,useFactory:Rm}]}function Rm(){let e=S(X),t=S(Qe);return n=>e.runOutsideAngular(()=>t.handleError(n))}function Pm(e){let t=Fm(()=>new X(km(e)));return Zd([[],t])}function km(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}var Lm=(()=>{let t=class t{constructor(){this.subscription=new R,this.initialized=!1,this.zone=S(X),this.pendingTasks=S(Lc)}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(()=>{X.assertNotInAngularZone(),queueMicrotask(()=>{r!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(r),r=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{X.assertInAngularZone(),r??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function jm(){return typeof $localize<"u"&&$localize.locale||lr}var ns=new O("",{providedIn:"root",factory:()=>S(ns,C.Optional|C.SkipSelf)||jm()});var Jc=new O("");var $n=null;function Vm(e=[],t){return Jt.create({name:t,providers:[{provide:hu,useValue:"platform"},{provide:Jc,useValue:new Set([()=>$n=null])},...e]})}function Bm(e=[]){if($n)return $n;let t=Vm(e);return $n=t,xm(),$m(t),t}function $m(e){e.get(hp,null)?.forEach(n=>n())}var rs=(()=>{let t=class t{};t.__NG_ELEMENT_ID__=Hm;let e=t;return e})();function Hm(e){return Um(U(),b(),(e&16)===16)}function Um(e,t,n){if(mr(e)&&!n){let r=xe(e.index,t);return new Ze(r,r)}else if(e.type&47){let r=t[ae];return new Ze(r,t)}return null}var gi=class{constructor(){}supports(t){return t instanceof Map||jc(t)}create(){return new mi}},mi=class{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return this._additionsHead!==null||this._changesHead!==null||this._removalsHead!==null}forEachItem(t){let n;for(n=this._mapHead;n!==null;n=n._next)t(n)}forEachPreviousItem(t){let n;for(n=this._previousMapHead;n!==null;n=n._nextPrevious)t(n)}forEachChangedItem(t){let n;for(n=this._changesHead;n!==null;n=n._nextChanged)t(n)}forEachAddedItem(t){let n;for(n=this._additionsHead;n!==null;n=n._nextAdded)t(n)}forEachRemovedItem(t){let n;for(n=this._removalsHead;n!==null;n=n._nextRemoved)t(n)}diff(t){if(!t)t=new Map;else if(!(t instanceof Map||jc(t)))throw new _(900,!1);return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let n=this._mapHead;if(this._appendAfter=null,this._forEach(t,(r,o)=>{if(n&&n.key===o)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{let i=this._getOrCreateRecordForKey(o,r);n=this._insertBeforeOrAppend(n,i)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;r!==null;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){let r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){let o=this._records.get(t);this._maybeAddToChanges(o,n);let i=o._prev,s=o._next;return i&&(i._next=s),s&&(s._prev=i),o._next=null,o._prev=null,o}let r=new yi(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;t!==null;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;t!==null;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;t!=null;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){this._additionsHead===null?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){this._changesHead===null?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}},yi=class{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}};function Va(){return new os([new gi])}var os=(()=>{let t=class t{constructor(r){this.factories=r}static create(r,o){if(o){let i=o.factories.slice();r=r.concat(i)}return new t(r)}static extend(r){return{provide:t,useFactory:o=>t.create(r,o||Va()),deps:[[t,new Td,new xd]]}}find(r){let o=this.factories.find(i=>i.supports(r));if(o)return o;throw new _(901,!1)}};t.\u0275prov=F({token:t,providedIn:"root",factory:Va});let e=t;return e})();function C0(e){try{let{rootComponent:t,appProviders:n,platformProviders:r}=e,o=Bm(r),i=[Pm(),...n||[]],a=new ar({providers:i,parent:o,debugName:"",runEnvironmentInitializers:!1}).injector,u=a.get(X);return u.run(()=>{a.resolveInjectorInitializers();let c=a.get(Qe,null),l;u.runOutsideAngular(()=>{l=u.onError.subscribe({next:f=>{c.handleError(f)}})});let d=()=>a.destroy(),p=o.get(Jc);return p.add(d),a.onDestroy(()=>{l.unsubscribe(),p.delete(d)}),Sm(c,u,()=>{let f=a.get(Zc);return f.runInitializers(),f.donePromise.then(()=>{let h=a.get(ns,lr);cm(h||lr);let y=a.get(Kc);return t!==void 0&&y.bootstrap(t),y})})})}catch(t){return Promise.reject(t)}}function Gm(e){return typeof e=="boolean"?e:e!=null&&e!=="false"}function is(e){let t=E(null);try{return e()}finally{E(t)}}function b0(e){let t=Ce(e);if(!t)return null;let n=new wt(t);return{get selector(){return n.selector},get type(){return n.componentType},get inputs(){return n.inputs},get outputs(){return n.outputs},get ngContentSelectors(){return n.ngContentSelectors},get isStandalone(){return t.standalone},get isSignal(){return t.signals}}}var ol=null;function ss(){return ol}function Y0(e){ol??=e}var Xc=class{};var ds=new O(""),fs=(()=>{let t=class t{historyGo(r){throw new Error("")}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:()=>S(zm),providedIn:"platform"});let e=t;return e})(),Q0=new O(""),zm=(()=>{let t=class t extends fs{constructor(){super(),this._doc=S(ds),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ss().getBaseHref(this._doc)}onPopState(r){let o=ss().getGlobalEventTarget(this._doc,"window");return o.addEventListener("popstate",r,!1),()=>o.removeEventListener("popstate",r)}onHashChange(r){let o=ss().getGlobalEventTarget(this._doc,"window");return o.addEventListener("hashchange",r,!1),()=>o.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,o,i){this._history.pushState(r,o,i)}replaceState(r,o,i){this._history.replaceState(r,o,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:()=>new t,providedIn:"platform"});let e=t;return e})();function ps(e,t){if(e.length==0)return t;if(t.length==0)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,n==2?e+t.substring(1):n==1?e+t:e+"/"+t}function el(e){let t=e.match(/#|\?|$/),n=t&&t.index||e.length,r=n-(e[n-1]==="/"?1:0);return e.slice(0,r)+e.slice(n)}function ve(e){return e&&e[0]!=="?"?"?"+e:e}var Ar=(()=>{let t=class t{historyGo(r){throw new Error("")}};t.\u0275fac=function(o){return new(o||t)},t.\u0275prov=F({token:t,factory:()=>S(qm),providedIn:"root"});let e=t;return e})(),il=new O(""),qm=(()=>{let t=class t extends Ar{constructor(r,o){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=o??this._platformLocation.getBaseHrefFromDOM()??S(ds).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 ps(this._baseHref,r)}path(r=!1){let o=this._platformLocation.pathname+ve(this._platformLocation.search),i=this._platformLocation.hash;return i&&r?`${o}${i}`:o}pushState(r,o,i,s){let a=this.prepareExternalUrl(i+ve(s));this._platformLocation.pushState(r,o,a)}replaceState(r,o,i,s){let a=this.prepareExternalUrl(i+ve(s));this._platformLocation.replaceState(r,o,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}};t.\u0275fac=function(o){return new(o||t)($(fs),$(il,8))},t.\u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})(),Z0=(()=>{let t=class t extends Ar{constructor(r,o){super(),this._platformLocation=r,this._baseHref="",this._removeListenerFns=[],o!=null&&(this._baseHref=o)}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){let o=this._platformLocation.hash??"#";return o.length>0?o.substring(1):o}prepareExternalUrl(r){let o=ps(this._baseHref,r);return o.length>0?"#"+o:o}pushState(r,o,i,s){let a=this.prepareExternalUrl(i+ve(s));a.length==0&&(a=this._platformLocation.pathname),this._platformLocation.pushState(r,o,a)}replaceState(r,o,i,s){let a=this.prepareExternalUrl(i+ve(s));a.length==0&&(a=this._platformLocation.pathname),this._platformLocation.replaceState(r,o,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}};t.\u0275fac=function(o){return new(o||t)($(fs),$(il,8))},t.\u0275prov=F({token:t,factory:t.\u0275fac});let e=t;return e})(),Ym=(()=>{let t=class t{constructor(r){this._subject=new Ve,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;let o=this._locationStrategy.getBaseHref();this._basePath=Km(el(tl(o))),this._locationStrategy.onPopState(i=>{this._subject.emit({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,o=""){return this.path()==this.normalize(r+ve(o))}normalize(r){return t.stripTrailingSlash(Zm(this._basePath,tl(r)))}prepareExternalUrl(r){return r&&r[0]!=="/"&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,o="",i=null){this._locationStrategy.pushState(i,"",r,o),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+ve(o)),i)}replaceState(r,o="",i=null){this._locationStrategy.replaceState(i,"",r,o),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+ve(o)),i)}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(o=>{this._notifyUrlChangeListeners(o.url,o.state)}),()=>{let o=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(o,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",o){this._urlChangeListeners.forEach(i=>i(r,o))}subscribe(r,o,i){return this._subject.subscribe({next:r,error:o,complete:i})}};t.normalizeQueryParams=ve,t.joinWithSlash=ps,t.stripTrailingSlash=el,t.\u0275fac=function(o){return new(o||t)($(Ar))},t.\u0275prov=F({token:t,factory:()=>Qm(),providedIn:"root"});let e=t;return e})();function Qm(){return new Ym($(Ar))}function Zm(e,t){if(!e||!t.startsWith(e))return t;let n=t.substring(e.length);return n===""||["/",";","?","#"].includes(n[0])?n:t}function tl(e){return e.replace(/\/index.html$/,"")}function Km(e){if(new RegExp("^(https?:)?//").test(e)){let[,n]=e.split(/\/\/[^\/]+/);return n}return e}function K0(e,t){t=encodeURIComponent(t);for(let n of e.split(";")){let r=n.indexOf("="),[o,i]=r==-1?[n,""]:[n.slice(0,r),n.slice(r+1)];if(o.trim()===t)return decodeURIComponent(i)}return null}var J0=(()=>{let t=class t{constructor(r){this._viewContainerRef=r,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null,this.ngTemplateOutletInjector=null}ngOnChanges(r){if(this._shouldRecreateView(r)){let o=this._viewContainerRef;if(this._viewRef&&o.remove(o.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let i=this._createContextForwardProxy();this._viewRef=o.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(r){return!!r.ngTemplateOutlet||!!r.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(r,o,i)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,o,i):!1,get:(r,o,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,o,i)}})}};t.\u0275fac=function(o){return new(o||t)(Te(tn))},t.\u0275dir=iu({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},standalone:!0,features:[_i]});let e=t;return e})();function Jm(e,t){return new _(2100,!1)}var as=class{createSubscription(t,n){return is(()=>t.subscribe({next:n,error:r=>{throw r}}))}dispose(t){is(()=>t.unsubscribe())}},us=class{createSubscription(t,n){return t.then(n,r=>{throw r})}dispose(t){}},Xm=new us,ey=new as,X0=(()=>{let t=class t{constructor(r){this._latestValue=null,this.markForCheckOnValueUpdate=!0,this._subscription=null,this._obj=null,this._strategy=null,this._ref=r}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(r){if(!this._obj){if(r)try{this.markForCheckOnValueUpdate=!1,this._subscribe(r)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return r!==this._obj?(this._dispose(),this.transform(r)):this._latestValue}_subscribe(r){this._obj=r,this._strategy=this._selectStrategy(r),this._subscription=this._strategy.createSubscription(r,o=>this._updateLatestValue(r,o))}_selectStrategy(r){if(Nr(r))return Xm;if(ts(r))return ey;throw Jm(t,r)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(r,o){r===this._obj&&(this._latestValue=o,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}};t.\u0275fac=function(o){return new(o||t)(Te(rs,16))},t.\u0275pipe=hr({name:"async",type:t,pure:!1,standalone:!0});let e=t;return e})();var eM=(()=>{let t=class t{transform(r){return JSON.stringify(r,null,2)}};t.\u0275fac=function(o){return new(o||t)},t.\u0275pipe=hr({name:"json",type:t,pure:!1,standalone:!0});let e=t;return e})();function ty(e,t){return{key:e,value:t}}var tM=(()=>{let t=class t{constructor(r){this.differs=r,this.keyValues=[],this.compareFn=nl}transform(r,o=nl){if(!r||!(r instanceof Map)&&typeof r!="object")return null;this.differ??=this.differs.find(r).create();let i=this.differ.diff(r),s=o!==this.compareFn;return i&&(this.keyValues=[],i.forEachItem(a=>{this.keyValues.push(ty(a.key,a.currentValue))})),(i||s)&&(this.keyValues.sort(o),this.compareFn=o),this.keyValues}};t.\u0275fac=function(o){return new(o||t)(Te(os,16))},t.\u0275pipe=hr({name:"keyvalue",type:t,pure:!1,standalone:!0});let e=t;return e})();function nl(e,t){let n=e.key,r=t.key;if(n===r)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(n===null)return 1;if(r===null)return-1;if(typeof n=="string"&&typeof r=="string")return n{let t=class t{};t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=ou({type:t}),t.\u0275inj=Wa({});let e=t;return e})(),ny="browser",ry="server";function oy(e){return e===ny}function rM(e){return e===ry}var oM=(()=>{let t=class t{};t.\u0275prov=F({token:t,providedIn:"root",factory:()=>oy(S(Li))?new cs(S(ds),window):new ls});let e=t;return e})(),cs=class{constructor(t,n){this.document=t,this.window=n,this.offset=()=>[0,0]}setOffset(t){Array.isArray(t)?this.offset=()=>t:this.offset=t}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(t){this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){let n=iy(this.document,t);n&&(this.scrollToElement(n),n.focus())}setHistoryScrollRestoration(t){this.window.history.scrollRestoration=t}scrollToElement(t){let n=t.getBoundingClientRect(),r=n.left+this.window.pageXOffset,o=n.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(r-i[0],o-i[1])}};function iy(e,t){let n=e.getElementById(t)||e.getElementsByName(t)[0];if(n)return n;if(typeof e.createTreeWalker=="function"&&e.body&&typeof e.body.attachShadow=="function"){let r=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT),o=r.currentNode;for(;o;){let i=o.shadowRoot;if(i){let s=i.getElementById(t)||i.querySelector(`[name="${t}"]`);if(s)return s}o=r.nextNode()}}return null}var ls=class{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}},rl=class{};export{_t as a,xt as b,sy as c,ay as d,uy as e,cy as f,gl as g,R as h,Ur as i,qr as j,Yr as k,Z as l,Tt as m,Nt as n,Re as o,J as p,Ol as q,Fl as r,Rl as s,ke as t,ce as u,Hl as v,Le as w,je as x,Sn as y,Ul as z,Gl as A,Wl as B,we as C,Ys as D,ql as E,Yl as F,Ql as G,Ot as H,Jr as I,Zl as J,Kl as K,ed as L,Zs as M,Xr as N,td as O,nd as P,rd as Q,od as R,id as S,Xs as T,ea as U,sd as V,ta as W,ra as X,ad as Y,_ as Z,F as _,Wa as $,Ub as aa,O as ba,C as ca,$ as da,S as ea,xd as fa,Td as ga,kt as ha,Ue as ia,Gb as ja,ou as ka,iu as la,Zd as ma,hu as na,be as oa,cf as pa,_i as qa,Wb as ra,zb as sa,qb as ta,np as ua,Jt as va,Qe as wa,Mt as xa,Ve as ya,Yb as za,Qb as Aa,hp as Ba,Li as Ca,Zb as Da,Kb as Ea,Jb as Fa,Xn as Ga,Xb as Ha,Te as Ia,e0 as Ja,Wt as Ka,$o as La,Ac as Ma,X as Na,eg as Oa,tn as Pa,_g as Qa,Jo as Ra,xg as Sa,Lc as Ta,ti as Ua,Rg as Va,Hg as Wa,Bc as Xa,Ug as Ya,o0 as Za,i0 as _a,s0 as $a,a0 as ab,Hc as bb,Uc as cb,rm as db,sm as eb,u0 as fb,lm as gb,c0 as hb,l0 as ib,d0 as jb,f0 as kb,p0 as lb,h0 as mb,gm as nb,zc as ob,g0 as pb,m0 as qb,y0 as rb,D0 as sb,v0 as tb,w0 as ub,I0 as vb,Nr as wb,Mm as xb,_m as yb,Kc as zb,E0 as Ab,rs as Bb,C0 as Cb,Gm as Db,b0 as Eb,ss as Fb,Y0 as Gb,Xc as Hb,ds as Ib,Q0 as Jb,Ar as Kb,qm as Lb,Z0 as Mb,Ym as Nb,K0 as Ob,J0 as Pb,X0 as Qb,eM as Rb,tM as Sb,nM as Tb,ny as Ub,rM as Vb,oM as Wb,rl as Xb}; diff --git a/docs/chunk-OI2SMRDK.js b/docs/chunk-OI2SMRDK.js new file mode 100644 index 0000000..713301f --- /dev/null +++ b/docs/chunk-OI2SMRDK.js @@ -0,0 +1,3 @@ +import{c as I}from"./chunk-KRYPOJUJ.js";import{$a as N,E as Y,Ha as m,Ia as f,Nb as ce,Qb as A,R as Z,Rb as se,T as J,Tb as O,Ua as oe,Wa as b,Xa as D,Za as ne,_ as M,_a as B,a as S,ab as R,b as q,bb as d,cb as l,da as ee,db as ie,e as de,fb as X,gb as L,hb as a,ja as P,m as y,mb as g,nb as re,ob as U,pb as $,qa as te,qb as V,ra as h,sa as x,tb as _,u as j,ub as k}from"./chunk-M6PASJEJ.js";var v=(()=>{let o=class o{constructor(){this.selected$=new y(void 0)}set selected(t){this.selected$.next(t)}get selected(){return this.selected$.value}onMouseDown(t,e){this.selected=this.selected?void 0:{start:e,end:e,type:"range"}}onMouseEnter(t,e){t.buttons===1&&this.selected&&(this.selected=q(S({},this.selected),{end:e}))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=M({token:o,factory:o.\u0275fac,providedIn:"platform"});let i=o;return i})();var E=(()=>{let o=class o{set positions(t){this.input$.next(t)}get positions(){return this.input$.value}constructor(t){this.selectionService=t,this.input$=new y([])}};o.\u0275fac=function(e){return new(e||o)(ee(v))},o.\u0275prov=M({token:o,factory:o.\u0275fac,providedIn:"platform"});let i=o;return i})();var w={};de(w,{ClustalX:()=>z,Physical:()=>ae});var z={A:{background:"#FFBF00",color:"#000000"},R:{background:"#FF0000",color:"#FFFFFF"},N:{background:"#00FFFF",color:"#000000"},D:{background:"#0000FF",color:"#FFFFFF"},C:{background:"#FFFF00",color:"#000000"},Q:{background:"#00FF00",color:"#000000"},E:{background:"#FF00FF",color:"#FFFFFF"},G:{background:"#808080",color:"#FFFFFF"},H:{background:"#008000",color:"#FFFFFF"},I:{background:"#FFA500",color:"#000000"},L:{background:"#FFA500",color:"#000000"},K:{background:"#FF0000",color:"#FFFFFF"},M:{background:"#FFA500",color:"#000000"},F:{background:"#FFA500",color:"#000000"},P:{background:"#800080",color:"#FFFFFF"},S:{background:"#00FF00",color:"#000000"},T:{background:"#00FF00",color:"#000000"},W:{background:"#FFA500",color:"#000000"},Y:{background:"#FFA500",color:"#000000"},V:{background:"#FFA500",color:"#000000"},B:{background:"#FFA500",color:"#000000"},Z:{background:"#FFA500",color:"#000000"},X:{background:"#FFA500",color:"#000000"},"-":{background:"#FFFFFF",color:"#000000"}},ae={G:{background:"#808080",color:"#FFFFFF"},A:{background:"#808080",color:"#FFFFFF"},V:{background:"#808080",color:"#FFFFFF"},L:{background:"#808080",color:"#FFFFFF"},I:{background:"#808080",color:"#FFFFFF"},M:{background:"#808080",color:"#FFFFFF"},F:{background:"#808080",color:"#FFFFFF"},W:{background:"#808080",color:"#FFFFFF"},P:{background:"#808080",color:"#FFFFFF"},S:{background:"#00FF00",color:"#000000"},T:{background:"#00FF00",color:"#000000"},C:{background:"#00FF00",color:"#000000"},Y:{background:"#00FF00",color:"#000000"},N:{background:"#00FF00",color:"#000000"},Q:{background:"#00FF00",color:"#000000"},D:{background:"#FF0000",color:"#FFFFFF"},E:{background:"#FF0000",color:"#FFFFFF"},R:{background:"#0000FF",color:"#FFFFFF"},H:{background:"#0000FF",color:"#FFFFFF"},K:{background:"#0000FF",color:"#FFFFFF"},B:{background:"#FFA500",color:"#000000"},Z:{background:"#FFA500",color:"#000000"},X:{background:"#FFA500",color:"#000000"},"-":{background:"#FFFFFF",color:"#000000"}};function pe(i,o){if(i&1){let c=X();d(0,"div",4),L("mouseenter",function(e){let n=h(c).$index,r=a();return x(r.onMouseEnter(e,r.index[n]))})("mousedown",function(e){let n=h(c).$index,r=a();return x(r.onMouseDown(e,r.index[n]))})("mouseup",function(e){h(c);let n=a();return x(n.onMouseUp(e))}),g(1),l()}if(i&2){let c=o.$implicit,t=o.$index,e=a();D("background",c==null?null:c.background)("color",c==null?null:c.color),b("id","index-residue-"+t),m(),U(" ",e.index[t]," ")}}function me(i,o){if(i&1){let c=X();d(0,"div",5),L("mouseenter",function(e){let n=h(c).$index,r=a();return x(r.onMouseEnter(e,r.index[n]))})("mousedown",function(e){let n=h(c).$index,r=a();return x(r.onMouseDown(e,r.index[n]))})("mouseup",function(e){h(c);let n=a();return x(n.onMouseUp(e))}),g(1),l()}if(i&2){let c=o.$implicit,t=o.$index,e=a();D("background",e.colors[c].background||e.colors["-"].background)("color",e.colors[c].color||e.colors["-"].color),b("id","sequence-residue-"+t),m(),U(" ",c," ")}}var G=(()=>{let o=class o{set positions(t){this.positionsService.positions=t}get positions(){return this.positionsService.positions}constructor(t,e){this.positionsService=t,this.selectionService=e,this.selected$=this.selectionService.selected$,this.positions$=this.selectionService.selected$.pipe(j(n=>q(S({},n),{background:"#FFFFFF",color:"#000000"})),J(void 0),Y(this.positionsService.input$),j(([n,r])=>{r=[...r];let s=new Map(this.index.map((F,p)=>[F,p])),u=n?.start,C=n?.end;if(u!=null&&C!=null){let F=s.get(u),p=s.get(C);F>p&&([F,p]=[p,F]),r.splice(F,p-F+1,...Array(p-F+1).fill(n))}return r}),Z(1))}ngOnChanges(t){if(t){if(t.sequence||t.index){if(typeof this.sequence=="string"){if(!this.description&&this.sequence[0]===">"){let[s,...u]=this.sequence.split(` +`);this.description=s,this.sequence=u.join(` +`)}this.sequence=this.sequence.replace(/[\n\r\s\t]+/g,"").split("")}this.index||(this.index=Array.from({length:this.sequence.length},(s,u)=>u+1))}this.colors||(this.colors=z);let e=new Map(this.index.map((s,u)=>[s,u])),n=new Array(this.index.length).fill(void 0),r=(this.loci||[]).map(({start:s,end:u,type:C,background:F,color:p})=>{let H=e.get(s),K=u!==void 0?e.get(u):s,Q={start:H,end:K,type:C,background:F,color:p};for(let T=H;T<=K;T++)n[T]=Q;return Q});r.sort((s,u)=>s.start-u.start||(s.end||0)-(u.end||0)),this.loci=r,this.positions=n}}onMouseUp(t){}onMouseDown(t,e){this.selectionService.onMouseDown(t,e)}onMouseEnter(t,e){this.selectionService.onMouseEnter(t,e)}};o.\u0275fac=function(e){return new(e||o)(f(E),f(v))},o.\u0275cmp=P({type:o,selectors:[["ngx-sequence-viewer"]],inputs:{loci:"loci",index:"index",sequence:"sequence",colors:"colors",description:"description"},outputs:{selected$:"selected"},standalone:!0,features:[$([E,v]),te,V],decls:7,vars:2,consts:[[1,"index"],[1,"index-residue",3,"id","background","color"],[1,"sequence"],[1,"sequence-residue",3,"id","background","color"],[1,"index-residue",3,"mouseenter","mousedown","mouseup","id"],[1,"sequence-residue",3,"mouseenter","mousedown","mouseup","id"]],template:function(e,n){e&1&&(d(0,"div",0),N(1,pe,2,6,"div",1,B),_(3,"async"),l(),d(4,"div",2),N(5,me,2,6,"div",3,B),l()),e&2&&(m(),R(k(3,0,n.positions$)),m(4),R(n.sequence))},dependencies:[O,A],styles:["[_nghost-%COMP%]{cursor:default;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .sequence[_ngcontent-%COMP%], [_nghost-%COMP%] .index[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch}[_nghost-%COMP%] .sequence[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], [_nghost-%COMP%] .index[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:0 0 auto;display:block;height:1rem;width:1rem;text-align:center;font-size:inherit;line-height:1rem}[_nghost-%COMP%] .sequence[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{text-align:center;vertical-align:center}[_nghost-%COMP%] .index[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:auto;text-align:left;transform:rotate(-180deg);writing-mode:vertical-rl;white-space:nowrap;padding-bottom:.25rem;padding-top:.25rem}"]});let i=o;return i})();function ge(i,o){if(i&1&&ie(0,"ngx-sequence-viewer",6),i&2){let c=a();b("sequence",c.sequence)("index",c.index)("loci",c.loci)("colors",c.colors)}}var Ve=(()=>{let o=class o{constructor(t,e){this.structureService=t,this.location=e,this.loci=[{start:"12",end:"43",type:"range",background:"#007A78",color:"#FFC745"},{start:"57",end:"58",type:"range",background:"#BDE673",color:"#000000"}],this.colors=w.ClustalX,this.structure$=this.structureService.structure$,this._structure=this.structure$.subscribe(()=>{this.sequence=this.structureService.residues.map(({authCompId1:r})=>r),this.index=this.structureService.residues.map(({authSeqId:r,pdbInsCode:s})=>r+s)});let n=this.location.prepareExternalUrl("assets/8vap.A.cif");this.source=this.structureService.source={type:"remote",label:"8VAP",binary:!1,format:"mmcif",link:n}}ngOnDestroy(){this._structure.unsubscribe()}};o.\u0275fac=function(e){return new(e||o)(f(I),f(ce))},o.\u0275cmp=P({type:o,selectors:[["app-page-sequence-viewer"]],standalone:!0,features:[$([I]),V],decls:17,vars:6,consts:[[1,"container","pt-3"],[1,"row"],[1,"col-7"],[1,"col-5"],[1,"rounded","bg-body-tertiary","p-3"],["id","sequence-viewer-structure",1,"d-block","rounded","border","w-100","h-auto",2,"overflow-x","auto","overflow-y","hidden"],[3,"sequence","index","loci","colors"]],template:function(e,n){e&1&&(d(0,"div",0)(1,"h1"),g(2,"Sequence viewer"),l(),d(3,"div")(4,"h2"),g(5,"Visualize structure"),l(),d(6,"div",1)(7,"div",2),g(8," In this example, the sequence underlying the PDB structure `1BRR`, chain `A` is shown. The colouring scheme chosen is based on the structural characteristics of the amino acids. "),l(),d(9,"div",3)(10,"code")(11,"pre",4),g(12),_(13,"json"),l()()()(),d(14,"div",5),oe(15,ge,1,4,"ngx-sequence-viewer",6),_(16,"async"),l()()()),e&2&&(m(12),re(k(13,2,n.source)),m(3),ne(15,k(16,4,n.structure$)?15:-1))},dependencies:[O,A,se,G]});let i=o;return i})();export{Ve as PageSequenceViewerComponent}; diff --git a/docs/chunk-TMD3IN23.js b/docs/chunk-TMD3IN23.js new file mode 100644 index 0000000..b51b83b --- /dev/null +++ b/docs/chunk-TMD3IN23.js @@ -0,0 +1 @@ +import{$ as Mt,Aa as jt,Ab as Ye,Ba as nr,Bb as Vt,C as Q,Ca as ye,Cb as vr,D as J,Da as kt,Db as Xe,Ea as rr,Eb as mr,F as ee,Fb as Bt,Ga as Se,Gb as yr,H as It,Hb as Sr,I as te,Ia as re,Ib as L,J as Bn,Ja as ir,Jb as Cr,Kb as Ce,L as Ze,La as sr,Lb as wr,M as H,Ma as or,Mb as Rr,N as Et,Na as x,Nb as we,O as qn,Oa as $t,Ob as br,Pa as ar,Q as Wn,Qa as cr,Ra as ur,Sa as _t,T as Gn,Ta as lr,U,Ub as Ir,V as Zn,Va as hr,Vb as qt,W as I,Wb as Er,Xb as Mr,Z as R,_ as C,a as h,aa as Kn,b as E,ba as M,ca as Tt,da as y,db as dr,ea as d,fa as At,g as $n,ga as Qn,gb as fr,h as _n,ha as ve,i as Fn,ia as Ke,j as Ct,ja as Yn,k as wt,ka as Dt,l as F,la as Ot,m as N,ma as Nt,na as Xn,o as z,oa as ne,p as T,pa as V,q as f,qa as Pt,qb as pr,r as ge,s as zn,t as Hn,ta as Ut,u as S,ua as Jn,v as Ge,va as xt,vb as Qe,w as A,wa as Lt,wb as gr,x as Rt,xa as er,xb as Ft,y as Vn,ya as me,yb as zt,z as bt,za as tr,zb as Ht}from"./chunk-M6PASJEJ.js";var Zt=class extends Sr{constructor(){super(...arguments),this.supportsDOMEvents=!0}},Kt=class n extends Zt{static makeCurrent(){yr(new n)}onAndCancel(e,i,t){return e.addEventListener(i,t),()=>{e.removeEventListener(i,t)}}dispatchEvent(e,i){e.dispatchEvent(i)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,i){return i=i||this.getDefaultDocument(),i.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,i){return i==="window"?window:i==="document"?e:i==="body"?e.body:null}getBaseHref(e){let i=Di();return i==null?null:Oi(i)}resetBaseElement(){Re=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return br(document.cookie,e)}},Re=null;function Di(){return Re=Re||document.querySelector("base"),Re?Re.getAttribute("href"):null}function Oi(n){return new URL(n,document.baseURI).pathname}var Ni=(()=>{let e=class e{build(){return new XMLHttpRequest}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})(),Qt=new M(""),Or=(()=>{let e=class e{constructor(t,r){this._zone=r,this._eventNameToPlugin=new Map,t.forEach(s=>{s.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,r,s){return this._findPluginFor(r).addEventListener(t,r,s)}getZone(){return this._zone}_findPluginFor(t){let r=this._eventNameToPlugin.get(t);if(r)return r;if(r=this._plugins.find(o=>o.supports(t)),!r)throw new R(5101,!1);return this._eventNameToPlugin.set(t,r),r}};e.\u0275fac=function(r){return new(r||e)(y(Qt),y(x))},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})(),Je=class{constructor(e){this._doc=e}},Wt="ng-app-id",Nr=(()=>{let e=class e{constructor(t,r,s,o={}){this.doc=t,this.appId=r,this.nonce=s,this.platformId=o,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=qt(o),this.resetHostNodes()}addStyles(t){for(let r of t)this.changeUsageCount(r,1)===1&&this.onStyleAdded(r)}removeStyles(t){for(let r of t)this.changeUsageCount(r,-1)<=0&&this.onStyleRemoved(r)}ngOnDestroy(){let t=this.styleNodesInDOM;t&&(t.forEach(r=>r.remove()),t.clear());for(let r of this.getAllStyles())this.onStyleRemoved(r);this.resetHostNodes()}addHost(t){this.hostNodes.add(t);for(let r of this.getAllStyles())this.addStyleToHost(t,r)}removeHost(t){this.hostNodes.delete(t)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(t){for(let r of this.hostNodes)this.addStyleToHost(r,t)}onStyleRemoved(t){let r=this.styleRef;r.get(t)?.elements?.forEach(s=>s.remove()),r.delete(t)}collectServerRenderedStyles(){let t=this.doc.head?.querySelectorAll(`style[${Wt}="${this.appId}"]`);if(t?.length){let r=new Map;return t.forEach(s=>{s.textContent!=null&&r.set(s.textContent,s)}),r}return null}changeUsageCount(t,r){let s=this.styleRef;if(s.has(t)){let o=s.get(t);return o.usage+=r,o.usage}return s.set(t,{usage:r,elements:[]}),r}getStyleElement(t,r){let s=this.styleNodesInDOM,o=s?.get(r);if(o?.parentNode===t)return s.delete(r),o.removeAttribute(Wt),o;{let a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=r,this.platformIsServer&&a.setAttribute(Wt,this.appId),t.appendChild(a),a}}addStyleToHost(t,r){let s=this.getStyleElement(t,r),o=this.styleRef,a=o.get(r)?.elements;a?a.push(s):o.set(r,{elements:[s],usage:1})}resetHostNodes(){let t=this.hostNodes;t.clear(),t.add(this.doc.head)}};e.\u0275fac=function(r){return new(r||e)(y(L),y(jt),y(kt,8),y(ye))},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})(),Gt={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/"},Xt=/%COMP%/g,Pr="%COMP%",Pi=`_nghost-${Pr}`,Ui=`_ngcontent-${Pr}`,xi=!0,Li=new M("",{providedIn:"root",factory:()=>xi});function ji(n){return Ui.replace(Xt,n)}function ki(n){return Pi.replace(Xt,n)}function Ur(n,e){return e.map(i=>i.replace(Xt,n))}var Tr=(()=>{let e=class e{constructor(t,r,s,o,a,u,c,l=null){this.eventManager=t,this.sharedStylesHost=r,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=a,this.platformId=u,this.ngZone=c,this.nonce=l,this.rendererByCompId=new Map,this.platformIsServer=qt(u),this.defaultRenderer=new be(t,a,c,this.platformIsServer)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;this.platformIsServer&&r.encapsulation===ve.ShadowDom&&(r=E(h({},r),{encapsulation:ve.Emulated}));let s=this.getOrCreateRenderer(t,r);return s instanceof et?s.applyToHost(t):s instanceof Ie&&s.applyStyles(),s}getOrCreateRenderer(t,r){let s=this.rendererByCompId,o=s.get(r.id);if(!o){let a=this.doc,u=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,p=this.removeStylesOnCompDestroy,v=this.platformIsServer;switch(r.encapsulation){case ve.Emulated:o=new et(c,l,r,this.appId,p,a,u,v);break;case ve.ShadowDom:return new Yt(c,l,t,r,a,u,this.nonce,v);default:o=new Ie(c,l,r,p,a,u,v);break}s.set(r.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}};e.\u0275fac=function(r){return new(r||e)(y(Or),y(Nr),y(jt),y(Li),y(L),y(ye),y(x),y(kt))},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})(),be=class{constructor(e,i,t,r){this.eventManager=e,this.doc=i,this.ngZone=t,this.platformIsServer=r,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(e,i){return i?this.doc.createElementNS(Gt[i]||i,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,i){(Ar(e)?e.content:e).appendChild(i)}insertBefore(e,i,t){e&&(Ar(e)?e.content:e).insertBefore(i,t)}removeChild(e,i){e&&e.removeChild(i)}selectRootElement(e,i){let t=typeof e=="string"?this.doc.querySelector(e):e;if(!t)throw new R(-5104,!1);return i||(t.textContent=""),t}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,i,t,r){if(r){i=r+":"+i;let s=Gt[r];s?e.setAttributeNS(s,i,t):e.setAttribute(i,t)}else e.setAttribute(i,t)}removeAttribute(e,i,t){if(t){let r=Gt[t];r?e.removeAttributeNS(r,i):e.removeAttribute(`${t}:${i}`)}else e.removeAttribute(i)}addClass(e,i){e.classList.add(i)}removeClass(e,i){e.classList.remove(i)}setStyle(e,i,t,r){r&(Se.DashCase|Se.Important)?e.style.setProperty(i,t,r&Se.Important?"important":""):e.style[i]=t}removeStyle(e,i,t){t&Se.DashCase?e.style.removeProperty(i):e.style[i]=""}setProperty(e,i,t){e!=null&&(e[i]=t)}setValue(e,i){e.nodeValue=i}listen(e,i,t){if(typeof e=="string"&&(e=Bt().getGlobalEventTarget(this.doc,e),!e))throw new Error(`Unsupported event target ${e} for event ${i}`);return this.eventManager.addEventListener(e,i,this.decoratePreventDefault(t))}decoratePreventDefault(e){return i=>{if(i==="__ngUnwrap__")return e;(this.platformIsServer?this.ngZone.runGuarded(()=>e(i)):e(i))===!1&&i.preventDefault()}}};function Ar(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var Yt=class extends be{constructor(e,i,t,r,s,o,a,u){super(e,s,o,u),this.sharedStylesHost=i,this.hostEl=t,this.shadowRoot=t.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let c=Ur(r.id,r.styles);for(let l of c){let p=document.createElement("style");a&&p.setAttribute("nonce",a),p.textContent=l,this.shadowRoot.appendChild(p)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,i){return super.appendChild(this.nodeOrShadowRoot(e),i)}insertBefore(e,i,t){return super.insertBefore(this.nodeOrShadowRoot(e),i,t)}removeChild(e,i){return super.removeChild(this.nodeOrShadowRoot(e),i)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},Ie=class extends be{constructor(e,i,t,r,s,o,a,u){super(e,s,o,a),this.sharedStylesHost=i,this.removeStylesOnCompDestroy=r,this.styles=u?Ur(u,t.styles):t.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}},et=class extends Ie{constructor(e,i,t,r,s,o,a,u){let c=r+"-"+t.id;super(e,i,t,s,o,a,u,c),this.contentAttr=ji(c),this.hostAttr=ki(c)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,i){let t=super.createElement(e,i);return super.setAttribute(t,this.contentAttr,""),t}},$i=(()=>{let e=class e extends Je{constructor(t){super(t)}supports(t){return!0}addEventListener(t,r,s){return t.addEventListener(r,s,!1),()=>this.removeEventListener(t,r,s)}removeEventListener(t,r,s){return t.removeEventListener(r,s)}};e.\u0275fac=function(r){return new(r||e)(y(L))},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})(),Dr=["alt","control","meta","shift"],_i={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Fi={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},zi=(()=>{let e=class e extends Je{constructor(t){super(t)}supports(t){return e.parseEventName(t)!=null}addEventListener(t,r,s){let o=e.parseEventName(r),a=e.eventCallback(o.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Bt().onAndCancel(t,o.domEventName,a))}static parseEventName(t){let r=t.toLowerCase().split("."),s=r.shift();if(r.length===0||!(s==="keydown"||s==="keyup"))return null;let o=e._normalizeKey(r.pop()),a="",u=r.indexOf("code");if(u>-1&&(r.splice(u,1),a="code."),Dr.forEach(l=>{let p=r.indexOf(l);p>-1&&(r.splice(p,1),a+=l+".")}),a+=o,r.length!=0||o.length===0)return null;let c={};return c.domEventName=s,c.fullKey=a,c}static matchEventFullKeyCode(t,r){let s=_i[t.key]||t.key,o="";return r.indexOf("code.")>-1&&(s=t.code,o="code."),s==null||!s?!1:(s=s.toLowerCase(),s===" "?s="space":s==="."&&(s="dot"),Dr.forEach(a=>{if(a!==s){let u=Fi[a];u(t)&&(o+=a+".")}}),o+=s,o===r)}static eventCallback(t,r,s){return o=>{e.matchEventFullKeyCode(o,t)&&s.runGuarded(()=>r(o))}}static _normalizeKey(t){return t==="esc"?"escape":t}};e.\u0275fac=function(r){return new(r||e)(y(L))},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})();function Ea(n,e){return vr(h({rootComponent:n},Hi(e)))}function Hi(n){return{appProviders:[...Gi,...n?.providers??[]],platformProviders:Wi}}function Vi(){Kt.makeCurrent()}function Bi(){return new Lt}function qi(){return tr(document),document}var Wi=[{provide:ye,useValue:Ir},{provide:nr,useValue:Vi,multi:!0},{provide:L,useFactory:qi,deps:[]}];var Gi=[{provide:Xn,useValue:"root"},{provide:Lt,useFactory:Bi,deps:[]},{provide:Qt,useClass:$i,multi:!0,deps:[L,x,ye]},{provide:Qt,useClass:zi,multi:!0,deps:[L]},Tr,Nr,Or,{provide:sr,useExisting:Tr},{provide:Mr,useClass:Ni,deps:[]},[]];var xr=(()=>{let e=class e{constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}};e.\u0275fac=function(r){return new(r||e)(y(L))},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var g="primary",Fe=Symbol("RouteTitle"),rn=class{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){let i=this.params[e];return Array.isArray(i)?i[0]:i}return null}getAll(e){if(this.has(e)){let i=this.params[e];return Array.isArray(i)?i:[i]}return[]}get keys(){return Object.keys(this.params)}};function ce(n){return new rn(n)}function Ki(n,e,i){let t=i.path.split("/");if(t.length>n.length||i.pathMatch==="full"&&(e.hasChildren()||t.lengtht[s]===r)}else return n===e}function Br(n){return n.length>0?n[n.length-1]:null}function Z(n){return zn(n)?n:gr(n)?T(Promise.resolve(n)):f(n)}var Yi={exact:Wr,subset:Gr},qr={exact:Xi,subset:Ji,ignored:()=>!0};function Lr(n,e,i){return Yi[i.paths](n.root,e.root,i.matrixParams)&&qr[i.queryParams](n.queryParams,e.queryParams)&&!(i.fragment==="exact"&&n.fragment!==e.fragment)}function Xi(n,e){return j(n,e)}function Wr(n,e,i){if(!X(n.segments,e.segments)||!rt(n.segments,e.segments,i)||n.numberOfChildren!==e.numberOfChildren)return!1;for(let t in e.children)if(!n.children[t]||!Wr(n.children[t],e.children[t],i))return!1;return!0}function Ji(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(i=>Vr(n[i],e[i]))}function Gr(n,e,i){return Zr(n,e,e.segments,i)}function Zr(n,e,i,t){if(n.segments.length>i.length){let r=n.segments.slice(0,i.length);return!(!X(r,i)||e.hasChildren()||!rt(r,i,t))}else if(n.segments.length===i.length){if(!X(n.segments,i)||!rt(n.segments,i,t))return!1;for(let r in e.children)if(!n.children[r]||!Gr(n.children[r],e.children[r],t))return!1;return!0}else{let r=i.slice(0,n.segments.length),s=i.slice(n.segments.length);return!X(n.segments,r)||!rt(n.segments,r,t)||!n.children[g]?!1:Zr(n.children[g],e,s,t)}}function rt(n,e,i){return e.every((t,r)=>qr[i](n[r].parameters,t.parameters))}var B=class{constructor(e=new m([],{}),i={},t=null){this.root=e,this.queryParams=i,this.fragment=t}get queryParamMap(){return this._queryParamMap??=ce(this.queryParams),this._queryParamMap}toString(){return ns.serialize(this)}},m=class{constructor(e,i){this.segments=e,this.children=i,this.parent=null,Object.values(i).forEach(t=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return it(this)}},Y=class{constructor(e,i){this.path=e,this.parameters=i}get parameterMap(){return this._parameterMap??=ce(this.parameters),this._parameterMap}toString(){return Qr(this)}};function es(n,e){return X(n,e)&&n.every((i,t)=>j(i.parameters,e[t].parameters))}function X(n,e){return n.length!==e.length?!1:n.every((i,t)=>i.path===e[t].path)}function ts(n,e){let i=[];return Object.entries(n.children).forEach(([t,r])=>{t===g&&(i=i.concat(e(r,t)))}),Object.entries(n.children).forEach(([t,r])=>{t!==g&&(i=i.concat(e(r,t)))}),i}var ze=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:()=>new Ne,providedIn:"root"});let n=e;return n})(),Ne=class{parse(e){let i=new an(e);return new B(i.parseRootSegment(),i.parseQueryParams(),i.parseFragment())}serialize(e){let i=`/${Ee(e.root,!0)}`,t=ss(e.queryParams),r=typeof e.fragment=="string"?`#${rs(e.fragment)}`:"";return`${i}${t}${r}`}},ns=new Ne;function it(n){return n.segments.map(e=>Qr(e)).join("/")}function Ee(n,e){if(!n.hasChildren())return it(n);if(e){let i=n.children[g]?Ee(n.children[g],!1):"",t=[];return Object.entries(n.children).forEach(([r,s])=>{r!==g&&t.push(`${r}:${Ee(s,!1)}`)}),t.length>0?`${i}(${t.join("//")})`:i}else{let i=ts(n,(t,r)=>r===g?[Ee(n.children[g],!1)]:[`${r}:${Ee(t,!1)}`]);return Object.keys(n.children).length===1&&n.children[g]!=null?`${it(n)}/${i[0]}`:`${it(n)}/(${i.join("//")})`}}function Kr(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function tt(n){return Kr(n).replace(/%3B/gi,";")}function rs(n){return encodeURI(n)}function on(n){return Kr(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function st(n){return decodeURIComponent(n)}function jr(n){return st(n.replace(/\+/g,"%20"))}function Qr(n){return`${on(n.path)}${is(n.parameters)}`}function is(n){return Object.entries(n).map(([e,i])=>`;${on(e)}=${on(i)}`).join("")}function ss(n){let e=Object.entries(n).map(([i,t])=>Array.isArray(t)?t.map(r=>`${tt(i)}=${tt(r)}`).join("&"):`${tt(i)}=${tt(t)}`).filter(i=>i);return e.length?`?${e.join("&")}`:""}var os=/^[^\/()?;#]+/;function Jt(n){let e=n.match(os);return e?e[0]:""}var as=/^[^\/()?;=#]+/;function cs(n){let e=n.match(as);return e?e[0]:""}var us=/^[^=?&#]+/;function ls(n){let e=n.match(us);return e?e[0]:""}var hs=/^[^&#]+/;function ds(n){let e=n.match(hs);return e?e[0]:""}var an=class{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new m([],{}):new m([],this.parseChildren())}parseQueryParams(){let e={};if(this.consumeOptional("?"))do this.parseQueryParam(e);while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let i={};this.peekStartsWith("/(")&&(this.capture("/"),i=this.parseParens(!0));let t={};return this.peekStartsWith("(")&&(t=this.parseParens(!1)),(e.length>0||Object.keys(i).length>0)&&(t[g]=new m(e,i)),t}parseSegment(){let e=Jt(this.remaining);if(e===""&&this.peekStartsWith(";"))throw new R(4009,!1);return this.capture(e),new Y(st(e),this.parseMatrixParams())}parseMatrixParams(){let e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){let i=cs(this.remaining);if(!i)return;this.capture(i);let t="";if(this.consumeOptional("=")){let r=Jt(this.remaining);r&&(t=r,this.capture(t))}e[st(i)]=st(t)}parseQueryParam(e){let i=ls(this.remaining);if(!i)return;this.capture(i);let t="";if(this.consumeOptional("=")){let o=ds(this.remaining);o&&(t=o,this.capture(t))}let r=jr(i),s=jr(t);if(e.hasOwnProperty(r)){let o=e[r];Array.isArray(o)||(o=[o],e[r]=o),o.push(s)}else e[r]=s}parseParens(e){let i={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let t=Jt(this.remaining),r=this.remaining[t.length];if(r!=="/"&&r!==")"&&r!==";")throw new R(4010,!1);let s;t.indexOf(":")>-1?(s=t.slice(0,t.indexOf(":")),this.capture(s),this.capture(":")):e&&(s=g);let o=this.parseChildren();i[s]=Object.keys(o).length===1?o[g]:new m([],o),this.consumeOptional("//")}return i}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return this.peekStartsWith(e)?(this.remaining=this.remaining.substring(e.length),!0):!1}capture(e){if(!this.consumeOptional(e))throw new R(4011,!1)}};function Yr(n){return n.segments.length>0?new m([],{[g]:n}):n}function Xr(n){let e={};for(let[t,r]of Object.entries(n.children)){let s=Xr(r);if(t===g&&s.segments.length===0&&s.hasChildren())for(let[o,a]of Object.entries(s.children))e[o]=a;else(s.segments.length>0||s.hasChildren())&&(e[t]=s)}let i=new m(n.segments,e);return fs(i)}function fs(n){if(n.numberOfChildren===1&&n.children[g]){let e=n.children[g];return new m(n.segments.concat(e.segments),e.children)}return n}function ue(n){return n instanceof B}function ps(n,e,i=null,t=null){let r=Jr(n);return ei(r,e,i,t)}function Jr(n){let e;function i(s){let o={};for(let u of s.children){let c=i(u);o[u.outlet]=c}let a=new m(s.url,o);return s===n&&(e=a),a}let t=i(n.root),r=Yr(t);return e??r}function ei(n,e,i,t){let r=n;for(;r.parent;)r=r.parent;if(e.length===0)return en(r,r,r,i,t);let s=gs(e);if(s.toRoot())return en(r,r,new m([],{}),i,t);let o=vs(s,r,n),a=o.processChildren?Ae(o.segmentGroup,o.index,s.commands):ni(o.segmentGroup,o.index,s.commands);return en(r,o.segmentGroup,a,i,t)}function ot(n){return typeof n=="object"&&n!=null&&!n.outlets&&!n.segmentPath}function Pe(n){return typeof n=="object"&&n!=null&&n.outlets}function en(n,e,i,t,r){let s={};t&&Object.entries(t).forEach(([u,c])=>{s[u]=Array.isArray(c)?c.map(l=>`${l}`):`${c}`});let o;n===e?o=i:o=ti(n,e,i);let a=Yr(Xr(o));return new B(a,s,r)}function ti(n,e,i){let t={};return Object.entries(n.children).forEach(([r,s])=>{s===e?t[r]=i:t[r]=ti(s,e,i)}),new m(n.segments,t)}var at=class{constructor(e,i,t){if(this.isAbsolute=e,this.numberOfDoubleDots=i,this.commands=t,e&&t.length>0&&ot(t[0]))throw new R(4003,!1);let r=t.find(Pe);if(r&&r!==Br(t))throw new R(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function gs(n){if(typeof n[0]=="string"&&n.length===1&&n[0]==="/")return new at(!0,0,n);let e=0,i=!1,t=n.reduce((r,s,o)=>{if(typeof s=="object"&&s!=null){if(s.outlets){let a={};return Object.entries(s.outlets).forEach(([u,c])=>{a[u]=typeof c=="string"?c.split("/"):c}),[...r,{outlets:a}]}if(s.segmentPath)return[...r,s.segmentPath]}return typeof s!="string"?[...r,s]:o===0?(s.split("/").forEach((a,u)=>{u==0&&a==="."||(u==0&&a===""?i=!0:a===".."?e++:a!=""&&r.push(a))}),r):[...r,s]},[]);return new at(i,e,t)}var oe=class{constructor(e,i,t){this.segmentGroup=e,this.processChildren=i,this.index=t}};function vs(n,e,i){if(n.isAbsolute)return new oe(e,!0,0);if(!i)return new oe(e,!1,NaN);if(i.parent===null)return new oe(i,!0,0);let t=ot(n.commands[0])?0:1,r=i.segments.length-1+t;return ms(i,r,n.numberOfDoubleDots)}function ms(n,e,i){let t=n,r=e,s=i;for(;s>r;){if(s-=r,t=t.parent,!t)throw new R(4005,!1);r=t.segments.length}return new oe(t,!1,r-s)}function ys(n){return Pe(n[0])?n[0].outlets:{[g]:n}}function ni(n,e,i){if(n??=new m([],{}),n.segments.length===0&&n.hasChildren())return Ae(n,e,i);let t=Ss(n,e,i),r=i.slice(t.commandIndex);if(t.match&&t.pathIndexs!==g)&&n.children[g]&&n.numberOfChildren===1&&n.children[g].segments.length===0){let s=Ae(n.children[g],e,i);return new m(n.segments,s.children)}return Object.entries(t).forEach(([s,o])=>{typeof o=="string"&&(o=[o]),o!==null&&(r[s]=ni(n.children[s],e,o))}),Object.entries(n.children).forEach(([s,o])=>{t[s]===void 0&&(r[s]=o)}),new m(n.segments,r)}}function Ss(n,e,i){let t=0,r=e,s={match:!1,pathIndex:0,commandIndex:0};for(;r=i.length)return s;let o=n.segments[r],a=i[t];if(Pe(a))break;let u=`${a}`,c=t0&&u===void 0)break;if(u&&c&&typeof c=="object"&&c.outlets===void 0){if(!$r(u,c,o))return s;t+=2}else{if(!$r(u,{},o))return s;t++}r++}return{match:!0,pathIndex:r,commandIndex:t}}function cn(n,e,i){let t=n.segments.slice(0,e),r=0;for(;r{typeof t=="string"&&(t=[t]),t!==null&&(e[i]=cn(new m([],{}),0,t))}),e}function kr(n){let e={};return Object.entries(n).forEach(([i,t])=>e[i]=`${t}`),e}function $r(n,e,i){return n==i.path&&j(e,i.parameters)}var De="imperative",b=function(n){return n[n.NavigationStart=0]="NavigationStart",n[n.NavigationEnd=1]="NavigationEnd",n[n.NavigationCancel=2]="NavigationCancel",n[n.NavigationError=3]="NavigationError",n[n.RoutesRecognized=4]="RoutesRecognized",n[n.ResolveStart=5]="ResolveStart",n[n.ResolveEnd=6]="ResolveEnd",n[n.GuardsCheckStart=7]="GuardsCheckStart",n[n.GuardsCheckEnd=8]="GuardsCheckEnd",n[n.RouteConfigLoadStart=9]="RouteConfigLoadStart",n[n.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",n[n.ChildActivationStart=11]="ChildActivationStart",n[n.ChildActivationEnd=12]="ChildActivationEnd",n[n.ActivationStart=13]="ActivationStart",n[n.ActivationEnd=14]="ActivationEnd",n[n.Scroll=15]="Scroll",n[n.NavigationSkipped=16]="NavigationSkipped",n}(b||{}),P=class{constructor(e,i){this.id=e,this.url=i}},le=class extends P{constructor(e,i,t="imperative",r=null){super(e,i),this.type=b.NavigationStart,this.navigationTrigger=t,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},k=class extends P{constructor(e,i,t){super(e,i),this.urlAfterRedirects=t,this.type=b.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},O=function(n){return n[n.Redirect=0]="Redirect",n[n.SupersededByNewNavigation=1]="SupersededByNewNavigation",n[n.NoDataFromResolver=2]="NoDataFromResolver",n[n.GuardRejected=3]="GuardRejected",n}(O||{}),ct=function(n){return n[n.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",n[n.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",n}(ct||{}),q=class extends P{constructor(e,i,t,r){super(e,i),this.reason=t,this.code=r,this.type=b.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},W=class extends P{constructor(e,i,t,r){super(e,i),this.reason=t,this.code=r,this.type=b.NavigationSkipped}},Ue=class extends P{constructor(e,i,t,r){super(e,i),this.error=t,this.target=r,this.type=b.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},ut=class extends P{constructor(e,i,t,r){super(e,i),this.urlAfterRedirects=t,this.state=r,this.type=b.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},un=class extends P{constructor(e,i,t,r){super(e,i),this.urlAfterRedirects=t,this.state=r,this.type=b.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},ln=class extends P{constructor(e,i,t,r,s){super(e,i),this.urlAfterRedirects=t,this.state=r,this.shouldActivate=s,this.type=b.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},hn=class extends P{constructor(e,i,t,r){super(e,i),this.urlAfterRedirects=t,this.state=r,this.type=b.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},dn=class extends P{constructor(e,i,t,r){super(e,i),this.urlAfterRedirects=t,this.state=r,this.type=b.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},fn=class{constructor(e){this.route=e,this.type=b.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},pn=class{constructor(e){this.route=e,this.type=b.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},gn=class{constructor(e){this.snapshot=e,this.type=b.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},vn=class{constructor(e){this.snapshot=e,this.type=b.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},mn=class{constructor(e){this.snapshot=e,this.type=b.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},yn=class{constructor(e){this.snapshot=e,this.type=b.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},lt=class{constructor(e,i,t){this.routerEvent=e,this.position=i,this.anchor=t,this.type=b.Scroll}toString(){let e=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${e}')`}},xe=class{},Le=class{constructor(e){this.url=e}};var Sn=class{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new He,this.attachRef=null}},He=(()=>{let e=class e{constructor(){this.contexts=new Map}onChildOutletCreated(t,r){let s=this.getOrCreateContext(t);s.outlet=r,this.contexts.set(t,s)}onChildOutletDestroyed(t){let r=this.getContext(t);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){let t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let r=this.getContext(t);return r||(r=new Sn,this.contexts.set(t,r)),r}getContext(t){return this.contexts.get(t)||null}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})(),ht=class{constructor(e){this._root=e}get root(){return this._root.value}parent(e){let i=this.pathFromRoot(e);return i.length>1?i[i.length-2]:null}children(e){let i=Cn(e,this._root);return i?i.children.map(t=>t.value):[]}firstChild(e){let i=Cn(e,this._root);return i&&i.children.length>0?i.children[0].value:null}siblings(e){let i=wn(e,this._root);return i.length<2?[]:i[i.length-2].children.map(r=>r.value).filter(r=>r!==e)}pathFromRoot(e){return wn(e,this._root).map(i=>i.value)}};function Cn(n,e){if(n===e.value)return e;for(let i of e.children){let t=Cn(n,i);if(t)return t}return null}function wn(n,e){if(n===e.value)return[e];for(let i of e.children){let t=wn(n,i);if(t.length)return t.unshift(e),t}return[]}var D=class{constructor(e,i){this.value=e,this.children=i}toString(){return`TreeNode(${this.value})`}};function se(n){let e={};return n&&n.children.forEach(i=>e[i.value.outlet]=i),e}var dt=class extends ht{constructor(e,i){super(e),this.snapshot=i,Nn(this,e)}toString(){return this.snapshot.toString()}};function ri(n){let e=ws(n),i=new N([new Y("",{})]),t=new N({}),r=new N({}),s=new N({}),o=new N(""),a=new G(i,t,s,o,r,g,n,e.root);return a.snapshot=e.root,new dt(new D(a,[]),e)}function ws(n){let e={},i={},t={},r="",s=new je([],e,t,r,i,g,n,null,{});return new ft("",new D(s,[]))}var G=class{constructor(e,i,t,r,s,o,a,u){this.urlSubject=e,this.paramsSubject=i,this.queryParamsSubject=t,this.fragmentSubject=r,this.dataSubject=s,this.outlet=o,this.component=a,this._futureSnapshot=u,this.title=this.dataSubject?.pipe(S(c=>c[Fe]))??f(void 0),this.url=e,this.params=i,this.queryParams=t,this.fragment=r,this.data=s}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(S(e=>ce(e))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(S(e=>ce(e))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function On(n,e,i="emptyOnly"){let t,{routeConfig:r}=n;return e!==null&&(i==="always"||r?.path===""||!e.component&&!e.routeConfig?.loadComponent)?t={params:h(h({},e.params),n.params),data:h(h({},e.data),n.data),resolve:h(h(h(h({},n.data),e.data),r?.data),n._resolvedData)}:t={params:h({},n.params),data:h({},n.data),resolve:h(h({},n.data),n._resolvedData??{})},r&&si(r)&&(t.resolve[Fe]=r.title),t}var je=class{get title(){return this.data?.[Fe]}constructor(e,i,t,r,s,o,a,u,c){this.url=e,this.params=i,this.queryParams=t,this.fragment=r,this.data=s,this.outlet=o,this.component=a,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??=ce(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=ce(this.queryParams),this._queryParamMap}toString(){let e=this.url.map(t=>t.toString()).join("/"),i=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${e}', path:'${i}')`}},ft=class extends ht{constructor(e,i){super(i),this.url=e,Nn(this,i)}toString(){return ii(this._root)}};function Nn(n,e){e.value._routerState=n,e.children.forEach(i=>Nn(n,i))}function ii(n){let e=n.children.length>0?` { ${n.children.map(ii).join(", ")} } `:"";return`${n.value}${e}`}function tn(n){if(n.snapshot){let e=n.snapshot,i=n._futureSnapshot;n.snapshot=i,j(e.queryParams,i.queryParams)||n.queryParamsSubject.next(i.queryParams),e.fragment!==i.fragment&&n.fragmentSubject.next(i.fragment),j(e.params,i.params)||n.paramsSubject.next(i.params),Qi(e.url,i.url)||n.urlSubject.next(i.url),j(e.data,i.data)||n.dataSubject.next(i.data)}else n.snapshot=n._futureSnapshot,n.dataSubject.next(n._futureSnapshot.data)}function Rn(n,e){let i=j(n.params,e.params)&&es(n.url,e.url),t=!n.parent!=!e.parent;return i&&!t&&(!n.parent||Rn(n.parent,e.parent))}function si(n){return typeof n.title=="string"||n.title===null}var Rs=(()=>{let e=class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=g,this.activateEvents=new me,this.deactivateEvents=new me,this.attachEvents=new me,this.detachEvents=new me,this.parentContexts=d(He),this.location=d(ar),this.changeDetector=d(Vt),this.environmentInjector=d(ne),this.inputBinder=d(mt,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(t){if(t.name){let{firstChange:r,previousValue:s}=t.name;if(r)return;this.isTrackedInParentContexts(s)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(s)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new R(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new R(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new R(4012,!1);this.location.detach();let t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,r){this.activated=t,this._activatedRoute=r,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){let t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,r){if(this.isActivated)throw new R(4013,!1);this._activatedRoute=t;let s=this.location,a=t.snapshot.component,u=this.parentContexts.getOrCreateContext(this.name).children,c=new bn(t,u,s.injector);this.activated=s.createComponent(a,{index:s.length,injector:c,environmentInjector:r??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Ot({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[Pt]});let n=e;return n})(),bn=class n{__ngOutletInjector(e){return new n(this.route,this.childContexts,e)}constructor(e,i,t){this.route=e,this.childContexts=i,this.parent=t}get(e,i){return e===G?this.route:e===He?this.childContexts:this.parent.get(e,i)}},mt=new M(""),_r=(()=>{let e=class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(t){this.unsubscribeFromRouteData(t),this.subscribeToRouteData(t)}unsubscribeFromRouteData(t){this.outletDataSubscriptions.get(t)?.unsubscribe(),this.outletDataSubscriptions.delete(t)}subscribeToRouteData(t){let{activatedRoute:r}=t,s=Ge([r.queryParams,r.params,r.data]).pipe(U(([o,a,u],c)=>(u=h(h(h({},o),a),u),c===0?f(u):Promise.resolve(u)))).subscribe(o=>{if(!t.isActivated||!t.activatedComponentRef||t.activatedRoute!==r||r.component===null){this.unsubscribeFromRouteData(t);return}let a=mr(r.component);if(!a){this.unsubscribeFromRouteData(t);return}for(let{templateName:u}of a.inputs)t.activatedComponentRef.setInput(u,o[u])});this.outletDataSubscriptions.set(t,s)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})();function bs(n,e,i){let t=ke(n,e._root,i?i._root:void 0);return new dt(t,e)}function ke(n,e,i){if(i&&n.shouldReuseRoute(e.value,i.value.snapshot)){let t=i.value;t._futureSnapshot=e.value;let r=Is(n,e,i);return new D(t,r)}else{if(n.shouldAttach(e.value)){let s=n.retrieve(e.value);if(s!==null){let o=s.route;return o.value._futureSnapshot=e.value,o.children=e.children.map(a=>ke(n,a)),o}}let t=Es(e.value),r=e.children.map(s=>ke(n,s));return new D(t,r)}}function Is(n,e,i){return e.children.map(t=>{for(let r of i.children)if(n.shouldReuseRoute(t.value,r.value.snapshot))return ke(n,t,r);return ke(n,t)})}function Es(n){return new G(new N(n.url),new N(n.params),new N(n.queryParams),new N(n.fragment),new N(n.data),n.outlet,n.component,n)}var oi="ngNavigationCancelingError";function ai(n,e){let{redirectTo:i,navigationBehaviorOptions:t}=ue(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,r=ci(!1,O.Redirect);return r.url=i,r.navigationBehaviorOptions=t,r}function ci(n,e){let i=new Error(`NavigationCancelingError: ${n||""}`);return i[oi]=!0,i.cancellationCode=e,i}function Ms(n){return ui(n)&&ue(n.url)}function ui(n){return!!n&&n[oi]}var Ts=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=Yn({type:e,selectors:[["ng-component"]],standalone:!0,features:[pr],decls:1,vars:0,template:function(r,s){r&1&&dr(0,"router-outlet")},dependencies:[Rs],encapsulation:2});let n=e;return n})();function As(n,e){return n.providers&&!n._injector&&(n._injector=_t(n.providers,e,`Route: ${n.path}`)),n._injector??e}function Pn(n){let e=n.children&&n.children.map(Pn),i=e?E(h({},n),{children:e}):h({},n);return!i.component&&!i.loadComponent&&(e||i.loadChildren)&&i.outlet&&i.outlet!==g&&(i.component=Ts),i}function $(n){return n.outlet||g}function Ds(n,e){let i=n.filter(t=>$(t)===e);return i.push(...n.filter(t=>$(t)!==e)),i}function Ve(n){if(!n)return null;if(n.routeConfig?._injector)return n.routeConfig._injector;for(let e=n.parent;e;e=e.parent){let i=e.routeConfig;if(i?._loadedInjector)return i._loadedInjector;if(i?._injector)return i._injector}return null}var Os=(n,e,i,t)=>S(r=>(new In(e,r.targetRouterState,r.currentRouterState,i,t).activate(n),r)),In=class{constructor(e,i,t,r,s){this.routeReuseStrategy=e,this.futureState=i,this.currState=t,this.forwardEvent=r,this.inputBindingEnabled=s}activate(e){let i=this.futureState._root,t=this.currState?this.currState._root:null;this.deactivateChildRoutes(i,t,e),tn(this.futureState.root),this.activateChildRoutes(i,t,e)}deactivateChildRoutes(e,i,t){let r=se(i);e.children.forEach(s=>{let o=s.value.outlet;this.deactivateRoutes(s,r[o],t),delete r[o]}),Object.values(r).forEach(s=>{this.deactivateRouteAndItsChildren(s,t)})}deactivateRoutes(e,i,t){let r=e.value,s=i?i.value:null;if(r===s)if(r.component){let o=t.getContext(r.outlet);o&&this.deactivateChildRoutes(e,i,o.children)}else this.deactivateChildRoutes(e,i,t);else s&&this.deactivateRouteAndItsChildren(i,t)}deactivateRouteAndItsChildren(e,i){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,i):this.deactivateRouteAndOutlet(e,i)}detachAndStoreRouteSubtree(e,i){let t=i.getContext(e.value.outlet),r=t&&e.value.component?t.children:i,s=se(e);for(let o of Object.values(s))this.deactivateRouteAndItsChildren(o,r);if(t&&t.outlet){let o=t.outlet.detach(),a=t.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:o,route:e,contexts:a})}}deactivateRouteAndOutlet(e,i){let t=i.getContext(e.value.outlet),r=t&&e.value.component?t.children:i,s=se(e);for(let o of Object.values(s))this.deactivateRouteAndItsChildren(o,r);t&&(t.outlet&&(t.outlet.deactivate(),t.children.onOutletDeactivated()),t.attachRef=null,t.route=null)}activateChildRoutes(e,i,t){let r=se(i);e.children.forEach(s=>{this.activateRoutes(s,r[s.value.outlet],t),this.forwardEvent(new yn(s.value.snapshot))}),e.children.length&&this.forwardEvent(new vn(e.value.snapshot))}activateRoutes(e,i,t){let r=e.value,s=i?i.value:null;if(tn(r),r===s)if(r.component){let o=t.getOrCreateContext(r.outlet);this.activateChildRoutes(e,i,o.children)}else this.activateChildRoutes(e,i,t);else if(r.component){let o=t.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){let a=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),o.children.onOutletReAttached(a.contexts),o.attachRef=a.componentRef,o.route=a.route.value,o.outlet&&o.outlet.attach(a.componentRef,a.route.value),tn(a.route.value),this.activateChildRoutes(e,null,o.children)}else{let a=Ve(r.snapshot);o.attachRef=null,o.route=r,o.injector=a,o.outlet&&o.outlet.activateWith(r,o.injector),this.activateChildRoutes(e,null,o.children)}}else this.activateChildRoutes(e,null,t)}},pt=class{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}},ae=class{constructor(e,i){this.component=e,this.route=i}};function Ns(n,e,i){let t=n._root,r=e?e._root:null;return Me(t,r,i,[t.value])}function Ps(n){let e=n.routeConfig?n.routeConfig.canActivateChild:null;return!e||e.length===0?null:{node:n,guards:e}}function de(n,e){let i=Symbol(),t=e.get(n,i);return t===i?typeof n=="function"&&!Kn(n)?n:e.get(n):t}function Me(n,e,i,t,r={canDeactivateChecks:[],canActivateChecks:[]}){let s=se(e);return n.children.forEach(o=>{Us(o,s[o.value.outlet],i,t.concat([o.value]),r),delete s[o.value.outlet]}),Object.entries(s).forEach(([o,a])=>Oe(a,i.getContext(o),r)),r}function Us(n,e,i,t,r={canDeactivateChecks:[],canActivateChecks:[]}){let s=n.value,o=e?e.value:null,a=i?i.getContext(n.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){let u=xs(o,s,s.routeConfig.runGuardsAndResolvers);u?r.canActivateChecks.push(new pt(t)):(s.data=o.data,s._resolvedData=o._resolvedData),s.component?Me(n,e,a?a.children:null,t,r):Me(n,e,i,t,r),u&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new ae(a.outlet.component,o))}else o&&Oe(e,a,r),r.canActivateChecks.push(new pt(t)),s.component?Me(n,null,a?a.children:null,t,r):Me(n,null,i,t,r);return r}function xs(n,e,i){if(typeof i=="function")return i(n,e);switch(i){case"pathParamsChange":return!X(n.url,e.url);case"pathParamsOrQueryParamsChange":return!X(n.url,e.url)||!j(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Rn(n,e)||!j(n.queryParams,e.queryParams);case"paramsChange":default:return!Rn(n,e)}}function Oe(n,e,i){let t=se(n),r=n.value;Object.entries(t).forEach(([s,o])=>{r.component?e?Oe(o,e.children.getContext(s),i):Oe(o,null,i):Oe(o,e,i)}),r.component?e&&e.outlet&&e.outlet.isActivated?i.canDeactivateChecks.push(new ae(e.outlet.component,r)):i.canDeactivateChecks.push(new ae(null,r)):i.canDeactivateChecks.push(new ae(null,r))}function Be(n){return typeof n=="function"}function Ls(n){return typeof n=="boolean"}function js(n){return n&&Be(n.canLoad)}function ks(n){return n&&Be(n.canActivate)}function $s(n){return n&&Be(n.canActivateChild)}function _s(n){return n&&Be(n.canDeactivate)}function Fs(n){return n&&Be(n.canMatch)}function li(n){return n instanceof Hn||n?.name==="EmptyError"}var nt=Symbol("INITIAL_VALUE");function he(){return U(n=>Ge(n.map(e=>e.pipe(te(1),Gn(nt)))).pipe(S(e=>{for(let i of e)if(i!==!0){if(i===nt)return nt;if(i===!1||i instanceof B)return i}return!0}),Q(e=>e!==nt),te(1)))}function zs(n,e){return A(i=>{let{targetSnapshot:t,currentSnapshot:r,guards:{canActivateChecks:s,canDeactivateChecks:o}}=i;return o.length===0&&s.length===0?f(E(h({},i),{guardsResult:!0})):Hs(o,t,r,n).pipe(A(a=>a&&Ls(a)?Vs(t,s,n,e):f(a)),S(a=>E(h({},i),{guardsResult:a})))})}function Hs(n,e,i,t){return T(n).pipe(A(r=>Zs(r.component,r.route,i,e,t)),H(r=>r!==!0,!0))}function Vs(n,e,i,t){return T(e).pipe(ee(r=>Vn(qs(r.route.parent,t),Bs(r.route,t),Gs(n,r.path,i),Ws(n,r.route,i))),H(r=>r!==!0,!0))}function Bs(n,e){return n!==null&&e&&e(new mn(n)),f(!0)}function qs(n,e){return n!==null&&e&&e(new gn(n)),f(!0)}function Ws(n,e,i){let t=e.routeConfig?e.routeConfig.canActivate:null;if(!t||t.length===0)return f(!0);let r=t.map(s=>bt(()=>{let o=Ve(e)??i,a=de(s,o),u=ks(a)?a.canActivate(e,n):V(o,()=>a(e,n));return Z(u).pipe(H())}));return f(r).pipe(he())}function Gs(n,e,i){let t=e[e.length-1],s=e.slice(0,e.length-1).reverse().map(o=>Ps(o)).filter(o=>o!==null).map(o=>bt(()=>{let a=o.guards.map(u=>{let c=Ve(o.node)??i,l=de(u,c),p=$s(l)?l.canActivateChild(t,n):V(c,()=>l(t,n));return Z(p).pipe(H())});return f(a).pipe(he())}));return f(s).pipe(he())}function Zs(n,e,i,t,r){let s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!s||s.length===0)return f(!0);let o=s.map(a=>{let u=Ve(e)??r,c=de(a,u),l=_s(c)?c.canDeactivate(n,e,i,t):V(u,()=>c(n,e,i,t));return Z(l).pipe(H())});return f(o).pipe(he())}function Ks(n,e,i,t){let r=e.canLoad;if(r===void 0||r.length===0)return f(!0);let s=r.map(o=>{let a=de(o,n),u=js(a)?a.canLoad(e,i):V(n,()=>a(e,i));return Z(u)});return f(s).pipe(he(),hi(t))}function hi(n){return Fn(I(e=>{if(ue(e))throw ai(n,e)}),S(e=>e===!0))}function Qs(n,e,i,t){let r=e.canMatch;if(!r||r.length===0)return f(!0);let s=r.map(o=>{let a=de(o,n),u=Fs(a)?a.canMatch(e,i):V(n,()=>a(e,i));return Z(u)});return f(s).pipe(he(),hi(t))}var $e=class{constructor(e){this.segmentGroup=e||null}},gt=class extends Error{constructor(e){super(),this.urlTree=e}};function ie(n){return ge(new $e(n))}function Ys(n){return ge(new R(4e3,!1))}function Xs(n){return ge(ci(!1,O.GuardRejected))}var En=class{constructor(e,i){this.urlSerializer=e,this.urlTree=i}lineralizeSegments(e,i){let t=[],r=i.root;for(;;){if(t=t.concat(r.segments),r.numberOfChildren===0)return f(t);if(r.numberOfChildren>1||!r.children[g])return Ys(e.redirectTo);r=r.children[g]}}applyRedirectCommands(e,i,t){let r=this.applyRedirectCreateUrlTree(i,this.urlSerializer.parse(i),e,t);if(i.startsWith("/"))throw new gt(r);return r}applyRedirectCreateUrlTree(e,i,t,r){let s=this.createSegmentGroup(e,i.root,t,r);return new B(s,this.createQueryParams(i.queryParams,this.urlTree.queryParams),i.fragment)}createQueryParams(e,i){let t={};return Object.entries(e).forEach(([r,s])=>{if(typeof s=="string"&&s.startsWith(":")){let a=s.substring(1);t[r]=i[a]}else t[r]=s}),t}createSegmentGroup(e,i,t,r){let s=this.createSegments(e,i.segments,t,r),o={};return Object.entries(i.children).forEach(([a,u])=>{o[a]=this.createSegmentGroup(e,u,t,r)}),new m(s,o)}createSegments(e,i,t,r){return i.map(s=>s.path.startsWith(":")?this.findPosParam(e,s,r):this.findOrReturn(s,t))}findPosParam(e,i,t){let r=t[i.path.substring(1)];if(!r)throw new R(4001,!1);return r}findOrReturn(e,i){let t=0;for(let r of i){if(r.path===e.path)return i.splice(t),r;t++}return e}},Mn={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function Js(n,e,i,t,r){let s=Un(n,e,i);return s.matched?(t=As(e,t),Qs(t,e,i,r).pipe(S(o=>o===!0?s:h({},Mn)))):f(s)}function Un(n,e,i){if(e.path==="**")return eo(i);if(e.path==="")return e.pathMatch==="full"&&(n.hasChildren()||i.length>0)?h({},Mn):{matched:!0,consumedSegments:[],remainingSegments:i,parameters:{},positionalParamSegments:{}};let r=(e.matcher||Ki)(i,n,e);if(!r)return h({},Mn);let s={};Object.entries(r.posParams??{}).forEach(([a,u])=>{s[a]=u.path});let o=r.consumed.length>0?h(h({},s),r.consumed[r.consumed.length-1].parameters):s;return{matched:!0,consumedSegments:r.consumed,remainingSegments:i.slice(r.consumed.length),parameters:o,positionalParamSegments:r.posParams??{}}}function eo(n){return{matched:!0,parameters:n.length>0?Br(n).parameters:{},consumedSegments:n,remainingSegments:[],positionalParamSegments:{}}}function Fr(n,e,i,t){return i.length>0&&ro(n,i,t)?{segmentGroup:new m(e,no(t,new m(i,n.children))),slicedSegments:[]}:i.length===0&&io(n,i,t)?{segmentGroup:new m(n.segments,to(n,i,t,n.children)),slicedSegments:i}:{segmentGroup:new m(n.segments,n.children),slicedSegments:i}}function to(n,e,i,t){let r={};for(let s of i)if(yt(n,e,s)&&!t[$(s)]){let o=new m([],{});r[$(s)]=o}return h(h({},t),r)}function no(n,e){let i={};i[g]=e;for(let t of n)if(t.path===""&&$(t)!==g){let r=new m([],{});i[$(t)]=r}return i}function ro(n,e,i){return i.some(t=>yt(n,e,t)&&$(t)!==g)}function io(n,e,i){return i.some(t=>yt(n,e,t))}function yt(n,e,i){return(n.hasChildren()||e.length>0)&&i.pathMatch==="full"?!1:i.path===""}function so(n,e,i,t){return $(n)!==t&&(t===g||!yt(e,i,n))?!1:Un(e,n,i).matched}function oo(n,e,i){return e.length===0&&!n.children[i]}var Tn=class{};function ao(n,e,i,t,r,s,o="emptyOnly"){return new An(n,e,i,t,r,o,s).recognize()}var co=31,An=class{constructor(e,i,t,r,s,o,a){this.injector=e,this.configLoader=i,this.rootComponentType=t,this.config=r,this.urlTree=s,this.paramsInheritanceStrategy=o,this.urlSerializer=a,this.applyRedirects=new En(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(e){return new R(4002,`'${e.segmentGroup}'`)}recognize(){let e=Fr(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(e).pipe(S(i=>{let t=new je([],Object.freeze({}),Object.freeze(h({},this.urlTree.queryParams)),this.urlTree.fragment,{},g,this.rootComponentType,null,{}),r=new D(t,i),s=new ft("",r),o=ps(t,[],this.urlTree.queryParams,this.urlTree.fragment);return o.queryParams=this.urlTree.queryParams,s.url=this.urlSerializer.serialize(o),this.inheritParamsAndData(s._root,null),{state:s,tree:o}}))}match(e){return this.processSegmentGroup(this.injector,this.config,e,g).pipe(J(t=>{if(t instanceof gt)return this.urlTree=t.urlTree,this.match(t.urlTree.root);throw t instanceof $e?this.noMatchError(t):t}))}inheritParamsAndData(e,i){let t=e.value,r=On(t,i,this.paramsInheritanceStrategy);t.params=Object.freeze(r.params),t.data=Object.freeze(r.data),e.children.forEach(s=>this.inheritParamsAndData(s,t))}processSegmentGroup(e,i,t,r){return t.segments.length===0&&t.hasChildren()?this.processChildren(e,i,t):this.processSegment(e,i,t,t.segments,r,!0).pipe(S(s=>s instanceof D?[s]:[]))}processChildren(e,i,t){let r=[];for(let s of Object.keys(t.children))s==="primary"?r.unshift(s):r.push(s);return T(r).pipe(ee(s=>{let o=t.children[s],a=Ds(i,s);return this.processSegmentGroup(e,a,o,s)}),Wn((s,o)=>(s.push(...o),s)),It(null),qn(),A(s=>{if(s===null)return ie(t);let o=di(s);return uo(o),f(o)}))}processSegment(e,i,t,r,s,o){return T(i).pipe(ee(a=>this.processSegmentAgainstRoute(a._injector??e,i,a,t,r,s,o).pipe(J(u=>{if(u instanceof $e)return f(null);throw u}))),H(a=>!!a),J(a=>{if(li(a))return oo(t,r,s)?f(new Tn):ie(t);throw a}))}processSegmentAgainstRoute(e,i,t,r,s,o,a){return so(t,r,s,o)?t.redirectTo===void 0?this.matchSegmentAgainstRoute(e,r,t,s,o):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(e,r,i,t,s,o):ie(r):ie(r)}expandSegmentAgainstRouteUsingRedirect(e,i,t,r,s,o){let{matched:a,consumedSegments:u,positionalParamSegments:c,remainingSegments:l}=Un(i,r,s);if(!a)return ie(i);r.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>co&&(this.allowRedirects=!1));let p=this.applyRedirects.applyRedirectCommands(u,r.redirectTo,c);return this.applyRedirects.lineralizeSegments(r,p).pipe(A(v=>this.processSegment(e,t,i,v.concat(l),o,!1)))}matchSegmentAgainstRoute(e,i,t,r,s){let o=Js(i,t,r,e,this.urlSerializer);return t.path==="**"&&(i.children={}),o.pipe(U(a=>a.matched?(e=t._injector??e,this.getChildConfig(e,t,r).pipe(U(({routes:u})=>{let c=t._loadedInjector??e,{consumedSegments:l,remainingSegments:p,parameters:v}=a,w=new je(l,v,Object.freeze(h({},this.urlTree.queryParams)),this.urlTree.fragment,ho(t),$(t),t.component??t._loadedComponent??null,t,fo(t)),{segmentGroup:fe,slicedSegments:pe}=Fr(i,l,p,u);if(pe.length===0&&fe.hasChildren())return this.processChildren(c,u,fe).pipe(S(K=>K===null?null:new D(w,K)));if(u.length===0&&pe.length===0)return f(new D(w,[]));let St=$(t)===s;return this.processSegment(c,u,fe,pe,St?g:s,!0).pipe(S(K=>new D(w,K instanceof D?[K]:[])))}))):ie(i)))}getChildConfig(e,i,t){return i.children?f({routes:i.children,injector:e}):i.loadChildren?i._loadedRoutes!==void 0?f({routes:i._loadedRoutes,injector:i._loadedInjector}):Ks(e,i,t,this.urlSerializer).pipe(A(r=>r?this.configLoader.loadChildren(e,i).pipe(I(s=>{i._loadedRoutes=s.routes,i._loadedInjector=s.injector})):Xs(i))):f({routes:[],injector:e})}};function uo(n){n.sort((e,i)=>e.value.outlet===g?-1:i.value.outlet===g?1:e.value.outlet.localeCompare(i.value.outlet))}function lo(n){let e=n.value.routeConfig;return e&&e.path===""}function di(n){let e=[],i=new Set;for(let t of n){if(!lo(t)){e.push(t);continue}let r=e.find(s=>t.value.routeConfig===s.value.routeConfig);r!==void 0?(r.children.push(...t.children),i.add(r)):e.push(t)}for(let t of i){let r=di(t.children);e.push(new D(t.value,r))}return e.filter(t=>!i.has(t))}function ho(n){return n.data||{}}function fo(n){return n.resolve||{}}function po(n,e,i,t,r,s){return A(o=>ao(n,e,i,t,o.extractedUrl,r,s).pipe(S(({state:a,tree:u})=>E(h({},o),{targetSnapshot:a,urlAfterRedirects:u}))))}function go(n,e){return A(i=>{let{targetSnapshot:t,guards:{canActivateChecks:r}}=i;if(!r.length)return f(i);let s=new Set(r.map(u=>u.route)),o=new Set;for(let u of s)if(!o.has(u))for(let c of fi(u))o.add(c);let a=0;return T(o).pipe(ee(u=>s.has(u)?vo(u,t,n,e):(u.data=On(u,u.parent,n).resolve,f(void 0))),I(()=>a++),Et(1),A(u=>a===o.size?f(i):z))})}function fi(n){let e=n.children.map(i=>fi(i)).flat();return[n,...e]}function vo(n,e,i,t){let r=n.routeConfig,s=n._resolve;return r?.title!==void 0&&!si(r)&&(s[Fe]=r.title),mo(s,n,e,t).pipe(S(o=>(n._resolvedData=o,n.data=On(n,n.parent,i).resolve,null)))}function mo(n,e,i,t){let r=sn(n);if(r.length===0)return f({});let s={};return T(r).pipe(A(o=>yo(n[o],e,i,t).pipe(H(),I(a=>{s[o]=a}))),Et(1),Bn(s),J(o=>li(o)?z:ge(o)))}function yo(n,e,i,t){let r=Ve(e)??t,s=de(n,r),o=s.resolve?s.resolve(e,i):V(r,()=>s(e,i));return Z(o)}function nn(n){return U(e=>{let i=n(e);return i?T(i).pipe(S(()=>e)):f(e)})}var pi=(()=>{let e=class e{buildTitle(t){let r,s=t.root;for(;s!==void 0;)r=this.getResolvedTitleForRoute(s)??r,s=s.children.find(o=>o.outlet===g);return r}getResolvedTitleForRoute(t){return t.data[Fe]}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:()=>d(So),providedIn:"root"});let n=e;return n})(),So=(()=>{let e=class e extends pi{constructor(t){super(),this.title=t}updateTitle(t){let r=this.buildTitle(t);r!==void 0&&this.title.setTitle(r)}};e.\u0275fac=function(r){return new(r||e)(y(xr))},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})(),qe=new M("",{providedIn:"root",factory:()=>({})}),_e=new M(""),xn=(()=>{let e=class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=d(Ye)}loadComponent(t){if(this.componentLoaders.get(t))return this.componentLoaders.get(t);if(t._loadedComponent)return f(t._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(t);let r=Z(t.loadComponent()).pipe(S(gi),I(o=>{this.onLoadEndListener&&this.onLoadEndListener(t),t._loadedComponent=o}),Ze(()=>{this.componentLoaders.delete(t)})),s=new wt(r,()=>new F).pipe(Ct());return this.componentLoaders.set(t,s),s}loadChildren(t,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return f({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);let o=Co(r,this.compiler,t,this.onLoadEndListener).pipe(Ze(()=>{this.childrenLoaders.delete(r)})),a=new wt(o,()=>new F).pipe(Ct());return this.childrenLoaders.set(r,a),a}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function Co(n,e,i,t){return Z(n.loadChildren()).pipe(S(gi),A(r=>r instanceof ur||Array.isArray(r)?f(r):T(e.compileModuleAsync(r))),S(r=>{t&&t(n);let s,o,a=!1;return Array.isArray(r)?(o=r,a=!0):(s=r.create(i).injector,o=s.get(_e,[],{optional:!0,self:!0}).flat()),{routes:o.map(Pn),injector:s}}))}function wo(n){return n&&typeof n=="object"&&"default"in n}function gi(n){return wo(n)?n.default:n}var Ln=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:()=>d(Ro),providedIn:"root"});let n=e;return n})(),Ro=(()=>{let e=class e{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,r){return t}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})(),vi=new M(""),mi=new M("");function bo(n,e,i){let t=n.get(mi),r=n.get(L);return n.get(x).runOutsideAngular(()=>{if(!r.startViewTransition||t.skipNextTransition)return t.skipNextTransition=!1,new Promise(c=>setTimeout(c));let s,o=new Promise(c=>{s=c}),a=r.startViewTransition(()=>(s(),Io(n))),{onViewTransitionCreated:u}=t;return u&&V(n,()=>u({transition:a,from:e,to:i})),o})}function Io(n){return new Promise(e=>{$t(e,{injector:n})})}var jn=(()=>{let e=class e{get hasRequestedNavigation(){return this.navigationId!==0}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new F,this.transitionAbortSubject=new F,this.configLoader=d(xn),this.environmentInjector=d(ne),this.urlSerializer=d(ze),this.rootContexts=d(He),this.location=d(we),this.inputBindingEnabled=d(mt,{optional:!0})!==null,this.titleStrategy=d(pi),this.options=d(qe,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=d(Ln),this.createViewTransition=d(vi,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>f(void 0),this.rootComponentType=null;let t=s=>this.events.next(new fn(s)),r=s=>this.events.next(new pn(s));this.configLoader.onLoadEndListener=r,this.configLoader.onLoadStartListener=t}complete(){this.transitions?.complete()}handleNavigationRequest(t){let r=++this.navigationId;this.transitions?.next(E(h(h({},this.transitions.value),t),{id:r}))}setupNavigations(t,r,s){return this.transitions=new N({id:0,currentUrlTree:r,currentRawUrl:r,extractedUrl:this.urlHandlingStrategy.extract(r),urlAfterRedirects:this.urlHandlingStrategy.extract(r),rawUrl:r,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:De,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(Q(o=>o.id!==0),S(o=>E(h({},o),{extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),U(o=>{let a=!1,u=!1;return f(o).pipe(U(c=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",O.SupersededByNewNavigation),z;this.currentTransition=o,this.currentNavigation={id:c.id,initialUrl:c.rawUrl,extractedUrl:c.extractedUrl,trigger:c.source,extras:c.extras,previousNavigation:this.lastSuccessfulNavigation?E(h({},this.lastSuccessfulNavigation),{previousNavigation:null}):null};let l=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),p=c.extras.onSameUrlNavigation??t.onSameUrlNavigation;if(!l&&p!=="reload"){let v="";return this.events.next(new W(c.id,this.urlSerializer.serialize(c.rawUrl),v,ct.IgnoredSameUrlNavigation)),c.resolve(null),z}if(this.urlHandlingStrategy.shouldProcessUrl(c.rawUrl))return f(c).pipe(U(v=>{let w=this.transitions?.getValue();return this.events.next(new le(v.id,this.urlSerializer.serialize(v.extractedUrl),v.source,v.restoredState)),w!==this.transitions?.getValue()?z:Promise.resolve(v)}),po(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),I(v=>{o.targetSnapshot=v.targetSnapshot,o.urlAfterRedirects=v.urlAfterRedirects,this.currentNavigation=E(h({},this.currentNavigation),{finalUrl:v.urlAfterRedirects});let w=new ut(v.id,this.urlSerializer.serialize(v.extractedUrl),this.urlSerializer.serialize(v.urlAfterRedirects),v.targetSnapshot);this.events.next(w)}));if(l&&this.urlHandlingStrategy.shouldProcessUrl(c.currentRawUrl)){let{id:v,extractedUrl:w,source:fe,restoredState:pe,extras:St}=c,K=new le(v,this.urlSerializer.serialize(w),fe,pe);this.events.next(K);let Ei=ri(this.rootComponentType).snapshot;return this.currentTransition=o=E(h({},c),{targetSnapshot:Ei,urlAfterRedirects:w,extras:E(h({},St),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=w,f(o)}else{let v="";return this.events.next(new W(c.id,this.urlSerializer.serialize(c.extractedUrl),v,ct.IgnoredByUrlHandlingStrategy)),c.resolve(null),z}}),I(c=>{let l=new un(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(l)}),S(c=>(this.currentTransition=o=E(h({},c),{guards:Ns(c.targetSnapshot,c.currentSnapshot,this.rootContexts)}),o)),zs(this.environmentInjector,c=>this.events.next(c)),I(c=>{if(o.guardsResult=c.guardsResult,ue(c.guardsResult))throw ai(this.urlSerializer,c.guardsResult);let l=new ln(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot,!!c.guardsResult);this.events.next(l)}),Q(c=>c.guardsResult?!0:(this.cancelNavigationTransition(c,"",O.GuardRejected),!1)),nn(c=>{if(c.guards.canActivateChecks.length)return f(c).pipe(I(l=>{let p=new hn(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(p)}),U(l=>{let p=!1;return f(l).pipe(go(this.paramsInheritanceStrategy,this.environmentInjector),I({next:()=>p=!0,complete:()=>{p||this.cancelNavigationTransition(l,"",O.NoDataFromResolver)}}))}),I(l=>{let p=new dn(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(p)}))}),nn(c=>{let l=p=>{let v=[];p.routeConfig?.loadComponent&&!p.routeConfig._loadedComponent&&v.push(this.configLoader.loadComponent(p.routeConfig).pipe(I(w=>{p.component=w}),S(()=>{})));for(let w of p.children)v.push(...l(w));return v};return Ge(l(c.targetSnapshot.root)).pipe(It(null),te(1))}),nn(()=>this.afterPreactivation()),U(()=>{let{currentSnapshot:c,targetSnapshot:l}=o,p=this.createViewTransition?.(this.environmentInjector,c.root,l.root);return p?T(p).pipe(S(()=>o)):f(o)}),S(c=>{let l=bs(t.routeReuseStrategy,c.targetSnapshot,c.currentRouterState);return this.currentTransition=o=E(h({},c),{targetRouterState:l}),this.currentNavigation.targetRouterState=l,o}),I(()=>{this.events.next(new xe)}),Os(this.rootContexts,t.routeReuseStrategy,c=>this.events.next(c),this.inputBindingEnabled),te(1),I({next:c=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new k(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects))),this.titleStrategy?.updateTitle(c.targetRouterState.snapshot),c.resolve(!0)},complete:()=>{a=!0}}),Zn(this.transitionAbortSubject.pipe(I(c=>{throw c}))),Ze(()=>{!a&&!u&&this.cancelNavigationTransition(o,"",O.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),J(c=>{if(u=!0,ui(c))this.events.next(new q(o.id,this.urlSerializer.serialize(o.extractedUrl),c.message,c.cancellationCode)),Ms(c)?this.events.next(new Le(c.url)):o.resolve(!1);else{this.events.next(new Ue(o.id,this.urlSerializer.serialize(o.extractedUrl),c,o.targetSnapshot??void 0));try{o.resolve(t.errorHandler(c))}catch(l){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(l)}}return z}))}))}cancelNavigationTransition(t,r,s){let o=new q(t.id,this.urlSerializer.serialize(t.extractedUrl),r,s);this.events.next(o),t.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}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function Eo(n){return n!==De}var Mo=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:()=>d(To),providedIn:"root"});let n=e;return n})(),Dn=class{shouldDetach(e){return!1}store(e,i){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,i){return e.routeConfig===i.routeConfig}},To=(()=>{let e=class e extends Dn{};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=Ut(e)))(s||e)}})(),e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})(),yi=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:()=>d(Ao),providedIn:"root"});let n=e;return n})(),Ao=(()=>{let e=class e extends yi{constructor(){super(...arguments),this.location=d(we),this.urlSerializer=d(ze),this.options=d(qe,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=d(Ln),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new B,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=ri(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(r=>{r.type==="popstate"&&t(r.url,r.state)})}handleRouterEvent(t,r){if(t instanceof le)this.stateMemento=this.createStateMemento();else if(t instanceof W)this.rawUrlTree=r.initialUrl;else if(t instanceof ut){if(this.urlUpdateStrategy==="eager"&&!r.extras.skipLocationChange){let s=this.urlHandlingStrategy.merge(r.finalUrl,r.initialUrl);this.setBrowserUrl(s,r)}}else t instanceof xe?(this.currentUrlTree=r.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(r.finalUrl,r.initialUrl),this.routerState=r.targetRouterState,this.urlUpdateStrategy==="deferred"&&(r.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,r))):t instanceof q&&(t.code===O.GuardRejected||t.code===O.NoDataFromResolver)?this.restoreHistory(r):t instanceof Ue?this.restoreHistory(r,!0):t instanceof k&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,r){let s=this.urlSerializer.serialize(t);if(this.location.isCurrentPathEqualTo(s)||r.extras.replaceUrl){let o=this.browserPageId,a=h(h({},r.extras.state),this.generateNgRouterState(r.id,o));this.location.replaceState(s,"",a)}else{let o=h(h({},r.extras.state),this.generateNgRouterState(r.id,this.browserPageId+1));this.location.go(s,"",o)}}restoreHistory(t,r=!1){if(this.canceledNavigationResolution==="computed"){let s=this.browserPageId,o=this.currentPageId-s;o!==0?this.location.historyGo(o):this.currentUrlTree===t.finalUrl&&o===0&&(this.resetState(t),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(r&&this.resetState(t),this.resetUrlToCurrentUrlTree())}resetState(t){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,r){return this.canceledNavigationResolution==="computed"?{navigationId:t,\u0275routerPageId:r}:{navigationId:t}}};e.\u0275fac=(()=>{let t;return function(s){return(t||(t=Ut(e)))(s||e)}})(),e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})(),Te=function(n){return n[n.COMPLETE=0]="COMPLETE",n[n.FAILED=1]="FAILED",n[n.REDIRECTING=2]="REDIRECTING",n}(Te||{});function Si(n,e){n.events.pipe(Q(i=>i instanceof k||i instanceof q||i instanceof Ue||i instanceof W),S(i=>i instanceof k||i instanceof W?Te.COMPLETE:(i instanceof q?i.code===O.Redirect||i.code===O.SupersededByNewNavigation:!1)?Te.REDIRECTING:Te.FAILED),Q(i=>i!==Te.REDIRECTING),te(1)).subscribe(()=>{e()})}function Do(n){throw n}var Oo={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},No={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},_=(()=>{let e=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=d(Qe),this.stateManager=d(yi),this.options=d(qe,{optional:!0})||{},this.pendingTasks=d(lr),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=d(jn),this.urlSerializer=d(ze),this.location=d(we),this.urlHandlingStrategy=d(Ln),this._events=new F,this.errorHandler=this.options.errorHandler||Do,this.navigated=!1,this.routeReuseStrategy=d(Mo),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=d(_e,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!d(mt,{optional:!0}),this.eventsSubscription=new _n,this.isNgZoneEnabled=d(x)instanceof x&&x.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){let t=this.navigationTransitions.events.subscribe(r=>{try{let s=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(s!==null&&o!==null){if(this.stateManager.handleRouterEvent(r,o),r instanceof q&&r.code!==O.Redirect&&r.code!==O.SupersededByNewNavigation)this.navigated=!0;else if(r instanceof k)this.navigated=!0;else if(r instanceof Le){let a=this.urlHandlingStrategy.merge(r.url,s.currentRawUrl),u={info:s.extras.info,skipLocationChange:s.extras.skipLocationChange,replaceUrl:this.urlUpdateStrategy==="eager"||Eo(s.source)};this.scheduleNavigation(a,De,null,u,{resolve:s.resolve,reject:s.reject,promise:s.promise})}}Uo(r)&&this._events.next(r)}catch(s){this.navigationTransitions.transitionAbortSubject.next(s)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),De,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,r)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(t,"popstate",r)},0)})}navigateToSyncWithBrowser(t,r,s){let o={replaceUrl:!0},a=s?.navigationId?s:null;if(s){let c=h({},s);delete c.navigationId,delete c.\u0275routerPageId,Object.keys(c).length!==0&&(o.state=c)}let u=this.parseUrl(t);this.scheduleNavigation(u,r,a,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(Pn),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(t,r={}){let{relativeTo:s,queryParams:o,fragment:a,queryParamsHandling:u,preserveFragment:c}=r,l=c?this.currentUrlTree.fragment:a,p=null;switch(u){case"merge":p=h(h({},this.currentUrlTree.queryParams),o);break;case"preserve":p=this.currentUrlTree.queryParams;break;default:p=o||null}p!==null&&(p=this.removeEmptyProps(p));let v;try{let w=s?s.snapshot:this.routerState.snapshot.root;v=Jr(w)}catch{(typeof t[0]!="string"||!t[0].startsWith("/"))&&(t=[]),v=this.currentUrlTree.root}return ei(v,t,p,l??null)}navigateByUrl(t,r={skipLocationChange:!1}){let s=ue(t)?t:this.parseUrl(t),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,De,null,r)}navigate(t,r={skipLocationChange:!1}){return Po(t),this.navigateByUrl(this.createUrlTree(t,r),r)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){try{return this.urlSerializer.parse(t)}catch{return this.urlSerializer.parse("/")}}isActive(t,r){let s;if(r===!0?s=h({},Oo):r===!1?s=h({},No):s=r,ue(t))return Lr(this.currentUrlTree,t,s);let o=this.parseUrl(t);return Lr(this.currentUrlTree,o,s)}removeEmptyProps(t){return Object.entries(t).reduce((r,[s,o])=>(o!=null&&(r[s]=o),r),{})}scheduleNavigation(t,r,s,o,a){if(this.disposed)return Promise.resolve(!1);let u,c,l;a?(u=a.resolve,c=a.reject,l=a.promise):l=new Promise((v,w)=>{u=v,c=w});let p=this.pendingTasks.add();return Si(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(p))}),this.navigationTransitions.handleNavigationRequest({source:r,restoredState:s,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:o,resolve:u,reject:c,promise:l,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),l.catch(v=>Promise.reject(v))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function Po(n){for(let e=0;e{let e=class e{constructor(t,r,s,o,a,u){this.router=t,this.route=r,this.tabIndexAttribute=s,this.renderer=o,this.el=a,this.locationStrategy=u,this.href=null,this.commands=null,this.onChanges=new F,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;let c=a.nativeElement.tagName?.toLowerCase();this.isAnchorElement=c==="a"||c==="area",this.isAnchorElement?this.subscription=t.events.subscribe(l=>{l instanceof k&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(t){this.tabIndexAttribute!=null||this.isAnchorElement||this.applyAttributeValue("tabindex",t)}ngOnChanges(t){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(t){t!=null?(this.commands=Array.isArray(t)?t:[t],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(t,r,s,o,a){let u=this.urlTree;if(u===null||this.isAnchorElement&&(t!==0||r||s||o||a||typeof this.target=="string"&&this.target!="_self"))return!0;let c={skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info};return this.router.navigateByUrl(u,c),!this.isAnchorElement}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){let t=this.urlTree;this.href=t!==null&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(t)):null;let r=this.href===null?null:rr(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",r)}applyAttributeValue(t,r){let s=this.renderer,o=this.el.nativeElement;r!==null?s.setAttribute(o,t,r):s.removeAttribute(o,t)}get urlTree(){return this.commands===null?null:this.router.createUrlTree(this.commands,{relativeTo:this.relativeTo!==void 0?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}};e.\u0275fac=function(r){return new(r||e)(re(_),re(G),Jn("tabindex"),re(or),re(er),re(Ce))},e.\u0275dir=Ot({type:e,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(r,s){r&1&&fr("click",function(a){return s.onClick(a.button,a.ctrlKey,a.shiftKey,a.altKey,a.metaKey)}),r&2&&hr("target",s.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[Ke.HasDecoratorInputTransform,"preserveFragment","preserveFragment",Xe],skipLocationChange:[Ke.HasDecoratorInputTransform,"skipLocationChange","skipLocationChange",Xe],replaceUrl:[Ke.HasDecoratorInputTransform,"replaceUrl","replaceUrl",Xe],routerLink:"routerLink"},standalone:!0,features:[cr,Pt]});let n=e;return n})();var vt=class{};var xo=(()=>{let e=class e{constructor(t,r,s,o,a){this.router=t,this.injector=s,this.preloadingStrategy=o,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(Q(t=>t instanceof k),ee(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,r){let s=[];for(let o of r){o.providers&&!o._injector&&(o._injector=_t(o.providers,t,`Route: ${o.path}`));let a=o._injector??t,u=o._loadedInjector??a;(o.loadChildren&&!o._loadedRoutes&&o.canLoad===void 0||o.loadComponent&&!o._loadedComponent)&&s.push(this.preloadConfig(a,o)),(o.children||o._loadedRoutes)&&s.push(this.processRoutes(u,o.children??o._loadedRoutes))}return T(s).pipe(Rt())}preloadConfig(t,r){return this.preloadingStrategy.preload(r,()=>{let s;r.loadChildren&&r.canLoad===void 0?s=this.loader.loadChildren(t,r):s=f(null);let o=s.pipe(A(a=>a===null?f(void 0):(r._loadedRoutes=a.routes,r._loadedInjector=a.injector,this.processRoutes(a.injector??t,a.routes))));if(r.loadComponent&&!r._loadedComponent){let a=this.loader.loadComponent(r);return T([o,a]).pipe(Rt())}else return o})}};e.\u0275fac=function(r){return new(r||e)(y(_),y(Ye),y(ne),y(vt),y(xn))},e.\u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})(),Ci=new M(""),Lo=(()=>{let e=class e{constructor(t,r,s,o,a={}){this.urlSerializer=t,this.transitions=r,this.viewportScroller=s,this.zone=o,this.options=a,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},this.environmentInjector=d(ne),a.scrollPositionRestoration||="disabled",a.anchorScrolling||="disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof le?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof k?(this.lastId=t.id,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.urlAfterRedirects).fragment)):t instanceof W&&t.code===ct.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof lt&&(t.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0]):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(t.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,r){this.zone.runOutsideAngular(()=>$n(this,null,function*(){yield new Promise(s=>{setTimeout(()=>{s()}),$t(()=>{s()},{injector:this.environmentInjector})}),this.zone.run(()=>{this.transitions.events.next(new lt(t,this.lastSource==="popstate"?this.store[this.restoredId]:null,r))})}))}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}};e.\u0275fac=function(r){ir()},e.\u0275prov=C({token:e,factory:e.\u0275fac});let n=e;return n})();function Ka(n,...e){return Nt([{provide:_e,multi:!0,useValue:n},[],{provide:G,useFactory:wi,deps:[_]},{provide:zt,multi:!0,useFactory:Ri},e.map(i=>i.\u0275providers)])}function wi(n){return n.routerState.root}function We(n,e){return{\u0275kind:n,\u0275providers:e}}function Ri(){let n=d(xt);return e=>{let i=n.get(Ht);if(e!==i.components[0])return;let t=n.get(_),r=n.get(bi);n.get(kn)===1&&t.initialNavigation(),n.get(Ii,null,Tt.Optional)?.setUpPreloading(),n.get(Ci,null,Tt.Optional)?.init(),t.resetRootComponentType(i.componentTypes[0]),r.closed||(r.next(),r.complete(),r.unsubscribe())}}var bi=new M("",{factory:()=>new F}),kn=new M("",{providedIn:"root",factory:()=>1});function jo(){return We(2,[{provide:kn,useValue:0},{provide:Ft,multi:!0,deps:[xt],useFactory:e=>{let i=e.get(Cr,Promise.resolve());return()=>i.then(()=>new Promise(t=>{let r=e.get(_),s=e.get(bi);Si(r,()=>{t(!0)}),e.get(jn).afterPreactivation=()=>(t(!0),s.closed?f(void 0):s),r.initialNavigation()}))}}])}function ko(){return We(3,[{provide:Ft,multi:!0,useFactory:()=>{let e=d(_);return()=>{e.setUpLocationChangeListener()}}},{provide:kn,useValue:2}])}var Ii=new M("");function $o(n){return We(0,[{provide:Ii,useExisting:xo},{provide:vt,useExisting:n}])}function _o(){return We(8,[_r,{provide:mt,useExisting:_r}])}function Fo(n){let e=[{provide:vi,useValue:bo},{provide:mi,useValue:h({skipNextTransition:!!n?.skipInitialTransition},n)}];return We(9,e)}var zr=new M("ROUTER_FORROOT_GUARD"),zo=[we,{provide:ze,useClass:Ne},_,He,{provide:G,useFactory:wi,deps:[_]},xn,[]],Qa=(()=>{let e=class e{constructor(t){}static forRoot(t,r){return{ngModule:e,providers:[zo,[],{provide:_e,multi:!0,useValue:t},{provide:zr,useFactory:qo,deps:[[_,new At,new Qn]]},{provide:qe,useValue:r||{}},r?.useHash?Vo():Bo(),Ho(),r?.preloadingStrategy?$o(r.preloadingStrategy).\u0275providers:[],r?.initialNavigation?Wo(r):[],r?.bindToComponentInputs?_o().\u0275providers:[],r?.enableViewTransitions?Fo().\u0275providers:[],Go()]}}static forChild(t){return{ngModule:e,providers:[{provide:_e,multi:!0,useValue:t}]}}};e.\u0275fac=function(r){return new(r||e)(y(zr,8))},e.\u0275mod=Dt({type:e}),e.\u0275inj=Mt({});let n=e;return n})();function Ho(){return{provide:Ci,useFactory:()=>{let n=d(Er),e=d(x),i=d(qe),t=d(jn),r=d(ze);return i.scrollOffset&&n.setOffset(i.scrollOffset),new Lo(r,t,n,e,i)}}}function Vo(){return{provide:Ce,useClass:Rr}}function Bo(){return{provide:Ce,useClass:wr}}function qo(n){return"guarded"}function Wo(n){return[n.initialNavigation==="disabled"?ko().\u0275providers:[],n.initialNavigation==="enabledBlocking"?jo().\u0275providers:[]]}var Hr=new M("");function Go(){return[{provide:Hr,useFactory:Ri},{provide:zt,multi:!0,useExisting:Hr}]}export{Ea as a,Rs as b,Za as c,Ka as d,Qa as e}; diff --git a/docs/chunk-X4P3GI5V.js b/docs/chunk-X4P3GI5V.js new file mode 100644 index 0000000..21b89ae --- /dev/null +++ b/docs/chunk-X4P3GI5V.js @@ -0,0 +1 @@ +import{e as te}from"./chunk-TMD3IN23.js";import{a as z,b as $,c as j,d as E}from"./chunk-KRYPOJUJ.js";import{$a as Q,A as T,Ha as r,Ia as I,Nb as ee,Qb as w,R as A,Rb as B,T as F,Tb as S,Ua as h,Wa as x,Xa as y,Za as p,_a as K,a as k,ab as X,b as V,bb as n,cb as i,db as v,gb as Y,hb as D,ja as _,mb as c,n as G,nb as u,pb as Z,qb as b,rb as P,sb as H,tb as m,u as g,ub as f}from"./chunk-M6PASJEJ.js";var ne=e=>({coordinates:e}),oe=e=>({"atom.id":e}),re=(e,t,l)=>({"chain.id":e,"residue.id":t,"atom.id":l});function le(e,t){e&1&&v(0,"div",9),e&2&&y("background-color",t)}function de(e,t){e&1&&(n(0,"code",6)(1,"pre",10),c(2),m(3,"json"),i()()),e&2&&(r(2),u(f(3,1,P(3,ne,t.coordinates))))}function pe(e,t){e&1&&(n(0,"code",6)(1,"pre",10),c(2),m(3,"json"),i()()),e&2&&(r(2),u(f(3,1,P(3,ne,t.coordinates))))}function me(e,t){e&1&&v(0,"div",9),e&2&&y("background-color",t)}function fe(e,t){e&1&&(n(0,"code",6)(1,"pre",10),c(2),m(3,"json"),i()()),e&2&&(r(2),u(f(3,1,P(3,oe,t["atom.id"]))))}function ue(e,t){e&1&&(n(0,"code",6)(1,"pre",10),c(2),m(3,"json"),i()()),e&2&&(r(2),u(f(3,1,P(3,oe,t["atom.id"]))))}function ve(e,t){e&1&&v(0,"div",9),e&2&&y("background-color",t)}function he(e,t){if(e&1&&(n(0,"code",6)(1,"pre",10),c(2),m(3,"json"),i()()),e&2){let l=t;r(2),u(f(3,1,H(3,re,l["chain.id"],l["residue.id"],l["atom.id"])))}}function ge(e,t){if(e&1&&(n(0,"code",6)(1,"pre",10),c(2),m(3,"json"),i()()),e&2){let l=t;r(2),u(f(3,1,H(3,re,l["chain.id"],l["residue.id"],l["atom.id"])))}}function _e(e,t){if(e&1&&v(0,"ngx-structure-viewer",8),e&2){let l=D();x("settings",l.settings)("source",l.source)("interactions",t)}}var ae=(()=>{let t=class t{constructor(s){this.location=s,this.settings={"background-color":"#2b3035ff","backbone-color":"#6ea8fe40","interaction-color":"#ff0000ff","interaction-size":.5},this.source={type:"remote",format:"mmcif",label:"8VAP.A",binary:!1,link:this.location.prepareExternalUrl("assets/8vap.A.cif")},this.interactions=[{from:{coordinates:z.create(165.36768,188.18981,113.00826)},to:{coordinates:z.create(160.33379,162.30181,108.49545)},color:"#ff4500"},{from:{"atom.id":211},to:{"atom.id":374},color:"#adff2f"},{from:{"chain.id":"A","residue.id":"148","atom.name":"CA"},to:{"chain.id":"A","residue.id":"89","atom.name":"CD"},color:"#8a2be2"}],this.interactions$=T(3e3).pipe(g(()=>this.interactions.map(o=>k({},o))),g(o=>o.sort(()=>Math.random()-.5)),g(o=>[o[0]]),F([this.interactions[0]]),A(1))}};t.\u0275fac=function(o){return new(o||t)(I(ee))},t.\u0275cmp=_({type:t,selectors:[["app-section-interactions"]],standalone:!0,features:[b],decls:29,vars:12,consts:[[1,"row","mb-3"],[1,"col-6"],[1,"mb-3"],[1,"mb-1"],[1,"d-flex","flex-row","align-items-stretch","gap-1"],[1,"d-block","p-2",3,"background-color"],[1,"d-block","flex-1"],[1,"rounded","squared","overflow-hidden","bg-body-tertiary"],[3,"settings","source","interactions"],[1,"d-block","p-2"],[1,"bg-body-tertiary","p-3","m-0"]],template:function(o,a){if(o&1&&(n(0,"div",0)(1,"div",1)(2,"h2"),c(3,"Interactions"),i(),n(4,"div",2)(5,"p",3),c(6,"1. Provide atom coordinates"),i(),n(7,"div",4),h(8,le,1,2,"div",5)(9,de,4,5,"code",6)(10,pe,4,5,"code",6),i()(),n(11,"div",2)(12,"p",3),c(13,"2. Provide atom identifier"),i(),n(14,"div",4),h(15,me,1,2,"div",5)(16,fe,4,5,"code",6)(17,ue,4,5,"code",6),i()(),n(18,"div",2)(19,"p",3),c(20,"3. Provide chain, residue identifier and atom name"),i(),n(21,"div",4),h(22,ve,1,2,"div",5)(23,he,4,7,"code",6)(24,ge,4,7,"code",6),i()()(),n(25,"div",1)(26,"div",7),h(27,_e,1,3,"ngx-structure-viewer",8),m(28,"async"),i()()()),o&2){let d,C,M,N,R,J,O,L,U,W;r(8),p(8,(d=a.interactions[0].color)?8:-1,d),r(),p(9,(C=a.interactions[0].from)?9:-1,C),r(),p(10,(M=a.interactions[0].to)?10:-1,M),r(5),p(15,(N=a.interactions[1].color)?15:-1,N),r(),p(16,(R=a.interactions[1].from)?16:-1,R),r(),p(17,(J=a.interactions[1].to)?17:-1,J),r(5),p(22,(O=a.interactions[2].color)?22:-1,O),r(),p(23,(L=a.interactions[2].from)?23:-1,L),r(),p(24,(U=a.interactions[2].to)?24:-1,U),r(3),p(27,(W=f(28,10,a.interactions$))?27:-1,W)}},dependencies:[E,S,w,B]});let e=t;return e})();function be(e,t){if(e&1&&(n(0,"div",6)(1,"div",7),v(2,"div",8),n(3,"code",9)(4,"pre",10),c(5),m(6,"json"),i()()()()),e&2){let l=t.$implicit;r(2),y("background-color",l.color),r(3),u(f(6,3,l))}}function Se(e,t){if(e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),v(3,"ngx-structure-viewer",3),i()(),n(4,"div",4)(5,"h2"),c(6,"Color chain"),i(),n(7,"div",5),Q(8,be,7,5,"div",6,K),i()()()),e&2){let l=t,s=D();r(3),x("settings",s.settings)("source",s.source)("loci",l),r(5),X(l)}}var ce=(()=>{let t=class t{constructor(s,o){this.structureService=s,this.pluginService=o,this.settings={"background-color":"#2b3035ff","backbone-color":"#6ea8fecc","interaction-color":"#ff0000ff","interaction-size":1},this.source={type:"remote",format:"mmcif",label:"8VAP",binary:!1,link:"assets/8vap.cif"};let a=[{chain:"A",color:"#6f42c1"},{chain:"B",color:"#0d6efd"},{chain:"C",color:"#dc3545"},{chain:"D",color:"#ffc107"},{chain:"E",color:"#28a745"},{chain:"F",color:"#17a2b8"},{chain:"G",color:"#fd7e14"}];this.chains$=T(3e3).pipe(g(()=>a.map(d=>d.color)),g(d=>d.sort(()=>Math.random()-.5)),g(d=>d.map((C,M)=>V(k({},a[M]),{color:C}))),F(a),A(1)),s.structure$.subscribe(()=>{console.log("Hello, world!")})}};t.\u0275fac=function(o){return new(o||t)(I(j),I($))},t.\u0275cmp=_({type:t,selectors:[["app-section-chains"]],standalone:!0,features:[Z([j,$]),b],decls:2,vars:3,consts:[[1,"row","mb-3"],[1,"col-9"],[1,"rounded","squared","overflow-hidden","shadow-sm"],[3,"settings","source","loci"],[1,"col-3","pt-0","p-3"],[1,"d-flex","flex-column","gap-2"],[1,"flex-1"],[1,"d-flex","flex-row","gap-2"],[1,"d-block","flex-shrink-0","p-2"],[1,"bg-body-tertiary","flex-grow-1","p-3"],[1,"m-0"]],template:function(o,a){if(o&1&&(h(0,Se,10,3,"div",0),m(1,"async")),o&2){let d;p(0,(d=f(1,1,a.chains$))?0:-1,d)}},dependencies:[E,S,w,B],changeDetection:0});let e=t;return e})();function Ce(e,t){e&1&&(n(0,"div",4)(1,"code",6),c(2),i()()),e&2&&(r(2),u(t))}var se=(()=>{let t=class t{constructor(){this.label$=new G(1),this.settings={"background-color":"#2b3035ff","backbone-color":"#6ea8fecc","interaction-color":"#ff0000ff","interaction-size":1},this.source={type:"remote",format:"mmcif",label:"8VAP",binary:!1,link:"assets/8vap.cif"}}onHighlights(s){let o=s?`Chain: ${s.chain}; Start: ${s.start}; End: ${s.end}.`:"";this.label$.next(o)}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=_({type:t,selectors:[["app-section-highlights"]],standalone:!0,features:[b],decls:9,vars:5,consts:[[1,"row","mb-3"],[1,"col-6","position-relative"],[1,"squared","rounded","overflow-hidden","bg-body-tertiary"],[3,"highlights","settings","source"],[1,"d-block","position-absolute","bottom-0","end-0","w-auto","h-auto","pe-3"],[1,"col-6"],[1,"d-block","p-3"]],template:function(o,a){if(o&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"ngx-structure-viewer",3),Y("highlights",function(C){return a.onHighlights(C)}),i()(),h(4,Ce,3,1,"div",4),m(5,"async"),i(),n(6,"div",5)(7,"h2"),c(8,"Highlights"),i()()()),o&2){let d;r(3),x("settings",a.settings)("source",a.source),r(),p(4,(d=f(5,3,a.label$))?4:-1,d)}},dependencies:[E,S,w],changeDetection:0});let e=t;return e})();var We=(()=>{let t=class t{};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=_({type:t,selectors:[["page-structure-viewer"]],standalone:!0,features:[b],decls:12,vars:0,consts:[[1,"container","pt-3"],[1,"mb-3"]],template:function(o,a){o&1&&(n(0,"div",0)(1,"div",1)(2,"h1"),c(3,"Structure viewer"),i(),n(4,"p"),c(5," The "),n(6,"b"),c(7,"ngx-structure-viewer"),i(),c(8," is a Mol* wrapper for Angular. It is a viewer for molecular structures and can be used to visualize and interact with 3D molecular structures. It works out of the box with the latest releases of Angular and automatized the most common features of Mol*. "),i()(),v(9,"app-section-chains")(10,"app-section-interactions")(11,"app-section-highlights"),i())},dependencies:[ae,se,ce,te,S],styles:[".progress-bar[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_progress 10s linear infinite;width:0}@keyframes _ngcontent-%COMP%_progress{0%{width:0}to{width:100%}}"]});let e=t;return e})();export{We as PageStructureViewerComponent}; diff --git a/docs/chunk-ZNC2MO6Y.js b/docs/chunk-ZNC2MO6Y.js new file mode 100644 index 0000000..223c72e --- /dev/null +++ b/docs/chunk-ZNC2MO6Y.js @@ -0,0 +1 @@ +import{a as S,b as h}from"./chunk-IFRY76GO.js";import{Ha as s,Tb as P,Ua as m,Wa as p,Ya as c,Za as g,bb as t,cb as a,db as o,ja as d,mb as n,ob as v,qb as f}from"./chunk-M6PASJEJ.js";function E(e,i){e&1&&o(0,"i",11)}function y(e,i){e&1&&o(0,"i",12)}function A(e,i){if(e&1&&(t(0,"div"),n(1),m(2,E,1,0,"i",11)(3,y,1,0),a()),e&2){let r=i.trace;c("text-muted",!r.expanded),s(),v(" ",r.label,"\xA0 "),s(),g(2,r.expanded?2:3)}}function L(e,i){if(e&1&&(t(0,"div"),n(1," Right label! "),a()),e&2){let r=i.trace;c("text-muted",!r.expanded)}}var D="MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDIEQWFTEDPGPDEAPRMPEAAPPVAPAPAAPTPAAPAPAPSWPLSSSVPSQKTYQGSYGFRLGFLHSGTAKSVTCTYSPALNKMFCQLAKTCPVQLWVDSTPPPGTRVRAMAIYKQSQHMTEVVRRCPHHERCSDSDGLAPPQHLIRVEGNLRVEYLDDRNTFRHSVVVPYEPPEVGSDCTTIHYNYMCNSSCMGGMNRRPILTIITLEDSSGNLLGRNSFEVRVCACPGRDRRTEEENLRKKGEPHHELPPGSTKRALPNNTSSSPQPKKKPLDGEYFTLQIRGRERFEMFRELNEALELKDAQAGKEPGGSRAHSSHLKSKKGQSTSRHKKLMFKTEGPDSD",V=(()=>{let i=class i{constructor(){this.settings={"line-height":24,"content-size":16,"background-color":"transparent","trace-color":"cyan","grid-color":"rgba(222, 226, 230, 0.5)","text-color":"white","margin-top":24,"margin-right":24,"margin-bottom":24,"margin-left":128},this.sequence=Array.from(D.slice(0,100)),this.features=[{label:"Feature #1",type:"continuous",values:Array.from({length:70},()=>Math.floor(Math.random()*100)+1)},{label:"Feature #2",type:"loci","trace-color":"red",values:[{start:1,end:50},{start:30,end:60}]},{label:"Feature #3",type:"trace",position:"overlap",values:[{type:"loci",values:[{start:1,end:10}],"trace-color":"blue"},{type:"loci",values:[{start:20,end:40}],"trace-color":"red"},{type:"loci",values:[{start:60,end:100}],"trace-color":"yellow"},{type:"continuous",values:Array.from({length:70},()=>Math.floor(Math.random()*100)+1),"trace-color":"yellow"}],"background-color":"transparent"},{label:"Feature #4",type:"loci",values:[{start:27,end:56},{start:61,end:72}],nested:[{label:"Feature #5",type:"trace",values:[{type:"loci",values:[{start:1,end:5},{start:6,end:10}]},{type:"loci",values:[{start:10,end:27}]}]},{label:"Feature #6",type:"continuous",values:Array.from({length:70},()=>Math.floor(Math.random()*100)+1)}]},{label:"Feature #7",type:"loci",values:[{start:81,end:81},{start:82,end:82}],nested:[{label:"Feature #8",type:"trace",values:[{type:"loci",values:[{start:81,end:81}]},{type:"loci",values:[{start:82,end:82}]}]},{label:"Feature #9",type:"continuous","trace-color":"greenyellow",values:Array.from({length:70},()=>Math.floor(Math.random()*100)+1)}]}]}};i.\u0275fac=function(l){return new(l||i)},i.\u0275cmp=d({type:i,selectors:[["page-features-viewer"]],standalone:!0,features:[f],decls:26,vars:3,consts:[[1,"container","pt-3"],[1,"mb-3"],[1,"d-flex","flex-row","gap-3","mb-3"],[2,"display","block","width","1rem","height","1rem","background","black","font-size","1rem","line-height","1rem"],[2,"display","block","width","1rem","height","auto","background","black","color","white","font-size","1rem","line-height",".5rem"],[2,"display","block","width","auto","height","1rem","background","black","color","white","font-size","1rem","line-height","1rem"],[1,"d-block","mb-3"],[2,"display","block","height","auto","width","100%"],[3,"sequence","features","settings"],["ngx-features-viewer-label",""],["ngx-features-viewer-label","right"],[1,"bi","bi-caret-down-fill"],[1,"bi","bi-caret-right"]],template:function(l,u){l&1&&(t(0,"div",0)(1,"div",1)(2,"h1"),n(3,"Feature viewer"),a(),t(4,"p"),n(5," The feature viewer allows you to represent features on a reference seqeunce... "),a()(),t(6,"div",2),o(7,"div",3),t(8,"div",4),n(9," W"),a(),t(10,"div",5),n(11," W"),a()(),t(12,"div",6)(13,"p"),n(14," Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras congue velit in sem sodales pretium. Vivamus sit amet enim malesuada, efficitur quam quis, semper metus. Aenean commodo tellus eu viverra lacinia. Nam sed lectus non tellus suscipit pellentesque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse lacus diam, laoreet eget nisl et, dictum dictum elit. Vivamus sit amet fringilla elit, vitae pulvinar nisl. Donec mattis magna lacus, id congue risus aliquet a. "),a(),t(15,"p"),n(16," Cras nec malesuada risus. Integer a tincidunt ante. Vivamus eu mauris placerat, dictum diam vitae, laoreet eros. Integer porttitor neque vel lectus ullamcorper commodo. Aliquam erat volutpat. Morbi convallis fermentum mauris, quis aliquet tellus posuere non. Nunc aliquet mattis tellus et ultrices. "),a()(),t(17,"div",7)(18,"ngx-features-viewer",8),m(19,A,4,4,"ng-template",9)(20,L,2,2,"ng-template",10),a()(),t(21,"div")(22,"p"),n(23," Morbi convallis ipsum sit amet felis faucibus mollis. Duis nec viverra nisl, nec maximus nisl. Proin non malesuada massa, sit amet auctor elit. Sed condimentum, urna id commodo semper, nisi lorem lobortis velit, eu auctor ante magna eu nibh. Aliquam mattis pulvinar sapien vitae rhoncus. Sed lacinia ex a ultrices finibus. Phasellus eu erat eu sapien laoreet dapibus ac vitae mauris. "),a(),t(24,"p"),n(25," Vestibulum elementum sem vel lorem suscipit varius. Mauris malesuada porta sapien blandit facilisis. Aliquam pretium erat nec lorem molestie, et feugiat turpis semper. Donec tempus posuere nibh, maximus hendrerit odio eleifend vitae. Praesent consequat felis leo, at ullamcorper nisl dictum sed. Morbi erat dui, sollicitudin id interdum convallis, elementum laoreet lorem. Duis leo massa, commodo id tempor sed, semper ut dui. Proin faucibus feugiat sapien, et cursus nunc. Duis eu mattis ipsum, ac facilisis quam. Donec a sapien non lectus iaculis luctus. Nulla lobortis turpis id nisi consectetur aliquet. Aliquam dignissim aliquam erat, at egestas nulla ullamcorper a. Duis porta interdum venenatis. Praesent a lorem at velit egestas efficitur eu et lectus. Suspendisse potenti. Duis imperdiet aliquam hendrerit. "),a()()()),l&2&&(s(18),p("sequence",u.sequence)("features",u.features)("settings",u.settings))},dependencies:[S,h,P],changeDetection:0});let e=i;return e})();export{V as PageFeaturesViewerComponent}; diff --git a/docs/index.html b/docs/index.html index 252d286..5f845d2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -13,8 +13,9 @@ - + - + diff --git a/docs/main-KWKHEO7E.js b/docs/main-KWKHEO7E.js new file mode 100644 index 0000000..9444279 --- /dev/null +++ b/docs/main-KWKHEO7E.js @@ -0,0 +1 @@ +import{a as c,b as u,c as E,d as h,e as d}from"./chunk-TMD3IN23.js";import"./chunk-IFRY76GO.js";import{Tb as m,bb as e,cb as t,db as i,ja as s,mb as n,qb as l}from"./chunk-M6PASJEJ.js";var g=(()=>{let o=class o{};o.\u0275fac=function(a){return new(a||o)},o.\u0275cmp=s({type:o,selectors:[["page-home"]],standalone:!0,features:[l],decls:54,vars:0,consts:[[1,"container","pt-3"],[1,"row"],[1,"col-12"],[1,"mb-3"],[1,"row","align-items-stretch","mb-3"],[1,"col-4"],["routerLink","/structure",1,"card","bg-body-tertiary","cursor-pointer","shadow-sm","mb-3"],[1,"card-header","bg-primary"],[1,"bi","bi-boxes","me-3"],[1,"card-body"],["src","assets/structure-viewer.png","alt","Structure viewer",1,"w-100","h-auto"],[1,"card-text"],[1,"text-center","mt-auto"],[1,"badge","rounded-pill","bg-primary"],[1,"bi","bi-chevron-right"],["routerLink","/features",1,"card","bg-body-tertiary","cursor-pointer","shadow-sm","mb-3"],[1,"bi","bi-sliders","me-1"],["src","assets/features-viewer.png","alt","Features viewer",1,"w-100","h-auto"],["routerLink","/sequence",1,"card","bg-body-tertiary","cursor-pointer","shadow-sm","mb-3"],[1,"bi","bi-body-text","me-1"],["src","assets/sequence-viewer.png","alt","Sequence viewer",1,"w-100","h-auto"],[1,"card","mb-3"],[1,"bi","bi-recycle","me-1"]],template:function(a,v){a&1&&(e(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),n(4,"Products"),t()()(),e(5,"div",4)(6,"div",5)(7,"div",6)(8,"h2",7),i(9,"i",8),n(10," ngx-structure-viewer"),t(),e(11,"div",9),i(12,"img",10),e(13,"p",11),n(14," Visualize and interact with 3D molecular structures. Provides Mol* functionalities out-of-the-box for Angular developers. "),t(),e(15,"div",12)(16,"span",13),n(17," Try it out "),i(18,"i",14),t()()()()(),e(19,"div",5)(20,"div",15)(21,"h2",7),i(22,"i",16),n(23," ngx-features-viewer "),t(),e(24,"div",9),i(25,"img",17),e(26,"p",11),n(27," The ultimate tool for Angular developers who want to visualize and interact biological sequences and their features. "),t(),e(28,"div",12)(29,"span",13),n(30," Try it out "),i(31,"i",14),t()()()()(),e(32,"div",5)(33,"div",18)(34,"h2",7),i(35,"i",19),n(36," ngx-sequence-viewer "),t(),e(37,"div",9),i(38,"img",20),e(39,"p",11),n(40," Angular native component for single sequences or multiple sequence alignments. Does not require any third party library. "),t(),e(41,"div",12)(42,"span",13),n(43," Try it out "),i(44,"i",14),t()()()()()(),e(45,"div",1)(46,"div",2)(47,"div",21)(48,"h2",7),i(49,"i",22),n(50," Enhanced interactivity "),t(),e(51,"div",9)(52,"p",11),n(53," Our components are designed starting from the same, generic data structures. This allows to easily wire up multiple components in the same Angular component. Hence, it provides component interaction out-of-the-box. "),t()()()()()())},dependencies:[m,d,E],styles:[".cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}"]});let r=o;return r})();var V=[{path:"structure",loadComponent:()=>import("./chunk-X4P3GI5V.js").then(r=>r.PageStructureViewerComponent)},{path:"sequence",loadComponent:()=>import("./chunk-OI2SMRDK.js").then(r=>r.PageSequenceViewerComponent)},{path:"features",loadComponent:()=>import("./chunk-ZNC2MO6Y.js").then(r=>r.PageFeaturesViewerComponent)},{path:"",component:g},{path:"**",redirectTo:""}];var A={providers:[h(V)]};var D="MLPGLALLLLAAWTARALEVPTDGNAGLLAEPQIAMFCGRLNMHMNVQNGKWDSDPSGTKTCIDTKEGILQYCQEVYPELQITNVVEANQPVTIQNWCKRGRKQCKTHPHFVIPYRCLVGEFVSDALLVPDKCKFLHQERMDVCETHLHWHTVAKETCSEKSTNLHDYGMLLPCGIDKFRGVEFVCCPLAEESDNVDSADAEEDDSDVWWGGADTDYADGSEDKVVEVAEEEEVAEVEEEEADDDEDDEDGDEVEEEAEEPYEEATERTTSIATTTTTTTESVEEVVREVCSEQAETGPCRAMISRWYFDVTEGKCAPFFYGGCGGNRNNFDTEEYCMAVCGSAMSQSLLKTTQEPLARDPVKLPTTAASTPDAVDKYLETPGDENEHAHFQKAKERLEAKHRERMSQVMREWEEAERQAKNLPKADKKAVIQHFQEKVESLEQEAANERQQLVETHMARVEAMLNDRRRLALENYITALQAVPPRPRHVFNMLKKYVRAEQKDRQHTLKHFEHVRMVDPKKAAQIRSQVMTHLRVIYERMNQSLSLLYNVPAVAEEIQDEVDELLQKEQNYSDDVLANMISEPRISYGNDALMPSLTETKTTVELLPVNGEFSLDDLQPWHSFGADSVPANTENEVEPVDARPAADRGLTTRPGSGLTNIKTEEISEVKMDAEFRHDSGYEVHHQKLVFFAEDVGSNKGAIIGLMVGGVVIATVIVITLVMLKKKQYTSIHHGVVEVDAAVTPEERHLSKMQQNGYENPTYKFFEQMQN",f=(()=>{let o=class o{constructor(){this.title="ngx-bio-tools",this.sequence=D.split(""),this.features=[{id:0,type:"continuous",color:"blue",values:this.sequence.map(()=>Math.random()),parent:void 0,height:128},{id:1,type:"loci",color:"red",values:[{start:1,end:3},{start:5,end:6}],parent:void 0,height:96},{id:2,type:"pins",color:"green",values:[{start:5},{start:100,color:"blue"},{start:400,color:"red"}],parent:1},{id:3,type:"loci",color:"orange",values:[{start:10,end:20},{start:30,end:70}],parent:1},{id:4,type:"loci",color:"purple",values:[{start:100,end:300}],parent:void 0},{id:5,type:"dssp",color:"black",values:[{start:30,end:90,code:"H",color:"orange"},{start:120,end:300,code:"E",color:"purple"}],parent:void 0}]}};o.\u0275fac=function(a){return new(a||o)},o.\u0275cmp=s({type:o,selectors:[["app-root"]],standalone:!0,features:[l],decls:19,vars:0,consts:[[1,"navbar"],[1,"container-fluid","justify-content-center"],["href","#",1,"navbar-brand","d-flex","flex-row","align-items-center","gap-3"],["src","assets/ngx-biocomp-up-white.png","alt","ngx-biocomp-up","height","48"],[1,"h2"],[1,"container-fluid","bg-dark","pt-2","pb-2"],[1,"row"],[1,"col-3","d-flex","justify-content-start"],["src","assets/biocomp-white.png","alt","BioComputing UP","height","36"],[1,"col-6","d-flex","align-items-center","justify-content-center"],["href","https://github.com/damiclem",1,"text-light","small"],[1,"bi","bi-github"],[1,"col-3","d-flex","justify-content-end"],["src","assets/unipd-white.png","alt","University of Padua","height","36"]],template:function(a,v){a&1&&(e(0,"header")(1,"nav",0)(2,"div",1)(3,"a",2),i(4,"img",3),e(5,"h1",4),n(6,"ngx-biocomp-up"),t()()()()(),e(7,"main"),i(8,"router-outlet"),t(),e(9,"footer",5)(10,"div",6)(11,"div",7),i(12,"img",8),t(),e(13,"div",9)(14,"a",10),n(15," Developed by Damiano Clementel "),i(16,"i",11),t()(),e(17,"div",12),i(18,"img",13),t()()())},dependencies:[m,d,u],styles:["[_nghost-%COMP%]{height:inherit;display:inherit;flex-direction:inherit}"]});let r=o;return r})();c(f,A).catch(r=>console.error(r)); diff --git a/docs/main.5b859c60ef271fc0.js b/docs/main.5b859c60ef271fc0.js deleted file mode 100644 index 306d98f..0000000 --- a/docs/main.5b859c60ef271fc0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[792],{1678:(Te,oe,S)=>{var E=S(345),I=S(6933),W=S(177),N=S(4438);const Q={providers:[(0,I.lh)([{path:"structure",loadComponent:()=>Promise.all([S.e(509),S.e(876)]).then(S.bind(S,9876)).then(q=>q.PageStructureViewerComponent)},{path:"sequence",loadComponent:()=>Promise.all([S.e(509),S.e(39)]).then(S.bind(S,3039)).then(q=>q.PageSequenceViewerComponent)},{path:"features",loadComponent:()=>S.e(772).then(S.bind(S,9772)).then(q=>q.PageFeaturesViewerComponent)},{path:"",component:(()=>{class q{static#e=this.\u0275fac=function(ye){return new(ye||q)};static#t=this.\u0275cmp=N.VBU({type:q,selectors:[["page-home"]],standalone:!0,features:[N.aNF],decls:54,vars:0,consts:[[1,"container","pt-3"],[1,"row"],[1,"col-12"],[1,"mb-3"],[1,"row","align-items-stretch","mb-3"],[1,"col-4"],["routerLink","/structure",1,"card","bg-body-tertiary","cursor-pointer","shadow-sm","mb-3"],[1,"card-header","bg-primary"],[1,"bi","bi-boxes","me-3"],[1,"card-body"],["src","assets/structure-viewer.png","alt","Structure viewer",1,"w-100","h-auto"],[1,"card-text"],[1,"text-center","mt-auto"],[1,"badge","rounded-pill","bg-primary"],[1,"bi","bi-chevron-right"],["routerLink","/features",1,"card","bg-body-tertiary","cursor-pointer","shadow-sm","mb-3"],[1,"bi","bi-sliders","me-1"],["src","assets/features-viewer.png","alt","Features viewer",1,"w-100","h-auto"],["routerLink","/sequence",1,"card","bg-body-tertiary","cursor-pointer","shadow-sm","mb-3"],[1,"bi","bi-body-text","me-1"],["src","assets/sequence-viewer.png","alt","Sequence viewer",1,"w-100","h-auto"],[1,"card","mb-3"],[1,"bi","bi-recycle","me-1"]],template:function(ye,le){1&ye&&(N.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),N.EFF(4,"Products"),N.k0s()()(),N.j41(5,"div",4)(6,"div",5)(7,"div",6)(8,"h2",7),N.nrm(9,"i",8),N.EFF(10," ngx-structure-viewer"),N.k0s(),N.j41(11,"div",9),N.nrm(12,"img",10),N.j41(13,"p",11),N.EFF(14," Visualize and interact with 3D molecular structures. Provides Mol* functionalities out-of-the-box for Angular developers. "),N.k0s(),N.j41(15,"div",12)(16,"span",13),N.EFF(17," Try it out "),N.nrm(18,"i",14),N.k0s()()()()(),N.j41(19,"div",5)(20,"div",15)(21,"h2",7),N.nrm(22,"i",16),N.EFF(23," ngx-features-viewer "),N.k0s(),N.j41(24,"div",9),N.nrm(25,"img",17),N.j41(26,"p",11),N.EFF(27," The ultimate tool for Angular developers who want to visualize and interact biological sequences and their features. "),N.k0s(),N.j41(28,"div",12)(29,"span",13),N.EFF(30," Try it out "),N.nrm(31,"i",14),N.k0s()()()()(),N.j41(32,"div",5)(33,"div",18)(34,"h2",7),N.nrm(35,"i",19),N.EFF(36," ngx-sequence-viewer "),N.k0s(),N.j41(37,"div",9),N.nrm(38,"img",20),N.j41(39,"p",11),N.EFF(40," Angular native component for single sequences or multiple sequence alignments. Does not require any third party library. "),N.k0s(),N.j41(41,"div",12)(42,"span",13),N.EFF(43," Try it out "),N.nrm(44,"i",14),N.k0s()()()()()(),N.j41(45,"div",1)(46,"div",2)(47,"div",21)(48,"h2",7),N.nrm(49,"i",22),N.EFF(50," Enhanced interactivity "),N.k0s(),N.j41(51,"div",9)(52,"p",11),N.EFF(53," Our components are designed starting from the same, generic data structures. This allows to easily wire up multiple components in the same Angular component. Hence, it provides component interaction out-of-the-box. "),N.k0s()()()()()())},dependencies:[W.MD,I.iI,I.Wk],styles:[".cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}"]})}return q})()},{path:"**",redirectTo:""}])]};(0,E.B8)((()=>{class q{constructor(){this.title="ngx-bio-tools",this.sequence="MLPGLALLLLAAWTARALEVPTDGNAGLLAEPQIAMFCGRLNMHMNVQNGKWDSDPSGTKTCIDTKEGILQYCQEVYPELQITNVVEANQPVTIQNWCKRGRKQCKTHPHFVIPYRCLVGEFVSDALLVPDKCKFLHQERMDVCETHLHWHTVAKETCSEKSTNLHDYGMLLPCGIDKFRGVEFVCCPLAEESDNVDSADAEEDDSDVWWGGADTDYADGSEDKVVEVAEEEEVAEVEEEEADDDEDDEDGDEVEEEAEEPYEEATERTTSIATTTTTTTESVEEVVREVCSEQAETGPCRAMISRWYFDVTEGKCAPFFYGGCGGNRNNFDTEEYCMAVCGSAMSQSLLKTTQEPLARDPVKLPTTAASTPDAVDKYLETPGDENEHAHFQKAKERLEAKHRERMSQVMREWEEAERQAKNLPKADKKAVIQHFQEKVESLEQEAANERQQLVETHMARVEAMLNDRRRLALENYITALQAVPPRPRHVFNMLKKYVRAEQKDRQHTLKHFEHVRMVDPKKAAQIRSQVMTHLRVIYERMNQSLSLLYNVPAVAEEIQDEVDELLQKEQNYSDDVLANMISEPRISYGNDALMPSLTETKTTVELLPVNGEFSLDDLQPWHSFGADSVPANTENEVEPVDARPAADRGLTTRPGSGLTNIKTEEISEVKMDAEFRHDSGYEVHHQKLVFFAEDVGSNKGAIIGLMVGGVVIATVIVITLVMLKKKQYTSIHHGVVEVDAAVTPEERHLSKMQQNGYENPTYKFFEQMQN".split(""),this.features=[{id:0,type:"continuous",color:"blue",values:this.sequence.map(()=>Math.random()),parent:void 0,height:128},{id:1,type:"loci",color:"red",values:[{start:1,end:3},{start:5,end:6}],parent:void 0,height:96},{id:2,type:"pins",color:"green",values:[{start:5},{start:100,color:"blue"},{start:400,color:"red"}],parent:1},{id:3,type:"loci",color:"orange",values:[{start:10,end:20},{start:30,end:70}],parent:1},{id:4,type:"loci",color:"purple",values:[{start:100,end:300}],parent:void 0},{id:5,type:"dssp",color:"black",values:[{start:30,end:90,code:"H",color:"orange"},{start:120,end:300,code:"E",color:"purple"}],parent:void 0}]}static#e=this.\u0275fac=function(ye){return new(ye||q)};static#t=this.\u0275cmp=N.VBU({type:q,selectors:[["app-root"]],standalone:!0,features:[N.aNF],decls:19,vars:0,consts:[[1,"navbar"],[1,"container-fluid","justify-content-center"],["href","#",1,"navbar-brand","d-flex","flex-row","align-items-center","gap-3"],["src","assets/ngx-biocomp-up-white.png","alt","ngx-biocomp-up","height","48"],[1,"h2"],[1,"container-fluid","bg-dark","pt-2","pb-2"],[1,"row"],[1,"col-3","d-flex","justify-content-start"],["src","assets/biocomp-white.png","alt","BioComputing UP","height","36"],[1,"col-6","d-flex","align-items-center","justify-content-center"],["href","https://github.com/damiclem",1,"text-light","small"],[1,"bi","bi-github"],[1,"col-3","d-flex","justify-content-end"],["src","assets/unipd-white.png","alt","University of Padua","height","36"]],template:function(ye,le){1&ye&&(N.j41(0,"header")(1,"nav",0)(2,"div",1)(3,"a",2),N.nrm(4,"img",3),N.j41(5,"h1",4),N.EFF(6,"ngx-biocomp-up"),N.k0s()()()()(),N.j41(7,"main"),N.nrm(8,"router-outlet"),N.k0s(),N.j41(9,"footer",5)(10,"div",6)(11,"div",7),N.nrm(12,"img",8),N.k0s(),N.j41(13,"div",9)(14,"a",10),N.EFF(15," Developed by Damiano Clementel "),N.nrm(16,"i",11),N.k0s()(),N.j41(17,"div",12),N.nrm(18,"img",13),N.k0s()()())},dependencies:[W.MD,I.iI,I.n3],styles:["[_nghost-%COMP%]{height:inherit;display:inherit;flex-direction:inherit}"]})}return q})(),Q).catch(q=>console.error(q))},4412:(Te,oe,S)=>{S.d(oe,{t:()=>I});var E=S(1413);class I extends E.B{constructor(N){super(),this._value=N}get value(){return this.getValue()}_subscribe(N){const G=super._subscribe(N);return!G.closed&&N.next(this._value),G}getValue(){const{hasError:N,thrownError:G,_value:te}=this;if(N)throw G;return this._throwIfClosed(),te}next(N){super.next(this._value=N)}}},1985:(Te,oe,S)=>{S.d(oe,{c:()=>Y});var E=S(7707),I=S(8359),W=S(3494),N=S(1203),G=S(1026),te=S(8071),Q=S(9786);let Y=(()=>{class ie{constructor(le){le&&(this._subscribe=le)}lift(le){const Ee=new ie;return Ee.source=this,Ee.operator=le,Ee}subscribe(le,Ee,Je){const Be=function H(ie){return ie&&ie instanceof E.vU||function q(ie){return ie&&(0,te.T)(ie.next)&&(0,te.T)(ie.error)&&(0,te.T)(ie.complete)}(ie)&&(0,I.Uv)(ie)}(le)?le:new E.Ms(le,Ee,Je);return(0,Q.Y)(()=>{const{operator:we,source:Ue}=this;Be.add(we?we.call(Be,Ue):Ue?this._subscribe(Be):this._trySubscribe(Be))}),Be}_trySubscribe(le){try{return this._subscribe(le)}catch(Ee){le.error(Ee)}}forEach(le,Ee){return new(Ee=ne(Ee))((Je,Be)=>{const we=new E.Ms({next:Ue=>{try{le(Ue)}catch(ze){Be(ze),we.unsubscribe()}},error:Be,complete:Je});this.subscribe(we)})}_subscribe(le){var Ee;return null===(Ee=this.source)||void 0===Ee?void 0:Ee.subscribe(le)}[W.s](){return this}pipe(...le){return(0,N.m)(le)(this)}toPromise(le){return new(le=ne(le))((Ee,Je)=>{let Be;this.subscribe(we=>Be=we,we=>Je(we),()=>Ee(Be))})}}return ie.create=ye=>new ie(ye),ie})();function ne(ie){var ye;return null!==(ye=ie??G.$.Promise)&&void 0!==ye?ye:Promise}},1413:(Te,oe,S)=>{S.d(oe,{B:()=>Q});var E=S(1985),I=S(8359);const N=(0,S(1853).L)(ne=>function(){ne(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var G=S(7908),te=S(9786);let Q=(()=>{class ne extends E.c{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(H){const ie=new Y(this,this);return ie.operator=H,ie}_throwIfClosed(){if(this.closed)throw new N}next(H){(0,te.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const ie of this.currentObservers)ie.next(H)}})}error(H){(0,te.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=H;const{observers:ie}=this;for(;ie.length;)ie.shift().error(H)}})}complete(){(0,te.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:H}=this;for(;H.length;)H.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var H;return(null===(H=this.observers)||void 0===H?void 0:H.length)>0}_trySubscribe(H){return this._throwIfClosed(),super._trySubscribe(H)}_subscribe(H){return this._throwIfClosed(),this._checkFinalizedStatuses(H),this._innerSubscribe(H)}_innerSubscribe(H){const{hasError:ie,isStopped:ye,observers:le}=this;return ie||ye?I.Kn:(this.currentObservers=null,le.push(H),new I.yU(()=>{this.currentObservers=null,(0,G.o)(le,H)}))}_checkFinalizedStatuses(H){const{hasError:ie,thrownError:ye,isStopped:le}=this;ie?H.error(ye):le&&H.complete()}asObservable(){const H=new E.c;return H.source=this,H}}return ne.create=(q,H)=>new Y(q,H),ne})();class Y extends Q{constructor(q,H){super(),this.destination=q,this.source=H}next(q){var H,ie;null===(ie=null===(H=this.destination)||void 0===H?void 0:H.next)||void 0===ie||ie.call(H,q)}error(q){var H,ie;null===(ie=null===(H=this.destination)||void 0===H?void 0:H.error)||void 0===ie||ie.call(H,q)}complete(){var q,H;null===(H=null===(q=this.destination)||void 0===q?void 0:q.complete)||void 0===H||H.call(q)}_subscribe(q){var H,ie;return null!==(ie=null===(H=this.source)||void 0===H?void 0:H.subscribe(q))&&void 0!==ie?ie:I.Kn}}},7707:(Te,oe,S)=>{S.d(oe,{Ms:()=>Je,vU:()=>ie});var E=S(8071),I=S(8359),W=S(1026),N=S(5334),G=S(5343);const te=ne("C",void 0,void 0);function ne(ce,ae,Ce){return{kind:ce,value:ae,error:Ce}}var q=S(9270),H=S(9786);class ie extends I.yU{constructor(ae){super(),this.isStopped=!1,ae?(this.destination=ae,(0,I.Uv)(ae)&&ae.add(this)):this.destination=ze}static create(ae,Ce,Ae){return new Je(ae,Ce,Ae)}next(ae){this.isStopped?Ue(function Y(ce){return ne("N",ce,void 0)}(ae),this):this._next(ae)}error(ae){this.isStopped?Ue(function Q(ce){return ne("E",void 0,ce)}(ae),this):(this.isStopped=!0,this._error(ae))}complete(){this.isStopped?Ue(te,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(ae){this.destination.next(ae)}_error(ae){try{this.destination.error(ae)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const ye=Function.prototype.bind;function le(ce,ae){return ye.call(ce,ae)}class Ee{constructor(ae){this.partialObserver=ae}next(ae){const{partialObserver:Ce}=this;if(Ce.next)try{Ce.next(ae)}catch(Ae){Be(Ae)}}error(ae){const{partialObserver:Ce}=this;if(Ce.error)try{Ce.error(ae)}catch(Ae){Be(Ae)}else Be(ae)}complete(){const{partialObserver:ae}=this;if(ae.complete)try{ae.complete()}catch(Ce){Be(Ce)}}}class Je extends ie{constructor(ae,Ce,Ae){let fe;if(super(),(0,E.T)(ae)||!ae)fe={next:ae??void 0,error:Ce??void 0,complete:Ae??void 0};else{let ee;this&&W.$.useDeprecatedNextContext?(ee=Object.create(ae),ee.unsubscribe=()=>this.unsubscribe(),fe={next:ae.next&&le(ae.next,ee),error:ae.error&&le(ae.error,ee),complete:ae.complete&&le(ae.complete,ee)}):fe=ae}this.destination=new Ee(fe)}}function Be(ce){W.$.useDeprecatedSynchronousErrorHandling?(0,H.l)(ce):(0,N.m)(ce)}function Ue(ce,ae){const{onStoppedNotification:Ce}=W.$;Ce&&q.f.setTimeout(()=>Ce(ce,ae))}const ze={closed:!0,next:G.l,error:function we(ce){throw ce},complete:G.l}},8359:(Te,oe,S)=>{S.d(oe,{Kn:()=>te,yU:()=>G,Uv:()=>Q});var E=S(8071);const W=(0,S(1853).L)(ne=>function(H){ne(this),this.message=H?`${H.length} errors occurred during unsubscription:\n${H.map((ie,ye)=>`${ye+1}) ${ie.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=H});var N=S(7908);class G{constructor(q){this.initialTeardown=q,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let q;if(!this.closed){this.closed=!0;const{_parentage:H}=this;if(H)if(this._parentage=null,Array.isArray(H))for(const le of H)le.remove(this);else H.remove(this);const{initialTeardown:ie}=this;if((0,E.T)(ie))try{ie()}catch(le){q=le instanceof W?le.errors:[le]}const{_finalizers:ye}=this;if(ye){this._finalizers=null;for(const le of ye)try{Y(le)}catch(Ee){q=q??[],Ee instanceof W?q=[...q,...Ee.errors]:q.push(Ee)}}if(q)throw new W(q)}}add(q){var H;if(q&&q!==this)if(this.closed)Y(q);else{if(q instanceof G){if(q.closed||q._hasParent(this))return;q._addParent(this)}(this._finalizers=null!==(H=this._finalizers)&&void 0!==H?H:[]).push(q)}}_hasParent(q){const{_parentage:H}=this;return H===q||Array.isArray(H)&&H.includes(q)}_addParent(q){const{_parentage:H}=this;this._parentage=Array.isArray(H)?(H.push(q),H):H?[H,q]:q}_removeParent(q){const{_parentage:H}=this;H===q?this._parentage=null:Array.isArray(H)&&(0,N.o)(H,q)}remove(q){const{_finalizers:H}=this;H&&(0,N.o)(H,q),q instanceof G&&q._removeParent(this)}}G.EMPTY=(()=>{const ne=new G;return ne.closed=!0,ne})();const te=G.EMPTY;function Q(ne){return ne instanceof G||ne&&"closed"in ne&&(0,E.T)(ne.remove)&&(0,E.T)(ne.add)&&(0,E.T)(ne.unsubscribe)}function Y(ne){(0,E.T)(ne)?ne():ne.unsubscribe()}},1026:(Te,oe,S)=>{S.d(oe,{$:()=>E});const E={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},1983:(Te,oe,S)=>{S.d(oe,{z:()=>Ee,P:()=>Je});var E=S(1985);const{isArray:I}=Array,{getPrototypeOf:W,prototype:N,keys:G}=Object;var Y=S(6648),ne=S(3669),q=S(6450),H=S(9326),ye=S(4360),le=S(5225);function Ee(...we){const Ue=(0,H.lI)(we),ze=(0,H.ms)(we),{args:ce,keys:ae}=function te(we){if(1===we.length){const Ue=we[0];if(I(Ue))return{args:Ue,keys:null};if(function Q(we){return we&&"object"==typeof we&&W(we)===N}(Ue)){const ze=G(Ue);return{args:ze.map(ce=>Ue[ce]),keys:ze}}}return{args:we,keys:null}}(we);if(0===ce.length)return(0,Y.H)([],Ue);const Ce=new E.c(Je(ce,Ue,ae?Ae=>function ie(we,Ue){return we.reduce((ze,ce,ae)=>(ze[ce]=Ue[ae],ze),{})}(ae,Ae):ne.D));return ze?Ce.pipe((0,q.I)(ze)):Ce}function Je(we,Ue,ze=ne.D){return ce=>{Be(Ue,()=>{const{length:ae}=we,Ce=new Array(ae);let Ae=ae,fe=ae;for(let ee=0;ee{const ve=(0,Y.H)(we[ee],Ue);let Fe=!1;ve.subscribe((0,ye._)(ce,Ye=>{Ce[ee]=Ye,Fe||(Fe=!0,fe--),fe||ce.next(ze(Ce.slice()))},()=>{--Ae||ce.complete()}))},ce)},ce)}}function Be(we,Ue,ze){we?(0,le.N)(ze,we,Ue):Ue()}},8793:(Te,oe,S)=>{S.d(oe,{x:()=>G});var E=S(6365),W=S(9326),N=S(6648);function G(...te){return function I(){return(0,E.U)(1)}()((0,N.H)(te,(0,W.lI)(te)))}},983:(Te,oe,S)=>{S.d(oe,{w:()=>I});const I=new(S(1985).c)(G=>G.complete())},6648:(Te,oe,S)=>{S.d(oe,{H:()=>Ae});var E=S(8750),I=S(5225),W=S(9974),N=S(4360);function G(fe,ee=0){return(0,W.N)((ve,Fe)=>{ve.subscribe((0,N._)(Fe,Ye=>(0,I.N)(Fe,fe,()=>Fe.next(Ye),ee),()=>(0,I.N)(Fe,fe,()=>Fe.complete(),ee),Ye=>(0,I.N)(Fe,fe,()=>Fe.error(Ye),ee)))})}function te(fe,ee=0){return(0,W.N)((ve,Fe)=>{Fe.add(fe.schedule(()=>ve.subscribe(Fe),ee))})}var ne=S(1985),H=S(4761),ie=S(8071);function le(fe,ee){if(!fe)throw new Error("Iterable cannot be null");return new ne.c(ve=>{(0,I.N)(ve,ee,()=>{const Fe=fe[Symbol.asyncIterator]();(0,I.N)(ve,ee,()=>{Fe.next().then(Ye=>{Ye.done?ve.complete():ve.next(Ye.value)})},0,!0)})})}var Ee=S(5055),Je=S(9858),Be=S(7441),we=S(5397),Ue=S(7953),ze=S(591),ce=S(5196);function Ae(fe,ee){return ee?function Ce(fe,ee){if(null!=fe){if((0,Ee.l)(fe))return function Q(fe,ee){return(0,E.Tg)(fe).pipe(te(ee),G(ee))}(fe,ee);if((0,Be.X)(fe))return function q(fe,ee){return new ne.c(ve=>{let Fe=0;return ee.schedule(function(){Fe===fe.length?ve.complete():(ve.next(fe[Fe++]),ve.closed||this.schedule())})})}(fe,ee);if((0,Je.y)(fe))return function Y(fe,ee){return(0,E.Tg)(fe).pipe(te(ee),G(ee))}(fe,ee);if((0,Ue.T)(fe))return le(fe,ee);if((0,we.x)(fe))return function ye(fe,ee){return new ne.c(ve=>{let Fe;return(0,I.N)(ve,ee,()=>{Fe=fe[H.l](),(0,I.N)(ve,ee,()=>{let Ye,Zt;try{({value:Ye,done:Zt}=Fe.next())}catch(_t){return void ve.error(_t)}Zt?ve.complete():ve.next(Ye)},0,!0)}),()=>(0,ie.T)(Fe?.return)&&Fe.return()})}(fe,ee);if((0,ce.U)(fe))return function ae(fe,ee){return le((0,ce.C)(fe),ee)}(fe,ee)}throw(0,ze.L)(fe)}(fe,ee):(0,E.Tg)(fe)}},8750:(Te,oe,S)=>{S.d(oe,{Tg:()=>ye});var E=S(1635),I=S(7441),W=S(9858),N=S(1985),G=S(5055),te=S(7953),Q=S(591),Y=S(5397),ne=S(5196),q=S(8071),H=S(5334),ie=S(3494);function ye(ce){if(ce instanceof N.c)return ce;if(null!=ce){if((0,G.l)(ce))return function le(ce){return new N.c(ae=>{const Ce=ce[ie.s]();if((0,q.T)(Ce.subscribe))return Ce.subscribe(ae);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(ce);if((0,I.X)(ce))return function Ee(ce){return new N.c(ae=>{for(let Ce=0;Ce{ce.then(Ce=>{ae.closed||(ae.next(Ce),ae.complete())},Ce=>ae.error(Ce)).then(null,H.m)})}(ce);if((0,te.T)(ce))return we(ce);if((0,Y.x)(ce))return function Be(ce){return new N.c(ae=>{for(const Ce of ce)if(ae.next(Ce),ae.closed)return;ae.complete()})}(ce);if((0,ne.U)(ce))return function Ue(ce){return we((0,ne.C)(ce))}(ce)}throw(0,Q.L)(ce)}function we(ce){return new N.c(ae=>{(function ze(ce,ae){var Ce,Ae,fe,ee;return(0,E.sH)(this,void 0,void 0,function*(){try{for(Ce=(0,E.xN)(ce);!(Ae=yield Ce.next()).done;)if(ae.next(Ae.value),ae.closed)return}catch(ve){fe={error:ve}}finally{try{Ae&&!Ae.done&&(ee=Ce.return)&&(yield ee.call(Ce))}finally{if(fe)throw fe.error}}ae.complete()})})(ce,ae).catch(Ce=>ae.error(Ce))})}},4360:(Te,oe,S)=>{S.d(oe,{_:()=>I});var E=S(7707);function I(N,G,te,Q,Y){return new W(N,G,te,Q,Y)}class W extends E.vU{constructor(G,te,Q,Y,ne,q){super(G),this.onFinalize=ne,this.shouldUnsubscribe=q,this._next=te?function(H){try{te(H)}catch(ie){G.error(ie)}}:super._next,this._error=Y?function(H){try{Y(H)}catch(ie){G.error(ie)}finally{this.unsubscribe()}}:super._error,this._complete=Q?function(){try{Q()}catch(H){G.error(H)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var G;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:te}=this;super.unsubscribe(),!te&&(null===(G=this.onFinalize)||void 0===G||G.call(this))}}}},5964:(Te,oe,S)=>{S.d(oe,{p:()=>W});var E=S(9974),I=S(4360);function W(N,G){return(0,E.N)((te,Q)=>{let Y=0;te.subscribe((0,I._)(Q,ne=>N.call(G,ne,Y++)&&Q.next(ne)))})}},6354:(Te,oe,S)=>{S.d(oe,{T:()=>W});var E=S(9974),I=S(4360);function W(N,G){return(0,E.N)((te,Q)=>{let Y=0;te.subscribe((0,I._)(Q,ne=>{Q.next(N.call(G,ne,Y++))}))})}},6365:(Te,oe,S)=>{S.d(oe,{U:()=>W});var E=S(1397),I=S(3669);function W(N=1/0){return(0,E.Z)(I.D,N)}},1397:(Te,oe,S)=>{S.d(oe,{Z:()=>Y});var E=S(6354),I=S(8750),W=S(9974),N=S(5225),G=S(4360),Q=S(8071);function Y(ne,q,H=1/0){return(0,Q.T)(q)?Y((ie,ye)=>(0,E.T)((le,Ee)=>q(ie,le,ye,Ee))((0,I.Tg)(ne(ie,ye))),H):("number"==typeof q&&(H=q),(0,W.N)((ie,ye)=>function te(ne,q,H,ie,ye,le,Ee,Je){const Be=[];let we=0,Ue=0,ze=!1;const ce=()=>{ze&&!Be.length&&!we&&q.complete()},ae=Ae=>we{le&&q.next(Ae),we++;let fe=!1;(0,I.Tg)(H(Ae,Ue++)).subscribe((0,G._)(q,ee=>{ye?.(ee),le?ae(ee):q.next(ee)},()=>{fe=!0},void 0,()=>{if(fe)try{for(we--;Be.length&&weCe(ee)):Ce(ee)}ce()}catch(ee){q.error(ee)}}))};return ne.subscribe((0,G._)(q,ae,()=>{ze=!0,ce()})),()=>{Je?.()}}(ie,ye,ne,H)))}},9172:(Te,oe,S)=>{S.d(oe,{Z:()=>N});var E=S(8793),I=S(9326),W=S(9974);function N(...G){const te=(0,I.lI)(G);return(0,W.N)((Q,Y)=>{(te?(0,E.x)(G,Q,te):(0,E.x)(G,Q)).subscribe(Y)})}},5558:(Te,oe,S)=>{S.d(oe,{n:()=>N});var E=S(8750),I=S(9974),W=S(4360);function N(G,te){return(0,I.N)((Q,Y)=>{let ne=null,q=0,H=!1;const ie=()=>H&&!ne&&Y.complete();Q.subscribe((0,W._)(Y,ye=>{ne?.unsubscribe();let le=0;const Ee=q++;(0,E.Tg)(G(ye,Ee)).subscribe(ne=(0,W._)(Y,Je=>Y.next(te?te(ye,Je,Ee,le++):Je),()=>{ne=null,ie()}))},()=>{H=!0,ie()}))})}},6697:(Te,oe,S)=>{S.d(oe,{s:()=>N});var E=S(983),I=S(9974),W=S(4360);function N(G){return G<=0?()=>E.w:(0,I.N)((te,Q)=>{let Y=0;te.subscribe((0,W._)(Q,ne=>{++Y<=G&&(Q.next(ne),G<=Y&&Q.complete())}))})}},8141:(Te,oe,S)=>{S.d(oe,{M:()=>G});var E=S(8071),I=S(9974),W=S(4360),N=S(3669);function G(te,Q,Y){const ne=(0,E.T)(te)||Q||Y?{next:te,error:Q,complete:Y}:te;return ne?(0,I.N)((q,H)=>{var ie;null===(ie=ne.subscribe)||void 0===ie||ie.call(ne);let ye=!0;q.subscribe((0,W._)(H,le=>{var Ee;null===(Ee=ne.next)||void 0===Ee||Ee.call(ne,le),H.next(le)},()=>{var le;ye=!1,null===(le=ne.complete)||void 0===le||le.call(ne),H.complete()},le=>{var Ee;ye=!1,null===(Ee=ne.error)||void 0===Ee||Ee.call(ne,le),H.error(le)},()=>{var le,Ee;ye&&(null===(le=ne.unsubscribe)||void 0===le||le.call(ne)),null===(Ee=ne.finalize)||void 0===Ee||Ee.call(ne)}))}):N.D}},9270:(Te,oe,S)=>{S.d(oe,{f:()=>E});const E={setTimeout(I,W,...N){const{delegate:G}=E;return G?.setTimeout?G.setTimeout(I,W,...N):setTimeout(I,W,...N)},clearTimeout(I){const{delegate:W}=E;return(W?.clearTimeout||clearTimeout)(I)},delegate:void 0}},4761:(Te,oe,S)=>{S.d(oe,{l:()=>I});const I=function E(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},3494:(Te,oe,S)=>{S.d(oe,{s:()=>E});const E="function"==typeof Symbol&&Symbol.observable||"@@observable"},9326:(Te,oe,S)=>{S.d(oe,{R0:()=>te,lI:()=>G,ms:()=>N});var E=S(8071),I=S(9470);function W(Q){return Q[Q.length-1]}function N(Q){return(0,E.T)(W(Q))?Q.pop():void 0}function G(Q){return(0,I.m)(W(Q))?Q.pop():void 0}function te(Q,Y){return"number"==typeof W(Q)?Q.pop():Y}},7908:(Te,oe,S)=>{function E(I,W){if(I){const N=I.indexOf(W);0<=N&&I.splice(N,1)}}S.d(oe,{o:()=>E})},1853:(Te,oe,S)=>{function E(I){const N=I(G=>{Error.call(G),G.stack=(new Error).stack});return N.prototype=Object.create(Error.prototype),N.prototype.constructor=N,N}S.d(oe,{L:()=>E})},9786:(Te,oe,S)=>{S.d(oe,{Y:()=>W,l:()=>N});var E=S(1026);let I=null;function W(G){if(E.$.useDeprecatedSynchronousErrorHandling){const te=!I;if(te&&(I={errorThrown:!1,error:null}),G(),te){const{errorThrown:Q,error:Y}=I;if(I=null,Q)throw Y}}else G()}function N(G){E.$.useDeprecatedSynchronousErrorHandling&&I&&(I.errorThrown=!0,I.error=G)}},5225:(Te,oe,S)=>{function E(I,W,N,G=0,te=!1){const Q=W.schedule(function(){N(),te?I.add(this.schedule(null,G)):this.unsubscribe()},G);if(I.add(Q),!te)return Q}S.d(oe,{N:()=>E})},3669:(Te,oe,S)=>{function E(I){return I}S.d(oe,{D:()=>E})},7441:(Te,oe,S)=>{S.d(oe,{X:()=>E});const E=I=>I&&"number"==typeof I.length&&"function"!=typeof I},7953:(Te,oe,S)=>{S.d(oe,{T:()=>I});var E=S(8071);function I(W){return Symbol.asyncIterator&&(0,E.T)(W?.[Symbol.asyncIterator])}},8071:(Te,oe,S)=>{function E(I){return"function"==typeof I}S.d(oe,{T:()=>E})},5055:(Te,oe,S)=>{S.d(oe,{l:()=>W});var E=S(3494),I=S(8071);function W(N){return(0,I.T)(N[E.s])}},5397:(Te,oe,S)=>{S.d(oe,{x:()=>W});var E=S(4761),I=S(8071);function W(N){return(0,I.T)(N?.[E.l])}},9858:(Te,oe,S)=>{S.d(oe,{y:()=>I});var E=S(8071);function I(W){return(0,E.T)(W?.then)}},5196:(Te,oe,S)=>{S.d(oe,{C:()=>W,U:()=>N});var E=S(1635),I=S(8071);function W(G){return(0,E.AQ)(this,arguments,function*(){const Q=G.getReader();try{for(;;){const{value:Y,done:ne}=yield(0,E.N3)(Q.read());if(ne)return yield(0,E.N3)(void 0);yield yield(0,E.N3)(Y)}}finally{Q.releaseLock()}})}function N(G){return(0,I.T)(G?.getReader)}},9470:(Te,oe,S)=>{S.d(oe,{m:()=>I});var E=S(8071);function I(W){return W&&(0,E.T)(W.schedule)}},9974:(Te,oe,S)=>{S.d(oe,{N:()=>W,S:()=>I});var E=S(8071);function I(N){return(0,E.T)(N?.lift)}function W(N){return G=>{if(I(G))return G.lift(function(te){try{return N(te,this)}catch(Q){this.error(Q)}});throw new TypeError("Unable to lift unknown Observable type")}}},6450:(Te,oe,S)=>{S.d(oe,{I:()=>N});var E=S(6354);const{isArray:I}=Array;function N(G){return(0,E.T)(te=>function W(G,te){return I(te)?G(...te):G(te)}(G,te))}},5343:(Te,oe,S)=>{function E(){}S.d(oe,{l:()=>E})},1203:(Te,oe,S)=>{S.d(oe,{F:()=>I,m:()=>W});var E=S(3669);function I(...N){return W(N)}function W(N){return 0===N.length?E.D:1===N.length?N[0]:function(te){return N.reduce((Q,Y)=>Y(Q),te)}}},5334:(Te,oe,S)=>{S.d(oe,{m:()=>W});var E=S(1026),I=S(9270);function W(N){I.f.setTimeout(()=>{const{onUnhandledError:G}=E.$;if(!G)throw N;G(N)})}},591:(Te,oe,S)=>{function E(I){return new TypeError(`You provided ${null!==I&&"object"==typeof I?"an invalid object":`'${I}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}S.d(oe,{L:()=>E})},177:(Te,oe,S)=>{S.d(oe,{AJ:()=>Ao,Jj:()=>Ze,MD:()=>Nr,N0:()=>ro,QT:()=>W,Sm:()=>Je,T3:()=>tt,TG:()=>So,VF:()=>G,Vy:()=>No,Xr:()=>na,ZD:()=>N,_b:()=>Co,aZ:()=>we,fw:()=>Be,hb:()=>le,hj:()=>ne,lG:()=>gn,qQ:()=>Q});var E=S(4438);let I=null;function W(){return I}function N(d){I??=d}class G{}const Q=new E.nKC("");let Y=(()=>{class d{historyGo(p){throw new Error("")}static#e=this.\u0275fac=function(v){return new(v||d)};static#t=this.\u0275prov=E.jDH({token:d,factory:()=>(0,E.WQX)(q),providedIn:"platform"})}return d})();const ne=new E.nKC("");let q=(()=>{class d extends Y{constructor(){super(),this._doc=(0,E.WQX)(Q),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return W().getBaseHref(this._doc)}onPopState(p){const v=W().getGlobalEventTarget(this._doc,"window");return v.addEventListener("popstate",p,!1),()=>v.removeEventListener("popstate",p)}onHashChange(p){const v=W().getGlobalEventTarget(this._doc,"window");return v.addEventListener("hashchange",p,!1),()=>v.removeEventListener("hashchange",p)}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(p){this._location.pathname=p}pushState(p,v,_){this._history.pushState(p,v,_)}replaceState(p,v,_){this._history.replaceState(p,v,_)}forward(){this._history.forward()}back(){this._history.back()}historyGo(p=0){this._history.go(p)}getState(){return this._history.state}static#e=this.\u0275fac=function(v){return new(v||d)};static#t=this.\u0275prov=E.jDH({token:d,factory:()=>new d,providedIn:"platform"})}return d})();function H(d,D){if(0==d.length)return D;if(0==D.length)return d;let p=0;return d.endsWith("/")&&p++,D.startsWith("/")&&p++,2==p?d+D.substring(1):1==p?d+D:d+"/"+D}function ie(d){const D=d.match(/#|\?|$/),p=D&&D.index||d.length;return d.slice(0,p-("/"===d[p-1]?1:0))+d.slice(p)}function ye(d){return d&&"?"!==d[0]?"?"+d:d}let le=(()=>{class d{historyGo(p){throw new Error("")}static#e=this.\u0275fac=function(v){return new(v||d)};static#t=this.\u0275prov=E.jDH({token:d,factory:()=>(0,E.WQX)(Je),providedIn:"root"})}return d})();const Ee=new E.nKC("");let Je=(()=>{class d extends le{constructor(p,v){super(),this._platformLocation=p,this._removeListenerFns=[],this._baseHref=v??this._platformLocation.getBaseHrefFromDOM()??(0,E.WQX)(Q).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(p){this._removeListenerFns.push(this._platformLocation.onPopState(p),this._platformLocation.onHashChange(p))}getBaseHref(){return this._baseHref}prepareExternalUrl(p){return H(this._baseHref,p)}path(p=!1){const v=this._platformLocation.pathname+ye(this._platformLocation.search),_=this._platformLocation.hash;return _&&p?`${v}${_}`:v}pushState(p,v,_,k){const K=this.prepareExternalUrl(_+ye(k));this._platformLocation.pushState(p,v,K)}replaceState(p,v,_,k){const K=this.prepareExternalUrl(_+ye(k));this._platformLocation.replaceState(p,v,K)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(p=0){this._platformLocation.historyGo?.(p)}static#e=this.\u0275fac=function(v){return new(v||d)(E.KVO(Y),E.KVO(Ee,8))};static#t=this.\u0275prov=E.jDH({token:d,factory:d.\u0275fac,providedIn:"root"})}return d})(),Be=(()=>{class d extends le{constructor(p,v){super(),this._platformLocation=p,this._baseHref="",this._removeListenerFns=[],null!=v&&(this._baseHref=v)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(p){this._removeListenerFns.push(this._platformLocation.onPopState(p),this._platformLocation.onHashChange(p))}getBaseHref(){return this._baseHref}path(p=!1){const v=this._platformLocation.hash??"#";return v.length>0?v.substring(1):v}prepareExternalUrl(p){const v=H(this._baseHref,p);return v.length>0?"#"+v:v}pushState(p,v,_,k){let K=this.prepareExternalUrl(_+ye(k));0==K.length&&(K=this._platformLocation.pathname),this._platformLocation.pushState(p,v,K)}replaceState(p,v,_,k){let K=this.prepareExternalUrl(_+ye(k));0==K.length&&(K=this._platformLocation.pathname),this._platformLocation.replaceState(p,v,K)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(p=0){this._platformLocation.historyGo?.(p)}static#e=this.\u0275fac=function(v){return new(v||d)(E.KVO(Y),E.KVO(Ee,8))};static#t=this.\u0275prov=E.jDH({token:d,factory:d.\u0275fac})}return d})(),we=(()=>{class d{constructor(p){this._subject=new E.bkB,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=p;const v=this._locationStrategy.getBaseHref();this._basePath=function ae(d){if(new RegExp("^(https?:)?//").test(d)){const[,p]=d.split(/\/\/[^\/]+/);return p}return d}(ie(ce(v))),this._locationStrategy.onPopState(_=>{this._subject.emit({url:this.path(!0),pop:!0,state:_.state,type:_.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(p=!1){return this.normalize(this._locationStrategy.path(p))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(p,v=""){return this.path()==this.normalize(p+ye(v))}normalize(p){return d.stripTrailingSlash(function ze(d,D){if(!d||!D.startsWith(d))return D;const p=D.substring(d.length);return""===p||["/",";","?","#"].includes(p[0])?p:D}(this._basePath,ce(p)))}prepareExternalUrl(p){return p&&"/"!==p[0]&&(p="/"+p),this._locationStrategy.prepareExternalUrl(p)}go(p,v="",_=null){this._locationStrategy.pushState(_,"",p,v),this._notifyUrlChangeListeners(this.prepareExternalUrl(p+ye(v)),_)}replaceState(p,v="",_=null){this._locationStrategy.replaceState(_,"",p,v),this._notifyUrlChangeListeners(this.prepareExternalUrl(p+ye(v)),_)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(p=0){this._locationStrategy.historyGo?.(p)}onUrlChange(p){return this._urlChangeListeners.push(p),this._urlChangeSubscription??=this.subscribe(v=>{this._notifyUrlChangeListeners(v.url,v.state)}),()=>{const v=this._urlChangeListeners.indexOf(p);this._urlChangeListeners.splice(v,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(p="",v){this._urlChangeListeners.forEach(_=>_(p,v))}subscribe(p,v,_){return this._subject.subscribe({next:p,error:v,complete:_})}static#e=this.normalizeQueryParams=ye;static#t=this.joinWithSlash=H;static#n=this.stripTrailingSlash=ie;static#r=this.\u0275fac=function(v){return new(v||d)(E.KVO(le))};static#o=this.\u0275prov=E.jDH({token:d,factory:()=>function Ue(){return new we((0,E.KVO)(le))}(),providedIn:"root"})}return d})();function ce(d){return d.replace(/\/index.html$/,"")}function Co(d,D){D=encodeURIComponent(D);for(const p of d.split(";")){const v=p.indexOf("="),[_,k]=-1==v?[p,""]:[p.slice(0,v),p.slice(v+1)];if(_.trim()===D)return decodeURIComponent(k)}return null}let tt=(()=>{class d{constructor(p){this._viewContainerRef=p,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null,this.ngTemplateOutletInjector=null}ngOnChanges(p){if(this._shouldRecreateView(p)){const v=this._viewContainerRef;if(this._viewRef&&v.remove(v.indexOf(this._viewRef)),!this.ngTemplateOutlet)return void(this._viewRef=null);const _=this._createContextForwardProxy();this._viewRef=v.createEmbeddedView(this.ngTemplateOutlet,_,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(p){return!!p.ngTemplateOutlet||!!p.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(p,v,_)=>!!this.ngTemplateOutletContext&&Reflect.set(this.ngTemplateOutletContext,v,_),get:(p,v,_)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,v,_)}})}static#e=this.\u0275fac=function(v){return new(v||d)(E.rXU(E.c1b))};static#t=this.\u0275dir=E.FsC({type:d,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},standalone:!0,features:[E.OA$]})}return d})();class Js{createSubscription(D,p){return(0,E.O8t)(()=>D.subscribe({next:p,error:v=>{throw v}}))}dispose(D){(0,E.O8t)(()=>D.unsubscribe())}}class Ou{createSubscription(D,p){return D.then(p,v=>{throw v})}dispose(D){}}const ea=new Ou,Jo=new Js;let Ze=(()=>{class d{constructor(p){this._latestValue=null,this.markForCheckOnValueUpdate=!0,this._subscription=null,this._obj=null,this._strategy=null,this._ref=p}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(p){if(!this._obj){if(p)try{this.markForCheckOnValueUpdate=!1,this._subscribe(p)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return p!==this._obj?(this._dispose(),this.transform(p)):this._latestValue}_subscribe(p){this._obj=p,this._strategy=this._selectStrategy(p),this._subscription=this._strategy.createSubscription(p,v=>this._updateLatestValue(p,v))}_selectStrategy(p){if((0,E.jNT)(p))return ea;if((0,E.zjR)(p))return Jo;throw function In(d,D){return new E.wOt(2100,!1)}()}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(p,v){p===this._obj&&(this._latestValue=v,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}static#e=this.\u0275fac=function(v){return new(v||d)(E.rXU(E.gRc,16))};static#t=this.\u0275pipe=E.EJ8({name:"async",type:d,pure:!1,standalone:!0})}return d})(),So=(()=>{class d{transform(p){return JSON.stringify(p,null,2)}static#e=this.\u0275fac=function(v){return new(v||d)};static#t=this.\u0275pipe=E.EJ8({name:"json",type:d,pure:!1,standalone:!0})}return d})(),gn=(()=>{class d{constructor(p){this.differs=p,this.keyValues=[],this.compareFn=oi}transform(p,v=oi){if(!p||!(p instanceof Map)&&"object"!=typeof p)return null;this.differ??=this.differs.find(p).create();const _=this.differ.diff(p),k=v!==this.compareFn;return _&&(this.keyValues=[],_.forEachItem(K=>{this.keyValues.push(function pn(d,D){return{key:d,value:D}}(K.key,K.currentValue))})),(_||k)&&(this.keyValues.sort(v),this.compareFn=v),this.keyValues}static#e=this.\u0275fac=function(v){return new(v||d)(E.rXU(E.MKu,16))};static#t=this.\u0275pipe=E.EJ8({name:"keyvalue",type:d,pure:!1,standalone:!0})}return d})();function oi(d,D){const p=d.key,v=D.key;if(p===v)return 0;if(void 0===p)return 1;if(void 0===v)return-1;if(null===p)return 1;if(null===v)return-1;if("string"==typeof p&&"string"==typeof v)return p{class d{static#e=this.\u0275fac=function(v){return new(v||d)};static#t=this.\u0275mod=E.$C({type:d});static#n=this.\u0275inj=E.G2t({})}return d})();const Ao="browser",ii="server";function No(d){return d===ii}let na=(()=>{class d{static#e=this.\u0275prov=(0,E.jDH)({token:d,providedIn:"root",factory:()=>function Rr(d){return d===Ao}((0,E.WQX)(E.Agw))?new an((0,E.WQX)(Q),window):new ai})}return d})();class an{constructor(D,p){this.document=D,this.window=p,this.offset=()=>[0,0]}setOffset(D){this.offset=Array.isArray(D)?()=>D:D}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(D){this.window.scrollTo(D[0],D[1])}scrollToAnchor(D){const p=function fr(d,D){const p=d.getElementById(D)||d.getElementsByName(D)[0];if(p)return p;if("function"==typeof d.createTreeWalker&&d.body&&"function"==typeof d.body.attachShadow){const v=d.createTreeWalker(d.body,NodeFilter.SHOW_ELEMENT);let _=v.currentNode;for(;_;){const k=_.shadowRoot;if(k){const K=k.getElementById(D)||k.querySelector(`[name="${D}"]`);if(K)return K}_=v.nextNode()}}return null}(this.document,D);p&&(this.scrollToElement(p),p.focus())}setHistoryScrollRestoration(D){this.window.history.scrollRestoration=D}scrollToElement(D){const p=D.getBoundingClientRect(),v=p.left+this.window.pageXOffset,_=p.top+this.window.pageYOffset,k=this.offset();this.window.scrollTo(v-k[0],_-k[1])}}class ai{setOffset(D){}getScrollPosition(){return[0,0]}scrollToPosition(D){}scrollToAnchor(D){}setHistoryScrollRestoration(D){}}class ro{}},4438:(Te,oe,S)=>{S.d(oe,{iLQ:()=>rh,sZ2:()=>Sp,hnV:()=>BD,o8S:()=>qo,BIS:()=>nw,gRc:()=>eC,Ql9:()=>zT,Ocv:()=>XT,Z63:()=>er,aKT:()=>Fa,uvJ:()=>Mn,zcH:()=>po,bkB:()=>zr,$GK:()=>Ze,nKC:()=>Xe,zZn:()=>Qn,_q3:()=>dh,MKu:()=>fh,xe9:()=>ul,Co$:()=>Bm,Vns:()=>Si,SKi:()=>qt,Xx1:()=>Rr,Agw:()=>ql,PLl:()=>bp,sFG:()=>M0,_9s:()=>Zg,czy:()=>yc,kdw:()=>Ro,C4Q:()=>eu,NYb:()=>kT,giA:()=>UD,RxE:()=>OD,c1b:()=>kc,gXe:()=>pr,mal:()=>rm,L39:()=>WA,Ol2:()=>lf,w6W:()=>__,WQX:()=>Oe,QuC:()=>$t,EmA:()=>Lr,HJs:()=>JA,N4e:()=>Sn,O8t:()=>KA,H3F:()=>xD,H8p:()=>gi,KH2:()=>$s,TgB:()=>_s,wOt:()=>pe,WHO:()=>jD,e01:()=>VD,H5H:()=>jf,Zy3:()=>Vn,mq5:()=>Kv,JZv:()=>xe,TL3:()=>NA,LfX:()=>yo,plB:()=>Wo,jNT:()=>th,zjR:()=>HD,TL$:()=>ew,Tbb:()=>mt,Mj6:()=>gr,GFd:()=>Hm,OA$:()=>je,Jv_:()=>sD,aNF:()=>aD,R7$:()=>Dg,BMQ:()=>Ef,AVh:()=>Tf,vxM:()=>jv,wni:()=>Py,VBU:()=>da,FsC:()=>pa,jDH:()=>dt,G2t:()=>vo,$C:()=>Ki,EJ8:()=>Po,rXU:()=>Ds,nrm:()=>Pf,eu8:()=>kf,k0s:()=>Yc,j41:()=>Zc,RV6:()=>zv,xGo:()=>qh,KVO:()=>Nt,kS0:()=>nc,QTQ:()=>Eg,bIt:()=>Hf,lsd:()=>ky,XpG:()=>_y,nI1:()=>gD,bMT:()=>mD,Y8G:()=>Mf,eq3:()=>cD,mGM:()=>Ly,Dyx:()=>Hv,Z7z:()=>Uv,Vm6:()=>Vv,Njj:()=>Sh,tSv:()=>Jp,eBV:()=>Mh,n$t:()=>qp,xc7:()=>bf,DNE:()=>Ms,EFF:()=>Ky,JRh:()=>zf,SpI:()=>nl,GBs:()=>Fy}),S(467);let W=null,G=1;const te=Symbol("SIGNAL");function Q(e){const t=W;return W=e,t}function le(e){if((!Ae(e)||e.dirty)&&(e.dirty||e.lastCleanEpoch!==G)){if(!e.producerMustRecompute(e)&&!ze(e))return e.dirty=!1,void(e.lastCleanEpoch=G);e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=G}}function ze(e){fe(e);for(let t=0;t0}function fe(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}let or=null;var Yt=S(1413),ct=S(8359),Ie=S(4412),Bt=S(6354);const Ft="https://g.co/ng/security#xss";class pe extends Error{constructor(t,n){super(Vn(t,n)),this.code=t}}function Vn(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}function He(e){return{toString:e}.toString()}const Xn="__parameters__";function jt(e,t,n){return He(()=>{const r=function ar(e){return function(...n){if(e){const r=e(...n);for(const o in r)this[o]=r[o]}}}(t);function o(...i){if(this instanceof o)return r.apply(this,i),this;const s=new o(...i);return a.annotation=s,a;function a(l,g,y){const w=l.hasOwnProperty(Xn)?l[Xn]:Object.defineProperty(l,Xn,{value:[]})[Xn];for(;w.length<=y;)w.push(null);return(w[y]=w[y]||[]).push(s),l}}return n&&(o.prototype=Object.create(n.prototype)),o.prototype.ngMetadataName=e,o.annotationCls=o,o})}const xe=globalThis;function et(e){for(let t in e)if(e[t]===et)return t;throw Error("Could not find renamed property on target object.")}function mt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(mt).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 n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function ur(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Jr=et({__forward_ref__:et});function _r(e){return e.__forward_ref__=_r,e.toString=function(){return mt(this())},e}function O(e){return F(e)?e():e}function F(e){return"function"==typeof e&&e.hasOwnProperty(Jr)&&e.__forward_ref__===_r}function dt(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function vo(e){return{providers:e.providers||[],imports:e.imports||[]}}function to(e){return cr(e,Do)||cr(e,Eo)}function yo(e){return null!==to(e)}function cr(e,t){return e.hasOwnProperty(t)?e[t]:null}function br(e){return e&&(e.hasOwnProperty(Co)||e.hasOwnProperty(no))?e[Co]:null}const Do=et({\u0275prov:et}),Co=et({\u0275inj:et}),Eo=et({ngInjectableDef:et}),no=et({ngInjectorDef:et});class Xe{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=dt({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function We(e){return e&&!!e.\u0275providers}const Qt=et({\u0275cmp:et}),Tr=et({\u0275dir:et}),Cn=et({\u0275pipe:et}),ln=et({\u0275mod:et}),En=et({\u0275fac:et}),wn=et({__NG_ELEMENT_ID__:et}),dr=et({__NG_ENV_ID__:et});function Re(e){return"string"==typeof e?e:null==e?"":String(e)}function Jo(e,t){throw new pe(-201,!1)}var Ze=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}(Ze||{});let ei;function ki(){return ei}function sn(e){const t=ei;return ei=e,t}function ti(e,t,n){const r=to(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&Ze.Optional?null:void 0!==t?t:void Jo()}const Mo={},ni="__NG_DI_FLAG__",Jn="ngTempTokenPath",ri=/\n/gm,pn="__source";let gn;function Hn(e){const t=gn;return gn=e,t}function ta(e,t=Ze.Default){if(void 0===gn)throw new pe(-203,!1);return null===gn?ti(e,void 0,t):gn.get(e,t&Ze.Optional?null:void 0,t)}function Nt(e,t=Ze.Default){return(ki()||ta)(O(e),t)}function Oe(e,t=Ze.Default){return Nt(e,bo(t))}function bo(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function To(e){const t=[];for(let n=0;nArray.isArray(n)?fr(n,t):t(n))}function ai(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function ro(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function mn(e,t,n){let r=Bn(e,t);return r>=0?e[1|r]=n:(r=~r,function ra(e,t,n,r){let o=e.length;if(o==t)e.push(n,r);else if(1===o)e.push(r,e[0]),e[0]=n;else{for(o--,e.push(e[o-1],e[o]);o>t;)e[o]=e[o-2],o--;e[t]=n,e[t+1]=r}}(e,r,t,n)),r}function Bi(e,t){const n=Bn(e,t);if(n>=0)return e[1|n]}function Bn(e,t){return function Fu(e,t,n){let r=0,o=e.length>>n;for(;o!==r;){const i=r+(o-r>>1),s=e[i<t?o=i:r=i+1}return~(o<t){s=i-1;break}}}for(;i-1){let i;for(;++oi?"":o[y+1].toLowerCase(),2&r&&g!==w){if(_n(r))return!1;s=!0}}}}else{if(!s&&!_n(r)&&!_n(l))return!1;if(s&&_n(l))continue;s=!1,r=l|1&r}}return _n(r)||s}function _n(e){return!(1&e)}function ua(e,t,n,r){if(null===t)return-1;let o=0;if(r||!n){let i=!1;for(;o-1)for(n++;n0?'="'+a+'"':"")+"]"}else 8&r?o+="."+s:4&r&&(o+=" "+s);else""!==o&&!_n(s)&&(t+=Fr(i,o),o=""),r=s,i=i||!_n(r);n++}return""!==o&&(t+=Fr(i,o)),t}function da(e){return He(()=>{const t=ga(e),n={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===li.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||pr.Emulated,styles:e.styles||nt,_:null,schemas:e.schemas||null,tView:null,id:""};fi(n);const r=e.dependencies;return n.directiveDefs=oo(r,!1),n.pipeDefs=oo(r,!0),n.id=function Uu(e){let t=0;const n=[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 o of n)t=Math.imul(31,t)+o.charCodeAt(0)|0;return t+=2147483648,"c"+t}(n),n})}function Vu(e){return Ge(e)||Rt(e)}function fa(e){return null!==e}function Ki(e){return He(()=>({type:e.type,bootstrap:e.bootstrap||nt,declarations:e.declarations||nt,imports:e.imports||nt,exports:e.exports||nt,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function ha(e,t){if(null==e)return On;const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];let i,s,a=gr.None;Array.isArray(o)?(a=o[0],i=o[1],s=o[2]??i):(i=o,s=o),t?(n[i]=a!==gr.None?[r,a]:r,t[i]=s):n[i]=r}return n}function pa(e){return He(()=>{const t=ga(e);return fi(t),t})}function Po(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 Ge(e){return e[Qt]||null}function Rt(e){return e[Tr]||null}function Ot(e){return e[Cn]||null}function $t(e){const t=Ge(e)||Rt(e)||Ot(e);return null!==t&&t.standalone}function un(e,t){const n=e[ln]||null;if(!n&&!0===t)throw new Error(`Type ${mt(e)} does not have '\u0275mod' property.`);return n}function ga(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||On,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||nt,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:ha(e.inputs,t),outputs:ha(e.outputs),debugInfo:null}}function fi(e){e.features?.forEach(t=>t(e))}function oo(e,t){if(!e)return null;const n=t?Ot:Vu;return()=>("function"==typeof e?e():e).map(r=>n(r)).filter(fa)}function Lr(e){return{\u0275providers:e}}function qi(...e){return{\u0275providers:io(0,e),\u0275fromNgModule:!0}}function io(e,...t){const n=[],r=new Set;let o;const i=s=>{n.push(s)};return fr(t,s=>{const a=s;hi(a,i,[],r)&&(o||=[],o.push(a))}),void 0!==o&&Zi(o,i),n}function Zi(e,t){for(let n=0;n{t(i,r)})}}function hi(e,t,n,r){if(!(e=O(e)))return!1;let o=null,i=br(e);const s=!i&&Ge(e);if(i||s){if(s&&!s.standalone)return!1;o=e}else{const l=e.ngModule;if(i=br(l),!i)return!1;o=l}const a=r.has(o);if(s){if(a)return!1;if(r.add(o),s.dependencies){const l="function"==typeof s.dependencies?s.dependencies():s.dependencies;for(const g of l)hi(g,t,n,r)}}else{if(!i)return!1;{if(null!=i.imports&&!a){let g;r.add(o);try{fr(i.imports,y=>{hi(y,t,n,r)&&(g||=[],g.push(y))})}finally{}void 0!==g&&Zi(g,t)}if(!a){const g=Rn(o)||(()=>new o);t({provide:o,useFactory:g,deps:nt},o),t({provide:ci,useValue:o,multi:!0},o),t({provide:er,useValue:()=>Nt(o),multi:!0},o)}const l=i.providers;if(null!=l&&!a){const g=e;Yi(l,y=>{t(y,g)})}}}return o!==e&&void 0!==e.providers}function Yi(e,t){for(let n of e)We(n)&&(n=n.\u0275providers),Array.isArray(n)?Yi(n,t):t(n)}const pi=et({provide:String,useValue:et});function Xi(e){return null!==e&&"object"==typeof e&&pi in e}function mr(e){return"function"==typeof e}const gi=new Xe(""),mi={},Da={};let vi;function yi(){return void 0===vi&&(vi=new tr),vi}class Mn{}class so extends Mn{get destroyed(){return this._destroyed}constructor(t,n,r,o){super(),this.parent=n,this.source=r,this.scopes=o,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,ts(t,s=>this.processProvider(s)),this.records.set(xn,ao(void 0,this)),o.has("environment")&&this.records.set(Mn,ao(void 0,this));const i=this.records.get(gi);null!=i&&"string"==typeof i.value&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(ci,nt,Ze.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=Q(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const n=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),Q(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const n=Hn(this),r=sn(void 0);try{return t()}finally{Hn(n),sn(r)}}get(t,n=Mo,r=Ze.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(dr))return t[dr](this);r=bo(r);const i=Hn(this),s=sn(void 0);try{if(!(r&Ze.SkipSelf)){let l=this.records.get(t);if(void 0===l){const g=function wa(e){return"function"==typeof e||"object"==typeof e&&e instanceof Xe}(t)&&to(t);l=g&&this.injectableDefInScope(g)?ao(Ji(t),mi):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(r&Ze.Self?yi():this.parent).get(t,n=r&Ze.Optional&&n===Mo?null:n)}catch(a){if("NullInjectorError"===a.name){if((a[Jn]=a[Jn]||[]).unshift(mt(t)),i)throw a;return function ii(e,t,n,r){const o=e[Jn];throw t[pn]&&o.unshift(t[pn]),e.message=function Hi(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let o=mt(t);if(Array.isArray(t))o=t.map(mt).join(" -> ");else if("object"==typeof t){let i=[];for(let s in t)if(t.hasOwnProperty(s)){let a=t[s];i.push(s+":"+("string"==typeof a?JSON.stringify(a):mt(a)))}o=`{${i.join(", ")}}`}return`${n}${r?"("+r+")":""}[${o}]: ${e.replace(ri,"\n ")}`}("\n"+e.message,o,n,r),e.ngTokenPath=o,e[Jn]=null,e}(a,t,"R3InjectorError",this.source)}throw a}finally{sn(s),Hn(i)}}resolveInjectorInitializers(){const t=Q(null),n=Hn(this),r=sn(void 0);try{const i=this.get(er,nt,Ze.Self);for(const s of i)s()}finally{Hn(n),sn(r),Q(t)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(mt(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new pe(205,!1)}processProvider(t){let n=mr(t=O(t))?t:O(t&&t.provide);const r=function Ca(e){return Xi(e)?ao(void 0,e.useValue):ao(Ea(e),mi)}(t);if(!mr(t)&&!0===t.multi){let o=this.records.get(n);o||(o=ao(void 0,mi,!0),o.factory=()=>To(o.multi),this.records.set(n,o)),n=t,o.multi.push(t)}this.records.set(n,r)}hydrate(t,n){const r=Q(null);try{return n.value===mi&&(n.value=Da,n.value=n.factory()),"object"==typeof n.value&&n.value&&function es(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{Q(r)}}injectableDefInScope(t){if(!t.providedIn)return!1;const n=O(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(t){const n=this._onDestroyHooks.indexOf(t);-1!==n&&this._onDestroyHooks.splice(n,1)}}function Ji(e){const t=to(e),n=null!==t?t.factory:Rn(e);if(null!==n)return n;if(e instanceof Xe)throw new pe(204,!1);if(e instanceof Function)return function Hu(e){if(e.length>0)throw new pe(204,!1);const n=function Sr(e){return e&&(e[Do]||e[Eo])||null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new pe(204,!1)}function Ea(e,t,n){let r;if(mr(e)){const o=O(e);return Rn(o)||Ji(o)}if(Xi(e))r=()=>O(e.useValue);else if(function va(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...To(e.deps||[]));else if(function ma(e){return!(!e||!e.useExisting)}(e))r=()=>Nt(O(e.useExisting));else{const o=O(e&&(e.useClass||e.provide));if(!function Bu(e){return!!e.deps}(e))return Rn(o)||Ji(o);r=()=>new o(...To(e.deps))}return r}function ao(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function ts(e,t){for(const n of e)Array.isArray(n)?ts(n,t):n&&We(n)?ts(n.\u0275providers,t):t(n)}function Sn(e,t){e instanceof so&&e.assertNotDestroyed();const r=Hn(e),o=sn(void 0);try{return t()}finally{Hn(r),sn(o)}}function kr(){return void 0!==ki()||null!=function oi(){return gn}()}const ot=0,J=1,De=2,ft=3,zt=4,It=5,ht=6,nr=7,Ct=8,xt=9,zn=10,Le=11,Fo=12,yl=13,Di=14,Pt=15,co=16,lo=17,vr=18,Lo=19,Wn=20,jr=21,Ia=22,ko=23,Ve=25,ns=1,Pn=7,Vo=9,Vt=10;var os=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(os||{});function cn(e){return Array.isArray(e)&&"object"==typeof e[ns]}function dn(e){return Array.isArray(e)&&!0===e[ns]}function $u(e){return!!(4&e.flags)}function Uo(e){return e.componentOffset>-1}function is(e){return!(1&~e.flags)}function Gn(e){return!!e.template}function zu(e){return!!(512&e[De])}class P{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function he(e,t,n,r){null!==t?t.applyValueToInputSignal(t,r):e[n]=r}function je(){return Ke}function Ke(e){return e.type.prototype.ngOnChanges&&(e.setInput=Ci),Ut}function Ut(){const e=Bo(this),t=e?.current;if(t){const n=e.previous;if(n===On)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function Ci(e,t,n,r,o){const i=this.declaredInputs[r],s=Bo(e)||function Sa(e,t){return e[Ho]=t}(e,{previous:On,current:null}),a=s.current||(s.current={}),l=s.previous,g=l[i];a[i]=new P(g&&g.currentValue,n,l===On),he(e,t,o,n)}je.ngInherit=!0;const Ho="__ngSimpleChanges__";function Bo(e){return e[Ho]||null}const Vr=function(e,t,n){};let Ch=!1;function Et(e){for(;Array.isArray(e);)e=e[ot];return e}function ba(e,t){return Et(t[e])}function bn(e,t){return Et(t[e.index])}function Ta(e,t){return e.data[t]}function Kn(e,t){const n=t[e];return cn(n)?n:n[ot]}function Il(e){return!(128&~e[De])}function Ur(e,t){return null==t?null:e[t]}function Eh(e){e[lo]=0}function $C(e){1024&e[De]||(e[De]|=1024,Il(e)&&Aa(e))}function _l(e){return!!(9216&e[De]||e[ko]?.dirty)}function Ml(e){e[zn].changeDetectionScheduler?.notify(1),_l(e)?Aa(e):64&e[De]&&(function VC(){return Ch}()?(e[De]|=1024,Aa(e)):e[zn].changeDetectionScheduler?.notify())}function Aa(e){e[zn].changeDetectionScheduler?.notify();let t=Ei(e);for(;null!==t&&!(8192&t[De])&&(t[De]|=8192,Il(t));)t=Ei(t)}function Ku(e,t){if(!(256&~e[De]))throw new pe(911,!1);null===e[jr]&&(e[jr]=[]),e[jr].push(t)}function Ei(e){const t=e[ft];return dn(t)?t[ft]:t}const ke={lFrame:xh(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function _h(){return ke.bindingsEnabled}function z(){return ke.lFrame.lView}function rt(){return ke.lFrame.tView}function Mh(e){return ke.lFrame.contextLView=e,e[Ct]}function Sh(e){return ke.lFrame.contextLView=null,e}function yt(){let e=bh();for(;null!==e&&64===e.type;)e=e.parent;return e}function bh(){return ke.lFrame.currentTNode}function Hr(e,t){const n=ke.lFrame;n.currentTNode=e,n.isParent=t}function bl(){return ke.lFrame.isParent}function Tl(){ke.lFrame.isParent=!1}function Tn(){const e=ke.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Dr(){return ke.lFrame.bindingIndex++}function eE(e,t){const n=ke.lFrame;n.bindingIndex=n.bindingRootIndex=e,Al(t)}function Al(e){ke.lFrame.currentDirectiveIndex=e}function Rl(){return ke.lFrame.currentQueryIndex}function Qu(e){ke.lFrame.currentQueryIndex=e}function nE(e){const t=e[J];return 2===t.type?t.declTNode:1===t.type?e[It]:null}function Rh(e,t,n){if(n&Ze.SkipSelf){let o=t,i=e;for(;!(o=o.parent,null!==o||n&Ze.Host||(o=nE(i),null===o||(i=i[Di],10&o.type))););if(null===o)return!1;t=o,e=i}const r=ke.lFrame=Oh();return r.currentTNode=t,r.lView=e,!0}function Ol(e){const t=Oh(),n=e[J];ke.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function Oh(){const e=ke.lFrame,t=null===e?null:e.child;return null===t?xh(e):t}function xh(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 Ph(){const e=ke.lFrame;return ke.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const Fh=Ph;function xl(){const e=Ph();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 vn(){return ke.lFrame.selectedIndex}function wi(e){ke.lFrame.selectedIndex=e}function At(){const e=ke.lFrame;return Ta(e.tView,e.selectedIndex)}let kh=!0;function Ra(){return kh}function Br(e){kh=e}function qu(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[l]<0&&(e[lo]+=65536),(a>14>16&&(3&e[De])===t&&(e[De]+=16384,Vh(a,i)):Vh(a,i)}const us=-1;class Oa{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}function Ll(e){return e!==us}function xa(e){return 32767&e}function Pa(e,t){let n=function pE(e){return e>>16}(e),r=t;for(;n>0;)r=r[Di],n--;return r}let kl=!0;function Xu(e){const t=kl;return kl=e,t}const Uh=255,Hh=5;let gE=0;const $r={};function Ju(e,t){const n=Bh(e,t);if(-1!==n)return n;const r=t[J];r.firstCreatePass&&(e.injectorIndex=t.length,jl(r.data,e),jl(t,null),jl(r.blueprint,null));const o=ec(e,t),i=e.injectorIndex;if(Ll(o)){const s=xa(o),a=Pa(o,t),l=a[J].data;for(let g=0;g<8;g++)t[i+g]=a[s+g]|l[s+g]}return t[i+8]=o,i}function jl(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Bh(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function ec(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,o=t;for(;null!==o;){if(r=Zh(o),null===r)return us;if(n++,o=o[Di],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return us}function Vl(e,t,n){!function mE(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(wn)&&(r=n[wn]),null==r&&(r=n[wn]=gE++);const o=r&Uh;t.data[e+(o>>Hh)]|=1<=0?t&Uh:CE:t}(n);if("function"==typeof i){if(!Rh(t,e,r))return r&Ze.Host?$h(o,0,r):zh(t,n,r,o);try{let s;if(s=i(r),null!=s||r&Ze.Optional)return s;Jo()}finally{Fh()}}else if("number"==typeof i){let s=null,a=Bh(e,t),l=us,g=r&Ze.Host?t[Pt][It]:null;for((-1===a||r&Ze.SkipSelf)&&(l=-1===a?ec(e,t):t[a+8],l!==us&&Qh(r,!1)?(s=t[J],a=xa(l),t=Pa(l,t)):a=-1);-1!==a;){const y=t[J];if(Kh(i,a,y.data)){const w=yE(a,t,n,s,r,g);if(w!==$r)return w}l=t[a+8],l!==us&&Qh(r,t[J].data[a+8]===g)&&Kh(i,a,t)?(s=y,a=xa(l),t=Pa(l,t)):a=-1}}return o}function yE(e,t,n,r,o,i){const s=t[J],a=s.data[e+8],y=tc(a,s,n,null==r?Uo(a)&&kl:r!=s&&!!(3&a.type),o&Ze.Host&&i===a);return null!==y?Ii(t,s,y,a):$r}function tc(e,t,n,r,o){const i=e.providerIndexes,s=t.data,a=1048575&i,l=e.directiveStart,y=i>>20,T=o?a+y:e.directiveEnd;for(let A=r?a:a+y;A=l&&x.type===n)return A}if(o){const A=s[l];if(A&&Gn(A)&&A.type===n)return l}return null}function Ii(e,t,n,r){let o=e[n];const i=t.data;if(function lE(e){return e instanceof Oa}(o)){const s=o;s.resolving&&function Js(e,t){throw t&&t.join(" > "),new pe(-200,e)}(function tt(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():Re(e)}(i[n]));const a=Xu(s.canSeeViewProviders);s.resolving=!0;const g=s.injectImpl?sn(s.injectImpl):null;Rh(e,r,Ze.Default);try{o=e[n]=s.factory(void 0,i,e,r),t.firstCreatePass&&n>=r.directiveStart&&function uE(e,t,n){const{ngOnChanges:r,ngOnInit:o,ngDoCheck:i}=t.type.prototype;if(r){const s=Ke(t);(n.preOrderHooks??=[]).push(e,s),(n.preOrderCheckHooks??=[]).push(e,s)}o&&(n.preOrderHooks??=[]).push(0-e,o),i&&((n.preOrderHooks??=[]).push(e,i),(n.preOrderCheckHooks??=[]).push(e,i))}(n,i[n],t)}finally{null!==g&&sn(g),Xu(a),s.resolving=!1,Fh()}}return o}function Kh(e,t,n){return!!(n[t+(e>>Hh)]&1<{const t=e.prototype.constructor,n=t[En]||Ul(t),r=Object.prototype;let o=Object.getPrototypeOf(e.prototype).constructor;for(;o&&o!==r;){const i=o[En]||Ul(o);if(i&&i!==n)return i;o=Object.getPrototypeOf(o)}return i=>new i})}function Ul(e){return F(e)?()=>{const t=Ul(O(e));return t&&t()}:Rn(e)}function Zh(e){const t=e[J],n=t.type;return 2===n?t.declTNode:1===n?e[It]:null}function nc(e){return function vE(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let o=0;for(;o{class e{static#e=this.THROW_IF_NOT_FOUND=Mo;static#t=this.NULL=new tr;static create(n,r){if(Array.isArray(n))return tp({name:""},r,n,"");{const o=n.name??"";return tp({name:o},n.parent,n.providers,o)}}static#n=this.\u0275prov=dt({token:e,providedIn:"any",factory:()=>Nt(xn)});static#r=this.__NG_ELEMENT_ID__=-1}return e})();function Bl(e){return e.ngOriginalError}class po{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&Bl(t);for(;n&&Bl(n);)n=Bl(n);return n||null}}const op=new Xe("",{providedIn:"root",factory:()=>Oe(po).handleError.bind(void 0)});let ds=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=NE;static#t=this.__NG_ENV_ID__=n=>n}return e})();class AE extends ds{constructor(t){super(),this._lView=t}onDestroy(t){return Ku(this._lView,t),()=>function Sl(e,t){if(null===e[jr])return;const n=e[jr].indexOf(t);-1!==n&&e[jr].splice(n,1)}(this._lView,t)}}function NE(){return new AE(z())}function RE(){return fs(yt(),z())}function fs(e,t){return new Fa(bn(e,t))}let Fa=(()=>{class e{constructor(n){this.nativeElement=n}static#e=this.__NG_ELEMENT_ID__=RE}return e})();function sp(e){return e instanceof Fa?e.nativeElement:e}function $l(e){return t=>{setTimeout(e,void 0,t)}}const zr=class OE extends Yt.B{constructor(t=!1){super(),this.destroyRef=void 0,this.__isAsync=t,kr()&&(this.destroyRef=Oe(ds,{optional:!0})??void 0)}emit(t){const n=Q(null);try{super.next(t)}finally{Q(n)}}subscribe(t,n,r){let o=t,i=n||(()=>null),s=r;if(t&&"object"==typeof t){const l=t;o=l.next?.bind(l),i=l.error?.bind(l),s=l.complete?.bind(l)}this.__isAsync&&(i=$l(i),o&&(o=$l(o)),s&&(s=$l(s)));const a=super.subscribe({next:o,error:i,complete:s});return t instanceof ct.yU&&t.add(a),a}};function xE(){return this._results[Symbol.iterator]()}class zl{static#e=Symbol.iterator;get changes(){return this._changes??=new zr}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const n=zl.prototype;n[Symbol.iterator]||(n[Symbol.iterator]=xE)}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,n){return this._results.reduce(t,n)}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,n){this.dirty=!1;const r=function an(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function na(e,t,n){if(e.length!==t.length)return!1;for(let r=0;rtw}),tw="ng",bp=new Xe(""),ql=new Xe("",{providedIn:"platform",factory:()=>"unknown"}),nw=new Xe("",{providedIn:"root",factory:()=>function $o(){if(void 0!==Ql)return Ql;if(typeof document<"u")return document;throw new pe(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let Tp=()=>null;function rd(e,t,n=!1){return Tp(e,t,n)}const xp=new Xe("",{providedIn:"root",factory:()=>!1});let pc;function kp(e){return function ud(){if(void 0===pc&&(pc=null,xe.trustedTypes))try{pc=xe.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return pc}()?.createScriptURL(e)||e}class jp{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Ft})`}}function zo(e){return e instanceof jp?e.changingThisBreaksApplicationSecurity:e}function Ba(e,t){const n=function Ew(e){return e instanceof jp&&e.getTypeName()||null}(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${n} (see ${Ft})`)}return n===t}const Mw=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;var ms=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}(ms||{});function Kp(e){const t=za();return t?t.sanitize(ms.URL,e)||"":Ba(e,"URL")?zo(e):function cd(e){return(e=String(e)).match(Mw)?e:"unsafe:"+e}(Re(e))}function Qp(e){const t=za();if(t)return kp(t.sanitize(ms.RESOURCE_URL,e)||"");if(Ba(e,"ResourceURL"))return kp(zo(e));throw new pe(904,!1)}function qp(e,t,n){return function Uw(e,t){return"src"===t&&("embed"===e||"frame"===e||"iframe"===e||"media"===e||"script"===e)||"href"===t&&("base"===e||"link"===e)?Qp:Kp}(t,n)(e)}function za(){const e=z();return e&&e[zn].sanitizer}const Hw=/^>|^->||--!>|)/g,$w="\u200b$1\u200b";function Jp(e){return e.ownerDocument.defaultView}function qn(e){return e instanceof Function?e():e}var yc=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(yc||{});let md;function vd(e,t){return md(e,t)}function ys(e,t,n,r,o){if(null!=r){let i,s=!1;dn(r)?i=r:cn(r)&&(s=!0,r=r[ot]);const a=Et(r);0===e&&null!==n?null==o?ug(t,n,a):_i(t,n,a,o||null,!0):1===e&&null!==n?_i(t,n,a,o||null,!0):2===e?function Ka(e,t,n){const r=Ec(e,t);r&&function aI(e,t,n,r){e.removeChild(t,n,r)}(e,r,t,n)}(t,a,s):3===e&&t.destroyNode(a),null!=i&&function lI(e,t,n,r,o){const i=n[Pn];i!==Et(n)&&ys(t,e,r,i,o);for(let a=Vt;at.replace(Bw,$w))}(t))}function Dc(e,t,n){return e.createElement(t,n)}function ig(e,t){t[zn].changeDetectionScheduler?.notify(1),Ic(e,t,t[Le],2,null,null)}function sg(e,t){const n=e[Vo],r=n.indexOf(t);n.splice(r,1)}function Wa(e,t){if(e.length<=Vt)return;const n=Vt+t,r=e[n];if(r){const o=r[co];null!==o&&o!==e&&sg(o,r),t>0&&(e[n-1][zt]=r[zt]);const i=ro(e,Vt+t);!function eI(e,t){ig(e,t),t[ot]=null,t[It]=null}(r[J],r);const s=i[vr];null!==s&&s.detachView(i[J]),r[ft]=null,r[zt]=null,r[De]&=-129}return r}function Cc(e,t){if(!(256&t[De])){const n=t[Le];n.destroyNode&&Ic(e,t,n,3,null,null),function nI(e){let t=e[Fo];if(!t)return Cd(e[J],e);for(;t;){let n=null;if(cn(t))n=t[Fo];else{const r=t[Vt];r&&(n=r)}if(!n){for(;t&&!t[zt]&&t!==e;)cn(t)&&Cd(t[J],t),t=t[ft];null===t&&(t=e),cn(t)&&Cd(t[J],t),n=t&&t[zt]}t=n}}(t)}}function Cd(e,t){if(256&t[De])return;const n=Q(null);try{t[De]&=-129,t[De]|=256,t[ko]&&function ce(e){if(fe(e),Ae(e))for(let t=0;t=0?r[s]():r[-s].unsubscribe(),i+=2}else n[i].call(r[n[i+1]]);null!==r&&(t[nr]=null);const o=t[jr];if(null!==o){t[jr]=null;for(let i=0;i-1){const{encapsulation:i}=e.data[r.directiveStart+o];if(i===pr.None||i===pr.Emulated)return null}return bn(r,n)}}(e,t.parent,n)}function _i(e,t,n,r,o){e.insertBefore(t,n,r,o)}function ug(e,t,n){e.appendChild(t,n)}function cg(e,t,n,r,o){null!==r?_i(e,t,n,r,o):ug(e,t,n)}function Ec(e,t){return e.parentNode(t)}let wd,fg=function dg(e,t,n){return 40&e.type?bn(e,n):null};function wc(e,t,n,r){const o=Ed(e,r,t),i=t[Le],a=function lg(e,t,n){return fg(e,t,n)}(r.parent||t[It],r,t);if(null!=o)if(Array.isArray(n))for(let l=0;lVe&&Cg(e,t,Ve,!1),Vr(s?2:0,o),n(r,o)}finally{wi(i),Vr(s?3:1,o)}}function Sd(e,t,n){if($u(t)){const r=Q(null);try{const i=t.directiveEnd;for(let s=t.directiveStart;snull;function Sg(e,t,n,r,o){for(let i in t){if(!t.hasOwnProperty(i))continue;const s=t[i];if(void 0===s)continue;r??={};let a,l=gr.None;Array.isArray(s)?(a=s[0],l=s[1]):a=s;let g=i;if(null!==o){if(!o.hasOwnProperty(i))continue;g=o[i]}0===e?bg(r,n,g,a,l):bg(r,n,g,a)}return r}function bg(e,t,n,r,o){let i;e.hasOwnProperty(n)?(i=e[n]).push(t,r):i=e[n]=[t,r],void 0!==o&&i.push(o)}function Nd(e,t,n,r){if(_h()){const o=null===r?null:{"":-1},i=function AI(e,t){const n=e.directiveRegistry;let r=null,o=null;if(n)for(let i=0;i0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(s)!=a&&s.push(a),s.push(n,r,i)}}(e,t,r,Qa(e,n,o.hostVars,$e),o)}function Wr(e,t,n,r,o,i){const s=bn(e,t);!function Od(e,t,n,r,o,i,s){if(null==i)e.removeAttribute(t,o,n);else{const a=null==s?Re(i):s(i,r||"",o);e.setAttribute(t,o,a,n)}}(t[Le],s,i,e.value,n,r,o)}function FI(e,t,n,r,o,i){const s=i[t];if(null!==s)for(let a=0;a0&&(n[o-1][zt]=t),r!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{},consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{Aa(e.lView)},consumerOnSignalRead(){this.lView[ko]=this}},jg=100;function bc(e,t=!0,n=0){const r=e[zn],o=r.rendererFactory;o.begin?.();try{!function zI(e,t){kd(e,t);let n=0;for(;_l(e);){if(n===jg)throw new pe(103,!1);n++,kd(e,1)}}(e,n)}catch(s){throw t&&Sc(e,s),s}finally{o.end?.(),r.inlineEffectRunner?.flush()}}function WI(e,t,n,r){const o=t[De];if(!(256&~o))return;t[zn].inlineEffectRunner?.flush(),Ol(t);let s=null,a=null;(function GI(e){return 2!==e.type})(e)&&(a=function UI(e){return e[ko]??function HI(e){const t=kg.pop()??Object.create($I);return t.lView=e,t}(e)}(t),s=function we(e){return e&&(e.nextProducerIndex=0),Q(e)}(a));try{Eh(t),function Ah(e){return ke.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==n&&Ig(e,t,n,2,r);const l=!(3&~o);if(l){const w=e.preOrderCheckHooks;null!==w&&Zu(t,w,null)}else{const w=e.preOrderHooks;null!==w&&Yu(t,w,0,null),Pl(t,0)}if(function KI(e){for(let t=mp(e);null!==t;t=vp(t)){if(!(t[De]&os.HasTransplantedViews))continue;const n=t[Vo];for(let r=0;re.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}(a,s),function BI(e){e.lView[ko]!==e&&(e.lView=null,kg.push(e))}(a)),xl()}}function Vg(e,t){for(let n=mp(e);null!==n;n=vp(n))for(let r=Vt;r-1&&(Wa(t,r),ro(n,r))}this._attachedToViewContainer=!1}Cc(this._lView[J],this._lView)}onDestroy(t){Ku(this._lView,t)}markForCheck(){Xa(this._cdRefInjectingView||this._lView)}detach(){this._lView[De]&=-129}reattach(){Ml(this._lView),this._lView[De]|=128}detectChanges(){this._lView[De]|=1024,bc(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new pe(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,ig(this._lView[J],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new pe(902,!1);this._appRef=t,Ml(this._lView)}}let eu=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=YI}return e})();const qI=eu,ZI=class extends qI{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,n){return this.createEmbeddedViewImpl(t,n)}createEmbeddedViewImpl(t,n,r){const o=qa(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:n,dehydratedView:r});return new Ja(o)}};function YI(){return Tc(yt(),z())}function Tc(e,t){return 4&e.type?new ZI(t,e,fs(e,t)):null}let Kg=()=>null;function ws(e,t){return Kg(e,t)}class $d{}class w0{}class Qg{}class _0{resolveComponentFactory(t){throw function I0(e){const t=Error(`No component factory found for ${mt(e)}.`);return t.ngComponent=e,t}(t)}}let xc=(()=>{class e{static#e=this.NULL=new _0}return e})();class Zg{}let M0=(()=>{class e{constructor(){this.destroyNode=null}static#e=this.__NG_ELEMENT_ID__=()=>function S0(){const e=z(),n=Kn(yt().index,e);return(cn(n)?n:e)[Le]}()}return e})(),b0=(()=>{class e{static#e=this.\u0275prov=dt({token:e,providedIn:"root",factory:()=>null})}return e})();const zd={},Yg=new Set;function Gr(e){Yg.has(e)||(Yg.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}function Xg(...e){}class qt{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new zr(!1),this.onMicrotaskEmpty=new zr(!1),this.onStable=new zr(!1),this.onError=new zr(!1),typeof Zone>"u")throw new pe(908,!1);Zone.assertZonePatched();const o=this;o._nesting=0,o._outer=o._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(o._inner=o._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(o._inner=o._inner.fork(Zone.longStackTraceZoneSpec)),o.shouldCoalesceEventChangeDetection=!r&&n,o.shouldCoalesceRunChangeDetection=r,o.lastRequestAnimationFrameId=-1,o.nativeRequestAnimationFrame=function T0(){const e="function"==typeof xe.requestAnimationFrame;let t=xe[e?"requestAnimationFrame":"setTimeout"],n=xe[e?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&t&&n){const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r);const o=n[Zone.__symbol__("OriginalDelegate")];o&&(n=o)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:n}}().nativeRequestAnimationFrame,function R0(e){const t=()=>{!function N0(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(xe,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Gd(e),e.isCheckStableRunning=!0,Wd(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Gd(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,o,i,s,a)=>{if(function O0(e){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0].data?.__ignore_ng_zone__}(a))return n.invokeTask(o,i,s,a);try{return Jg(e),n.invokeTask(o,i,s,a)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===i.type||e.shouldCoalesceRunChangeDetection)&&t(),em(e)}},onInvoke:(n,r,o,i,s,a,l)=>{try{return Jg(e),n.invoke(o,i,s,a,l)}finally{e.shouldCoalesceRunChangeDetection&&t(),em(e)}},onHasTask:(n,r,o,i)=>{n.hasTask(o,i),r===o&&("microTask"==i.change?(e._hasPendingMicrotasks=i.microTask,Gd(e),Wd(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(n,r,o,i)=>(n.handleError(o,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}(o)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!qt.isInAngularZone())throw new pe(909,!1)}static assertNotInAngularZone(){if(qt.isInAngularZone())throw new pe(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,o){const i=this._inner,s=i.scheduleEventTask("NgZoneEvent: "+o,t,A0,Xg,Xg);try{return i.runTask(s,n,r)}finally{i.cancelTask(s)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const A0={};function Wd(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 Gd(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function Jg(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function em(e){e._nesting--,Wd(e)}var Mi=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(Mi||{});const nm={destroy(){}};function rm(e,t){!t&&function uo(e){if(!kr())throw new pe(-203,!1)}();const n=t?.injector??Oe(Qn);if(!function Cr(e){return"browser"===(e??Oe(Qn)).get(ql)}(n))return nm;Gr("NgAfterNextRender");const r=n.get(iu),o=r.handler??=new im,i=t?.phase??Mi.MixedReadWrite,s=()=>{o.unregister(l),a()},a=n.get(ds).onDestroy(s),l=Sn(n,()=>new om(i,()=>{s(),e()}));return o.register(l),{destroy:s}}class om{constructor(t,n){this.phase=t,this.callbackFn=n,this.zone=Oe(qt),this.errorHandler=Oe(po,{optional:!0}),Oe($d,{optional:!0})?.notify(1)}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(t){this.errorHandler?.handleError(t)}}}class im{constructor(){this.executingCallbacks=!1,this.buckets={[Mi.EarlyRead]:new Set,[Mi.Write]:new Set,[Mi.MixedReadWrite]:new Set,[Mi.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(){this.executingCallbacks=!0;for(const t of Object.values(this.buckets))for(const n of t)n.invoke();this.executingCallbacks=!1;for(const t of this.deferredCallbacks)this.buckets[t.phase].add(t);this.deferredCallbacks.clear()}destroy(){for(const t of Object.values(this.buckets))t.clear();this.deferredCallbacks.clear()}}let iu=(()=>{class e{constructor(){this.handler=null,this.internalCallbacks=[]}execute(){this.executeInternalCallbacks(),this.handler?.execute()}executeInternalCallbacks(){const n=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const r of n)r()}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}static#e=this.\u0275prov=dt({token:e,providedIn:"root",factory:()=>new e})}return e})();function Wo(e){return!!un(e)}function Fc(e,t,n){let r=n?e.styles:null,o=n?e.classes:null,i=0;if(null!==t)for(let s=0;s0&&vg(e,n,i.join(" "))}}(A,on,B,r),void 0!==n&&function z0(e,t,n){const r=e.projection=[];for(let o=0;o{class e{static#e=this.__NG_ELEMENT_ID__=G0}return e})();function G0(){return fm(yt(),z())}const K0=kc,lm=class extends K0{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return fs(this._hostTNode,this._hostLView)}get injector(){return new tn(this._hostTNode,this._hostLView)}get parentInjector(){const t=ec(this._hostTNode,this._hostLView);if(Ll(t)){const n=Pa(t,this._hostLView),r=xa(t);return new tn(n[J].data[r+8],n)}return new tn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=dm(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-Vt}createEmbeddedView(t,n,r){let o,i;"number"==typeof r?o=r:null!=r&&(o=r.index,i=r.injector);const s=ws(this._lContainer,t.ssrId),a=t.createEmbeddedViewImpl(n||{},i,s);return this.insertImpl(a,o,Es(this._hostTNode,s)),a}createComponent(t,n,r,o,i){const s=t&&!function K(e){return"function"==typeof e}(t);let a;if(s)a=n;else{const x=n||{};a=x.index,r=x.injector,o=x.projectableNodes,i=x.environmentInjector||x.ngModuleRef}const l=s?t:new uu(Ge(t)),g=r||this.parentInjector;if(!i&&null==l.ngModule){const B=(s?g:this.parentInjector).get(Mn,null);B&&(i=B)}const y=Ge(l.componentType??{}),w=ws(this._lContainer,y?.id??null),A=l.create(g,o,w?.firstChild??null,i);return this.insertImpl(A.hostView,a,Es(this._hostTNode,w)),A}insert(t,n){return this.insertImpl(t,n,!0)}insertImpl(t,n,r){const o=t._lView;if(function BC(e){return dn(e[ft])}(o)){const a=this.indexOf(t);if(-1!==a)this.detach(a);else{const l=o[ft],g=new lm(l,l[It],l[ft]);g.detach(g.indexOf(t))}}const i=this._adjustIndex(n),s=this._lContainer;return Za(s,o,i,r),t.attachToViewContainerRef(),ai(Zd(s),i,t),t}move(t,n){return this.insert(t,n)}indexOf(t){const n=dm(this._lContainer);return null!==n?n.indexOf(t):-1}remove(t){const n=this._adjustIndex(t,-1),r=Wa(this._lContainer,n);r&&(ro(Zd(this._lContainer),n),Cc(r[J],r))}detach(t){const n=this._adjustIndex(t,-1),r=Wa(this._lContainer,n);return r&&null!=ro(Zd(this._lContainer),n)?new Ja(r):null}_adjustIndex(t,n=0){return t??this.length+n}};function dm(e){return e[8]}function Zd(e){return e[8]||(e[8]=[])}function fm(e,t){let n;const r=t[e.index];return dn(r)?n=r:(n=Ng(r,t,null,e),t[e.index]=n,Mc(t,n)),hm(n,t,e,r),new lm(n,e,t)}let hm=function gm(e,t,n,r){if(e[Pn])return;let o;o=8&n.type?Et(r):function Q0(e,t){const n=e[Le],r=n.createComment(""),o=bn(t,e);return _i(n,Ec(n,o),r,function uI(e,t){return e.nextSibling(t)}(n,o),!1),r}(t,n),e[Pn]=o},Yd=()=>!1;class Xd{constructor(t){this.queryList=t,this.matches=null}clone(){return new Xd(this.queryList)}setDirty(){this.queryList.setDirty()}}class Jd{constructor(t=[]){this.queries=t}createEmbeddedView(t){const n=t.queries;if(null!==n){const r=null!==t.contentQueries?t.contentQueries[0]:n.length,o=[];for(let i=0;it.trim())}(t):t}}class ef{constructor(t=[]){this.queries=t}elementStart(t,n){for(let r=0;r0)r.push(s[a/2]);else{const g=i[a+1],y=t[-l];for(let w=Vt;wn()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class cf extends Bm{constructor(t){super(),this.moduleType=t}create(t){return new uf(this.moduleType,t,[])}}class $m extends Si{constructor(t){super(),this.componentFactoryResolver=new um(this),this.instance=null;const n=new so([...t.providers,{provide:Si,useValue:this},{provide:xc,useValue:this.componentFactoryResolver}],t.parent||yi(),t.debugName,new Set(["environment"]));this.injector=n,t.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function lf(e,t,n=null){return new $m({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}let _s=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Ie.t(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const n=this.taskId++;return this.pendingTasks.add(n),n}remove(n){this.pendingTasks.delete(n),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(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Hc(e){return!!df(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function df(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function Wt(e,t,n){return!Object.is(e[t],n)&&(e[t]=n,!0)}function Ms(e,t,n,r,o,i,s,a){const l=z(),g=rt(),y=e+Ve,w=g.firstCreatePass?function R_(e,t,n,r,o,i,s,a,l){const g=t.consts,y=Cs(t,e,4,s||null,Ur(g,a));Nd(t,n,y,Ur(g,l)),qu(t,y);const w=y.tView=Ad(2,y,r,o,i,t.directiveRegistry,t.pipeRegistry,null,t.schemas,g,null);return null!==t.queries&&(t.queries.template(t,y),w.queries=t.queries.embeddedTView(y)),y}(y,g,l,t,n,r,o,i,s):g.data[y];Hr(w,!1);const T=zm(g,l,w,e);Ra()&&wc(g,l,T,w),yn(T,l);const A=Ng(T,l,T,w);return l[y]=A,Mc(l,A),function pm(e,t,n){return Yd(e,t,n)}(A,w,l),is(w)&&bd(g,l,w),null!=s&&Td(l,w,a),Ms}let zm=function Wm(e,t,n,r){return Br(!0),t[Le].createComment("")};function Ef(e,t,n,r){const o=z();return Wt(o,Dr(),t)&&(rt(),Wr(At(),o,e,t,n,r)),Ef}function Qc(e,t){return e<<17|t<<2}function Qo(e){return e>>17&32767}function wf(e){return 2|e}function Ai(e){return(131068&e)>>2}function If(e,t){return-131069&e|t<<2}function _f(e){return 1|e}function wv(e,t,n,r){const o=e[n+1],i=null===t;let s=r?Qo(o):Ai(o),a=!1;for(;0!==s&&(!1===a||i);){const g=e[s+1];vM(e[s],t)&&(a=!0,e[s+1]=r?_f(g):wf(g)),s=r?Qo(g):Ai(g)}a&&(e[n+1]=r?wf(o):_f(o))}function vM(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Bn(e,t)>=0}function Mf(e,t,n){const r=z();return Wt(r,Dr(),t)&&function Ln(e,t,n,r,o,i,s,a){const l=bn(t,n);let y,g=t.inputs;!a&&null!=g&&(y=g[r])?(Pd(e,n,y,r,o),Uo(t)&&function II(e,t){const n=Kn(t,e);16&n[De]||(n[De]|=64)}(n,t.index)):3&t.type&&(r=function wI(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(r),o=null!=s?s(o,t.value||"",r):o,i.setProperty(l,r,o))}(rt(),At(),r,e,t,r[Le],n,!1),Mf}function Sf(e,t,n,r,o){const s=o?"class":"style";Pd(e,n,t.inputs[s],s,r)}function bf(e,t,n){return Er(e,t,n,!1),bf}function Tf(e,t){return Er(e,t,null,!0),Tf}function Er(e,t,n,r){const o=z(),i=rt(),s=function ho(e){const t=ke.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}(2);i.firstUpdatePass&&function Nv(e,t,n,r){const o=e.data;if(null===o[n+1]){const i=o[vn()],s=function Av(e,t){return t>=e.expandoStartIndex}(e,n);(function Pv(e,t){return!!(e.flags&(t?8:16))})(i,r)&&null===t&&!s&&(t=!1),t=function SM(e,t,n,r){const o=function Nl(e){const t=ke.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}(e);let i=r?t.residualClasses:t.residualStyles;if(null===o)0===(r?t.classBindings:t.styleBindings)&&(n=gu(n=Af(null,e,t,n,r),t.attrs,r),i=null);else{const s=t.directiveStylingLast;if(-1===s||e[s]!==o)if(n=Af(o,e,t,n,r),null===i){let l=function bM(e,t,n){const r=n?t.classBindings:t.styleBindings;if(0!==Ai(r))return e[Qo(r)]}(e,t,r);void 0!==l&&Array.isArray(l)&&(l=Af(null,e,t,l[1],r),l=gu(l,t.attrs,r),function TM(e,t,n,r){e[Qo(n?t.classBindings:t.styleBindings)]=r}(e,t,r,l))}else i=function AM(e,t,n){let r;const o=t.directiveEnd;for(let i=1+t.directiveStylingLast;i0)&&(g=!0)):y=n,o)if(0!==l){const T=Qo(e[a+1]);e[r+1]=Qc(T,a),0!==T&&(e[T+1]=If(e[T+1],r)),e[a+1]=function hM(e,t){return 131071&e|t<<17}(e[a+1],r)}else e[r+1]=Qc(a,0),0!==a&&(e[a+1]=If(e[a+1],r)),a=r;else e[r+1]=Qc(l,0),0===a?a=r:e[l+1]=If(e[l+1],r),l=r;g&&(e[r+1]=wf(e[r+1])),wv(e,y,r,!0),wv(e,y,r,!1),function mM(e,t,n,r,o){const i=o?e.residualClasses:e.residualStyles;null!=i&&"string"==typeof t&&Bn(i,t)>=0&&(n[r+1]=_f(n[r+1]))}(t,y,e,r,i),s=Qc(a,l),i?t.classBindings=s:t.styleBindings=s}(o,i,t,n,s,r)}}(i,e,s,r),t!==$e&&Wt(o,s,t)&&function Ov(e,t,n,r,o,i,s,a){if(!(3&t.type))return;const l=e.data,g=l[a+1],y=function pM(e){return!(1&~e)}(g)?xv(l,t,n,o,Ai(g),s):void 0;qc(y)||(qc(i)||function fM(e){return!(2&~e)}(g)&&(i=xv(l,null,n,o,a,s)),function dI(e,t,n,r,o){if(t)o?e.addClass(n,r):e.removeClass(n,r);else{let i=-1===r.indexOf("-")?void 0:yc.DashCase;null==o?e.removeStyle(n,r,i):("string"==typeof o&&o.endsWith("!important")&&(o=o.slice(0,-10),i|=yc.Important),e.setStyle(n,r,o,i))}}(r,s,ba(vn(),n),o,i))}(i,i.data[vn()],o,o[Le],e,o[s+1]=function xM(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=mt(zo(e)))),e}(t,n),r,s)}function Af(e,t,n,r,o){let i=null;const s=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const l=e[o],g=Array.isArray(l),y=g?l[1]:l,w=null===y;let T=n[o+1];T===$e&&(T=w?nt:void 0);let A=w?Bi(T,r):y===r?T:void 0;if(g&&!qc(A)&&(A=Bi(l,r)),qc(A)&&(a=A,s))return a;const x=e[o+1];o=s?Qo(x):Ai(x)}if(null!==t){let l=i?t.residualClasses:t.residualStyles;null!=l&&(a=Bi(l,r))}return a}function qc(e){return void 0!==e}class zM{destroy(t){}updateValue(t,n){}swap(t,n){const r=Math.min(t,n),o=Math.max(t,n),i=this.detach(o);if(o-r>1){const s=this.detach(r);this.attach(r,i),this.attach(o,s)}else this.attach(r,i)}move(t,n){this.attach(n,this.detach(t))}}function Nf(e,t,n,r,o){return e===n&&Object.is(t,r)?1:Object.is(o(e,t),o(n,r))?-1:0}function Rf(e,t,n,r){return!(void 0===t||!t.has(r)||(e.attach(n,t.get(r)),t.delete(r),0))}function Fv(e,t,n,r,o){if(Rf(e,t,r,n(r,o)))e.updateValue(r,o);else{const i=e.create(r,o);e.attach(r,i)}}function Lv(e,t,n,r){const o=new Set;for(let i=t;i<=n;i++)o.add(r(i,e.at(i)));return o}class kv{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 n=this.kvMap.get(t);return void 0!==this._vMap&&this._vMap.has(n)?(this.kvMap.set(t,this._vMap.get(n)),this._vMap.delete(n)):this.kvMap.delete(t),!0}get(t){return this.kvMap.get(t)}set(t,n){if(this.kvMap.has(t)){let r=this.kvMap.get(t);void 0===this._vMap&&(this._vMap=new Map);const o=this._vMap;for(;o.has(r);)r=o.get(r);o.set(r,n)}else this.kvMap.set(t,n)}forEach(t){for(let[n,r]of this.kvMap)if(t(r,n),void 0!==this._vMap){const o=this._vMap;for(;o.has(r);)r=o.get(r),t(r,n)}}}function jv(e,t,n){Gr("NgControlFlow");const r=z(),o=Dr(),i=Of(r,Ve+e);if(Wt(r,o,t)){const a=Q(null);try{if(Ld(i,0),-1!==t){const l=xf(r[J],Ve+t),g=ws(i,l.tView.ssrId);Za(i,qa(r,l,n,{dehydratedView:g}),0,Es(l,g))}}finally{Q(a)}}else{const a=Fg(i,0);void 0!==a&&(a[Ct]=n)}}class GM{constructor(t,n,r){this.lContainer=t,this.$implicit=n,this.$index=r}get $count(){return this.lContainer.length-Vt}}function Vv(e){return e}class QM{constructor(t,n,r){this.hasEmptyBlock=t,this.trackByFn=n,this.liveCollection=r}}function Uv(e,t,n,r,o,i,s,a,l,g,y,w,T){Gr("NgControlFlow");const A=void 0!==l,x=z(),B=a?s.bind(x[Pt][Ct]):s,se=new QM(A,B);x[Ve+e]=se,Ms(e+1,t,n,r,o,i),A&&Ms(e+2,l,g,y,w,T)}class qM extends zM{constructor(t,n,r){super(),this.lContainer=t,this.hostLView=n,this.templateTNode=r,this.needsIndexUpdate=!1}get length(){return this.lContainer.length-Vt}at(t){return this.getLView(t)[Ct].$implicit}attach(t,n){const r=n[ht];this.needsIndexUpdate||=t!==this.length,Za(this.lContainer,n,t,Es(this.templateTNode,r))}detach(t){return this.needsIndexUpdate||=t!==this.length-1,function ZM(e,t){return Wa(e,t)}(this.lContainer,t)}create(t,n){const r=ws(this.lContainer,this.templateTNode.tView.ssrId);return qa(this.hostLView,this.templateTNode,new GM(this.lContainer,n,t),{dehydratedView:r})}destroy(t){Cc(t[J],t)}updateValue(t,n){this.getLView(t)[Ct].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let t=0;t{e.destroy(a)})}(s,e,i.trackByFn),s.updateIndexes(),i.hasEmptyBlock){const a=Dr(),l=0===s.length;if(Wt(r,a,l)){const g=n+2,y=Of(r,g);if(l){const w=xf(o,g),T=ws(y,w.tView.ssrId);Za(y,qa(r,w,void 0,{dehydratedView:T}),0,Es(w,T))}else Ld(y,0)}}}finally{Q(t)}}function Of(e,t){return e[t]}function xf(e,t){return Ta(e,t)}function Zc(e,t,n,r){const o=z(),i=rt(),s=Ve+e,a=o[Le],l=i.firstCreatePass?function XM(e,t,n,r,o,i){const s=t.consts,l=Cs(t,e,2,r,Ur(s,o));return Nd(t,n,l,Ur(s,i)),null!==l.attrs&&Fc(l,l.attrs,!1),null!==l.mergedAttrs&&Fc(l,l.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,l),l}(s,i,o,t,n,r):i.data[s],g=Bv(i,o,l,a,t,e);o[s]=g;const y=is(l);return Hr(l,!0),yg(a,g,l),!function du(e){return!(32&~e.flags)}(l)&&Ra()&&wc(i,o,g,l),0===function zC(){return ke.lFrame.elementDepthCount}()&&yn(g,o),function WC(){ke.lFrame.elementDepthCount++}(),y&&(bd(i,o,l),Sd(i,l,o)),null!==r&&Td(o,l),Zc}function Yc(){let e=yt();bl()?Tl():(e=e.parent,Hr(e,!1));const t=e;(function KC(e){return ke.skipHydrationRootTNode===e})(t)&&function YC(){ke.skipHydrationRootTNode=null}(),function GC(){ke.lFrame.elementDepthCount--}();const n=rt();return n.firstCreatePass&&(qu(n,e),$u(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function fE(e){return!!(8&e.flags)}(t)&&Sf(n,t,z(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function hE(e){return!!(16&e.flags)}(t)&&Sf(n,t,z(),t.stylesWithoutHost,!1),Yc}function Pf(e,t,n,r){return Zc(e,t,n,r),Yc(),Pf}let Bv=(e,t,n,r,o,i)=>(Br(!0),Dc(r,o,function Lh(){return ke.lFrame.currentNamespace}()));function Ff(e,t,n){const r=z(),o=rt(),i=e+Ve,s=o.firstCreatePass?function tS(e,t,n,r,o){const i=t.consts,s=Ur(i,r),a=Cs(t,e,8,"ng-container",s);return null!==s&&Fc(a,s,!0),Nd(t,n,a,Ur(i,o)),null!==t.queries&&t.queries.elementStart(t,a),a}(i,o,r,t,n):o.data[i];Hr(s,!0);const a=$v(o,r,s,e);return r[i]=a,Ra()&&wc(o,r,a,s),yn(a,r),is(s)&&(bd(o,r,s),Sd(o,s,r)),null!=n&&Td(r,s),Ff}function Lf(){let e=yt();const t=rt();return bl()?Tl():(e=e.parent,Hr(e,!1)),t.firstCreatePass&&(qu(t,e),$u(e)&&t.queries.elementEnd(e)),Lf}function kf(e,t,n){return Ff(e,t,n),Lf(),kf}let $v=(e,t,n,r)=>(Br(!0),Dd(t[Le],""));function zv(){return z()}const Ni=void 0;var iS=["en",[["a","p"],["AM","PM"],Ni],[["AM","PM"],Ni,Ni],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Ni,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Ni,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Ni,"{1} 'at' {0}",Ni],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function oS(e){const n=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===r?1:5}];let Bs={};function jf(e){const t=function sS(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=Qv(t);if(n)return n;const r=t.split("-")[0];if(n=Qv(r),n)return n;if("en"===r)return iS;throw new pe(701,!1)}function Kv(e){return jf(e)[$s.PluralCase]}function Qv(e){return e in Bs||(Bs[e]=xe.ng&&xe.ng.common&&xe.ng.common.locales&&xe.ng.common.locales[e]),Bs[e]}var $s=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}($s||{});const zs="en-US";let qv=zs;function Hf(e,t,n,r){const o=z(),i=rt(),s=yt();return function Bf(e,t,n,r,o,i,s){const a=is(r),g=e.firstCreatePass&&xg(e),y=t[Ct],w=Og(t);let T=!0;if(3&r.type||s){const B=bn(r,t),se=s?s(B):B,de=w.length,Z=s?ut=>s(Et(ut[r.index])):r.index;let Pe=null;if(!s&&a&&(Pe=function nb(e,t,n,r){const o=e.cleanup;if(null!=o)for(let i=0;il?a[l]:null}"string"==typeof s&&(i+=2)}return null}(e,t,o,r.index)),null!==Pe)(Pe.__ngLastListenerFn__||Pe).__ngNextListenerFn__=i,Pe.__ngLastListenerFn__=i,T=!1;else{i=Iy(r,t,y,i,!1);const ut=n.listen(se,o,i);w.push(i,ut),g&&g.push(o,Z,de,de+1)}}else i=Iy(r,t,y,i,!1);const A=r.outputs;let x;if(T&&null!==A&&(x=A[o])){const B=x.length;if(B)for(let se=0;se-1?Kn(e.index,t):t);let l=wy(t,n,r,s),g=i.__ngNextListenerFn__;for(;g;)l=wy(t,n,g,s)&&l,g=g.__ngNextListenerFn__;return o&&!1===l&&s.preventDefault(),l}}function _y(e=1){return function rE(e){return(ke.lFrame.contextLView=function wh(e,t){for(;e>0;)t=t[Di],e--;return t}(e,ke.lFrame.contextLView))[Ct]}(e)}function Py(e,t,n,r){!function Cm(e,t,n,r){const o=rt();if(o.firstCreatePass){const i=yt();Em(o,new mm(t,n,r),i.index),function r_(e,t){const n=e.contentQueries||(e.contentQueries=[]);t!==(n.length?n[n.length-1]:-1)&&n.push(e.queries.length-1,t)}(o,e),!(2&~n)&&(o.staticContentQueries=!0)}return ym(o,z(),n)}(e,t,n,r)}function Fy(e,t,n){!function Dm(e,t,n){const r=rt();return r.firstCreatePass&&(Em(r,new mm(e,t,n),-1),!(2&~t)&&(r.staticViewQueries=!0)),ym(r,z(),t)}(e,t,n)}function Ly(e){const t=z(),n=rt(),r=Rl();Qu(r+1);const o=sf(n,r);if(e.dirty&&function HC(e){return!(4&~e[De])}(t)===!(2&~o.metadata.flags)){if(null===o.matches)e.reset([]);else{const i=wm(t,r);e.reset(i,sp),e.notifyOnChanges()}return!0}return!1}function ky(){return function rf(e,t){return e[vr].queries[t].queryList}(z(),Rl())}function Ky(e,t=""){const n=z(),r=rt(),o=e+Ve,i=r.firstCreatePass?Cs(r,o,1,t,null):r.data[o],s=Qy(r,n,i,t,e);n[o]=s,Ra()&&wc(r,n,s,i),Hr(i,!1)}let Qy=(e,t,n,r,o)=>(Br(!0),function yd(e,t){return e.createText(t)}(t[Le],r));function zf(e){return nl("",e,""),zf}function nl(e,t,n){const r=z(),o=function xs(e,t,n,r){return Wt(e,Dr(),n)?t+Re(n)+r:$e}(r,e,t,n);return o!==$e&&function mo(e,t,n){const r=ba(t,e);!function og(e,t,n){e.setValue(t,n)}(e[Le],r,n)}(r,vn(),o),nl}function Wf(e,t,n,r,o){if(e=O(e),Array.isArray(e))for(let i=0;i>20;if(mr(e)||!e.multi){const A=new Oa(g,o,Ds),x=Kf(l,t,o?y:y+T,w);-1===x?(Vl(Ju(a,s),i,l),Gf(i,e,t.length),t.push(l),a.directiveStart++,a.directiveEnd++,o&&(a.providerIndexes+=1048576),n.push(A),s.push(A)):(n[x]=A,s[x]=A)}else{const A=Kf(l,t,y+T,w),x=Kf(l,t,y,y+T),se=x>=0&&n[x];if(o&&!se||!o&&!(A>=0&&n[A])){Vl(Ju(a,s),i,l);const de=function Sb(e,t,n,r,o){const i=new Oa(e,n,Ds);return i.multi=[],i.index=t,i.componentProviders=0,iD(i,o,r&&!n),i}(o?Mb:_b,n.length,o,r,g);!o&&se&&(n[x].providerFactory=de),Gf(i,e,t.length,0),t.push(l),a.directiveStart++,a.directiveEnd++,o&&(a.providerIndexes+=1048576),n.push(de),s.push(de)}else Gf(i,e,A>-1?A:x,iD(n[o?x:A],g,!o&&r));!o&&r&&se&&n[x].componentProviders++}}}function Gf(e,t,n,r){const o=mr(t),i=function ya(e){return!!e.useClass}(t);if(o||i){const l=(i?O(t.useClass):t).prototype.ngOnDestroy;if(l){const g=e.destroyHooks||(e.destroyHooks=[]);if(!o&&t.multi){const y=g.indexOf(n);-1===y?g.push(n,[r,l]):g[y+1].push(r,l)}else g.push(n,l)}}}function iD(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Kf(e,t,n,r){for(let o=n;o{n.providersResolver=(r,o)=>function Ib(e,t,n){const r=rt();if(r.firstCreatePass){const o=Gn(e);Wf(n,r.data,r.blueprint,o,!0),Wf(t,r.data,r.blueprint,o,!1)}}(r,o?o(e):e,t)}}let bb=(()=>{class e{constructor(n){this._injector=n,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){const r=io(0,n.type),o=r.length>0?lf([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n,o)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(const n of this.cachedInjectors.values())null!==n&&n.destroy()}finally{this.cachedInjectors.clear()}}static#e=this.\u0275prov=dt({token:e,providedIn:"environment",factory:()=>new e(Nt(Mn))})}return e})();function aD(e){Gr("NgStandalone"),e.getStandaloneInjector=t=>t.get(bb).getOrCreateStandaloneInjector(e)}function cD(e,t,n,r){return lD(z(),Tn(),e,t,n,r)}function lD(e,t,n,r,o,i){const s=t+n;return Wt(e,s,o)?function Kr(e,t,n){return e[t]=n}(e,s+1,i?r.call(i,o):r(o)):function wu(e,t){const n=e[t];return n===$e?void 0:n}(e,s+1)}function gD(e,t){const n=rt();let r;const o=e+Ve;n.firstCreatePass?(r=function Vb(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}}(t,n.pipeRegistry),n.data[o]=r,r.onDestroy&&(n.destroyHooks??=[]).push(o,r.onDestroy)):r=n.data[o];const i=r.factory||(r.factory=Rn(r.type)),a=sn(Ds);try{const l=Xu(!1),g=i();return Xu(l),function cb(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,z(),o,g),g}finally{sn(a)}}function mD(e,t,n){const r=e+Ve,o=z(),i=function ss(e,t){return e[t]}(o,r);return function Iu(e,t){return e[J].data[t].pure}(o,r)?lD(o,Tn(),t,i.transform,n,i):i.transform(n)}class OD{constructor(t){this.full=t;const n=t.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}}let xD=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const jD=new Xe(""),VD=new Xe("");let eh,kT=(()=>{class e{constructor(n,r,o){this._ngZone=n,this.registry=r,this._pendingCount=0,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,eh||(function jT(e){eh=e}(o),o.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{qt.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb()}});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1))}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,o){let i=-1;r&&r>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(s=>s.timeoutId!==i),n()},r)),this._callbacks.push({doneCb:n,timeoutId:i,updateCb:o})}whenStable(n,r,o){if(o&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,o),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,o){return[]}static#e=this.\u0275fac=function(r){return new(r||e)(Nt(qt),Nt(UD),Nt(VD))};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac})}return e})(),UD=(()=>{class e{constructor(){this._applications=new Map}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return eh?.findTestabilityInTree(this,n,r)??null}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();function th(e){return!!e&&"function"==typeof e.then}function HD(e){return!!e&&"function"==typeof e.subscribe}const BD=new Xe("");let nh=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((n,r)=>{this.resolve=n,this.reject=r}),this.appInits=Oe(BD,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const n=[];for(const o of this.appInits){const i=o();if(th(i))n.push(i);else if(HD(i)){const s=new Promise((a,l)=>{i.subscribe({complete:a,error:l})});n.push(s)}}const r=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{r()}).catch(o=>{this.reject(o)}),0===n.length&&r(),this.initialized=!0}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const rh=new Xe("");let qo=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=Oe(op),this.afterRenderEffectManager=Oe(iu),this.externalTestViews=new Set,this.beforeRender=new Yt.B,this.afterTick=new Yt.B,this.componentTypes=[],this.components=[],this.isStable=Oe(_s).hasPendingTasks.pipe((0,Bt.T)(n=>!n)),this._injector=Oe(Mn)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(n,r){const o=n instanceof Qg;if(!this._injector.get(nh).done)throw!o&&$t(n),new pe(405,!1);let s;s=o?n:this._injector.get(xc).resolveComponentFactory(n),this.componentTypes.push(s.componentType);const a=function VT(e){return e.isBoundToModule}(s)?void 0:this._injector.get(Si),g=s.create(Qn.NULL,[],r||s.selector,a),y=g.location.nativeElement,w=g.injector.get(jD,null);return w?.registerApplication(y),g.onDestroy(()=>{this.detachView(g.hostView),sl(this.components,g),w?.unregisterApplication(y)}),this._loadComponent(g),g}tick(){this._tick(!0)}_tick(n){if(this._runningTick)throw new pe(101,!1);const r=Q(null);try{this._runningTick=!0,this.detectChangesInAttachedViews(n)}catch(o){this.internalErrorHandler(o)}finally{this.afterTick.next(),this._runningTick=!1,Q(r)}}detectChangesInAttachedViews(n){let r=0;const o=this.afterRenderEffectManager;for(;;){if(r===jg)throw new pe(103,!1);if(n){const i=0===r;this.beforeRender.next(i);for(let{_lView:s,notifyErrorHandler:a}of this._views)HT(s,i,a)}if(r++,o.executeInternalCallbacks(),![...this.externalTestViews.keys(),...this._views].some(({_lView:i})=>oh(i))&&(o.execute(),![...this.externalTestViews.keys(),...this._views].some(({_lView:i})=>oh(i))))break}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;sl(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n);const r=this._injector.get(rh,[]);[...this._bootstrapListeners,...r].forEach(o=>o(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>sl(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new pe(406,!1);const n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function sl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}function HT(e,t,n){!t&&!oh(e)||function BT(e,t,n){let r;n?(r=0,e[De]|=1024):r=64&e[De]?0:1,bc(e,t,r)}(e,n,t)}function oh(e){return _l(e)}class $T{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}let zT=(()=>{class e{compileModuleSync(n){return new cf(n)}compileModuleAsync(n){return Promise.resolve(this.compileModuleSync(n))}compileModuleAndAllComponentsSync(n){const r=this.compileModuleSync(n),i=qn(un(n).declarations).reduce((s,a)=>{const l=Ge(a);return l&&s.push(new uu(l)),s},[]);return new $T(r,i)}compileModuleAndAllComponentsAsync(n){return Promise.resolve(this.compileModuleAndAllComponentsSync(n))}clearCache(){}clearCacheFor(n){}getModuleId(n){}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),KT=(()=>{class e{constructor(){this.zone=Oe(qt),this.applicationRef=Oe(qo)}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(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function KD(e){return[{provide:qt,useFactory:e},{provide:er,multi:!0,useFactory:()=>{const t=Oe(KT,{optional:!0});return()=>t.initialize()}},{provide:er,multi:!0,useFactory:()=>{const t=Oe(ZT);return()=>{t.initialize()}}},{provide:op,useFactory:QT}]}function QT(){const e=Oe(qt),t=Oe(po);return n=>e.runOutsideAngular(()=>t.handleError(n))}function qT(e){return Lr([[],KD(()=>new qt(function QD(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}(e)))])}let ZT=(()=>{class e{constructor(){this.subscription=new ct.yU,this.initialized=!1,this.zone=Oe(qt),this.pendingTasks=Oe(_s)}initialize(){if(this.initialized)return;this.initialized=!0;let n=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(n=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{qt.assertNotInAngularZone(),queueMicrotask(()=>{null!==n&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(n),n=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{qt.assertInAngularZone(),n??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=dt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const ul=new Xe("",{providedIn:"root",factory:()=>Oe(ul,Ze.Optional|Ze.SkipSelf)||function YT(){return typeof $localize<"u"&&$localize.locale||zs}()}),XT=new Xe("",{providedIn:"root",factory:()=>"USD"}),ih=new Xe("");let Zo=null;let eC=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=rA}return e})();function rA(e){return function oA(e,t,n){if(Uo(e)&&!n){const r=Kn(e.index,t);return new Ja(r,r)}return 47&e.type?new Ja(t[Pt],t):null}(yt(),z(),!(16&~e))}class oC{constructor(){}supports(t){return Hc(t)}create(t){return new cA(t)}}const uA=(e,t)=>t;class cA{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||uA}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,o=0,i=null;for(;n||r;){const s=!r||n&&n.currentIndex{s=this._trackByFn(o,a),null!==n&&Object.is(n.trackById,s)?(r&&(n=this._verifyReinsertion(n,a,s,o)),Object.is(n.item,a)||this._addIdentityChange(n,a)):(n=this._mismatch(n,a,s,o),r=!0),n=n._next,o++}),this.length=o;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,o){let i;return null===t?i=this._itTail:(i=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,i,o)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,o))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,i,o)):t=this._addAfter(new lA(n,r),i,o),t}_verifyReinsertion(t,n,r,o){let i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==i?t=this._reinsertAfter(i,t._prev,o):t.currentIndex!=o&&(t.currentIndex=o,this._addToMoves(t,o)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const o=t._prevRemoved,i=t._nextRemoved;return null===o?this._removalsHead=i:o._nextRemoved=i,null===i?this._removalsTail=o:i._prevRemoved=o,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const o=null===n?this._itHead:n._next;return t._next=o,t._prev=n,null===o?this._itTail=t:o._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new iC),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new iC),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class lA{constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class dA{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class iC{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new dA,this.map.set(n,r)),r.add(t)}get(t,n){const o=this.map.get(t);return o?o.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function sC(e,t,n){const r=e.previousIndex;if(null===r)return r;let o=0;return n&&r{if(n&&n.key===o)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const i=this._getOrCreateRecordForKey(o,r);n=this._insertBeforeOrAppend(n,i)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const o=this._records.get(t);this._maybeAddToChanges(o,n);const i=o._prev,s=o._next;return i&&(i._next=s),s&&(s._prev=i),o._next=null,o._prev=null,o}const r=new hA(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class hA{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function uC(){return new dh([new oC])}let dh=(()=>{class e{static#e=this.\u0275prov=dt({token:e,providedIn:"root",factory:uC});constructor(n){this.factories=n}static create(n,r){if(null!=r){const o=r.factories.slice();n=n.concat(o)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||uC()),deps:[[e,new Ro,new Rr]]}}find(n){const r=this.factories.find(o=>o.supports(n));if(null!=r)return r;throw new pe(901,!1)}}return e})();function cC(){return new fh([new aC])}let fh=(()=>{class e{static#e=this.\u0275prov=dt({token:e,providedIn:"root",factory:cC});constructor(n){this.factories=n}static create(n,r){if(r){const o=r.factories.slice();n=n.concat(o)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||cC()),deps:[[e,new Ro,new Rr]]}}find(n){const r=this.factories.find(o=>o.supports(n));if(r)return r;throw new pe(901,!1)}}return e})();function NA(e){try{const{rootComponent:t,appProviders:n,platformProviders:r}=e,o=function nA(e=[]){if(Zo)return Zo;const t=function YD(e=[],t){return Qn.create({name:t,providers:[{provide:gi,useValue:"platform"},{provide:ih,useValue:new Set([()=>Zo=null])},...e]})}(e);return Zo=t,function $D(){!function Zr(e){or=e}(()=>{throw new pe(600,!1)})}(),function XD(e){e.get(bp,null)?.forEach(n=>n())}(t),t}(r),i=[qT(),...n||[]],a=new $m({providers:i,parent:o,debugName:"",runEnvironmentInitializers:!1}).injector,l=a.get(qt);return l.run(()=>{a.resolveInjectorInitializers();const g=a.get(po,null);let y;l.runOutsideAngular(()=>{y=l.onError.subscribe({next:A=>{g.handleError(A)}})});const w=()=>a.destroy(),T=o.get(ih);return T.add(w),a.onDestroy(()=>{y.unsubscribe(),T.delete(w)}),function zD(e,t,n){try{const r=n();return th(r)?r.catch(o=>{throw t.runOutsideAngular(()=>e.handleError(o)),o}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(g,l,()=>{const A=a.get(nh);return A.runInitializers(),A.donePromise.then(()=>{!function Zv(e){"string"==typeof e&&(qv=e.toLowerCase().replace(/_/g,"-"))}(a.get(ul,zs)||zs);const B=a.get(qo);return void 0!==t&&B.bootstrap(t),B})})})}catch(t){return Promise.reject(t)}}function WA(e){return"boolean"==typeof e?e:null!=e&&"false"!==e}function KA(e){const t=Q(null);try{return e()}finally{Q(t)}}function JA(e){const t=Ge(e);if(!t)return null;const n=new uu(t);return{get selector(){return n.selector},get type(){return n.componentType},get inputs(){return n.inputs},get outputs(){return n.outputs},get ngContentSelectors(){return n.ngContentSelectors},get isStandalone(){return t.standalone},get isSignal(){return t.signals}}}},345:(Te,oe,S)=>{S.d(oe,{B8:()=>U,hE:()=>Ft});var E=S(4438),I=S(177);class W extends I.VF{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class N extends W{static makeCurrent(){(0,I.ZD)(new N)}onAndCancel(F,b,R){return F.addEventListener(b,R),()=>{F.removeEventListener(b,R)}}dispatchEvent(F,b){F.dispatchEvent(b)}remove(F){F.parentNode&&F.parentNode.removeChild(F)}createElement(F,b){return(b=b||this.getDefaultDocument()).createElement(F)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(F){return F.nodeType===Node.ELEMENT_NODE}isShadowRoot(F){return F instanceof DocumentFragment}getGlobalEventTarget(F,b){return"window"===b?window:"document"===b?F:"body"===b?F.body:null}getBaseHref(F){const b=function te(){return G=G||document.querySelector("base"),G?G.getAttribute("href"):null}();return null==b?null:function Q(O){return new URL(O,document.baseURI).pathname}(b)}resetBaseElement(){G=null}getUserAgent(){return window.navigator.userAgent}getCookie(F){return(0,I._b)(document.cookie,F)}}let G=null,ne=(()=>{class O{build(){return new XMLHttpRequest}static#e=this.\u0275fac=function(R){return new(R||O)};static#t=this.\u0275prov=E.jDH({token:O,factory:O.\u0275fac})}return O})();const q=new E.nKC("");let H=(()=>{class O{constructor(b,R){this._zone=R,this._eventNameToPlugin=new Map,b.forEach(X=>{X.manager=this}),this._plugins=b.slice().reverse()}addEventListener(b,R,X){return this._findPluginFor(R).addEventListener(b,R,X)}getZone(){return this._zone}_findPluginFor(b){let R=this._eventNameToPlugin.get(b);if(R)return R;if(R=this._plugins.find(ge=>ge.supports(b)),!R)throw new E.wOt(5101,!1);return this._eventNameToPlugin.set(b,R),R}static#e=this.\u0275fac=function(R){return new(R||O)(E.KVO(q),E.KVO(E.SKi))};static#t=this.\u0275prov=E.jDH({token:O,factory:O.\u0275fac})}return O})();class ie{constructor(F){this._doc=F}}const ye="ng-app-id";let le=(()=>{class O{constructor(b,R,X,ge={}){this.doc=b,this.appId=R,this.nonce=X,this.platformId=ge,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=(0,I.Vy)(ge),this.resetHostNodes()}addStyles(b){for(const R of b)1===this.changeUsageCount(R,1)&&this.onStyleAdded(R)}removeStyles(b){for(const R of b)this.changeUsageCount(R,-1)<=0&&this.onStyleRemoved(R)}ngOnDestroy(){const b=this.styleNodesInDOM;b&&(b.forEach(R=>R.remove()),b.clear());for(const R of this.getAllStyles())this.onStyleRemoved(R);this.resetHostNodes()}addHost(b){this.hostNodes.add(b);for(const R of this.getAllStyles())this.addStyleToHost(b,R)}removeHost(b){this.hostNodes.delete(b)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(b){for(const R of this.hostNodes)this.addStyleToHost(R,b)}onStyleRemoved(b){const R=this.styleRef;R.get(b)?.elements?.forEach(X=>X.remove()),R.delete(b)}collectServerRenderedStyles(){const b=this.doc.head?.querySelectorAll(`style[${ye}="${this.appId}"]`);if(b?.length){const R=new Map;return b.forEach(X=>{null!=X.textContent&&R.set(X.textContent,X)}),R}return null}changeUsageCount(b,R){const X=this.styleRef;if(X.has(b)){const ge=X.get(b);return ge.usage+=R,ge.usage}return X.set(b,{usage:R,elements:[]}),R}getStyleElement(b,R){const X=this.styleNodesInDOM,ge=X?.get(R);if(ge?.parentNode===b)return X.delete(R),ge.removeAttribute(ye),ge;{const Me=this.doc.createElement("style");return this.nonce&&Me.setAttribute("nonce",this.nonce),Me.textContent=R,this.platformIsServer&&Me.setAttribute(ye,this.appId),b.appendChild(Me),Me}}addStyleToHost(b,R){const X=this.getStyleElement(b,R),ge=this.styleRef,Me=ge.get(R)?.elements;Me?Me.push(X):ge.set(R,{elements:[X],usage:1})}resetHostNodes(){const b=this.hostNodes;b.clear(),b.add(this.doc.head)}static#e=this.\u0275fac=function(R){return new(R||O)(E.KVO(I.qQ),E.KVO(E.sZ2),E.KVO(E.BIS,8),E.KVO(E.Agw))};static#t=this.\u0275prov=E.jDH({token:O,factory:O.\u0275fac})}return O})();const Ee={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/"},Je=/%COMP%/g,ce=new E.nKC("",{providedIn:"root",factory:()=>!0});function Ae(O,F){return F.map(b=>b.replace(Je,O))}let fe=(()=>{class O{constructor(b,R,X,ge,Me,lt,St,Jt=null){this.eventManager=b,this.sharedStylesHost=R,this.appId=X,this.removeStylesOnCompDestroy=ge,this.doc=Me,this.platformId=lt,this.ngZone=St,this.nonce=Jt,this.rendererByCompId=new Map,this.platformIsServer=(0,I.Vy)(lt),this.defaultRenderer=new ee(b,Me,St,this.platformIsServer)}createRenderer(b,R){if(!b||!R)return this.defaultRenderer;this.platformIsServer&&R.encapsulation===E.gXe.ShadowDom&&(R={...R,encapsulation:E.gXe.Emulated});const X=this.getOrCreateRenderer(b,R);return X instanceof Yn?X.applyToHost(b):X instanceof _t&&X.applyStyles(),X}getOrCreateRenderer(b,R){const X=this.rendererByCompId;let ge=X.get(R.id);if(!ge){const Me=this.doc,lt=this.ngZone,St=this.eventManager,Jt=this.sharedStylesHost,Un=this.removeStylesOnCompDestroy,hn=this.platformIsServer;switch(R.encapsulation){case E.gXe.Emulated:ge=new Yn(St,Jt,R,this.appId,Un,Me,lt,hn);break;case E.gXe.ShadowDom:return new Zt(St,Jt,b,R,Me,lt,this.nonce,hn);default:ge=new _t(St,Jt,R,Un,Me,lt,hn)}X.set(R.id,ge)}return ge}ngOnDestroy(){this.rendererByCompId.clear()}static#e=this.\u0275fac=function(R){return new(R||O)(E.KVO(H),E.KVO(le),E.KVO(E.sZ2),E.KVO(ce),E.KVO(I.qQ),E.KVO(E.Agw),E.KVO(E.SKi),E.KVO(E.BIS))};static#t=this.\u0275prov=E.jDH({token:O,factory:O.\u0275fac})}return O})();class ee{constructor(F,b,R,X){this.eventManager=F,this.doc=b,this.ngZone=R,this.platformIsServer=X,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(F,b){return b?this.doc.createElementNS(Ee[b]||b,F):this.doc.createElement(F)}createComment(F){return this.doc.createComment(F)}createText(F){return this.doc.createTextNode(F)}appendChild(F,b){(Ye(F)?F.content:F).appendChild(b)}insertBefore(F,b,R){F&&(Ye(F)?F.content:F).insertBefore(b,R)}removeChild(F,b){F&&F.removeChild(b)}selectRootElement(F,b){let R="string"==typeof F?this.doc.querySelector(F):F;if(!R)throw new E.wOt(-5104,!1);return b||(R.textContent=""),R}parentNode(F){return F.parentNode}nextSibling(F){return F.nextSibling}setAttribute(F,b,R,X){if(X){b=X+":"+b;const ge=Ee[X];ge?F.setAttributeNS(ge,b,R):F.setAttribute(b,R)}else F.setAttribute(b,R)}removeAttribute(F,b,R){if(R){const X=Ee[R];X?F.removeAttributeNS(X,b):F.removeAttribute(`${R}:${b}`)}else F.removeAttribute(b)}addClass(F,b){F.classList.add(b)}removeClass(F,b){F.classList.remove(b)}setStyle(F,b,R,X){X&(E.czy.DashCase|E.czy.Important)?F.style.setProperty(b,R,X&E.czy.Important?"important":""):F.style[b]=R}removeStyle(F,b,R){R&E.czy.DashCase?F.style.removeProperty(b):F.style[b]=""}setProperty(F,b,R){null!=F&&(F[b]=R)}setValue(F,b){F.nodeValue=b}listen(F,b,R){if("string"==typeof F&&!(F=(0,I.QT)().getGlobalEventTarget(this.doc,F)))throw new Error(`Unsupported event target ${F} for event ${b}`);return this.eventManager.addEventListener(F,b,this.decoratePreventDefault(R))}decoratePreventDefault(F){return b=>{if("__ngUnwrap__"===b)return F;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>F(b)):F(b))&&b.preventDefault()}}}function Ye(O){return"TEMPLATE"===O.tagName&&void 0!==O.content}class Zt extends ee{constructor(F,b,R,X,ge,Me,lt,St){super(F,ge,Me,St),this.sharedStylesHost=b,this.hostEl=R,this.shadowRoot=R.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const Jt=Ae(X.id,X.styles);for(const Un of Jt){const hn=document.createElement("style");lt&&hn.setAttribute("nonce",lt),hn.textContent=Un,this.shadowRoot.appendChild(hn)}}nodeOrShadowRoot(F){return F===this.hostEl?this.shadowRoot:F}appendChild(F,b){return super.appendChild(this.nodeOrShadowRoot(F),b)}insertBefore(F,b,R){return super.insertBefore(this.nodeOrShadowRoot(F),b,R)}removeChild(F,b){return super.removeChild(this.nodeOrShadowRoot(F),b)}parentNode(F){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(F)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class _t extends ee{constructor(F,b,R,X,ge,Me,lt,St){super(F,ge,Me,lt),this.sharedStylesHost=b,this.removeStylesOnCompDestroy=X,this.styles=St?Ae(St,R.styles):R.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class Yn extends _t{constructor(F,b,R,X,ge,Me,lt,St){const Jt=X+"-"+R.id;super(F,b,R,ge,Me,lt,St,Jt),this.contentAttr=function ae(O){return"_ngcontent-%COMP%".replace(Je,O)}(Jt),this.hostAttr=function Ce(O){return"_nghost-%COMP%".replace(Je,O)}(Jt)}applyToHost(F){this.applyStyles(),this.setAttribute(F,this.hostAttr,"")}createElement(F,b){const R=super.createElement(F,b);return super.setAttribute(R,this.contentAttr,""),R}}let or=(()=>{class O extends ie{constructor(b){super(b)}supports(b){return!0}addEventListener(b,R,X){return b.addEventListener(R,X,!1),()=>this.removeEventListener(b,R,X)}removeEventListener(b,R,X){return b.removeEventListener(R,X)}static#e=this.\u0275fac=function(R){return new(R||O)(E.KVO(I.qQ))};static#t=this.\u0275prov=E.jDH({token:O,factory:O.\u0275fac})}return O})();const ir=["alt","control","meta","shift"],Zr={"\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"},j={alt:O=>O.altKey,control:O=>O.ctrlKey,meta:O=>O.metaKey,shift:O=>O.shiftKey};let V=(()=>{class O extends ie{constructor(b){super(b)}supports(b){return null!=O.parseEventName(b)}addEventListener(b,R,X){const ge=O.parseEventName(R),Me=O.eventCallback(ge.fullKey,X,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>(0,I.QT)().onAndCancel(b,ge.domEventName,Me))}static parseEventName(b){const R=b.toLowerCase().split("."),X=R.shift();if(0===R.length||"keydown"!==X&&"keyup"!==X)return null;const ge=O._normalizeKey(R.pop());let Me="",lt=R.indexOf("code");if(lt>-1&&(R.splice(lt,1),Me="code."),ir.forEach(Jt=>{const Un=R.indexOf(Jt);Un>-1&&(R.splice(Un,1),Me+=Jt+".")}),Me+=ge,0!=R.length||0===ge.length)return null;const St={};return St.domEventName=X,St.fullKey=Me,St}static matchEventFullKeyCode(b,R){let X=Zr[b.key]||b.key,ge="";return R.indexOf("code.")>-1&&(X=b.code,ge="code."),!(null==X||!X)&&(X=X.toLowerCase()," "===X?X="space":"."===X&&(X="dot"),ir.forEach(Me=>{Me!==X&&(0,j[Me])(b)&&(ge+=Me+".")}),ge+=X,ge===R)}static eventCallback(b,R,X){return ge=>{O.matchEventFullKeyCode(ge,b)&&X.runGuarded(()=>R(ge))}}static _normalizeKey(b){return"esc"===b?"escape":b}static#e=this.\u0275fac=function(R){return new(R||O)(E.KVO(I.qQ))};static#t=this.\u0275prov=E.jDH({token:O,factory:O.\u0275fac})}return O})();function U(O,F){return(0,E.TL3)({rootComponent:O,...ue(F)})}function ue(O){return{appProviders:[...ct,...O?.providers??[]],platformProviders:Ne}}const Ne=[{provide:E.Agw,useValue:I.AJ},{provide:E.PLl,useValue:function be(){N.makeCurrent()},multi:!0},{provide:I.qQ,useFactory:function Ht(){return(0,E.TL$)(document),document},deps:[]}],ct=[{provide:E.H8p,useValue:"root"},{provide:E.zcH,useFactory:function it(){return new E.zcH},deps:[]},{provide:q,useClass:or,multi:!0,deps:[I.qQ,E.SKi,E.Agw]},{provide:q,useClass:V,multi:!0,deps:[I.qQ]},fe,le,H,{provide:E._9s,useExisting:fe},{provide:I.N0,useClass:ne,deps:[]},[]];let Ft=(()=>{class O{constructor(b){this._doc=b}getTitle(){return this._doc.title}setTitle(b){this._doc.title=b||""}static#e=this.\u0275fac=function(R){return new(R||O)(E.KVO(I.qQ))};static#t=this.\u0275prov=E.jDH({token:O,factory:O.\u0275fac,providedIn:"root"})}return O})()},6933:(Te,oe,S)=>{S.d(oe,{Wk:()=>xt,iI:()=>_a,n3:()=>si,lh:()=>vr});var E=S(467),I=S(4438),W=S(1985),N=S(8071),te=S(6648),Q=S(9326);function Y(...u){const f=(0,Q.lI)(u);return(0,te.H)(u,f)}var ne=S(4412),q=S(1983);const ie=(0,S(1853).L)(u=>function(){u(this),this.name="EmptyError",this.message="no elements in sequence"});var ye=S(8793),le=S(8750);function Ee(u){return new W.c(f=>{(0,le.Tg)(u()).subscribe(f)})}var Je=S(1203);function Be(u,f){const c=(0,N.T)(u)?u:()=>u,h=m=>m.error(c());return new W.c(f?m=>f.schedule(h,0,m):h)}var we=S(983),Ue=S(8359),ze=S(9974),ce=S(4360);function ae(){return(0,ze.N)((u,f)=>{let c=null;u._refCount++;const h=(0,ce._)(f,void 0,void 0,void 0,()=>{if(!u||u._refCount<=0||0<--u._refCount)return void(c=null);const m=u._connection,C=c;c=null,m&&(!C||m===C)&&m.unsubscribe(),f.unsubscribe()});u.subscribe(h),h.closed||(c=u.connect())})}class Ce extends W.c{constructor(f,c){super(),this.source=f,this.subjectFactory=c,this._subject=null,this._refCount=0,this._connection=null,(0,ze.S)(f)&&(this.lift=f.lift)}_subscribe(f){return this.getSubject().subscribe(f)}getSubject(){const f=this._subject;return(!f||f.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:f}=this;this._subject=this._connection=null,f?.unsubscribe()}connect(){let f=this._connection;if(!f){f=this._connection=new Ue.yU;const c=this.getSubject();f.add(this.source.subscribe((0,ce._)(c,void 0,()=>{this._teardown(),c.complete()},h=>{this._teardown(),c.error(h)},()=>this._teardown()))),f.closed&&(this._connection=null,f=Ue.yU.EMPTY)}return f}refCount(){return ae()(this)}}var Ae=S(1413),fe=S(177),ee=S(6354),ve=S(5558),Fe=S(6697),Ye=S(9172),Zt=S(5964),_t=S(1397);function Yn(u){return(0,ze.N)((f,c)=>{let h=!1;f.subscribe((0,ce._)(c,m=>{h=!0,c.next(m)},()=>{h||c.next(u),c.complete()}))})}function or(u=ir){return(0,ze.N)((f,c)=>{let h=!1;f.subscribe((0,ce._)(c,m=>{h=!0,c.next(m)},()=>h?c.complete():c.error(u())))})}function ir(){return new ie}var Zr=S(3669);function j(u,f){const c=arguments.length>=2;return h=>h.pipe(u?(0,Zt.p)((m,C)=>u(m,C,h)):Zr.D,(0,Fe.s)(1),c?Yn(f):or(()=>new ie))}function V(u,f){return(0,N.T)(f)?(0,_t.Z)(u,f,1):(0,_t.Z)(u,1)}var U=S(8141);function $(u){return(0,ze.N)((f,c)=>{let C,h=null,m=!1;h=f.subscribe((0,ce._)(c,void 0,void 0,M=>{C=(0,le.Tg)(u(M,$(u)(f))),h?(h.unsubscribe(),h=null,C.subscribe(c)):m=!0})),m&&(h.unsubscribe(),h=null,C.subscribe(c))})}function be(u){return u<=0?()=>we.w:(0,ze.N)((f,c)=>{let h=[];f.subscribe((0,ce._)(c,m=>{h.push(m),u{for(const m of h)c.next(m);c.complete()},void 0,()=>{h=null}))})}function Ne(u){return(0,ze.N)((f,c)=>{try{f.subscribe(c)}finally{c.add(u)}})}var Dt=S(5343),Yt=S(6365),ct=S(345);const Ie="primary",Bt=Symbol("RouteTitle");class Mt{constructor(f){this.params=f||{}}has(f){return Object.prototype.hasOwnProperty.call(this.params,f)}get(f){if(this.has(f)){const c=this.params[f];return Array.isArray(c)?c[0]:c}return null}getAll(f){if(this.has(f)){const c=this.params[f];return Array.isArray(c)?c:[c]}return[]}get keys(){return Object.keys(this.params)}}function Ft(u){return new Mt(u)}function pe(u,f,c){const h=c.path.split("/");if(h.length>u.length||"full"===c.pathMatch&&(f.hasChildren()||h.lengthh[C]===m)}return u===f}function Oi(u){return u.length>0?u[u.length-1]:null}function kt(u){return function G(u){return!!u&&(u instanceof W.c||(0,N.T)(u.lift)&&(0,N.T)(u.subscribe))}(u)?u:(0,I.jNT)(u)?(0,te.H)(Promise.resolve(u)):Y(u)}const He={exact:function fn(u,f,c){if(!mt(u.segments,f.segments)||!xe(u.segments,f.segments,c)||u.numberOfChildren!==f.numberOfChildren)return!1;for(const h in f.children)if(!u.children[h]||!fn(u.children[h],f.children[h],c))return!1;return!0},subset:jt},Qe={exact:function Nn(u,f){return Xt(u,f)},subset:function ar(u,f){return Object.keys(f).length<=Object.keys(u).length&&Object.keys(f).every(c=>Yr(u[c],f[c]))},ignored:()=>!0};function Xn(u,f,c){return He[c.paths](u.root,f.root,c.matrixParams)&&Qe[c.queryParams](u.queryParams,f.queryParams)&&!("exact"===c.fragment&&u.fragment!==f.fragment)}function jt(u,f,c){return xi(u,f,f.segments,c)}function xi(u,f,c,h){if(u.segments.length>c.length){const m=u.segments.slice(0,c.length);return!(!mt(m,c)||f.hasChildren()||!xe(m,c,h))}if(u.segments.length===c.length){if(!mt(u.segments,c)||!xe(u.segments,c,h))return!1;for(const m in f.children)if(!u.children[m]||!jt(u.children[m],f.children[m],h))return!1;return!0}{const m=c.slice(0,u.segments.length),C=c.slice(u.segments.length);return!!(mt(u.segments,m)&&xe(u.segments,m,h)&&u.children[Ie])&&xi(u.children[Ie],f,C,h)}}function xe(u,f,c){return f.every((h,m)=>Qe[c](u[m].parameters,h.parameters))}class Dn{constructor(f=new _e([],{}),c={},h=null){this.root=f,this.queryParams=c,this.fragment=h}get queryParamMap(){return this._queryParamMap??=Ft(this.queryParams),this._queryParamMap}toString(){return _r.serialize(this)}}class _e{constructor(f,c){this.segments=f,this.children=c,this.parent=null,Object.values(c).forEach(h=>h.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return O(this)}}class et{constructor(f,c){this.path=f,this.parameters=c}get parameterMap(){return this._parameterMap??=Ft(this.parameters),this._parameterMap}toString(){return St(this)}}function mt(u,f){return u.length===f.length&&u.every((c,h)=>c.path===f[h].path)}let Ir=(()=>{class u{static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:()=>new Jr,providedIn:"root"})}return u})();class Jr{parse(f){const c=new Nu(f);return new Dn(c.parseRootSegment(),c.parseQueryParams(),c.parseFragment())}serialize(f){const c=`/${F(f.root,!0)}`,h=function Un(u){const f=Object.entries(u).map(([c,h])=>Array.isArray(h)?h.map(m=>`${R(c)}=${R(m)}`).join("&"):`${R(c)}=${R(h)}`).filter(c=>c);return f.length?`?${f.join("&")}`:""}(f.queryParams);return`${c}${h}${"string"==typeof f.fragment?`#${function X(u){return encodeURI(u)}(f.fragment)}`:""}`}}const _r=new Jr;function O(u){return u.segments.map(f=>St(f)).join("/")}function F(u,f){if(!u.hasChildren())return O(u);if(f){const c=u.children[Ie]?F(u.children[Ie],!1):"",h=[];return Object.entries(u.children).forEach(([m,C])=>{m!==Ie&&h.push(`${m}:${F(C,!1)}`)}),h.length>0?`${c}(${h.join("//")})`:c}{const c=function ur(u,f){let c=[];return Object.entries(u.children).forEach(([h,m])=>{h===Ie&&(c=c.concat(f(m,h)))}),Object.entries(u.children).forEach(([h,m])=>{h!==Ie&&(c=c.concat(f(m,h)))}),c}(u,(h,m)=>m===Ie?[F(u.children[Ie],!1)]:[`${m}:${F(h,!1)}`]);return 1===Object.keys(u.children).length&&null!=u.children[Ie]?`${O(u)}/${c[0]}`:`${O(u)}/(${c.join("//")})`}}function b(u){return encodeURIComponent(u).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function R(u){return b(u).replace(/%3B/gi,";")}function ge(u){return b(u).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Me(u){return decodeURIComponent(u)}function lt(u){return Me(u.replace(/\+/g,"%20"))}function St(u){return`${ge(u.path)}${function Jt(u){return Object.entries(u).map(([f,c])=>`;${ge(f)}=${ge(c)}`).join("")}(u.parameters)}`}const hn=/^[^\/()?;#]+/;function Mr(u){const f=u.match(hn);return f?f[0]:""}const qs=/^[^\/()?;=#]+/,en=/^[^=?&#]+/,Au=/^[^&#]+/;class Nu{constructor(f){this.url=f,this.remaining=f}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new _e([],{}):new _e([],this.parseChildren())}parseQueryParams(){const f={};if(this.consumeOptional("?"))do{this.parseQueryParam(f)}while(this.consumeOptional("&"));return f}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const f=[];for(this.peekStartsWith("(")||f.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),f.push(this.parseSegment());let c={};this.peekStartsWith("/(")&&(this.capture("/"),c=this.parseParens(!0));let h={};return this.peekStartsWith("(")&&(h=this.parseParens(!1)),(f.length>0||Object.keys(c).length>0)&&(h[Ie]=new _e(f,c)),h}parseSegment(){const f=Mr(this.remaining);if(""===f&&this.peekStartsWith(";"))throw new I.wOt(4009,!1);return this.capture(f),new et(Me(f),this.parseMatrixParams())}parseMatrixParams(){const f={};for(;this.consumeOptional(";");)this.parseParam(f);return f}parseParam(f){const c=function Tu(u){const f=u.match(qs);return f?f[0]:""}(this.remaining);if(!c)return;this.capture(c);let h="";if(this.consumeOptional("=")){const m=Mr(this.remaining);m&&(h=m,this.capture(h))}f[Me(c)]=Me(h)}parseQueryParam(f){const c=function Se(u){const f=u.match(en);return f?f[0]:""}(this.remaining);if(!c)return;this.capture(c);let h="";if(this.consumeOptional("=")){const M=function Pi(u){const f=u.match(Au);return f?f[0]:""}(this.remaining);M&&(h=M,this.capture(h))}const m=lt(c),C=lt(h);if(f.hasOwnProperty(m)){let M=f[m];Array.isArray(M)||(M=[M],f[m]=M),M.push(C)}else f[m]=C}parseParens(f){const c={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const h=Mr(this.remaining),m=this.remaining[h.length];if("/"!==m&&")"!==m&&";"!==m)throw new I.wOt(4010,!1);let C;h.indexOf(":")>-1?(C=h.slice(0,h.indexOf(":")),this.capture(C),this.capture(":")):f&&(C=Ie);const M=this.parseChildren();c[C]=1===Object.keys(M).length?M[Ie]:new _e([],M),this.consumeOptional("//")}return c}peekStartsWith(f){return this.remaining.startsWith(f)}consumeOptional(f){return!!this.peekStartsWith(f)&&(this.remaining=this.remaining.substring(f.length),!0)}capture(f){if(!this.consumeOptional(f))throw new I.wOt(4011,!1)}}function Zs(u){return u.segments.length>0?new _e([],{[Ie]:u}):u}function Ys(u){const f={};for(const[h,m]of Object.entries(u.children)){const C=Ys(m);if(h===Ie&&0===C.segments.length&&C.hasChildren())for(const[M,L]of Object.entries(C.children))f[M]=L;else(C.segments.length>0||C.hasChildren())&&(f[h]=C)}return function dt(u){if(1===u.numberOfChildren&&u.children[Ie]){const f=u.children[Ie];return new _e(u.segments.concat(f.segments),f.children)}return u}(new _e(u.segments,f))}function eo(u){return u instanceof Dn}function to(u){let f;const m=Zs(function c(C){const M={};for(const P of C.children){const he=c(P);M[P.outlet]=he}const L=new _e(C.url,M);return C===u&&(f=L),L}(u.root));return f??m}function yo(u,f,c,h){let m=u;for(;m.parent;)m=m.parent;if(0===f.length)return br(m,m,m,c,h);const C=function Eo(u){if("string"==typeof u[0]&&1===u.length&&"/"===u[0])return new Co(!0,0,u);let f=0,c=!1;const h=u.reduce((m,C,M)=>{if("object"==typeof C&&null!=C){if(C.outlets){const L={};return Object.entries(C.outlets).forEach(([P,he])=>{L[P]="string"==typeof he?he.split("/"):he}),[...m,{outlets:L}]}if(C.segmentPath)return[...m,C.segmentPath]}return"string"!=typeof C?[...m,C]:0===M?(C.split("/").forEach((L,P)=>{0==P&&"."===L||(0==P&&""===L?c=!0:".."===L?f++:""!=L&&m.push(L))}),m):[...m,C]},[]);return new Co(c,f,h)}(f);if(C.toRoot())return br(m,m,new _e([],{}),c,h);const M=function Xe(u,f,c){if(u.isAbsolute)return new no(f,!0,0);if(!c)return new no(f,!1,NaN);if(null===c.parent)return new no(c,!0,0);const h=cr(u.commands[0])?0:1;return function Yo(u,f,c){let h=u,m=f,C=c;for(;C>m;){if(C-=m,h=h.parent,!h)throw new I.wOt(4005,!1);m=h.segments.length}return new no(h,!1,m-C)}(c,c.segments.length-1+h,u.numberOfDoubleDots)}(C,m,u),L=M.processChildren?lr(M.segmentGroup,M.index,C.commands):Xo(M.segmentGroup,M.index,C.commands);return br(m,M.segmentGroup,L,c,h)}function cr(u){return"object"==typeof u&&null!=u&&!u.outlets&&!u.segmentPath}function Sr(u){return"object"==typeof u&&null!=u&&u.outlets}function br(u,f,c,h,m){let M,C={};h&&Object.entries(h).forEach(([P,he])=>{C[P]=Array.isArray(he)?he.map(je=>`${je}`):`${he}`}),M=u===f?c:Do(u,f,c);const L=Zs(Ys(M));return new Dn(L,C,m)}function Do(u,f,c){const h={};return Object.entries(u.children).forEach(([m,C])=>{h[m]=C===f?c:Do(C,f,c)}),new _e(u.segments,h)}class Co{constructor(f,c,h){if(this.isAbsolute=f,this.numberOfDoubleDots=c,this.commands=h,f&&h.length>0&&cr(h[0]))throw new I.wOt(4003,!1);const m=h.find(Sr);if(m&&m!==Oi(h))throw new I.wOt(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class no{constructor(f,c,h){this.segmentGroup=f,this.processChildren=c,this.index=h}}function Xo(u,f,c){if(u??=new _e([],{}),0===u.segments.length&&u.hasChildren())return lr(u,f,c);const h=function Fi(u,f,c){let h=0,m=f;const C={match:!1,pathIndex:0,commandIndex:0};for(;m=c.length)return C;const M=u.segments[m],L=c[h];if(Sr(L))break;const P=`${L}`,he=h0&&void 0===P)break;if(P&&he&&"object"==typeof he&&void 0===he.outlets){if(!Li(P,he,M))return C;h+=2}else{if(!Li(P,{},M))return C;h++}m++}return{match:!0,pathIndex:m,commandIndex:h}}(u,f,c),m=c.slice(h.commandIndex);if(h.match&&h.pathIndexC!==Ie)&&u.children[Ie]&&1===u.numberOfChildren&&0===u.children[Ie].segments.length){const C=lr(u.children[Ie],f,c);return new _e(u.segments,C.children)}return Object.entries(h).forEach(([C,M])=>{"string"==typeof M&&(M=[M]),null!==M&&(m[C]=Xo(u.children[C],f,M))}),Object.entries(u.children).forEach(([C,M])=>{void 0===h[C]&&(m[C]=M)}),new _e(u.segments,m)}}function Io(u,f,c){const h=u.segments.slice(0,f);let m=0;for(;m{"string"==typeof h&&(h=[h]),null!==h&&(f[c]=Io(new _e([],{}),0,h))}),f}function Xs(u){const f={};return Object.entries(u).forEach(([c,h])=>f[c]=`${h}`),f}function Li(u,f,c){return u==c.path&&Xt(f,c.parameters)}const _o="imperative";var We=function(u){return u[u.NavigationStart=0]="NavigationStart",u[u.NavigationEnd=1]="NavigationEnd",u[u.NavigationCancel=2]="NavigationCancel",u[u.NavigationError=3]="NavigationError",u[u.RoutesRecognized=4]="RoutesRecognized",u[u.ResolveStart=5]="ResolveStart",u[u.ResolveEnd=6]="ResolveEnd",u[u.GuardsCheckStart=7]="GuardsCheckStart",u[u.GuardsCheckEnd=8]="GuardsCheckEnd",u[u.RouteConfigLoadStart=9]="RouteConfigLoadStart",u[u.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",u[u.ChildActivationStart=11]="ChildActivationStart",u[u.ChildActivationEnd=12]="ChildActivationEnd",u[u.ActivationStart=13]="ActivationStart",u[u.ActivationEnd=14]="ActivationEnd",u[u.Scroll=15]="Scroll",u[u.NavigationSkipped=16]="NavigationSkipped",u}(We||{});class Qt{constructor(f,c){this.id=f,this.url=c}}class Tr extends Qt{constructor(f,c,h="imperative",m=null){super(f,c),this.type=We.NavigationStart,this.navigationTrigger=h,this.restoredState=m}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Cn extends Qt{constructor(f,c,h){super(f,c),this.urlAfterRedirects=h,this.type=We.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var ln=function(u){return u[u.Redirect=0]="Redirect",u[u.SupersededByNewNavigation=1]="SupersededByNewNavigation",u[u.NoDataFromResolver=2]="NoDataFromResolver",u[u.GuardRejected=3]="GuardRejected",u}(ln||{}),En=function(u){return u[u.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",u[u.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",u}(En||{});class wn extends Qt{constructor(f,c,h,m){super(f,c),this.reason=h,this.code=m,this.type=We.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class dr extends Qt{constructor(f,c,h,m){super(f,c),this.reason=h,this.code=m,this.type=We.NavigationSkipped}}class Re extends Qt{constructor(f,c,h,m){super(f,c),this.error=h,this.target=m,this.type=We.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class tt extends Qt{constructor(f,c,h,m){super(f,c),this.urlAfterRedirects=h,this.state=m,this.type=We.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ml extends Qt{constructor(f,c,h,m){super(f,c),this.urlAfterRedirects=h,this.state=m,this.type=We.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class In extends Qt{constructor(f,c,h,m,C){super(f,c),this.urlAfterRedirects=h,this.state=m,this.shouldActivate=C,this.type=We.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Js extends Qt{constructor(f,c,h,m){super(f,c),this.urlAfterRedirects=h,this.state=m,this.type=We.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ou extends Qt{constructor(f,c,h,m){super(f,c),this.urlAfterRedirects=h,this.state=m,this.type=We.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ea{constructor(f){this.route=f,this.type=We.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Jo{constructor(f){this.route=f,this.type=We.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Ze{constructor(f){this.snapshot=f,this.type=We.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class ei{constructor(f){this.snapshot=f,this.type=We.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class ki{constructor(f){this.snapshot=f,this.type=We.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class sn{constructor(f){this.snapshot=f,this.type=We.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class ti{constructor(f,c,h){this.routerEvent=f,this.position=c,this.anchor=h,this.type=We.Scroll}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class ji{}class Vi{constructor(f){this.url=f}}class ni{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new Jn,this.attachRef=null}}let Jn=(()=>{class u{constructor(){this.contexts=new Map}onChildOutletCreated(c,h){const m=this.getOrCreateContext(c);m.outlet=h,this.contexts.set(c,m)}onChildOutletDestroyed(c){const h=this.getContext(c);h&&(h.outlet=null,h.attachRef=null)}onOutletDeactivated(){const c=this.contexts;return this.contexts=new Map,c}onOutletReAttached(c){this.contexts=c}getOrCreateContext(c){let h=this.getContext(c);return h||(h=new ni,this.contexts.set(c,h)),h}getContext(c){return this.contexts.get(c)||null}static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();class Ui{constructor(f){this._root=f}get root(){return this._root.value}parent(f){const c=this.pathFromRoot(f);return c.length>1?c[c.length-2]:null}children(f){const c=ri(f,this._root);return c?c.children.map(h=>h.value):[]}firstChild(f){const c=ri(f,this._root);return c&&c.children.length>0?c.children[0].value:null}siblings(f){const c=So(f,this._root);return c.length<2?[]:c[c.length-2].children.map(m=>m.value).filter(m=>m!==f)}pathFromRoot(f){return So(f,this._root).map(c=>c.value)}}function ri(u,f){if(u===f.value)return f;for(const c of f.children){const h=ri(u,c);if(h)return h}return null}function So(u,f){if(u===f.value)return[f];for(const c of f.children){const h=So(u,c);if(h.length)return h.unshift(f),h}return[]}class pn{constructor(f,c){this.value=f,this.children=c}toString(){return`TreeNode(${this.value})`}}function gn(u){const f={};return u&&u.children.forEach(c=>f[c.value.outlet]=c),f}class oi extends Ui{constructor(f,c){super(f),this.snapshot=c,To(this,f)}toString(){return this.snapshot.toString()}}function Hn(u){const f=function ta(u){const C=new Oe([],{},{},"",{},Ie,u,null,{});return new bo("",new pn(C,[]))}(u),c=new ne.t([new et("",{})]),h=new ne.t({}),m=new ne.t({}),C=new ne.t({}),M=new ne.t(""),L=new Nt(c,h,C,M,m,Ie,u,f.root);return L.snapshot=f.root,new oi(new pn(L,[]),f)}class Nt{constructor(f,c,h,m,C,M,L,P){this.urlSubject=f,this.paramsSubject=c,this.queryParamsSubject=h,this.fragmentSubject=m,this.dataSubject=C,this.outlet=M,this.component=L,this._futureSnapshot=P,this.title=this.dataSubject?.pipe((0,ee.T)(he=>he[Bt]))??Y(void 0),this.url=f,this.params=c,this.queryParams=h,this.fragment=m,this.data=C}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((0,ee.T)(f=>Ft(f))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe((0,ee.T)(f=>Ft(f))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Ar(u,f,c="emptyOnly"){let h;const{routeConfig:m}=u;return h=null===f||"always"!==c&&""!==m?.path&&(f.component||f.routeConfig?.loadComponent)?{params:{...u.params},data:{...u.data},resolve:{...u.data,...u._resolvedData??{}}}:{params:{...f.params,...u.params},data:{...f.data,...u.data},resolve:{...u.data,...f.data,...m?.data,...u._resolvedData}},m&&Hi(m)&&(h.resolve[Bt]=m.title),h}class Oe{get title(){return this.data?.[Bt]}constructor(f,c,h,m,C,M,L,P,he){this.url=f,this.params=c,this.queryParams=h,this.fragment=m,this.data=C,this.outlet=M,this.component=L,this.routeConfig=P,this._resolve=he}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??=Ft(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Ft(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(h=>h.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class bo extends Ui{constructor(f,c){super(c),this.url=f,To(this,c)}toString(){return Nr(this._root)}}function To(u,f){f.value._routerState=u,f.children.forEach(c=>To(u,c))}function Nr(u){const f=u.children.length>0?` { ${u.children.map(Nr).join(", ")} } `:"";return`${u.value}${f}`}function Ao(u){if(u.snapshot){const f=u.snapshot,c=u._futureSnapshot;u.snapshot=c,Xt(f.queryParams,c.queryParams)||u.queryParamsSubject.next(c.queryParams),f.fragment!==c.fragment&&u.fragmentSubject.next(c.fragment),Xt(f.params,c.params)||u.paramsSubject.next(c.params),function Vn(u,f){if(u.length!==f.length)return!1;for(let c=0;cXt(c.parameters,f[h].parameters))}(u.url,f.url);return c&&!(!u.parent!=!f.parent)&&(!u.parent||ii(u.parent,f.parent))}function Hi(u){return"string"==typeof u.title||null===u.title}let si=(()=>{class u{constructor(){this.activated=null,this._activatedRoute=null,this.name=Ie,this.activateEvents=new I.bkB,this.deactivateEvents=new I.bkB,this.attachEvents=new I.bkB,this.detachEvents=new I.bkB,this.parentContexts=(0,I.WQX)(Jn),this.location=(0,I.WQX)(I.c1b),this.changeDetector=(0,I.WQX)(I.gRc),this.environmentInjector=(0,I.WQX)(I.uvJ),this.inputBinder=(0,I.WQX)(No,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(c){if(c.name){const{firstChange:h,previousValue:m}=c.name;if(h)return;this.isTrackedInParentContexts(m)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(m)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(c){return this.parentContexts.getContext(c)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const c=this.parentContexts.getContext(this.name);c?.route&&(c.attachRef?this.attach(c.attachRef,c.route):this.activateWith(c.route,c.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new I.wOt(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new I.wOt(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new I.wOt(4012,!1);this.location.detach();const c=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(c.instance),c}attach(c,h){this.activated=c,this._activatedRoute=h,this.location.insert(c.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(c.instance)}deactivate(){if(this.activated){const c=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(c)}}activateWith(c,h){if(this.isActivated)throw new I.wOt(4013,!1);this._activatedRoute=c;const m=this.location,M=c.snapshot.component,L=this.parentContexts.getOrCreateContext(this.name).children,P=new Rr(c,L,m.injector);this.activated=m.createComponent(M,{index:m.length,injector:P,environmentInjector:h??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275dir=I.FsC({type:u,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[I.OA$]})}return u})();class Rr{__ngOutletInjector(f){return new Rr(this.route,this.childContexts,f)}constructor(f,c,h){this.route=f,this.childContexts=c,this.parent=h}get(f,c){return f===Nt?this.route:f===Jn?this.childContexts:this.parent.get(f,c)}}const No=new I.nKC("");let Ro=(()=>{class u{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(c){this.unsubscribeFromRouteData(c),this.subscribeToRouteData(c)}unsubscribeFromRouteData(c){this.outletDataSubscriptions.get(c)?.unsubscribe(),this.outletDataSubscriptions.delete(c)}subscribeToRouteData(c){const{activatedRoute:h}=c,m=(0,q.z)([h.queryParams,h.params,h.data]).pipe((0,ve.n)(([C,M,L],P)=>(L={...C,...M,...L},0===P?Y(L):Promise.resolve(L)))).subscribe(C=>{if(!c.isActivated||!c.activatedComponentRef||c.activatedRoute!==h||null===h.component)return void this.unsubscribeFromRouteData(c);const M=(0,I.HJs)(h.component);if(M)for(const{templateName:L}of M.inputs)c.activatedComponentRef.setInput(L,C[L]);else this.unsubscribeFromRouteData(c)});this.outletDataSubscriptions.set(c,m)}static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac})}return u})();function Rn(u,f,c){if(c&&u.shouldReuseRoute(f.value,c.value.snapshot)){const h=c.value;h._futureSnapshot=f.value;const m=function na(u,f,c){return f.children.map(h=>{for(const m of c.children)if(u.shouldReuseRoute(h.value,m.value.snapshot))return Rn(u,h,m);return Rn(u,h)})}(u,f,c);return new pn(h,m)}{if(u.shouldAttach(f.value)){const C=u.retrieve(f.value);if(null!==C){const M=C.route;return M.value._futureSnapshot=f.value,M.children=f.children.map(L=>Rn(u,L)),M}}const h=function an(u){return new Nt(new ne.t(u.url),new ne.t(u.params),new ne.t(u.queryParams),new ne.t(u.fragment),new ne.t(u.data),u.outlet,u.component,u)}(f.value),m=f.children.map(C=>Rn(u,C));return new pn(h,m)}}const fr="ngNavigationCancelingError";function ai(u,f){const{redirectTo:c,navigationBehaviorOptions:h}=eo(f)?{redirectTo:f,navigationBehaviorOptions:void 0}:f,m=ro(!1,ln.Redirect);return m.url=c,m.navigationBehaviorOptions=h,m}function ro(u,f){const c=new Error(`NavigationCancelingError: ${u||""}`);return c[fr]=!0,c.cancellationCode=f,c}function ui(u){return!!u&&u[fr]}let Oo=(()=>{class u{static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275cmp=I.VBU({type:u,selectors:[["ng-component"]],standalone:!0,features:[I.aNF],decls:1,vars:0,template:function(h,m){1&h&&I.nrm(0,"router-outlet")},dependencies:[si],encapsulation:2})}return u})();function er(u){const f=u.children&&u.children.map(er),c=f?{...u,children:f}:{...u};return!c.component&&!c.loadComponent&&(f||c.loadChildren)&&c.outlet&&c.outlet!==Ie&&(c.component=Oo),c}function xn(u){return u.outlet||Ie}function tr(u){if(!u)return null;if(u.routeConfig?._injector)return u.routeConfig._injector;for(let f=u.parent;f;f=f.parent){const c=f.routeConfig;if(c?._loadedInjector)return c._loadedInjector;if(c?._injector)return c._injector}return null}class gr{constructor(f,c,h,m,C){this.routeReuseStrategy=f,this.futureState=c,this.currState=h,this.forwardEvent=m,this.inputBindingEnabled=C}activate(f){const c=this.futureState._root,h=this.currState?this.currState._root:null;this.deactivateChildRoutes(c,h,f),Ao(this.futureState.root),this.activateChildRoutes(c,h,f)}deactivateChildRoutes(f,c,h){const m=gn(c);f.children.forEach(C=>{const M=C.value.outlet;this.deactivateRoutes(C,m[M],h),delete m[M]}),Object.values(m).forEach(C=>{this.deactivateRouteAndItsChildren(C,h)})}deactivateRoutes(f,c,h){const m=f.value,C=c?c.value:null;if(m===C)if(m.component){const M=h.getContext(m.outlet);M&&this.deactivateChildRoutes(f,c,M.children)}else this.deactivateChildRoutes(f,c,h);else C&&this.deactivateRouteAndItsChildren(c,h)}deactivateRouteAndItsChildren(f,c){f.value.component&&this.routeReuseStrategy.shouldDetach(f.value.snapshot)?this.detachAndStoreRouteSubtree(f,c):this.deactivateRouteAndOutlet(f,c)}detachAndStoreRouteSubtree(f,c){const h=c.getContext(f.value.outlet),m=h&&f.value.component?h.children:c,C=gn(f);for(const M of Object.values(C))this.deactivateRouteAndItsChildren(M,m);if(h&&h.outlet){const M=h.outlet.detach(),L=h.children.onOutletDeactivated();this.routeReuseStrategy.store(f.value.snapshot,{componentRef:M,route:f,contexts:L})}}deactivateRouteAndOutlet(f,c){const h=c.getContext(f.value.outlet),m=h&&f.value.component?h.children:c,C=gn(f);for(const M of Object.values(C))this.deactivateRouteAndItsChildren(M,m);h&&(h.outlet&&(h.outlet.deactivate(),h.children.onOutletDeactivated()),h.attachRef=null,h.route=null)}activateChildRoutes(f,c,h){const m=gn(c);f.children.forEach(C=>{this.activateRoutes(C,m[C.value.outlet],h),this.forwardEvent(new sn(C.value.snapshot))}),f.children.length&&this.forwardEvent(new ei(f.value.snapshot))}activateRoutes(f,c,h){const m=f.value,C=c?c.value:null;if(Ao(m),m===C)if(m.component){const M=h.getOrCreateContext(m.outlet);this.activateChildRoutes(f,c,M.children)}else this.activateChildRoutes(f,c,h);else if(m.component){const M=h.getOrCreateContext(m.outlet);if(this.routeReuseStrategy.shouldAttach(m.snapshot)){const L=this.routeReuseStrategy.retrieve(m.snapshot);this.routeReuseStrategy.store(m.snapshot,null),M.children.onOutletReAttached(L.contexts),M.attachRef=L.componentRef,M.route=L.route.value,M.outlet&&M.outlet.attach(L.componentRef,L.route.value),Ao(L.route.value),this.activateChildRoutes(f,null,M.children)}else{const L=tr(m.snapshot);M.attachRef=null,M.route=m,M.injector=L,M.outlet&&M.outlet.activateWith(m,M.injector),this.activateChildRoutes(f,null,M.children)}}else this.activateChildRoutes(f,null,h)}}class $i{constructor(f){this.path=f,this.route=this.path[this.path.length-1]}}class Or{constructor(f,c){this.component=f,this.route=c}}function zi(u,f,c){const h=u._root;return xr(h,f?f._root:null,c,[h.value])}function $n(u,f){const c=Symbol(),h=f.get(u,c);return h===c?"function"!=typeof u||(0,I.LfX)(u)?f.get(u):u:h}function xr(u,f,c,h,m={canDeactivateChecks:[],canActivateChecks:[]}){const C=gn(f);return u.children.forEach(M=>{(function Wi(u,f,c,h,m={canDeactivateChecks:[],canActivateChecks:[]}){const C=u.value,M=f?f.value:null,L=c?c.getContext(u.value.outlet):null;if(M&&C.routeConfig===M.routeConfig){const P=function sa(u,f,c){if("function"==typeof c)return c(u,f);switch(c){case"pathParamsChange":return!mt(u.url,f.url);case"pathParamsOrQueryParamsChange":return!mt(u.url,f.url)||!Xt(u.queryParams,f.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!ii(u,f)||!Xt(u.queryParams,f.queryParams);default:return!ii(u,f)}}(M,C,C.routeConfig.runGuardsAndResolvers);P?m.canActivateChecks.push(new $i(h)):(C.data=M.data,C._resolvedData=M._resolvedData),xr(u,f,C.component?L?L.children:null:c,h,m),P&&L&&L.outlet&&L.outlet.isActivated&&m.canDeactivateChecks.push(new Or(L.outlet.component,M))}else M&&Pr(f,L,m),m.canActivateChecks.push(new $i(h)),xr(u,null,C.component?L?L.children:null:c,h,m)})(M,C[M.value.outlet],c,h.concat([M.value]),m),delete C[M.value.outlet]}),Object.entries(C).forEach(([M,L])=>Pr(L,c.getContext(M),m)),m}function Pr(u,f,c){const h=gn(u),m=u.value;Object.entries(h).forEach(([C,M])=>{Pr(M,m.component?f?f.children.getContext(C):null:f,c)}),c.canDeactivateChecks.push(new Or(m.component&&f&&f.outlet&&f.outlet.isActivated?f.outlet.component:null,m))}function xo(u){return"function"==typeof u}function pt(u){return u instanceof ie||"EmptyError"===u?.name}const di=Symbol("INITIAL_VALUE");function Fr(){return(0,ve.n)(u=>(0,q.z)(u.map(f=>f.pipe((0,Fe.s)(1),(0,Ye.Z)(di)))).pipe((0,ee.T)(f=>{for(const c of f)if(!0!==c){if(c===di)return di;if(!1===c||c instanceof Dn)return c}return!0}),(0,Zt.p)(f=>f!==di),(0,Fe.s)(1)))}function Po(u){return(0,Je.F)((0,U.M)(f=>{if(eo(f))throw ai(0,f)}),(0,ee.T)(f=>!0===f))}class Rt{constructor(f){this.segmentGroup=f||null}}class Ot extends Error{constructor(f){super(),this.urlTree=f}}function $t(u){return Be(new Rt(u))}class oo{constructor(f,c){this.urlSerializer=f,this.urlTree=c}lineralizeSegments(f,c){let h=[],m=c.root;for(;;){if(h=h.concat(m.segments),0===m.numberOfChildren)return Y(h);if(m.numberOfChildren>1||!m.children[Ie])return Be(new I.wOt(4e3,!1));m=m.children[Ie]}}applyRedirectCommands(f,c,h){const m=this.applyRedirectCreateUrlTree(c,this.urlSerializer.parse(c),f,h);if(c.startsWith("/"))throw new Ot(m);return m}applyRedirectCreateUrlTree(f,c,h,m){const C=this.createSegmentGroup(f,c.root,h,m);return new Dn(C,this.createQueryParams(c.queryParams,this.urlTree.queryParams),c.fragment)}createQueryParams(f,c){const h={};return Object.entries(f).forEach(([m,C])=>{if("string"==typeof C&&C.startsWith(":")){const L=C.substring(1);h[m]=c[L]}else h[m]=C}),h}createSegmentGroup(f,c,h,m){const C=this.createSegments(f,c.segments,h,m);let M={};return Object.entries(c.children).forEach(([L,P])=>{M[L]=this.createSegmentGroup(f,P,h,m)}),new _e(C,M)}createSegments(f,c,h,m){return c.map(C=>C.path.startsWith(":")?this.findPosParam(f,C,m):this.findOrReturn(C,h))}findPosParam(f,c,h){const m=h[c.path.substring(1)];if(!m)throw new I.wOt(4001,!1);return m}findOrReturn(f,c){let h=0;for(const m of c){if(m.path===f.path)return c.splice(h),m;h++}return f}}const Qi={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function Uu(u,f,c,h,m){const C=Lr(u,f,c);return C.matched?(h=function ra(u,f){return u.providers&&!u._injector&&(u._injector=(0,I.Ol2)(u.providers,f,`Route: ${u.path}`)),u._injector??f}(f,h),function Ge(u,f,c,h){const m=f.canMatch;return m&&0!==m.length?Y(m.map(M=>{const L=$n(M,u);return kt(function la(u){return u&&xo(u.canMatch)}(L)?L.canMatch(f,c):(0,I.N4e)(u,()=>L(f,c)))})).pipe(Fr(),Po()):Y(!0)}(h,f,c).pipe((0,ee.T)(M=>!0===M?C:{...Qi}))):Y(C)}function Lr(u,f,c){if("**"===f.path)return function qi(u){return{matched:!0,parameters:u.length>0?Oi(u).parameters:{},consumedSegments:u,remainingSegments:[],positionalParamSegments:{}}}(c);if(""===f.path)return"full"===f.pathMatch&&(u.hasChildren()||c.length>0)?{...Qi}:{matched:!0,consumedSegments:[],remainingSegments:c,parameters:{},positionalParamSegments:{}};const m=(f.matcher||pe)(c,u,f);if(!m)return{...Qi};const C={};Object.entries(m.posParams??{}).forEach(([L,P])=>{C[L]=P.path});const M=m.consumed.length>0?{...C,...m.consumed[m.consumed.length-1].parameters}:C;return{matched:!0,consumedSegments:m.consumed,remainingSegments:c.slice(m.consumed.length),parameters:M,positionalParamSegments:m.posParams??{}}}function io(u,f,c,h){return c.length>0&&function vl(u,f,c){return c.some(h=>pi(u,f,h)&&xn(h)!==Ie)}(u,c,h)?{segmentGroup:new _e(f,hi(h,new _e(c,u.children))),slicedSegments:[]}:0===c.length&&function Yi(u,f,c){return c.some(h=>pi(u,f,h))}(u,c,h)?{segmentGroup:new _e(u.segments,Zi(u,c,h,u.children)),slicedSegments:c}:{segmentGroup:new _e(u.segments,u.children),slicedSegments:c}}function Zi(u,f,c,h){const m={};for(const C of c)if(pi(u,f,C)&&!h[xn(C)]){const M=new _e([],{});m[xn(C)]=M}return{...h,...m}}function hi(u,f){const c={};c[Ie]=f;for(const h of u)if(""===h.path&&xn(h)!==Ie){const m=new _e([],{});c[xn(h)]=m}return c}function pi(u,f,c){return(!(u.hasChildren()||f.length>0)||"full"!==c.pathMatch)&&""===c.path}class va{}class gi{constructor(f,c,h,m,C,M,L){this.injector=f,this.configLoader=c,this.rootComponentType=h,this.config=m,this.urlTree=C,this.paramsInheritanceStrategy=M,this.urlSerializer=L,this.applyRedirects=new oo(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(f){return new I.wOt(4002,`'${f.segmentGroup}'`)}recognize(){const f=io(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(f).pipe((0,ee.T)(c=>{const h=new Oe([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},Ie,this.rootComponentType,null,{}),m=new pn(h,c),C=new bo("",m),M=function vo(u,f,c=null,h=null){return yo(to(u),f,c,h)}(h,[],this.urlTree.queryParams,this.urlTree.fragment);return M.queryParams=this.urlTree.queryParams,C.url=this.urlSerializer.serialize(M),this.inheritParamsAndData(C._root,null),{state:C,tree:M}}))}match(f){return this.processSegmentGroup(this.injector,this.config,f,Ie).pipe($(h=>{if(h instanceof Ot)return this.urlTree=h.urlTree,this.match(h.urlTree.root);throw h instanceof Rt?this.noMatchError(h):h}))}inheritParamsAndData(f,c){const h=f.value,m=Ar(h,c,this.paramsInheritanceStrategy);h.params=Object.freeze(m.params),h.data=Object.freeze(m.data),f.children.forEach(C=>this.inheritParamsAndData(C,h))}processSegmentGroup(f,c,h,m){return 0===h.segments.length&&h.hasChildren()?this.processChildren(f,c,h):this.processSegment(f,c,h,h.segments,m,!0).pipe((0,ee.T)(C=>C instanceof pn?[C]:[]))}processChildren(f,c,h){const m=[];for(const C of Object.keys(h.children))"primary"===C?m.unshift(C):m.push(C);return(0,te.H)(m).pipe(V(C=>{const M=h.children[C],L=function ci(u,f){const c=u.filter(h=>xn(h)===f);return c.push(...u.filter(h=>xn(h)!==f)),c}(c,C);return this.processSegmentGroup(f,L,M,C)}),function re(u,f){return(0,ze.N)(function ue(u,f,c,h,m){return(C,M)=>{let L=c,P=f,he=0;C.subscribe((0,ce._)(M,je=>{const Ke=he++;P=L?u(P,je,Ke):(L=!0,je),h&&M.next(P)},m&&(()=>{L&&M.next(P),M.complete()})))}}(u,f,arguments.length>=2,!0))}((C,M)=>(C.push(...M),C)),Yn(null),function it(u,f){const c=arguments.length>=2;return h=>h.pipe(u?(0,Zt.p)((m,C)=>u(m,C,h)):Zr.D,be(1),c?Yn(f):or(()=>new ie))}(),(0,_t.Z)(C=>{if(null===C)return $t(h);const M=vi(C);return function mi(u){u.sort((f,c)=>f.value.outlet===Ie?-1:c.value.outlet===Ie?1:f.value.outlet.localeCompare(c.value.outlet))}(M),Y(M)}))}processSegment(f,c,h,m,C,M){return(0,te.H)(c).pipe(V(L=>this.processSegmentAgainstRoute(L._injector??f,c,L,h,m,C,M).pipe($(P=>{if(P instanceof Rt)return Y(null);throw P}))),j(L=>!!L),$(L=>{if(pt(L))return function ma(u,f,c){return 0===f.length&&!u.children[c]}(h,m,C)?Y(new va):$t(h);throw L}))}processSegmentAgainstRoute(f,c,h,m,C,M,L){return function Xi(u,f,c,h){return!!(xn(u)===h||h!==Ie&&pi(f,c,u))&&Lr(f,u,c).matched}(h,m,C,M)?void 0===h.redirectTo?this.matchSegmentAgainstRoute(f,m,h,C,M):this.allowRedirects&&L?this.expandSegmentAgainstRouteUsingRedirect(f,m,c,h,C,M):$t(m):$t(m)}expandSegmentAgainstRouteUsingRedirect(f,c,h,m,C,M){const{matched:L,consumedSegments:P,positionalParamSegments:he,remainingSegments:je}=Lr(c,m,C);if(!L)return $t(c);m.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const Ke=this.applyRedirects.applyRedirectCommands(P,m.redirectTo,he);return this.applyRedirects.lineralizeSegments(m,Ke).pipe((0,_t.Z)(Ut=>this.processSegment(f,h,c,Ut.concat(je),M,!1)))}matchSegmentAgainstRoute(f,c,h,m,C){const M=Uu(c,h,m,f);return"**"===h.path&&(c.children={}),M.pipe((0,ve.n)(L=>L.matched?this.getChildConfig(f=h._injector??f,h,m).pipe((0,ve.n)(({routes:P})=>{const he=h._loadedInjector??f,{consumedSegments:je,remainingSegments:Ke,parameters:Ut}=L,Ci=new Oe(je,Ut,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,function Mn(u){return u.data||{}}(h),xn(h),h.component??h._loadedComponent??null,h,function so(u){return u.resolve||{}}(h)),{segmentGroup:Ho,slicedSegments:Bo}=io(c,je,Ke,P);if(0===Bo.length&&Ho.hasChildren())return this.processChildren(he,P,Ho).pipe((0,ee.T)(yr=>null===yr?null:new pn(Ci,yr)));if(0===P.length&&0===Bo.length)return Y(new pn(Ci,[]));const Sa=xn(h)===C;return this.processSegment(he,P,Ho,Bo,Sa?Ie:C,!0).pipe((0,ee.T)(yr=>new pn(Ci,yr instanceof pn?[yr]:[])))})):$t(c)))}getChildConfig(f,c,h){return c.children?Y({routes:c.children,injector:f}):c.loadChildren?void 0!==c._loadedRoutes?Y({routes:c._loadedRoutes,injector:c._loadedInjector}):function pa(u,f,c,h){const m=f.canLoad;return void 0===m||0===m.length?Y(!0):Y(m.map(M=>{const L=$n(M,u);return kt(function _n(u){return u&&xo(u.canLoad)}(L)?L.canLoad(f,c):(0,I.N4e)(u,()=>L(f,c)))})).pipe(Fr(),Po())}(f,c,h).pipe((0,_t.Z)(m=>m?this.configLoader.loadChildren(f,c).pipe((0,U.M)(C=>{c._loadedRoutes=C.routes,c._loadedInjector=C.injector})):function fi(u){return Be(ro(!1,ln.GuardRejected))}())):Y({routes:[],injector:f})}}function Da(u){const f=u.value.routeConfig;return f&&""===f.path}function vi(u){const f=[],c=new Set;for(const h of u){if(!Da(h)){f.push(h);continue}const m=f.find(C=>h.value.routeConfig===C.value.routeConfig);void 0!==m?(m.children.push(...h.children),c.add(m)):f.push(h)}for(const h of c){const m=vi(h.children);f.push(new pn(h.value,m))}return f.filter(h=>!c.has(h))}function Ca(u){const f=u.children.map(c=>Ca(c)).flat();return[u,...f]}function es(u){return(0,ve.n)(f=>{const c=u(f);return c?(0,te.H)(c).pipe((0,ee.T)(()=>f)):Y(f)})}let wa=(()=>{class u{buildTitle(c){let h,m=c.root;for(;void 0!==m;)h=this.getResolvedTitleForRoute(m)??h,m=m.children.find(C=>C.outlet===Ie);return h}getResolvedTitleForRoute(c){return c.data[Bt]}static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:()=>(0,I.WQX)(ts),providedIn:"root"})}return u})(),ts=(()=>{class u extends wa{constructor(c){super(),this.title=c}updateTitle(c){const h=this.buildTitle(c);void 0!==h&&this.title.setTitle(h)}static#e=this.\u0275fac=function(h){return new(h||u)(I.KVO(ct.hE))};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();const Sn=new I.nKC("",{providedIn:"root",factory:()=>({})}),kr=new I.nKC("");let uo=(()=>{class u{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=(0,I.WQX)(I.Ql9)}loadComponent(c){if(this.componentLoaders.get(c))return this.componentLoaders.get(c);if(c._loadedComponent)return Y(c._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(c);const h=kt(c.loadComponent()).pipe((0,ee.T)(p),(0,U.M)(C=>{this.onLoadEndListener&&this.onLoadEndListener(c),c._loadedComponent=C}),Ne(()=>{this.componentLoaders.delete(c)})),m=new Ce(h,()=>new Ae.B).pipe(ae());return this.componentLoaders.set(c,m),m}loadChildren(c,h){if(this.childrenLoaders.get(h))return this.childrenLoaders.get(h);if(h._loadedRoutes)return Y({routes:h._loadedRoutes,injector:h._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(h);const C=function d(u,f,c,h){return kt(u.loadChildren()).pipe((0,ee.T)(p),(0,_t.Z)(m=>m instanceof I.Co$||Array.isArray(m)?Y(m):(0,te.H)(f.compileModuleAsync(m))),(0,ee.T)(m=>{h&&h(u);let C,M,L=!1;return Array.isArray(m)?(M=m,!0):(C=m.create(c).injector,M=C.get(kr,[],{optional:!0,self:!0}).flat()),{routes:M.map(er),injector:C}}))}(h,this.compiler,c,this.onLoadEndListener).pipe(Ne(()=>{this.childrenLoaders.delete(h)})),M=new Ce(C,()=>new Ae.B).pipe(ae());return this.childrenLoaders.set(h,M),M}static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();function p(u){return function D(u){return u&&"object"==typeof u&&"default"in u}(u)?u.default:u}let v=(()=>{class u{static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:()=>(0,I.WQX)(_),providedIn:"root"})}return u})(),_=(()=>{class u{shouldProcessUrl(c){return!0}extract(c){return c}merge(c,h){return c}static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();const k=new I.nKC(""),K=new I.nKC("");function me(u,f,c){const h=u.get(K),m=u.get(fe.qQ);return u.get(I.SKi).runOutsideAngular(()=>{if(!m.startViewTransition||h.skipNextTransition)return h.skipNextTransition=!1,new Promise(he=>setTimeout(he));let C;const M=new Promise(he=>{C=he}),L=m.startViewTransition(()=>(C(),function vt(u){return new Promise(f=>{(0,I.mal)(f,{injector:u})})}(u))),{onViewTransitionCreated:P}=h;return P&&(0,I.N4e)(u,()=>P({transition:L,from:f,to:c})),M})}let st=(()=>{class u{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Ae.B,this.transitionAbortSubject=new Ae.B,this.configLoader=(0,I.WQX)(uo),this.environmentInjector=(0,I.WQX)(I.uvJ),this.urlSerializer=(0,I.WQX)(Ir),this.rootContexts=(0,I.WQX)(Jn),this.location=(0,I.WQX)(fe.aZ),this.inputBindingEnabled=null!==(0,I.WQX)(No,{optional:!0}),this.titleStrategy=(0,I.WQX)(wa),this.options=(0,I.WQX)(Sn,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=(0,I.WQX)(v),this.createViewTransition=(0,I.WQX)(k,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>Y(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=m=>this.events.next(new Jo(m)),this.configLoader.onLoadStartListener=m=>this.events.next(new ea(m))}complete(){this.transitions?.complete()}handleNavigationRequest(c){const h=++this.navigationId;this.transitions?.next({...this.transitions.value,...c,id:h})}setupNavigations(c,h,m){return this.transitions=new ne.t({id:0,currentUrlTree:h,currentRawUrl:h,extractedUrl:this.urlHandlingStrategy.extract(h),urlAfterRedirects:this.urlHandlingStrategy.extract(h),rawUrl:h,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:_o,restoredState:null,currentSnapshot:m.snapshot,targetSnapshot:null,currentRouterState:m,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe((0,Zt.p)(C=>0!==C.id),(0,ee.T)(C=>({...C,extractedUrl:this.urlHandlingStrategy.extract(C.rawUrl)})),(0,ve.n)(C=>{let M=!1,L=!1;return Y(C).pipe((0,ve.n)(P=>{if(this.navigationId>C.id)return this.cancelNavigationTransition(C,"",ln.SupersededByNewNavigation),we.w;this.currentTransition=C,this.currentNavigation={id:P.id,initialUrl:P.rawUrl,extractedUrl:P.extractedUrl,trigger:P.source,extras:P.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const he=!c.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!he&&"reload"!==(P.extras.onSameUrlNavigation??c.onSameUrlNavigation)){const Ke="";return this.events.next(new dr(P.id,this.urlSerializer.serialize(P.rawUrl),Ke,En.IgnoredSameUrlNavigation)),P.resolve(null),we.w}if(this.urlHandlingStrategy.shouldProcessUrl(P.rawUrl))return Y(P).pipe((0,ve.n)(Ke=>{const Ut=this.transitions?.getValue();return this.events.next(new Tr(Ke.id,this.urlSerializer.serialize(Ke.extractedUrl),Ke.source,Ke.restoredState)),Ut!==this.transitions?.getValue()?we.w:Promise.resolve(Ke)}),function Ji(u,f,c,h,m,C){return(0,_t.Z)(M=>function mr(u,f,c,h,m,C,M="emptyOnly"){return new gi(u,f,c,h,m,M,C).recognize()}(u,f,c,h,M.extractedUrl,m,C).pipe((0,ee.T)(({state:L,tree:P})=>({...M,targetSnapshot:L,urlAfterRedirects:P}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,c.config,this.urlSerializer,this.paramsInheritanceStrategy),(0,U.M)(Ke=>{C.targetSnapshot=Ke.targetSnapshot,C.urlAfterRedirects=Ke.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:Ke.urlAfterRedirects};const Ut=new tt(Ke.id,this.urlSerializer.serialize(Ke.extractedUrl),this.urlSerializer.serialize(Ke.urlAfterRedirects),Ke.targetSnapshot);this.events.next(Ut)}));if(he&&this.urlHandlingStrategy.shouldProcessUrl(P.currentRawUrl)){const{id:Ke,extractedUrl:Ut,source:Ci,restoredState:Ho,extras:Bo}=P,Sa=new Tr(Ke,this.urlSerializer.serialize(Ut),Ci,Ho);this.events.next(Sa);const yr=Hn(this.rootComponentType).snapshot;return this.currentTransition=C={...P,targetSnapshot:yr,urlAfterRedirects:Ut,extras:{...Bo,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=Ut,Y(C)}{const Ke="";return this.events.next(new dr(P.id,this.urlSerializer.serialize(P.extractedUrl),Ke,En.IgnoredByUrlHandlingStrategy)),P.resolve(null),we.w}}),(0,U.M)(P=>{const he=new ml(P.id,this.urlSerializer.serialize(P.extractedUrl),this.urlSerializer.serialize(P.urlAfterRedirects),P.targetSnapshot);this.events.next(he)}),(0,ee.T)(P=>(this.currentTransition=C={...P,guards:zi(P.targetSnapshot,P.currentSnapshot,this.rootContexts)},C)),function Lu(u,f){return(0,_t.Z)(c=>{const{targetSnapshot:h,currentSnapshot:m,guards:{canActivateChecks:C,canDeactivateChecks:M}}=c;return 0===M.length&&0===C.length?Y({...c,guardsResult:!0}):function ku(u,f,c,h){return(0,te.H)(u).pipe((0,_t.Z)(m=>function ha(u,f,c,h,m){const C=f&&f.routeConfig?f.routeConfig.canDeactivate:null;return C&&0!==C.length?Y(C.map(L=>{const P=tr(f)??m,he=$n(L,P);return kt(function Gi(u){return u&&xo(u.canDeactivate)}(he)?he.canDeactivate(u,f,c,h):(0,I.N4e)(P,()=>he(u,f,c,h))).pipe(j())})).pipe(Fr()):Y(!0)}(m.component,m.route,c,f,h)),j(m=>!0!==m,!0))}(M,h,m,u).pipe((0,_t.Z)(L=>L&&function aa(u){return"boolean"==typeof u}(L)?function ju(u,f,c,h){return(0,te.H)(f).pipe(V(m=>(0,ye.x)(function Vu(u,f){return null!==u&&f&&f(new Ze(u)),Y(!0)}(m.route.parent,h),function da(u,f){return null!==u&&f&&f(new ki(u)),Y(!0)}(m.route,h),function Ki(u,f,c){const h=f[f.length-1],C=f.slice(0,f.length-1).reverse().map(M=>function ia(u){const f=u.routeConfig?u.routeConfig.canActivateChild:null;return f&&0!==f.length?{node:u,guards:f}:null}(M)).filter(M=>null!==M).map(M=>Ee(()=>Y(M.guards.map(P=>{const he=tr(M.node)??c,je=$n(P,he);return kt(function ca(u){return u&&xo(u.canActivateChild)}(je)?je.canActivateChild(h,u):(0,I.N4e)(he,()=>je(h,u))).pipe(j())})).pipe(Fr())));return Y(C).pipe(Fr())}(u,m.path,c),function fa(u,f,c){const h=f.routeConfig?f.routeConfig.canActivate:null;if(!h||0===h.length)return Y(!0);const m=h.map(C=>Ee(()=>{const M=tr(f)??c,L=$n(C,M);return kt(function ua(u){return u&&xo(u.canActivate)}(L)?L.canActivate(f,u):(0,I.N4e)(M,()=>L(f,u))).pipe(j())}));return Y(m).pipe(Fr())}(u,m.route,c))),j(m=>!0!==m,!0))}(h,C,u,f):Y(L)),(0,ee.T)(L=>({...c,guardsResult:L})))})}(this.environmentInjector,P=>this.events.next(P)),(0,U.M)(P=>{if(C.guardsResult=P.guardsResult,eo(P.guardsResult))throw ai(0,P.guardsResult);const he=new In(P.id,this.urlSerializer.serialize(P.extractedUrl),this.urlSerializer.serialize(P.urlAfterRedirects),P.targetSnapshot,!!P.guardsResult);this.events.next(he)}),(0,Zt.p)(P=>!!P.guardsResult||(this.cancelNavigationTransition(P,"",ln.GuardRejected),!1)),es(P=>{if(P.guards.canActivateChecks.length)return Y(P).pipe((0,U.M)(he=>{const je=new Js(he.id,this.urlSerializer.serialize(he.extractedUrl),this.urlSerializer.serialize(he.urlAfterRedirects),he.targetSnapshot);this.events.next(je)}),(0,ve.n)(he=>{let je=!1;return Y(he).pipe(function Hu(u,f){return(0,_t.Z)(c=>{const{targetSnapshot:h,guards:{canActivateChecks:m}}=c;if(!m.length)return Y(c);const C=new Set(m.map(P=>P.route)),M=new Set;for(const P of C)if(!M.has(P))for(const he of Ca(P))M.add(he);let L=0;return(0,te.H)(M).pipe(V(P=>C.has(P)?function Ea(u,f,c,h){const m=u.routeConfig,C=u._resolve;return void 0!==m?.title&&!Hi(m)&&(C[Bt]=m.title),function ao(u,f,c,h){const m=sr(u);if(0===m.length)return Y({});const C={};return(0,te.H)(m).pipe((0,_t.Z)(M=>function Bu(u,f,c,h){const m=tr(f)??h,C=$n(u,m);return kt(C.resolve?C.resolve(f,c):(0,I.N4e)(m,()=>C(f,c)))}(u[M],f,c,h).pipe(j(),(0,U.M)(L=>{C[M]=L}))),be(1),function Ht(u){return(0,ee.T)(()=>u)}(C),$(M=>pt(M)?we.w:Be(M)))}(C,u,f,h).pipe((0,ee.T)(M=>(u._resolvedData=M,u.data=Ar(u,u.parent,c).resolve,null)))}(P,h,u,f):(P.data=Ar(P,P.parent,u).resolve,Y(void 0))),(0,U.M)(()=>L++),be(1),(0,_t.Z)(P=>L===M.size?Y(c):we.w))})}(this.paramsInheritanceStrategy,this.environmentInjector),(0,U.M)({next:()=>je=!0,complete:()=>{je||this.cancelNavigationTransition(he,"",ln.NoDataFromResolver)}}))}),(0,U.M)(he=>{const je=new Ou(he.id,this.urlSerializer.serialize(he.extractedUrl),this.urlSerializer.serialize(he.urlAfterRedirects),he.targetSnapshot);this.events.next(je)}))}),es(P=>{const he=je=>{const Ke=[];je.routeConfig?.loadComponent&&!je.routeConfig._loadedComponent&&Ke.push(this.configLoader.loadComponent(je.routeConfig).pipe((0,U.M)(Ut=>{je.component=Ut}),(0,ee.T)(()=>{})));for(const Ut of je.children)Ke.push(...he(Ut));return Ke};return(0,q.z)(he(P.targetSnapshot.root)).pipe(Yn(null),(0,Fe.s)(1))}),es(()=>this.afterPreactivation()),(0,ve.n)(()=>{const{currentSnapshot:P,targetSnapshot:he}=C,je=this.createViewTransition?.(this.environmentInjector,P.root,he.root);return je?(0,te.H)(je).pipe((0,ee.T)(()=>C)):Y(C)}),(0,ee.T)(P=>{const he=function xu(u,f,c){const h=Rn(u,f._root,c?c._root:void 0);return new oi(h,f)}(c.routeReuseStrategy,P.targetSnapshot,P.currentRouterState);return this.currentTransition=C={...P,targetRouterState:he},this.currentNavigation.targetRouterState=he,C}),(0,U.M)(()=>{this.events.next(new ji)}),((u,f,c,h)=>(0,ee.T)(m=>(new gr(f,m.targetRouterState,m.currentRouterState,c,h).activate(u),m)))(this.rootContexts,c.routeReuseStrategy,P=>this.events.next(P),this.inputBindingEnabled),(0,Fe.s)(1),(0,U.M)({next:P=>{M=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Cn(P.id,this.urlSerializer.serialize(P.extractedUrl),this.urlSerializer.serialize(P.urlAfterRedirects))),this.titleStrategy?.updateTitle(P.targetRouterState.snapshot),P.resolve(!0)},complete:()=>{M=!0}}),function Lt(u){return(0,ze.N)((f,c)=>{(0,le.Tg)(u).subscribe((0,ce._)(c,()=>c.complete(),Dt.l)),!c.closed&&f.subscribe(c)})}(this.transitionAbortSubject.pipe((0,U.M)(P=>{throw P}))),Ne(()=>{!M&&!L&&this.cancelNavigationTransition(C,"",ln.SupersededByNewNavigation),this.currentTransition?.id===C.id&&(this.currentNavigation=null,this.currentTransition=null)}),$(P=>{if(L=!0,ui(P))this.events.next(new wn(C.id,this.urlSerializer.serialize(C.extractedUrl),P.message,P.cancellationCode)),function hr(u){return ui(u)&&eo(u.url)}(P)?this.events.next(new Vi(P.url)):C.resolve(!1);else{this.events.next(new Re(C.id,this.urlSerializer.serialize(C.extractedUrl),P,C.targetSnapshot??void 0));try{C.resolve(c.errorHandler(P))}catch(he){this.options.resolveNavigationPromiseOnError?C.resolve(!1):C.reject(he)}}return we.w}))}))}cancelNavigationTransition(c,h,m){const C=new wn(c.id,this.urlSerializer.serialize(c.extractedUrl),h,m);this.events.next(C),c.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(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();function gt(u){return u!==_o}let qe=(()=>{class u{static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:()=>(0,I.WQX)(at),providedIn:"root"})}return u})();class bt{shouldDetach(f){return!1}store(f,c){}shouldAttach(f){return!1}retrieve(f){return null}shouldReuseRoute(f,c){return f.routeConfig===c.routeConfig}}let at=(()=>{class u extends bt{static#e=this.\u0275fac=(()=>{let c;return function(m){return(c||(c=I.xGo(u)))(m||u)}})();static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})(),Tt=(()=>{class u{static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:()=>(0,I.WQX)(ot),providedIn:"root"})}return u})(),ot=(()=>{class u extends Tt{constructor(){super(...arguments),this.location=(0,I.WQX)(fe.aZ),this.urlSerializer=(0,I.WQX)(Ir),this.options=(0,I.WQX)(Sn,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=(0,I.WQX)(v),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new Dn,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=Hn(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(c){return this.location.subscribe(h=>{"popstate"===h.type&&c(h.url,h.state)})}handleRouterEvent(c,h){if(c instanceof Tr)this.stateMemento=this.createStateMemento();else if(c instanceof dr)this.rawUrlTree=h.initialUrl;else if(c instanceof tt){if("eager"===this.urlUpdateStrategy&&!h.extras.skipLocationChange){const m=this.urlHandlingStrategy.merge(h.finalUrl,h.initialUrl);this.setBrowserUrl(m,h)}}else c instanceof ji?(this.currentUrlTree=h.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(h.finalUrl,h.initialUrl),this.routerState=h.targetRouterState,"deferred"===this.urlUpdateStrategy&&(h.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,h))):c instanceof wn&&(c.code===ln.GuardRejected||c.code===ln.NoDataFromResolver)?this.restoreHistory(h):c instanceof Re?this.restoreHistory(h,!0):c instanceof Cn&&(this.lastSuccessfulId=c.id,this.currentPageId=this.browserPageId)}setBrowserUrl(c,h){const m=this.urlSerializer.serialize(c);if(this.location.isCurrentPathEqualTo(m)||h.extras.replaceUrl){const M={...h.extras.state,...this.generateNgRouterState(h.id,this.browserPageId)};this.location.replaceState(m,"",M)}else{const C={...h.extras.state,...this.generateNgRouterState(h.id,this.browserPageId+1)};this.location.go(m,"",C)}}restoreHistory(c,h=!1){if("computed"===this.canceledNavigationResolution){const C=this.currentPageId-this.browserPageId;0!==C?this.location.historyGo(C):this.currentUrlTree===c.finalUrl&&0===C&&(this.resetState(c),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(h&&this.resetState(c),this.resetUrlToCurrentUrlTree())}resetState(c){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,c.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(c,h){return"computed"===this.canceledNavigationResolution?{navigationId:c,\u0275routerPageId:h}:{navigationId:c}}static#e=this.\u0275fac=(()=>{let c;return function(m){return(c||(c=I.xGo(u)))(m||u)}})();static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();var J=function(u){return u[u.COMPLETE=0]="COMPLETE",u[u.FAILED=1]="FAILED",u[u.REDIRECTING=2]="REDIRECTING",u}(J||{});function De(u,f){u.events.pipe((0,Zt.p)(c=>c instanceof Cn||c instanceof wn||c instanceof Re||c instanceof dr),(0,ee.T)(c=>c instanceof Cn||c instanceof dr?J.COMPLETE:c instanceof wn&&(c.code===ln.Redirect||c.code===ln.SupersededByNewNavigation)?J.REDIRECTING:J.FAILED),(0,Zt.p)(c=>c!==J.REDIRECTING),(0,Fe.s)(1)).subscribe(()=>{f()})}function ft(u){throw u}const zt={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},It={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let ht=(()=>{class u{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=(0,I.WQX)(I.H3F),this.stateManager=(0,I.WQX)(Tt),this.options=(0,I.WQX)(Sn,{optional:!0})||{},this.pendingTasks=(0,I.WQX)(I.TgB),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=(0,I.WQX)(st),this.urlSerializer=(0,I.WQX)(Ir),this.location=(0,I.WQX)(fe.aZ),this.urlHandlingStrategy=(0,I.WQX)(v),this._events=new Ae.B,this.errorHandler=this.options.errorHandler||ft,this.navigated=!1,this.routeReuseStrategy=(0,I.WQX)(qe),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=(0,I.WQX)(kr,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!(0,I.WQX)(No,{optional:!0}),this.eventsSubscription=new Ue.yU,this.isNgZoneEnabled=(0,I.WQX)(I.SKi)instanceof I.SKi&&I.SKi.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:c=>{this.console.warn(c)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const c=this.navigationTransitions.events.subscribe(h=>{try{const m=this.navigationTransitions.currentTransition,C=this.navigationTransitions.currentNavigation;if(null!==m&&null!==C)if(this.stateManager.handleRouterEvent(h,C),h instanceof wn&&h.code!==ln.Redirect&&h.code!==ln.SupersededByNewNavigation)this.navigated=!0;else if(h instanceof Cn)this.navigated=!0;else if(h instanceof Vi){const M=this.urlHandlingStrategy.merge(h.url,m.currentRawUrl),L={info:m.extras.info,skipLocationChange:m.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||gt(m.source)};this.scheduleNavigation(M,_o,null,L,{resolve:m.resolve,reject:m.reject,promise:m.promise})}(function Ct(u){return!(u instanceof ji||u instanceof Vi)})(h)&&this._events.next(h)}catch(m){this.navigationTransitions.transitionAbortSubject.next(m)}});this.eventsSubscription.add(c)}resetRootComponentType(c){this.routerState.root.component=c,this.navigationTransitions.rootComponentType=c}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),_o,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((c,h)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(c,"popstate",h)},0)})}navigateToSyncWithBrowser(c,h,m){const C={replaceUrl:!0},M=m?.navigationId?m:null;if(m){const P={...m};delete P.navigationId,delete P.\u0275routerPageId,0!==Object.keys(P).length&&(C.state=P)}const L=this.parseUrl(c);this.scheduleNavigation(L,h,M,C)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(c){this.config=c.map(er),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(c,h={}){const{relativeTo:m,queryParams:C,fragment:M,queryParamsHandling:L,preserveFragment:P}=h,he=P?this.currentUrlTree.fragment:M;let Ke,je=null;switch(L){case"merge":je={...this.currentUrlTree.queryParams,...C};break;case"preserve":je=this.currentUrlTree.queryParams;break;default:je=C||null}null!==je&&(je=this.removeEmptyProps(je));try{Ke=to(m?m.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof c[0]||!c[0].startsWith("/"))&&(c=[]),Ke=this.currentUrlTree.root}return yo(Ke,c,je,he??null)}navigateByUrl(c,h={skipLocationChange:!1}){const m=eo(c)?c:this.parseUrl(c),C=this.urlHandlingStrategy.merge(m,this.rawUrlTree);return this.scheduleNavigation(C,_o,null,h)}navigate(c,h={skipLocationChange:!1}){return function nr(u){for(let f=0;f(null!=C&&(h[m]=C),h),{})}scheduleNavigation(c,h,m,C,M){if(this.disposed)return Promise.resolve(!1);let L,P,he;M?(L=M.resolve,P=M.reject,he=M.promise):he=new Promise((Ke,Ut)=>{L=Ke,P=Ut});const je=this.pendingTasks.add();return De(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(je))}),this.navigationTransitions.handleNavigationRequest({source:h,restoredState:m,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:c,extras:C,resolve:L,reject:P,promise:he,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),he.catch(Ke=>Promise.reject(Ke))}static#e=this.\u0275fac=function(h){return new(h||u)};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})(),xt=(()=>{class u{constructor(c,h,m,C,M,L){this.router=c,this.route=h,this.tabIndexAttribute=m,this.renderer=C,this.el=M,this.locationStrategy=L,this.href=null,this.commands=null,this.onChanges=new Ae.B,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;const P=M.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===P||"area"===P,this.isAnchorElement?this.subscription=c.events.subscribe(he=>{he instanceof Cn&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(c){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",c)}ngOnChanges(c){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(c){null!=c?(this.commands=Array.isArray(c)?c:[c],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(c,h,m,C,M){const L=this.urlTree;return!!(null===L||this.isAnchorElement&&(0!==c||h||m||C||M||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(L,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const c=this.urlTree;this.href=null!==c&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(c)):null;const h=null===this.href?null:(0,I.n$t)(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",h)}applyAttributeValue(c,h){const m=this.renderer,C=this.el.nativeElement;null!==h?m.setAttribute(C,c,h):m.removeAttribute(C,c)}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(h){return new(h||u)(I.rXU(ht),I.rXU(Nt),I.kS0("tabindex"),I.rXU(I.sFG),I.rXU(I.aKT),I.rXU(fe.hb))};static#t=this.\u0275dir=I.FsC({type:u,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(h,m){1&h&&I.bIt("click",function(M){return m.onClick(M.button,M.ctrlKey,M.shiftKey,M.altKey,M.metaKey)}),2&h&&I.BMQ("target",m.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[I.Mj6.HasDecoratorInputTransform,"preserveFragment","preserveFragment",I.L39],skipLocationChange:[I.Mj6.HasDecoratorInputTransform,"skipLocationChange","skipLocationChange",I.L39],replaceUrl:[I.Mj6.HasDecoratorInputTransform,"replaceUrl","replaceUrl",I.L39],routerLink:"routerLink"},standalone:!0,features:[I.GFd,I.OA$]})}return u})();class Fo{}let Pt=(()=>{class u{constructor(c,h,m,C,M){this.router=c,this.injector=m,this.preloadingStrategy=C,this.loader=M}setUpPreloading(){this.subscription=this.router.events.pipe((0,Zt.p)(c=>c instanceof Cn),V(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(c,h){const m=[];for(const C of h){C.providers&&!C._injector&&(C._injector=(0,I.Ol2)(C.providers,c,`Route: ${C.path}`));const M=C._injector??c,L=C._loadedInjector??M;(C.loadChildren&&!C._loadedRoutes&&void 0===C.canLoad||C.loadComponent&&!C._loadedComponent)&&m.push(this.preloadConfig(M,C)),(C.children||C._loadedRoutes)&&m.push(this.processRoutes(L,C.children??C._loadedRoutes))}return(0,te.H)(m).pipe((0,Yt.U)())}preloadConfig(c,h){return this.preloadingStrategy.preload(h,()=>{let m;m=h.loadChildren&&void 0===h.canLoad?this.loader.loadChildren(c,h):Y(null);const C=m.pipe((0,_t.Z)(M=>null===M?Y(void 0):(h._loadedRoutes=M.routes,h._loadedInjector=M.injector,this.processRoutes(M.injector??c,M.routes))));if(h.loadComponent&&!h._loadedComponent){const M=this.loader.loadComponent(h);return(0,te.H)([C,M]).pipe((0,Yt.U)())}return C})}static#e=this.\u0275fac=function(h){return new(h||u)(I.KVO(ht),I.KVO(I.Ql9),I.KVO(I.uvJ),I.KVO(Fo),I.KVO(uo))};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();const co=new I.nKC("");let lo=(()=>{class u{constructor(c,h,m,C,M={}){this.urlSerializer=c,this.transitions=h,this.viewportScroller=m,this.zone=C,this.options=M,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},this.environmentInjector=(0,I.WQX)(I.uvJ),M.scrollPositionRestoration||="disabled",M.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(c=>{c instanceof Tr?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=c.navigationTrigger,this.restoredId=c.restoredState?c.restoredState.navigationId:0):c instanceof Cn?(this.lastId=c.id,this.scheduleScrollEvent(c,this.urlSerializer.parse(c.urlAfterRedirects).fragment)):c instanceof dr&&c.code===En.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(c,this.urlSerializer.parse(c.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(c=>{c instanceof ti&&(c.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(c.position):c.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(c.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(c,h){var m=this;this.zone.runOutsideAngular((0,E.A)(function*(){yield new Promise(C=>{setTimeout(()=>{C()}),(0,I.mal)(()=>{C()},{injector:m.environmentInjector})}),m.zone.run(()=>{m.transitions.events.next(new ti(c,"popstate"===m.lastSource?m.store[m.restoredId]:null,h))})}))}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static#e=this.\u0275fac=function(h){I.QTQ()};static#t=this.\u0275prov=I.jDH({token:u,factory:u.\u0275fac})}return u})();function vr(u,...f){return(0,I.EmA)([{provide:kr,multi:!0,useValue:u},[],{provide:Nt,useFactory:Lo,deps:[ht]},{provide:I.iLQ,multi:!0,useFactory:ns},f.map(c=>c.\u0275providers)])}function Lo(u){return u.routerState.root}function Wn(u,f){return{\u0275kind:u,\u0275providers:f}}function ns(){const u=(0,I.WQX)(I.zZn);return f=>{const c=u.get(I.o8S);if(f!==c.components[0])return;const h=u.get(ht),m=u.get(jo);1===u.get(Pn)&&h.initialNavigation(),u.get(os,null,I.$GK.Optional)?.setUpPreloading(),u.get(co,null,I.$GK.Optional)?.init(),h.resetRootComponentType(c.componentTypes[0]),m.closed||(m.next(),m.complete(),m.unsubscribe())}}const jo=new I.nKC("",{factory:()=>new Ae.B}),Pn=new I.nKC("",{providedIn:"root",factory:()=>1}),os=new I.nKC("");function cn(u){return Wn(0,[{provide:os,useExisting:Pt},{provide:Fo,useExisting:u}])}function Gn(u){return Wn(9,[{provide:k,useValue:me},{provide:K,useValue:{skipNextTransition:!!u?.skipInitialTransition,...u}}])}const Wu=new I.nKC("ROUTER_FORROOT_GUARD"),Dl=[fe.aZ,{provide:Ir,useClass:Jr},ht,Jn,{provide:Nt,useFactory:Lo,deps:[ht]},uo,[]];let _a=(()=>{class u{constructor(c){}static forRoot(c,h){return{ngModule:u,providers:[Dl,[],{provide:kr,multi:!0,useValue:c},{provide:Wu,useFactory:gh,deps:[[ht,new I.Xx1,new I.kdw]]},{provide:Sn,useValue:h||{}},h?.useHash?{provide:fe.hb,useClass:fe.fw}:{provide:fe.hb,useClass:fe.Sm},{provide:co,useFactory:()=>{const u=(0,I.WQX)(fe.Xr),f=(0,I.WQX)(I.SKi),c=(0,I.WQX)(Sn),h=(0,I.WQX)(st),m=(0,I.WQX)(Ir);return c.scrollOffset&&u.setOffset(c.scrollOffset),new lo(m,h,u,f,c)}},h?.preloadingStrategy?cn(h.preloadingStrategy).\u0275providers:[],h?.initialNavigation?mh(h):[],h?.bindToComponentInputs?Wn(8,[Ro,{provide:No,useExisting:Ro}]).\u0275providers:[],h?.enableViewTransitions?Gn().\u0275providers:[],[{provide:El,useFactory:ns},{provide:I.iLQ,multi:!0,useExisting:El}]]}}static forChild(c){return{ngModule:u,providers:[{provide:kr,multi:!0,useValue:c}]}}static#e=this.\u0275fac=function(h){return new(h||u)(I.KVO(Wu,8))};static#t=this.\u0275mod=I.$C({type:u});static#n=this.\u0275inj=I.G2t({})}return u})();function gh(u){return"guarded"}function mh(u){return["disabled"===u.initialNavigation?Wn(3,[{provide:I.hnV,multi:!0,useFactory:()=>{const f=(0,I.WQX)(ht);return()=>{f.setUpLocationChangeListener()}}},{provide:Pn,useValue:2}]).\u0275providers:[],"enabledBlocking"===u.initialNavigation?Wn(2,[{provide:Pn,useValue:0},{provide:I.hnV,multi:!0,deps:[I.zZn],useFactory:f=>{const c=f.get(fe.hj,Promise.resolve());return()=>c.then(()=>new Promise(h=>{const m=f.get(ht),C=f.get(jo);De(m,()=>{h(!0)}),f.get(st).afterPreactivation=()=>(h(!0),C.closed?Y(void 0):C),m.initialNavigation()}))}}]).\u0275providers:[]]}const El=new I.nKC("")},467:(Te,oe,S)=>{function E(W,N,G,te,Q,Y,ne){try{var q=W[Y](ne),H=q.value}catch(ie){return void G(ie)}q.done?N(H):Promise.resolve(H).then(te,Q)}function I(W){return function(){var N=this,G=arguments;return new Promise(function(te,Q){var Y=W.apply(N,G);function ne(H){E(Y,te,Q,ne,q,"next",H)}function q(H){E(Y,te,Q,ne,q,"throw",H)}ne(void 0)})}}S.d(oe,{A:()=>I})},1635:(Te,oe,S)=>{function ie(j,V,U,$){return new(U||(U=Promise))(function(re,be){function it(Dt){try{Ne($.next(Dt))}catch(Lt){be(Lt)}}function Ht(Dt){try{Ne($.throw(Dt))}catch(Lt){be(Lt)}}function Ne(Dt){Dt.done?re(Dt.value):function ue(re){return re instanceof U?re:new U(function(be){be(re)})}(Dt.value).then(it,Ht)}Ne(($=$.apply(j,V||[])).next())})}function ce(j){return this instanceof ce?(this.v=j,this):new ce(j)}function ae(j,V,U){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var ue,$=U.apply(j,V||[]),re=[];return ue={},it("next"),it("throw"),it("return",function be(ct){return function(Ie){return Promise.resolve(Ie).then(ct,Lt)}}),ue[Symbol.asyncIterator]=function(){return this},ue;function it(ct,Ie){$[ct]&&(ue[ct]=function(Bt){return new Promise(function(Mt,Ft){re.push([ct,Bt,Mt,Ft])>1||Ht(ct,Bt)})},Ie&&(ue[ct]=Ie(ue[ct])))}function Ht(ct,Ie){try{!function Ne(ct){ct.value instanceof ce?Promise.resolve(ct.value.v).then(Dt,Lt):Yt(re[0][2],ct)}($[ct](Ie))}catch(Bt){Yt(re[0][3],Bt)}}function Dt(ct){Ht("next",ct)}function Lt(ct){Ht("throw",ct)}function Yt(ct,Ie){ct(Ie),re.shift(),re.length&&Ht(re[0][0],re[0][1])}}function Ae(j){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var U,V=j[Symbol.asyncIterator];return V?V.call(j):(j=function Je(j){var V="function"==typeof Symbol&&Symbol.iterator,U=V&&j[V],$=0;if(U)return U.call(j);if(j&&"number"==typeof j.length)return{next:function(){return j&&$>=j.length&&(j=void 0),{value:j&&j[$++],done:!j}}};throw new TypeError(V?"Object is not iterable.":"Symbol.iterator is not defined.")}(j),U={},$("next"),$("throw"),$("return"),U[Symbol.asyncIterator]=function(){return this},U);function $(re){U[re]=j[re]&&function(be){return new Promise(function(it,Ht){!function ue(re,be,it,Ht){Promise.resolve(Ht).then(function(Ne){re({value:Ne,done:it})},be)}(it,Ht,(be=j[re](be)).done,be.value)})}}}S.d(oe,{AQ:()=>ae,N3:()=>ce,sH:()=>ie,xN:()=>Ae}),"function"==typeof SuppressedError&&SuppressedError}},Te=>{Te(Te.s=1678)}]); \ No newline at end of file diff --git a/docs/bootstrap-icons.70a9dee9e5ab72aa.woff b/docs/media/bootstrap-icons-OCU552PF.woff similarity index 100% rename from docs/bootstrap-icons.70a9dee9e5ab72aa.woff rename to docs/media/bootstrap-icons-OCU552PF.woff diff --git a/docs/bootstrap-icons.bfa90bda92a84a6a.woff2 b/docs/media/bootstrap-icons-X6UQXWUS.woff2 similarity index 100% rename from docs/bootstrap-icons.bfa90bda92a84a6a.woff2 rename to docs/media/bootstrap-icons-X6UQXWUS.woff2 diff --git a/docs/dssp-helix.74d0a47e4d7ed27e.svg b/docs/media/dssp-helix-OTIKI7SN.svg similarity index 100% rename from docs/dssp-helix.74d0a47e4d7ed27e.svg rename to docs/media/dssp-helix-OTIKI7SN.svg diff --git a/docs/dssp-strand-head.85a295955fb4c220.svg b/docs/media/dssp-strand-head-QWRJLFK7.svg similarity index 100% rename from docs/dssp-strand-head.85a295955fb4c220.svg rename to docs/media/dssp-strand-head-QWRJLFK7.svg diff --git a/docs/dssp-strand-tail.783864b28823e2c7.svg b/docs/media/dssp-strand-tail-PA4GJMUI.svg similarity index 100% rename from docs/dssp-strand-tail.783864b28823e2c7.svg rename to docs/media/dssp-strand-tail-PA4GJMUI.svg diff --git a/docs/polyfills-6EAL64PA.js b/docs/polyfills-6EAL64PA.js new file mode 100644 index 0000000..f67a2da --- /dev/null +++ b/docs/polyfills-6EAL64PA.js @@ -0,0 +1,2 @@ +var ie=globalThis;function Q(e){return(ie.__Zone_symbol_prefix||"__zone_symbol__")+e}function ft(){let e=ie.performance;function n(j){e&&e.mark&&e.mark(j)}function a(j,r){e&&e.measure&&e.measure(j,r)}n("Zone");let $=class ${static assertZonePatched(){if(ie.Promise!==D.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let r=$.current;for(;r.parent;)r=r.parent;return r}static get current(){return k.zone}static get currentTask(){return S}static __load_patch(r,i,s=!1){if(D.hasOwnProperty(r)){let b=ie[Q("forceDuplicateZoneCheck")]===!0;if(!s&&b)throw Error("Already loaded patch: "+r)}else if(!ie["__Zone_disable_"+r]){let b="Zone:"+r;n(b),D[r]=i(ie,$,w),a(b,b)}}get parent(){return this._parent}get name(){return this._name}constructor(r,i){this._parent=r,this._name=i?i.name||"unnamed":"",this._properties=i&&i.properties||{},this._zoneDelegate=new f(this,this._parent&&this._parent._zoneDelegate,i)}get(r){let i=this.getZoneWith(r);if(i)return i._properties[r]}getZoneWith(r){let i=this;for(;i;){if(i._properties.hasOwnProperty(r))return i;i=i._parent}return null}fork(r){if(!r)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,r)}wrap(r,i){if(typeof r!="function")throw new Error("Expecting function got: "+r);let s=this._zoneDelegate.intercept(this,r,i),b=this;return function(){return b.runGuarded(s,this,arguments,i)}}run(r,i,s,b){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,r,i,s,b)}finally{k=k.parent}}runGuarded(r,i=null,s,b){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,r,i,s,b)}catch(x){if(this._zoneDelegate.handleError(this,x))throw x}}finally{k=k.parent}}runTask(r,i,s){if(r.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(r.zone||te).name+"; Execution: "+this.name+")");if(r.state===X&&(r.type===U||r.type===g))return;let b=r.state!=F;b&&r._transitionTo(F,d),r.runCount++;let x=S;S=r,k={parent:k,zone:this};try{r.type==g&&r.data&&!r.data.isPeriodic&&(r.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,i,s)}catch(M){if(this._zoneDelegate.handleError(this,M))throw M}}finally{r.state!==X&&r.state!==Y&&(r.type==U||r.data&&r.data.isPeriodic?b&&r._transitionTo(d,F):(r.runCount=0,this._updateTaskCount(r,-1),b&&r._transitionTo(X,F,X))),k=k.parent,S=x}}scheduleTask(r){if(r.zone&&r.zone!==this){let s=this;for(;s;){if(s===r.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${r.zone.name}`);s=s.parent}}r._transitionTo(v,X);let i=[];r._zoneDelegates=i,r._zone=this;try{r=this._zoneDelegate.scheduleTask(this,r)}catch(s){throw r._transitionTo(Y,v,X),this._zoneDelegate.handleError(this,s),s}return r._zoneDelegates===i&&this._updateTaskCount(r,1),r.state==v&&r._transitionTo(d,v),r}scheduleMicroTask(r,i,s,b){return this.scheduleTask(new _(B,r,i,s,b,void 0))}scheduleMacroTask(r,i,s,b,x){return this.scheduleTask(new _(g,r,i,s,b,x))}scheduleEventTask(r,i,s,b,x){return this.scheduleTask(new _(U,r,i,s,b,x))}cancelTask(r){if(r.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(r.zone||te).name+"; Execution: "+this.name+")");if(!(r.state!==d&&r.state!==F)){r._transitionTo(q,d,F);try{this._zoneDelegate.cancelTask(this,r)}catch(i){throw r._transitionTo(Y,q),this._zoneDelegate.handleError(this,i),i}return this._updateTaskCount(r,-1),r._transitionTo(X,q),r.runCount=0,r}}_updateTaskCount(r,i){let s=r._zoneDelegates;i==-1&&(r._zoneDelegates=null);for(let b=0;bj.hasTask(i,s),onScheduleTask:(j,r,i,s)=>j.scheduleTask(i,s),onInvokeTask:(j,r,i,s,b,x)=>j.invokeTask(i,s,b,x),onCancelTask:(j,r,i,s)=>j.cancelTask(i,s)};class f{get zone(){return this._zone}constructor(r,i,s){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this._zone=r,this._parentDelegate=i,this._forkZS=s&&(s&&s.onFork?s:i._forkZS),this._forkDlgt=s&&(s.onFork?i:i._forkDlgt),this._forkCurrZone=s&&(s.onFork?this._zone:i._forkCurrZone),this._interceptZS=s&&(s.onIntercept?s:i._interceptZS),this._interceptDlgt=s&&(s.onIntercept?i:i._interceptDlgt),this._interceptCurrZone=s&&(s.onIntercept?this._zone:i._interceptCurrZone),this._invokeZS=s&&(s.onInvoke?s:i._invokeZS),this._invokeDlgt=s&&(s.onInvoke?i:i._invokeDlgt),this._invokeCurrZone=s&&(s.onInvoke?this._zone:i._invokeCurrZone),this._handleErrorZS=s&&(s.onHandleError?s:i._handleErrorZS),this._handleErrorDlgt=s&&(s.onHandleError?i:i._handleErrorDlgt),this._handleErrorCurrZone=s&&(s.onHandleError?this._zone:i._handleErrorCurrZone),this._scheduleTaskZS=s&&(s.onScheduleTask?s:i._scheduleTaskZS),this._scheduleTaskDlgt=s&&(s.onScheduleTask?i:i._scheduleTaskDlgt),this._scheduleTaskCurrZone=s&&(s.onScheduleTask?this._zone:i._scheduleTaskCurrZone),this._invokeTaskZS=s&&(s.onInvokeTask?s:i._invokeTaskZS),this._invokeTaskDlgt=s&&(s.onInvokeTask?i:i._invokeTaskDlgt),this._invokeTaskCurrZone=s&&(s.onInvokeTask?this._zone:i._invokeTaskCurrZone),this._cancelTaskZS=s&&(s.onCancelTask?s:i._cancelTaskZS),this._cancelTaskDlgt=s&&(s.onCancelTask?i:i._cancelTaskDlgt),this._cancelTaskCurrZone=s&&(s.onCancelTask?this._zone:i._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let b=s&&s.onHasTask,x=i&&i._hasTaskZS;(b||x)&&(this._hasTaskZS=b?s:c,this._hasTaskDlgt=i,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,s.onScheduleTask||(this._scheduleTaskZS=c,this._scheduleTaskDlgt=i,this._scheduleTaskCurrZone=this._zone),s.onInvokeTask||(this._invokeTaskZS=c,this._invokeTaskDlgt=i,this._invokeTaskCurrZone=this._zone),s.onCancelTask||(this._cancelTaskZS=c,this._cancelTaskDlgt=i,this._cancelTaskCurrZone=this._zone))}fork(r,i){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,r,i):new t(r,i)}intercept(r,i,s){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,r,i,s):i}invoke(r,i,s,b,x){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,r,i,s,b,x):i.apply(s,b)}handleError(r,i){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,r,i):!0}scheduleTask(r,i){let s=i;if(this._scheduleTaskZS)this._hasTaskZS&&s._zoneDelegates.push(this._hasTaskDlgtOwner),s=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,r,i),s||(s=i);else if(i.scheduleFn)i.scheduleFn(i);else if(i.type==B)W(i);else throw new Error("Task is missing scheduleFn.");return s}invokeTask(r,i,s,b){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,r,i,s,b):i.callback.apply(s,b)}cancelTask(r,i){let s;if(this._cancelTaskZS)s=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,r,i);else{if(!i.cancelFn)throw Error("Task is not cancelable");s=i.cancelFn(i)}return s}hasTask(r,i){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,r,i)}catch(s){this.handleError(r,s)}}_updateTaskCount(r,i){let s=this._taskCounts,b=s[r],x=s[r]=b+i;if(x<0)throw new Error("More tasks executed then were scheduled.");if(b==0||x==0){let M={microTask:s.microTask>0,macroTask:s.macroTask>0,eventTask:s.eventTask>0,change:r};this.hasTask(this._zone,M)}}}class _{constructor(r,i,s,b,x,M){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=r,this.source=i,this.data=b,this.scheduleFn=x,this.cancelFn=M,!s)throw new Error("callback is not defined");this.callback=s;let de=this;r===U&&b&&b.useG?this.invoke=_.invokeTask:this.invoke=function(){return _.invokeTask.call(ie,de,this,arguments)}}static invokeTask(r,i,s){r||(r=this),K++;try{return r.runCount++,r.zone.runTask(r,i,s)}finally{K==1&&A(),K--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(X,v)}_transitionTo(r,i,s){if(this._state===i||this._state===s)this._state=r,r==X&&(this._zoneDelegates=null);else throw new Error(`${this.type} '${this.source}': can not transition to '${r}', expecting state '${i}'${s?" or '"+s+"'":""}, was '${this._state}'.`)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let E=Q("setTimeout"),m=Q("Promise"),C=Q("then"),T=[],I=!1,P;function Z(j){if(P||ie[m]&&(P=ie[m].resolve(0)),P){let r=P[C];r||(r=P.then),r.call(P,j)}else ie[E](j,0)}function W(j){K===0&&T.length===0&&Z(A),j&&T.push(j)}function A(){if(!I){for(I=!0;T.length;){let j=T;T=[];for(let r=0;rk,onUnhandledError:z,microtaskDrainDone:z,scheduleMicroTask:W,showUncaughtError:()=>!t[Q("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:z,patchMethod:()=>z,bindArguments:()=>[],patchThen:()=>z,patchMacroTask:()=>z,patchEventPrototype:()=>z,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>z,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>z,wrapWithCurrentZone:()=>z,filterProperties:()=>[],attachOriginToPatched:()=>z,_redefineProperty:()=>z,patchCallbacks:()=>z,nativeScheduleMicroTask:Z},k={parent:null,zone:new t(null,null)},S=null,K=0;function z(){}return a("Zone","Zone"),t}function ht(){let e=globalThis,n=e[Q("forceDuplicateZoneCheck")]===!0;if(e.Zone&&(n||typeof e.Zone.__symbol__!="function"))throw new Error("Zone already loaded.");return e.Zone??=ft(),e.Zone}var ve=Object.getOwnPropertyDescriptor,Ae=Object.defineProperty,je=Object.getPrototypeOf,dt=Object.create,_t=Array.prototype.slice,He="addEventListener",xe="removeEventListener",Le=Q(He),Ie=Q(xe),ce="true",ae="false",be=Q("");function Ge(e,n){return Zone.current.wrap(e,n)}function Ve(e,n,a,t,c){return Zone.current.scheduleMacroTask(e,n,a,t,c)}var H=Q,Se=typeof window<"u",ye=Se?window:void 0,J=Se&&ye||globalThis,Et="removeAttribute";function Fe(e,n){for(let a=e.length-1;a>=0;a--)typeof e[a]=="function"&&(e[a]=Ge(e[a],n+"_"+a));return e}function Tt(e,n){let a=e.constructor.name;for(let t=0;t{let m=function(){return E.apply(this,Fe(arguments,a+"."+c))};return ue(m,E),m})(f)}}}function Qe(e){return e?e.writable===!1?!1:!(typeof e.get=="function"&&typeof e.set>"u"):!0}var et=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,De=!("nw"in J)&&typeof J.process<"u"&&J.process.toString()==="[object process]",Be=!De&&!et&&!!(Se&&ye.HTMLElement),tt=typeof J.process<"u"&&J.process.toString()==="[object process]"&&!et&&!!(Se&&ye.HTMLElement),Ce={},Ye=function(e){if(e=e||J.event,!e)return;let n=Ce[e.type];n||(n=Ce[e.type]=H("ON_PROPERTY"+e.type));let a=this||e.target||J,t=a[n],c;if(Be&&a===ye&&e.type==="error"){let f=e;c=t&&t.call(this,f.message,f.filename,f.lineno,f.colno,f.error),c===!0&&e.preventDefault()}else c=t&&t.apply(this,arguments),c!=null&&!c&&e.preventDefault();return c};function $e(e,n,a){let t=ve(e,n);if(!t&&a&&ve(a,n)&&(t={enumerable:!0,configurable:!0}),!t||!t.configurable)return;let c=H("on"+n+"patched");if(e.hasOwnProperty(c)&&e[c])return;delete t.writable,delete t.value;let f=t.get,_=t.set,E=n.slice(2),m=Ce[E];m||(m=Ce[E]=H("ON_PROPERTY"+E)),t.set=function(C){let T=this;if(!T&&e===J&&(T=J),!T)return;typeof T[m]=="function"&&T.removeEventListener(E,Ye),_&&_.call(T,null),T[m]=C,typeof C=="function"&&T.addEventListener(E,Ye,!1)},t.get=function(){let C=this;if(!C&&e===J&&(C=J),!C)return null;let T=C[m];if(T)return T;if(f){let I=f.call(this);if(I)return t.set.call(this,I),typeof C[Et]=="function"&&C.removeAttribute(n),I}return null},Ae(e,n,t),e[c]=!0}function nt(e,n,a){if(n)for(let t=0;tfunction(_,E){let m=a(_,E);return m.cbIdx>=0&&typeof E[m.cbIdx]=="function"?Ve(m.name,E[m.cbIdx],m,c):f.apply(_,E)})}function ue(e,n){e[H("OriginalDelegate")]=n}var Je=!1,Me=!1;function yt(){try{let e=ye.navigator.userAgent;if(e.indexOf("MSIE ")!==-1||e.indexOf("Trident/")!==-1)return!0}catch{}return!1}function mt(){if(Je)return Me;Je=!0;try{let e=ye.navigator.userAgent;(e.indexOf("MSIE ")!==-1||e.indexOf("Trident/")!==-1||e.indexOf("Edge/")!==-1)&&(Me=!0)}catch{}return Me}var ge=!1;if(typeof window<"u")try{let e=Object.defineProperty({},"passive",{get:function(){ge=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{ge=!1}var pt={useG:!0},ee={},rt={},ot=new RegExp("^"+be+"(\\w+)(true|false)$"),st=H("propagationStopped");function it(e,n){let a=(n?n(e):e)+ae,t=(n?n(e):e)+ce,c=be+a,f=be+t;ee[e]={},ee[e][ae]=c,ee[e][ce]=f}function kt(e,n,a,t){let c=t&&t.add||He,f=t&&t.rm||xe,_=t&&t.listeners||"eventListeners",E=t&&t.rmAll||"removeAllListeners",m=H(c),C="."+c+":",T="prependListener",I="."+T+":",P=function(v,d,F){if(v.isRemoved)return;let q=v.callback;typeof q=="object"&&q.handleEvent&&(v.callback=g=>q.handleEvent(g),v.originalDelegate=q);let Y;try{v.invoke(v,d,[F])}catch(g){Y=g}let B=v.options;if(B&&typeof B=="object"&&B.once){let g=v.originalDelegate?v.originalDelegate:v.callback;d[f].call(d,F.type,g,B)}return Y};function Z(v,d,F){if(d=d||e.event,!d)return;let q=v||d.target||e,Y=q[ee[d.type][F?ce:ae]];if(Y){let B=[];if(Y.length===1){let g=P(Y[0],q,d);g&&B.push(g)}else{let g=Y.slice();for(let U=0;U{throw U})}}}let W=function(v){return Z(this,v,!1)},A=function(v){return Z(this,v,!0)};function te(v,d){if(!v)return!1;let F=!0;d&&d.useG!==void 0&&(F=d.useG);let q=d&&d.vh,Y=!0;d&&d.chkDup!==void 0&&(Y=d.chkDup);let B=!1;d&&d.rt!==void 0&&(B=d.rt);let g=v;for(;g&&!g.hasOwnProperty(c);)g=je(g);if(!g&&v[c]&&(g=v),!g||g[m])return!1;let U=d&&d.eventNameToString,D={},w=g[m]=g[c],k=g[H(f)]=g[f],S=g[H(_)]=g[_],K=g[H(E)]=g[E],z;d&&d.prepend&&(z=g[H(d.prepend)]=g[d.prepend]);function $(o,u){return!ge&&typeof o=="object"&&o?!!o.capture:!ge||!u?o:typeof o=="boolean"?{capture:o,passive:!0}:o?typeof o=="object"&&o.passive!==!1?{...o,passive:!0}:o:{passive:!0}}let j=function(o){if(!D.isExisting)return w.call(D.target,D.eventName,D.capture?A:W,D.options)},r=function(o){if(!o.isRemoved){let u=ee[o.eventName],p;u&&(p=u[o.capture?ce:ae]);let R=p&&o.target[p];if(R){for(let y=0;yne.zone.cancelTask(ne);o.call(_e,"abort",se,{once:!0}),ne.removeAbortListener=()=>_e.removeEventListener("abort",se)}if(D.target=null,pe&&(pe.taskData=null),Ue&&(D.options.once=!0),!ge&&typeof ne.options=="boolean"||(ne.options=oe),ne.target=N,ne.capture=Oe,ne.eventName=L,V&&(ne.originalDelegate=G),O?Ee.unshift(ne):Ee.push(ne),y)return N}};return g[c]=l(w,C,x,M,B),z&&(g[T]=l(z,I,s,M,B,!0)),g[f]=function(){let o=this||e,u=arguments[0];d&&d.transferEventName&&(u=d.transferEventName(u));let p=arguments[2],R=p?typeof p=="boolean"?!0:p.capture:!1,y=arguments[1];if(!y)return k.apply(this,arguments);if(q&&!q(k,y,o,arguments))return;let O=ee[u],N;O&&(N=O[R?ce:ae]);let L=N&&o[N];if(L)for(let G=0;Gfunction(c,f){c[st]=!0,t&&t.apply(c,f)})}function bt(e,n){n.patchMethod(e,"queueMicrotask",a=>function(t,c){Zone.current.scheduleMicroTask("queueMicrotask",c[0])})}var Re=H("zoneTask");function Te(e,n,a,t){let c=null,f=null;n+=t,a+=t;let _={};function E(C){let T=C.data;return T.args[0]=function(){return C.invoke.apply(this,arguments)},T.handleId=c.apply(e,T.args),C}function m(C){return f.call(e,C.data.handleId)}c=le(e,n,C=>function(T,I){if(typeof I[0]=="function"){let P={isPeriodic:t==="Interval",delay:t==="Timeout"||t==="Interval"?I[1]||0:void 0,args:I},Z=I[0];I[0]=function(){try{return Z.apply(this,arguments)}finally{P.isPeriodic||(typeof P.handleId=="number"?delete _[P.handleId]:P.handleId&&(P.handleId[Re]=null))}};let W=Ve(n,I[0],P,E,m);if(!W)return W;let A=W.data.handleId;return typeof A=="number"?_[A]=W:A&&(A[Re]=W),A&&A.ref&&A.unref&&typeof A.ref=="function"&&typeof A.unref=="function"&&(W.ref=A.ref.bind(A),W.unref=A.unref.bind(A)),typeof A=="number"||A?A:W}else return C.apply(e,I)}),f=le(e,a,C=>function(T,I){let P=I[0],Z;typeof P=="number"?Z=_[P]:(Z=P&&P[Re],Z||(Z=P)),Z&&typeof Z.type=="string"?Z.state!=="notScheduled"&&(Z.cancelFn&&Z.data.isPeriodic||Z.runCount===0)&&(typeof P=="number"?delete _[P]:P&&(P[Re]=null),Z.zone.cancelTask(Z)):C.apply(e,I)})}function Pt(e,n){let{isBrowser:a,isMix:t}=n.getGlobalObjects();if(!a&&!t||!e.customElements||!("customElements"in e))return;let c=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"];n.patchCallbacks(n,e.customElements,"customElements","define",c)}function wt(e,n){if(Zone[n.symbol("patchEventTarget")])return;let{eventNames:a,zoneSymbolEventNames:t,TRUE_STR:c,FALSE_STR:f,ZONE_SYMBOL_PREFIX:_}=n.getGlobalObjects();for(let m=0;mf.target===e);if(!t||t.length===0)return n;let c=t[0].ignoreProperties;return n.filter(f=>c.indexOf(f)===-1)}function Ke(e,n,a,t){if(!e)return;let c=at(e,n,a);nt(e,c,t)}function Ze(e){return Object.getOwnPropertyNames(e).filter(n=>n.startsWith("on")&&n.length>2).map(n=>n.substring(2))}function Ct(e,n){if(De&&!tt||Zone[e.symbol("patchEvents")])return;let a=n.__Zone_ignore_on_properties,t=[];if(Be){let c=window;t=t.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);let f=yt()?[{target:c,ignoreProperties:["error"]}]:[];Ke(c,Ze(c),a&&a.concat(f),je(c))}t=t.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let c=0;c{let a=n[e.__symbol__("legacyPatch")];a&&a()}),e.__load_patch("timers",n=>{let a="set",t="clear";Te(n,a,t,"Timeout"),Te(n,a,t,"Interval"),Te(n,a,t,"Immediate")}),e.__load_patch("requestAnimationFrame",n=>{Te(n,"request","cancel","AnimationFrame"),Te(n,"mozRequest","mozCancel","AnimationFrame"),Te(n,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(n,a)=>{let t=["alert","prompt","confirm"];for(let c=0;cfunction(C,T){return a.current.run(_,n,T,m)})}}),e.__load_patch("EventTarget",(n,a,t)=>{Rt(n,t),wt(n,t);let c=n.XMLHttpRequestEventTarget;c&&c.prototype&&t.patchEventTarget(n,t,[c.prototype])}),e.__load_patch("MutationObserver",(n,a,t)=>{ke("MutationObserver"),ke("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(n,a,t)=>{ke("IntersectionObserver")}),e.__load_patch("FileReader",(n,a,t)=>{ke("FileReader")}),e.__load_patch("on_property",(n,a,t)=>{Ct(t,n)}),e.__load_patch("customElements",(n,a,t)=>{Pt(n,t)}),e.__load_patch("XHR",(n,a)=>{C(n);let t=H("xhrTask"),c=H("xhrSync"),f=H("xhrListener"),_=H("xhrScheduled"),E=H("xhrURL"),m=H("xhrErrorBeforeScheduled");function C(T){let I=T.XMLHttpRequest;if(!I)return;let P=I.prototype;function Z(w){return w[t]}let W=P[Le],A=P[Ie];if(!W){let w=T.XMLHttpRequestEventTarget;if(w){let k=w.prototype;W=k[Le],A=k[Ie]}}let te="readystatechange",X="scheduled";function v(w){let k=w.data,S=k.target;S[_]=!1,S[m]=!1;let K=S[f];W||(W=S[Le],A=S[Ie]),K&&A.call(S,te,K);let z=S[f]=()=>{if(S.readyState===S.DONE)if(!k.aborted&&S[_]&&w.state===X){let j=S[a.__symbol__("loadfalse")];if(S.status!==0&&j&&j.length>0){let r=w.invoke;w.invoke=function(){let i=S[a.__symbol__("loadfalse")];for(let s=0;sfunction(w,k){return w[c]=k[2]==!1,w[E]=k[1],q.apply(w,k)}),Y="XMLHttpRequest.send",B=H("fetchTaskAborting"),g=H("fetchTaskScheduling"),U=le(P,"send",()=>function(w,k){if(a.current[g]===!0||w[c])return U.apply(w,k);{let S={target:w,url:w[E],isPeriodic:!1,args:k,aborted:!1},K=Ve(Y,d,S,v,F);w&&w[m]===!0&&!S.aborted&&K.state===X&&K.invoke()}}),D=le(P,"abort",()=>function(w,k){let S=Z(w);if(S&&typeof S.type=="string"){if(S.cancelFn==null||S.data&&S.data.aborted)return;S.zone.cancelTask(S)}else if(a.current[B]===!0)return D.apply(w,k)})}}),e.__load_patch("geolocation",n=>{n.navigator&&n.navigator.geolocation&&Tt(n.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(n,a)=>{function t(c){return function(f){ct(n,c).forEach(E=>{let m=n.PromiseRejectionEvent;if(m){let C=new m(c,{promise:f.promise,reason:f.rejection});E.invoke(C)}})}}n.PromiseRejectionEvent&&(a[H("unhandledPromiseRejectionHandler")]=t("unhandledrejection"),a[H("rejectionHandledHandler")]=t("rejectionhandled"))}),e.__load_patch("queueMicrotask",(n,a,t)=>{bt(n,t)})}function Dt(e){e.__load_patch("ZoneAwarePromise",(n,a,t)=>{let c=Object.getOwnPropertyDescriptor,f=Object.defineProperty;function _(h){if(h&&h.toString===Object.prototype.toString){let l=h.constructor&&h.constructor.name;return(l||"")+": "+JSON.stringify(h)}return h?h.toString():Object.prototype.toString.call(h)}let E=t.symbol,m=[],C=n[E("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")]!==!1,T=E("Promise"),I=E("then"),P="__creationTrace__";t.onUnhandledError=h=>{if(t.showUncaughtError()){let l=h&&h.rejection;l?console.error("Unhandled Promise rejection:",l instanceof Error?l.message:l,"; Zone:",h.zone.name,"; Task:",h.task&&h.task.source,"; Value:",l,l instanceof Error?l.stack:void 0):console.error(h)}},t.microtaskDrainDone=()=>{for(;m.length;){let h=m.shift();try{h.zone.runGuarded(()=>{throw h.throwOriginal?h.rejection:h})}catch(l){W(l)}}};let Z=E("unhandledPromiseRejectionHandler");function W(h){t.onUnhandledError(h);try{let l=a[Z];typeof l=="function"&&l.call(this,h)}catch{}}function A(h){return h&&h.then}function te(h){return h}function X(h){return M.reject(h)}let v=E("state"),d=E("value"),F=E("finally"),q=E("parentPromiseValue"),Y=E("parentPromiseState"),B="Promise.then",g=null,U=!0,D=!1,w=0;function k(h,l){return o=>{try{$(h,l,o)}catch(u){$(h,!1,u)}}}let S=function(){let h=!1;return function(o){return function(){h||(h=!0,o.apply(null,arguments))}}},K="Promise resolved with itself",z=E("currentTaskTrace");function $(h,l,o){let u=S();if(h===o)throw new TypeError(K);if(h[v]===g){let p=null;try{(typeof o=="object"||typeof o=="function")&&(p=o&&o.then)}catch(R){return u(()=>{$(h,!1,R)})(),h}if(l!==D&&o instanceof M&&o.hasOwnProperty(v)&&o.hasOwnProperty(d)&&o[v]!==g)r(o),$(h,o[v],o[d]);else if(l!==D&&typeof p=="function")try{p.call(o,u(k(h,l)),u(k(h,!1)))}catch(R){u(()=>{$(h,!1,R)})()}else{h[v]=l;let R=h[d];if(h[d]=o,h[F]===F&&l===U&&(h[v]=h[Y],h[d]=h[q]),l===D&&o instanceof Error){let y=a.currentTask&&a.currentTask.data&&a.currentTask.data[P];y&&f(o,z,{configurable:!0,enumerable:!1,writable:!0,value:y})}for(let y=0;y{try{let O=h[d],N=!!o&&F===o[F];N&&(o[q]=O,o[Y]=R);let L=l.run(y,void 0,N&&y!==X&&y!==te?[]:[O]);$(o,!0,L)}catch(O){$(o,!1,O)}},o)}let s="function ZoneAwarePromise() { [native code] }",b=function(){},x=n.AggregateError;class M{static toString(){return s}static resolve(l){return l instanceof M?l:$(new this(null),U,l)}static reject(l){return $(new this(null),D,l)}static withResolvers(){let l={};return l.promise=new M((o,u)=>{l.resolve=o,l.reject=u}),l}static any(l){if(!l||typeof l[Symbol.iterator]!="function")return Promise.reject(new x([],"All promises were rejected"));let o=[],u=0;try{for(let y of l)u++,o.push(M.resolve(y))}catch{return Promise.reject(new x([],"All promises were rejected"))}if(u===0)return Promise.reject(new x([],"All promises were rejected"));let p=!1,R=[];return new M((y,O)=>{for(let N=0;N{p||(p=!0,y(L))},L=>{R.push(L),u--,u===0&&(p=!0,O(new x(R,"All promises were rejected")))})})}static race(l){let o,u,p=new this((O,N)=>{o=O,u=N});function R(O){o(O)}function y(O){u(O)}for(let O of l)A(O)||(O=this.resolve(O)),O.then(R,y);return p}static all(l){return M.allWithCallback(l)}static allSettled(l){return(this&&this.prototype instanceof M?this:M).allWithCallback(l,{thenCallback:u=>({status:"fulfilled",value:u}),errorCallback:u=>({status:"rejected",reason:u})})}static allWithCallback(l,o){let u,p,R=new this((L,G)=>{u=L,p=G}),y=2,O=0,N=[];for(let L of l){A(L)||(L=this.resolve(L));let G=O;try{L.then(V=>{N[G]=o?o.thenCallback(V):V,y--,y===0&&u(N)},V=>{o?(N[G]=o.errorCallback(V),y--,y===0&&u(N)):p(V)})}catch(V){p(V)}y++,O++}return y-=2,y===0&&u(N),R}constructor(l){let o=this;if(!(o instanceof M))throw new Error("Must be an instanceof Promise.");o[v]=g,o[d]=[];try{let u=S();l&&l(u(k(o,U)),u(k(o,D)))}catch(u){$(o,!1,u)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(l,o){let u=this.constructor?.[Symbol.species];(!u||typeof u!="function")&&(u=this.constructor||M);let p=new u(b),R=a.current;return this[v]==g?this[d].push(R,p,l,o):i(this,R,p,l,o),p}catch(l){return this.then(null,l)}finally(l){let o=this.constructor?.[Symbol.species];(!o||typeof o!="function")&&(o=M);let u=new o(b);u[F]=F;let p=a.current;return this[v]==g?this[d].push(p,u,l,l):i(this,p,u,l,l),u}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;let de=n[T]=n.Promise;n.Promise=M;let me=E("thenPatched");function he(h){let l=h.prototype,o=c(l,"then");if(o&&(o.writable===!1||!o.configurable))return;let u=l.then;l[I]=u,h.prototype.then=function(p,R){return new M((O,N)=>{u.call(this,O,N)}).then(p,R)},h[me]=!0}t.patchThen=he;function Pe(h){return function(l,o){let u=h.apply(l,o);if(u instanceof M)return u;let p=u.constructor;return p[me]||he(p),u}}return de&&(he(de),le(n,"fetch",h=>Pe(h))),Promise[a.__symbol__("uncaughtPromiseErrors")]=m,M})}function Ot(e){e.__load_patch("toString",n=>{let a=Function.prototype.toString,t=H("OriginalDelegate"),c=H("Promise"),f=H("Error"),_=function(){if(typeof this=="function"){let T=this[t];if(T)return typeof T=="function"?a.call(T):Object.prototype.toString.call(T);if(this===Promise){let I=n[c];if(I)return a.call(I)}if(this===Error){let I=n[f];if(I)return a.call(I)}}return a.call(this)};_[t]=a,Function.prototype.toString=_;let E=Object.prototype.toString,m="[object Promise]";Object.prototype.toString=function(){return typeof Promise=="function"&&this instanceof Promise?m:E.call(this)}})}function Nt(e,n,a,t,c){let f=Zone.__symbol__(t);if(n[f])return;let _=n[f]=n[t];n[t]=function(E,m,C){return m&&m.prototype&&c.forEach(function(T){let I=`${a}.${t}::`+T,P=m.prototype;try{if(P.hasOwnProperty(T)){let Z=e.ObjectGetOwnPropertyDescriptor(P,T);Z&&Z.value?(Z.value=e.wrapWithCurrentZone(Z.value,I),e._redefineProperty(m.prototype,T,Z)):P[T]&&(P[T]=e.wrapWithCurrentZone(P[T],I))}else P[T]&&(P[T]=e.wrapWithCurrentZone(P[T],I))}catch{}}),_.call(n,E,m,C)},e.attachOriginToPatched(n[t],_)}function Lt(e){e.__load_patch("util",(n,a,t)=>{let c=Ze(n);t.patchOnProperties=nt,t.patchMethod=le,t.bindArguments=Fe,t.patchMacroTask=gt;let f=a.__symbol__("BLACK_LISTED_EVENTS"),_=a.__symbol__("UNPATCHED_EVENTS");n[_]&&(n[f]=n[_]),n[f]&&(a[f]=a[_]=n[f]),t.patchEventPrototype=vt,t.patchEventTarget=kt,t.isIEOrEdge=mt,t.ObjectDefineProperty=Ae,t.ObjectGetOwnPropertyDescriptor=ve,t.ObjectCreate=dt,t.ArraySlice=_t,t.patchClass=ke,t.wrapWithCurrentZone=Ge,t.filterProperties=at,t.attachOriginToPatched=ue,t._redefineProperty=Object.defineProperty,t.patchCallbacks=Nt,t.getGlobalObjects=()=>({globalSources:rt,zoneSymbolEventNames:ee,eventNames:c,isBrowser:Be,isMix:tt,isNode:De,TRUE_STR:ce,FALSE_STR:ae,ZONE_SYMBOL_PREFIX:be,ADD_EVENT_LISTENER_STR:He,REMOVE_EVENT_LISTENER_STR:xe})})}function It(e){Dt(e),Ot(e),Lt(e)}var lt=ht();It(lt);St(lt); diff --git a/docs/polyfills.97b80eb56ae3e13c.js b/docs/polyfills.97b80eb56ae3e13c.js deleted file mode 100644 index 1930238..0000000 --- a/docs/polyfills.97b80eb56ae3e13c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[461],{6935:()=>{const ee=globalThis;function Q(t){return(ee.__Zone_symbol_prefix||"__zone_symbol__")+t}const ye=Object.getOwnPropertyDescriptor,Ne=Object.defineProperty,Ie=Object.getPrototypeOf,ht=Object.create,dt=Array.prototype.slice,Le="addEventListener",Me="removeEventListener",Ze=Q(Le),Ae=Q(Me),ce="true",ae="false",me=Q("");function je(t,r){return Zone.current.wrap(t,r)}function He(t,r,c,n,i){return Zone.current.scheduleMacroTask(t,r,c,n,i)}const H=Q,be=typeof window<"u",de=be?window:void 0,J=be&&de||globalThis,_t="removeAttribute";function xe(t,r){for(let c=t.length-1;c>=0;c--)"function"==typeof t[c]&&(t[c]=je(t[c],r+"_"+c));return t}function ze(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&typeof t.set>"u")}const qe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Pe=!("nw"in J)&&typeof J.process<"u"&&"[object process]"===J.process.toString(),Ge=!Pe&&!qe&&!(!be||!de.HTMLElement),Xe=typeof J.process<"u"&&"[object process]"===J.process.toString()&&!qe&&!(!be||!de.HTMLElement),we={},Ye=function(t){if(!(t=t||J.event))return;let r=we[t.type];r||(r=we[t.type]=H("ON_PROPERTY"+t.type));const c=this||t.target||J,n=c[r];let i;return Ge&&c===de&&"error"===t.type?(i=n&&n.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===i&&t.preventDefault()):(i=n&&n.apply(this,arguments),null!=i&&!i&&t.preventDefault()),i};function $e(t,r,c){let n=ye(t,r);if(!n&&c&&ye(c,r)&&(n={enumerable:!0,configurable:!0}),!n||!n.configurable)return;const i=H("on"+r+"patched");if(t.hasOwnProperty(i)&&t[i])return;delete n.writable,delete n.value;const u=n.get,_=n.set,E=r.slice(2);let m=we[E];m||(m=we[E]=H("ON_PROPERTY"+E)),n.set=function(C){let T=this;!T&&t===J&&(T=J),T&&("function"==typeof T[m]&&T.removeEventListener(E,Ye),_&&_.call(T,null),T[m]=C,"function"==typeof C&&T.addEventListener(E,Ye,!1))},n.get=function(){let C=this;if(!C&&t===J&&(C=J),!C)return null;const T=C[m];if(T)return T;if(u){let Z=u.call(this);if(Z)return n.set.call(this,Z),"function"==typeof C[_t]&&C.removeAttribute(r),Z}return null},Ne(t,r,n),t[i]=!0}function Je(t,r,c){if(r)for(let n=0;nfunction(_,E){const m=c(_,E);return m.cbIdx>=0&&"function"==typeof E[m.cbIdx]?He(m.name,E[m.cbIdx],m,i):u.apply(_,E)})}function ue(t,r){t[H("OriginalDelegate")]=r}let Ke=!1,Ve=!1;function yt(){if(Ke)return Ve;Ke=!0;try{const t=de.navigator.userAgent;(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/")||-1!==t.indexOf("Edge/"))&&(Ve=!0)}catch{}return Ve}let _e=!1;if(typeof window<"u")try{const t=Object.defineProperty({},"passive",{get:function(){_e=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{_e=!1}const mt={useG:!0},te={},Qe={},et=new RegExp("^"+me+"(\\w+)(true|false)$"),tt=H("propagationStopped");function nt(t,r){const c=(r?r(t):t)+ae,n=(r?r(t):t)+ce,i=me+c,u=me+n;te[t]={},te[t][ae]=i,te[t][ce]=u}function pt(t,r,c,n){const i=n&&n.add||Le,u=n&&n.rm||Me,_=n&&n.listeners||"eventListeners",E=n&&n.rmAll||"removeAllListeners",m=H(i),C="."+i+":",T="prependListener",Z="."+T+":",P=function(b,h,F){if(b.isRemoved)return;const z=b.callback;let Y;"object"==typeof z&&z.handleEvent&&(b.callback=g=>z.handleEvent(g),b.originalDelegate=z);try{b.invoke(b,h,[F])}catch(g){Y=g}const B=b.options;return B&&"object"==typeof B&&B.once&&h[u].call(h,F.type,b.originalDelegate?b.originalDelegate:b.callback,B),Y};function j(b,h,F){if(!(h=h||t.event))return;const z=b||h.target||t,Y=z[te[h.type][F?ce:ae]];if(Y){const B=[];if(1===Y.length){const g=P(Y[0],z,h);g&&B.push(g)}else{const g=Y.slice();for(let U=0;U{throw U})}}}const W=function(b){return j(this,b,!1)},x=function(b){return j(this,b,!0)};function re(b,h){if(!b)return!1;let F=!0;h&&void 0!==h.useG&&(F=h.useG);const z=h&&h.vh;let Y=!0;h&&void 0!==h.chkDup&&(Y=h.chkDup);let B=!1;h&&void 0!==h.rt&&(B=h.rt);let g=b;for(;g&&!g.hasOwnProperty(i);)g=Ie(g);if(!g&&b[i]&&(g=b),!g||g[m])return!1;const U=h&&h.eventNameToString,O={},w=g[m]=g[i],v=g[H(u)]=g[u],S=g[H(_)]=g[_],K=g[H(E)]=g[E];let q;h&&h.prepend&&(q=g[H(h.prepend)]=g[h.prepend]);const $=F?function(s){if(!O.isExisting)return w.call(O.target,O.eventName,O.capture?x:W,O.options)}:function(s){return w.call(O.target,O.eventName,s.invoke,O.options)},A=F?function(s){if(!s.isRemoved){const l=te[s.eventName];let k;l&&(k=l[s.capture?ce:ae]);const R=k&&s.target[k];if(R)for(let y=0;yoe.zone.cancelTask(oe);s.call(Te,"abort",ie,{once:!0}),oe.removeAbortListener=()=>Te.removeEventListener("abort",ie)}return O.target=null,ve&&(ve.taskData=null),ct&&(O.options.once=!0),!_e&&"boolean"==typeof oe.options||(oe.options=se),oe.target=L,oe.capture=Be,oe.eventName=M,V&&(oe.originalDelegate=G),I?ge.unshift(oe):ge.push(oe),y?L:void 0}};return g[i]=a(w,C,$,A,B),q&&(g[T]=a(q,Z,function(s){return q.call(O.target,O.eventName,s.invoke,O.options)},A,B,!0)),g[u]=function(){const s=this||t;let l=arguments[0];h&&h.transferEventName&&(l=h.transferEventName(l));const k=arguments[2],R=!!k&&("boolean"==typeof k||k.capture),y=arguments[1];if(!y)return v.apply(this,arguments);if(z&&!z(v,y,s,arguments))return;const I=te[l];let L;I&&(L=I[R?ce:ae]);const M=L&&s[L];if(M)for(let G=0;Gfunction(i,u){i[tt]=!0,n&&n.apply(i,u)})}const Re=H("zoneTask");function Ee(t,r,c,n){let i=null,u=null;c+=n;const _={};function E(C){const T=C.data;return T.args[0]=function(){return C.invoke.apply(this,arguments)},T.handleId=i.apply(t,T.args),C}function m(C){return u.call(t,C.data.handleId)}i=le(t,r+=n,C=>function(T,Z){if("function"==typeof Z[0]){const P={isPeriodic:"Interval"===n,delay:"Timeout"===n||"Interval"===n?Z[1]||0:void 0,args:Z},j=Z[0];Z[0]=function(){try{return j.apply(this,arguments)}finally{P.isPeriodic||("number"==typeof P.handleId?delete _[P.handleId]:P.handleId&&(P.handleId[Re]=null))}};const W=He(r,Z[0],P,E,m);if(!W)return W;const x=W.data.handleId;return"number"==typeof x?_[x]=W:x&&(x[Re]=W),x&&x.ref&&x.unref&&"function"==typeof x.ref&&"function"==typeof x.unref&&(W.ref=x.ref.bind(x),W.unref=x.unref.bind(x)),"number"==typeof x||x?x:W}return C.apply(t,Z)}),u=le(t,c,C=>function(T,Z){const P=Z[0];let j;"number"==typeof P?j=_[P]:(j=P&&P[Re],j||(j=P)),j&&"string"==typeof j.type?"notScheduled"!==j.state&&(j.cancelFn&&j.data.isPeriodic||0===j.runCount)&&("number"==typeof P?delete _[P]:P&&(P[Re]=null),j.zone.cancelTask(j)):C.apply(t,Z)})}function ot(t,r,c){if(!c||0===c.length)return r;const n=c.filter(u=>u.target===t);if(!n||0===n.length)return r;const i=n[0].ignoreProperties;return r.filter(u=>-1===i.indexOf(u))}function st(t,r,c,n){t&&Je(t,ot(t,r,c),n)}function Fe(t){return Object.getOwnPropertyNames(t).filter(r=>r.startsWith("on")&&r.length>2).map(r=>r.substring(2))}function Ot(t,r,c,n,i){const u=Zone.__symbol__(n);if(r[u])return;const _=r[u]=r[n];r[n]=function(E,m,C){return m&&m.prototype&&i.forEach(function(T){const Z=`${c}.${n}::`+T,P=m.prototype;try{if(P.hasOwnProperty(T)){const j=t.ObjectGetOwnPropertyDescriptor(P,T);j&&j.value?(j.value=t.wrapWithCurrentZone(j.value,Z),t._redefineProperty(m.prototype,T,j)):P[T]&&(P[T]=t.wrapWithCurrentZone(P[T],Z))}else P[T]&&(P[T]=t.wrapWithCurrentZone(P[T],Z))}catch{}}),_.call(r,E,m,C)},t.attachOriginToPatched(r[n],_)}const it=function Oe(){const t=globalThis,r=!0===t[Q("forceDuplicateZoneCheck")];if(t.Zone&&(r||"function"!=typeof t.Zone.__symbol__))throw new Error("Zone already loaded.");return t.Zone??=function We(){const t=ee.performance;function r(N){t&&t.mark&&t.mark(N)}function c(N,d){t&&t.measure&&t.measure(N,d)}r("Zone");let n=(()=>{class N{static#e=this.__symbol__=Q;static assertZonePatched(){if(ee.Promise!==O.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=N.current;for(;e.parent;)e=e.parent;return e}static get current(){return v.zone}static get currentTask(){return S}static __load_patch(e,o,p=!1){if(O.hasOwnProperty(e)){const D=!0===ee[Q("forceDuplicateZoneCheck")];if(!p&&D)throw Error("Already loaded patch: "+e)}else if(!ee["__Zone_disable_"+e]){const D="Zone:"+e;r(D),O[e]=o(ee,N,w),c(D,D)}}get parent(){return this._parent}get name(){return this._name}constructor(e,o){this._parent=e,this._name=o?o.name||"unnamed":"",this._properties=o&&o.properties||{},this._zoneDelegate=new u(this,this._parent&&this._parent._zoneDelegate,o)}get(e){const o=this.getZoneWith(e);if(o)return o._properties[e]}getZoneWith(e){let o=this;for(;o;){if(o._properties.hasOwnProperty(e))return o;o=o._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,o){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const p=this._zoneDelegate.intercept(this,e,o),D=this;return function(){return D.runGuarded(p,this,arguments,o)}}run(e,o,p,D){v={parent:v,zone:this};try{return this._zoneDelegate.invoke(this,e,o,p,D)}finally{v=v.parent}}runGuarded(e,o=null,p,D){v={parent:v,zone:this};try{try{return this._zoneDelegate.invoke(this,e,o,p,D)}catch($){if(this._zoneDelegate.handleError(this,$))throw $}}finally{v=v.parent}}runTask(e,o,p){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||re).name+"; Execution: "+this.name+")");if(e.state===X&&(e.type===U||e.type===g))return;const D=e.state!=F;D&&e._transitionTo(F,h),e.runCount++;const $=S;S=e,v={parent:v,zone:this};try{e.type==g&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,o,p)}catch(A){if(this._zoneDelegate.handleError(this,A))throw A}}finally{e.state!==X&&e.state!==Y&&(e.type==U||e.data&&e.data.isPeriodic?D&&e._transitionTo(h,F):(e.runCount=0,this._updateTaskCount(e,-1),D&&e._transitionTo(X,F,X))),v=v.parent,S=$}}scheduleTask(e){if(e.zone&&e.zone!==this){let p=this;for(;p;){if(p===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);p=p.parent}}e._transitionTo(b,X);const o=[];e._zoneDelegates=o,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(p){throw e._transitionTo(Y,b,X),this._zoneDelegate.handleError(this,p),p}return e._zoneDelegates===o&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(h,b),e}scheduleMicroTask(e,o,p,D){return this.scheduleTask(new _(B,e,o,p,D,void 0))}scheduleMacroTask(e,o,p,D,$){return this.scheduleTask(new _(g,e,o,p,D,$))}scheduleEventTask(e,o,p,D,$){return this.scheduleTask(new _(U,e,o,p,D,$))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||re).name+"; Execution: "+this.name+")");if(e.state===h||e.state===F){e._transitionTo(z,h,F);try{this._zoneDelegate.cancelTask(this,e)}catch(o){throw e._transitionTo(Y,z),this._zoneDelegate.handleError(this,o),o}return this._updateTaskCount(e,-1),e._transitionTo(X,z),e.runCount=0,e}}_updateTaskCount(e,o){const p=e._zoneDelegates;-1==o&&(e._zoneDelegates=null);for(let D=0;DN.hasTask(e,o),onScheduleTask:(N,d,e,o)=>N.scheduleTask(e,o),onInvokeTask:(N,d,e,o,p,D)=>N.invokeTask(e,o,p,D),onCancelTask:(N,d,e,o)=>N.cancelTask(e,o)};class u{get zone(){return this._zone}constructor(d,e,o){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this._zone=d,this._parentDelegate=e,this._forkZS=o&&(o&&o.onFork?o:e._forkZS),this._forkDlgt=o&&(o.onFork?e:e._forkDlgt),this._forkCurrZone=o&&(o.onFork?this._zone:e._forkCurrZone),this._interceptZS=o&&(o.onIntercept?o:e._interceptZS),this._interceptDlgt=o&&(o.onIntercept?e:e._interceptDlgt),this._interceptCurrZone=o&&(o.onIntercept?this._zone:e._interceptCurrZone),this._invokeZS=o&&(o.onInvoke?o:e._invokeZS),this._invokeDlgt=o&&(o.onInvoke?e:e._invokeDlgt),this._invokeCurrZone=o&&(o.onInvoke?this._zone:e._invokeCurrZone),this._handleErrorZS=o&&(o.onHandleError?o:e._handleErrorZS),this._handleErrorDlgt=o&&(o.onHandleError?e:e._handleErrorDlgt),this._handleErrorCurrZone=o&&(o.onHandleError?this._zone:e._handleErrorCurrZone),this._scheduleTaskZS=o&&(o.onScheduleTask?o:e._scheduleTaskZS),this._scheduleTaskDlgt=o&&(o.onScheduleTask?e:e._scheduleTaskDlgt),this._scheduleTaskCurrZone=o&&(o.onScheduleTask?this._zone:e._scheduleTaskCurrZone),this._invokeTaskZS=o&&(o.onInvokeTask?o:e._invokeTaskZS),this._invokeTaskDlgt=o&&(o.onInvokeTask?e:e._invokeTaskDlgt),this._invokeTaskCurrZone=o&&(o.onInvokeTask?this._zone:e._invokeTaskCurrZone),this._cancelTaskZS=o&&(o.onCancelTask?o:e._cancelTaskZS),this._cancelTaskDlgt=o&&(o.onCancelTask?e:e._cancelTaskDlgt),this._cancelTaskCurrZone=o&&(o.onCancelTask?this._zone:e._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const p=o&&o.onHasTask;(p||e&&e._hasTaskZS)&&(this._hasTaskZS=p?o:i,this._hasTaskDlgt=e,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,o.onScheduleTask||(this._scheduleTaskZS=i,this._scheduleTaskDlgt=e,this._scheduleTaskCurrZone=this._zone),o.onInvokeTask||(this._invokeTaskZS=i,this._invokeTaskDlgt=e,this._invokeTaskCurrZone=this._zone),o.onCancelTask||(this._cancelTaskZS=i,this._cancelTaskDlgt=e,this._cancelTaskCurrZone=this._zone))}fork(d,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,d,e):new n(d,e)}intercept(d,e,o){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,d,e,o):e}invoke(d,e,o,p,D){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,d,e,o,p,D):e.apply(o,p)}handleError(d,e){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,d,e)}scheduleTask(d,e){let o=e;if(this._scheduleTaskZS)this._hasTaskZS&&o._zoneDelegates.push(this._hasTaskDlgtOwner),o=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,d,e),o||(o=e);else if(e.scheduleFn)e.scheduleFn(e);else{if(e.type!=B)throw new Error("Task is missing scheduleFn.");W(e)}return o}invokeTask(d,e,o,p){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,d,e,o,p):e.callback.apply(o,p)}cancelTask(d,e){let o;if(this._cancelTaskZS)o=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,d,e);else{if(!e.cancelFn)throw Error("Task is not cancelable");o=e.cancelFn(e)}return o}hasTask(d,e){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,d,e)}catch(o){this.handleError(d,o)}}_updateTaskCount(d,e){const o=this._taskCounts,p=o[d],D=o[d]=p+e;if(D<0)throw new Error("More tasks executed then were scheduled.");0!=p&&0!=D||this.hasTask(this._zone,{microTask:o.microTask>0,macroTask:o.macroTask>0,eventTask:o.eventTask>0,change:d})}}class _{constructor(d,e,o,p,D,$){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=d,this.source=e,this.data=p,this.scheduleFn=D,this.cancelFn=$,!o)throw new Error("callback is not defined");this.callback=o;const A=this;this.invoke=d===U&&p&&p.useG?_.invokeTask:function(){return _.invokeTask.call(ee,A,this,arguments)}}static invokeTask(d,e,o){d||(d=this),K++;try{return d.runCount++,d.zone.runTask(d,e,o)}finally{1==K&&x(),K--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(X,b)}_transitionTo(d,e,o){if(this._state!==e&&this._state!==o)throw new Error(`${this.type} '${this.source}': can not transition to '${d}', expecting state '${e}'${o?" or '"+o+"'":""}, was '${this._state}'.`);this._state=d,d==X&&(this._zoneDelegates=null)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const E=Q("setTimeout"),m=Q("Promise"),C=Q("then");let P,T=[],Z=!1;function j(N){if(P||ee[m]&&(P=ee[m].resolve(0)),P){let d=P[C];d||(d=P.then),d.call(P,N)}else ee[E](N,0)}function W(N){0===K&&0===T.length&&j(x),N&&T.push(N)}function x(){if(!Z){for(Z=!0;T.length;){const N=T;T=[];for(let d=0;dv,onUnhandledError:q,microtaskDrainDone:q,scheduleMicroTask:W,showUncaughtError:()=>!n[Q("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:q,patchMethod:()=>q,bindArguments:()=>[],patchThen:()=>q,patchMacroTask:()=>q,patchEventPrototype:()=>q,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>q,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>q,wrapWithCurrentZone:()=>q,filterProperties:()=>[],attachOriginToPatched:()=>q,_redefineProperty:()=>q,patchCallbacks:()=>q,nativeScheduleMicroTask:j};let v={parent:null,zone:new n(null,null)},S=null,K=0;function q(){}return c("Zone","Zone"),n}(),t.Zone}();(function It(t){(function St(t){t.__load_patch("ZoneAwarePromise",(r,c,n)=>{const i=Object.getOwnPropertyDescriptor,u=Object.defineProperty,E=n.symbol,m=[],C=!1!==r[E("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],T=E("Promise"),Z=E("then"),P="__creationTrace__";n.onUnhandledError=f=>{if(n.showUncaughtError()){const a=f&&f.rejection;a?console.error("Unhandled Promise rejection:",a instanceof Error?a.message:a,"; Zone:",f.zone.name,"; Task:",f.task&&f.task.source,"; Value:",a,a instanceof Error?a.stack:void 0):console.error(f)}},n.microtaskDrainDone=()=>{for(;m.length;){const f=m.shift();try{f.zone.runGuarded(()=>{throw f.throwOriginal?f.rejection:f})}catch(a){W(a)}}};const j=E("unhandledPromiseRejectionHandler");function W(f){n.onUnhandledError(f);try{const a=c[j];"function"==typeof a&&a.call(this,f)}catch{}}function x(f){return f&&f.then}function re(f){return f}function X(f){return A.reject(f)}const b=E("state"),h=E("value"),F=E("finally"),z=E("parentPromiseValue"),Y=E("parentPromiseState"),B="Promise.then",g=null,U=!0,O=!1,w=0;function v(f,a){return s=>{try{N(f,a,s)}catch(l){N(f,!1,l)}}}const S=function(){let f=!1;return function(s){return function(){f||(f=!0,s.apply(null,arguments))}}},K="Promise resolved with itself",q=E("currentTaskTrace");function N(f,a,s){const l=S();if(f===s)throw new TypeError(K);if(f[b]===g){let k=null;try{("object"==typeof s||"function"==typeof s)&&(k=s&&s.then)}catch(R){return l(()=>{N(f,!1,R)})(),f}if(a!==O&&s instanceof A&&s.hasOwnProperty(b)&&s.hasOwnProperty(h)&&s[b]!==g)e(s),N(f,s[b],s[h]);else if(a!==O&&"function"==typeof k)try{k.call(s,l(v(f,a)),l(v(f,!1)))}catch(R){l(()=>{N(f,!1,R)})()}else{f[b]=a;const R=f[h];if(f[h]=s,f[F]===F&&a===U&&(f[b]=f[Y],f[h]=f[z]),a===O&&s instanceof Error){const y=c.currentTask&&c.currentTask.data&&c.currentTask.data[P];y&&u(s,q,{configurable:!0,enumerable:!1,writable:!0,value:y})}for(let y=0;y{try{const I=f[h],L=!!s&&F===s[F];L&&(s[z]=I,s[Y]=R);const M=a.run(y,void 0,L&&y!==X&&y!==re?[]:[I]);N(s,!0,M)}catch(I){N(s,!1,I)}},s)}const D=function(){},$=r.AggregateError;class A{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(a){return a instanceof A?a:N(new this(null),U,a)}static reject(a){return N(new this(null),O,a)}static withResolvers(){const a={};return a.promise=new A((s,l)=>{a.resolve=s,a.reject=l}),a}static any(a){if(!a||"function"!=typeof a[Symbol.iterator])return Promise.reject(new $([],"All promises were rejected"));const s=[];let l=0;try{for(let y of a)l++,s.push(A.resolve(y))}catch{return Promise.reject(new $([],"All promises were rejected"))}if(0===l)return Promise.reject(new $([],"All promises were rejected"));let k=!1;const R=[];return new A((y,I)=>{for(let L=0;L{k||(k=!0,y(M))},M=>{R.push(M),l--,0===l&&(k=!0,I(new $(R,"All promises were rejected")))})})}static race(a){let s,l,k=new this((I,L)=>{s=I,l=L});function R(I){s(I)}function y(I){l(I)}for(let I of a)x(I)||(I=this.resolve(I)),I.then(R,y);return k}static all(a){return A.allWithCallback(a)}static allSettled(a){return(this&&this.prototype instanceof A?this:A).allWithCallback(a,{thenCallback:l=>({status:"fulfilled",value:l}),errorCallback:l=>({status:"rejected",reason:l})})}static allWithCallback(a,s){let l,k,R=new this((M,G)=>{l=M,k=G}),y=2,I=0;const L=[];for(let M of a){x(M)||(M=this.resolve(M));const G=I;try{M.then(V=>{L[G]=s?s.thenCallback(V):V,y--,0===y&&l(L)},V=>{s?(L[G]=s.errorCallback(V),y--,0===y&&l(L)):k(V)})}catch(V){k(V)}y++,I++}return y-=2,0===y&&l(L),R}constructor(a){const s=this;if(!(s instanceof A))throw new Error("Must be an instanceof Promise.");s[b]=g,s[h]=[];try{const l=S();a&&a(l(v(s,U)),l(v(s,O)))}catch(l){N(s,!1,l)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return A}then(a,s){let l=this.constructor?.[Symbol.species];(!l||"function"!=typeof l)&&(l=this.constructor||A);const k=new l(D),R=c.current;return this[b]==g?this[h].push(R,k,a,s):o(this,R,k,a,s),k}catch(a){return this.then(null,a)}finally(a){let s=this.constructor?.[Symbol.species];(!s||"function"!=typeof s)&&(s=A);const l=new s(D);l[F]=F;const k=c.current;return this[b]==g?this[h].push(k,l,a,a):o(this,k,l,a,a),l}}A.resolve=A.resolve,A.reject=A.reject,A.race=A.race,A.all=A.all;const Ce=r[T]=r.Promise;r.Promise=A;const ke=E("thenPatched");function he(f){const a=f.prototype,s=i(a,"then");if(s&&(!1===s.writable||!s.configurable))return;const l=a.then;a[Z]=l,f.prototype.then=function(k,R){return new A((I,L)=>{l.call(this,I,L)}).then(k,R)},f[ke]=!0}return n.patchThen=he,Ce&&(he(Ce),le(r,"fetch",f=>function Se(f){return function(a,s){let l=f.apply(a,s);if(l instanceof A)return l;let k=l.constructor;return k[ke]||he(k),l}}(f))),Promise[c.__symbol__("uncaughtPromiseErrors")]=m,A})})(t),function Dt(t){t.__load_patch("toString",r=>{const c=Function.prototype.toString,n=H("OriginalDelegate"),i=H("Promise"),u=H("Error"),_=function(){if("function"==typeof this){const T=this[n];if(T)return"function"==typeof T?c.call(T):Object.prototype.toString.call(T);if(this===Promise){const Z=r[i];if(Z)return c.call(Z)}if(this===Error){const Z=r[u];if(Z)return c.call(Z)}}return c.call(this)};_[n]=c,Function.prototype.toString=_;const E=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":E.call(this)}})}(t),function Nt(t){t.__load_patch("util",(r,c,n)=>{const i=Fe(r);n.patchOnProperties=Je,n.patchMethod=le,n.bindArguments=xe,n.patchMacroTask=Tt;const u=c.__symbol__("BLACK_LISTED_EVENTS"),_=c.__symbol__("UNPATCHED_EVENTS");r[_]&&(r[u]=r[_]),r[u]&&(c[u]=c[_]=r[u]),n.patchEventPrototype=kt,n.patchEventTarget=pt,n.isIEOrEdge=yt,n.ObjectDefineProperty=Ne,n.ObjectGetOwnPropertyDescriptor=ye,n.ObjectCreate=ht,n.ArraySlice=dt,n.patchClass=pe,n.wrapWithCurrentZone=je,n.filterProperties=ot,n.attachOriginToPatched=ue,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Ot,n.getGlobalObjects=()=>({globalSources:Qe,zoneSymbolEventNames:te,eventNames:i,isBrowser:Ge,isMix:Xe,isNode:Pe,TRUE_STR:ce,FALSE_STR:ae,ZONE_SYMBOL_PREFIX:me,ADD_EVENT_LISTENER_STR:Le,REMOVE_EVENT_LISTENER_STR:Me})})}(t)})(it),function Ct(t){t.__load_patch("legacy",r=>{const c=r[t.__symbol__("legacyPatch")];c&&c()}),t.__load_patch("timers",r=>{const c="set",n="clear";Ee(r,c,n,"Timeout"),Ee(r,c,n,"Interval"),Ee(r,c,n,"Immediate")}),t.__load_patch("requestAnimationFrame",r=>{Ee(r,"request","cancel","AnimationFrame"),Ee(r,"mozRequest","mozCancel","AnimationFrame"),Ee(r,"webkitRequest","webkitCancel","AnimationFrame")}),t.__load_patch("blocking",(r,c)=>{const n=["alert","prompt","confirm"];for(let i=0;ifunction(C,T){return c.current.run(_,r,T,m)})}),t.__load_patch("EventTarget",(r,c,n)=>{(function wt(t,r){r.patchEventPrototype(t,r)})(r,n),function Pt(t,r){if(Zone[r.symbol("patchEventTarget")])return;const{eventNames:c,zoneSymbolEventNames:n,TRUE_STR:i,FALSE_STR:u,ZONE_SYMBOL_PREFIX:_}=r.getGlobalObjects();for(let m=0;m{pe("MutationObserver"),pe("WebKitMutationObserver")}),t.__load_patch("IntersectionObserver",(r,c,n)=>{pe("IntersectionObserver")}),t.__load_patch("FileReader",(r,c,n)=>{pe("FileReader")}),t.__load_patch("on_property",(r,c,n)=>{!function Rt(t,r){if(Pe&&!Xe||Zone[t.symbol("patchEvents")])return;const c=r.__Zone_ignore_on_properties;let n=[];if(Ge){const i=window;n=n.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const u=function gt(){try{const t=de.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch{}return!1}()?[{target:i,ignoreProperties:["error"]}]:[];st(i,Fe(i),c&&c.concat(u),Ie(i))}n=n.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let i=0;i{!function bt(t,r){const{isBrowser:c,isMix:n}=r.getGlobalObjects();(c||n)&&t.customElements&&"customElements"in t&&r.patchCallbacks(r,t.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(r,n)}),t.__load_patch("XHR",(r,c)=>{!function C(T){const Z=T.XMLHttpRequest;if(!Z)return;const P=Z.prototype;let W=P[Ze],x=P[Ae];if(!W){const w=T.XMLHttpRequestEventTarget;if(w){const v=w.prototype;W=v[Ze],x=v[Ae]}}const re="readystatechange",X="scheduled";function b(w){const v=w.data,S=v.target;S[_]=!1,S[m]=!1;const K=S[u];W||(W=S[Ze],x=S[Ae]),K&&x.call(S,re,K);const q=S[u]=()=>{if(S.readyState===S.DONE)if(!v.aborted&&S[_]&&w.state===X){const d=S[c.__symbol__("loadfalse")];if(0!==S.status&&d&&d.length>0){const e=w.invoke;w.invoke=function(){const o=S[c.__symbol__("loadfalse")];for(let p=0;pfunction(w,v){return w[i]=0==v[2],w[E]=v[1],z.apply(w,v)}),B=H("fetchTaskAborting"),g=H("fetchTaskScheduling"),U=le(P,"send",()=>function(w,v){if(!0===c.current[g]||w[i])return U.apply(w,v);{const S={target:w,url:w[E],isPeriodic:!1,args:v,aborted:!1},K=He("XMLHttpRequest.send",h,S,b,F);w&&!0===w[m]&&!S.aborted&&K.state===X&&K.invoke()}}),O=le(P,"abort",()=>function(w,v){const S=function j(w){return w[n]}(w);if(S&&"string"==typeof S.type){if(null==S.cancelFn||S.data&&S.data.aborted)return;S.zone.cancelTask(S)}else if(!0===c.current[B])return O.apply(w,v)})}(r);const n=H("xhrTask"),i=H("xhrSync"),u=H("xhrListener"),_=H("xhrScheduled"),E=H("xhrURL"),m=H("xhrErrorBeforeScheduled")}),t.__load_patch("geolocation",r=>{r.navigator&&r.navigator.geolocation&&function Et(t,r){const c=t.constructor.name;for(let n=0;n{const m=function(){return E.apply(this,xe(arguments,c+"."+i))};return ue(m,E),m})(u)}}}(r.navigator.geolocation,["getCurrentPosition","watchPosition"])}),t.__load_patch("PromiseRejectionEvent",(r,c)=>{function n(i){return function(u){rt(r,i).forEach(E=>{const m=r.PromiseRejectionEvent;if(m){const C=new m(i,{promise:u.promise,reason:u.rejection});E.invoke(C)}})}}r.PromiseRejectionEvent&&(c[H("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),c[H("rejectionHandledHandler")]=n("rejectionhandled"))}),t.__load_patch("queueMicrotask",(r,c,n)=>{!function vt(t,r){r.patchMethod(t,"queueMicrotask",c=>function(n,i){Zone.current.scheduleMicroTask("queueMicrotask",i[0])})}(r,n)})}(it)}},ee=>{ee(ee.s=6935)}]); \ No newline at end of file diff --git a/docs/runtime.048d90275c60126e.js b/docs/runtime.048d90275c60126e.js deleted file mode 100644 index 2b7c6b3..0000000 --- a/docs/runtime.048d90275c60126e.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,v={},m={};function r(e){var i=m[e];if(void 0!==i)return i.exports;var t=m[e]={exports:{}};return v[e].call(t.exports,t,t.exports,r),t.exports}r.m=v,e=[],r.O=(i,t,o,d)=>{if(!t){var a=1/0;for(n=0;n=d)&&Object.keys(r.O).every(b=>r.O[b](t[u]))?t.splice(u--,1):(s=!1,d0&&e[n-1][2]>d;n--)e[n]=e[n-1];e[n]=[t,o,d]},r.d=(e,i)=>{for(var t in i)r.o(i,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((i,t)=>(r.f[t](e,i),i),[])),r.u=e=>e+"."+{39:"61769452f9c238cb",509:"ec6a8d82178da6d9",772:"0440337245892f34",876:"ad26e918280ccdc0"}[e]+".js",r.miniCssF=e=>{},r.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={},i="demo-showcase:";r.l=(t,o,d,n)=>{if(e[t])e[t].push(o);else{var a,s;if(void 0!==d)for(var u=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(_=>_(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:i=>i},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(o,d)=>{var n=r.o(e,o)?e[o]:void 0;if(0!==n)if(n)d.push(n[2]);else if(121!=o){var a=new Promise((f,c)=>n=e[o]=[f,c]);d.push(n[2]=a);var s=r.p+r.u(o),u=new Error;r.l(s,f=>{if(r.o(e,o)&&(0!==(n=e[o])&&(e[o]=void 0),n)){var c=f&&("load"===f.type?"missing":f.type),p=f&&f.target&&f.target.src;u.message="Loading chunk "+o+" failed.\n("+c+": "+p+")",u.name="ChunkLoadError",u.type=c,u.request=p,n[1](u)}},"chunk-"+o,o)}else e[o]=0},r.O.j=o=>0===e[o];var i=(o,d)=>{var u,l,[n,a,s]=d,f=0;if(n.some(p=>0!==e[p])){for(u in a)r.o(a,u)&&(r.m[u]=a[u]);if(s)var c=s(r)}for(o&&o(d);fcode{color:inherit}kbd{padding:.1875rem .375rem;font-size:.875em;color:var(--bs-body-bg);background-color:var(--bs-body-color);border-radius:.25rem}kbd kbd{padding:0;font-size:1em}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-secondary-color);text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}thead,tbody,tfoot,tr,td,th{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator{display:none!important}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button:not(:disabled),[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width: 1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:calc(1.625rem + 4.5vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-1{font-size:5rem}}.display-2{font-size:calc(1.575rem + 3.9vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-2{font-size:4.5rem}}.display-3{font-size:calc(1.525rem + 3.3vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-3{font-size:4rem}}.display-4{font-size:calc(1.475rem + 2.7vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-4{font-size:3.5rem}}.display-5{font-size:calc(1.425rem + 2.1vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-5{font-size:3rem}}.display-6{font-size:calc(1.375rem + 1.5vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-6{font-size:2.5rem}}.list-unstyled,.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:.875em;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote>:last-child{margin-bottom:0}.blockquote-footer{margin-top:-1rem;margin-bottom:1rem;font-size:.875em;color:#6c757d}.blockquote-footer:before{content:"\2014\a0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:var(--bs-body-bg);border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:.875em;color:var(--bs-secondary-color)}.container,.container-fluid,.container-xxl,.container-xl,.container-lg,.container-md,.container-sm{--bs-gutter-x: 1.5rem;--bs-gutter-y: 0;width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-right:auto;margin-left:auto}@media (min-width: 576px){.container-sm,.container{max-width:540px}}@media (min-width: 768px){.container-md,.container-sm,.container{max-width:720px}}@media (min-width: 992px){.container-lg,.container-md,.container-sm,.container{max-width:960px}}@media (min-width: 1200px){.container-xl,.container-lg,.container-md,.container-sm,.container{max-width:1140px}}@media (min-width: 1400px){.container-xxl,.container-xl,.container-lg,.container-md,.container-sm,.container{max-width:1320px}}:root{--bs-breakpoint-xs: 0;--bs-breakpoint-sm: 576px;--bs-breakpoint-md: 768px;--bs-breakpoint-lg: 992px;--bs-breakpoint-xl: 1200px;--bs-breakpoint-xxl: 1400px}.row{--bs-gutter-x: 1.5rem;--bs-gutter-y: 0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-.5 * var(--bs-gutter-x));margin-left:calc(-.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}.row-cols-auto>*{flex:0 0 auto;width:auto}.row-cols-1>*{flex:0 0 auto;width:100%}.row-cols-2>*{flex:0 0 auto;width:50%}.row-cols-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-4>*{flex:0 0 auto;width:25%}.row-cols-5>*{flex:0 0 auto;width:20%}.row-cols-6>*{flex:0 0 auto;width:16.66666667%}.col-auto{flex:0 0 auto;width:auto}.col-1{flex:0 0 auto;width:8.33333333%}.col-2{flex:0 0 auto;width:16.66666667%}.col-3{flex:0 0 auto;width:25%}.col-4{flex:0 0 auto;width:33.33333333%}.col-5{flex:0 0 auto;width:41.66666667%}.col-6{flex:0 0 auto;width:50%}.col-7{flex:0 0 auto;width:58.33333333%}.col-8{flex:0 0 auto;width:66.66666667%}.col-9{flex:0 0 auto;width:75%}.col-10{flex:0 0 auto;width:83.33333333%}.col-11{flex:0 0 auto;width:91.66666667%}.col-12{flex:0 0 auto;width:100%}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}.g-0,.gx-0{--bs-gutter-x: 0}.g-0,.gy-0{--bs-gutter-y: 0}.g-1,.gx-1{--bs-gutter-x: .25rem}.g-1,.gy-1{--bs-gutter-y: .25rem}.g-2,.gx-2{--bs-gutter-x: .5rem}.g-2,.gy-2{--bs-gutter-y: .5rem}.g-3,.gx-3{--bs-gutter-x: 1rem}.g-3,.gy-3{--bs-gutter-y: 1rem}.g-4,.gx-4{--bs-gutter-x: 1.5rem}.g-4,.gy-4{--bs-gutter-y: 1.5rem}.g-5,.gx-5{--bs-gutter-x: 3rem}.g-5,.gy-5{--bs-gutter-y: 3rem}@media (min-width: 576px){.col-sm{flex:1 0 0%}.row-cols-sm-auto>*{flex:0 0 auto;width:auto}.row-cols-sm-1>*{flex:0 0 auto;width:100%}.row-cols-sm-2>*{flex:0 0 auto;width:50%}.row-cols-sm-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-sm-4>*{flex:0 0 auto;width:25%}.row-cols-sm-5>*{flex:0 0 auto;width:20%}.row-cols-sm-6>*{flex:0 0 auto;width:16.66666667%}.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-1{flex:0 0 auto;width:8.33333333%}.col-sm-2{flex:0 0 auto;width:16.66666667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.33333333%}.col-sm-5{flex:0 0 auto;width:41.66666667%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-7{flex:0 0 auto;width:58.33333333%}.col-sm-8{flex:0 0 auto;width:66.66666667%}.col-sm-9{flex:0 0 auto;width:75%}.col-sm-10{flex:0 0 auto;width:83.33333333%}.col-sm-11{flex:0 0 auto;width:91.66666667%}.col-sm-12{flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x: 0}.g-sm-0,.gy-sm-0{--bs-gutter-y: 0}.g-sm-1,.gx-sm-1{--bs-gutter-x: .25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y: .25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x: .5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y: .5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x: 1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y: 1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x: 1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y: 1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x: 3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y: 3rem}}@media (min-width: 768px){.col-md{flex:1 0 0%}.row-cols-md-auto>*{flex:0 0 auto;width:auto}.row-cols-md-1>*{flex:0 0 auto;width:100%}.row-cols-md-2>*{flex:0 0 auto;width:50%}.row-cols-md-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-md-4>*{flex:0 0 auto;width:25%}.row-cols-md-5>*{flex:0 0 auto;width:20%}.row-cols-md-6>*{flex:0 0 auto;width:16.66666667%}.col-md-auto{flex:0 0 auto;width:auto}.col-md-1{flex:0 0 auto;width:8.33333333%}.col-md-2{flex:0 0 auto;width:16.66666667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.33333333%}.col-md-5{flex:0 0 auto;width:41.66666667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.33333333%}.col-md-8{flex:0 0 auto;width:66.66666667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.33333333%}.col-md-11{flex:0 0 auto;width:91.66666667%}.col-md-12{flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}.g-md-0,.gx-md-0{--bs-gutter-x: 0}.g-md-0,.gy-md-0{--bs-gutter-y: 0}.g-md-1,.gx-md-1{--bs-gutter-x: .25rem}.g-md-1,.gy-md-1{--bs-gutter-y: .25rem}.g-md-2,.gx-md-2{--bs-gutter-x: .5rem}.g-md-2,.gy-md-2{--bs-gutter-y: .5rem}.g-md-3,.gx-md-3{--bs-gutter-x: 1rem}.g-md-3,.gy-md-3{--bs-gutter-y: 1rem}.g-md-4,.gx-md-4{--bs-gutter-x: 1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y: 1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x: 3rem}.g-md-5,.gy-md-5{--bs-gutter-y: 3rem}}@media (min-width: 992px){.col-lg{flex:1 0 0%}.row-cols-lg-auto>*{flex:0 0 auto;width:auto}.row-cols-lg-1>*{flex:0 0 auto;width:100%}.row-cols-lg-2>*{flex:0 0 auto;width:50%}.row-cols-lg-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-lg-4>*{flex:0 0 auto;width:25%}.row-cols-lg-5>*{flex:0 0 auto;width:20%}.row-cols-lg-6>*{flex:0 0 auto;width:16.66666667%}.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-1{flex:0 0 auto;width:8.33333333%}.col-lg-2{flex:0 0 auto;width:16.66666667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.33333333%}.col-lg-5{flex:0 0 auto;width:41.66666667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.33333333%}.col-lg-8{flex:0 0 auto;width:66.66666667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.33333333%}.col-lg-11{flex:0 0 auto;width:91.66666667%}.col-lg-12{flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x: 0}.g-lg-0,.gy-lg-0{--bs-gutter-y: 0}.g-lg-1,.gx-lg-1{--bs-gutter-x: .25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y: .25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x: .5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y: .5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x: 1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y: 1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x: 1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y: 1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x: 3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y: 3rem}}@media (min-width: 1200px){.col-xl{flex:1 0 0%}.row-cols-xl-auto>*{flex:0 0 auto;width:auto}.row-cols-xl-1>*{flex:0 0 auto;width:100%}.row-cols-xl-2>*{flex:0 0 auto;width:50%}.row-cols-xl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xl-4>*{flex:0 0 auto;width:25%}.row-cols-xl-5>*{flex:0 0 auto;width:20%}.row-cols-xl-6>*{flex:0 0 auto;width:16.66666667%}.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-1{flex:0 0 auto;width:8.33333333%}.col-xl-2{flex:0 0 auto;width:16.66666667%}.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.33333333%}.col-xl-5{flex:0 0 auto;width:41.66666667%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-7{flex:0 0 auto;width:58.33333333%}.col-xl-8{flex:0 0 auto;width:66.66666667%}.col-xl-9{flex:0 0 auto;width:75%}.col-xl-10{flex:0 0 auto;width:83.33333333%}.col-xl-11{flex:0 0 auto;width:91.66666667%}.col-xl-12{flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x: 0}.g-xl-0,.gy-xl-0{--bs-gutter-y: 0}.g-xl-1,.gx-xl-1{--bs-gutter-x: .25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y: .25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x: .5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y: .5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x: 1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y: 1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x: 1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y: 1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x: 3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y: 3rem}}@media (min-width: 1400px){.col-xxl{flex:1 0 0%}.row-cols-xxl-auto>*{flex:0 0 auto;width:auto}.row-cols-xxl-1>*{flex:0 0 auto;width:100%}.row-cols-xxl-2>*{flex:0 0 auto;width:50%}.row-cols-xxl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xxl-4>*{flex:0 0 auto;width:25%}.row-cols-xxl-5>*{flex:0 0 auto;width:20%}.row-cols-xxl-6>*{flex:0 0 auto;width:16.66666667%}.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-1{flex:0 0 auto;width:8.33333333%}.col-xxl-2{flex:0 0 auto;width:16.66666667%}.col-xxl-3{flex:0 0 auto;width:25%}.col-xxl-4{flex:0 0 auto;width:33.33333333%}.col-xxl-5{flex:0 0 auto;width:41.66666667%}.col-xxl-6{flex:0 0 auto;width:50%}.col-xxl-7{flex:0 0 auto;width:58.33333333%}.col-xxl-8{flex:0 0 auto;width:66.66666667%}.col-xxl-9{flex:0 0 auto;width:75%}.col-xxl-10{flex:0 0 auto;width:83.33333333%}.col-xxl-11{flex:0 0 auto;width:91.66666667%}.col-xxl-12{flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.33333333%}.offset-xxl-2{margin-left:16.66666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.33333333%}.offset-xxl-5{margin-left:41.66666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.33333333%}.offset-xxl-8{margin-left:66.66666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.33333333%}.offset-xxl-11{margin-left:91.66666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x: 0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y: 0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x: .25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y: .25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x: .5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y: .5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x: 1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y: 1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x: 1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y: 1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x: 3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y: 3rem}}.clearfix:after{display:block;clear:both;content:""}.text-bg-primary{color:#fff!important;background-color:RGBA(var(--bs-primary-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-secondary{color:#fff!important;background-color:RGBA(var(--bs-secondary-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-success{color:#fff!important;background-color:RGBA(var(--bs-success-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-info{color:#000!important;background-color:RGBA(var(--bs-info-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-warning{color:#000!important;background-color:RGBA(var(--bs-warning-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-danger{color:#fff!important;background-color:RGBA(var(--bs-danger-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-light{color:#000!important;background-color:RGBA(var(--bs-light-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-dark{color:#fff!important;background-color:RGBA(var(--bs-dark-rgb),var(--bs-bg-opacity, 1))!important}.link-primary{color:RGBA(var(--bs-primary-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-primary-rgb),var(--bs-link-underline-opacity, 1))!important}.link-primary:hover,.link-primary:focus{color:RGBA(10,88,202,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(10,88,202,var(--bs-link-underline-opacity, 1))!important}.link-secondary{color:RGBA(var(--bs-secondary-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-secondary-rgb),var(--bs-link-underline-opacity, 1))!important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86,94,100,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(86,94,100,var(--bs-link-underline-opacity, 1))!important}.link-success{color:RGBA(var(--bs-success-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-success-rgb),var(--bs-link-underline-opacity, 1))!important}.link-success:hover,.link-success:focus{color:RGBA(20,108,67,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(20,108,67,var(--bs-link-underline-opacity, 1))!important}.link-info{color:RGBA(var(--bs-info-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-info-rgb),var(--bs-link-underline-opacity, 1))!important}.link-info:hover,.link-info:focus{color:RGBA(61,213,243,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(61,213,243,var(--bs-link-underline-opacity, 1))!important}.link-warning{color:RGBA(var(--bs-warning-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-warning-rgb),var(--bs-link-underline-opacity, 1))!important}.link-warning:hover,.link-warning:focus{color:RGBA(255,205,57,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(255,205,57,var(--bs-link-underline-opacity, 1))!important}.link-danger{color:RGBA(var(--bs-danger-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-danger-rgb),var(--bs-link-underline-opacity, 1))!important}.link-danger:hover,.link-danger:focus{color:RGBA(176,42,55,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(176,42,55,var(--bs-link-underline-opacity, 1))!important}.link-light{color:RGBA(var(--bs-light-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-light-rgb),var(--bs-link-underline-opacity, 1))!important}.link-light:hover,.link-light:focus{color:RGBA(249,250,251,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(249,250,251,var(--bs-link-underline-opacity, 1))!important}.link-dark{color:RGBA(var(--bs-dark-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-dark-rgb),var(--bs-link-underline-opacity, 1))!important}.link-dark:hover,.link-dark:focus{color:RGBA(26,30,33,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(26,30,33,var(--bs-link-underline-opacity, 1))!important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity, 1))!important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-opacity, .75))!important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity, .75))!important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity, .5));text-underline-offset:.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio:before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio: 100%}.ratio-4x3{--bs-aspect-ratio: 75%}.ratio-16x9{--bs-aspect-ratio: 56.25%}.ratio-21x9{--bs-aspect-ratio: 42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute!important}.stretched-link:after{position:absolute;inset:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:.25}.navbar{--bs-navbar-padding-x: 0;--bs-navbar-padding-y: .5rem;--bs-navbar-color: rgba(var(--bs-emphasis-color-rgb), .65);--bs-navbar-hover-color: rgba(var(--bs-emphasis-color-rgb), .8);--bs-navbar-disabled-color: rgba(var(--bs-emphasis-color-rgb), .3);--bs-navbar-active-color: rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-brand-padding-y: .3125rem;--bs-navbar-brand-margin-end: 1rem;--bs-navbar-brand-font-size: 1.25rem;--bs-navbar-brand-color: rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-brand-hover-color: rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-nav-link-padding-x: .5rem;--bs-navbar-toggler-padding-y: .25rem;--bs-navbar-toggler-padding-x: .75rem;--bs-navbar-toggler-font-size: 1.25rem;--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");--bs-navbar-toggler-border-color: rgba(var(--bs-emphasis-color-rgb), .15);--bs-navbar-toggler-border-radius: var(--bs-border-radius);--bs-navbar-toggler-focus-width: .25rem;--bs-navbar-toggler-transition: box-shadow .15s ease-in-out;position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:var(--bs-navbar-padding-y) var(--bs-navbar-padding-x)}.navbar>.container,.navbar>.container-fluid,.navbar>.container-sm,.navbar>.container-md,.navbar>.container-lg,.navbar>.container-xl,.navbar>.container-xxl{display:flex;flex-wrap:inherit;align-items:center;justify-content:space-between}.navbar-brand{padding-top:var(--bs-navbar-brand-padding-y);padding-bottom:var(--bs-navbar-brand-padding-y);margin-right:var(--bs-navbar-brand-margin-end);font-size:var(--bs-navbar-brand-font-size);color:var(--bs-navbar-brand-color);text-decoration:none;white-space:nowrap}.navbar-brand:hover,.navbar-brand:focus{color:var(--bs-navbar-brand-hover-color)}.navbar-nav{--bs-nav-link-padding-x: 0;--bs-nav-link-padding-y: .5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color: var(--bs-navbar-color);--bs-nav-link-hover-color: var(--bs-navbar-hover-color);--bs-nav-link-disabled-color: var(--bs-navbar-disabled-color);display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link.active,.navbar-nav .nav-link.show{color:var(--bs-navbar-active-color)}.navbar-nav .dropdown-menu{position:static}.navbar-text{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-navbar-color)}.navbar-text a,.navbar-text a:hover,.navbar-text a:focus{color:var(--bs-navbar-active-color)}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:var(--bs-navbar-toggler-padding-y) var(--bs-navbar-toggler-padding-x);font-size:var(--bs-navbar-toggler-font-size);line-height:1;color:var(--bs-navbar-color);background-color:transparent;border:var(--bs-border-width) solid var(--bs-navbar-toggler-border-color);border-radius:var(--bs-navbar-toggler-border-radius);transition:var(--bs-navbar-toggler-transition)}@media (prefers-reduced-motion: reduce){.navbar-toggler{transition:none}}.navbar-toggler:hover{text-decoration:none}.navbar-toggler:focus{text-decoration:none;outline:0;box-shadow:0 0 0 var(--bs-navbar-toggler-focus-width)}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;background-image:var(--bs-navbar-toggler-icon-bg);background-repeat:no-repeat;background-position:center;background-size:100%}.navbar-nav-scroll{max-height:var(--bs-scroll-height, 75vh);overflow-y:auto}@media (min-width: 576px){.navbar-expand-sm{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-sm .offcanvas .offcanvas-header{display:none}.navbar-expand-sm .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 768px){.navbar-expand-md{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-md .offcanvas .offcanvas-header{display:none}.navbar-expand-md .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 992px){.navbar-expand-lg{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-lg .offcanvas .offcanvas-header{display:none}.navbar-expand-lg .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 1200px){.navbar-expand-xl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xl .offcanvas .offcanvas-header{display:none}.navbar-expand-xl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 1400px){.navbar-expand-xxl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xxl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}.navbar-expand-xxl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xxl .offcanvas .offcanvas-header{display:none}.navbar-expand-xxl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}.navbar-expand{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand .offcanvas .offcanvas-header{display:none}.navbar-expand .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}.navbar-dark,.navbar[data-bs-theme=dark]{--bs-navbar-color: rgba(255, 255, 255, .55);--bs-navbar-hover-color: rgba(255, 255, 255, .75);--bs-navbar-disabled-color: rgba(255, 255, 255, .25);--bs-navbar-active-color: #fff;--bs-navbar-brand-color: #fff;--bs-navbar-brand-hover-color: #fff;--bs-navbar-toggler-border-color: rgba(255, 255, 255, .1);--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}[data-bs-theme=dark] .navbar-toggler-icon{--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.badge{--bs-badge-padding-x: .65em;--bs-badge-padding-y: .35em;--bs-badge-font-size: .75em;--bs-badge-font-weight: 700;--bs-badge-color: #fff;--bs-badge-border-radius: var(--bs-border-radius);display:inline-block;padding:var(--bs-badge-padding-y) var(--bs-badge-padding-x);font-size:var(--bs-badge-font-size);font-weight:var(--bs-badge-font-weight);line-height:1;color:var(--bs-badge-color);text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:var(--bs-badge-border-radius)}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress,.progress-stacked{--bs-progress-height: 1rem;--bs-progress-font-size: .75rem;--bs-progress-bg: var(--bs-secondary-bg);--bs-progress-border-radius: var(--bs-border-radius);--bs-progress-box-shadow: var(--bs-box-shadow-inset);--bs-progress-bar-color: #fff;--bs-progress-bar-bg: #0d6efd;--bs-progress-bar-transition: width .6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}.progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media (prefers-reduced-motion: reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}.progress-stacked>.progress{overflow:visible}.progress-stacked>.progress>.progress-bar{width:100%}.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media (prefers-reduced-motion: reduce){.progress-bar-animated{animation:none}}.nav{--bs-nav-link-padding-x: 1rem;--bs-nav-link-padding-y: .5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color: var(--bs-link-color);--bs-nav-link-hover-color: var(--bs-link-hover-color);--bs-nav-link-disabled-color: var(--bs-secondary-color);display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);font-size:var(--bs-nav-link-font-size);font-weight:var(--bs-nav-link-font-weight);color:var(--bs-nav-link-color);text-decoration:none;background:none;border:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media (prefers-reduced-motion: reduce){.nav-link{transition:none}}.nav-link:hover,.nav-link:focus{color:var(--bs-nav-link-hover-color)}.nav-link:focus-visible{outline:0;box-shadow:0 0 0 .25rem #0d6efd40}.nav-link.disabled,.nav-link:disabled{color:var(--bs-nav-link-disabled-color);pointer-events:none;cursor:default}.nav-tabs{--bs-nav-tabs-border-width: var(--bs-border-width);--bs-nav-tabs-border-color: var(--bs-border-color);--bs-nav-tabs-border-radius: var(--bs-border-radius);--bs-nav-tabs-link-hover-border-color: var(--bs-secondary-bg) var(--bs-secondary-bg) var(--bs-border-color);--bs-nav-tabs-link-active-color: var(--bs-emphasis-color);--bs-nav-tabs-link-active-bg: var(--bs-body-bg);--bs-nav-tabs-link-active-border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.nav-tabs .nav-link{margin-bottom:calc(-1 * var(--bs-nav-tabs-border-width));border:var(--bs-nav-tabs-border-width) solid transparent;border-top-left-radius:var(--bs-nav-tabs-border-radius);border-top-right-radius:var(--bs-nav-tabs-border-radius)}.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{isolation:isolate;border-color:var(--bs-nav-tabs-link-hover-border-color)}.nav-tabs .nav-link.active,.nav-tabs .nav-item.show .nav-link{color:var(--bs-nav-tabs-link-active-color);background-color:var(--bs-nav-tabs-link-active-bg);border-color:var(--bs-nav-tabs-link-active-border-color)}.nav-tabs .dropdown-menu{margin-top:calc(-1 * var(--bs-nav-tabs-border-width));border-top-left-radius:0;border-top-right-radius:0}.nav-pills{--bs-nav-pills-border-radius: var(--bs-border-radius);--bs-nav-pills-link-active-color: #fff;--bs-nav-pills-link-active-bg: #0d6efd}.nav-pills .nav-link{border-radius:var(--bs-nav-pills-border-radius)}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:var(--bs-nav-pills-link-active-color);background-color:var(--bs-nav-pills-link-active-bg)}.nav-underline{--bs-nav-underline-gap: 1rem;--bs-nav-underline-border-width: .125rem;--bs-nav-underline-link-active-color: var(--bs-emphasis-color);gap:var(--bs-nav-underline-gap)}.nav-underline .nav-link{padding-right:0;padding-left:0;border-bottom:var(--bs-nav-underline-border-width) solid transparent}.nav-underline .nav-link:hover,.nav-underline .nav-link:focus{border-bottom-color:currentcolor}.nav-underline .nav-link.active,.nav-underline .show>.nav-link{font-weight:700;color:var(--bs-nav-underline-link-active-color);border-bottom-color:currentcolor}.nav-fill>.nav-link,.nav-fill .nav-item{flex:1 1 auto;text-align:center}.nav-justified>.nav-link,.nav-justified .nav-item{flex-basis:0;flex-grow:1;text-align:center}.nav-fill .nav-item .nav-link,.nav-justified .nav-item .nav-link{width:100%}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.card{--bs-card-spacer-y: 1rem;--bs-card-spacer-x: 1rem;--bs-card-title-spacer-y: .5rem;--bs-card-title-color: ;--bs-card-subtitle-color: ;--bs-card-border-width: var(--bs-border-width);--bs-card-border-color: var(--bs-border-color-translucent);--bs-card-border-radius: var(--bs-border-radius);--bs-card-box-shadow: ;--bs-card-inner-border-radius: calc(var(--bs-border-radius) - (var(--bs-border-width)));--bs-card-cap-padding-y: .5rem;--bs-card-cap-padding-x: 1rem;--bs-card-cap-bg: rgba(var(--bs-body-color-rgb), .03);--bs-card-cap-color: ;--bs-card-height: ;--bs-card-color: ;--bs-card-bg: var(--bs-body-bg);--bs-card-img-overlay-padding: 1rem;--bs-card-group-margin: .75rem;position:relative;display:flex;flex-direction:column;min-width:0;height:var(--bs-card-height);color:var(--bs-body-color);word-wrap:break-word;background-color:var(--bs-card-bg);background-clip:border-box;border:var(--bs-card-border-width) solid var(--bs-card-border-color);border-radius:var(--bs-card-border-radius)}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;padding:var(--bs-card-spacer-y) var(--bs-card-spacer-x);color:var(--bs-card-color)}.card-title{margin-bottom:var(--bs-card-title-spacer-y);color:var(--bs-card-title-color)}.card-subtitle{margin-top:calc(-.5 * var(--bs-card-title-spacer-y));margin-bottom:0;color:var(--bs-card-subtitle-color)}.card-text:last-child{margin-bottom:0}.card-link+.card-link{margin-left:var(--bs-card-spacer-x)}.card-header{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);margin-bottom:0;color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-bottom:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-header:first-child{border-radius:var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0}.card-footer{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-top:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-footer:last-child{border-radius:0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius)}.card-header-tabs{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-bottom:calc(-1 * var(--bs-card-cap-padding-y));margin-left:calc(-.5 * var(--bs-card-cap-padding-x));border-bottom:0}.card-header-tabs .nav-link.active{background-color:var(--bs-card-bg);border-bottom-color:var(--bs-card-bg)}.card-header-pills{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-left:calc(-.5 * var(--bs-card-cap-padding-x))}.card-img-overlay{position:absolute;inset:0;padding:var(--bs-card-img-overlay-padding);border-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-top,.card-img-bottom{width:100%}.card-img,.card-img-top{border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-bottom{border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card-group>.card{margin-bottom:var(--bs-card-group-margin)}@media (min-width: 576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-img-top,.card-group>.card:not(:last-child) .card-header{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-img-bottom,.card-group>.card:not(:last-child) .card-footer{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-img-top,.card-group>.card:not(:first-child) .card-header{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-img-bottom,.card-group>.card:not(:first-child) .card-footer{border-bottom-left-radius:0}}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.float-start{float:left!important}.float-end{float:right!important}.float-none{float:none!important}.object-fit-contain{object-fit:contain!important}.object-fit-cover{object-fit:cover!important}.object-fit-fill{object-fit:fill!important}.object-fit-scale{object-fit:scale-down!important}.object-fit-none{object-fit:none!important}.opacity-0{opacity:0!important}.opacity-25{opacity:.25!important}.opacity-50{opacity:.5!important}.opacity-75{opacity:.75!important}.opacity-100{opacity:1!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-visible{overflow:visible!important}.overflow-scroll{overflow:scroll!important}.overflow-x-auto{overflow-x:auto!important}.overflow-x-hidden{overflow-x:hidden!important}.overflow-x-visible{overflow-x:visible!important}.overflow-x-scroll{overflow-x:scroll!important}.overflow-y-auto{overflow-y:auto!important}.overflow-y-hidden{overflow-y:hidden!important}.overflow-y-visible{overflow-y:visible!important}.overflow-y-scroll{overflow-y:scroll!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-grid{display:grid!important}.d-inline-grid{display:inline-grid!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}.d-none{display:none!important}.shadow{box-shadow:var(--bs-box-shadow)!important}.shadow-sm{box-shadow:var(--bs-box-shadow-sm)!important}.shadow-lg{box-shadow:var(--bs-box-shadow-lg)!important}.shadow-none{box-shadow:none!important}.focus-ring-primary{--bs-focus-ring-color: rgba(var(--bs-primary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-secondary{--bs-focus-ring-color: rgba(var(--bs-secondary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-success{--bs-focus-ring-color: rgba(var(--bs-success-rgb), var(--bs-focus-ring-opacity))}.focus-ring-info{--bs-focus-ring-color: rgba(var(--bs-info-rgb), var(--bs-focus-ring-opacity))}.focus-ring-warning{--bs-focus-ring-color: rgba(var(--bs-warning-rgb), var(--bs-focus-ring-opacity))}.focus-ring-danger{--bs-focus-ring-color: rgba(var(--bs-danger-rgb), var(--bs-focus-ring-opacity))}.focus-ring-light{--bs-focus-ring-color: rgba(var(--bs-light-rgb), var(--bs-focus-ring-opacity))}.focus-ring-dark{--bs-focus-ring-color: rgba(var(--bs-dark-rgb), var(--bs-focus-ring-opacity))}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.top-0{top:0!important}.top-50{top:50%!important}.top-100{top:100%!important}.bottom-0{bottom:0!important}.bottom-50{bottom:50%!important}.bottom-100{bottom:100%!important}.start-0{left:0!important}.start-50{left:50%!important}.start-100{left:100%!important}.end-0{right:0!important}.end-50{right:50%!important}.end-100{right:100%!important}.translate-middle{transform:translate(-50%,-50%)!important}.translate-middle-x{transform:translate(-50%)!important}.translate-middle-y{transform:translateY(-50%)!important}.border{border:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-0{border:0!important}.border-top{border-top:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-top-0{border-top:0!important}.border-end{border-right:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-end-0{border-right:0!important}.border-bottom{border-bottom:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-bottom-0{border-bottom:0!important}.border-start{border-left:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-start-0{border-left:0!important}.border-primary{--bs-border-opacity: 1;border-color:rgba(var(--bs-primary-rgb),var(--bs-border-opacity))!important}.border-secondary{--bs-border-opacity: 1;border-color:rgba(var(--bs-secondary-rgb),var(--bs-border-opacity))!important}.border-success{--bs-border-opacity: 1;border-color:rgba(var(--bs-success-rgb),var(--bs-border-opacity))!important}.border-info{--bs-border-opacity: 1;border-color:rgba(var(--bs-info-rgb),var(--bs-border-opacity))!important}.border-warning{--bs-border-opacity: 1;border-color:rgba(var(--bs-warning-rgb),var(--bs-border-opacity))!important}.border-danger{--bs-border-opacity: 1;border-color:rgba(var(--bs-danger-rgb),var(--bs-border-opacity))!important}.border-light{--bs-border-opacity: 1;border-color:rgba(var(--bs-light-rgb),var(--bs-border-opacity))!important}.border-dark{--bs-border-opacity: 1;border-color:rgba(var(--bs-dark-rgb),var(--bs-border-opacity))!important}.border-black{--bs-border-opacity: 1;border-color:rgba(var(--bs-black-rgb),var(--bs-border-opacity))!important}.border-white{--bs-border-opacity: 1;border-color:rgba(var(--bs-white-rgb),var(--bs-border-opacity))!important}.border-primary-subtle{border-color:var(--bs-primary-border-subtle)!important}.border-secondary-subtle{border-color:var(--bs-secondary-border-subtle)!important}.border-success-subtle{border-color:var(--bs-success-border-subtle)!important}.border-info-subtle{border-color:var(--bs-info-border-subtle)!important}.border-warning-subtle{border-color:var(--bs-warning-border-subtle)!important}.border-danger-subtle{border-color:var(--bs-danger-border-subtle)!important}.border-light-subtle{border-color:var(--bs-light-border-subtle)!important}.border-dark-subtle{border-color:var(--bs-dark-border-subtle)!important}.border-1{border-width:1px!important}.border-2{border-width:2px!important}.border-3{border-width:3px!important}.border-4{border-width:4px!important}.border-5{border-width:5px!important}.border-opacity-10{--bs-border-opacity: .1}.border-opacity-25{--bs-border-opacity: .25}.border-opacity-50{--bs-border-opacity: .5}.border-opacity-75{--bs-border-opacity: .75}.border-opacity-100{--bs-border-opacity: 1}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.mw-100{max-width:100%!important}.vw-100{width:100vw!important}.min-vw-100{min-width:100vw!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mh-100{max-height:100%!important}.vh-100{height:100vh!important}.min-vh-100{min-height:100vh!important}.flex-fill{flex:1 1 auto!important}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.justify-content-evenly{justify-content:space-evenly!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}.order-first{order:-1!important}.order-0{order:0!important}.order-1{order:1!important}.order-2{order:2!important}.order-3{order:3!important}.order-4{order:4!important}.order-5{order:5!important}.order-last{order:6!important}.m-0{margin:0!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}.m-5{margin:3rem!important}.m-auto{margin:auto!important}.mx-0{margin-right:0!important;margin-left:0!important}.mx-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-3{margin-right:1rem!important;margin-left:1rem!important}.mx-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-5{margin-right:3rem!important;margin-left:3rem!important}.mx-auto{margin-right:auto!important;margin-left:auto!important}.my-0{margin-top:0!important;margin-bottom:0!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}.mt-auto{margin-top:auto!important}.me-0{margin-right:0!important}.me-1{margin-right:.25rem!important}.me-2{margin-right:.5rem!important}.me-3{margin-right:1rem!important}.me-4{margin-right:1.5rem!important}.me-5{margin-right:3rem!important}.me-auto{margin-right:auto!important}.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}.mb-auto{margin-bottom:auto!important}.ms-0{margin-left:0!important}.ms-1{margin-left:.25rem!important}.ms-2{margin-left:.5rem!important}.ms-3{margin-left:1rem!important}.ms-4{margin-left:1.5rem!important}.ms-5{margin-left:3rem!important}.ms-auto{margin-left:auto!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:3rem!important}.px-0{padding-right:0!important;padding-left:0!important}.px-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-3{padding-right:1rem!important;padding-left:1rem!important}.px-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-5{padding-right:3rem!important;padding-left:3rem!important}.py-0{padding-top:0!important;padding-bottom:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pt-4{padding-top:1.5rem!important}.pt-5{padding-top:3rem!important}.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}.pe-4{padding-right:1.5rem!important}.pe-5{padding-right:3rem!important}.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}.pb-4{padding-bottom:1.5rem!important}.pb-5{padding-bottom:3rem!important}.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}.ps-4{padding-left:1.5rem!important}.ps-5{padding-left:3rem!important}.gap-0{gap:0!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-3{gap:1rem!important}.gap-4{gap:1.5rem!important}.gap-5{gap:3rem!important}.row-gap-0{row-gap:0!important}.row-gap-1{row-gap:.25rem!important}.row-gap-2{row-gap:.5rem!important}.row-gap-3{row-gap:1rem!important}.row-gap-4{row-gap:1.5rem!important}.row-gap-5{row-gap:3rem!important}.column-gap-0{column-gap:0!important}.column-gap-1{column-gap:.25rem!important}.column-gap-2{column-gap:.5rem!important}.column-gap-3{column-gap:1rem!important}.column-gap-4{column-gap:1.5rem!important}.column-gap-5{column-gap:3rem!important}.font-monospace{font-family:var(--bs-font-monospace)!important}.fs-1{font-size:calc(1.375rem + 1.5vw)!important}.fs-2{font-size:calc(1.325rem + .9vw)!important}.fs-3{font-size:calc(1.3rem + .6vw)!important}.fs-4{font-size:calc(1.275rem + .3vw)!important}.fs-5{font-size:1.25rem!important}.fs-6{font-size:1rem!important}.fst-italic{font-style:italic!important}.fst-normal{font-style:normal!important}.fw-lighter{font-weight:lighter!important}.fw-light{font-weight:300!important}.fw-normal{font-weight:400!important}.fw-medium{font-weight:500!important}.fw-semibold{font-weight:600!important}.fw-bold{font-weight:700!important}.fw-bolder{font-weight:bolder!important}.lh-1{line-height:1!important}.lh-sm{line-height:1.25!important}.lh-base{line-height:1.5!important}.lh-lg{line-height:2!important}.text-start{text-align:left!important}.text-end{text-align:right!important}.text-center{text-align:center!important}.text-decoration-none{text-decoration:none!important}.text-decoration-underline{text-decoration:underline!important}.text-decoration-line-through{text-decoration:line-through!important}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-break{word-wrap:break-word!important;word-break:break-word!important}.text-primary{--bs-text-opacity: 1;color:rgba(var(--bs-primary-rgb),var(--bs-text-opacity))!important}.text-secondary{--bs-text-opacity: 1;color:rgba(var(--bs-secondary-rgb),var(--bs-text-opacity))!important}.text-success{--bs-text-opacity: 1;color:rgba(var(--bs-success-rgb),var(--bs-text-opacity))!important}.text-info{--bs-text-opacity: 1;color:rgba(var(--bs-info-rgb),var(--bs-text-opacity))!important}.text-warning{--bs-text-opacity: 1;color:rgba(var(--bs-warning-rgb),var(--bs-text-opacity))!important}.text-danger{--bs-text-opacity: 1;color:rgba(var(--bs-danger-rgb),var(--bs-text-opacity))!important}.text-light{--bs-text-opacity: 1;color:rgba(var(--bs-light-rgb),var(--bs-text-opacity))!important}.text-dark{--bs-text-opacity: 1;color:rgba(var(--bs-dark-rgb),var(--bs-text-opacity))!important}.text-black{--bs-text-opacity: 1;color:rgba(var(--bs-black-rgb),var(--bs-text-opacity))!important}.text-white{--bs-text-opacity: 1;color:rgba(var(--bs-white-rgb),var(--bs-text-opacity))!important}.text-body{--bs-text-opacity: 1;color:rgba(var(--bs-body-color-rgb),var(--bs-text-opacity))!important}.text-muted{--bs-text-opacity: 1;color:var(--bs-secondary-color)!important}.text-black-50{--bs-text-opacity: 1;color:#00000080!important}.text-white-50{--bs-text-opacity: 1;color:#ffffff80!important}.text-body-secondary{--bs-text-opacity: 1;color:var(--bs-secondary-color)!important}.text-body-tertiary{--bs-text-opacity: 1;color:var(--bs-tertiary-color)!important}.text-body-emphasis{--bs-text-opacity: 1;color:var(--bs-emphasis-color)!important}.text-reset{--bs-text-opacity: 1;color:inherit!important}.text-opacity-25{--bs-text-opacity: .25}.text-opacity-50{--bs-text-opacity: .5}.text-opacity-75{--bs-text-opacity: .75}.text-opacity-100{--bs-text-opacity: 1}.text-primary-emphasis{color:var(--bs-primary-text-emphasis)!important}.text-secondary-emphasis{color:var(--bs-secondary-text-emphasis)!important}.text-success-emphasis{color:var(--bs-success-text-emphasis)!important}.text-info-emphasis{color:var(--bs-info-text-emphasis)!important}.text-warning-emphasis{color:var(--bs-warning-text-emphasis)!important}.text-danger-emphasis{color:var(--bs-danger-text-emphasis)!important}.text-light-emphasis{color:var(--bs-light-text-emphasis)!important}.text-dark-emphasis{color:var(--bs-dark-text-emphasis)!important}.link-opacity-10,.link-opacity-10-hover:hover{--bs-link-opacity: .1}.link-opacity-25,.link-opacity-25-hover:hover{--bs-link-opacity: .25}.link-opacity-50,.link-opacity-50-hover:hover{--bs-link-opacity: .5}.link-opacity-75,.link-opacity-75-hover:hover{--bs-link-opacity: .75}.link-opacity-100,.link-opacity-100-hover:hover{--bs-link-opacity: 1}.link-offset-1,.link-offset-1-hover:hover{text-underline-offset:.125em!important}.link-offset-2,.link-offset-2-hover:hover{text-underline-offset:.25em!important}.link-offset-3,.link-offset-3-hover:hover{text-underline-offset:.375em!important}.link-underline-primary{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-primary-rgb),var(--bs-link-underline-opacity))!important}.link-underline-secondary{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-secondary-rgb),var(--bs-link-underline-opacity))!important}.link-underline-success{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-success-rgb),var(--bs-link-underline-opacity))!important}.link-underline-info{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-info-rgb),var(--bs-link-underline-opacity))!important}.link-underline-warning{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-warning-rgb),var(--bs-link-underline-opacity))!important}.link-underline-danger{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-danger-rgb),var(--bs-link-underline-opacity))!important}.link-underline-light{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-light-rgb),var(--bs-link-underline-opacity))!important}.link-underline-dark{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-dark-rgb),var(--bs-link-underline-opacity))!important}.link-underline{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-underline-opacity, 1))!important}.link-underline-opacity-0,.link-underline-opacity-0-hover:hover{--bs-link-underline-opacity: 0}.link-underline-opacity-10,.link-underline-opacity-10-hover:hover{--bs-link-underline-opacity: .1}.link-underline-opacity-25,.link-underline-opacity-25-hover:hover{--bs-link-underline-opacity: .25}.link-underline-opacity-50,.link-underline-opacity-50-hover:hover{--bs-link-underline-opacity: .5}.link-underline-opacity-75,.link-underline-opacity-75-hover:hover{--bs-link-underline-opacity: .75}.link-underline-opacity-100,.link-underline-opacity-100-hover:hover{--bs-link-underline-opacity: 1}.bg-primary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-primary-rgb),var(--bs-bg-opacity))!important}.bg-secondary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-secondary-rgb),var(--bs-bg-opacity))!important}.bg-success{--bs-bg-opacity: 1;background-color:rgba(var(--bs-success-rgb),var(--bs-bg-opacity))!important}.bg-info{--bs-bg-opacity: 1;background-color:rgba(var(--bs-info-rgb),var(--bs-bg-opacity))!important}.bg-warning{--bs-bg-opacity: 1;background-color:rgba(var(--bs-warning-rgb),var(--bs-bg-opacity))!important}.bg-danger{--bs-bg-opacity: 1;background-color:rgba(var(--bs-danger-rgb),var(--bs-bg-opacity))!important}.bg-light{--bs-bg-opacity: 1;background-color:rgba(var(--bs-light-rgb),var(--bs-bg-opacity))!important}.bg-dark{--bs-bg-opacity: 1;background-color:rgba(var(--bs-dark-rgb),var(--bs-bg-opacity))!important}.bg-black{--bs-bg-opacity: 1;background-color:rgba(var(--bs-black-rgb),var(--bs-bg-opacity))!important}.bg-white{--bs-bg-opacity: 1;background-color:rgba(var(--bs-white-rgb),var(--bs-bg-opacity))!important}.bg-body{--bs-bg-opacity: 1;background-color:rgba(var(--bs-body-bg-rgb),var(--bs-bg-opacity))!important}.bg-transparent{--bs-bg-opacity: 1;background-color:transparent!important}.bg-body-secondary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-secondary-bg-rgb),var(--bs-bg-opacity))!important}.bg-body-tertiary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-tertiary-bg-rgb),var(--bs-bg-opacity))!important}.bg-opacity-10{--bs-bg-opacity: .1}.bg-opacity-25{--bs-bg-opacity: .25}.bg-opacity-50{--bs-bg-opacity: .5}.bg-opacity-75{--bs-bg-opacity: .75}.bg-opacity-100{--bs-bg-opacity: 1}.bg-primary-subtle{background-color:var(--bs-primary-bg-subtle)!important}.bg-secondary-subtle{background-color:var(--bs-secondary-bg-subtle)!important}.bg-success-subtle{background-color:var(--bs-success-bg-subtle)!important}.bg-info-subtle{background-color:var(--bs-info-bg-subtle)!important}.bg-warning-subtle{background-color:var(--bs-warning-bg-subtle)!important}.bg-danger-subtle{background-color:var(--bs-danger-bg-subtle)!important}.bg-light-subtle{background-color:var(--bs-light-bg-subtle)!important}.bg-dark-subtle{background-color:var(--bs-dark-bg-subtle)!important}.bg-gradient{background-image:var(--bs-gradient)!important}.user-select-all{-webkit-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;user-select:none!important}.pe-none{pointer-events:none!important}.pe-auto{pointer-events:auto!important}.rounded{border-radius:var(--bs-border-radius)!important}.rounded-0{border-radius:0!important}.rounded-1{border-radius:var(--bs-border-radius-sm)!important}.rounded-2{border-radius:var(--bs-border-radius)!important}.rounded-3{border-radius:var(--bs-border-radius-lg)!important}.rounded-4{border-radius:var(--bs-border-radius-xl)!important}.rounded-5{border-radius:var(--bs-border-radius-xxl)!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:var(--bs-border-radius-pill)!important}.rounded-top{border-top-left-radius:var(--bs-border-radius)!important;border-top-right-radius:var(--bs-border-radius)!important}.rounded-top-0{border-top-left-radius:0!important;border-top-right-radius:0!important}.rounded-top-1{border-top-left-radius:var(--bs-border-radius-sm)!important;border-top-right-radius:var(--bs-border-radius-sm)!important}.rounded-top-2{border-top-left-radius:var(--bs-border-radius)!important;border-top-right-radius:var(--bs-border-radius)!important}.rounded-top-3{border-top-left-radius:var(--bs-border-radius-lg)!important;border-top-right-radius:var(--bs-border-radius-lg)!important}.rounded-top-4{border-top-left-radius:var(--bs-border-radius-xl)!important;border-top-right-radius:var(--bs-border-radius-xl)!important}.rounded-top-5{border-top-left-radius:var(--bs-border-radius-xxl)!important;border-top-right-radius:var(--bs-border-radius-xxl)!important}.rounded-top-circle{border-top-left-radius:50%!important;border-top-right-radius:50%!important}.rounded-top-pill{border-top-left-radius:var(--bs-border-radius-pill)!important;border-top-right-radius:var(--bs-border-radius-pill)!important}.rounded-end{border-top-right-radius:var(--bs-border-radius)!important;border-bottom-right-radius:var(--bs-border-radius)!important}.rounded-end-0{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.rounded-end-1{border-top-right-radius:var(--bs-border-radius-sm)!important;border-bottom-right-radius:var(--bs-border-radius-sm)!important}.rounded-end-2{border-top-right-radius:var(--bs-border-radius)!important;border-bottom-right-radius:var(--bs-border-radius)!important}.rounded-end-3{border-top-right-radius:var(--bs-border-radius-lg)!important;border-bottom-right-radius:var(--bs-border-radius-lg)!important}.rounded-end-4{border-top-right-radius:var(--bs-border-radius-xl)!important;border-bottom-right-radius:var(--bs-border-radius-xl)!important}.rounded-end-5{border-top-right-radius:var(--bs-border-radius-xxl)!important;border-bottom-right-radius:var(--bs-border-radius-xxl)!important}.rounded-end-circle{border-top-right-radius:50%!important;border-bottom-right-radius:50%!important}.rounded-end-pill{border-top-right-radius:var(--bs-border-radius-pill)!important;border-bottom-right-radius:var(--bs-border-radius-pill)!important}.rounded-bottom{border-bottom-right-radius:var(--bs-border-radius)!important;border-bottom-left-radius:var(--bs-border-radius)!important}.rounded-bottom-0{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.rounded-bottom-1{border-bottom-right-radius:var(--bs-border-radius-sm)!important;border-bottom-left-radius:var(--bs-border-radius-sm)!important}.rounded-bottom-2{border-bottom-right-radius:var(--bs-border-radius)!important;border-bottom-left-radius:var(--bs-border-radius)!important}.rounded-bottom-3{border-bottom-right-radius:var(--bs-border-radius-lg)!important;border-bottom-left-radius:var(--bs-border-radius-lg)!important}.rounded-bottom-4{border-bottom-right-radius:var(--bs-border-radius-xl)!important;border-bottom-left-radius:var(--bs-border-radius-xl)!important}.rounded-bottom-5{border-bottom-right-radius:var(--bs-border-radius-xxl)!important;border-bottom-left-radius:var(--bs-border-radius-xxl)!important}.rounded-bottom-circle{border-bottom-right-radius:50%!important;border-bottom-left-radius:50%!important}.rounded-bottom-pill{border-bottom-right-radius:var(--bs-border-radius-pill)!important;border-bottom-left-radius:var(--bs-border-radius-pill)!important}.rounded-start{border-bottom-left-radius:var(--bs-border-radius)!important;border-top-left-radius:var(--bs-border-radius)!important}.rounded-start-0{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.rounded-start-1{border-bottom-left-radius:var(--bs-border-radius-sm)!important;border-top-left-radius:var(--bs-border-radius-sm)!important}.rounded-start-2{border-bottom-left-radius:var(--bs-border-radius)!important;border-top-left-radius:var(--bs-border-radius)!important}.rounded-start-3{border-bottom-left-radius:var(--bs-border-radius-lg)!important;border-top-left-radius:var(--bs-border-radius-lg)!important}.rounded-start-4{border-bottom-left-radius:var(--bs-border-radius-xl)!important;border-top-left-radius:var(--bs-border-radius-xl)!important}.rounded-start-5{border-bottom-left-radius:var(--bs-border-radius-xxl)!important;border-top-left-radius:var(--bs-border-radius-xxl)!important}.rounded-start-circle{border-bottom-left-radius:50%!important;border-top-left-radius:50%!important}.rounded-start-pill{border-bottom-left-radius:var(--bs-border-radius-pill)!important;border-top-left-radius:var(--bs-border-radius-pill)!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}.z-n1{z-index:-1!important}.z-0{z-index:0!important}.z-1{z-index:1!important}.z-2{z-index:2!important}.z-3{z-index:3!important}@media (min-width: 576px){.float-sm-start{float:left!important}.float-sm-end{float:right!important}.float-sm-none{float:none!important}.object-fit-sm-contain{object-fit:contain!important}.object-fit-sm-cover{object-fit:cover!important}.object-fit-sm-fill{object-fit:fill!important}.object-fit-sm-scale{object-fit:scale-down!important}.object-fit-sm-none{object-fit:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-grid{display:grid!important}.d-sm-inline-grid{display:inline-grid!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}.d-sm-none{display:none!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.justify-content-sm-evenly{justify-content:space-evenly!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}.order-sm-first{order:-1!important}.order-sm-0{order:0!important}.order-sm-1{order:1!important}.order-sm-2{order:2!important}.order-sm-3{order:3!important}.order-sm-4{order:4!important}.order-sm-5{order:5!important}.order-sm-last{order:6!important}.m-sm-0{margin:0!important}.m-sm-1{margin:.25rem!important}.m-sm-2{margin:.5rem!important}.m-sm-3{margin:1rem!important}.m-sm-4{margin:1.5rem!important}.m-sm-5{margin:3rem!important}.m-sm-auto{margin:auto!important}.mx-sm-0{margin-right:0!important;margin-left:0!important}.mx-sm-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-sm-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-sm-3{margin-right:1rem!important;margin-left:1rem!important}.mx-sm-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-sm-5{margin-right:3rem!important;margin-left:3rem!important}.mx-sm-auto{margin-right:auto!important;margin-left:auto!important}.my-sm-0{margin-top:0!important;margin-bottom:0!important}.my-sm-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-sm-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-sm-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-sm-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-sm-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-sm-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-sm-0{margin-top:0!important}.mt-sm-1{margin-top:.25rem!important}.mt-sm-2{margin-top:.5rem!important}.mt-sm-3{margin-top:1rem!important}.mt-sm-4{margin-top:1.5rem!important}.mt-sm-5{margin-top:3rem!important}.mt-sm-auto{margin-top:auto!important}.me-sm-0{margin-right:0!important}.me-sm-1{margin-right:.25rem!important}.me-sm-2{margin-right:.5rem!important}.me-sm-3{margin-right:1rem!important}.me-sm-4{margin-right:1.5rem!important}.me-sm-5{margin-right:3rem!important}.me-sm-auto{margin-right:auto!important}.mb-sm-0{margin-bottom:0!important}.mb-sm-1{margin-bottom:.25rem!important}.mb-sm-2{margin-bottom:.5rem!important}.mb-sm-3{margin-bottom:1rem!important}.mb-sm-4{margin-bottom:1.5rem!important}.mb-sm-5{margin-bottom:3rem!important}.mb-sm-auto{margin-bottom:auto!important}.ms-sm-0{margin-left:0!important}.ms-sm-1{margin-left:.25rem!important}.ms-sm-2{margin-left:.5rem!important}.ms-sm-3{margin-left:1rem!important}.ms-sm-4{margin-left:1.5rem!important}.ms-sm-5{margin-left:3rem!important}.ms-sm-auto{margin-left:auto!important}.p-sm-0{padding:0!important}.p-sm-1{padding:.25rem!important}.p-sm-2{padding:.5rem!important}.p-sm-3{padding:1rem!important}.p-sm-4{padding:1.5rem!important}.p-sm-5{padding:3rem!important}.px-sm-0{padding-right:0!important;padding-left:0!important}.px-sm-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-sm-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-sm-3{padding-right:1rem!important;padding-left:1rem!important}.px-sm-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-sm-5{padding-right:3rem!important;padding-left:3rem!important}.py-sm-0{padding-top:0!important;padding-bottom:0!important}.py-sm-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-sm-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-sm-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-sm-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-sm-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-sm-0{padding-top:0!important}.pt-sm-1{padding-top:.25rem!important}.pt-sm-2{padding-top:.5rem!important}.pt-sm-3{padding-top:1rem!important}.pt-sm-4{padding-top:1.5rem!important}.pt-sm-5{padding-top:3rem!important}.pe-sm-0{padding-right:0!important}.pe-sm-1{padding-right:.25rem!important}.pe-sm-2{padding-right:.5rem!important}.pe-sm-3{padding-right:1rem!important}.pe-sm-4{padding-right:1.5rem!important}.pe-sm-5{padding-right:3rem!important}.pb-sm-0{padding-bottom:0!important}.pb-sm-1{padding-bottom:.25rem!important}.pb-sm-2{padding-bottom:.5rem!important}.pb-sm-3{padding-bottom:1rem!important}.pb-sm-4{padding-bottom:1.5rem!important}.pb-sm-5{padding-bottom:3rem!important}.ps-sm-0{padding-left:0!important}.ps-sm-1{padding-left:.25rem!important}.ps-sm-2{padding-left:.5rem!important}.ps-sm-3{padding-left:1rem!important}.ps-sm-4{padding-left:1.5rem!important}.ps-sm-5{padding-left:3rem!important}.gap-sm-0{gap:0!important}.gap-sm-1{gap:.25rem!important}.gap-sm-2{gap:.5rem!important}.gap-sm-3{gap:1rem!important}.gap-sm-4{gap:1.5rem!important}.gap-sm-5{gap:3rem!important}.row-gap-sm-0{row-gap:0!important}.row-gap-sm-1{row-gap:.25rem!important}.row-gap-sm-2{row-gap:.5rem!important}.row-gap-sm-3{row-gap:1rem!important}.row-gap-sm-4{row-gap:1.5rem!important}.row-gap-sm-5{row-gap:3rem!important}.column-gap-sm-0{column-gap:0!important}.column-gap-sm-1{column-gap:.25rem!important}.column-gap-sm-2{column-gap:.5rem!important}.column-gap-sm-3{column-gap:1rem!important}.column-gap-sm-4{column-gap:1.5rem!important}.column-gap-sm-5{column-gap:3rem!important}.text-sm-start{text-align:left!important}.text-sm-end{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width: 768px){.float-md-start{float:left!important}.float-md-end{float:right!important}.float-md-none{float:none!important}.object-fit-md-contain{object-fit:contain!important}.object-fit-md-cover{object-fit:cover!important}.object-fit-md-fill{object-fit:fill!important}.object-fit-md-scale{object-fit:scale-down!important}.object-fit-md-none{object-fit:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-grid{display:grid!important}.d-md-inline-grid{display:inline-grid!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}.d-md-none{display:none!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.justify-content-md-evenly{justify-content:space-evenly!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}.order-md-first{order:-1!important}.order-md-0{order:0!important}.order-md-1{order:1!important}.order-md-2{order:2!important}.order-md-3{order:3!important}.order-md-4{order:4!important}.order-md-5{order:5!important}.order-md-last{order:6!important}.m-md-0{margin:0!important}.m-md-1{margin:.25rem!important}.m-md-2{margin:.5rem!important}.m-md-3{margin:1rem!important}.m-md-4{margin:1.5rem!important}.m-md-5{margin:3rem!important}.m-md-auto{margin:auto!important}.mx-md-0{margin-right:0!important;margin-left:0!important}.mx-md-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-md-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-md-3{margin-right:1rem!important;margin-left:1rem!important}.mx-md-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-md-5{margin-right:3rem!important;margin-left:3rem!important}.mx-md-auto{margin-right:auto!important;margin-left:auto!important}.my-md-0{margin-top:0!important;margin-bottom:0!important}.my-md-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-md-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-md-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-md-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-md-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-md-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-md-0{margin-top:0!important}.mt-md-1{margin-top:.25rem!important}.mt-md-2{margin-top:.5rem!important}.mt-md-3{margin-top:1rem!important}.mt-md-4{margin-top:1.5rem!important}.mt-md-5{margin-top:3rem!important}.mt-md-auto{margin-top:auto!important}.me-md-0{margin-right:0!important}.me-md-1{margin-right:.25rem!important}.me-md-2{margin-right:.5rem!important}.me-md-3{margin-right:1rem!important}.me-md-4{margin-right:1.5rem!important}.me-md-5{margin-right:3rem!important}.me-md-auto{margin-right:auto!important}.mb-md-0{margin-bottom:0!important}.mb-md-1{margin-bottom:.25rem!important}.mb-md-2{margin-bottom:.5rem!important}.mb-md-3{margin-bottom:1rem!important}.mb-md-4{margin-bottom:1.5rem!important}.mb-md-5{margin-bottom:3rem!important}.mb-md-auto{margin-bottom:auto!important}.ms-md-0{margin-left:0!important}.ms-md-1{margin-left:.25rem!important}.ms-md-2{margin-left:.5rem!important}.ms-md-3{margin-left:1rem!important}.ms-md-4{margin-left:1.5rem!important}.ms-md-5{margin-left:3rem!important}.ms-md-auto{margin-left:auto!important}.p-md-0{padding:0!important}.p-md-1{padding:.25rem!important}.p-md-2{padding:.5rem!important}.p-md-3{padding:1rem!important}.p-md-4{padding:1.5rem!important}.p-md-5{padding:3rem!important}.px-md-0{padding-right:0!important;padding-left:0!important}.px-md-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-md-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-md-3{padding-right:1rem!important;padding-left:1rem!important}.px-md-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-md-5{padding-right:3rem!important;padding-left:3rem!important}.py-md-0{padding-top:0!important;padding-bottom:0!important}.py-md-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-md-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-md-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-md-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-md-0{padding-top:0!important}.pt-md-1{padding-top:.25rem!important}.pt-md-2{padding-top:.5rem!important}.pt-md-3{padding-top:1rem!important}.pt-md-4{padding-top:1.5rem!important}.pt-md-5{padding-top:3rem!important}.pe-md-0{padding-right:0!important}.pe-md-1{padding-right:.25rem!important}.pe-md-2{padding-right:.5rem!important}.pe-md-3{padding-right:1rem!important}.pe-md-4{padding-right:1.5rem!important}.pe-md-5{padding-right:3rem!important}.pb-md-0{padding-bottom:0!important}.pb-md-1{padding-bottom:.25rem!important}.pb-md-2{padding-bottom:.5rem!important}.pb-md-3{padding-bottom:1rem!important}.pb-md-4{padding-bottom:1.5rem!important}.pb-md-5{padding-bottom:3rem!important}.ps-md-0{padding-left:0!important}.ps-md-1{padding-left:.25rem!important}.ps-md-2{padding-left:.5rem!important}.ps-md-3{padding-left:1rem!important}.ps-md-4{padding-left:1.5rem!important}.ps-md-5{padding-left:3rem!important}.gap-md-0{gap:0!important}.gap-md-1{gap:.25rem!important}.gap-md-2{gap:.5rem!important}.gap-md-3{gap:1rem!important}.gap-md-4{gap:1.5rem!important}.gap-md-5{gap:3rem!important}.row-gap-md-0{row-gap:0!important}.row-gap-md-1{row-gap:.25rem!important}.row-gap-md-2{row-gap:.5rem!important}.row-gap-md-3{row-gap:1rem!important}.row-gap-md-4{row-gap:1.5rem!important}.row-gap-md-5{row-gap:3rem!important}.column-gap-md-0{column-gap:0!important}.column-gap-md-1{column-gap:.25rem!important}.column-gap-md-2{column-gap:.5rem!important}.column-gap-md-3{column-gap:1rem!important}.column-gap-md-4{column-gap:1.5rem!important}.column-gap-md-5{column-gap:3rem!important}.text-md-start{text-align:left!important}.text-md-end{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width: 992px){.float-lg-start{float:left!important}.float-lg-end{float:right!important}.float-lg-none{float:none!important}.object-fit-lg-contain{object-fit:contain!important}.object-fit-lg-cover{object-fit:cover!important}.object-fit-lg-fill{object-fit:fill!important}.object-fit-lg-scale{object-fit:scale-down!important}.object-fit-lg-none{object-fit:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-grid{display:grid!important}.d-lg-inline-grid{display:inline-grid!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}.d-lg-none{display:none!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.justify-content-lg-evenly{justify-content:space-evenly!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}.order-lg-first{order:-1!important}.order-lg-0{order:0!important}.order-lg-1{order:1!important}.order-lg-2{order:2!important}.order-lg-3{order:3!important}.order-lg-4{order:4!important}.order-lg-5{order:5!important}.order-lg-last{order:6!important}.m-lg-0{margin:0!important}.m-lg-1{margin:.25rem!important}.m-lg-2{margin:.5rem!important}.m-lg-3{margin:1rem!important}.m-lg-4{margin:1.5rem!important}.m-lg-5{margin:3rem!important}.m-lg-auto{margin:auto!important}.mx-lg-0{margin-right:0!important;margin-left:0!important}.mx-lg-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-lg-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-lg-3{margin-right:1rem!important;margin-left:1rem!important}.mx-lg-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-lg-5{margin-right:3rem!important;margin-left:3rem!important}.mx-lg-auto{margin-right:auto!important;margin-left:auto!important}.my-lg-0{margin-top:0!important;margin-bottom:0!important}.my-lg-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-lg-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-lg-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-lg-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-lg-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-lg-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-lg-0{margin-top:0!important}.mt-lg-1{margin-top:.25rem!important}.mt-lg-2{margin-top:.5rem!important}.mt-lg-3{margin-top:1rem!important}.mt-lg-4{margin-top:1.5rem!important}.mt-lg-5{margin-top:3rem!important}.mt-lg-auto{margin-top:auto!important}.me-lg-0{margin-right:0!important}.me-lg-1{margin-right:.25rem!important}.me-lg-2{margin-right:.5rem!important}.me-lg-3{margin-right:1rem!important}.me-lg-4{margin-right:1.5rem!important}.me-lg-5{margin-right:3rem!important}.me-lg-auto{margin-right:auto!important}.mb-lg-0{margin-bottom:0!important}.mb-lg-1{margin-bottom:.25rem!important}.mb-lg-2{margin-bottom:.5rem!important}.mb-lg-3{margin-bottom:1rem!important}.mb-lg-4{margin-bottom:1.5rem!important}.mb-lg-5{margin-bottom:3rem!important}.mb-lg-auto{margin-bottom:auto!important}.ms-lg-0{margin-left:0!important}.ms-lg-1{margin-left:.25rem!important}.ms-lg-2{margin-left:.5rem!important}.ms-lg-3{margin-left:1rem!important}.ms-lg-4{margin-left:1.5rem!important}.ms-lg-5{margin-left:3rem!important}.ms-lg-auto{margin-left:auto!important}.p-lg-0{padding:0!important}.p-lg-1{padding:.25rem!important}.p-lg-2{padding:.5rem!important}.p-lg-3{padding:1rem!important}.p-lg-4{padding:1.5rem!important}.p-lg-5{padding:3rem!important}.px-lg-0{padding-right:0!important;padding-left:0!important}.px-lg-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-lg-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-lg-3{padding-right:1rem!important;padding-left:1rem!important}.px-lg-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-lg-5{padding-right:3rem!important;padding-left:3rem!important}.py-lg-0{padding-top:0!important;padding-bottom:0!important}.py-lg-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-lg-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-lg-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-lg-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-lg-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-lg-0{padding-top:0!important}.pt-lg-1{padding-top:.25rem!important}.pt-lg-2{padding-top:.5rem!important}.pt-lg-3{padding-top:1rem!important}.pt-lg-4{padding-top:1.5rem!important}.pt-lg-5{padding-top:3rem!important}.pe-lg-0{padding-right:0!important}.pe-lg-1{padding-right:.25rem!important}.pe-lg-2{padding-right:.5rem!important}.pe-lg-3{padding-right:1rem!important}.pe-lg-4{padding-right:1.5rem!important}.pe-lg-5{padding-right:3rem!important}.pb-lg-0{padding-bottom:0!important}.pb-lg-1{padding-bottom:.25rem!important}.pb-lg-2{padding-bottom:.5rem!important}.pb-lg-3{padding-bottom:1rem!important}.pb-lg-4{padding-bottom:1.5rem!important}.pb-lg-5{padding-bottom:3rem!important}.ps-lg-0{padding-left:0!important}.ps-lg-1{padding-left:.25rem!important}.ps-lg-2{padding-left:.5rem!important}.ps-lg-3{padding-left:1rem!important}.ps-lg-4{padding-left:1.5rem!important}.ps-lg-5{padding-left:3rem!important}.gap-lg-0{gap:0!important}.gap-lg-1{gap:.25rem!important}.gap-lg-2{gap:.5rem!important}.gap-lg-3{gap:1rem!important}.gap-lg-4{gap:1.5rem!important}.gap-lg-5{gap:3rem!important}.row-gap-lg-0{row-gap:0!important}.row-gap-lg-1{row-gap:.25rem!important}.row-gap-lg-2{row-gap:.5rem!important}.row-gap-lg-3{row-gap:1rem!important}.row-gap-lg-4{row-gap:1.5rem!important}.row-gap-lg-5{row-gap:3rem!important}.column-gap-lg-0{column-gap:0!important}.column-gap-lg-1{column-gap:.25rem!important}.column-gap-lg-2{column-gap:.5rem!important}.column-gap-lg-3{column-gap:1rem!important}.column-gap-lg-4{column-gap:1.5rem!important}.column-gap-lg-5{column-gap:3rem!important}.text-lg-start{text-align:left!important}.text-lg-end{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width: 1200px){.float-xl-start{float:left!important}.float-xl-end{float:right!important}.float-xl-none{float:none!important}.object-fit-xl-contain{object-fit:contain!important}.object-fit-xl-cover{object-fit:cover!important}.object-fit-xl-fill{object-fit:fill!important}.object-fit-xl-scale{object-fit:scale-down!important}.object-fit-xl-none{object-fit:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-grid{display:grid!important}.d-xl-inline-grid{display:inline-grid!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}.d-xl-none{display:none!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.justify-content-xl-evenly{justify-content:space-evenly!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}.order-xl-first{order:-1!important}.order-xl-0{order:0!important}.order-xl-1{order:1!important}.order-xl-2{order:2!important}.order-xl-3{order:3!important}.order-xl-4{order:4!important}.order-xl-5{order:5!important}.order-xl-last{order:6!important}.m-xl-0{margin:0!important}.m-xl-1{margin:.25rem!important}.m-xl-2{margin:.5rem!important}.m-xl-3{margin:1rem!important}.m-xl-4{margin:1.5rem!important}.m-xl-5{margin:3rem!important}.m-xl-auto{margin:auto!important}.mx-xl-0{margin-right:0!important;margin-left:0!important}.mx-xl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xl-auto{margin-right:auto!important;margin-left:auto!important}.my-xl-0{margin-top:0!important;margin-bottom:0!important}.my-xl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xl-0{margin-top:0!important}.mt-xl-1{margin-top:.25rem!important}.mt-xl-2{margin-top:.5rem!important}.mt-xl-3{margin-top:1rem!important}.mt-xl-4{margin-top:1.5rem!important}.mt-xl-5{margin-top:3rem!important}.mt-xl-auto{margin-top:auto!important}.me-xl-0{margin-right:0!important}.me-xl-1{margin-right:.25rem!important}.me-xl-2{margin-right:.5rem!important}.me-xl-3{margin-right:1rem!important}.me-xl-4{margin-right:1.5rem!important}.me-xl-5{margin-right:3rem!important}.me-xl-auto{margin-right:auto!important}.mb-xl-0{margin-bottom:0!important}.mb-xl-1{margin-bottom:.25rem!important}.mb-xl-2{margin-bottom:.5rem!important}.mb-xl-3{margin-bottom:1rem!important}.mb-xl-4{margin-bottom:1.5rem!important}.mb-xl-5{margin-bottom:3rem!important}.mb-xl-auto{margin-bottom:auto!important}.ms-xl-0{margin-left:0!important}.ms-xl-1{margin-left:.25rem!important}.ms-xl-2{margin-left:.5rem!important}.ms-xl-3{margin-left:1rem!important}.ms-xl-4{margin-left:1.5rem!important}.ms-xl-5{margin-left:3rem!important}.ms-xl-auto{margin-left:auto!important}.p-xl-0{padding:0!important}.p-xl-1{padding:.25rem!important}.p-xl-2{padding:.5rem!important}.p-xl-3{padding:1rem!important}.p-xl-4{padding:1.5rem!important}.p-xl-5{padding:3rem!important}.px-xl-0{padding-right:0!important;padding-left:0!important}.px-xl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xl-0{padding-top:0!important;padding-bottom:0!important}.py-xl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xl-0{padding-top:0!important}.pt-xl-1{padding-top:.25rem!important}.pt-xl-2{padding-top:.5rem!important}.pt-xl-3{padding-top:1rem!important}.pt-xl-4{padding-top:1.5rem!important}.pt-xl-5{padding-top:3rem!important}.pe-xl-0{padding-right:0!important}.pe-xl-1{padding-right:.25rem!important}.pe-xl-2{padding-right:.5rem!important}.pe-xl-3{padding-right:1rem!important}.pe-xl-4{padding-right:1.5rem!important}.pe-xl-5{padding-right:3rem!important}.pb-xl-0{padding-bottom:0!important}.pb-xl-1{padding-bottom:.25rem!important}.pb-xl-2{padding-bottom:.5rem!important}.pb-xl-3{padding-bottom:1rem!important}.pb-xl-4{padding-bottom:1.5rem!important}.pb-xl-5{padding-bottom:3rem!important}.ps-xl-0{padding-left:0!important}.ps-xl-1{padding-left:.25rem!important}.ps-xl-2{padding-left:.5rem!important}.ps-xl-3{padding-left:1rem!important}.ps-xl-4{padding-left:1.5rem!important}.ps-xl-5{padding-left:3rem!important}.gap-xl-0{gap:0!important}.gap-xl-1{gap:.25rem!important}.gap-xl-2{gap:.5rem!important}.gap-xl-3{gap:1rem!important}.gap-xl-4{gap:1.5rem!important}.gap-xl-5{gap:3rem!important}.row-gap-xl-0{row-gap:0!important}.row-gap-xl-1{row-gap:.25rem!important}.row-gap-xl-2{row-gap:.5rem!important}.row-gap-xl-3{row-gap:1rem!important}.row-gap-xl-4{row-gap:1.5rem!important}.row-gap-xl-5{row-gap:3rem!important}.column-gap-xl-0{column-gap:0!important}.column-gap-xl-1{column-gap:.25rem!important}.column-gap-xl-2{column-gap:.5rem!important}.column-gap-xl-3{column-gap:1rem!important}.column-gap-xl-4{column-gap:1.5rem!important}.column-gap-xl-5{column-gap:3rem!important}.text-xl-start{text-align:left!important}.text-xl-end{text-align:right!important}.text-xl-center{text-align:center!important}}@media (min-width: 1400px){.float-xxl-start{float:left!important}.float-xxl-end{float:right!important}.float-xxl-none{float:none!important}.object-fit-xxl-contain{object-fit:contain!important}.object-fit-xxl-cover{object-fit:cover!important}.object-fit-xxl-fill{object-fit:fill!important}.object-fit-xxl-scale{object-fit:scale-down!important}.object-fit-xxl-none{object-fit:none!important}.d-xxl-inline{display:inline!important}.d-xxl-inline-block{display:inline-block!important}.d-xxl-block{display:block!important}.d-xxl-grid{display:grid!important}.d-xxl-inline-grid{display:inline-grid!important}.d-xxl-table{display:table!important}.d-xxl-table-row{display:table-row!important}.d-xxl-table-cell{display:table-cell!important}.d-xxl-flex{display:flex!important}.d-xxl-inline-flex{display:inline-flex!important}.d-xxl-none{display:none!important}.flex-xxl-fill{flex:1 1 auto!important}.flex-xxl-row{flex-direction:row!important}.flex-xxl-column{flex-direction:column!important}.flex-xxl-row-reverse{flex-direction:row-reverse!important}.flex-xxl-column-reverse{flex-direction:column-reverse!important}.flex-xxl-grow-0{flex-grow:0!important}.flex-xxl-grow-1{flex-grow:1!important}.flex-xxl-shrink-0{flex-shrink:0!important}.flex-xxl-shrink-1{flex-shrink:1!important}.flex-xxl-wrap{flex-wrap:wrap!important}.flex-xxl-nowrap{flex-wrap:nowrap!important}.flex-xxl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xxl-start{justify-content:flex-start!important}.justify-content-xxl-end{justify-content:flex-end!important}.justify-content-xxl-center{justify-content:center!important}.justify-content-xxl-between{justify-content:space-between!important}.justify-content-xxl-around{justify-content:space-around!important}.justify-content-xxl-evenly{justify-content:space-evenly!important}.align-items-xxl-start{align-items:flex-start!important}.align-items-xxl-end{align-items:flex-end!important}.align-items-xxl-center{align-items:center!important}.align-items-xxl-baseline{align-items:baseline!important}.align-items-xxl-stretch{align-items:stretch!important}.align-content-xxl-start{align-content:flex-start!important}.align-content-xxl-end{align-content:flex-end!important}.align-content-xxl-center{align-content:center!important}.align-content-xxl-between{align-content:space-between!important}.align-content-xxl-around{align-content:space-around!important}.align-content-xxl-stretch{align-content:stretch!important}.align-self-xxl-auto{align-self:auto!important}.align-self-xxl-start{align-self:flex-start!important}.align-self-xxl-end{align-self:flex-end!important}.align-self-xxl-center{align-self:center!important}.align-self-xxl-baseline{align-self:baseline!important}.align-self-xxl-stretch{align-self:stretch!important}.order-xxl-first{order:-1!important}.order-xxl-0{order:0!important}.order-xxl-1{order:1!important}.order-xxl-2{order:2!important}.order-xxl-3{order:3!important}.order-xxl-4{order:4!important}.order-xxl-5{order:5!important}.order-xxl-last{order:6!important}.m-xxl-0{margin:0!important}.m-xxl-1{margin:.25rem!important}.m-xxl-2{margin:.5rem!important}.m-xxl-3{margin:1rem!important}.m-xxl-4{margin:1.5rem!important}.m-xxl-5{margin:3rem!important}.m-xxl-auto{margin:auto!important}.mx-xxl-0{margin-right:0!important;margin-left:0!important}.mx-xxl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xxl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xxl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xxl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xxl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xxl-auto{margin-right:auto!important;margin-left:auto!important}.my-xxl-0{margin-top:0!important;margin-bottom:0!important}.my-xxl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xxl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xxl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xxl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xxl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xxl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xxl-0{margin-top:0!important}.mt-xxl-1{margin-top:.25rem!important}.mt-xxl-2{margin-top:.5rem!important}.mt-xxl-3{margin-top:1rem!important}.mt-xxl-4{margin-top:1.5rem!important}.mt-xxl-5{margin-top:3rem!important}.mt-xxl-auto{margin-top:auto!important}.me-xxl-0{margin-right:0!important}.me-xxl-1{margin-right:.25rem!important}.me-xxl-2{margin-right:.5rem!important}.me-xxl-3{margin-right:1rem!important}.me-xxl-4{margin-right:1.5rem!important}.me-xxl-5{margin-right:3rem!important}.me-xxl-auto{margin-right:auto!important}.mb-xxl-0{margin-bottom:0!important}.mb-xxl-1{margin-bottom:.25rem!important}.mb-xxl-2{margin-bottom:.5rem!important}.mb-xxl-3{margin-bottom:1rem!important}.mb-xxl-4{margin-bottom:1.5rem!important}.mb-xxl-5{margin-bottom:3rem!important}.mb-xxl-auto{margin-bottom:auto!important}.ms-xxl-0{margin-left:0!important}.ms-xxl-1{margin-left:.25rem!important}.ms-xxl-2{margin-left:.5rem!important}.ms-xxl-3{margin-left:1rem!important}.ms-xxl-4{margin-left:1.5rem!important}.ms-xxl-5{margin-left:3rem!important}.ms-xxl-auto{margin-left:auto!important}.p-xxl-0{padding:0!important}.p-xxl-1{padding:.25rem!important}.p-xxl-2{padding:.5rem!important}.p-xxl-3{padding:1rem!important}.p-xxl-4{padding:1.5rem!important}.p-xxl-5{padding:3rem!important}.px-xxl-0{padding-right:0!important;padding-left:0!important}.px-xxl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xxl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xxl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xxl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xxl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xxl-0{padding-top:0!important;padding-bottom:0!important}.py-xxl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xxl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xxl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xxl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xxl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xxl-0{padding-top:0!important}.pt-xxl-1{padding-top:.25rem!important}.pt-xxl-2{padding-top:.5rem!important}.pt-xxl-3{padding-top:1rem!important}.pt-xxl-4{padding-top:1.5rem!important}.pt-xxl-5{padding-top:3rem!important}.pe-xxl-0{padding-right:0!important}.pe-xxl-1{padding-right:.25rem!important}.pe-xxl-2{padding-right:.5rem!important}.pe-xxl-3{padding-right:1rem!important}.pe-xxl-4{padding-right:1.5rem!important}.pe-xxl-5{padding-right:3rem!important}.pb-xxl-0{padding-bottom:0!important}.pb-xxl-1{padding-bottom:.25rem!important}.pb-xxl-2{padding-bottom:.5rem!important}.pb-xxl-3{padding-bottom:1rem!important}.pb-xxl-4{padding-bottom:1.5rem!important}.pb-xxl-5{padding-bottom:3rem!important}.ps-xxl-0{padding-left:0!important}.ps-xxl-1{padding-left:.25rem!important}.ps-xxl-2{padding-left:.5rem!important}.ps-xxl-3{padding-left:1rem!important}.ps-xxl-4{padding-left:1.5rem!important}.ps-xxl-5{padding-left:3rem!important}.gap-xxl-0{gap:0!important}.gap-xxl-1{gap:.25rem!important}.gap-xxl-2{gap:.5rem!important}.gap-xxl-3{gap:1rem!important}.gap-xxl-4{gap:1.5rem!important}.gap-xxl-5{gap:3rem!important}.row-gap-xxl-0{row-gap:0!important}.row-gap-xxl-1{row-gap:.25rem!important}.row-gap-xxl-2{row-gap:.5rem!important}.row-gap-xxl-3{row-gap:1rem!important}.row-gap-xxl-4{row-gap:1.5rem!important}.row-gap-xxl-5{row-gap:3rem!important}.column-gap-xxl-0{column-gap:0!important}.column-gap-xxl-1{column-gap:.25rem!important}.column-gap-xxl-2{column-gap:.5rem!important}.column-gap-xxl-3{column-gap:1rem!important}.column-gap-xxl-4{column-gap:1.5rem!important}.column-gap-xxl-5{column-gap:3rem!important}.text-xxl-start{text-align:left!important}.text-xxl-end{text-align:right!important}.text-xxl-center{text-align:center!important}}@media (min-width: 1200px){.fs-1{font-size:2.5rem!important}.fs-2{font-size:2rem!important}.fs-3{font-size:1.75rem!important}.fs-4{font-size:1.5rem!important}}@media print{.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-grid{display:grid!important}.d-print-inline-grid{display:inline-grid!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}.d-print-none{display:none!important}}.navbar,.bg-primary{background:linear-gradient(45deg,#ff2600,#440064)}html,body{height:100vh}body{display:flex;flex-direction:column;flex-wrap:nowrap}header{flex-shrink:0;flex-grow:0}main{flex-shrink:0;flex-grow:1;margin-bottom:auto;margin-top:0}footer{flex-shrink:0;flex-grow:0;margin-bottom:0;margin-top:auto}.squared{width:100%;padding-top:100%;position:relative}.squared>*{position:absolute;top:0;left:0;width:100%;height:100%} diff --git a/docs/styles.2596d53c3a552682.css b/docs/styles.2596d53c3a552682.css deleted file mode 100644 index 12d670a..0000000 --- a/docs/styles.2596d53c3a552682.css +++ /dev/null @@ -1,5 +0,0 @@ -@charset "UTF-8";:root,[data-bs-theme=light]{--bs-blue: #0d6efd;--bs-indigo: #6610f2;--bs-purple: #6f42c1;--bs-pink: #d63384;--bs-red: #dc3545;--bs-orange: #fd7e14;--bs-yellow: #ffc107;--bs-green: #198754;--bs-teal: #20c997;--bs-cyan: #0dcaf0;--bs-black: #000;--bs-white: #fff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-gray-100: #f8f9fa;--bs-gray-200: #e9ecef;--bs-gray-300: #dee2e6;--bs-gray-400: #ced4da;--bs-gray-500: #adb5bd;--bs-gray-600: #6c757d;--bs-gray-700: #495057;--bs-gray-800: #343a40;--bs-gray-900: #212529;--bs-primary: #0d6efd;--bs-secondary: #6c757d;--bs-success: #198754;--bs-info: #0dcaf0;--bs-warning: #ffc107;--bs-danger: #dc3545;--bs-light: #f8f9fa;--bs-dark: #212529;--bs-primary-rgb: 13, 110, 253;--bs-secondary-rgb: 108, 117, 125;--bs-success-rgb: 25, 135, 84;--bs-info-rgb: 13, 202, 240;--bs-warning-rgb: 255, 193, 7;--bs-danger-rgb: 220, 53, 69;--bs-light-rgb: 248, 249, 250;--bs-dark-rgb: 33, 37, 41;--bs-primary-text-emphasis: #052c65;--bs-secondary-text-emphasis: #2b2f32;--bs-success-text-emphasis: #0a3622;--bs-info-text-emphasis: #055160;--bs-warning-text-emphasis: #664d03;--bs-danger-text-emphasis: #58151c;--bs-light-text-emphasis: #495057;--bs-dark-text-emphasis: #495057;--bs-primary-bg-subtle: #cfe2ff;--bs-secondary-bg-subtle: #e2e3e5;--bs-success-bg-subtle: #d1e7dd;--bs-info-bg-subtle: #cff4fc;--bs-warning-bg-subtle: #fff3cd;--bs-danger-bg-subtle: #f8d7da;--bs-light-bg-subtle: #fcfcfd;--bs-dark-bg-subtle: #ced4da;--bs-primary-border-subtle: #9ec5fe;--bs-secondary-border-subtle: #c4c8cb;--bs-success-border-subtle: #a3cfbb;--bs-info-border-subtle: #9eeaf9;--bs-warning-border-subtle: #ffe69c;--bs-danger-border-subtle: #f1aeb5;--bs-light-border-subtle: #e9ecef;--bs-dark-border-subtle: #adb5bd;--bs-white-rgb: 255, 255, 255;--bs-black-rgb: 0, 0, 0;--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family: var(--bs-font-sans-serif);--bs-body-font-size: 1rem;--bs-body-font-weight: 400;--bs-body-line-height: 1.5;--bs-body-color: #212529;--bs-body-color-rgb: 33, 37, 41;--bs-body-bg: #fff;--bs-body-bg-rgb: 255, 255, 255;--bs-emphasis-color: #000;--bs-emphasis-color-rgb: 0, 0, 0;--bs-secondary-color: rgba(33, 37, 41, .75);--bs-secondary-color-rgb: 33, 37, 41;--bs-secondary-bg: #e9ecef;--bs-secondary-bg-rgb: 233, 236, 239;--bs-tertiary-color: rgba(33, 37, 41, .5);--bs-tertiary-color-rgb: 33, 37, 41;--bs-tertiary-bg: #f8f9fa;--bs-tertiary-bg-rgb: 248, 249, 250;--bs-heading-color: inherit;--bs-link-color: #0d6efd;--bs-link-color-rgb: 13, 110, 253;--bs-link-decoration: underline;--bs-link-hover-color: #0a58ca;--bs-link-hover-color-rgb: 10, 88, 202;--bs-code-color: #d63384;--bs-highlight-color: #212529;--bs-highlight-bg: #fff3cd;--bs-border-width: 1px;--bs-border-style: solid;--bs-border-color: #dee2e6;--bs-border-color-translucent: rgba(0, 0, 0, .175);--bs-border-radius: .375rem;--bs-border-radius-sm: .25rem;--bs-border-radius-lg: .5rem;--bs-border-radius-xl: 1rem;--bs-border-radius-xxl: 2rem;--bs-border-radius-2xl: var(--bs-border-radius-xxl);--bs-border-radius-pill: 50rem;--bs-box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);--bs-box-shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, .075);--bs-focus-ring-width: .25rem;--bs-focus-ring-opacity: .25;--bs-focus-ring-color: rgba(13, 110, 253, .25);--bs-form-valid-color: #198754;--bs-form-valid-border-color: #198754;--bs-form-invalid-color: #dc3545;--bs-form-invalid-border-color: #dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color: #dee2e6;--bs-body-color-rgb: 222, 226, 230;--bs-body-bg: #212529;--bs-body-bg-rgb: 33, 37, 41;--bs-emphasis-color: #fff;--bs-emphasis-color-rgb: 255, 255, 255;--bs-secondary-color: rgba(222, 226, 230, .75);--bs-secondary-color-rgb: 222, 226, 230;--bs-secondary-bg: #343a40;--bs-secondary-bg-rgb: 52, 58, 64;--bs-tertiary-color: rgba(222, 226, 230, .5);--bs-tertiary-color-rgb: 222, 226, 230;--bs-tertiary-bg: #2b3035;--bs-tertiary-bg-rgb: 43, 48, 53;--bs-primary-text-emphasis: #6ea8fe;--bs-secondary-text-emphasis: #a7acb1;--bs-success-text-emphasis: #75b798;--bs-info-text-emphasis: #6edff6;--bs-warning-text-emphasis: #ffda6a;--bs-danger-text-emphasis: #ea868f;--bs-light-text-emphasis: #f8f9fa;--bs-dark-text-emphasis: #dee2e6;--bs-primary-bg-subtle: #031633;--bs-secondary-bg-subtle: #161719;--bs-success-bg-subtle: #051b11;--bs-info-bg-subtle: #032830;--bs-warning-bg-subtle: #332701;--bs-danger-bg-subtle: #2c0b0e;--bs-light-bg-subtle: #343a40;--bs-dark-bg-subtle: #1a1d20;--bs-primary-border-subtle: #084298;--bs-secondary-border-subtle: #41464b;--bs-success-border-subtle: #0f5132;--bs-info-border-subtle: #087990;--bs-warning-border-subtle: #997404;--bs-danger-border-subtle: #842029;--bs-light-border-subtle: #495057;--bs-dark-border-subtle: #343a40;--bs-heading-color: inherit;--bs-link-color: #6ea8fe;--bs-link-hover-color: #8bb9fe;--bs-link-color-rgb: 110, 168, 254;--bs-link-hover-color-rgb: 139, 185, 254;--bs-code-color: #e685b5;--bs-highlight-color: #dee2e6;--bs-highlight-bg: #664d03;--bs-border-color: #495057;--bs-border-color-translucent: rgba(255, 255, 255, .15);--bs-form-valid-color: #75b798;--bs-form-valid-border-color: #75b798;--bs-form-invalid-color: #ea868f;--bs-form-invalid-border-color: #ea868f}*,*:before,*:after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}hr{margin:1rem 0;color:inherit;border:0;border-top:var(--bs-border-width) solid;opacity:.25}h6,.h6,h5,.h5,h4,.h4,h3,.h3,h2,.h2,h1,.h1{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2;color:var(--bs-heading-color)}h1,.h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width: 1200px){h1,.h1{font-size:2.5rem}}h2,.h2{font-size:calc(1.325rem + .9vw)}@media (min-width: 1200px){h2,.h2{font-size:2rem}}h3,.h3{font-size:calc(1.3rem + .6vw)}@media (min-width: 1200px){h3,.h3{font-size:1.75rem}}h4,.h4{font-size:calc(1.275rem + .3vw)}@media (min-width: 1200px){h4,.h4{font-size:1.5rem}}h5,.h5{font-size:1.25rem}h6,.h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small,.small{font-size:.875em}mark,.mark{padding:.1875em;color:var(--bs-highlight-color);background-color:var(--bs-highlight-bg)}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity, 1));text-decoration:underline}a:hover{--bs-link-color-rgb: var(--bs-link-hover-color-rgb)}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}pre,code,kbd,samp{font-family:var(--bs-font-monospace);font-size:1em}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:var(--bs-code-color);word-wrap:break-word}a>code{color:inherit}kbd{padding:.1875rem .375rem;font-size:.875em;color:var(--bs-body-bg);background-color:var(--bs-body-color);border-radius:.25rem}kbd kbd{padding:0;font-size:1em}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-secondary-color);text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}thead,tbody,tfoot,tr,td,th{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator{display:none!important}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button:not(:disabled),[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width: 1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:calc(1.625rem + 4.5vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-1{font-size:5rem}}.display-2{font-size:calc(1.575rem + 3.9vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-2{font-size:4.5rem}}.display-3{font-size:calc(1.525rem + 3.3vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-3{font-size:4rem}}.display-4{font-size:calc(1.475rem + 2.7vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-4{font-size:3.5rem}}.display-5{font-size:calc(1.425rem + 2.1vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-5{font-size:3rem}}.display-6{font-size:calc(1.375rem + 1.5vw);font-weight:300;line-height:1.2}@media (min-width: 1200px){.display-6{font-size:2.5rem}}.list-unstyled,.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:.875em;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote>:last-child{margin-bottom:0}.blockquote-footer{margin-top:-1rem;margin-bottom:1rem;font-size:.875em;color:#6c757d}.blockquote-footer:before{content:"\2014\a0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:var(--bs-body-bg);border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:.875em;color:var(--bs-secondary-color)}.container,.container-fluid,.container-xxl,.container-xl,.container-lg,.container-md,.container-sm{--bs-gutter-x: 1.5rem;--bs-gutter-y: 0;width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-right:auto;margin-left:auto}@media (min-width: 576px){.container-sm,.container{max-width:540px}}@media (min-width: 768px){.container-md,.container-sm,.container{max-width:720px}}@media (min-width: 992px){.container-lg,.container-md,.container-sm,.container{max-width:960px}}@media (min-width: 1200px){.container-xl,.container-lg,.container-md,.container-sm,.container{max-width:1140px}}@media (min-width: 1400px){.container-xxl,.container-xl,.container-lg,.container-md,.container-sm,.container{max-width:1320px}}:root{--bs-breakpoint-xs: 0;--bs-breakpoint-sm: 576px;--bs-breakpoint-md: 768px;--bs-breakpoint-lg: 992px;--bs-breakpoint-xl: 1200px;--bs-breakpoint-xxl: 1400px}.row{--bs-gutter-x: 1.5rem;--bs-gutter-y: 0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-.5 * var(--bs-gutter-x));margin-left:calc(-.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}.row-cols-auto>*{flex:0 0 auto;width:auto}.row-cols-1>*{flex:0 0 auto;width:100%}.row-cols-2>*{flex:0 0 auto;width:50%}.row-cols-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-4>*{flex:0 0 auto;width:25%}.row-cols-5>*{flex:0 0 auto;width:20%}.row-cols-6>*{flex:0 0 auto;width:16.66666667%}.col-auto{flex:0 0 auto;width:auto}.col-1{flex:0 0 auto;width:8.33333333%}.col-2{flex:0 0 auto;width:16.66666667%}.col-3{flex:0 0 auto;width:25%}.col-4{flex:0 0 auto;width:33.33333333%}.col-5{flex:0 0 auto;width:41.66666667%}.col-6{flex:0 0 auto;width:50%}.col-7{flex:0 0 auto;width:58.33333333%}.col-8{flex:0 0 auto;width:66.66666667%}.col-9{flex:0 0 auto;width:75%}.col-10{flex:0 0 auto;width:83.33333333%}.col-11{flex:0 0 auto;width:91.66666667%}.col-12{flex:0 0 auto;width:100%}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}.g-0,.gx-0{--bs-gutter-x: 0}.g-0,.gy-0{--bs-gutter-y: 0}.g-1,.gx-1{--bs-gutter-x: .25rem}.g-1,.gy-1{--bs-gutter-y: .25rem}.g-2,.gx-2{--bs-gutter-x: .5rem}.g-2,.gy-2{--bs-gutter-y: .5rem}.g-3,.gx-3{--bs-gutter-x: 1rem}.g-3,.gy-3{--bs-gutter-y: 1rem}.g-4,.gx-4{--bs-gutter-x: 1.5rem}.g-4,.gy-4{--bs-gutter-y: 1.5rem}.g-5,.gx-5{--bs-gutter-x: 3rem}.g-5,.gy-5{--bs-gutter-y: 3rem}@media (min-width: 576px){.col-sm{flex:1 0 0%}.row-cols-sm-auto>*{flex:0 0 auto;width:auto}.row-cols-sm-1>*{flex:0 0 auto;width:100%}.row-cols-sm-2>*{flex:0 0 auto;width:50%}.row-cols-sm-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-sm-4>*{flex:0 0 auto;width:25%}.row-cols-sm-5>*{flex:0 0 auto;width:20%}.row-cols-sm-6>*{flex:0 0 auto;width:16.66666667%}.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-1{flex:0 0 auto;width:8.33333333%}.col-sm-2{flex:0 0 auto;width:16.66666667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.33333333%}.col-sm-5{flex:0 0 auto;width:41.66666667%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-7{flex:0 0 auto;width:58.33333333%}.col-sm-8{flex:0 0 auto;width:66.66666667%}.col-sm-9{flex:0 0 auto;width:75%}.col-sm-10{flex:0 0 auto;width:83.33333333%}.col-sm-11{flex:0 0 auto;width:91.66666667%}.col-sm-12{flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x: 0}.g-sm-0,.gy-sm-0{--bs-gutter-y: 0}.g-sm-1,.gx-sm-1{--bs-gutter-x: .25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y: .25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x: .5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y: .5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x: 1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y: 1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x: 1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y: 1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x: 3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y: 3rem}}@media (min-width: 768px){.col-md{flex:1 0 0%}.row-cols-md-auto>*{flex:0 0 auto;width:auto}.row-cols-md-1>*{flex:0 0 auto;width:100%}.row-cols-md-2>*{flex:0 0 auto;width:50%}.row-cols-md-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-md-4>*{flex:0 0 auto;width:25%}.row-cols-md-5>*{flex:0 0 auto;width:20%}.row-cols-md-6>*{flex:0 0 auto;width:16.66666667%}.col-md-auto{flex:0 0 auto;width:auto}.col-md-1{flex:0 0 auto;width:8.33333333%}.col-md-2{flex:0 0 auto;width:16.66666667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.33333333%}.col-md-5{flex:0 0 auto;width:41.66666667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.33333333%}.col-md-8{flex:0 0 auto;width:66.66666667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.33333333%}.col-md-11{flex:0 0 auto;width:91.66666667%}.col-md-12{flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}.g-md-0,.gx-md-0{--bs-gutter-x: 0}.g-md-0,.gy-md-0{--bs-gutter-y: 0}.g-md-1,.gx-md-1{--bs-gutter-x: .25rem}.g-md-1,.gy-md-1{--bs-gutter-y: .25rem}.g-md-2,.gx-md-2{--bs-gutter-x: .5rem}.g-md-2,.gy-md-2{--bs-gutter-y: .5rem}.g-md-3,.gx-md-3{--bs-gutter-x: 1rem}.g-md-3,.gy-md-3{--bs-gutter-y: 1rem}.g-md-4,.gx-md-4{--bs-gutter-x: 1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y: 1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x: 3rem}.g-md-5,.gy-md-5{--bs-gutter-y: 3rem}}@media (min-width: 992px){.col-lg{flex:1 0 0%}.row-cols-lg-auto>*{flex:0 0 auto;width:auto}.row-cols-lg-1>*{flex:0 0 auto;width:100%}.row-cols-lg-2>*{flex:0 0 auto;width:50%}.row-cols-lg-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-lg-4>*{flex:0 0 auto;width:25%}.row-cols-lg-5>*{flex:0 0 auto;width:20%}.row-cols-lg-6>*{flex:0 0 auto;width:16.66666667%}.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-1{flex:0 0 auto;width:8.33333333%}.col-lg-2{flex:0 0 auto;width:16.66666667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.33333333%}.col-lg-5{flex:0 0 auto;width:41.66666667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.33333333%}.col-lg-8{flex:0 0 auto;width:66.66666667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.33333333%}.col-lg-11{flex:0 0 auto;width:91.66666667%}.col-lg-12{flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x: 0}.g-lg-0,.gy-lg-0{--bs-gutter-y: 0}.g-lg-1,.gx-lg-1{--bs-gutter-x: .25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y: .25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x: .5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y: .5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x: 1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y: 1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x: 1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y: 1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x: 3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y: 3rem}}@media (min-width: 1200px){.col-xl{flex:1 0 0%}.row-cols-xl-auto>*{flex:0 0 auto;width:auto}.row-cols-xl-1>*{flex:0 0 auto;width:100%}.row-cols-xl-2>*{flex:0 0 auto;width:50%}.row-cols-xl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xl-4>*{flex:0 0 auto;width:25%}.row-cols-xl-5>*{flex:0 0 auto;width:20%}.row-cols-xl-6>*{flex:0 0 auto;width:16.66666667%}.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-1{flex:0 0 auto;width:8.33333333%}.col-xl-2{flex:0 0 auto;width:16.66666667%}.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.33333333%}.col-xl-5{flex:0 0 auto;width:41.66666667%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-7{flex:0 0 auto;width:58.33333333%}.col-xl-8{flex:0 0 auto;width:66.66666667%}.col-xl-9{flex:0 0 auto;width:75%}.col-xl-10{flex:0 0 auto;width:83.33333333%}.col-xl-11{flex:0 0 auto;width:91.66666667%}.col-xl-12{flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x: 0}.g-xl-0,.gy-xl-0{--bs-gutter-y: 0}.g-xl-1,.gx-xl-1{--bs-gutter-x: .25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y: .25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x: .5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y: .5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x: 1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y: 1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x: 1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y: 1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x: 3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y: 3rem}}@media (min-width: 1400px){.col-xxl{flex:1 0 0%}.row-cols-xxl-auto>*{flex:0 0 auto;width:auto}.row-cols-xxl-1>*{flex:0 0 auto;width:100%}.row-cols-xxl-2>*{flex:0 0 auto;width:50%}.row-cols-xxl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xxl-4>*{flex:0 0 auto;width:25%}.row-cols-xxl-5>*{flex:0 0 auto;width:20%}.row-cols-xxl-6>*{flex:0 0 auto;width:16.66666667%}.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-1{flex:0 0 auto;width:8.33333333%}.col-xxl-2{flex:0 0 auto;width:16.66666667%}.col-xxl-3{flex:0 0 auto;width:25%}.col-xxl-4{flex:0 0 auto;width:33.33333333%}.col-xxl-5{flex:0 0 auto;width:41.66666667%}.col-xxl-6{flex:0 0 auto;width:50%}.col-xxl-7{flex:0 0 auto;width:58.33333333%}.col-xxl-8{flex:0 0 auto;width:66.66666667%}.col-xxl-9{flex:0 0 auto;width:75%}.col-xxl-10{flex:0 0 auto;width:83.33333333%}.col-xxl-11{flex:0 0 auto;width:91.66666667%}.col-xxl-12{flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.33333333%}.offset-xxl-2{margin-left:16.66666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.33333333%}.offset-xxl-5{margin-left:41.66666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.33333333%}.offset-xxl-8{margin-left:66.66666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.33333333%}.offset-xxl-11{margin-left:91.66666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x: 0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y: 0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x: .25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y: .25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x: .5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y: .5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x: 1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y: 1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x: 1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y: 1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x: 3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y: 3rem}}.clearfix:after{display:block;clear:both;content:""}.text-bg-primary{color:#fff!important;background-color:RGBA(var(--bs-primary-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-secondary{color:#fff!important;background-color:RGBA(var(--bs-secondary-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-success{color:#fff!important;background-color:RGBA(var(--bs-success-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-info{color:#000!important;background-color:RGBA(var(--bs-info-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-warning{color:#000!important;background-color:RGBA(var(--bs-warning-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-danger{color:#fff!important;background-color:RGBA(var(--bs-danger-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-light{color:#000!important;background-color:RGBA(var(--bs-light-rgb),var(--bs-bg-opacity, 1))!important}.text-bg-dark{color:#fff!important;background-color:RGBA(var(--bs-dark-rgb),var(--bs-bg-opacity, 1))!important}.link-primary{color:RGBA(var(--bs-primary-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-primary-rgb),var(--bs-link-underline-opacity, 1))!important}.link-primary:hover,.link-primary:focus{color:RGBA(10,88,202,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(10,88,202,var(--bs-link-underline-opacity, 1))!important}.link-secondary{color:RGBA(var(--bs-secondary-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-secondary-rgb),var(--bs-link-underline-opacity, 1))!important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86,94,100,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(86,94,100,var(--bs-link-underline-opacity, 1))!important}.link-success{color:RGBA(var(--bs-success-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-success-rgb),var(--bs-link-underline-opacity, 1))!important}.link-success:hover,.link-success:focus{color:RGBA(20,108,67,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(20,108,67,var(--bs-link-underline-opacity, 1))!important}.link-info{color:RGBA(var(--bs-info-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-info-rgb),var(--bs-link-underline-opacity, 1))!important}.link-info:hover,.link-info:focus{color:RGBA(61,213,243,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(61,213,243,var(--bs-link-underline-opacity, 1))!important}.link-warning{color:RGBA(var(--bs-warning-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-warning-rgb),var(--bs-link-underline-opacity, 1))!important}.link-warning:hover,.link-warning:focus{color:RGBA(255,205,57,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(255,205,57,var(--bs-link-underline-opacity, 1))!important}.link-danger{color:RGBA(var(--bs-danger-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-danger-rgb),var(--bs-link-underline-opacity, 1))!important}.link-danger:hover,.link-danger:focus{color:RGBA(176,42,55,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(176,42,55,var(--bs-link-underline-opacity, 1))!important}.link-light{color:RGBA(var(--bs-light-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-light-rgb),var(--bs-link-underline-opacity, 1))!important}.link-light:hover,.link-light:focus{color:RGBA(249,250,251,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(249,250,251,var(--bs-link-underline-opacity, 1))!important}.link-dark{color:RGBA(var(--bs-dark-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-dark-rgb),var(--bs-link-underline-opacity, 1))!important}.link-dark:hover,.link-dark:focus{color:RGBA(26,30,33,var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(26,30,33,var(--bs-link-underline-opacity, 1))!important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-opacity, 1))!important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity, 1))!important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-opacity, .75))!important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity, .75))!important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity, .5));text-underline-offset:.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio:before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio: 100%}.ratio-4x3{--bs-aspect-ratio: 75%}.ratio-16x9{--bs-aspect-ratio: 56.25%}.ratio-21x9{--bs-aspect-ratio: 42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute!important}.stretched-link:after{position:absolute;inset:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:.25}.navbar{--bs-navbar-padding-x: 0;--bs-navbar-padding-y: .5rem;--bs-navbar-color: rgba(var(--bs-emphasis-color-rgb), .65);--bs-navbar-hover-color: rgba(var(--bs-emphasis-color-rgb), .8);--bs-navbar-disabled-color: rgba(var(--bs-emphasis-color-rgb), .3);--bs-navbar-active-color: rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-brand-padding-y: .3125rem;--bs-navbar-brand-margin-end: 1rem;--bs-navbar-brand-font-size: 1.25rem;--bs-navbar-brand-color: rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-brand-hover-color: rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-nav-link-padding-x: .5rem;--bs-navbar-toggler-padding-y: .25rem;--bs-navbar-toggler-padding-x: .75rem;--bs-navbar-toggler-font-size: 1.25rem;--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");--bs-navbar-toggler-border-color: rgba(var(--bs-emphasis-color-rgb), .15);--bs-navbar-toggler-border-radius: var(--bs-border-radius);--bs-navbar-toggler-focus-width: .25rem;--bs-navbar-toggler-transition: box-shadow .15s ease-in-out;position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:var(--bs-navbar-padding-y) var(--bs-navbar-padding-x)}.navbar>.container,.navbar>.container-fluid,.navbar>.container-sm,.navbar>.container-md,.navbar>.container-lg,.navbar>.container-xl,.navbar>.container-xxl{display:flex;flex-wrap:inherit;align-items:center;justify-content:space-between}.navbar-brand{padding-top:var(--bs-navbar-brand-padding-y);padding-bottom:var(--bs-navbar-brand-padding-y);margin-right:var(--bs-navbar-brand-margin-end);font-size:var(--bs-navbar-brand-font-size);color:var(--bs-navbar-brand-color);text-decoration:none;white-space:nowrap}.navbar-brand:hover,.navbar-brand:focus{color:var(--bs-navbar-brand-hover-color)}.navbar-nav{--bs-nav-link-padding-x: 0;--bs-nav-link-padding-y: .5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color: var(--bs-navbar-color);--bs-nav-link-hover-color: var(--bs-navbar-hover-color);--bs-nav-link-disabled-color: var(--bs-navbar-disabled-color);display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link.active,.navbar-nav .nav-link.show{color:var(--bs-navbar-active-color)}.navbar-nav .dropdown-menu{position:static}.navbar-text{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-navbar-color)}.navbar-text a,.navbar-text a:hover,.navbar-text a:focus{color:var(--bs-navbar-active-color)}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:var(--bs-navbar-toggler-padding-y) var(--bs-navbar-toggler-padding-x);font-size:var(--bs-navbar-toggler-font-size);line-height:1;color:var(--bs-navbar-color);background-color:transparent;border:var(--bs-border-width) solid var(--bs-navbar-toggler-border-color);border-radius:var(--bs-navbar-toggler-border-radius);transition:var(--bs-navbar-toggler-transition)}@media (prefers-reduced-motion: reduce){.navbar-toggler{transition:none}}.navbar-toggler:hover{text-decoration:none}.navbar-toggler:focus{text-decoration:none;outline:0;box-shadow:0 0 0 var(--bs-navbar-toggler-focus-width)}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;background-image:var(--bs-navbar-toggler-icon-bg);background-repeat:no-repeat;background-position:center;background-size:100%}.navbar-nav-scroll{max-height:var(--bs-scroll-height, 75vh);overflow-y:auto}@media (min-width: 576px){.navbar-expand-sm{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-sm .offcanvas .offcanvas-header{display:none}.navbar-expand-sm .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 768px){.navbar-expand-md{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-md .offcanvas .offcanvas-header{display:none}.navbar-expand-md .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 992px){.navbar-expand-lg{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-lg .offcanvas .offcanvas-header{display:none}.navbar-expand-lg .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 1200px){.navbar-expand-xl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xl .offcanvas .offcanvas-header{display:none}.navbar-expand-xl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width: 1400px){.navbar-expand-xxl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xxl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}.navbar-expand-xxl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xxl .offcanvas .offcanvas-header{display:none}.navbar-expand-xxl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}.navbar-expand{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand .offcanvas .offcanvas-header{display:none}.navbar-expand .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}.navbar-dark,.navbar[data-bs-theme=dark]{--bs-navbar-color: rgba(255, 255, 255, .55);--bs-navbar-hover-color: rgba(255, 255, 255, .75);--bs-navbar-disabled-color: rgba(255, 255, 255, .25);--bs-navbar-active-color: #fff;--bs-navbar-brand-color: #fff;--bs-navbar-brand-hover-color: #fff;--bs-navbar-toggler-border-color: rgba(255, 255, 255, .1);--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}[data-bs-theme=dark] .navbar-toggler-icon{--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.badge{--bs-badge-padding-x: .65em;--bs-badge-padding-y: .35em;--bs-badge-font-size: .75em;--bs-badge-font-weight: 700;--bs-badge-color: #fff;--bs-badge-border-radius: var(--bs-border-radius);display:inline-block;padding:var(--bs-badge-padding-y) var(--bs-badge-padding-x);font-size:var(--bs-badge-font-size);font-weight:var(--bs-badge-font-weight);line-height:1;color:var(--bs-badge-color);text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:var(--bs-badge-border-radius)}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress,.progress-stacked{--bs-progress-height: 1rem;--bs-progress-font-size: .75rem;--bs-progress-bg: var(--bs-secondary-bg);--bs-progress-border-radius: var(--bs-border-radius);--bs-progress-box-shadow: var(--bs-box-shadow-inset);--bs-progress-bar-color: #fff;--bs-progress-bar-bg: #0d6efd;--bs-progress-bar-transition: width .6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}.progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media (prefers-reduced-motion: reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}.progress-stacked>.progress{overflow:visible}.progress-stacked>.progress>.progress-bar{width:100%}.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media (prefers-reduced-motion: reduce){.progress-bar-animated{animation:none}}.nav{--bs-nav-link-padding-x: 1rem;--bs-nav-link-padding-y: .5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color: var(--bs-link-color);--bs-nav-link-hover-color: var(--bs-link-hover-color);--bs-nav-link-disabled-color: var(--bs-secondary-color);display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);font-size:var(--bs-nav-link-font-size);font-weight:var(--bs-nav-link-font-weight);color:var(--bs-nav-link-color);text-decoration:none;background:none;border:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media (prefers-reduced-motion: reduce){.nav-link{transition:none}}.nav-link:hover,.nav-link:focus{color:var(--bs-nav-link-hover-color)}.nav-link:focus-visible{outline:0;box-shadow:0 0 0 .25rem #0d6efd40}.nav-link.disabled,.nav-link:disabled{color:var(--bs-nav-link-disabled-color);pointer-events:none;cursor:default}.nav-tabs{--bs-nav-tabs-border-width: var(--bs-border-width);--bs-nav-tabs-border-color: var(--bs-border-color);--bs-nav-tabs-border-radius: var(--bs-border-radius);--bs-nav-tabs-link-hover-border-color: var(--bs-secondary-bg) var(--bs-secondary-bg) var(--bs-border-color);--bs-nav-tabs-link-active-color: var(--bs-emphasis-color);--bs-nav-tabs-link-active-bg: var(--bs-body-bg);--bs-nav-tabs-link-active-border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.nav-tabs .nav-link{margin-bottom:calc(-1 * var(--bs-nav-tabs-border-width));border:var(--bs-nav-tabs-border-width) solid transparent;border-top-left-radius:var(--bs-nav-tabs-border-radius);border-top-right-radius:var(--bs-nav-tabs-border-radius)}.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{isolation:isolate;border-color:var(--bs-nav-tabs-link-hover-border-color)}.nav-tabs .nav-link.active,.nav-tabs .nav-item.show .nav-link{color:var(--bs-nav-tabs-link-active-color);background-color:var(--bs-nav-tabs-link-active-bg);border-color:var(--bs-nav-tabs-link-active-border-color)}.nav-tabs .dropdown-menu{margin-top:calc(-1 * var(--bs-nav-tabs-border-width));border-top-left-radius:0;border-top-right-radius:0}.nav-pills{--bs-nav-pills-border-radius: var(--bs-border-radius);--bs-nav-pills-link-active-color: #fff;--bs-nav-pills-link-active-bg: #0d6efd}.nav-pills .nav-link{border-radius:var(--bs-nav-pills-border-radius)}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:var(--bs-nav-pills-link-active-color);background-color:var(--bs-nav-pills-link-active-bg)}.nav-underline{--bs-nav-underline-gap: 1rem;--bs-nav-underline-border-width: .125rem;--bs-nav-underline-link-active-color: var(--bs-emphasis-color);gap:var(--bs-nav-underline-gap)}.nav-underline .nav-link{padding-right:0;padding-left:0;border-bottom:var(--bs-nav-underline-border-width) solid transparent}.nav-underline .nav-link:hover,.nav-underline .nav-link:focus{border-bottom-color:currentcolor}.nav-underline .nav-link.active,.nav-underline .show>.nav-link{font-weight:700;color:var(--bs-nav-underline-link-active-color);border-bottom-color:currentcolor}.nav-fill>.nav-link,.nav-fill .nav-item{flex:1 1 auto;text-align:center}.nav-justified>.nav-link,.nav-justified .nav-item{flex-basis:0;flex-grow:1;text-align:center}.nav-fill .nav-item .nav-link,.nav-justified .nav-item .nav-link{width:100%}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.card{--bs-card-spacer-y: 1rem;--bs-card-spacer-x: 1rem;--bs-card-title-spacer-y: .5rem;--bs-card-title-color: ;--bs-card-subtitle-color: ;--bs-card-border-width: var(--bs-border-width);--bs-card-border-color: var(--bs-border-color-translucent);--bs-card-border-radius: var(--bs-border-radius);--bs-card-box-shadow: ;--bs-card-inner-border-radius: calc(var(--bs-border-radius) - (var(--bs-border-width)));--bs-card-cap-padding-y: .5rem;--bs-card-cap-padding-x: 1rem;--bs-card-cap-bg: rgba(var(--bs-body-color-rgb), .03);--bs-card-cap-color: ;--bs-card-height: ;--bs-card-color: ;--bs-card-bg: var(--bs-body-bg);--bs-card-img-overlay-padding: 1rem;--bs-card-group-margin: .75rem;position:relative;display:flex;flex-direction:column;min-width:0;height:var(--bs-card-height);color:var(--bs-body-color);word-wrap:break-word;background-color:var(--bs-card-bg);background-clip:border-box;border:var(--bs-card-border-width) solid var(--bs-card-border-color);border-radius:var(--bs-card-border-radius)}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;padding:var(--bs-card-spacer-y) var(--bs-card-spacer-x);color:var(--bs-card-color)}.card-title{margin-bottom:var(--bs-card-title-spacer-y);color:var(--bs-card-title-color)}.card-subtitle{margin-top:calc(-.5 * var(--bs-card-title-spacer-y));margin-bottom:0;color:var(--bs-card-subtitle-color)}.card-text:last-child{margin-bottom:0}.card-link+.card-link{margin-left:var(--bs-card-spacer-x)}.card-header{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);margin-bottom:0;color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-bottom:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-header:first-child{border-radius:var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0}.card-footer{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-top:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-footer:last-child{border-radius:0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius)}.card-header-tabs{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-bottom:calc(-1 * var(--bs-card-cap-padding-y));margin-left:calc(-.5 * var(--bs-card-cap-padding-x));border-bottom:0}.card-header-tabs .nav-link.active{background-color:var(--bs-card-bg);border-bottom-color:var(--bs-card-bg)}.card-header-pills{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-left:calc(-.5 * var(--bs-card-cap-padding-x))}.card-img-overlay{position:absolute;inset:0;padding:var(--bs-card-img-overlay-padding);border-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-top,.card-img-bottom{width:100%}.card-img,.card-img-top{border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-bottom{border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card-group>.card{margin-bottom:var(--bs-card-group-margin)}@media (min-width: 576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-img-top,.card-group>.card:not(:last-child) .card-header{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-img-bottom,.card-group>.card:not(:last-child) .card-footer{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-img-top,.card-group>.card:not(:first-child) .card-header{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-img-bottom,.card-group>.card:not(:first-child) .card-footer{border-bottom-left-radius:0}}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.float-start{float:left!important}.float-end{float:right!important}.float-none{float:none!important}.object-fit-contain{object-fit:contain!important}.object-fit-cover{object-fit:cover!important}.object-fit-fill{object-fit:fill!important}.object-fit-scale{object-fit:scale-down!important}.object-fit-none{object-fit:none!important}.opacity-0{opacity:0!important}.opacity-25{opacity:.25!important}.opacity-50{opacity:.5!important}.opacity-75{opacity:.75!important}.opacity-100{opacity:1!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-visible{overflow:visible!important}.overflow-scroll{overflow:scroll!important}.overflow-x-auto{overflow-x:auto!important}.overflow-x-hidden{overflow-x:hidden!important}.overflow-x-visible{overflow-x:visible!important}.overflow-x-scroll{overflow-x:scroll!important}.overflow-y-auto{overflow-y:auto!important}.overflow-y-hidden{overflow-y:hidden!important}.overflow-y-visible{overflow-y:visible!important}.overflow-y-scroll{overflow-y:scroll!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-grid{display:grid!important}.d-inline-grid{display:inline-grid!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}.d-none{display:none!important}.shadow{box-shadow:var(--bs-box-shadow)!important}.shadow-sm{box-shadow:var(--bs-box-shadow-sm)!important}.shadow-lg{box-shadow:var(--bs-box-shadow-lg)!important}.shadow-none{box-shadow:none!important}.focus-ring-primary{--bs-focus-ring-color: rgba(var(--bs-primary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-secondary{--bs-focus-ring-color: rgba(var(--bs-secondary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-success{--bs-focus-ring-color: rgba(var(--bs-success-rgb), var(--bs-focus-ring-opacity))}.focus-ring-info{--bs-focus-ring-color: rgba(var(--bs-info-rgb), var(--bs-focus-ring-opacity))}.focus-ring-warning{--bs-focus-ring-color: rgba(var(--bs-warning-rgb), var(--bs-focus-ring-opacity))}.focus-ring-danger{--bs-focus-ring-color: rgba(var(--bs-danger-rgb), var(--bs-focus-ring-opacity))}.focus-ring-light{--bs-focus-ring-color: rgba(var(--bs-light-rgb), var(--bs-focus-ring-opacity))}.focus-ring-dark{--bs-focus-ring-color: rgba(var(--bs-dark-rgb), var(--bs-focus-ring-opacity))}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.top-0{top:0!important}.top-50{top:50%!important}.top-100{top:100%!important}.bottom-0{bottom:0!important}.bottom-50{bottom:50%!important}.bottom-100{bottom:100%!important}.start-0{left:0!important}.start-50{left:50%!important}.start-100{left:100%!important}.end-0{right:0!important}.end-50{right:50%!important}.end-100{right:100%!important}.translate-middle{transform:translate(-50%,-50%)!important}.translate-middle-x{transform:translate(-50%)!important}.translate-middle-y{transform:translateY(-50%)!important}.border{border:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-0{border:0!important}.border-top{border-top:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-top-0{border-top:0!important}.border-end{border-right:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-end-0{border-right:0!important}.border-bottom{border-bottom:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-bottom-0{border-bottom:0!important}.border-start{border-left:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-start-0{border-left:0!important}.border-primary{--bs-border-opacity: 1;border-color:rgba(var(--bs-primary-rgb),var(--bs-border-opacity))!important}.border-secondary{--bs-border-opacity: 1;border-color:rgba(var(--bs-secondary-rgb),var(--bs-border-opacity))!important}.border-success{--bs-border-opacity: 1;border-color:rgba(var(--bs-success-rgb),var(--bs-border-opacity))!important}.border-info{--bs-border-opacity: 1;border-color:rgba(var(--bs-info-rgb),var(--bs-border-opacity))!important}.border-warning{--bs-border-opacity: 1;border-color:rgba(var(--bs-warning-rgb),var(--bs-border-opacity))!important}.border-danger{--bs-border-opacity: 1;border-color:rgba(var(--bs-danger-rgb),var(--bs-border-opacity))!important}.border-light{--bs-border-opacity: 1;border-color:rgba(var(--bs-light-rgb),var(--bs-border-opacity))!important}.border-dark{--bs-border-opacity: 1;border-color:rgba(var(--bs-dark-rgb),var(--bs-border-opacity))!important}.border-black{--bs-border-opacity: 1;border-color:rgba(var(--bs-black-rgb),var(--bs-border-opacity))!important}.border-white{--bs-border-opacity: 1;border-color:rgba(var(--bs-white-rgb),var(--bs-border-opacity))!important}.border-primary-subtle{border-color:var(--bs-primary-border-subtle)!important}.border-secondary-subtle{border-color:var(--bs-secondary-border-subtle)!important}.border-success-subtle{border-color:var(--bs-success-border-subtle)!important}.border-info-subtle{border-color:var(--bs-info-border-subtle)!important}.border-warning-subtle{border-color:var(--bs-warning-border-subtle)!important}.border-danger-subtle{border-color:var(--bs-danger-border-subtle)!important}.border-light-subtle{border-color:var(--bs-light-border-subtle)!important}.border-dark-subtle{border-color:var(--bs-dark-border-subtle)!important}.border-1{border-width:1px!important}.border-2{border-width:2px!important}.border-3{border-width:3px!important}.border-4{border-width:4px!important}.border-5{border-width:5px!important}.border-opacity-10{--bs-border-opacity: .1}.border-opacity-25{--bs-border-opacity: .25}.border-opacity-50{--bs-border-opacity: .5}.border-opacity-75{--bs-border-opacity: .75}.border-opacity-100{--bs-border-opacity: 1}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.mw-100{max-width:100%!important}.vw-100{width:100vw!important}.min-vw-100{min-width:100vw!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mh-100{max-height:100%!important}.vh-100{height:100vh!important}.min-vh-100{min-height:100vh!important}.flex-fill{flex:1 1 auto!important}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.justify-content-evenly{justify-content:space-evenly!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}.order-first{order:-1!important}.order-0{order:0!important}.order-1{order:1!important}.order-2{order:2!important}.order-3{order:3!important}.order-4{order:4!important}.order-5{order:5!important}.order-last{order:6!important}.m-0{margin:0!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}.m-5{margin:3rem!important}.m-auto{margin:auto!important}.mx-0{margin-right:0!important;margin-left:0!important}.mx-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-3{margin-right:1rem!important;margin-left:1rem!important}.mx-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-5{margin-right:3rem!important;margin-left:3rem!important}.mx-auto{margin-right:auto!important;margin-left:auto!important}.my-0{margin-top:0!important;margin-bottom:0!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}.mt-auto{margin-top:auto!important}.me-0{margin-right:0!important}.me-1{margin-right:.25rem!important}.me-2{margin-right:.5rem!important}.me-3{margin-right:1rem!important}.me-4{margin-right:1.5rem!important}.me-5{margin-right:3rem!important}.me-auto{margin-right:auto!important}.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}.mb-auto{margin-bottom:auto!important}.ms-0{margin-left:0!important}.ms-1{margin-left:.25rem!important}.ms-2{margin-left:.5rem!important}.ms-3{margin-left:1rem!important}.ms-4{margin-left:1.5rem!important}.ms-5{margin-left:3rem!important}.ms-auto{margin-left:auto!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:3rem!important}.px-0{padding-right:0!important;padding-left:0!important}.px-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-3{padding-right:1rem!important;padding-left:1rem!important}.px-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-5{padding-right:3rem!important;padding-left:3rem!important}.py-0{padding-top:0!important;padding-bottom:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pt-4{padding-top:1.5rem!important}.pt-5{padding-top:3rem!important}.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}.pe-4{padding-right:1.5rem!important}.pe-5{padding-right:3rem!important}.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}.pb-4{padding-bottom:1.5rem!important}.pb-5{padding-bottom:3rem!important}.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}.ps-4{padding-left:1.5rem!important}.ps-5{padding-left:3rem!important}.gap-0{gap:0!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-3{gap:1rem!important}.gap-4{gap:1.5rem!important}.gap-5{gap:3rem!important}.row-gap-0{row-gap:0!important}.row-gap-1{row-gap:.25rem!important}.row-gap-2{row-gap:.5rem!important}.row-gap-3{row-gap:1rem!important}.row-gap-4{row-gap:1.5rem!important}.row-gap-5{row-gap:3rem!important}.column-gap-0{column-gap:0!important}.column-gap-1{column-gap:.25rem!important}.column-gap-2{column-gap:.5rem!important}.column-gap-3{column-gap:1rem!important}.column-gap-4{column-gap:1.5rem!important}.column-gap-5{column-gap:3rem!important}.font-monospace{font-family:var(--bs-font-monospace)!important}.fs-1{font-size:calc(1.375rem + 1.5vw)!important}.fs-2{font-size:calc(1.325rem + .9vw)!important}.fs-3{font-size:calc(1.3rem + .6vw)!important}.fs-4{font-size:calc(1.275rem + .3vw)!important}.fs-5{font-size:1.25rem!important}.fs-6{font-size:1rem!important}.fst-italic{font-style:italic!important}.fst-normal{font-style:normal!important}.fw-lighter{font-weight:lighter!important}.fw-light{font-weight:300!important}.fw-normal{font-weight:400!important}.fw-medium{font-weight:500!important}.fw-semibold{font-weight:600!important}.fw-bold{font-weight:700!important}.fw-bolder{font-weight:bolder!important}.lh-1{line-height:1!important}.lh-sm{line-height:1.25!important}.lh-base{line-height:1.5!important}.lh-lg{line-height:2!important}.text-start{text-align:left!important}.text-end{text-align:right!important}.text-center{text-align:center!important}.text-decoration-none{text-decoration:none!important}.text-decoration-underline{text-decoration:underline!important}.text-decoration-line-through{text-decoration:line-through!important}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-break{word-wrap:break-word!important;word-break:break-word!important}.text-primary{--bs-text-opacity: 1;color:rgba(var(--bs-primary-rgb),var(--bs-text-opacity))!important}.text-secondary{--bs-text-opacity: 1;color:rgba(var(--bs-secondary-rgb),var(--bs-text-opacity))!important}.text-success{--bs-text-opacity: 1;color:rgba(var(--bs-success-rgb),var(--bs-text-opacity))!important}.text-info{--bs-text-opacity: 1;color:rgba(var(--bs-info-rgb),var(--bs-text-opacity))!important}.text-warning{--bs-text-opacity: 1;color:rgba(var(--bs-warning-rgb),var(--bs-text-opacity))!important}.text-danger{--bs-text-opacity: 1;color:rgba(var(--bs-danger-rgb),var(--bs-text-opacity))!important}.text-light{--bs-text-opacity: 1;color:rgba(var(--bs-light-rgb),var(--bs-text-opacity))!important}.text-dark{--bs-text-opacity: 1;color:rgba(var(--bs-dark-rgb),var(--bs-text-opacity))!important}.text-black{--bs-text-opacity: 1;color:rgba(var(--bs-black-rgb),var(--bs-text-opacity))!important}.text-white{--bs-text-opacity: 1;color:rgba(var(--bs-white-rgb),var(--bs-text-opacity))!important}.text-body{--bs-text-opacity: 1;color:rgba(var(--bs-body-color-rgb),var(--bs-text-opacity))!important}.text-muted{--bs-text-opacity: 1;color:var(--bs-secondary-color)!important}.text-black-50{--bs-text-opacity: 1;color:#00000080!important}.text-white-50{--bs-text-opacity: 1;color:#ffffff80!important}.text-body-secondary{--bs-text-opacity: 1;color:var(--bs-secondary-color)!important}.text-body-tertiary{--bs-text-opacity: 1;color:var(--bs-tertiary-color)!important}.text-body-emphasis{--bs-text-opacity: 1;color:var(--bs-emphasis-color)!important}.text-reset{--bs-text-opacity: 1;color:inherit!important}.text-opacity-25{--bs-text-opacity: .25}.text-opacity-50{--bs-text-opacity: .5}.text-opacity-75{--bs-text-opacity: .75}.text-opacity-100{--bs-text-opacity: 1}.text-primary-emphasis{color:var(--bs-primary-text-emphasis)!important}.text-secondary-emphasis{color:var(--bs-secondary-text-emphasis)!important}.text-success-emphasis{color:var(--bs-success-text-emphasis)!important}.text-info-emphasis{color:var(--bs-info-text-emphasis)!important}.text-warning-emphasis{color:var(--bs-warning-text-emphasis)!important}.text-danger-emphasis{color:var(--bs-danger-text-emphasis)!important}.text-light-emphasis{color:var(--bs-light-text-emphasis)!important}.text-dark-emphasis{color:var(--bs-dark-text-emphasis)!important}.link-opacity-10,.link-opacity-10-hover:hover{--bs-link-opacity: .1}.link-opacity-25,.link-opacity-25-hover:hover{--bs-link-opacity: .25}.link-opacity-50,.link-opacity-50-hover:hover{--bs-link-opacity: .5}.link-opacity-75,.link-opacity-75-hover:hover{--bs-link-opacity: .75}.link-opacity-100,.link-opacity-100-hover:hover{--bs-link-opacity: 1}.link-offset-1,.link-offset-1-hover:hover{text-underline-offset:.125em!important}.link-offset-2,.link-offset-2-hover:hover{text-underline-offset:.25em!important}.link-offset-3,.link-offset-3-hover:hover{text-underline-offset:.375em!important}.link-underline-primary{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-primary-rgb),var(--bs-link-underline-opacity))!important}.link-underline-secondary{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-secondary-rgb),var(--bs-link-underline-opacity))!important}.link-underline-success{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-success-rgb),var(--bs-link-underline-opacity))!important}.link-underline-info{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-info-rgb),var(--bs-link-underline-opacity))!important}.link-underline-warning{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-warning-rgb),var(--bs-link-underline-opacity))!important}.link-underline-danger{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-danger-rgb),var(--bs-link-underline-opacity))!important}.link-underline-light{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-light-rgb),var(--bs-link-underline-opacity))!important}.link-underline-dark{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-dark-rgb),var(--bs-link-underline-opacity))!important}.link-underline{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-underline-opacity, 1))!important}.link-underline-opacity-0,.link-underline-opacity-0-hover:hover{--bs-link-underline-opacity: 0}.link-underline-opacity-10,.link-underline-opacity-10-hover:hover{--bs-link-underline-opacity: .1}.link-underline-opacity-25,.link-underline-opacity-25-hover:hover{--bs-link-underline-opacity: .25}.link-underline-opacity-50,.link-underline-opacity-50-hover:hover{--bs-link-underline-opacity: .5}.link-underline-opacity-75,.link-underline-opacity-75-hover:hover{--bs-link-underline-opacity: .75}.link-underline-opacity-100,.link-underline-opacity-100-hover:hover{--bs-link-underline-opacity: 1}.bg-primary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-primary-rgb),var(--bs-bg-opacity))!important}.bg-secondary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-secondary-rgb),var(--bs-bg-opacity))!important}.bg-success{--bs-bg-opacity: 1;background-color:rgba(var(--bs-success-rgb),var(--bs-bg-opacity))!important}.bg-info{--bs-bg-opacity: 1;background-color:rgba(var(--bs-info-rgb),var(--bs-bg-opacity))!important}.bg-warning{--bs-bg-opacity: 1;background-color:rgba(var(--bs-warning-rgb),var(--bs-bg-opacity))!important}.bg-danger{--bs-bg-opacity: 1;background-color:rgba(var(--bs-danger-rgb),var(--bs-bg-opacity))!important}.bg-light{--bs-bg-opacity: 1;background-color:rgba(var(--bs-light-rgb),var(--bs-bg-opacity))!important}.bg-dark{--bs-bg-opacity: 1;background-color:rgba(var(--bs-dark-rgb),var(--bs-bg-opacity))!important}.bg-black{--bs-bg-opacity: 1;background-color:rgba(var(--bs-black-rgb),var(--bs-bg-opacity))!important}.bg-white{--bs-bg-opacity: 1;background-color:rgba(var(--bs-white-rgb),var(--bs-bg-opacity))!important}.bg-body{--bs-bg-opacity: 1;background-color:rgba(var(--bs-body-bg-rgb),var(--bs-bg-opacity))!important}.bg-transparent{--bs-bg-opacity: 1;background-color:transparent!important}.bg-body-secondary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-secondary-bg-rgb),var(--bs-bg-opacity))!important}.bg-body-tertiary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-tertiary-bg-rgb),var(--bs-bg-opacity))!important}.bg-opacity-10{--bs-bg-opacity: .1}.bg-opacity-25{--bs-bg-opacity: .25}.bg-opacity-50{--bs-bg-opacity: .5}.bg-opacity-75{--bs-bg-opacity: .75}.bg-opacity-100{--bs-bg-opacity: 1}.bg-primary-subtle{background-color:var(--bs-primary-bg-subtle)!important}.bg-secondary-subtle{background-color:var(--bs-secondary-bg-subtle)!important}.bg-success-subtle{background-color:var(--bs-success-bg-subtle)!important}.bg-info-subtle{background-color:var(--bs-info-bg-subtle)!important}.bg-warning-subtle{background-color:var(--bs-warning-bg-subtle)!important}.bg-danger-subtle{background-color:var(--bs-danger-bg-subtle)!important}.bg-light-subtle{background-color:var(--bs-light-bg-subtle)!important}.bg-dark-subtle{background-color:var(--bs-dark-bg-subtle)!important}.bg-gradient{background-image:var(--bs-gradient)!important}.user-select-all{-webkit-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;user-select:none!important}.pe-none{pointer-events:none!important}.pe-auto{pointer-events:auto!important}.rounded{border-radius:var(--bs-border-radius)!important}.rounded-0{border-radius:0!important}.rounded-1{border-radius:var(--bs-border-radius-sm)!important}.rounded-2{border-radius:var(--bs-border-radius)!important}.rounded-3{border-radius:var(--bs-border-radius-lg)!important}.rounded-4{border-radius:var(--bs-border-radius-xl)!important}.rounded-5{border-radius:var(--bs-border-radius-xxl)!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:var(--bs-border-radius-pill)!important}.rounded-top{border-top-left-radius:var(--bs-border-radius)!important;border-top-right-radius:var(--bs-border-radius)!important}.rounded-top-0{border-top-left-radius:0!important;border-top-right-radius:0!important}.rounded-top-1{border-top-left-radius:var(--bs-border-radius-sm)!important;border-top-right-radius:var(--bs-border-radius-sm)!important}.rounded-top-2{border-top-left-radius:var(--bs-border-radius)!important;border-top-right-radius:var(--bs-border-radius)!important}.rounded-top-3{border-top-left-radius:var(--bs-border-radius-lg)!important;border-top-right-radius:var(--bs-border-radius-lg)!important}.rounded-top-4{border-top-left-radius:var(--bs-border-radius-xl)!important;border-top-right-radius:var(--bs-border-radius-xl)!important}.rounded-top-5{border-top-left-radius:var(--bs-border-radius-xxl)!important;border-top-right-radius:var(--bs-border-radius-xxl)!important}.rounded-top-circle{border-top-left-radius:50%!important;border-top-right-radius:50%!important}.rounded-top-pill{border-top-left-radius:var(--bs-border-radius-pill)!important;border-top-right-radius:var(--bs-border-radius-pill)!important}.rounded-end{border-top-right-radius:var(--bs-border-radius)!important;border-bottom-right-radius:var(--bs-border-radius)!important}.rounded-end-0{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.rounded-end-1{border-top-right-radius:var(--bs-border-radius-sm)!important;border-bottom-right-radius:var(--bs-border-radius-sm)!important}.rounded-end-2{border-top-right-radius:var(--bs-border-radius)!important;border-bottom-right-radius:var(--bs-border-radius)!important}.rounded-end-3{border-top-right-radius:var(--bs-border-radius-lg)!important;border-bottom-right-radius:var(--bs-border-radius-lg)!important}.rounded-end-4{border-top-right-radius:var(--bs-border-radius-xl)!important;border-bottom-right-radius:var(--bs-border-radius-xl)!important}.rounded-end-5{border-top-right-radius:var(--bs-border-radius-xxl)!important;border-bottom-right-radius:var(--bs-border-radius-xxl)!important}.rounded-end-circle{border-top-right-radius:50%!important;border-bottom-right-radius:50%!important}.rounded-end-pill{border-top-right-radius:var(--bs-border-radius-pill)!important;border-bottom-right-radius:var(--bs-border-radius-pill)!important}.rounded-bottom{border-bottom-right-radius:var(--bs-border-radius)!important;border-bottom-left-radius:var(--bs-border-radius)!important}.rounded-bottom-0{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.rounded-bottom-1{border-bottom-right-radius:var(--bs-border-radius-sm)!important;border-bottom-left-radius:var(--bs-border-radius-sm)!important}.rounded-bottom-2{border-bottom-right-radius:var(--bs-border-radius)!important;border-bottom-left-radius:var(--bs-border-radius)!important}.rounded-bottom-3{border-bottom-right-radius:var(--bs-border-radius-lg)!important;border-bottom-left-radius:var(--bs-border-radius-lg)!important}.rounded-bottom-4{border-bottom-right-radius:var(--bs-border-radius-xl)!important;border-bottom-left-radius:var(--bs-border-radius-xl)!important}.rounded-bottom-5{border-bottom-right-radius:var(--bs-border-radius-xxl)!important;border-bottom-left-radius:var(--bs-border-radius-xxl)!important}.rounded-bottom-circle{border-bottom-right-radius:50%!important;border-bottom-left-radius:50%!important}.rounded-bottom-pill{border-bottom-right-radius:var(--bs-border-radius-pill)!important;border-bottom-left-radius:var(--bs-border-radius-pill)!important}.rounded-start{border-bottom-left-radius:var(--bs-border-radius)!important;border-top-left-radius:var(--bs-border-radius)!important}.rounded-start-0{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.rounded-start-1{border-bottom-left-radius:var(--bs-border-radius-sm)!important;border-top-left-radius:var(--bs-border-radius-sm)!important}.rounded-start-2{border-bottom-left-radius:var(--bs-border-radius)!important;border-top-left-radius:var(--bs-border-radius)!important}.rounded-start-3{border-bottom-left-radius:var(--bs-border-radius-lg)!important;border-top-left-radius:var(--bs-border-radius-lg)!important}.rounded-start-4{border-bottom-left-radius:var(--bs-border-radius-xl)!important;border-top-left-radius:var(--bs-border-radius-xl)!important}.rounded-start-5{border-bottom-left-radius:var(--bs-border-radius-xxl)!important;border-top-left-radius:var(--bs-border-radius-xxl)!important}.rounded-start-circle{border-bottom-left-radius:50%!important;border-top-left-radius:50%!important}.rounded-start-pill{border-bottom-left-radius:var(--bs-border-radius-pill)!important;border-top-left-radius:var(--bs-border-radius-pill)!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}.z-n1{z-index:-1!important}.z-0{z-index:0!important}.z-1{z-index:1!important}.z-2{z-index:2!important}.z-3{z-index:3!important}@media (min-width: 576px){.float-sm-start{float:left!important}.float-sm-end{float:right!important}.float-sm-none{float:none!important}.object-fit-sm-contain{object-fit:contain!important}.object-fit-sm-cover{object-fit:cover!important}.object-fit-sm-fill{object-fit:fill!important}.object-fit-sm-scale{object-fit:scale-down!important}.object-fit-sm-none{object-fit:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-grid{display:grid!important}.d-sm-inline-grid{display:inline-grid!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}.d-sm-none{display:none!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.justify-content-sm-evenly{justify-content:space-evenly!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}.order-sm-first{order:-1!important}.order-sm-0{order:0!important}.order-sm-1{order:1!important}.order-sm-2{order:2!important}.order-sm-3{order:3!important}.order-sm-4{order:4!important}.order-sm-5{order:5!important}.order-sm-last{order:6!important}.m-sm-0{margin:0!important}.m-sm-1{margin:.25rem!important}.m-sm-2{margin:.5rem!important}.m-sm-3{margin:1rem!important}.m-sm-4{margin:1.5rem!important}.m-sm-5{margin:3rem!important}.m-sm-auto{margin:auto!important}.mx-sm-0{margin-right:0!important;margin-left:0!important}.mx-sm-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-sm-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-sm-3{margin-right:1rem!important;margin-left:1rem!important}.mx-sm-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-sm-5{margin-right:3rem!important;margin-left:3rem!important}.mx-sm-auto{margin-right:auto!important;margin-left:auto!important}.my-sm-0{margin-top:0!important;margin-bottom:0!important}.my-sm-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-sm-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-sm-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-sm-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-sm-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-sm-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-sm-0{margin-top:0!important}.mt-sm-1{margin-top:.25rem!important}.mt-sm-2{margin-top:.5rem!important}.mt-sm-3{margin-top:1rem!important}.mt-sm-4{margin-top:1.5rem!important}.mt-sm-5{margin-top:3rem!important}.mt-sm-auto{margin-top:auto!important}.me-sm-0{margin-right:0!important}.me-sm-1{margin-right:.25rem!important}.me-sm-2{margin-right:.5rem!important}.me-sm-3{margin-right:1rem!important}.me-sm-4{margin-right:1.5rem!important}.me-sm-5{margin-right:3rem!important}.me-sm-auto{margin-right:auto!important}.mb-sm-0{margin-bottom:0!important}.mb-sm-1{margin-bottom:.25rem!important}.mb-sm-2{margin-bottom:.5rem!important}.mb-sm-3{margin-bottom:1rem!important}.mb-sm-4{margin-bottom:1.5rem!important}.mb-sm-5{margin-bottom:3rem!important}.mb-sm-auto{margin-bottom:auto!important}.ms-sm-0{margin-left:0!important}.ms-sm-1{margin-left:.25rem!important}.ms-sm-2{margin-left:.5rem!important}.ms-sm-3{margin-left:1rem!important}.ms-sm-4{margin-left:1.5rem!important}.ms-sm-5{margin-left:3rem!important}.ms-sm-auto{margin-left:auto!important}.p-sm-0{padding:0!important}.p-sm-1{padding:.25rem!important}.p-sm-2{padding:.5rem!important}.p-sm-3{padding:1rem!important}.p-sm-4{padding:1.5rem!important}.p-sm-5{padding:3rem!important}.px-sm-0{padding-right:0!important;padding-left:0!important}.px-sm-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-sm-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-sm-3{padding-right:1rem!important;padding-left:1rem!important}.px-sm-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-sm-5{padding-right:3rem!important;padding-left:3rem!important}.py-sm-0{padding-top:0!important;padding-bottom:0!important}.py-sm-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-sm-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-sm-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-sm-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-sm-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-sm-0{padding-top:0!important}.pt-sm-1{padding-top:.25rem!important}.pt-sm-2{padding-top:.5rem!important}.pt-sm-3{padding-top:1rem!important}.pt-sm-4{padding-top:1.5rem!important}.pt-sm-5{padding-top:3rem!important}.pe-sm-0{padding-right:0!important}.pe-sm-1{padding-right:.25rem!important}.pe-sm-2{padding-right:.5rem!important}.pe-sm-3{padding-right:1rem!important}.pe-sm-4{padding-right:1.5rem!important}.pe-sm-5{padding-right:3rem!important}.pb-sm-0{padding-bottom:0!important}.pb-sm-1{padding-bottom:.25rem!important}.pb-sm-2{padding-bottom:.5rem!important}.pb-sm-3{padding-bottom:1rem!important}.pb-sm-4{padding-bottom:1.5rem!important}.pb-sm-5{padding-bottom:3rem!important}.ps-sm-0{padding-left:0!important}.ps-sm-1{padding-left:.25rem!important}.ps-sm-2{padding-left:.5rem!important}.ps-sm-3{padding-left:1rem!important}.ps-sm-4{padding-left:1.5rem!important}.ps-sm-5{padding-left:3rem!important}.gap-sm-0{gap:0!important}.gap-sm-1{gap:.25rem!important}.gap-sm-2{gap:.5rem!important}.gap-sm-3{gap:1rem!important}.gap-sm-4{gap:1.5rem!important}.gap-sm-5{gap:3rem!important}.row-gap-sm-0{row-gap:0!important}.row-gap-sm-1{row-gap:.25rem!important}.row-gap-sm-2{row-gap:.5rem!important}.row-gap-sm-3{row-gap:1rem!important}.row-gap-sm-4{row-gap:1.5rem!important}.row-gap-sm-5{row-gap:3rem!important}.column-gap-sm-0{column-gap:0!important}.column-gap-sm-1{column-gap:.25rem!important}.column-gap-sm-2{column-gap:.5rem!important}.column-gap-sm-3{column-gap:1rem!important}.column-gap-sm-4{column-gap:1.5rem!important}.column-gap-sm-5{column-gap:3rem!important}.text-sm-start{text-align:left!important}.text-sm-end{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width: 768px){.float-md-start{float:left!important}.float-md-end{float:right!important}.float-md-none{float:none!important}.object-fit-md-contain{object-fit:contain!important}.object-fit-md-cover{object-fit:cover!important}.object-fit-md-fill{object-fit:fill!important}.object-fit-md-scale{object-fit:scale-down!important}.object-fit-md-none{object-fit:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-grid{display:grid!important}.d-md-inline-grid{display:inline-grid!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}.d-md-none{display:none!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.justify-content-md-evenly{justify-content:space-evenly!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}.order-md-first{order:-1!important}.order-md-0{order:0!important}.order-md-1{order:1!important}.order-md-2{order:2!important}.order-md-3{order:3!important}.order-md-4{order:4!important}.order-md-5{order:5!important}.order-md-last{order:6!important}.m-md-0{margin:0!important}.m-md-1{margin:.25rem!important}.m-md-2{margin:.5rem!important}.m-md-3{margin:1rem!important}.m-md-4{margin:1.5rem!important}.m-md-5{margin:3rem!important}.m-md-auto{margin:auto!important}.mx-md-0{margin-right:0!important;margin-left:0!important}.mx-md-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-md-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-md-3{margin-right:1rem!important;margin-left:1rem!important}.mx-md-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-md-5{margin-right:3rem!important;margin-left:3rem!important}.mx-md-auto{margin-right:auto!important;margin-left:auto!important}.my-md-0{margin-top:0!important;margin-bottom:0!important}.my-md-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-md-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-md-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-md-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-md-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-md-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-md-0{margin-top:0!important}.mt-md-1{margin-top:.25rem!important}.mt-md-2{margin-top:.5rem!important}.mt-md-3{margin-top:1rem!important}.mt-md-4{margin-top:1.5rem!important}.mt-md-5{margin-top:3rem!important}.mt-md-auto{margin-top:auto!important}.me-md-0{margin-right:0!important}.me-md-1{margin-right:.25rem!important}.me-md-2{margin-right:.5rem!important}.me-md-3{margin-right:1rem!important}.me-md-4{margin-right:1.5rem!important}.me-md-5{margin-right:3rem!important}.me-md-auto{margin-right:auto!important}.mb-md-0{margin-bottom:0!important}.mb-md-1{margin-bottom:.25rem!important}.mb-md-2{margin-bottom:.5rem!important}.mb-md-3{margin-bottom:1rem!important}.mb-md-4{margin-bottom:1.5rem!important}.mb-md-5{margin-bottom:3rem!important}.mb-md-auto{margin-bottom:auto!important}.ms-md-0{margin-left:0!important}.ms-md-1{margin-left:.25rem!important}.ms-md-2{margin-left:.5rem!important}.ms-md-3{margin-left:1rem!important}.ms-md-4{margin-left:1.5rem!important}.ms-md-5{margin-left:3rem!important}.ms-md-auto{margin-left:auto!important}.p-md-0{padding:0!important}.p-md-1{padding:.25rem!important}.p-md-2{padding:.5rem!important}.p-md-3{padding:1rem!important}.p-md-4{padding:1.5rem!important}.p-md-5{padding:3rem!important}.px-md-0{padding-right:0!important;padding-left:0!important}.px-md-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-md-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-md-3{padding-right:1rem!important;padding-left:1rem!important}.px-md-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-md-5{padding-right:3rem!important;padding-left:3rem!important}.py-md-0{padding-top:0!important;padding-bottom:0!important}.py-md-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-md-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-md-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-md-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-md-0{padding-top:0!important}.pt-md-1{padding-top:.25rem!important}.pt-md-2{padding-top:.5rem!important}.pt-md-3{padding-top:1rem!important}.pt-md-4{padding-top:1.5rem!important}.pt-md-5{padding-top:3rem!important}.pe-md-0{padding-right:0!important}.pe-md-1{padding-right:.25rem!important}.pe-md-2{padding-right:.5rem!important}.pe-md-3{padding-right:1rem!important}.pe-md-4{padding-right:1.5rem!important}.pe-md-5{padding-right:3rem!important}.pb-md-0{padding-bottom:0!important}.pb-md-1{padding-bottom:.25rem!important}.pb-md-2{padding-bottom:.5rem!important}.pb-md-3{padding-bottom:1rem!important}.pb-md-4{padding-bottom:1.5rem!important}.pb-md-5{padding-bottom:3rem!important}.ps-md-0{padding-left:0!important}.ps-md-1{padding-left:.25rem!important}.ps-md-2{padding-left:.5rem!important}.ps-md-3{padding-left:1rem!important}.ps-md-4{padding-left:1.5rem!important}.ps-md-5{padding-left:3rem!important}.gap-md-0{gap:0!important}.gap-md-1{gap:.25rem!important}.gap-md-2{gap:.5rem!important}.gap-md-3{gap:1rem!important}.gap-md-4{gap:1.5rem!important}.gap-md-5{gap:3rem!important}.row-gap-md-0{row-gap:0!important}.row-gap-md-1{row-gap:.25rem!important}.row-gap-md-2{row-gap:.5rem!important}.row-gap-md-3{row-gap:1rem!important}.row-gap-md-4{row-gap:1.5rem!important}.row-gap-md-5{row-gap:3rem!important}.column-gap-md-0{column-gap:0!important}.column-gap-md-1{column-gap:.25rem!important}.column-gap-md-2{column-gap:.5rem!important}.column-gap-md-3{column-gap:1rem!important}.column-gap-md-4{column-gap:1.5rem!important}.column-gap-md-5{column-gap:3rem!important}.text-md-start{text-align:left!important}.text-md-end{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width: 992px){.float-lg-start{float:left!important}.float-lg-end{float:right!important}.float-lg-none{float:none!important}.object-fit-lg-contain{object-fit:contain!important}.object-fit-lg-cover{object-fit:cover!important}.object-fit-lg-fill{object-fit:fill!important}.object-fit-lg-scale{object-fit:scale-down!important}.object-fit-lg-none{object-fit:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-grid{display:grid!important}.d-lg-inline-grid{display:inline-grid!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}.d-lg-none{display:none!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.justify-content-lg-evenly{justify-content:space-evenly!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}.order-lg-first{order:-1!important}.order-lg-0{order:0!important}.order-lg-1{order:1!important}.order-lg-2{order:2!important}.order-lg-3{order:3!important}.order-lg-4{order:4!important}.order-lg-5{order:5!important}.order-lg-last{order:6!important}.m-lg-0{margin:0!important}.m-lg-1{margin:.25rem!important}.m-lg-2{margin:.5rem!important}.m-lg-3{margin:1rem!important}.m-lg-4{margin:1.5rem!important}.m-lg-5{margin:3rem!important}.m-lg-auto{margin:auto!important}.mx-lg-0{margin-right:0!important;margin-left:0!important}.mx-lg-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-lg-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-lg-3{margin-right:1rem!important;margin-left:1rem!important}.mx-lg-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-lg-5{margin-right:3rem!important;margin-left:3rem!important}.mx-lg-auto{margin-right:auto!important;margin-left:auto!important}.my-lg-0{margin-top:0!important;margin-bottom:0!important}.my-lg-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-lg-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-lg-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-lg-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-lg-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-lg-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-lg-0{margin-top:0!important}.mt-lg-1{margin-top:.25rem!important}.mt-lg-2{margin-top:.5rem!important}.mt-lg-3{margin-top:1rem!important}.mt-lg-4{margin-top:1.5rem!important}.mt-lg-5{margin-top:3rem!important}.mt-lg-auto{margin-top:auto!important}.me-lg-0{margin-right:0!important}.me-lg-1{margin-right:.25rem!important}.me-lg-2{margin-right:.5rem!important}.me-lg-3{margin-right:1rem!important}.me-lg-4{margin-right:1.5rem!important}.me-lg-5{margin-right:3rem!important}.me-lg-auto{margin-right:auto!important}.mb-lg-0{margin-bottom:0!important}.mb-lg-1{margin-bottom:.25rem!important}.mb-lg-2{margin-bottom:.5rem!important}.mb-lg-3{margin-bottom:1rem!important}.mb-lg-4{margin-bottom:1.5rem!important}.mb-lg-5{margin-bottom:3rem!important}.mb-lg-auto{margin-bottom:auto!important}.ms-lg-0{margin-left:0!important}.ms-lg-1{margin-left:.25rem!important}.ms-lg-2{margin-left:.5rem!important}.ms-lg-3{margin-left:1rem!important}.ms-lg-4{margin-left:1.5rem!important}.ms-lg-5{margin-left:3rem!important}.ms-lg-auto{margin-left:auto!important}.p-lg-0{padding:0!important}.p-lg-1{padding:.25rem!important}.p-lg-2{padding:.5rem!important}.p-lg-3{padding:1rem!important}.p-lg-4{padding:1.5rem!important}.p-lg-5{padding:3rem!important}.px-lg-0{padding-right:0!important;padding-left:0!important}.px-lg-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-lg-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-lg-3{padding-right:1rem!important;padding-left:1rem!important}.px-lg-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-lg-5{padding-right:3rem!important;padding-left:3rem!important}.py-lg-0{padding-top:0!important;padding-bottom:0!important}.py-lg-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-lg-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-lg-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-lg-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-lg-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-lg-0{padding-top:0!important}.pt-lg-1{padding-top:.25rem!important}.pt-lg-2{padding-top:.5rem!important}.pt-lg-3{padding-top:1rem!important}.pt-lg-4{padding-top:1.5rem!important}.pt-lg-5{padding-top:3rem!important}.pe-lg-0{padding-right:0!important}.pe-lg-1{padding-right:.25rem!important}.pe-lg-2{padding-right:.5rem!important}.pe-lg-3{padding-right:1rem!important}.pe-lg-4{padding-right:1.5rem!important}.pe-lg-5{padding-right:3rem!important}.pb-lg-0{padding-bottom:0!important}.pb-lg-1{padding-bottom:.25rem!important}.pb-lg-2{padding-bottom:.5rem!important}.pb-lg-3{padding-bottom:1rem!important}.pb-lg-4{padding-bottom:1.5rem!important}.pb-lg-5{padding-bottom:3rem!important}.ps-lg-0{padding-left:0!important}.ps-lg-1{padding-left:.25rem!important}.ps-lg-2{padding-left:.5rem!important}.ps-lg-3{padding-left:1rem!important}.ps-lg-4{padding-left:1.5rem!important}.ps-lg-5{padding-left:3rem!important}.gap-lg-0{gap:0!important}.gap-lg-1{gap:.25rem!important}.gap-lg-2{gap:.5rem!important}.gap-lg-3{gap:1rem!important}.gap-lg-4{gap:1.5rem!important}.gap-lg-5{gap:3rem!important}.row-gap-lg-0{row-gap:0!important}.row-gap-lg-1{row-gap:.25rem!important}.row-gap-lg-2{row-gap:.5rem!important}.row-gap-lg-3{row-gap:1rem!important}.row-gap-lg-4{row-gap:1.5rem!important}.row-gap-lg-5{row-gap:3rem!important}.column-gap-lg-0{column-gap:0!important}.column-gap-lg-1{column-gap:.25rem!important}.column-gap-lg-2{column-gap:.5rem!important}.column-gap-lg-3{column-gap:1rem!important}.column-gap-lg-4{column-gap:1.5rem!important}.column-gap-lg-5{column-gap:3rem!important}.text-lg-start{text-align:left!important}.text-lg-end{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width: 1200px){.float-xl-start{float:left!important}.float-xl-end{float:right!important}.float-xl-none{float:none!important}.object-fit-xl-contain{object-fit:contain!important}.object-fit-xl-cover{object-fit:cover!important}.object-fit-xl-fill{object-fit:fill!important}.object-fit-xl-scale{object-fit:scale-down!important}.object-fit-xl-none{object-fit:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-grid{display:grid!important}.d-xl-inline-grid{display:inline-grid!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}.d-xl-none{display:none!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.justify-content-xl-evenly{justify-content:space-evenly!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}.order-xl-first{order:-1!important}.order-xl-0{order:0!important}.order-xl-1{order:1!important}.order-xl-2{order:2!important}.order-xl-3{order:3!important}.order-xl-4{order:4!important}.order-xl-5{order:5!important}.order-xl-last{order:6!important}.m-xl-0{margin:0!important}.m-xl-1{margin:.25rem!important}.m-xl-2{margin:.5rem!important}.m-xl-3{margin:1rem!important}.m-xl-4{margin:1.5rem!important}.m-xl-5{margin:3rem!important}.m-xl-auto{margin:auto!important}.mx-xl-0{margin-right:0!important;margin-left:0!important}.mx-xl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xl-auto{margin-right:auto!important;margin-left:auto!important}.my-xl-0{margin-top:0!important;margin-bottom:0!important}.my-xl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xl-0{margin-top:0!important}.mt-xl-1{margin-top:.25rem!important}.mt-xl-2{margin-top:.5rem!important}.mt-xl-3{margin-top:1rem!important}.mt-xl-4{margin-top:1.5rem!important}.mt-xl-5{margin-top:3rem!important}.mt-xl-auto{margin-top:auto!important}.me-xl-0{margin-right:0!important}.me-xl-1{margin-right:.25rem!important}.me-xl-2{margin-right:.5rem!important}.me-xl-3{margin-right:1rem!important}.me-xl-4{margin-right:1.5rem!important}.me-xl-5{margin-right:3rem!important}.me-xl-auto{margin-right:auto!important}.mb-xl-0{margin-bottom:0!important}.mb-xl-1{margin-bottom:.25rem!important}.mb-xl-2{margin-bottom:.5rem!important}.mb-xl-3{margin-bottom:1rem!important}.mb-xl-4{margin-bottom:1.5rem!important}.mb-xl-5{margin-bottom:3rem!important}.mb-xl-auto{margin-bottom:auto!important}.ms-xl-0{margin-left:0!important}.ms-xl-1{margin-left:.25rem!important}.ms-xl-2{margin-left:.5rem!important}.ms-xl-3{margin-left:1rem!important}.ms-xl-4{margin-left:1.5rem!important}.ms-xl-5{margin-left:3rem!important}.ms-xl-auto{margin-left:auto!important}.p-xl-0{padding:0!important}.p-xl-1{padding:.25rem!important}.p-xl-2{padding:.5rem!important}.p-xl-3{padding:1rem!important}.p-xl-4{padding:1.5rem!important}.p-xl-5{padding:3rem!important}.px-xl-0{padding-right:0!important;padding-left:0!important}.px-xl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xl-0{padding-top:0!important;padding-bottom:0!important}.py-xl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xl-0{padding-top:0!important}.pt-xl-1{padding-top:.25rem!important}.pt-xl-2{padding-top:.5rem!important}.pt-xl-3{padding-top:1rem!important}.pt-xl-4{padding-top:1.5rem!important}.pt-xl-5{padding-top:3rem!important}.pe-xl-0{padding-right:0!important}.pe-xl-1{padding-right:.25rem!important}.pe-xl-2{padding-right:.5rem!important}.pe-xl-3{padding-right:1rem!important}.pe-xl-4{padding-right:1.5rem!important}.pe-xl-5{padding-right:3rem!important}.pb-xl-0{padding-bottom:0!important}.pb-xl-1{padding-bottom:.25rem!important}.pb-xl-2{padding-bottom:.5rem!important}.pb-xl-3{padding-bottom:1rem!important}.pb-xl-4{padding-bottom:1.5rem!important}.pb-xl-5{padding-bottom:3rem!important}.ps-xl-0{padding-left:0!important}.ps-xl-1{padding-left:.25rem!important}.ps-xl-2{padding-left:.5rem!important}.ps-xl-3{padding-left:1rem!important}.ps-xl-4{padding-left:1.5rem!important}.ps-xl-5{padding-left:3rem!important}.gap-xl-0{gap:0!important}.gap-xl-1{gap:.25rem!important}.gap-xl-2{gap:.5rem!important}.gap-xl-3{gap:1rem!important}.gap-xl-4{gap:1.5rem!important}.gap-xl-5{gap:3rem!important}.row-gap-xl-0{row-gap:0!important}.row-gap-xl-1{row-gap:.25rem!important}.row-gap-xl-2{row-gap:.5rem!important}.row-gap-xl-3{row-gap:1rem!important}.row-gap-xl-4{row-gap:1.5rem!important}.row-gap-xl-5{row-gap:3rem!important}.column-gap-xl-0{column-gap:0!important}.column-gap-xl-1{column-gap:.25rem!important}.column-gap-xl-2{column-gap:.5rem!important}.column-gap-xl-3{column-gap:1rem!important}.column-gap-xl-4{column-gap:1.5rem!important}.column-gap-xl-5{column-gap:3rem!important}.text-xl-start{text-align:left!important}.text-xl-end{text-align:right!important}.text-xl-center{text-align:center!important}}@media (min-width: 1400px){.float-xxl-start{float:left!important}.float-xxl-end{float:right!important}.float-xxl-none{float:none!important}.object-fit-xxl-contain{object-fit:contain!important}.object-fit-xxl-cover{object-fit:cover!important}.object-fit-xxl-fill{object-fit:fill!important}.object-fit-xxl-scale{object-fit:scale-down!important}.object-fit-xxl-none{object-fit:none!important}.d-xxl-inline{display:inline!important}.d-xxl-inline-block{display:inline-block!important}.d-xxl-block{display:block!important}.d-xxl-grid{display:grid!important}.d-xxl-inline-grid{display:inline-grid!important}.d-xxl-table{display:table!important}.d-xxl-table-row{display:table-row!important}.d-xxl-table-cell{display:table-cell!important}.d-xxl-flex{display:flex!important}.d-xxl-inline-flex{display:inline-flex!important}.d-xxl-none{display:none!important}.flex-xxl-fill{flex:1 1 auto!important}.flex-xxl-row{flex-direction:row!important}.flex-xxl-column{flex-direction:column!important}.flex-xxl-row-reverse{flex-direction:row-reverse!important}.flex-xxl-column-reverse{flex-direction:column-reverse!important}.flex-xxl-grow-0{flex-grow:0!important}.flex-xxl-grow-1{flex-grow:1!important}.flex-xxl-shrink-0{flex-shrink:0!important}.flex-xxl-shrink-1{flex-shrink:1!important}.flex-xxl-wrap{flex-wrap:wrap!important}.flex-xxl-nowrap{flex-wrap:nowrap!important}.flex-xxl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xxl-start{justify-content:flex-start!important}.justify-content-xxl-end{justify-content:flex-end!important}.justify-content-xxl-center{justify-content:center!important}.justify-content-xxl-between{justify-content:space-between!important}.justify-content-xxl-around{justify-content:space-around!important}.justify-content-xxl-evenly{justify-content:space-evenly!important}.align-items-xxl-start{align-items:flex-start!important}.align-items-xxl-end{align-items:flex-end!important}.align-items-xxl-center{align-items:center!important}.align-items-xxl-baseline{align-items:baseline!important}.align-items-xxl-stretch{align-items:stretch!important}.align-content-xxl-start{align-content:flex-start!important}.align-content-xxl-end{align-content:flex-end!important}.align-content-xxl-center{align-content:center!important}.align-content-xxl-between{align-content:space-between!important}.align-content-xxl-around{align-content:space-around!important}.align-content-xxl-stretch{align-content:stretch!important}.align-self-xxl-auto{align-self:auto!important}.align-self-xxl-start{align-self:flex-start!important}.align-self-xxl-end{align-self:flex-end!important}.align-self-xxl-center{align-self:center!important}.align-self-xxl-baseline{align-self:baseline!important}.align-self-xxl-stretch{align-self:stretch!important}.order-xxl-first{order:-1!important}.order-xxl-0{order:0!important}.order-xxl-1{order:1!important}.order-xxl-2{order:2!important}.order-xxl-3{order:3!important}.order-xxl-4{order:4!important}.order-xxl-5{order:5!important}.order-xxl-last{order:6!important}.m-xxl-0{margin:0!important}.m-xxl-1{margin:.25rem!important}.m-xxl-2{margin:.5rem!important}.m-xxl-3{margin:1rem!important}.m-xxl-4{margin:1.5rem!important}.m-xxl-5{margin:3rem!important}.m-xxl-auto{margin:auto!important}.mx-xxl-0{margin-right:0!important;margin-left:0!important}.mx-xxl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xxl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xxl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xxl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xxl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xxl-auto{margin-right:auto!important;margin-left:auto!important}.my-xxl-0{margin-top:0!important;margin-bottom:0!important}.my-xxl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xxl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xxl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xxl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xxl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xxl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xxl-0{margin-top:0!important}.mt-xxl-1{margin-top:.25rem!important}.mt-xxl-2{margin-top:.5rem!important}.mt-xxl-3{margin-top:1rem!important}.mt-xxl-4{margin-top:1.5rem!important}.mt-xxl-5{margin-top:3rem!important}.mt-xxl-auto{margin-top:auto!important}.me-xxl-0{margin-right:0!important}.me-xxl-1{margin-right:.25rem!important}.me-xxl-2{margin-right:.5rem!important}.me-xxl-3{margin-right:1rem!important}.me-xxl-4{margin-right:1.5rem!important}.me-xxl-5{margin-right:3rem!important}.me-xxl-auto{margin-right:auto!important}.mb-xxl-0{margin-bottom:0!important}.mb-xxl-1{margin-bottom:.25rem!important}.mb-xxl-2{margin-bottom:.5rem!important}.mb-xxl-3{margin-bottom:1rem!important}.mb-xxl-4{margin-bottom:1.5rem!important}.mb-xxl-5{margin-bottom:3rem!important}.mb-xxl-auto{margin-bottom:auto!important}.ms-xxl-0{margin-left:0!important}.ms-xxl-1{margin-left:.25rem!important}.ms-xxl-2{margin-left:.5rem!important}.ms-xxl-3{margin-left:1rem!important}.ms-xxl-4{margin-left:1.5rem!important}.ms-xxl-5{margin-left:3rem!important}.ms-xxl-auto{margin-left:auto!important}.p-xxl-0{padding:0!important}.p-xxl-1{padding:.25rem!important}.p-xxl-2{padding:.5rem!important}.p-xxl-3{padding:1rem!important}.p-xxl-4{padding:1.5rem!important}.p-xxl-5{padding:3rem!important}.px-xxl-0{padding-right:0!important;padding-left:0!important}.px-xxl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xxl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xxl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xxl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xxl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xxl-0{padding-top:0!important;padding-bottom:0!important}.py-xxl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xxl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xxl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xxl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xxl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xxl-0{padding-top:0!important}.pt-xxl-1{padding-top:.25rem!important}.pt-xxl-2{padding-top:.5rem!important}.pt-xxl-3{padding-top:1rem!important}.pt-xxl-4{padding-top:1.5rem!important}.pt-xxl-5{padding-top:3rem!important}.pe-xxl-0{padding-right:0!important}.pe-xxl-1{padding-right:.25rem!important}.pe-xxl-2{padding-right:.5rem!important}.pe-xxl-3{padding-right:1rem!important}.pe-xxl-4{padding-right:1.5rem!important}.pe-xxl-5{padding-right:3rem!important}.pb-xxl-0{padding-bottom:0!important}.pb-xxl-1{padding-bottom:.25rem!important}.pb-xxl-2{padding-bottom:.5rem!important}.pb-xxl-3{padding-bottom:1rem!important}.pb-xxl-4{padding-bottom:1.5rem!important}.pb-xxl-5{padding-bottom:3rem!important}.ps-xxl-0{padding-left:0!important}.ps-xxl-1{padding-left:.25rem!important}.ps-xxl-2{padding-left:.5rem!important}.ps-xxl-3{padding-left:1rem!important}.ps-xxl-4{padding-left:1.5rem!important}.ps-xxl-5{padding-left:3rem!important}.gap-xxl-0{gap:0!important}.gap-xxl-1{gap:.25rem!important}.gap-xxl-2{gap:.5rem!important}.gap-xxl-3{gap:1rem!important}.gap-xxl-4{gap:1.5rem!important}.gap-xxl-5{gap:3rem!important}.row-gap-xxl-0{row-gap:0!important}.row-gap-xxl-1{row-gap:.25rem!important}.row-gap-xxl-2{row-gap:.5rem!important}.row-gap-xxl-3{row-gap:1rem!important}.row-gap-xxl-4{row-gap:1.5rem!important}.row-gap-xxl-5{row-gap:3rem!important}.column-gap-xxl-0{column-gap:0!important}.column-gap-xxl-1{column-gap:.25rem!important}.column-gap-xxl-2{column-gap:.5rem!important}.column-gap-xxl-3{column-gap:1rem!important}.column-gap-xxl-4{column-gap:1.5rem!important}.column-gap-xxl-5{column-gap:3rem!important}.text-xxl-start{text-align:left!important}.text-xxl-end{text-align:right!important}.text-xxl-center{text-align:center!important}}@media (min-width: 1200px){.fs-1{font-size:2.5rem!important}.fs-2{font-size:2rem!important}.fs-3{font-size:1.75rem!important}.fs-4{font-size:1.5rem!important}}@media print{.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-grid{display:grid!important}.d-print-inline-grid{display:inline-grid!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}.d-print-none{display:none!important}}/*! - * Bootstrap Icons v1.11.3 (https://icons.getbootstrap.com/) - * Copyright 2019-2024 The Bootstrap Authors - * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE) - */@font-face{font-display:block;font-family:bootstrap-icons;src:url(bootstrap-icons.bfa90bda92a84a6a.woff2?24e3eb84d0bcaf83d77f904c78ac1f47) format("woff2"),url(bootstrap-icons.70a9dee9e5ab72aa.woff?24e3eb84d0bcaf83d77f904c78ac1f47) format("woff")}.bi:before,[class^=bi-]:before,[class*=" bi-"]:before{display:inline-block;font-family:bootstrap-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;line-height:1;vertical-align:-.125em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bi-123:before{content:"\f67f"}.bi-alarm-fill:before{content:"\f101"}.bi-alarm:before{content:"\f102"}.bi-align-bottom:before{content:"\f103"}.bi-align-center:before{content:"\f104"}.bi-align-end:before{content:"\f105"}.bi-align-middle:before{content:"\f106"}.bi-align-start:before{content:"\f107"}.bi-align-top:before{content:"\f108"}.bi-alt:before{content:"\f109"}.bi-app-indicator:before{content:"\f10a"}.bi-app:before{content:"\f10b"}.bi-archive-fill:before{content:"\f10c"}.bi-archive:before{content:"\f10d"}.bi-arrow-90deg-down:before{content:"\f10e"}.bi-arrow-90deg-left:before{content:"\f10f"}.bi-arrow-90deg-right:before{content:"\f110"}.bi-arrow-90deg-up:before{content:"\f111"}.bi-arrow-bar-down:before{content:"\f112"}.bi-arrow-bar-left:before{content:"\f113"}.bi-arrow-bar-right:before{content:"\f114"}.bi-arrow-bar-up:before{content:"\f115"}.bi-arrow-clockwise:before{content:"\f116"}.bi-arrow-counterclockwise:before{content:"\f117"}.bi-arrow-down-circle-fill:before{content:"\f118"}.bi-arrow-down-circle:before{content:"\f119"}.bi-arrow-down-left-circle-fill:before{content:"\f11a"}.bi-arrow-down-left-circle:before{content:"\f11b"}.bi-arrow-down-left-square-fill:before{content:"\f11c"}.bi-arrow-down-left-square:before{content:"\f11d"}.bi-arrow-down-left:before{content:"\f11e"}.bi-arrow-down-right-circle-fill:before{content:"\f11f"}.bi-arrow-down-right-circle:before{content:"\f120"}.bi-arrow-down-right-square-fill:before{content:"\f121"}.bi-arrow-down-right-square:before{content:"\f122"}.bi-arrow-down-right:before{content:"\f123"}.bi-arrow-down-short:before{content:"\f124"}.bi-arrow-down-square-fill:before{content:"\f125"}.bi-arrow-down-square:before{content:"\f126"}.bi-arrow-down-up:before{content:"\f127"}.bi-arrow-down:before{content:"\f128"}.bi-arrow-left-circle-fill:before{content:"\f129"}.bi-arrow-left-circle:before{content:"\f12a"}.bi-arrow-left-right:before{content:"\f12b"}.bi-arrow-left-short:before{content:"\f12c"}.bi-arrow-left-square-fill:before{content:"\f12d"}.bi-arrow-left-square:before{content:"\f12e"}.bi-arrow-left:before{content:"\f12f"}.bi-arrow-repeat:before{content:"\f130"}.bi-arrow-return-left:before{content:"\f131"}.bi-arrow-return-right:before{content:"\f132"}.bi-arrow-right-circle-fill:before{content:"\f133"}.bi-arrow-right-circle:before{content:"\f134"}.bi-arrow-right-short:before{content:"\f135"}.bi-arrow-right-square-fill:before{content:"\f136"}.bi-arrow-right-square:before{content:"\f137"}.bi-arrow-right:before{content:"\f138"}.bi-arrow-up-circle-fill:before{content:"\f139"}.bi-arrow-up-circle:before{content:"\f13a"}.bi-arrow-up-left-circle-fill:before{content:"\f13b"}.bi-arrow-up-left-circle:before{content:"\f13c"}.bi-arrow-up-left-square-fill:before{content:"\f13d"}.bi-arrow-up-left-square:before{content:"\f13e"}.bi-arrow-up-left:before{content:"\f13f"}.bi-arrow-up-right-circle-fill:before{content:"\f140"}.bi-arrow-up-right-circle:before{content:"\f141"}.bi-arrow-up-right-square-fill:before{content:"\f142"}.bi-arrow-up-right-square:before{content:"\f143"}.bi-arrow-up-right:before{content:"\f144"}.bi-arrow-up-short:before{content:"\f145"}.bi-arrow-up-square-fill:before{content:"\f146"}.bi-arrow-up-square:before{content:"\f147"}.bi-arrow-up:before{content:"\f148"}.bi-arrows-angle-contract:before{content:"\f149"}.bi-arrows-angle-expand:before{content:"\f14a"}.bi-arrows-collapse:before{content:"\f14b"}.bi-arrows-expand:before{content:"\f14c"}.bi-arrows-fullscreen:before{content:"\f14d"}.bi-arrows-move:before{content:"\f14e"}.bi-aspect-ratio-fill:before{content:"\f14f"}.bi-aspect-ratio:before{content:"\f150"}.bi-asterisk:before{content:"\f151"}.bi-at:before{content:"\f152"}.bi-award-fill:before{content:"\f153"}.bi-award:before{content:"\f154"}.bi-back:before{content:"\f155"}.bi-backspace-fill:before{content:"\f156"}.bi-backspace-reverse-fill:before{content:"\f157"}.bi-backspace-reverse:before{content:"\f158"}.bi-backspace:before{content:"\f159"}.bi-badge-3d-fill:before{content:"\f15a"}.bi-badge-3d:before{content:"\f15b"}.bi-badge-4k-fill:before{content:"\f15c"}.bi-badge-4k:before{content:"\f15d"}.bi-badge-8k-fill:before{content:"\f15e"}.bi-badge-8k:before{content:"\f15f"}.bi-badge-ad-fill:before{content:"\f160"}.bi-badge-ad:before{content:"\f161"}.bi-badge-ar-fill:before{content:"\f162"}.bi-badge-ar:before{content:"\f163"}.bi-badge-cc-fill:before{content:"\f164"}.bi-badge-cc:before{content:"\f165"}.bi-badge-hd-fill:before{content:"\f166"}.bi-badge-hd:before{content:"\f167"}.bi-badge-tm-fill:before{content:"\f168"}.bi-badge-tm:before{content:"\f169"}.bi-badge-vo-fill:before{content:"\f16a"}.bi-badge-vo:before{content:"\f16b"}.bi-badge-vr-fill:before{content:"\f16c"}.bi-badge-vr:before{content:"\f16d"}.bi-badge-wc-fill:before{content:"\f16e"}.bi-badge-wc:before{content:"\f16f"}.bi-bag-check-fill:before{content:"\f170"}.bi-bag-check:before{content:"\f171"}.bi-bag-dash-fill:before{content:"\f172"}.bi-bag-dash:before{content:"\f173"}.bi-bag-fill:before{content:"\f174"}.bi-bag-plus-fill:before{content:"\f175"}.bi-bag-plus:before{content:"\f176"}.bi-bag-x-fill:before{content:"\f177"}.bi-bag-x:before{content:"\f178"}.bi-bag:before{content:"\f179"}.bi-bar-chart-fill:before{content:"\f17a"}.bi-bar-chart-line-fill:before{content:"\f17b"}.bi-bar-chart-line:before{content:"\f17c"}.bi-bar-chart-steps:before{content:"\f17d"}.bi-bar-chart:before{content:"\f17e"}.bi-basket-fill:before{content:"\f17f"}.bi-basket:before{content:"\f180"}.bi-basket2-fill:before{content:"\f181"}.bi-basket2:before{content:"\f182"}.bi-basket3-fill:before{content:"\f183"}.bi-basket3:before{content:"\f184"}.bi-battery-charging:before{content:"\f185"}.bi-battery-full:before{content:"\f186"}.bi-battery-half:before{content:"\f187"}.bi-battery:before{content:"\f188"}.bi-bell-fill:before{content:"\f189"}.bi-bell:before{content:"\f18a"}.bi-bezier:before{content:"\f18b"}.bi-bezier2:before{content:"\f18c"}.bi-bicycle:before{content:"\f18d"}.bi-binoculars-fill:before{content:"\f18e"}.bi-binoculars:before{content:"\f18f"}.bi-blockquote-left:before{content:"\f190"}.bi-blockquote-right:before{content:"\f191"}.bi-book-fill:before{content:"\f192"}.bi-book-half:before{content:"\f193"}.bi-book:before{content:"\f194"}.bi-bookmark-check-fill:before{content:"\f195"}.bi-bookmark-check:before{content:"\f196"}.bi-bookmark-dash-fill:before{content:"\f197"}.bi-bookmark-dash:before{content:"\f198"}.bi-bookmark-fill:before{content:"\f199"}.bi-bookmark-heart-fill:before{content:"\f19a"}.bi-bookmark-heart:before{content:"\f19b"}.bi-bookmark-plus-fill:before{content:"\f19c"}.bi-bookmark-plus:before{content:"\f19d"}.bi-bookmark-star-fill:before{content:"\f19e"}.bi-bookmark-star:before{content:"\f19f"}.bi-bookmark-x-fill:before{content:"\f1a0"}.bi-bookmark-x:before{content:"\f1a1"}.bi-bookmark:before{content:"\f1a2"}.bi-bookmarks-fill:before{content:"\f1a3"}.bi-bookmarks:before{content:"\f1a4"}.bi-bookshelf:before{content:"\f1a5"}.bi-bootstrap-fill:before{content:"\f1a6"}.bi-bootstrap-reboot:before{content:"\f1a7"}.bi-bootstrap:before{content:"\f1a8"}.bi-border-all:before{content:"\f1a9"}.bi-border-bottom:before{content:"\f1aa"}.bi-border-center:before{content:"\f1ab"}.bi-border-inner:before{content:"\f1ac"}.bi-border-left:before{content:"\f1ad"}.bi-border-middle:before{content:"\f1ae"}.bi-border-outer:before{content:"\f1af"}.bi-border-right:before{content:"\f1b0"}.bi-border-style:before{content:"\f1b1"}.bi-border-top:before{content:"\f1b2"}.bi-border-width:before{content:"\f1b3"}.bi-border:before{content:"\f1b4"}.bi-bounding-box-circles:before{content:"\f1b5"}.bi-bounding-box:before{content:"\f1b6"}.bi-box-arrow-down-left:before{content:"\f1b7"}.bi-box-arrow-down-right:before{content:"\f1b8"}.bi-box-arrow-down:before{content:"\f1b9"}.bi-box-arrow-in-down-left:before{content:"\f1ba"}.bi-box-arrow-in-down-right:before{content:"\f1bb"}.bi-box-arrow-in-down:before{content:"\f1bc"}.bi-box-arrow-in-left:before{content:"\f1bd"}.bi-box-arrow-in-right:before{content:"\f1be"}.bi-box-arrow-in-up-left:before{content:"\f1bf"}.bi-box-arrow-in-up-right:before{content:"\f1c0"}.bi-box-arrow-in-up:before{content:"\f1c1"}.bi-box-arrow-left:before{content:"\f1c2"}.bi-box-arrow-right:before{content:"\f1c3"}.bi-box-arrow-up-left:before{content:"\f1c4"}.bi-box-arrow-up-right:before{content:"\f1c5"}.bi-box-arrow-up:before{content:"\f1c6"}.bi-box-seam:before{content:"\f1c7"}.bi-box:before{content:"\f1c8"}.bi-braces:before{content:"\f1c9"}.bi-bricks:before{content:"\f1ca"}.bi-briefcase-fill:before{content:"\f1cb"}.bi-briefcase:before{content:"\f1cc"}.bi-brightness-alt-high-fill:before{content:"\f1cd"}.bi-brightness-alt-high:before{content:"\f1ce"}.bi-brightness-alt-low-fill:before{content:"\f1cf"}.bi-brightness-alt-low:before{content:"\f1d0"}.bi-brightness-high-fill:before{content:"\f1d1"}.bi-brightness-high:before{content:"\f1d2"}.bi-brightness-low-fill:before{content:"\f1d3"}.bi-brightness-low:before{content:"\f1d4"}.bi-broadcast-pin:before{content:"\f1d5"}.bi-broadcast:before{content:"\f1d6"}.bi-brush-fill:before{content:"\f1d7"}.bi-brush:before{content:"\f1d8"}.bi-bucket-fill:before{content:"\f1d9"}.bi-bucket:before{content:"\f1da"}.bi-bug-fill:before{content:"\f1db"}.bi-bug:before{content:"\f1dc"}.bi-building:before{content:"\f1dd"}.bi-bullseye:before{content:"\f1de"}.bi-calculator-fill:before{content:"\f1df"}.bi-calculator:before{content:"\f1e0"}.bi-calendar-check-fill:before{content:"\f1e1"}.bi-calendar-check:before{content:"\f1e2"}.bi-calendar-date-fill:before{content:"\f1e3"}.bi-calendar-date:before{content:"\f1e4"}.bi-calendar-day-fill:before{content:"\f1e5"}.bi-calendar-day:before{content:"\f1e6"}.bi-calendar-event-fill:before{content:"\f1e7"}.bi-calendar-event:before{content:"\f1e8"}.bi-calendar-fill:before{content:"\f1e9"}.bi-calendar-minus-fill:before{content:"\f1ea"}.bi-calendar-minus:before{content:"\f1eb"}.bi-calendar-month-fill:before{content:"\f1ec"}.bi-calendar-month:before{content:"\f1ed"}.bi-calendar-plus-fill:before{content:"\f1ee"}.bi-calendar-plus:before{content:"\f1ef"}.bi-calendar-range-fill:before{content:"\f1f0"}.bi-calendar-range:before{content:"\f1f1"}.bi-calendar-week-fill:before{content:"\f1f2"}.bi-calendar-week:before{content:"\f1f3"}.bi-calendar-x-fill:before{content:"\f1f4"}.bi-calendar-x:before{content:"\f1f5"}.bi-calendar:before{content:"\f1f6"}.bi-calendar2-check-fill:before{content:"\f1f7"}.bi-calendar2-check:before{content:"\f1f8"}.bi-calendar2-date-fill:before{content:"\f1f9"}.bi-calendar2-date:before{content:"\f1fa"}.bi-calendar2-day-fill:before{content:"\f1fb"}.bi-calendar2-day:before{content:"\f1fc"}.bi-calendar2-event-fill:before{content:"\f1fd"}.bi-calendar2-event:before{content:"\f1fe"}.bi-calendar2-fill:before{content:"\f1ff"}.bi-calendar2-minus-fill:before{content:"\f200"}.bi-calendar2-minus:before{content:"\f201"}.bi-calendar2-month-fill:before{content:"\f202"}.bi-calendar2-month:before{content:"\f203"}.bi-calendar2-plus-fill:before{content:"\f204"}.bi-calendar2-plus:before{content:"\f205"}.bi-calendar2-range-fill:before{content:"\f206"}.bi-calendar2-range:before{content:"\f207"}.bi-calendar2-week-fill:before{content:"\f208"}.bi-calendar2-week:before{content:"\f209"}.bi-calendar2-x-fill:before{content:"\f20a"}.bi-calendar2-x:before{content:"\f20b"}.bi-calendar2:before{content:"\f20c"}.bi-calendar3-event-fill:before{content:"\f20d"}.bi-calendar3-event:before{content:"\f20e"}.bi-calendar3-fill:before{content:"\f20f"}.bi-calendar3-range-fill:before{content:"\f210"}.bi-calendar3-range:before{content:"\f211"}.bi-calendar3-week-fill:before{content:"\f212"}.bi-calendar3-week:before{content:"\f213"}.bi-calendar3:before{content:"\f214"}.bi-calendar4-event:before{content:"\f215"}.bi-calendar4-range:before{content:"\f216"}.bi-calendar4-week:before{content:"\f217"}.bi-calendar4:before{content:"\f218"}.bi-camera-fill:before{content:"\f219"}.bi-camera-reels-fill:before{content:"\f21a"}.bi-camera-reels:before{content:"\f21b"}.bi-camera-video-fill:before{content:"\f21c"}.bi-camera-video-off-fill:before{content:"\f21d"}.bi-camera-video-off:before{content:"\f21e"}.bi-camera-video:before{content:"\f21f"}.bi-camera:before{content:"\f220"}.bi-camera2:before{content:"\f221"}.bi-capslock-fill:before{content:"\f222"}.bi-capslock:before{content:"\f223"}.bi-card-checklist:before{content:"\f224"}.bi-card-heading:before{content:"\f225"}.bi-card-image:before{content:"\f226"}.bi-card-list:before{content:"\f227"}.bi-card-text:before{content:"\f228"}.bi-caret-down-fill:before{content:"\f229"}.bi-caret-down-square-fill:before{content:"\f22a"}.bi-caret-down-square:before{content:"\f22b"}.bi-caret-down:before{content:"\f22c"}.bi-caret-left-fill:before{content:"\f22d"}.bi-caret-left-square-fill:before{content:"\f22e"}.bi-caret-left-square:before{content:"\f22f"}.bi-caret-left:before{content:"\f230"}.bi-caret-right-fill:before{content:"\f231"}.bi-caret-right-square-fill:before{content:"\f232"}.bi-caret-right-square:before{content:"\f233"}.bi-caret-right:before{content:"\f234"}.bi-caret-up-fill:before{content:"\f235"}.bi-caret-up-square-fill:before{content:"\f236"}.bi-caret-up-square:before{content:"\f237"}.bi-caret-up:before{content:"\f238"}.bi-cart-check-fill:before{content:"\f239"}.bi-cart-check:before{content:"\f23a"}.bi-cart-dash-fill:before{content:"\f23b"}.bi-cart-dash:before{content:"\f23c"}.bi-cart-fill:before{content:"\f23d"}.bi-cart-plus-fill:before{content:"\f23e"}.bi-cart-plus:before{content:"\f23f"}.bi-cart-x-fill:before{content:"\f240"}.bi-cart-x:before{content:"\f241"}.bi-cart:before{content:"\f242"}.bi-cart2:before{content:"\f243"}.bi-cart3:before{content:"\f244"}.bi-cart4:before{content:"\f245"}.bi-cash-stack:before{content:"\f246"}.bi-cash:before{content:"\f247"}.bi-cast:before{content:"\f248"}.bi-chat-dots-fill:before{content:"\f249"}.bi-chat-dots:before{content:"\f24a"}.bi-chat-fill:before{content:"\f24b"}.bi-chat-left-dots-fill:before{content:"\f24c"}.bi-chat-left-dots:before{content:"\f24d"}.bi-chat-left-fill:before{content:"\f24e"}.bi-chat-left-quote-fill:before{content:"\f24f"}.bi-chat-left-quote:before{content:"\f250"}.bi-chat-left-text-fill:before{content:"\f251"}.bi-chat-left-text:before{content:"\f252"}.bi-chat-left:before{content:"\f253"}.bi-chat-quote-fill:before{content:"\f254"}.bi-chat-quote:before{content:"\f255"}.bi-chat-right-dots-fill:before{content:"\f256"}.bi-chat-right-dots:before{content:"\f257"}.bi-chat-right-fill:before{content:"\f258"}.bi-chat-right-quote-fill:before{content:"\f259"}.bi-chat-right-quote:before{content:"\f25a"}.bi-chat-right-text-fill:before{content:"\f25b"}.bi-chat-right-text:before{content:"\f25c"}.bi-chat-right:before{content:"\f25d"}.bi-chat-square-dots-fill:before{content:"\f25e"}.bi-chat-square-dots:before{content:"\f25f"}.bi-chat-square-fill:before{content:"\f260"}.bi-chat-square-quote-fill:before{content:"\f261"}.bi-chat-square-quote:before{content:"\f262"}.bi-chat-square-text-fill:before{content:"\f263"}.bi-chat-square-text:before{content:"\f264"}.bi-chat-square:before{content:"\f265"}.bi-chat-text-fill:before{content:"\f266"}.bi-chat-text:before{content:"\f267"}.bi-chat:before{content:"\f268"}.bi-check-all:before{content:"\f269"}.bi-check-circle-fill:before{content:"\f26a"}.bi-check-circle:before{content:"\f26b"}.bi-check-square-fill:before{content:"\f26c"}.bi-check-square:before{content:"\f26d"}.bi-check:before{content:"\f26e"}.bi-check2-all:before{content:"\f26f"}.bi-check2-circle:before{content:"\f270"}.bi-check2-square:before{content:"\f271"}.bi-check2:before{content:"\f272"}.bi-chevron-bar-contract:before{content:"\f273"}.bi-chevron-bar-down:before{content:"\f274"}.bi-chevron-bar-expand:before{content:"\f275"}.bi-chevron-bar-left:before{content:"\f276"}.bi-chevron-bar-right:before{content:"\f277"}.bi-chevron-bar-up:before{content:"\f278"}.bi-chevron-compact-down:before{content:"\f279"}.bi-chevron-compact-left:before{content:"\f27a"}.bi-chevron-compact-right:before{content:"\f27b"}.bi-chevron-compact-up:before{content:"\f27c"}.bi-chevron-contract:before{content:"\f27d"}.bi-chevron-double-down:before{content:"\f27e"}.bi-chevron-double-left:before{content:"\f27f"}.bi-chevron-double-right:before{content:"\f280"}.bi-chevron-double-up:before{content:"\f281"}.bi-chevron-down:before{content:"\f282"}.bi-chevron-expand:before{content:"\f283"}.bi-chevron-left:before{content:"\f284"}.bi-chevron-right:before{content:"\f285"}.bi-chevron-up:before{content:"\f286"}.bi-circle-fill:before{content:"\f287"}.bi-circle-half:before{content:"\f288"}.bi-circle-square:before{content:"\f289"}.bi-circle:before{content:"\f28a"}.bi-clipboard-check:before{content:"\f28b"}.bi-clipboard-data:before{content:"\f28c"}.bi-clipboard-minus:before{content:"\f28d"}.bi-clipboard-plus:before{content:"\f28e"}.bi-clipboard-x:before{content:"\f28f"}.bi-clipboard:before{content:"\f290"}.bi-clock-fill:before{content:"\f291"}.bi-clock-history:before{content:"\f292"}.bi-clock:before{content:"\f293"}.bi-cloud-arrow-down-fill:before{content:"\f294"}.bi-cloud-arrow-down:before{content:"\f295"}.bi-cloud-arrow-up-fill:before{content:"\f296"}.bi-cloud-arrow-up:before{content:"\f297"}.bi-cloud-check-fill:before{content:"\f298"}.bi-cloud-check:before{content:"\f299"}.bi-cloud-download-fill:before{content:"\f29a"}.bi-cloud-download:before{content:"\f29b"}.bi-cloud-drizzle-fill:before{content:"\f29c"}.bi-cloud-drizzle:before{content:"\f29d"}.bi-cloud-fill:before{content:"\f29e"}.bi-cloud-fog-fill:before{content:"\f29f"}.bi-cloud-fog:before{content:"\f2a0"}.bi-cloud-fog2-fill:before{content:"\f2a1"}.bi-cloud-fog2:before{content:"\f2a2"}.bi-cloud-hail-fill:before{content:"\f2a3"}.bi-cloud-hail:before{content:"\f2a4"}.bi-cloud-haze-fill:before{content:"\f2a6"}.bi-cloud-haze:before{content:"\f2a7"}.bi-cloud-haze2-fill:before{content:"\f2a8"}.bi-cloud-lightning-fill:before{content:"\f2a9"}.bi-cloud-lightning-rain-fill:before{content:"\f2aa"}.bi-cloud-lightning-rain:before{content:"\f2ab"}.bi-cloud-lightning:before{content:"\f2ac"}.bi-cloud-minus-fill:before{content:"\f2ad"}.bi-cloud-minus:before{content:"\f2ae"}.bi-cloud-moon-fill:before{content:"\f2af"}.bi-cloud-moon:before{content:"\f2b0"}.bi-cloud-plus-fill:before{content:"\f2b1"}.bi-cloud-plus:before{content:"\f2b2"}.bi-cloud-rain-fill:before{content:"\f2b3"}.bi-cloud-rain-heavy-fill:before{content:"\f2b4"}.bi-cloud-rain-heavy:before{content:"\f2b5"}.bi-cloud-rain:before{content:"\f2b6"}.bi-cloud-slash-fill:before{content:"\f2b7"}.bi-cloud-slash:before{content:"\f2b8"}.bi-cloud-sleet-fill:before{content:"\f2b9"}.bi-cloud-sleet:before{content:"\f2ba"}.bi-cloud-snow-fill:before{content:"\f2bb"}.bi-cloud-snow:before{content:"\f2bc"}.bi-cloud-sun-fill:before{content:"\f2bd"}.bi-cloud-sun:before{content:"\f2be"}.bi-cloud-upload-fill:before{content:"\f2bf"}.bi-cloud-upload:before{content:"\f2c0"}.bi-cloud:before{content:"\f2c1"}.bi-clouds-fill:before{content:"\f2c2"}.bi-clouds:before{content:"\f2c3"}.bi-cloudy-fill:before{content:"\f2c4"}.bi-cloudy:before{content:"\f2c5"}.bi-code-slash:before{content:"\f2c6"}.bi-code-square:before{content:"\f2c7"}.bi-code:before{content:"\f2c8"}.bi-collection-fill:before{content:"\f2c9"}.bi-collection-play-fill:before{content:"\f2ca"}.bi-collection-play:before{content:"\f2cb"}.bi-collection:before{content:"\f2cc"}.bi-columns-gap:before{content:"\f2cd"}.bi-columns:before{content:"\f2ce"}.bi-command:before{content:"\f2cf"}.bi-compass-fill:before{content:"\f2d0"}.bi-compass:before{content:"\f2d1"}.bi-cone-striped:before{content:"\f2d2"}.bi-cone:before{content:"\f2d3"}.bi-controller:before{content:"\f2d4"}.bi-cpu-fill:before{content:"\f2d5"}.bi-cpu:before{content:"\f2d6"}.bi-credit-card-2-back-fill:before{content:"\f2d7"}.bi-credit-card-2-back:before{content:"\f2d8"}.bi-credit-card-2-front-fill:before{content:"\f2d9"}.bi-credit-card-2-front:before{content:"\f2da"}.bi-credit-card-fill:before{content:"\f2db"}.bi-credit-card:before{content:"\f2dc"}.bi-crop:before{content:"\f2dd"}.bi-cup-fill:before{content:"\f2de"}.bi-cup-straw:before{content:"\f2df"}.bi-cup:before{content:"\f2e0"}.bi-cursor-fill:before{content:"\f2e1"}.bi-cursor-text:before{content:"\f2e2"}.bi-cursor:before{content:"\f2e3"}.bi-dash-circle-dotted:before{content:"\f2e4"}.bi-dash-circle-fill:before{content:"\f2e5"}.bi-dash-circle:before{content:"\f2e6"}.bi-dash-square-dotted:before{content:"\f2e7"}.bi-dash-square-fill:before{content:"\f2e8"}.bi-dash-square:before{content:"\f2e9"}.bi-dash:before{content:"\f2ea"}.bi-diagram-2-fill:before{content:"\f2eb"}.bi-diagram-2:before{content:"\f2ec"}.bi-diagram-3-fill:before{content:"\f2ed"}.bi-diagram-3:before{content:"\f2ee"}.bi-diamond-fill:before{content:"\f2ef"}.bi-diamond-half:before{content:"\f2f0"}.bi-diamond:before{content:"\f2f1"}.bi-dice-1-fill:before{content:"\f2f2"}.bi-dice-1:before{content:"\f2f3"}.bi-dice-2-fill:before{content:"\f2f4"}.bi-dice-2:before{content:"\f2f5"}.bi-dice-3-fill:before{content:"\f2f6"}.bi-dice-3:before{content:"\f2f7"}.bi-dice-4-fill:before{content:"\f2f8"}.bi-dice-4:before{content:"\f2f9"}.bi-dice-5-fill:before{content:"\f2fa"}.bi-dice-5:before{content:"\f2fb"}.bi-dice-6-fill:before{content:"\f2fc"}.bi-dice-6:before{content:"\f2fd"}.bi-disc-fill:before{content:"\f2fe"}.bi-disc:before{content:"\f2ff"}.bi-discord:before{content:"\f300"}.bi-display-fill:before{content:"\f301"}.bi-display:before{content:"\f302"}.bi-distribute-horizontal:before{content:"\f303"}.bi-distribute-vertical:before{content:"\f304"}.bi-door-closed-fill:before{content:"\f305"}.bi-door-closed:before{content:"\f306"}.bi-door-open-fill:before{content:"\f307"}.bi-door-open:before{content:"\f308"}.bi-dot:before{content:"\f309"}.bi-download:before{content:"\f30a"}.bi-droplet-fill:before{content:"\f30b"}.bi-droplet-half:before{content:"\f30c"}.bi-droplet:before{content:"\f30d"}.bi-earbuds:before{content:"\f30e"}.bi-easel-fill:before{content:"\f30f"}.bi-easel:before{content:"\f310"}.bi-egg-fill:before{content:"\f311"}.bi-egg-fried:before{content:"\f312"}.bi-egg:before{content:"\f313"}.bi-eject-fill:before{content:"\f314"}.bi-eject:before{content:"\f315"}.bi-emoji-angry-fill:before{content:"\f316"}.bi-emoji-angry:before{content:"\f317"}.bi-emoji-dizzy-fill:before{content:"\f318"}.bi-emoji-dizzy:before{content:"\f319"}.bi-emoji-expressionless-fill:before{content:"\f31a"}.bi-emoji-expressionless:before{content:"\f31b"}.bi-emoji-frown-fill:before{content:"\f31c"}.bi-emoji-frown:before{content:"\f31d"}.bi-emoji-heart-eyes-fill:before{content:"\f31e"}.bi-emoji-heart-eyes:before{content:"\f31f"}.bi-emoji-laughing-fill:before{content:"\f320"}.bi-emoji-laughing:before{content:"\f321"}.bi-emoji-neutral-fill:before{content:"\f322"}.bi-emoji-neutral:before{content:"\f323"}.bi-emoji-smile-fill:before{content:"\f324"}.bi-emoji-smile-upside-down-fill:before{content:"\f325"}.bi-emoji-smile-upside-down:before{content:"\f326"}.bi-emoji-smile:before{content:"\f327"}.bi-emoji-sunglasses-fill:before{content:"\f328"}.bi-emoji-sunglasses:before{content:"\f329"}.bi-emoji-wink-fill:before{content:"\f32a"}.bi-emoji-wink:before{content:"\f32b"}.bi-envelope-fill:before{content:"\f32c"}.bi-envelope-open-fill:before{content:"\f32d"}.bi-envelope-open:before{content:"\f32e"}.bi-envelope:before{content:"\f32f"}.bi-eraser-fill:before{content:"\f330"}.bi-eraser:before{content:"\f331"}.bi-exclamation-circle-fill:before{content:"\f332"}.bi-exclamation-circle:before{content:"\f333"}.bi-exclamation-diamond-fill:before{content:"\f334"}.bi-exclamation-diamond:before{content:"\f335"}.bi-exclamation-octagon-fill:before{content:"\f336"}.bi-exclamation-octagon:before{content:"\f337"}.bi-exclamation-square-fill:before{content:"\f338"}.bi-exclamation-square:before{content:"\f339"}.bi-exclamation-triangle-fill:before{content:"\f33a"}.bi-exclamation-triangle:before{content:"\f33b"}.bi-exclamation:before{content:"\f33c"}.bi-exclude:before{content:"\f33d"}.bi-eye-fill:before{content:"\f33e"}.bi-eye-slash-fill:before{content:"\f33f"}.bi-eye-slash:before{content:"\f340"}.bi-eye:before{content:"\f341"}.bi-eyedropper:before{content:"\f342"}.bi-eyeglasses:before{content:"\f343"}.bi-facebook:before{content:"\f344"}.bi-file-arrow-down-fill:before{content:"\f345"}.bi-file-arrow-down:before{content:"\f346"}.bi-file-arrow-up-fill:before{content:"\f347"}.bi-file-arrow-up:before{content:"\f348"}.bi-file-bar-graph-fill:before{content:"\f349"}.bi-file-bar-graph:before{content:"\f34a"}.bi-file-binary-fill:before{content:"\f34b"}.bi-file-binary:before{content:"\f34c"}.bi-file-break-fill:before{content:"\f34d"}.bi-file-break:before{content:"\f34e"}.bi-file-check-fill:before{content:"\f34f"}.bi-file-check:before{content:"\f350"}.bi-file-code-fill:before{content:"\f351"}.bi-file-code:before{content:"\f352"}.bi-file-diff-fill:before{content:"\f353"}.bi-file-diff:before{content:"\f354"}.bi-file-earmark-arrow-down-fill:before{content:"\f355"}.bi-file-earmark-arrow-down:before{content:"\f356"}.bi-file-earmark-arrow-up-fill:before{content:"\f357"}.bi-file-earmark-arrow-up:before{content:"\f358"}.bi-file-earmark-bar-graph-fill:before{content:"\f359"}.bi-file-earmark-bar-graph:before{content:"\f35a"}.bi-file-earmark-binary-fill:before{content:"\f35b"}.bi-file-earmark-binary:before{content:"\f35c"}.bi-file-earmark-break-fill:before{content:"\f35d"}.bi-file-earmark-break:before{content:"\f35e"}.bi-file-earmark-check-fill:before{content:"\f35f"}.bi-file-earmark-check:before{content:"\f360"}.bi-file-earmark-code-fill:before{content:"\f361"}.bi-file-earmark-code:before{content:"\f362"}.bi-file-earmark-diff-fill:before{content:"\f363"}.bi-file-earmark-diff:before{content:"\f364"}.bi-file-earmark-easel-fill:before{content:"\f365"}.bi-file-earmark-easel:before{content:"\f366"}.bi-file-earmark-excel-fill:before{content:"\f367"}.bi-file-earmark-excel:before{content:"\f368"}.bi-file-earmark-fill:before{content:"\f369"}.bi-file-earmark-font-fill:before{content:"\f36a"}.bi-file-earmark-font:before{content:"\f36b"}.bi-file-earmark-image-fill:before{content:"\f36c"}.bi-file-earmark-image:before{content:"\f36d"}.bi-file-earmark-lock-fill:before{content:"\f36e"}.bi-file-earmark-lock:before{content:"\f36f"}.bi-file-earmark-lock2-fill:before{content:"\f370"}.bi-file-earmark-lock2:before{content:"\f371"}.bi-file-earmark-medical-fill:before{content:"\f372"}.bi-file-earmark-medical:before{content:"\f373"}.bi-file-earmark-minus-fill:before{content:"\f374"}.bi-file-earmark-minus:before{content:"\f375"}.bi-file-earmark-music-fill:before{content:"\f376"}.bi-file-earmark-music:before{content:"\f377"}.bi-file-earmark-person-fill:before{content:"\f378"}.bi-file-earmark-person:before{content:"\f379"}.bi-file-earmark-play-fill:before{content:"\f37a"}.bi-file-earmark-play:before{content:"\f37b"}.bi-file-earmark-plus-fill:before{content:"\f37c"}.bi-file-earmark-plus:before{content:"\f37d"}.bi-file-earmark-post-fill:before{content:"\f37e"}.bi-file-earmark-post:before{content:"\f37f"}.bi-file-earmark-ppt-fill:before{content:"\f380"}.bi-file-earmark-ppt:before{content:"\f381"}.bi-file-earmark-richtext-fill:before{content:"\f382"}.bi-file-earmark-richtext:before{content:"\f383"}.bi-file-earmark-ruled-fill:before{content:"\f384"}.bi-file-earmark-ruled:before{content:"\f385"}.bi-file-earmark-slides-fill:before{content:"\f386"}.bi-file-earmark-slides:before{content:"\f387"}.bi-file-earmark-spreadsheet-fill:before{content:"\f388"}.bi-file-earmark-spreadsheet:before{content:"\f389"}.bi-file-earmark-text-fill:before{content:"\f38a"}.bi-file-earmark-text:before{content:"\f38b"}.bi-file-earmark-word-fill:before{content:"\f38c"}.bi-file-earmark-word:before{content:"\f38d"}.bi-file-earmark-x-fill:before{content:"\f38e"}.bi-file-earmark-x:before{content:"\f38f"}.bi-file-earmark-zip-fill:before{content:"\f390"}.bi-file-earmark-zip:before{content:"\f391"}.bi-file-earmark:before{content:"\f392"}.bi-file-easel-fill:before{content:"\f393"}.bi-file-easel:before{content:"\f394"}.bi-file-excel-fill:before{content:"\f395"}.bi-file-excel:before{content:"\f396"}.bi-file-fill:before{content:"\f397"}.bi-file-font-fill:before{content:"\f398"}.bi-file-font:before{content:"\f399"}.bi-file-image-fill:before{content:"\f39a"}.bi-file-image:before{content:"\f39b"}.bi-file-lock-fill:before{content:"\f39c"}.bi-file-lock:before{content:"\f39d"}.bi-file-lock2-fill:before{content:"\f39e"}.bi-file-lock2:before{content:"\f39f"}.bi-file-medical-fill:before{content:"\f3a0"}.bi-file-medical:before{content:"\f3a1"}.bi-file-minus-fill:before{content:"\f3a2"}.bi-file-minus:before{content:"\f3a3"}.bi-file-music-fill:before{content:"\f3a4"}.bi-file-music:before{content:"\f3a5"}.bi-file-person-fill:before{content:"\f3a6"}.bi-file-person:before{content:"\f3a7"}.bi-file-play-fill:before{content:"\f3a8"}.bi-file-play:before{content:"\f3a9"}.bi-file-plus-fill:before{content:"\f3aa"}.bi-file-plus:before{content:"\f3ab"}.bi-file-post-fill:before{content:"\f3ac"}.bi-file-post:before{content:"\f3ad"}.bi-file-ppt-fill:before{content:"\f3ae"}.bi-file-ppt:before{content:"\f3af"}.bi-file-richtext-fill:before{content:"\f3b0"}.bi-file-richtext:before{content:"\f3b1"}.bi-file-ruled-fill:before{content:"\f3b2"}.bi-file-ruled:before{content:"\f3b3"}.bi-file-slides-fill:before{content:"\f3b4"}.bi-file-slides:before{content:"\f3b5"}.bi-file-spreadsheet-fill:before{content:"\f3b6"}.bi-file-spreadsheet:before{content:"\f3b7"}.bi-file-text-fill:before{content:"\f3b8"}.bi-file-text:before{content:"\f3b9"}.bi-file-word-fill:before{content:"\f3ba"}.bi-file-word:before{content:"\f3bb"}.bi-file-x-fill:before{content:"\f3bc"}.bi-file-x:before{content:"\f3bd"}.bi-file-zip-fill:before{content:"\f3be"}.bi-file-zip:before{content:"\f3bf"}.bi-file:before{content:"\f3c0"}.bi-files-alt:before{content:"\f3c1"}.bi-files:before{content:"\f3c2"}.bi-film:before{content:"\f3c3"}.bi-filter-circle-fill:before{content:"\f3c4"}.bi-filter-circle:before{content:"\f3c5"}.bi-filter-left:before{content:"\f3c6"}.bi-filter-right:before{content:"\f3c7"}.bi-filter-square-fill:before{content:"\f3c8"}.bi-filter-square:before{content:"\f3c9"}.bi-filter:before{content:"\f3ca"}.bi-flag-fill:before{content:"\f3cb"}.bi-flag:before{content:"\f3cc"}.bi-flower1:before{content:"\f3cd"}.bi-flower2:before{content:"\f3ce"}.bi-flower3:before{content:"\f3cf"}.bi-folder-check:before{content:"\f3d0"}.bi-folder-fill:before{content:"\f3d1"}.bi-folder-minus:before{content:"\f3d2"}.bi-folder-plus:before{content:"\f3d3"}.bi-folder-symlink-fill:before{content:"\f3d4"}.bi-folder-symlink:before{content:"\f3d5"}.bi-folder-x:before{content:"\f3d6"}.bi-folder:before{content:"\f3d7"}.bi-folder2-open:before{content:"\f3d8"}.bi-folder2:before{content:"\f3d9"}.bi-fonts:before{content:"\f3da"}.bi-forward-fill:before{content:"\f3db"}.bi-forward:before{content:"\f3dc"}.bi-front:before{content:"\f3dd"}.bi-fullscreen-exit:before{content:"\f3de"}.bi-fullscreen:before{content:"\f3df"}.bi-funnel-fill:before{content:"\f3e0"}.bi-funnel:before{content:"\f3e1"}.bi-gear-fill:before{content:"\f3e2"}.bi-gear-wide-connected:before{content:"\f3e3"}.bi-gear-wide:before{content:"\f3e4"}.bi-gear:before{content:"\f3e5"}.bi-gem:before{content:"\f3e6"}.bi-geo-alt-fill:before{content:"\f3e7"}.bi-geo-alt:before{content:"\f3e8"}.bi-geo-fill:before{content:"\f3e9"}.bi-geo:before{content:"\f3ea"}.bi-gift-fill:before{content:"\f3eb"}.bi-gift:before{content:"\f3ec"}.bi-github:before{content:"\f3ed"}.bi-globe:before{content:"\f3ee"}.bi-globe2:before{content:"\f3ef"}.bi-google:before{content:"\f3f0"}.bi-graph-down:before{content:"\f3f1"}.bi-graph-up:before{content:"\f3f2"}.bi-grid-1x2-fill:before{content:"\f3f3"}.bi-grid-1x2:before{content:"\f3f4"}.bi-grid-3x2-gap-fill:before{content:"\f3f5"}.bi-grid-3x2-gap:before{content:"\f3f6"}.bi-grid-3x2:before{content:"\f3f7"}.bi-grid-3x3-gap-fill:before{content:"\f3f8"}.bi-grid-3x3-gap:before{content:"\f3f9"}.bi-grid-3x3:before{content:"\f3fa"}.bi-grid-fill:before{content:"\f3fb"}.bi-grid:before{content:"\f3fc"}.bi-grip-horizontal:before{content:"\f3fd"}.bi-grip-vertical:before{content:"\f3fe"}.bi-hammer:before{content:"\f3ff"}.bi-hand-index-fill:before{content:"\f400"}.bi-hand-index-thumb-fill:before{content:"\f401"}.bi-hand-index-thumb:before{content:"\f402"}.bi-hand-index:before{content:"\f403"}.bi-hand-thumbs-down-fill:before{content:"\f404"}.bi-hand-thumbs-down:before{content:"\f405"}.bi-hand-thumbs-up-fill:before{content:"\f406"}.bi-hand-thumbs-up:before{content:"\f407"}.bi-handbag-fill:before{content:"\f408"}.bi-handbag:before{content:"\f409"}.bi-hash:before{content:"\f40a"}.bi-hdd-fill:before{content:"\f40b"}.bi-hdd-network-fill:before{content:"\f40c"}.bi-hdd-network:before{content:"\f40d"}.bi-hdd-rack-fill:before{content:"\f40e"}.bi-hdd-rack:before{content:"\f40f"}.bi-hdd-stack-fill:before{content:"\f410"}.bi-hdd-stack:before{content:"\f411"}.bi-hdd:before{content:"\f412"}.bi-headphones:before{content:"\f413"}.bi-headset:before{content:"\f414"}.bi-heart-fill:before{content:"\f415"}.bi-heart-half:before{content:"\f416"}.bi-heart:before{content:"\f417"}.bi-heptagon-fill:before{content:"\f418"}.bi-heptagon-half:before{content:"\f419"}.bi-heptagon:before{content:"\f41a"}.bi-hexagon-fill:before{content:"\f41b"}.bi-hexagon-half:before{content:"\f41c"}.bi-hexagon:before{content:"\f41d"}.bi-hourglass-bottom:before{content:"\f41e"}.bi-hourglass-split:before{content:"\f41f"}.bi-hourglass-top:before{content:"\f420"}.bi-hourglass:before{content:"\f421"}.bi-house-door-fill:before{content:"\f422"}.bi-house-door:before{content:"\f423"}.bi-house-fill:before{content:"\f424"}.bi-house:before{content:"\f425"}.bi-hr:before{content:"\f426"}.bi-hurricane:before{content:"\f427"}.bi-image-alt:before{content:"\f428"}.bi-image-fill:before{content:"\f429"}.bi-image:before{content:"\f42a"}.bi-images:before{content:"\f42b"}.bi-inbox-fill:before{content:"\f42c"}.bi-inbox:before{content:"\f42d"}.bi-inboxes-fill:before{content:"\f42e"}.bi-inboxes:before{content:"\f42f"}.bi-info-circle-fill:before{content:"\f430"}.bi-info-circle:before{content:"\f431"}.bi-info-square-fill:before{content:"\f432"}.bi-info-square:before{content:"\f433"}.bi-info:before{content:"\f434"}.bi-input-cursor-text:before{content:"\f435"}.bi-input-cursor:before{content:"\f436"}.bi-instagram:before{content:"\f437"}.bi-intersect:before{content:"\f438"}.bi-journal-album:before{content:"\f439"}.bi-journal-arrow-down:before{content:"\f43a"}.bi-journal-arrow-up:before{content:"\f43b"}.bi-journal-bookmark-fill:before{content:"\f43c"}.bi-journal-bookmark:before{content:"\f43d"}.bi-journal-check:before{content:"\f43e"}.bi-journal-code:before{content:"\f43f"}.bi-journal-medical:before{content:"\f440"}.bi-journal-minus:before{content:"\f441"}.bi-journal-plus:before{content:"\f442"}.bi-journal-richtext:before{content:"\f443"}.bi-journal-text:before{content:"\f444"}.bi-journal-x:before{content:"\f445"}.bi-journal:before{content:"\f446"}.bi-journals:before{content:"\f447"}.bi-joystick:before{content:"\f448"}.bi-justify-left:before{content:"\f449"}.bi-justify-right:before{content:"\f44a"}.bi-justify:before{content:"\f44b"}.bi-kanban-fill:before{content:"\f44c"}.bi-kanban:before{content:"\f44d"}.bi-key-fill:before{content:"\f44e"}.bi-key:before{content:"\f44f"}.bi-keyboard-fill:before{content:"\f450"}.bi-keyboard:before{content:"\f451"}.bi-ladder:before{content:"\f452"}.bi-lamp-fill:before{content:"\f453"}.bi-lamp:before{content:"\f454"}.bi-laptop-fill:before{content:"\f455"}.bi-laptop:before{content:"\f456"}.bi-layer-backward:before{content:"\f457"}.bi-layer-forward:before{content:"\f458"}.bi-layers-fill:before{content:"\f459"}.bi-layers-half:before{content:"\f45a"}.bi-layers:before{content:"\f45b"}.bi-layout-sidebar-inset-reverse:before{content:"\f45c"}.bi-layout-sidebar-inset:before{content:"\f45d"}.bi-layout-sidebar-reverse:before{content:"\f45e"}.bi-layout-sidebar:before{content:"\f45f"}.bi-layout-split:before{content:"\f460"}.bi-layout-text-sidebar-reverse:before{content:"\f461"}.bi-layout-text-sidebar:before{content:"\f462"}.bi-layout-text-window-reverse:before{content:"\f463"}.bi-layout-text-window:before{content:"\f464"}.bi-layout-three-columns:before{content:"\f465"}.bi-layout-wtf:before{content:"\f466"}.bi-life-preserver:before{content:"\f467"}.bi-lightbulb-fill:before{content:"\f468"}.bi-lightbulb-off-fill:before{content:"\f469"}.bi-lightbulb-off:before{content:"\f46a"}.bi-lightbulb:before{content:"\f46b"}.bi-lightning-charge-fill:before{content:"\f46c"}.bi-lightning-charge:before{content:"\f46d"}.bi-lightning-fill:before{content:"\f46e"}.bi-lightning:before{content:"\f46f"}.bi-link-45deg:before{content:"\f470"}.bi-link:before{content:"\f471"}.bi-linkedin:before{content:"\f472"}.bi-list-check:before{content:"\f473"}.bi-list-nested:before{content:"\f474"}.bi-list-ol:before{content:"\f475"}.bi-list-stars:before{content:"\f476"}.bi-list-task:before{content:"\f477"}.bi-list-ul:before{content:"\f478"}.bi-list:before{content:"\f479"}.bi-lock-fill:before{content:"\f47a"}.bi-lock:before{content:"\f47b"}.bi-mailbox:before{content:"\f47c"}.bi-mailbox2:before{content:"\f47d"}.bi-map-fill:before{content:"\f47e"}.bi-map:before{content:"\f47f"}.bi-markdown-fill:before{content:"\f480"}.bi-markdown:before{content:"\f481"}.bi-mask:before{content:"\f482"}.bi-megaphone-fill:before{content:"\f483"}.bi-megaphone:before{content:"\f484"}.bi-menu-app-fill:before{content:"\f485"}.bi-menu-app:before{content:"\f486"}.bi-menu-button-fill:before{content:"\f487"}.bi-menu-button-wide-fill:before{content:"\f488"}.bi-menu-button-wide:before{content:"\f489"}.bi-menu-button:before{content:"\f48a"}.bi-menu-down:before{content:"\f48b"}.bi-menu-up:before{content:"\f48c"}.bi-mic-fill:before{content:"\f48d"}.bi-mic-mute-fill:before{content:"\f48e"}.bi-mic-mute:before{content:"\f48f"}.bi-mic:before{content:"\f490"}.bi-minecart-loaded:before{content:"\f491"}.bi-minecart:before{content:"\f492"}.bi-moisture:before{content:"\f493"}.bi-moon-fill:before{content:"\f494"}.bi-moon-stars-fill:before{content:"\f495"}.bi-moon-stars:before{content:"\f496"}.bi-moon:before{content:"\f497"}.bi-mouse-fill:before{content:"\f498"}.bi-mouse:before{content:"\f499"}.bi-mouse2-fill:before{content:"\f49a"}.bi-mouse2:before{content:"\f49b"}.bi-mouse3-fill:before{content:"\f49c"}.bi-mouse3:before{content:"\f49d"}.bi-music-note-beamed:before{content:"\f49e"}.bi-music-note-list:before{content:"\f49f"}.bi-music-note:before{content:"\f4a0"}.bi-music-player-fill:before{content:"\f4a1"}.bi-music-player:before{content:"\f4a2"}.bi-newspaper:before{content:"\f4a3"}.bi-node-minus-fill:before{content:"\f4a4"}.bi-node-minus:before{content:"\f4a5"}.bi-node-plus-fill:before{content:"\f4a6"}.bi-node-plus:before{content:"\f4a7"}.bi-nut-fill:before{content:"\f4a8"}.bi-nut:before{content:"\f4a9"}.bi-octagon-fill:before{content:"\f4aa"}.bi-octagon-half:before{content:"\f4ab"}.bi-octagon:before{content:"\f4ac"}.bi-option:before{content:"\f4ad"}.bi-outlet:before{content:"\f4ae"}.bi-paint-bucket:before{content:"\f4af"}.bi-palette-fill:before{content:"\f4b0"}.bi-palette:before{content:"\f4b1"}.bi-palette2:before{content:"\f4b2"}.bi-paperclip:before{content:"\f4b3"}.bi-paragraph:before{content:"\f4b4"}.bi-patch-check-fill:before{content:"\f4b5"}.bi-patch-check:before{content:"\f4b6"}.bi-patch-exclamation-fill:before{content:"\f4b7"}.bi-patch-exclamation:before{content:"\f4b8"}.bi-patch-minus-fill:before{content:"\f4b9"}.bi-patch-minus:before{content:"\f4ba"}.bi-patch-plus-fill:before{content:"\f4bb"}.bi-patch-plus:before{content:"\f4bc"}.bi-patch-question-fill:before{content:"\f4bd"}.bi-patch-question:before{content:"\f4be"}.bi-pause-btn-fill:before{content:"\f4bf"}.bi-pause-btn:before{content:"\f4c0"}.bi-pause-circle-fill:before{content:"\f4c1"}.bi-pause-circle:before{content:"\f4c2"}.bi-pause-fill:before{content:"\f4c3"}.bi-pause:before{content:"\f4c4"}.bi-peace-fill:before{content:"\f4c5"}.bi-peace:before{content:"\f4c6"}.bi-pen-fill:before{content:"\f4c7"}.bi-pen:before{content:"\f4c8"}.bi-pencil-fill:before{content:"\f4c9"}.bi-pencil-square:before{content:"\f4ca"}.bi-pencil:before{content:"\f4cb"}.bi-pentagon-fill:before{content:"\f4cc"}.bi-pentagon-half:before{content:"\f4cd"}.bi-pentagon:before{content:"\f4ce"}.bi-people-fill:before{content:"\f4cf"}.bi-people:before{content:"\f4d0"}.bi-percent:before{content:"\f4d1"}.bi-person-badge-fill:before{content:"\f4d2"}.bi-person-badge:before{content:"\f4d3"}.bi-person-bounding-box:before{content:"\f4d4"}.bi-person-check-fill:before{content:"\f4d5"}.bi-person-check:before{content:"\f4d6"}.bi-person-circle:before{content:"\f4d7"}.bi-person-dash-fill:before{content:"\f4d8"}.bi-person-dash:before{content:"\f4d9"}.bi-person-fill:before{content:"\f4da"}.bi-person-lines-fill:before{content:"\f4db"}.bi-person-plus-fill:before{content:"\f4dc"}.bi-person-plus:before{content:"\f4dd"}.bi-person-square:before{content:"\f4de"}.bi-person-x-fill:before{content:"\f4df"}.bi-person-x:before{content:"\f4e0"}.bi-person:before{content:"\f4e1"}.bi-phone-fill:before{content:"\f4e2"}.bi-phone-landscape-fill:before{content:"\f4e3"}.bi-phone-landscape:before{content:"\f4e4"}.bi-phone-vibrate-fill:before{content:"\f4e5"}.bi-phone-vibrate:before{content:"\f4e6"}.bi-phone:before{content:"\f4e7"}.bi-pie-chart-fill:before{content:"\f4e8"}.bi-pie-chart:before{content:"\f4e9"}.bi-pin-angle-fill:before{content:"\f4ea"}.bi-pin-angle:before{content:"\f4eb"}.bi-pin-fill:before{content:"\f4ec"}.bi-pin:before{content:"\f4ed"}.bi-pip-fill:before{content:"\f4ee"}.bi-pip:before{content:"\f4ef"}.bi-play-btn-fill:before{content:"\f4f0"}.bi-play-btn:before{content:"\f4f1"}.bi-play-circle-fill:before{content:"\f4f2"}.bi-play-circle:before{content:"\f4f3"}.bi-play-fill:before{content:"\f4f4"}.bi-play:before{content:"\f4f5"}.bi-plug-fill:before{content:"\f4f6"}.bi-plug:before{content:"\f4f7"}.bi-plus-circle-dotted:before{content:"\f4f8"}.bi-plus-circle-fill:before{content:"\f4f9"}.bi-plus-circle:before{content:"\f4fa"}.bi-plus-square-dotted:before{content:"\f4fb"}.bi-plus-square-fill:before{content:"\f4fc"}.bi-plus-square:before{content:"\f4fd"}.bi-plus:before{content:"\f4fe"}.bi-power:before{content:"\f4ff"}.bi-printer-fill:before{content:"\f500"}.bi-printer:before{content:"\f501"}.bi-puzzle-fill:before{content:"\f502"}.bi-puzzle:before{content:"\f503"}.bi-question-circle-fill:before{content:"\f504"}.bi-question-circle:before{content:"\f505"}.bi-question-diamond-fill:before{content:"\f506"}.bi-question-diamond:before{content:"\f507"}.bi-question-octagon-fill:before{content:"\f508"}.bi-question-octagon:before{content:"\f509"}.bi-question-square-fill:before{content:"\f50a"}.bi-question-square:before{content:"\f50b"}.bi-question:before{content:"\f50c"}.bi-rainbow:before{content:"\f50d"}.bi-receipt-cutoff:before{content:"\f50e"}.bi-receipt:before{content:"\f50f"}.bi-reception-0:before{content:"\f510"}.bi-reception-1:before{content:"\f511"}.bi-reception-2:before{content:"\f512"}.bi-reception-3:before{content:"\f513"}.bi-reception-4:before{content:"\f514"}.bi-record-btn-fill:before{content:"\f515"}.bi-record-btn:before{content:"\f516"}.bi-record-circle-fill:before{content:"\f517"}.bi-record-circle:before{content:"\f518"}.bi-record-fill:before{content:"\f519"}.bi-record:before{content:"\f51a"}.bi-record2-fill:before{content:"\f51b"}.bi-record2:before{content:"\f51c"}.bi-reply-all-fill:before{content:"\f51d"}.bi-reply-all:before{content:"\f51e"}.bi-reply-fill:before{content:"\f51f"}.bi-reply:before{content:"\f520"}.bi-rss-fill:before{content:"\f521"}.bi-rss:before{content:"\f522"}.bi-rulers:before{content:"\f523"}.bi-save-fill:before{content:"\f524"}.bi-save:before{content:"\f525"}.bi-save2-fill:before{content:"\f526"}.bi-save2:before{content:"\f527"}.bi-scissors:before{content:"\f528"}.bi-screwdriver:before{content:"\f529"}.bi-search:before{content:"\f52a"}.bi-segmented-nav:before{content:"\f52b"}.bi-server:before{content:"\f52c"}.bi-share-fill:before{content:"\f52d"}.bi-share:before{content:"\f52e"}.bi-shield-check:before{content:"\f52f"}.bi-shield-exclamation:before{content:"\f530"}.bi-shield-fill-check:before{content:"\f531"}.bi-shield-fill-exclamation:before{content:"\f532"}.bi-shield-fill-minus:before{content:"\f533"}.bi-shield-fill-plus:before{content:"\f534"}.bi-shield-fill-x:before{content:"\f535"}.bi-shield-fill:before{content:"\f536"}.bi-shield-lock-fill:before{content:"\f537"}.bi-shield-lock:before{content:"\f538"}.bi-shield-minus:before{content:"\f539"}.bi-shield-plus:before{content:"\f53a"}.bi-shield-shaded:before{content:"\f53b"}.bi-shield-slash-fill:before{content:"\f53c"}.bi-shield-slash:before{content:"\f53d"}.bi-shield-x:before{content:"\f53e"}.bi-shield:before{content:"\f53f"}.bi-shift-fill:before{content:"\f540"}.bi-shift:before{content:"\f541"}.bi-shop-window:before{content:"\f542"}.bi-shop:before{content:"\f543"}.bi-shuffle:before{content:"\f544"}.bi-signpost-2-fill:before{content:"\f545"}.bi-signpost-2:before{content:"\f546"}.bi-signpost-fill:before{content:"\f547"}.bi-signpost-split-fill:before{content:"\f548"}.bi-signpost-split:before{content:"\f549"}.bi-signpost:before{content:"\f54a"}.bi-sim-fill:before{content:"\f54b"}.bi-sim:before{content:"\f54c"}.bi-skip-backward-btn-fill:before{content:"\f54d"}.bi-skip-backward-btn:before{content:"\f54e"}.bi-skip-backward-circle-fill:before{content:"\f54f"}.bi-skip-backward-circle:before{content:"\f550"}.bi-skip-backward-fill:before{content:"\f551"}.bi-skip-backward:before{content:"\f552"}.bi-skip-end-btn-fill:before{content:"\f553"}.bi-skip-end-btn:before{content:"\f554"}.bi-skip-end-circle-fill:before{content:"\f555"}.bi-skip-end-circle:before{content:"\f556"}.bi-skip-end-fill:before{content:"\f557"}.bi-skip-end:before{content:"\f558"}.bi-skip-forward-btn-fill:before{content:"\f559"}.bi-skip-forward-btn:before{content:"\f55a"}.bi-skip-forward-circle-fill:before{content:"\f55b"}.bi-skip-forward-circle:before{content:"\f55c"}.bi-skip-forward-fill:before{content:"\f55d"}.bi-skip-forward:before{content:"\f55e"}.bi-skip-start-btn-fill:before{content:"\f55f"}.bi-skip-start-btn:before{content:"\f560"}.bi-skip-start-circle-fill:before{content:"\f561"}.bi-skip-start-circle:before{content:"\f562"}.bi-skip-start-fill:before{content:"\f563"}.bi-skip-start:before{content:"\f564"}.bi-slack:before{content:"\f565"}.bi-slash-circle-fill:before{content:"\f566"}.bi-slash-circle:before{content:"\f567"}.bi-slash-square-fill:before{content:"\f568"}.bi-slash-square:before{content:"\f569"}.bi-slash:before{content:"\f56a"}.bi-sliders:before{content:"\f56b"}.bi-smartwatch:before{content:"\f56c"}.bi-snow:before{content:"\f56d"}.bi-snow2:before{content:"\f56e"}.bi-snow3:before{content:"\f56f"}.bi-sort-alpha-down-alt:before{content:"\f570"}.bi-sort-alpha-down:before{content:"\f571"}.bi-sort-alpha-up-alt:before{content:"\f572"}.bi-sort-alpha-up:before{content:"\f573"}.bi-sort-down-alt:before{content:"\f574"}.bi-sort-down:before{content:"\f575"}.bi-sort-numeric-down-alt:before{content:"\f576"}.bi-sort-numeric-down:before{content:"\f577"}.bi-sort-numeric-up-alt:before{content:"\f578"}.bi-sort-numeric-up:before{content:"\f579"}.bi-sort-up-alt:before{content:"\f57a"}.bi-sort-up:before{content:"\f57b"}.bi-soundwave:before{content:"\f57c"}.bi-speaker-fill:before{content:"\f57d"}.bi-speaker:before{content:"\f57e"}.bi-speedometer:before{content:"\f57f"}.bi-speedometer2:before{content:"\f580"}.bi-spellcheck:before{content:"\f581"}.bi-square-fill:before{content:"\f582"}.bi-square-half:before{content:"\f583"}.bi-square:before{content:"\f584"}.bi-stack:before{content:"\f585"}.bi-star-fill:before{content:"\f586"}.bi-star-half:before{content:"\f587"}.bi-star:before{content:"\f588"}.bi-stars:before{content:"\f589"}.bi-stickies-fill:before{content:"\f58a"}.bi-stickies:before{content:"\f58b"}.bi-sticky-fill:before{content:"\f58c"}.bi-sticky:before{content:"\f58d"}.bi-stop-btn-fill:before{content:"\f58e"}.bi-stop-btn:before{content:"\f58f"}.bi-stop-circle-fill:before{content:"\f590"}.bi-stop-circle:before{content:"\f591"}.bi-stop-fill:before{content:"\f592"}.bi-stop:before{content:"\f593"}.bi-stoplights-fill:before{content:"\f594"}.bi-stoplights:before{content:"\f595"}.bi-stopwatch-fill:before{content:"\f596"}.bi-stopwatch:before{content:"\f597"}.bi-subtract:before{content:"\f598"}.bi-suit-club-fill:before{content:"\f599"}.bi-suit-club:before{content:"\f59a"}.bi-suit-diamond-fill:before{content:"\f59b"}.bi-suit-diamond:before{content:"\f59c"}.bi-suit-heart-fill:before{content:"\f59d"}.bi-suit-heart:before{content:"\f59e"}.bi-suit-spade-fill:before{content:"\f59f"}.bi-suit-spade:before{content:"\f5a0"}.bi-sun-fill:before{content:"\f5a1"}.bi-sun:before{content:"\f5a2"}.bi-sunglasses:before{content:"\f5a3"}.bi-sunrise-fill:before{content:"\f5a4"}.bi-sunrise:before{content:"\f5a5"}.bi-sunset-fill:before{content:"\f5a6"}.bi-sunset:before{content:"\f5a7"}.bi-symmetry-horizontal:before{content:"\f5a8"}.bi-symmetry-vertical:before{content:"\f5a9"}.bi-table:before{content:"\f5aa"}.bi-tablet-fill:before{content:"\f5ab"}.bi-tablet-landscape-fill:before{content:"\f5ac"}.bi-tablet-landscape:before{content:"\f5ad"}.bi-tablet:before{content:"\f5ae"}.bi-tag-fill:before{content:"\f5af"}.bi-tag:before{content:"\f5b0"}.bi-tags-fill:before{content:"\f5b1"}.bi-tags:before{content:"\f5b2"}.bi-telegram:before{content:"\f5b3"}.bi-telephone-fill:before{content:"\f5b4"}.bi-telephone-forward-fill:before{content:"\f5b5"}.bi-telephone-forward:before{content:"\f5b6"}.bi-telephone-inbound-fill:before{content:"\f5b7"}.bi-telephone-inbound:before{content:"\f5b8"}.bi-telephone-minus-fill:before{content:"\f5b9"}.bi-telephone-minus:before{content:"\f5ba"}.bi-telephone-outbound-fill:before{content:"\f5bb"}.bi-telephone-outbound:before{content:"\f5bc"}.bi-telephone-plus-fill:before{content:"\f5bd"}.bi-telephone-plus:before{content:"\f5be"}.bi-telephone-x-fill:before{content:"\f5bf"}.bi-telephone-x:before{content:"\f5c0"}.bi-telephone:before{content:"\f5c1"}.bi-terminal-fill:before{content:"\f5c2"}.bi-terminal:before{content:"\f5c3"}.bi-text-center:before{content:"\f5c4"}.bi-text-indent-left:before{content:"\f5c5"}.bi-text-indent-right:before{content:"\f5c6"}.bi-text-left:before{content:"\f5c7"}.bi-text-paragraph:before{content:"\f5c8"}.bi-text-right:before{content:"\f5c9"}.bi-textarea-resize:before{content:"\f5ca"}.bi-textarea-t:before{content:"\f5cb"}.bi-textarea:before{content:"\f5cc"}.bi-thermometer-half:before{content:"\f5cd"}.bi-thermometer-high:before{content:"\f5ce"}.bi-thermometer-low:before{content:"\f5cf"}.bi-thermometer-snow:before{content:"\f5d0"}.bi-thermometer-sun:before{content:"\f5d1"}.bi-thermometer:before{content:"\f5d2"}.bi-three-dots-vertical:before{content:"\f5d3"}.bi-three-dots:before{content:"\f5d4"}.bi-toggle-off:before{content:"\f5d5"}.bi-toggle-on:before{content:"\f5d6"}.bi-toggle2-off:before{content:"\f5d7"}.bi-toggle2-on:before{content:"\f5d8"}.bi-toggles:before{content:"\f5d9"}.bi-toggles2:before{content:"\f5da"}.bi-tools:before{content:"\f5db"}.bi-tornado:before{content:"\f5dc"}.bi-trash-fill:before{content:"\f5dd"}.bi-trash:before{content:"\f5de"}.bi-trash2-fill:before{content:"\f5df"}.bi-trash2:before{content:"\f5e0"}.bi-tree-fill:before{content:"\f5e1"}.bi-tree:before{content:"\f5e2"}.bi-triangle-fill:before{content:"\f5e3"}.bi-triangle-half:before{content:"\f5e4"}.bi-triangle:before{content:"\f5e5"}.bi-trophy-fill:before{content:"\f5e6"}.bi-trophy:before{content:"\f5e7"}.bi-tropical-storm:before{content:"\f5e8"}.bi-truck-flatbed:before{content:"\f5e9"}.bi-truck:before{content:"\f5ea"}.bi-tsunami:before{content:"\f5eb"}.bi-tv-fill:before{content:"\f5ec"}.bi-tv:before{content:"\f5ed"}.bi-twitch:before{content:"\f5ee"}.bi-twitter:before{content:"\f5ef"}.bi-type-bold:before{content:"\f5f0"}.bi-type-h1:before{content:"\f5f1"}.bi-type-h2:before{content:"\f5f2"}.bi-type-h3:before{content:"\f5f3"}.bi-type-italic:before{content:"\f5f4"}.bi-type-strikethrough:before{content:"\f5f5"}.bi-type-underline:before{content:"\f5f6"}.bi-type:before{content:"\f5f7"}.bi-ui-checks-grid:before{content:"\f5f8"}.bi-ui-checks:before{content:"\f5f9"}.bi-ui-radios-grid:before{content:"\f5fa"}.bi-ui-radios:before{content:"\f5fb"}.bi-umbrella-fill:before{content:"\f5fc"}.bi-umbrella:before{content:"\f5fd"}.bi-union:before{content:"\f5fe"}.bi-unlock-fill:before{content:"\f5ff"}.bi-unlock:before{content:"\f600"}.bi-upc-scan:before{content:"\f601"}.bi-upc:before{content:"\f602"}.bi-upload:before{content:"\f603"}.bi-vector-pen:before{content:"\f604"}.bi-view-list:before{content:"\f605"}.bi-view-stacked:before{content:"\f606"}.bi-vinyl-fill:before{content:"\f607"}.bi-vinyl:before{content:"\f608"}.bi-voicemail:before{content:"\f609"}.bi-volume-down-fill:before{content:"\f60a"}.bi-volume-down:before{content:"\f60b"}.bi-volume-mute-fill:before{content:"\f60c"}.bi-volume-mute:before{content:"\f60d"}.bi-volume-off-fill:before{content:"\f60e"}.bi-volume-off:before{content:"\f60f"}.bi-volume-up-fill:before{content:"\f610"}.bi-volume-up:before{content:"\f611"}.bi-vr:before{content:"\f612"}.bi-wallet-fill:before{content:"\f613"}.bi-wallet:before{content:"\f614"}.bi-wallet2:before{content:"\f615"}.bi-watch:before{content:"\f616"}.bi-water:before{content:"\f617"}.bi-whatsapp:before{content:"\f618"}.bi-wifi-1:before{content:"\f619"}.bi-wifi-2:before{content:"\f61a"}.bi-wifi-off:before{content:"\f61b"}.bi-wifi:before{content:"\f61c"}.bi-wind:before{content:"\f61d"}.bi-window-dock:before{content:"\f61e"}.bi-window-sidebar:before{content:"\f61f"}.bi-window:before{content:"\f620"}.bi-wrench:before{content:"\f621"}.bi-x-circle-fill:before{content:"\f622"}.bi-x-circle:before{content:"\f623"}.bi-x-diamond-fill:before{content:"\f624"}.bi-x-diamond:before{content:"\f625"}.bi-x-octagon-fill:before{content:"\f626"}.bi-x-octagon:before{content:"\f627"}.bi-x-square-fill:before{content:"\f628"}.bi-x-square:before{content:"\f629"}.bi-x:before{content:"\f62a"}.bi-youtube:before{content:"\f62b"}.bi-zoom-in:before{content:"\f62c"}.bi-zoom-out:before{content:"\f62d"}.bi-bank:before{content:"\f62e"}.bi-bank2:before{content:"\f62f"}.bi-bell-slash-fill:before{content:"\f630"}.bi-bell-slash:before{content:"\f631"}.bi-cash-coin:before{content:"\f632"}.bi-check-lg:before{content:"\f633"}.bi-coin:before{content:"\f634"}.bi-currency-bitcoin:before{content:"\f635"}.bi-currency-dollar:before{content:"\f636"}.bi-currency-euro:before{content:"\f637"}.bi-currency-exchange:before{content:"\f638"}.bi-currency-pound:before{content:"\f639"}.bi-currency-yen:before{content:"\f63a"}.bi-dash-lg:before{content:"\f63b"}.bi-exclamation-lg:before{content:"\f63c"}.bi-file-earmark-pdf-fill:before{content:"\f63d"}.bi-file-earmark-pdf:before{content:"\f63e"}.bi-file-pdf-fill:before{content:"\f63f"}.bi-file-pdf:before{content:"\f640"}.bi-gender-ambiguous:before{content:"\f641"}.bi-gender-female:before{content:"\f642"}.bi-gender-male:before{content:"\f643"}.bi-gender-trans:before{content:"\f644"}.bi-headset-vr:before{content:"\f645"}.bi-info-lg:before{content:"\f646"}.bi-mastodon:before{content:"\f647"}.bi-messenger:before{content:"\f648"}.bi-piggy-bank-fill:before{content:"\f649"}.bi-piggy-bank:before{content:"\f64a"}.bi-pin-map-fill:before{content:"\f64b"}.bi-pin-map:before{content:"\f64c"}.bi-plus-lg:before{content:"\f64d"}.bi-question-lg:before{content:"\f64e"}.bi-recycle:before{content:"\f64f"}.bi-reddit:before{content:"\f650"}.bi-safe-fill:before{content:"\f651"}.bi-safe2-fill:before{content:"\f652"}.bi-safe2:before{content:"\f653"}.bi-sd-card-fill:before{content:"\f654"}.bi-sd-card:before{content:"\f655"}.bi-skype:before{content:"\f656"}.bi-slash-lg:before{content:"\f657"}.bi-translate:before{content:"\f658"}.bi-x-lg:before{content:"\f659"}.bi-safe:before{content:"\f65a"}.bi-apple:before{content:"\f65b"}.bi-microsoft:before{content:"\f65d"}.bi-windows:before{content:"\f65e"}.bi-behance:before{content:"\f65c"}.bi-dribbble:before{content:"\f65f"}.bi-line:before{content:"\f660"}.bi-medium:before{content:"\f661"}.bi-paypal:before{content:"\f662"}.bi-pinterest:before{content:"\f663"}.bi-signal:before{content:"\f664"}.bi-snapchat:before{content:"\f665"}.bi-spotify:before{content:"\f666"}.bi-stack-overflow:before{content:"\f667"}.bi-strava:before{content:"\f668"}.bi-wordpress:before{content:"\f669"}.bi-vimeo:before{content:"\f66a"}.bi-activity:before{content:"\f66b"}.bi-easel2-fill:before{content:"\f66c"}.bi-easel2:before{content:"\f66d"}.bi-easel3-fill:before{content:"\f66e"}.bi-easel3:before{content:"\f66f"}.bi-fan:before{content:"\f670"}.bi-fingerprint:before{content:"\f671"}.bi-graph-down-arrow:before{content:"\f672"}.bi-graph-up-arrow:before{content:"\f673"}.bi-hypnotize:before{content:"\f674"}.bi-magic:before{content:"\f675"}.bi-person-rolodex:before{content:"\f676"}.bi-person-video:before{content:"\f677"}.bi-person-video2:before{content:"\f678"}.bi-person-video3:before{content:"\f679"}.bi-person-workspace:before{content:"\f67a"}.bi-radioactive:before{content:"\f67b"}.bi-webcam-fill:before{content:"\f67c"}.bi-webcam:before{content:"\f67d"}.bi-yin-yang:before{content:"\f67e"}.bi-bandaid-fill:before{content:"\f680"}.bi-bandaid:before{content:"\f681"}.bi-bluetooth:before{content:"\f682"}.bi-body-text:before{content:"\f683"}.bi-boombox:before{content:"\f684"}.bi-boxes:before{content:"\f685"}.bi-dpad-fill:before{content:"\f686"}.bi-dpad:before{content:"\f687"}.bi-ear-fill:before{content:"\f688"}.bi-ear:before{content:"\f689"}.bi-envelope-check-fill:before{content:"\f68b"}.bi-envelope-check:before{content:"\f68c"}.bi-envelope-dash-fill:before{content:"\f68e"}.bi-envelope-dash:before{content:"\f68f"}.bi-envelope-exclamation-fill:before{content:"\f691"}.bi-envelope-exclamation:before{content:"\f692"}.bi-envelope-plus-fill:before{content:"\f693"}.bi-envelope-plus:before{content:"\f694"}.bi-envelope-slash-fill:before{content:"\f696"}.bi-envelope-slash:before{content:"\f697"}.bi-envelope-x-fill:before{content:"\f699"}.bi-envelope-x:before{content:"\f69a"}.bi-explicit-fill:before{content:"\f69b"}.bi-explicit:before{content:"\f69c"}.bi-git:before{content:"\f69d"}.bi-infinity:before{content:"\f69e"}.bi-list-columns-reverse:before{content:"\f69f"}.bi-list-columns:before{content:"\f6a0"}.bi-meta:before{content:"\f6a1"}.bi-nintendo-switch:before{content:"\f6a4"}.bi-pc-display-horizontal:before{content:"\f6a5"}.bi-pc-display:before{content:"\f6a6"}.bi-pc-horizontal:before{content:"\f6a7"}.bi-pc:before{content:"\f6a8"}.bi-playstation:before{content:"\f6a9"}.bi-plus-slash-minus:before{content:"\f6aa"}.bi-projector-fill:before{content:"\f6ab"}.bi-projector:before{content:"\f6ac"}.bi-qr-code-scan:before{content:"\f6ad"}.bi-qr-code:before{content:"\f6ae"}.bi-quora:before{content:"\f6af"}.bi-quote:before{content:"\f6b0"}.bi-robot:before{content:"\f6b1"}.bi-send-check-fill:before{content:"\f6b2"}.bi-send-check:before{content:"\f6b3"}.bi-send-dash-fill:before{content:"\f6b4"}.bi-send-dash:before{content:"\f6b5"}.bi-send-exclamation-fill:before{content:"\f6b7"}.bi-send-exclamation:before{content:"\f6b8"}.bi-send-fill:before{content:"\f6b9"}.bi-send-plus-fill:before{content:"\f6ba"}.bi-send-plus:before{content:"\f6bb"}.bi-send-slash-fill:before{content:"\f6bc"}.bi-send-slash:before{content:"\f6bd"}.bi-send-x-fill:before{content:"\f6be"}.bi-send-x:before{content:"\f6bf"}.bi-send:before{content:"\f6c0"}.bi-steam:before{content:"\f6c1"}.bi-terminal-dash:before{content:"\f6c3"}.bi-terminal-plus:before{content:"\f6c4"}.bi-terminal-split:before{content:"\f6c5"}.bi-ticket-detailed-fill:before{content:"\f6c6"}.bi-ticket-detailed:before{content:"\f6c7"}.bi-ticket-fill:before{content:"\f6c8"}.bi-ticket-perforated-fill:before{content:"\f6c9"}.bi-ticket-perforated:before{content:"\f6ca"}.bi-ticket:before{content:"\f6cb"}.bi-tiktok:before{content:"\f6cc"}.bi-window-dash:before{content:"\f6cd"}.bi-window-desktop:before{content:"\f6ce"}.bi-window-fullscreen:before{content:"\f6cf"}.bi-window-plus:before{content:"\f6d0"}.bi-window-split:before{content:"\f6d1"}.bi-window-stack:before{content:"\f6d2"}.bi-window-x:before{content:"\f6d3"}.bi-xbox:before{content:"\f6d4"}.bi-ethernet:before{content:"\f6d5"}.bi-hdmi-fill:before{content:"\f6d6"}.bi-hdmi:before{content:"\f6d7"}.bi-usb-c-fill:before{content:"\f6d8"}.bi-usb-c:before{content:"\f6d9"}.bi-usb-fill:before{content:"\f6da"}.bi-usb-plug-fill:before{content:"\f6db"}.bi-usb-plug:before{content:"\f6dc"}.bi-usb-symbol:before{content:"\f6dd"}.bi-usb:before{content:"\f6de"}.bi-boombox-fill:before{content:"\f6df"}.bi-displayport:before{content:"\f6e1"}.bi-gpu-card:before{content:"\f6e2"}.bi-memory:before{content:"\f6e3"}.bi-modem-fill:before{content:"\f6e4"}.bi-modem:before{content:"\f6e5"}.bi-motherboard-fill:before{content:"\f6e6"}.bi-motherboard:before{content:"\f6e7"}.bi-optical-audio-fill:before{content:"\f6e8"}.bi-optical-audio:before{content:"\f6e9"}.bi-pci-card:before{content:"\f6ea"}.bi-router-fill:before{content:"\f6eb"}.bi-router:before{content:"\f6ec"}.bi-thunderbolt-fill:before{content:"\f6ef"}.bi-thunderbolt:before{content:"\f6f0"}.bi-usb-drive-fill:before{content:"\f6f1"}.bi-usb-drive:before{content:"\f6f2"}.bi-usb-micro-fill:before{content:"\f6f3"}.bi-usb-micro:before{content:"\f6f4"}.bi-usb-mini-fill:before{content:"\f6f5"}.bi-usb-mini:before{content:"\f6f6"}.bi-cloud-haze2:before{content:"\f6f7"}.bi-device-hdd-fill:before{content:"\f6f8"}.bi-device-hdd:before{content:"\f6f9"}.bi-device-ssd-fill:before{content:"\f6fa"}.bi-device-ssd:before{content:"\f6fb"}.bi-displayport-fill:before{content:"\f6fc"}.bi-mortarboard-fill:before{content:"\f6fd"}.bi-mortarboard:before{content:"\f6fe"}.bi-terminal-x:before{content:"\f6ff"}.bi-arrow-through-heart-fill:before{content:"\f700"}.bi-arrow-through-heart:before{content:"\f701"}.bi-badge-sd-fill:before{content:"\f702"}.bi-badge-sd:before{content:"\f703"}.bi-bag-heart-fill:before{content:"\f704"}.bi-bag-heart:before{content:"\f705"}.bi-balloon-fill:before{content:"\f706"}.bi-balloon-heart-fill:before{content:"\f707"}.bi-balloon-heart:before{content:"\f708"}.bi-balloon:before{content:"\f709"}.bi-box2-fill:before{content:"\f70a"}.bi-box2-heart-fill:before{content:"\f70b"}.bi-box2-heart:before{content:"\f70c"}.bi-box2:before{content:"\f70d"}.bi-braces-asterisk:before{content:"\f70e"}.bi-calendar-heart-fill:before{content:"\f70f"}.bi-calendar-heart:before{content:"\f710"}.bi-calendar2-heart-fill:before{content:"\f711"}.bi-calendar2-heart:before{content:"\f712"}.bi-chat-heart-fill:before{content:"\f713"}.bi-chat-heart:before{content:"\f714"}.bi-chat-left-heart-fill:before{content:"\f715"}.bi-chat-left-heart:before{content:"\f716"}.bi-chat-right-heart-fill:before{content:"\f717"}.bi-chat-right-heart:before{content:"\f718"}.bi-chat-square-heart-fill:before{content:"\f719"}.bi-chat-square-heart:before{content:"\f71a"}.bi-clipboard-check-fill:before{content:"\f71b"}.bi-clipboard-data-fill:before{content:"\f71c"}.bi-clipboard-fill:before{content:"\f71d"}.bi-clipboard-heart-fill:before{content:"\f71e"}.bi-clipboard-heart:before{content:"\f71f"}.bi-clipboard-minus-fill:before{content:"\f720"}.bi-clipboard-plus-fill:before{content:"\f721"}.bi-clipboard-pulse:before{content:"\f722"}.bi-clipboard-x-fill:before{content:"\f723"}.bi-clipboard2-check-fill:before{content:"\f724"}.bi-clipboard2-check:before{content:"\f725"}.bi-clipboard2-data-fill:before{content:"\f726"}.bi-clipboard2-data:before{content:"\f727"}.bi-clipboard2-fill:before{content:"\f728"}.bi-clipboard2-heart-fill:before{content:"\f729"}.bi-clipboard2-heart:before{content:"\f72a"}.bi-clipboard2-minus-fill:before{content:"\f72b"}.bi-clipboard2-minus:before{content:"\f72c"}.bi-clipboard2-plus-fill:before{content:"\f72d"}.bi-clipboard2-plus:before{content:"\f72e"}.bi-clipboard2-pulse-fill:before{content:"\f72f"}.bi-clipboard2-pulse:before{content:"\f730"}.bi-clipboard2-x-fill:before{content:"\f731"}.bi-clipboard2-x:before{content:"\f732"}.bi-clipboard2:before{content:"\f733"}.bi-emoji-kiss-fill:before{content:"\f734"}.bi-emoji-kiss:before{content:"\f735"}.bi-envelope-heart-fill:before{content:"\f736"}.bi-envelope-heart:before{content:"\f737"}.bi-envelope-open-heart-fill:before{content:"\f738"}.bi-envelope-open-heart:before{content:"\f739"}.bi-envelope-paper-fill:before{content:"\f73a"}.bi-envelope-paper-heart-fill:before{content:"\f73b"}.bi-envelope-paper-heart:before{content:"\f73c"}.bi-envelope-paper:before{content:"\f73d"}.bi-filetype-aac:before{content:"\f73e"}.bi-filetype-ai:before{content:"\f73f"}.bi-filetype-bmp:before{content:"\f740"}.bi-filetype-cs:before{content:"\f741"}.bi-filetype-css:before{content:"\f742"}.bi-filetype-csv:before{content:"\f743"}.bi-filetype-doc:before{content:"\f744"}.bi-filetype-docx:before{content:"\f745"}.bi-filetype-exe:before{content:"\f746"}.bi-filetype-gif:before{content:"\f747"}.bi-filetype-heic:before{content:"\f748"}.bi-filetype-html:before{content:"\f749"}.bi-filetype-java:before{content:"\f74a"}.bi-filetype-jpg:before{content:"\f74b"}.bi-filetype-js:before{content:"\f74c"}.bi-filetype-jsx:before{content:"\f74d"}.bi-filetype-key:before{content:"\f74e"}.bi-filetype-m4p:before{content:"\f74f"}.bi-filetype-md:before{content:"\f750"}.bi-filetype-mdx:before{content:"\f751"}.bi-filetype-mov:before{content:"\f752"}.bi-filetype-mp3:before{content:"\f753"}.bi-filetype-mp4:before{content:"\f754"}.bi-filetype-otf:before{content:"\f755"}.bi-filetype-pdf:before{content:"\f756"}.bi-filetype-php:before{content:"\f757"}.bi-filetype-png:before{content:"\f758"}.bi-filetype-ppt:before{content:"\f75a"}.bi-filetype-psd:before{content:"\f75b"}.bi-filetype-py:before{content:"\f75c"}.bi-filetype-raw:before{content:"\f75d"}.bi-filetype-rb:before{content:"\f75e"}.bi-filetype-sass:before{content:"\f75f"}.bi-filetype-scss:before{content:"\f760"}.bi-filetype-sh:before{content:"\f761"}.bi-filetype-svg:before{content:"\f762"}.bi-filetype-tiff:before{content:"\f763"}.bi-filetype-tsx:before{content:"\f764"}.bi-filetype-ttf:before{content:"\f765"}.bi-filetype-txt:before{content:"\f766"}.bi-filetype-wav:before{content:"\f767"}.bi-filetype-woff:before{content:"\f768"}.bi-filetype-xls:before{content:"\f76a"}.bi-filetype-xml:before{content:"\f76b"}.bi-filetype-yml:before{content:"\f76c"}.bi-heart-arrow:before{content:"\f76d"}.bi-heart-pulse-fill:before{content:"\f76e"}.bi-heart-pulse:before{content:"\f76f"}.bi-heartbreak-fill:before{content:"\f770"}.bi-heartbreak:before{content:"\f771"}.bi-hearts:before{content:"\f772"}.bi-hospital-fill:before{content:"\f773"}.bi-hospital:before{content:"\f774"}.bi-house-heart-fill:before{content:"\f775"}.bi-house-heart:before{content:"\f776"}.bi-incognito:before{content:"\f777"}.bi-magnet-fill:before{content:"\f778"}.bi-magnet:before{content:"\f779"}.bi-person-heart:before{content:"\f77a"}.bi-person-hearts:before{content:"\f77b"}.bi-phone-flip:before{content:"\f77c"}.bi-plugin:before{content:"\f77d"}.bi-postage-fill:before{content:"\f77e"}.bi-postage-heart-fill:before{content:"\f77f"}.bi-postage-heart:before{content:"\f780"}.bi-postage:before{content:"\f781"}.bi-postcard-fill:before{content:"\f782"}.bi-postcard-heart-fill:before{content:"\f783"}.bi-postcard-heart:before{content:"\f784"}.bi-postcard:before{content:"\f785"}.bi-search-heart-fill:before{content:"\f786"}.bi-search-heart:before{content:"\f787"}.bi-sliders2-vertical:before{content:"\f788"}.bi-sliders2:before{content:"\f789"}.bi-trash3-fill:before{content:"\f78a"}.bi-trash3:before{content:"\f78b"}.bi-valentine:before{content:"\f78c"}.bi-valentine2:before{content:"\f78d"}.bi-wrench-adjustable-circle-fill:before{content:"\f78e"}.bi-wrench-adjustable-circle:before{content:"\f78f"}.bi-wrench-adjustable:before{content:"\f790"}.bi-filetype-json:before{content:"\f791"}.bi-filetype-pptx:before{content:"\f792"}.bi-filetype-xlsx:before{content:"\f793"}.bi-1-circle-fill:before{content:"\f796"}.bi-1-circle:before{content:"\f797"}.bi-1-square-fill:before{content:"\f798"}.bi-1-square:before{content:"\f799"}.bi-2-circle-fill:before{content:"\f79c"}.bi-2-circle:before{content:"\f79d"}.bi-2-square-fill:before{content:"\f79e"}.bi-2-square:before{content:"\f79f"}.bi-3-circle-fill:before{content:"\f7a2"}.bi-3-circle:before{content:"\f7a3"}.bi-3-square-fill:before{content:"\f7a4"}.bi-3-square:before{content:"\f7a5"}.bi-4-circle-fill:before{content:"\f7a8"}.bi-4-circle:before{content:"\f7a9"}.bi-4-square-fill:before{content:"\f7aa"}.bi-4-square:before{content:"\f7ab"}.bi-5-circle-fill:before{content:"\f7ae"}.bi-5-circle:before{content:"\f7af"}.bi-5-square-fill:before{content:"\f7b0"}.bi-5-square:before{content:"\f7b1"}.bi-6-circle-fill:before{content:"\f7b4"}.bi-6-circle:before{content:"\f7b5"}.bi-6-square-fill:before{content:"\f7b6"}.bi-6-square:before{content:"\f7b7"}.bi-7-circle-fill:before{content:"\f7ba"}.bi-7-circle:before{content:"\f7bb"}.bi-7-square-fill:before{content:"\f7bc"}.bi-7-square:before{content:"\f7bd"}.bi-8-circle-fill:before{content:"\f7c0"}.bi-8-circle:before{content:"\f7c1"}.bi-8-square-fill:before{content:"\f7c2"}.bi-8-square:before{content:"\f7c3"}.bi-9-circle-fill:before{content:"\f7c6"}.bi-9-circle:before{content:"\f7c7"}.bi-9-square-fill:before{content:"\f7c8"}.bi-9-square:before{content:"\f7c9"}.bi-airplane-engines-fill:before{content:"\f7ca"}.bi-airplane-engines:before{content:"\f7cb"}.bi-airplane-fill:before{content:"\f7cc"}.bi-airplane:before{content:"\f7cd"}.bi-alexa:before{content:"\f7ce"}.bi-alipay:before{content:"\f7cf"}.bi-android:before{content:"\f7d0"}.bi-android2:before{content:"\f7d1"}.bi-box-fill:before{content:"\f7d2"}.bi-box-seam-fill:before{content:"\f7d3"}.bi-browser-chrome:before{content:"\f7d4"}.bi-browser-edge:before{content:"\f7d5"}.bi-browser-firefox:before{content:"\f7d6"}.bi-browser-safari:before{content:"\f7d7"}.bi-c-circle-fill:before{content:"\f7da"}.bi-c-circle:before{content:"\f7db"}.bi-c-square-fill:before{content:"\f7dc"}.bi-c-square:before{content:"\f7dd"}.bi-capsule-pill:before{content:"\f7de"}.bi-capsule:before{content:"\f7df"}.bi-car-front-fill:before{content:"\f7e0"}.bi-car-front:before{content:"\f7e1"}.bi-cassette-fill:before{content:"\f7e2"}.bi-cassette:before{content:"\f7e3"}.bi-cc-circle-fill:before{content:"\f7e6"}.bi-cc-circle:before{content:"\f7e7"}.bi-cc-square-fill:before{content:"\f7e8"}.bi-cc-square:before{content:"\f7e9"}.bi-cup-hot-fill:before{content:"\f7ea"}.bi-cup-hot:before{content:"\f7eb"}.bi-currency-rupee:before{content:"\f7ec"}.bi-dropbox:before{content:"\f7ed"}.bi-escape:before{content:"\f7ee"}.bi-fast-forward-btn-fill:before{content:"\f7ef"}.bi-fast-forward-btn:before{content:"\f7f0"}.bi-fast-forward-circle-fill:before{content:"\f7f1"}.bi-fast-forward-circle:before{content:"\f7f2"}.bi-fast-forward-fill:before{content:"\f7f3"}.bi-fast-forward:before{content:"\f7f4"}.bi-filetype-sql:before{content:"\f7f5"}.bi-fire:before{content:"\f7f6"}.bi-google-play:before{content:"\f7f7"}.bi-h-circle-fill:before{content:"\f7fa"}.bi-h-circle:before{content:"\f7fb"}.bi-h-square-fill:before{content:"\f7fc"}.bi-h-square:before{content:"\f7fd"}.bi-indent:before{content:"\f7fe"}.bi-lungs-fill:before{content:"\f7ff"}.bi-lungs:before{content:"\f800"}.bi-microsoft-teams:before{content:"\f801"}.bi-p-circle-fill:before{content:"\f804"}.bi-p-circle:before{content:"\f805"}.bi-p-square-fill:before{content:"\f806"}.bi-p-square:before{content:"\f807"}.bi-pass-fill:before{content:"\f808"}.bi-pass:before{content:"\f809"}.bi-prescription:before{content:"\f80a"}.bi-prescription2:before{content:"\f80b"}.bi-r-circle-fill:before{content:"\f80e"}.bi-r-circle:before{content:"\f80f"}.bi-r-square-fill:before{content:"\f810"}.bi-r-square:before{content:"\f811"}.bi-repeat-1:before{content:"\f812"}.bi-repeat:before{content:"\f813"}.bi-rewind-btn-fill:before{content:"\f814"}.bi-rewind-btn:before{content:"\f815"}.bi-rewind-circle-fill:before{content:"\f816"}.bi-rewind-circle:before{content:"\f817"}.bi-rewind-fill:before{content:"\f818"}.bi-rewind:before{content:"\f819"}.bi-train-freight-front-fill:before{content:"\f81a"}.bi-train-freight-front:before{content:"\f81b"}.bi-train-front-fill:before{content:"\f81c"}.bi-train-front:before{content:"\f81d"}.bi-train-lightrail-front-fill:before{content:"\f81e"}.bi-train-lightrail-front:before{content:"\f81f"}.bi-truck-front-fill:before{content:"\f820"}.bi-truck-front:before{content:"\f821"}.bi-ubuntu:before{content:"\f822"}.bi-unindent:before{content:"\f823"}.bi-unity:before{content:"\f824"}.bi-universal-access-circle:before{content:"\f825"}.bi-universal-access:before{content:"\f826"}.bi-virus:before{content:"\f827"}.bi-virus2:before{content:"\f828"}.bi-wechat:before{content:"\f829"}.bi-yelp:before{content:"\f82a"}.bi-sign-stop-fill:before{content:"\f82b"}.bi-sign-stop-lights-fill:before{content:"\f82c"}.bi-sign-stop-lights:before{content:"\f82d"}.bi-sign-stop:before{content:"\f82e"}.bi-sign-turn-left-fill:before{content:"\f82f"}.bi-sign-turn-left:before{content:"\f830"}.bi-sign-turn-right-fill:before{content:"\f831"}.bi-sign-turn-right:before{content:"\f832"}.bi-sign-turn-slight-left-fill:before{content:"\f833"}.bi-sign-turn-slight-left:before{content:"\f834"}.bi-sign-turn-slight-right-fill:before{content:"\f835"}.bi-sign-turn-slight-right:before{content:"\f836"}.bi-sign-yield-fill:before{content:"\f837"}.bi-sign-yield:before{content:"\f838"}.bi-ev-station-fill:before{content:"\f839"}.bi-ev-station:before{content:"\f83a"}.bi-fuel-pump-diesel-fill:before{content:"\f83b"}.bi-fuel-pump-diesel:before{content:"\f83c"}.bi-fuel-pump-fill:before{content:"\f83d"}.bi-fuel-pump:before{content:"\f83e"}.bi-0-circle-fill:before{content:"\f83f"}.bi-0-circle:before{content:"\f840"}.bi-0-square-fill:before{content:"\f841"}.bi-0-square:before{content:"\f842"}.bi-rocket-fill:before{content:"\f843"}.bi-rocket-takeoff-fill:before{content:"\f844"}.bi-rocket-takeoff:before{content:"\f845"}.bi-rocket:before{content:"\f846"}.bi-stripe:before{content:"\f847"}.bi-subscript:before{content:"\f848"}.bi-superscript:before{content:"\f849"}.bi-trello:before{content:"\f84a"}.bi-envelope-at-fill:before{content:"\f84b"}.bi-envelope-at:before{content:"\f84c"}.bi-regex:before{content:"\f84d"}.bi-text-wrap:before{content:"\f84e"}.bi-sign-dead-end-fill:before{content:"\f84f"}.bi-sign-dead-end:before{content:"\f850"}.bi-sign-do-not-enter-fill:before{content:"\f851"}.bi-sign-do-not-enter:before{content:"\f852"}.bi-sign-intersection-fill:before{content:"\f853"}.bi-sign-intersection-side-fill:before{content:"\f854"}.bi-sign-intersection-side:before{content:"\f855"}.bi-sign-intersection-t-fill:before{content:"\f856"}.bi-sign-intersection-t:before{content:"\f857"}.bi-sign-intersection-y-fill:before{content:"\f858"}.bi-sign-intersection-y:before{content:"\f859"}.bi-sign-intersection:before{content:"\f85a"}.bi-sign-merge-left-fill:before{content:"\f85b"}.bi-sign-merge-left:before{content:"\f85c"}.bi-sign-merge-right-fill:before{content:"\f85d"}.bi-sign-merge-right:before{content:"\f85e"}.bi-sign-no-left-turn-fill:before{content:"\f85f"}.bi-sign-no-left-turn:before{content:"\f860"}.bi-sign-no-parking-fill:before{content:"\f861"}.bi-sign-no-parking:before{content:"\f862"}.bi-sign-no-right-turn-fill:before{content:"\f863"}.bi-sign-no-right-turn:before{content:"\f864"}.bi-sign-railroad-fill:before{content:"\f865"}.bi-sign-railroad:before{content:"\f866"}.bi-building-add:before{content:"\f867"}.bi-building-check:before{content:"\f868"}.bi-building-dash:before{content:"\f869"}.bi-building-down:before{content:"\f86a"}.bi-building-exclamation:before{content:"\f86b"}.bi-building-fill-add:before{content:"\f86c"}.bi-building-fill-check:before{content:"\f86d"}.bi-building-fill-dash:before{content:"\f86e"}.bi-building-fill-down:before{content:"\f86f"}.bi-building-fill-exclamation:before{content:"\f870"}.bi-building-fill-gear:before{content:"\f871"}.bi-building-fill-lock:before{content:"\f872"}.bi-building-fill-slash:before{content:"\f873"}.bi-building-fill-up:before{content:"\f874"}.bi-building-fill-x:before{content:"\f875"}.bi-building-fill:before{content:"\f876"}.bi-building-gear:before{content:"\f877"}.bi-building-lock:before{content:"\f878"}.bi-building-slash:before{content:"\f879"}.bi-building-up:before{content:"\f87a"}.bi-building-x:before{content:"\f87b"}.bi-buildings-fill:before{content:"\f87c"}.bi-buildings:before{content:"\f87d"}.bi-bus-front-fill:before{content:"\f87e"}.bi-bus-front:before{content:"\f87f"}.bi-ev-front-fill:before{content:"\f880"}.bi-ev-front:before{content:"\f881"}.bi-globe-americas:before{content:"\f882"}.bi-globe-asia-australia:before{content:"\f883"}.bi-globe-central-south-asia:before{content:"\f884"}.bi-globe-europe-africa:before{content:"\f885"}.bi-house-add-fill:before{content:"\f886"}.bi-house-add:before{content:"\f887"}.bi-house-check-fill:before{content:"\f888"}.bi-house-check:before{content:"\f889"}.bi-house-dash-fill:before{content:"\f88a"}.bi-house-dash:before{content:"\f88b"}.bi-house-down-fill:before{content:"\f88c"}.bi-house-down:before{content:"\f88d"}.bi-house-exclamation-fill:before{content:"\f88e"}.bi-house-exclamation:before{content:"\f88f"}.bi-house-gear-fill:before{content:"\f890"}.bi-house-gear:before{content:"\f891"}.bi-house-lock-fill:before{content:"\f892"}.bi-house-lock:before{content:"\f893"}.bi-house-slash-fill:before{content:"\f894"}.bi-house-slash:before{content:"\f895"}.bi-house-up-fill:before{content:"\f896"}.bi-house-up:before{content:"\f897"}.bi-house-x-fill:before{content:"\f898"}.bi-house-x:before{content:"\f899"}.bi-person-add:before{content:"\f89a"}.bi-person-down:before{content:"\f89b"}.bi-person-exclamation:before{content:"\f89c"}.bi-person-fill-add:before{content:"\f89d"}.bi-person-fill-check:before{content:"\f89e"}.bi-person-fill-dash:before{content:"\f89f"}.bi-person-fill-down:before{content:"\f8a0"}.bi-person-fill-exclamation:before{content:"\f8a1"}.bi-person-fill-gear:before{content:"\f8a2"}.bi-person-fill-lock:before{content:"\f8a3"}.bi-person-fill-slash:before{content:"\f8a4"}.bi-person-fill-up:before{content:"\f8a5"}.bi-person-fill-x:before{content:"\f8a6"}.bi-person-gear:before{content:"\f8a7"}.bi-person-lock:before{content:"\f8a8"}.bi-person-slash:before{content:"\f8a9"}.bi-person-up:before{content:"\f8aa"}.bi-scooter:before{content:"\f8ab"}.bi-taxi-front-fill:before{content:"\f8ac"}.bi-taxi-front:before{content:"\f8ad"}.bi-amd:before{content:"\f8ae"}.bi-database-add:before{content:"\f8af"}.bi-database-check:before{content:"\f8b0"}.bi-database-dash:before{content:"\f8b1"}.bi-database-down:before{content:"\f8b2"}.bi-database-exclamation:before{content:"\f8b3"}.bi-database-fill-add:before{content:"\f8b4"}.bi-database-fill-check:before{content:"\f8b5"}.bi-database-fill-dash:before{content:"\f8b6"}.bi-database-fill-down:before{content:"\f8b7"}.bi-database-fill-exclamation:before{content:"\f8b8"}.bi-database-fill-gear:before{content:"\f8b9"}.bi-database-fill-lock:before{content:"\f8ba"}.bi-database-fill-slash:before{content:"\f8bb"}.bi-database-fill-up:before{content:"\f8bc"}.bi-database-fill-x:before{content:"\f8bd"}.bi-database-fill:before{content:"\f8be"}.bi-database-gear:before{content:"\f8bf"}.bi-database-lock:before{content:"\f8c0"}.bi-database-slash:before{content:"\f8c1"}.bi-database-up:before{content:"\f8c2"}.bi-database-x:before{content:"\f8c3"}.bi-database:before{content:"\f8c4"}.bi-houses-fill:before{content:"\f8c5"}.bi-houses:before{content:"\f8c6"}.bi-nvidia:before{content:"\f8c7"}.bi-person-vcard-fill:before{content:"\f8c8"}.bi-person-vcard:before{content:"\f8c9"}.bi-sina-weibo:before{content:"\f8ca"}.bi-tencent-qq:before{content:"\f8cb"}.bi-wikipedia:before{content:"\f8cc"}.bi-alphabet-uppercase:before{content:"\f2a5"}.bi-alphabet:before{content:"\f68a"}.bi-amazon:before{content:"\f68d"}.bi-arrows-collapse-vertical:before{content:"\f690"}.bi-arrows-expand-vertical:before{content:"\f695"}.bi-arrows-vertical:before{content:"\f698"}.bi-arrows:before{content:"\f6a2"}.bi-ban-fill:before{content:"\f6a3"}.bi-ban:before{content:"\f6b6"}.bi-bing:before{content:"\f6c2"}.bi-cake:before{content:"\f6e0"}.bi-cake2:before{content:"\f6ed"}.bi-cookie:before{content:"\f6ee"}.bi-copy:before{content:"\f759"}.bi-crosshair:before{content:"\f769"}.bi-crosshair2:before{content:"\f794"}.bi-emoji-astonished-fill:before{content:"\f795"}.bi-emoji-astonished:before{content:"\f79a"}.bi-emoji-grimace-fill:before{content:"\f79b"}.bi-emoji-grimace:before{content:"\f7a0"}.bi-emoji-grin-fill:before{content:"\f7a1"}.bi-emoji-grin:before{content:"\f7a6"}.bi-emoji-surprise-fill:before{content:"\f7a7"}.bi-emoji-surprise:before{content:"\f7ac"}.bi-emoji-tear-fill:before{content:"\f7ad"}.bi-emoji-tear:before{content:"\f7b2"}.bi-envelope-arrow-down-fill:before{content:"\f7b3"}.bi-envelope-arrow-down:before{content:"\f7b8"}.bi-envelope-arrow-up-fill:before{content:"\f7b9"}.bi-envelope-arrow-up:before{content:"\f7be"}.bi-feather:before{content:"\f7bf"}.bi-feather2:before{content:"\f7c4"}.bi-floppy-fill:before{content:"\f7c5"}.bi-floppy:before{content:"\f7d8"}.bi-floppy2-fill:before{content:"\f7d9"}.bi-floppy2:before{content:"\f7e4"}.bi-gitlab:before{content:"\f7e5"}.bi-highlighter:before{content:"\f7f8"}.bi-marker-tip:before{content:"\f802"}.bi-nvme-fill:before{content:"\f803"}.bi-nvme:before{content:"\f80c"}.bi-opencollective:before{content:"\f80d"}.bi-pci-card-network:before{content:"\f8cd"}.bi-pci-card-sound:before{content:"\f8ce"}.bi-radar:before{content:"\f8cf"}.bi-send-arrow-down-fill:before{content:"\f8d0"}.bi-send-arrow-down:before{content:"\f8d1"}.bi-send-arrow-up-fill:before{content:"\f8d2"}.bi-send-arrow-up:before{content:"\f8d3"}.bi-sim-slash-fill:before{content:"\f8d4"}.bi-sim-slash:before{content:"\f8d5"}.bi-sourceforge:before{content:"\f8d6"}.bi-substack:before{content:"\f8d7"}.bi-threads-fill:before{content:"\f8d8"}.bi-threads:before{content:"\f8d9"}.bi-transparency:before{content:"\f8da"}.bi-twitter-x:before{content:"\f8db"}.bi-type-h4:before{content:"\f8dc"}.bi-type-h5:before{content:"\f8dd"}.bi-type-h6:before{content:"\f8de"}.bi-backpack-fill:before{content:"\f8df"}.bi-backpack:before{content:"\f8e0"}.bi-backpack2-fill:before{content:"\f8e1"}.bi-backpack2:before{content:"\f8e2"}.bi-backpack3-fill:before{content:"\f8e3"}.bi-backpack3:before{content:"\f8e4"}.bi-backpack4-fill:before{content:"\f8e5"}.bi-backpack4:before{content:"\f8e6"}.bi-brilliance:before{content:"\f8e7"}.bi-cake-fill:before{content:"\f8e8"}.bi-cake2-fill:before{content:"\f8e9"}.bi-duffle-fill:before{content:"\f8ea"}.bi-duffle:before{content:"\f8eb"}.bi-exposure:before{content:"\f8ec"}.bi-gender-neuter:before{content:"\f8ed"}.bi-highlights:before{content:"\f8ee"}.bi-luggage-fill:before{content:"\f8ef"}.bi-luggage:before{content:"\f8f0"}.bi-mailbox-flag:before{content:"\f8f1"}.bi-mailbox2-flag:before{content:"\f8f2"}.bi-noise-reduction:before{content:"\f8f3"}.bi-passport-fill:before{content:"\f8f4"}.bi-passport:before{content:"\f8f5"}.bi-person-arms-up:before{content:"\f8f6"}.bi-person-raised-hand:before{content:"\f8f7"}.bi-person-standing-dress:before{content:"\f8f8"}.bi-person-standing:before{content:"\f8f9"}.bi-person-walking:before{content:"\f8fa"}.bi-person-wheelchair:before{content:"\f8fb"}.bi-shadows:before{content:"\f8fc"}.bi-suitcase-fill:before{content:"\f8fd"}.bi-suitcase-lg-fill:before{content:"\f8fe"}.bi-suitcase-lg:before{content:"\f8ff"}.bi-suitcase:before{content:"\f900"}.bi-suitcase2-fill:before{content:"\f901"}.bi-suitcase2:before{content:"\f902"}.bi-vignette:before{content:"\f903"}.navbar,.bg-primary{background:linear-gradient(45deg,#ff2600,#440064)}html,body{height:100vh}body{display:flex;flex-direction:column;flex-wrap:nowrap}header{flex-shrink:0;flex-grow:0}main{flex-shrink:0;flex-grow:1;margin-bottom:auto;margin-top:0}footer{flex-shrink:0;flex-grow:0;margin-bottom:0;margin-top:auto}.squared{width:100%;padding-top:100%;position:relative}.squared>*{position:absolute;top:0;left:0;width:100%;height:100%}