diff --git a/6.1curlcommands.md b/6.1curlcommands.md
index efb2605..29c7e18 100644
--- a/6.1curlcommands.md
+++ b/6.1curlcommands.md
@@ -1753,5 +1753,39 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
]
}'
```
+### Smithsonian Voyager 3D model Previewer (beta)
+__Note:__ Voyager supports multiple formats. Only *.glb (model/gltf-binary) is currently supported by the Previewer.
+Also note that with current styling the Voyager app fills the window when launched as a separate page, so the usual
+preview header/footer information doesn't show (and therefore isn't even requested from Dataverse).
+
+```bash
+curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
+'{
+ "displayName":"View 3D model",
+ "description":"Explore the 3D model file using Voyager.",
+ "toolName":"voyagerPreviewer",
+ "scope":"file",
+ "types":["preview"],
+ "toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/VoyagerPreview.html",
+ "toolParameters": {
+ "queryParameters":[
+ {"fileid":"{fileId}"},
+ {"siteUrl":"{siteUrl}"},
+ {"datasetid":"{datasetId}"},
+ {"datasetversion":"{datasetVersion}"},
+ {"locale":"{localeCode}"}
+ ]
+ },
+ "contentType":"model/gltf-binary",
+ "allowedApiCalls": [
+ {
+ "name": "retrieveFileContents",
+ "httpMethod": "GET",
+ "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
+ "timeOut": 3600
+ }
+ ]
+}'
+```
diff --git a/README.md b/README.md
index b2162bc..a68561e 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,8 @@ The image previewer only works with image/tiff files on some browsers (as of ~Ja
The original tools were developed through the [Qualitative Data Repository](https://qdr.syr.edu) but are being offered to the Dataverse community at large.
-[qqmyers](https://github.com/qqmyers) - developer of the original previewer framework, contributions to the Rich Html Previewer
+[qqmyers](https://github.com/qqmyers) - developer of the original previewer framework, contributions to the Rich Html Previewer, Voyager Previewer, updating to use signed URLs
+
The Spreadsheet Previewer was contributed by [anncie-pcss](https://github.com/anncie-pcss).
[pdurbin](https://github.com/pdurbin) updated the retriever.js script to allow previewers to be embedded directly in the Dataverse file pages.
diff --git a/previewers/betatest/VoyagerPreview.html b/previewers/betatest/VoyagerPreview.html
new file mode 100644
index 0000000..397117c
--- /dev/null
+++ b/previewers/betatest/VoyagerPreview.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+ Voyager 3D Preview
+
+
+
+
+
+
+
+
+
+
+
+ Voyager Explorer v0.12.3
+
+
+
+
+
+
+
+ Voyager 3D Preview
+
+
+
+
+
\ No newline at end of file
diff --git a/previewers/betatest/js/voyager.js b/previewers/betatest/js/voyager.js
new file mode 100644
index 0000000..452fc9a
--- /dev/null
+++ b/previewers/betatest/js/voyager.js
@@ -0,0 +1,21 @@
+$(document).ready(function() {
+ startPreview(false);
+});
+
+function translateBaseHtmlPage() {
+ var videoPreviewText = $.i18n("videoPreviewText");
+ $('.videoPreviewText').text(videoPreviewText);
+}
+
+function writeContent(fileUrl, file, title, authors) {
+ // Currently the styling of Voyager hides this info anyway.
+ // addStandardPreviewHeader(file, title, authors);
+ const lastIndexOfChar = fileUrl.lastIndexOf("/");
+ const rootUrl = fileUrl.substring(0, lastIndexOfChar + 1);
+ const fileName = fileUrl.substring(lastIndexOfChar + 1);
+ console.log(fileUrl);
+ $("voyager-explorer").attr("root", rootUrl).attr("model", fileName);
+ //For Dataverse 6.4+, this can use the standard script:
+ //$.getScript("https://3d-api.si.edu/resources/js/v0.42.1/voyager-explorer.min.js");
+ $.getScript("lib/voyager-explorer.v0.42.1.gdcc.min.js");
+}
\ No newline at end of file
diff --git a/previewers/betatest/lib/voyager-explorer.v0.42.1.gdcc.min.js b/previewers/betatest/lib/voyager-explorer.v0.42.1.gdcc.min.js
new file mode 100644
index 0000000..513fe00
--- /dev/null
+++ b/previewers/betatest/lib/voyager-explorer.v0.42.1.gdcc.min.js
@@ -0,0 +1,381 @@
+/*! For license information please see voyager-explorer.min.js.LICENSE.txt */
+(()=>{var e={93523:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n\n// #include \n// replaced with\nvarying vec2 vUv;\n\n//#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include \n\n vec2 coords = vUv * 2.0 - 1.0;\n float f = dot(coords, coords);\n\tgl_FragColor = vec4(outgoingLight, mix(diffuseColor.a, 0.0, f));\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n\n"},62001:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include \n\n//#include \n// replaced with\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\n//#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t// replaced with\n\tvUv = ( vec3( uv, 1 ) ).xy;\n\n\t//#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n\n"},8669:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="//#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\n\nvarying vec3 vViewPosition;\n\n\n#include \n#include \n#include \n#include \n\n#include \n\n// Zone map support\n#if defined(USE_ZONEMAP)\n\tvarying vec2 vZoneUv;\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef USE_ZONEMAP\n\tuniform sampler2D zoneMap;\n#endif\n\n#ifdef USE_AOMAP\n uniform vec3 aoMapMix;\n#endif\n\n#ifdef MODE_XRAY\n varying float vIntensity;\n#endif\n\n#ifdef CUT_PLANE\n\t#if !defined(USE_TRANSMISSION)\n \tvarying vec3 vWorldPosition;\n\t#endif\n uniform vec4 cutPlaneDirection;\n uniform vec3 cutPlaneColor;\n#endif\n\nvoid main() {\n #ifdef CUT_PLANE\n if (dot(vWorldPosition, cutPlaneDirection.xyz) < -cutPlaneDirection.w) {\n discard;\n }\n #endif\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#ifdef CUT_PLANE\n\t // on the cut surface (back facing fragments revealed), replace normal with cut plane direction\n if (!gl_FrontFacing) {\n normal = -cutPlaneDirection.xyz;\n diffuseColor.rgb = cutPlaneColor.rgb;\n }\n\t#endif\n\n #include \n #include \n #include \n\t\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t//#include \n\t// REPLACED WITH\n\t#ifdef USE_AOMAP\n\t // if cut plane is enabled, disable ambient occlusion on back facing fragments\n\t #ifdef CUT_PLANE\n if (gl_FrontFacing) {\n\t #endif\n\n \t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n \tvec3 aoSample = vec3(texture2D(aoMap, vAoMapUv).r,texture2D(aoMap, vAoMapUv).r,texture2D(aoMap, vAoMapUv).r);\n \tvec3 aoFactors = mix(vec3(1.0), aoSample, clamp(aoMapMix * aoMapIntensity, 0.0, 1.0));\n \tfloat ambientOcclusion = aoFactors.x * aoFactors.y * aoFactors.z;\n \tfloat ambientOcclusion2 = ambientOcclusion * ambientOcclusion;\n \treflectedLight.directDiffuse *= ambientOcclusion2;\n \treflectedLight.directSpecular *= ambientOcclusion;\n \t//reflectedLight.indirectDiffuse *= ambientOcclusion;\n\n \t#if defined( USE_CLEARCOAT ) \n\t\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t\t#endif\n\n\t\t#if defined( USE_SHEEN ) \n\t\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t\t#endif\n\n\t\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n\t\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\n\t\t#endif\n\n \t#ifdef CUT_PLANE\n \t }\n \t#endif\n #endif\n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include \n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n #ifdef USE_SHEEN\n\n\t\t// Sheen energy compensation approximation calculation can be found at the end of\n\t\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\n\t#endif\n\n\t#ifdef CUT_PLANE\n\tif (!gl_FrontFacing) {\n\t\toutgoingLight = cutPlaneColor.rgb;\n\t}\n\t#endif\n\n\t#include \n\n\t#ifdef USE_ZONEMAP\n\t\tvec4 zoneColor = texture2D(zoneMap, vZoneUv);\n\t\tgl_FragColor += mix(vec4(0.0, 0.0, 0.0, 1.0), vec4(zoneColor.rgb, 1.0), zoneColor.a);\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n #ifdef MODE_NORMALS\n gl_FragColor = vec4(vec3(normal * 0.5 + 0.5), 1.0);\n #endif\n\n #ifdef MODE_XRAY\n gl_FragColor = vec4(vec3(0.4, 0.7, 1.0) * vIntensity, 1.0);\n #endif\n}\n"},9849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="//#define PHYSICAL\n//#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#if defined(USE_TRANSMISSION) || defined(CUT_PLANE)\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n// Zone map support\n#if defined(USE_ZONEMAP)\t\n\tvarying vec2 vZoneUv;\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef MODE_XRAY\n varying float vIntensity;\n#endif\n\n//#ifdef CUT_PLANE\n// varying vec3 vWorldPosition;\n//#endif\n\nvoid main() {\n\n\t#include \n\n// Zone map support\n#if defined(USE_ZONEMAP)\n\t#if defined(USE_MAP)\n\t\tvZoneUv = (mapTransform * vec3(vMapUv, 1)).xy;\n\t#else\n\t\tvZoneUv = uv;\n\t#endif\n#endif\n\n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#ifdef MODE_XRAY\n vIntensity = pow(abs(1.0 - abs(dot(vNormal, vec3(0.0, 0.0, 1.0)))), 3.0);\n#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t// #include \n\t// REPLACED WITH\n\t#if defined(USE_ENVMAP) || defined(DISTANCE) || defined(USE_SHADOWMAP) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 || defined(CUT_PLANE)\n \tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #endif\n\n\t#include \n\t#include \n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n\n#ifdef CUT_PLANE\n vWorldPosition = worldPosition.xyz / worldPosition.w;\n#endif\n\n#ifdef MODE_NORMALS\n vNormal = normal;\n#endif\n}"},75310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const i=n(72206),s=n(610),r=n(73348),o=n(90360),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.default{_addVocabularies(){super._addVocabularies(),s.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var h=n(43750);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var d=n(56110);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},6657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=i;class s extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const n=[e[0]];let i=0;for(;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const i=n(6657),s=n(32715);var r=n(6657);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var o=n(32715);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?s.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=L(this.rhs,e,t),this}get names(){return R(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class h extends c{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class m extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=L(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let i=n.length;for(;i--;){const s=n[i];s.optimizeNames(e,t)||(N(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>P(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends f{}class y extends g{}y.kind="else";class b extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(D(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=L(this.condition,e,t),this}get names(){const e=super.names;return R(e,this.condition),this.else&&P(e,this.else.names),e}}b.kind="if";class _ extends g{}_.kind="for";class x extends _{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=L(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class w extends _{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?s.varKinds.var:this.varKind,{name:n,from:i,to:r}=this;return`for(${t} ${n}=${i}; ${n}<${r}; ${n}++)`+super.render(e)}get names(){const e=R(super.names,this.from);return R(e,this.to)}}class S extends _{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=L(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class M extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}M.kind="func";class E extends f{render(e){return"return "+super.render(e)}}E.kind="return";class T extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,i;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class C extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}C.kind="catch";class A extends g{render(e){return"finally"+super.render(e)}}A.kind="finally";function P(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function R(e,t){return t instanceof i._CodeOrName?P(e,t.names):e}function L(e,t,n){return e instanceof i.Name?r(e):(s=e)instanceof i._Code&&s._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==n[e.str]))?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=r(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var s;function r(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function N(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${k(e)}`}t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,i){const s=this._scope.toName(t);return void 0!==n&&i&&(this._constants[s.str]=n),this._leafNode(new l(e,s,n)),s}const(e,t,n){return this._def(s.varKinds.const,e,t,n)}let(e,t,n){return this._def(s.varKinds.let,e,t,n)}var(e,t,n){return this._def(s.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new h(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==i.nil&&this._leafNode(new m(e)),this}object(...e){const t=["{"];for(const[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,s));return t.push("}"),new i._Code(t)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(b,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new x(e),t)}forRange(e,t,n,i,r=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const o=this._scope.toName(e);return this._for(new w(r,o,t,n),(()=>i(o)))}forOf(e,t,n,r=s.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(o,i._`${e}[${t}]`),n(o)}))}return this._for(new S("of",r,o,t),(()=>n(o)))}forIn(e,t,n,r=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const o=this._scope.toName(e);return this._for(new S("in",r,o,t),(()=>n(o)))}endFor(){return this._endBlockNode(_)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new T;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new C(e),t(e)}return n&&(this._currNode=i.finally=new A,this.code(n)),this._endBlockNode(C,A)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=i.nil,n,s){return this._blockNode(new M(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(M)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=D;const I=U(t.operators.AND);t.and=function(...e){return e.reduce(I)};const O=U(t.operators.OR);function U(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${k(t)} ${e} ${k(n)}`}function k(e){return e instanceof i.Name?e:i._`(${e})`}t.or=function(...e){return e.reduce(O)}},32715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const i=n(6657);class s extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${n}]`}}t.ValueScopeName=a;const l=i._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(e),{prefix:s}=i,r=null!==(n=t.key)&&void 0!==n?n:t.ref;let o=this._values[s];if(o){const e=o.get(r);if(e)return e}else o=this._values[s]=new Map;o.set(r,i);const a=this._scope[s]||(this._scope[s]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:s,itemIndex:l}),i}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return i._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,o={},a){let l=i.nil;for(const c in e){const h=e[c];if(!h)continue;const d=o[c]=o[c]||new Map;h.forEach((e=>{if(d.has(e))return;d.set(e,r.Started);let o=n(e);if(o){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==a?void 0:a(e)))throw new s(e);l=i._`${l}${o}${this.opts._n}`}d.set(e,r.Completed)}))}return l}}},16257:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const i=n(56110),s=n(20530),r=n(17748);function o(e,t){const n=e.const("err",t);e.if(i._`${r.default.vErrors} === null`,(()=>e.assign(r.default.vErrors,i._`[${n}]`)),i._`${r.default.vErrors}.push(${n})`),e.code(i._`${r.default.errors}++`)}function a(e,t){const{gen:n,validateName:s,schemaEnv:r}=e;r.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${s}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,s,r){const{it:l}=e,{gen:h,compositeRule:d,allErrors:u}=l,p=c(e,n,s);(null!=r?r:d||u)?o(h,p):a(l,i._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:s}=e,{gen:l,compositeRule:h,allErrors:d}=s;o(l,c(e,n,i)),h||d||a(s,r.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(r.default.errors,t),e.if(i._`${r.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${r.default.vErrors}.length`,t)),(()=>e.assign(r.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:s,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,r.default.errors,(o=>{e.const(l,i._`${r.default.vErrors}[${o}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(r.default.instancePath,a.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(i._`${l}.schema`,n),e.assign(i._`${l}.data`,s))}))};const l={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function c(e,t,n){const{createErrors:s}=e.it;return!1===s?i._`{}`:function(e,t,n={}){const{gen:s,it:o}=e,a=[h(o,n),d(e,n)];return function(e,{params:t,message:n},s){const{keyword:o,data:a,schemaValue:c,it:h}=e,{opts:d,propertyName:u,topSchemaRef:p,schemaPath:m}=h;s.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||i._`{}`]),d.messages&&s.push([l.message,"function"==typeof n?n(e):n]);d.verbose&&s.push([l.schema,c],[l.parentSchema,i._`${p}${m}`],[r.default.data,a]);u&&s.push([l.propertyName,u])}(e,t,a),s.object(...a)}(e,t,n)}function h({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[r.default.instancePath,(0,i.strConcat)(r.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:i.str`${t}/${e}`;return n&&(o=i.str`${o}${(0,s.getErrorPath)(n,s.Type.Str)}`),[l.schemaPath,o]}},59336:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const i=n(56110),s=n(97939),r=n(17748),o=n(66184),a=n(20530),l=n(43750),c=n(55858);class h{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function d(e){const t=p.call(this,e);if(t)return t;const n=(0,o.getFullPath)(e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,d=new i.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let u;e.$async&&(u=d.scopeValue("Error",{ref:s.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const m=d.scopeName("validate");e.validateName=m;const f={gen:d,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(f),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:m,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function u(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function p(e){for(const i of this._compilations)if(n=e,(t=i).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return i;var t,n}function m(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||f.call(this,e,t)}function f(e,t){const n=c.parse(t),i=(0,o._getFullPath)(n);let s=(0,o.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&i===s)return v.call(this,n,e);const r=(0,o.normalizeId)(i),a=this.refs[r]||this.schemas[r];if("string"==typeof a){const t=f.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return v.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||d.call(this,a),r===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,i=t[n];return i&&(s=(0,o.resolveUrl)(s,i)),new h({schema:t,schemaId:n,root:e,baseId:s})}return v.call(this,n,a)}}t.SchemaEnv=h,t.compileSchema=d,t.resolveRef=function(e,t,n){var i;n=(0,o.resolveUrl)(t,n);const s=e.refs[n];if(s)return s;let r=m.call(this,e,n);if(void 0===r){const s=null===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:o}=this.opts;s&&(r=new h({schema:s,schemaId:o,root:e,baseId:t}))}return void 0!==r?e.refs[n]=u.call(this,r):void 0},t.getCompilingSchema=p,t.resolveSchema=f;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v(e,{baseId:t,schema:n,root:i}){var s;if("/"!==(null===(s=e.fragment)||void 0===s?void 0:s[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(i)];if(void 0===e)return;const s="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(i)&&s&&(t=(0,o.resolveUrl)(t,s))}let r;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,o.resolveUrl)(t,n.$ref);r=f.call(this,i,e)}const{schemaId:l}=this.opts;return r=r||new h({schema:n,schemaId:l,root:i,baseId:t}),r.schema!==r.root.schema?r:void 0}},17748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t.default=s},33482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(66184);class s extends Error{constructor(e,t,n){super(n||`can't resolve reference ${t} from id ${e}`),this.missingRef=(0,i.resolveUrl)(e,t),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(this.missingRef))}}t.default=s},66184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const i=n(20530),s=n(28926),r=n(68125),o=n(55858),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&h(e)<=t)};const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(l.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function h(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=h(e))),t===1/0))return 1/0}return t}function d(e="",t){!1!==t&&(e=m(e));return u(o.parse(e))}function u(e){return o.serialize(e).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=u;const p=/#\/?$/;function m(e){return e?e.replace(p,""):""}t.normalizeId=m,t.resolveUrl=function(e,t){return t=m(t),o.resolve(e,t)};const f=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n}=this.opts,i=m(e[n]||t),a={"":i},l=d(i,!1),c={},h=new Set;return r(e,{allKeys:!0},((e,t,i,s)=>{if(void 0===s)return;const r=l+t;let d=a[s];function g(t){if(t=m(d?o.resolve(d,t):t),h.has(t))throw p(t);h.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==m(r)&&("#"===t[0]?(u(e,c[t],t),c[t]=e):this.refs[t]=r),t}function v(e){if("string"==typeof e){if(!f.test(e))throw new Error(`invalid anchor "${e}"`);g.call(this,`#${e}`)}}"string"==typeof e[n]&&(d=g.call(this,e[n])),v.call(this,e.$anchor),v.call(this,e.$dynamicAnchor),a[t]=d})),c;function u(e,t,n){if(void 0!==t&&!s(e,t))throw p(n)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},46754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},20530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const i=n(56110),s=n(6657);function r(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const s=i.RULES.keywords;for(const n in t)s[n]||m(e,`unknown keyword: "${n}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:s}){return(r,o,a,l)=>{const c=void 0===a?o:a instanceof i.Name?(o instanceof i.Name?e(r,o,a):t(r,o,a),a):o instanceof i.Name?(t(r,a,o),o):n(o,a);return l!==i.Name||c instanceof i.Name?c:s(r,c)}}function h(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(i._`${t}${(0,i.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,s,r){if(!r){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(s)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,i._`${n} || {}`).code(i._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,i._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:h}),items:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,i._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>e.assign(n,!0===t||i._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=h,t.setEvaluated=d;const u={};var p;function m(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new s._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof i.Name){const s=t===p.Num;return n?s?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:s?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,i.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=m},87177:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>i(e,t)))}function i(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},i){const s=t.RULES.types[i];return s&&!0!==s&&n(e,s)},t.shouldUseGroup=n,t.shouldUseRule=i},42971:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=n(16257),s=n(56110),r=n(17748),o={message:"boolean schema is false"};function a(e,t){const{gen:n,data:s}=e,r={gen:n,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(r,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:i}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(r.default.data):(t.assign(s._`${i}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:i}=e;!1===i?(n.var(t,!1),a(e)):n.var(t,!0)}},97349:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const i=n(46754),s=n(87177),r=n(16257),o=n(56110),a=n(20530);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:i,opts:r}=e,a=function(e,t){return t?e.filter((e=>h.has(e)||"array"===t&&"array"===e)):[]}(t,r.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(c){const s=u(t,i,r.strictNumbers,l.Wrong);n.if(s,(()=>{a.length?function(e,t,n){const{gen:i,data:s,opts:r}=e,a=i.let("dataType",o._`typeof ${s}`),l=i.let("coerced",o._`undefined`);"array"===r.coerceTypes&&i.if(o._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,(()=>i.assign(s,o._`${s}[0]`).assign(a,o._`typeof ${s}`).if(u(t,s,r.strictNumbers),(()=>i.assign(l,s)))));i.if(o._`${l} !== undefined`);for(const e of n)(h.has(e)||"array"===e&&"array"===r.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${s}`).elseIf(o._`${s} === null`).assign(l,o._`""`);case"number":return void i.elseIf(o._`${a} == "boolean" || ${s} === null
+ || (${a} == "string" && ${s} && ${s} == +${s})`).assign(l,o._`+${s}`);case"integer":return void i.elseIf(o._`${a} === "boolean" || ${s} === null
+ || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(l,o._`+${s}`);case"boolean":return void i.elseIf(o._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(l,!1).elseIf(o._`${s} === "true" || ${s} === 1`).assign(l,!0);case"null":return i.elseIf(o._`${s} === "" || ${s} === 0 || ${s} === false`),void i.assign(l,null);case"array":i.elseIf(o._`${a} === "string" || ${a} === "number"
+ || ${a} === "boolean" || ${s} === null`).assign(l,o._`[${s}]`)}}i.else(),m(e),i.endIf(),i.if(o._`${l} !== undefined`,(()=>{i.assign(s,l),function({gen:e,parentData:t,parentDataProperty:n},i){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${n}]`,i)))}(e,l)}))}(e,t,a):m(e)}))}return c};const h=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,i=l.Correct){const s=i===l.Correct?o.operators.EQ:o.operators.NEQ;let r;switch(e){case"null":return o._`${t} ${s} null`;case"array":r=o._`Array.isArray(${t})`;break;case"object":r=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":r=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":r=a();break;default:return o._`typeof ${t} ${s} ${e}`}return i===l.Correct?r:(0,o.not)(r);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,n?o._`isFinite(${t})`:o.nil)}}function u(e,t,n,i){if(1===e.length)return d(e[0],t,n,i);let s;const r=(0,a.toHash)(e);if(r.array&&r.object){const e=o._`typeof ${t} != "object"`;s=r.null?e:o._`!${t} || ${e}`,delete r.null,delete r.array,delete r.object}else s=o.nil;r.number&&delete r.integer;for(const e in r)s=(0,o.and)(s,d(e,t,n,i));return s}t.checkDataType=d,t.checkDataTypes=u;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function m(e){const t=function(e){const{gen:t,data:n,schema:i}=e,s=(0,a.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:s,schemaValue:s,parentSchema:i,params:{},it:e}}(e);(0,r.reportError)(t,p)}t.reportTypeError=m},15944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const i=n(56110),s=n(20530);function r(e,t,n){const{gen:r,compositeRule:o,data:a,opts:l}=e;if(void 0===n)return;const c=i._`${a}${(0,i.getProperty)(t)}`;if(o)return void(0,s.checkStrictMode)(e,`default is ignored for: ${c}`);let h=i._`${c} === undefined`;"empty"===l.useDefaults&&(h=i._`${h} || ${c} === null || ${c} === ""`),r.if(h,i._`${c} = ${(0,i.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:i}=e.schema;if("object"===t&&n)for(const t in n)r(e,t,n[t].default);else"array"===t&&Array.isArray(i)&&i.forEach(((t,n)=>r(e,n,t.default)))}},43750:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const i=n(42971),s=n(97349),r=n(87177),o=n(97349),a=n(15944),l=n(42e3),c=n(35678),h=n(56110),d=n(17748),u=n(66184),p=n(20530),m=n(16257);function f({gen:e,validateName:t,schema:n,schemaEnv:i,opts:s},r){s.code.es5?e.func(t,h._`${d.default.data}, ${d.default.valCxt}`,i.$async,(()=>{e.code(h._`"use strict"; ${g(n,s)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,h._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,h._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,h._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,h._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,h._`""`),e.var(d.default.parentData,h._`undefined`),e.var(d.default.parentDataProperty,h._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`{}`)}))}(e,s),e.code(r)})):e.func(t,h._`${d.default.data}, ${function(e){return h._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?h._`, ${d.default.dynamicAnchors}={}`:h.nil}}={}`}(s)}`,i.$async,(()=>e.code(g(n,s)).code(r)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?h._`/*# sourceURL=${n} */`:h.nil}function v(e,t){b(e)&&(_(e),y(e))?function(e,t){const{schema:n,gen:i,opts:s}=e;s.$comment&&n.$comment&&w(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const r=i.const("_errs",d.default.errors);x(e,r),i.var(t,h._`${r} === ${d.default.errors}`)}(e,t):(0,i.boolOrEmptySchema)(e,t)}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function _(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:i,self:s}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function x(e,t){if(e.opts.jtd)return S(e,[],!1,t);const n=(0,s.getSchemaTypes)(e.schema);S(e,n,!(0,s.coerceAndCheckDataType)(e,n),t)}function w({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:s}){const r=n.$comment;if(!0===s.$comment)e.code(h._`${d.default.self}.logger.log(${r})`);else if("function"==typeof s.$comment){const n=h.str`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(h._`${d.default.self}.opts.$comment(${r}, ${n}, ${s}.schema)`)}}function S(e,t,n,i){const{gen:s,schema:a,data:l,allErrors:c,opts:u,self:m}=e,{RULES:f}=m;function g(p){(0,r.shouldUseGroup)(a,p)&&(p.type?(s.if((0,o.checkDataType)(p.type,l,u.strictNumbers)),M(e,p),1===t.length&&t[0]===p.type&&n&&(s.else(),(0,o.reportTypeError)(e)),s.endIf()):M(e,p),c||s.if(h._`${d.default.errors} === ${i||0}`))}!a.$ref||!u.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,f)?(u.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{T(e.dataTypes,t)||C(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>T(t,e)))})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&C(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const n=e.self.RULES.all;for(const i in n){const s=n[i];if("object"==typeof s&&(0,r.shouldUseRule)(e.schema,s)){const{type:n}=s.definition;n.length&&!n.some((e=>E(t,e)))&&C(e,`missing type "${n.join(",")}" for keyword "${i}"`)}}}(e,e.dataTypes)}(e,t),s.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):s.block((()=>P(e,"$ref",f.all.$ref.definition)))}function M(e,t){const{gen:n,schema:i,opts:{useDefaults:s}}=e;s&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,r.shouldUseRule)(i,n)&&P(e,n.keyword,n.definition,t.type)}))}function E(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function T(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function C(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(_(e),y(e))?function(e){const{schema:t,opts:n,gen:i}=e;f(e,(()=>{n.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),i.let(d.default.vErrors,null),i.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",h._`${n}.evaluated`),t.if(h._`${e.evaluated}.dynamicProps`,(()=>t.assign(h._`${e.evaluated}.props`,h._`undefined`))),t.if(h._`${e.evaluated}.dynamicItems`,(()=>t.assign(h._`${e.evaluated}.items`,h._`undefined`)))}(e),x(e),function(e){const{gen:t,schemaEnv:n,validateName:i,ValidationError:s,opts:r}=e;n.$async?t.if(h._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(h._`new ${s}(${d.default.vErrors})`))):(t.assign(h._`${i}.errors`,d.default.vErrors),r.unevaluated&&function({gen:e,evaluated:t,props:n,items:i}){n instanceof h.Name&&e.assign(h._`${t}.props`,n);i instanceof h.Name&&e.assign(h._`${t}.items`,i)}(e),t.return(h._`${d.default.errors} === 0`))}(e)}))}(e):f(e,(()=>(0,i.topBoolOrEmptySchema)(e)))};class A{constructor(e,t,n){if((0,l.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",N(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,h.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,h.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(h._`${t} !== undefined && (${(0,h.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?m.reportExtraError:m.reportError)(this,this.def.error,t)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=h.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=h.nil,t=h.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:s,def:r}=this;n.if((0,h.or)(h._`${i} === undefined`,t)),e!==h.nil&&n.assign(e,!0),(s.length||r.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==h.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:i,it:s}=this;return(0,h.or)(function(){if(n.length){if(!(t instanceof h.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return h._`${(0,o.checkDataTypes)(e,t,s.opts.strictNumbers,o.DataType.Wrong)}`}return h.nil}(),function(){if(i.validateSchema){const n=e.scopeValue("validate$data",{ref:i.validateSchema});return h._`!${n}(${t})`}return h.nil}())}subschema(e,t){const n=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(n,this.it,e),(0,c.extendSubschemaMode)(n,e);const i={...this.it,...n,items:void 0,props:void 0};return v(i,t),i}mergeEvaluated(e,t){const{it:n,gen:i}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=p.mergeEvaluated.props(i,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=p.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return i.if(t,(()=>this.mergeEvaluated(e,h.Name))),!0}}function P(e,t,n,i){const s=new A(e,n,t);"code"in n?n.code(s,i):s.$data&&n.validate?(0,l.funcKeywordCode)(s,n):"macro"in n?(0,l.macroKeywordCode)(s,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(s,n)}t.KeywordCxt=A;const R=/^\/(?:[^~]|~0|~1)*$/,L=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let s,r;if(""===e)return d.default.rootData;if("/"===e[0]){if(!R.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,r=d.default.rootData}else{const o=L.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(s=o[2],"#"===s){if(a>=t)throw new Error(l("property/index",a));return i[t-a]}if(a>t)throw new Error(l("data",a));if(r=n[t-a],!s)return r}let o=r;const a=s.split("/");for(const e of a)e&&(r=h._`${r}${(0,h.getProperty)((0,p.unescapeJsonPointer)(e))}`,o=h._`${o} && ${r}`);return o;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=N},42e3:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const i=n(56110),s=n(17748),r=n(57111),o=n(16257);function a(e){const{gen:t,data:n,it:s}=e;t.if(s.parentData,(()=>t.assign(n,i._`${s.parentData}[${s.parentDataProperty}]`)))}function l(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,i.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:s,schema:r,parentSchema:o,it:a}=e,c=t.macro.call(a.self,r,o,a),h=l(n,s,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const d=n.name("valid");e.subschema({schema:c,schemaPath:i.nil,errSchemaPath:`${a.errSchemaPath}/${s}`,topSchemaRef:h,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:c,keyword:h,schema:d,parentSchema:u,$data:p,it:m}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(m,t);const f=!p&&t.compile?t.compile.call(m.self,d,u,m):t.validate,g=l(c,h,f),v=c.let("valid");function y(n=(t.async?i._`await `:i.nil)){const o=m.opts.passContext?s.default.this:s.default.self,a=!("compile"in t&&!p||!1===t.schema);c.assign(v,i._`${n}${(0,r.callValidateCode)(e,g,o,a)}`,t.modifying)}function b(e){var n;c.if((0,i.not)(null!==(n=t.valid)&&void 0!==n?n:v),e)}e.block$data(v,(function(){if(!1===t.errors)y(),t.modifying&&a(e),b((()=>e.error()));else{const n=t.async?function(){const e=c.let("ruleErrs",null);return c.try((()=>y(i._`await `)),(t=>c.assign(v,!1).if(i._`${t} instanceof ${m.ValidationError}`,(()=>c.assign(e,i._`${t}.errors`)),(()=>c.throw(t))))),e}():function(){const e=i._`${g}.errors`;return c.assign(e,null),y(i.nil),e}();t.modifying&&a(e),b((()=>function(e,t){const{gen:n}=e;n.if(i._`Array.isArray(${t})`,(()=>{n.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,i._`${s.default.vErrors}.length`),(0,o.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:v)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:i},s,r){if(Array.isArray(s.keyword)?!s.keyword.includes(r):s.keyword!==r)throw new Error("ajv implementation error");const o=s.dependencies;if(null==o?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${r}: ${o.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[r])){const e=`keyword "${r}" value is invalid at path "${i}": `+n.errorsText(s.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}}},35678:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const i=n(56110),s=n(20530);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==r)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const r=e.schema[t];return void 0===n?{schema:r,schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:r[n],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(n)}`}}if(void 0!==r){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==n){const{errorPath:o,dataPathArr:a,opts:l}=t;h(c.let("data",i._`${t.data}${(0,i.getProperty)(n)}`,!0)),e.errorPath=i.str`${o}${(0,s.getErrorPath)(n,r,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){h(o instanceof i.Name?o:c.let("data",o,!0)),void 0!==l&&(e.propertyName=l)}function h(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:s,allErrors:r}){void 0!==i&&(e.compositeRule=i),void 0!==s&&(e.createErrors=s),void 0!==r&&(e.allErrors=r),e.jtdDiscriminator=t,e.jtdMetadata=n}},72206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var i=n(43750);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return i.KeywordCxt}});var s=n(56110);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const r=n(97939),o=n(33482),a=n(46754),l=n(59336),c=n(56110),h=n(66184),d=n(97349),u=n(20530),p=n(338),m=["removeAdditional","useDefaults","coerceTypes"],f=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,n,i,s,r,o,a,l,c,h,d,u,p,m,f,g,v,y,b,_,x,w;const S=e.strict,M=null===(t=e.code)||void 0===t?void 0:t.optimize,E=!0===M||void 0===M?1:M||0;return{strictSchema:null===(i=null!==(n=e.strictSchema)&&void 0!==n?n:S)||void 0===i||i,strictNumbers:null===(r=null!==(s=e.strictNumbers)&&void 0!==s?s:S)||void 0===r||r,strictTypes:null!==(a=null!==(o=e.strictTypes)&&void 0!==o?o:S)&&void 0!==a?a:"log",strictTuples:null!==(c=null!==(l=e.strictTuples)&&void 0!==l?l:S)&&void 0!==c?c:"log",strictRequired:null!==(d=null!==(h=e.strictRequired)&&void 0!==h?h:S)&&void 0!==d&&d,code:e.code?{...e.code,optimize:E}:{optimize:E},loopRequired:null!==(u=e.loopRequired)&&void 0!==u?u:200,loopEnum:null!==(p=e.loopEnum)&&void 0!==p?p:200,meta:null===(m=e.meta)||void 0===m||m,messages:null===(f=e.messages)||void 0===f||f,inlineRefs:null===(g=e.inlineRefs)||void 0===g||g,schemaId:null!==(v=e.schemaId)&&void 0!==v?v:"$id",addUsedSchema:null===(y=e.addUsedSchema)||void 0===y||y,validateSchema:null===(b=e.validateSchema)||void 0===b||b,validateFormats:null===(_=e.validateFormats)||void 0===_||_,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(w=e.int32range)||void 0===w||w}}class b{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:f,es5:t,lines:n}),this.logger=function(e){if(!1===e)return T;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),_.call(this,g,e,"NOT SUPPORTED"),_.call(this,v,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&M.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let i=p;"id"===n&&(i={...p},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const i=n(t);return"$async"in n||(this.errors=n.errors),i}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return i.call(this,e,t);async function i(e,t){await s.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||r.call(this,n)}async function s(e){e&&!this.getSchema(e)&&await i.call(this,{$ref:e},!0)}async function r(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),r.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const n=await c.call(this,e);this.refs[e]||await s.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,i);return this}let s;if("object"==typeof e){const{schemaId:t}=this.opts;if(s=e[t],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${t} must be string`)}return t=(0,h.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const i=this.validate(n,e);if(!i&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return i}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,h.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(A.call(this,n,t),!t)return(0,u.eachItem)(n,(e=>P.call(this,e))),this;L.call(this,t);const i={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(n,0===i.type.length?e=>P.call(this,e,i):e=>i.type.forEach((t=>P.call(this,e,i,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const i of t){const t=i.split("/").slice(1);let s=e;for(const e of t)s=s[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:i}=t.definition,r=s[e];i&&r&&(s[e]=D(r))}}return e}_removeAllSchemas(e,t){for(const n in e){const i=e[n];t&&!t.test(n)||("string"==typeof i?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let r;const{schemaId:o}=this.opts;if("object"==typeof e)r=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,h.normalizeId)(r||n);const c=h.getSchemaRefs.call(this,e,n);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),i&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function _(e,t,n,i="error"){for(const s in e){const r=s;r in t&&this.logger[i](`${n}: option ${s}. ${e[r]}`)}}function x(e){return e=(0,h.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function M(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function E(){const e={...this.opts};for(const t of m)delete e[t];return e}t.default=b,b.ValidationError=r.default,b.MissingRefError=o.default;const T={log(){},warn(){},error(){}};const C=/^[a-z_$][a-z0-9_$:-]*$/i;function A(e,t){const{RULES:n}=this;if((0,u.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!C.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function P(e,t,n){var i;const s=null==t?void 0:t.post;if(n&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:r}=this;let o=s?r.post:r.rules.find((({type:e})=>e===n));if(o||(o={type:n,rules:[]},r.rules.push(o)),r.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?R.call(this,o,a,t.before):o.rules.push(a),r.all[e]=a,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function R(e,t,n){const i=e.rules.findIndex((e=>e.keyword===n));i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function L(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=D(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D(e){return{anyOf:[e,N]}}},18062:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(28926);i.code='require("ajv/dist/runtime/equal").default',t.default=i},75842:(e,t)=>{"use strict";function n(e){const t=e.length;let n,i=0,s=0;for(;s=55296&&n<=56319&&s{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},81600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const i=n(56110),s=n(20530),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:i}=t;Array.isArray(i)?o(e,i):(0,s.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(e,t){const{gen:n,schema:r,data:o,keyword:a,it:l}=e;l.items=!0;const c=n.const("len",i._`${o}.length`);if(!1===r)e.setParams({len:t.length}),e.pass(i._`${c} <= ${t.length}`);else if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){const r=n.var("valid",i._`${c} <= ${t.length}`);n.if((0,i.not)(r),(()=>function(r){n.forRange("i",t.length,c,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:s.Type.Num},r),l.allErrors||n.if((0,i.not)(r),(()=>n.break()))}))}(r))),e.ok(r)}}t.validateAdditionalItems=o,t.default=r},88183:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(17748),o=n(20530),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>s._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:l,errsCount:c,it:h}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:d,opts:u}=h;if(h.props=!0,"all"!==u.removeAdditional&&(0,o.alwaysValidSchema)(h,n))return;const p=(0,i.allSchemaProperties)(a.properties),m=(0,i.allSchemaProperties)(a.patternProperties);function f(e){t.code(s._`delete ${l}[${e}]`)}function g(i){if("all"===u.removeAdditional||u.removeAdditional&&!1===n)f(i);else{if(!1===n)return e.setParams({additionalProperty:i}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,o.alwaysValidSchema)(h,n)){const n=t.name("valid");"failing"===u.removeAdditional?(v(i,n,!1),t.if((0,s.not)(n),(()=>{e.reset(),f(i)}))):(v(i,n),d||t.if((0,s.not)(n),(()=>t.break())))}}}function v(t,n,i){const s={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===i&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,n)}t.forIn("key",l,(n=>{p.length||m.length?t.if(function(n){let r;if(p.length>8){const e=(0,o.schemaRefOrVal)(h,a.properties,"properties");r=(0,i.isOwnProperty)(t,e,n)}else r=p.length?(0,s.or)(...p.map((e=>s._`${n} === ${e}`))):s.nil;return m.length&&(r=(0,s.or)(r,...m.map((t=>s._`${(0,i.usePattern)(e,t)}.test(${n})`)))),(0,s.not)(r)}(n),(()=>g(n))):g(n)})),e.ok(s._`${c} === ${r.default.errors}`)}};t.default=a},68302:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const r=t.name("valid");n.forEach(((t,n)=>{if((0,i.alwaysValidSchema)(s,t))return;const o=e.subschema({keyword:"allOf",schemaProp:n},r);e.ok(r),e.mergeEvaluated(o)}))}};t.default=s},50120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(57111).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=i},97458:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?i.str`must contain at least ${e} valid item(s)`:i.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?i._`{minContains: ${e}}`:i._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:a}=e;let l,c;const{minContains:h,maxContains:d}=r;a.opts.next?(l=void 0===h?1:h,c=d):l=1;const u=t.const("len",i._`${o}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,s.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,s.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,s.alwaysValidSchema)(a,n)){let t=i._`${u} >= ${l}`;return void 0!==c&&(t=i._`${t} && ${u} <= ${c}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function m(){const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(i._`${e}++`),void 0===c?t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0).break())):(t.if(i._`${e} > ${c}`,(()=>t.assign(p,!1).break())),1===l?t.assign(p,!0):t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0))))}(n)))))}function f(n,i){t.forRange("i",0,u,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:s.Type.Num,compositeRule:!0},n),i()}))}void 0===c&&1===l?f(p,(()=>t.if(p,(()=>t.break())))):(t.let(p,!1),0===l?t.if(i._`${o}.length > 0`,m,(()=>t.assign(p,!0))):m()),e.result(p,(()=>e.reset()))}};t.default=r},32790:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const i=n(56110),s=n(20530),r=n(57111);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const s=1===t?"property":"properties";return i.str`must have ${s} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:s}})=>i._`{property: ${e},
+ missingProperty: ${s},
+ depsCount: ${t},
+ deps: ${n}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const i in e){if("__proto__"===i)continue;(Array.isArray(e[i])?t:n)[i]=e[i]}return[t,n]}(e);a(e,t),l(e,n)}};function a(e,t=e.schema){const{gen:n,data:s,it:o}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const h=(0,r.propertyInData)(n,s,l,o.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),o.allErrors?n.if(h,(()=>{for(const t of c)(0,r.checkReportMissingProp)(e,t)})):(n.if(i._`${h} && (${(0,r.checkMissingProp)(e,c,a)})`),(0,r.reportMissingProp)(e,a),n.else())}}function l(e,t=e.schema){const{gen:n,data:i,keyword:o,it:a}=e,l=n.name("valid");for(const c in t)(0,s.alwaysValidSchema)(a,t[c])||(n.if((0,r.propertyInData)(n,i,c,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:o,schemaProp:c},l);e.mergeValidEvaluated(t,l)}),(()=>n.var(l,!0))),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=o},17498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>i.str`must match "${e.ifClause}" schema`,params:({params:e})=>i._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:r}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const a=o(r,"then"),l=o(r,"else");if(!a&&!l)return;const c=t.let("valid",!0),h=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(t)}(),e.reset(),a&&l){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(h,d("then",n),d("else",n))}else a?t.if(h,d("then")):t.if((0,i.not)(h),d("else"));function d(n,s){return()=>{const r=e.subschema({keyword:n},h);t.assign(c,h),e.mergeValidEvaluated(r,c),s?t.assign(s,i._`${n}`):e.setParams({ifClause:n})}}e.pass(c,(()=>e.error(!0)))}};function o(e,t){const n=e.schema[t];return void 0!==n&&!(0,s.alwaysValidSchema)(e,n)}t.default=r},3698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(81600),s=n(53609),r=n(38223),o=n(62490),a=n(97458),l=n(32790),c=n(13796),h=n(88183),d=n(11935),u=n(98289),p=n(62514),m=n(50120),f=n(16328),g=n(68302),v=n(17498),y=n(96105);t.default=function(e=!1){const t=[p.default,m.default,f.default,g.default,v.default,y.default,c.default,h.default,l.default,d.default,u.default];return e?t.push(s.default,o.default):t.push(i.default,r.default),t.push(a.default),t}},38223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const i=n(56110),s=n(20530),r=n(57111),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,s.alwaysValidSchema)(n,t)||e.ok((0,r.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:r,parentSchema:o,data:a,keyword:l,it:c}=e;!function(e){const{opts:i,errSchemaPath:r}=c,o=n.length,a=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(i.strictTuples&&!a){const e=`"${l}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${r}"`;(0,s.checkStrictMode)(c,e,i.strictTuples)}}(o),c.opts.unevaluated&&n.length&&!0!==c.items&&(c.items=s.mergeEvaluated.items(r,n.length,c.items));const h=r.name("valid"),d=r.const("len",i._`${a}.length`);n.forEach(((t,n)=>{(0,s.alwaysValidSchema)(c,t)||(r.if(i._`${d} > ${n}`,(()=>e.subschema({keyword:l,schemaProp:n,dataProp:n},h))),e.ok(h))}))}t.validateTuple=a,t.default=o},62490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(57111),o=n(81600),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:i}=e,{prefixItems:a}=n;i.items=!0,(0,s.alwaysValidSchema)(i,t)||(a?(0,o.validateAdditionalItems)(e,a):e.ok((0,r.validateArray)(e)))}};t.default=a},62514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:s}=e;if((0,i.alwaysValidSchema)(s,n))return void e.fail();const r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=s},16328:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>i._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const a=n,l=t.let("valid",!1),c=t.let("passing",null),h=t.name("_valid");e.setParams({passing:c}),t.block((function(){a.forEach(((n,r)=>{let a;(0,s.alwaysValidSchema)(o,n)?t.var(h,!0):a=e.subschema({keyword:"oneOf",schemaProp:r,compositeRule:!0},h),r>0&&t.if(i._`${h} && ${l}`).assign(l,!1).assign(c,i._`[${c}, ${r}]`).else(),t.if(h,(()=>{t.assign(l,!0),t.assign(c,r),a&&e.mergeEvaluated(a,i.Name)}))}))})),e.result(l,(()=>e.reset()),(()=>e.error(!0)))}};t.default=r},98289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(20530),o=n(20530),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:l,it:c}=e,{opts:h}=c,d=(0,i.allSchemaProperties)(n),u=d.filter((e=>(0,r.alwaysValidSchema)(c,n[e])));if(0===d.length||u.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;const p=h.strictSchema&&!h.allowMatchingProperties&&l.properties,m=t.name("valid");!0===c.props||c.props instanceof s.Name||(c.props=(0,o.evaluatedPropsToName)(t,c.props));const{props:f}=c;function g(e){for(const t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(n){t.forIn("key",a,(r=>{t.if(s._`${(0,i.usePattern)(e,n)}.test(${r})`,(()=>{const i=u.includes(n);i||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:r,dataPropType:o.Type.Str},m),c.opts.unevaluated&&!0!==f?t.assign(s._`${f}[${r}]`,!0):i||c.allErrors||t.if((0,s.not)(m),(()=>t.break()))}))}))}!function(){for(const e of d)p&&g(e),c.allErrors?v(e):(t.var(m,!0),v(e),t.if(m))}()}};t.default=a},53609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(38223),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,i.validateTuple)(e,"items")};t.default=s},11935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(43750),s=n(57111),r=n(20530),o=n(88183),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&o.default.code(new i.KeywordCxt(c,o.default,"additionalProperties"));const h=(0,s.allSchemaProperties)(n);for(const e of h)c.definedProperties.add(e);c.opts.unevaluated&&h.length&&!0!==c.props&&(c.props=r.mergeEvaluated.props(t,(0,r.toHash)(h),c.props));const d=h.filter((e=>!(0,r.alwaysValidSchema)(c,n[e])));if(0===d.length)return;const u=t.name("valid");for(const n of d)p(n)?m(n):(t.if((0,s.propertyInData)(t,l,n,c.opts.ownProperties)),m(n),c.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(u);function p(e){return c.opts.useDefaults&&!c.compositeRule&&void 0!==n[e].default}function m(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},u)}}};t.default=a},13796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>i._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,s.alwaysValidSchema)(o,n))return;const a=t.name("valid");t.forIn("key",r,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,i.not)(a),(()=>{e.error(!0),o.allErrors||t.break()}))})),e.ok(a)}};t.default=r},96105:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,i.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=s},57111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const i=n(56110),s=n(20530),r=n(17748);function o(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:i._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return i._`${o(e)}.call(${t}, ${n})`}function l(e,t,n,s){const r=i._`${t}${(0,i.getProperty)(n)} === undefined`;return s?(0,i.or)(r,(0,i.not)(a(e,t,n))):r}function c(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:s,it:r}=e;n.if(l(n,s,t,r.opts.ownProperties),(()=>{e.setParams({missingProperty:i._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},s,r){return(0,i.or)(...s.map((s=>(0,i.and)(l(e,t,s,n.ownProperties),i._`${r} = ${s}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=o,t.isOwnProperty=a,t.propertyInData=function(e,t,n,s){const r=i._`${t}${(0,i.getProperty)(n)} !== undefined`;return s?i._`${r} && ${a(e,t,n)}`:r},t.noPropertyInData=l,t.allSchemaProperties=c,t.schemaProperties=function(e,t){return c(t).filter((n=>!(0,s.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:s,schemaPath:o,errorPath:a},it:l},c,h,d){const u=d?i._`${e}, ${t}, ${s}${o}`:t,p=[[r.default.instancePath,(0,i.strConcat)(r.default.instancePath,a)],[r.default.parentData,l.parentData],[r.default.parentDataProperty,l.parentDataProperty],[r.default.rootData,r.default.rootData]];l.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const m=i._`${u}, ${n.object(...p)}`;return h!==i.nil?i._`${c}.call(${h}, ${m})`:i._`${c}(${m})`},t.usePattern=function({gen:e,it:{opts:t}},n){const s=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,s),code:i._`new RegExp(${n}, ${s})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:r,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return l((()=>t.assign(e,!1))),e}return t.var(a,!0),l((()=>t.break())),a;function l(o){const l=t.const("len",i._`${n}.length`);t.forRange("i",0,l,(n=>{e.subschema({keyword:r,dataProp:n,dataPropType:s.Type.Num},a),t.if((0,i.not)(a),o)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,s.alwaysValidSchema)(o,e)))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block((()=>n.forEach(((n,s)=>{const o=e.subschema({keyword:r,schemaProp:s,compositeRule:!0},l);t.assign(a,i._`${a} || ${l}`);e.mergeValidEvaluated(o,l)||t.if((0,i.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},84874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},59730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(84874),s=n(45403),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",i.default,s.default];t.default=r},45403:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const i=n(33482),s=n(57111),r=n(56110),o=n(17748),a=n(59336),l=n(20530),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:s}=e,{baseId:o,schemaEnv:l,validateName:c,opts:u,self:p}=s,{root:m}=l;if(("#"===n||"#/"===n)&&o===m.baseId)return function(){if(l===m)return d(e,c,l,l.$async);const n=t.scopeValue("root",{ref:m});return d(e,r._`${n}.validate`,m,m.$async)}();const f=a.resolveRef.call(p,m,o,n);if(void 0===f)throw new i.default(o,n);return f instanceof a.SchemaEnv?function(t){const n=h(e,t);d(e,n,t,t.$async)}(f):function(i){const s=t.scopeValue("schema",!0===u.code.source?{ref:i,code:(0,r.stringify)(i)}:{ref:i}),o=t.name("valid"),a=e.subschema({schema:i,dataTypes:[],schemaPath:r.nil,topSchemaRef:s,errSchemaPath:n},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function h(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):r._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,i){const{gen:a,it:c}=e,{allErrors:h,schemaEnv:d,opts:u}=c,p=u.passContext?o.default.this:r.nil;function m(e){const t=r._`${e}.errors`;a.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`),a.assign(o.default.errors,r._`${o.default.vErrors}.length`)}function f(e){var t;if(!c.opts.unevaluated)return;const i=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(i&&!i.dynamicProps)void 0!==i.props&&(c.props=l.mergeEvaluated.props(a,i.props,c.props));else{const t=a.var("props",r._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,r.Name)}if(!0!==c.items)if(i&&!i.dynamicItems)void 0!==i.items&&(c.items=l.mergeEvaluated.items(a,i.items,c.items));else{const t=a.var("items",r._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,r.Name)}}i?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(r._`await ${(0,s.callValidateCode)(e,t,p)}`),f(t),h||a.assign(n,!0)}),(e=>{a.if(r._`!(${e} instanceof ${c.ValidationError})`,(()=>a.throw(e))),m(e),h||a.assign(n,!1)})),e.ok(n)}():e.result((0,s.callValidateCode)(e,t,p),(()=>f(t)),(()=>m(t)))}t.getValidate=h,t.callRef=d,t.default=c},73348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(2997),r={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>i._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:a}=e,{oneOf:l}=o;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const c=r.propertyName;if("string"!=typeof c)throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),d=t.const("tag",i._`${n}${(0,i.getProperty)(c)}`);function u(n){const s=t.name("valid"),r=e.subschema({keyword:"oneOf",schemaProp:n},s);return e.mergeEvaluated(r,i.Name),s}t.if(i._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=s(o);let i=!0;for(let t=0;te.error(!1,{discrError:s.DiscrError.Tag,tag:d,tagName:c}))),e.ok(h)}};t.default=r},2997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(59730),s=n(86020),r=n(3698),o=n(45036),a=n(99275),l=[i.default,s.default,(0,r.default)(),o.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},88997:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>i.str`must match format "${e}"`,params:({schemaCode:e})=>i._`{format: ${e}}`},code(e,t){const{gen:n,data:s,$data:r,schema:o,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:h,schemaEnv:d,self:u}=l;c.validateFormats&&(r?function(){const r=n.scopeValue("formats",{ref:u.formats,code:c.code.formats}),o=n.const("fDef",i._`${r}[${a}]`),l=n.let("fType"),h=n.let("format");n.if(i._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>n.assign(l,i._`${o}.type || "string"`).assign(h,i._`${o}.validate`)),(()=>n.assign(l,i._`"string"`).assign(h,o))),e.fail$data((0,i.or)(!1===c.strictSchema?i.nil:i._`${a} && !${h}`,function(){const e=d.$async?i._`(${o}.async ? await ${h}(${s}) : ${h}(${s}))`:i._`${h}(${s})`,n=i._`(typeof ${h} == "function" ? ${e} : ${h}.test(${s}))`;return i._`${h} && ${h} !== true && ${l} === ${t} && !${n}`}()))}():function(){const r=u.formats[o];if(!r)return void function(){if(!1===c.strictSchema)return void u.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${h}"`}}();if(!0===r)return;const[a,l,p]=function(e){const t=e instanceof RegExp?(0,i.regexpCode)(e):c.code.formats?i._`${c.code.formats}${(0,i.getProperty)(o)}`:void 0,s=n.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,i._`${s}.validate`];return["string",e,s]}(r);a===t&&e.pass(function(){if("object"==typeof r&&!(r instanceof RegExp)&&r.async){if(!d.$async)throw new Error("async format in sync schema");return i._`await ${p}(${s})`}return"function"==typeof l?i._`${p}(${s})`:i._`${p}.test(${s})`}())}())}};t.default=s},45036:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=[n(88997).default];t.default=i},99275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},33103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(18062),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>i._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:o,schemaCode:a,schema:l}=e;o||l&&"object"==typeof l?e.fail$data(i._`!${(0,s.useFunc)(t,r.default)}(${n}, ${a})`):e.fail(i._`${l} !== ${n}`)}};t.default=o},13139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(18062),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>i._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:o,schema:a,schemaCode:l,it:c}=e;if(!o&&0===a.length)throw new Error("enum must have non-empty array");const h=a.length>=c.opts.loopEnum,d=(0,s.useFunc)(t,r.default);let u;if(h||o)u=t.let("valid"),e.block$data(u,(function(){t.assign(u,!1),t.forOf("v",l,(e=>t.if(i._`${d}(${n}, ${e})`,(()=>t.assign(u,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);u=(0,i.or)(...a.map(((t,s)=>function(e,t){const s=a[t];return"object"==typeof s&&null!==s?i._`${d}(${n}, ${e}[${t}])`:i._`${n} === ${s}`}(e,s))))}e.pass(u)}};t.default=o},86020:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20897),s=n(75162),r=n(74905),o=n(22508),a=n(10082),l=n(86846),c=n(57569),h=n(55640),d=n(33103),u=n(13139),p=[i.default,s.default,r.default,o.default,a.default,l.default,c.default,h.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,u.default];t.default=p},57569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,r="maxItems"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`${n}.length ${r} ${s}`)}};t.default=s},74905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(75842),o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o,it:a}=e,l="maxLength"===t?i.operators.GT:i.operators.LT,c=!1===a.opts.unicode?i._`${n}.length`:i._`${(0,s.useFunc)(e.gen,r.default)}(${n})`;e.fail$data(i._`${c} ${l} ${o}`)}};t.default=o},20897:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=i.operators,r={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},o={message:({keyword:e,schemaCode:t})=>i.str`must be ${r[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${r[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(e){const{keyword:t,data:n,schemaCode:s}=e;e.fail$data(i._`${n} ${r[t].fail} ${s} || isNaN(${n})`)}};t.default=a},10082:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,r="maxProperties"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`Object.keys(${n}).length ${r} ${s}`)}};t.default=s},75162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>i.str`must be multiple of ${e}`,params:({schemaCode:e})=>i._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:s,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),l=o?i._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:i._`${a} !== parseInt(${a})`;e.fail$data(i._`(${s} === 0 || (${a} = ${n}/${s}, ${l}))`)}};t.default=s},22508:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>s.str`must match pattern "${e}"`,params:({schemaCode:e})=>s._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:r,schemaCode:o,it:a}=e,l=a.opts.unicodeRegExp?"u":"",c=n?s._`(new RegExp(${o}, ${l}))`:(0,i.usePattern)(e,r);e.fail$data(s._`!${c}.test(${t})`)}};t.default=r},86846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(20530),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>s.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>s._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:o,data:a,$data:l,it:c}=e,{opts:h}=c;if(!l&&0===n.length)return;const d=n.length>=h.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(s.nil,u);else for(const t of n)(0,i.checkReportMissingProp)(e,t)}():function(){const r=t.let("missing");if(d||l){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,r){e.setParams({missingProperty:n}),t.forOf(n,o,(()=>{t.assign(r,(0,i.propertyInData)(t,a,n,h.ownProperties)),t.if((0,s.not)(r),(()=>{e.error(),t.break()}))}),s.nil)}(r,n))),e.ok(n)}else t.if((0,i.checkMissingProp)(e,n,r)),(0,i.reportMissingProp)(e,r),t.else()}(),h.strictRequired){const t=e.parentSchema.properties,{definedProperties:i}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!i.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(c,t,c.opts.strictRequired)}}function u(){t.forOf("prop",o,(n=>{e.setParams({missingProperty:n}),t.if((0,i.noPropertyInData)(t,a,n,h.ownProperties),(()=>e.error()))}))}}};t.default=o},55640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(97349),s=n(56110),r=n(20530),o=n(18062),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>s.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>s._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:l,parentSchema:c,schemaCode:h,it:d}=e;if(!a&&!l)return;const u=t.let("valid"),p=c.items?(0,i.getSchemaTypes)(c.items):[];function m(r,o){const a=t.name("item"),l=(0,i.checkDataTypes)(p,a,d.opts.strictNumbers,i.DataType.Wrong),c=t.const("indices",s._`{}`);t.for(s._`;${r}--;`,(()=>{t.let(a,s._`${n}[${r}]`),t.if(l,s._`continue`),p.length>1&&t.if(s._`typeof ${a} == "string"`,s._`${a} += "_"`),t.if(s._`typeof ${c}[${a}] == "number"`,(()=>{t.assign(o,s._`${c}[${a}]`),e.error(),t.assign(u,!1).break()})).code(s._`${c}[${a}] = ${r}`)}))}function f(i,a){const l=(0,r.useFunc)(t,o.default),c=t.name("outer");t.label(c).for(s._`;${i}--;`,(()=>t.for(s._`${a} = ${i}; ${a}--;`,(()=>t.if(s._`${l}(${n}[${i}], ${n}[${a}])`,(()=>{e.error(),t.assign(u,!1).break(c)}))))))}e.block$data(u,(function(){const i=t.let("i",s._`${n}.length`),r=t.let("j");e.setParams({i,j:r}),t.assign(u,!0),t.if(s._`${i} > 1`,(()=>(p.length>0&&!p.some((e=>"object"===e||"array"===e))?m:f)(i,r)))}),s._`${h} === false`),e.ok(u)}};t.default=a},28926:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,s,r;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(s=i;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(s=i;0!=s--;)if(!Object.prototype.hasOwnProperty.call(n,r[s]))return!1;for(s=i;0!=s--;){var o=r[s];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},68125:e=>{"use strict";var t=e.exports=function(e,t,i){"function"==typeof t&&(i=t,t={}),n(t,"function"==typeof(i=t.cb||i)?i:i.pre||function(){},i.post||function(){},e,"",e)};function n(e,i,s,r,o,a,l,c,h,d){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var u in i(r,o,a,l,c,h,d),r){var p=r[u];if(Array.isArray(p)){if(u in t.arrayKeywords)for(var m=0;m1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,s=1;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=p-m,T=Math.floor,C=String.fromCharCode;function A(e){throw new RangeError(M[e])}function P(e,t){for(var n=[],i=e.length;i--;)n[i]=t(e[i]);return n}function R(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+P((e=e.replace(S,".")).split("."),t).join(".")}function L(e){for(var t=[],n=0,i=e.length;n=55296&&s<=56319&&n>1,e+=T(e/t);e>E*f>>1;i+=p)e=T(e/E);return T(i+(E+1)*e/(e+g))},O=function(e){var t=[],n=e.length,i=0,s=b,r=y,o=e.lastIndexOf(_);o<0&&(o=0);for(var a=0;a=128&&A("not-basic"),t.push(e.charCodeAt(a));for(var l=o>0?o+1:0;l=n&&A("invalid-input");var g=N(e.charCodeAt(l++));(g>=p||g>T((u-i)/h))&&A("overflow"),i+=g*h;var v=d<=r?m:d>=r+f?f:d-r;if(gT(u/x)&&A("overflow"),h*=x}var w=t.length+1;r=I(i-c,w,0==c),T(i/w)>u-s&&A("overflow"),s+=T(i/w),i%=w,t.splice(i++,0,s)}return String.fromCodePoint.apply(String,t)},U=function(e){var t=[],n=(e=L(e)).length,i=b,s=0,r=y,o=!0,a=!1,l=void 0;try{for(var c,h=e[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=c.value;d<128&&t.push(C(d))}}catch(e){a=!0,l=e}finally{try{!o&&h.return&&h.return()}finally{if(a)throw l}}var g=t.length,v=g;for(g&&t.push(_);v=i&&RT((u-s)/N)&&A("overflow"),s+=(x-i)*N,i=x;var O=!0,U=!1,k=void 0;try{for(var V,z=e[Symbol.iterator]();!(O=(V=z.next()).done);O=!0){var F=V.value;if(Fu&&A("overflow"),F==i){for(var B=s,$=p;;$+=p){var j=$<=r?m:$>=r+f?f:$-r;if(B>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function $(e){for(var t="",n=0,i=e.length;n=194&&s<224){if(i-n>=6){var r=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&s)<<6|63&r)}else t+=e.substr(n,6);n+=6}else if(s>=224){if(i-n>=9){var o=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function j(e,t){function n(e){var n=$(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,B).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,B).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,B).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,B).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,B).replace(t.PCT_ENCODED,s)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function G(e,t){var n=e.match(t.IPV4ADDRESS)||[],i=h(n,2)[1];return i?i.split(".").map(H).join("."):e}function Z(e,t){var n=e.match(t.IPV6ADDRESS)||[],i=h(n,3),s=i[1],r=i[2];if(s){for(var o=s.toLowerCase().split("::").reverse(),a=h(o,2),l=a[0],c=a[1],d=c?c.split(":").map(H):[],u=l.split(":").map(H),p=t.IPV4ADDRESS.test(u[u.length-1]),m=p?7:8,f=u.length-m,g=Array(m),v=0;v1){var _=g.slice(0,y.index),x=g.slice(y.index+y.length);b=_.join(":")+"::"+x.join(":")}else b=g.join(":");return r&&(b+="%"+r),b}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,q=void 0==="".match(/(){0}/)[1];function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},i=!1!==t.iri?c:l;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(W);if(s){q?(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5])):(n.scheme=s[1]||void 0,n.userinfo=-1!==e.indexOf("@")?s[3]:void 0,n.host=-1!==e.indexOf("//")?s[4]:void 0,n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=-1!==e.indexOf("?")?s[7]:void 0,n.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),n.host&&(n.host=Z(G(n.host,i),i)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var r=F[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||r&&r.unicodeSupport)j(n,i);else{if(n.host&&(t.domainHost||r&&r.domainHost))try{n.host=z.toASCII(n.host.replace(i.PCT_ENCODED,$).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}j(n,l)}r&&r.parse&&r.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function Y(e,t){var n=!1!==t.iri?c:l,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(Z(G(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var K=/^\.\.?\//,J=/^\/\.(\/|$)/,Q=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(K))e=e.replace(K,"");else if(e.match(J))e=e.replace(J,"/");else if(e.match(Q))e=e.replace(Q,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(ee);if(!n)throw new Error("Unexpected dot segment condition");var i=n[0];e=e.slice(i.length),t.push(i)}return t.join("")}function ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?c:l,i=[],s=F[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?z.toUnicode(e.host):z.toASCII(e.host.replace(n.PCT_ENCODED,$).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}j(e,n),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var r=Y(e,t);if(void 0!==r&&("suffix"!==t.reference&&i.push("//"),i.push(r),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var o=e.path;t.absolutePath||s&&s.absolutePath||(o=te(o)),void 0===r&&(o=o.replace(/^\/\//,"/%2F")),i.push(o)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};return arguments[3]||(e=X(ne(e,n),n),t=X(ne(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=te(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function se(e,t,n){var i=o({scheme:"null"},n);return ne(ie(X(e,i),X(t,i),i,!0),i)}function re(e,t){return"string"==typeof e?e=ne(X(e,t),t):"object"===i(e)&&(e=X(ne(e,t),t)),e}function oe(e,t,n){return"string"==typeof e?e=ne(X(e,n),n):"object"===i(e)&&(e=ne(e,n)),"string"==typeof t?t=ne(X(t,n),n):"object"===i(t)&&(t=ne(t,n)),e===t}function ae(e,t){return e&&e.toString().replace(t&&t.iri?c.ESCAPE:l.ESCAPE,B)}function le(e,t){return e&&e.toString().replace(t&&t.iri?c.PCT_ENCODED:l.PCT_ENCODED,$)}var ce={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},he={scheme:"https",domainHost:ce.domainHost,parse:ce.parse,serialize:ce.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var ue={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=de(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(de(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),i=h(n,2),s=i[0],r=i[1];e.path=s&&"/"!==s?s:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},pe={scheme:"wss",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize},me={},fe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ve=n(n("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+n("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+n("%"+ge+ge)),ye="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),_e="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",xe=new RegExp(fe,"g"),we=new RegExp(ve,"g"),Se=new RegExp(t("[^]",ye,"[\\.]",'[\\"]',be),"g"),Me=new RegExp(t("[^]",fe,_e),"g"),Ee=Me;function Te(e){var t=$(e);return t.match(xe)?t:e}var Ce={scheme:"mailto",parse:function(e,t){var n=e,i=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var s=!1,r={},o=n.query.split("&"),a=0,l=o.length;a{"use strict";n.d(t,{Z:()=>s});const i=function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},s={text:function(e,t){const n=window.URL.createObjectURL(new Blob([e],{type:"text/plain"}));i(n,t)},json:function(e,t){"object"==typeof e&&(e=JSON.stringify(e));const n=window.URL.createObjectURL(new Blob([e],{type:"text/json"}));i(n,t)},url:function(e,t){i(e,t)}}},56587:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={json:async function(e,t,n){n&&"string"!=typeof n&&(n=JSON.stringify(n));return fetch(e,{headers:{Accept:"application/json","Content-Type":"application/json"},method:t,credentials:"same-origin",body:n}).then((n=>{if(!n.ok){const i=`fetch.json (${t} at '${e}'), error: ${n.status} - ${n.statusText}`;throw console.warn(i),new Error(i)}return n.json()})).catch((n=>{throw console.warn(`fetch.json (${t} at '${e}'), error: ${n.message}`),n}))},text:async function(e,t,n){return fetch(e,{headers:{Accept:"text/plain","Content-Type":"text/plain"},method:t,credentials:"same-origin",body:n}).then((e=>{if(!e.ok)throw new Error(`status: ${e.status}`);return e.text()})).catch((n=>{throw console.warn(`fetch.text (${t} at '${e}'), error: ${n.message}`),n}))},file:async function(e,t,n,i=!0){const s={method:t,credentials:"include",body:n};return i||(s.headers={"Content-Type":"application/octet-stream"}),fetch(e,s).then((e=>{if(!e.ok)throw new Error(`status: ${e.status}`);return e})).catch((n=>{throw console.warn(`fetch.file (${t} at '${e}'), error: ${n.message}`),n}))},buffer:async function(e,t,n){return fetch(e,{headers:{Accept:"application/octet-stream","Content-Type":"application/octet-stream"},method:t,credentials:"include",body:n}).then((e=>{if(!e.ok)throw new Error(`status: ${e.status}`);return e.arrayBuffer()})).catch((n=>{throw console.warn(`fetch.buffer (${t} at '${e}'), error: ${n.message}`),n}))}}},31741:(e,t,n)=>{"use strict";function i(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");const n=new RegExp("[?&]"+e+"(=([^]*)|&|#|$)").exec(t);if(n)return n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):""}n.d(t,{Z:()=>i})},47855:(e,t,n)=>{"use strict";n.d(t,{P:()=>s,ZP:()=>o});var i=n(96368);class s{constructor(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}static makeZeros(){return new s(0,0,0)}static makeOnes(){return new s(1,1,1)}static makeUnitX(){return new s(1,0,0)}static makeUnitY(){return new s(0,1,0)}static makeUnitZ(){return new s(0,0,1)}static makeCopy(e){return new s(e.x,e.y,e.z)}static makeFromScalar(e){return new s(e,e,e)}static makeFromArray(e){return new s(e[0],e[1],e[2])}static toString(e){return`[${e.x}, ${e.y}, ${e.z}]`}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}set(e,t,n){return this.x=e,this.y=t,this.z=n,this}setFromScalar(e){return this.x=e,this.y=e,this.z=e,this}setFromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}setZeros(){return this.x=0,this.y=0,this.z=0,this}setOnes(){return this.x=1,this.y=1,this.z=1,this}setUnitX(){return this.x=1,this.y=0,this.z=0,this}setUnitY(){return this.x=0,this.y=1,this.z=0,this}setUnitZ(){return this.x=0,this.y=0,this.z=1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}mul(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}div(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}mulScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}divScalar(e){return this.x/=e,this.y/=e,this.z/=e,this}translate(e,t,n){return this.x+=e,this.y+=t,this.z+=n,this}rotateX(e){const t=Math.cos(e),n=Math.sin(e),i=this.y,s=this.z;return this.y=t*i-n*s,this.z=n*i+t*s,this}rotateY(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.z;return this.x=t*i+n*s,this.z=-n*i+t*s,this}rotateZ(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.y;return this.x=t*i-n*s,this.y=n*i+t*s,this}scale(e,t,n){return this.x*=e,this.y*=t,this.z*=n,this}invert(){return this.x=1/this.x,this.y=1/this.y,this.z=1/this.z,this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x*=e,this.y*=e,this.z*=e,this}homogenize(){return this.x/=this.z,this.y/=this.z,this.z=1,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.x=t,this.y=n,this.z=i,this}length(){const e=this.x,t=this.y,n=this.z;return Math.sqrt(e*e+t*t+n*n)}lengthSquared(){const e=this.x,t=this.y,n=this.z;return e*e+t*t+n*n}distanceTo(e){const t=e.x-this.x,n=e.y-this.y,i=e.z-this.z;return Math.sqrt(t*t+n*n+i*i)}min(){return this.xthis.y?this.x>this.z?this.x:this.z:this.y>this.z?this.y:this.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}clone(){return new s(this.x,this.y,this.z)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e):[this.x,this.y,this.z]}toVector2(e){return e?(e.x=this.x,e.y=this.y,e):new i.Z(this.x,this.y)}toString(){return s.toString(this)}}s.zeros=new s(0,0,0),s.ones=new s(1,1,1),s.unitX=new s(1,0,0),s.unitY=new s(0,1,0),s.unitZ=new s(0,0,1);class r{constructor(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=i||0}static makeZeros(){return new r(0,0,0,0)}static makeOnes(){return new r(1,1,1,1)}static makeUnitX(){return new r(1,0,0,0)}static makeUnitY(){return new r(0,1,0,0)}static makeUnitZ(){return new r(0,0,1,0)}static makeUnitW(){return new r(0,0,0,1)}static makeCopy(e){return new r(e.x,e.y,e.z,e.w)}static makeFromScalar(e){return new r(e,e,e,e)}static makeFromArray(e){return new r(e[0],e[1],e[2],e[3])}static makeFromPosition(e){return new r(e.x,e.y,e.z,1)}static makeFromDirection(e){return new r(e.x,e.y,e.z,0)}static toString(e){return`[${e.x}, ${e.y}, ${e.z}, ${e.w}]`}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=void 0===i?1:i,this}setFromScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setFromArray(e,t=1){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}setPosition(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=1,this}setDirection(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=0,this}setZeros(){return this.x=0,this.y=0,this.z=0,this.w=0,this}setOnes(){return this.x=1,this.y=1,this.z=1,this.w=1,this}setUnitX(){return this.x=1,this.y=0,this.z=0,this.w=0,this}setUnitY(){return this.x=0,this.y=1,this.z=0,this.w=0,this}setUnitZ(){return this.x=0,this.y=0,this.z=1,this.w=0,this}setUnitW(){return this.x=0,this.y=0,this.z=0,this.w=1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}mul(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}div(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}homogenize(){return this.x/=this.w,this.y/=this.w,this.z/=this.w,this.w=1,this}project(e){const t=this.dot(e)/this.lengthSquared();return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}length(){const e=this.x,t=this.y,n=this.z,i=this.w;return Math.sqrt(e*e+t*t+n*n+i*i)}lengthSquared(){const e=this.x,t=this.y,n=this.z,i=this.w;return e*e+t*t+n*n+i*i}isZero(){return 0===this.x&&0===this.y&&0===this.z&&0===this.w}clone(){return new r(this.x,this.y,this.z,this.w)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e):[this.x,this.y,this.z,this.w]}toVector3(e){return e?(e.x=this.x,e.y=this.y,e.z=this.z,e):new s(this.x,this.y,this.z)}toString(){return r.toString(this)}}r.zeros=new r(0,0,0,0),r.ones=new r(1,1,1,1),r.unitX=new r(1,0,0,0),r.unitY=new r(0,1,0,0),r.unitZ=new r(0,0,1,0),r.unitW=new r(0,0,0,1);class o{constructor(e=0,t=0,n=0,i=1){e instanceof o?(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w):Array.isArray(e)?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0,this.w=void 0!==e[3]?e[3]:1):"string"==typeof e?this.setString(e):(this.x=e,this.y=t,this.z=n,this.w=i)}static fromString(e){return(new o).setString(e)}static fromArray(e){return new o(e)}get r(){return this.x}get g(){return this.y}get b(){return this.z}get a(){return this.w}set r(e){this.x=e}set g(e){this.y=e}set b(e){this.z=e}set a(e){this.w=e}get red(){return this.x}get green(){return this.y}get blue(){return this.z}get alpha(){return this.w}set red(e){this.x=e}set green(e){this.y=e}set blue(e){this.z=e}set alpha(e){this.w=e}get redByte(){return Math.floor(255*this.x)}get greenByte(){return Math.floor(255*this.y)}get blueByte(){return Math.floor(255*this.z)}get alphaByte(){return Math.floor(255*this.w)}set redByte(e){this.x=e/255}set greenByte(e){this.y=e/255}set blueByte(e){this.z=e/255}set alphaByte(e){this.w=e/255}inverseMultiply(e){return this.x=this.x*(1-e)+e,this.y=this.y*(1-e)+e,this.z=this.z*(1-e)+e,this}multiply(e){return this.x*=e,this.y*=e,this.z*=e,this}copy(e){this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w}clone(){return new o(this.x,this.y,this.z,this.w)}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=void 0===i?1:i,this}setBytes(e,t,n,i){return this.x=e/255,this.y=t/255,this.z=n/255,this.w=void 0===i?1:i/255,this}setUInt24RGB(e){return this.x=e>>16&255,this.y=e>>8&255,this.z=255&e,this.w=1,this}setUInt32RGBA(e){return this.x=e>>24&255,this.y=e>>16&255,this.z=e>>8&255,this.w=255&e,this.w=1,this}setRed(e){return this.x=e,this}setGreen(e){return this.y=e,this}setBlue(e){return this.z=e,this}setAlpha(e){return this.w=e,this}setRedByte(e){return this.x=e/255,this}setGreenByte(e){return this.y=e/255,this}setBlueByte(e){return this.z=e/255,this}setAlphaByte(e){return this.w=e/255,this}setHSV(e,t=1,n=1,i){"object"==typeof e&&(t=e.y,n=e.z,i=void 0!==e.w?e.w:i,e=e.x);const s=Math.floor(e/60),r=e/60-s,o=n*(1-t),a=n*(1-r*t),l=n*(1-(1-r)*t);let c,h,d;switch(s%6){case 0:c=n,h=l,d=o;break;case 1:c=a,h=n,d=o;break;case 2:c=o,h=n,d=l;break;case 3:c=o,h=a,d=n;break;case 4:c=l,h=o,d=n;break;case 5:c=n,h=o,d=a}return this.x=c,this.y=h,this.z=d,void 0!==i&&(this.w=i),this}setHSL(e,t=1,n=1,i){if("object"==typeof e&&(t=e.y,n=e.z,i=void 0!==e.w?e.w:i,e=e.x),0===t)this.x=this.y=this.z=n;else{function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}e/=360;var s=n<.5?n*(1+t):n+t-n*t,r=2*n-s;this.x=o(r,s,e+1/3),this.y=o(r,s,e),this.z=o(r,s,e-1/3)}return void 0!==i&&(this.w=i),this}fromArray(e){this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0,this.w=void 0!==e[3]?e[3]:1}setString(e,t=1,n=!0){e=e.trim().toLowerCase();let i=(e=o.presets[e]||e).match(/^#?([0-9a-f]{3})$/i);if(i){const e=i[1],n=1/15;return this.x=Number.parseInt(e.charAt(0),16)*n,this.y=Number.parseInt(e.charAt(1),16)*n,this.z=Number.parseInt(e.charAt(2),16)*n,this.w=t,this}if(i=e.match(/^#?([0-9a-f]{6})$/i),i){const e=i[1],n=1/255;return this.x=Number.parseInt(e.substr(0,2),16)*n,this.y=Number.parseInt(e.substr(2,2),16)*n,this.z=Number.parseInt(e.substr(4,2),16)*n,this.w=t,this}if(0===e.indexOf("rgb")){let n=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const e=1/255;return this.x=Number.parseInt(n[1])*e,this.y=Number.parseInt(n[2])*e,this.z=Number.parseInt(n[3])*e,this.w=t,this}if(n=e.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+.*\d*)\s*\)$/i),n){const e=1/255;return this.x=Number.parseInt(n[1])*e,this.y=Number.parseInt(n[2])*e,this.z=Number.parseInt(n[3])*e,this.w=Number.parseFloat(n[4]),this}}if(0===e.indexOf("hsl")){let n=e.match(/(\d+(\.\d+)?)/g);return n&&this.setHSL(Number.parseFloat(n[0]),.01*Number.parseFloat(n[1]),.01*Number.parseFloat(n[2]),void 0!==n[3]?Number.parseFloat(n[3]):t),this}if(n)throw new RangeError("failed to parse color from string: "+e);return this}toUInt24RGB(){return Math.floor(255*this.x)<<16+Math.floor(255*this.y)<<8+Math.floor(255*this.z)}toUInt32RGBA(){return Math.floor(255*this.x)<<24+Math.floor(255*this.y)<<16+Math.floor(255*this.z)<<8+Math.floor(255*this.w)}toVector3(e){return e?(e.x=this.r,e.y=this.g,e.z=this.b,e):new s(this.r,this.g,this.b)}toVector4(e){return e?(e.x=this.r,e.y=this.g,e.z=this.b,e.w=this.a,e):new r(this.r,this.g,this.b,this.a)}toHSV(e){let t=this.x,n=this.y,i=this.z,r=Math.min(t,n,i),o=Math.max(t,n,i),a=o-r,l=0,c=0===o?0:a/o,h=o;return 0!==a&&(l=60*(t===o?(n-i)/a+(n.5?a/(2-o-r):a/(o+r),l=60*(t===o?(n-i)/a+(n{"use strict";n.d(t,{Z:()=>r});var i=n(82942);class s{constructor(e,t){this._args=e,this._props=t,this._args=e,this._state=null}get name(){return this._props.name||this._props.do.name.replace(/([A-Z])/g," $1").replace(/^./,(e=>e.toUpperCase()))}do(){if(this._state)throw new Error("undo should be called before execute can be applied again");this._state=this._props.do.apply(this._props.target,this._args)}undo(){if(!this._props.undo)throw new Error("can't undo this command");if(!this._state)throw new Error("execute should be called before undo can be applied");this._props.undo.call(this._props.target,this._state),this._state=null}canDo(){return!this._props.canDo||this._props.canDo()}canUndo(){return!!this._props.undo}}class r extends i.Z{constructor(e){super(),this.addEvent("update"),this.stack=[],this.pointer=-1,this.capacity=void 0!==e?e:r.defaultCapacity}register(e){let t;t="function"==typeof e?e:t=>new s(t,e);return(...e)=>{const n=t(e);this.do(n)}}setCapacity(e){for(this.capacity=e;this.stack.length>e;)this.stack.shift(),this.pointer--;this.pointer<0&&(this.stack=[],this.pointer=-1)}do(e){console.log(`Commander.do - '${e.name}'`),e.do(),e.canUndo()&&(this.stack.splice(this.pointer+1),this.stack.push(e),this.stack.length>this.capacity&&this.stack.shift(),this.pointer=this.stack.length-1,this.emit("update"))}undo(){if(this.pointer>=0){this.stack[this.pointer].undo(),this.pointer--,this.emit("update")}}redo(){if(this.pointer0&&(this.stack=[],this.pointer=-1,this.emit("update"))}canUndo(){return this.pointer>=0}canRedo(){return this.pointer=0?"Undo "+this.stack[this.pointer].name:"Can't Undo"}getRedoText(){return this.pointer{"use strict";n.d(t,{Z:()=>r});var i=n(82942),s=n(84292);class r extends i.Z{constructor(e){super(),this.addEvents("update","dispose"),e?this.fromJSON(e):this._data=this.init()}static generateId(){return(0,s.Z)()}get id(){return this._data.id}get data(){return this._data}set(e,t){this._data[e]=t,this.update()}get(e){return this._data[e]}update(){this.emit({type:"update",document:this})}dispose(){this.emit({type:"dispose",document:this}),this._data=null}fromJSON(e){return this._data={},this.inflate(e,this._data),this.update(),this}toJSON(e){return e=e||{},this.deflate(this._data,e),e}init(){return{}}inflate(e,t){Object.assign(t,e)}deflate(e,t){t=t||{},Object.assign(t,this._data)}}},97444:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(82942);const s=[];class r extends i.Z{constructor(e){super({knownEvents:!1});const t=e.typeName;if(!t)throw new Error("root type must have a 'typeName' member");this._rootTypeName=t,this._objLists={[this._rootTypeName]:[]},this._objTags={},this._objDict={}}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e}add(e){const t=e.id;if("string"==typeof t){if(void 0!==this._objDict[t])throw new Error("object already registered");this._objDict[t]=e}let n,i=e;const s=this._rootTypeName,r={type:"",add:!0,remove:!1,object:e};do{i=Object.getPrototypeOf(i),n=i.constructor.typeName,n&&((this._objLists[n]||(this._objLists[n]=[])).push(e),r.type=n,this.emit(r))}while(n!==s)}remove(e){const t=e.id;if("string"==typeof t){if(this._objDict[t]!==e)throw new Error("object not registered");delete this._objDict[t]}let n,i=e;const s=this._rootTypeName,r={type:"",add:!1,remove:!0,object:e};do{if(i=Object.getPrototypeOf(i),n=i.constructor.typeName,n){r.type=n;const t=this._objLists[n];t.splice(t.indexOf(e),1),this.emit(r)}}while(n!==s)}addByTag(e,t){if(!e||"tag"===e)throw new Error("illegal tag name");(this._objTags[e]||(this._objTags[e]=[])).push(t);const n={type:"tag",add:!0,remove:!1,object:t,tag:e};this.emit(n),n.type=e,this.emit(n)}removeByTag(e,t){if(!e||"tag"===e)throw new Error("illegal tag name");const n=this._objTags[e];if(n){const i=n.indexOf(t);if(i>=0){const s={type:"tag",add:!1,remove:!0,object:t,tag:e};return this.emit(s),s.type=e,this.emit(s),n.splice(i,1),!0}}return!1}clear(){this.cloneArray().forEach((e=>this.remove(e)))}get length(){return this._objLists[this._rootTypeName].length}count(e){const t=this._objLists[this.getTypeName(e)];return t?t.length:0}has(e){if("function"==typeof e){const t=this._objLists[e.typeName];return!!t&&t.length>0}if("string"==typeof e){const t=this._objLists[e];return!!t&&t.length>0}const t=this._objLists[e.constructor.typeName];return t&&t.indexOf(e)>=0}contains(e){const t=e.id;if("string"==typeof t)return!!this._objDict[t];const n=this._objLists[e.constructor.typeName];return n&&n.indexOf(e)>=0}get(e,t=!1){const n=this.getTypeName(e),i=this._objLists[n],s=i?i[0]:void 0;if(!t&&!s)throw new Error(`no instances of class '${n}' in object registry`);return s}getArray(e){return this._objLists[this.getTypeName(e)]||s}cloneArray(e){return this.getArray(e).slice()}getById(e){return this._objDict[e]}getDictionary(){return this._objDict}getByTag(e){return this._objTags[e]||s}on(e,t,n){super.on(this.getTypeName(e),t,n)}once(e,t,n){super.once(this.getTypeName(e),t,n)}off(e,t,n){super.off(this.getTypeName(e),t,n)}getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||this._rootTypeName}}},82942:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const i=Symbol("Publisher private data"),s=Symbol("Publisher strict option");class r{constructor(e){const t=!e||e.knownEvents;this[i]={[s]:t}}on(e,t,n){if(Array.isArray(e))return void e.forEach((e=>{this.on(e,t,n)}));if(!t)throw new Error("missing callback function");let r=this[i][e];if(!r){if(this[i][s])throw new Error(`can't subscribe; unknown event: '${e}'`);r=this[i][e]=[]}let o={callback:t,context:n};r.push(o)}addEventListener(e,t,n){this.on(e,t,n)}once(e,t,n){if(Array.isArray(e))return void e.forEach((e=>{this.once(e,t,n)}));const i=s=>{this.off(e,i,n),t.call(n,s)};i.cb=t,this.on(e,i,n)}off(e,t,n){if("object"==typeof e){if(Array.isArray(e))e.forEach((e=>{this.off(e,t,n)}));else{const t=this[i];for(let n=0,i=Object.keys(t).length;n{this[i][e]||(this[i][e]=[])}))}hasEvent(e){return!!this[i][e]}listEvents(){return Object.getOwnPropertyNames(this[i])}}},25976:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e,t,n){this._type=e,this._callback=t,this._context=n,this._publishers=[]}on(...e){return e.forEach((e=>{this._publishers.push(e),e.on(this._type,this._callback,this._context)})),this}off(){return this._publishers.forEach((e=>e.off(this._type,this._callback,this._context))),this._publishers.length=0,this}}},26041:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(82942);class s extends i.Z{constructor(){super(),this._dict={},this.addEvent("type")}add(e){if(Array.isArray(e))return void e.forEach((e=>this.add(e)));const t=e.typeName;if(!t)throw new Error("type must have a 'typeName' member");if(this._dict[t])throw new Error(`type '${t}' already registered`);this._dict[t]=e,this.emit({type:"type",add:!0,remove:!1,classType:e})}remove(e){if(Array.isArray(e))return void e.forEach((e=>this.remove(e)));const t=e.typeName;if(!t)throw new Error("type must have a 'typeName' member");if(!this._dict[t])throw new Error(`type '${t}' not registered`);delete this._dict[t],this.emit({type:"type",add:!1,remove:!0,classType:e})}getType(e){let t=e;return"function"==typeof e?t=e.typeName:"object"==typeof e&&(t=e.constructor.typeName),this._dict[t]}createInstance(e,...t){const n=this.getType(e);if(!n)throw new Error(`type '${e}' not registered`);return new n(...t)}}},96368:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e,t){this.x=e||0,this.y=t||0}static makeZeros(){return new i(0,0)}static makeOnes(){return new i(1,1)}static makeUnitX(){return new i(1,0)}static makeUnitY(){return new i(0,1)}static makeCopy(e){return new i(e.x,e.y)}static makeFromScalar(e){return new i(e,e)}static makeFromArray(e){return new i(e[0],e[1])}static toString(e){return`[${e.x}, ${e.y}]`}copy(e){return this.x=e.x,this.y=e.y,this}set(e,t){return this.x=e,this.y=t,this}setFromScalar(e){return this.x=e,this.y=e,this}setFromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}setZeros(){return this.x=0,this.y=0,this}setOnes(){return this.x=1,this.y=1,this}setUnitX(){return this.x=1,this.y=0,this}setUnitY(){return this.x=0,this.y=1,this}add(e){return this.x+=e.x,this.y+=e.y,this}sub(e){return this.x-=e.x,this.y-=e.y,this}mul(e){return this.x*=e.x,this.y*=e.y,this}div(e){return this.x/=e.x,this.y/=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}subScalar(e){return this.x-=e,this.y-=e,this}mulScalar(e){return this.x*=e,this.y*=e,this}divScalar(e){return this.x/=e,this.y/=e,this}translate(e,t){return this.x+=e,this.y+=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.y;return this.x=t*i-n*s,this.y=n*i+t*s,this}scale(e,t){return this.x*=e,this.y*=t,this}invert(){return this.x=1/this.x,this.y=1/this.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y);return this.x*=e,this.y*=e,this}dot(e){return this.x*e.x+this.y*e.y}length(){const e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}lengthSquared(){const e=this.x,t=this.y;return e*e+t*t}distanceTo(e){const t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)}angle(){return Math.atan2(this.y,this.x)}angleTo(e){const t=this.x,n=this.y,i=e.x,s=e.y;return Math.acos((t*i+n*s)/(Math.sqrt(t*t+n*n)+Math.sqrt(i*i+s*s)))}min(){return this.xthis.y?this.x:this.y}isZero(){return 0===this.x&&0===this.y}clone(){return new i(this.x,this.y)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e):[this.x,this.y]}toString(){return i.toString(this)}}i.zeros=new i(0,0),i.ones=new i(1,1),i.unitX=new i(1,0),i.unitY=new i(0,1)},28581:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});const i={PI:3.141592653589793,DOUBLE_PI:6.283185307179586,HALF_PI:1.5707963267948966,QUARTER_PI:.7853981633974483,DEG2RAD:.017453292519943295,RAD2DEG:57.29577951308232,limit:(e,t,n)=>en?n:e,limitInt:function(e,t,n){return(e=Math.trunc(e))n?n:e},normalize:(e,t,n)=>(e-t)/(n-t),normalizeLimit:(e,t,n)=>(e=(e-t)/(n-t))<0?0:e>1?1:e,denormalize:(e,t,n)=>(t+e)*(n-t),scale:(e,t,n,i,s)=>i+(e-t)/(n-t)*(s-i),scaleLimit:(e,t,n,i,s)=>i+((e=en?n:e)-t)/(n-t)*(s-i),deg2rad:function(e){return.017453292519943295*e},rad2deg:function(e){return 57.29577951308232*e},deltaRadians:function(e,t){return e=(e%=i.DOUBLE_PI)<0?e+i.DOUBLE_PI:e,(t=(t%=i.DOUBLE_PI)<0?t+i.DOUBLE_PI:t)-e>i.PI&&(e+=i.DOUBLE_PI),t-e},deltaDegrees:function(e,t){return e=(e%=i.DOUBLE_PI)<0?e+i.DOUBLE_PI:e,(t=(t%=i.DOUBLE_PI)<0?t+i.DOUBLE_PI:t)-e>i.PI&&(e+=i.DOUBLE_PI),t-e},curves:{linear:e=>e,easeIn:e=>Math.sin(e*i.HALF_PI),easeOut:e=>Math.cos(e*i.HALF_PI-i.PI)+1,ease:e=>.5*Math.cos(e*i.PI-i.PI)+.5,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e}},s=i},82507:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});const i=function(e){return Object.keys(e).filter((e=>isNaN(Number(e))))}},84292:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});function i(e,t){let n;e&&"number"==typeof e||(e=12);do{n="";for(let t=0;t{"use strict";n.d(t,{ZP:()=>c,V5:()=>s.V5});var i=n(82942),s=n(31181),r=n(84292);class o extends i.Z{constructor(e){super(),this.addEvent("property"),this.linkable=e,this.properties=[]}get customProperties(){return this.properties.filter((e=>e.custom))}dispose(){this.unlinkAllProperties()}isInputGroup(){return this===this.linkable.ins}isOutputGroup(){return this===this.linkable.outs}createProperties(e,t){return Object.keys(e).forEach(((n,i)=>{const s=void 0===t?void 0:t+i,r=e[n];this.createProperty(r.path,r.schema,n,s)})),this}createProperty(e,t,n,i){const r=new s.ZP(e,t);return this.addProperty(r,n,i),r}createCustomProperty(e,t,n){const i=new s.ZP(e,t,!0);return this.addCustomProperty(i,n),i}addCustomProperty(e,t){const n=(0,r.Z)(5);this.addProperty(e,n,t)}addProperty(e,t,n){if(e.group)throw new Error("can't add, property already part of a group");if(this[t])throw new Error(`key '${t}' already exists in group`);e._group=this,e._key=t,void 0===n?this.properties.push(e):this.properties.splice(n,0,e),this[t]=e,this.emit({type:"property",add:!0,remove:!1,property:e})}removeProperty(e){if(e.group!==this)throw new Error("can't remove, property not in this group");if(e.hasLinks())throw new Error("can't remove, property has links");if(this[e.key]!==e)throw new Error(`property key '${e.key}' not found in group`);this.properties.slice(this.properties.indexOf(e),1),delete this[e.key],e._group=null,e._key="",this.emit({type:"property",add:!1,remove:!0,property:e})}getProperty(e){const t=this[e];if(!t)throw new Error(`no property found with key '${e}'`);return t}getKeys(e=!1){const t=[];return this.properties.forEach((n=>{(e||"object"!==n.type)&&t.push(n.key)})),t}getValues(e=!1){const t=[];return this.properties.map((n=>{(e||"object"!==n.type)&&t.push(n.value)})),t}cloneValues(e=!1){const t=[];return this.properties.map((n=>{(e||"object"!==n.type)&&t.push(n.cloneValue())})),t}setValues(e){Object.keys(e).forEach((t=>this.getProperty(t).value=e[t]))}copyValues(e){Object.keys(e).forEach((t=>this.getProperty(t).copyValue(e[t])))}unlinkAllProperties(){this.properties.forEach((e=>e.unlink()))}toJSON(){let e=null;return this.properties.forEach((t=>{const n=t.toJSON();n&&(e=e||{},e[t.key]=n)})),e}fromJSON(e){Object.keys(e).forEach((t=>{const n=e[t];if(n.schema){const e=new s.ZP(n.path,n.schema,!0);this.addProperty(e,t)}}))}linksFromJSON(e,t){Object.keys(e).forEach((n=>{this[n].fromJSON(e[n],t)}))}}var a=n(52226);class l{constructor(e,t){this._typeName=t?c.getTypeName(t):null,this._id=t instanceof c?t.id:void 0,this._system=e}get component(){return this._id&&this._system.components.getById(this._id)||null}set component(e){if(e&&this._typeName&&!(e instanceof this._system.registry.getType(this._typeName)))throw new Error(`can't assign component of class '${e.constructor.name||"unknown"}' to link of class '${this._typeName}'`);this._id=e?e.id:void 0}}n(90199);class c extends i.Z{constructor(e,t){super({knownEvents:!1}),this.ins=new o(this),this.outs=new o(this),this.changed=!0,this.updated=!1,this._name="",this._tags=new Set,this._trackers=[],this.node=e,this.id=t}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||c.typeName}create(){this.node._addComponent(this),this.graph.isActive&&this.activate&&this.activate()}dispose(){this.graph.isActive&&this.deactivate&&this.deactivate(),this.emit({type:"dispose",component:this}),this.ins.dispose(),this.outs.dispose(),this._trackers.forEach((e=>e.dispose())),this.node&&(this.node._removeComponent(this),this.node=null)}get isNodeSingleton(){return this.constructor.isNodeSingleton}get isGraphSingleton(){return this.constructor.isGraphSingleton}get isSystemSingleton(){return this.constructor.isSystemSingleton}get typeName(){return this.constructor.typeName}get displayTypeName(){const e=this.typeName;return"Component"===e?e:e.substr(1)}get text(){return this.constructor.text}get icon(){return this.constructor.icon}get name(){return this._name}get displayName(){return this._name||this.text||this.displayTypeName}set name(e){this._name=e,this.emit({type:"change",component:this,what:"name"})}get tags(){return this._tags}addTag(e){this._tags.has(e)||(this._tags.add(e),this.node._addComponentTag(e,this))}removeTag(e){this._tags.has(e)&&(this._tags.delete(e),this.node._removeComponentTag(e,this))}get graph(){return this.node.graph}get system(){return this.node.system}get components(){return this.node.components}get isActive(){return this.graph.isActive}getComponent(e,t=!1){return this.node.components.get(e,t)}getComponents(e){return this.node.components.getArray(e)}getComponentsByTag(e){return this.node.components.getByTag(e)}createComponent(e){return this.node.createComponent(e)}getOrCreateComponent(e){return this.node.components.get(e,!0)||this.node.createComponent(e)}hasComponent(e){return this.node.components.has(e)}getGraphComponent(e,t=!1){return this.node.graph.components.get(e,t)}getGraphComponents(e){return this.node.graph.components.getArray(e)}getGraphComponentsByTag(e){return this.node.graph.components.getByTag(e)}hasGraphComponent(e){return this.node.graph.components.has(e)}getMainComponent(e,t=!1){return this.node.system.graph.components.get(e,t)}getMainComponents(e){return this.node.system.graph.components.getArray(e)}getMainComponentsByTag(e){return this.node.system.graph.components.getByTag(e)}hasMainComponent(e){return this.node.system.graph.components.has(e)}getSystemComponent(e,t=!1){return this.node.system.components.get(e,t)}getSystemComponents(e){return this.node.system.components.getArray(e)}getSystemComponentsByTag(e){return this.node.system.components.getByTag(e)}hasSystemComponent(e){return this.node.system.components.has(e)}getComponentById(e){return this.node.system.components.getById(e)}getNode(e,t=!1){return this.node.graph.nodes.get(e,t)}getNodes(e){return this.node.graph.nodes.getArray(e)}getNodesByTag(e){return this.node.graph.nodes.getByTag(e)}hasNode(e){return this.node.graph.nodes.has(e)}getMainNode(e,t=!1){return this.node.system.graph.nodes.get(e,t)}getMainNodes(e){return this.node.system.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.node.system.graph.nodes.getByTag(e)}hasMainNode(e){return this.node.system.graph.nodes.has(e)}getSystemNode(e,t=!1){return this.node.system.nodes.get(e,t)}getSystemNodes(e){return this.node.system.nodes.getArray(e)}getSystemNodesByTag(e){return this.node.system.nodes.getByTag(e)}hasSystemNode(e){return this.node.system.nodes.has(e)}getNodeById(e){return this.node.system.nodes.getById(e)}activate(){}update(e){throw new Error("this should never be called")}tick(e){throw new Error("this should never be called")}tock(e){throw new Error("this should never be called")}deactivate(){}requestSort(){this.graph.requestSort()}is(e){const t=c.getTypeName(e);let n=this;do{if(n=Object.getPrototypeOf(n),n.constructor.typeName===t)return!0}while(n.constructor.typeName!==c.typeName);return!1}unlinkAllProperties(){this.ins.unlinkAllProperties(),this.outs.unlinkAllProperties()}resetChanged(){this.changed=!1;const e=this.ins.properties;for(let t=0,n=e.length;tt.dump(e+" IN "))),this.outs.properties.forEach((t=>t.dump(e+" OUT ")))}toJSON(){let e={};const t=this.ins.toJSON();t&&(e.ins=t);const n=this.outs.toJSON();return n&&(e.outs=n),e}fromJSON(e){e.ins&&this.ins.fromJSON(e.ins),e.outs&&this.outs.fromJSON(e.outs)}referencesFromJSON(e){const t=this.system.components.getDictionary();e.ins&&this.ins.linksFromJSON(e.ins,t),e.outs&&this.outs.linksFromJSON(e.outs,t)}addCustomInput(e,t,n){return this.changed=!0,this.ins.createCustomProperty(e,t,n)}allowCustomInput(e){return!1}addCustomOutput(e,t,n){return this.outs.createCustomProperty(e,t,n)}allowCustomOutput(e){return!1}addInputs(e,t){return this.ins.createProperties(e,t)}addOutputs(e,t){return this.outs.createProperties(e,t)}}c.typeName="Component",c.text="",c.icon="",c.isNodeSingleton=!0,c.isGraphSingleton=!1,c.isSystemSingleton=!1,c.prototype.activate=null,c.prototype.update=null,c.prototype.tick=null,c.prototype.tock=null,c.prototype.deactivate=null},52226:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s{constructor(e,t,n,s){this.typeName=i.ZP.getTypeName(t),this.didAdd=n,this.willRemove=s,this._registry=e,e.on(this.typeName,this.onComponent,this),this.component=e.get(t,!0),this.component&&n&&n(this.component)}dispose(){this._registry.off(this.typeName,this.onComponent,this),this.component=null,this.didAdd=null,this.willRemove=null}onComponent(e){e.add?(this.component=e.object,this.didAdd&&this.didAdd(e.object)):e.remove&&(this.willRemove&&this.willRemove(e.object),this.component=null)}}},83275:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(84292),s=n(82942);class r{constructor(){this.visited={},this.visiting={},this.sorted=[]}sort(e){for(let t=0,n=e.length;t0)throw new Error("graph not empty")}requestSort(){this._sortRequested=!0}sort(){this._sortedList=this._sorter.sort(this.components.getArray());this.parent&&(this.parent.name||this.parent.typeName)}createCustomNode(e,t,n){const s=this.system.registry.getType(e);if(!s)throw new Error(`node type '${a.Z.getTypeName(e)}' not registered`);const r=new s(this,n||(0,i.Z)(12,this.system.nodes.getDictionary()));return r.create(),t&&(r.name=t),n||(r.createComponents(),r.unlock()),r}createNode(e,t){const n=new a.Z(this,t||(0,i.Z)(12,this.system.nodes.getDictionary()));return n.create(),e&&(n.name=e),n.unlock(),n}findNodeByName(e,t){const n=this.nodes.getArray(t);for(let t=0,i=n.length;te.toString(!0))).join("\n"):i}dump(e=""){console.log(e+"%cGraph","color: red");this.findRootNodes().forEach((t=>t.dump(e+" ")))}toJSON(){const e={},t=[],n=this.nodes.getArray();for(let e=0,i=n.length;e0&&(e.nodes=t),e}fromJSON(e){e.nodes&&(e.nodes.forEach((e=>{this.createCustomNode(e.type,e.name,e.id).fromJSON(e)})),e.nodes.forEach((e=>{this.nodes.getById(e.id).referencesFromJSON(e)})))}nodeToJSON(e){return e.toJSON()}_addNode(e){this.nodes.add(e),this.system._addNode(e)}_removeNode(e){this.system._removeNode(e),this.nodes.remove(e)}_addNodeTag(e,t){this.nodes.addByTag(e,t),this.system._addNodeTag(e,t)}_removeNodeTag(e,t){this.system._removeNodeTag(e,t),this.nodes.removeByTag(e,t)}_addComponent(e){if(e.isGraphSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per graph`);this.components.add(e),this.system._addComponent(e),e.tock&&this._tockList.push(e),this._sortRequested=!0}_removeComponent(e){this.system._removeComponent(e),this.components.remove(e),e.tock&&this._tockList.splice(this._tockList.indexOf(e),1),this._sortRequested=!0}_addComponentTag(e,t){this.components.addByTag(e,t),this.system._addComponentTag(e,t)}_removeComponentTag(e,t){this.system._removeComponentTag(e,t),this.components.removeByTag(e,t)}_addRoot(e){this.roots.push(e),this.parent&&this.parent.onAddInnerRoot(e)}_removeRoot(e){this.parent&&this.parent.onRemoveInnerRoot(e),this.roots.splice(this.roots.indexOf(e),1)}}},90199:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(84292),s=n(82942),r=n(97444),o=n(80038);class a extends s.Z{constructor(e,t){super({knownEvents:!1}),this.graph=null,this.components=new r.Z(o.ZP),this._name="",this._tags=new Set,this._isLocked=void 0,this.graph=e,this.id=t}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||a.typeName}get typeName(){return this.constructor.typeName}get displayTypeName(){const e=this.typeName;return"Node"===e?e:e.substr(1)}get isLocked(){return this._isLocked}get text(){return this.constructor.text}get icon(){return this.constructor.icon}get name(){return this._name}get displayName(){return this._name||this.text||this.displayTypeName}set name(e){this._name=e,this.emit({type:"change",what:"name",node:this})}get tags(){return this._tags}addTag(e){this._tags.has(e)||(this._tags.add(e),this.graph._addNodeTag(e,this))}removeTag(e){this._tags.has(e)&&(this._tags.delete(e),this.graph._removeNodeTag(e,this))}get system(){return this.graph.system}getComponent(e,t=!1){return this.components.get(e,t)}getComponents(e){return this.components.getArray(e)}getComponentsByTag(e){return this.components.getByTag(e)}getOrCreateComponent(e){return this.components.get(e,!0)||this.createComponent(e)}hasComponent(e){return this.components.has(e)}getGraphComponent(e,t=!1){return this.graph.components.get(e,t)}getGraphComponents(e){return this.graph.components.getArray(e)}getGraphComponentsByTag(e){return this.graph.components.getByTag(e)}hasGraphComponent(e){return this.graph.components.has(e)}getMainComponent(e,t=!1){return this.graph.system.graph.components.get(e,t)}getMainComponents(e){return this.graph.system.graph.components.getArray(e)}getMainComponentsByTag(e){return this.graph.system.graph.components.getByTag(e)}hasMainComponent(e){return this.graph.system.graph.components.has(e)}getSystemComponent(e,t=!1){return this.graph.system.components.get(e,t)}getSystemComponents(e){return this.graph.system.components.getArray(e)}getSystemComponentsByTag(e){return this.graph.system.components.getByTag(e)}hasSystemComponent(e){return this.graph.system.components.has(e)}getComponentById(e){return this.graph.system.components.getById(e)}getNode(e,t=!1){return this.graph.nodes.get(e,t)}getNodes(e){return this.graph.nodes.getArray(e)}getNodesByTag(e){return this.graph.nodes.getByTag(e)}hasNode(e){return this.graph.nodes.has(e)}getMainNode(e,t=!1){return this.graph.system.graph.nodes.get(e,t)}getMainNodes(e){return this.graph.system.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.graph.system.graph.nodes.getByTag(e)}hasMainNode(e){return this.graph.system.graph.nodes.has(e)}getSystemNode(e,t=!1){return this.graph.system.nodes.get(e,t)}getSystemNodes(e){return this.graph.system.nodes.getArray(e)}getSystemNodesByTag(e){return this.graph.system.nodes.getByTag(e)}hasSystemNode(e){return this.graph.system.nodes.has(e)}getNodeById(e){return this.graph.system.nodes.getById(e)}lock(){if(!1===this._isLocked)throw new Error("can't lock an unlocked node again");this._isLocked=!0}unlock(){this._isLocked=!1}create(){this.graph._addNode(this)}createComponents(){}clear(){this.components.getArray().slice().forEach((e=>e.dispose()))}dispose(){this.components.cloneArray().reverse().forEach((e=>e.dispose())),this.emit({type:"dispose",node:this}),this.graph&&(this.graph._removeNode(this),this.graph=null)}createComponent(e,t,n){if(!0===this._isLocked)throw new Error("node is locked, can't create component");const s=this.system.registry.getType(e);if(!s)throw new Error(`component type '${o.ZP.getTypeName(e)}' not registered`);const r=new s(this,n||(0,i.Z)(12,this.system.components.getDictionary()));return r.create(),t&&(r.name=t),r}is(e){const t=a.getTypeName(e);let n=this;do{if(n=Object.getPrototypeOf(n),n.constructor.typeName===t)return!0}while(n.constructor.typeName!==a.typeName);return!1}toString(e=!1){const t=this.components.getArray(),n=`Node '${this.name}' - ${t.length} components`;return e?n+"\n"+t.map((e=>" "+e.toString())).join("\n"):n}dump(e=""){console.log(e+`%cNode '${this.typeName}' (${this.displayName})`,"color: blue"),this.components.getArray().forEach((t=>t.dump(e+" ")))}toJSON(){const e={},t=[];this._isLocked&&(e.locked=!0);const n=this.components.getArray();for(let e=0,i=n.length;e0&&(e.components=t),e}fromJSON(e){this._isLocked=!!e.locked,e.components&&e.components.forEach((e=>this.componentFromJSON(e)))}componentFromJSON(e){this.createComponent(e.type,e.name,e.id).fromJSON(e)}referencesFromJSON(e){e.components&&e.components.forEach((e=>{this.components.getById(e.id).referencesFromJSON(e)}))}componentToJSON(e){return e.toJSON()}_addComponent(e){if(e.isNodeSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per node`);this.components.add(e),this.graph._addComponent(e)}_removeComponent(e){this.graph._removeComponent(e),this.components.remove(e)}_addComponentTag(e,t){this.components.addByTag(e,t),this.graph._addComponentTag(e,t)}_removeComponentTag(e,t){this.graph._removeComponentTag(e,t),this.components.removeByTag(e,t)}}a.typeName="Node",a.text="",a.icon=""},31181:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,V5:()=>u.V5});var i=n(82942);const s=[function(e){return e},function(e,t){for(let n=0,i=t.length;n=0)throw new Error("non-array source property; can't link to element");if(1===t.elementCount&&i>=0)throw new Error("non-array destination property; can't link to element");this.source=e,this.destination=t,this.sourceIndex=n,this.destinationIndex=i;const s=void 0===n?-1:n,r=void 0===i?-1:i,o=e.elementCount>1&&s<0&&r<0;this.fnConvert=function(e,t,n){const i=n?1:0;return l[e][t][i]}(e.type,t.type,o);const a=function(e,t,n){return-1===e&&-1===t?n:e<=3&&t<=3?h[e+1][t+1]:function(n,i,s){return i[t]=s(n[e]),i}}(s,r,this.fnConvert);var c,d,u;this.fnCopy=(c=e.isMulti(),d=t.isMulti(),u=a,!1===c?!1===d?u:function(e,t,n){for(let n=0,i=t.length;n0&&(t=u(e[0],t)),t}:function(e,t,n){for(let n=0,i=e.length,s=t.length;n=0&&this.setValue(i,t,n)}copyValue(e,t){Array.isArray(e)&&(e=e.slice()),this.setValue(e,t)}set(e){e||(this.changed=!0,this.isInput()&&(this._group.linkable.changed=!0)),this.emit("value",this.value);const t=this.outLinks;for(let e=0,n=t.length;ei.source===e&&i.sourceIndex===t&&i.destinationIndex===n));return!!i&&(e.removeOutLink(i),this.removeInLink(i),!0)}unlink(){this.inLinks.slice().forEach((e=>{e.source.removeOutLink(e),this.removeInLink(e)}));if(this.outLinks.slice().forEach((e=>{this.removeOutLink(e),e.destination.removeInLink(e)})),0!==this.inLinks.length||0!==this.outLinks.length)throw new Error("fatal: leftover links")}addInLink(e){if(e.destination!==this)throw new Error("input link's destination must equal this");this.inLinks.push(e),this.requestSort(),this.emit({type:"link",add:!0,remove:!1,link:e})}addOutLink(e){if(e.source!==this)throw new Error("output link's source must equal this");this.outLinks.push(e),this.requestSort(),e.push()}removeInLink(e){const t=this.inLinks.indexOf(e);if(t<0)throw new Error("input link not found");this.inLinks.splice(t,1),this.requestSort(),0===this.inLinks.length&&"object"===this.type&&this.reset(),this.emit({type:"link",add:!1,remove:!0,link:e})}removeOutLink(e){const t=this.outLinks.indexOf(e);if(t<0)throw new Error("output link not found");this.outLinks.splice(t,1),this.requestSort()}canLinkTo(e,t,n){return e.canLinkFrom(this,t,n)}canLinkFrom(e,t,n){if(this.isOutput())return!1;const i=t>=0,s=n>=0;if(!e.isArray()&&i)throw new Error("non-array source property; can't link to element");if(!this.isArray()&&s)throw new Error("non-array destination property; can't link to element");const r=e.isArray()&&!i;return r===(this.isArray()&&!s)&&((!r||e.elementCount===this.elementCount)&&(!("object"===e.type&&"object"===this.type&&!function(e,t){if(!e||!t)return!1;let n=e.prototype;for(;n;){if(n===t.prototype)return!0;n=n.prototype}return!1}(e.schema.objectType,this.schema.objectType))&&(o=e.type,a=this.type,c[o][a])));var o,a}reset(){let e;if(this.isMulti()){let t=this.value;t?t.length=1:e=t=[],t[0]=this.clonePreset()}else e=this.clonePreset();this.setValue(e)}setMultiChannelCount(e){if(!this.isMulti())throw new Error("can't set multi channel count on non-multi property");const t=this.value,n=t.length;t.length=e;for(let i=n;i=e.length?0:t]||""}}isInput(){return this._group&&this._group===this._group.linkable.ins}isOutput(){return this._group&&this._group===this._group.linkable.outs}isArray(){return Array.isArray(this.schema.preset)}isMulti(){return!!this.schema.multi}isDefault(){const e=this.schema.multi?this.value[0]:this.value,t=this.schema.preset,n=Array.isArray(e)?e.length:-1;if(n!==(Array.isArray(t)?t.length:-1))return!1;if(n>=0){for(let i=0;i0||this.outLinks.length>0}hasInLinks(e){const t=this.inLinks;if(!(e>=0))return t.length>0;for(let n=0,i=t.length;n=0))return!0;return!1}hasOutLinks(e){const t=this.outLinks;if(!(e>=0))return t.length>0;for(let n=0,i=t.length;n0&&(e=e||{},e.links=this.outLinks.map((e=>{const t={id:e.destination._group.linkable.id,key:e.destination.key};return e.sourceIndex>=0&&(t.srcIndex=e.sourceIndex),e.destinationIndex>=0&&(t.dstIndex=e.destinationIndex),t}))),e}fromJSON(e,t){void 0!==e.value&&(this.value=e.value),void 0!==e.links&&e.links.forEach((e=>{t[e.id].ins[e.key].linkFrom(this,e.srcIndex,e.dstIndex)}))}toString(){const e=this.schema,t=e.event?"event":e.options?"enum":this.type;return`${this.path} [${t}]`}dump(e=""){console.log(e+`Property '${this.path}', key: ${this.key}, value: ${this.value}`)}validateValue(e){const t=this.schema;if(t.enum){const n=Math.trunc(e);return t.enum[n]?n:0}if(t.options){const n=Math.trunc(e);return n<0||n>=t.options.length?0:n}return"number"===this.type?(e=t.min?Math.max(t.min,e):e,e=t.max?Math.min(t.max,e):e):e}clonePreset(){const e=this.schema.preset;return Array.isArray(e)?e.slice():e}}},56166:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(82942),s=n(97444),r=n(26041),o=n(80038),a=n(90199),l=n(83275);class c extends i.Z{constructor(e){super({knownEvents:!1}),this.nodes=new s.Z(a.Z),this.components=new s.Z(o.ZP),this.registry=e||new r.Z,this.graph=new l.Z(this,null),this.graph.activate()}getComponent(e,t=!1){return this.components.get(e,t)}getComponents(e){return this.components.getArray(e)}getComponentsByTag(e){return this.components.getByTag(e)}hasComponents(e){return this.components.has(e)}getMainComponent(e,t=!1){return this.graph.components.get(e,t)}getMainComponents(e){return this.graph.components.getArray(e)}getMainComponentsByTag(e){return this.graph.components.getByTag(e)}hasMainComponents(e){return this.graph.components.has(e)}getNode(e,t=!1){return this.nodes.get(e,t)}getNodes(e){return this.nodes.getArray(e)}getNodesByTag(e){return this.nodes.getByTag(e)}hasNodes(e){return this.nodes.has(e)}getMainNode(e,t=!1){return this.graph.nodes.get(e,t)}getMainNodes(e){return this.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.graph.nodes.getByTag(e)}hasMainNodes(e){return this.graph.nodes.has(e)}findNodeByName(e,t){const n=this.nodes.getArray(t);for(let t=0,i=n.length;te.toString(!0))).join("\n"):i}_addNode(e){this.nodes.add(e)}_removeNode(e){this.nodes.remove(e)}_addNodeTag(e,t){this.nodes.addByTag(e,t)}_removeNodeTag(e,t){this.nodes.removeByTag(e,t)}_addComponent(e){if(e.isSystemSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per system`);this.components.add(e)}_removeComponent(e){this.components.remove(e)}_addComponentTag(e,t){this.components.addByTag(e,t)}_removeComponentTag(e,t){this.components.removeByTag(e,t)}}},63833:(e,t,n)=>{"use strict";n.d(t,{$:()=>i,Z:()=>a});var i,s=n(80038),r=n(90199),o=n(67171);!function(e){e[e.Node=0]="Node",e[e.Graph=1]="Graph",e[e.Main=2]="Main",e[e.System=3]="System"}(i||(i={}));class a extends s.ZP{constructor(){super(...arguments),this._scope=i.Node,this._scopedNode=null,this._scopedGraph=null,this._activeComponent=null}get componentType(){return this.constructor.componentType}get followComponentSelection(){return this.constructor.followComponentSelection}get followNodeSelection(){return this.constructor.followNodeSelection}get retainSelection(){return this.constructor.retainSelection}get scope(){return this._scope}set scope(e){this._scope=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null)}get scopedNode(){return this._scopedNode}set scopedNode(e){e!==this._scopedNode&&(this._scopedNode=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null),this.onScopedComponents(),this.emit({type:"scoped-components"}))}get scopedGraph(){return this._scopedGraph}set scopedGraph(e){e!==this._scopedGraph&&(this._scopedGraph=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null),this.onScopedComponents(),this.emit({type:"scoped-components"}))}get scopedComponents(){switch(this._scope){case i.Node:return(this._scopedNode||this.node).getComponents(this.componentType);case i.Graph:return(this._scopedGraph?this._scopedGraph.innerGraph:this.graph).getComponents(this.componentType);case i.Main:return this.getMainComponents(this.componentType);case i.System:return this.getSystemComponents(this.componentType)}}get activeComponent(){return this._activeComponent}set activeComponent(e){const t=this.activeComponent;if(e!==t){if(t&&this.deactivateComponent(t),e){if(!this.isComponentInScope(e))throw new Error("can't activate, component out of scope");this.activateComponent(e)}this._activeComponent=e,this.onActiveComponent(t,e),this.emit({type:"active-component",previous:t,next:e})}}get selection(){return this.getSystemComponent(o.Z)}create(){super.create(),this.system.components.on(s.ZP,this.onComponent,this),this.followComponentSelection&&this.selection.selectedComponents.on(this.componentType,this.onSelectComponent,this),this.followNodeSelection&&this.selection.selectedNodes.on(r.Z,this.onSelectNode,this)}dispose(){this.activeComponent&&(this.activeComponent=null),this.system.components.off(s.ZP,this.onComponent,this),this.followComponentSelection&&this.selection.selectedComponents.off(this.componentType,this.onSelectComponent,this),this.followNodeSelection&&this.selection.selectedNodes.off(r.Z,this.onSelectNode,this),super.dispose()}activateComponent(e){}deactivateComponent(e){}onActiveComponent(e,t){}onScopedComponents(){}onComponent(e){e.remove&&e.object===this.activeComponent&&(this.activeComponent=null),this.isComponentInScope(e.object)&&(this.onScopedComponents(),this.emit({type:"scoped-components"}))}onSelectComponent(e){const t=e.object;this.isComponentInScope(t)&&(e.add?this.activeComponent=t:e.remove&&!this.retainSelection&&t===this.activeComponent&&(this.activeComponent=null))}onSelectNode(e){const t=e.object;if(this.isNodeInScope(t)){const n=t.getComponent(this.componentType);n&&this.onSelectComponent({type:n.typeName,object:n,add:e.add,remove:e.remove})}}isComponentInScope(e){if(!e.is(this.componentType))return!1;switch(this._scope){case i.Node:const t=this._scopedNode||this.node;return e.node===t;case i.Graph:const n=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===n;case i.Main:return e.graph===this.system.graph;case i.System:return!0}return!1}isNodeInScope(e){switch(this._scope){case i.Node:return e===(this._scopedNode||this.node);case i.Graph:const t=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===t;case i.Main:return e.graph===this.system.graph;case i.System:return!0}}}a.typeName="CComponentProvider",a.componentType=s.ZP,a.followComponentSelection=!0,a.followNodeSelection=!1,a.retainSelection=!0},18894:(e,t,n)=>{"use strict";n.d(t,{V5:()=>i.V5,ZP:()=>r});var i=n(80038),s=n(83275);n(90199);class r extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(r.graphIns),this._innerGraph=null,this._innerRoot=null,this._innerGraph=new s.Z(this.system,this)}get innerGraph(){return this._innerGraph}get innerNodes(){return this._innerGraph.nodes}get innerComponents(){return this._innerGraph.components}get innerRoots(){return this._innerGraph.roots}getInnerComponent(e,t=!1){return this._innerGraph.components.get(e,t)}getInnerComponents(e){return this._innerGraph.components.getArray(e)}hasInnerComponent(e){return this._innerGraph.components.has(e)}getInnerNode(e,t=!1){return this._innerGraph.nodes.get(e,t)}getInnerNodes(e){return this._innerGraph.nodes.getArray(e)}hasInnerNode(e){return this._innerGraph.nodes.has(e)}isEmpty(){return 0===this._innerGraph.nodes.count()}update(e){const t=this.ins;if(t.active.changed){const e=t.active.value;e!==this._innerGraph.isActive&&(e?this.activateInnerGraph():this.deactivateInnerGraph())}return!0}tick(e){return this._innerGraph.tick(e)}tock(e){return this._innerGraph.tock(e)}dispose(){this._innerGraph.clear(),this._innerGraph=null,this._innerRoot=null,super.dispose()}clearInnerGraph(){this._innerGraph.clear()}fromJSON(e){super.fromJSON(e),this._innerGraph.clear(),this._innerGraph.fromJSON(e.graph)}toJSON(){const e=super.toJSON();return e.graph=this._innerGraph.toJSON(),e}dump(e=""){super.dump(e),this.innerGraph.dump(e+" ")}onAddInnerRoot(e){}onRemoveInnerRoot(e){}activateInnerGraph(){this._innerGraph.activate()}deactivateInnerGraph(){this._innerGraph.deactivate()}}r.typeName="CGraph",r.graphIns={active:i.V5.Boolean("Graph.Active",!0)}},3474:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(80038),s=(n(90199),n(18894));const r=(e,t,n)=>{let i;const s=e.children;for(let e=0,n=s.length;e{let i;const s=e.children;for(let e=0,n=s.length;e{let i=[];const s=e.children;for(let e=0,n=s.length;ee.node.dispose())),this._parent&&this._parent.removeChild(this),this.graph._removeRoot(this),super.dispose()}getRootComponent(e){let t=this;for(;t._parent;)t=t._parent;return t?t.node.components.get(e):null}getParentComponent(e,t){let n=this;for(;;){if(n=n._parent,!n){const e=this.graph.parent;n=e?e.components.get(l):void 0}if(!n)return;const i=n.node.components.get(e,!0);if(i)return i;if(!t)return}}getParentNode(e,t){let n=this;for(;;){if(n=n._parent,!n){const e=this.graph.parent;n=e?e.components.get(l):void 0}if(!n)return;const i=n.node;if(i.is(e))return i;if(!t)return}}getSiblingNode(e){return this.getSiblingNodes(e)[0]}getSiblingNodes(e){const t=this._parent;return this.graph.nodes.getArray(e).filter((e=>{const n=e.components.get(l);return(n?n._parent:null)==t}))}hasChildComponents(e,t){return r(this,e,t)}getChildComponent(e,t){return o(this,e,t)}getChildComponents(e,t){return a(this,e,t)}traverseUp(e,t,n,i){if(e)if(t){const e=this.node.components.getArray();for(let t=0,n=e.length;t(e.emit(n),n.stopPropagation)))}propagateDown(e,t,n){this.traverseDown(!0,e,t,(e=>(e.emit(n),n.stopPropagation)))}addChild(e){if(e===this)throw new Error("can't add self as child");if(e._parent)throw new Error("can't add child, component has a parent");if(e.graph!==this.graph)throw new Error("can't add child, component in different graph");e._parent=this,this._children.push(e),this.graph._removeRoot(e);const t={type:"hierarchy",add:!0,remove:!1,parent:this,child:e};this.traverseUp(!0,!1,!0,(e=>e.emit(t))),this.traverseDown(!1,!1,!0,(e=>e.emit(t))),this.system.emit(t)}removeChild(e){if(e._parent!==this)throw new Error("component not a child of this");const t={type:"hierarchy",add:!1,remove:!0,parent:this,child:e};this.traverseUp(!0,!1,!0,(e=>e.emit(t))),this.traverseDown(!1,!1,!0,(e=>e.emit(t))),this.system.emit(t);const n=this._children.indexOf(e);this._children.splice(n,1),e._parent=null,this.graph._addRoot(e)}onComponent(e){if(e.object===this)return;const t={type:"child",add:e.add,remove:e.remove,component:e.object};this.traverseUp(!0,!1,!0,(e=>e.emit(t)))}toJSON(){const e=super.toJSON();return this._children.length>0&&(e.children=this._children.map((e=>e.id))),e}referencesFromJSON(e){super.referencesFromJSON(e);const t=this.system.components.getDictionary();e.children&&e.children.forEach((e=>{const n=t[e];this.addChild(n)}))}toString(){return super.toString()+` - children: ${this.children.length}`}dump(e=""){super.dump(e),this.children.length>0&&(console.log(e+"%cChildren","color: purple"),this.children.forEach((t=>t.node.dump(e+" "))))}}l.typeName="CHierarchy"},92989:(e,t,n)=>{"use strict";n.d(t,{F:()=>i,Z:()=>a});var i,s=n(80038),r=n(90199),o=n(67171);!function(e){e[e.Graph=0]="Graph",e[e.Main=1]="Main",e[e.System=2]="System"}(i||(i={}));class a extends s.ZP{constructor(){super(...arguments),this._scope=i.Graph,this._scopedGraph=null,this._activeNode=null}get nodeType(){return this.constructor.nodeType}get followNodeSelection(){return this.constructor.followNodeSelection}get followComponentSelection(){return this.constructor.followComponentSelection}get retainSelection(){return this.constructor.retainSelection}get scope(){return this._scope}set scope(e){this._scope=e,this._activeNode&&!this.isNodeInScope(this._activeNode)&&(this.activeNode=null)}get scopedGraph(){return this._scopedGraph}set scopedGraph(e){e!==this._scopedGraph&&(this._scopedGraph=e,this._activeNode&&!this.isNodeInScope(this._activeNode)&&(this.activeNode=null),this.onScopedNodes(),this.emit({type:"scoped-nodes"}))}get scopedNodes(){switch(this._scope){case i.Graph:return(this._scopedGraph?this._scopedGraph.innerGraph:this.graph).getNodes(this.nodeType);case i.Main:return this.getMainNodes(this.nodeType);case i.System:return this.getSystemNodes(this.nodeType)}}get activeNode(){return this._activeNode}set activeNode(e){const t=this.activeNode;if(e!==t){if(t&&this.deactivateNode(t),e){if(!this.isNodeInScope(e))throw new Error("can't activate, node out of scope");this.activateNode(e)}this._activeNode=e,this.onActiveNode(t,e),this.emit({type:"active-node",previous:t,next:e})}}get selection(){return this.getSystemComponent(o.Z)}create(){super.create(),this.system.nodes.on(r.Z,this.onNode,this),this.followNodeSelection&&this.selection.selectedNodes.on(this.nodeType,this.onSelectNode,this),this.followComponentSelection&&this.selection.selectedComponents.on(s.ZP,this.onSelectComponent,this)}dispose(){this.activeNode&&(this.activeNode=null),this.system.nodes.off(r.Z,this.onNode,this),this.followNodeSelection&&this.selection.selectedNodes.off(this.nodeType,this.onSelectNode,this),this.followComponentSelection&&this.selection.selectedComponents.off(s.ZP,this.onSelectComponent,this),super.dispose()}activateNode(e){}deactivateNode(e){}onActiveNode(e,t){}onScopedNodes(){}onNode(e){e.remove&&e.object===this.activeNode&&(this.activeNode=null),this.isNodeInScope(e.object)&&(this.onScopedNodes(),this.emit({type:"scoped-nodes"}))}onSelectNode(e){const t=e.object;this.isNodeInScope(t)&&(e.add?this.activeNode=t:e.remove&&!this.retainSelection&&t===this.activeNode&&(this.activeNode=null))}onSelectComponent(e){const t=e.object.node;t.is(this.nodeType)&&this.onSelectNode({type:t.typeName,object:t,add:e.add,remove:e.remove})}isNodeInScope(e){if(!e.is(this.nodeType))return!1;switch(this._scope){case i.Graph:const t=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===t;case i.Main:return e.graph===this.system.graph;case i.System:return!0}return!1}}a.typeName="CNodeProvider",a.nodeType=r.Z,a.followNodeSelection=!0,a.followComponentSelection=!1,a.retainSelection=!0},26220:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(e,t){super(e,t),this.outs=this.addOutputs(s.pulseOuts),this._tockUpdated=!1,this.addEvent("pulse"),this.onAnimationFrame=this.onAnimationFrame.bind(this),this.context={time:new Date,secondsElapsed:0,secondsDelta:0,frameNumber:0},this._secondsStarted=.001*Date.now(),this._secondsStopped=this._secondsStarted,this._animHandler=0,this._pulseEvent={type:"pulse",context:this.context,systemUpdated:!1}}start(){0===this._animHandler&&(this._secondsStopped>0&&(this._secondsStarted+=.001*Date.now()-this._secondsStopped,this._secondsStopped=0),this._animHandler=window.requestAnimationFrame(this.onAnimationFrame))}stop(){0!==this._animHandler&&(0===this._secondsStopped&&(this._secondsStopped=.001*Date.now()),window.cancelAnimationFrame(this._animHandler),this._animHandler=0)}pulse(e){const{outs:t,context:n,_pulseEvent:i}=this;n.time.setTime(e);const s=.001*e-this._secondsStarted;n.secondsDelta=s-n.secondsElapsed,n.secondsElapsed=s,n.frameNumber++,t.time.setValue(n.secondsElapsed),t.frame.setValue(n.frameNumber);const r=this.system.graph.tick(n);i.systemUpdated=r||this._tockUpdated,this.emit(i),this._tockUpdated=this.system.graph.tock(n)}onAnimationFrame(){this.pulse(Date.now()),this._animHandler=window.requestAnimationFrame(this.onAnimationFrame)}}s.typeName="CPulse",s.isSystemSingleton=!0,s.pulseOuts={time:i.V5.Number("Pulse.Time"),frame:i.V5.Integer("Pulse.Frame")}},67171:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(97444),s=n(89809),r=n(80038),o=n(90199),a=n(18894);n(96561);class l extends r.ZP{createActions(e){return{}}}l.typeName="CController",l.isSystemSingleton=!0;class c extends l{constructor(e,t){super(e,t),this.outs=this.addOutputs(c.selOuts),this.multiSelect=!1,this.exclusiveSelect=!0,this.selectedNodes=new i.Z(o.Z),this.selectedComponents=new i.Z(r.ZP),this._activeGraph=null,this.addEvents("select-node","select-component","active-graph","update"),this.selectedNodes.on(o.Z,(e=>this.onSelectNode(e.object,e.add))),this.selectedComponents.on(r.ZP,(e=>this.onSelectComponent(e.object,e.add))),this._activeGraph=this.system.graph}getSelectedNode(e){return this.selectedNodes.get(e,!0)}getSelectedNodes(e){return this.selectedNodes.getArray(e)}getSelectedComponent(e){return this.selectedComponents.get(e,!0)}getSelectedComponents(e){return this.selectedComponents.getArray(e)}get activeGraph(){return this._activeGraph}set activeGraph(e){if(e!==this.activeGraph){this.clearSelection();const t=this._activeGraph;this._activeGraph=e,this.onActiveGraph(e),this.emit({type:"active-graph",previous:t,next:e})}}hasParentGraph(){return this._activeGraph&&this._activeGraph.parent}activateParentGraph(){this._activeGraph&&this._activeGraph.parent.graph&&(this.activeGraph=this._activeGraph.parent.graph)}hasChildGraph(){return this.selectedComponents.has(a.ZP)}activateChildGraph(){const e=this.selectedComponents.get(a.ZP,!0);e&&(this.activeGraph=e.innerGraph)}create(){super.create(),this.system.nodes.on(o.Z,this.onSystemNode,this),this.system.components.on(r.ZP,this.onSystemComponent,this)}dispose(){this.system.nodes.off(o.Z,this.onSystemNode,this),this.system.components.off(r.ZP,this.onSystemComponent,this),super.dispose()}createActions(e){return{selectNode:e.register({name:"Select Node",do:this.selectNode,target:this}),selectComponent:e.register({name:"Select Component",do:this.selectComponent,target:this}),clearSelection:e.register({name:"Clear Selection",do:this.clearSelection,target:this})}}nodeContainsSelectedComponent(e){const t=e.components.getArray();for(let e=0,n=t.length;e{"use strict";n.d(t,{P:()=>r,Z:()=>c});const i=Math.PI,s=.5*i;var r;!function(e){e[e.Linear=0]="Linear",e[e.EaseQuad=1]="EaseQuad",e[e.EaseInQuad=2]="EaseInQuad",e[e.EaseOutQuad=3]="EaseOutQuad",e[e.EaseCubic=4]="EaseCubic",e[e.EaseInCubic=5]="EaseInCubic",e[e.EaseOutCubic=6]="EaseOutCubic",e[e.EaseQuart=7]="EaseQuart",e[e.EaseInQuart=8]="EaseInQuart",e[e.EaseOutQuart=9]="EaseOutQuart",e[e.EaseQuint=10]="EaseQuint",e[e.EaseInQuint=11]="EaseInQuint",e[e.EaseOutQuint=12]="EaseOutQuint",e[e.EaseSine=13]="EaseSine",e[e.EaseInSine=14]="EaseInSine",e[e.EaseOutSine=15]="EaseOutSine"}(r||(r={}));const o={Linear:function(e){return e},EaseQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},EaseInQuad:function(e){return e*e},EaseOutQuad:function(e){return e*(2-e)},EaseCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},EaseInCubic:function(e){return e*e*e},EaseOutCubic:function(e){return--e*e*e+1},EaseQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},EaseInQuart:function(e){return e*e*e*e},EaseOutQuart:function(e){return 1- --e*e*e*e},EaseQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},EaseInQuint:function(e){return e*e*e*e*e},EaseOutQuint:function(e){return 1+--e*e*e*e*e},EaseSine:function(e){return-.5*(Math.cos(e*i)-1)},EaseInSine:function(e){return 1-Math.cos(e*s)},EaseOutSine:function(e){return Math.sin(e*s)}};var a=n(80038),l=n(84292);class c extends a.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.ins),this.outs=this.addOutputs(c.outs),this.targets=[],this.states={},this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null}getState(e){return this.states[e]}setState(e){return e.id=e.id||(0,l.Z)(6),this.states[e.id]=e,e.id}deleteState(e){delete this.states[e]}clear(){this.targets.forEach((e=>e.property.off("dispose",this.onPropertyDispose,this))),this.targets.length=0,this.states={},this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null}dispose(){this.clear(),super.dispose()}tweenTo(e,t){const n=this.states[e],i=this.outs;if(n)return this._targetState=n,this._currentValues=this.getCurrentValues(),this._startTime=t,this._easingFunction=(s=n.curve,o[r[s]]),i.switched.setValue(!1),i.tweening.setValue(!0),i.start.set(),!0;var s}update(e){const t=this.ins,n=this.states,i=t.id.value,s=n[i];if(s){if((t.tween.changed||t.recall.changed)&&(t.curve.setValue(s.curve),t.duration.setValue(s.duration),t.threshold.setValue(s.threshold)),t.tween.changed)return this.tweenTo(i,e.secondsElapsed),!0;if(t.recall.changed)return this.setValues(s.values),!0;(t.curve.changed||t.duration.changed||t.threshold.changed)&&(s.curve=t.curve.value,s.duration=t.duration.value,s.threshold=t.threshold.value),t.store.changed&&(s.values=this.getCurrentValues()),t.delete.changed&&delete n[i]}else if(i&&t.store.changed){const e={id:this.ins.id.value,curve:this.ins.curve.getValidatedValue(),duration:this.ins.duration.value,threshold:this.ins.threshold.value,values:this.getCurrentValues()};n[e.id]=e}return!0}tick(e){const t=this._targetState;if(!t)return!1;const n=this.outs,i=this._currentValues,s=this._startTime,r=e.secondsElapsed-s,o=r/t.duration;if(o<1){const e=this._easingFunction(o),s=o>=t.threshold&&!n.switched.value;this.setValues(i,t.values,e,s),n.time.setValue(r),n.completed.setValue(o),s&&(n.switched.setValue(!0),n.switch.set())}else this.setValues(i,t.values,1,!n.switched.value),n.tweening.setValue(!1),n.time.setValue(t.duration),n.completed.setValue(1),n.end.set(),n.switched.value||n.switched.setValue(!0),this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null;return!0}addTargetProperty(e){if("object"===e.type||e.schema.event)throw new Error("can't add object or event properties");if(this.getTarget(e))throw new Error("can't add, target already exists");e.on("dispose",this.onPropertyDispose,this);const t="number"===e.type&&!e.schema.options,n=e.isArray();this.targets.push({property:e,isNumber:t,isArray:n});const i=this.states,s=Object.keys(i);for(let t=0,n=s.length;t{const t=this.getProperty(e.id,e.key);return{property:t,isNumber:!!t&&"number"===t.type&&!t.schema.options,isArray:!!t&&t.isArray()}}))),e.states&&e.states.forEach((e=>this.states[e.id]=e)),this._startTime=0}toJSON(){const e=super.toJSON(),t=this.stateToJSON();return t&&(e.state=t),e}stateToJSON(){const e={},t=this.targets;t.length>0&&(e.targets=t.map((e=>({id:e.property.group.linkable.id,key:e.property.key}))));const n=Object.keys(this.states);return n.length>0&&(e.states=n.map((e=>this.states[e]))),e}getTargetProperties(){return this.targets.map((e=>e.property))}onPropertyDispose(e){e.property.off("dispose",this.onPropertyDispose,this);const t=this.getTarget(e.property);this.removeTarget(t)}removeTarget(e){const t=this.targets.indexOf(e);this.targets.splice(t,1),this.removeChannel(t)}removeChannel(e){const t=this.states,n=Object.keys(t);for(let i=0,s=n.length;it.property===e))}getProperty(e,t){const n=this.system.components.getById(e);return n?n.ins[t]:null}setValues(e,t,n,i){const s=this.targets;for(let r=0,o=s.length;r{"use strict";n.d(t,{V5:()=>l});var i=n(82507);const s={xyzw:["X","Y","Z","W"],rgba:["R","G","B","A"]},r=function(e){return void 0===e||"object"==typeof e&&!Array.isArray(e)?e:{preset:e}},o=function(e,t,n){return{path:t,schema:(n=r(n))?Object.assign({},e,n):e}},a={Number:{preset:0},Integer:{preset:0,step:1,speed:.34,precision:0},Natural:{preset:0,step:1,speed:.34,precision:0,min:0},Unit:{preset:0,min:0,max:1,bar:!0},Percent:{preset:0,min:0,max:1,bar:!0,percent:!0},Vector2:{preset:[0,0]},Vector3:{preset:[0,0,0]},Vector4:{preset:[0,0,0,0]},Matrix2:{preset:[1,0,0,1]},Matrix3:{preset:[1,0,0,0,1,0,0,0,1]},Matrix4:{preset:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Scale:{preset:1},Scale2:{preset:[1,1]},Scale3:{preset:[1,1,1]},IntVec2:{preset:[0,0],step:1,speed:.34,precision:0},IntVec3:{preset:[0,0,0],step:1,speed:.34,precision:0},ColorRGB:{preset:[1,1,1],semantic:"color",labels:s.rgba,min:0,max:1,bar:!0},ColorRGBA:{preset:[1,1,1,1],semantic:"color",labels:s.rgba,min:0,max:1,bar:!0},Boolean:{preset:!1},String:{preset:""},AssetPath:{preset:"",semantic:"asset-path"},Object:{preset:null,objectType:Object},Event:{preset:0,event:!0}},l={Property:(e,t)=>o(void 0,e,t),Number:(e,t)=>o(a.Number,e,t),Integer:(e,t)=>o(a.Integer,e,t),Natural:(e,t)=>o(a.Natural,e,t),Unit:(e,t)=>o(a.Unit,e,t),Percent:(e,t)=>o(a.Percent,e,t),Vector2:(e,t)=>o(a.Vector2,e,t),Vector3:(e,t)=>o(a.Vector3,e,t),Vector4:(e,t)=>o(a.Vector4,e,t),IntVec2:(e,t)=>o(a.IntVec2,e,t),IntVec3:(e,t)=>o(a.IntVec3,e,t),Matrix2:(e,t)=>o(a.Matrix2,e,t),Matrix3:(e,t)=>o(a.Matrix3,e,t),Matrix4:(e,t)=>o(a.Matrix4,e,t),Scale:(e,t)=>o(a.Scale,e,t),Scale2:(e,t)=>o(a.Scale2,e,t),Scale3:(e,t)=>o(a.Scale3,e,t),ColorRGB:(e,t)=>o(a.ColorRGB,e,t),ColorRGBA:(e,t)=>o(a.ColorRGBA,e,t),Boolean:(e,t)=>o(a.Boolean,e,t),String:(e,t)=>o(a.String,e,t),AssetPath:(e,t)=>o(a.AssetPath,e,t),Enum:(e,t,n)=>function(e,t,n){n=r(n);const s={enum:e,options:(0,i.q)(e),preset:0};return{path:t,schema:n?Object.assign({},s,n):s}}(t,e,n),Option:(e,t,n)=>function(e,t,n){const i={options:e,preset:0};return{path:t,schema:(n=r(n))?Object.assign({},i,n):i}}(t,e,n),Object:(e,t,n)=>function(e,t,n){const i={preset:null,objectType:e};return{path:t,schema:(n=r(n))?Object.assign({},i,n):i}}(t,e,n),Event:(e,t)=>o(a.Event,e,t)}},87156:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o,t:()=>i});var i,s=n(26775),r=n(73130);!function(e){e[e.Single=0]="Single",e[e.HorizontalSplit=1]="HorizontalSplit",e[e.VerticalSplit=2]="VerticalSplit",e[e.Quad=3]="Quad"}(i||(i={}));class o extends r.Z{constructor(e,t,n){super(e,t,n),this._layout=i.Quad,this._horizontalSplit=.5,this._verticalSplit=.5,this.addEvent("layout"),this.layout=i.Single}set layout(e){if(e===this._layout)return;this._layout=e;const t=this.viewports;switch(this._layout){case i.Single:this.setViewportCount(1);break;case i.HorizontalSplit:case i.VerticalSplit:this.setViewportCount(2);break;case i.Quad:this.setViewportCount(4)}this.updateSplitPositions(),t[1]&&(t[1].setBuiltInCamera(s.mP.Orthographic,s.LY.Top),t[1].enableCameraControl(!0).orientationEnabled=!1),t[2]&&(t[2].setBuiltInCamera(s.mP.Orthographic,s.LY.Left),t[2].enableCameraControl(!0).orientationEnabled=!1),t[3]&&(t[3].setBuiltInCamera(s.mP.Orthographic,s.LY.Front),t[3].enableCameraControl(!0).orientationEnabled=!1),this.emit({type:"layout",layout:e})}get layout(){return this._layout}set horizontalSplit(e){this._horizontalSplit=e,this.updateSplitPositions()}get horizontalSplit(){return this._horizontalSplit}set verticalSplit(e){this._verticalSplit=e,this.updateSplitPositions()}get verticalSplit(){return this._verticalSplit}updateSplitPositions(){const e=this._horizontalSplit,t=this._verticalSplit;switch(this._layout){case i.Single:this.viewports[0].setSize(0,0,1,1);break;case i.HorizontalSplit:this.viewports[0].setSize(0,0,e,1),this.viewports[1].setSize(e,0,1-e,1);break;case i.VerticalSplit:this.viewports[0].setSize(0,1-t,1,t),this.viewports[1].setSize(0,0,1,1-t);break;case i.Quad:this.viewports[0].setSize(0,1-t,e,t),this.viewports[1].setSize(e,1-t,1-e,t),this.viewports[2].setSize(0,0,e,1-t),this.viewports[3].setSize(e,0,1-e,1-t)}}}},73130:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var i=n(64702),s=n(7177),r=n(75544),o=n(82942),a=n(3474),l=n(73902),c=n(12197),h=n(26060),d=n(15271),u=n(26775);class p extends o.Z{constructor(e,t,n){super(),this.viewports=[],this.rendererComponent=null,this.targetViewport=null,this.targetObject3D=null,this.targetComponent=null,this.targetScene=null,this.targetCamera=null,this.defaultScene=new i.x,this.defaultCamera=new u.ZP,this.system=e,this.canvas=t,this.overlay=n,this.renderer=new s.C({canvas:t,antialias:!0}),this.renderer.autoClear=!1,this.renderer.outputColorSpace=r.KI_,this.picker=new h.Z(this.renderer)}dispose(){this.renderer.dispose(),this.viewports.forEach((e=>e.dispose()))}get canvasWidth(){return this.canvas.width}get canvasHeight(){return this.canvas.height}attach(){const e=this.canvasWidth,t=this.canvasHeight;this.viewports.forEach((n=>n.setCanvasSize(e,t))),this.renderer.setSize(e,t,!1),this.rendererComponent=this.system.getComponent(d.Z,!0),this.rendererComponent.attachView(this)}detach(){this.rendererComponent=this.system.getComponent(d.Z,!0),this.rendererComponent.detachView(this),this.rendererComponent=null}renderImage(e,t,n,i){const s=this.canvas.width,r=this.canvas.height;this.setRenderSize(e,t),this.render();const o=this.canvas.toDataURL(n,i);return this.setRenderSize(s,r),o}render(){const e=this.rendererComponent.activeSceneComponent;if(!e)return;let t=e.scene,n=e.activeCamera;t&&n||(t=this.defaultScene,n=this.defaultCamera);const i=this.renderer;i.clear(),i.__view=this;const s=this.viewports;for(let e=0,r=s.length;en.setCanvasSize(e,t))),this.renderer.xr.isPresenting||this.renderer.setSize(e,t,!1)}resize(){this.setRenderSize(this.canvas.clientWidth,this.canvas.clientHeight),this.renderer.xr.isPresenting||this.render()}setViewportCount(e){const t=this.viewports;for(let n=e;n{"use strict";n.d(t,{u:()=>h,Z:()=>g});var i=n(2837),s=n(8035),r=n(75809),o=n(56963),a=n(31599),l=n(44428);class c extends l.j{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}var h,d=n(19588),u=n(93113);!function(e){e[e.Solid=0]="Solid",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"}(h||(h={}));class p extends s.K{constructor(){super(new m,new f),this.frustumCulled=!1,this.renderOrder=-1/0,this.matrixAutoUpdate=!1}dispose(){this.geometry.dispose(),this.material.dispose()}updateMatrixWorld(e){}}class m extends r.u{constructor(){super();const e=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),t=new o.v(e,5);this.setIndex([0,1,2,0,2,3]),this.setAttribute("position",new a.k(t,3,0,!1)),this.setAttribute("uv",new a.k(t,2,3,!1))}}class f extends c{constructor(){super(...arguments),this.depthTest=!1,this.depthWrite=!1,this.transparent=!1,this.uniforms={style:{value:h.LinearGradient},color0:{value:new d.P(.15,.2,.25)},color1:{value:new d.P(0,0,0)},noise:{value:.02}},this.vertexShader=["precision highp float;","attribute vec3 position;","attribute vec2 uv;","varying vec2 ndc;","void main() {"," ndc = position.xy;"," gl_Position = vec4(position, 1.0);","}"].join("\n"),this.fragmentShader=["precision highp float;","uniform vec3 color0;","uniform vec3 color1;","uniform float noise;","uniform int style;","varying vec2 ndc;","float rand(vec2 co) {","float dt = dot(co.xy ,vec2(12.9898, 78.233));","float sn = mod(dt, 3.14);","return fract(sin(sn) * 43758.5453);","}","void main() {"," float f = style == 0 ? 0.0 : (style == 1 ? ndc.y * 0.5 + 0.5 : length(ndc) * 0.707);"," gl_FragColor = vec4(mix(color0, color1, f) + noise * rand(ndc), 1.0);","}"].join("\n")}set style(e){this.uniforms.style.value=e}get style(){return this.uniforms.style.value}set color0(e){if(e instanceof u.I){const t=this.uniforms.color0.value;t.x=e.r,t.y=e.g,t.z=e.b}else this.uniforms.color0.value.copy(e)}get color0(){return this.uniforms.color0.value}set color1(e){if(e instanceof u.I){const t=this.uniforms.color1.value;t.x=e.r,t.y=e.g,t.z=e.b}else this.uniforms.color1.value.copy(e)}get color1(){return this.uniforms.color1.value}set noise(e){this.uniforms.noise.value=e}get noise(){return this.uniforms.noise.value}}class g extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(g.backgroundIns),this.object3D=new p}get background(){return this.object3D}update(e){super.update(e);const t=this.ins,n=this.background.material;return t.style.changed&&(n.style=t.style.getValidatedValue()),t.color0.changed&&n.color0.fromArray(t.color0.value),t.color1.changed&&n.color1.fromArray(t.color1.value),t.noise.changed&&(n.noise=t.noise.value),!0}dispose(){this.background.dispose(),super.dispose()}}g.typeName="CBackground",g.backgroundIns={style:i.V5.Enum("Background.Style",h,h.RadialGradient),color0:i.V5.ColorRGB("Background.Color0",[.2,.25,.3]),color1:i.V5.ColorRGB("Background.Color1",[.01,.03,.05]),noise:i.V5.Number("Background.Noise",{min:0,max:1,bar:!0,preset:.02})}},76288:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(77656),s=n(80038),r=n(16967);class o extends r.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(o.dirLightIns),this.object3D=new i.O,this.light.target.matrixAutoUpdate=!1}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;if((n.color.changed||n.intensity.changed)&&(t.intensity=n.intensity.value*Math.PI),(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.target.position.fromArray(n.target.value),t.updateMatrix(),t.target.updateMatrix()),n.shadowSize.changed){const e=t.shadow.camera,i=.5*n.shadowSize.value;e.left=e.bottom=-i,e.right=e.top=i,e.near=.05*n.shadowSize.value,e.far=50*n.shadowSize.value,e.updateProjectionMatrix()}return!0}onAddToParent(e){super.onAddToParent(e),e.add(this.light.target)}onRemoveFromParent(e){super.onRemoveFromParent(e),e.remove(this.light.target)}}o.typeName="CDirectionalLight",o.dirLightIns={position:s.V5.Vector3("Light.Position"),target:s.V5.Vector3("Light.Target",[0,-1,0]),shadowSize:s.V5.Number("Shadow.Size",100)}},38080:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(s.ins),this.outs=this.addOutputs(s.outs),this._fullscreenElement=null,this.onFullscreenChange=this.onFullscreenChange.bind(this);const n=document.documentElement,i=n.requestFullscreen||n.mozRequestFullScreen||n.webkitRequestFullscreen;this.outs.fullscreenAvailable.setValue(!!i),this.ins.toggle.on("value",this.toggle,this)}get fullscreenElement(){return this._fullscreenElement}set fullscreenElement(e){e!==this._fullscreenElement&&(this._fullscreenElement&&this._fullscreenElement.removeEventListener("fullscreenchange",this.onFullscreenChange),this._fullscreenElement=e,e&&e.addEventListener("fullscreenchange",this.onFullscreenChange))}update(e){return!0}toggle(){const e=this.outs,t=this._fullscreenElement;if(t){const n=e.fullscreenActive.value;if(!n&&e.fullscreenAvailable.value)t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else if(n){const e=document;e.exitFullscreen?e.exitFullscreen():e.cancelFullScreen?e.cancelFullScreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()}}}onFullscreenChange(e){const t=document,n=t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement;this.outs.fullscreenActive.setValue(!!n)}}s.typeName="CFullscreen",s.ins={toggle:i.V5.Event("Fullscreen.Toggle")},s.outs={fullscreenAvailable:i.V5.Boolean("Fullscreen.Available",!1),fullscreenActive:i.V5.Boolean("Fullscreen.Active",!1)}},16967:(e,t,n)=>{"use strict";n.d(t,{B:()=>i,Z:()=>a});var i,s=n(80038),r=n(2837);!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(i||(i={}));const o={[i.Low]:512,[i.Medium]:1024,[i.High]:2048};class a extends r.ZP{constructor(){super(...arguments),this.ins=this.addInputs(a.lightIns)}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;if((n.color.changed||n.intensity.changed)&&(t.color.fromArray(n.color.value),t.intensity=n.intensity.value),"shadow"in t&&(n.shadowEnabled.changed&&(t.castShadow=n.shadowEnabled.value),n.shadowBlur.changed&&(t.shadow.radius=n.shadowBlur.value),n.shadowResolution.changed)){const e=o[n.shadowResolution.getValidatedValue()];t.shadow.mapSize.set(e,e),t.shadow.map=null}return!0}}a.typeName="CLight",a.lightIns={color:s.V5.ColorRGB("Light.Color"),intensity:s.V5.Number("Light.Intensity",1),shadowEnabled:s.V5.Boolean("Shadow.Enabled"),shadowResolution:s.V5.Enum("Shadow.Resolution",i,i.Medium),shadowBlur:s.V5.Number("Shadow.Blur",1)}},2837:(e,t,n)=>{"use strict";n.d(t,{V5:()=>r.V5,VZ:()=>l.VZ,ZP:()=>h});var i=n(19588),s=n(71050),r=n(80038),o=n(26060),a=n(36283),l=n(92642);const c=new i.P;class h extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(h.object3DIns),this.outs=this.addOutputs(h.object3DOuts),this._object3D=null,this._isPickable=!1,this.addEvent("object"),this.node.components.on(this.parentComponentClass,this._onParent,this)}get parentComponentClass(){return this.constructor.parentComponentClass}get parentComponent(){return this.node.components.get(this.parentComponentClass,!0)}get transform(){return this.node.components.get(l.ZP,!0)}get scene(){const e=this.transform;return e?e.getParentComponent(a.Z,!0):void 0}get object3D(){return this._object3D}set object3D(e){const t=this._object3D;if(t&&(t.userData.component=null,this.unregisterPickableObject3D(t,!0),t.parent&&this.onRemoveFromParent(t.parent)),this.emit({type:"object",current:t,next:e}),this._object3D=e,e){e.userData.component=this,e.matrixAutoUpdate=!1,e.visible=this.ins.visible.value,this.registerPickableObject3D(e,!0);const t=this.parentComponent;t&&this.onAddToParent(t.object3D)}}update(e){const{visible:t,pickable:n}=this.ins;return t.changed&&this._object3D&&(this._object3D.visible=t.value),n.changed&&n.value!==this._isPickable&&(this._isPickable=n.value,n.value?this.enablePointerEvents():this.disablePointerEvents()),!0}dispose(){this.object3D=null,this.ins.pickable.value&&this.disablePointerEvents(),this.node.components.off(this.parentComponentClass,this._onParent,this),super.dispose()}preRender(e){}postRender(e){}toString(){return super.toString()+(this._object3D?` - type: ${this._object3D.type}`:" - (null)")}onPointer(e){const t=this.outs;"pointer-down"===e.type?(t.pointerDown.set(),t.pointerActive.setValue(!0)):"pointer-up"===e.type&&(t.pointerUp.set(),t.pointerActive.setValue(!1)),e.stopPropagation=!0}enablePointerEvents(){this.on("pointer-down",this.onPointer,this),this.on("pointer-up",this.onPointer,this)}disablePointerEvents(){this.off("pointer-down",this.onPointer,this),this.off("pointer-up",this.onPointer,this);const e=this.outs;e.pointerActive.value&&(e.pointerUp.set(),e.pointerActive.setValue(!1))}updateTransform(){const e=this._object3D;if(!e)return;const{position:t,rotation:n,order:i,scale:r}=this.ins;if(t.changed||n.changed||i.changed||r.changed){e.position.fromArray(t.value),c.fromArray(n.value).multiplyScalar(s.M8.DEG2RAD);const o=i.getOptionText();e.rotation.setFromVector3(c,o),e.scale.fromArray(r.value),e.updateMatrix()}return!0}onAddToParent(e){e.add(this._object3D)}onRemoveFromParent(e){e.remove(this._object3D)}addObject3D(e){this._object3D.add(e),this.registerPickableObject3D(e,!0)}removeObject3D(e){this.unregisterPickableObject3D(e,!0),this._object3D.remove(e)}registerPickableObject3D(e,t){o.Z.add(e,t)}unregisterPickableObject3D(e,t){o.Z.remove(e,t)}_onParent(e){this._object3D&&!this._object3D.parent&&e.add&&this.onAddToParent(e.object.object3D)}}h.typeName="CObject3D",h.parentComponentClass=l.ZP,h.object3DIns={visible:r.V5.Boolean("Object.Visible",!0),pickable:r.V5.Boolean("Object.Pickable")},h.object3DOuts={pointerDown:r.V5.Event("Pointer.Down"),pointerUp:r.V5.Event("Pointer.Up"),pointerActive:r.V5.Boolean("Pointer.Active")},h.transformIns=l.ZP.transformIns,h.prototype.preRender=null,h.prototype.postRender=null},18345:(e,t,n)=>{"use strict";n.d(t,{Z:()=>W});var i=n(80038),s=n(52226),r=n(67171),o=n(19588),a=n(82587),l=n(28092),c=n(37840),h=n(75809),d=n(35322),u=n(64026),p=n(93113),m=n(79961);const f=new o.P,g=new a.y;class v extends l.e{constructor(e,t){t=Object.assign({},v.defaultProps,t);const n=new c.Z;n.makeEmpty(),(0,m.sN)(e,n);const i=t.length,s=[n.min.x,n.min.y,n.min.z],r=[n.max.x,n.max.y,n.max.z],o=[(r[0]-s[0])*i,(r[1]-s[1])*i,(r[2]-s[2])*i];let a;a=isFinite(o[0])&&isFinite(o[1])&&isFinite(o[2])?[s[0],s[1],s[2],s[0]+o[0],s[1],s[2],s[0],s[1],s[2],s[0],s[1]+o[1],s[2],s[0],s[1],s[2],s[0],s[1],s[2]+o[2],r[0],s[1],s[2],r[0]-o[0],s[1],s[2],r[0],s[1],s[2],r[0],s[1]+o[1],s[2],r[0],s[1],s[2],r[0],s[1],s[2]+o[2],s[0],r[1],s[2],s[0]+o[0],r[1],s[2],s[0],r[1],s[2],s[0],r[1]-o[1],s[2],s[0],r[1],s[2],s[0],r[1],s[2]+o[2],s[0],s[1],r[2],s[0]+o[0],s[1],r[2],s[0],s[1],r[2],s[0],s[1]+o[1],r[2],s[0],s[1],r[2],s[0],s[1],r[2]-o[2],s[0],r[1],r[2],s[0]+o[0],r[1],r[2],s[0],r[1],r[2],s[0],r[1]-o[1],r[2],s[0],r[1],r[2],s[0],r[1],r[2]-o[2],r[0],s[1],r[2],r[0]-o[0],s[1],r[2],r[0],s[1],r[2],r[0],s[1]+o[1],r[2],r[0],s[1],r[2],r[0],s[1],r[2]-o[2],r[0],r[1],s[2],r[0]-o[0],r[1],s[2],r[0],r[1],s[2],r[0],r[1]-o[1],s[2],r[0],r[1],s[2],r[0],r[1],s[2]+o[2],r[0],r[1],r[2],r[0]-o[0],r[1],r[2],r[0],r[1],r[2],r[0],r[1]-o[1],r[2],r[0],r[1],r[2],r[0],r[1],r[2]-o[2]]:[-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1,0,0,1];const l=new h.u;l.setAttribute("position",new d.a$(a,3));super(l,new u.n({color:t.color,depthTest:!1})),this.renderOrder=1,this.onBeforeRender=()=>{e.updateMatrixWorld(!1),this.matrixWorld.copy(e.matrixWorld)}}dispose(){this.parent&&this.parent.remove(this),this.geometry.dispose()}static expandBoundingBox(e,t,n){const i=e.geometry;if(void 0!==i){let s=e;for(g.identity();s&&s!==t;)g.premultiply(s.matrix),s=s.parent;if(i.isGeometry){const e=i.vertices;for(let t=0,i=e.length;t0)&&m.push(t,s,a),(e!==n-1||l.9&&o<.1&&(t<.2&&(r[e+0]+=1),n<.2&&(r[e+2]+=1),i<.2&&(r[e+4]+=1))}}()}(),this.setAttribute("position",new d.a$(s,3)),this.setAttribute("normal",new d.a$(s.slice(),3)),this.setAttribute("uv",new d.a$(r,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new k(e.vertices,e.indices,e.radius,e.details)}}class V extends k{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new V(e.radius,e.detail)}}const z=new o.P,F=new p.I,B=new p.I;class $ extends x.T{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new V(t);i.rotateY(.5*Math.PI),this.material=new P.v({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),r=new Float32Array(3*s.count);i.setAttribute("color",new d.Tl(r,3)),this.add(new A.K(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");F.copy(this.light.color),B.copy(this.light.groundColor);for(let e=0,n=t.count;e{e.on("after-render",this.onSceneAfterRender,this)}),(e=>{e.off("after-render",this.onSceneAfterRender,this)}))}dispose(){this._sceneTracker.dispose(),this.system.off("pointer-up",this.onPointerUp,this),this._sceneTracker.dispose(),super.dispose()}update(){return!0}onSelectNode(e,t){super.onSelectNode(e,t);const n=e.getComponent(b.ZP,!0);n&&this.updateBracket(n,t)}onSelectComponent(e,t){super.onSelectComponent(e,t),(e instanceof y.ZP||e instanceof b.ZP)&&this.updateBracket(e,t)}onPointerUp(e){this.ins.viewportPicking.value&&e.isPrimary&&!e.isDragging&&(e.component?this.selectComponent(e.component,e.ctrlKey):e.ctrlKey||this.clearSelection())}onSceneAfterRender(e){if(!this.ins.viewportBrackets.value)return;const t=e.context.renderer,n=e.context.camera;for(let e of this._brackets.values())G.some((([t])=>e instanceof t))&&(e.update(),e.updateWorldMatrix(!0,!1)),t.render(e,n)}updateBracket(e,t){if(e){if(t){const t=e.object3D;if(t){let n;for(let[e,i]of G)t.children[0]instanceof i&&(n=new e(t.children[0],1),n.updateWorldMatrix(!0,!1));n||(n=new v(e.object3D)),this._brackets.set(e,n)}}else{const t=this._brackets.get(e);t&&(this._brackets.delete(e),t.dispose())}this.changed=!0}}}W.typeName="CPickSelection"},15271:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i,s=n(75544),r=n(80038),o=n(26220);!function(e){e[e.Basic=0]="Basic",e[e.PCF=1]="PCF",e[e.PCFSoft=2]="PCFSoft"}(i||(i={}));const a={[i.Basic]:s._MY,[i.PCF]:s._iA,[i.PCFSoft]:s.ntZ};class l extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(l.ins),this.outs=this.addOutputs(l.outs),this.views=[],this._activeSceneComponent=null,this._forceRender=!1,this.addEvents("active-scene","active-camera")}get activeSceneComponent(){return this._activeSceneComponent}set activeSceneComponent(e){if(e!==this._activeSceneComponent){const t=this._activeSceneComponent,n=this.activeCameraComponent;t&&t.off("active-camera",this.onActiveCamera,this),e&&e.on("active-camera",this.onActiveCamera,this),this._activeSceneComponent=e;const i=this.activeCameraComponent,s={type:"active-scene",previous:t,next:e};this.emit(s);const r={type:"active-camera",previous:n,next:i};this.emit(r)}}get activeSceneGraph(){return this._activeSceneComponent?this._activeSceneComponent.graph:null}get activeScene(){return this._activeSceneComponent?this._activeSceneComponent.scene:null}get activeCameraComponent(){return this._activeSceneComponent?this._activeSceneComponent.activeCameraComponent:null}get activeCamera(){const e=this._activeSceneComponent?this._activeSceneComponent.activeCameraComponent:null;return e?e.camera:null}forceRender(){this._forceRender=!0}create(){super.create(),this.trackComponent(o.Z,(e=>{e.on("pulse",this.onPulse,this)}),(e=>{e.off("pulse",this.onPulse,this)}))}update(){const e=this.ins;return e.exposure.changed&&this.views.forEach((t=>t.renderer.toneMappingExposure=e.exposure.value)),e.gamma.changed,e.shadowsEnabled.changed&&this.views.forEach((t=>t.renderer.shadowMap.enabled=e.shadowsEnabled.value)),e.shadowMapType.changed&&this.views.forEach((t=>t.renderer.shadowMap.type=a[e.shadowMapType.getValidatedValue()])),!0}attachView(e){if(0===this.views.length){const t=e.renderer,n=this.outs;n.maxTextureSize.setValue(t.capabilities.maxTextureSize),n.maxCubemapSize.setValue(t.capabilities.maxCubemapSize)}this.views.push(e)}detachView(e){const t=this.views.indexOf(e);if(t<0)throw new Error("render view not registered");this.views.splice(t,1)}logInfo(){this.views.forEach((e=>{console.log(e.renderer.info)}))}onPulse(e){(e.systemUpdated||this._forceRender)&&(this.views.forEach((e=>{e.renderer.xr.isPresenting||e.render()})),this._forceRender=!1)}onActiveCamera(e){this.emit(e)}}l.typeName="CRenderer",l.isSystemSingleton=!0,l.ins={exposure:r.V5.Number("Shading.Exposure",1),gamma:r.V5.Number("Shading.Gamma",2),shadowsEnabled:r.V5.Boolean("Shadows.Enabled",!0),shadowMapType:r.V5.Enum("Shadows.MapType",i,i.PCF)},l.outs={maxTextureSize:r.V5.Integer("Caps.MaxTextureSize"),maxCubemapSize:r.V5.Integer("Caps.MaxCubemapSize")}},36283:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var i=n(64702),s=n(80038),r=n(15271),o=n(92642);const a={view:null,viewport:null,renderer:null,scene:null,camera:null},l={type:"before-render",component:null,context:a},c={type:"after-render",component:null,context:a},h={activate:s.V5.Event("Scene.Activate")};class d extends o.ZP{constructor(e,t){super(e,t),this._activeCameraComponent=null,this._preRenderList=[],this._postRenderList=[],this._renderListsNeedUpdate=!0,this.ins=this.addInputs(h,0),this.addEvents("before-render","after-render","active-camera")}get scene(){return this.object3D}get activeCameraComponent(){return this._activeCameraComponent}set activeCameraComponent(e){if(e!==this._activeCameraComponent){const t=this._activeCameraComponent;this._activeCameraComponent=e;const n={type:"active-camera",previous:t,next:e};this.emit(n)}}get activeCamera(){return this._activeCameraComponent?this._activeCameraComponent.camera:null}get renderer(){return this.getMainComponent(r.Z)}create(){super.create(),this.on("hierarchy",this.shouldUpdateRenderLists,this),this.on("child",this.shouldUpdateRenderLists,this);const e=this.renderer;e&&!e.activeSceneComponent&&(e.activeSceneComponent=this)}update(e){if(super.update(e),this.ins.activate.changed){const e=this.renderer;e&&(e.activeSceneComponent=this)}return!0}tick(e){return this._renderListsNeedUpdate&&(this.updateRenderLists(),this._renderListsNeedUpdate=!1),!1}dispose(){const e=this.renderer;e&&e.activeSceneComponent===this&&(e.activeSceneComponent=null),this.off("hierarchy",this.shouldUpdateRenderLists,this),this.off("child",this.shouldUpdateRenderLists,this),super.dispose()}preRender(e){const t=this._preRenderList;for(let n=0,i=t.length;n(e.preRender&&this._preRenderList.push(e),e.postRender&&this._postRenderList.push(e),!1))),this.changed=!0}_onBeforeRender(e,t,n){a.view=e.__view,a.viewport=e.__viewport,a.renderer=e,a.scene=t,a.camera=n,this.preRender(a),l.component=this,this.emit(l)}_onAfterRender(e,t,n){a.view=e.__view,a.viewport=e.__viewport,a.renderer=e,a.scene=t,a.camera=n,this.postRender(a),c.component=this,this.emit(c)}}d.typeName="CScene",d.isGraphSingleton=!0},92642:(e,t,n)=>{"use strict";n.d(t,{VZ:()=>m,ZP:()=>f});var i=n(19588),s=n(78943),r=n(82954),o=n(25499),a=n(28581),l=n(80038),c=n(3474);const h=new i.P,d=new i.P,u=new s._,p=new r.U;var m;!function(e){e[e.XYZ=0]="XYZ",e[e.YZX=1]="YZX",e[e.ZXY=2]="ZXY",e[e.XZY=3]="XZY",e[e.YXZ=4]="YXZ",e[e.ZYX=5]="ZYX"}(m||(m={}));class f extends c.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(f.transformIns),this.outs=this.addOutputs(f.transformOuts),this._object3D=this.createObject3D(),this._object3D.matrixAutoUpdate=!1}get transform(){return this}get object3D(){return this._object3D}get children(){return this._children||[]}get matrix(){return this._object3D.matrix}update(e){const t=this._object3D,{position:n,rotation:i,order:s,scale:r}=this.ins,{matrix:o}=this.outs;t.position.fromArray(n.value),h.fromArray(i.value).multiplyScalar(a.Z.DEG2RAD);const l=s.getOptionText();return t.rotation.setFromVector3(h,l),t.scale.fromArray(r.value),t.updateMatrix(),t.matrix.toArray(o.value),o.set(),!0}dispose(){this._object3D&&(this._object3D.children.slice().forEach((e=>this._object3D.remove(e))),this._object3D.parent&&this._object3D.parent.remove(this._object3D)),super.dispose()}setPropertiesFromMatrix(e){const t=!e;e=e||this._object3D.matrix;const{position:n,rotation:i,order:s,scale:r}=this.ins;e.decompose(h,u,d),h.toArray(n.value);const o=s.getOptionText();p.setFromQuaternion(u,o),h.setFromEuler(p),h.multiplyScalar(a.Z.RAD2DEG).toArray(i.value),d.toArray(r.value),n.set(t),i.set(t),r.set(t)}addChild(e){super.addChild(e),this._object3D.add(e._object3D)}removeChild(e){this._object3D.remove(e._object3D),super.removeChild(e)}createObject3D(){return new o.T}}f.typeName="CTransform",f.transformIns={position:l.V5.Vector3("Transform.Position"),rotation:l.V5.Vector3("Transform.Rotation"),order:l.V5.Enum("Transform.Order",m),scale:l.V5.Scale3("Transform.Scale")},f.transformOuts={matrix:l.V5.Matrix4("Transform.Matrix")}},67695:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>r,dy:()=>i.dy});n(56166);var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class r extends i.ZP{constructor(e){super(),this.system=e}}s([(0,i.Cb)({attribute:!1})],r.prototype,"system",void 0)},28097:(e,t,n)=>{"use strict";n.d(t,{Z:()=>M});var i=n(82587),s=n(37840),r=n(19588),o=n(28581),a=n(84538),l=n(82954),c=n(78943);const h=new a.L,d=(new a.L,new r.P),u=new r.P,p=new i.y,m=new l.U,f=new c._,g={PI:3.141592653589793,DOUBLE_PI:6.283185307179586,HALF_PI:1.5707963267948966,QUARTER_PI:.7853981633974483,DEG2RAD:.017453292519943295,RAD2DEG:57.29577951308232,composeOrbitMatrix:function(e,t,n){const s=e.x,r=e.y,o=e.z,a=t.x,l=t.y,c=t.z,h=Math.sin(s),d=Math.cos(s),u=Math.sin(r),p=Math.cos(r),m=Math.sin(o),f=Math.cos(o),g=p*f,v=f*u*h-m*d,y=f*u*d+m*h,b=p*m,_=h*u*m+f*d,x=m*u*d-f*h,w=-u,S=p*h,M=p*d,E=(n=n||new i.y).elements;return E[0]=g,E[1]=b,E[2]=w,E[3]=0,E[4]=v,E[5]=_,E[6]=S,E[7]=0,E[8]=y,E[9]=x,E[10]=M,E[11]=0,E[12]=a*g+l*v+c*y,E[13]=a*b+l*_+c*x,E[14]=a*w+l*S+c*M,E[15]=1,n},decomposeOrbitMatrix:function(e,t,n){m.setFromRotationMatrix(e,"ZYX"),t.setFromEuler(m),p.copy(e).invert(),h.set(0,0,0,1),h.applyMatrix4(p),n.x=-h.x,n.y=-h.y,n.z=-h.z},isMatrix4Identity:function(e){const t=e.elements;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]},decomposeTransformMatrix:function(e,t,n,i){p.fromArray(e),p.decompose(d,f,u),m.setFromQuaternion(f,"XYZ"),d.toArray(t),u.toArray(i),d.setFromEuler(m),h.multiplyScalar(o.Z.RAD2DEG),d.toArray(n)}},v=new i.y,y=new s.Z,b=new r.P,_=new r.P;var x,w,S;!function(e){e[e.Orbit=0]="Orbit",e[e.FirstPerson=1]="FirstPerson"}(x||(x={})),function(e){e[e.Off=0]="Off",e[e.Pan=1]="Pan",e[e.Orbit=2]="Orbit",e[e.Dolly=3]="Dolly",e[e.Zoom=4]="Zoom",e[e.PanDolly=5]="PanDolly",e[e.Roll=6]="Roll"}(w||(w={})),function(e){e[e.Off=0]="Off",e[e.Active=1]="Active",e[e.Release=2]="Release"}(S||(S={}));class M{constructor(e){this.orbit=new r.P(0,0,0),this.offset=new r.P(0,0,50),this.minOrbit=new r.P(-90,-1/0,-1/0),this.maxOrbit=new r.P(90,1/0,1/0),this.minOffset=new r.P(-1/0,-1/0,.1),this.maxOffset=new r.P(1/0,1/0,1e3),this.orientationEnabled=!0,this.offsetEnabled=!0,this.mode=w.Off,this.phase=S.Off,this.prevPinchDist=0,this.deltaX=0,this.deltaY=0,this.deltaPinch=0,this.deltaWheel=0,this.viewportWidth=100,this.viewportHeight=100,this.camera=e}onPointer(e){if(e.isPrimary)if("pointer-down"===e.type)this.phase=S.Active;else if("pointer-up"===e.type)return this.phase=S.Release,!0;"pointer-down"===e.type&&(this.mode=this.getModeFromEvent(e));if(this.deltaX+=1*e.movementX,this.deltaY+=1*e.movementY,2===e.pointerCount){const t=e.activePositions,n=t[1].clientX-t[0].clientX,i=t[1].clientY-t[0].clientY,s=Math.sqrt(n*n+i*i),r=this.prevPinchDist||s;this.deltaPinch*=r>0?s/r:1,this.prevPinchDist=s}else this.deltaPinch=1,this.prevPinchDist=0;return!0}onTrigger(e){return"wheel"===e.type&&(this.deltaWheel+=o.Z.limit(e.wheel,-1,1),!0)}onKeypress(e){if("ArrowUp"===e.key||"ArrowDown"===e.key){const t="ArrowUp"===e.key?-1:1;return this.deltaY=20*t,this.mode=e.shiftKey?w.Pan:e.ctrlKey?w.Dolly:w.Orbit,!0}if("ArrowLeft"===e.key||"ArrowRight"===e.key){const t="ArrowLeft"===e.key?-1:1;return this.deltaX=20*t,this.mode=e.shiftKey?w.Pan:w.Orbit,!0}return!1}setViewportSize(e,t){this.viewportWidth=e,this.viewportHeight=t}updateController(e,t){const n=this.camera;e=e||n;const i=this.orbit,s=this.offset;g.decomposeOrbitMatrix(e.matrix,i,s),this.orbit.multiplyScalar(g.RAD2DEG),t&&(this.minOffset.min(s),this.maxOffset.max(s))}zoomExtents(e){const t=this.camera,n=this.offset;if(!t)return void console.warn("CameraController.zoomExtents - camera not set");b.copy(this.orbit).multiplyScalar(o.Z.DEG2RAD),_.setScalar(0),g.composeOrbitMatrix(b,_,v),y.copy(e).applyMatrix4(v.transpose()),y.getSize(b),y.getCenter(_),n.x=_.x,n.y=_.y;const i=Math.max(b.x/t.aspect,b.y);if(t.isOrthographicCamera)n.z=1.1*i;else{const e=1/(2*Math.tan(t.fov*o.Z.DEG2RAD*.5));n.z=_.z+i*e+.25*b.z}n.z>this.maxOffset.z&&(this.maxOffset.z=2*n.length())}updateCamera(e,t){const n=this.camera;return e=e||n,!(!this.update()&&!t)&&(b.copy(this.orbit).multiplyScalar(o.Z.DEG2RAD),_.copy(this.offset),n.isOrthographicCamera&&(_.z=this.maxOffset.z,n.size=this.offset.z,n.far=2*this.maxOffset.z,n.updateProjectionMatrix()),g.composeOrbitMatrix(b,_,e.matrix),e.matrixWorldNeedsUpdate=!0,!0)}update(){if(this.phase===S.Off&&0===this.deltaWheel&&0===this.deltaX&&0===this.deltaY)return!1;if(0!==this.deltaWheel)return this.updatePose(0,0,.07*this.deltaWheel+1,0,0,0),this.deltaWheel=0,!0;if(this.phase===S.Active)return(0!==this.deltaX||0!==this.deltaY||1!==this.deltaPinch)&&(this.updateByMode(),this.deltaX=0,this.deltaY=0,this.deltaPinch=1,!0);if(this.phase===S.Release){this.deltaX*=.85,this.deltaY*=.85,this.deltaPinch=1,this.updateByMode();return Math.abs(this.deltaX)+Math.abs(this.deltaY)<.1&&(this.mode=w.Off,this.phase=S.Off),!0}return(0!==this.deltaX||0!==this.deltaY)&&(this.updateByMode(),this.deltaX=0,this.deltaY=0,this.mode=w.Off,!0)}updateByMode(){switch(this.mode){case w.Orbit:this.updatePose(0,0,1,this.deltaY,this.deltaX,0);break;case w.Pan:this.updatePose(this.deltaX,this.deltaY,1,0,0,0);break;case w.Roll:this.updatePose(0,0,1,0,0,this.deltaX);break;case w.Dolly:this.updatePose(0,0,.0075*this.deltaY+1,0,0,0);break;case w.PanDolly:const e=.42*(this.deltaPinch-1)+1;this.updatePose(.75*this.deltaX,.75*this.deltaY,1/e,0,0,0)}}updatePose(e,t,n,i,s,r){const{orbit:a,minOrbit:l,maxOrbit:c,offset:h,minOffset:d,maxOffset:u}=this;if(this.orientationEnabled&&(a.x+=-1*i*220/this.viewportHeight,a.y+=-1*s*220/this.viewportHeight,a.z+=-1*r*220/this.viewportHeight,a.x=o.Z.limit(a.x,l.x,c.x),a.y=o.Z.limit(a.y,l.y,c.y),a.z=o.Z.limit(a.z,l.z,c.z)),this.offsetEnabled){const i=h.z=n*h.z;h.x+=e*i*-1/this.viewportHeight,h.y-=t*i*-1/this.viewportHeight,h.x=o.Z.limit(h.x,d.x,u.x),h.y=o.Z.limit(h.y,d.y,u.y),h.z=o.Z.limit(h.z,d.z,u.z)}}getModeFromEvent(e){if("mouse"===e.source){const t=e.originalEvent.button;if(0===t)return e.ctrlKey?w.Pan:e.altKey?w.Dolly:w.Orbit;if(2===t)return e.altKey?w.Roll:w.Pan;if(1===t)return w.Dolly}else if("touch"===e.source){const t=e.pointerCount;return 1===t?w.Orbit:2===t?w.PanDolly:w.Pan}}}},26060:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var i=n(19588),s=n(93113),r=n(37840),o=n(46953),a=n(44428);class l extends a.j{constructor(){super(...arguments),this.isIndexShader=!0,this.uniformsNeedUpdate=!1,this.lights=!1,this.uniforms={index:{value:[0,0,0]}},this.vertexShader=["void main() {"," #include "," #include ","}"].join("\n"),this.fragmentShader=["uniform vec3 index;","void main() {"," gl_FragColor = vec4(index, 1.0);","}"].join("\n")}static indexFromPixel(e){return e[0]+e[1]<<8+e[2]<<16}static zoneFromPixel(e){return e[3]}setIndex(e){const t=e>>16,n=(e>>8)-(t<<8),i=e-(t<<16)-(n<<8),s=this.uniforms.index.value;s[0]=i/255,s[1]=n/255,s[2]=t/255,this.uniformsNeedUpdate=!0}}class c extends a.j{constructor(){super(...arguments),this.isPositionShader=!0,this.uniforms={index:{value:0},range:{value:[-1,1]}},this.vertexShader=["varying vec3 vLocalPosition;","void main() {"," #include "," #include "," vLocalPosition = vec3(position);","}"].join("\n"),this.fragmentShader=["uniform float index;","uniform vec2 range;","varying vec3 vLocalPosition;","vec4 toVec4(float v) {"," float vn = (v - range.x) / (range.y - range.x);"," float b0 = floor(vn * 255.0) / 255.0; vn = (vn - b0) * 256.0;"," float b1 = floor(vn * 255.0) / 255.0; vn = (vn - b1) * 256.0;"," float b2 = floor(vn * 255.0) / 255.0; vn = (vn - b2) * 256.0;"," float b3 = floor(vn * 255.0) / 255.0;"," return vec4(clamp(b0, 0.0, 1.0), clamp(b1, 0.0, 1.0), clamp(b2, 0.0, 1.0), clamp(b3, 0.0, 1.0));","}","void main() {"," gl_FragColor = (index == 0.0 ? toVec4(vLocalPosition.x)"," : (index == 1.0 ? toVec4(vLocalPosition.y) : toVec4(vLocalPosition.z)));","}"].join("\n")}}class h extends a.j{constructor(){super(...arguments),this.isNormalShader=!0,this.uniforms={index:{value:0}},this.vertexShader=["varying vec3 vLocalNormal;","void main() {"," #include "," #include "," #include "," vLocalNormal = vec3(normal);","}"].join("\n"),this.fragmentShader=["uniform vec3 index;","varying vec3 vLocalNormal;","void main() {"," vec3 normal = normalize(vLocalNormal);"," gl_FragColor = vec4(normal * 0.5 + 0.5, 1.0);","}"].join("\n")}}const d=new i.P,u=new s.I,p=1e4,m=new r.Z(new i.P(-1e4,-1e4,-1e4),new i.P(p,p,p));class f{constructor(e){this.renderer=e,this.pickTextures=[];for(let e=0;e<3;++e)this.pickTextures[e]=new o.d(1,1,{stencilBuffer:!1});this.pickBuffer=new Uint8Array(4),this.indexShader=new l,this.positionShader=new c,this.normalShader=new h}static add(e,t){const n=e=>{e.material&&(e.onBeforeRender=function(t,n,i,s,r){r.isIndexShader&&r.setIndex(e.id)},e.onAfterRender=function(e,t,n,i,s){s.isIndexShader&&s.setIndex(0)})};t?e.traverse((e=>n(e))):n(e)}static remove(e,t){const n=e=>{e.material&&(e.onBeforeRender=null,e.onAfterRender=null)};t?e.traverse((e=>n(e))):n(e)}pickObject(e,t,n){const i=this.pickIndex(e,t,n);if(i>0)return e.getObjectById(i)}pickIndex(e,t,n){const i=n.viewport;(t=i.updateCamera(t)).layers.disable(1);const s=e.overrideMaterial;e.overrideMaterial=this.indexShader;const r=this.renderer,o=this.pickTextures[0];r.getClearColor(u),i.applyPickViewport(o,n),r.setRenderTarget(o),r.setClearColor(0);const a=r.xr.enabled;r.xr.enabled=!1,r.clear(),r.render(e,t),r.xr.enabled=a,r.setRenderTarget(null),r.setClearColor(u),e.overrideMaterial=s,t.layers.enable(1);const l=this.pickBuffer;return r.readRenderTargetPixels(o,0,0,1,1,l),l[0]+256*l[1]+65536*l[2]}pickPosition(e,t,n,s,r){s=s||m,r=r||new i.P;const o=n.viewport;(t=o.updateCamera(t)).layers.disable(1);const a=e.overrideMaterial,l=e.overrideMaterial=this.positionShader,c=this.renderer,h=this.pickTextures;c.getClearColor(u),c.setClearColor(0);for(let i=0;i<3;++i)l.uniforms.index.value=i,l.uniforms.range.value[0]=s.min.getComponent(i),l.uniforms.range.value[1]=s.max.getComponent(i),o.applyPickViewport(h[i],n),c.setRenderTarget(h[i]),c.clear(),c.render(e,t);c.setRenderTarget(null),c.setClearColor(u),e.overrideMaterial=a,t.layers.enable(1);const p=this.pickBuffer;for(let e=0;e<3;++e)c.readRenderTargetPixels(h[e],0,0,1,1,p),r.setComponent(e,2.337437050015319e-10*p[3]+5.983838848039216e-8*p[2]+1531862745098039e-20*p[1]+.003921568627451*p[0]);return s.getSize(d),r.multiply(d).add(s.min)}pickNormal(e,t,n,s){s=s||new i.P;const r=n.viewport;(t=r.updateCamera(t)).layers.disable(1);const o=e.overrideMaterial;e.overrideMaterial=this.normalShader;const a=this.renderer,l=this.pickTextures[0];a.getClearColor(u),r.applyPickViewport(l,n),a.setRenderTarget(l),a.setClearColor(0),a.clear(),a.render(e,t),a.setRenderTarget(null),a.setClearColor(u),e.overrideMaterial=o,t.layers.enable(1);const c=this.pickBuffer;return a.readRenderTargetPixels(l,0,0,1,1,c),s.set(c[0]/255*2-1,c[1]/255*2-1,c[2]/255*2-1).normalize()}}},94608:(e,t,n)=>{"use strict";n.d(t,{KB:()=>g,ZP:()=>f,hf:()=>m});var i=n(19588),s=n(40693),r=n(25499),o=n(51120),a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const l=new i.P,c=new i.P,h=new i.P,d=new i.P,u=new s.F,p=new s.F;var m;!function(e){e[e.TopRight=0]="TopRight",e[e.TopLeft=1]="TopLeft",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight"}(m||(m={}));class f extends r.T{constructor(){super(),this.isHTMLSprite=!0,this.viewAngle=0,this.orientationAngle=0,this.orientationQuadrant=m.TopLeft,this._elements=new Map,this._visible=!0,this.frustumCulled=!1}getVisible(){return this._visible}setVisible(e){e!==this._visible&&this._elements&&(this._visible=e,this._elements.forEach((t=>{t&&t.setVisible(e)})))}dispose(){this._elements.forEach(((e,t)=>{e&&t.removeChild(e)})),this._elements.clear()}disposeHTMLElement(e){const t=this._elements.get(e);t&&(this._elements.delete(e),e.removeChild(t))}update(){this._elements.forEach((e=>{e&&this.updateHTMLElement(e)}))}renderHTMLElement(e,t,n,i,s){i=i||this,l.set(0,0,0),l.applyMatrix4(i.modelViewMatrix),s?c.copy(s):c.set(0,1,0),c.applyMatrix4(i.modelViewMatrix),h.copy(c).sub(l).normalize(),d.set(0,0,1),this.viewAngle=h.angleTo(d),l.applyMatrix4(n.projectionMatrix),c.applyMatrix4(n.projectionMatrix),p.set(c.x,c.y),u.set(l.x,l.y),p.sub(u);const r=.5*(c.x+1)*t.clientWidth,o=.5*(1-c.y)*t.clientHeight;e.setPosition(r,o);const a=this.orientationAngle=p.angle();this.orientationQuadrant=Math.floor(2*a/Math.PI)}getHTMLElement(e){let t=this._elements.get(e);return t||(t=this.createHTMLElement(),t&&(t.setVisible(this._visible),e.appendChild(t),this._elements.set(e,t))),t}createHTMLElement(){return null}updateHTMLElement(e){e.requestUpdate()}}let g=class extends o.ZP{setVisible(e){this.style.display=e?"block":"none"}setOpacity(e){this.style.opacity=e.toString(),this.style.visibility=e>0?"visible":"hidden"}setPosition(e,t){this.style.left=e.toString()+"px",this.style.top=t.toString()+"px"}};g=a([(0,o.Mo)("ff-sprite-element")],g)},28110:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(25499);n(94608);class s extends i.T{constructor(){super(...arguments),this.isHTMLSpriteGroup=!0,this._visible=!0}getVisible(){return this._visible}setVisible(e){if(e!==this._visible){this._visible=e;const t=this.children;for(let n=0,i=t.length;n{"use strict";n.d(t,{LY:()=>b,ZP:()=>_,mP:()=>y});var i=n(37840),s=n(19588),r=n(82587),o=n(68347),a=n(71050),l=n(67440),c=n(62257),h=n(28581);const d=.5*Math.PI,u=new i.Z,p=new s.P,m=new s.P,f=new s.P,g=new r.y,v=(new r.y,[new s.P(0,-d,0),new s.P(0,d,0),new s.P(-d,0,0),new s.P(d,0,0),new s.P(0,0,0),new s.P(0,Math.PI,0)]);var y,b;!function(e){e[e.Perspective=0]="Perspective",e[e.Orthographic=1]="Orthographic"}(y||(y={})),function(e){e[e.None=-1]="None",e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Top=2]="Top",e[e.Bottom=3]="Bottom",e[e.Front=4]="Front",e[e.Back=5]="Back"}(b||(b={}));class _ extends o.V{constructor(e){super(),this.isUniversalCamera=!0,this.fov=50,this.size=20,this.aspect=1,this.distance=20,this.zoom=1,this.near=.1,this.far=2e3,this.focus=10,this.filmGauge=35,this.filmOffset=0,this.view=null,this.setProjection(e)}setProjection(e){e===y.Orthographic?(this.type="OrthographicCamera",this.isPerspectiveCamera=!1,this.isOrthographicCamera=!0):(this.type="PerspectiveCamera",this.isPerspectiveCamera=!0,this.isOrthographicCamera=!1),this.updateProjectionMatrix()}getProjection(){return this.isOrthographicCamera?y.Orthographic:y.Perspective}setPreset(e){e!==b.None?(this.rotation.setFromVector3(v[e],"XYZ"),this.position.set(0,0,this.distance).applyQuaternion(this.quaternion)):(this.rotation.set(0,0,0),this.position.set(0,0,0)),this.updateMatrix()}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*a.M8.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*a.M8.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*a.M8.RAD2DEG*Math.atan(Math.tan(.5*a.M8.DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,r){this.isPerspectiveCamera?l.c.prototype.setViewOffset.call(this,e,t,n,i,s,r):c.i.prototype.setViewOffset.call(this,e,t,n,i,s,r)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}zoomToView(){}moveToView(e){this.updateMatrixWorld(!1),u.copy(e),g.extractRotation(this.matrixWorldInverse),u.applyMatrix4(g),u.getSize(p),u.getCenter(m);const t=Math.max(p.x/this.aspect,p.y);f.set(-m.x,-m.y,0),this.isPerspectiveCamera?f.z=p.z/(2*Math.tan(this.fov*h.Z.DEG2RAD*.5)):(this.size=.5*t,f.z=2*p.z,this.far=Math.max(this.far,2*f.z)),g.extractRotation(this.matrixWorld),f.applyMatrix4(g),this.matrix.decompose(this.position,this.quaternion,this.scale),this.position.copy(f),this.updateMatrix()}updateProjectionMatrix(){const e=this.near,t=this.far,n=this.aspect,i=this.zoom,s=this.view;if(this.isOrthographicCamera){const r=this.size,o=r/(2*i),a=o*n;let l=-a,c=a,h=o,d=-o;if(s&&s.enabled){const e=i/(s.width/s.fullWidth),t=i/(s.height/s.fullHeight),o=r*n/s.width,a=r/s.height;l+=o*(s.offsetX/e),c=l+o*(s.width/e),h-=a*(s.offsetY/t),d=h-a*(s.height/t)}this.projectionMatrix.makeOrthographic(l,c,h,d,e,t)}else{let o=e*Math.tan(.5*a.M8.DEG2RAD*this.fov)/i,l=2*o,c=n*l,h=-.5*c;s&&s.enabled&&(h+=s.offsetX*c/s.fullWidth,o-=s.offsetY*l/s.fullHeight,c*=s.width/s.fullWidth,l*=s.height/s.fullHeight);var r=this.filmOffset;0!==r&&(h+=e*r/this.getFilmWidth()),this.projectionMatrix.makePerspective(h,h+c,o,o-l,e,t)}this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}copy(e,t){return super.copy(e,t),this.type=e.type,this.isOrthographicCamera=e.isOrthographicCamera,this.isPerspectiveCamera=e.isPerspectiveCamera,this.fov=e.fov,this.size=e.size,this.aspect=e.aspect,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.view=e.view?Object.assign({},e.view):null,this}clone(){return(new this.constructor).copy(this)}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.size=this.size,t.object.aspect=this.aspect,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}},73902:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(40693),s=n(82942),r=n(26775),o=n(12197),a=n(28097);class l extends s.Z{constructor(e){super(),this.next=null,this._canvasWidth=1,this._canvasHeight=1,this._overlay=null,this._camera=null,this._controller=null,this.addEvent("dispose"),this.next=null,e=e||{},this._relRect={x:e.x||0,y:e.y||0,width:e.width||1,height:e.height||1},this._absRect={x:0,y:0,width:1,height:1},e.overlay&&(this._overlay=e.overlay)}get x(){return this._absRect.x}get y(){return this._absRect.y}get width(){return this._absRect.width}get height(){return this._absRect.height}get canvasWidth(){return this._canvasWidth}get canvasHeight(){return this._canvasHeight}get camera(){return this._camera}get controller(){return this._controller}get overlay(){return this._overlay}set overlay(e){this._overlay=e,this.updateGeometry()}dispose(){this.emit({type:"dispose",viewport:this}),this._overlay&&(this._overlay.remove(),this._overlay=null)}setSize(e,t,n,i){const s=this._relRect;s.x=e,s.y=t,s.width=n,s.height=i,this.updateGeometry()}setCanvasSize(e,t){this._canvasWidth=e,this._canvasHeight=t,this.updateGeometry(),this._controller&&this._controller.setViewportSize(e,t)}setBuiltInCamera(e,t){this._camera?this._camera.setProjection(e):(this._camera=new r.ZP(e),this._camera.matrixAutoUpdate=!1),void 0!==t&&(this._camera.setPreset(t),this.overlay.setLabel(o.x.TopRight,"view",r.LY[t],"ff-label-box"))}unsetBuiltInCamera(){this._camera=null,this._controller=null,this.overlay.unsetLabel(o.x.TopRight,"view")}enableCameraControl(e){return!e&&this._controller?this._controller=null:e&&this._camera&&(this._controller||(this._controller=new a.Z(this._camera),this._controller.setViewportSize(this.width,this.height),this._controller.updateController())),this._controller}zoomExtents(e){const t=this._camera,n=this._controller;t&&n&&(n.zoomExtents(e),n.updateCamera(null,!0))}isInside(e){return this.isPointInside(e.localX,e.localY)}isPointInside(e,t){const n=this._absRect;return t=this.canvasHeight-t,e>=n.x&&e=n.y&&t{"use strict";n.d(t,{D7:()=>p,MO:()=>u,jU:()=>d,sN:()=>m});var i=n(19588),s=n(82587),r=n(82954),o=n(78943),a=n(71050);const l=new i.P,c=new s.y,h=new r.U;new o._;function d(e,t,n){const i=n||new o._;return l.fromArray(e).multiplyScalar(a.M8.DEG2RAD),h.setFromVector3(l,t),i.setFromEuler(h),i}function u(e,t,n){const i=n||[0,0,0];return h.setFromQuaternion(e,t),l.setFromEuler(h),l.multiplyScalar(a.M8.RAD2DEG).toArray(i),i}function p(e){const t=new Map,n=new Map,i=new Map;e.traverse((e=>{const s=e;if(s.isMesh){const e=s.geometry;e&&t.set(e.uuid,e);const r=s.material;if(r){n.set(r.uuid,r);for(let e in r){const t=r[e];t&&t.isTexture&&i.set(t.uuid,t)}}}}));for(let e of i)e[1].dispose();for(let e of n)e[1].dispose();for(let e of t)e[1].dispose()}function m(e,t,n){n||(n=e);const i=e.geometry;if(i&&e.visible){let s=e;for(c.identity();s&&s!==n;)c.premultiply(s.matrix),s=s.parent;if(i.isGeometry){const e=i.vertices;for(let n=0,i=e.length;n{"use strict";n.d(t,{Z:()=>a,x:()=>i});var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};!function(e){e[e.TopLeft=0]="TopLeft",e[e.TopCenter=1]="TopCenter",e[e.TopRight=2]="TopRight",e[e.BottomLeft=3]="BottomLeft",e[e.BottomCenter=4]="BottomCenter",e[e.BottomRight=5]="BottomRight"}(i||(i={}));let o=class extends s.ZP{constructor(){super(),this.labels=[],this.labels.push({},{},{},{},{},{})}setLabel(e,t,n,i){this.labels[e][t]={text:n,className:i},this.requestUpdate()}unsetLabel(e,t){delete this.labels[e][t],this.requestUpdate()}firstConnected(){this.classList.add("ff-container","ff-viewport-overlay")}render(){const e=this.labels;return s.dy`
+
${Object.keys(e[i.TopLeft]).map((t=>{const n=e[i.TopLeft][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.TopCenter]).map((t=>{const n=e[i.TopCenter][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.TopRight]).map((t=>{const n=e[i.TopRight][t];return s.dy`
${n.text}
`}))}
+
+
${Object.keys(e[i.BottomLeft]).map((t=>{const n=e[i.BottomLeft][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.BottomCenter]).map((t=>{const n=e[i.BottomCenter][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.BottomRight]).map((t=>{const n=e[i.BottomRight][t];return s.dy`
${n.text}
`}))}
+
`}};o=r([(0,s.Mo)("ff-viewport-overlay")],o);const a=o},98595:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});n(1239);var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(),this.name="",this.index=0,this.selectedIndex=-1,this.tabbingIndex=0,this.selected=!1,this.selectable=!1,this.disabled=!1,this.icon="",this.role="button",this.caret=!1,this.inline=!1,this.transparent=!1,this.addEventListener("click",(e=>this.onClick(e))),this.addEventListener("keydown",(e=>this.onKeyDown(e)))}firstConnected(){this.tabIndex=this.tabbingIndex,this.setAttribute("role",this.role),this.classList.add("ff-button")}shouldUpdate(e){return(e.has("selectedIndex")||e.has("index"))&&this.selectedIndex>=0&&(this.selected=this.index===this.selectedIndex),e.has("disabled")&&this.setClass("ff-disabled",this.disabled),!0}update(e){this.classList.remove("ff-inline","ff-transparent","ff-control"),this.inline?this.classList.add("ff-inline"):this.transparent?this.classList.add("ff-transparent"):this.classList.add("ff-control"),super.update(e)}render(){return i.dy`${this.renderIcon()}${this.renderText()}${this.renderCaret()}`}renderIcon(){return this.icon?i.dy` `:null}renderText(){return this.text?i.dy` ${this.text}
`:null}renderCaret(){return this.caret?i.dy`
`:null}onClick(e){this.selectable&&(this.selected=!this.selected)}onKeyDown(e){(document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement)!==this||"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0})))}};s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"index",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"selectedIndex",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"tabbingIndex",void 0),s([(0,i.Cb)({type:Boolean,reflect:!0})],r.prototype,"selected",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"selectable",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"disabled",void 0),s([(0,i.Cb)()],r.prototype,"text",void 0),s([(0,i.Cb)()],r.prototype,"icon",void 0),s([(0,i.Cb)()],r.prototype,"role",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"caret",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"inline",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"transparent",void 0),r=s([(0,i.Mo)("ff-button")],r);const o=r},34834:(e,t,n)=>{"use strict";var i=n(28581),s=n(47855),r=(n(45716),n(61497)),o=n(96368),a=n(51120),l=n(69551),c=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let h=class extends a.ZP{constructor(){super(),this.value=new o.Z,this._offsetX=0,this._offsetY=0,this._knob=(new a.ZP).addClass("ff-knob").setStyle({display:"block",position:"relative "}),new l.Z(this)}setXY(e,t){this.value.set(e,t),this.requestUpdate()}dragStart(e){const t=this._knob,n=this.getBoundingClientRect();e.target===this._knob?(this._offsetX=e.clientX-t.offsetLeft+.5*(t.clientWidth-t.offsetWidth),this._offsetY=e.clientY-t.offsetTop+.5*(t.clientHeight-t.offsetHeight)):(this._offsetX=n.left+.8*t.clientWidth,this._offsetY=n.top+.8*t.clientHeight),this.dragMove(e)}dragMove(e){const t=this._knob,n=e.clientX-this._offsetX,s=e.clientY-this._offsetY;let r=n/(this.clientWidth-t.clientWidth);r=i.Z.limit(r,0,1);let o=1-s/(this.clientHeight-t.clientHeight);o=i.Z.limit(o,0,1),r===this.value.x&&o===this.value.y||(this.value=this.value.set(r,o),this.emitChangeEvent(!0))}dragEnd(){this.emitChangeEvent(!1)}firstConnected(){this.setStyle({position:"relative",touchAction:"none"}),this.setAttribute("touch-action","none"),this.setAttribute("tabindex","0"),this.classList.add("ff-control","ff-vector-slider"),this.appendChild(this._knob)}update(e){const t=100*this.value.x,n=100*(1-this.value.y);this._knob.style.left=`${t.toFixed(3)}%`,this._knob.style.top=`${n.toFixed(3)}%`,super.update(e)}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,isDragging:e},bubbles:!0}))}};c([(0,a.Cb)({attribute:!1})],h.prototype,"value",void 0),h=c([(0,a.Mo)("ff-vector-slider")],h);const d=h;var u=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const p=new s.ZP;let m=class extends a.ZP{constructor(){super(),this.color=new s.ZP,this.alpha=!1,this.numeric=!1,this.onLumSatChange=this.onLumSatChange.bind(this),this.onHueChange=this.onHueChange.bind(this),this.onAlphaChange=this.onAlphaChange.bind(this),this.addEventListener("click",(e=>e.stopPropagation())),this._hsv=new s.P,this._lumSatSlider=(new d).on("change",this.onLumSatChange),this._hueSlider=(new r.Z).addClass("ff-hue-slider").on("change",this.onHueChange),this._hueSlider.direction="vertical"}firstConnected(){this.classList.add("ff-flex-column","ff-control","ff-color-edit")}update(e){e.has("color")&&this.color.toHSV(this._hsv),e.has("alpha")&&(this.alpha&&!this._alphaSlider?(this._alphaSlider=(new r.Z).addClass("ff-alpha-slider").on("change",this.onAlphaChange),this._alphaSlider.direction="vertical"):!this.alpha&&this._alphaSlider&&this._alphaSlider.remove()),super.update(e)}render(){let e=null;if(this.numeric){const t=this.color,n=t.toString(!1).substr(1),i=this.alpha?a.dy`
+ A
+ `:null;e=a.dy``}return a.dy`
+ ${this._lumSatSlider}${this._hueSlider}${this._alphaSlider}
+
${e}`}updated(){this._hueSlider.value=1-this._hsv.x/360;const e=`linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, ${p.setHSV(this._hsv.x).toString(!1)})`;if(this._lumSatSlider.style.backgroundImage=e,this._lumSatSlider.setXY(this._hsv.y,this._hsv.z),this.alpha){const e=this.color.toString(!1),t=getComputedStyle(this._alphaSlider).color,n=`linear-gradient(to top, transparent, ${e}), repeating-linear-gradient(-45deg, transparent, transparent 8px, ${t} 8px, ${t} 16px)`;this._alphaSlider.style.backgroundImage=n,this._alphaSlider.value=this.color.alpha}}onLumSatChange(e){e.stopPropagation();const t=e.detail.value;this._hsv.y=t.x,this._hsv.z=t.y,this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onHueChange(e){e.stopPropagation(),this._hsv.x=360*(1-e.target.value),this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onAlphaChange(e){e.stopPropagation(),this.color.alpha=e.target.value,this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onNumericEdit(e){e.stopPropagation();const t=e.target.name;if("string"===t)this.color.setString(e.detail.text,1,!1);else{let n=parseInt(e.detail.text);if(!isFinite(n))return;this.color[t]=i.Z.limit(n,0,255)}this.color.toHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isEditing)}onKeyDown(e){const t="ArrowRight"===e.code||"ArrowUp"===e.code,n="PageUp"===e.code,s="ArrowLeft"===e.code||"ArrowDown"===e.code,r="PageDown"===e.code;if(t||n||s||r)if(e.target===this._hueSlider||e.target===this._alphaSlider){const r=t||n?-1:1,o=t||s?.01:.1;e.target===this._hueSlider?(this._hsv.x=i.Z.limit(this._hsv.x+360*o*r,0,360),this.color.setHSV(this._hsv)):this.color.alpha=i.Z.limit(this.color.alpha+o*r,0,1),this.requestUpdate(),this.emitChangeEvent(!1)}else if(e.target===this._lumSatSlider&&(t||s)){const n=t?1:-1,s=e.shiftKey?.1:.01;"ArrowRight"===e.code||"ArrowLeft"===e.code?this._hsv.y=i.Z.limit(this._hsv.y+s*n,0,1):this._hsv.z=i.Z.limit(this._hsv.z+s*n,0,1),this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(!1)}}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{color:this.color,isDragging:e},bubbles:!0}))}};u([(0,a.Cb)({attribute:!1})],m.prototype,"color",void 0),u([(0,a.Cb)({type:Boolean})],m.prototype,"alpha",void 0),u([(0,a.Cb)({type:Boolean})],m.prototype,"numeric",void 0),m=u([(0,a.Mo)("ff-color-edit")],m)},51120:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>$,ZP:()=>B,dy:()=>d.dy,Cb:()=>M,sY:()=>d.sY});var i=n(93909),s=n(14056);function r(e,t){const{element:{content:n},parts:i}=e,s=document.createTreeWalker(n,133,null,!1);let r=a(i),o=i[r],l=-1,c=0;const h=[];let d=null;for(;s.nextNode();){l++;const e=s.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(h.push(e),null===d&&(d=e)),null!==d&&c++;void 0!==o&&o.index===l;)o.index=null!==d?-1:o.index-c,r=a(i,r),o=i[r]}h.forEach((e=>e.parentNode.removeChild(e)))}const o=e=>{let t=11===e.nodeType?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},a=(e,t=-1)=>{for(let n=t+1;n`${e}--${t}`;let p=!0;void 0===window.ShadyCSS?p=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),p=!1);const m=e=>t=>{const n=u(t.type,e);let i=c.r.get(n);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},c.r.set(n,i));let r=i.stringsArray.get(t.strings);if(void 0!==r)return r;const o=t.strings.join(s.Jw);if(r=i.keyString.get(o),void 0===r){const n=t.getTemplateElement();p&&window.ShadyCSS.prepareTemplateDom(n,e),r=new s.YS(t,n),i.keyString.set(o,r)}return i.stringsArray.set(t.strings,r),r},f=["html","svg"],g=new Set,v=(e,t,n)=>{g.add(e);const i=n?n.element:document.createElement("template"),s=t.querySelectorAll("style"),{length:l}=s;if(0===l)return void window.ShadyCSS.prepareTemplateStyles(i,e);const h=document.createElement("style");for(let e=0;e{f.forEach((t=>{const n=c.r.get(u(t,e));void 0!==n&&n.keyString.forEach((e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach((e=>{n.add(e)})),r(e,n)}))}))})(e);const d=i.content;n?function(e,t,n=null){const{element:{content:i},parts:s}=e;if(null==n)return void i.appendChild(t);const r=document.createTreeWalker(i,133,null,!1);let l=a(s),c=0,h=-1;for(;r.nextNode();)for(h++,r.currentNode===n&&(c=o(t),n.parentNode.insertBefore(t,n));-1!==l&&s[l].index===h;){if(c>0){for(;-1!==l;)s[l].index+=c,l=a(s,l);return}l=a(s,l)}}(n,h,d.firstChild):d.insertBefore(h,d.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const p=d.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==p)t.insertBefore(p.cloneNode(!0),t.firstChild);else if(n){d.insertBefore(h,d.firstChild);const e=new Set;e.add(h),r(n,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const y={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},b=(e,t)=>t!==e&&(t==t||e==e),_={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:b},x="finalized";class w extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach(((t,n)=>{const i=this._attributeNameForProperty(n,t);void 0!==i&&(this._attributeToPropertyMap.set(i,n),e.push(i))})),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(((e,t)=>this._classProperties.set(t,e)))}}static createProperty(e,t=_){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n="symbol"==typeof e?Symbol():`__${e}`,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const s=this[e];this[t]=i,this.requestUpdateInternal(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||_}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty(x)||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const n of t)this.createProperty(n,e[n])}}static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,n=b){return n(e,t)}static _propertyValueFromAttribute(e,t){const n=t.type,i=t.converter||y,s="function"==typeof i?i:i.fromAttribute;return s?s(e,n):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const n=t.type,i=t.converter;return(i&&i.toAttribute||y.toAttribute)(e,n)}initialize(){this._updateState=0,this._updatePromise=new Promise((e=>this._enableUpdatingResolver=e)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((e,t)=>this[t]=e)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}_propertyToAttribute(e,t,n=_){const i=this.constructor,s=i._attributeNameForProperty(e,n);if(void 0!==s){const e=i._propertyValueToAttribute(t,n);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(s):this.setAttribute(s,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const n=this.constructor,i=n._attributeToPropertyMap.get(e);if(void 0!==i){const e=n.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=n._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,n){let i=!0;if(void 0!==e){const s=this.constructor;n=n||s.getPropertyOptions(e),s._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((e,t)=>this._propertyToAttribute(t,this[t],e))),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}w.finalized=!0;const S=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function M(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):S(e,t)}const E=Element.prototype;E.msMatchesSelector||E.webkitMatchesSelector;const T=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,C=Symbol();class A{constructor(e,t){if(t!==C)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(T?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const P={};class R extends w{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,n)=>e.reduceRight(((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e)),n),n=t(e,new Set),i=[];n.forEach((e=>i.unshift(e))),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map((e=>{if(e instanceof CSSStyleSheet&&!T){const t=Array.prototype.slice.call(e.cssRules).reduce(((e,t)=>e+t.cssText),"");return new A(String(t),C)}return e}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?T?this.renderRoot.adoptedStyleSheets=e.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((e=>e.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==P&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)})))}render(){return P}}R.finalized=!0,R.render=(e,t,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const s=n.scopeName,r=l.L.has(t),o=p&&11===t.nodeType&&!!t.host,a=o&&!g.has(s),c=a?document.createDocumentFragment():t;if((0,l.s)(e,c,Object.assign({templateFactory:m(s)},n)),a){const e=l.L.get(c);l.L.delete(c);const n=e.value instanceof h.R?e.value.template:void 0;v(s,c,n),(0,i.r4)(t,t.firstChild),t.appendChild(c),l.L.set(t,e)}!r&&o&&window.ShadyCSS.styleElement(t.host)},R.shadowRootOptions={mode:"open"};const L=(e,t)=>{const n=e.startNode.parentNode,i=void 0===t?e.endNode:t.startNode,s=n.insertBefore((0,d.IW)(),i);n.insertBefore((0,d.IW)(),i);const r=new d.nt(e.options);return r.insertAfterNode(s),r},N=(e,t)=>(e.setValue(t),e.commit(),e),D=(e,t,n)=>{const i=e.startNode.parentNode,s=n?n.startNode:e.endNode,r=t.endNode.nextSibling;r!==s&&(0,d.V)(i,t.startNode,r,s)},I=e=>{(0,d.r4)(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},O=(e,t,n)=>{const i=new Map;for(let s=t;s<=n;s++)i.set(e[s],s);return i},U=new WeakMap,k=new WeakMap;(0,d.XM)(((e,t,n)=>{let i;return void 0===n?n=t:void 0!==t&&(i=t),t=>{if(!(t instanceof d.nt))throw new Error("repeat can only be used in text bindings");const s=U.get(t)||[],r=k.get(t)||[],o=[],a=[],l=[];let c,h,u=0;for(const t of e)l[u]=i?i(t,u):u,a[u]=n(t,u),u++;let p=0,m=s.length-1,f=0,g=a.length-1;for(;p<=m&&f<=g;)if(null===s[p])p++;else if(null===s[m])m--;else if(r[p]===l[f])o[f]=N(s[p],a[f]),p++,f++;else if(r[m]===l[g])o[g]=N(s[m],a[g]),m--,g--;else if(r[p]===l[g])o[g]=N(s[p],a[g]),D(t,s[p],o[g+1]),p++,g--;else if(r[m]===l[f])o[f]=N(s[m],a[f]),D(t,s[m],s[p]),m--,f++;else if(void 0===c&&(c=O(l,f,g),h=O(r,p,m)),c.has(r[p]))if(c.has(r[m])){const e=h.get(l[f]),n=void 0!==e?s[e]:null;if(null===n){const e=L(t,s[p]);N(e,a[f]),o[f]=e}else o[f]=N(n,a[f]),D(t,n,s[p]),s[e]=null;f++}else I(s[m]),m--;else I(s[p]),p++;for(;f<=g;){const e=L(t,o[g+1]);N(e,a[f]),o[f++]=e}for(;p<=m;){const e=s[p++];null!==e&&I(e)}U.set(t,o),k.set(t,l)}}));var V,z=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let F=V=class extends R{constructor(){super(...arguments),this._isFirstConnected=!1}static setStyle(e,t){Object.assign(e.style,t)}static setAttribs(e,t){for(let n in t)e.setAttribute(n,t[n])}get shady(){return this.constructor.shady}appendTo(e){return e.appendChild(this),this}removeChildren(){for(;this.firstChild;)this.removeChild(this.firstChild)}getChildrenArray(){return Array.from(this.children)}appendElement(e,t){return this.createElement(e,t,this)}createElement(e,t,n){let i;return i="string"==typeof e?document.createElement(e):e instanceof HTMLElement?e:new e,t&&Object.assign(i.style,t),n&&n.appendChild(i),i}setStyle(e){return V.setStyle(this,e),this}setAttribute(e,t){return super.setAttribute(e,t),this}setAttributes(e){return V.setAttribs(this,e),this}addClass(...e){return e.forEach((e=>this.classList.add(e))),this}removeClass(...e){return e.forEach((e=>this.classList.remove(e))),this}setClass(e,t){return t?this.classList.add(e):this.classList.remove(e),this}hasFocus(){return document.activeElement===this}on(e,t,n){return this.addEventListener(e,t,n),this}off(e,t,n){return this.removeEventListener(e,t,n),this}connectedCallback(){this._isFirstConnected||(this._isFirstConnected=!0,this.firstConnected()),this.connected(),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.disconnected()}createRenderRoot(){return this.shady?super.createRenderRoot():this}firstConnected(){}connected(){}disconnected(){}onUpdate(){this.requestUpdate()}};F.tagName="ff-custom-element",F.shady=!1,F=V=z([$("ff-custom-element")],F);const B=F;function $(e){return t=>(t.tagName=e,customElements.define(t.tagName,t),t)}},69551:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e){this.isEnabled=!0,this._isDragging=!1,this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this.target=e,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp)}get isDragging(){return this._isDragging}get startX(){return this._startX}get startY(){return this._startY}onPointerDown(e){e.isPrimary&&this.isEnabled&&(this._isDragging=!0,this._startX=this._lastX=e.clientX,this._startY=this._lastY=e.clientY,this.target.setPointerCapture(e.pointerId),this.target.dragStart(e)),e.stopPropagation(),e.preventDefault()}onPointerMove(e){if(e.isPrimary&&this._isDragging){const t=e.clientX-this._lastX;this._lastX=e.clientX;const n=e.clientY-this._lastY;this._lastY=e.clientY,this.target.dragMove(e,t,n)}e.stopPropagation(),e.preventDefault()}onPointerUp(e){this._isDragging&&e.isPrimary&&(this.target.dragEnd(e),this.target.releasePointerCapture(e.pointerId),this._isDragging=!1),e.stopPropagation(),e.preventDefault()}}},1239:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let o=i=class extends s.ZP{constructor(e){super(),this.template=null,this.name=e||""}static add(e,t){if(i.templates[e])throw new Error(`icon already registered: '${e}'`);i.templates[e]=t}static getTemplateNames(){return Object.keys(i.templates)}firstConnected(){this.classList.add("ff-icon")}render(){if(this.name){const e=this.constructor.templates[this.name];return e||console.warn(`icon not found: '${this.name}'`),e}return this.template?this.template:s.dy`[icon undefined]`}};o.templates={},r([(0,s.Cb)({attribute:!1})],o.prototype,"template",void 0),r([(0,s.Cb)({type:String})],o.prototype,"name",void 0),o=i=r([(0,s.Mo)("ff-icon")],o);const a=o;o.add("empty",s.dy``),o.add("check",s.dy` `),o.add("close",s.dy` `),o.add("grip",s.dy` `),o.add("up",s.dy` `),o.add("down",s.dy` `),o.add("caret-up",s.dy` `),o.add("caret-down",s.dy` `),o.add("folder",s.dy` `),o.add("file",s.dy` `),o.add("info",s.dy` `),o.add("warning",s.dy` `),o.add("error",s.dy` `),o.add("prompt",s.dy` `)},45716:(e,t,n)=>{"use strict";var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(...arguments),this.name="",this.index=0,this.text="",this.placeholder="",this.align="left",this.initialValue="",this.requestFocus=!1}get inputElement(){return this.getElementsByTagName("input").item(0)}focus(){this.requestFocus=!0,this.performUpdate()}hasFocus(){const e=document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement;return this.inputElement===e}firstConnected(){this.classList.add("ff-control","ff-line-edit")}shouldUpdate(e){return!this.hasFocus()&&super.shouldUpdate(e)}render(){return i.dy` `}updated(){this.requestFocus&&(this.requestFocus=!1,this.inputElement.focus())}onKeyDown(e){const t=e.target;"Enter"===e.key?(this.commit(t),t.blur()):"Escape"===e.key&&(this.revert(t),t.blur())}onChange(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!1)}onInput(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!0)}onFocus(e){this.initialValue=e.target.value,e.target.select()}onBlur(e){this.commit(e.target),this.requestUpdate()}revert(e){e.value=this.initialValue,this.dispatchChangeEvent(e.value,!1)}commit(e){this.initialValue=e.value,this.dispatchChangeEvent(e.value,!1)}dispatchChangeEvent(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{text:e,isEditing:t}}))}};s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"index",void 0),s([(0,i.Cb)({type:String})],r.prototype,"text",void 0),s([(0,i.Cb)({type:String})],r.prototype,"placeholder",void 0),s([(0,i.Cb)({type:String})],r.prototype,"align",void 0),r=s([(0,i.Mo)("ff-line-edit")],r)},61497:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(28581),s=n(51120),r=n(69551),o=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let a=class extends s.ZP{constructor(){super(),this.direction="horizontal",this.value=0,this._isVertical=!1,this._offsetX=0,this._offsetY=0,this._knob=(new s.ZP).addClass("ff-knob").setStyle({display:"block",position:"relative "}),new r.Z(this)}dragStart(e){const t=this._knob,n=this.getBoundingClientRect();e.target===this._knob?(this._offsetX=e.clientX-t.offsetLeft+.5*(t.clientWidth-t.offsetWidth),this._offsetY=e.clientY-t.offsetTop+.5*(t.clientHeight-t.offsetHeight)):(this._offsetX=n.left+.8*t.clientWidth,this._offsetY=n.top+.8*t.clientHeight),this.dragMove(e)}dragMove(e){const t=this._knob,n=e.clientX-this._offsetX,s=e.clientY-this._offsetY;let r=this._isVertical?1-s/(this.clientHeight-t.clientHeight):n/(this.clientWidth-t.clientWidth);r=i.Z.limit(r,0,1),r!==this.value&&(this.value=r,this.emitChangeEvent(!0))}dragEnd(){this.emitChangeEvent(!1)}firstConnected(){this.setStyle({position:"relative",touchAction:"none"}),this.setAttribute("touch-action","none"),this.setAttribute("tabindex","0"),this.classList.add("ff-control","ff-linear-slider"),this.appendChild(this._knob)}update(e){if(e.has("direction")&&(this._isVertical="vertical"===this.direction,this.setClass("ff-horizontal",!this._isVertical),this.setClass("ff-vertical",this._isVertical)),e.has("value")){const e=i.Z.limit(this.value,0,1),t=this._isVertical?0:100*e,n=this._isVertical?100*(1-e):0;this._knob.style.left=`${t.toFixed(3)}%`,this._knob.style.top=`${n.toFixed(3)}%`}super.update(e)}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,isDragging:e},bubbles:!0}))}};o([(0,s.Cb)({type:String})],a.prototype,"direction",void 0),o([(0,s.Cb)({type:Number})],a.prototype,"value",void 0),a=o([(0,s.Mo)("ff-linear-slider")],a);const l=a},10564:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>h});n(1239);var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const o={info:"ff-info",success:"ff-success",warning:"ff-warning",error:"ff-error"},a={info:"info",success:"check",warning:"warning",error:"error"},l={info:2e3,success:2e3,warning:5e3,error:0};let c=i=class extends s.ZP{constructor(e,t,n){super(),this._handler=0,this.on("transitionend",this.remove.bind(this)),this.message=e||"",this.level=t||"info",this.timeout=void 0!==n?n:l[this.level];const s=(i.shadowRootNode||document).getElementById(i.stackId);s?s.appendChild(this):console.warn(`element '#${i.stackId}' not found`)}static show(e,t,n){new i(e,t,n)}close(){this._handler>0&&(window.clearTimeout(this._handler),this._handler=0),this.classList.add("ff-out")}firstUpdated(){this.classList.add("ff-notification",o[this.level]),this.timeout>0&&(this._handler=window.setTimeout((()=>this.close()),this.timeout))}render(){const e=a[this.level];return s.dy`
+ ${this.message}
+ `}onClose(e){e.stopPropagation(),this.close()}};c.stackId="ff-notification-stack",c.shadowRootNode=null,r([(0,s.Cb)({type:String})],c.prototype,"message",void 0),r([(0,s.Cb)({type:String})],c.prototype,"level",void 0),r([(0,s.Cb)({type:Number})],c.prototype,"timeout",void 0),c=i=r([(0,s.Mo)("ff-notification")],c);const h=c},34287:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>o,dy:()=>i.dy});var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(),this.anchor=null,this.portal=null,this.position=void 0,this.align=void 0,this.justify=void 0,this.positionX=0,this.positionY=0,this.offsetX=0,this.offsetY=0,this.keepVisible=!1,this.modal=!1,this._modalPlane=null,this.onResize=this.onResize.bind(this),this.onCaptureEvent=this.onCaptureEvent.bind(this),this.onEatEvent=this.onEatEvent.bind(this)}close(){this.dispatchEvent(new CustomEvent("close"))}connected(){if(this.calculatePosition(),window.addEventListener("resize",this.onResize),this.modal){const e=this._modalPlane=this.createElement("div");e.classList.add("ff-modal-plane"),e.addEventListener("mousedown",this.onEatEvent),e.addEventListener("contextmenu",this.onEatEvent),e.addEventListener("pointerdown",this.onEatEvent),this.parentElement.appendChild(e),setTimeout((()=>e.classList.add("ff-transition")))}else document.addEventListener("mousedown",this.onCaptureEvent,{capture:!0,passive:!0})}disconnected(){window.removeEventListener("resize",this.onResize),this._modalPlane?(this._modalPlane.remove(),this._modalPlane=null):document.removeEventListener("mousedown",this.onCaptureEvent)}firstConnected(){super.firstConnected(),this.setStyle({position:"fixed",zIndex:"1000"}),this.classList.add("ff-popup")}updated(){this.isConnected&&this.calculatePosition()}calculatePosition(){let e,t;const n=this.getBoundingClientRect();let i;if(t=this.portal?this.portal.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight},"center"===this.position)i=this.center(n,t);else if("anchor"===this.position){const s=this.anchor||this.parentElement;s&&(e=s.getBoundingClientRect(),i=this.positionToAnchor(n,e,t))}else i={x:this.positionX,y:this.positionY};this.keepVisible&&"center"!==this.position&&(i=this.keepElementVisible(i,n,t)),this.style.left=Math.round(i.x)+"px",this.style.top=Math.round(i.y)+"px"}center(e,t){return{x:Math.round(.5*(t.width-e.width)),y:Math.round(.5*(t.height-e.height))}}positionToAnchor(e,t,n){const i=this.align,s=this.justify,r=this.offsetX,o=this.offsetY,a={x:0,y:0};switch(i){case"start":a.x="start"!==s&&"end"!==s?t.left-e.width-r:t.left;break;case"end":a.x="start"!==s&&"end"!==s?t.right+r:t.right-e.width;break;case"fixed":a.x=this.positionX;break;default:a.x=t.left+.5*(t.width-e.width)}switch(s){case"start":a.y=t.top-e.height-o;break;case"end":a.y=t.bottom+o;break;case"fixed":a.y=this.positionY;break;default:a.y=t.top+.5*(t.height-e.height)}return a.x+=this.offsetX,a.y+=this.offsetY,a}keepElementVisible(e,t,n){const i=this.offsetX,s=this.offsetY;return t.width>n.width?e.x=.5*(n.width-t.width):e.xn.right&&(e.x=n.right-t.width-i),t.height>n.height?e.y=.5*(n.height-t.height):e.yn.bottom&&(e.y=n.bottom-t.height-s),e}onResize(){this.calculatePosition()}onCaptureEvent(e){e.target instanceof Node&&this.contains(e.target)||this.close()}onEatEvent(e){console.log("Popup.onEatEvent"),e.stopPropagation(),e.preventDefault()}};s([(0,i.Cb)({attribute:!1})],r.prototype,"anchor",void 0),s([(0,i.Cb)({attribute:!1})],r.prototype,"portal",void 0),s([(0,i.Cb)({type:String})],r.prototype,"position",void 0),s([(0,i.Cb)({type:String})],r.prototype,"align",void 0),s([(0,i.Cb)({type:String})],r.prototype,"justify",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"positionX",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"positionY",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"offsetX",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"offsetY",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"keepVisible",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"modal",void 0),r=s([(0,i.Mo)("ff-popup")],r);const o=r},39229:(e,t,n)=>{"use strict";var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let o=i=class extends s.ZP{constructor(){super(),this.direction="horizontal",this.width=5,this.margin=20,this.detached=!1,this._isActive=!1,this._offset=0,this._position=0,this.addEventListener("pointerdown",(e=>this.onPointerDown(e))),this.addEventListener("pointermove",(e=>this.onPointerMove(e))),this.addEventListener("pointerup",(e=>this.onPointerUpOrCancel(e))),this.addEventListener("pointercancel",(e=>this.onPointerUpOrCancel(e)))}get position(){return this._position}isHorizontal(){return"horizontal"===this.direction}update(e){super.update(e);const t=this.isHorizontal(),n=this.width;this.setStyle({padding:t?`0 ${n}px`:`${n}px 0`,margin:t?`0 ${-n}px`:-n+"px 0",cursor:t?"col-resize":"row-resize"})}firstUpdated(){this.classList.add("ff-splitter"),this.setAttribute("touch-action","none"),this.setStyle({position:"relative",display:"block",zIndex:"1",touchAction:"none"})}onPointerDown(e){if(e.isPrimary){e.stopPropagation(),e.preventDefault(),this._isActive=!0,this.setPointerCapture(e.pointerId);const t=this.getBoundingClientRect();this._offset=this.isHorizontal()?t.left+.5*t.width-e.clientX:t.top+.5*t.height-e.clientY}}onPointerMove(e){if(e.isPrimary&&this._isActive){e.stopPropagation(),e.preventDefault();const t=this.parentElement;if(!t)return;const n=t.getBoundingClientRect(),s=this.isHorizontal(),r=s?n.width:n.height;let o=this._offset+(s?e.clientX-n.left:e.clientY-n.top),a=o/r;if(!this.detached){const e=this.previousElementSibling,n=this.nextElementSibling;if(e instanceof HTMLElement&&n instanceof HTMLElement){const l=Array.from(t.children);let c=0,h=r,d=!1;l.forEach((t=>{if(t instanceof i)return;if(t===e||t===n)return void(d=!0);const r=t.getBoundingClientRect(),o=s?r.width:r.height;h-=o,d||(c+=o)}));const u=this.margin,p=h-u;o-=c,o=op?p:o;const m=(h-o)/r;a=o/r,e.style.flexBasis=(100*a).toFixed(3)+"%",n.style.flexBasis=(100*m).toFixed(3)+"%",setTimeout((()=>window.dispatchEvent(new CustomEvent("resize"))),0)}}this._position=a,this.dispatchEvent(new CustomEvent(i.changeEvent,{detail:{direction:this.direction,position:this._position,isDragging:!0}}))}}onPointerUpOrCancel(e){e.isPrimary&&(e.stopPropagation(),e.preventDefault(),this._isActive=!1,this.dispatchEvent(new CustomEvent(i.changeEvent,{detail:{direction:this.direction,position:this._position,isDragging:!1}})))}};o.changeEvent="ff-splitter-change",r([(0,s.Cb)({type:String})],o.prototype,"direction",void 0),r([(0,s.Cb)({type:Number})],o.prototype,"width",void 0),r([(0,s.Cb)({type:Number})],o.prototype,"margin",void 0),r([(0,s.Cb)({type:Boolean})],o.prototype,"detached",void 0),o=i=r([(0,s.Mo)("ff-splitter")],o)},13470:(e,t,n)=>{"use strict";var i=n(51120),s=n(53868);const r=new WeakMap,o=(0,s.XM)((e=>t=>{const n=r.get(t);if(void 0===e&&t instanceof s._l){if(void 0!==n||!r.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);r.set(t,e)}));var a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let l=class extends i.ZP{constructor(){super(...arguments),this.name="",this.index=0,this.text="",this.placeholder="",this.readonly=!1,this.align="left",this.maxLength=0,this.initialValue=""}get textArea(){return this.getElementsByTagName("textarea").item(0)}select(){const e=this.textArea;e&&e.select()}focus(){const e=this.textArea;e&&e.focus()}blur(){const e=this.textArea;e&&e.blur()}hasFocus(){const e=document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement;return this.textArea===e}firstConnected(){this.classList.add("ff-control","ff-text-edit")}shouldUpdate(e){return!this.hasFocus()&&super.shouldUpdate(e)}render(){var e;return i.dy``}onKeyDown(e){const t=e.target;"Escape"===e.key&&(this.revert(t),t.blur())}onChange(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!1)}onInput(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!0)}onFocus(e){this.initialValue=e.target.value}onBlur(e){this.commit(e.target),this.requestUpdate()}revert(e){e.value=this.initialValue,this.dispatchChangeEvent(e.value,!1)}commit(e){this.initialValue=e.value,this.dispatchChangeEvent(e.value,!1)}dispatchChangeEvent(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{text:e,isEditing:t}}))}};a([(0,i.Cb)({type:String})],l.prototype,"name",void 0),a([(0,i.Cb)({type:Number})],l.prototype,"index",void 0),a([(0,i.Cb)({type:String})],l.prototype,"text",void 0),a([(0,i.Cb)({type:String})],l.prototype,"placeholder",void 0),a([(0,i.Cb)({type:Boolean})],l.prototype,"readonly",void 0),a([(0,i.Cb)({type:String})],l.prototype,"align",void 0),a([(0,i.Cb)({type:Number})],l.prototype,"maxLength",void 0),l=a([(0,i.Mo)("ff-text-edit")],l)},41029:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{static registerType(e){if(this.types[e.typeName])throw new Error(`Annotation type '${e.typeName}' already registered.`);this.types[e.typeName]=e}static registerDefaultType(e){this.defaultType=e}static get typeNames(){return[this.defaultTypeName,...Object.keys(this.types).sort()]}static get defaultTypeName(){return this.defaultType.typeName}static getType(e){const t=this.types[e]||this.defaultType;if(!t)throw new Error(`type '${e}' not registered and no default type set.`);return t}static createInstance(e,t,n){return"Circle"===(t=t||e.data.style)?new(this.getType(t))(e,n):new(this.getType(t))(e)}}i.types={},i.defaultType=null},56752:(e,t,n)=>{"use strict";n.d(t,{m$:()=>v,ZP:()=>g});var i,s=n(19588),r=n(60531),o=n(94608),a=(n(44466),n(34287)),l=(n(98595),n(13470),n(53310)),c=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let h=i=class extends a.ZP{constructor(e,t){super(),this.content=null,this.sprite=null,this.resizeObserver=null,this.close=this.close.bind(this),this.content=e,this.title=t.annotation.title,this.sprite=t,this.position="center",this.modal=!0}static show(e,t,n){const s=new i(t,n);return e.appendChild(s),new Promise(((e,t)=>{s.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-annotation-overlay","sv-annotation")}connected(){super.connected(),this.sprite.addEventListener("link",this.close),this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>this.onResize()))),this.resizeObserver.observe(this)}disconnected(){this.resizeObserver.disconnect(),this.sprite.removeEventListener("link",this.close),super.disconnected()}render(){return a.dy`
+ this.discardEvents(e)} @pointerdown=${e=>this.discardEvents(e)} aria-label="Annotation pop-up" @keydown=${e=>this.onKeyDownMain(e)}>
+
+
+ `}firstUpdated(e){super.firstUpdated(e);this.querySelector("#anno_container").append(this.content)}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,l.e)((0,l.G)(this),e)}tabReset(e){const t=e.target instanceof Element?e.target:null;if(t){const e=Array.from(t.parentElement.children).find((e=>e.hasAttribute("selected")));e!==t&&(t.setAttribute("tabIndex","-1"),e.setAttribute("tabIndex","0"))}}discardEvents(e){e.stopPropagation()}};h=i=c([(0,a.Mo)("sv-annotation-overlay")],h);const d=h,u=new s.P(0,1,0),p=new s.P,m=new s.P,f=new s.P;class g extends o.ZP{constructor(e,t){super(),this.isAdaptive=!0,this.isAnimating=!1,this.assetManager=null,this.audioManager=null,this.annotation=e,this.matrixAutoUpdate=!1}get typeName(){return this.constructor.typeName}update(){super.update();const e=this.annotation.data;this.position.fromArray(e.position),p.fromArray(e.direction).normalize(),this.quaternion.setFromUnitVectors(u,p),this.updateMatrix()}emitClickEvent(){const e={type:"click",annotation:this.annotation,sprite:this};this.dispatchEvent(e)}emitLinkEvent(e){const t={type:"link",annotation:this.annotation,sprite:this,link:e};this.dispatchEvent(t)}isBehindCamera(e,t){let n=null;n=t instanceof r.H&&t.cameras.length>0?t.cameras[0]:t;const i=n.matrixWorld.elements;return e.updateMatrixWorld(),m.setFromMatrixPosition(e.matrixWorld),f.setFromMatrixPosition(n.matrixWorld),p.set(-i[8],-i[9],-i[10]).normalize(),f.addScaledVector(p,n.near),f.sub(m),f.angleTo(p)<=Math.PI/2}}g.typeName="Annotation";class v extends o.KB{constructor(e){super(),this.isTruncated=!1,this.isOverlayed=!1,this.sprite=e,this.discardEvent=this.discardEvent.bind(this),this.addEventListener("pointercancel",this.discardEvent),this.addEventListener("click",this.discardEvent)}get truncated(){return this.isTruncated}set truncated(e){this.isTruncated=e}get overlayed(){return this.isOverlayed}set overlayed(e){this.isOverlayed=e}firstConnected(){super.firstConnected(),this.classList.add("sv-annotation")}discardEvent(e){e.stopPropagation()}showOverlay(e){this.requestUpdate().then((()=>{d.show(this.parentElement,e,this.sprite).then((()=>{this.overlayed=!1,this.append(e),this.requestUpdate()}))}))}}},10160:(e,t,n)=>{"use strict";var i=n(19588),s=n(29187),r=n(8035),o=n(75809),a=n(24479),l=n(51120),c=n(28581),h=n(47855),d=(n(98595),n(56752)),u=n(41029),p=n(19853),m=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const f=new h.ZP,g=new i.P(0,0,0),v=new i.P,y=new i.P,b=new i.P,_=new i.P;class x extends d.ZP{constructor(e){super(e),this.adaptive=!0,this.offset=new s.Z,this.offset.matrixAutoUpdate=!1,this.add(this.offset),this.anchorMesh=new r.K(new o.u,new a.v),this.anchorMesh.frustumCulled=!1,this.anchorMesh.matrixAutoUpdate=!1,this.offset.add(this.anchorMesh),this.update()}dispose(){this.offset=null,this.anchorMesh=null,super.dispose()}update(){const e=this.annotation.data;this.anchorMesh.scale.setScalar(e.scale),this.anchorMesh.position.y=e.offset,this.anchorMesh.updateMatrix(),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.anchorMesh,g);const i=this.anchorMesh;v.set(0,0,0),v.applyMatrix4(i.modelViewMatrix),y.set(0,1,0),y.applyMatrix4(i.modelViewMatrix),b.copy(y).sub(v).normalize(),_.set(0,0,1),this.viewAngle=b.angleTo(_);const s=c.Z.scaleLimit(this.viewAngle*c.Z.RAD2DEG,90,100,1,0),r=this.annotation.data.visible?s:0;e.setOpacity(r);const o=this.annotation.data,a=o.visible;this.offset.visible=a,this.adaptive!==this.isAdaptive&&(this.isAdaptive||(e.truncated=!1,e.classList.remove("sv-short"),e.requestUpdate()),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.offset,n)&&a),this.getVisible()||e.setVisible(this.getVisible()),this.adaptive&&!this.isAnimating&&o.expanded&&(e.truncated||(e.classList.contains("sv-expanded")?(this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth):e.requestUpdate().then((()=>{this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth,this.checkTruncate(e,t)}))),this.checkTruncate(e,t))}createHTMLElement(){return new w(this)}checkTruncate(e,t){e.getBoundingClientRect().left,t.getBoundingClientRect().left;const n=e.getBoundingClientRect().top-t.getBoundingClientRect().top+this.originalHeight>=t.offsetHeight;n!==e.truncated?(e.truncated=n,e.requestUpdate().then((()=>{this.checkBounds(e,t)}))):this.checkBounds(e,t)}checkBounds(e,t){const n=e.getBoundingClientRect().left-t.getBoundingClientRect().left,i=e.getBoundingClientRect().top-t.getBoundingClientRect().top;n+e.offsetWidth>=t.offsetWidth&&!e.classList.contains("sv-align-right")?(e.classList.add("sv-align-right"),e.requestUpdate()):n+e.offsetWidth=t.offsetHeight&&!e.classList.contains("sv-align-bottom")?(e.classList.add("sv-align-bottom"),e.requestUpdate()):i+e.offsetHeight0),s=this.sprite.audioManager;this.markerElement.innerText=n.marker;const r=l.dy`
+ ${this.isOverlayed?null:l.dy`${t.title}
`}
+ ${n.imageUri&&!i?l.dy`${t.imageCredit?l.dy`
${t.imageCredit}
`:null}
`:null}
+ ${i?null:l.dy``}
+ ${n.audioId&&!this.isOverlayed?l.dy`
`:null}
+ ${n.articleId&&!i?l.dy` `:null}
+ ${i?l.dy` `:null}`;(0,l.sY)(r,this.contentElement),f.fromArray(n.color),this.markerElement.style.borderColor=f.toString(),this.isExpanded&&(this.contentElement.style.height="auto"),this.isExpanded===n.expanded||this.overlayed||(this.isExpanded=n.expanded,this.isExpanded?(n.audioId&&this.querySelector("#audio_container").append(s.getPlayerById(n.audioId)),this.classList.add("sv-expanded"),this.contentElement.style.display="block",this.contentElement.style.height="auto"):(this.classList.remove("sv-expanded"),this.contentElement.style.display="none",s.activeId==n.audioId&&this.sprite.audioManager.stop())),this.isExpanded&&(this.contentElement.style.removeProperty("transform"),this.classList.contains("sv-align-right")&&(this.contentElement.style.transform=`translateX(-${this.offsetWidth}px)`),this.classList.contains("sv-align-bottom")&&(this.contentElement.style.transform=`translateY(-${this.offsetHeight-this.markerElement.offsetHeight}px)`));const o=this.querySelector(".sv-audio-view");if(n.audioId&&!this.overlayed)if(n.expanded&&!o){this.querySelector("#audio_container").append(s.getPlayerById(n.audioId))}else!n.expanded&&o&&s.activeId==n.audioId&&s.stop()}onClickMarker(e){this.contentElement.style.display="block",e.stopPropagation(),this.sprite.emitClickEvent()}onClickArticle(e){e.stopPropagation(),this.sprite.emitLinkEvent(this.sprite.annotation.data.articleId)}onClickOverlay(e){e.stopPropagation();const t=this.contentElement;this.overlayed=!0,this.showOverlay(t)}onClickAudio(e){e.stopPropagation()}onKeyDown(e){"Space"!==e.code&&"Enter"!==e.code||(e.stopPropagation(),this.sprite.emitClickEvent())}};w=m([(0,l.Mo)("sv-circle-annotation")],w)},13301:(e,t,n)=>{"use strict";var i=n(19588),s=n(75809),r=n(64026),o=n(93122),a=n(28581),l=n(47855),c=n(51120),h=n(19853),d=(n(98595),n(56752)),u=n(41029),p=n(94608),m=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const f=["sv-q0","sv-q1","sv-q2","sv-q3"],g=new l.ZP,v=new i.P(0,1,0);class y extends d.ZP{constructor(e){super(e),this.quadrant=-1,this.adaptive=!0;const t=[];t.push(new i.P(0,0,0)),t.push(new i.P(0,1,0));const n=(new s.u).setFromPoints(t),a=new r.n({color:"#009cde",transparent:!0});a.toneMapped=!1,this.stemLine=new o.x(n,a),this.stemLine.frustumCulled=!1,this.stemLine.matrixAutoUpdate=!1,this.add(this.stemLine),this.update()}update(){const e=this.annotation.data;this.stemLine.scale.setScalar(e.scale),this.stemLine.position.y=e.offset,this.stemLine.updateMatrix();this.stemLine.material.color.fromArray(e.color),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.stemLine,v);const i=a.Z.scaleLimit(this.viewAngle*a.Z.RAD2DEG,90,100,1,0),s=this.annotation.data.visible?i:0;if(this.stemLine.material.opacity=s,e.setOpacity(s),this.orientationQuadrant!==this.quadrant&&(e.classList.remove(f[this.quadrant]),e.classList.add(f[this.orientationQuadrant]),this.quadrant=this.orientationQuadrant),this.adaptive!==this.isAdaptive&&(this.isAdaptive?e.classList.remove("sv-static-width"):(e.classList.add("sv-static-width"),e.truncated=!1,e.classList.remove("sv-short"),e.requestUpdate()),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.stemLine,n)),this.adaptive&&!this.isAnimating&&this.annotation.data.expanded){if(!e.truncated){if(!e.classList.contains("sv-expanded"))return void e.requestUpdate().then((()=>{this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth,this.checkTruncate(e,t)}));this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth}this.checkTruncate(e,t)}}createHTMLElement(){return new b(this)}checkTruncate(e,t){const n=this.quadrant==p.hf.TopLeft||this.quadrant==p.hf.TopRight,i=this.quadrant==p.hf.TopRight||this.quadrant==p.hf.BottomRight,s=i?e.getBoundingClientRect().left-t.getBoundingClientRect().left:e.getBoundingClientRect().right-t.getBoundingClientRect().left,r=n?e.getBoundingClientRect().bottom-t.getBoundingClientRect().top:e.getBoundingClientRect().top-t.getBoundingClientRect().top,o=n?r-this.originalHeight<=0:r+this.originalHeight>=t.offsetHeight,a=i?s+this.originalWidth>=t.offsetWidth:s-this.originalWidth<=0,l=o||a;l!==e.truncated&&(e.truncated=l,l?e.classList.add("sv-short"):e.classList.remove("sv-short"),e.requestUpdate().then((()=>{})))}}y.typeName="Extended",u.Z.registerType(y);let b=class extends d.m${constructor(e){super(e),this.isExpanded=void 0,this.onClickTitle=this.onClickTitle.bind(this),this.onClickArticle=this.onClickArticle.bind(this),this.onClickAudio=this.onClickAudio.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onClickOverlay=this.onClickOverlay.bind(this),this.titleElement=this.appendElement("div"),this.titleElement.classList.add("sv-title"),this.titleElement.addEventListener("click",this.onClickTitle),this.wrapperElement=this.appendElement("div"),this.contentElement=this.createElement("div",null,this.wrapperElement),this.contentElement.classList.add("sv-annotation-body"),this.contentElement.style.display="none"}firstConnected(){super.firstConnected(),this.classList.add("sv-extended-annotation")}update(e){super.update(e);const t=this.sprite.annotation,n=this.sprite.annotation.data,i=this.sprite.audioManager,s=!this.overlayed&&this.truncated&&(n.imageUri||n.articleId||t.lead.length>0);this.titleElement.innerText=this.sprite.annotation.title;const r=c.dy`
+ ${n.imageUri&&!s?c.dy`${t.imageCredit?c.dy`
${t.imageCredit}
`:null}
`:null}
+ ${s?null:c.dy`${(0,h.A)(t.lead)}
`}
+ ${n.audioId&&!this.overlayed?c.dy`
`:null}
+ ${n.articleId&&!s?c.dy` `:null}
+ ${s?c.dy` `:null}`;(0,c.sY)(r,this.contentElement),g.fromArray(n.color),this.style.borderColor=g.toString(),this.isExpanded&&(this.contentElement.style.height="auto"),this.isExpanded===n.expanded||this.overlayed||(this.isExpanded=n.expanded,this.isExpanded?(n.audioId&&this.querySelector("#audio_container").append(i.getPlayerById(n.audioId)),this.classList.add("sv-expanded"),this.style.minWidth=this.sprite.annotation.lead.length<40&&(!n.audioId||0==n.audioId.length)?"0":"",this.contentElement.style.display="block",this.contentElement.style.height="auto"):(this.classList.remove("sv-expanded"),this.contentElement.style.height="0",this.contentElement.style.display="none",i.activeId==n.audioId&&this.sprite.audioManager.stop()));const o=this.querySelector(".sv-audio-view");if(n.audioId&&!this.overlayed)if(n.expanded&&!o){this.querySelector("#audio_container").append(i.getPlayerById(n.audioId))}else!n.expanded&&o&&i.activeId==n.audioId&&i.stop()}onClickTitle(e){e.stopPropagation(),this.sprite.emitClickEvent()}onClickArticle(e){e.stopPropagation(),this.sprite.emitLinkEvent(this.sprite.annotation.data.articleId)}onClickAudio(e){e.stopPropagation()}onClickOverlay(e){e.stopPropagation();const t=this.contentElement;this.overlayed=!0,this.showOverlay(t)}onKeyDown(e){"Space"!==e.code&&"Enter"!==e.code||(e.stopPropagation(),this.sprite.emitClickEvent())}};b=m([(0,c.Mo)("sv-extended-annotation")],b)},91013:(e,t,n)=>{"use strict";var i=n(19588),s=n(75809),r=n(64026),o=n(93122),a=n(28581),l=n(47855),c=n(51120),h=(n(98595),n(56752)),d=n(41029),u=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const p=["sv-q0","sv-q1","sv-q2","sv-q3"],m=new l.ZP,f=new i.P(0,1,0);class g extends h.ZP{constructor(e){super(e),this.quadrant=-1,this.adaptive=!0;const t=[];t.push(new i.P(0,0,0)),t.push(new i.P(0,1,0));const n=(new s.u).setFromPoints(t),a=new r.n({color:"#009cde",transparent:!0});a.toneMapped=!1,this.stemLine=new o.x(n,a),this.stemLine.frustumCulled=!1,this.stemLine.matrixAutoUpdate=!1,this.add(this.stemLine),this.update()}update(){const e=this.annotation.data;this.stemLine.scale.setScalar(e.scale),this.stemLine.position.y=e.offset,this.stemLine.updateMatrix();this.stemLine.material.color.fromArray(e.color),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.stemLine,f);const i=a.Z.scaleLimit(this.viewAngle*a.Z.RAD2DEG,90,100,1,0),s=this.annotation.data.visible?i:0;this.stemLine.material.opacity=s,e.setOpacity(s),this.orientationQuadrant!==this.quadrant&&(e.classList.remove(p[this.quadrant]),e.classList.add(p[this.orientationQuadrant]),this.quadrant=this.orientationQuadrant),this.adaptive!==this.isAdaptive&&(this.isAdaptive?e.classList.remove("sv-static-width"):e.classList.add("sv-static-width"),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.stemLine,n))}createHTMLElement(){return new v(this)}}g.typeName="Standard",d.Z.registerDefaultType(g);let v=class extends h.m${constructor(e){super(e),this.onClickTitle=this.onClickTitle.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.titleElement=this.appendElement("div"),this.titleElement.classList.add("sv-title"),this.titleElement.addEventListener("click",this.onClickTitle)}firstConnected(){super.firstConnected(),this.classList.add("sv-standard-annotation")}update(e){super.update(e);const t=this.sprite.annotation.data;t.viewId.length?this.classList.add("sv-enable-events"):this.classList.remove("sv-enable-events"),this.titleElement.innerText=this.sprite.annotation.title,m.fromArray(t.color),this.style.borderColor=m.toString()}onClickTitle(e){e.stopPropagation(),this.sprite.emitClickEvent()}onKeyDown(e){"Space"!==e.code&&"Enter"!==e.code||(e.stopPropagation(),this.sprite.emitClickEvent())}};v=u([(0,c.Mo)("sv-standard-annotation")],v)},13772:(e,t,n)=>{"use strict";n.d(t,{Z:()=>ee});var i=n(31741),s=n(96561),r=n(26041),o=n(10564),a=n(56166),l=n(89167),c=n(31491),h=n(22040),d=(n(98595),n(18257),n(85203),n(44661)),u=n(97008),p=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class m extends u.ZP{createView(){return new f(this)}}m.typeName="CVViewTool",m.text="View",m.icon="eye";let f=class extends u.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-view-tool-view")}render(){const e=this.activeDocument;if(!e)return u.dy``;this.tool;const t=e.setup.navigation,n=e.setup.language,i=t.ins.projection,s=t.ins.preset,r=t.ins.zoomExtents,o=[d.LY.Front,d.LY.Back,d.LY.Left,d.LY.Right,d.LY.Top,d.LY.Bottom];return u.dy``}onActiveDocument(e,t){this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};f=p([(0,u.Mo)("sv-view-tool-view")],f);var g=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class v extends u.ZP{createView(){return new y(this)}}v.typeName="CVRenderTool",v.text="Material",v.icon="palette";let y=class extends u.v5{constructor(){super(...arguments),this.viewer=null}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-render-tool-view")}render(){this.tool;const e=this.activeDocument,t=this.viewer;if(!t)return u.dy``;const n=t.ins.shader,i=e.setup.language;return u.dy``}onActiveDocument(e,t){this.viewer&&(this.viewer.ins.shader.off("value",this.onUpdate,this),this.viewer=null),t&&(this.viewer=t.setup.viewer,this.viewer.ins.shader.on("value",this.onUpdate,this))}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};y=g([(0,u.Mo)("sv-render-tool-view")],y);var b=n(76969),_=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class x extends u.ZP{createView(){return new w(this)}}x.typeName="CVEnvironmentTool",x.text="Environment",x.icon="environment";let w=class extends u.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-environment-tool-view")}render(){this.tool;if(!this.activeDocument)return u.dy`No active document`;const e=this.activeDocument.setup,t=e.grid,n=e.floor,i=e.background,s=i.ins.style.getValidatedValue()===b.u.Solid,r=e.environment,o=e.language;return u.dy`
+
+
+
+ ${s?null:u.dy` `}
+
+
+
+
+
+
+
`}onActiveDocument(e,t){if(e){e.setup.background.ins.style.off("value",this.onUpdate,this)}if(t){t.setup.background.ins.style.on("value",this.onUpdate,this)}this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};w=_([(0,u.Mo)("sv-environment-tool-view")],w);var S=n(16967),M=(n(97010),n(90470),n(46436),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});class E extends u.ZP{constructor(){super(...arguments),this.lights=[],this.ins=this.addInputs(E.ins),this.outs=this.addOutputs(E.outs)}update(e){return this.outs.light.setValue(this.lights[this.ins.light.getValidatedValue()]),!0}createView(){return new T(this)}onActiveDocument(e,t){this.lights=t?t.getInnerComponents(S.Z):[],this.ins.light.setOptions(this.lights.map((e=>e.node.name))),this.outs.light.setValue(this.lights[0]),super.onActiveDocument(e,t)}}E.typeName="CVLightTool",E.text="Lights",E.icon="bulb",E.ins={light:u.V5.Option("Tool.Light",[])},E.outs={light:u.V5.Object("Tool.SelectedLight",S.Z)};let T=class extends u.v5{constructor(){super(...arguments),this.lights=null}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-light-tool-view")}connected(){super.connected(),this.tool.outs.light.on("value",this.onUpdate,this)}disconnected(){this.tool.outs.light.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.tool,t=e.lights,n=this.activeDocument;if(!t||!n)return u.dy`No editable lights in this scene.`;const i=e.outs.light.value,s=n.setup.navigation,r=n.setup.language,o=i?u.dy``:null;return u.dy`${o}`}onActiveDocument(e,t){e&&e.setup.navigation.ins.lightsFollowCamera.off("value",this.onUpdate,this),t&&t.setup.navigation.ins.lightsFollowCamera.on("value",this.onUpdate,this),this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};T=M([(0,u.Mo)("sv-light-tool-view")],T);n(77804);var C=n(29767),A=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class P extends u.ZP{createView(){return new R(this)}}P.typeName="CVTapeTool",P.text="Measure",P.icon="tape";let R=class extends u.v5{constructor(){super(...arguments),this.firstRender=!0,this.statusMsg=""}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-tape-tool-view")}render(){const e=this.activeDocument;if(!e)return u.dy``;this.tool;const t=e.setup.tape,n=t.ins.enabled,i=t.outs.state.value,s=t.outs.distance.value,r=e.setup.language;let o;if(n.value)if(0===s)o=r.getLocalizedString("Tap on model to set start of tape")+".";else if(i===C.T.SetStart){const t=e.root.scene.ins.units.getOptionText();o=`${s.toFixed(2)} ${t}`}else o=r.getLocalizedString("Tap on model to set end of tape")+".";else o=r.getLocalizedString("Switch on to take measurements")+".";return this.statusMsg=o,u.dy``}updated(e){super.updated(e);const t=this.getElementsByClassName("ff-string").item(0);t&&(t.innerHTML=this.statusMsg,this.firstRender&&(setTimeout((()=>{t.innerHTML=`${this.statusMsg}
`}),200),this.firstRender=!1))}onActiveDocument(e,t){e&&e.setup.tape.off("update",this.onUpdate,this),t&&t.setup.tape.on("update",this.onUpdate,this),this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("ff-button")[1].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};R=A([(0,u.Mo)("sv-tape-tool-view")],R);var L=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class N extends u.ZP{createView(){return new D(this)}}N.typeName="CVSliceTool",N.text="Slice",N.icon="knife";let D=class extends u.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-slice-tool-view")}render(){const e=this.activeDocument;if(!e)return u.dy``;this.tool;const t=e.setup.slicer,n=t.ins.enabled,i=t.ins.axis,s=t.ins.position,r=e.setup.language;return u.dy``}onActiveDocument(e,t){this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("ff-button")[1].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};D=L([(0,u.Mo)("sv-slice-tool-view")],D);var I=n(90199);class O extends I.Z{get toolProvider(){return this.getComponent(h.Z)}createComponents(){this.createComponent(h.Z),this.createComponent(m),this.createComponent(v),this.createComponent(x),this.createComponent(E),this.createComponent(P),this.createComponent(N)}}O.typeName="NVTools";const U=[c.Z,h.Z,m,v,x,E,P,N,O];var k=n(47227),V=n(25864),z=n(63872),F=n(68327),B=n(11359),$=n(38303),j=n(87203),H=n(94860),G=n(43875),Z=n(30242),W=n(40490),q=n(60206),X=n(15271),Y=n(88300),K=n(26629),J=n(51462),Q=n(1594);class ee{constructor(e,t,n){this.props=t||{},console.log(ee.splashMessage);const i=new r.Z;i.add(l.Z),i.add(U),this.commander=new s.Z;const o=this.system=new a.Z(i),c=o.graph.createCustomNode($.Z);o.graph.createCustomNode(O),o.graph.createCustomNode(j.Z),this.analytics.startTimer(),e&&new H.Z(this).appendTo(e),n||(this.documentProvider.createDocument(k),this.evaluateProps());(/^(iPad|iPhone|iPod)/.test(window.navigator.platform)||/^Mac/.test(window.navigator.platform)&&window.navigator.maxTouchPoints>1)&&(window.createImageBitmap=void 0),c.pulse.start()}get assetManager(){return this.system.getMainComponent(z.Z)}get assetReader(){return this.system.getMainComponent(F.Z)}get documentProvider(){return this.system.getMainComponent(V.Z)}get analytics(){return this.system.getMainComponent(B.Z)}dispose(){this.assetReader.dispose(),this.documentProvider.activeComponent.clearNodeTree(),this.system.getMainComponent(X.Z).views.forEach((e=>e.dispose()))}setBaseUrl(e){this.assetManager.baseUrl=e}loadDocument(e,t,n){const i=G.$l[n];return this.assetReader.getJSON(e).then((n=>(t=void 0===t?!n.lights&&!n.cameras:t,this.documentProvider.amendDocument(n,e,t)))).then((e=>(isFinite(i)&&e.setup.viewer.ins.quality.setValue(i),e)))}reloadDocument(){this.documentProvider.removeActiveDocument(),this.documentProvider.createDocument(k),this.evaluateProps()}loadModel(e,t){return this.documentProvider.appendModel(e,t)}loadGeometry(e,t,n,i,s){return this.documentProvider.appendGeometry(e,t,n,i,s)}evaluateProps(){const e=this.props,t=this.assetManager;e.root=e.root||(0,i.Z)("root")||(0,i.Z)("r"),e.dracoRoot=e.dracoRoot||(0,i.Z)("dracoRoot")||(0,i.Z)("dr"),e.resourceRoot=e.resourceRoot||(0,i.Z)("resourceRoot")||(0,i.Z)("rr"),e.document=e.document||(0,i.Z)("document")||(0,i.Z)("d"),e.model=e.model||(0,i.Z)("model")||(0,i.Z)("m"),e.geometry=e.geometry||(0,i.Z)("geometry")||(0,i.Z)("g"),e.texture=e.texture||(0,i.Z)("texture")||(0,i.Z)("t"),e.occlusion=e.occlusion||(0,i.Z)("occlusion")||(0,i.Z)("o"),e.normals=e.normals||(0,i.Z)("normals")||(0,i.Z)("n"),e.quality=e.quality||(0,i.Z)("quality")||(0,i.Z)("q"),e.uiMode=e.uiMode||(0,i.Z)("uiMode")||(0,i.Z)("u"),e.bgColor=e.bgColor||(0,i.Z)("bgColor")||(0,i.Z)("bc"),e.bgStyle=e.bgStyle||(0,i.Z)("bgStyle")||(0,i.Z)("bs"),e.controls=e.controls||(0,i.Z)("controls")||(0,i.Z)("ct"),e.prompt=e.prompt||(0,i.Z)("prompt")||(0,i.Z)("pm"),e.reader=e.reader||(0,i.Z)("reader")||(0,i.Z)("rdr"),e.lang=e.lang||(0,i.Z)("lang")||(0,i.Z)("l");const n=e.root||e.document||e.model||e.geometry;if(this.setBaseUrl(new URL(n||".",window.location).href),e.uiMode){let t=0,n=!1;const i=Object.values(W.p).filter((e=>"string"==typeof e));e.uiMode.split("|").forEach((e=>{const s=e.toLowerCase();i.includes(s)&&(t+=W.p[s],n=!0)})),n&&this.documentProvider.activeComponent.setup.interface.ins.visibleElements.setValue(t)}e.dracoRoot&&this.assetReader.setDracoPath(e.dracoRoot),e.resourceRoot&&this.assetReader.setSystemAssetPath(e.resourceRoot),e.lang&&this.setLanguage(e.lang),e.document?(e.document=t.getAssetName(e.document),this.loadDocument(e.document,void 0,e.quality).then((()=>this.postLoadHandler(e))).catch((e=>o.ZP.show(`Failed to load document: ${e.message}`,"error")))):e.model?(e.model=t.getAssetName(e.model),this.assetReader.getText(e.model).then((()=>{this.loadModel(e.model,e.quality),this.postLoadHandler(e)})).catch((e=>o.ZP.show(`Bad Model Path: ${e.message}`,"error")))):e.geometry?(e.geometry=t.getAssetName(e.geometry),e.texture=t.getAssetName(e.texture),e.occlusion=t.getAssetName(e.occlusion),e.normals=t.getAssetName(e.normals),this.assetReader.getText(e.geometry).then((()=>{this.loadGeometry(e.geometry,e.texture,e.occlusion,e.normals,e.quality),this.postLoadHandler(e)})).catch((e=>o.ZP.show(`Bad Geometry Path: ${e.message}`,"error")))):e.root&&this.loadDocument("scene.svx.json",void 0).then((()=>this.postLoadHandler(e))).catch((()=>{}))}postLoadHandler(e){if(this.assetManager.ins.baseUrlValid.setValue(!0),e.bgColor){const t=e.bgColor.split(" ");this.setBackgroundColor(t[0],t[1]||null)}e.bgStyle&&this.setBackgroundStyle(e.bgStyle),e.controls&&this.enableNavigation(e.controls),e.prompt&&this.enablePrompt(e.prompt),e.reader&&this.enableReader(e.reader)}toggleAnnotations(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.viewer.ins,t=this.system.getMainComponent(h.Z).ins;t.visible.value&&t.visible.setValue(!1),e.annotationsVisible.setValue(!e.annotationsVisible.value),this.analytics.sendProperty("Annotations_Visible",e.annotationsVisible.value)}toggleReader(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.reader,t=e.ins;t.enabled.setValue(!t.enabled.value),t.focus.setValue(t.enabled.value),t.enabled.value&&t.articleId.setValue(1===e.articles.length?e.articles[0].article.id:""),this.analytics.sendProperty("Reader_Enabled",t.enabled.value)}toggleTours(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.tours.ins,t=this.system.getMainComponent(V.Z).activeComponent.setup.reader.ins;e.enabled.value?e.enabled.setValue(!1):(t.enabled.value&&t.enabled.setValue(!1),e.enabled.setValue(!0),e.tourIndex.setValue(-1)),this.analytics.sendProperty("Tours_Enabled",e.enabled.value)}toggleTools(){const e=this.system.getMainComponent(h.Z).ins,t=this.system.getMainComponent(V.Z).activeComponent.setup.viewer.ins;t.annotationsVisible.value&&t.annotationsVisible.setValue(!1),e.visible.setValue(!e.visible.value),this.analytics.sendProperty("Tools_Visible",e.visible.value)}toggleMeasurement(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.tape.ins;e.visible.setValue(!e.visible.value)}enableAR(){this.system.getMainComponent(Z.Z).ins.enabled.setValue(!0),this.analytics.sendProperty("AR_enabled",!0)}getArticles(){return this.system.getMainComponent(V.Z).activeComponent.setup.reader.articles.map((e=>e.article.data))}getAnnotations(){const e=this.system.getComponent(K.Z).getGraphComponents(J.Z);let t=[];return e.forEach((e=>{t=t.concat(e.getAnnotations())})),t}getCameraOrbit(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins;let n=t.orbit.value;if(e){const i=e.toLowerCase();if("max"===i)n=t.maxOrbit.value;else if("min"===i)n=t.minOrbit.value;else if("active"!==i)return void console.error("Error: getCameraOrbit invalid type param.")}return n.slice(0,2)}setCameraOrbit(e,t){const n=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins,i=parseFloat(e),s=parseFloat(t);isNaN(i)||isNaN(s)?console.error("Error: setCameraOrbit param is not a number."):n.orbit.setValue([i,s,0])}getCameraOffset(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins;let n=t.offset.value;if(e){const i=e.toLowerCase();if("max"===i)n=t.maxOffset.value;else if("min"===i)n=t.minOffset.value;else if("active"!==i)return void console.error("Error: getCameraOffset invalid type param.")}return n.slice(0,3)}setCameraOffset(e,t,n){const i=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins;let s=parseFloat(e),r=parseFloat(t),o=parseFloat(n);if(isNaN(s)||isNaN(r)||isNaN(o))console.error("Error: setCameraOffset param is not a number.");else{const e=i.minOffset.value,t=i.maxOffset.value;s=(0,Y.u)(s,e[0],t[0]),r=(0,Y.u)(r,e[1],t[1]),o=(0,Y.u)(o,e[2],t[2]),i.offset.setValue([s,r,o])}}setBackgroundColor(e,t){const n=this.system.getMainComponent(V.Z).activeComponent.setup.background.ins,i=document.createElement("div");if(i.id="temp-color",i.style.color=e,document.body.appendChild(i),""!==i.style.color){const e=getComputedStyle(i).color.split("(")[1].split(")")[0].split(",").map((e=>parseInt(e)/255));n.color0.setValue(e)}else console.error("Error: Color0 param is invalid.");if(t)if(i.style.color=t,""!==i.style.color){const e=getComputedStyle(i).color.split("(")[1].split(")")[0].split(",").map((e=>parseInt(e)/255));n.color1.setValue(e)}else console.error("Error: Color1 param is invalid.");document.body.removeChild(i)}setBackgroundStyle(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.background.ins,n=Object.values(q.u6).filter((e=>"string"==typeof e)).find((t=>t.toLowerCase()===e.toLowerCase()));void 0!==n?t.style.setValue(q.u6[n]):console.error("Error: Style param is invalid.")}setTourStep(e,t,n){const i=this.system.getMainComponent(V.Z).activeComponent.setup.tours.ins,s=this.system.getMainComponent(V.Z).activeComponent.setup.tours.outs;let r=parseInt(e),o=parseInt(t);!isNaN(r)&&!isNaN(o)&&r>=0&&o>=0?(i.tourIndex.setValue(r),n?(s.stepIndex.setValue(o-1),i.next.set()):i.stepIndex.setValue(o)):console.error("Error: setTourStep param ["+r+" "+o+"] is not a valid number.")}enableNavigation(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins.pointerEnabled.setValue(t)}else console.error("Error: enableNavigation param is not valid.")}enablePrompt(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins.promptEnabled.setValue(t)}else console.error("Error: enablePrompt param is not valid.")}enableReader(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(V.Z).activeComponent.setup.reader.ins.visible.setValue(t)}else console.error("Error: enableReader param is not valid.")}setLanguage(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.language.ins,n=e.toUpperCase();n in Q.PD?t.language.setValue(Q.PD[n]):console.error("Error: setLanguage param is not a valid language id.")}setActiveArticle(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.reader;t.ins.enabled.setValue(!0),t.ins.articleId.setValue(e)}isTrue(e){let t;const n=e.toLowerCase();return"true"===n?t=!0:"false"===n&&(t=!1),t}}ee.splashMessage="\n _________ .__ __ .__ .__ ________ ________ \n / _____/ _____ |__|/ |_| |__ __________ ____ |__|____ ____ \\_____ \\\\______ \\ \n \\_____ \\ / \\| \\ __\\ | \\ / ___/ _ \\ / \\| \\__ \\ / \\ _(__ < | | \\ \n / \\ Y Y \\ || | | Y \\\\___ ( <_> ) | \\ |/ __ \\| | \\ / \\| ` \\\n/_______ /__|_| /__||__| |___| /____ >____/|___| /__(____ /___| / /______ /_______ /\n \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \n \nVoyager - 3D Explorer and Tool Suite\n3D Foundation Project\n(c) 2024 Smithsonian Institution\n\nhttps://3d.si.edu\nhttps://github.com/smithsonian/dpo-voyager\n\n-----------------------------------------------------\nVersion: Voyager v0.42.1 PROD\n-----------------------------------------------------\n ",window.VoyagerExplorer=ee},89167:(e,t,n)=>{"use strict";n.d(t,{Z:()=>me,J:()=>pe});var i=n(18894),s=n(26220),r=n(63833),o=n(92989),a=n(403),l=n(15271),c=n(38080),h=n(18345),d=n(36283),u=n(90199),p=n(11359),m=n(63872),f=n(68327),g=n(48377),v=n(25864),y=n(26629),b=n(79815),_=n(13227),x=n(84678),w=n(3388),S=n(80038);class M extends S.ZP{constructor(){super(...arguments),this.ins=this.addInputs(M.ins)}get model(){return this.getComponent(w.Z)}update(e){return!0}}M.typeName="CVAnnotations",M.ins={};var E=n(51462),T=n(31105),C=n(27884),A=n(53414),P=n(19588),R=n(54992),L=n(16967);new P.P;class N extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(N.pointLightIns),this.object3D=new R.c}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return n.position.changed&&(t.position.fromArray(n.position.value),t.updateMatrix()),(n.distance.changed||n.decay.changed)&&(t.distance=n.distance.value,t.decay=n.decay.value,t.shadow.camera.near=t.distance?t.distance/800:.5),t.updateMatrix(),!0}}N.typeName="CPointLight",N.pointLightIns={position:S.V5.Vector3("Light.Position"),distance:S.V5.Number("Light.Distance"),decay:S.V5.Number("Light.Decay",1)};class D extends N{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.distance,this.ins.decay,this.ins.shadowEnabled,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==D.type)throw new Error("light type mismatch: not a point light");return n.point=n.point||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,distance:n.point.distance||i.distance.schema.preset,decay:void 0!==n.point.decay?n.point.decay:i.decay.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowResolution:void 0!==n.shadowResolution&&L.B[n.shadowResolution]||1,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,point:{distance:n.distance.value,decay:n.decay.value}};i.type=D.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=L.B[n.shadowResolution.value])),e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}D.typeName="CVPointLight",D.type="point",D.text="Point Light",D.icon="bulb";var I=n(16426),O=n(71050);class U extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(U.spotLightIns),this.object3D=new I.P,this.light.target.matrixAutoUpdate=!1}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.target.position.fromArray(n.target.value),t.updateMatrix(),t.target.updateMatrix()),(n.distance.changed||n.decay.changed||n.angle.changed||n.penumbra.changed)&&(t.distance=n.distance.value,t.decay=n.decay.value,t.angle=n.angle.value*O.M8.DEG2RAD,t.penumbra=n.penumbra.value,t.shadow.camera.near=t.distance?t.distance/800:.5),!0}onAddToParent(e){super.onAddToParent(e),e.add(this.light.target)}onRemoveFromParent(e){super.onRemoveFromParent(e),e.remove(this.light.target)}}U.typeName="CSpotLight",U.spotLightIns={position:S.V5.Vector3("Light.Position"),target:S.V5.Vector3("Light.Target",[0,-1,0]),distance:S.V5.Number("Light.Distance"),decay:S.V5.Number("Light.Decay",1),angle:S.V5.Number("Light.Angle",45),penumbra:S.V5.Percent("Light.Penumbra",.5)};class k extends U{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.distance,this.ins.decay,this.ins.angle,this.ins.penumbra,this.ins.shadowEnabled,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==k.type)throw new Error("light type mismatch: not a spot light");return n.spot=n.spot||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset,distance:n.spot.distance||i.distance.schema.preset,decay:void 0!==n.spot.decay?n.spot.decay:i.decay.schema.preset,angle:void 0!==n.spot.angle?n.spot.angle:i.angle.schema.preset,penumbra:n.spot.penumbra||i.penumbra.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowResolution:void 0!==n.shadowResolution&&L.B[n.shadowResolution]||1,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,spot:{distance:n.distance.value,decay:n.decay.value,angle:n.angle.value,penumbra:n.penumbra.value}};i.type=k.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=L.B[n.shadowResolution.value])),e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}k.typeName="CVSpotLight",k.type="spot",k.text="Spot Light",k.icon="spot";var V=n(40490),z=n(27643),F=n(5249),B=n(44661),$=n(71507),j=n(97322),H=n(6461),G=n(29767),Z=n(63531),W=n(7134),q=n(74572),X=n(24856),Y=n(30242),K=n(93072),J=n(17467),Q=n(38303),ee=n(87203),te=n(82567),ne=n(75222),ie=n(19816);class se extends ie._{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class re extends L.Z{constructor(e,t){super(e,t),this.object3D=new se}get light(){return this.object3D}}re.typeName="CAmbientLight";class oe extends re{get settingProperties(){return[this.ins.color,this.ins.intensity]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==oe.type)throw new Error("light type mismatch: not an ambient light");return n.point=n.point||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=oe.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}oe.typeName="CVAmbientLight",oe.type="ambient",oe.text="Ambient Light",oe.icon="globe";var ae=n(57090);class le extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(le.hemiLightIns),this.object3D=new ae.v}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.ground.changed||n.intensity.changed)&&(t.groundColor.fromArray(n.ground.value),t.intensity=n.intensity.value),!0}}le.typeName="CHemisphereLight",le.hemiLightIns={ground:S.V5.ColorRGB("Light.Ground",[.31,.31,.125])};class ce extends le{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.ground]}get snapshotProperties(){return[this.ins.color,this.ins.intensity,this.ins.ground]}dispose(){super.dispose()}fromDocument(e,t){var n,i;if(!isFinite(t.light))throw new Error("light property missing in node");const s=e.lights[t.light],r=this.ins;if(s.type!==ce.type)throw new Error("light type mismatch: not an hemisphere light");return s.point=s.point||{},r.copyValues({color:void 0!==s.color?s.color:r.color.schema.preset,intensity:void 0!==s.intensity?s.intensity:r.intensity.schema.preset,ground:null!==(i=null===(n=s.hemisphere)||void 0===n?void 0:n.ground)&&void 0!==i?i:r.ground.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,hemisphere:{ground:n.ground.cloneValue()}};i.type=ce.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}ce.typeName="CVHemisphereLight",ce.type="hemisphere",ce.text="Hemisphere Light",ce.icon="half-sun";var he=n(50910);class de extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(de.rectLightIns),this.object3D=new he.T}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.updateMatrix()),!0}}de.typeName="CRectLight",de.rectLightIns={position:S.V5.Vector3("Light.Position",[0,1,0]),target:S.V5.Vector3("Light.Target",[0,0,0]),size:S.V5.Vector2("Light.Size",[10,10])};class ue extends de{get settingProperties(){return[this.ins.color,this.ins.intensity]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==ue.type)throw new Error(`light type mismatch: not a directional light (${n.type})`);return i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=ue.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}ue.typeName="CVRectLight",ue.type="rect",ue.text="Rectangular Light",ue.icon="area";const pe=[A.Z,D,k,oe,ce,ue],me=[i.ZP,s.Z,r.Z,o.Z,a.Z,l.Z,c.Z,h.Z,d.Z,u.Z,p.Z,Y.Z,m.Z,f.Z,g.Z,v.Z,y.Z,b.Z,_.Z,x.Z,w.Z,M,E.Z,T.Z,C.Z,...pe,V.Z,z.Z,F.ZP,B.ZP,$.Z,j.Z,H.Z,G.Z,Z.Z,W.Z,q.Z,X.Z,K.Z,J.Z,Q.Z,ee.Z,te.Z,ne.Z]},30242:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Ye});var i={};n.r(i),n.d(i,{ArcCurve:()=>E,CatmullRomCurve3:()=>L,CubicBezierCurve:()=>O,CubicBezierCurve3:()=>U,EllipseCurve:()=>M,LineCurve:()=>k,LineCurve3:()=>V,QuadraticBezierCurve:()=>z,QuadraticBezierCurve3:()=>F,SplineCurve:()=>B});var s=n(80038),r=n(15271),o=n(92642),a=n(26220),l=n(10564),c=n(82587),h=n(19588),d=n(40693),u=n(37840),p=n(78943),m=n(96643),f=n(45787);class g{constructor(e,t,n=0,i=1/0){this.ray=new m.z(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new f.S,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return y(e,this,n,t),n.sort(v),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i0)){l=i;break}l=i-1}if(i=l,n[i]===r)return i/(s-1);const c=n[i];return(i+(r-c)/(n[i+1]-c))/(s-1)}getTangent(e,t){const n=1e-4;let i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);const r=this.getPoint(i),o=this.getPoint(s),a=t||(r.isVector2?new d.F:new h.P);return a.copy(o).sub(r).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new h.P,i=[],s=[],r=[],o=new h.P,a=new c.y;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new h.P)}s[0]=new h.P,r[0]=new h.P;let l=Number.MAX_VALUE;const d=Math.abs(i[0].x),u=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=l&&(l=d,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),p<=l&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),r[0].crossVectors(i[0],s[0]);for(let t=1;t<=e;t++){if(s[t]=s[t-1].clone(),r[t]=r[t-1].clone(),o.crossVectors(i[t-1],i[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(w.uZ(i[t-1].dot(i[t]),-1,1));s[t].applyMatrix4(a.makeRotationAxis(o,e))}r[t].crossVectors(i[t],s[t])}if(!0===t){let t=Math.acos(w.uZ(s[0].dot(s[e]),-1,1));t/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(t=-t);for(let n=1;n<=e;n++)s[n].applyMatrix4(a.makeRotationAxis(i[n],t*n)),r[n].crossVectors(i[n],s[n])}return{tangents:i,normals:s,binormals:r}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class M extends S{constructor(e=0,t=0,n=1,i=1,s=0,r=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const n=t||new d.F,i=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(l)/s)+1)*s:0===c&&l===s-1&&(l=s-2,c=1),this.closed||l>0?o=i[(l-1)%s]:(C.subVectors(i[0],i[1]).add(i[0]),o=C);const d=i[l%s],u=i[(l+1)%s];if(this.closed||l+2i.length-2?i.length-1:r+1],h=i[r>i.length-3?i.length-1:r+2];return n.set(N(o,a.x,l.x,c.x,h.x),N(o,a.y,l.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const e=i[s]-n,r=this.curves[s],o=r.getLength(),a=0===o?0:1-e/o;return r.getPointAt(a,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class H extends j{constructor(e){super(e),this.uuid=w.DO(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n80*n){a=c=e[0],l=h=e[1];for(let t=n;tc&&(c=d),u>h&&(h=u);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return Y(r,o,n,a,l,p,0),o};function q(e,t,n,i,s){let r,o;if(s===function(e,t,n,i){let s=0;for(let r=t,o=n-i;r0)for(r=t;r=t;r-=i)o=fe(r,e[r],e[r+1],o);return o&&ce(o,o.next)&&(ge(o),o=o.next),o}function X(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!ce(i,i.next)&&0!==le(i.prev,i,i.next))i=i.next;else{if(ge(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function Y(e,t,n,i,s,r,o){if(!e)return;!o&&r&&function(e,t,n,i){let s=e;do{0===s.z&&(s.z=se(s.x,s.y,t,n,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==e);s.prevZ.nextZ=null,s.prevZ=null,function(e){let t,n,i,s,r,o,a,l,c=1;do{for(n=e,e=null,r=null,o=0;n;){for(o++,i=n,a=0,t=0;t0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(s=n,n=n.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:e=s,s.prevZ=r,r=s;n=i}r.nextZ=null,c*=2}while(o>1)}(s)}(e,i,s,r);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,r?J(e,i,s,r):K(e))t.push(a.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),ge(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Y(e=Q(X(e),t,n),t,n,i,s,r,2):2===o&&ee(e,t,n,i,s,r):Y(X(e),t,n,i,s,r,1);break}}function K(e){const t=e.prev,n=e,i=e.next;if(le(t,n,i)>=0)return!1;const s=t.x,r=n.x,o=i.x,a=t.y,l=n.y,c=i.y,h=sr?s>o?s:o:r>o?r:o,p=a>l?a>c?a:c:l>c?l:c;let m=i.next;for(;m!==t;){if(m.x>=h&&m.x<=u&&m.y>=d&&m.y<=p&&oe(s,a,r,l,o,c,m.x,m.y)&&le(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function J(e,t,n,i){const s=e.prev,r=e,o=e.next;if(le(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,h=s.y,d=r.y,u=o.y,p=al?a>c?a:c:l>c?l:c,g=h>d?h>u?h:u:d>u?d:u,v=se(p,m,t,n,i),y=se(f,g,t,n,i);let b=e.prevZ,_=e.nextZ;for(;b&&b.z>=v&&_&&_.z<=y;){if(b.x>=p&&b.x<=f&&b.y>=m&&b.y<=g&&b!==s&&b!==o&&oe(a,h,l,d,c,u,b.x,b.y)&&le(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==s&&_!==o&&oe(a,h,l,d,c,u,_.x,_.y)&&le(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;b&&b.z>=v;){if(b.x>=p&&b.x<=f&&b.y>=m&&b.y<=g&&b!==s&&b!==o&&oe(a,h,l,d,c,u,b.x,b.y)&&le(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;_&&_.z<=y;){if(_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==s&&_!==o&&oe(a,h,l,d,c,u,_.x,_.y)&&le(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Q(e,t,n){let i=e;do{const s=i.prev,r=i.next.next;!ce(s,r)&&he(s,i,i.next,r)&&pe(s,r)&&pe(r,s)&&(t.push(s.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),ge(i),ge(i.next),i=e=r),i=i.next}while(i!==e);return X(i)}function ee(e,t,n,i,s,r){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&ae(o,e)){let a=me(o,e);return o=X(o,o.next),a=X(a,a.next),Y(o,t,n,i,s,r,0),void Y(a,t,n,i,s,r,0)}e=e.next}o=o.next}while(o!==e)}function te(e,t){return e.x-t.x}function ne(e,t){const n=function(e,t){let n,i=t,s=-1/0;const r=e.x,o=e.y;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){const e=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=r&&e>s&&(s=e,n=i.x