@prostgles/app 2.3.6-dev.1796082782 → 2.3.6-dev.1796227577
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/build/02726df5e3a78b451761.mjs +2 -0
- package/client/build/{b02769651493b6f4acec.mjs.LICENSE.txt → 02726df5e3a78b451761.mjs.LICENSE.txt} +0 -1
- package/client/build/index.html +1 -1
- package/client/build/js/155.bundle.js +1 -1
- package/client/build/js/34.bundle.js +1 -1
- package/client/build/js/474.bundle.js +1 -1
- package/client/build/js/478.bundle.js +1 -1
- package/client/build/js/495.bundle.js +1 -1
- package/client/build/js/499.bundle.js +1 -1
- package/client/build/js/578.bundle.js +1 -1
- package/client/build/js/586.bundle.js +1 -1
- package/client/build/js/630.bundle.js +1 -1
- package/client/build/js/650.bundle.js +1 -1
- package/client/build/js/776.bundle.js +1 -1
- package/client/build/js/872.bundle.js +1 -1
- package/client/build/js/88.bundle.js +1 -1
- package/client/build/js/934.bundle.js +1 -1
- package/client/build/js/977.bundle.js +1 -1
- package/client/build/js/998.bundle.js +2 -0
- package/client/build/js/{733.bundle.js.LICENSE.txt → 998.bundle.js.LICENSE.txt} +1 -1
- package/client/build/js/deckgl.bundle.js +1 -1
- package/client/build/js/deckglExtensions.bundle.js +1 -1
- package/client/build/js/main.bundle.js +2 -2
- package/client/build/js/monaco_editor.bundle.js +1 -1
- package/client/build/js/mvtLoader.bundle.js +1 -1
- package/client/build/js/papaparse.bundle.js +1 -1
- package/client/build/js/papaparse.bundle.js.LICENSE.txt +1 -1
- package/client/build/mvt-worker.js +1 -1
- package/client/build/static/css/{main.d122debc.css → main.9f3305cf.css} +16 -0
- package/dist/common/DBGeneratedSchema.d.ts +30 -30
- package/dist/common/DBGeneratedSchema.d.ts.map +1 -1
- package/dist/common/DashboardTypes.d.ts +1 -1
- package/dist/common/DashboardTypes.d.ts.map +1 -1
- package/dist/common/actionColumn.d.ts +7 -7
- package/dist/common/actionColumn.d.ts.map +1 -1
- package/dist/common/actionColumn.js +7 -1
- package/dist/common/actionColumn.js.map +1 -1
- package/dist/common/columnDisplayFormat.schema.d.ts +4 -4
- package/dist/common/createActionColumn.d.ts +3 -3
- package/dist/common/functionOptions.d.ts +6 -6
- package/dist/common/llmUtils.d.ts.map +1 -1
- package/dist/common/mcp/tableOptionsJsonbSchema.d.ts +8 -8
- package/dist/common/mcp/ui.mcp.schema.d.ts +8 -8
- package/dist/common/prostglesMcp.d.ts +8 -8
- package/dist/common/userSync.d.ts +1 -2
- package/dist/common/userSync.d.ts.map +1 -1
- package/dist/common/userSync.js +8 -16
- package/dist/common/userSync.js.map +1 -1
- package/dist/server/package.json +8 -8
- package/dist/server/src/Alerts/enqueueAlerts.d.ts +1 -1
- package/dist/server/src/Alerts/enqueueAlerts.d.ts.map +1 -1
- package/dist/server/src/Alerts/enqueueAlerts.js +2 -2
- package/dist/server/src/Alerts/enqueueAlerts.js.map +1 -1
- package/dist/server/src/Alerts/getAlertFunctions.d.ts +1 -1
- package/dist/server/src/Alerts/getAlertFunctions.d.ts.map +1 -1
- package/dist/server/src/Alerts/getAlertFunctions.js +4 -4
- package/dist/server/src/Alerts/getAlertFunctions.js.map +1 -1
- package/dist/server/src/Alerts/getAlertRecipients.d.ts +1 -1
- package/dist/server/src/Alerts/getAlertRecipients.d.ts.map +1 -1
- package/dist/server/src/Alerts/getAlertRecipients.js +6 -6
- package/dist/server/src/Alerts/getAlertRecipients.js.map +1 -1
- package/dist/server/src/Alerts/getAlertTables.d.ts +1 -1
- package/dist/server/src/Alerts/getAlertTables.d.ts.map +1 -1
- package/dist/server/src/Alerts/getAlertTables.js +3 -3
- package/dist/server/src/Alerts/getAlertTables.js.map +1 -1
- package/dist/server/src/Alerts/getAlertsPlugin.d.ts +1 -1
- package/dist/server/src/Alerts/getAlertsPlugin.d.ts.map +1 -1
- package/dist/server/src/Alerts/getAlertsPlugin.js +5 -5
- package/dist/server/src/Alerts/getAlertsPlugin.js.map +1 -1
- package/dist/server/src/Alerts/runAlertDelivery.d.ts +1 -1
- package/dist/server/src/Alerts/runAlertDelivery.d.ts.map +1 -1
- package/dist/server/src/Alerts/runAlertDelivery.js +2 -2
- package/dist/server/src/Alerts/runAlertDelivery.js.map +1 -1
- package/dist/server/src/BackupManager/BackupManager.d.ts +30 -30
- package/dist/server/src/BackupManager/BackupManager.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/ConnectionManager.d.ts +32 -31
- package/dist/server/src/ConnectionManager/ConnectionManager.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/ConnectionManager.js +10 -8
- package/dist/server/src/ConnectionManager/ConnectionManager.js.map +1 -1
- package/dist/server/src/ConnectionManager/applyStartupSchemaConfig.js +1 -1
- package/dist/server/src/ConnectionManager/applyStartupSchemaConfig.js.map +1 -1
- package/dist/server/src/ConnectionManager/applyUserSyncTableConfig.d.ts +9 -0
- package/dist/server/src/ConnectionManager/applyUserSyncTableConfig.d.ts.map +1 -0
- package/dist/server/src/ConnectionManager/applyUserSyncTableConfig.js +40 -0
- package/dist/server/src/ConnectionManager/applyUserSyncTableConfig.js.map +1 -0
- package/dist/server/src/ConnectionManager/deleteStaleUserSyncRows.d.ts +4 -0
- package/dist/server/src/ConnectionManager/deleteStaleUserSyncRows.d.ts.map +1 -0
- package/dist/server/src/ConnectionManager/deleteStaleUserSyncRows.js +26 -0
- package/dist/server/src/ConnectionManager/deleteStaleUserSyncRows.js.map +1 -0
- package/dist/server/src/ConnectionManager/getAuditActorTableConfig.d.ts +1 -1
- package/dist/server/src/ConnectionManager/getAuditActorTableConfig.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/getAuditActorTableConfig.js +1 -3
- package/dist/server/src/ConnectionManager/getAuditActorTableConfig.js.map +1 -1
- package/dist/server/src/ConnectionManager/getConnectionAuth.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/getConnectionServerFunctions.d.ts +4 -3
- package/dist/server/src/ConnectionManager/getConnectionServerFunctions.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/getConnectionServerFunctions.js +1 -4
- package/dist/server/src/ConnectionManager/getConnectionServerFunctions.js.map +1 -1
- package/dist/server/src/ConnectionManager/getHotReloadConfigs.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/getHotReloadConfigs.js +16 -9
- package/dist/server/src/ConnectionManager/getHotReloadConfigs.js.map +1 -1
- package/dist/server/src/ConnectionManager/getSchemaConfig.d.ts +284 -2
- package/dist/server/src/ConnectionManager/getSchemaConfig.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/getSchemaConfig.js +57 -10
- package/dist/server/src/ConnectionManager/getSchemaConfig.js.map +1 -1
- package/dist/server/src/ConnectionManager/getUserSyncLookups.d.ts +14 -0
- package/dist/server/src/ConnectionManager/getUserSyncLookups.d.ts.map +1 -0
- package/dist/server/src/ConnectionManager/getUserSyncLookups.js +26 -0
- package/dist/server/src/ConnectionManager/getUserSyncLookups.js.map +1 -0
- package/dist/server/src/ConnectionManager/initConnectionManager.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/initConnectionManager.js +7 -5
- package/dist/server/src/ConnectionManager/initConnectionManager.js.map +1 -1
- package/dist/server/src/ConnectionManager/setSyncUserSub.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/setSyncUserSub.js +20 -15
- package/dist/server/src/ConnectionManager/setSyncUserSub.js.map +1 -1
- package/dist/server/src/ConnectionManager/syncConnectionUsers.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/syncConnectionUsers.js +40 -44
- package/dist/server/src/ConnectionManager/syncConnectionUsers.js.map +1 -1
- package/dist/server/src/ConnectionManager/syncSchemaConfig.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/syncSchemaConfig.js +12 -13
- package/dist/server/src/ConnectionManager/syncSchemaConfig.js.map +1 -1
- package/dist/server/src/Emails/getEmailOutboxPlugin.d.ts +1 -1
- package/dist/server/src/Emails/getEmailOutboxPlugin.d.ts.map +1 -1
- package/dist/server/src/Emails/getEmailOutboxPlugin.js +2 -2
- package/dist/server/src/Emails/getEmailOutboxPlugin.js.map +1 -1
- package/dist/server/src/Emails/getEmailOutboxTables.d.ts +1 -1
- package/dist/server/src/Emails/getEmailOutboxTables.d.ts.map +1 -1
- package/dist/server/src/Emails/getEmailOutboxTables.js +2 -2
- package/dist/server/src/Emails/getEmailOutboxTables.js.map +1 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/definitionValidation/validateAgenticWorkflowDefinitions.d.ts.map +1 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/proxyHandlers/createWorkflowExecutionHandlers.d.ts.map +1 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/proxyHandlers/getAgentConfigWithDefaults.d.ts.map +1 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/proxyHandlers/setupOrchestrationToolPermissions.d.ts.map +1 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Ui.mcp.d.ts +8 -8
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/WebDev/tools/getWebDevChatAndConnection.d.ts +30 -30
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/WebDev/tools/getWebDevChatAndConnection.d.ts.map +1 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers.d.ts +16 -16
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMcpHub.d.ts +16 -16
- package/dist/server/src/Plugins/jobsPlugin.d.ts +2 -2
- package/dist/server/src/Plugins/jobsPlugin.d.ts.map +1 -1
- package/dist/server/src/Plugins/jobsPlugin.js +2 -2
- package/dist/server/src/Plugins/jobsPlugin.js.map +1 -1
- package/dist/server/src/Plugins/parsePlugins.d.ts +4 -2
- package/dist/server/src/Plugins/parsePlugins.d.ts.map +1 -1
- package/dist/server/src/Plugins/parsePlugins.js +7 -10
- package/dist/server/src/Plugins/parsePlugins.js.map +1 -1
- package/dist/server/src/authConfig/getAuth.d.ts.map +1 -1
- package/dist/server/src/authConfig/sessionUtils.d.ts.map +1 -1
- package/dist/server/src/authConfig/subscribeToAuthSetupChanges.d.ts.map +1 -1
- package/dist/server/src/cli/cliTemplateFiles.js +1 -1
- package/dist/server/src/cli/cliTemplateFiles.js.map +1 -1
- package/dist/server/src/init/initUsers.d.ts.map +1 -1
- package/dist/server/src/publish/getPublishLLM.d.ts.map +1 -1
- package/dist/server/src/publish/getPublishLlmChats.d.ts.map +1 -1
- package/dist/server/src/schemaConfig.d.ts +1 -1
- package/dist/server/src/schemaConfig.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/adminServerFunctions/stateServerAdminFunctions.d.ts +60 -60
- package/dist/server/src/serverFunctions/adminServerFunctions/stateServerAdminFunctions.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/adminServerFunctions/webApp/getTemplatedWebAppConnection.d.ts +30 -30
- package/dist/server/src/serverFunctions/adminServerFunctions/webApp/getTemplatedWebAppConnection.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/applySampleSchema.d.ts +30 -30
- package/dist/server/src/serverFunctions/applySampleSchema.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/askLLM.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/fetchModels.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/getPastMessages.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/getValidatedAskLLMChatOptions.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/handleToolUseResultConfirmation.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/prostglesLLMTools/getMCPServerTools.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/prostglesLLMTools/getMcpToolsWithDynamicDescription.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/askLLM/saveToolUseResults.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/deleteConnection.d.ts +30 -30
- package/dist/server/src/serverFunctions/deleteConnection.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/getConnectionAndDatabaseConfig.d.ts +30 -30
- package/dist/server/src/serverFunctions/getConnectionAndDatabaseConfig.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/loadGeneratedWorkspaces/loadGeneratedWorkspaces.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/loadGeneratedWorkspaces/loadGeneratedWorkspacesFunction.d.ts.map +1 -1
- package/dist/server/src/serverFunctions/stateServerFunctions.d.ts +60 -60
- package/dist/server/src/serverFunctions/stateServerFunctions.d.ts.map +1 -1
- package/dist/server/src/tableConfig/tableConfigUsers.d.ts +122 -3
- package/dist/server/src/tableConfig/tableConfigUsers.d.ts.map +1 -1
- package/dist/server/src/tableConfig/tableConfigUsers.js +14 -4
- package/dist/server/src/tableConfig/tableConfigUsers.js.map +1 -1
- package/dist/server/src/tableHooks/database_configs.tableHooks.d.ts +558 -2
- package/dist/server/src/tableHooks/database_configs.tableHooks.d.ts.map +1 -1
- package/dist/server/src/tableHooks/database_configs.tableHooks.js +12 -0
- package/dist/server/src/tableHooks/database_configs.tableHooks.js.map +1 -1
- package/dist/server/src/tableHooks/llm_credentials.tableHooks.d.ts.map +1 -1
- package/dist/server/src/tableHooks/tableHooks.d.ts +648 -92
- package/dist/server/src/tableHooks/tableHooks.d.ts.map +1 -1
- package/dist/server/src/tableHooks/users.tableHooks.d.ts +30 -30
- package/dist/server/src/tableHooks/users.tableHooks.d.ts.map +1 -1
- package/dist/server/src/upsertConnection.d.ts +30 -30
- package/dist/server/src/upsertConnection.d.ts.map +1 -1
- package/package.json +8 -8
- package/sample_schemas/crypto/dist/onMount.js +3 -1
- package/client/build/b02769651493b6f4acec.mjs +0 -2
- package/client/build/js/733.bundle.js +0 -2
- package/dist/server/src/ConnectionManager/syncConfiguredLlmCredential.d.ts +0 -4
- package/dist/server/src/ConnectionManager/syncConfiguredLlmCredential.d.ts.map +0 -1
- package/dist/server/src/ConnectionManager/syncConfiguredLlmCredential.js +0 -64
- package/dist/server/src/ConnectionManager/syncConfiguredLlmCredential.js.map +0 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/getAgentGrantPromptId.d.ts +0 -8
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/getAgentGrantPromptId.d.ts.map +0 -1
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/getAgentGrantPromptId.js +0 -34
- package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/getAgentGrantPromptId.js.map +0 -1
- package/dist/server/src/serverFunctions/askLLM/checkLLMLimit.d.ts +0 -4
- package/dist/server/src/serverFunctions/askLLM/checkLLMLimit.d.ts.map +0 -1
- package/dist/server/src/serverFunctions/askLLM/checkLLMLimit.js +0 -45
- package/dist/server/src/serverFunctions/askLLM/checkLLMLimit.js.map +0 -1
- package/dist/server/src/serverFunctions/askLLM/getLlmLimitWasReached.d.ts +0 -4
- package/dist/server/src/serverFunctions/askLLM/getLlmLimitWasReached.d.ts.map +0 -1
- package/dist/server/src/serverFunctions/askLLM/getLlmLimitWasReached.js +0 -26
- package/dist/server/src/serverFunctions/askLLM/getLlmLimitWasReached.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[977],{9350(t,e,n){var i=n(3459),o=n(19852);const r={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"};Object.defineProperty(r,"IDENTITY",{get:()=>(i.A.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),r.CARTESIAN)});const s={multipan:[o.uq,{threshold:10,pointers:2,trackpad:!0}],pinch:[o.h1,{trackpad:!0},null,["multipan"]],pan:[o.uq,{threshold:1},["pinch"],["multipan"]],dblclick:[o.Cx,{event:"dblclick",taps:2,enable:!1}],dblclickdrag:[o.Cp,{event:"dblclickdrag",enable:!1},["dblclick"],null],click:[o.Cx,{event:"click"},["dblclickdrag"],["dblclick","dblclickdrag"]]};n.d(e,["Kx",0,{WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},"We",0,s,"p5",0,{common:0,meters:1,pixels:2},"rf",0,r,"tg",0,{click:"onClick",dblclick:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"}])},18742(t,e,n){var i=n(7914);class LayerExtension{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(t){t&&(this.opts=t)}equals(t){return this===t||this.constructor===t.constructor&&(0,i.b)(this.opts,t.opts,1)}getShaders(t){return null}getSubLayerProps(t){const{defaultProps:e}=t.constructor,n={updateTriggers:{}};for(const t in e)if(t in this.props){const i=e[t],o=this.props[t];n[t]=o,i&&"accessor"===i.type&&(n.updateTriggers[t]=this.props.updateTriggers[t],"function"==typeof o&&(n[t]=this.getSubLayerAccessor(o)))}return n}initializeState(t,e){}updateState(t,e){}onNeedsRedraw(t){}getNeedsPickingBuffer(t){return!1}draw(t,e){}finalizeState(t,e){}}LayerExtension.defaultProps={},LayerExtension.extensionName="LayerExtension";const o=LayerExtension;n.d(e,["A",0,o])},98043(t,e,n){n.d(e,{A:()=>LayersPass});class Pass{constructor(t,e={id:"pass"}){const{id:n}=e;this.id=n,this.device=t,this.props={...e}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}}const i={depthWriteEnabled:!0,depthCompare:"less-equal",blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"one-minus-src-alpha",blendAlphaOperation:"add",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one-minus-src-alpha"};class LayersPass extends Pass{constructor(){super(...arguments),this._lastRenderIndex=-1}render(t){this._render(t)}_render(t){const{canvasContext:e=this.device.canvasContext}=t,n=t.target??e.getCurrentFramebuffer(),[i,o]=e.getDrawingBufferSize(),r=t.clearCanvas??!0;let s=t.clearColor??(!!r&&[0,0,0,0]),a=!!r&&1,c=!!r&&0;const l=t.colorMask??15,h={viewport:[0,0,i,o]};t.colorMask&&(h.colorMask=l),t.scissorRect&&(h.scissorRect=t.scissorRect);const{shaderModuleProps:u,viewports:p,views:d,onViewportActive:f,clearStack:m=!0}=t,_=t.pass||"unknown",v="webgpu"===this.device.type;m&&(this._lastRenderIndex=-1);const g=[];if(!p.length){return this.device.beginRenderPass({framebuffer:n,parameters:h,clearColor:s,clearDepth:a,clearStencil:c}).end(),this.device.submit(),g}try{for(const i of p){f?.(i);const o=this._getDrawLayerParams(i,t),r=d&&d[i.id],l=i.subViewports||[i],p=v?l.map(t=>[t]):[l];for(const i of p){const l=this.device.beginRenderPass({framebuffer:n,parameters:h,clearColor:s,clearDepth:a,clearStencil:c});try{for(const s of i){const i=this._drawLayersInViewport(l,{target:n,canvasContext:e,shaderModuleProps:u,viewport:s,view:r,pass:_,layers:t.layers,isPicking:t.isPicking},o);g.push(i)}}finally{l.end(),v&&this.device.submit()}s=!1,a=!1,c=!1}}return g}finally{v||this.device.submit()}}_getDrawLayerParams(t,{layers:e,pass:n,isPicking:r=!1,layerFilter:s,cullRect:a,views:c,effects:l,canvasContext:h=this.device.canvasContext,shaderModuleProps:u},p=!1){const d=[],f=o(this._lastRenderIndex+1),m={layer:e[0],viewport:t,isPicking:r,renderPass:n,cullRect:a},_={};for(let o=0;o<e.length;o++){const r=e[o],a=this._shouldDrawLayer(r,m,s,_),v={shouldDrawLayer:a};if(a&&!p){v.shouldDrawLayer=!0,v.layerRenderIndex=f(r,a),v.shaderModuleProps=this._getShaderModuleProps(r,l,n,h,u);const e="webgpu"===r.context.device.type?i:null;v.layerParameters={...e,...r.context.deck?.props.parameters,...c?.[t.id]?.props.parameters,...this.getLayerParameters(r,o,t)}}d[o]=v}return d}_drawLayersInViewport(t,{layers:e,shaderModuleProps:n,pass:i,target:o,canvasContext:r,viewport:s,view:a,isPicking:c},l){const h=function(t,{canvasContext:e=t.canvasContext,shaderModuleProps:n,target:i,viewport:o}){const r=n?.project?.devicePixelRatio??e.cssToDeviceRatio(),[,s]=e.getDrawingBufferSize(),a=i?i.height:s,c=o;return[c.x*r,a-(c.y+c.height)*r,c.width*r,c.height*r]}(this.device,{canvasContext:r,shaderModuleProps:n,target:o,viewport:s});if(a){const{clear:t,clearColor:e,clearDepth:n,clearStencil:i}=a.props;if(t){let t=[0,0,0,0],r=1,s=0;Array.isArray(e)&&!c?t=[...e.slice(0,3),e[3]||255].map(t=>t/255):!1===e&&(t=!1),void 0!==n&&(r=n),void 0!==i&&(s=i);this.device.beginRenderPass({framebuffer:o,parameters:{viewport:h,scissorRect:h},clearColor:t,clearDepth:r,clearStencil:s}).end()}}const u={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};t.setParameters({viewport:h});for(let n=0;n<e.length;n++){const o=e[n],r=l[n],{shouldDrawLayer:a}=r;if(a&&o.props.pickable&&u.pickableCount++,o.isComposite&&u.compositeCount++,o.isDrawable&&r.shouldDrawLayer){const{layerRenderIndex:e,shaderModuleProps:n,layerParameters:a}=r;u.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,e),n.project&&(n.project.viewport=s),o.context.renderPass=t;try{o._drawLayer({renderPass:t,shaderModuleProps:n,uniforms:{layerIndex:e},parameters:a})}catch(t){o.raiseError(t,`drawing ${o} to ${i}`)}}}return u}shouldDrawLayer(t){return!0}getShaderModuleProps(t,e,n){return null}getLayerParameters(t,e,n){return t.props.parameters}_shouldDrawLayer(t,e,n,i){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;let o=t.parent;for(;o;){if(!o.props.visible||!o.filterSubLayer(e))return!1;e.layer=o,o=o.parent}if(n){const t=e.layer.id;if(t in i||(i[t]=n(e)),!i[t])return!1}return t.activateViewport(e.viewport),!0}_getShaderModuleProps(t,e,n,i,o){const s=i.cssToDeviceRatio(),a=t.internalState?.propsInTransition||t.props,c={layer:a,picking:{isActive:!1},project:{viewport:t.context.viewport,devicePixelRatio:s,modelMatrix:a.modelMatrix,coordinateSystem:a.coordinateSystem,coordinateOrigin:a.coordinateOrigin,autoWrapLongitude:t.wrapLongitude}};if(e)for(const n of e)r(c,n.getShaderModuleProps?.(t,c));for(const e of t.context.defaultShaderModules)e.name in c||(c[e.name]={});return r(c,this.getShaderModuleProps(t,e,c),o)}}function o(t=0,e={}){const n={},i=(r,s)=>{const a=r.props._offset,c=r.id,l=r.parent&&r.parent.id;let h;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||o(e[l],e);h=t(r,s),n[c]=t}else Number.isFinite(a)?(h=a+(e[l]||0),n[c]=null):h=t;return s&&h>=t&&(t=h+1),e[c]=h,h};return i}function r(t,...e){for(const n of e)if(n)for(const e in n)t[e]?Object.assign(t[e],n[e]):t[e]=n[e];return t}},3065(t,e,n){const i="#define SMOOTH_EDGE_RADIUS 0.5",o={name:"geometry",source:"const SMOOTH_EDGE_RADIUS: f32 = 0.5;\n\nstruct VertexGeometry {\n position: vec4<f32>,\n worldPosition: vec3<f32>,\n worldPositionAlt: vec3<f32>,\n normal: vec3<f32>,\n uv: vec2<f32>,\n pickingColor: vec3<f32>,\n};\n\nvar<private> geometry_: VertexGeometry = VertexGeometry(\n vec4<f32>(0.0, 0.0, 1.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec2<f32>(0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0)\n);\n\nstruct FragmentGeometry {\n uv: vec2<f32>,\n};\n\nvar<private> fragmentGeometry: FragmentGeometry;\n\nfn smoothedge(edge: f32, x: f32) -> f32 {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n",vs:`${i}\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n`,fs:`${i}\n\nstruct FragmentGeometry {\n vec2 uv;\n};\nFragmentGeometry geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n`};n.d(e,["A",0,o])},4782(t,e,n){n.d(e,{A:()=>h});var i=n(34938),o=n(3065),r=n(74334),s=n(9350);const a=`${`${["default","lnglat","meter-offsets","lnglat-offsets","cartesian"].map(t=>`const COORDINATE_SYSTEM_${t.toUpperCase().replaceAll("-","_")}: i32 = ${(0,r.LB)(t)};`).join("")}\n${Object.keys(s.Kx).map(t=>`const PROJECTION_MODE_${t}: i32 = ${s.Kx[t]};`).join("")}\n${Object.keys(s.p5).map(t=>`const UNIT_${t.toUpperCase()}: i32 = ${s.p5[t]};`).join("")}\n\nconst TILE_SIZE: f32 = 512.0;\nconst PI: f32 = 3.1415926536;\nconst WORLD_SCALE: f32 = TILE_SIZE / (PI * 2.0);\nconst ZERO_64_LOW: vec3<f32> = vec3<f32>(0.0, 0.0, 0.0);\nconst EARTH_RADIUS: f32 = 6370972.0; // meters\nconst GLOBE_RADIUS: f32 = 256.0;\n\n// -----------------------------------------------------------------------------\n// Uniform block (converted from GLSL uniform block)\n// -----------------------------------------------------------------------------\nstruct ProjectUniforms {\n wrapLongitude: i32,\n coordinateSystem: i32,\n commonUnitsPerMeter: vec3<f32>,\n projectionMode: i32,\n scale: f32,\n commonUnitsPerWorldUnit: vec3<f32>,\n commonUnitsPerWorldUnit2: vec3<f32>,\n center: vec4<f32>,\n modelMatrix: mat4x4<f32>,\n viewProjectionMatrix: mat4x4<f32>,\n viewportSize: vec2<f32>,\n devicePixelRatio: f32,\n focalDistance: f32,\n cameraPosition: vec3<f32>,\n coordinateOrigin: vec3<f32>,\n commonOrigin: vec3<f32>,\n pseudoMeters: i32,\n};\n\n@group(0) @binding(auto)\nvar<uniform> project: ProjectUniforms;\n\n// -----------------------------------------------------------------------------\n// Geometry data shared across the project helpers.\n// The active layer shader is responsible for populating this private module\n// state before calling the project functions below.\n// -----------------------------------------------------------------------------\n\n// Structure to carry additional geometry data used by deck.gl filters.\nstruct Geometry {\n worldPosition: vec3<f32>,\n worldPositionAlt: vec3<f32>,\n position: vec4<f32>,\n normal: vec3<f32>,\n uv: vec2<f32>,\n pickingColor: vec3<f32>,\n};\n\nvar<private> geometry: Geometry;\n`}\n\n// -----------------------------------------------------------------------------\n// Functions\n// -----------------------------------------------------------------------------\n\n// Returns an adjustment factor for commonUnitsPerMeter\nfn _project_size_at_latitude(lat: f32) -> f32 {\n let y = clamp(lat, -89.9, 89.9);\n return 1.0 / cos(radians(y));\n}\n\n// Overloaded version: scales a value in meters at a given latitude.\nfn _project_size_at_latitude_m(meters: f32, lat: f32) -> f32 {\n return meters * project.commonUnitsPerMeter.z * _project_size_at_latitude(lat);\n}\n\n// Computes a non-linear scale factor based on geometry.\n// (Note: This function relies on "geometry" being provided.)\nfn project_size() -> f32 {\n if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n project.pseudoMeters == 0) {\n if (geometry.position.w == 0.0) {\n return _project_size_at_latitude(geometry.worldPosition.y);\n }\n let y: f32 = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n let y2 = y * y;\n let y4 = y2 * y2;\n let y6 = y4 * y2;\n return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n }\n return 1.0;\n}\n\n// Overloads to scale offsets (meters to world units)\nfn project_size_float(meters: f32) -> f32 {\n return meters * project.commonUnitsPerMeter.z * project_size();\n}\n\nfn project_size_vec2(meters: vec2<f32>) -> vec2<f32> {\n return meters * project.commonUnitsPerMeter.xy * project_size();\n}\n\nfn project_size_vec3(meters: vec3<f32>) -> vec3<f32> {\n return meters * project.commonUnitsPerMeter * project_size();\n}\n\nfn project_size_vec4(meters: vec4<f32>) -> vec4<f32> {\n return vec4<f32>(meters.xyz * project.commonUnitsPerMeter, meters.w);\n}\n\n// Returns a rotation matrix aligning the z‑axis with the given up vector.\nfn project_get_orientation_matrix(up: vec3<f32>) -> mat3x3<f32> {\n let uz = normalize(up);\n let ux = select(\n vec3<f32>(1.0, 0.0, 0.0),\n normalize(vec3<f32>(uz.y, -uz.x, 0.0)),\n abs(uz.z) == 1.0\n );\n let uy = cross(uz, ux);\n return mat3x3<f32>(ux, uy, uz);\n}\n\n// Since WGSL does not support "out" parameters, we return a struct.\nstruct RotationResult {\n needsRotation: bool,\n transform: mat3x3<f32>,\n};\n\nfn project_needs_rotation(commonPosition: vec3<f32>) -> RotationResult {\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n return RotationResult(true, project_get_orientation_matrix(commonPosition));\n } else {\n return RotationResult(false, mat3x3<f32>()); // identity alternative if needed\n };\n}\n\n// Projects a normal vector from the current coordinate system to world space.\nfn project_normal(vector: vec3<f32>) -> vec3<f32> {\n let normal_modelspace = project.modelMatrix * vec4<f32>(vector, 0.0);\n var n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);\n let rotResult = project_needs_rotation(geometry.position.xyz);\n if (rotResult.needsRotation) {\n n = rotResult.transform * n;\n }\n return n;\n}\n\n// Applies a scale offset based on y-offset (dy)\nfn project_offset_(offset: vec4<f32>) -> vec4<f32> {\n let dy: f32 = offset.y;\n let commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;\n return vec4<f32>(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\n\n// Projects lng/lat coordinates to a unit tile [0,1]\nfn project_mercator_(lnglat: vec2<f32>) -> vec2<f32> {\n var x = lnglat.x;\n if (project.wrapLongitude != 0) {\n x = ((x + 180.0) % 360.0) - 180.0;\n }\n let y = clamp(lnglat.y, -89.9, 89.9);\n return vec2<f32>(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// Projects lng/lat/z coordinates for a globe projection.\nfn project_globe_(lnglatz: vec3<f32>) -> vec3<f32> {\n let lambda = radians(lnglatz.x);\n let phi = radians(lnglatz.y);\n let cosPhi = cos(phi);\n let D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n return vec3<f32>(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\n\n// Mercator y of project_mercator_'s latitude clamp: log(tan(PI / 4 + radians(89.9) / 2))\nconst MAX_MERCATOR_Y: f32 = 7.0439589847;\n\n// Inverse of project_globe_ followed by project_mercator_, without forming lat/lng:\n// Mercator y = atanh(sin(lat)) = log((D + |z|) / |xy|), which stays accurate near the poles\nfn project_globe_to_mercator_(spherePos: vec3<f32>) -> vec2<f32> {\n let D = length(spherePos);\n let h = max(length(spherePos.xy), 1e-20);\n let y = sign(spherePos.z) * min(log((D + abs(spherePos.z)) / h), MAX_MERCATOR_Y);\n let x = atan2(spherePos.x, -spherePos.y);\n return (vec2<f32>(x, y) + PI) * WORLD_SCALE;\n}\n\n// Flat common space (Mercator or cartesian) of a common position; identity except under GLOBE.\n// WGSL has no function overloading: pass position.xyz for a vec4. See project.glsl.ts.\nfn project_common_position_to_flat(commonPosition: vec3<f32>) -> vec2<f32> {\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n return project_globe_to_mercator_(commonPosition);\n }\n return commonPosition.xy;\n}\n\n// World copy of a flat x nearest to referenceX\nfn project_wrap_flat_x_(x: f32, referenceX: f32) -> f32 {\n return x - TILE_SIZE * floor((x - referenceX) / TILE_SIZE + 0.5);\n}\n\n// Flat position in the world copy nearest to referenceX (e.g. a bounds centre); geospatial only\nfn project_common_position_to_flat_wrapped(commonPosition: vec3<f32>, referenceX: f32) -> vec2<f32> {\n var flatPosition = project_common_position_to_flat(commonPosition);\n if (project.projectionMode != PROJECTION_MODE_IDENTITY) {\n flatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n }\n return flatPosition;\n}\n\n// Flat position continuous across the antimeridian under GLOBE (seam moved opposite referenceX,\n// e.g. the camera); identity for flat modes. For periodic patterns.\nfn project_common_position_to_flat_continuous(commonPosition: vec3<f32>, referenceX: f32) -> vec2<f32> {\n var flatPosition = project_common_position_to_flat(commonPosition);\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n flatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n }\n return flatPosition;\n}\n\n// Projects positions (with an optional 64-bit low part) from the input\n// coordinate system to the common space.\nfn project_position_vec4_f64(position: vec4<f32>, position64Low: vec3<f32>) -> vec4<f32> {\n var position_world = project.modelMatrix * position;\n\n // Work around for a Mac+NVIDIA bug:\n if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4<f32>(\n project_mercator_(position_world.xy),\n _project_size_at_latitude_m(position_world.z, position_world.y),\n position_world.w\n );\n }\n if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world = vec4f(position_world.xyz + project.coordinateOrigin, position_world.w);\n }\n }\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4<f32>(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n if (project.coordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS) {\n let enuMatrix = project_get_orientation_matrix(project.commonOrigin);\n let metersToCommon = GLOBE_RADIUS / EARTH_RADIUS;\n let offsetCommon = (enuMatrix * vec3<f32>(-position_world.x, -position_world.y, position_world.z)) * metersToCommon;\n return vec4<f32>(project.commonOrigin + offsetCommon, position_world.w);\n }\n }\n if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {\n return vec4<f32>(\n project_mercator_(position_world.xy) - project.commonOrigin.xy,\n project_size_float(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project.projectionMode == PROJECTION_MODE_IDENTITY ||\n (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world = vec4f(position_world.xyz - project.coordinateOrigin, position_world.w);\n }\n\n return project_offset_(position_world) +\n project_offset_(project.modelMatrix * vec4<f32>(position64Low, 0.0));\n}\n\n// Overloaded versions for different input types.\nfn project_position_vec4_f32(position: vec4<f32>) -> vec4<f32> {\n return project_position_vec4_f64(position, ZERO_64_LOW);\n}\n\nfn project_position_vec3_f64(position: vec3<f32>, position64Low: vec3<f32>) -> vec3<f32> {\n let projected_position = project_position_vec4_f64(vec4<f32>(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nfn project_position_vec3_f32(position: vec3<f32>) -> vec3<f32> {\n let projected_position = project_position_vec4_f64(vec4<f32>(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nfn project_position_vec2_f32(position: vec2<f32>) -> vec2<f32> {\n let projected_position = project_position_vec4_f64(vec4<f32>(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\n// Transforms a common space position to clip space.\nfn project_common_position_to_clipspace_with_projection(position: vec4<f32>, viewProjectionMatrix: mat4x4<f32>, center: vec4<f32>) -> vec4<f32> {\n var clipPosition = viewProjectionMatrix * position + center;\n // deck.gl projection matrices use WebGL's [-w, w] depth range; WebGPU clips z to [0, w].\n clipPosition.z = (clipPosition.z + clipPosition.w) * 0.5;\n return clipPosition;\n}\n\n// Uses the project viewProjectionMatrix and center.\nfn project_common_position_to_clipspace(position: vec4<f32>) -> vec4<f32> {\n return project_common_position_to_clipspace_with_projection(position, project.viewProjectionMatrix, project.center);\n}\n\n// Returns a clip space offset corresponding to a given number of screen pixels.\nfn project_pixel_size_to_clipspace(pixels: vec2<f32>) -> vec2<f32> {\n let offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;\n return offset * project.focalDistance;\n}\n\nfn project_meter_size_to_pixel(meters: f32) -> f32 {\n return project_size_float(meters) * project.scale;\n}\n\nfn project_unit_size_to_pixel(size: f32, unit: i32) -> f32 {\n if (unit == UNIT_METERS) {\n return project_meter_size_to_pixel(size);\n } else if (unit == UNIT_COMMON) {\n return size * project.scale;\n }\n // UNIT_PIXELS: no scaling applied.\n return size;\n}\n\nfn project_pixel_size_float(pixels: f32) -> f32 {\n return pixels / project.scale;\n}\n\nfn project_pixel_size_vec2(pixels: vec2<f32>) -> vec2<f32> {\n return pixels / project.scale;\n}\n`,c=`${["default","lnglat","meter-offsets","lnglat-offsets","cartesian"].map(t=>`const int COORDINATE_SYSTEM_${t.toUpperCase().replaceAll("-","_")} = ${(0,r.LB)(t)};`).join("")}\n${Object.keys(s.Kx).map(t=>`const int PROJECTION_MODE_${t} = ${s.Kx[t]};`).join("")}\n${Object.keys(s.p5).map(t=>`const int UNIT_${t.toUpperCase()} = ${s.p5[t]};`).join("")}\nlayout(std140) uniform projectUniforms {\nbool wrapLongitude;\nint coordinateSystem;\nvec3 commonUnitsPerMeter;\nint projectionMode;\nfloat scale;\nvec3 commonUnitsPerWorldUnit;\nvec3 commonUnitsPerWorldUnit2;\nvec4 center;\nmat4 modelMatrix;\nmat4 viewProjectionMatrix;\nvec2 viewportSize;\nfloat devicePixelRatio;\nfloat focalDistance;\nvec3 cameraPosition;\nvec3 coordinateOrigin;\nvec3 commonOrigin;\nbool pseudoMeters;\n} project;\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size_at_latitude(float lat) {\nfloat y = clamp(lat, -89.9, 89.9);\nreturn 1.0 / cos(radians(y));\n}\nfloat project_size() {\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&\nproject.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\nproject.pseudoMeters == false) {\nif (geometry.position.w == 0.0) {\nreturn project_size_at_latitude(geometry.worldPosition.y);\n}\nfloat y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\nfloat y2 = y * y;\nfloat y4 = y2 * y2;\nfloat y6 = y4 * y2;\nreturn 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n}\nreturn 1.0;\n}\nfloat project_size_at_latitude(float meters, float lat) {\nreturn meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat);\n}\nfloat project_size(float meters) {\nreturn meters * project.commonUnitsPerMeter.z * project_size();\n}\nvec2 project_size(vec2 meters) {\nreturn meters * project.commonUnitsPerMeter.xy * project_size();\n}\nvec3 project_size(vec3 meters) {\nreturn meters * project.commonUnitsPerMeter * project_size();\n}\nvec4 project_size(vec4 meters) {\nreturn vec4(meters.xyz * project.commonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\nvec3 uz = normalize(up);\nvec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\nvec3 uy = cross(uz, ux);\nreturn mat3(ux, uy, uz);\n}\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\ntransform = project_get_orientation_matrix(commonPosition);\nreturn true;\n}\nreturn false;\n}\nvec3 project_normal(vec3 vector) {\nvec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0);\nvec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);\nmat3 rotation;\nif (project_needs_rotation(geometry.position.xyz, rotation)) {\nn = rotation * n;\n}\nreturn n;\n}\nvec4 project_offset_(vec4 offset) {\nfloat dy = offset.y;\nvec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;\nreturn vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\nfloat x = lnglat.x;\nif (project.wrapLongitude) {\nx = mod(x + 180., 360.0) - 180.;\n}\nfloat y = clamp(lnglat.y, -89.9, 89.9);\nreturn vec2(\nradians(x) + PI,\nPI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n) * WORLD_SCALE;\n}\nvec3 project_globe_(vec3 lnglatz) {\nfloat lambda = radians(lnglatz.x);\nfloat phi = radians(lnglatz.y);\nfloat cosPhi = cos(phi);\nfloat D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\nreturn vec3(\nsin(lambda) * cosPhi,\n-cos(lambda) * cosPhi,\nsin(phi)\n) * D;\n}\nconst float MAX_MERCATOR_Y = 7.0439589847;\nvec2 project_globe_to_mercator_(vec3 spherePos) {\nfloat D = length(spherePos);\nfloat h = max(length(spherePos.xy), 1e-20);\nfloat y = sign(spherePos.z) * min(log((D + abs(spherePos.z)) / h), MAX_MERCATOR_Y);\nfloat x = atan(spherePos.x, -spherePos.y);\nreturn (vec2(x, y) + PI) * WORLD_SCALE;\n}\nvec2 project_common_position_to_flat(vec3 commonPosition) {\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\nreturn project_globe_to_mercator_(commonPosition);\n}\nreturn commonPosition.xy;\n}\nvec2 project_common_position_to_flat(vec4 commonPosition) {\nreturn project_common_position_to_flat(commonPosition.xyz);\n}\nfloat project_wrap_flat_x_(float x, float referenceX) {\nreturn x - TILE_SIZE * floor((x - referenceX) / TILE_SIZE + 0.5);\n}\nvec2 project_common_position_to_flat_wrapped(vec3 commonPosition, float referenceX) {\nvec2 flatPosition = project_common_position_to_flat(commonPosition);\nif (project.projectionMode != PROJECTION_MODE_IDENTITY) {\nflatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n}\nreturn flatPosition;\n}\nvec2 project_common_position_to_flat_wrapped(vec4 commonPosition, float referenceX) {\nreturn project_common_position_to_flat_wrapped(commonPosition.xyz, referenceX);\n}\nvec2 project_common_position_to_flat_continuous(vec3 commonPosition, float referenceX) {\nvec2 flatPosition = project_common_position_to_flat(commonPosition);\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\nflatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n}\nreturn flatPosition;\n}\nvec2 project_common_position_to_flat_continuous(vec4 commonPosition, float referenceX) {\nreturn project_common_position_to_flat_continuous(commonPosition.xyz, referenceX);\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\nvec4 position_world = project.modelMatrix * position;\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_mercator_(position_world.xy),\nproject_size_at_latitude(position_world.z, position_world.y),\nposition_world.w\n);\n}\nif (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\nposition_world.xyz += project.coordinateOrigin;\n}\n}\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_globe_(position_world.xyz),\nposition_world.w\n);\n}\nif (project.coordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS) {\nmat3 enuMatrix = project_get_orientation_matrix(project.commonOrigin);\nfloat metersToCommon = GLOBE_RADIUS / EARTH_RADIUS;\nvec3 offsetCommon = (enuMatrix * vec3(-position_world.xy, position_world.z)) * metersToCommon;\nreturn vec4(project.commonOrigin + offsetCommon, position_world.w);\n}\n}\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nif (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {\nreturn vec4(\nproject_mercator_(position_world.xy) - project.commonOrigin.xy,\nproject_size(position_world.z),\nposition_world.w\n);\n}\n}\n}\nif (project.projectionMode == PROJECTION_MODE_IDENTITY ||\n(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\nproject.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\nposition_world.xyz -= project.coordinateOrigin;\n}\nreturn project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0));\n}\nvec4 project_position(vec4 position) {\nreturn project_position(position, ZERO_64_LOW);\n}\nvec3 project_position(vec3 position, vec3 position64Low) {\nvec4 projected_position = project_position(vec4(position, 1.0), position64Low);\nreturn projected_position.xyz;\n}\nvec3 project_position(vec3 position) {\nvec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\nreturn projected_position.xyz;\n}\nvec2 project_position(vec2 position) {\nvec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\nreturn projected_position.xy;\n}\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\nreturn viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\nreturn project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\nvec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;\nreturn offset * project.focalDistance;\n}\nfloat project_size_to_pixel(float meters) {\nreturn project_size(meters) * project.scale;\n}\nvec2 project_size_to_pixel(vec2 meters) {\nreturn project_size(meters) * project.scale;\n}\nfloat project_size_to_pixel(float size, int unit) {\nif (unit == UNIT_METERS) return project_size_to_pixel(size);\nif (unit == UNIT_COMMON) return size * project.scale;\nreturn size;\n}\nfloat project_pixel_size(float pixels) {\nreturn pixels / project.scale;\n}\nvec2 project_pixel_size(vec2 pixels) {\nreturn pixels / project.scale;\n}\n`,l={};const h={name:"project",dependencies:[i.i,o.A],source:a,vs:c,getUniforms:function(t=l){return"viewport"in t?(0,r.aY)(t):{}},uniformTypes:{wrapLongitude:"f32",coordinateSystem:"i32",commonUnitsPerMeter:"vec3<f32>",projectionMode:"i32",scale:"f32",commonUnitsPerWorldUnit:"vec3<f32>",commonUnitsPerWorldUnit2:"vec3<f32>",center:"vec4<f32>",modelMatrix:"mat4x4<f32>",viewProjectionMatrix:"mat4x4<f32>",viewportSize:"vec2<f32>",devicePixelRatio:"f32",focalDistance:"f32",cameraPosition:"vec3<f32>",coordinateOrigin:"vec3<f32>",commonOrigin:"vec3<f32>",pseudoMeters:"f32"}}},74334(t,e,n){n.d(e,{LB:()=>d,aY:()=>_,ow:()=>m});var i=n(90218),o=n(39426),r=n(9350),s=n(82417);const a=[0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=[0,0,0],u=[0,0,0],p={default:-1,cartesian:0,lnglat:1,"meter-offsets":2,"lnglat-offsets":3};function d(t){const e=p[t];if(void 0===e)throw new Error(`Invalid coordinateSystem: ${t}`);return e}const f=(0,s.A)(function({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:s}){const{projectionCenter:u,viewProjectionMatrix:p,originCommon:f,cameraPosCommon:_,shaderCoordinateOrigin:v,geospatialOrigin:g}=function(t,e,n){const{viewMatrixUncentered:r,projectionMatrix:s}=t;let{viewMatrix:l,viewProjectionMatrix:h}=t,u=a,p=a,d=t.cameraPosition;const{geospatialOrigin:f,shaderCoordinateOrigin:_,offsetMode:v}=m(t,e,n);v&&(p=t.projectPosition(f||_),d=[d[0]-p[0],d[1]-p[1],d[2]-p[2]],p[3]=1,u=o.Z0([],p,h),l=r||l,h=i.lw([],s,l),h=i.lw([],h,c));return{viewMatrix:l,viewProjectionMatrix:h,projectionCenter:u,originCommon:p,cameraPosCommon:d,shaderCoordinateOrigin:_,geospatialOrigin:f}}(t,n,s),E=t.getDistanceScales(),y=[t.width*e,t.height*e],M=o.Z0([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,b={coordinateSystem:d(n),projectionMode:t.projectionMode,coordinateOrigin:v,commonOrigin:f.slice(0,3),center:u,pseudoMeters:Boolean(t._pseudoMeters),viewportSize:y,devicePixelRatio:e,focalDistance:M,commonUnitsPerMeter:E.unitsPerMeter,commonUnitsPerWorldUnit:E.unitsPerMeter,commonUnitsPerWorldUnit2:h,scale:t.scale,wrapLongitude:!1,viewProjectionMatrix:p,modelMatrix:l,cameraPosition:_};if(g){const e=t.getDistanceScales(g);switch(n){case"meter-offsets":b.commonUnitsPerWorldUnit=e.unitsPerMeter,b.commonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case"lnglat":case"lnglat-offsets":t._pseudoMeters||(b.commonUnitsPerMeter=e.unitsPerMeter),b.commonUnitsPerWorldUnit=e.unitsPerDegree,b.commonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case"cartesian":b.commonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],b.commonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}if(t.projectionMode===r.Kx.GLOBE&&"meter-offsets"===n){const t=6370972,e=256,n=s[0]*Math.PI/180,i=s[1]*Math.PI/180,o=Math.cos(i),r=((s[2]||0)/t+1)*e;b.commonOrigin=[Math.sin(n)*o*r,-Math.cos(n)*o*r,Math.sin(i)*r]}return b});function m(t,e,n=u){n.length<3&&(n=[n[0],n[1],0]);let i,o=n,s=!0;switch(i="lnglat-offsets"===e||"meter-offsets"===e?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case r.Kx.WEB_MERCATOR:"lnglat"===e?(i=[0,0,0],s=!1):"cartesian"===e&&(s=!1,i=t.unprojectPosition([Math.fround(t.center[0]),Math.fround(t.center[1]),0]));break;case r.Kx.WEB_MERCATOR_AUTO_OFFSET:"lnglat"===e?o=i:"cartesian"===e&&(o=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(o),o[0]-=n[0],o[1]-=n[1],o[2]-=n[2]);break;case r.Kx.IDENTITY:o=t.position.map(Math.fround),o[2]=o[2]||0;break;case r.Kx.GLOBE:s=!1,i=null;break;default:s=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:o,offsetMode:s}}function _({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i="default",coordinateOrigin:o=u,autoWrapLongitude:r=!1}){"default"===i&&(i=t.isGeospatial?"lnglat":"cartesian");const s=f({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:o});return s.wrapLongitude=r,s.modelMatrix=n||l,s}},7914(t,e,n){function i(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!i(t[o],e[o],n-1))return!1;return!0}if(Array.isArray(e))return!1;if("object"==typeof t&&"object"==typeof e){const o=Object.keys(t),r=Object.keys(e);if(o.length!==r.length)return!1;for(const r of o){if(!e.hasOwnProperty(r))return!1;if(!i(t[r],e[r],n-1))return!1}return!0}return!1}n.d(e,{b:()=>i})},3459(t,e,n){const i=new(n(60776).h)({id:"deck"});n.d(e,["A",0,i])},25667(t,e,n){n.d(e,{$M:()=>r,Vl:()=>a,_Z:()=>f,cT:()=>d,on:()=>c,zi:()=>s});var i=n(23459),o=n(87597);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t,e){const n=t%e;return n<0?e+n:n}function a(t){return[t[12],t[13],t[14]]}function c(t){return{left:h(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:h(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:h(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:h(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:h(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:h(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const l=new o.P;function h(t,e,n,i){l.set(t,e,n);const r=l.len();return{distance:i/r,normal:new o.P(-t/r,-e/r,-n/r)}}function u(t){return t-Math.fround(t)}let p;function d(t,e){const{size:n=1,startIndex:o=0}=e,r=void 0!==e.endIndex?e.endIndex:t.length,s=(r-o)/n;p=i.A.allocate(p,s,{type:Float32Array,size:2*n});let a=o,c=0;for(;a<r;){for(let e=0;e<n;e++){const i=t[a++];p[c+e]=i,p[c+e+n]=u(i)}c+=2*n}return p.subarray(0,s*n*2)}function f(t){let e=null,n=!1;for(const i of t)i&&(e?(n||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=!0),e[0][0]=Math.min(e[0][0],i[0][0]),e[0][1]=Math.min(e[0][1],i[0][1]),e[1][0]=Math.max(e[1][0],i[1][0]),e[1][1]=Math.max(e[1][1],i[1][1])):e=i);return e}},82417(t,e,n){function i(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}return!1}function o(t){let e,n={};return o=>{for(const r in o)if(!i(o[r],n[r])){e=t(o),n=o;break}return e}}n.d(e,{A:()=>o})},66540(t,e,n){function i(t,e){if(!e)return t;const n={...t,...e};if("defines"in e&&(n.defines={...t.defines,...e.defines}),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(t=>"project64"===t.name))){const t=n.modules.findIndex(t=>"project32"===t.name);t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i={...t.inject};for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}n.d(e,{n:()=>i})},23459(t,e,n){const i=new class TypedArrayManager{constructor(t={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,e,{size:n=1,type:i,padding:o=0,copy:r=!1,initialize:s=!1,maxCount:a}){const c=i||t&&t.constructor||Float32Array,l=e*n+o;if(ArrayBuffer.isView(t)){if(l<=t.length)return t;if(l*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new c(t.buffer,0,l)}let h=1/0;a&&(h=a*n+o);const u=this._allocate(c,l,s,h);return t&&r?u.set(t):s||u.fill(0,0,4),this._release(t),u}release(t){this._release(t)}_allocate(t,e,n,i){let o=Math.max(Math.ceil(e*this.opts.overAlloc),1);o>i&&(o=i);const r=this._pool,s=t.BYTES_PER_ELEMENT*o,a=r.findIndex(t=>t.byteLength>=s);if(a>=0){const e=new t(r.splice(a,1)[0],0,o);return n&&e.fill(0),e}return new t(o)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,o=e.findIndex(t=>t.byteLength>=i);o<0?e.push(n):(o>0||e.length<this.opts.poolSize)&&e.splice(o,0,n),e.length>this.opts.poolSize&&e.shift()}};n.d(e,["A",0,i])},47345(t,e,n){var i=n(3459),o=n(25667),r=n(87597),s=n(31886),a=n(54901),c=n(90218),l=n(45249),h=n(9350);const u=Math.PI/180,p=(0,o.$M)(),d=[0,0,0],f={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class Viewport{constructor(t={}){this._frustumPlanes={},this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||f,this.focalDistance=t.focalDistance||1,this.position=t.position||d,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:n}=t;this.isGeospatial=Number.isFinite(n)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?h.Kx.WEB_MERCATOR:h.Kx.WEB_MERCATOR_AUTO_OFFSET:h.Kx.IDENTITY}equals(t){return t instanceof Viewport&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&t.projectionMode===this.projectionMode&&t.resolution===this.resolution&&(0,a.aI)(t.distanceScales.unitsPerMeter,this.distanceScales.unitsPerMeter)&&(0,a.aI)(t.projectionMatrix,this.projectionMatrix)&&(0,a.aI)(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=this.projectPosition(t),i=(0,l.VJ)(n,this.pixelProjectionMatrix),[o,r]=i,s=e?r:this.height-r;return 2===t.length?[o,s]:[o,s,i[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,o,r]=t,s=e?o:this.height-o,a=n&&n*this.distanceScales.unitsPerMeter[2],c=(0,l.xJ)([i,s,r],this.pixelUnprojectionMatrix,a),[h,u,p]=this.unprojectPosition(c);return Number.isFinite(r)?[h,u,p]:Number.isFinite(n)?[h,u,n]:[h,u]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=(0,l.Gw)(t);return e[1]=(0,a.qE)(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?(0,l.iV)(t):t}getBounds(t={}){const e={targetZ:t.z||0},n=this.unproject([0,0],e),i=this.unproject([this.width,0],e),o=this.unproject([0,this.height],e),r=this.unproject([this.width,this.height],e);return[Math.min(n[0],i[0],o[0],r[0]),Math.min(n[1],i[1],o[1],r[1]),Math.max(n[0],i[0],o[0],r[0]),Math.max(n[1],i[1],o[1],r[1])]}getDistanceScales(t){return t&&this.isGeospatial?(0,l.nI)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:n=1,height:i=1}){return t<this.x+this.width&&this.x<t+n&&e<this.y+this.height&&this.y<e+i}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,(0,o.on)(this.viewProjectionMatrix)),this._frustumPlanes}panByPosition(t,e,n){return null}_initProps(t){const e=t.longitude,n=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=(0,l.fO)({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||(0,l.nI)({latitude:n,longitude:e}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:o,modelMatrix:a}=t;let c=d;if(o&&(c=a?new s.k(a).transformAsVector(o,[]):o),this.isGeospatial){const t=this.projectPosition([e,n,0]);this.center=new r.P(c).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(c)}_initMatrices(t){const{viewMatrix:e=p,projectionMatrix:n=null,orthographic:l=!1,fovyRadians:h,fovy:d=75,near:f=.1,far:m=1e3,padding:_=null,focalDistance:v=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new s.k).multiplyRight(e).translate(new r.P(this.center).negate()),this.projectionMatrix=n||function({width:t,height:e,orthographic:n,fovyRadians:i,focalDistance:o,padding:r,near:c,far:l}){const h=t/e,u=n?(new s.k).orthographic({fovy:i,aspect:h,focalDistance:o,near:c,far:l}):(new s.k).perspective({fovy:i,aspect:h,near:c,far:l});if(r){const{left:n=0,right:i=0,top:o=0,bottom:s=0}=r,c=(0,a.qE)((n+t-i)/2,0,t)-t/2,l=(0,a.qE)((o+e-s)/2,0,e)-e/2;u[8]-=2*c/t,u[9]+=2*l/e}return u}({width:this.width,height:this.height,orthographic:l,fovyRadians:h||d*u,focalDistance:v,padding:_,near:f,far:m});const g=(0,o.$M)();c.lw(g,g,this.projectionMatrix),c.lw(g,g,this.viewMatrix),this.viewProjectionMatrix=g,this.viewMatrixInverse=c.B8([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=(0,o.Vl)(this.viewMatrixInverse);const E=(0,o.$M)(),y=(0,o.$M)();c.hs(E,E,[this.width/2,-this.height/2,1]),c.Tl(E,E,[1,-1,0]),c.lw(y,E,this.viewProjectionMatrix),this.pixelProjectionMatrix=y,this.pixelUnprojectionMatrix=c.B8((0,o.$M)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||i.A.warn("Pixel project matrix not invertible")()}}Viewport.displayName="Viewport";const m=Viewport;n.d(e,["A",0,m])},69502(t,e,n){var i=n(47345),o=n(45249),r=n(31886),s=n(54901),a=n(83588);class WebMercatorViewport extends i.A{constructor(t={}){const{latitude:e=0,longitude:n=0,zoom:i=0,pitch:a=0,bearing:c=0,nearZMultiplier:l=.1,farZMultiplier:h=1.01,nearZ:u,farZ:p,orthographic:d=!1,projectionMatrix:f,repeat:m=!1,worldOffset:_=0,position:v,padding:g,legacyMeterSizes:E=!1}=t;let{width:y,height:M,altitude:b=1.5}=t;const T=Math.pow(2,i);let P;y=y||1,M=M||1;let w=null;if(f)b=f[5]/2,P=(0,o.Os)(b);else{let n;if(t.fovy?(P=t.fovy,b=(0,o.wZ)(P)):P=(0,o.Os)(b),g){const{top:t=0,bottom:e=0}=g;n=[0,(0,s.qE)((t+M-e)/2,0,M)-M/2]}w=(0,o.om)({width:y,height:M,scale:T,center:v&&[0,0,v[2]*(0,o.mY)(e)],offset:n,pitch:a,fovy:P,nearZMultiplier:l,farZMultiplier:h}),Number.isFinite(u)&&(w.near=u),Number.isFinite(p)&&(w.far=p)}let S=(0,o.rY)({height:M,pitch:a,bearing:c,scale:T,altitude:b});if(_){S=(new r.k).translate([512*_,0,0]).multiplyLeft(S)}super({...t,width:y,height:M,viewMatrix:S,longitude:n,latitude:e,zoom:i,...w,fovy:P,focalDistance:b}),this.latitude=e,this.longitude=n,this.zoom=i,this.pitch=a,this.bearing=c,this.altitude=b,this.fovy=P,this.orthographic=d,this._subViewports=m?[]:null,this._pseudoMeters=E,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),n=Math.ceil((t[2]-180)/360);for(let t=e;t<=n;t++){const e=t?new WebMercatorViewport({...this,worldOffset:t}):this;this._subViewports.push(e)}}return this._subViewports}equals(t){return t instanceof WebMercatorViewport&&t._pseudoMeters===this._pseudoMeters&&super.equals(t)}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*(0,o.mY)(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)/(0,o.mY)(n)]}addMetersToLngLat(t,e){return(0,o.dT)(t,e)}panByPosition(t,e,n){const i=(0,o.xJ)(e,this.pixelUnprojectionMatrix),r=this.projectFlat(t),s=a.WQ([],r,a.ze([],i)),c=a.WQ([],this.center,s),[l,h]=this.unprojectFlat(c);return{longitude:l,latitude:h}}panByPosition3D(t,e){const n=t[2]||0,i=a.jb([],t,this.unproject(e,{targetZ:n}));return{longitude:this.longitude+i[0],latitude:this.latitude+i[1]}}getBounds(t={}){const e=(0,o.gW)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t,e={}){const{width:n,height:i}=this,{longitude:r,latitude:s,zoom:a}=(0,o.Fe)({width:n,height:i,bounds:t,...e});return new WebMercatorViewport({width:n,height:i,longitude:r,latitude:s,zoom:a})}}WebMercatorViewport.displayName="WebMercatorViewport";const c=WebMercatorViewport;n.d(e,["A",0,c])},34938(t,e,n){const i={name:"fp32",source:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst FP32_TWO_PI: f32 = 6.2831854820251465;\nconst FP32_PI_2: f32 = 1.5707963705062866;\nconst FP32_PI_16: f32 = 0.1963495463132858;\n\nconst FP32_SIN_TABLE_0: f32 = 0.19509032368659973;\nconst FP32_SIN_TABLE_1: f32 = 0.3826834261417389;\nconst FP32_SIN_TABLE_2: f32 = 0.5555702447891235;\nconst FP32_SIN_TABLE_3: f32 = 0.7071067690849304;\n\nconst FP32_COS_TABLE_0: f32 = 0.9807852506637573;\nconst FP32_COS_TABLE_1: f32 = 0.9238795042037964;\nconst FP32_COS_TABLE_2: f32 = 0.8314695954322815;\nconst FP32_COS_TABLE_3: f32 = 0.7071067690849304;\n\nconst FP32_INVERSE_FACTORIAL_3: f32 = 1.666666716337204e-01;\nconst FP32_INVERSE_FACTORIAL_5: f32 = 8.333333767950535e-03;\nconst FP32_INVERSE_FACTORIAL_7: f32 = 1.9841270113829523e-04;\nconst FP32_INVERSE_FACTORIAL_9: f32 = 2.75573188446287533e-06;\nconst FP32_OVERFLOW: f32 = 3.402823466e+38;\n\nfn sin_taylor_fp32(a: f32) -> f32 {\n if (a == 0.0) {\n return 0.0;\n }\n\n let x = -a * a;\n var sum = a;\n var term = a;\n\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_3;\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_5;\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_7;\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_9;\n\n return sum;\n}\n\nfn tan_taylor_fp32(a: f32) -> f32 {\n if (a == 0.0) {\n return 0.0;\n }\n\n let z = floor(a / FP32_TWO_PI);\n let reduced = a - FP32_TWO_PI * z;\n\n var quadrantValue = floor(reduced / FP32_PI_2 + 0.5);\n let quadrant = i32(quadrantValue);\n if (quadrant < -2 || quadrant > 2) {\n return FP32_OVERFLOW;\n }\n\n var angle = reduced - FP32_PI_2 * quadrantValue;\n quadrantValue = floor(angle / FP32_PI_16 + 0.5);\n let tableIndex = i32(quadrantValue);\n let absoluteTableIndex = abs(tableIndex);\n if (absoluteTableIndex > 4) {\n return FP32_OVERFLOW;\n }\n\n angle = angle - FP32_PI_16 * quadrantValue;\n let sinAngle = sin_taylor_fp32(angle);\n let cosAngle = sqrt(1.0 - sinAngle * sinAngle);\n\n var tableCos = 0.0;\n var tableSin = 0.0;\n if (absoluteTableIndex == 1) {\n tableCos = FP32_COS_TABLE_0;\n tableSin = FP32_SIN_TABLE_0;\n } else if (absoluteTableIndex == 2) {\n tableCos = FP32_COS_TABLE_1;\n tableSin = FP32_SIN_TABLE_1;\n } else if (absoluteTableIndex == 3) {\n tableCos = FP32_COS_TABLE_2;\n tableSin = FP32_SIN_TABLE_2;\n } else if (absoluteTableIndex == 4) {\n tableCos = FP32_COS_TABLE_3;\n tableSin = FP32_SIN_TABLE_3;\n }\n\n var sinReduced = sinAngle;\n var cosReduced = cosAngle;\n if (tableIndex > 0) {\n sinReduced = tableCos * sinAngle + tableSin * cosAngle;\n cosReduced = tableCos * cosAngle - tableSin * sinAngle;\n } else if (tableIndex < 0) {\n sinReduced = tableCos * sinAngle - tableSin * cosAngle;\n cosReduced = tableCos * cosAngle + tableSin * sinAngle;\n }\n\n var sinValue = 0.0;\n var cosValue = 0.0;\n if (quadrant == 0) {\n sinValue = sinReduced;\n cosValue = cosReduced;\n } else if (quadrant == 1) {\n sinValue = cosReduced;\n cosValue = -sinReduced;\n } else if (quadrant == -1) {\n sinValue = -cosReduced;\n cosValue = sinReduced;\n } else {\n sinValue = -sinReduced;\n cosValue = -cosReduced;\n }\n\n return sinValue / cosValue;\n}\n\nfn tan_fp32(a: f32) -> f32 {\n return tan_taylor_fp32(a);\n}\n#else\nfn tan_fp32(a: f32) -> f32 {\n return tan(a);\n}\n#endif\n",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n\n// All these functions are for substituting tan() function from Intel GPU only\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3!\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5!\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7!\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9!\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n // 2pi range reduction\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n"};n.d(e,["i",0,i])},58073(t,e,n){n.d(e,{a:()=>MathArray});var i=n(54901);class MathArray extends Array{clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}toArray(t=[],e=0){for(let n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:(0,i.cy)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(i.$W)}formatString(t){let e="";for(let n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+(0,i.Fl)(this[n],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!(0,i.aI)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,n){if(void 0===n)return this.lerp(this,t,e);for(let i=0;i<this.ELEMENTS;++i){const o=t[i],r="number"==typeof e?e:e[i];this[i]=o+n*(r-o)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(i.$W.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}get elements(){return this}}},46022(t,e,n){n.d(e,{u:()=>Matrix});var i=n(58073),o=n(73731),r=n(54901);class Matrix extends i.a{toString(){let t="[";if(r.$W.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+e]}`}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=` ${this[e]}`}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,n){return this[e*this.RANK+t]=(0,o.ws)(n),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[n+t];return e}setColumn(t,e){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)this[n+t]=e[t];return this}}},54272(t,e,n){n.d(e,{M:()=>Vector});var i=n(58073),o=n(73731),r=n(4990);class Vector extends i.a{get x(){return this[0]}set x(t){this[0]=(0,o.ws)(t)}get y(){return this[1]}set y(t){this[1]=(0,o.ws)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let n=0;n<this.ELEMENTS;++n){const i=this[n]-t[n];e+=i*i}return(0,o.ws)(e)}dot(t){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return(0,o.ws)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return(0,r.v)(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,o.ws)(this[t])}setComponent(t,e){return(0,r.v)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},31886(t,e,n){n.d(e,{k:()=>Matrix4});var i,o=n(46022),r=n(73731),s=n(68225),a=n(90218),c=n(83588),l=n(82859),h=n(39426);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(i||(i={}));const u=45*Math.PI/180,p=1,d=.1,f=500,m=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class Matrix4 extends o.u{static get IDENTITY(){return function(){v||(v=new Matrix4,Object.freeze(v));return v}()}static get ZERO(){return function(){_||(_=new Matrix4([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(_));return _}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return i}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,n,i,o,r,s,a,c,l,h,u,p,d,f,m){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this[4]=o,this[5]=r,this[6]=s,this[7]=a,this[8]=c,this[9]=l,this[10]=h,this[11]=u,this[12]=p,this[13]=d,this[14]=f,this[15]=m,this.check()}setRowMajor(t,e,n,i,o,r,s,a,c,l,h,u,p,d,f,m){return this[0]=t,this[1]=o,this[2]=c,this[3]=p,this[4]=e,this[5]=r,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=h,this[11]=f,this[12]=i,this[13]=a,this[14]=u,this[15]=m,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(m)}fromObject(t){return this.check()}fromQuaternion(t){return(0,a.I0)(this,t),this.check()}frustum(t){const{left:e,right:n,bottom:i,top:o,near:r=d,far:s=f}=t;return s===1/0?function(t,e,n,i,o,r){const s=2*r/(n-e),a=2*r/(o-i),c=(n+e)/(n-e),l=(o+i)/(o-i),h=-1,u=-1,p=-2*r;t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=l,t[10]=h,t[11]=u,t[12]=0,t[13]=0,t[14]=p,t[15]=0}(this,e,n,i,o,r):(0,a.$h)(this,e,n,i,o,r,s),this.check()}lookAt(t){const{eye:e,center:n=[0,0,0],up:i=[0,1,0]}=t;return(0,a.t5)(this,e,n,i),this.check()}ortho(t){const{left:e,right:n,bottom:i,top:o,near:r=d,far:s=f}=t;return(0,a.v3)(this,e,n,i,o,r,s),this.check()}orthographic(t){const{fovy:e=u,aspect:n=p,focalDistance:i=1,near:o=d,far:r=f}=t;g(e);const s=e/2,a=i*Math.tan(s),c=a*n;return this.ortho({left:-c,right:c,bottom:-a,top:a,near:o,far:r})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return g(e),(0,a.fN)(this,e,n,i,o),this.check()}determinant(){return(0,a.a4)(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],o=1/n[1],r=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*r,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*r,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],o=1/n[1],r=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*r,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*r,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*r,t}transpose(){return(0,a.mg)(this,this),this.check()}invert(){return(0,a.B8)(this,this),this.check()}multiplyLeft(t){return(0,a.lw)(this,t,this),this.check()}multiplyRight(t){return(0,a.lw)(this,this,t),this.check()}rotateX(t){return(0,a.eL)(this,this,t),this.check()}rotateY(t){return(0,a.Z8)(this,this,t),this.check()}rotateZ(t){return(0,a.Qr)(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return(0,a.e$)(this,this,t,e),this.check()}scale(t){return(0,a.hs)(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return(0,a.Tl)(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=(0,h.Z0)(e||[-0,-0,-0,-0],t,this),(0,r.qk)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:n}=t;let i;switch(n){case 2:i=(0,c.Z0)(e||[-0,-0],t,this);break;case 3:i=(0,l.Z0)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,r.qk)(i,t.length),i}transformAsVector(t,e){let n;switch(t.length){case 2:n=(0,s.B$)(e||[-0,-0],t,this);break;case 3:n=(0,s.cL)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,r.qk)(n,t.length),n}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,n){return this.identity().translate([t,e,n])}}let _,v;function g(t){if(t>2*Math.PI)throw Error("expected radians")}},87597(t,e,n){n.d(e,{P:()=>Vector3});var i=n(54272),o=n(54901),r=n(73731),s=n(82859),a=n(68225);const c=[0,0,0];let l;class Vector3 extends i.M{static get ZERO(){return l||(l=new Vector3(0,0,0),Object.freeze(l)),l}constructor(t=0,e=0,n=0){super(-0,-0,-0),1===arguments.length&&(0,o.cy)(t)?this.copy(t):(o.$W.debug&&((0,r.ws)(t),(0,r.ws)(e),(0,r.ws)(n)),this[0]=t,this[1]=e,this[2]=n)}set(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return o.$W.debug&&((0,r.ws)(t.x),(0,r.ws)(t.y),(0,r.ws)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=(0,r.ws)(t)}angle(t){return(0,s.g7)(this,t)}cross(t){return(0,s.$A)(this,this,t),this.check()}rotateX({radians:t,origin:e=c}){return(0,s.eL)(this,this,e,t),this.check()}rotateY({radians:t,origin:e=c}){return(0,s.Z8)(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=c}){return(0,s.x6)(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return(0,s.Z0)(this,this,t),this.check()}transformAsVector(t){return(0,a.cL)(this,this,t),this.check()}transformByMatrix3(t){return(0,s.ei)(this,this,t),this.check()}transformByMatrix2(t){return(0,a.J4)(this,this,t),this.check()}transformByQuaternion(t){return(0,s.gL)(this,this,t),this.check()}}},50741(t,e,n){n.d(e,{tb:()=>o});const i=1e-6;let o="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;n.d(e,["p8",0,i])},90218(t,e,n){n.d(e,{$h:()=>_,B8:()=>r,I0:()=>m,IL:()=>f,Qr:()=>d,Tl:()=>c,Z8:()=>p,a4:()=>s,e$:()=>h,eL:()=>u,hs:()=>l,lw:()=>a,mg:()=>o,t5:()=>E});var i=n(50741);function o(t,e){if(t===e){const n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[11]=e[14],t[12]=o,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function r(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],u=e[9],p=e[10],d=e[11],f=e[12],m=e[13],_=e[14],v=e[15],g=n*a-i*s,E=n*c-o*s,y=n*l-r*s,M=i*c-o*a,b=i*l-r*a,T=o*l-r*c,P=h*m-u*f,w=h*_-p*f,S=h*v-d*f,x=u*_-p*m,O=u*v-d*m,j=p*v-d*_;let I=g*j-E*O+y*x+M*S-b*w+T*P;return I?(I=1/I,t[0]=(a*j-c*O+l*x)*I,t[1]=(o*O-i*j-r*x)*I,t[2]=(m*T-_*b+v*M)*I,t[3]=(p*b-u*T-d*M)*I,t[4]=(c*S-s*j-l*w)*I,t[5]=(n*j-o*S+r*w)*I,t[6]=(_*y-f*T-v*E)*I,t[7]=(h*T-p*y+d*E)*I,t[8]=(s*O-a*S+l*P)*I,t[9]=(i*S-n*O-r*P)*I,t[10]=(f*b-m*y+v*g)*I,t[11]=(u*y-h*b-d*g)*I,t[12]=(a*w-s*x-c*P)*I,t[13]=(n*x-i*w+o*P)*I,t[14]=(m*E-f*M-_*g)*I,t[15]=(h*M-u*E+p*g)*I,t):null}function s(t){const e=t[0],n=t[1],i=t[2],o=t[3],r=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],u=t[10],p=t[11],d=t[12],f=t[13],m=t[14],_=e*s-n*r,v=e*a-i*r,g=n*a-i*s,E=l*f-h*d,y=l*m-u*d,M=h*m-u*f;return c*(e*M-n*y+i*E)-o*(r*M-s*y+a*E)+t[15]*(l*g-h*v+u*_)-p*(d*g-f*v+m*_)}function a(t,e,n){const i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],l=e[6],h=e[7],u=e[8],p=e[9],d=e[10],f=e[11],m=e[12],_=e[13],v=e[14],g=e[15];let E=n[0],y=n[1],M=n[2],b=n[3];return t[0]=E*i+y*a+M*u+b*m,t[1]=E*o+y*c+M*p+b*_,t[2]=E*r+y*l+M*d+b*v,t[3]=E*s+y*h+M*f+b*g,E=n[4],y=n[5],M=n[6],b=n[7],t[4]=E*i+y*a+M*u+b*m,t[5]=E*o+y*c+M*p+b*_,t[6]=E*r+y*l+M*d+b*v,t[7]=E*s+y*h+M*f+b*g,E=n[8],y=n[9],M=n[10],b=n[11],t[8]=E*i+y*a+M*u+b*m,t[9]=E*o+y*c+M*p+b*_,t[10]=E*r+y*l+M*d+b*v,t[11]=E*s+y*h+M*f+b*g,E=n[12],y=n[13],M=n[14],b=n[15],t[12]=E*i+y*a+M*u+b*m,t[13]=E*o+y*c+M*p+b*_,t[14]=E*r+y*l+M*d+b*v,t[15]=E*s+y*h+M*f+b*g,t}function c(t,e,n){const i=n[0],o=n[1],r=n[2];let s,a,c,l,h,u,p,d,f,m,_,v;return e===t?(t[12]=e[0]*i+e[4]*o+e[8]*r+e[12],t[13]=e[1]*i+e[5]*o+e[9]*r+e[13],t[14]=e[2]*i+e[6]*o+e[10]*r+e[14],t[15]=e[3]*i+e[7]*o+e[11]*r+e[15]):(s=e[0],a=e[1],c=e[2],l=e[3],h=e[4],u=e[5],p=e[6],d=e[7],f=e[8],m=e[9],_=e[10],v=e[11],t[0]=s,t[1]=a,t[2]=c,t[3]=l,t[4]=h,t[5]=u,t[6]=p,t[7]=d,t[8]=f,t[9]=m,t[10]=_,t[11]=v,t[12]=s*i+h*o+f*r+e[12],t[13]=a*i+u*o+m*r+e[13],t[14]=c*i+p*o+_*r+e[14],t[15]=l*i+d*o+v*r+e[15]),t}function l(t,e,n){const i=n[0],o=n[1],r=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function h(t,e,n,o){let r,s,a,c,l,h,u,p,d,f,m,_,v,g,E,y,M,b,T,P,w,S,x,O,j=o[0],I=o[1],R=o[2],A=Math.sqrt(j*j+I*I+R*R);return A<i.p8?null:(A=1/A,j*=A,I*=A,R*=A,s=Math.sin(n),r=Math.cos(n),a=1-r,c=e[0],l=e[1],h=e[2],u=e[3],p=e[4],d=e[5],f=e[6],m=e[7],_=e[8],v=e[9],g=e[10],E=e[11],y=j*j*a+r,M=I*j*a+R*s,b=R*j*a-I*s,T=j*I*a-R*s,P=I*I*a+r,w=R*I*a+j*s,S=j*R*a+I*s,x=I*R*a-j*s,O=R*R*a+r,t[0]=c*y+p*M+_*b,t[1]=l*y+d*M+v*b,t[2]=h*y+f*M+g*b,t[3]=u*y+m*M+E*b,t[4]=c*T+p*P+_*w,t[5]=l*T+d*P+v*w,t[6]=h*T+f*P+g*w,t[7]=u*T+m*P+E*w,t[8]=c*S+p*x+_*O,t[9]=l*S+d*x+v*O,t[10]=h*S+f*x+g*O,t[11]=u*S+m*x+E*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function u(t,e,n){const i=Math.sin(n),o=Math.cos(n),r=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],u=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*o+l*i,t[5]=s*o+h*i,t[6]=a*o+u*i,t[7]=c*o+p*i,t[8]=l*o-r*i,t[9]=h*o-s*i,t[10]=u*o-a*i,t[11]=p*o-c*i,t}function p(t,e,n){const i=Math.sin(n),o=Math.cos(n),r=e[0],s=e[1],a=e[2],c=e[3],l=e[8],h=e[9],u=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*o-l*i,t[1]=s*o-h*i,t[2]=a*o-u*i,t[3]=c*o-p*i,t[8]=r*i+l*o,t[9]=s*i+h*o,t[10]=a*i+u*o,t[11]=c*i+p*o,t}function d(t,e,n){const i=Math.sin(n),o=Math.cos(n),r=e[0],s=e[1],a=e[2],c=e[3],l=e[4],h=e[5],u=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*o+l*i,t[1]=s*o+h*i,t[2]=a*o+u*i,t[3]=c*o+p*i,t[4]=l*o-r*i,t[5]=h*o-s*i,t[6]=u*o-a*i,t[7]=p*o-c*i,t}function f(t,e){const n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],l=e[9],h=e[10];return t[0]=Math.sqrt(n*n+i*i+o*o),t[1]=Math.sqrt(r*r+s*s+a*a),t[2]=Math.sqrt(c*c+l*l+h*h),t}function m(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=n+n,a=i+i,c=o+o,l=n*s,h=i*s,u=i*a,p=o*s,d=o*a,f=o*c,m=r*s,_=r*a,v=r*c;return t[0]=1-u-f,t[1]=h+v,t[2]=p-_,t[3]=0,t[4]=h-v,t[5]=1-l-f,t[6]=d+m,t[7]=0,t[8]=p+_,t[9]=d-m,t[10]=1-l-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _(t,e,n,i,o,r,s){const a=1/(n-e),c=1/(o-i),l=1/(r-s);return t[0]=2*r*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*r*c,t[6]=0,t[7]=0,t[8]=(n+e)*a,t[9]=(o+i)*c,t[10]=(s+r)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*r*2*l,t[15]=0,t}const v=function(t,e,n,i,o){const r=1/Math.tan(e/2);if(t[0]=r/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0){const e=1/(i-o);t[10]=(o+i)*e,t[14]=2*o*i*e}else t[10]=-1,t[14]=-2*i;return t};const g=function(t,e,n,i,o,r,s){const a=1/(e-n),c=1/(i-o),l=1/(r-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*a,t[13]=(o+i)*c,t[14]=(s+r)*l,t[15]=1,t};function E(t,e,n,o){let r,s,a,c,l,h,u,p,d,f;const m=e[0],_=e[1],v=e[2],g=o[0],E=o[1],y=o[2],M=n[0],b=n[1],T=n[2];return Math.abs(m-M)<i.p8&&Math.abs(_-b)<i.p8&&Math.abs(v-T)<i.p8?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(p=m-M,d=_-b,f=v-T,r=1/Math.sqrt(p*p+d*d+f*f),p*=r,d*=r,f*=r,s=E*f-y*d,a=y*p-g*f,c=g*d-E*p,r=Math.sqrt(s*s+a*a+c*c),r?(r=1/r,s*=r,a*=r,c*=r):(s=0,a=0,c=0),l=d*c-f*a,h=f*s-p*c,u=p*a-d*s,r=Math.sqrt(l*l+h*h+u*u),r?(r=1/r,l*=r,h*=r,u*=r):(l=0,h=0,u=0),t[0]=s,t[1]=l,t[2]=p,t[3]=0,t[4]=a,t[5]=h,t[6]=d,t[7]=0,t[8]=c,t[9]=u,t[10]=f,t[11]=0,t[12]=-(s*m+a*_+c*v),t[13]=-(l*m+h*_+u*v),t[14]=-(p*m+d*_+f*v),t[15]=1,t)}n.d(e,["fN",0,v,"v3",0,g])},83588(t,e,n){n.d(e,{Bw:()=>s,Cc:()=>c,WQ:()=>o,Z0:()=>h,ei:()=>l,hs:()=>r,ze:()=>a});var i=n(50741);function o(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function r(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function s(t){const e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function a(t,e){return t[0]=-e[0],t[1]=-e[1],t}function c(t,e,n,i){const o=e[0],r=e[1];return t[0]=o+i*(n[0]-o),t[1]=r+i*(n[1]-r),t}function l(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[3]*o+n[6],t[1]=n[1]*i+n[4]*o+n[7],t}function h(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[4]*o+n[12],t[1]=n[1]*i+n[5]*o+n[13],t}const u=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){const t=function(){const t=new i.tb(2);return i.tb!=Float32Array&&(t[0]=0,t[1]=0),t}()}();n.d(e,["jb",0,u])},82859(t,e,n){n.d(e,{$A:()=>u,Cc:()=>p,Ln:()=>a,Om:()=>h,S8:()=>l,Z0:()=>d,Z8:()=>v,eL:()=>_,ei:()=>f,fA:()=>r,g7:()=>E,gL:()=>m,lw:()=>s,vt:()=>o,x6:()=>g,ze:()=>c});var i=n(50741);function o(){const t=new i.tb(3);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function r(t,e,n){const o=new i.tb(3);return o[0]=t,o[1]=e,o[2]=n,o}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function a(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}function c(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function l(t,e){const n=e[0],i=e[1],o=e[2];let r=n*n+i*i+o*o;return r>0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function h(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function u(t,e,n){const i=e[0],o=e[1],r=e[2],s=n[0],a=n[1],c=n[2];return t[0]=o*c-r*a,t[1]=r*s-i*c,t[2]=i*a-o*s,t}function p(t,e,n,i){const o=e[0],r=e[1],s=e[2];return t[0]=o+i*(n[0]-o),t[1]=r+i*(n[1]-r),t[2]=s+i*(n[2]-s),t}function d(t,e,n){const i=e[0],o=e[1],r=e[2];let s=n[3]*i+n[7]*o+n[11]*r+n[15];return s=s||1,t[0]=(n[0]*i+n[4]*o+n[8]*r+n[12])/s,t[1]=(n[1]*i+n[5]*o+n[9]*r+n[13])/s,t[2]=(n[2]*i+n[6]*o+n[10]*r+n[14])/s,t}function f(t,e,n){const i=e[0],o=e[1],r=e[2];return t[0]=i*n[0]+o*n[3]+r*n[6],t[1]=i*n[1]+o*n[4]+r*n[7],t[2]=i*n[2]+o*n[5]+r*n[8],t}function m(t,e,n){const i=n[0],o=n[1],r=n[2],s=n[3],a=e[0],c=e[1],l=e[2];let h=o*l-r*c,u=r*a-i*l,p=i*c-o*a,d=o*p-r*u,f=r*h-i*p,m=i*u-o*h;const _=2*s;return h*=_,u*=_,p*=_,d*=2,f*=2,m*=2,t[0]=a+h+d,t[1]=c+u+f,t[2]=l+p+m,t}function _(t,e,n,i){const o=[],r=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],r[0]=o[0],r[1]=o[1]*Math.cos(i)-o[2]*Math.sin(i),r[2]=o[1]*Math.sin(i)+o[2]*Math.cos(i),t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t}function v(t,e,n,i){const o=[],r=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],r[0]=o[2]*Math.sin(i)+o[0]*Math.cos(i),r[1]=o[1],r[2]=o[2]*Math.cos(i)-o[0]*Math.sin(i),t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t}function g(t,e,n,i){const o=[],r=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],r[0]=o[0]*Math.cos(i)-o[1]*Math.sin(i),r[1]=o[0]*Math.sin(i)+o[1]*Math.cos(i),r[2]=o[2],t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t}function E(t,e){const n=t[0],i=t[1],o=t[2],r=e[0],s=e[1],a=e[2],c=Math.sqrt((n*n+i*i+o*o)*(r*r+s*s+a*a)),l=c&&h(t,e)/c;return Math.acos(Math.min(Math.max(l,-1),1))}const y=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},M=function(t,e){const n=e[0]-t[0],i=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(n*n+i*i+o*o)},b=function(t){const e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)},T=function(t){const e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i};!function(){const t=o()}();n.d(e,["Il",0,b,"jb",0,y,"uE",0,T,"xg",0,M])},39426(t,e,n){n.d(e,{Bw:()=>h,C:()=>s,Cc:()=>f,Om:()=>d,S8:()=>p,WQ:()=>c,Z0:()=>m,fA:()=>r,gL:()=>_,hZ:()=>a,hs:()=>l,m3:()=>u,o8:()=>o,t2:()=>v});var i=n(50741);function o(t){const e=new i.tb(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function r(t,e,n,o){const r=new i.tb(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=o,r}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t,e,n,i,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function l(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function h(t){const e=t[0],n=t[1],i=t[2],o=t[3];return Math.sqrt(e*e+n*n+i*i+o*o)}function u(t){const e=t[0],n=t[1],i=t[2],o=t[3];return e*e+n*n+i*i+o*o}function p(t,e){const n=e[0],i=e[1],o=e[2],r=e[3];let s=n*n+i*i+o*o+r*r;return s>0&&(s=1/Math.sqrt(s)),t[0]=n*s,t[1]=i*s,t[2]=o*s,t[3]=r*s,t}function d(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function f(t,e,n,i){const o=e[0],r=e[1],s=e[2],a=e[3];return t[0]=o+i*(n[0]-o),t[1]=r+i*(n[1]-r),t[2]=s+i*(n[2]-s),t[3]=a+i*(n[3]-a),t}function m(t,e,n){const i=e[0],o=e[1],r=e[2],s=e[3];return t[0]=n[0]*i+n[4]*o+n[8]*r+n[12]*s,t[1]=n[1]*i+n[5]*o+n[9]*r+n[13]*s,t[2]=n[2]*i+n[6]*o+n[10]*r+n[14]*s,t[3]=n[3]*i+n[7]*o+n[11]*r+n[15]*s,t}function _(t,e,n){const i=e[0],o=e[1],r=e[2],s=n[0],a=n[1],c=n[2],l=n[3],h=l*i+a*r-c*o,u=l*o+c*i-s*r,p=l*r+s*o-a*i,d=-s*i-a*o-c*r;return t[0]=h*l+d*-s+u*-c-p*-a,t[1]=u*l+d*-a+p*-s-h*-c,t[2]=p*l+d*-c+h*-a-u*-s,t[3]=e[3],t}function v(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}!function(){const t=function(){const t=new i.tb(4);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},4990(t,e,n){function i(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}n.d(e,{v:()=>i})},54901(t,e,n){n.d(e,{Cc:()=>a,Fl:()=>o,aI:()=>c,cy:()=>r,qE:()=>s});Math.PI,Math.PI;globalThis.mathgl=globalThis.mathgl||{config:{EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1}};const i=globalThis.mathgl.config;function o(t,{precision:e=i.precision}={}){return t=function(t){return Math.round(t/i.EPSILON)*i.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function r(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function s(t,e,n){return l(t,t=>Math.max(e,Math.min(n,t)))}function a(t,e,n){return r(t)?t.map((t,i)=>a(t,e[i],n)):n*e+(1-n)*t}function c(t,e,n){const o=i.EPSILON;n&&(i.EPSILON=n);try{if(t===e)return!0;if(r(t)&&r(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!c(t[n],e[n]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=i.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{i.EPSILON=o}}function l(t,e,n){if(r(t)){const i=t;n=n||function(t){return t.clone?t.clone():new Array(t.length)}(i);for(let o=0;o<n.length&&o<i.length;++o){const i="number"==typeof t?t:t[o];n[o]=e(i,o,n)}return n}return e(t)}n.d(e,["$W",0,i])},68225(t,e,n){function i(t,e,n){const i=e[0],o=e[1],r=n[3]*i+n[7]*o||1;return t[0]=(n[0]*i+n[4]*o)/r,t[1]=(n[1]*i+n[5]*o)/r,t}function o(t,e,n){const i=e[0],o=e[1],r=e[2],s=n[3]*i+n[7]*o+n[11]*r||1;return t[0]=(n[0]*i+n[4]*o+n[8]*r)/s,t[1]=(n[1]*i+n[5]*o+n[9]*r)/s,t[2]=(n[2]*i+n[6]*o+n[10]*r)/s,t}function r(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[2]*o,t[1]=n[1]*i+n[3]*o,t[2]=e[2],t}function s(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[2]*o,t[1]=n[1]*i+n[3]*o,t[2]=e[2],t[3]=e[3],t}function a(t,e,n){const i=e[0],o=e[1],r=e[2];return t[0]=n[0]*i+n[3]*o+n[6]*r,t[1]=n[1]*i+n[4]*o+n[7]*r,t[2]=n[2]*i+n[5]*o+n[8]*r,t[3]=e[3],t}n.d(e,{B$:()=>i,Cg:()=>s,J4:()=>r,cL:()=>o,vE:()=>a})},73731(t,e,n){n.d(e,{qk:()=>r,ws:()=>o});var i=n(54901);function o(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function r(t,e,n=""){if(i.$W.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error(`math.gl: ${n} some fields set to invalid numbers'`);return t}},45249(t,e,n){n.d(e,{aH:()=>g,dT:()=>x,Os:()=>I,Fe:()=>L,rj:()=>U,wZ:()=>R,gW:()=>N,nI:()=>S,v7:()=>W,fO:()=>P,om:()=>j,rY:()=>O,Gw:()=>b,xJ:()=>C,mY:()=>w,iV:()=>T,VJ:()=>A});var i=n(39426);function o(t,e){const n=i.Z0([],e,t);return i.hs(n,n,1/n[3]),n}function r(t,e,n){return n*e+(1-n)*t}function s(t,e,n){return t<e?e:t>n?n:t}const a=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var c=n(90218),l=n(82859),h=n(83588);function u(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const p=Math.PI,d=p/4,f=p/180,m=180/p,_=512,v=4003e4,g=85.051129,E=1.5;function y(t){return Math.pow(2,t)}function M(t){return a(t)}function b(t){const[e,n]=t;u(Number.isFinite(e)),u(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const i=n*f;return[_*(e*f+p)/(2*p),_*(p+Math.log(Math.tan(d+.5*i)))/(2*p)]}function T(t){const[e,n]=t,i=e/_*(2*p)-p,o=2*(Math.atan(Math.exp(n/_*(2*p)-p))-d);return[i*m,o*m]}function P(t){const{latitude:e}=t;u(Number.isFinite(e));const n=Math.cos(e*f);return M(v*n)-9}function w(t){return 12790407194604047e-21/Math.cos(t*f)}function S(t){const{latitude:e,longitude:n,highPrecision:i=!1}=t;u(Number.isFinite(e)&&Number.isFinite(n));const o=_,r=Math.cos(e*f),s=o/360,a=s/r,c=12790407194604047e-21/r,l={unitsPerMeter:[c,c,c],metersPerUnit:[1/c,1/c,1/c],unitsPerDegree:[s,a,c],degreesPerUnit:[.703125,1/a,1/c]};if(i){const t=f*Math.tan(e*f)/r,n=s*t/2,i=12790407194604047e-21*t,o=i/a*c;l.unitsPerDegree2=[0,n,i],l.unitsPerMeter2=[o,0,o]}return l}function x(t,e){const[n,i,o]=t,[r,s,a]=e,{unitsPerMeter:c,unitsPerMeter2:l}=S({longitude:n,latitude:i,highPrecision:!0}),h=b(t);h[0]+=r*(c[0]+l[0]*s),h[1]+=s*(c[1]+l[1]*s);const u=T(h),p=(o||0)+(a||0);return Number.isFinite(o)||Number.isFinite(a)?[u[0],u[1],p]:u}function O(t){const{height:e,pitch:n,bearing:i,altitude:o,scale:r,center:s}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.Tl(a,a,[0,0,-o]),c.eL(a,a,-n*f),c.Qr(a,a,i*f);const h=r/e;return c.hs(a,a,[h,h,h]),s&&c.Tl(a,a,l.ze([],s)),a}function j(t){const{width:e,height:n,altitude:i,pitch:o=0,offset:r,center:a,scale:c,nearZMultiplier:l=1,farZMultiplier:h=1}=t;let{fovy:u=I(E)}=t;void 0!==i&&(u=I(i));const p=u*f,d=o*f,m=R(u);let _=m;a&&(_+=a[2]*c/Math.cos(d)/n);const v=p*(.5+(r?r[1]:0)/n),g=Math.sin(v)*_/Math.sin(s(Math.PI/2-d-v,.01,Math.PI-.01)),y=Math.sin(d)*g+_,M=10*_;return{fov:p,aspect:e/n,focalDistance:m,near:l,far:Math.min(y*h,M)}}function I(t){return 2*Math.atan(.5/t)*m}function R(t){return.5/Math.tan(.5*t*f)}function A(t,e){const[n,i,r=0]=t;return u(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),o(e,[n,i,r,1])}function C(t,e,n=0){const[i,r,s]=t;if(u(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s)){return o(e,[i,r,s,1])}const a=o(e,[i,r,0,1]),c=o(e,[i,r,1,1]),l=a[2],p=c[2],d=l===p?0:((n||0)-l)/(p-l);return h.Cc([],a,c,d)}function L(t){const{width:e,height:n,bounds:i,minExtent:o=0,maxZoom:r=24,offset:c=[0,0]}=t,[[l,h],[p,d]]=i,f=function(t=0){if("number"==typeof t)return{top:t,bottom:t,left:t,right:t};return u(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),m=b([l,s(d,-g,g)]),_=b([p,s(h,-g,g)]),v=[Math.max(Math.abs(_[0]-m[0]),o),Math.max(Math.abs(_[1]-m[1]),o)],E=[e-f.left-f.right-2*Math.abs(c[0]),n-f.top-f.bottom-2*Math.abs(c[1])];u(E[0]>0&&E[1]>0);const y=E[0]/v[0],M=E[1]/v[1],P=(f.right-f.left)/2/y,w=(f.top-f.bottom)/2/M,S=T([(_[0]+m[0])/2+P,(_[1]+m[1])/2+w]),x=Math.min(r,a(Math.abs(Math.min(y,M))));return u(Number.isFinite(x)),{longitude:S[0],latitude:S[1],zoom:x}}const z=Math.PI/180;function N(t,e=0){const{width:n,height:i,unproject:o}=t,r={targetZ:e},s=o([0,i],r),a=o([n,i],r);let c,l;return(t.fovy?.5*t.fovy*z:Math.atan(.5/t.altitude))>(90-t.pitch)*z-.01?(c=k(t,0,e),l=k(t,n,e)):(c=o([0,0],r),l=o([n,0],r)),[s,a,l,c]}function k(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=o(i,[e,0,1,1]),s=o(i,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2]),c=T(h.Cc([],r,s,a));return c.push(n),c}const D=["longitude","latitude","zoom"],F={curve:1.414,speed:1.2};function U(t,e,n,i){const{startZoom:o,startCenterXY:s,uDelta:a,w0:c,u1:l,S:u,rho:p,rho2:d,r0:f}=B(t,e,i);if(l<.01){const i={};for(const o of D){const s=t[o],a=e[o];i[o]=r(s,a,n)}return i}const m=n*u,_=Math.cosh(f)/Math.cosh(f+p*m),v=c*((Math.cosh(f)*Math.tanh(f+p*m)-Math.sinh(f))/d)/l,g=o+M(1/_),E=h.hs([],a,v);h.WQ(E,E,s);const y=T(E);return{longitude:y[0],latitude:y[1],zoom:g}}function W(t,e,n){const i={...F,...n},{screenSpeed:o,speed:r,maxDuration:s}=i,{S:a,rho:c}=B(t,e,i),l=1e3*a;let h;return h=Number.isFinite(o)?l/(o/c):l/r,Number.isFinite(s)&&h>s?0:h}function B(t,e,n){const i=(n=Object.assign({},F,n)).curve,o=t.zoom,r=[t.longitude,t.latitude],s=y(o),a=e.zoom,c=[e.longitude,e.latitude],l=y(a-o),u=b(r),p=b(c),d=h.jb([],p,u),f=Math.max(t.width,t.height),m=f/l,_=h.Bw(d)*s,v=Math.max(_,.01),g=i*i,E=(m*m-f*f+g*g*v*v)/(2*f*g*v),M=(m*m-f*f-g*g*v*v)/(2*m*g*v),T=Math.log(Math.sqrt(E*E+1)-E),P=Math.log(Math.sqrt(M*M+1)-M);return{startZoom:o,startCenterXY:u,uDelta:d,w0:f,u1:_,S:(P-T)/i,rho:i,rho2:g,r0:T,r1:P}}},19852(t,e,n){n.d(e,{Cp:()=>DoubleClickDragRecognizer,EU:()=>EventManager,uq:()=>PanRecognizer,h1:()=>PinchRecognizer,Cx:()=>TapRecognizer});var i,o,r;!function(t){t[t.Start=1]="Start",t[t.Move=2]="Move",t[t.End=4]="End",t[t.Cancel=8]="Cancel"}(i||(i={})),function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Up=4]="Up",t[t.Down=8]="Down",t[t.Horizontal=3]="Horizontal",t[t.Vertical=12]="Vertical",t[t.All=15]="All"}(o||(o={})),function(t){t[t.Possible=1]="Possible",t[t.Began=2]="Began",t[t.Changed=4]="Changed",t[t.Ended=8]="Ended",t[t.Recognized=8]="Recognized",t[t.Cancelled=16]="Cancelled",t[t.Failed=32]="Failed"}(r||(r={}));const s="manipulation";class TouchAction{constructor(t,e){this.actions="",this.manager=t,this.set(e)}set(t){"compute"===t&&(t=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=t,this.actions=t)}update(){this.set(this.manager.options.touchAction)}compute(){let t=[];for(const e of this.manager.recognizers)e.options.enable&&(t=t.concat(e.getTouchAction()));return function(t){if(t.includes("none"))return"none";const e=t.includes("pan-x"),n=t.includes("pan-y");return e&&n?"none":e||n?e?"pan-x":"pan-y":t.includes(s)?s:"auto"}(t.join(" "))}}function a(t){return t.trim().split(/\s+/g)}function c(t,e,n){if(t)for(const i of a(e))t.addEventListener(i,n,!1)}function l(t,e,n){if(t)for(const i of a(e))t.removeEventListener(i,n,!1)}function h(t){return(t.ownerDocument||t).defaultView}function u(t){const e=t.length;if(1===e)return{x:Math.round(t[0].clientX),y:Math.round(t[0].clientY)};let n=0,i=0,o=0;for(;o<e;)n+=t[o].clientX,i+=t[o].clientY,o++;return{x:Math.round(n/e),y:Math.round(i/e)}}function p(t){const e=[];let n=0;for(;n<t.pointers.length;)e[n]={clientX:Math.round(t.pointers[n].clientX),clientY:Math.round(t.pointers[n].clientY)},n++;return{timeStamp:Date.now(),pointers:e,center:u(e),deltaX:t.deltaX,deltaY:t.deltaY}}function d(t,e){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}function f(t,e){const n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)}function m(t,e){const n=e.clientX-t.clientX,i=e.clientY-t.clientY;return 180*Math.atan2(i,n)/Math.PI}function _(t,e){return t===e?o.None:Math.abs(t)>=Math.abs(e)?t<0?o.Left:o.Right:e<0?o.Up:o.Down}function v(t,e,n){return{x:e/t||0,y:n/t||0}}function g(t,e){return"pointerId"in t?t.pointerId:e}function E(t,e){t.movementOrigin=new Map(e.map((t,e)=>[g(t,e),{clientX:t.clientX,clientY:t.clientY}])),t.firstMovementTime=void 0}function y(t,e){const{session:n}=t,{pointers:o}=e,{length:r}=o;n.firstInput||(n.firstInput=p(e)),r>1&&!n.firstMultiple?n.firstMultiple=p(e):1===r&&(n.firstMultiple=!1);const{firstInput:s,firstMultiple:a}=n,c=a?a.center:s.center,l=e.center=u(o);e.timeStamp=Date.now(),e.deltaTime=e.timeStamp-s.timeStamp,function(t,e){const n=e.pointers.map(g);if(t.movementOrigin?.size===n.length&&n.every(e=>t.movementOrigin.has(e))||E(t,e.pointers),e.distancePerPointer=e.pointers.map((e,i)=>f(t.movementOrigin.get(n[i]),e)),e.eventType&i.Move&&e.distancePerPointer.some(t=>t>0)&&(t.firstMovementTime??(t.firstMovementTime=e.timeStamp)),e.movementDeltaTime=void 0===t.firstMovementTime?0:e.timeStamp-t.firstMovementTime,e.eventType&(i.End|i.Cancel)){const i=e.changedPointers.map(t=>g(t,e.pointers.indexOf(t)));E(t,e.pointers.filter((t,e)=>!i.includes(n[e])))}}(n,e),e.angle=function(t,e){const n=e.x-t.x,i=e.y-t.y;return 180*Math.atan2(i,n)/Math.PI}(c,l),e.distance=d(c,l);const{deltaX:h,deltaY:y}=function(t,e){const n=e.center;let o=t.offsetDelta,r=t.prevDelta;const s=t.prevInput;return e.eventType!==i.Start&&s?.eventType!==i.End||(r=t.prevDelta={x:s?.deltaX||0,y:s?.deltaY||0},o=t.offsetDelta={x:n.x,y:n.y}),{deltaX:r.x+(n.x-o.x),deltaY:r.y+(n.y-o.y)}}(n,e);e.deltaX=h,e.deltaY=y,e.offsetDirection=_(e.deltaX,e.deltaY);const M=v(e.deltaTime,e.deltaX,e.deltaY);var b,T;e.overallVelocityX=M.x,e.overallVelocityY=M.y,e.overallVelocity=Math.abs(M.x)>Math.abs(M.y)?M.x:M.y,e.scale=a?(b=a.pointers,f((T=o)[0],T[1])/f(b[0],b[1])):1,e.rotation=a?function(t,e){return m(e[1],e[0])-m(t[1],t[0])}(a.pointers,o):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length;let P=t.element;return function(t,e){let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}(e.srcEvent.target,P)&&(P=e.srcEvent.target),e.target=P,function(t,e){const n=t.lastInterval||e,o=e.timeStamp-n.timeStamp;let r,s,a,c;if(e.eventType!==i.Cancel&&(o>25||void 0===n.velocity)){const i=e.deltaX-n.deltaX,l=e.deltaY-n.deltaY,h=v(o,i,l);s=h.x,a=h.y,r=Math.abs(h.x)>Math.abs(h.y)?h.x:h.y,c=_(i,l),t.lastInterval=e}else r=n.velocity,s=n.velocityX,a=n.velocityY,c=n.direction;e.velocity=r,e.velocityX=s,e.velocityY=a,e.direction=c}(n,e),e}class Input{constructor(t){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=t=>{this.manager.options.enable&&this.handler(t)},this.manager=t,this.element=t.element,this.target=t.options.inputTarget||t.element}callback(t,e){!function(t,e,n){const o=n.pointers.length,r=n.changedPointers.length,s=e&i.Start&&o-r===0,a=e&(i.End|i.Cancel)&&o-r===0;n.isFirst=Boolean(s),n.isFinal=Boolean(a),s&&(t.session={}),n.eventType=e;const c=y(t,n);t.emit("hammer.input",c),t.recognize(c),t.session.prevInput=c}(this.manager,t,e)}init(){c(this.element,this.evEl,this.domHandler),c(this.target,this.evTarget,this.domHandler),c(h(this.element),this.evWin,this.domHandler)}destroy(){l(this.element,this.evEl,this.domHandler),l(this.target,this.evTarget,this.domHandler),l(h(this.element),this.evWin,this.domHandler)}}const M={pointerdown:i.Start,pointermove:i.Move,pointerup:i.End,pointercancel:i.Cancel,pointerout:i.Cancel};class PointerEventInput extends Input{constructor(t){super(t),this.evEl="pointerdown",this.evWin="pointermove pointerup pointercancel",this.store=this.manager.session.pointerEvents=[],this.init()}handler(t){const{store:e}=this;let n=!1;const o=M[t.type],r=t.pointerType,s="touch"===r;let a=e.findIndex(e=>e.pointerId===t.pointerId);o&i.Start&&(t.buttons||s)?a<0&&(e.push(t),a=e.length-1):o&(i.End|i.Cancel)&&(n=!0),a<0||(e[a]=t,this.callback(o,{pointers:e,changedPointers:[t],eventType:o,pointerType:r,srcEvent:t}),n&&e.splice(a,1))}}const b=["","webkit","Moz","MS","ms","o"];function T(t,e){const n=e[0].toUpperCase()+e.slice(1);for(const i of b){const o=i?i+n:e;if(o in t)return o}}const P={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}};class Manager{constructor(t,e){this.options={...P,...e,cssProps:{...P.cssProps,...e.cssProps},inputTarget:e.inputTarget||t},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new PointerEventInput(this),this.touchAction=new TouchAction(this,this.options.touchAction),this.toggleCssProps(!0)}set(t){return Object.assign(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this}stop(t){this.session.stopped=t?2:1}recognize(t){const{session:e}=this;if(e.stopped)return;let n;this.session.prevented&&t.srcEvent.preventDefault();const{recognizers:i}=this;let{curRecognizer:o}=e;(!o||o&&o.state&r.Recognized)&&(o=e.curRecognizer=null);let s=0;for(;s<i.length;)n=i[s],2===e.stopped||o&&n!==o&&!n.canRecognizeWith(o)?n.reset():n.recognize(t),!o&&n.state&(r.Began|r.Changed|r.Ended)&&(o=e.curRecognizer=n),s++}get(t){const{recognizers:e}=this;for(let n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null}add(t){if(Array.isArray(t)){for(const e of t)this.add(e);return this}const e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t}remove(t){if(Array.isArray(t)){for(const e of t)this.remove(e);return this}const e="string"==typeof t?this.get(t):t;if(e){const{recognizers:t}=this,n=t.indexOf(e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this}on(t,e){if(!t||!e)return;const{handlers:n}=this;for(const i of a(t))n[i]=n[i]||[],n[i].push(e)}off(t,e){if(!t)return;const{handlers:n}=this;for(const i of a(t))e?n[i]&&n[i].splice(n[i].indexOf(e),1):delete n[i]}emit(t,e){const n=this.handlers[t]&&this.handlers[t].slice();if(!n||!n.length)return;const i=e;i.type=t,i.preventDefault=function(){e.srcEvent.preventDefault()};let o=0;for(;o<n.length;)n[o](i),o++}destroy(){this.toggleCssProps(!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}toggleCssProps(t){const{element:e}=this;if(e){for(const[n,i]of Object.entries(this.options.cssProps)){const o=T(e.style,n);t?(this.oldCssProps[o]=e.style[o],e.style[o]=i):e.style[o]=this.oldCssProps[o]||""}t||(this.oldCssProps={})}}}let w=1;function S(t){return t&r.Cancelled?"cancel":t&r.Ended?"end":t&r.Changed?"move":t&r.Began?"start":""}class Recognizer{constructor(t){this.options=t,this.id=w++,this.state=r.Possible,this.simultaneous={},this.requireFail=[]}set(t){return Object.assign(this.options,t),this.manager.touchAction.update(),this}recognizeWith(t){if(Array.isArray(t)){for(const e of t)this.recognizeWith(e);return this}let e;if("string"==typeof t){if(e=this.manager.get(t),!e)throw new Error(`Cannot find recognizer ${t}`)}else e=t;const{simultaneous:n}=this;return n[e.id]||(n[e.id]=e,e.recognizeWith(this)),this}dropRecognizeWith(t){if(Array.isArray(t)){for(const e of t)this.dropRecognizeWith(e);return this}let e;return e="string"==typeof t?this.manager.get(t):t,e&&delete this.simultaneous[e.id],this}requireFailure(t){if(Array.isArray(t)){for(const e of t)this.requireFailure(e);return this}let e;if("string"==typeof t){if(e=this.manager.get(t),!e)throw new Error(`Cannot find recognizer ${t}`)}else e=t;const{requireFail:n}=this;return-1===n.indexOf(e)&&(n.push(e),e.requireFailure(this)),this}dropRequireFailure(t){if(Array.isArray(t)){for(const e of t)this.dropRequireFailure(e);return this}let e;if(e="string"==typeof t?this.manager.get(t):t,e){const t=this.requireFail.indexOf(e);t>-1&&this.requireFail.splice(t,1)}return this}hasRequireFailures(){return Boolean(this.requireFail.find(t=>t.options.enable))}canRecognizeWith(t){return Boolean(this.simultaneous[t.id])}emit(t){if(!t)return;const{state:e}=this;e<r.Ended&&this.manager.emit(this.options.event+S(e),t),this.manager.emit(this.options.event,t),t.additionalEvent&&this.manager.emit(t.additionalEvent,t),e>=r.Ended&&this.manager.emit(this.options.event+S(e),t)}tryEmit(t){this.canEmit()?this.emit(t):this.state=r.Failed}canEmit(){let t=0;for(;t<this.requireFail.length;){if(!(this.requireFail[t].state&(r.Failed|r.Possible)))return!1;t++}return!0}recognize(t){const e={...t};if(!this.options.enable)return this.reset(),void(this.state=r.Failed);this.state&(r.Recognized|r.Cancelled|r.Failed)&&(this.state=r.Possible),this.state=this.process(e),this.state&(r.Began|r.Changed|r.Ended|r.Cancelled)&&this.tryEmit(e)}getEventNames(){return[this.options.event]}reset(){}}function x(t,e){return(void 0===e.distance||t.distance>=e.distance)&&(void 0===e.distancePerPointer||t.distancePerPointer.length>0&&t.distancePerPointer.every(t=>t>=e.distancePerPointer))&&(void 0===e.movementDeltaTime||t.movementDeltaTime>=e.movementDeltaTime)&&(void 0===e.rotation||(n=t.rotation,Math.abs(((n+180)%360+360)%360-180)>=e.rotation))&&(void 0===e.scale||Math.abs(t.scale-1)>=e.scale);var n}class AttrRecognizer extends Recognizer{attrTest(t){const e=this.options.pointers;return 0===e||t.pointers.length===e}coherentTest(t){const e=this.options.coherent;return!e?.length||e.some(e=>x(t,e))}process(t){const{state:e}=this,{eventType:n}=t,o=e&(r.Began|r.Changed),s=this.attrTest(t);return o&&(n&i.Cancel||!s)?e|r.Cancelled:o||s?n&i.End?e|r.Ended:e&r.Began?e|r.Changed:r.Began:r.Failed}}const O=["","start","move","end","cancel"];class DoubleClickDragRecognizer extends Recognizer{constructor(t={}){super({enable:!0,event:"doubleclickdrag",pointers:1,interval:500,time:350,threshold:28,dragThreshold:1,pixelsPerScale:120,...t}),this._tapStart=null,this._lastTap=null,this._drag=null,this._emittedStart=!1}getTouchAction(){return[s]}getEventNames(){return O.map(t=>this.options.event+t)}process(t){const{options:e}=this;return t.pointers.length===e.pointers?t.eventType&i.Start?this._handleStart(t):t.eventType&i.Move?this._handleMove(t):t.eventType&i.Cancel?this._handleEnd(t,!0):t.eventType&i.End?this._handleEnd(t,!1):r.Failed:(this.reset(),r.Failed)}reset(){this._tapStart=null,this._lastTap=null,this._drag=null,this._emittedStart=!1}emit(t){if(t){if(this.state===r.Began){if(!this._drag?.active||this._emittedStart)return;return this._emittedStart=!0,this.manager.emit(`${this.options.event}start`,t),void this.manager.emit(this.options.event,t)}if(this.state===r.Changed){if(!this._emittedStart)return;return this.manager.emit(`${this.options.event}move`,t),void this.manager.emit(this.options.event,t)}if(this.state===r.Ended){if(!this._emittedStart)return;return this.manager.emit(this.options.event,t),this.manager.emit(`${this.options.event}end`,t),void(this._emittedStart=!1)}if(this.state===r.Cancelled){if(!this._emittedStart)return;this.manager.emit(this.options.event,t),this.manager.emit(`${this.options.event}cancel`,t),this._emittedStart=!1}}}_handleStart(t){const e=this._getPointerId(t);return this._lastTap&&this._isTapMatch(t,this._lastTap)?(this._tapStart=null,this._lastTap=null,this._drag={startCenter:t.center,pointerId:e,active:!1},this._emittedStart=!1,r.Began):(this._tapStart={center:t.center,timeStamp:t.timeStamp,pointerId:e},this._lastTap=null,this._drag=null,this._emittedStart=!1,r.Failed)}_handleMove(t){if(!this._drag||!this._isSamePointer(t,this._drag.pointerId))return r.Failed;const e=this._drag.startCenter.y-t.center.y;return!this._drag.active&&Math.abs(e)<this.options.dragThreshold?r.Began:(this._drag.active=!0,t.scale=Math.pow(2,e/this.options.pixelsPerScale),this._emittedStart?r.Changed:r.Began)}_handleEnd(t,e){if(this._drag&&this._isSamePointer(t,this._drag.pointerId)){const{active:n,startCenter:i}=this._drag;if(this._drag=null,this._tapStart=null,this._lastTap=null,!n)return this._emittedStart=!1,r.Failed;const o=i.y-t.center.y;return t.scale=Math.pow(2,o/this.options.pixelsPerScale),e?r.Cancelled:r.Ended}return this._tapStart&&this._isSamePointer(t,this._tapStart.pointerId)?(this._isValidTap(t)?this._lastTap={center:t.center,timeStamp:t.timeStamp,pointerId:this._tapStart.pointerId}:this._lastTap=null,this._tapStart=null,r.Failed):(e&&this.reset(),r.Failed)}_isTapMatch(t,e){return t.timeStamp-e.timeStamp<=this.options.interval&&d(t.center,e.center)<=this.options.threshold}_isValidTap(t){return t.deltaTime<=this.options.time&&t.distance<=this.options.threshold}_getPointerId(t){return"pointerId"in t.srcEvent?t.srcEvent.pointerId:null}_isSamePointer(t,e){return null===e||this._getPointerId(t)===e}}class TapRecognizer extends Recognizer{constructor(t={}){super({enable:!0,event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...t}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[s]}process(t){const{options:e}=this,n=t.pointers.length===e.pointers,o=t.distance<e.threshold,s=t.deltaTime<e.time;if(this.reset(),t.eventType&i.Start&&0===this.count)return this.failTimeout();if(o&&s&&n){if(t.eventType!==i.End)return this.failTimeout();const n=!this.pTime||t.timeStamp-this.pTime<e.interval,o=!this.pCenter||d(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,o&&n?this.count+=1:this.count=1,this._input=t;if(0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=r.Recognized,this.tryEmit(this._input)},e.interval),r.Began):r.Recognized}return r.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=r.Failed},this.options.interval),r.Failed}reset(){clearTimeout(this._timer)}emit(t){this.state===r.Recognized&&(t.tapCount=this.count,this.manager.emit(this.options.event,t))}}class TrackpadRecognizer extends AttrRecognizer{constructor(){super(...arguments),this.wheelSession=null,this.wheelSessionUnsubscribe=null,this.handleWheelSessionEvent=t=>{"trackpad"===t.device&&this.handleTrackpadEvent(t)}}set(t){const{wheelSession:e,...n}=t;return e&&e!==this.wheelSession&&(this.wheelSessionUnsubscribe?.(),this.wheelSessionUnsubscribe=null,this.wheelSession=e),super.set(n),this.updateWheelSessionSubscription(),this}getTrackpadInput(t,e={}){const{srcEvent:n}=t,i=e.deltaX??t.deltaX,o=e.deltaY??t.deltaY,r=_(i,o),s=Math.sqrt(t.deltaX*t.deltaX+t.deltaY*t.deltaY);return{pointers:[n,n],changedPointers:[n,n],pointerType:"trackpad",srcEvent:n,eventType:t.eventType,timeStamp:t.timeStamp,deltaTime:t.deltaTime,center:t.center,deltaX:i,deltaY:o,angle:180*Math.atan2(o,i)/Math.PI,distance:Math.sqrt(i*i+o*o),distancePerPointer:[s,s],movementDeltaTime:t.deltaTime,scale:1,rotation:0,direction:r,offsetDirection:r,velocity:t.velocity,velocityX:t.velocityX,velocityY:t.velocityY,overallVelocity:t.overallVelocity,overallVelocityX:t.overallVelocityX,overallVelocityY:t.overallVelocityY,maxPointers:2,target:n.target||this.manager.element,additionalEvent:"",...e}}updateWheelSessionSubscription(){const t=Boolean(this.wheelSession&&this.options.enable&&this.options.trackpad&&2===this.options.pointers);t&&!this.wheelSessionUnsubscribe?this.wheelSessionUnsubscribe=this.wheelSession.on(this.handleWheelSessionEvent):!t&&this.wheelSessionUnsubscribe&&(this.wheelSessionUnsubscribe(),this.wheelSessionUnsubscribe=null)}}const j=["","start","move","end","cancel","up","down","left","right"];class PanRecognizer extends TrackpadRecognizer{constructor(t={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:o.All,trackpad:!1,coherent:[],...t}),this.trackpadGesture=!1,this.pX=null,this.pY=null}getTouchAction(){const{options:{direction:t}}=this,e=[];return t&o.Horizontal&&e.push("pan-y"),t&o.Vertical&&e.push("pan-x"),e}getEventNames(){return j.map(t=>this.options.event+t)}directionTest(t){const{options:e}=this;let n=!0,{distance:i}=t,{direction:r}=t;const s=t.deltaX,a=t.deltaY;return r&e.direction||(e.direction&o.Horizontal?(r=0===s?o.None:s<0?o.Left:o.Right,n=s!==this.pX,i=Math.abs(t.deltaX)):(r=0===a?o.None:a<0?o.Up:o.Down,n=a!==this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&Boolean(r&e.direction)}attrTest(t){const e=Boolean(this.state&r.Began),n=!(this.options.coherent?.length&&t.eventType&(i.End|i.Cancel));return super.attrTest(t)&&(e||n&&this.coherentTest(t)&&this.directionTest(t))}emit(t){this.pX=t.deltaX,this.pY=t.deltaY;const e=o[t.direction].toLowerCase();e&&(t.additionalEvent=this.options.event+e),super.emit(t)}handleTrackpadEvent(t){t.isFirst&&(this.trackpadGesture=!t.srcEvent.ctrlKey,!this.trackpadGesture&&this.state&(r.Recognized|r.Cancelled|r.Failed)&&(this.state=r.Possible)),this.trackpadGesture&&(this.recognize(this.getTrackpadInput(t,{deltaX:-t.deltaX,deltaY:-t.deltaY,velocity:-t.velocity,velocityX:-t.velocityX,velocityY:-t.velocityY,overallVelocity:-t.overallVelocity,overallVelocityX:-t.overallVelocityX,overallVelocityY:-t.overallVelocityY})),t.isFinal&&(this.trackpadGesture=!1))}}const I=["","start","move","end","cancel","in","out"];class PinchRecognizer extends TrackpadRecognizer{constructor(t={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,trackpad:!1,coherent:[],...t}),this.trackpadGesture=!1}getTouchAction(){return["none"]}getEventNames(){return I.map(t=>this.options.event+t)}attrTest(t){const e=Boolean(this.options.coherent?.length),n=Boolean(this.state&r.Began),o=!(e&&t.eventType&(i.End|i.Cancel));return super.attrTest(t)&&(n||o&&(e?this.coherentTest(t):Math.abs(t.scale-1)>this.options.threshold))}emit(t){if(1!==t.scale){const e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}super.emit(t)}handleTrackpadEvent(t){t.isFirst&&(this.trackpadGesture=t.srcEvent.ctrlKey,!this.trackpadGesture&&this.state&(r.Recognized|r.Cancelled|r.Failed)&&(this.state=r.Possible)),this.trackpadGesture&&(this.recognize(this.getTrackpadInput(t,{deltaX:0,deltaY:0,velocity:0,velocityX:0,velocityY:0,overallVelocity:0,overallVelocityX:0,overallVelocityY:0,scale:Math.exp(-t.deltaY/100)})),t.isFinal&&(this.trackpadGesture=!1))}}class input_Input{constructor(t,e,n){this.element=t,this.callback=e,this.options=n}listen(t,e){e?this.element.addEventListener(t,this.handleEvent,{passive:!1}):this.element.removeEventListener(t,this.handleEvent)}}const R=-1!==("undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"").indexOf("firefox");class WheelInput extends input_Input{constructor(t,e,n){n.enable=n.enable??!1,super(t,e,n),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;globalThis.WheelEvent&&(R&&t.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(e/=globalThis.devicePixelRatio),t.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(e*=40)),t.shiftKey&&e&&(e*=.25),this.callback({type:"wheel",center:{x:t.clientX,y:t.clientY},delta:-e,device:this.options.wheelSession?.device??"unknown",srcEvent:t,pointerType:"mouse",target:t.target})},n.enable&&(this.wheelSessionUnsubscribe=this.options.wheelSession?.on(()=>{}),this.listen("wheel",!0))}destroy(){this.listen("wheel",!1),this.wheelSessionUnsubscribe?.(),this.wheelSessionUnsubscribe=void 0}enableEventType(t,e){"wheel"===t&&this.options.enable!==e&&(this.options.enable=e,e&&!this.wheelSessionUnsubscribe&&(this.wheelSessionUnsubscribe=this.options.wheelSession?.on(()=>{})),this.listen("wheel",e),e||(this.wheelSessionUnsubscribe?.(),this.wheelSessionUnsubscribe=void 0))}}const A={classificationDelay:32,endDelay:80};class WheelGestureSession{constructor(t,e={}){this.subscriptions=new Map,this.session=null,this.classificationTimer=null,this.endTimer=null,this.pressedControlKeys=new Set,this.listeningForControlKeys=!1,this.handleEvent=t=>{if(!this.hasSubscribers)return"unknown";const e=function(t,e){let n=t.deltaX,i=t.deltaY;1===t.deltaMode&&(n*=40,i*=40);return{event:t,timeStamp:t.timeStamp,deltaX:n,deltaY:i,isControlKeyDown:e}}(t,this.pressedControlKeys.size>0);let n=this.session;if(n&&e.timeStamp-n.lastTimeStamp>=this.options.endDelay){if(this.end(),!this.hasSubscribers)return"unknown";n=null}n?(this.scheduleEnd(),this.addSample(n,e)):(n=this.startPendingSession(e),this.scheduleEnd());let{device:i}=n;return"unknown"===i&&(i=C(n.samples,!1),"unknown"!==i&&this.begin(n,i)),i},this.finishClassification=()=>{if(this.classificationTimer=null,!this.session||"unknown"!==this.session.device)return;const t=this.session,e=C(t.samples,!0);this.begin(t,"unknown"===e?"mouse":e)},this.end=()=>{if(!this.session)return;if("unknown"===this.session.device){const t=this.session,e=C(t.samples,!0);this.begin(t,"unknown"===e?"mouse":e)}if(!this.session)return;const t=this.session;this.emit(i.End,t.lastEvent),this.reset()},this.handleKeyDown=t=>{"Control"===t.key&&this.pressedControlKeys.add(t.code||t.key)},this.handleKeyUp=t=>{"Control"===t.key&&(t.code?this.pressedControlKeys.delete(t.code):this.pressedControlKeys.clear())},this.handleWindowBlur=()=>{this.pressedControlKeys.clear()},this.element=t,this.options={...A,...e},this.element?.addEventListener("wheel",this.handleEvent,{passive:!0})}get hasSubscribers(){return this.subscriptions.size>0}get device(){return this.session?.device??"unknown"}on(t){const e={listener:t};return this.subscriptions.set(t,e),this.updateControlKeyEventListeners(),()=>{this.subscriptions.get(t)===e&&this.off(t)}}off(t){this.subscriptions.delete(t),this.updateControlKeyEventListeners(),this.hasSubscribers||this.reset()}cancel(){const t=this.session;t&&"unknown"!==t.device&&this.emit(i.Cancel,t.lastEvent),this.reset()}destroy(){this.cancel(),this.subscriptions.clear(),this.updateControlKeyEventListeners(),this.element?.removeEventListener("wheel",this.handleEvent)}startPendingSession(t){const e={samples:[t],device:"unknown",firstTimeStamp:t.timeStamp,lastTimeStamp:t.timeStamp,totalDeltaX:t.deltaX,totalDeltaY:t.deltaY,velocityX:0,velocityY:0,lastEvent:t.event};return this.session=e,this.classificationTimer=globalThis.setTimeout(this.finishClassification,this.options.classificationDelay),e}addSample(t,e){if(t.samples.push(e),t.lastTimeStamp=e.timeStamp,t.lastEvent=e.event,t.totalDeltaX+=e.deltaX,t.totalDeltaY+=e.deltaY,"unknown"!==t.device){const n=t.samples[t.samples.length-2],o=e.timeStamp-n.timeStamp;t.velocityX=o>0?e.deltaX/o:0,t.velocityY=o>0?e.deltaY/o:0,this.emit(i.Move,e.event,{velocityX:t.velocityX,velocityY:t.velocityY})}}begin(t,e){t.device=e,this.clearClassificationTimer(),this.emit(i.Start,t.samples[0].event);const n=t.lastTimeStamp-t.firstTimeStamp;t.velocityX=n>0?t.totalDeltaX/n:0,t.velocityY=n>0?t.totalDeltaY/n:0,this.emit(i.Move,t.lastEvent,{velocityX:t.velocityX,velocityY:t.velocityY})}scheduleEnd(){this.clearEndTimer(),this.endTimer=globalThis.setTimeout(this.end,this.options.endDelay)}emit(t,e,n){const o=this.session;if(!o||"unknown"===o.device)return;const r=t===i.Start,s=t===i.End||t===i.Cancel,a=r?o.firstTimeStamp:o.lastTimeStamp,c=r?0:Math.max(0,a-o.firstTimeStamp),l=r?0:o.totalDeltaX,h=r?0:o.totalDeltaY,u=c>0?l/c:0,p=c>0?h/c:0,d=r?0:n?.velocityX??o.velocityX,f=r?0:n?.velocityY??o.velocityY,m={eventType:t,device:o.device,srcEvent:e,timeStamp:a,center:{x:e.clientX,y:e.clientY},deltaX:l,deltaY:h,deltaTime:c,velocity:Math.abs(d)>Math.abs(f)?d:f,velocityX:d,velocityY:f,overallVelocity:Math.abs(u)>Math.abs(p)?u:p,overallVelocityX:u,overallVelocityY:p,isFirst:r,isFinal:s};for(const{listener:t}of[...this.subscriptions.values()])t(m)}reset(){this.clearClassificationTimer(),this.clearEndTimer(),this.session=null}clearClassificationTimer(){null!==this.classificationTimer&&(globalThis.clearTimeout(this.classificationTimer),this.classificationTimer=null)}clearEndTimer(){null!==this.endTimer&&(globalThis.clearTimeout(this.endTimer),this.endTimer=null)}updateControlKeyEventListeners(){const t=this.hasSubscribers,e=function(){if("undefined"!=typeof window)return window;return globalThis.document?.defaultView}();e&&t!==this.listeningForControlKeys&&(this.listeningForControlKeys=t,t?(e.addEventListener("keydown",this.handleKeyDown,!0),e.addEventListener("keyup",this.handleKeyUp,!0),e.addEventListener("blur",this.handleWindowBlur)):(e.removeEventListener("keydown",this.handleKeyDown,!0),e.removeEventListener("keyup",this.handleKeyUp,!0),e.removeEventListener("blur",this.handleWindowBlur),this.pressedControlKeys.clear()))}}function C(t,e){return t.some(({event:t,isControlKeyDown:e})=>t.ctrlKey&&!e)?"trackpad":t.some(({event:t})=>0!==t.deltaMode)||t.some(L)||t.every(({event:t})=>{const e=t.wheelDelta;return void 0!==e&&Math.abs(e)%40==0})?"mouse":t.some(({deltaX:t})=>0!==t)||t.length>1&&function(t){for(let e=0;e<t.length;e++){const n=t[e];if(Math.abs(n.deltaX)>40||Math.abs(n.deltaY)>40)return!1;if(e>0&&n.timeStamp-t[e-1].timeStamp>40)return!1}return!0}(t)?"trackpad":e?"mouse":"unknown"}function L({event:t,deltaX:e,deltaY:n}){if(0!==e||0===n)return!1;const i=Math.abs(n/4.000244140625);if(Number.isInteger(i))return!0;const o=t.wheelDelta;return"number"==typeof o&&0!==o&&o%120==0}const z=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseenter","mouseleave"];class MoveInput extends input_Input{constructor(t,e,n){super(t,e,{enable:!0,...n}),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:i=!1}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,i&&z.forEach(t=>this.listen(t,!0))}destroy(){z.forEach(t=>this.listen(t,!1))}enableEventType(t,e){switch(t){case"pointermove":this.enableMoveEvent!==e&&(this.enableMoveEvent=e,this.listen("mousedown",e),this.listen("mousemove",e),this.listen("mouseup",e));break;case"pointerover":this.enableOverEvent!==e&&(this.enableOverEvent=e,this.listen("mouseover",e));break;case"pointerout":this.enableOutEvent!==e&&(this.enableOutEvent=e,this.listen("mouseout",e));break;case"pointerenter":this.enableEnterEvent!==e&&(this.enableEnterEvent=e,this.listen("mouseenter",e));break;case"pointerleave":this.enableLeaveEvent!==e&&(this.enableLeaveEvent=e,this.listen("mouseleave",e))}}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit("pointerover",t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit("pointerout",t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit("pointerenter",t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit("pointerleave",t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.buttons&&(this.pressed=!1),this.pressed||this._emit("pointermove",t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const N=["keydown","keyup"];class KeyInput extends input_Input{constructor(t,e,n){super(t,e,{enable:!0,tabIndex:0,...n}),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))};const{enable:i=!1}=this.options;this.enableDownEvent=i,this.enableUpEvent=i,t.tabIndex=this.options.tabIndex,t.style.outline="none",i&&N.forEach(t=>this.listen(t,!0))}destroy(){N.forEach(t=>this.listen(t,!1))}enableEventType(t,e){"keydown"===t&&this.enableDownEvent!==e&&(this.enableDownEvent=e,this.listen(t,e)),"keyup"===t&&this.enableUpEvent!==e&&(this.enableUpEvent=e,this.listen(t,e))}}class ContextmenuInput extends input_Input{constructor(t,e,n){n.enable=n.enable??!1,super(t,e,n),this.handleEvent=t=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},n.enable&&this.listen("contextmenu",!0)}destroy(){this.listen("contextmenu",!1)}enableEventType(t,e){"contextmenu"===t&&this.options.enable!==e&&(this.options.enable=e,this.listen("contextmenu",e))}}const k={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function D(t){const e=k[t.srcEvent.type];if(!e)return null;const{buttons:n,button:i}=t.srcEvent;let o=!1,r=!1,s=!1;return 2===e?(o=Boolean(1&n),r=Boolean(4&n),s=Boolean(2&n)):(o=0===i,r=1===i,s=2===i),{leftButton:o,middleButton:r,rightButton:s}}function F(t,e){const n=t.center;if(!n)return null;const i=e.getBoundingClientRect(),o=i.width/e.offsetWidth||1,r=i.height/e.offsetHeight||1;return{center:n,offsetCenter:{x:(n.x-i.left-e.clientLeft)/o,y:(n.y-i.top-e.clientTop)/r}}}const U={srcElement:"root",priority:0};class EventRegistrar{constructor(t,e){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")},this.eventManager=t,this.recognizerName=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,n,i=!1,o=!1){const{handlers:r,handlersByElement:s}=this,a={...U,...n};let c=s.get(a.srcElement);c||(c=[],s.set(a.srcElement,c));const l={type:t,handler:e,srcElement:a.srcElement,priority:a.priority};i&&(l.once=!0),o&&(l.passive=!0),r.push(l),this._active=this._active||!l.passive;let h=c.length-1;for(;h>=0&&!(c[h].priority>=l.priority);)h--;c.splice(h+1,0,l)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let o=n.length-1;o>=0;o--){const r=n[o];if(r.type===t&&r.handler===e){n.splice(o,1);const t=i.get(r.srcElement);t.splice(t.indexOf(r),1),0===t.length&&i.delete(r.srcElement)}}this._active=n.some(t=>!t.passive)}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},o=()=>{t.handled=!0,e=!0},r=[];for(let s=0;s<n.length;s++){const{type:a,handler:c,once:l}=n[s];if(c({...t,type:a,stopPropagation:i,stopImmediatePropagation:o}),l&&r.push(n[s]),e)break}for(let t=0;t<r.length;t++){const{type:e,handler:n}=r[t];this.remove(e,n)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...D(t),...F(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}function W(t){if("recognizer"in t)return t;let e;const n=Array.isArray(t)?[...t]:[t];if("function"==typeof n[0]){e=new(n.shift())(n.shift()||{})}else e=n.shift();return{recognizer:e,recognizeWith:"string"==typeof n[0]?[n[0]]:n[0],requireFailure:"string"==typeof n[1]?[n[1]]:n[1]}}class EventManager{constructor(t=null,e={}){if(this._onBasicInput=t=>{this.manager.emit(t.srcEvent.type,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...e},this.events=new Map,this.element=t,this.wheelSession=new WheelGestureSession(t),t){this.manager=new Manager(t,this.options);for(const t of this.options.recognizers){const{recognizer:e,recognizeWith:n,requireFailure:i}=W(t);this.manager.add(e),n&&e.recognizeWith(n),i&&e.requireFailure(i)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new WheelInput(t,this._onOtherEvent,{enable:!1,wheelSession:this.wheelSession}),this.moveInput=new MoveInput(t,this._onOtherEvent,{enable:!1}),this.keyInput=new KeyInput(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new ContextmenuInput(t,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element?(this.wheelInput.destroy(),this.wheelSession.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy()):this.wheelSession.destroy()}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}emit(t){this.manager?.emit(t.type,t)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);i&&(i.set({enable:e,wheelSession:this.wheelSession}),n.touchAction.update()),this.wheelInput?.enableEventType(t,e),this.moveInput?.enableEventType(t,e),this.keyInput?.enableEventType(t,e),this.contextmenuInput?.enableEventType(t,e)}_addEventHandler(t,e,n,i,o){if("string"!=typeof t){n=e;for(const[e,r]of Object.entries(t))this._addEventHandler(e,r,n,i,o);return}const{manager:r,events:s}=this;if(!r)return;let a=s.get(t);if(!a){const e=this._getRecognizerName(t)||t;a=new EventRegistrar(this,e),s.set(t,a),r&&r.on(t,a.handleEvent)}a.add(t,e,n,i,o),a.isEmpty()||this._toggleRecognizer(a.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const[e,n]of Object.entries(t))this._removeEventHandler(e,n);return}const{events:n}=this,i=n.get(t);if(i&&(i.remove(t,e),i.isEmpty())){const{recognizerName:t}=i;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}_getRecognizerName(t){return this.manager.recognizers.find(e=>e.getEventNames().includes(t))?.options.event}}}}]);
|
|
1
|
+
"use strict";(Array.isArray(globalThis.webpackChunk)?globalThis.webpackChunk:globalThis.webpackChunk=[]).push([[977],{9350(t,e,n){var i=n(3459),o=n(19852);const r={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"};Object.defineProperty(r,"IDENTITY",{get:()=>(i.A.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),r.CARTESIAN)});const s={multipan:[o.uq,{threshold:10,pointers:2,trackpad:!0}],pinch:[o.h1,{trackpad:!0},null,["multipan"]],pan:[o.uq,{threshold:1},["pinch"],["multipan"]],dblclick:[o.Cx,{event:"dblclick",taps:2,enable:!1}],dblclickdrag:[o.Cp,{event:"dblclickdrag",enable:!1},["dblclick"],null],click:[o.Cx,{event:"click"},["dblclickdrag"],["dblclick","dblclickdrag"]]};n.d(e,["Kx",0,{WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},"We",0,s,"p5",0,{common:0,meters:1,pixels:2},"rf",0,r,"tg",0,{click:"onClick",dblclick:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"}])},18742(t,e,n){var i=n(7914);class LayerExtension{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(t){t&&(this.opts=t)}equals(t){return this===t||this.constructor===t.constructor&&(0,i.b)(this.opts,t.opts,1)}getShaders(t){return null}getSubLayerProps(t){const{defaultProps:e}=t.constructor,n={updateTriggers:{}};for(const t in e)if(t in this.props){const i=e[t],o=this.props[t];n[t]=o,i&&"accessor"===i.type&&(n.updateTriggers[t]=this.props.updateTriggers[t],"function"==typeof o&&(n[t]=this.getSubLayerAccessor(o)))}return n}initializeState(t,e){}updateState(t,e){}onNeedsRedraw(t){}getNeedsPickingBuffer(t){return!1}draw(t,e){}finalizeState(t,e){}}LayerExtension.defaultProps={},LayerExtension.extensionName="LayerExtension";const o=LayerExtension;n.d(e,["A",0,o])},98043(t,e,n){n.d(e,{A:()=>LayersPass});class Pass{constructor(t,e={id:"pass"}){const{id:n}=e;this.id=n,this.device=t,this.props={...e}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}}const i={depthWriteEnabled:!0,depthCompare:"less-equal",blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"one-minus-src-alpha",blendAlphaOperation:"add",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one-minus-src-alpha"};class LayersPass extends Pass{constructor(){super(...arguments),this._lastRenderIndex=-1}render(t){this._render(t)}_render(t){const{canvasContext:e=this.device.canvasContext}=t,n=t.target??e.getCurrentFramebuffer(),[i,o]=e.getDrawingBufferSize(),r=t.clearCanvas??!0;let s=t.clearColor??(!!r&&[0,0,0,0]),a=!!r&&1,c=!!r&&0;const l=t.colorMask??15,h={viewport:[0,0,i,o]};t.colorMask&&(h.colorMask=l),t.scissorRect&&(h.scissorRect=t.scissorRect);const{shaderModuleProps:u,viewports:p,views:d,onViewportActive:f,clearStack:m=!0}=t,_=t.pass||"unknown",v="webgpu"===this.device.type;m&&(this._lastRenderIndex=-1);const g=[];if(!p.length){return this.device.beginRenderPass({framebuffer:n,parameters:h,clearColor:s,clearDepth:a,clearStencil:c}).end(),this.device.submit(),g}try{for(const i of p){f?.(i);const o=this._getDrawLayerParams(i,t),r=d&&d[i.id],l=i.subViewports||[i],p=v?l.map(t=>[t]):[l];for(const i of p){const l=this.device.beginRenderPass({framebuffer:n,parameters:h,clearColor:s,clearDepth:a,clearStencil:c});try{for(const s of i){const i=this._drawLayersInViewport(l,{target:n,canvasContext:e,shaderModuleProps:u,viewport:s,view:r,pass:_,layers:t.layers,isPicking:t.isPicking},o);g.push(i)}}finally{l.end(),v&&this.device.submit()}s=!1,a=!1,c=!1}}return g}finally{v||this.device.submit()}}_getDrawLayerParams(t,{layers:e,pass:n,isPicking:r=!1,layerFilter:s,cullRect:a,views:c,effects:l,canvasContext:h=this.device.canvasContext,shaderModuleProps:u},p=!1){const d=[],f=o(this._lastRenderIndex+1),m={layer:e[0],viewport:t,isPicking:r,renderPass:n,cullRect:a},_={};for(let o=0;o<e.length;o++){const r=e[o],a=this._shouldDrawLayer(r,m,s,_),v={shouldDrawLayer:a};if(a&&!p){v.shouldDrawLayer=!0,v.layerRenderIndex=f(r,a),v.shaderModuleProps=this._getShaderModuleProps(r,l,n,h,u);const e="webgpu"===r.context.device.type?i:null;v.layerParameters={...e,...r.context.deck?.props.parameters,...c?.[t.id]?.props.parameters,...this.getLayerParameters(r,o,t)}}d[o]=v}return d}_drawLayersInViewport(t,{layers:e,shaderModuleProps:n,pass:i,target:o,canvasContext:r,viewport:s,view:a,isPicking:c},l){const h=function(t,{canvasContext:e=t.canvasContext,shaderModuleProps:n,target:i,viewport:o}){const r=n?.project?.devicePixelRatio??e.cssToDeviceRatio(),[,s]=e.getDrawingBufferSize(),a=i?i.height:s,c=o;return[c.x*r,a-(c.y+c.height)*r,c.width*r,c.height*r]}(this.device,{canvasContext:r,shaderModuleProps:n,target:o,viewport:s});if(a){const{clear:t,clearColor:e,clearDepth:n,clearStencil:i}=a.props;if(t){let t=[0,0,0,0],r=1,s=0;Array.isArray(e)&&!c?t=[...e.slice(0,3),e[3]||255].map(t=>t/255):!1===e&&(t=!1),void 0!==n&&(r=n),void 0!==i&&(s=i);this.device.beginRenderPass({framebuffer:o,parameters:{viewport:h,scissorRect:h},clearColor:t,clearDepth:r,clearStencil:s}).end()}}const u={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};t.setParameters({viewport:h});for(let n=0;n<e.length;n++){const o=e[n],r=l[n],{shouldDrawLayer:a}=r;if(a&&o.props.pickable&&u.pickableCount++,o.isComposite&&u.compositeCount++,o.isDrawable&&r.shouldDrawLayer){const{layerRenderIndex:e,shaderModuleProps:n,layerParameters:a}=r;u.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,e),n.project&&(n.project.viewport=s),o.context.renderPass=t;try{o._drawLayer({renderPass:t,shaderModuleProps:n,uniforms:{layerIndex:e},parameters:a})}catch(t){o.raiseError(t,`drawing ${o} to ${i}`)}}}return u}shouldDrawLayer(t){return!0}getShaderModuleProps(t,e,n){return null}getLayerParameters(t,e,n){return t.props.parameters}_shouldDrawLayer(t,e,n,i){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;let o=t.parent;for(;o;){if(!o.props.visible||!o.filterSubLayer(e))return!1;e.layer=o,o=o.parent}if(n){const t=e.layer.id;if(t in i||(i[t]=n(e)),!i[t])return!1}return t.activateViewport(e.viewport),!0}_getShaderModuleProps(t,e,n,i,o){const s=i.cssToDeviceRatio(),a=t.internalState?.propsInTransition||t.props,c={layer:a,picking:{isActive:!1},project:{viewport:t.context.viewport,devicePixelRatio:s,modelMatrix:a.modelMatrix,coordinateSystem:a.coordinateSystem,coordinateOrigin:a.coordinateOrigin,autoWrapLongitude:t.wrapLongitude}};if(e)for(const n of e)r(c,n.getShaderModuleProps?.(t,c));for(const e of t.context.defaultShaderModules)e.name in c||(c[e.name]={});return r(c,this.getShaderModuleProps(t,e,c),o)}}function o(t=0,e={}){const n={},i=(r,s)=>{const a=r.props._offset,c=r.id,l=r.parent&&r.parent.id;let h;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||o(e[l],e);h=t(r,s),n[c]=t}else Number.isFinite(a)?(h=a+(e[l]||0),n[c]=null):h=t;return s&&h>=t&&(t=h+1),e[c]=h,h};return i}function r(t,...e){for(const n of e)if(n)for(const e in n)t[e]?Object.assign(t[e],n[e]):t[e]=n[e];return t}},3065(t,e,n){const i="#define SMOOTH_EDGE_RADIUS 0.5",o={name:"geometry",source:"const SMOOTH_EDGE_RADIUS: f32 = 0.5;\n\nstruct VertexGeometry {\n position: vec4<f32>,\n worldPosition: vec3<f32>,\n worldPositionAlt: vec3<f32>,\n normal: vec3<f32>,\n uv: vec2<f32>,\n pickingColor: vec3<f32>,\n};\n\nvar<private> geometry_: VertexGeometry = VertexGeometry(\n vec4<f32>(0.0, 0.0, 1.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec2<f32>(0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0)\n);\n\nstruct FragmentGeometry {\n uv: vec2<f32>,\n};\n\nvar<private> fragmentGeometry: FragmentGeometry;\n\nfn smoothedge(edge: f32, x: f32) -> f32 {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n",vs:`${i}\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n`,fs:`${i}\n\nstruct FragmentGeometry {\n vec2 uv;\n};\nFragmentGeometry geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n`};n.d(e,["A",0,o])},4782(t,e,n){n.d(e,{A:()=>h});var i=n(34938),o=n(3065),r=n(74334),s=n(9350);const a=`${`${["default","lnglat","meter-offsets","lnglat-offsets","cartesian"].map(t=>`const COORDINATE_SYSTEM_${t.toUpperCase().replaceAll("-","_")}: i32 = ${(0,r.LB)(t)};`).join("")}\n${Object.keys(s.Kx).map(t=>`const PROJECTION_MODE_${t}: i32 = ${s.Kx[t]};`).join("")}\n${Object.keys(s.p5).map(t=>`const UNIT_${t.toUpperCase()}: i32 = ${s.p5[t]};`).join("")}\n\nconst TILE_SIZE: f32 = 512.0;\nconst PI: f32 = 3.1415926536;\nconst WORLD_SCALE: f32 = TILE_SIZE / (PI * 2.0);\nconst ZERO_64_LOW: vec3<f32> = vec3<f32>(0.0, 0.0, 0.0);\nconst EARTH_RADIUS: f32 = 6370972.0; // meters\nconst GLOBE_RADIUS: f32 = 256.0;\n\n// -----------------------------------------------------------------------------\n// Uniform block (converted from GLSL uniform block)\n// -----------------------------------------------------------------------------\nstruct ProjectUniforms {\n wrapLongitude: i32,\n coordinateSystem: i32,\n commonUnitsPerMeter: vec3<f32>,\n projectionMode: i32,\n scale: f32,\n commonUnitsPerWorldUnit: vec3<f32>,\n commonUnitsPerWorldUnit2: vec3<f32>,\n center: vec4<f32>,\n modelMatrix: mat4x4<f32>,\n viewProjectionMatrix: mat4x4<f32>,\n viewportSize: vec2<f32>,\n devicePixelRatio: f32,\n focalDistance: f32,\n cameraPosition: vec3<f32>,\n coordinateOrigin: vec3<f32>,\n commonOrigin: vec3<f32>,\n pseudoMeters: i32,\n};\n\n@group(0) @binding(auto)\nvar<uniform> project: ProjectUniforms;\n\n// -----------------------------------------------------------------------------\n// Geometry data shared across the project helpers.\n// The active layer shader is responsible for populating this private module\n// state before calling the project functions below.\n// -----------------------------------------------------------------------------\n\n// Structure to carry additional geometry data used by deck.gl filters.\nstruct Geometry {\n worldPosition: vec3<f32>,\n worldPositionAlt: vec3<f32>,\n position: vec4<f32>,\n normal: vec3<f32>,\n uv: vec2<f32>,\n pickingColor: vec3<f32>,\n};\n\nvar<private> geometry: Geometry;\n`}\n\n// -----------------------------------------------------------------------------\n// Functions\n// -----------------------------------------------------------------------------\n\n// Returns an adjustment factor for commonUnitsPerMeter\nfn _project_size_at_latitude(lat: f32) -> f32 {\n let y = clamp(lat, -89.9, 89.9);\n return 1.0 / cos(radians(y));\n}\n\n// Overloaded version: scales a value in meters at a given latitude.\nfn _project_size_at_latitude_m(meters: f32, lat: f32) -> f32 {\n return meters * project.commonUnitsPerMeter.z * _project_size_at_latitude(lat);\n}\n\n// Computes a non-linear scale factor based on geometry.\n// (Note: This function relies on "geometry" being provided.)\nfn project_size() -> f32 {\n if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n project.pseudoMeters == 0) {\n if (geometry.position.w == 0.0) {\n return _project_size_at_latitude(geometry.worldPosition.y);\n }\n let y: f32 = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n let y2 = y * y;\n let y4 = y2 * y2;\n let y6 = y4 * y2;\n return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n }\n return 1.0;\n}\n\n// Overloads to scale offsets (meters to world units)\nfn project_size_float(meters: f32) -> f32 {\n return meters * project.commonUnitsPerMeter.z * project_size();\n}\n\nfn project_size_vec2(meters: vec2<f32>) -> vec2<f32> {\n return meters * project.commonUnitsPerMeter.xy * project_size();\n}\n\nfn project_size_vec3(meters: vec3<f32>) -> vec3<f32> {\n return meters * project.commonUnitsPerMeter * project_size();\n}\n\nfn project_size_vec4(meters: vec4<f32>) -> vec4<f32> {\n return vec4<f32>(meters.xyz * project.commonUnitsPerMeter, meters.w);\n}\n\n// Returns a rotation matrix aligning the z‑axis with the given up vector.\nfn project_get_orientation_matrix(up: vec3<f32>) -> mat3x3<f32> {\n let uz = normalize(up);\n let ux = select(\n vec3<f32>(1.0, 0.0, 0.0),\n normalize(vec3<f32>(uz.y, -uz.x, 0.0)),\n abs(uz.z) == 1.0\n );\n let uy = cross(uz, ux);\n return mat3x3<f32>(ux, uy, uz);\n}\n\n// Since WGSL does not support "out" parameters, we return a struct.\nstruct RotationResult {\n needsRotation: bool,\n transform: mat3x3<f32>,\n};\n\nfn project_needs_rotation(commonPosition: vec3<f32>) -> RotationResult {\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n return RotationResult(true, project_get_orientation_matrix(commonPosition));\n } else {\n return RotationResult(false, mat3x3<f32>()); // identity alternative if needed\n };\n}\n\n// Projects a normal vector from the current coordinate system to world space.\nfn project_normal(vector: vec3<f32>) -> vec3<f32> {\n let normal_modelspace = project.modelMatrix * vec4<f32>(vector, 0.0);\n var n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);\n let rotResult = project_needs_rotation(geometry.position.xyz);\n if (rotResult.needsRotation) {\n n = rotResult.transform * n;\n }\n return n;\n}\n\n// Applies a scale offset based on y-offset (dy)\nfn project_offset_(offset: vec4<f32>) -> vec4<f32> {\n let dy: f32 = offset.y;\n let commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;\n return vec4<f32>(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\n\n// Projects lng/lat coordinates to a unit tile [0,1]\nfn project_mercator_(lnglat: vec2<f32>) -> vec2<f32> {\n var x = lnglat.x;\n if (project.wrapLongitude != 0) {\n x = ((x + 180.0) % 360.0) - 180.0;\n }\n let y = clamp(lnglat.y, -89.9, 89.9);\n return vec2<f32>(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// Projects lng/lat/z coordinates for a globe projection.\nfn project_globe_(lnglatz: vec3<f32>) -> vec3<f32> {\n let lambda = radians(lnglatz.x);\n let phi = radians(lnglatz.y);\n let cosPhi = cos(phi);\n let D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n return vec3<f32>(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\n\n// Mercator y of project_mercator_'s latitude clamp: log(tan(PI / 4 + radians(89.9) / 2))\nconst MAX_MERCATOR_Y: f32 = 7.0439589847;\n\n// Inverse of project_globe_ followed by project_mercator_, without forming lat/lng:\n// Mercator y = atanh(sin(lat)) = log((D + |z|) / |xy|), which stays accurate near the poles\nfn project_globe_to_mercator_(spherePos: vec3<f32>) -> vec2<f32> {\n let D = length(spherePos);\n let h = max(length(spherePos.xy), 1e-20);\n let y = sign(spherePos.z) * min(log((D + abs(spherePos.z)) / h), MAX_MERCATOR_Y);\n let x = atan2(spherePos.x, -spherePos.y);\n return (vec2<f32>(x, y) + PI) * WORLD_SCALE;\n}\n\n// Flat common space (Mercator or cartesian) of a common position; identity except under GLOBE.\n// WGSL has no function overloading: pass position.xyz for a vec4. See project.glsl.ts.\nfn project_common_position_to_flat(commonPosition: vec3<f32>) -> vec2<f32> {\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n return project_globe_to_mercator_(commonPosition);\n }\n return commonPosition.xy;\n}\n\n// World copy of a flat x nearest to referenceX\nfn project_wrap_flat_x_(x: f32, referenceX: f32) -> f32 {\n return x - TILE_SIZE * floor((x - referenceX) / TILE_SIZE + 0.5);\n}\n\n// Flat position in the world copy nearest to referenceX (e.g. a bounds centre); geospatial only\nfn project_common_position_to_flat_wrapped(commonPosition: vec3<f32>, referenceX: f32) -> vec2<f32> {\n var flatPosition = project_common_position_to_flat(commonPosition);\n if (project.projectionMode != PROJECTION_MODE_IDENTITY) {\n flatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n }\n return flatPosition;\n}\n\n// Flat position continuous across the antimeridian under GLOBE (seam moved opposite referenceX,\n// e.g. the camera); identity for flat modes. For periodic patterns.\nfn project_common_position_to_flat_continuous(commonPosition: vec3<f32>, referenceX: f32) -> vec2<f32> {\n var flatPosition = project_common_position_to_flat(commonPosition);\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n flatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n }\n return flatPosition;\n}\n\n// Projects positions (with an optional 64-bit low part) from the input\n// coordinate system to the common space.\nfn project_position_vec4_f64(position: vec4<f32>, position64Low: vec3<f32>) -> vec4<f32> {\n var position_world = project.modelMatrix * position;\n\n // Work around for a Mac+NVIDIA bug:\n if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4<f32>(\n project_mercator_(position_world.xy),\n _project_size_at_latitude_m(position_world.z, position_world.y),\n position_world.w\n );\n }\n if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world = vec4f(position_world.xyz + project.coordinateOrigin, position_world.w);\n }\n }\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4<f32>(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n if (project.coordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS) {\n let enuMatrix = project_get_orientation_matrix(project.commonOrigin);\n let metersToCommon = GLOBE_RADIUS / EARTH_RADIUS;\n let offsetCommon = (enuMatrix * vec3<f32>(-position_world.x, -position_world.y, position_world.z)) * metersToCommon;\n return vec4<f32>(project.commonOrigin + offsetCommon, position_world.w);\n }\n }\n if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {\n return vec4<f32>(\n project_mercator_(position_world.xy) - project.commonOrigin.xy,\n project_size_float(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project.projectionMode == PROJECTION_MODE_IDENTITY ||\n (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world = vec4f(position_world.xyz - project.coordinateOrigin, position_world.w);\n }\n\n return project_offset_(position_world) +\n project_offset_(project.modelMatrix * vec4<f32>(position64Low, 0.0));\n}\n\n// Overloaded versions for different input types.\nfn project_position_vec4_f32(position: vec4<f32>) -> vec4<f32> {\n return project_position_vec4_f64(position, ZERO_64_LOW);\n}\n\nfn project_position_vec3_f64(position: vec3<f32>, position64Low: vec3<f32>) -> vec3<f32> {\n let projected_position = project_position_vec4_f64(vec4<f32>(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nfn project_position_vec3_f32(position: vec3<f32>) -> vec3<f32> {\n let projected_position = project_position_vec4_f64(vec4<f32>(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nfn project_position_vec2_f32(position: vec2<f32>) -> vec2<f32> {\n let projected_position = project_position_vec4_f64(vec4<f32>(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\n// Transforms a common space position to clip space.\nfn project_common_position_to_clipspace_with_projection(position: vec4<f32>, viewProjectionMatrix: mat4x4<f32>, center: vec4<f32>) -> vec4<f32> {\n var clipPosition = viewProjectionMatrix * position + center;\n // deck.gl projection matrices use WebGL's [-w, w] depth range; WebGPU clips z to [0, w].\n clipPosition.z = (clipPosition.z + clipPosition.w) * 0.5;\n return clipPosition;\n}\n\n// Uses the project viewProjectionMatrix and center.\nfn project_common_position_to_clipspace(position: vec4<f32>) -> vec4<f32> {\n return project_common_position_to_clipspace_with_projection(position, project.viewProjectionMatrix, project.center);\n}\n\n// Returns a clip space offset corresponding to a given number of screen pixels.\nfn project_pixel_size_to_clipspace(pixels: vec2<f32>) -> vec2<f32> {\n let offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;\n return offset * project.focalDistance;\n}\n\nfn project_meter_size_to_pixel(meters: f32) -> f32 {\n return project_size_float(meters) * project.scale;\n}\n\nfn project_unit_size_to_pixel(size: f32, unit: i32) -> f32 {\n if (unit == UNIT_METERS) {\n return project_meter_size_to_pixel(size);\n } else if (unit == UNIT_COMMON) {\n return size * project.scale;\n }\n // UNIT_PIXELS: no scaling applied.\n return size;\n}\n\nfn project_pixel_size_float(pixels: f32) -> f32 {\n return pixels / project.scale;\n}\n\nfn project_pixel_size_vec2(pixels: vec2<f32>) -> vec2<f32> {\n return pixels / project.scale;\n}\n`,c=`${["default","lnglat","meter-offsets","lnglat-offsets","cartesian"].map(t=>`const int COORDINATE_SYSTEM_${t.toUpperCase().replaceAll("-","_")} = ${(0,r.LB)(t)};`).join("")}\n${Object.keys(s.Kx).map(t=>`const int PROJECTION_MODE_${t} = ${s.Kx[t]};`).join("")}\n${Object.keys(s.p5).map(t=>`const int UNIT_${t.toUpperCase()} = ${s.p5[t]};`).join("")}\nlayout(std140) uniform projectUniforms {\nbool wrapLongitude;\nint coordinateSystem;\nvec3 commonUnitsPerMeter;\nint projectionMode;\nfloat scale;\nvec3 commonUnitsPerWorldUnit;\nvec3 commonUnitsPerWorldUnit2;\nvec4 center;\nmat4 modelMatrix;\nmat4 viewProjectionMatrix;\nvec2 viewportSize;\nfloat devicePixelRatio;\nfloat focalDistance;\nvec3 cameraPosition;\nvec3 coordinateOrigin;\nvec3 commonOrigin;\nbool pseudoMeters;\n} project;\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size_at_latitude(float lat) {\nfloat y = clamp(lat, -89.9, 89.9);\nreturn 1.0 / cos(radians(y));\n}\nfloat project_size() {\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&\nproject.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\nproject.pseudoMeters == false) {\nif (geometry.position.w == 0.0) {\nreturn project_size_at_latitude(geometry.worldPosition.y);\n}\nfloat y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\nfloat y2 = y * y;\nfloat y4 = y2 * y2;\nfloat y6 = y4 * y2;\nreturn 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n}\nreturn 1.0;\n}\nfloat project_size_at_latitude(float meters, float lat) {\nreturn meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat);\n}\nfloat project_size(float meters) {\nreturn meters * project.commonUnitsPerMeter.z * project_size();\n}\nvec2 project_size(vec2 meters) {\nreturn meters * project.commonUnitsPerMeter.xy * project_size();\n}\nvec3 project_size(vec3 meters) {\nreturn meters * project.commonUnitsPerMeter * project_size();\n}\nvec4 project_size(vec4 meters) {\nreturn vec4(meters.xyz * project.commonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\nvec3 uz = normalize(up);\nvec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\nvec3 uy = cross(uz, ux);\nreturn mat3(ux, uy, uz);\n}\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\ntransform = project_get_orientation_matrix(commonPosition);\nreturn true;\n}\nreturn false;\n}\nvec3 project_normal(vec3 vector) {\nvec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0);\nvec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);\nmat3 rotation;\nif (project_needs_rotation(geometry.position.xyz, rotation)) {\nn = rotation * n;\n}\nreturn n;\n}\nvec4 project_offset_(vec4 offset) {\nfloat dy = offset.y;\nvec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;\nreturn vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\nfloat x = lnglat.x;\nif (project.wrapLongitude) {\nx = mod(x + 180., 360.0) - 180.;\n}\nfloat y = clamp(lnglat.y, -89.9, 89.9);\nreturn vec2(\nradians(x) + PI,\nPI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n) * WORLD_SCALE;\n}\nvec3 project_globe_(vec3 lnglatz) {\nfloat lambda = radians(lnglatz.x);\nfloat phi = radians(lnglatz.y);\nfloat cosPhi = cos(phi);\nfloat D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\nreturn vec3(\nsin(lambda) * cosPhi,\n-cos(lambda) * cosPhi,\nsin(phi)\n) * D;\n}\nconst float MAX_MERCATOR_Y = 7.0439589847;\nvec2 project_globe_to_mercator_(vec3 spherePos) {\nfloat D = length(spherePos);\nfloat h = max(length(spherePos.xy), 1e-20);\nfloat y = sign(spherePos.z) * min(log((D + abs(spherePos.z)) / h), MAX_MERCATOR_Y);\nfloat x = atan(spherePos.x, -spherePos.y);\nreturn (vec2(x, y) + PI) * WORLD_SCALE;\n}\nvec2 project_common_position_to_flat(vec3 commonPosition) {\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\nreturn project_globe_to_mercator_(commonPosition);\n}\nreturn commonPosition.xy;\n}\nvec2 project_common_position_to_flat(vec4 commonPosition) {\nreturn project_common_position_to_flat(commonPosition.xyz);\n}\nfloat project_wrap_flat_x_(float x, float referenceX) {\nreturn x - TILE_SIZE * floor((x - referenceX) / TILE_SIZE + 0.5);\n}\nvec2 project_common_position_to_flat_wrapped(vec3 commonPosition, float referenceX) {\nvec2 flatPosition = project_common_position_to_flat(commonPosition);\nif (project.projectionMode != PROJECTION_MODE_IDENTITY) {\nflatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n}\nreturn flatPosition;\n}\nvec2 project_common_position_to_flat_wrapped(vec4 commonPosition, float referenceX) {\nreturn project_common_position_to_flat_wrapped(commonPosition.xyz, referenceX);\n}\nvec2 project_common_position_to_flat_continuous(vec3 commonPosition, float referenceX) {\nvec2 flatPosition = project_common_position_to_flat(commonPosition);\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\nflatPosition.x = project_wrap_flat_x_(flatPosition.x, referenceX);\n}\nreturn flatPosition;\n}\nvec2 project_common_position_to_flat_continuous(vec4 commonPosition, float referenceX) {\nreturn project_common_position_to_flat_continuous(commonPosition.xyz, referenceX);\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\nvec4 position_world = project.modelMatrix * position;\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_mercator_(position_world.xy),\nproject_size_at_latitude(position_world.z, position_world.y),\nposition_world.w\n);\n}\nif (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\nposition_world.xyz += project.coordinateOrigin;\n}\n}\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_globe_(position_world.xyz),\nposition_world.w\n);\n}\nif (project.coordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS) {\nmat3 enuMatrix = project_get_orientation_matrix(project.commonOrigin);\nfloat metersToCommon = GLOBE_RADIUS / EARTH_RADIUS;\nvec3 offsetCommon = (enuMatrix * vec3(-position_world.xy, position_world.z)) * metersToCommon;\nreturn vec4(project.commonOrigin + offsetCommon, position_world.w);\n}\n}\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nif (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nif (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {\nreturn vec4(\nproject_mercator_(position_world.xy) - project.commonOrigin.xy,\nproject_size(position_world.z),\nposition_world.w\n);\n}\n}\n}\nif (project.projectionMode == PROJECTION_MODE_IDENTITY ||\n(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\nproject.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\nposition_world.xyz -= project.coordinateOrigin;\n}\nreturn project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0));\n}\nvec4 project_position(vec4 position) {\nreturn project_position(position, ZERO_64_LOW);\n}\nvec3 project_position(vec3 position, vec3 position64Low) {\nvec4 projected_position = project_position(vec4(position, 1.0), position64Low);\nreturn projected_position.xyz;\n}\nvec3 project_position(vec3 position) {\nvec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\nreturn projected_position.xyz;\n}\nvec2 project_position(vec2 position) {\nvec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\nreturn projected_position.xy;\n}\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\nreturn viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\nreturn project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\nvec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;\nreturn offset * project.focalDistance;\n}\nfloat project_size_to_pixel(float meters) {\nreturn project_size(meters) * project.scale;\n}\nvec2 project_size_to_pixel(vec2 meters) {\nreturn project_size(meters) * project.scale;\n}\nfloat project_size_to_pixel(float size, int unit) {\nif (unit == UNIT_METERS) return project_size_to_pixel(size);\nif (unit == UNIT_COMMON) return size * project.scale;\nreturn size;\n}\nfloat project_pixel_size(float pixels) {\nreturn pixels / project.scale;\n}\nvec2 project_pixel_size(vec2 pixels) {\nreturn pixels / project.scale;\n}\n`,l={};const h={name:"project",dependencies:[i.i,o.A],source:a,vs:c,getUniforms:function(t=l){return"viewport"in t?(0,r.aY)(t):{}},uniformTypes:{wrapLongitude:"f32",coordinateSystem:"i32",commonUnitsPerMeter:"vec3<f32>",projectionMode:"i32",scale:"f32",commonUnitsPerWorldUnit:"vec3<f32>",commonUnitsPerWorldUnit2:"vec3<f32>",center:"vec4<f32>",modelMatrix:"mat4x4<f32>",viewProjectionMatrix:"mat4x4<f32>",viewportSize:"vec2<f32>",devicePixelRatio:"f32",focalDistance:"f32",cameraPosition:"vec3<f32>",coordinateOrigin:"vec3<f32>",commonOrigin:"vec3<f32>",pseudoMeters:"f32"}}},74334(t,e,n){n.d(e,{LB:()=>d,aY:()=>_,ow:()=>m});var i=n(90218),o=n(39426),r=n(9350),s=n(82417);const a=[0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=[0,0,0],u=[0,0,0],p={default:-1,cartesian:0,lnglat:1,"meter-offsets":2,"lnglat-offsets":3};function d(t){const e=p[t];if(void 0===e)throw new Error(`Invalid coordinateSystem: ${t}`);return e}const f=(0,s.A)(function({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:s}){const{projectionCenter:u,viewProjectionMatrix:p,originCommon:f,cameraPosCommon:_,shaderCoordinateOrigin:v,geospatialOrigin:g}=function(t,e,n){const{viewMatrixUncentered:r,projectionMatrix:s}=t;let{viewMatrix:l,viewProjectionMatrix:h}=t,u=a,p=a,d=t.cameraPosition;const{geospatialOrigin:f,shaderCoordinateOrigin:_,offsetMode:v}=m(t,e,n);v&&(p=t.projectPosition(f||_),d=[d[0]-p[0],d[1]-p[1],d[2]-p[2]],p[3]=1,u=o.Z0([],p,h),l=r||l,h=i.lw([],s,l),h=i.lw([],h,c));return{viewMatrix:l,viewProjectionMatrix:h,projectionCenter:u,originCommon:p,cameraPosCommon:d,shaderCoordinateOrigin:_,geospatialOrigin:f}}(t,n,s),E=t.getDistanceScales(),y=[t.width*e,t.height*e],M=o.Z0([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,b={coordinateSystem:d(n),projectionMode:t.projectionMode,coordinateOrigin:v,commonOrigin:f.slice(0,3),center:u,pseudoMeters:Boolean(t._pseudoMeters),viewportSize:y,devicePixelRatio:e,focalDistance:M,commonUnitsPerMeter:E.unitsPerMeter,commonUnitsPerWorldUnit:E.unitsPerMeter,commonUnitsPerWorldUnit2:h,scale:t.scale,wrapLongitude:!1,viewProjectionMatrix:p,modelMatrix:l,cameraPosition:_};if(g){const e=t.getDistanceScales(g);switch(n){case"meter-offsets":b.commonUnitsPerWorldUnit=e.unitsPerMeter,b.commonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case"lnglat":case"lnglat-offsets":t._pseudoMeters||(b.commonUnitsPerMeter=e.unitsPerMeter),b.commonUnitsPerWorldUnit=e.unitsPerDegree,b.commonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case"cartesian":b.commonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],b.commonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}if(t.projectionMode===r.Kx.GLOBE&&"meter-offsets"===n){const t=6370972,e=256,n=s[0]*Math.PI/180,i=s[1]*Math.PI/180,o=Math.cos(i),r=((s[2]||0)/t+1)*e;b.commonOrigin=[Math.sin(n)*o*r,-Math.cos(n)*o*r,Math.sin(i)*r]}return b});function m(t,e,n=u){n.length<3&&(n=[n[0],n[1],0]);let i,o=n,s=!0;switch(i="lnglat-offsets"===e||"meter-offsets"===e?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case r.Kx.WEB_MERCATOR:"lnglat"===e?(i=[0,0,0],s=!1):"cartesian"===e&&(s=!1,i=t.unprojectPosition([Math.fround(t.center[0]),Math.fround(t.center[1]),0]));break;case r.Kx.WEB_MERCATOR_AUTO_OFFSET:"lnglat"===e?o=i:"cartesian"===e&&(o=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(o),o[0]-=n[0],o[1]-=n[1],o[2]-=n[2]);break;case r.Kx.IDENTITY:o=t.position.map(Math.fround),o[2]=o[2]||0;break;case r.Kx.GLOBE:s=!1,i=null;break;default:s=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:o,offsetMode:s}}function _({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:i="default",coordinateOrigin:o=u,autoWrapLongitude:r=!1}){"default"===i&&(i=t.isGeospatial?"lnglat":"cartesian");const s=f({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:o});return s.wrapLongitude=r,s.modelMatrix=n||l,s}},7914(t,e,n){function i(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!i(t[o],e[o],n-1))return!1;return!0}if(Array.isArray(e))return!1;if("object"==typeof t&&"object"==typeof e){const o=Object.keys(t),r=Object.keys(e);if(o.length!==r.length)return!1;for(const r of o){if(!e.hasOwnProperty(r))return!1;if(!i(t[r],e[r],n-1))return!1}return!0}return!1}n.d(e,{b:()=>i})},3459(t,e,n){const i=new(n(60776).h)({id:"deck"});n.d(e,["A",0,i])},25667(t,e,n){n.d(e,{$M:()=>r,Vl:()=>a,_Z:()=>f,cT:()=>d,on:()=>c,zi:()=>s});var i=n(23459),o=n(87597);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t,e){const n=t%e;return n<0?e+n:n}function a(t){return[t[12],t[13],t[14]]}function c(t){return{left:h(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:h(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:h(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:h(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:h(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:h(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const l=new o.P;function h(t,e,n,i){l.set(t,e,n);const r=l.len();return{distance:i/r,normal:new o.P(-t/r,-e/r,-n/r)}}function u(t){return t-Math.fround(t)}let p;function d(t,e){const{size:n=1,startIndex:o=0}=e,r=void 0!==e.endIndex?e.endIndex:t.length,s=(r-o)/n;p=i.A.allocate(p,s,{type:Float32Array,size:2*n});let a=o,c=0;for(;a<r;){for(let e=0;e<n;e++){const i=t[a++];p[c+e]=i,p[c+e+n]=u(i)}c+=2*n}return p.subarray(0,s*n*2)}function f(t){let e=null,n=!1;for(const i of t)i&&(e?(n||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=!0),e[0][0]=Math.min(e[0][0],i[0][0]),e[0][1]=Math.min(e[0][1],i[0][1]),e[1][0]=Math.max(e[1][0],i[1][0]),e[1][1]=Math.max(e[1][1],i[1][1])):e=i);return e}},82417(t,e,n){function i(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}return!1}function o(t){let e,n={};return o=>{for(const r in o)if(!i(o[r],n[r])){e=t(o),n=o;break}return e}}n.d(e,{A:()=>o})},66540(t,e,n){function i(t,e){if(!e)return t;const n={...t,...e};if("defines"in e&&(n.defines={...t.defines,...e.defines}),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(t=>"project64"===t.name))){const t=n.modules.findIndex(t=>"project32"===t.name);t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i={...t.inject};for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}n.d(e,{n:()=>i})},23459(t,e,n){const i=new class TypedArrayManager{constructor(t={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,e,{size:n=1,type:i,padding:o=0,copy:r=!1,initialize:s=!1,maxCount:a}){const c=i||t&&t.constructor||Float32Array,l=e*n+o;if(ArrayBuffer.isView(t)){if(l<=t.length)return t;if(l*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new c(t.buffer,0,l)}let h=1/0;a&&(h=a*n+o);const u=this._allocate(c,l,s,h);return t&&r?u.set(t):s||u.fill(0,0,4),this._release(t),u}release(t){this._release(t)}_allocate(t,e,n,i){let o=Math.max(Math.ceil(e*this.opts.overAlloc),1);o>i&&(o=i);const r=this._pool,s=t.BYTES_PER_ELEMENT*o,a=r.findIndex(t=>t.byteLength>=s);if(a>=0){const e=new t(r.splice(a,1)[0],0,o);return n&&e.fill(0),e}return new t(o)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,o=e.findIndex(t=>t.byteLength>=i);o<0?e.push(n):(o>0||e.length<this.opts.poolSize)&&e.splice(o,0,n),e.length>this.opts.poolSize&&e.shift()}};n.d(e,["A",0,i])},47345(t,e,n){var i=n(3459),o=n(25667),r=n(87597),s=n(31886),a=n(54901),c=n(90218),l=n(45249),h=n(9350);const u=Math.PI/180,p=(0,o.$M)(),d=[0,0,0],f={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class Viewport{constructor(t={}){this._frustumPlanes={},this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||f,this.focalDistance=t.focalDistance||1,this.position=t.position||d,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:n}=t;this.isGeospatial=Number.isFinite(n)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?h.Kx.WEB_MERCATOR:h.Kx.WEB_MERCATOR_AUTO_OFFSET:h.Kx.IDENTITY}equals(t){return t instanceof Viewport&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&t.projectionMode===this.projectionMode&&t.resolution===this.resolution&&(0,a.aI)(t.distanceScales.unitsPerMeter,this.distanceScales.unitsPerMeter)&&(0,a.aI)(t.projectionMatrix,this.projectionMatrix)&&(0,a.aI)(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const n=this.projectPosition(t),i=(0,l.VJ)(n,this.pixelProjectionMatrix),[o,r]=i,s=e?r:this.height-r;return 2===t.length?[o,s]:[o,s,i[2]]}unproject(t,{topLeft:e=!0,targetZ:n}={}){const[i,o,r]=t,s=e?o:this.height-o,a=n&&n*this.distanceScales.unitsPerMeter[2],c=(0,l.xJ)([i,s,r],this.pixelUnprojectionMatrix,a),[h,u,p]=this.unprojectPosition(c);return Number.isFinite(r)?[h,u,p]:Number.isFinite(n)?[h,u,n]:[h,u]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=(0,l.Gw)(t);return e[1]=(0,a.qE)(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?(0,l.iV)(t):t}getBounds(t={}){const e={targetZ:t.z||0},n=this.unproject([0,0],e),i=this.unproject([this.width,0],e),o=this.unproject([0,this.height],e),r=this.unproject([this.width,this.height],e);return[Math.min(n[0],i[0],o[0],r[0]),Math.min(n[1],i[1],o[1],r[1]),Math.max(n[0],i[0],o[0],r[0]),Math.max(n[1],i[1],o[1],r[1])]}getDistanceScales(t){return t&&this.isGeospatial?(0,l.nI)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:n=1,height:i=1}){return t<this.x+this.width&&this.x<t+n&&e<this.y+this.height&&this.y<e+i}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,(0,o.on)(this.viewProjectionMatrix)),this._frustumPlanes}panByPosition(t,e,n){return null}_initProps(t){const e=t.longitude,n=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=(0,l.fO)({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||(0,l.nI)({latitude:n,longitude:e}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:o,modelMatrix:a}=t;let c=d;if(o&&(c=a?new s.k(a).transformAsVector(o,[]):o),this.isGeospatial){const t=this.projectPosition([e,n,0]);this.center=new r.P(c).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(c)}_initMatrices(t){const{viewMatrix:e=p,projectionMatrix:n=null,orthographic:l=!1,fovyRadians:h,fovy:d=75,near:f=.1,far:m=1e3,padding:_=null,focalDistance:v=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new s.k).multiplyRight(e).translate(new r.P(this.center).negate()),this.projectionMatrix=n||function({width:t,height:e,orthographic:n,fovyRadians:i,focalDistance:o,padding:r,near:c,far:l}){const h=t/e,u=n?(new s.k).orthographic({fovy:i,aspect:h,focalDistance:o,near:c,far:l}):(new s.k).perspective({fovy:i,aspect:h,near:c,far:l});if(r){const{left:n=0,right:i=0,top:o=0,bottom:s=0}=r,c=(0,a.qE)((n+t-i)/2,0,t)-t/2,l=(0,a.qE)((o+e-s)/2,0,e)-e/2;u[8]-=2*c/t,u[9]+=2*l/e}return u}({width:this.width,height:this.height,orthographic:l,fovyRadians:h||d*u,focalDistance:v,padding:_,near:f,far:m});const g=(0,o.$M)();c.lw(g,g,this.projectionMatrix),c.lw(g,g,this.viewMatrix),this.viewProjectionMatrix=g,this.viewMatrixInverse=c.B8([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=(0,o.Vl)(this.viewMatrixInverse);const E=(0,o.$M)(),y=(0,o.$M)();c.hs(E,E,[this.width/2,-this.height/2,1]),c.Tl(E,E,[1,-1,0]),c.lw(y,E,this.viewProjectionMatrix),this.pixelProjectionMatrix=y,this.pixelUnprojectionMatrix=c.B8((0,o.$M)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||i.A.warn("Pixel project matrix not invertible")()}}Viewport.displayName="Viewport";const m=Viewport;n.d(e,["A",0,m])},69502(t,e,n){var i=n(47345),o=n(45249),r=n(31886),s=n(54901),a=n(83588);class WebMercatorViewport extends i.A{constructor(t={}){const{latitude:e=0,longitude:n=0,zoom:i=0,pitch:a=0,bearing:c=0,nearZMultiplier:l=.1,farZMultiplier:h=1.01,nearZ:u,farZ:p,orthographic:d=!1,projectionMatrix:f,repeat:m=!1,worldOffset:_=0,position:v,padding:g,legacyMeterSizes:E=!1}=t;let{width:y,height:M,altitude:b=1.5}=t;const T=Math.pow(2,i);let P;y=y||1,M=M||1;let w=null;if(f)b=f[5]/2,P=(0,o.Os)(b);else{let n;if(t.fovy?(P=t.fovy,b=(0,o.wZ)(P)):P=(0,o.Os)(b),g){const{top:t=0,bottom:e=0}=g;n=[0,(0,s.qE)((t+M-e)/2,0,M)-M/2]}w=(0,o.om)({width:y,height:M,scale:T,center:v&&[0,0,v[2]*(0,o.mY)(e)],offset:n,pitch:a,fovy:P,nearZMultiplier:l,farZMultiplier:h}),Number.isFinite(u)&&(w.near=u),Number.isFinite(p)&&(w.far=p)}let S=(0,o.rY)({height:M,pitch:a,bearing:c,scale:T,altitude:b});if(_){S=(new r.k).translate([512*_,0,0]).multiplyLeft(S)}super({...t,width:y,height:M,viewMatrix:S,longitude:n,latitude:e,zoom:i,...w,fovy:P,focalDistance:b}),this.latitude=e,this.longitude=n,this.zoom=i,this.pitch=a,this.bearing=c,this.altitude=b,this.fovy=P,this.orthographic=d,this._subViewports=m?[]:null,this._pseudoMeters=E,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),n=Math.ceil((t[2]-180)/360);for(let t=e;t<=n;t++){const e=t?new WebMercatorViewport({...this,worldOffset:t}):this;this._subViewports.push(e)}}return this._subViewports}equals(t){return t instanceof WebMercatorViewport&&t._pseudoMeters===this._pseudoMeters&&super.equals(t)}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*(0,o.mY)(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)/(0,o.mY)(n)]}addMetersToLngLat(t,e){return(0,o.dT)(t,e)}panByPosition(t,e,n){const i=(0,o.xJ)(e,this.pixelUnprojectionMatrix),r=this.projectFlat(t),s=a.WQ([],r,a.ze([],i)),c=a.WQ([],this.center,s),[l,h]=this.unprojectFlat(c);return{longitude:l,latitude:h}}panByPosition3D(t,e){const n=t[2]||0,i=a.jb([],t,this.unproject(e,{targetZ:n}));return{longitude:this.longitude+i[0],latitude:this.latitude+i[1]}}getBounds(t={}){const e=(0,o.gW)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t,e={}){const{width:n,height:i}=this,{longitude:r,latitude:s,zoom:a}=(0,o.Fe)({width:n,height:i,bounds:t,...e});return new WebMercatorViewport({width:n,height:i,longitude:r,latitude:s,zoom:a})}}WebMercatorViewport.displayName="WebMercatorViewport";const c=WebMercatorViewport;n.d(e,["A",0,c])},34938(t,e,n){const i={name:"fp32",source:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst FP32_TWO_PI: f32 = 6.2831854820251465;\nconst FP32_PI_2: f32 = 1.5707963705062866;\nconst FP32_PI_16: f32 = 0.1963495463132858;\n\nconst FP32_SIN_TABLE_0: f32 = 0.19509032368659973;\nconst FP32_SIN_TABLE_1: f32 = 0.3826834261417389;\nconst FP32_SIN_TABLE_2: f32 = 0.5555702447891235;\nconst FP32_SIN_TABLE_3: f32 = 0.7071067690849304;\n\nconst FP32_COS_TABLE_0: f32 = 0.9807852506637573;\nconst FP32_COS_TABLE_1: f32 = 0.9238795042037964;\nconst FP32_COS_TABLE_2: f32 = 0.8314695954322815;\nconst FP32_COS_TABLE_3: f32 = 0.7071067690849304;\n\nconst FP32_INVERSE_FACTORIAL_3: f32 = 1.666666716337204e-01;\nconst FP32_INVERSE_FACTORIAL_5: f32 = 8.333333767950535e-03;\nconst FP32_INVERSE_FACTORIAL_7: f32 = 1.9841270113829523e-04;\nconst FP32_INVERSE_FACTORIAL_9: f32 = 2.75573188446287533e-06;\nconst FP32_OVERFLOW: f32 = 3.402823466e+38;\n\nfn sin_taylor_fp32(a: f32) -> f32 {\n if (a == 0.0) {\n return 0.0;\n }\n\n let x = -a * a;\n var sum = a;\n var term = a;\n\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_3;\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_5;\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_7;\n term = term * x;\n sum = sum + term * FP32_INVERSE_FACTORIAL_9;\n\n return sum;\n}\n\nfn tan_taylor_fp32(a: f32) -> f32 {\n if (a == 0.0) {\n return 0.0;\n }\n\n let z = floor(a / FP32_TWO_PI);\n let reduced = a - FP32_TWO_PI * z;\n\n var quadrantValue = floor(reduced / FP32_PI_2 + 0.5);\n let quadrant = i32(quadrantValue);\n if (quadrant < -2 || quadrant > 2) {\n return FP32_OVERFLOW;\n }\n\n var angle = reduced - FP32_PI_2 * quadrantValue;\n quadrantValue = floor(angle / FP32_PI_16 + 0.5);\n let tableIndex = i32(quadrantValue);\n let absoluteTableIndex = abs(tableIndex);\n if (absoluteTableIndex > 4) {\n return FP32_OVERFLOW;\n }\n\n angle = angle - FP32_PI_16 * quadrantValue;\n let sinAngle = sin_taylor_fp32(angle);\n let cosAngle = sqrt(1.0 - sinAngle * sinAngle);\n\n var tableCos = 0.0;\n var tableSin = 0.0;\n if (absoluteTableIndex == 1) {\n tableCos = FP32_COS_TABLE_0;\n tableSin = FP32_SIN_TABLE_0;\n } else if (absoluteTableIndex == 2) {\n tableCos = FP32_COS_TABLE_1;\n tableSin = FP32_SIN_TABLE_1;\n } else if (absoluteTableIndex == 3) {\n tableCos = FP32_COS_TABLE_2;\n tableSin = FP32_SIN_TABLE_2;\n } else if (absoluteTableIndex == 4) {\n tableCos = FP32_COS_TABLE_3;\n tableSin = FP32_SIN_TABLE_3;\n }\n\n var sinReduced = sinAngle;\n var cosReduced = cosAngle;\n if (tableIndex > 0) {\n sinReduced = tableCos * sinAngle + tableSin * cosAngle;\n cosReduced = tableCos * cosAngle - tableSin * sinAngle;\n } else if (tableIndex < 0) {\n sinReduced = tableCos * sinAngle - tableSin * cosAngle;\n cosReduced = tableCos * cosAngle + tableSin * sinAngle;\n }\n\n var sinValue = 0.0;\n var cosValue = 0.0;\n if (quadrant == 0) {\n sinValue = sinReduced;\n cosValue = cosReduced;\n } else if (quadrant == 1) {\n sinValue = cosReduced;\n cosValue = -sinReduced;\n } else if (quadrant == -1) {\n sinValue = -cosReduced;\n cosValue = sinReduced;\n } else {\n sinValue = -sinReduced;\n cosValue = -cosReduced;\n }\n\n return sinValue / cosValue;\n}\n\nfn tan_fp32(a: f32) -> f32 {\n return tan_taylor_fp32(a);\n}\n#else\nfn tan_fp32(a: f32) -> f32 {\n return tan(a);\n}\n#endif\n",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n\n// All these functions are for substituting tan() function from Intel GPU only\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3!\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5!\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7!\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9!\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n // 2pi range reduction\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n"};n.d(e,["i",0,i])},58073(t,e,n){n.d(e,{a:()=>MathArray});var i=n(54901);class MathArray extends Array{clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}toArray(t=[],e=0){for(let n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:(0,i.cy)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(i.$W)}formatString(t){let e="";for(let n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+(0,i.Fl)(this[n],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!(0,i.aI)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,n){if(void 0===n)return this.lerp(this,t,e);for(let i=0;i<this.ELEMENTS;++i){const o=t[i],r="number"==typeof e?e:e[i];this[i]=o+n*(r-o)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(i.$W.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}get elements(){return this}}},46022(t,e,n){n.d(e,{u:()=>Matrix});var i=n(58073),o=n(73731),r=n(54901);class Matrix extends i.a{toString(){let t="[";if(r.$W.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+e]}`}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=` ${this[e]}`}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,n){return this[e*this.RANK+t]=(0,o.ws)(n),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[n+t];return e}setColumn(t,e){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)this[n+t]=e[t];return this}}},54272(t,e,n){n.d(e,{M:()=>Vector});var i=n(58073),o=n(73731),r=n(4990);class Vector extends i.a{get x(){return this[0]}set x(t){this[0]=(0,o.ws)(t)}get y(){return this[1]}set y(t){this[1]=(0,o.ws)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let n=0;n<this.ELEMENTS;++n){const i=this[n]-t[n];e+=i*i}return(0,o.ws)(e)}dot(t){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return(0,o.ws)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return(0,r.v)(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,o.ws)(this[t])}setComponent(t,e){return(0,r.v)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},31886(t,e,n){n.d(e,{k:()=>Matrix4});var i,o=n(46022),r=n(73731),s=n(68225),a=n(90218),c=n(83588),l=n(82859),h=n(39426);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(i||(i={}));const u=45*Math.PI/180,p=1,d=.1,f=500,m=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class Matrix4 extends o.u{static get IDENTITY(){return function(){v||(v=new Matrix4,Object.freeze(v));return v}()}static get ZERO(){return function(){_||(_=new Matrix4([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(_));return _}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return i}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,n,i,o,r,s,a,c,l,h,u,p,d,f,m){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this[4]=o,this[5]=r,this[6]=s,this[7]=a,this[8]=c,this[9]=l,this[10]=h,this[11]=u,this[12]=p,this[13]=d,this[14]=f,this[15]=m,this.check()}setRowMajor(t,e,n,i,o,r,s,a,c,l,h,u,p,d,f,m){return this[0]=t,this[1]=o,this[2]=c,this[3]=p,this[4]=e,this[5]=r,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=h,this[11]=f,this[12]=i,this[13]=a,this[14]=u,this[15]=m,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(m)}fromObject(t){return this.check()}fromQuaternion(t){return(0,a.I0)(this,t),this.check()}frustum(t){const{left:e,right:n,bottom:i,top:o,near:r=d,far:s=f}=t;return s===1/0?function(t,e,n,i,o,r){const s=2*r/(n-e),a=2*r/(o-i),c=(n+e)/(n-e),l=(o+i)/(o-i),h=-1,u=-1,p=-2*r;t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=l,t[10]=h,t[11]=u,t[12]=0,t[13]=0,t[14]=p,t[15]=0}(this,e,n,i,o,r):(0,a.$h)(this,e,n,i,o,r,s),this.check()}lookAt(t){const{eye:e,center:n=[0,0,0],up:i=[0,1,0]}=t;return(0,a.t5)(this,e,n,i),this.check()}ortho(t){const{left:e,right:n,bottom:i,top:o,near:r=d,far:s=f}=t;return(0,a.v3)(this,e,n,i,o,r,s),this.check()}orthographic(t){const{fovy:e=u,aspect:n=p,focalDistance:i=1,near:o=d,far:r=f}=t;g(e);const s=e/2,a=i*Math.tan(s),c=a*n;return this.ortho({left:-c,right:c,bottom:-a,top:a,near:o,far:r})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return g(e),(0,a.fN)(this,e,n,i,o),this.check()}determinant(){return(0,a.a4)(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],o=1/n[1],r=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*r,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*r,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],o=1/n[1],r=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*r,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*r,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*r,t}transpose(){return(0,a.mg)(this,this),this.check()}invert(){return(0,a.B8)(this,this),this.check()}multiplyLeft(t){return(0,a.lw)(this,t,this),this.check()}multiplyRight(t){return(0,a.lw)(this,this,t),this.check()}rotateX(t){return(0,a.eL)(this,this,t),this.check()}rotateY(t){return(0,a.Z8)(this,this,t),this.check()}rotateZ(t){return(0,a.Qr)(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return(0,a.e$)(this,this,t,e),this.check()}scale(t){return(0,a.hs)(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return(0,a.Tl)(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=(0,h.Z0)(e||[-0,-0,-0,-0],t,this),(0,r.qk)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:n}=t;let i;switch(n){case 2:i=(0,c.Z0)(e||[-0,-0],t,this);break;case 3:i=(0,l.Z0)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,r.qk)(i,t.length),i}transformAsVector(t,e){let n;switch(t.length){case 2:n=(0,s.B$)(e||[-0,-0],t,this);break;case 3:n=(0,s.cL)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,r.qk)(n,t.length),n}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,n){return this.identity().translate([t,e,n])}}let _,v;function g(t){if(t>2*Math.PI)throw Error("expected radians")}},87597(t,e,n){n.d(e,{P:()=>Vector3});var i=n(54272),o=n(54901),r=n(73731),s=n(82859),a=n(68225);const c=[0,0,0];let l;class Vector3 extends i.M{static get ZERO(){return l||(l=new Vector3(0,0,0),Object.freeze(l)),l}constructor(t=0,e=0,n=0){super(-0,-0,-0),1===arguments.length&&(0,o.cy)(t)?this.copy(t):(o.$W.debug&&((0,r.ws)(t),(0,r.ws)(e),(0,r.ws)(n)),this[0]=t,this[1]=e,this[2]=n)}set(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return o.$W.debug&&((0,r.ws)(t.x),(0,r.ws)(t.y),(0,r.ws)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=(0,r.ws)(t)}angle(t){return(0,s.g7)(this,t)}cross(t){return(0,s.$A)(this,this,t),this.check()}rotateX({radians:t,origin:e=c}){return(0,s.eL)(this,this,e,t),this.check()}rotateY({radians:t,origin:e=c}){return(0,s.Z8)(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=c}){return(0,s.x6)(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return(0,s.Z0)(this,this,t),this.check()}transformAsVector(t){return(0,a.cL)(this,this,t),this.check()}transformByMatrix3(t){return(0,s.ei)(this,this,t),this.check()}transformByMatrix2(t){return(0,a.J4)(this,this,t),this.check()}transformByQuaternion(t){return(0,s.gL)(this,this,t),this.check()}}},50741(t,e,n){n.d(e,{p8:()=>i,tb:()=>o});const i=1e-6;let o="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI},90218(t,e,n){n.d(e,{$h:()=>_,B8:()=>r,I0:()=>m,IL:()=>f,Qr:()=>d,Tl:()=>c,Z8:()=>p,a4:()=>s,e$:()=>h,eL:()=>u,fN:()=>v,hs:()=>l,lw:()=>a,mg:()=>o,t5:()=>E});var i=n(50741);function o(t,e){if(t===e){const n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[11]=e[14],t[12]=o,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function r(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],u=e[9],p=e[10],d=e[11],f=e[12],m=e[13],_=e[14],v=e[15],g=n*a-i*s,E=n*c-o*s,y=n*l-r*s,M=i*c-o*a,b=i*l-r*a,T=o*l-r*c,P=h*m-u*f,w=h*_-p*f,S=h*v-d*f,x=u*_-p*m,O=u*v-d*m,j=p*v-d*_;let I=g*j-E*O+y*x+M*S-b*w+T*P;return I?(I=1/I,t[0]=(a*j-c*O+l*x)*I,t[1]=(o*O-i*j-r*x)*I,t[2]=(m*T-_*b+v*M)*I,t[3]=(p*b-u*T-d*M)*I,t[4]=(c*S-s*j-l*w)*I,t[5]=(n*j-o*S+r*w)*I,t[6]=(_*y-f*T-v*E)*I,t[7]=(h*T-p*y+d*E)*I,t[8]=(s*O-a*S+l*P)*I,t[9]=(i*S-n*O-r*P)*I,t[10]=(f*b-m*y+v*g)*I,t[11]=(u*y-h*b-d*g)*I,t[12]=(a*w-s*x-c*P)*I,t[13]=(n*x-i*w+o*P)*I,t[14]=(m*E-f*M-_*g)*I,t[15]=(h*M-u*E+p*g)*I,t):null}function s(t){const e=t[0],n=t[1],i=t[2],o=t[3],r=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],u=t[10],p=t[11],d=t[12],f=t[13],m=t[14],_=e*s-n*r,v=e*a-i*r,g=n*a-i*s,E=l*f-h*d,y=l*m-u*d,M=h*m-u*f;return c*(e*M-n*y+i*E)-o*(r*M-s*y+a*E)+t[15]*(l*g-h*v+u*_)-p*(d*g-f*v+m*_)}function a(t,e,n){const i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],l=e[6],h=e[7],u=e[8],p=e[9],d=e[10],f=e[11],m=e[12],_=e[13],v=e[14],g=e[15];let E=n[0],y=n[1],M=n[2],b=n[3];return t[0]=E*i+y*a+M*u+b*m,t[1]=E*o+y*c+M*p+b*_,t[2]=E*r+y*l+M*d+b*v,t[3]=E*s+y*h+M*f+b*g,E=n[4],y=n[5],M=n[6],b=n[7],t[4]=E*i+y*a+M*u+b*m,t[5]=E*o+y*c+M*p+b*_,t[6]=E*r+y*l+M*d+b*v,t[7]=E*s+y*h+M*f+b*g,E=n[8],y=n[9],M=n[10],b=n[11],t[8]=E*i+y*a+M*u+b*m,t[9]=E*o+y*c+M*p+b*_,t[10]=E*r+y*l+M*d+b*v,t[11]=E*s+y*h+M*f+b*g,E=n[12],y=n[13],M=n[14],b=n[15],t[12]=E*i+y*a+M*u+b*m,t[13]=E*o+y*c+M*p+b*_,t[14]=E*r+y*l+M*d+b*v,t[15]=E*s+y*h+M*f+b*g,t}function c(t,e,n){const i=n[0],o=n[1],r=n[2];let s,a,c,l,h,u,p,d,f,m,_,v;return e===t?(t[12]=e[0]*i+e[4]*o+e[8]*r+e[12],t[13]=e[1]*i+e[5]*o+e[9]*r+e[13],t[14]=e[2]*i+e[6]*o+e[10]*r+e[14],t[15]=e[3]*i+e[7]*o+e[11]*r+e[15]):(s=e[0],a=e[1],c=e[2],l=e[3],h=e[4],u=e[5],p=e[6],d=e[7],f=e[8],m=e[9],_=e[10],v=e[11],t[0]=s,t[1]=a,t[2]=c,t[3]=l,t[4]=h,t[5]=u,t[6]=p,t[7]=d,t[8]=f,t[9]=m,t[10]=_,t[11]=v,t[12]=s*i+h*o+f*r+e[12],t[13]=a*i+u*o+m*r+e[13],t[14]=c*i+p*o+_*r+e[14],t[15]=l*i+d*o+v*r+e[15]),t}function l(t,e,n){const i=n[0],o=n[1],r=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function h(t,e,n,o){let r,s,a,c,l,h,u,p,d,f,m,_,v,g,E,y,M,b,T,P,w,S,x,O,j=o[0],I=o[1],R=o[2],A=Math.sqrt(j*j+I*I+R*R);return A<i.p8?null:(A=1/A,j*=A,I*=A,R*=A,s=Math.sin(n),r=Math.cos(n),a=1-r,c=e[0],l=e[1],h=e[2],u=e[3],p=e[4],d=e[5],f=e[6],m=e[7],_=e[8],v=e[9],g=e[10],E=e[11],y=j*j*a+r,M=I*j*a+R*s,b=R*j*a-I*s,T=j*I*a-R*s,P=I*I*a+r,w=R*I*a+j*s,S=j*R*a+I*s,x=I*R*a-j*s,O=R*R*a+r,t[0]=c*y+p*M+_*b,t[1]=l*y+d*M+v*b,t[2]=h*y+f*M+g*b,t[3]=u*y+m*M+E*b,t[4]=c*T+p*P+_*w,t[5]=l*T+d*P+v*w,t[6]=h*T+f*P+g*w,t[7]=u*T+m*P+E*w,t[8]=c*S+p*x+_*O,t[9]=l*S+d*x+v*O,t[10]=h*S+f*x+g*O,t[11]=u*S+m*x+E*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function u(t,e,n){const i=Math.sin(n),o=Math.cos(n),r=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],u=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*o+l*i,t[5]=s*o+h*i,t[6]=a*o+u*i,t[7]=c*o+p*i,t[8]=l*o-r*i,t[9]=h*o-s*i,t[10]=u*o-a*i,t[11]=p*o-c*i,t}function p(t,e,n){const i=Math.sin(n),o=Math.cos(n),r=e[0],s=e[1],a=e[2],c=e[3],l=e[8],h=e[9],u=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*o-l*i,t[1]=s*o-h*i,t[2]=a*o-u*i,t[3]=c*o-p*i,t[8]=r*i+l*o,t[9]=s*i+h*o,t[10]=a*i+u*o,t[11]=c*i+p*o,t}function d(t,e,n){const i=Math.sin(n),o=Math.cos(n),r=e[0],s=e[1],a=e[2],c=e[3],l=e[4],h=e[5],u=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*o+l*i,t[1]=s*o+h*i,t[2]=a*o+u*i,t[3]=c*o+p*i,t[4]=l*o-r*i,t[5]=h*o-s*i,t[6]=u*o-a*i,t[7]=p*o-c*i,t}function f(t,e){const n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],l=e[9],h=e[10];return t[0]=Math.sqrt(n*n+i*i+o*o),t[1]=Math.sqrt(r*r+s*s+a*a),t[2]=Math.sqrt(c*c+l*l+h*h),t}function m(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=n+n,a=i+i,c=o+o,l=n*s,h=i*s,u=i*a,p=o*s,d=o*a,f=o*c,m=r*s,_=r*a,v=r*c;return t[0]=1-u-f,t[1]=h+v,t[2]=p-_,t[3]=0,t[4]=h-v,t[5]=1-l-f,t[6]=d+m,t[7]=0,t[8]=p+_,t[9]=d-m,t[10]=1-l-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _(t,e,n,i,o,r,s){const a=1/(n-e),c=1/(o-i),l=1/(r-s);return t[0]=2*r*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*r*c,t[6]=0,t[7]=0,t[8]=(n+e)*a,t[9]=(o+i)*c,t[10]=(s+r)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*r*2*l,t[15]=0,t}const v=function(t,e,n,i,o){const r=1/Math.tan(e/2);if(t[0]=r/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0){const e=1/(i-o);t[10]=(o+i)*e,t[14]=2*o*i*e}else t[10]=-1,t[14]=-2*i;return t};const g=function(t,e,n,i,o,r,s){const a=1/(e-n),c=1/(i-o),l=1/(r-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*a,t[13]=(o+i)*c,t[14]=(s+r)*l,t[15]=1,t};function E(t,e,n,o){let r,s,a,c,l,h,u,p,d,f;const m=e[0],_=e[1],v=e[2],g=o[0],E=o[1],y=o[2],M=n[0],b=n[1],T=n[2];return Math.abs(m-M)<i.p8&&Math.abs(_-b)<i.p8&&Math.abs(v-T)<i.p8?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(p=m-M,d=_-b,f=v-T,r=1/Math.sqrt(p*p+d*d+f*f),p*=r,d*=r,f*=r,s=E*f-y*d,a=y*p-g*f,c=g*d-E*p,r=Math.sqrt(s*s+a*a+c*c),r?(r=1/r,s*=r,a*=r,c*=r):(s=0,a=0,c=0),l=d*c-f*a,h=f*s-p*c,u=p*a-d*s,r=Math.sqrt(l*l+h*h+u*u),r?(r=1/r,l*=r,h*=r,u*=r):(l=0,h=0,u=0),t[0]=s,t[1]=l,t[2]=p,t[3]=0,t[4]=a,t[5]=h,t[6]=d,t[7]=0,t[8]=c,t[9]=u,t[10]=f,t[11]=0,t[12]=-(s*m+a*_+c*v),t[13]=-(l*m+h*_+u*v),t[14]=-(p*m+d*_+f*v),t[15]=1,t)}n.d(e,["v3",0,g])},83588(t,e,n){n.d(e,{Bw:()=>s,Cc:()=>c,WQ:()=>o,Z0:()=>h,ei:()=>l,hs:()=>r,jb:()=>u,ze:()=>a});var i=n(50741);function o(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function r(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function s(t){const e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function a(t,e){return t[0]=-e[0],t[1]=-e[1],t}function c(t,e,n,i){const o=e[0],r=e[1];return t[0]=o+i*(n[0]-o),t[1]=r+i*(n[1]-r),t}function l(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[3]*o+n[6],t[1]=n[1]*i+n[4]*o+n[7],t}function h(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[4]*o+n[12],t[1]=n[1]*i+n[5]*o+n[13],t}const u=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){const t=function(){const t=new i.tb(2);return i.tb!=Float32Array&&(t[0]=0,t[1]=0),t}()}()},82859(t,e,n){n.d(e,{$A:()=>u,Cc:()=>p,Il:()=>b,Ln:()=>a,Om:()=>h,S8:()=>l,Z0:()=>d,Z8:()=>v,eL:()=>_,ei:()=>f,fA:()=>r,g7:()=>E,gL:()=>m,jb:()=>y,lw:()=>s,uE:()=>T,vt:()=>o,x6:()=>g,xg:()=>M,ze:()=>c});var i=n(50741);function o(){const t=new i.tb(3);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function r(t,e,n){const o=new i.tb(3);return o[0]=t,o[1]=e,o[2]=n,o}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function a(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}function c(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function l(t,e){const n=e[0],i=e[1],o=e[2];let r=n*n+i*i+o*o;return r>0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function h(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function u(t,e,n){const i=e[0],o=e[1],r=e[2],s=n[0],a=n[1],c=n[2];return t[0]=o*c-r*a,t[1]=r*s-i*c,t[2]=i*a-o*s,t}function p(t,e,n,i){const o=e[0],r=e[1],s=e[2];return t[0]=o+i*(n[0]-o),t[1]=r+i*(n[1]-r),t[2]=s+i*(n[2]-s),t}function d(t,e,n){const i=e[0],o=e[1],r=e[2];let s=n[3]*i+n[7]*o+n[11]*r+n[15];return s=s||1,t[0]=(n[0]*i+n[4]*o+n[8]*r+n[12])/s,t[1]=(n[1]*i+n[5]*o+n[9]*r+n[13])/s,t[2]=(n[2]*i+n[6]*o+n[10]*r+n[14])/s,t}function f(t,e,n){const i=e[0],o=e[1],r=e[2];return t[0]=i*n[0]+o*n[3]+r*n[6],t[1]=i*n[1]+o*n[4]+r*n[7],t[2]=i*n[2]+o*n[5]+r*n[8],t}function m(t,e,n){const i=n[0],o=n[1],r=n[2],s=n[3],a=e[0],c=e[1],l=e[2];let h=o*l-r*c,u=r*a-i*l,p=i*c-o*a,d=o*p-r*u,f=r*h-i*p,m=i*u-o*h;const _=2*s;return h*=_,u*=_,p*=_,d*=2,f*=2,m*=2,t[0]=a+h+d,t[1]=c+u+f,t[2]=l+p+m,t}function _(t,e,n,i){const o=[],r=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],r[0]=o[0],r[1]=o[1]*Math.cos(i)-o[2]*Math.sin(i),r[2]=o[1]*Math.sin(i)+o[2]*Math.cos(i),t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t}function v(t,e,n,i){const o=[],r=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],r[0]=o[2]*Math.sin(i)+o[0]*Math.cos(i),r[1]=o[1],r[2]=o[2]*Math.cos(i)-o[0]*Math.sin(i),t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t}function g(t,e,n,i){const o=[],r=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],r[0]=o[0]*Math.cos(i)-o[1]*Math.sin(i),r[1]=o[0]*Math.sin(i)+o[1]*Math.cos(i),r[2]=o[2],t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t}function E(t,e){const n=t[0],i=t[1],o=t[2],r=e[0],s=e[1],a=e[2],c=Math.sqrt((n*n+i*i+o*o)*(r*r+s*s+a*a)),l=c&&h(t,e)/c;return Math.acos(Math.min(Math.max(l,-1),1))}const y=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},M=function(t,e){const n=e[0]-t[0],i=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(n*n+i*i+o*o)},b=function(t){const e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)},T=function(t){const e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i};!function(){const t=o()}()},39426(t,e,n){n.d(e,{Bw:()=>h,C:()=>s,Cc:()=>f,Om:()=>d,S8:()=>p,WQ:()=>c,Z0:()=>m,fA:()=>r,gL:()=>_,hZ:()=>a,hs:()=>l,m3:()=>u,o8:()=>o,t2:()=>v});var i=n(50741);function o(t){const e=new i.tb(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function r(t,e,n,o){const r=new i.tb(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=o,r}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t,e,n,i,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function l(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function h(t){const e=t[0],n=t[1],i=t[2],o=t[3];return Math.sqrt(e*e+n*n+i*i+o*o)}function u(t){const e=t[0],n=t[1],i=t[2],o=t[3];return e*e+n*n+i*i+o*o}function p(t,e){const n=e[0],i=e[1],o=e[2],r=e[3];let s=n*n+i*i+o*o+r*r;return s>0&&(s=1/Math.sqrt(s)),t[0]=n*s,t[1]=i*s,t[2]=o*s,t[3]=r*s,t}function d(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function f(t,e,n,i){const o=e[0],r=e[1],s=e[2],a=e[3];return t[0]=o+i*(n[0]-o),t[1]=r+i*(n[1]-r),t[2]=s+i*(n[2]-s),t[3]=a+i*(n[3]-a),t}function m(t,e,n){const i=e[0],o=e[1],r=e[2],s=e[3];return t[0]=n[0]*i+n[4]*o+n[8]*r+n[12]*s,t[1]=n[1]*i+n[5]*o+n[9]*r+n[13]*s,t[2]=n[2]*i+n[6]*o+n[10]*r+n[14]*s,t[3]=n[3]*i+n[7]*o+n[11]*r+n[15]*s,t}function _(t,e,n){const i=e[0],o=e[1],r=e[2],s=n[0],a=n[1],c=n[2],l=n[3],h=l*i+a*r-c*o,u=l*o+c*i-s*r,p=l*r+s*o-a*i,d=-s*i-a*o-c*r;return t[0]=h*l+d*-s+u*-c-p*-a,t[1]=u*l+d*-a+p*-s-h*-c,t[2]=p*l+d*-c+h*-a-u*-s,t[3]=e[3],t}function v(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}!function(){const t=function(){const t=new i.tb(4);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},4990(t,e,n){function i(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}n.d(e,{v:()=>i})},54901(t,e,n){n.d(e,{$W:()=>i,Cc:()=>a,Fl:()=>o,aI:()=>c,cy:()=>r,qE:()=>s});Math.PI,Math.PI;globalThis.mathgl=globalThis.mathgl||{config:{EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1}};const i=globalThis.mathgl.config;function o(t,{precision:e=i.precision}={}){return t=function(t){return Math.round(t/i.EPSILON)*i.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function r(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function s(t,e,n){return l(t,t=>Math.max(e,Math.min(n,t)))}function a(t,e,n){return r(t)?t.map((t,i)=>a(t,e[i],n)):n*e+(1-n)*t}function c(t,e,n){const o=i.EPSILON;n&&(i.EPSILON=n);try{if(t===e)return!0;if(r(t)&&r(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!c(t[n],e[n]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=i.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{i.EPSILON=o}}function l(t,e,n){if(r(t)){const i=t;n=n||function(t){return t.clone?t.clone():new Array(t.length)}(i);for(let o=0;o<n.length&&o<i.length;++o){const i="number"==typeof t?t:t[o];n[o]=e(i,o,n)}return n}return e(t)}},68225(t,e,n){function i(t,e,n){const i=e[0],o=e[1],r=n[3]*i+n[7]*o||1;return t[0]=(n[0]*i+n[4]*o)/r,t[1]=(n[1]*i+n[5]*o)/r,t}function o(t,e,n){const i=e[0],o=e[1],r=e[2],s=n[3]*i+n[7]*o+n[11]*r||1;return t[0]=(n[0]*i+n[4]*o+n[8]*r)/s,t[1]=(n[1]*i+n[5]*o+n[9]*r)/s,t[2]=(n[2]*i+n[6]*o+n[10]*r)/s,t}function r(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[2]*o,t[1]=n[1]*i+n[3]*o,t[2]=e[2],t}function s(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[2]*o,t[1]=n[1]*i+n[3]*o,t[2]=e[2],t[3]=e[3],t}function a(t,e,n){const i=e[0],o=e[1],r=e[2];return t[0]=n[0]*i+n[3]*o+n[6]*r,t[1]=n[1]*i+n[4]*o+n[7]*r,t[2]=n[2]*i+n[5]*o+n[8]*r,t[3]=e[3],t}n.d(e,{B$:()=>i,Cg:()=>s,J4:()=>r,cL:()=>o,vE:()=>a})},73731(t,e,n){n.d(e,{qk:()=>r,ws:()=>o});var i=n(54901);function o(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function r(t,e,n=""){if(i.$W.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error(`math.gl: ${n} some fields set to invalid numbers'`);return t}},45249(t,e,n){n.d(e,{aH:()=>g,dT:()=>x,Os:()=>I,Fe:()=>L,rj:()=>U,wZ:()=>R,gW:()=>N,nI:()=>S,v7:()=>W,fO:()=>P,om:()=>j,rY:()=>O,Gw:()=>b,xJ:()=>C,mY:()=>w,iV:()=>T,VJ:()=>A});var i=n(39426);function o(t,e){const n=i.Z0([],e,t);return i.hs(n,n,1/n[3]),n}function r(t,e,n){return n*e+(1-n)*t}function s(t,e,n){return t<e?e:t>n?n:t}const a=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var c=n(90218),l=n(82859),h=n(83588);function u(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const p=Math.PI,d=p/4,f=p/180,m=180/p,_=512,v=4003e4,g=85.051129,E=1.5;function y(t){return Math.pow(2,t)}function M(t){return a(t)}function b(t){const[e,n]=t;u(Number.isFinite(e)),u(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const i=n*f;return[_*(e*f+p)/(2*p),_*(p+Math.log(Math.tan(d+.5*i)))/(2*p)]}function T(t){const[e,n]=t,i=e/_*(2*p)-p,o=2*(Math.atan(Math.exp(n/_*(2*p)-p))-d);return[i*m,o*m]}function P(t){const{latitude:e}=t;u(Number.isFinite(e));const n=Math.cos(e*f);return M(v*n)-9}function w(t){return 12790407194604047e-21/Math.cos(t*f)}function S(t){const{latitude:e,longitude:n,highPrecision:i=!1}=t;u(Number.isFinite(e)&&Number.isFinite(n));const o=_,r=Math.cos(e*f),s=o/360,a=s/r,c=12790407194604047e-21/r,l={unitsPerMeter:[c,c,c],metersPerUnit:[1/c,1/c,1/c],unitsPerDegree:[s,a,c],degreesPerUnit:[.703125,1/a,1/c]};if(i){const t=f*Math.tan(e*f)/r,n=s*t/2,i=12790407194604047e-21*t,o=i/a*c;l.unitsPerDegree2=[0,n,i],l.unitsPerMeter2=[o,0,o]}return l}function x(t,e){const[n,i,o]=t,[r,s,a]=e,{unitsPerMeter:c,unitsPerMeter2:l}=S({longitude:n,latitude:i,highPrecision:!0}),h=b(t);h[0]+=r*(c[0]+l[0]*s),h[1]+=s*(c[1]+l[1]*s);const u=T(h),p=(o||0)+(a||0);return Number.isFinite(o)||Number.isFinite(a)?[u[0],u[1],p]:u}function O(t){const{height:e,pitch:n,bearing:i,altitude:o,scale:r,center:s}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.Tl(a,a,[0,0,-o]),c.eL(a,a,-n*f),c.Qr(a,a,i*f);const h=r/e;return c.hs(a,a,[h,h,h]),s&&c.Tl(a,a,l.ze([],s)),a}function j(t){const{width:e,height:n,altitude:i,pitch:o=0,offset:r,center:a,scale:c,nearZMultiplier:l=1,farZMultiplier:h=1}=t;let{fovy:u=I(E)}=t;void 0!==i&&(u=I(i));const p=u*f,d=o*f,m=R(u);let _=m;a&&(_+=a[2]*c/Math.cos(d)/n);const v=p*(.5+(r?r[1]:0)/n),g=Math.sin(v)*_/Math.sin(s(Math.PI/2-d-v,.01,Math.PI-.01)),y=Math.sin(d)*g+_,M=10*_;return{fov:p,aspect:e/n,focalDistance:m,near:l,far:Math.min(y*h,M)}}function I(t){return 2*Math.atan(.5/t)*m}function R(t){return.5/Math.tan(.5*t*f)}function A(t,e){const[n,i,r=0]=t;return u(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),o(e,[n,i,r,1])}function C(t,e,n=0){const[i,r,s]=t;if(u(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s)){return o(e,[i,r,s,1])}const a=o(e,[i,r,0,1]),c=o(e,[i,r,1,1]),l=a[2],p=c[2],d=l===p?0:((n||0)-l)/(p-l);return h.Cc([],a,c,d)}function L(t){const{width:e,height:n,bounds:i,minExtent:o=0,maxZoom:r=24,offset:c=[0,0]}=t,[[l,h],[p,d]]=i,f=function(t=0){if("number"==typeof t)return{top:t,bottom:t,left:t,right:t};return u(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),m=b([l,s(d,-g,g)]),_=b([p,s(h,-g,g)]),v=[Math.max(Math.abs(_[0]-m[0]),o),Math.max(Math.abs(_[1]-m[1]),o)],E=[e-f.left-f.right-2*Math.abs(c[0]),n-f.top-f.bottom-2*Math.abs(c[1])];u(E[0]>0&&E[1]>0);const y=E[0]/v[0],M=E[1]/v[1],P=(f.right-f.left)/2/y,w=(f.top-f.bottom)/2/M,S=T([(_[0]+m[0])/2+P,(_[1]+m[1])/2+w]),x=Math.min(r,a(Math.abs(Math.min(y,M))));return u(Number.isFinite(x)),{longitude:S[0],latitude:S[1],zoom:x}}const z=Math.PI/180;function N(t,e=0){const{width:n,height:i,unproject:o}=t,r={targetZ:e},s=o([0,i],r),a=o([n,i],r);let c,l;return(t.fovy?.5*t.fovy*z:Math.atan(.5/t.altitude))>(90-t.pitch)*z-.01?(c=k(t,0,e),l=k(t,n,e)):(c=o([0,0],r),l=o([n,0],r)),[s,a,l,c]}function k(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=o(i,[e,0,1,1]),s=o(i,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2]),c=T(h.Cc([],r,s,a));return c.push(n),c}const D=["longitude","latitude","zoom"],F={curve:1.414,speed:1.2};function U(t,e,n,i){const{startZoom:o,startCenterXY:s,uDelta:a,w0:c,u1:l,S:u,rho:p,rho2:d,r0:f}=B(t,e,i);if(l<.01){const i={};for(const o of D){const s=t[o],a=e[o];i[o]=r(s,a,n)}return i}const m=n*u,_=Math.cosh(f)/Math.cosh(f+p*m),v=c*((Math.cosh(f)*Math.tanh(f+p*m)-Math.sinh(f))/d)/l,g=o+M(1/_),E=h.hs([],a,v);h.WQ(E,E,s);const y=T(E);return{longitude:y[0],latitude:y[1],zoom:g}}function W(t,e,n){const i={...F,...n},{screenSpeed:o,speed:r,maxDuration:s}=i,{S:a,rho:c}=B(t,e,i),l=1e3*a;let h;return h=Number.isFinite(o)?l/(o/c):l/r,Number.isFinite(s)&&h>s?0:h}function B(t,e,n){const i=(n=Object.assign({},F,n)).curve,o=t.zoom,r=[t.longitude,t.latitude],s=y(o),a=e.zoom,c=[e.longitude,e.latitude],l=y(a-o),u=b(r),p=b(c),d=h.jb([],p,u),f=Math.max(t.width,t.height),m=f/l,_=h.Bw(d)*s,v=Math.max(_,.01),g=i*i,E=(m*m-f*f+g*g*v*v)/(2*f*g*v),M=(m*m-f*f-g*g*v*v)/(2*m*g*v),T=Math.log(Math.sqrt(E*E+1)-E),P=Math.log(Math.sqrt(M*M+1)-M);return{startZoom:o,startCenterXY:u,uDelta:d,w0:f,u1:_,S:(P-T)/i,rho:i,rho2:g,r0:T,r1:P}}},19852(t,e,n){n.d(e,{Cp:()=>DoubleClickDragRecognizer,EU:()=>EventManager,uq:()=>PanRecognizer,h1:()=>PinchRecognizer,Cx:()=>TapRecognizer});var i,o,r;!function(t){t[t.Start=1]="Start",t[t.Move=2]="Move",t[t.End=4]="End",t[t.Cancel=8]="Cancel"}(i||(i={})),function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Up=4]="Up",t[t.Down=8]="Down",t[t.Horizontal=3]="Horizontal",t[t.Vertical=12]="Vertical",t[t.All=15]="All"}(o||(o={})),function(t){t[t.Possible=1]="Possible",t[t.Began=2]="Began",t[t.Changed=4]="Changed",t[t.Ended=8]="Ended",t[t.Recognized=8]="Recognized",t[t.Cancelled=16]="Cancelled",t[t.Failed=32]="Failed"}(r||(r={}));const s="manipulation";class TouchAction{constructor(t,e){this.actions="",this.manager=t,this.set(e)}set(t){"compute"===t&&(t=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=t,this.actions=t)}update(){this.set(this.manager.options.touchAction)}compute(){let t=[];for(const e of this.manager.recognizers)e.options.enable&&(t=t.concat(e.getTouchAction()));return function(t){if(t.includes("none"))return"none";const e=t.includes("pan-x"),n=t.includes("pan-y");return e&&n?"none":e||n?e?"pan-x":"pan-y":t.includes(s)?s:"auto"}(t.join(" "))}}function a(t){return t.trim().split(/\s+/g)}function c(t,e,n){if(t)for(const i of a(e))t.addEventListener(i,n,!1)}function l(t,e,n){if(t)for(const i of a(e))t.removeEventListener(i,n,!1)}function h(t){return(t.ownerDocument||t).defaultView}function u(t){const e=t.length;if(1===e)return{x:Math.round(t[0].clientX),y:Math.round(t[0].clientY)};let n=0,i=0,o=0;for(;o<e;)n+=t[o].clientX,i+=t[o].clientY,o++;return{x:Math.round(n/e),y:Math.round(i/e)}}function p(t){const e=[];let n=0;for(;n<t.pointers.length;)e[n]={clientX:Math.round(t.pointers[n].clientX),clientY:Math.round(t.pointers[n].clientY)},n++;return{timeStamp:Date.now(),pointers:e,center:u(e),deltaX:t.deltaX,deltaY:t.deltaY}}function d(t,e){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}function f(t,e){const n=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(n*n+i*i)}function m(t,e){const n=e.clientX-t.clientX,i=e.clientY-t.clientY;return 180*Math.atan2(i,n)/Math.PI}function _(t,e){return t===e?o.None:Math.abs(t)>=Math.abs(e)?t<0?o.Left:o.Right:e<0?o.Up:o.Down}function v(t,e,n){return{x:e/t||0,y:n/t||0}}function g(t,e){return"pointerId"in t?t.pointerId:e}function E(t,e){t.movementOrigin=new Map(e.map((t,e)=>[g(t,e),{clientX:t.clientX,clientY:t.clientY}])),t.firstMovementTime=void 0}function y(t,e){const{session:n}=t,{pointers:o}=e,{length:r}=o;n.firstInput||(n.firstInput=p(e)),r>1&&!n.firstMultiple?n.firstMultiple=p(e):1===r&&(n.firstMultiple=!1);const{firstInput:s,firstMultiple:a}=n,c=a?a.center:s.center,l=e.center=u(o);e.timeStamp=Date.now(),e.deltaTime=e.timeStamp-s.timeStamp,function(t,e){const n=e.pointers.map(g);if(t.movementOrigin?.size===n.length&&n.every(e=>t.movementOrigin.has(e))||E(t,e.pointers),e.distancePerPointer=e.pointers.map((e,i)=>f(t.movementOrigin.get(n[i]),e)),e.eventType&i.Move&&e.distancePerPointer.some(t=>t>0)&&(t.firstMovementTime??(t.firstMovementTime=e.timeStamp)),e.movementDeltaTime=void 0===t.firstMovementTime?0:e.timeStamp-t.firstMovementTime,e.eventType&(i.End|i.Cancel)){const i=e.changedPointers.map(t=>g(t,e.pointers.indexOf(t)));E(t,e.pointers.filter((t,e)=>!i.includes(n[e])))}}(n,e),e.angle=function(t,e){const n=e.x-t.x,i=e.y-t.y;return 180*Math.atan2(i,n)/Math.PI}(c,l),e.distance=d(c,l);const{deltaX:h,deltaY:y}=function(t,e){const n=e.center;let o=t.offsetDelta,r=t.prevDelta;const s=t.prevInput;return e.eventType!==i.Start&&s?.eventType!==i.End||(r=t.prevDelta={x:s?.deltaX||0,y:s?.deltaY||0},o=t.offsetDelta={x:n.x,y:n.y}),{deltaX:r.x+(n.x-o.x),deltaY:r.y+(n.y-o.y)}}(n,e);e.deltaX=h,e.deltaY=y,e.offsetDirection=_(e.deltaX,e.deltaY);const M=v(e.deltaTime,e.deltaX,e.deltaY);var b,T;e.overallVelocityX=M.x,e.overallVelocityY=M.y,e.overallVelocity=Math.abs(M.x)>Math.abs(M.y)?M.x:M.y,e.scale=a?(b=a.pointers,f((T=o)[0],T[1])/f(b[0],b[1])):1,e.rotation=a?function(t,e){return m(e[1],e[0])-m(t[1],t[0])}(a.pointers,o):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length;let P=t.element;return function(t,e){let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}(e.srcEvent.target,P)&&(P=e.srcEvent.target),e.target=P,function(t,e){const n=t.lastInterval||e,o=e.timeStamp-n.timeStamp;let r,s,a,c;if(e.eventType!==i.Cancel&&(o>25||void 0===n.velocity)){const i=e.deltaX-n.deltaX,l=e.deltaY-n.deltaY,h=v(o,i,l);s=h.x,a=h.y,r=Math.abs(h.x)>Math.abs(h.y)?h.x:h.y,c=_(i,l),t.lastInterval=e}else r=n.velocity,s=n.velocityX,a=n.velocityY,c=n.direction;e.velocity=r,e.velocityX=s,e.velocityY=a,e.direction=c}(n,e),e}class Input{constructor(t){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=t=>{this.manager.options.enable&&this.handler(t)},this.manager=t,this.element=t.element,this.target=t.options.inputTarget||t.element}callback(t,e){!function(t,e,n){const o=n.pointers.length,r=n.changedPointers.length,s=e&i.Start&&o-r===0,a=e&(i.End|i.Cancel)&&o-r===0;n.isFirst=Boolean(s),n.isFinal=Boolean(a),s&&(t.session={}),n.eventType=e;const c=y(t,n);t.emit("hammer.input",c),t.recognize(c),t.session.prevInput=c}(this.manager,t,e)}init(){c(this.element,this.evEl,this.domHandler),c(this.target,this.evTarget,this.domHandler),c(h(this.element),this.evWin,this.domHandler)}destroy(){l(this.element,this.evEl,this.domHandler),l(this.target,this.evTarget,this.domHandler),l(h(this.element),this.evWin,this.domHandler)}}const M={pointerdown:i.Start,pointermove:i.Move,pointerup:i.End,pointercancel:i.Cancel,pointerout:i.Cancel};class PointerEventInput extends Input{constructor(t){super(t),this.evEl="pointerdown",this.evWin="pointermove pointerup pointercancel",this.store=this.manager.session.pointerEvents=[],this.init()}handler(t){const{store:e}=this;let n=!1;const o=M[t.type],r=t.pointerType,s="touch"===r;let a=e.findIndex(e=>e.pointerId===t.pointerId);o&i.Start&&(t.buttons||s)?a<0&&(e.push(t),a=e.length-1):o&(i.End|i.Cancel)&&(n=!0),a<0||(e[a]=t,this.callback(o,{pointers:e,changedPointers:[t],eventType:o,pointerType:r,srcEvent:t}),n&&e.splice(a,1))}}const b=["","webkit","Moz","MS","ms","o"];function T(t,e){const n=e[0].toUpperCase()+e.slice(1);for(const i of b){const o=i?i+n:e;if(o in t)return o}}const P={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}};class Manager{constructor(t,e){this.options={...P,...e,cssProps:{...P.cssProps,...e.cssProps},inputTarget:e.inputTarget||t},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new PointerEventInput(this),this.touchAction=new TouchAction(this,this.options.touchAction),this.toggleCssProps(!0)}set(t){return Object.assign(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this}stop(t){this.session.stopped=t?2:1}recognize(t){const{session:e}=this;if(e.stopped)return;let n;this.session.prevented&&t.srcEvent.preventDefault();const{recognizers:i}=this;let{curRecognizer:o}=e;(!o||o&&o.state&r.Recognized)&&(o=e.curRecognizer=null);let s=0;for(;s<i.length;)n=i[s],2===e.stopped||o&&n!==o&&!n.canRecognizeWith(o)?n.reset():n.recognize(t),!o&&n.state&(r.Began|r.Changed|r.Ended)&&(o=e.curRecognizer=n),s++}get(t){const{recognizers:e}=this;for(let n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null}add(t){if(Array.isArray(t)){for(const e of t)this.add(e);return this}const e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t}remove(t){if(Array.isArray(t)){for(const e of t)this.remove(e);return this}const e="string"==typeof t?this.get(t):t;if(e){const{recognizers:t}=this,n=t.indexOf(e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this}on(t,e){if(!t||!e)return;const{handlers:n}=this;for(const i of a(t))n[i]=n[i]||[],n[i].push(e)}off(t,e){if(!t)return;const{handlers:n}=this;for(const i of a(t))e?n[i]&&n[i].splice(n[i].indexOf(e),1):delete n[i]}emit(t,e){const n=this.handlers[t]&&this.handlers[t].slice();if(!n||!n.length)return;const i=e;i.type=t,i.preventDefault=function(){e.srcEvent.preventDefault()};let o=0;for(;o<n.length;)n[o](i),o++}destroy(){this.toggleCssProps(!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}toggleCssProps(t){const{element:e}=this;if(e){for(const[n,i]of Object.entries(this.options.cssProps)){const o=T(e.style,n);t?(this.oldCssProps[o]=e.style[o],e.style[o]=i):e.style[o]=this.oldCssProps[o]||""}t||(this.oldCssProps={})}}}let w=1;function S(t){return t&r.Cancelled?"cancel":t&r.Ended?"end":t&r.Changed?"move":t&r.Began?"start":""}class Recognizer{constructor(t){this.options=t,this.id=w++,this.state=r.Possible,this.simultaneous={},this.requireFail=[]}set(t){return Object.assign(this.options,t),this.manager.touchAction.update(),this}recognizeWith(t){if(Array.isArray(t)){for(const e of t)this.recognizeWith(e);return this}let e;if("string"==typeof t){if(e=this.manager.get(t),!e)throw new Error(`Cannot find recognizer ${t}`)}else e=t;const{simultaneous:n}=this;return n[e.id]||(n[e.id]=e,e.recognizeWith(this)),this}dropRecognizeWith(t){if(Array.isArray(t)){for(const e of t)this.dropRecognizeWith(e);return this}let e;return e="string"==typeof t?this.manager.get(t):t,e&&delete this.simultaneous[e.id],this}requireFailure(t){if(Array.isArray(t)){for(const e of t)this.requireFailure(e);return this}let e;if("string"==typeof t){if(e=this.manager.get(t),!e)throw new Error(`Cannot find recognizer ${t}`)}else e=t;const{requireFail:n}=this;return-1===n.indexOf(e)&&(n.push(e),e.requireFailure(this)),this}dropRequireFailure(t){if(Array.isArray(t)){for(const e of t)this.dropRequireFailure(e);return this}let e;if(e="string"==typeof t?this.manager.get(t):t,e){const t=this.requireFail.indexOf(e);t>-1&&this.requireFail.splice(t,1)}return this}hasRequireFailures(){return Boolean(this.requireFail.find(t=>t.options.enable))}canRecognizeWith(t){return Boolean(this.simultaneous[t.id])}emit(t){if(!t)return;const{state:e}=this;e<r.Ended&&this.manager.emit(this.options.event+S(e),t),this.manager.emit(this.options.event,t),t.additionalEvent&&this.manager.emit(t.additionalEvent,t),e>=r.Ended&&this.manager.emit(this.options.event+S(e),t)}tryEmit(t){this.canEmit()?this.emit(t):this.state=r.Failed}canEmit(){let t=0;for(;t<this.requireFail.length;){if(!(this.requireFail[t].state&(r.Failed|r.Possible)))return!1;t++}return!0}recognize(t){const e={...t};if(!this.options.enable)return this.reset(),void(this.state=r.Failed);this.state&(r.Recognized|r.Cancelled|r.Failed)&&(this.state=r.Possible),this.state=this.process(e),this.state&(r.Began|r.Changed|r.Ended|r.Cancelled)&&this.tryEmit(e)}getEventNames(){return[this.options.event]}reset(){}}function x(t,e){return(void 0===e.distance||t.distance>=e.distance)&&(void 0===e.distancePerPointer||t.distancePerPointer.length>0&&t.distancePerPointer.every(t=>t>=e.distancePerPointer))&&(void 0===e.movementDeltaTime||t.movementDeltaTime>=e.movementDeltaTime)&&(void 0===e.rotation||(n=t.rotation,Math.abs(((n+180)%360+360)%360-180)>=e.rotation))&&(void 0===e.scale||Math.abs(t.scale-1)>=e.scale);var n}class AttrRecognizer extends Recognizer{attrTest(t){const e=this.options.pointers;return 0===e||t.pointers.length===e}coherentTest(t){const e=this.options.coherent;return!e?.length||e.some(e=>x(t,e))}process(t){const{state:e}=this,{eventType:n}=t,o=e&(r.Began|r.Changed),s=this.attrTest(t);return o&&(n&i.Cancel||!s)?e|r.Cancelled:o||s?n&i.End?e|r.Ended:e&r.Began?e|r.Changed:r.Began:r.Failed}}const O=["","start","move","end","cancel"];class DoubleClickDragRecognizer extends Recognizer{constructor(t={}){super({enable:!0,event:"doubleclickdrag",pointers:1,interval:500,time:350,threshold:28,dragThreshold:1,pixelsPerScale:120,...t}),this._tapStart=null,this._lastTap=null,this._drag=null,this._emittedStart=!1}getTouchAction(){return[s]}getEventNames(){return O.map(t=>this.options.event+t)}process(t){const{options:e}=this;return t.pointers.length===e.pointers?t.eventType&i.Start?this._handleStart(t):t.eventType&i.Move?this._handleMove(t):t.eventType&i.Cancel?this._handleEnd(t,!0):t.eventType&i.End?this._handleEnd(t,!1):r.Failed:(this.reset(),r.Failed)}reset(){this._tapStart=null,this._lastTap=null,this._drag=null,this._emittedStart=!1}emit(t){if(t){if(this.state===r.Began){if(!this._drag?.active||this._emittedStart)return;return this._emittedStart=!0,this.manager.emit(`${this.options.event}start`,t),void this.manager.emit(this.options.event,t)}if(this.state===r.Changed){if(!this._emittedStart)return;return this.manager.emit(`${this.options.event}move`,t),void this.manager.emit(this.options.event,t)}if(this.state===r.Ended){if(!this._emittedStart)return;return this.manager.emit(this.options.event,t),this.manager.emit(`${this.options.event}end`,t),void(this._emittedStart=!1)}if(this.state===r.Cancelled){if(!this._emittedStart)return;this.manager.emit(this.options.event,t),this.manager.emit(`${this.options.event}cancel`,t),this._emittedStart=!1}}}_handleStart(t){const e=this._getPointerId(t);return this._lastTap&&this._isTapMatch(t,this._lastTap)?(this._tapStart=null,this._lastTap=null,this._drag={startCenter:t.center,pointerId:e,active:!1},this._emittedStart=!1,r.Began):(this._tapStart={center:t.center,timeStamp:t.timeStamp,pointerId:e},this._lastTap=null,this._drag=null,this._emittedStart=!1,r.Failed)}_handleMove(t){if(!this._drag||!this._isSamePointer(t,this._drag.pointerId))return r.Failed;const e=this._drag.startCenter.y-t.center.y;return!this._drag.active&&Math.abs(e)<this.options.dragThreshold?r.Began:(this._drag.active=!0,t.scale=Math.pow(2,e/this.options.pixelsPerScale),this._emittedStart?r.Changed:r.Began)}_handleEnd(t,e){if(this._drag&&this._isSamePointer(t,this._drag.pointerId)){const{active:n,startCenter:i}=this._drag;if(this._drag=null,this._tapStart=null,this._lastTap=null,!n)return this._emittedStart=!1,r.Failed;const o=i.y-t.center.y;return t.scale=Math.pow(2,o/this.options.pixelsPerScale),e?r.Cancelled:r.Ended}return this._tapStart&&this._isSamePointer(t,this._tapStart.pointerId)?(this._isValidTap(t)?this._lastTap={center:t.center,timeStamp:t.timeStamp,pointerId:this._tapStart.pointerId}:this._lastTap=null,this._tapStart=null,r.Failed):(e&&this.reset(),r.Failed)}_isTapMatch(t,e){return t.timeStamp-e.timeStamp<=this.options.interval&&d(t.center,e.center)<=this.options.threshold}_isValidTap(t){return t.deltaTime<=this.options.time&&t.distance<=this.options.threshold}_getPointerId(t){return"pointerId"in t.srcEvent?t.srcEvent.pointerId:null}_isSamePointer(t,e){return null===e||this._getPointerId(t)===e}}class TapRecognizer extends Recognizer{constructor(t={}){super({enable:!0,event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...t}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[s]}process(t){const{options:e}=this,n=t.pointers.length===e.pointers,o=t.distance<e.threshold,s=t.deltaTime<e.time;if(this.reset(),t.eventType&i.Start&&0===this.count)return this.failTimeout();if(o&&s&&n){if(t.eventType!==i.End)return this.failTimeout();const n=!this.pTime||t.timeStamp-this.pTime<e.interval,o=!this.pCenter||d(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,o&&n?this.count+=1:this.count=1,this._input=t;if(0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=r.Recognized,this.tryEmit(this._input)},e.interval),r.Began):r.Recognized}return r.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=r.Failed},this.options.interval),r.Failed}reset(){clearTimeout(this._timer)}emit(t){this.state===r.Recognized&&(t.tapCount=this.count,this.manager.emit(this.options.event,t))}}class TrackpadRecognizer extends AttrRecognizer{constructor(){super(...arguments),this.wheelSession=null,this.wheelSessionUnsubscribe=null,this.handleWheelSessionEvent=t=>{"trackpad"===t.device&&this.handleTrackpadEvent(t)}}set(t){const{wheelSession:e,...n}=t;return e&&e!==this.wheelSession&&(this.wheelSessionUnsubscribe?.(),this.wheelSessionUnsubscribe=null,this.wheelSession=e),super.set(n),this.updateWheelSessionSubscription(),this}getTrackpadInput(t,e={}){const{srcEvent:n}=t,i=e.deltaX??t.deltaX,o=e.deltaY??t.deltaY,r=_(i,o),s=Math.sqrt(t.deltaX*t.deltaX+t.deltaY*t.deltaY);return{pointers:[n,n],changedPointers:[n,n],pointerType:"trackpad",srcEvent:n,eventType:t.eventType,timeStamp:t.timeStamp,deltaTime:t.deltaTime,center:t.center,deltaX:i,deltaY:o,angle:180*Math.atan2(o,i)/Math.PI,distance:Math.sqrt(i*i+o*o),distancePerPointer:[s,s],movementDeltaTime:t.deltaTime,scale:1,rotation:0,direction:r,offsetDirection:r,velocity:t.velocity,velocityX:t.velocityX,velocityY:t.velocityY,overallVelocity:t.overallVelocity,overallVelocityX:t.overallVelocityX,overallVelocityY:t.overallVelocityY,maxPointers:2,target:n.target||this.manager.element,additionalEvent:"",...e}}updateWheelSessionSubscription(){const t=Boolean(this.wheelSession&&this.options.enable&&this.options.trackpad&&2===this.options.pointers);t&&!this.wheelSessionUnsubscribe?this.wheelSessionUnsubscribe=this.wheelSession.on(this.handleWheelSessionEvent):!t&&this.wheelSessionUnsubscribe&&(this.wheelSessionUnsubscribe(),this.wheelSessionUnsubscribe=null)}}const j=["","start","move","end","cancel","up","down","left","right"];class PanRecognizer extends TrackpadRecognizer{constructor(t={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:o.All,trackpad:!1,coherent:[],...t}),this.trackpadGesture=!1,this.pX=null,this.pY=null}getTouchAction(){const{options:{direction:t}}=this,e=[];return t&o.Horizontal&&e.push("pan-y"),t&o.Vertical&&e.push("pan-x"),e}getEventNames(){return j.map(t=>this.options.event+t)}directionTest(t){const{options:e}=this;let n=!0,{distance:i}=t,{direction:r}=t;const s=t.deltaX,a=t.deltaY;return r&e.direction||(e.direction&o.Horizontal?(r=0===s?o.None:s<0?o.Left:o.Right,n=s!==this.pX,i=Math.abs(t.deltaX)):(r=0===a?o.None:a<0?o.Up:o.Down,n=a!==this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&Boolean(r&e.direction)}attrTest(t){const e=Boolean(this.state&r.Began),n=!(this.options.coherent?.length&&t.eventType&(i.End|i.Cancel));return super.attrTest(t)&&(e||n&&this.coherentTest(t)&&this.directionTest(t))}emit(t){this.pX=t.deltaX,this.pY=t.deltaY;const e=o[t.direction].toLowerCase();e&&(t.additionalEvent=this.options.event+e),super.emit(t)}handleTrackpadEvent(t){t.isFirst&&(this.trackpadGesture=!t.srcEvent.ctrlKey,!this.trackpadGesture&&this.state&(r.Recognized|r.Cancelled|r.Failed)&&(this.state=r.Possible)),this.trackpadGesture&&(this.recognize(this.getTrackpadInput(t,{deltaX:-t.deltaX,deltaY:-t.deltaY,velocity:-t.velocity,velocityX:-t.velocityX,velocityY:-t.velocityY,overallVelocity:-t.overallVelocity,overallVelocityX:-t.overallVelocityX,overallVelocityY:-t.overallVelocityY})),t.isFinal&&(this.trackpadGesture=!1))}}const I=["","start","move","end","cancel","in","out"];class PinchRecognizer extends TrackpadRecognizer{constructor(t={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,trackpad:!1,coherent:[],...t}),this.trackpadGesture=!1}getTouchAction(){return["none"]}getEventNames(){return I.map(t=>this.options.event+t)}attrTest(t){const e=Boolean(this.options.coherent?.length),n=Boolean(this.state&r.Began),o=!(e&&t.eventType&(i.End|i.Cancel));return super.attrTest(t)&&(n||o&&(e?this.coherentTest(t):Math.abs(t.scale-1)>this.options.threshold))}emit(t){if(1!==t.scale){const e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}super.emit(t)}handleTrackpadEvent(t){t.isFirst&&(this.trackpadGesture=t.srcEvent.ctrlKey,!this.trackpadGesture&&this.state&(r.Recognized|r.Cancelled|r.Failed)&&(this.state=r.Possible)),this.trackpadGesture&&(this.recognize(this.getTrackpadInput(t,{deltaX:0,deltaY:0,velocity:0,velocityX:0,velocityY:0,overallVelocity:0,overallVelocityX:0,overallVelocityY:0,scale:Math.exp(-t.deltaY/100)})),t.isFinal&&(this.trackpadGesture=!1))}}class input_Input{constructor(t,e,n){this.element=t,this.callback=e,this.options=n}listen(t,e){e?this.element.addEventListener(t,this.handleEvent,{passive:!1}):this.element.removeEventListener(t,this.handleEvent)}}const R="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",A=(globalThis,-1!==R.indexOf("firefox"));class WheelInput extends input_Input{constructor(t,e,n){n.enable=n.enable??!1,super(t,e,n),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;globalThis.WheelEvent&&(A&&t.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(e/=globalThis.devicePixelRatio),t.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(e*=40)),t.shiftKey&&e&&(e*=.25),this.callback({type:"wheel",center:{x:t.clientX,y:t.clientY},delta:-e,device:this.options.wheelSession?.device??"unknown",srcEvent:t,pointerType:"mouse",target:t.target})},n.enable&&(this.wheelSessionUnsubscribe=this.options.wheelSession?.on(()=>{}),this.listen("wheel",!0))}destroy(){this.listen("wheel",!1),this.wheelSessionUnsubscribe?.(),this.wheelSessionUnsubscribe=void 0}enableEventType(t,e){"wheel"===t&&this.options.enable!==e&&(this.options.enable=e,e&&!this.wheelSessionUnsubscribe&&(this.wheelSessionUnsubscribe=this.options.wheelSession?.on(()=>{})),this.listen("wheel",e),e||(this.wheelSessionUnsubscribe?.(),this.wheelSessionUnsubscribe=void 0))}}const C={classificationDelay:32,endDelay:80};class WheelGestureSession{constructor(t,e={}){this.subscriptions=new Map,this.session=null,this.classificationTimer=null,this.endTimer=null,this.pressedControlKeys=new Set,this.listeningForControlKeys=!1,this.handleEvent=t=>{if(!this.hasSubscribers)return"unknown";const e=function(t,e){let n=t.deltaX,i=t.deltaY;1===t.deltaMode&&(n*=40,i*=40);return{event:t,timeStamp:t.timeStamp,deltaX:n,deltaY:i,isControlKeyDown:e}}(t,this.pressedControlKeys.size>0);let n=this.session;if(n&&e.timeStamp-n.lastTimeStamp>=this.options.endDelay){if(this.end(),!this.hasSubscribers)return"unknown";n=null}n?(this.scheduleEnd(),this.addSample(n,e)):(n=this.startPendingSession(e),this.scheduleEnd());let{device:i}=n;return"unknown"===i&&(i=L(n.samples,!1),"unknown"!==i&&this.begin(n,i)),i},this.finishClassification=()=>{if(this.classificationTimer=null,!this.session||"unknown"!==this.session.device)return;const t=this.session,e=L(t.samples,!0);this.begin(t,"unknown"===e?"mouse":e)},this.end=()=>{if(!this.session)return;if("unknown"===this.session.device){const t=this.session,e=L(t.samples,!0);this.begin(t,"unknown"===e?"mouse":e)}if(!this.session)return;const t=this.session;this.emit(i.End,t.lastEvent),this.reset()},this.handleKeyDown=t=>{"Control"===t.key&&this.pressedControlKeys.add(t.code||t.key)},this.handleKeyUp=t=>{"Control"===t.key&&(t.code?this.pressedControlKeys.delete(t.code):this.pressedControlKeys.clear())},this.handleWindowBlur=()=>{this.pressedControlKeys.clear()},this.element=t,this.options={...C,...e},this.element?.addEventListener("wheel",this.handleEvent,{passive:!0})}get hasSubscribers(){return this.subscriptions.size>0}get device(){return this.session?.device??"unknown"}on(t){const e={listener:t};return this.subscriptions.set(t,e),this.updateControlKeyEventListeners(),()=>{this.subscriptions.get(t)===e&&this.off(t)}}off(t){this.subscriptions.delete(t),this.updateControlKeyEventListeners(),this.hasSubscribers||this.reset()}cancel(){const t=this.session;t&&"unknown"!==t.device&&this.emit(i.Cancel,t.lastEvent),this.reset()}destroy(){this.cancel(),this.subscriptions.clear(),this.updateControlKeyEventListeners(),this.element?.removeEventListener("wheel",this.handleEvent)}startPendingSession(t){const e={samples:[t],device:"unknown",firstTimeStamp:t.timeStamp,lastTimeStamp:t.timeStamp,totalDeltaX:t.deltaX,totalDeltaY:t.deltaY,velocityX:0,velocityY:0,lastEvent:t.event};return this.session=e,this.classificationTimer=globalThis.setTimeout(this.finishClassification,this.options.classificationDelay),e}addSample(t,e){if(t.samples.push(e),t.lastTimeStamp=e.timeStamp,t.lastEvent=e.event,t.totalDeltaX+=e.deltaX,t.totalDeltaY+=e.deltaY,"unknown"!==t.device){const n=t.samples[t.samples.length-2],o=e.timeStamp-n.timeStamp;t.velocityX=o>0?e.deltaX/o:0,t.velocityY=o>0?e.deltaY/o:0,this.emit(i.Move,e.event,{velocityX:t.velocityX,velocityY:t.velocityY})}}begin(t,e){t.device=e,this.clearClassificationTimer(),this.emit(i.Start,t.samples[0].event);const n=t.lastTimeStamp-t.firstTimeStamp;t.velocityX=n>0?t.totalDeltaX/n:0,t.velocityY=n>0?t.totalDeltaY/n:0,this.emit(i.Move,t.lastEvent,{velocityX:t.velocityX,velocityY:t.velocityY})}scheduleEnd(){this.clearEndTimer(),this.endTimer=globalThis.setTimeout(this.end,this.options.endDelay)}emit(t,e,n){const o=this.session;if(!o||"unknown"===o.device)return;const r=t===i.Start,s=t===i.End||t===i.Cancel,a=r?o.firstTimeStamp:o.lastTimeStamp,c=r?0:Math.max(0,a-o.firstTimeStamp),l=r?0:o.totalDeltaX,h=r?0:o.totalDeltaY,u=c>0?l/c:0,p=c>0?h/c:0,d=r?0:n?.velocityX??o.velocityX,f=r?0:n?.velocityY??o.velocityY,m={eventType:t,device:o.device,srcEvent:e,timeStamp:a,center:{x:e.clientX,y:e.clientY},deltaX:l,deltaY:h,deltaTime:c,velocity:Math.abs(d)>Math.abs(f)?d:f,velocityX:d,velocityY:f,overallVelocity:Math.abs(u)>Math.abs(p)?u:p,overallVelocityX:u,overallVelocityY:p,isFirst:r,isFinal:s};for(const{listener:t}of[...this.subscriptions.values()])t(m)}reset(){this.clearClassificationTimer(),this.clearEndTimer(),this.session=null}clearClassificationTimer(){null!==this.classificationTimer&&(globalThis.clearTimeout(this.classificationTimer),this.classificationTimer=null)}clearEndTimer(){null!==this.endTimer&&(globalThis.clearTimeout(this.endTimer),this.endTimer=null)}updateControlKeyEventListeners(){const t=this.hasSubscribers,e=function(){if("undefined"!=typeof window)return window;return globalThis.document?.defaultView}();e&&t!==this.listeningForControlKeys&&(this.listeningForControlKeys=t,t?(e.addEventListener("keydown",this.handleKeyDown,!0),e.addEventListener("keyup",this.handleKeyUp,!0),e.addEventListener("blur",this.handleWindowBlur)):(e.removeEventListener("keydown",this.handleKeyDown,!0),e.removeEventListener("keyup",this.handleKeyUp,!0),e.removeEventListener("blur",this.handleWindowBlur),this.pressedControlKeys.clear()))}}function L(t,e){return t.some(({event:t,isControlKeyDown:e})=>t.ctrlKey&&!e)?"trackpad":t.some(({event:t})=>0!==t.deltaMode)||t.some(z)||t.every(({event:t})=>{const e=t.wheelDelta;return void 0!==e&&Math.abs(e)%40==0})?"mouse":t.some(({deltaX:t})=>0!==t)||t.length>1&&function(t){for(let e=0;e<t.length;e++){const n=t[e];if(Math.abs(n.deltaX)>40||Math.abs(n.deltaY)>40)return!1;if(e>0&&n.timeStamp-t[e-1].timeStamp>40)return!1}return!0}(t)?"trackpad":e?"mouse":"unknown"}function z({event:t,deltaX:e,deltaY:n}){if(0!==e||0===n)return!1;const i=Math.abs(n/4.000244140625);if(Number.isInteger(i))return!0;const o=t.wheelDelta;return"number"==typeof o&&0!==o&&o%120==0}const N=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseenter","mouseleave"];class MoveInput extends input_Input{constructor(t,e,n){super(t,e,{enable:!0,...n}),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:i=!1}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,i&&N.forEach(t=>this.listen(t,!0))}destroy(){N.forEach(t=>this.listen(t,!1))}enableEventType(t,e){switch(t){case"pointermove":this.enableMoveEvent!==e&&(this.enableMoveEvent=e,this.listen("mousedown",e),this.listen("mousemove",e),this.listen("mouseup",e));break;case"pointerover":this.enableOverEvent!==e&&(this.enableOverEvent=e,this.listen("mouseover",e));break;case"pointerout":this.enableOutEvent!==e&&(this.enableOutEvent=e,this.listen("mouseout",e));break;case"pointerenter":this.enableEnterEvent!==e&&(this.enableEnterEvent=e,this.listen("mouseenter",e));break;case"pointerleave":this.enableLeaveEvent!==e&&(this.enableLeaveEvent=e,this.listen("mouseleave",e))}}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit("pointerover",t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit("pointerout",t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit("pointerenter",t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit("pointerleave",t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.buttons&&(this.pressed=!1),this.pressed||this._emit("pointermove",t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const k=["keydown","keyup"];class KeyInput extends input_Input{constructor(t,e,n){super(t,e,{enable:!0,tabIndex:0,...n}),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))};const{enable:i=!1}=this.options;this.enableDownEvent=i,this.enableUpEvent=i,t.tabIndex=this.options.tabIndex,t.style.outline="none",i&&k.forEach(t=>this.listen(t,!0))}destroy(){k.forEach(t=>this.listen(t,!1))}enableEventType(t,e){"keydown"===t&&this.enableDownEvent!==e&&(this.enableDownEvent=e,this.listen(t,e)),"keyup"===t&&this.enableUpEvent!==e&&(this.enableUpEvent=e,this.listen(t,e))}}class ContextmenuInput extends input_Input{constructor(t,e,n){n.enable=n.enable??!1,super(t,e,n),this.handleEvent=t=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},n.enable&&this.listen("contextmenu",!0)}destroy(){this.listen("contextmenu",!1)}enableEventType(t,e){"contextmenu"===t&&this.options.enable!==e&&(this.options.enable=e,this.listen("contextmenu",e))}}const D={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function F(t){const e=D[t.srcEvent.type];if(!e)return null;const{buttons:n,button:i}=t.srcEvent;let o=!1,r=!1,s=!1;return 2===e?(o=Boolean(1&n),r=Boolean(4&n),s=Boolean(2&n)):(o=0===i,r=1===i,s=2===i),{leftButton:o,middleButton:r,rightButton:s}}function U(t,e){const n=t.center;if(!n)return null;const i=e.getBoundingClientRect(),o=i.width/e.offsetWidth||1,r=i.height/e.offsetHeight||1;return{center:n,offsetCenter:{x:(n.x-i.left-e.clientLeft)/o,y:(n.y-i.top-e.clientTop)/r}}}const W={srcElement:"root",priority:0};class EventRegistrar{constructor(t,e){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")},this.eventManager=t,this.recognizerName=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,n,i=!1,o=!1){const{handlers:r,handlersByElement:s}=this,a={...W,...n};let c=s.get(a.srcElement);c||(c=[],s.set(a.srcElement,c));const l={type:t,handler:e,srcElement:a.srcElement,priority:a.priority};i&&(l.once=!0),o&&(l.passive=!0),r.push(l),this._active=this._active||!l.passive;let h=c.length-1;for(;h>=0&&!(c[h].priority>=l.priority);)h--;c.splice(h+1,0,l)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let o=n.length-1;o>=0;o--){const r=n[o];if(r.type===t&&r.handler===e){n.splice(o,1);const t=i.get(r.srcElement);t.splice(t.indexOf(r),1),0===t.length&&i.delete(r.srcElement)}}this._active=n.some(t=>!t.passive)}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},o=()=>{t.handled=!0,e=!0},r=[];for(let s=0;s<n.length;s++){const{type:a,handler:c,once:l}=n[s];if(c({...t,type:a,stopPropagation:i,stopImmediatePropagation:o}),l&&r.push(n[s]),e)break}for(let t=0;t<r.length;t++){const{type:e,handler:n}=r[t];this.remove(e,n)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...F(t),...U(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}function B(t){if("recognizer"in t)return t;let e;const n=Array.isArray(t)?[...t]:[t];if("function"==typeof n[0]){e=new(n.shift())(n.shift()||{})}else e=n.shift();return{recognizer:e,recognizeWith:"string"==typeof n[0]?[n[0]]:n[0],requireFailure:"string"==typeof n[1]?[n[1]]:n[1]}}class EventManager{constructor(t=null,e={}){if(this._onBasicInput=t=>{this.manager.emit(t.srcEvent.type,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...e},this.events=new Map,this.element=t,this.wheelSession=new WheelGestureSession(t),t){this.manager=new Manager(t,this.options);for(const t of this.options.recognizers){const{recognizer:e,recognizeWith:n,requireFailure:i}=B(t);this.manager.add(e),n&&e.recognizeWith(n),i&&e.requireFailure(i)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new WheelInput(t,this._onOtherEvent,{enable:!1,wheelSession:this.wheelSession}),this.moveInput=new MoveInput(t,this._onOtherEvent,{enable:!1}),this.keyInput=new KeyInput(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new ContextmenuInput(t,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element?(this.wheelInput.destroy(),this.wheelSession.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy()):this.wheelSession.destroy()}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}emit(t){this.manager?.emit(t.type,t)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);i&&(i.set({enable:e,wheelSession:this.wheelSession}),n.touchAction.update()),this.wheelInput?.enableEventType(t,e),this.moveInput?.enableEventType(t,e),this.keyInput?.enableEventType(t,e),this.contextmenuInput?.enableEventType(t,e)}_addEventHandler(t,e,n,i,o){if("string"!=typeof t){n=e;for(const[e,r]of Object.entries(t))this._addEventHandler(e,r,n,i,o);return}const{manager:r,events:s}=this;if(!r)return;let a=s.get(t);if(!a){const e=this._getRecognizerName(t)||t;a=new EventRegistrar(this,e),s.set(t,a),r&&r.on(t,a.handleEvent)}a.add(t,e,n,i,o),a.isEmpty()||this._toggleRecognizer(a.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const[e,n]of Object.entries(t))this._removeEventHandler(e,n);return}const{events:n}=this,i=n.get(t);if(i&&(i.remove(t,e),i.isEmpty())){const{recognizerName:t}=i;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}_getRecognizerName(t){return this.manager.recognizers.find(e=>e.getEventNames().includes(t))?.options.event}}}}]);
|