@arcgis/core 4.33.0-next.20250402 → 4.33.0-next.20250403
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0cec53e6f1464c69448d.js +1 -0
- package/assets/esri/core/workers/chunks/{322cb1b1871d03b69f0a.js → 5beb525b4adde1d98532.js} +33 -33
- package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +1 -0
- package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +1 -0
- package/assets/esri/core/workers/chunks/{7e00122014d0a55363a8.js → ccb289911e7445b17763.js} +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/buffer/internals/Vec2.js +1 -1
- package/interfaces.d.ts +23 -21
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/terrain/PatchGeometry.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainAttributes.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/ChangeSet.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/ITexture.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/TextureUpdater.js +5 -0
- package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/assets/esri/core/workers/chunks/a56da688088404259481.js +0 -1
- package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +0 -1
- package/assets/esri/core/workers/chunks/e9e517a2141e504eec64.js +0 -1
package/widgets/FeatureForm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{createResolver as s}from"../core/promiseUtils.js";import{watch as n,initial as a,whenOnce as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import _ from"./Feature/FeatureUtilityNetworkAssociations.js";import{isRelatableFeatureSupportedLayer as g}from"./Feature/support/featureUtils.js";import{css as b}from"./FeatureForm/css.js";import{isGroupInput as f,isFieldInput as y,isRelationshipInput as C,isTextElementInput as F,isUtilityNetworkAssociationInput as w,flattenInputs as R,isInputInGroupInput as k,isFieldElementWithInputType as I,getErrorMessageForFieldInput as O,getIconForFeature as N,isNumberFieldInput as M,subtypeChangeShouldPrompt as L}from"./FeatureForm/featureFormUtils.js";import T from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import x from"./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js";import{loadCalciteComponents as D}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as V,getIntlOptionsForField as S,numberingSystem as U,prepareISOFieldValueForDateComponents as E,prepareUnixFieldValueForDateComponents as j,normalizeTimeOnlyString as P,getISOFieldValueFromDateComponents as $,getUnixFieldValueFromDateComponents as H}from"./support/dateUtils.js";import{globalCss as Z}from"./support/globalCss.js";import{Heading as G,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as B}from"./support/widgetUtils.js";import{messageBundle as K}from"./support/decorators/messageBundle.js";import{vmEvent as q}from"./support/decorators/vmEvent.js";import{tsx as z}from"./support/jsxFactory.js";import{substitute as J}from"../intl/substitute.js";import{formatNumber as Q}from"../intl/number.js";const X="data-field-name";let Y=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new Map,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new T,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&g(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.feature),(()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),r((()=>!this.viewModel.updating)).then((()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0}))})),n((()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails]),(([e,t])=>{e&&(e.visibleElements.associationDetails=t)}),a),n((()=>this.groupDisplay),(()=>this._syncGroupInputStates())),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),n((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange())),n((()=>this.viewModel.activeAssociationInput),(e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}))])}loadDependencies(){return D({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return z("div",{class:this.classes(b.base,Z.widget,Z.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return z("div",null,z("form",{class:b.form,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderHeader(),this._renderContent()),this._prompt?z(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&z(G,{key:"title",level:this.headingLevel},t),s=null!=i&&z("p",{class:b.description,key:"description"},i);return z("div",{class:b.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return f(e)?this._renderGroup(e):y(e)?this._renderLabeledField(e):C(e)?this._renderRelationshipInput(e):F(e)?this._renderTextElementInput(e):w(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}_setUpUtilityNetworkAssociationList(){this._featureFormUNAssociationList||(this._featureFormUNAssociationList=new x({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)}))}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._setUpUtilityNetworkAssociationList(),o(this._associationsWidgetsMap,e,(()=>new _({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel}))).render()}_renderDescriptionOrEmpty(e,t){return null==e?null:z("div",{class:this.classes(b.description),id:t},e)}_renderGroup(e){const{disabled:t,formTemplate:i,headingLevel:o}=this,{description:s,id:n,inputs:a,label:r,open:l}=e,d=a.filter((e=>e.visible)),c=this.viewModel.findField(this._focusedFieldName),u=c?.group===e,p="sequential"===this.groupDisplay;return z("calcite-block",{class:this.classes(b.group,p?b.groupSequential:null,u?b.groupActive:null,t?b.inputDisabled:null),collapsible:!0,"data-group":e,description:s||void 0,disabled:t,heading:r??"",headingLevel:i?.title?W(o):o,id:n,key:n,open:l,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},d.map((e=>this._renderInput(e))))}_getFocusableInput(e,t){const i=R(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(f(t)){const e=t.inputs.find((e=>e.visible));o=e?i.indexOf(e):0}else{let s;if(k(t)&&!t.group.open){const i=t.group.inputs.filter(y);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&y(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?J(this.messages.requiredFieldLabel,{name:o}):o,class:b.label,key:`${s.id}-${i.uid}-${e.name}`},r=[z("div",{class:b.labelTextContent,key:"labelTextContainer"},o,n?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?z("label",{...a},r):z("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?z("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return z("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,V(i,t.value,{timeZone:this.timeZone,...S(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[X],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:U,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[X],key:`${n}-time-input`,numberingSystem:U,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:U,overlayPositioning:"fixed",readOnly:d,[X]:i,onfocus:this._onComponentFocus},m=E(c,s),h=E(u,s),v=E(a,s);return z("div",{class:b.dateInputContainer,key:`${l}-date-time-container`},z("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),z("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?z("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:U,overlayPositioning:"fixed",readOnly:c,[X]:o,onfocus:this._onComponentFocus},m=j(n,u),h=j(l,u),v=j(d,u);return z("div",{class:b.dateInputContainer,key:`${r}-date-time-container`},z("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?z("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(b.fieldInput,b.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.arcadeEditType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return z("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,disabled:i.readOnly,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map((e=>e.map((({name:e,value:t})=>z("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))))),u=[];d.length>0&&u.push(z("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(z("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(z("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.arcadeEditType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(z("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i})));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:b.inputRadioGroup,"data-field-name":i[X],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!I(e.element,"switch")&&i===e.element.input.onValue;return z("calcite-switch",{...t,checked:o,class:b.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return z("calcite-label",{class:b.inputRadioLabel,key:e,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:b.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?O(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?z("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?z("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return z("calcite-list-item",{description:J(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o}=e,{messages:s,callbacks:n}=this;if(t&&n?.addRelatedRecord&&o)return z("calcite-button",{alignment:"center",appearance:"outline-fill",class:b.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?s.addRecord:s.addFeature)}_renderRelatedRecordListItem(e,t){const{feature:i,description:o,title:s}=e,{feature:n,callbacks:a}=this,{highlightHelper:r}=this.viewModel,l=()=>{r?.removeAll(),a?.editRelatedRecord&&n&&a.editRelatedRecord({parentFeature:n,relationshipId:t,relatedFeature:i})},d=r?()=>r.add(i):void 0,c=r?()=>r.remove(i):void 0;return z("calcite-list-item",{bind:this,description:o,key:`${t}-${i.uid}`,label:s,onclick:l,onmouseenter:d,onmouseleave:c,value:s},z("calcite-icon",{icon:N(i),slot:"content-start"}),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return z("calcite-label",{class:this.classes(b.label,b.relatedRecordsLabel),key:`relationship-${t}-container`},z("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return z("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map((t=>this._renderCategory(e,t))),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=Q(i);return z("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},z("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),z("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return z("calcite-list-item",{description:J(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return z("div",{class:b.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},z("span",null,e.label),t?z("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return z("calcite-list",{class:b.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=J(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return z("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:b.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return z("div",{class:b.textElement,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(b.fieldInput,h?b.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[X]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(X))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver((()=>{switch(e.value=void 0,t.field.type){case"date":e.value=j(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=E(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)}));i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);M(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,k(i)&&(i.group.open=!0),B(e))}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=P(r),l=P(e.value)):l="timestamp-offset"===o?null!=e.value?$({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?H({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&L(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:o}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(o,t),!l?.length)return;const d=l.find((e=>e.code===t)),c=l.find((e=>e.code===i))?.name??`${i}`;if(!d)return;const u=s();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:J(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&k(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return I(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.open?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach((e=>{e!==t&&(e.open=!1)}))):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter((e=>e.open));0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach((e=>e.open=!1))}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],Y.prototype,"_listObserverNode",void 0),e([l()],Y.prototype,"_relatedRecordsEnabled",null),e([l()],Y.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],Y.prototype,"_prompt",void 0),e([l()],Y.prototype,"_subtypes",null),e([l()],Y.prototype,"associationId",null),e([l()],Y.prototype,"associatedLayer",null),e([l()],Y.prototype,"disabled",null),e([l()],Y.prototype,"feature",null),e([l()],Y.prototype,"_featureFormUNAssociationList",void 0),e([l()],Y.prototype,"formTemplate",null),e([l()],Y.prototype,"groupDisplay",void 0),e([l()],Y.prototype,"headingLevel",void 0),e([l()],Y.prototype,"icon",null),e([l()],Y.prototype,"label",null),e([l()],Y.prototype,"layer",null),e([l()],Y.prototype,"map",null),e([l(),K("esri/widgets/FeatureForm/t9n/FeatureForm")],Y.prototype,"messages",void 0),e([l(),K("esri/t9n/common")],Y.prototype,"messagesCommon",void 0),e([l(),K("esri/widgets/Feature/t9n/Feature")],Y.prototype,"messagesFeature",void 0),e([l(),K("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],Y.prototype,"messagesTemplates",void 0),e([l()],Y.prototype,"callbacks",null),e([l()],Y.prototype,"relationshipId",null),e([l()],Y.prototype,"spatialReference",null),e([l()],Y.prototype,"strict",null),e([l()],Y.prototype,"timeZone",null),e([l()],Y.prototype,"showPrompt",null),e([l()],Y.prototype,"clearPrompt",null),e([l(),q(["value-change","submit"])],Y.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],Y.prototype,"visibleElements",void 0),e([l()],Y.prototype,"test",null),Y=e([d("esri.widgets.FeatureForm")],Y);const ee=Y;export{ee as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{createResolver as o}from"../core/promiseUtils.js";import s from"../core/ReactiveMap.js";import{watch as n,initial as a,whenOnce as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as _}from"./Feature/support/featureUtils.js";import{css as g}from"./FeatureForm/css.js";import{isGroupInput as b,isFieldInput as f,isRelationshipInput as y,isTextElementInput as C,isUtilityNetworkAssociationInput as F,flattenInputs as w,isInputInGroupInput as R,isFieldElementWithInputType as k,getErrorMessageForFieldInput as I,getIconForFeature as O,isNumberFieldInput as N,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import L from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as T}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as x,getIntlOptionsForField as D,numberingSystem as V,prepareISOFieldValueForDateComponents as S,prepareUnixFieldValueForDateComponents as U,normalizeTimeOnlyString as E,getISOFieldValueFromDateComponents as j,getUnixFieldValueFromDateComponents as P}from"./support/dateUtils.js";import{globalCss as $}from"./support/globalCss.js";import{Heading as H,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as Z}from"./support/widgetUtils.js";import{messageBundle as G}from"./support/decorators/messageBundle.js";import{vmEvent as B}from"./support/decorators/vmEvent.js";import{tsx as K}from"./support/jsxFactory.js";import{substitute as q}from"../intl/substitute.js";import{formatNumber as z}from"../intl/number.js";const J="data-field-name";let Q=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new s,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new L,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&_(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.feature),(()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),r((()=>!this.viewModel.updating)).then((()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0}))})),n((()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails]),(([e,t])=>{e&&(e.visibleElements.associationDetails=t)}),a),n((()=>this.groupDisplay),(()=>this._syncGroupInputStates())),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),n((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange())),n((()=>this.viewModel.activeAssociationInput),(e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)})),n((()=>this.viewModel.inputs.filter(F)),(async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))}))])}loadDependencies(){return T({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return K("div",{class:this.classes(g.base,$.widget,$.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return K("div",null,K("form",{class:g.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderHeader(),this._renderContent()),this._prompt?K(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&K(H,{key:"title",level:this.headingLevel},t),s=null!=i&&K("p",{class:g.description,key:"description"},i);return K("div",{class:g.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroup(e):f(e)?this._renderLabeledField(e):y(e)?this._renderRelationshipInput(e):C(e)?this._renderTextElementInput(e):F(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:K("div",{class:this.classes(g.description),id:t},e)}_renderGroup(e){const{disabled:t,formTemplate:i,headingLevel:o}=this,{description:s,id:n,inputs:a,label:r,open:l}=e,d=a.filter((e=>e.visible)),c=this.viewModel.findField(this._focusedFieldName),u=c?.group===e,p="sequential"===this.groupDisplay;return K("calcite-block",{class:this.classes(g.group,p?g.groupSequential:null,u?g.groupActive:null,t?g.inputDisabled:null),collapsible:!0,"data-group":e,description:s||void 0,disabled:t,heading:r??"",headingLevel:i?.title?W(o):o,id:n,key:n,open:l,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},d.map((e=>this._renderInput(e))))}_getFocusableInput(e,t){const i=w(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(b(t)){const e=t.inputs.find((e=>e.visible));o=e?i.indexOf(e):0}else{let s;if(R(t)&&!t.group.open){const i=t.group.inputs.filter(f);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&f(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?q(this.messages.requiredFieldLabel,{name:o}):o,class:g.label,key:`${s.id}-${i.uid}-${e.name}`},r=[K("div",{class:g.labelTextContent,key:"labelTextContainer"},o,n?K("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?K("label",{...a},r):K("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?K("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return K("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,x(i,t.value,{timeZone:this.timeZone,...D(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return K("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[J],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return K("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[J],key:`${n}-time-input`,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:V,overlayPositioning:"fixed",readOnly:d,[J]:i,onfocus:this._onComponentFocus},m=S(c,s),h=S(u,s),v=S(a,s);return K("div",{class:g.dateInputContainer,key:`${l}-date-time-container`},K("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),K("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?K("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:V,overlayPositioning:"fixed",readOnly:c,[J]:o,onfocus:this._onComponentFocus},m=U(n,u),h=U(l,u),v=U(d,u);return K("div",{class:g.dateInputContainer,key:`${r}-date-time-container`},K("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?K("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return K("calcite-input",{...i,class:this.classes(g.fieldInput,g.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.arcadeEditType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return K("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,disabled:i.readOnly,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map((e=>e.map((({name:e,value:t})=>K("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))))),u=[];d.length>0&&u.push(K("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(K("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(K("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.arcadeEditType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(K("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i})));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return K("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:g.inputRadioGroup,"data-field-name":i[J],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!k(e.element,"switch")&&i===e.element.input.onValue;return K("calcite-switch",{...t,checked:o,class:g.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return K("calcite-label",{class:g.inputRadioLabel,key:e,layout:"inline"},K("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:g.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?I(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?K("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?K("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o}=e,{messages:s,callbacks:n}=this;if(t&&n?.addRelatedRecord&&o)return K("calcite-button",{alignment:"center",appearance:"outline-fill",class:g.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?s.addRecord:s.addFeature)}_renderRelatedRecordListItem(e,t){const{feature:i,description:o,title:s}=e,{feature:n,callbacks:a}=this,{highlightHelper:r}=this.viewModel,l=()=>{r?.removeAll(),a?.editRelatedRecord&&n&&a.editRelatedRecord({parentFeature:n,relationshipId:t,relatedFeature:i})},d=r?()=>r.add(i):void 0,c=r?()=>r.remove(i):void 0;return K("calcite-list-item",{bind:this,description:o,key:`${t}-${i.uid}`,label:s,onclick:l,onmouseenter:d,onmouseleave:c,value:s},K("calcite-icon",{icon:O(i),slot:"content-start"}),K("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return K("calcite-label",{class:this.classes(g.label,g.relatedRecordsLabel),key:`relationship-${t}-container`},K("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return K("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map((t=>this._renderCategory(e,t))),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=z(i);return K("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},K("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),K("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return K("div",{class:g.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},K("span",null,e.label),t?K("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return K("calcite-list",{class:g.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=q(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return K("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:g.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return K("div",{class:g.textElement,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(g.fieldInput,h?g.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[J]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(J))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver((()=>{switch(e.value=void 0,t.field.type){case"date":e.value=U(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=S(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)}));i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);N(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,R(i)&&(i.group.open=!0),Z(e))}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=E(r),l=E(e.value)):l="timestamp-offset"===o?null!=e.value?j({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?P({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&M(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:s}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(s,t),!l?.length)return;const d=l.find((e=>e.code===t)),c=l.find((e=>e.code===i))?.name??`${i}`;if(!d)return;const u=o();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:q(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&R(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return k(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.open?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach((e=>{e!==t&&(e.open=!1)}))):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter((e=>e.open));0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach((e=>e.open=!1))}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],Q.prototype,"_listObserverNode",void 0),e([l()],Q.prototype,"_relatedRecordsEnabled",null),e([l()],Q.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],Q.prototype,"_prompt",void 0),e([l()],Q.prototype,"_subtypes",null),e([l()],Q.prototype,"associationId",null),e([l()],Q.prototype,"associatedLayer",null),e([l()],Q.prototype,"disabled",null),e([l()],Q.prototype,"feature",null),e([l()],Q.prototype,"_featureFormUNAssociationList",void 0),e([l()],Q.prototype,"formTemplate",null),e([l()],Q.prototype,"groupDisplay",void 0),e([l()],Q.prototype,"headingLevel",void 0),e([l()],Q.prototype,"icon",null),e([l()],Q.prototype,"label",null),e([l()],Q.prototype,"layer",null),e([l()],Q.prototype,"map",null),e([l(),G("esri/widgets/FeatureForm/t9n/FeatureForm")],Q.prototype,"messages",void 0),e([l(),G("esri/t9n/common")],Q.prototype,"messagesCommon",void 0),e([l(),G("esri/widgets/Feature/t9n/Feature")],Q.prototype,"messagesFeature",void 0),e([l(),G("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],Q.prototype,"messagesTemplates",void 0),e([l()],Q.prototype,"callbacks",null),e([l()],Q.prototype,"relationshipId",null),e([l()],Q.prototype,"spatialReference",null),e([l()],Q.prototype,"strict",null),e([l()],Q.prototype,"timeZone",null),e([l()],Q.prototype,"showPrompt",null),e([l()],Q.prototype,"clearPrompt",null),e([l(),B(["value-change","submit"])],Q.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],Q.prototype,"visibleElements",void 0),e([l()],Q.prototype,"test",null),Q=e([d("esri.widgets.FeatureForm")],Q);const X=Q;export{X as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Color.js";import i from"../../../core/Evented.js";import r from"../../../core/Logger.js";import{rad2deg as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as n,watch as a}from"../../../core/reactiveUtils.js";import{convertUnit as l}from"../../../core/unitUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Point.js";import{isLoadedOrLoadFor as d,project as m}from"../../../geometry/projection.js";import{getResolutionForScale as g}from"../../../geometry/support/scaleUtils.js";import{MeasuredGrid as u}from"../../../grids/MeasuredGrid.js";import{makeDehydratedPoint as v}from"../../../layers/graphics/dehydratedPoint.js";import{defaultUnitPropertyMetadata as y}from"../../../properties/defaultUnit.js";import _ from"../../../symbols/SimpleLineSymbol.js";import w from"../../../symbols/SimpleMarkerSymbol.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as f}from"../../../views/2d/grid/constants.js";import{getScaleFactor as S,shouldUsePlanar as b,measureMetersPerUnitAtReferencePoint as P}from"../../../views/2d/grid/gridUtils.js";import{DrawGraphicTool2D as T}from"../../../views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js";import"../../../views/2d/interactive/editingTools/ControlPointsTransformTool.js";import"../../../views/2d/interactive/editingTools/TransformTool.js";import"../../../views/2d/interactive/editingTools/MediaTransformToolsWrapper.js";import j from"../../../views/interactive/snapping/SnappingOptions.js";import{gridPlacementGraphicSymbol as C}from"../../../views/interactive/snapping/snappingUtils.js";import x from"../../../views/overlay/CrosshairOverlayItem.js";import G from"../../../views/overlay/TextOverlayItem.js";import{degreeSymbol as O}from"../../CoordinateConversion/support/formatUtils.js";import{applyColorToGrid as R,gridRotationToDegrees as I}from"./gridUtils.js";const L=Symbol("grid-interactivity");let M=class extends i.EventedAccessor{constructor(t){super(t),this._drawGraphicTool=null,this._crosshairLabel=null,this._crosshairItem=null,this.snappingManager=null,this.snappingOptions=null,this.view=null,this.placementDisabled=!1,this._mostRecentlyShownGrid=null,this._sketchedVertexCount=0}initialize(){this.addHandles([n((()=>!this.displayEnabled),(()=>{this.interactivePlacementState=null})),a((()=>this.view?.viewpoint),(()=>{this._renderOverlays()})),a((()=>this.snappingOptions?.gridEnabled),(t=>{null!=t&&this.trySetDisplayEnabled(t)})),a((()=>this.view?.grid),((t,e)=>{this._mostRecentlyShownGrid=!t&&e?e:null}))])}destroy(){this._resetGridPlacementState(),this._crosshairItem&&(this.view?.overlay?.removeItem(this._crosshairItem),this._crosshairItem=o(this._crosshairItem)),this._crosshairLabel&&(this.view?.overlay?.removeItem(this._crosshairLabel),this._crosshairLabel=o(this._crosshairLabel))}get displayEnabled(){return!!this.view?.grid}get dynamicScaling(){return this.grid?.dynamicScaling??!1}set dynamicScaling(t){this.grid&&(this.grid.dynamicScaling=t)}get grid(){return this.view?.grid??this._mostRecentlyShownGrid}set gridColor(t){this._set("gridColor",t);const[e,i,r,s]=t.toArray();R(this.grid,[e,i,r,s/255])}get gridControlsEnabled(){return this.displayEnabled&&!this.interactivePlacementState}set interactivePlacementState(t){this._set("interactivePlacementState",t),this._resetGridPlacementState(),t&&this._startGridManipulation(t)}get majorLineInterval(){return this.grid?.majorLineInterval??10}set majorLineInterval(t){this.grid&&(this.grid.majorLineInterval=t<1?1:t>15?15:t)}get rotateWithMap(){return this.grid?.rotateWithMap??!1}set rotateWithMap(t){this.grid&&(this.grid.rotateWithMap=t)}get rotation(){return this.grid?.rotation??-180}set rotation(t){this.grid&&(this.grid.rotation=t)}get snappingEnabled(){return(this.grid&&this.snappingOptions?.gridEnabled)??!1}set snappingEnabled(t){const{snappingOptions:e}=this;e&&(e.gridEnabled=t)}get spacing(){return this.grid?.spacing??1}set spacing(t){this.grid&&t>0&&(this.grid.spacing=t)}get unit(){return this.grid?.units}set unit(t){this.grid&&(this.grid.units=t)}get gridOutOfScale(){return!this.dynamicScaling&&null!=this._pixelsPerStride&&this._pixelsPerStride<f}get effectiveSpacingAfterDynamicScaling(){return this.majorLineInterval<1||!this.dynamicScaling||!this.view||null==this._pixelsPerStride||!this.grid?.spacing?null:this.grid.spacing*S(this.majorLineInterval,this._pixelsPerStride,this.dynamicScaling)}get numericSpacingInputShouldBeVisible(){return!!this.view?.spatialReference&&b(this.view.spatialReference)}get _metersPerSRUnit(){if(!(this.view&&this.displayEnabled&&this.grid&&d(this.grid.center.spatialReference,this.view.spatialReference)))return null;const t=m(this.grid.center,this.view.spatialReference);return P(t)}get _pixelsPerStride(){if(!this.view?.scale||!this.displayEnabled||!this.grid||null==this._metersPerSRUnit)return null;const t=this.grid,{scale:e,spatialReference:i}=this.view;return l(t.spacing,t.units,"meters")/(this._metersPerSRUnit*g(e,i))}get _isPlacing(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"place"===t||"interactive"===t&&0===this._sketchedVertexCount}get _isRotating(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"rotate"===t||"interactive"===t&&1===this._sketchedVertexCount}get _isScaling(){if(!this._drawGraphicTool)return!1;return"interactive"===this.interactivePlacementState&&1===this._sketchedVertexCount}togglePlacementState(t){this.interactivePlacementState=this.interactivePlacementState===t?null:t}trySetDisplayEnabled(t){const{view:e}=this;if(e?.ready)if(!e.grid&&t)if(this._mostRecentlyShownGrid)e.grid=this._mostRecentlyShownGrid;else{const t="imperial"===this.defaultUnit?"feet":"meters";e.grid=new u({units:t,center:e.center??new p,rotateWithMap:!0}),R(this.grid,[115,115,115])}else t||(e.grid=null);else r.getLogger(this).warn("Attempting to enable grid display while view is not ready")}startPlacement(t){const{view:e,snappingManager:i}=this;if(!e)return;this._set("interactivePlacementState",t),this._sketchedVertexCount=0;const r=new T({view:e,graphicProperties:{attributes:{[C]:C}},sketchOptions:{tooltips:{enabled:!0,visibleElements:{direction:!1,rotation:!1,totalLength:!1,elevation:!1,distance:!1,area:!1}}},geometryType:"polyline",mode:"click",snapToScene:!1,snappingManager:i,forceUniformSize:!0,centered:!1,cursor:"interactive"===this.interactivePlacementState||"place"===this.interactivePlacementState?"none":null,regularVerticesSymbol:void 0,activeVertexSymbol:U,activeLineSymbol:E,graphicSymbol:E});this._drawGraphicTool=r,e.addAndActivateTool(r),this._renderOverlays(),this.addHandles([r.on("cursor-update",(t=>this._onCursorUpdate(t))),r.on("complete",(()=>this._onDrawComplete())),r.on("vertex-add",(e=>this._onVertexAdd(e,t)))],L)}async _startGridManipulation(t){const{view:e}=this;if(!e)return void(this.interactivePlacementState=null);const i=new CustomEvent("before-placement",{cancelable:!0});this.emit("before-placement",i),i.defaultPrevented||this.startPlacement(t)}_onCursorUpdate(t){try{if(this._isPlacing){const e=t.vertices[0].coordinates;return void this._handlePlace(e)}if(this._drawGraphicTool.cursor=null,this._isRotating&&this._handleRotate(t.vertices[0].coordinates),this._isScaling){const t=this._drawGraphicTool?.drawOperation.cursorVertex;this._handleScale(t)}}finally{this._renderOverlays()}}_onDrawComplete(){this._drawGraphicTool.cursor=null,this.interactivePlacementState=null}_onVertexAdd(t,e){const i=t.vertices[0].coordinates;this._isPlacing&&this._handlePlace(i),this._isRotating&&this._sketchedVertexCount>0&&this._handleRotate(i),this._isScaling&&this._sketchedVertexCount>0&&this._handleScale(v(i[0],i[1],void 0,this.view.spatialReference)),this._sketchedVertexCount++,this._drawGraphicTool.cursor=null,2!==this._sketchedVertexCount&&"interactive"===e||(this.interactivePlacementState=null),this._renderOverlays()}_handlePlace(t){const{grid:e,view:i}=this;e&&i&&(e.center=new p({x:t[0],y:t[1],spatialReference:i.spatialReference}))}_handleRotate(t){const{grid:e,view:i}=this;if(!e||!i)return;this._drawGraphicTool?.sketchOptions.tooltips.set("enabled",!1);const{x:r,y:o}=e.center,[n,a]=t,l=i.toScreen(e.center,{pickClosestTarget:!0}),c=l&&i.toMap(l),h=i.toScreen(v(n,a,void 0,i.spatialReference),{pickClosestTarget:!0}),p=h&&i.toMap(h),d=c?c.x:r,m=c?c.y:o,g=d-(p?p.x:n),u=m-(p?p.y:a);if(0===g&&0===u)return;const y=Math.atan2(u,g),_=s(y),w=e.rotateWithMap,f=i.viewpoint.rotation??0,S=w?_:_-f;e.rotation=Math.fround(S)%360}_handleScale(t){const{view:e,grid:i,_drawGraphicTool:r,interactivePlacementState:s,_metersPerSRUnit:o}=this;if(!(t&&e&&i&&r&&o))return;r.sketchOptions.tooltips.enabled=!1;const n="interactive"===s?i.center:r.drawOperation.firstVertex;if(!n||!t)return;const a=e?.toScreen(n),c=a&&e.toMap(a),h=e?.toScreen(t),p=c??n,d=(h&&e.toMap(h))??t,m=Math.sqrt((p.x-d.x)**2+(p.y-d.y)**2),g=l(m*o,"meters",i.units);this.spacing=g}_renderOverlays(){this._renderCrosshairOverlay(),this._renderTextOverlay()}_renderTextOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this,r=this._getCrosshairLabel();if(!(t&&e?.overlay&&i&&r))return;const s=e.toScreen(t.center,{pickClosestTarget:!0});s&&(r.position=[s.x+12,s.y+12]),this._isRotating?(r.text=`${I(t.rotation)}${O}`,r.visible=!0):r.visible=!1}_renderCrosshairOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this;if(!t||!e?.overlay||!i)return;const r=this._getCrosshair();if(!r)return;const s=e.toScreen(t.center);s&&(r.x=s.x,r.y=s.y,r.rotation=t.rotateWithMap?e.viewpoint.rotation-t.rotation:-t.rotation,r.visible=!!i)}_getCrosshairLabel(){if(this._crosshairLabel)return this._crosshairLabel;const{grid:t,view:i,_drawGraphicTool:r}=this;if(!t||!i?.overlay||!r)return null;const s=new G({anchor:"top-left",fontSize:10,textColor:new e([21,21,21]),backgroundColor:new e([248,248,248]),padding:8,borderRadius:20});return i.overlay.addItem(s),this._crosshairLabel=s,s}_getCrosshair(){const{_crosshairItem:t,view:e}=this;return e?.overlay?t&&e.overlay.items.includes(t)?t:(this._crosshairItem=new x({color:e.effectiveTheme.accentColor,thickness:4,length:36,visible:!0}),e.overlay?.addItem(this._crosshairItem),this._crosshairItem):null}_resetGridPlacementState(){this.removeHandles(L),this._crosshairItem&&(this._crosshairItem.visible=!1),this._crosshairLabel&&(this._crosshairLabel.visible=!1),this._drawGraphicTool&&(this.view?.activeTool===this._drawGraphicTool&&(this.view.activeTool=null),this.view?.tools.remove(this._drawGraphicTool)),this._drawGraphicTool=o(this._drawGraphicTool)}};t([c(y)],M.prototype,"defaultUnit",void 0),t([c({readOnly:!0})],M.prototype,"displayEnabled",null),t([c()],M.prototype,"dynamicScaling",null),t([c()],M.prototype,"grid",null),t([c({type:e})],M.prototype,"gridColor",null),t([c({readOnly:!0})],M.prototype,"gridControlsEnabled",null),t([c()],M.prototype,"interactivePlacementState",null),t([c()],M.prototype,"majorLineInterval",null),t([c()],M.prototype,"rotateWithMap",null),t([c()],M.prototype,"rotation",null),t([c()],M.prototype,"snappingEnabled",null),t([c()],M.prototype,"snappingManager",void 0),t([c({type:j})],M.prototype,"snappingOptions",void 0),t([c()],M.prototype,"spacing",null),t([c()],M.prototype,"unit",null),t([c()],M.prototype,"view",void 0),t([c({readOnly:!0})],M.prototype,"gridOutOfScale",null),t([c({readOnly:!0})],M.prototype,"effectiveSpacingAfterDynamicScaling",null),t([c({readOnly:!0})],M.prototype,"numericSpacingInputShouldBeVisible",null),t([c()],M.prototype,"placementDisabled",void 0),t([c()],M.prototype,"_metersPerSRUnit",null),t([c()],M.prototype,"_pixelsPerStride",null),t([c()],M.prototype,"_isPlacing",null),t([c()],M.prototype,"_isRotating",null),t([c()],M.prototype,"_isScaling",null),t([c()],M.prototype,"_mostRecentlyShownGrid",void 0),t([c()],M.prototype,"_sketchedVertexCount",void 0),M=t([h("esri.widgets.support.GridControls.GridControlsViewModel")],M);const k=M,E=new _({width:0}),U=new w({color:e.fromArray([0,0,0,0]),outline:new _({color:e.fromArray([0,0,0,0])})});export{k as default};
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Color.js";import i from"../../../core/Evented.js";import r from"../../../core/Logger.js";import{rad2deg as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as n,watch as a}from"../../../core/reactiveUtils.js";import{convertUnit as l}from"../../../core/unitUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../geometry/Point.js";import{isLoadedOrLoadFor as p,project as m}from"../../../geometry/projection.js";import{getResolutionForScale as g}from"../../../geometry/support/scaleUtils.js";import{MeasuredGrid as u}from"../../../grids/MeasuredGrid.js";import{makeDehydratedPoint as v}from"../../../layers/graphics/dehydratedPoint.js";import{defaultUnitPropertyMetadata as y}from"../../../properties/defaultUnit.js";import _ from"../../../symbols/SimpleLineSymbol.js";import w from"../../../symbols/SimpleMarkerSymbol.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as f}from"../../../views/2d/grid/constants.js";import{getScaleFactor as S,shouldUsePlanar as b,measureMetersPerUnitAtReferencePoint as P}from"../../../views/2d/grid/gridUtils.js";import{DrawGraphicTool2D as j}from"../../../views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js";import"../../../views/2d/interactive/editingTools/ControlPointsTransformTool.js";import"../../../views/2d/interactive/editingTools/TransformTool.js";import"../../../views/2d/interactive/editingTools/MediaTransformToolsWrapper.js";import C from"../../../views/interactive/snapping/SnappingOptions.js";import{gridPlacementGraphicSymbol as T}from"../../../views/interactive/snapping/snappingUtils.js";import x from"../../../views/overlay/CrosshairOverlayItem.js";import G from"../../../views/overlay/TextOverlayItem.js";import{degreeSymbol as O}from"../../CoordinateConversion/support/formatUtils.js";import{applyColorToGrid as R,gridRotationToDegrees as L}from"./gridUtils.js";const I=Symbol("grid-interactivity");let M=class extends i.EventedAccessor{constructor(t){super(t),this._drawGraphicTool=null,this._crosshairLabel=null,this._crosshairItem=null,this.snappingManager=null,this.snappingOptions=null,this.view=null,this.placementDisabled=!1,this._mostRecentlyShownGrid=null,this._sketchedVertexCount=0}initialize(){this.addHandles([n((()=>!this.displayEnabled),(()=>{this.interactivePlacementState=null})),a((()=>this.view?.viewpoint),(()=>{this._renderOverlays()})),a((()=>this.snappingOptions?.gridEnabled),(t=>{null!=t&&this.trySetDisplayEnabled(t)})),a((()=>this.view?.grid),((t,e)=>{this._mostRecentlyShownGrid=!t&&e?e:null}))])}destroy(){this._resetGridPlacementState(),this._crosshairItem&&(this.view?.overlay?.removeItem(this._crosshairItem),this._crosshairItem=o(this._crosshairItem)),this._crosshairLabel&&(this.view?.overlay?.removeItem(this._crosshairLabel),this._crosshairLabel=o(this._crosshairLabel))}get displayEnabled(){return!!this.view?.grid}get dynamicScaling(){return this.grid?.dynamicScaling??!1}set dynamicScaling(t){this.grid&&(this.grid.dynamicScaling=t)}get grid(){return this.view?.grid??this._mostRecentlyShownGrid}set gridColor(t){if(t?.equals(this.grid?.majorLineColor))return;if(!t)return;const[e,i,r,s]=t.toArray();R(this.grid,[e,i,r,s/255])}get gridColor(){return this.grid?.majorLineColor}get gridControlsEnabled(){return this.displayEnabled&&!this.interactivePlacementState}set interactivePlacementState(t){this._set("interactivePlacementState",t),this._resetGridPlacementState(),t&&this._startGridManipulation(t)}get majorLineInterval(){return this.grid?.majorLineInterval??10}set majorLineInterval(t){this.grid&&(this.grid.majorLineInterval=t<1?1:t>15?15:t)}get rotateWithMap(){return this.grid?.rotateWithMap??!1}set rotateWithMap(t){this.grid&&(this.grid.rotateWithMap=t)}get rotation(){return this.grid?.rotation??-180}set rotation(t){this.grid&&(this.grid.rotation=t)}get snappingEnabled(){return(this.grid&&this.snappingOptions?.gridEnabled)??!1}set snappingEnabled(t){const{snappingOptions:e}=this;e&&(e.gridEnabled=t)}get spacing(){return this.grid?.spacing??1}set spacing(t){this.grid&&t>0&&(this.grid.spacing=t)}get unit(){return this.grid?.units}set unit(t){this.grid&&(this.grid.units=t)}get gridOutOfScale(){return!this.dynamicScaling&&null!=this._pixelsPerStride&&this._pixelsPerStride<f}get effectiveSpacingAfterDynamicScaling(){return this.majorLineInterval<1||!this.dynamicScaling||!this.view||null==this._pixelsPerStride||!this.grid?.spacing?null:this.grid.spacing*S(this.majorLineInterval,this._pixelsPerStride,this.dynamicScaling)}get numericSpacingInputShouldBeVisible(){return!!this.view?.spatialReference&&b(this.view.spatialReference)}get _metersPerSRUnit(){if(!(this.view&&this.displayEnabled&&this.grid&&p(this.grid.center.spatialReference,this.view.spatialReference)))return null;const t=m(this.grid.center,this.view.spatialReference);return P(t)}get _pixelsPerStride(){if(!this.view?.scale||!this.displayEnabled||!this.grid||null==this._metersPerSRUnit)return null;const t=this.grid,{scale:e,spatialReference:i}=this.view;return l(t.spacing,t.units,"meters")/(this._metersPerSRUnit*g(e,i))}get _isPlacing(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"place"===t||"interactive"===t&&0===this._sketchedVertexCount}get _isRotating(){if(!this._drawGraphicTool)return!1;const t=this.interactivePlacementState;return"rotate"===t||"interactive"===t&&1===this._sketchedVertexCount}get _isScaling(){if(!this._drawGraphicTool)return!1;return"interactive"===this.interactivePlacementState&&1===this._sketchedVertexCount}togglePlacementState(t){this.interactivePlacementState=this.interactivePlacementState===t?null:t}trySetDisplayEnabled(t){const{view:e}=this;if(e?.ready)if(!e.grid&&t)if(this._mostRecentlyShownGrid)e.grid=this._mostRecentlyShownGrid;else{const t="imperial"===this.defaultUnit?"feet":"meters";e.grid=new u({units:t,center:e.center??new d,rotateWithMap:!0}),R(this.grid,[115,115,115])}else t||(e.grid=null);else r.getLogger(this).warn("Attempting to enable grid display while view is not ready")}startPlacement(t){const{view:e,snappingManager:i}=this;if(!e)return;this._set("interactivePlacementState",t),this._sketchedVertexCount=0;const r=new j({view:e,graphicProperties:{attributes:{[T]:T}},sketchOptions:{tooltips:{enabled:!0,visibleElements:{direction:!1,rotation:!1,totalLength:!1,elevation:!1,distance:!1,area:!1}}},geometryType:"polyline",mode:"click",snapToScene:!1,snappingManager:i,forceUniformSize:!0,centered:!1,cursor:"interactive"===this.interactivePlacementState||"place"===this.interactivePlacementState?"none":null,regularVerticesSymbol:void 0,activeVertexSymbol:U,activeLineSymbol:E,graphicSymbol:E});this._drawGraphicTool=r,e.addAndActivateTool(r),this._renderOverlays(),this.addHandles([r.on("cursor-update",(t=>this._onCursorUpdate(t))),r.on("complete",(()=>this._onDrawComplete())),r.on("vertex-add",(e=>this._onVertexAdd(e,t)))],I)}async _startGridManipulation(t){const{view:e}=this;if(!e)return void(this.interactivePlacementState=null);const i=new CustomEvent("before-placement",{cancelable:!0});this.emit("before-placement",i),i.defaultPrevented||this.startPlacement(t)}_onCursorUpdate(t){try{if(this._isPlacing){const e=t.vertices[0].coordinates;return void this._handlePlace(e)}if(this._drawGraphicTool.cursor=null,this._isRotating&&this._handleRotate(t.vertices[0].coordinates),this._isScaling){const t=this._drawGraphicTool?.drawOperation.cursorVertex;this._handleScale(t)}}finally{this._renderOverlays()}}_onDrawComplete(){this._drawGraphicTool.cursor=null,this.interactivePlacementState=null}_onVertexAdd(t,e){const i=t.vertices[0].coordinates;this._isPlacing&&this._handlePlace(i),this._isRotating&&this._sketchedVertexCount>0&&this._handleRotate(i),this._isScaling&&this._sketchedVertexCount>0&&this._handleScale(v(i[0],i[1],void 0,this.view.spatialReference)),this._sketchedVertexCount++,this._drawGraphicTool.cursor=null,2!==this._sketchedVertexCount&&"interactive"===e||(this.interactivePlacementState=null),this._renderOverlays()}_handlePlace(t){const{grid:e,view:i}=this;e&&i&&(e.center=new d({x:t[0],y:t[1],spatialReference:i.spatialReference}))}_handleRotate(t){const{grid:e,view:i}=this;if(!e||!i)return;this._drawGraphicTool?.sketchOptions.tooltips.set("enabled",!1);const{x:r,y:o}=e.center,[n,a]=t,l=i.toScreen(e.center,{pickClosestTarget:!0}),c=l&&i.toMap(l),h=i.toScreen(v(n,a,void 0,i.spatialReference),{pickClosestTarget:!0}),d=h&&i.toMap(h),p=c?c.x:r,m=c?c.y:o,g=p-(d?d.x:n),u=m-(d?d.y:a);if(0===g&&0===u)return;const y=Math.atan2(u,g),_=s(y),w=e.rotateWithMap,f=i.viewpoint.rotation??0,S=w?_:_-f;e.rotation=Math.fround(S)%360}_handleScale(t){const{view:e,grid:i,_drawGraphicTool:r,interactivePlacementState:s,_metersPerSRUnit:o}=this;if(!(t&&e&&i&&r&&o))return;r.sketchOptions.tooltips.enabled=!1;const n="interactive"===s?i.center:r.drawOperation.firstVertex;if(!n||!t)return;const a=e?.toScreen(n),c=a&&e.toMap(a),h=e?.toScreen(t),d=c??n,p=(h&&e.toMap(h))??t,m=Math.sqrt((d.x-p.x)**2+(d.y-p.y)**2),g=l(m*o,"meters",i.units);this.spacing=g}_renderOverlays(){this._renderCrosshairOverlay(),this._renderTextOverlay()}_renderTextOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this,r=this._getCrosshairLabel();if(!(t&&e?.overlay&&i&&r))return;const s=e.toScreen(t.center,{pickClosestTarget:!0});s&&(r.position=[s.x+12,s.y+12]),this._isRotating?(r.text=`${L(t.rotation)}${O}`,r.visible=!0):r.visible=!1}_renderCrosshairOverlay(){const{grid:t,view:e,_drawGraphicTool:i}=this;if(!t||!e?.overlay||!i)return;const r=this._getCrosshair();if(!r)return;const s=e.toScreen(t.center);s&&(r.x=s.x,r.y=s.y,r.rotation=t.rotateWithMap?e.viewpoint.rotation-t.rotation:-t.rotation,r.visible=!!i)}_getCrosshairLabel(){if(this._crosshairLabel)return this._crosshairLabel;const{grid:t,view:i,_drawGraphicTool:r}=this;if(!t||!i?.overlay||!r)return null;const s=new G({anchor:"top-left",fontSize:10,textColor:new e([21,21,21]),backgroundColor:new e([248,248,248]),padding:8,borderRadius:20});return i.overlay.addItem(s),this._crosshairLabel=s,s}_getCrosshair(){const{_crosshairItem:t,view:e}=this;return e?.overlay?t&&e.overlay.items.includes(t)?t:(this._crosshairItem=new x({color:e.effectiveTheme.accentColor,thickness:4,length:36,visible:!0}),e.overlay?.addItem(this._crosshairItem),this._crosshairItem):null}_resetGridPlacementState(){this.removeHandles(I),this._crosshairItem&&(this._crosshairItem.visible=!1),this._crosshairLabel&&(this._crosshairLabel.visible=!1),this._drawGraphicTool&&(this.view?.activeTool===this._drawGraphicTool&&(this.view.activeTool=null),this.view?.tools.remove(this._drawGraphicTool)),this._drawGraphicTool=o(this._drawGraphicTool)}};t([c(y)],M.prototype,"defaultUnit",void 0),t([c({readOnly:!0})],M.prototype,"displayEnabled",null),t([c()],M.prototype,"dynamicScaling",null),t([c()],M.prototype,"grid",null),t([c()],M.prototype,"gridColor",null),t([c({readOnly:!0})],M.prototype,"gridControlsEnabled",null),t([c()],M.prototype,"interactivePlacementState",null),t([c()],M.prototype,"majorLineInterval",null),t([c()],M.prototype,"rotateWithMap",null),t([c()],M.prototype,"rotation",null),t([c()],M.prototype,"snappingEnabled",null),t([c()],M.prototype,"snappingManager",void 0),t([c({type:C})],M.prototype,"snappingOptions",void 0),t([c()],M.prototype,"spacing",null),t([c()],M.prototype,"unit",null),t([c()],M.prototype,"view",void 0),t([c({readOnly:!0})],M.prototype,"gridOutOfScale",null),t([c({readOnly:!0})],M.prototype,"effectiveSpacingAfterDynamicScaling",null),t([c({readOnly:!0})],M.prototype,"numericSpacingInputShouldBeVisible",null),t([c()],M.prototype,"placementDisabled",void 0),t([c()],M.prototype,"_metersPerSRUnit",null),t([c()],M.prototype,"_pixelsPerStride",null),t([c()],M.prototype,"_isPlacing",null),t([c()],M.prototype,"_isRotating",null),t([c()],M.prototype,"_isScaling",null),t([c()],M.prototype,"_mostRecentlyShownGrid",void 0),t([c()],M.prototype,"_sketchedVertexCount",void 0),M=t([h("esri.widgets.support.GridControls.GridControlsViewModel")],M);const k=M,E=new _({width:0}),U=new w({color:e.fromArray([0,0,0,0]),outline:new _({color:e.fromArray([0,0,0,0])})});export{k as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import"../../intl.js";import{watch as i,initial as n}from"../../core/reactiveUtils.js";import{formatDecimal as s}from"../../core/unitFormatUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{loadCalciteComponents as a}from"./componentsUtils.js";import{globalCss as c}from"./globalCss.js";import{loadLabeledSwitchComponents as d,LabeledSwitch as p}from"./LabeledSwitch.js";import{classes as m}from"./widgetUtils.js";import{messageBundle as g}from"./decorators/messageBundle.js";import{tsx as u}from"./jsxFactory.js";import h from"./GridControls/GridControlsViewModel.js";import{gridRotationToDegrees as b,userInputToGridRotation as v}from"./GridControls/gridUtils.js";import w from"./GridControls/VisibleElements.js";import{substitute as _}from"../../intl/substitute.js";const f="esri-grid-controls",C={base:f,borderedSwitch:`${f}__switch--bordered`,container:`${f}__container`,numericInputsContainer:`${f}__numeric-inputs__container`,tilegroup:`${f}__tilegroup`,tile:`${f}__tile`,tileDisabled:`${f}__tile--disabled`,tileContent:`${f}__tile__content`,suffixedInputContainer:`${f}__input-with-suffix__container`,inputSuffix:`${f}__input-with-suffix__suffix-part`,inlineIcon:`${f}__inline-icon`},y={widgetIcon:"grid-unit",gridTheme:{light:"circle",dark:"circle-area",custom:"palette"},placementState:{interactive:"maximum-territory-distance",place:"move",rotate:"rotate"},warning:"exclamation-mark-triangle"},M=t.fromArray([115,115,115]),S=t.fromArray([200,200,200]),I=["interactive","place","rotate"];let T=class extends r{constructor(e,t){super(e,t),this.customColor=null,this.messages=null,this.messagesUnits=null,this.viewModel=new h,this.visibleElements=new w}initialize(){this.addHandles([i((()=>this.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import"../../intl.js";import{watch as i,initial as n}from"../../core/reactiveUtils.js";import{formatDecimal as s}from"../../core/unitFormatUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{loadCalciteComponents as a}from"./componentsUtils.js";import{globalCss as c}from"./globalCss.js";import{loadLabeledSwitchComponents as d,LabeledSwitch as p}from"./LabeledSwitch.js";import{classes as m}from"./widgetUtils.js";import{messageBundle as g}from"./decorators/messageBundle.js";import{tsx as u}from"./jsxFactory.js";import h from"./GridControls/GridControlsViewModel.js";import{gridRotationToDegrees as b,userInputToGridRotation as v}from"./GridControls/gridUtils.js";import w from"./GridControls/VisibleElements.js";import{substitute as _}from"../../intl/substitute.js";const f="esri-grid-controls",C={base:f,borderedSwitch:`${f}__switch--bordered`,container:`${f}__container`,numericInputsContainer:`${f}__numeric-inputs__container`,tilegroup:`${f}__tilegroup`,tile:`${f}__tile`,tileDisabled:`${f}__tile--disabled`,tileContent:`${f}__tile__content`,suffixedInputContainer:`${f}__input-with-suffix__container`,inputSuffix:`${f}__input-with-suffix__suffix-part`,inlineIcon:`${f}__inline-icon`},y={widgetIcon:"grid-unit",gridTheme:{light:"circle",dark:"circle-area",custom:"palette"},placementState:{interactive:"maximum-territory-distance",place:"move",rotate:"rotate"},warning:"exclamation-mark-triangle"},M=t.fromArray([115,115,115]),S=t.fromArray([200,200,200]),I=["interactive","place","rotate"];let T=class extends r{constructor(e,t){super(e,t),this.customColor=null,this.messages=null,this.messagesUnits=null,this.viewModel=new h,this.visibleElements=new w}initialize(){this.addHandles([i((()=>this.viewModel.gridColor),(e=>{!e||M.equals(e)||S.equals(e)||(this.customColor=e)}),n)])}loadDependencies(){return Promise.all([a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip"),"color-picker":()=>import("@esri/calcite-components/dist/components/calcite-color-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number")}),d()])}get icon(){return y.widgetIcon}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages.widgetLabel}set label(e){this._overrideIfSome("label",e)}get snappingManager(){return this.viewModel.snappingManager}set snappingManager(e){this.viewModel.snappingManager=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get theme(){const e=this.viewModel.gridColor;return e?M.equals(e)?"dark":S.equals(e)?"light":"custom":null}set theme(e){const{viewModel:t,customColor:i,view:n}=this;switch(e){case"light":t.gridColor=S;break;case"dark":t.gridColor=M;break;case"custom":t.gridColor=i??n?.effectiveTheme.accentColor??M}}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){return u("div",{"aria-label":this.label,class:this.classes(C.base,c.widget,c.panel)},u("div",{class:C.container},this._renderContent()))}_renderContent(){const{visibleElements:e}=this;return[e.gridEnabledToggle?this._renderEnabledToggle():null,e.placementButtons?this._renderGridPlacementButtons():null,e.numericInputs?this._renderNumericInputs():null,e.lineIntervalInput?this._renderIntervalInput():null,e.gridSnapEnabledToggle&&this.viewModel.snappingOptions?this._renderSnappingToggle():null,e.dynamicScaleToggle?this._renderDynamicScaleToggle():null,e.rotateWithMapToggle?this._renderRotateToggle():null,e.colorSelection?this._renderColorSelection():null]}_renderGridPlacementButtons(){const{interactivePlacementState:e,placementDisabled:t,gridControlsEnabled:i}=this.viewModel,n=t||!i;return u("calcite-label",{key:"grid-placement-buttons",scale:"s"},this.messages.placementOptions,u("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},I.map((t=>this._renderPlacementModeButton(t,n,e)))))}_renderPlacementModeButton(e,t,i){const n=this.messages.placementState[e],s=`__placement-action-${e}`;return u("div",null,u("calcite-action",{active:i===e,alignment:"center",disabled:t,icon:y.placementState[e],id:s,onclick:()=>this.viewModel.togglePlacementState(e),text:n}),u("calcite-tooltip",{overlayPositioning:"fixed",placement:"top",referenceElement:s},n))}_renderNumericInputs(){const{rotation:e,spacing:t,effectiveSpacingAfterDynamicScaling:i,numericSpacingInputShouldBeVisible:n,unit:o="meters"}=this.viewModel,l=this.messagesUnits.units[o].abbr,r=this.viewModel.gridControlsEnabled,a=null!=i&&i!==this.viewModel.spacing,c=`__spacing_input_scaled-${this.id}`;return u("div",{class:this.classes(C.numericInputsContainer)},[n?u("calcite-label",{key:"spacing-label",scale:"s"},u("span",null,this.messages.inputLabel.spacing,a?u("calcite-icon",{class:this.classes(C.inlineIcon),icon:y.warning,id:c,scale:"s",tabIndex:0}):void 0),u("div",{class:C.suffixedInputContainer},u("calcite-input-number",{disabled:!r,numberButtonType:"none",suffixText:l,value:`${t?.toFixed(2)}`,onCalciteInputNumberChange:({currentTarget:e})=>{const t=parseFloat(e.value);this.viewModel.spacing=t,t!==this.viewModel.spacing&&(e.value=`${this.viewModel.spacing}`)}}),a?u("calcite-tooltip",{overlayPositioning:"fixed",placement:"leading",referenceElement:c},_(this.messages.warnings.dynamicSpacing,{actualSpacingIncludingUnit:s(this.messagesUnits,i,o,2,"plural")})):void 0)):void 0,u("calcite-label",{key:"angle-label",scale:"s"},this.messages.inputLabel.angle,u("calcite-input-number",{disabled:!r,integer:!0,numberButtonType:"none",suffixText:this.messagesUnits.units.degrees.abbr,value:`${b(e)}`,onCalciteInputNumberChange:({currentTarget:e})=>this.viewModel.rotation=v(e.value)}))])}_renderIntervalInput(){const{majorLineInterval:e,gridControlsEnabled:t}=this.viewModel;return u("div",{class:this.classes(C.numericInputsContainer)},u("calcite-label",{scale:"s"},this.messages.inputLabel.interval,u("calcite-input-number",{disabled:!t,integer:!0,max:15,min:1,numberButtonType:"vertical",value:`${e}`,onCalciteInputNumberChange:({currentTarget:e})=>{const t=Number.parseInt(e.value,10);this.viewModel.majorLineInterval=t,t!==this.viewModel.majorLineInterval&&(e.value=`${this.viewModel.majorLineInterval}`)}})))}_renderSnappingToggle(){const{snappingOptions:e,gridControlsEnabled:t}=this.viewModel;return u(p,{checked:!!(e?.gridEnabled??!1),disabled:!(t&&!!e),key:"grid-snap-enabled-toggle",label:this.messages.switchLabel.snap,onChange:e=>this.viewModel.snappingOptions?.set("gridEnabled",e)})}_renderDynamicScaleToggle(){const{viewModel:e,messages:t}=this,i=this.visibleElements.outOfScaleWarning&&e.gridOutOfScale;return u(p,{checked:e.dynamicScaling,disabled:!e.gridControlsEnabled,hint:i?t.warnings.outOfScale:void 0,hintIcon:y.warning,hintKind:"warning",key:`grid-dynamic-scale-toggle-${this.id}`,label:t.switchLabel.scaling,onChange:t=>e.dynamicScaling=t})}_renderRotateToggle(){const{gridControlsEnabled:e,rotateWithMap:t}=this.viewModel;return u(p,{checked:t,disabled:!e,key:"grid-rotate-map-toggle",label:this.messages.switchLabel.rotateWithMap,onChange:e=>this.viewModel.rotateWithMap=e})}_renderEnabledToggle(){return u("div",{class:C.borderedSwitch},u(p,{checked:this.viewModel.displayEnabled,disabled:!!this.viewModel.interactivePlacementState,key:"grid-enabled-toggle",label:this.messages.switchLabel.display,onChange:e=>this.viewModel.trySetDisplayEnabled(e)}))}_renderColorSelection(){const{customColor:e}=this,i=`${this.id}--custom-grid-color-button`;return u("calcite-label",{scale:"s"},this.messages.inputLabel.theme,u("div",{class:C.tilegroup},[this._renderThemeTile({value:"dark"}),this._renderThemeTile({value:"light"}),this._renderThemeTile({value:"custom",id:i}),u("calcite-popover",{autoClose:!0,label:this.messages.gridLineColorPopoverLabel,overlayPositioning:"fixed",referenceElement:i},u("calcite-color-picker",{alphaChannel:!0,savedDisabled:!0,value:e?.toHex({digits:8})??"#000000ff",onCalciteColorPickerChange:e=>{const i=t.fromHex(e.currentTarget.value);i&&(this.customColor=i,this.theme="custom")}}))]))}_renderThemeTile(e){const{theme:t}=this,{value:i}=e,n=this.messages.gridTheme[i],s=`${this.id}--theme_tile_${i}`,o=`${s}__label`,l=y.gridTheme[i],r=this.viewModel.gridControlsEnabled;return u("div",{class:m({[C.tile]:!0,[C.tileDisabled]:!r}),id:e.id,role:"button"},u("input",{"aria-labelledby":o,checked:t===i,disabled:!r,id:s,name:`${this.id}--theme`,onchange:e=>{this.theme=i,e.target?.focus()},tabIndex:0,type:"radio"}),u("div",{class:C.tileContent},u("calcite-icon",{icon:l,scale:"l"}),u("calcite-label",{for:s,id:o},n)))}};e([o({type:t})],T.prototype,"customColor",void 0),e([o()],T.prototype,"icon",null),e([o()],T.prototype,"label",null),e([o(),g("esri/widgets/support/GridControls/t9n/GridControls")],T.prototype,"messages",void 0),e([o(),g("esri/core/t9n/Units")],T.prototype,"messagesUnits",void 0),e([o()],T.prototype,"snappingManager",null),e([o()],T.prototype,"snappingOptions",null),e([o()],T.prototype,"theme",null),e([o()],T.prototype,"view",null),e([o({type:h})],T.prototype,"viewModel",void 0),e([o({type:w,nonNullable:!0})],T.prototype,"visibleElements",void 0),T=e([l("esri.widgets.support.GridControls")],T);const j=T;export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1882],{537:(t,n,e)=>{e.d(n,{B$:()=>m,LJ:()=>g,Pj:()=>d,Rg:()=>p,Yz:()=>y,z8:()=>f});var i=e(19419);function s(t){return void 0!==t.xmin&&void 0!==t.ymin&&void 0!==t.xmax&&void 0!==t.ymax}function r(t){return void 0!==t.points}function a(t){return void 0!==t.x&&void 0!==t.y}function o(t){return void 0!==t.paths}function h(t){return void 0!==t.rings}function l(t){return function(n,e){return null==n?e:null==e?n:t(n,e)}}const u=l(Math.min),c=l(Math.max);function p(t,n){return o(n)?y(t,n.paths,!1,!1):h(n)?y(t,n.rings,!1,!1):r(n)?d(t,n.points,!1,!1,!1,!1):s(n)?x(t,n):(a(n)&&(t[0]=n.x,t[1]=n.y,t[2]=n.x,t[3]=n.y),t)}function f(t){let n,e,s,r;for(t.reset(),n=s=1/0,e=r=-1/0;t.nextPath();){const i=m(t);n=Math.min(i[0],n),s=Math.min(i[1],s),e=Math.max(i[2],e),r=Math.max(i[3],r)}return(0,i.vt)([n,s,e,r])}function m(t){let n,e,s,r;for(n=s=1/0,e=r=-1/0;t.nextPoint();)n=Math.min(t.x,n),s=Math.min(t.y,s),e=Math.max(t.x,e),r=Math.max(t.y,r);return(0,i.vt)([n,s,e,r])}function g(t,n){return o(n)?y(t,n.paths,!0,!1):h(n)?y(t,n.rings,!0,!1):r(n)?d(t,n.points,!0,!1,!0,!1):s(n)?x(t,n,0,0,!0,!1):(a(n)&&(t[0]=n.x,t[1]=n.y,t[2]=n.z,t[3]=n.x,t[4]=n.y,t[5]=n.z),t)}function y(t,n,e,i){const s=e?3:2;if(!n.length||!n[0].length)return null;let r,a,o,h,[l,p]=n[0][0],[f,m]=n[0][0];for(let t=0;t<n.length;t++){const g=n[t];for(let t=0;t<g.length;t++){const n=g[t],[y,x]=n;if(l=u(l,y),p=u(p,x),f=c(f,y),m=c(m,x),e&&n.length>2){const t=n[2];r=u(r,t),a=c(a,t)}if(i&&n.length>s){const t=n[s];o=u(r,t),h=c(a,t)}}}return e?i?(t[0]=l,t[1]=p,t[2]=r,t[3]=o,t[4]=f,t[5]=m,t[6]=a,t[7]=h,t.length=8,t):(t[0]=l,t[1]=p,t[2]=r,t[3]=f,t[4]=m,t[5]=a,t.length=6,t):i?(t[0]=l,t[1]=p,t[2]=o,t[3]=f,t[4]=m,t[5]=h,t.length=6,t):(t[0]=l,t[1]=p,t[2]=f,t[3]=m,t.length=4,t)}function x(t,n,e,i,s,r){const a=n.xmin,o=n.xmax,h=n.ymin,l=n.ymax;let u=n.zmin,c=n.zmax,p=n.mmin,f=n.mmax;return s?(u=u||0,c=c||0,r?(p=p||0,f=f||0,t[0]=a,t[1]=h,t[2]=u,t[3]=p,t[4]=o,t[5]=l,t[6]=c,t[7]=f,t):(t[0]=a,t[1]=h,t[2]=u,t[3]=o,t[4]=l,t[5]=c,t)):r?(p=p||0,f=f||0,t[0]=a,t[1]=h,t[2]=p,t[3]=o,t[4]=l,t[5]=f,t):(t[0]=a,t[1]=h,t[2]=o,t[3]=l,t)}function d(t,n,e,i,s,r){const a=e?3:2,o=i&&r,h=e&&s;if(!n.length||!n[0].length)return null;let l,p,f,m,[g,y]=n[0],[x,d]=n[0];for(let t=0;t<n.length;t++){const e=n[t],[i,s]=e;if(g=u(g,i),y=u(y,s),x=c(x,i),d=c(d,s),h&&e.length>2){const t=e[2];l=u(l,t),p=c(p,t)}if(o&&e.length>a){const t=e[a];f=u(l,t),m=c(p,t)}}return s?(l=l||0,p=p||0,r?(f=f||0,m=m||0,t[0]=g,t[1]=y,t[2]=l,t[3]=f,t[4]=x,t[5]=d,t[6]=p,t[7]=m,t):(t[0]=g,t[1]=y,t[2]=l,t[3]=x,t[4]=d,t[5]=p,t)):r?(f=f||0,m=m||0,t[0]=g,t[1]=y,t[2]=f,t[3]=x,t[4]=d,t[5]=m,t):(t[0]=g,t[1]=y,t[2]=x,t[3]=d,t)}},12359:(t,n,e)=>{e.d(n,{TP:()=>u,Z4:()=>r,l8:()=>a,w2:()=>h});var i=e(51118),s=e(95108);function r(t){return t?t.hasZ?[t.xmax-t.xmin/2,t.ymax-t.ymin/2,t.zmax-t.zmin/2]:[t.xmax-t.xmin/2,t.ymax-t.ymin/2]:null}function a(t){return t?function(t,n){if(!t?.length)return null;const e=[],i=[],r=n?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let e=0,s=t.length;e<s;e++){const s=o(t[e],n,r);s&&i.push(s)}if(i.sort(((t,e)=>{let i=t[2]-e[2];return 0===i&&n&&(i=t[4]-e[4]),i})),i.length&&(e[0]=i[0][0],e[1]=i[0][1],n&&(e[2]=i[0][3]),(e[0]<r[0]||e[0]>r[1]||e[1]<r[2]||e[1]>r[3]||n&&(e[2]<r[4]||e[2]>r[5]))&&(e.length=0)),!e.length){const i=t[0]&&t[0].length?function(t,n){const e=n?[0,0,0]:[0,0],i=n?[0,0,0]:[0,0];let r=0,a=0,o=0,h=0;for(let l=0,u=t.length;l<u-1;l++){const u=t[l],c=t[l+1];if(u&&c){e[0]=u[0],e[1]=u[1],i[0]=c[0],i[1]=c[1],n&&u.length>2&&c.length>2&&(e[2]=u[2],i[2]=c[2]);const t=(0,s.R3)(e,i);if(t){r+=t;const e=(0,s.t9)(u,c);a+=t*e[0],o+=t*e[1],n&&e.length>2&&(h+=t*e[2])}}}return r>0?n?[a/r,o/r,h/r]:[a/r,o/r]:t.length?t[0]:null}(t[0],n):null;if(!i)return null;e[0]=i[0],e[1]=i[1],n&&i.length>2&&(e[2]=i[2])}return e}(t.rings,t.hasZ??!1):null}function o(t,n,e){let i=0,s=0,r=0,a=0,o=0;const h=t.length?t[0][0]:0,l=t.length?t[0][1]:0,u=t.length&&n?t[0][2]:0;for(let c=0;c<t.length;c++){const p=t[c],f=t[(c+1)%t.length],[m,g,y]=p,x=m-h,d=g-l,[v,P,R]=f,A=v-h,I=P-l,M=x*I-A*d;if(a+=M,i+=(x+A)*M,s+=(d+I)*M,n&&p.length>2&&f.length>2){const t=y-u,n=R-u,e=x*n-A*t;r+=(t+n)*e,o+=e}m<e[0]&&(e[0]=m),m>e[1]&&(e[1]=m),g<e[2]&&(e[2]=g),g>e[3]&&(e[3]=g),n&&(y<e[4]&&(e[4]=y),y>e[5]&&(e[5]=y))}if(a>0&&(a*=-1),o>0&&(o*=-1),!a)return null;a*=.5,o*=.5;const c=[i/(6*a)+h,s/(6*a)+l,a];return n&&(e[4]===e[5]||0===o?(c[3]=(e[4]+e[5])/2,c[4]=0):(c[3]=r/(6*o)+u,c[4]=o)),c}function h(t,n){let e=0,i=0,s=0;t.nextPoint();const r=t.pathSize?t.x:0,a=t.pathSize?t.y:0;for(let o=0;o<t.pathSize;o++){t.seekInPath(o);const h=[t.x,t.y];t.seekInPath((o+1)%t.pathSize);const l=[t.x,t.y],[u,c]=h,p=u-r,f=c-a,[m,g]=l,y=m-r,x=g-a,d=p*x-y*f;s+=d,e+=(p+y)*d,i+=(f+x)*d,u<n[0]&&(n[0]=u),u>n[1]&&(n[1]=u),c<n[2]&&(n[2]=c),c>n[3]&&(n[3]=c)}return s>0&&(s*=-1),s?(s*=.5,[e/(6*s)+r,i/(6*s)+a,s]):null}const l=1e-6;function u(t){let n=0;for(t.reset();t.nextPath();)n+=t.getCurrentRingArea();if(n<l){const n=function(t){const{hasZ:n,totalSize:e}=t;if(0===e)return null;const r=[],a=[],h=n?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(t.reset();t.nextPath();){const n=o((0,i.A)(t),t.hasZ,h);n&&a.push(n)}if(a.sort(((t,e)=>{let i=t[2]-e[2];return 0===i&&n&&(i=t[4]-e[4]),i})),a.length&&(r[0]=a[0][0],r[1]=a[0][1],n&&(r[2]=a[0][3]),(r[0]<h[0]||r[0]>h[1]||r[1]<h[2]||r[1]>h[3]||n&&(r[2]<h[4]||r[2]>h[5]))&&(r.length=0)),!r.length){t.reset(),t.nextPath();const e=t.pathSize?function(t){const{hasZ:n}=t,e=n?[0,0,0]:[0,0],i=n?[0,0,0]:[0,0];let r=0,a=0,o=0,h=0;if(t.nextPoint()){let l=t.x,u=t.y,c=t.z;for(;t.nextPoint();){const p=t.x,f=t.y,m=t.z;e[0]=l,e[1]=u,i[0]=p,i[1]=f,n&&(e[2]=c,i[2]=m);const g=(0,s.R3)(e,i);if(g){r+=g;const t=(0,s.t9)(e,i);a+=g*t[0],o+=g*t[1],n&&t.length>2&&(h+=g*t[2])}l=p,u=f,c=m}}return r>0?n?[a/r,o/r,h/r]:[a/r,o/r]:t.pathSize?(t.seekPathStart(),t.nextPoint(),[t.x,t.y]):null}(t):null;if(!e)return null;r[0]=e[0],r[1]=e[1],n&&e.length>2&&(r[2]=e[2])}return r}(t);return n?[n[0],n[1]]:null}const e=[0,0];if(t.reset(),!t.nextPath()||!t.nextPoint())return null;const r=[t.x,t.y];for(t.reset();t.nextPath();)p(e,r,t);return e[0]*=1/n,e[1]*=1/n,e[0]+=r[0],e[1]+=r[1],e}const c=1/3;function p(t,n,e){if(!e||e.pathSize<3)return null;e.nextPoint();const i=e.x,s=e.y;e.nextPoint();let r,a=e.x-i,o=e.y-s,h=0,l=0;for(;e.nextPoint();)h=e.x-i,l=e.y-s,r=.5*c*(h*o-l*a),t[0]+=r*(a+h),t[1]+=r*(o+l),a=h,o=l;const u=e.getCurrentRingArea(),p=[i,s];return p[0]-=n[0],p[1]-=n[1],p[0]*=u,p[1]*=u,t[0]+=p[0],t[1]+=p[1],t}},39829:(t,n,e)=>{e.d(n,{A:()=>I});var i,s=e(90237),r=e(4576),a=e(4718),o=e(10107),h=(e(44208),e(53966),e(40608)),l=e(43937),u=e(5443),c=e(91075),p=e(86738),f=e(16930),m=e(12359),g=e(94078),y=e(95108),x=e(90634),d=e(12176),v=e(28735),P=e(56993);function R(t){return!Array.isArray(t[0])}let A=i=class extends c.A{static fromExtent(t){const n=t.clone().normalize(),{spatialReference:e}=t;let s=!1,r=!1;for(const t of n)t.hasZ&&(s=!0),t.hasM&&(r=!0);const a={rings:n.map((t=>{const n=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(s&&t.hasZ){const e=t.zmin+.5*(t.zmax-t.zmin);for(let t=0;t<n.length;t++)n[t].push(e)}if(r&&t.hasM){const e=t.mmin+.5*(t.mmax-t.mmin);for(let t=0;t<n.length;t++)n[t].push(e)}return n})),spatialReference:e};return s&&(a.hasZ=!0),r&&(a.hasM=!0),new i(a)}constructor(t){super(function(t){if(!t)return;let{rings:n,hasM:e,hasZ:i,spatialReference:s}=t;switch(n??=[],function(t){return"number"==typeof t[0]?.[0]}(n)&&(n=[n]),n[0]?.[0]?.length){case 4:i??=!0,e??=!0;break;case 3:i??=!0!==e,e??=!i;break;default:i??=!1,e??=!1}return s??=f.A.WGS84,{...t,hasM:e,hasZ:i,rings:n,spatialReference:s}}(t)),this.curveRings=void 0,this.rings=[],this.type="polygon"}get cache(){return this.commitProperty("curveRings"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("rings"),this.commitProperty("spatialReference"),{}}get centroid(){const t=(0,m.l8)(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const n=new p.A;return n.x=t[0],n.y=t[1],n.spatialReference=this.spatialReference,this.hasZ&&(n.z=t[2]),n}writeCurveRings(t,n){n.curveRings=(0,a.o8)(t)}get extent(){const t=(0,x.v)(this),{spatialReference:n}=this;return t?new u.A({...t,spatialReference:n}):null}get isSelfIntersecting(){return(0,d.A3)(this.rings)}writeRings(t,n){n.rings=(0,a.o8)(this.rings)}addRing(t){if(!t)return;const n=this.rings,e=n.length;if(R(t)){const i=[];for(let n=0,e=t.length;n<e;n++)i[n]=t[n].toArray();n[e]=i}else n[e]=t.slice();return this.notifyChange("rings"),this}clone(){const t=new i;return t.spatialReference=this.spatialReference,t.rings=(0,a.o8)(this.rings),t.curveRings=(0,a.o8)(this.curveRings),t.hasZ=this.hasZ,t.hasM=this.hasM,t}equals(t){if(this===t)return!0;if(null==t)return!1;const n=this.spatialReference,e=t.spatialReference;if(null!=n!=(null!=e))return!1;if(null!=n&&null!=e&&!n.equals(e))return!1;if(this.rings.length!==t.rings.length)return!1;const i=([t,n,e,i],[s,r,a,o])=>t===s&&n===r&&(null==e&&null==a||e===a)&&(null==i&&null==o||i===o);for(let n=0;n<this.rings.length;n++){const e=this.rings[n],s=t.rings[n];if(!(0,r.aI)(e,s,i))return!1}return!0}contains(t){if(!t)return!1;const n=(0,v.Cv)(t,this.spatialReference);return(0,g.m3)(this,null!=n?n:t)}isClockwise(t){const n=R(t)?t.map((t=>this.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])):t;return(0,y.$3)(n)}getPoint(t,n){if(!this._validateInputs(t,n))return null;const e=this.rings[t][n],i=this.hasZ,s=this.hasM;return i&&!s?new p.A(e[0],e[1],e[2],void 0,this.spatialReference):s&&!i?new p.A(e[0],e[1],void 0,e[2],this.spatialReference):i&&s?new p.A(e[0],e[1],e[2],e[3],this.spatialReference):new p.A(e[0],e[1],this.spatialReference)}insertPoint(t,n,e){return this._validateInputs(t,n,!0)?((0,P.h)(this,e),Array.isArray(e)||(e=e.toArray()),this.rings[t].splice(n,0,e),this.notifyChange("rings"),this):this}removePoint(t,n){if(!this._validateInputs(t,n))return null;const e=new p.A(this.rings[t].splice(n,1)[0],this.spatialReference);return this.notifyChange("rings"),e}removeRing(t){if(!this._validateInputs(t,null))return null;const n=this.rings.splice(t,1)[0],e=this.spatialReference,i=n.map((t=>new p.A(t,e)));return this.notifyChange("rings"),i}setPoint(t,n,e){return this._validateInputs(t,n)?((0,P.h)(this,e),Array.isArray(e)||(e=e.toArray()),this.rings[t][n]=e,this.notifyChange("rings"),this):this}_validateInputs(t,n,e=!1){if(null==t||t<0||t>=this.rings.length)return!1;if(null!=n){const i=this.rings[t];if(e&&(n<0||n>i.length))return!1;if(!e&&(n<0||n>=i.length))return!1}return!0}toJSON(t){return this.write({},t)}};(0,s._)([(0,o.MZ)({readOnly:!0})],A.prototype,"cache",null),(0,s._)([(0,o.MZ)({readOnly:!0})],A.prototype,"centroid",null),(0,s._)([(0,o.MZ)({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],A.prototype,"curveRings",void 0),(0,s._)([(0,l.K)("curveRings")],A.prototype,"writeCurveRings",null),(0,s._)([(0,o.MZ)({readOnly:!0})],A.prototype,"extent",null),(0,s._)([(0,o.MZ)({readOnly:!0})],A.prototype,"isSelfIntersecting",null),(0,s._)([(0,o.MZ)({type:[[[Number]]],json:{write:{isRequired:!0}}})],A.prototype,"rings",void 0),(0,s._)([(0,l.K)("rings")],A.prototype,"writeRings",null),A=i=(0,s._)([(0,h.$)("esri.geometry.Polygon")],A);const I=A;A.prototype.toJSON.isDefaultToJSON=!0},48526:(t,n,e)=>{e.d(n,{A:()=>g});var i,s=e(90237),r=e(4718),a=e(10107),o=(e(44208),e(53966),e(40608)),h=e(43937),l=e(5443),u=e(91075),c=e(86738),p=e(56993);function f(t){return(n,e)=>null==n?e:null==e?n:t(n,e)}let m=i=class extends u.A{constructor(...t){super(...t),this.points=[],this.type="multipoint"}normalizeCtorArgs(t,n){if(!t&&!n)return{};const e={};Array.isArray(t)?(e.points=t,e.spatialReference=n):function(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}(t)?e.spatialReference=t:(t.points&&(e.points=t.points),t.spatialReference&&(e.spatialReference=t.spatialReference),t.hasZ&&(e.hasZ=t.hasZ),t.hasM&&(e.hasM=t.hasM));const i=e.points?.[0];return i&&(void 0===e.hasZ&&void 0===e.hasM?(e.hasZ=i.length>2,e.hasM=!1):void 0===e.hasZ?e.hasZ=i.length>3:void 0===e.hasM&&(e.hasM=i.length>3)),e}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const t=this.points;if(!t.length)return null;const n=new l.A,e=this.hasZ,i=this.hasM,s=e?3:2,r=t[0],a=f(Math.min),o=f(Math.max);let h,u,c,p,[m,g]=r,[y,x]=r;for(let n=0,r=t.length;n<r;n++){const r=t[n],[l,f]=r;if(m=a(m,l),g=a(g,f),y=o(y,l),x=o(x,f),e&&r.length>2){const t=r[2];h=a(h,t),c=o(c,t)}if(i&&r.length>s){const t=r[s];u=a(u,t),p=o(p,t)}}return n.xmin=m,n.ymin=g,n.xmax=y,n.ymax=x,n.spatialReference=this.spatialReference,e?(n.zmin=h,n.zmax=c):(n.zmin=void 0,n.zmax=void 0),i?(n.mmin=u,n.mmax=p):(n.mmin=void 0,n.mmax=void 0),n}writePoints(t,n){n.points=(0,r.o8)(this.points)}addPoint(t){return(0,p.h)(this,t),Array.isArray(t)?this.points.push(t):this.points.push(t.toArray()),this.notifyChange("points"),this}clone(){const t={points:(0,r.o8)(this.points),spatialReference:this.spatialReference};return this.hasZ&&(t.hasZ=!0),this.hasM&&(t.hasM=!0),new i(t)}getPoint(t){if(!this._validateInputs(t))return null;const n=this.points[t],e={x:n[0],y:n[1],spatialReference:this.spatialReference};let i=2;return this.hasZ&&(e.z=n[2],i=3),this.hasM&&(e.m=n[i]),new c.A(e)}removePoint(t){if(!this._validateInputs(t))return null;const n=new c.A(this.points.splice(t,1)[0],this.spatialReference);return this.notifyChange("points"),n}setPoint(t,n){return this._validateInputs(t)?((0,p.h)(this,n),Array.isArray(n)||(n=n.toArray()),this.points[t]=n,this.notifyChange("points"),this):this}toJSON(t){return this.write({},t)}_validateInputs(t){return null!=t&&t>=0&&t<this.points.length}};(0,s._)([(0,a.MZ)({readOnly:!0})],m.prototype,"cache",null),(0,s._)([(0,a.MZ)()],m.prototype,"extent",null),(0,s._)([(0,a.MZ)({type:[[Number]],json:{write:{isRequired:!0}}})],m.prototype,"points",void 0),(0,s._)([(0,h.K)("points")],m.prototype,"writePoints",null),m=i=(0,s._)([(0,o.$)("esri.geometry.Multipoint")],m),m.prototype.toJSON.isDefaultToJSON=!0;const g=m},51118:(t,n,e)=>{function i(t){const n=[];for(t.reset();t.nextPath();){const e=[];for(;t.nextPoint();)e.push([t.x,t.y]);n.push(e)}return t.reset(),n}function s(t){const n=[];for(;t.nextPoint();)n.push([t.x,t.y]);return t.seekPathStart(),n}e.d(n,{A:()=>s,x:()=>i})},56993:(t,n,e)=>{function i(t,n,e=!1){let{hasM:i,hasZ:s}=t;Array.isArray(n)?4!==n.length||i||s?3===n.length&&e&&!i?(s=!0,i=!1):3===n.length&&i&&s&&(i=!1,s=!1):(i=!0,s=!0):(s=!s&&n.hasZ&&(!i||n.hasM),i=!i&&n.hasM&&(!s||n.hasZ)),t.hasZ=s,t.hasM=i}e.d(n,{h:()=>i})},82799:(t,n,e)=>{e.d(n,{A:()=>y});var i,s=e(90237),r=e(4718),a=e(10107),o=(e(44208),e(53966),e(40608)),h=e(43937),l=e(5443),u=e(91075),c=e(86738),p=e(16930),f=e(90634),m=e(56993);let g=i=class extends u.A{constructor(t){super(function(t){if(!t)return;let{paths:n,hasM:e,hasZ:i,spatialReference:s}=t;switch(n??=[],function(t){return"number"==typeof t[0]?.[0]}(n)&&(n=[n]),n[0]?.[0]?.length){case 4:i??=!0,e??=!0;break;case 3:i??=!0!==e,e??=!i;break;default:i??=!1,e??=!1}return s??=p.A.WGS84,{...t,hasM:e,hasZ:i,paths:n,spatialReference:s}}(t)),this.curvePaths=void 0,this.paths=[],this.type="polyline"}get cache(){return this.commitProperty("curvePaths"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("paths"),this.commitProperty("spatialReference"),{}}writeCurvePaths(t,n){n.curvePaths=(0,r.o8)(t)}get extent(){const t=(0,f.Z3)(this),{spatialReference:n}=this;return t?new l.A({...t,spatialReference:n}):null}writePaths(t,n){n.paths=(0,r.o8)(this.paths)}addPath(t){if(!t)return;const n=this.paths,e=n.length;if(function(t){return!Array.isArray(t[0])}(t)){const i=[];for(let n=0,e=t.length;n<e;n++)i[n]=t[n].toArray();n[e]=i}else n[e]=t.slice();return this.notifyChange("paths"),this}clone(){const t=new i;return t.spatialReference=this.spatialReference,t.paths=(0,r.o8)(this.paths),t.curvePaths=(0,r.o8)(this.curvePaths),t.hasZ=this.hasZ,t.hasM=this.hasM,t}getPoint(t,n){if(!this._validateInputs(t,n))return null;const e=this.paths[t][n],i=this.hasZ,s=this.hasM;return i&&!s?new c.A(e[0],e[1],e[2],void 0,this.spatialReference):s&&!i?new c.A(e[0],e[1],void 0,e[2],this.spatialReference):i&&s?new c.A(e[0],e[1],e[2],e[3],this.spatialReference):new c.A(e[0],e[1],this.spatialReference)}insertPoint(t,n,e){return this._validateInputs(t,n,!0)?((0,m.h)(this,e),Array.isArray(e)||(e=e.toArray()),this.paths[t].splice(n,0,e),this.notifyChange("paths"),this):this}removePath(t){if(!this._validateInputs(t,null))return null;const n=this.paths.splice(t,1)[0],e=this.spatialReference,i=n.map((t=>new c.A(t,e)));return this.notifyChange("paths"),i}removePoint(t,n){if(!this._validateInputs(t,n))return null;const e=new c.A(this.paths[t].splice(n,1)[0],this.spatialReference);return this.notifyChange("paths"),e}setPoint(t,n,e){return this._validateInputs(t,n)?((0,m.h)(this,e),Array.isArray(e)||(e=e.toArray()),this.paths[t][n]=e,this.notifyChange("paths"),this):this}_validateInputs(t,n,e=!1){if(null==t||t<0||t>=this.paths.length)return!1;if(null!=n){const i=this.paths[t];if(e&&(n<0||n>i.length))return!1;if(!e&&(n<0||n>=i.length))return!1}return!0}toJSON(t){return this.write({},t)}};(0,s._)([(0,a.MZ)({readOnly:!0})],g.prototype,"cache",null),(0,s._)([(0,a.MZ)({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],g.prototype,"curvePaths",void 0),(0,s._)([(0,h.K)("curvePaths")],g.prototype,"writeCurvePaths",null),(0,s._)([(0,a.MZ)({readOnly:!0})],g.prototype,"extent",null),(0,s._)([(0,a.MZ)({type:[[[Number]]],json:{write:{isRequired:!0}}})],g.prototype,"paths",void 0),(0,s._)([(0,h.K)("paths")],g.prototype,"writePaths",null),g=i=(0,s._)([(0,o.$)("esri.geometry.Polyline")],g);const y=g;g.prototype.toJSON.isDefaultToJSON=!0},90634:(t,n,e)=>{e.d(n,{HA:()=>u,Z3:()=>p,v:()=>c});var i=e(537);const s=[];function r(t,n,e,i){return{xmin:t,ymin:n,xmax:e,ymax:i}}function a(t,n,e,i,s,r){return{xmin:t,ymin:n,zmin:e,xmax:i,ymax:s,zmax:r}}function o(t,n,e,i,s,r){return{xmin:t,ymin:n,mmin:e,xmax:i,ymax:s,mmax:r}}function h(t,n,e,i,s,r,a,o){return{xmin:t,ymin:n,zmin:e,mmin:i,xmax:s,ymax:r,zmax:a,mmax:o}}function l(t,n=!1,e=!1){return n?e?h(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]):a(t[0],t[1],t[2],t[3],t[4],t[5]):e?o(t[0],t[1],t[2],t[3],t[4],t[5]):r(t[0],t[1],t[2],t[3])}function u(t){return t?function(t){return void 0!==t.xmin&&void 0!==t.ymin&&void 0!==t.xmax&&void 0!==t.ymax}(t)?t:function(t){return void 0!==t.x&&void 0!==t.y}(t)?function(t){const{x:n,y:e,z:i,m:s}=t,l=null!=s;return null!=i?l?h(n,e,i,s,n,e,i,s):a(n,e,i,n,e,i):l?o(n,e,s,n,e,s):r(n,e,n,e)}(t):function(t){return void 0!==t.rings}(t)?c(t):function(t){return void 0!==t.paths}(t)?p(t):function(t){return void 0!==t.points}(t)?function(t){const{hasZ:n,hasM:e,points:r}=t;return l((0,i.Pj)(s,r,n??!1,e??!1),n,e)}(t):null:null}function c(t){const{hasZ:n,hasM:e,rings:r}=t,a=(0,i.Yz)(s,r,n??!1,e??!1);return a?l(a,n,e):null}function p(t){const{hasZ:n,hasM:e,paths:r}=t,a=(0,i.Yz)(s,r,n??!1,e??!1);return a?l(a,n,e):null}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9899],{620:(_,E,R)=>{R.d(E,{O_:()=>t,vA:()=>T}),R(48163),R(87317),(0,R(91829).vt)();class A{constructor(_){this.message=_}toString(){return`AssertException: ${this.message}`}}function T(_,E="Assertion"){if(!_){const _=new Error(E).stack;throw new A(`${E} at ${_}`)}}function t(_,E,R,A){let T,t=(R[0]-_[0])/E[0],e=(A[0]-_[0])/E[0];t>e&&(T=t,t=e,e=T);let N=(R[1]-_[1])/E[1],S=(A[1]-_[1])/E[1];if(N>S&&(T=N,N=S,S=T),t>S||N>e)return!1;N>t&&(t=N),S<e&&(e=S);let I=(R[2]-_[2])/E[2],n=(A[2]-_[2])/E[2];return I>n&&(T=I,I=n,n=T),!(t>n||I>e||(n<e&&(e=n),e<0))}},1843:(_,E,R)=>{R.d(E,{BP:()=>S,l5:()=>I});var A=R(13030),T=R(90239),t=R(620);class e{constructor(_,E){this.layout=_,this.buffer="number"==typeof E?new ArrayBuffer(E*_.stride):E;for(const E of _.fields.keys()){const R=_.fields.get(E);this[E]=new R.constructor(this.buffer,R.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(_,E){const R=this[_];return R&&R.elementCount===E.ElementCount&&R.elementType===E.ElementType?R:null}slice(_,E){return new e(this.layout,this.buffer.slice(_*this.stride,E*this.stride))}copyFrom(_,E=0,R=0,A=_.count){const T=this.stride;if(T%4==0){const t=new Uint32Array(_.buffer,E*T,A*T/4);new Uint32Array(this.buffer,R*T,A*T/4).set(t)}else{const t=new Uint8Array(_.buffer,E*T,A*T);new Uint8Array(this.buffer,R*T,A*T).set(t)}return this}get cachedMemory(){return this.byteLength}dispose(){}}class N{constructor(_){this._stride=0,this._fields=new Map,_&&(this._stride=_.stride,_.fields.forEach((_=>this._fields.set(_[0],{..._[1],constructor:O(_[1].constructor)}))))}freeze(){return this}vec2f16(_,E){return this._appendField(_,A.ZD,E),this}vec2f(_,E){return this._appendField(_,A.gH,E),this}vec2f64(_,E){return this._appendField(_,A.si,E),this}vec3f16(_,E){return this._appendField(_,A.EC,E),this}vec3f(_,E){return this._appendField(_,A.xs,E),this}vec3f64(_,E){return this._appendField(_,A.Xm,E),this}vec4f16(_,E){return this._appendField(_,A.jz,E),this}vec4f(_,E){return this._appendField(_,A.Eq,E),this}vec4f64(_,E){return this._appendField(_,A.Aj,E),this}mat3f(_,E){return this._appendField(_,A.jZ,E),this}mat3f64(_,E){return this._appendField(_,A.j0,E),this}mat4f(_,E){return this._appendField(_,A.Sx,E),this}mat4f64(_,E){return this._appendField(_,A.E$,E),this}vec4u8(_,E){return this._appendField(_,A.XP,E),this}f16(_,E){return this._appendField(_,A.XW,E),this}f32(_,E){return this._appendField(_,A.Y$,E),this}f64(_,E){return this._appendField(_,A.qB,E),this}u8(_,E){return this._appendField(_,A.SL,E),this}u16(_,E){return this._appendField(_,A.h,E),this}i8(_,E){return this._appendField(_,A.bf,E),this}vec2i8(_,E){return this._appendField(_,A.D6,E),this}vec2i16(_,E){return this._appendField(_,A.mJ,E),this}vec2u8(_,E){return this._appendField(_,A.LC,E),this}vec4u16(_,E){return this._appendField(_,A.Uz,E),this}u32(_,E){return this._appendField(_,A.P,E),this}_appendField(_,E,R){if(this._fields.has(_))return void(0,t.vA)(!1,`${_} already added to vertex buffer layout`);const A=E.ElementCount*(0,T.GJ)(E.ElementType),e=this._stride;this._fields.set(_,{constructor:E,size:A,offset:e,optional:R}),this._alignFields()}_alignFields(){let _=0,E=1;this._fields.forEach((R=>{const A=(0,T.GJ)(R.constructor.ElementType);_=Math.floor((_+A-1)/A)*A,R.offset=_,_+=R.size,E=Math.max(E,A)})),_=Math.floor((_+E-1)/E)*E,this._stride=_}createBuffer(_){return new e(this,_)}createView(_){return new e(this,_)}clone(){const _=new N;return _._stride=this._stride,_._fields=new Map,this._fields.forEach(((E,R)=>_._fields.set(R,E))),_.BufferType=this.BufferType,_}get stride(){return this._stride}get fields(){return this._fields}}function S(){return new N}class I{constructor(_){this.fields=new Array,_.fields.forEach(((_,E)=>{const R={..._,constructor:r(_.constructor)};this.fields.push([E,R])})),this.stride=_.stride}}const n=[A.Y$,A.gH,A.xs,A.Eq,A.jZ,A.Sx,A.qB,A.si,A.Xm,A.Aj,A.j0,A.E$,A.SL,A.LC,A.eI,A.XP,A.h,A.Yi,A.nS,A.Uz,A.P,A.An,A.H$,A.ml,A.bf,A.D6,A.m8,A.TX,A.Qt,A.mJ,A.Vp,A.E7,A.My,A.UL,A.zD,A.Y4];function r(_){return`${_.ElementType}_${_.ElementCount}`}function O(_){return C.get(_)}const C=new Map;n.forEach((_=>C.set(r(_),_)))},11868:(_,E,R)=>{R.d(E,{oe:()=>T});var A=R(34275);function T(_,E=!1){return _<=A.y9?E?new Array(_).fill(0):new Array(_):new Float32Array(_)}},63907:(_,E,R)=>{var A,T,t,e,N,S,I,n,r,O,C,i,L,D,U,s,P,M,G,F,B,f,u,c;R.d(E,{Ab:()=>s,Ac:()=>n,Ap:()=>D,CQ:()=>l,Cj:()=>i,Fq:()=>a,H0:()=>P,H3:()=>U,Hr:()=>c,MT:()=>O,NV:()=>A,Tb:()=>N,WR:()=>t,Y7:()=>I,bh:()=>m,dn:()=>e,eA:()=>C,ld:()=>M,nI:()=>d,pF:()=>L,pe:()=>r,r6:()=>o,vt:()=>u,yI:()=>h,yQ:()=>G}),function(_){_[_.DEPTH=256]="DEPTH",_[_.STENCIL=1024]="STENCIL",_[_.COLOR=16384]="COLOR"}(A||(A={})),function(_){_[_.COLOR=6144]="COLOR",_[_.DEPTH=6145]="DEPTH",_[_.STENCIL=6146]="STENCIL",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(T||(T={})),function(_){_[_.POINTS=0]="POINTS",_[_.LINES=1]="LINES",_[_.LINE_LOOP=2]="LINE_LOOP",_[_.LINE_STRIP=3]="LINE_STRIP",_[_.TRIANGLES=4]="TRIANGLES",_[_.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",_[_.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(t||(t={})),function(_){_[_.ZERO=0]="ZERO",_[_.ONE=1]="ONE",_[_.SRC_COLOR=768]="SRC_COLOR",_[_.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",_[_.SRC_ALPHA=770]="SRC_ALPHA",_[_.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",_[_.DST_ALPHA=772]="DST_ALPHA",_[_.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",_[_.DST_COLOR=774]="DST_COLOR",_[_.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",_[_.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",_[_.CONSTANT_COLOR=32769]="CONSTANT_COLOR",_[_.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",_[_.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",_[_.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(e||(e={})),function(_){_[_.ADD=32774]="ADD",_[_.MIN=32775]="MIN",_[_.MAX=32776]="MAX",_[_.SUBTRACT=32778]="SUBTRACT",_[_.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(N||(N={})),function(_){_[_.ARRAY_BUFFER=34962]="ARRAY_BUFFER",_[_.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",_[_.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",_[_.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",_[_.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",_[_.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",_[_.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",_[_.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(S||(S={})),function(_){_[_.FRONT=1028]="FRONT",_[_.BACK=1029]="BACK",_[_.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(I||(I={})),function(_){_[_.CW=2304]="CW",_[_.CCW=2305]="CCW"}(n||(n={})),function(_){_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.INT=5124]="INT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.FLOAT=5126]="FLOAT",_[_.HALF_FLOAT=5131]="HALF_FLOAT"}(r||(r={})),function(_){_[_.NEVER=512]="NEVER",_[_.LESS=513]="LESS",_[_.EQUAL=514]="EQUAL",_[_.LEQUAL=515]="LEQUAL",_[_.GREATER=516]="GREATER",_[_.NOTEQUAL=517]="NOTEQUAL",_[_.GEQUAL=518]="GEQUAL",_[_.ALWAYS=519]="ALWAYS"}(O||(O={})),function(_){_[_.ZERO=0]="ZERO",_[_.KEEP=7680]="KEEP",_[_.REPLACE=7681]="REPLACE",_[_.INCR=7682]="INCR",_[_.DECR=7683]="DECR",_[_.INVERT=5386]="INVERT",_[_.INCR_WRAP=34055]="INCR_WRAP",_[_.DECR_WRAP=34056]="DECR_WRAP"}(C||(C={})),function(_){_[_.NEAREST=9728]="NEAREST",_[_.LINEAR=9729]="LINEAR",_[_.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",_[_.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",_[_.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",_[_.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(i||(i={})),function(_){_[_.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",_[_.REPEAT=10497]="REPEAT",_[_.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(L||(L={})),function(_){_[_.TEXTURE_2D=3553]="TEXTURE_2D",_[_.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",_[_.TEXTURE_3D=32879]="TEXTURE_3D",_[_.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",_[_.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",_[_.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",_[_.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",_[_.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(D||(D={})),function(_){_[_.MIN_LOD=33082]="MIN_LOD",_[_.MAX_LOD=33083]="MAX_LOD",_[_.BASE_LEVEL=33084]="BASE_LEVEL",_[_.MAX_LEVEL=33085]="MAX_LEVEL",_[_.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE"}(U||(U={})),function(_){_[_.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL",_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.ALPHA=6406]="ALPHA",_[_.RGB=6407]="RGB",_[_.RGBA=6408]="RGBA",_[_.LUMINANCE=6409]="LUMINANCE",_[_.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",_[_.RED=6403]="RED",_[_.RG=33319]="RG",_[_.RED_INTEGER=36244]="RED_INTEGER",_[_.RG_INTEGER=33320]="RG_INTEGER",_[_.RGB_INTEGER=36248]="RGB_INTEGER",_[_.RGBA_INTEGER=36249]="RGBA_INTEGER"}(s||(s={})),function(_){_[_.RGBA4=32854]="RGBA4",_[_.R16F=33325]="R16F",_[_.RG16F=33327]="RG16F",_[_.RGB32F=34837]="RGB32F",_[_.RGBA16F=34842]="RGBA16F",_[_.R32F=33326]="R32F",_[_.RG32F=33328]="RG32F",_[_.RGBA32F=34836]="RGBA32F",_[_.R11F_G11F_B10F=35898]="R11F_G11F_B10F",_[_.RGB8=32849]="RGB8",_[_.RGBA8=32856]="RGBA8",_[_.RGB5_A1=32855]="RGB5_A1",_[_.R8=33321]="R8",_[_.RG8=33323]="RG8",_[_.R8I=33329]="R8I",_[_.R8UI=33330]="R8UI",_[_.R16I=33331]="R16I",_[_.R16UI=33332]="R16UI",_[_.R32I=33333]="R32I",_[_.R32UI=33334]="R32UI",_[_.RG8I=33335]="RG8I",_[_.RG8UI=33336]="RG8UI",_[_.RG16I=33337]="RG16I",_[_.RG16UI=33338]="RG16UI",_[_.RG32I=33339]="RG32I",_[_.RG32UI=33340]="RG32UI",_[_.RGB16F=34843]="RGB16F",_[_.RGB9_E5=35901]="RGB9_E5",_[_.SRGB8=35905]="SRGB8",_[_.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",_[_.RGB565=36194]="RGB565",_[_.RGBA32UI=36208]="RGBA32UI",_[_.RGB32UI=36209]="RGB32UI",_[_.RGBA16UI=36214]="RGBA16UI",_[_.RGB16UI=36215]="RGB16UI",_[_.RGBA8UI=36220]="RGBA8UI",_[_.RGB8UI=36221]="RGB8UI",_[_.RGBA32I=36226]="RGBA32I",_[_.RGB32I=36227]="RGB32I",_[_.RGBA16I=36232]="RGBA16I",_[_.RGB16I=36233]="RGB16I",_[_.RGBA8I=36238]="RGBA8I",_[_.RGB8I=36239]="RGB8I",_[_.R8_SNORM=36756]="R8_SNORM",_[_.RG8_SNORM=36757]="RG8_SNORM",_[_.RGB8_SNORM=36758]="RGB8_SNORM",_[_.RGBA8_SNORM=36759]="RGBA8_SNORM",_[_.RGB10_A2=32857]="RGB10_A2",_[_.RGB10_A2UI=36975]="RGB10_A2UI"}(P||(P={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",_[_.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",_[_.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",_[_.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.INT=5124]="INT",_[_.HALF_FLOAT=5131]="HALF_FLOAT",_[_.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",_[_.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",_[_.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",_[_.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(M||(M={})),function(_){_[_.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",_[_.STENCIL_INDEX8=36168]="STENCIL_INDEX8",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL",_[_.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",_[_.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(G||(G={})),function(_){_[_.STATIC_DRAW=35044]="STATIC_DRAW",_[_.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",_[_.STREAM_DRAW=35040]="STREAM_DRAW",_[_.STATIC_READ=35045]="STATIC_READ",_[_.DYNAMIC_READ=35049]="DYNAMIC_READ",_[_.STREAM_READ=35041]="STREAM_READ",_[_.STATIC_COPY=35046]="STATIC_COPY",_[_.DYNAMIC_COPY=35050]="DYNAMIC_COPY",_[_.STREAM_COPY=35042]="STREAM_COPY"}(F||(F={})),function(_){_[_.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",_[_.VERTEX_SHADER=35633]="VERTEX_SHADER"}(B||(B={})),function(_){_[_.FRAMEBUFFER=36160]="FRAMEBUFFER",_[_.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",_[_.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(f||(f={})),function(_){_[_.Texture=0]="Texture",_[_.BufferObject=1]="BufferObject",_[_.VertexArrayObject=2]="VertexArrayObject",_[_.Shader=3]="Shader",_[_.Program=4]="Program",_[_.FramebufferObject=5]="FramebufferObject",_[_.Renderbuffer=6]="Renderbuffer",_[_.TransformFeedback=7]="TransformFeedback",_[_.Sync=8]="Sync",_[_.UNCOUNTED=9]="UNCOUNTED",_[_.LinesOfCode=9]="LinesOfCode",_[_.Uniform=10]="Uniform",_[_.COUNT=11]="COUNT"}(u||(u={})),function(_){_[_.NONE=0]="NONE",_[_.BACK=1029]="BACK"}(c||(c={}));const o=36064,h=36065,a=36066,d=33306;var l,H,p,V,X,Y,y,m,w;!function(_){_[_.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",_[_.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",_[_.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",_[_.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",_[_.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",_[_.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",_[_.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",_[_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",_[_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(l||(l={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.FLOAT_VEC2=35664]="FLOAT_VEC2",_[_.FLOAT_VEC3=35665]="FLOAT_VEC3",_[_.FLOAT_VEC4=35666]="FLOAT_VEC4",_[_.INT=5124]="INT",_[_.INT_VEC2=35667]="INT_VEC2",_[_.INT_VEC3=35668]="INT_VEC3",_[_.INT_VEC4=35669]="INT_VEC4",_[_.BOOL=35670]="BOOL",_[_.BOOL_VEC2=35671]="BOOL_VEC2",_[_.BOOL_VEC3=35672]="BOOL_VEC3",_[_.BOOL_VEC4=35673]="BOOL_VEC4",_[_.FLOAT_MAT2=35674]="FLOAT_MAT2",_[_.FLOAT_MAT3=35675]="FLOAT_MAT3",_[_.FLOAT_MAT4=35676]="FLOAT_MAT4",_[_.SAMPLER_2D=35678]="SAMPLER_2D",_[_.SAMPLER_CUBE=35680]="SAMPLER_CUBE",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",_[_.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",_[_.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",_[_.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",_[_.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",_[_.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",_[_.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",_[_.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",_[_.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",_[_.SAMPLER_3D=35679]="SAMPLER_3D",_[_.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",_[_.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",_[_.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",_[_.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",_[_.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",_[_.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",_[_.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",_[_.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",_[_.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",_[_.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",_[_.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",_[_.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(H||(H={})),function(_){_[_.OBJECT_TYPE=37138]="OBJECT_TYPE",_[_.SYNC_CONDITION=37139]="SYNC_CONDITION",_[_.SYNC_STATUS=37140]="SYNC_STATUS",_[_.SYNC_FLAGS=37141]="SYNC_FLAGS"}(p||(p={})),function(_){_[_.UNSIGNALED=37144]="UNSIGNALED",_[_.SIGNALED=37145]="SIGNALED"}(V||(V={})),function(_){_[_.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",_[_.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",_[_.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",_[_.WAIT_FAILED=37149]="WAIT_FAILED"}(X||(X={})),function(_){_[_.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(Y||(Y={})),function(_){_[_.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(y||(y={})),function(_){_[_.INVALID_ENUM=1280]="INVALID_ENUM",_[_.INVALID_VALUE=1281]="INVALID_VALUE",_[_.INVALID_OPERATION=1282]="INVALID_OPERATION",_[_.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",_[_.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",_[_.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL"}(m||(m={})),function(_){_[_.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR"}(w||(w={}))},90239:(_,E,R)=>{function A(_){switch(_){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}R.d(E,{GJ:()=>A})},97146:(_,E,R)=>{R.d(E,{Dg:()=>t,my:()=>e,tM:()=>n,uW:()=>T});var A=R(34275);function T(_){return t(_,!0)}function t(_,E){if(Array.isArray(_)){if(_.length<A.y9)return _}else if(_.length<A.y9)return Array.from(_);let R=!0,T=!0;return _.some(((_,E)=>(R=R&&0===_,T=T&&_===E,!R&&!T))),R?function(_){if(1===_)return S;if(_<A.y9)return new Array(_).fill(0);if(_>O.length){const E=Math.max(2*O.length,_);O=new Uint8Array(E)}return new Uint8Array(O.buffer,0,_)}(_.length):T?n(_.length):(0,A.iu)(_)&&_.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?_:function(_,E){for(const R of _){if(R>=65536)return(0,A.iu)(_)?_:new Uint32Array(_);R>=256&&(E=!1)}return E?new Uint8Array(_):new Uint16Array(_)}(_,!E)}function e(_){return _<=A.y9?new Array(_):_<=65536?new Uint16Array(_):new Uint32Array(_)}let N=r(131072);const S=[0],I=(()=>{const _=new Uint16Array(65536);for(let E=0;E<_.length;++E)_[E]=E;return _})();function n(_){return 1===_?S:_<A.y9?Array.from(new Uint16Array(I.buffer,0,_)):_<I.length?new Uint16Array(I.buffer,0,_):(_>N.length&&(N=r(Math.max(2*N.length,_))),new Uint32Array(N.buffer,0,_))}function r(_){const E=new Uint32Array(_);for(let _=0;_<E.length;_++)E[_]=_;return E}let O=new Uint8Array(65536)}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3030],{13030:(t,e,r)=>{r.d(e,{Y$:()=>p,XW:()=>a,qB:()=>L,Qt:()=>X,My:()=>Q,bf:()=>j,jZ:()=>A,j0:()=>O,Sx:()=>S,E$:()=>g,h:()=>R,P:()=>I,SL:()=>x,gH:()=>b,ZD:()=>l,si:()=>M,mJ:()=>Z,UL:()=>W,D6:()=>D,Yi:()=>N,An:()=>U,LC:()=>C,xs:()=>T,EC:()=>B,Xm:()=>w,Vp:()=>$,zD:()=>J,m8:()=>z,nS:()=>F,H$:()=>q,eI:()=>P,Eq:()=>m,jz:()=>E,Aj:()=>_,E7:()=>H,Y4:()=>G,TX:()=>k,Uz:()=>v,ml:()=>V,XP:()=>Y});var s=r(26615);class f{static{this.ElementCount=9}constructor(t,e,r=0,s,f){this.TypedArrayConstructor=t,this.elementCount=9;const i=this.TypedArrayConstructor;void 0===s&&(s=9*i.BYTES_PER_ELEMENT);const n=0===e.byteLength?0:r;this.typedBuffer=null==f?new i(e,n):new i(e,n,(f-r)/i.BYTES_PER_ELEMENT),this.typedBufferStride=s/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(t,e,r=this.count-e){const s=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,s,this.stride,s+r*this.stride)}getMat(t,e){let r=t*this.typedBufferStride;for(let t=0;t<9;t++)e[t]=this.typedBuffer[r++];return e}setMat(t,e){let r=t*this.typedBufferStride;for(let t=0;t<9;t++)this.typedBuffer[r++]=e[t]}get(t,e){return this.typedBuffer[t*this.typedBufferStride+e]}set(t,e,r){this.typedBuffer[t*this.typedBufferStride+e]=r}copyFrom(t,e,r){const s=this.typedBuffer,f=e.typedBuffer;let i=t*this.typedBufferStride,n=r*e.typedBufferStride;for(let t=0;t<9;++t)s[i++]=f[n++]}get buffer(){return this.typedBuffer.buffer}}class i{static{this.ElementCount=16}constructor(t,e,r=0,s,f){this.TypedArrayConstructor=t,this.elementCount=16;const i=this.TypedArrayConstructor;void 0===s&&(s=16*i.BYTES_PER_ELEMENT);const n=0===e.byteLength?0:r;this.typedBuffer=null==f?new i(e,n):new i(e,n,(f-r)/i.BYTES_PER_ELEMENT),this.typedBufferStride=s/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(t,e,r=this.count-e){const s=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,s,this.stride,s+r*this.stride)}getMat(t,e){let r=t*this.typedBufferStride;for(let t=0;t<16;t++)e[t]=this.typedBuffer[r++];return e}setMat(t,e){let r=t*this.typedBufferStride;for(let t=0;t<16;t++)this.typedBuffer[r++]=e[t]}get(t,e){return this.typedBuffer[t*this.typedBufferStride+e]}set(t,e,r){this.typedBuffer[t*this.typedBufferStride+e]=r}copyFrom(t,e,r){this.copyFromTypedBuffer(t,e.typedBuffer,r*e.typedBufferStride)}copyFromTypedBuffer(t,e,r){const s=this.typedBuffer;let f=t*this.typedBufferStride;for(let t=0;t<16;++t)s[f++]=e[r++]}get buffer(){return this.typedBuffer.buffer}}class n{static{this.ElementCount=1}constructor(t,e,r=0,s,f){this.TypedArrayConstructor=t,this.elementCount=1;const i=this.TypedArrayConstructor;void 0===s&&(s=i.BYTES_PER_ELEMENT);const n=0===e.byteLength?0:r;this.typedBuffer=null==f?new i(e,n):new i(e,n,(f-r)/i.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(t,e,r=this.count-e){const s=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,s,this.stride,s+r*this.stride)}get(t){return this.typedBuffer[t*this.typedBufferStride]}set(t,e){this.typedBuffer[t*this.typedBufferStride]=e}get buffer(){return this.typedBuffer.buffer}}var u=r(37585);class y{static{this.ElementCount=2}constructor(t,e,r=0,s,f){this.TypedArrayConstructor=t,this.elementCount=2;const i=this.TypedArrayConstructor;void 0===s&&(s=2*i.BYTES_PER_ELEMENT);const n=0===e.byteLength?0:r;this.typedBuffer=null==f?new i(e,n):new i(e,n,(f-r)/i.BYTES_PER_ELEMENT),this.typedBufferStride=s/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(t,e,r=this.count-e){const s=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,s,this.stride,s+r*this.stride)}getVec(t,e){return t*=this.typedBufferStride,(0,u.hZ)(e,this.typedBuffer[t],this.typedBuffer[t+1])}setVec(t,e){t*=this.typedBufferStride,this.typedBuffer[t++]=e[0],this.typedBuffer[t]=e[1]}get(t,e){return this.typedBuffer[t*this.typedBufferStride+e]}set(t,e,r){this.typedBuffer[t*this.typedBufferStride+e]=r}setValues(t,e,r){t*=this.typedBufferStride,this.typedBuffer[t++]=e,this.typedBuffer[t]=r}copyFrom(t,e,r){const s=this.typedBuffer,f=e.typedBuffer;let i=t*this.typedBufferStride,n=r*e.typedBufferStride;s[i++]=f[n++],s[i]=f[n]}get buffer(){return this.typedBuffer.buffer}}var c=r(38954);class h{static{this.ElementCount=3}constructor(t,e,r=0,s,f){this.TypedArrayConstructor=t,this.elementCount=3;const i=this.TypedArrayConstructor;void 0===s&&(s=3*i.BYTES_PER_ELEMENT);const n=0===e.byteLength?0:r;this.typedBuffer=null==f?new i(e,n):new i(e,n,(f-r)/i.BYTES_PER_ELEMENT),this.typedBufferStride=s/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(t,e,r=this.count-e){const s=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,s,this.stride,s+r*this.stride)}getVec(t,e){return t*=this.typedBufferStride,(0,c.i)(e,this.typedBuffer[t],this.typedBuffer[t+1],this.typedBuffer[t+2])}setVec(t,e){t*=this.typedBufferStride,this.typedBuffer[t++]=e[0],this.typedBuffer[t++]=e[1],this.typedBuffer[t]=e[2]}get(t,e){return this.typedBuffer[t*this.typedBufferStride+e]}set(t,e,r){this.typedBuffer[t*this.typedBufferStride+e]=r}setValues(t,e,r,s){t*=this.typedBufferStride,this.typedBuffer[t++]=e,this.typedBuffer[t++]=r,this.typedBuffer[t]=s}copyFrom(t,e,r){const s=this.typedBuffer,f=e.typedBuffer;let i=t*this.typedBufferStride,n=r*e.typedBufferStride;s[i++]=f[n++],s[i++]=f[n++],s[i]=f[n]}get buffer(){return this.typedBuffer.buffer}}var o=r(87317);class d{static{this.ElementCount=4}constructor(t,e,r=0,s,f){this.TypedArrayConstructor=t,this.start=r,this.elementCount=4;const i=this.TypedArrayConstructor;void 0===s&&(s=4*i.BYTES_PER_ELEMENT);const n=0===e.byteLength?0:r;this.typedBuffer=null==f?new i(e,n):new i(e,n,(f-r)/i.BYTES_PER_ELEMENT),this.typedBufferStride=s/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(t,e,r=this.count-e){const s=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,s,this.stride,s+r*this.stride)}getVec(t,e){return t*=this.typedBufferStride,(0,o.s)(e,this.typedBuffer[t++],this.typedBuffer[t++],this.typedBuffer[t++],this.typedBuffer[t])}setVec(t,e){t*=this.typedBufferStride,this.typedBuffer[t++]=e[0],this.typedBuffer[t++]=e[1],this.typedBuffer[t++]=e[2],this.typedBuffer[t]=e[3]}get(t,e){return this.typedBuffer[t*this.typedBufferStride+e]}set(t,e,r){this.typedBuffer[t*this.typedBufferStride+e]=r}setValues(t,e,r,s,f){t*=this.typedBufferStride,this.typedBuffer[t++]=e,this.typedBuffer[t++]=r,this.typedBuffer[t++]=s,this.typedBuffer[t]=f}copyFrom(t,e,r){const s=this.typedBuffer,f=e.typedBuffer;let i=t*this.typedBufferStride,n=r*e.typedBufferStride;s[i++]=f[n++],s[i++]=f[n++],s[i++]=f[n++],s[i]=f[n]}get buffer(){return this.typedBuffer.buffer}}class a extends n{constructor(t,e=0,r,f){super(s.l,t,e,r,f),this.elementType="f16"}static fromTypedArray(t,e){return new a(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f16"}}class p extends n{constructor(t,e=0,r,s){super(Float32Array,t,e,r,s),this.elementType="f32"}static fromTypedArray(t,e){return new p(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f32"}}class l extends y{constructor(t,e=0,r,f){super(s.l,t,e,r,f),this.elementType="f16"}slice(t,e){return this.sliceBuffer(l,t,e)}static fromTypedArray(t,e){return new l(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f16"}}class b extends y{constructor(t,e=0,r,s){super(Float32Array,t,e,r,s),this.elementType="f32"}slice(t,e){return this.sliceBuffer(b,t,e)}static fromTypedArray(t,e){return new b(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f32"}}class B extends h{constructor(t,e=0,r,f){super(s.l,t,e,r,f),this.elementType="f16"}slice(t,e){return this.sliceBuffer(B,t,e)}static fromTypedArray(t,e){return new B(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f16"}}class T extends h{constructor(t,e=0,r,s){super(Float32Array,t,e,r,s),this.elementType="f32"}slice(t,e){return this.sliceBuffer(T,t,e)}static fromTypedArray(t,e){return new T(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f32"}}class E extends d{constructor(t,e=0,r,f){super(s.l,t,e,r,f),this.elementType="f16"}slice(t,e){return this.sliceBuffer(E,t,e)}static fromTypedArray(t,e){return new E(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f16"}}class m extends d{constructor(t,e=0,r,s){super(Float32Array,t,e,r,s),this.elementType="f32"}slice(t,e){return this.sliceBuffer(m,t,e)}static fromTypedArray(t,e){return new m(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f32"}}class A extends f{constructor(t,e=0,r,s){super(Float32Array,t,e,r,s),this.elementType="f32"}slice(t,e){return this.sliceBuffer(A,t,e)}static fromTypedArray(t,e){return new A(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f32"}}class O extends f{constructor(t,e=0,r,s){super(Float64Array,t,e,r,s),this.elementType="f64"}slice(t,e){return this.sliceBuffer(O,t,e)}static fromTypedArray(t,e){return new O(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f64"}}class S extends i{constructor(t,e=0,r,s){super(Float32Array,t,e,r,s),this.elementType="f32"}slice(t,e){return this.sliceBuffer(S,t,e)}static fromTypedArray(t,e){return new S(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f32"}}class g extends i{constructor(t,e=0,r,s){super(Float64Array,t,e,r,s),this.elementType="f64"}slice(t,e){return this.sliceBuffer(g,t,e)}static fromTypedArray(t,e){return new g(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f64"}}class L extends n{constructor(t,e=0,r,s){super(Float64Array,t,e,r,s),this.elementType="f64"}slice(t,e){return this.sliceBuffer(L,t,e)}static fromTypedArray(t,e){return new L(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f64"}}class M extends y{constructor(t,e=0,r,s){super(Float64Array,t,e,r,s),this.elementType="f64"}slice(t,e){return this.sliceBuffer(M,t,e)}static fromTypedArray(t,e){return new M(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f64"}}class w extends h{constructor(t,e=0,r,s){super(Float64Array,t,e,r,s),this.elementType="f64"}slice(t,e){return this.sliceBuffer(w,t,e)}static fromTypedArray(t,e){return new w(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f64"}}class _ extends d{constructor(t,e=0,r,s){super(Float64Array,t,e,r,s),this.elementType="f64"}slice(t,e){return this.sliceBuffer(_,t,e)}static fromTypedArray(t,e){return new _(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="f64"}}class x extends n{constructor(t,e=0,r,s){super(Uint8Array,t,e,r,s),this.elementType="u8"}slice(t,e){return this.sliceBuffer(x,t,e)}static fromTypedArray(t,e){return new x(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u8"}}class C extends y{constructor(t,e=0,r,s){super(Uint8Array,t,e,r,s),this.elementType="u8"}slice(t,e){return this.sliceBuffer(C,t,e)}static fromTypedArray(t,e){return new C(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u8"}}class P extends h{constructor(t,e=0,r,s){super(Uint8Array,t,e,r,s),this.elementType="u8"}slice(t,e){return this.sliceBuffer(P,t,e)}static fromTypedArray(t,e){return new P(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u8"}}class Y extends d{constructor(t,e=0,r,s){super(Uint8Array,t,e,r,s),this.elementType="u8"}slice(t,e){return this.sliceBuffer(Y,t,e)}static fromTypedArray(t,e){return new Y(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u8"}}class R extends n{constructor(t,e=0,r,s){super(Uint16Array,t,e,r,s),this.elementType="u16"}slice(t,e){return this.sliceBuffer(R,t,e)}static fromTypedArray(t,e){return new R(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u16"}}class N extends y{constructor(t,e=0,r,s){super(Uint16Array,t,e,r,s),this.elementType="u16"}slice(t,e){return this.sliceBuffer(N,t,e)}static fromTypedArray(t,e){return new N(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u16"}}class F extends h{constructor(t,e=0,r,s){super(Uint16Array,t,e,r,s),this.elementType="u16"}slice(t,e){return this.sliceBuffer(F,t,e)}static fromTypedArray(t,e){return new F(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u16"}}class v extends d{constructor(t,e=0,r,s){super(Uint16Array,t,e,r,s),this.elementType="u16"}slice(t,e){return this.sliceBuffer(v,t,e)}static fromTypedArray(t,e){return new v(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u16"}}class I extends n{constructor(t,e=0,r,s){super(Uint32Array,t,e,r,s),this.elementType="u32"}slice(t,e){return this.sliceBuffer(I,t,e)}static fromTypedArray(t,e){return new I(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u32"}}class U extends y{constructor(t,e=0,r,s){super(Uint32Array,t,e,r,s),this.elementType="u32"}slice(t,e){return this.sliceBuffer(U,t,e)}static fromTypedArray(t,e){return new U(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u32"}}class q extends h{constructor(t,e=0,r,s){super(Uint32Array,t,e,r,s),this.elementType="u32"}slice(t,e){return this.sliceBuffer(q,t,e)}static fromTypedArray(t,e){return new q(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u32"}}class V extends d{constructor(t,e=0,r,s){super(Uint32Array,t,e,r,s),this.elementType="u32"}slice(t,e){return this.sliceBuffer(V,t,e)}static fromTypedArray(t,e){return new V(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="u32"}}class j extends n{constructor(t,e=0,r,s){super(Int8Array,t,e,r,s),this.elementType="i8"}slice(t,e){return this.sliceBuffer(j,t,e)}static fromTypedArray(t,e){return new j(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i8"}}class D extends y{constructor(t,e=0,r,s){super(Int8Array,t,e,r,s),this.elementType="i8"}slice(t,e){return this.sliceBuffer(D,t,e)}static fromTypedArray(t,e){return new D(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i8"}}class z extends h{constructor(t,e=0,r,s){super(Int8Array,t,e,r,s),this.elementType="i8"}slice(t,e){return this.sliceBuffer(z,t,e)}static fromTypedArray(t,e){return new z(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i8"}}class k extends d{constructor(t,e=0,r,s){super(Int8Array,t,e,r,s),this.elementType="i8"}slice(t,e){return this.sliceBuffer(k,t,e)}static fromTypedArray(t,e){return new k(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i8"}}class X extends n{constructor(t,e=0,r,s){super(Int16Array,t,e,r,s),this.elementType="i16"}slice(t,e){return this.sliceBuffer(X,t,e)}static fromTypedArray(t,e){return new X(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i16"}}class Z extends y{constructor(t,e=0,r,s){super(Int16Array,t,e,r,s),this.elementType="i16"}slice(t,e){return this.sliceBuffer(Z,t,e)}static fromTypedArray(t,e){return new Z(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i16"}}class $ extends h{constructor(t,e=0,r,s){super(Int16Array,t,e,r,s),this.elementType="i16"}slice(t,e){return this.sliceBuffer($,t,e)}static fromTypedArray(t,e){return new $(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i16"}}class H extends d{constructor(t,e=0,r,s){super(Int16Array,t,e,r,s),this.elementType="i16"}slice(t,e){return this.sliceBuffer(H,t,e)}static fromTypedArray(t,e){return new H(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i16"}}class Q extends n{constructor(t,e=0,r,s){super(Int32Array,t,e,r,s),this.elementType="i32"}slice(t,e){return this.sliceBuffer(Q,t,e)}static fromTypedArray(t,e){return new Q(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i32"}}class W extends y{constructor(t,e=0,r,s){super(Int32Array,t,e,r,s),this.elementType="i32"}slice(t,e){return this.sliceBuffer(W,t,e)}static fromTypedArray(t,e){return new W(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i32"}}class J extends h{constructor(t,e=0,r,s){super(Int32Array,t,e,r,s),this.elementType="i32"}slice(t,e){return this.sliceBuffer(J,t,e)}static fromTypedArray(t,e){return new J(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i32"}}class G extends d{constructor(t,e=0,r,s){super(Int32Array,t,e,r,s),this.elementType="i32"}slice(t,e){return this.sliceBuffer(G,t,e)}static fromTypedArray(t,e){return new G(t.buffer,t.byteOffset,e,t.byteOffset+t.byteLength)}static{this.ElementType="i32"}}},37585:(t,e,r)=>{r.d(e,{C:()=>f,Cc:()=>b,Io:()=>o,S8:()=>l,WQ:()=>n,e$:()=>T,hZ:()=>i,hs:()=>h,jb:()=>m,l0:()=>B});var s=r(34304);function f(t,e){return t[0]=e[0],t[1]=e[1],t}function i(t,e,r){return t[0]=e,t[1]=r,t}function n(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function u(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function y(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function c(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function h(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function o(t,e){const r=e[0]-t[0],s=e[1]-t[1];return Math.sqrt(r*r+s*s)}function d(t,e){const r=e[0]-t[0],s=e[1]-t[1];return r*r+s*s}function a(t){const e=t[0],r=t[1];return Math.sqrt(e*e+r*r)}function p(t){const e=t[0],r=t[1];return e*e+r*r}function l(t,e){const r=e[0],s=e[1];let f=r*r+s*s;return f>0&&(f=1/Math.sqrt(f),t[0]=e[0]*f,t[1]=e[1]*f),t}function b(t,e,r,s){const f=e[0],i=e[1];return t[0]=f+s*(r[0]-f),t[1]=i+s*(r[1]-i),t}function B(t,e,r){const s=e[0],f=e[1];return t[0]=r[0]*s+r[2]*f+r[4],t[1]=r[1]*s+r[3]*f+r[5],t}function T(t,e,r,s){const f=e[0]-r[0],i=e[1]-r[1],n=Math.sin(s),u=Math.cos(s);return t[0]=f*u-i*n+r[0],t[1]=f*n+i*u+r[1],t}const E=a,m=u,A=y,O=c,S=o,g=d,L=p;Object.freeze(Object.defineProperty({__proto__:null,add:n,angle:function(t,e){const r=t[0],s=t[1],f=e[0],i=e[1];let n=r*r+s*s;n>0&&(n=1/Math.sqrt(n));let u=f*f+i*i;u>0&&(u=1/Math.sqrt(u));const y=(r*f+s*i)*n*u;return y>1?0:y<-1?Math.PI:Math.acos(y)},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},copy:f,cross:function(t,e,r){const s=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=s,t},dist:S,distance:o,div:O,divide:c,dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},equals:function(t,e){const r=t[0],f=t[1],i=e[0],n=e[1],u=(0,s.FD)();return Math.abs(r-i)<=u*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(f-n)<=u*Math.max(1,Math.abs(f),Math.abs(n))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},len:E,length:a,lerp:b,max:function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},min:function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},mul:A,multiply:y,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:l,projectAndScale:function(t,e,r,s,f){let i=e[0]-r[0],n=e[1]-r[1];const u=(s[0]*i+s[1]*n)*(f-1);return i=s[0]*u,n=s[1]*u,t[0]=e[0]+i,t[1]=e[1]+n,t},random:function(t,e=1){const r=2*(0,s.Ov)()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},rotate:T,round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:h,scaleAndAdd:function(t,e,r,s){return t[0]=e[0]+r[0]*s,t[1]=e[1]+r[1]*s,t},set:i,sqrDist:g,sqrLen:L,squaredDistance:d,squaredLength:p,str:function(t){return"vec2("+t[0]+", "+t[1]+")"},sub:m,subtract:u,transformMat2:function(t,e,r){const s=e[0],f=e[1];return t[0]=r[0]*s+r[2]*f,t[1]=r[1]*s+r[3]*f,t},transformMat2d:B,transformMat3:function(t,e,r){const s=e[0],f=e[1];return t[0]=r[0]*s+r[3]*f+r[6],t[1]=r[1]*s+r[4]*f+r[7],t},transformMat4:function(t,e,r){const s=e[0],f=e[1];return t[0]=r[0]*s+r[4]*f+r[12],t[1]=r[1]*s+r[5]*f+r[13],t}},Symbol.toStringTag,{value:"Module"}))}}]);
|