@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 11.7 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3813],{62885(t,e,i){i.d(e,{H:()=>r,V:()=>s});var n=i(7762);function s(t,e,i=n.A){return e||(e=new i),e===t||e.destroyed||(e.removeAll(),(s=t)&&(Array.isArray(s)||"items"in s&&Array.isArray(s.items))?e.addMany(t):t&&e.add(t)),e;var s}function r(t){return t}},68197(t,e,i){i.d(e,{A:()=>u});var n=i(40876),s=i(4576),r=i(34727),o=i(56507);function l(t){return(0,r.qE)((0,o.Vr)(t),0,255)}function a(t,e){const i=t.toString(16).padStart(2,"0");return e?i.slice(0,1):i}class u{static blendColors(t,e,i,n=new u){return n.r=Math.round(t.r+(e.r-t.r)*i),n.g=Math.round(t.g+(e.g-t.g)*i),n.b=Math.round(t.b+(e.b-t.b)*i),n.a=t.a+(e.a-t.a)*i,n._sanitize()}static fromRgb(t,e){const i=(0,n.lT)(t);return i?u.fromArray(i,e):null}static fromHex(t,e=new u){const i=(0,n.oW)(t);return i?u.fromArray(i,e):null}static fromArray(t,e=new u){return e._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(e.a)&&(e.a=1),e._sanitize()}static fromString(t,e){const i=(0,n.Eq)(t);return i?u.fromArray(i,e):null}static fromJSON(t){return null!=t?new u([t[0],t[1],t[2],(t[3]??255)/255]):void 0}toUnitRGB(){return[this.r/255,this.g/255,this.b/255]}toUnitRGBA(t){return t??=[0,0,0,0],t[0]=this.r/255,t[1]=this.g/255,t[2]=this.b/255,t[3]=null!=this.a?this.a:1,t}constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(t){if("string"==typeof t)u.fromString(t,this);else if((0,s.yc)(t))u.fromArray(t,this);else{const e=t;this._set(e.r??0,e.g??0,e.b??0,e.a??1),t instanceof u||this._sanitize()}return this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(t){const e=t?.capitalize??!1,i=t?.digits??6,n=3===i||4===i,s=4===i||8===i,r=`#${a(this.r,n)}${a(this.g,n)}${a(this.b,n)}${s?a(Math.round(255*this.a),n):""}`;return e?r.toUpperCase():r}toCss(t=!1){const e=this.r+", "+this.g+", "+this.b;return t?`rgba(${e}, ${this.a})`:`rgb(${e})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=0){const e=l(this.r),i=l(this.g),n=l(this.b);return 0===t||1!==this.a?[e,i,n,l(255*this.a)]:[e,i,n]}clone(){return new u(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return null!=t&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=(0,n.c1)(this.r),this.g=(0,n.c1)(this.g),this.b=(0,n.c1)(this.b),this.a=(0,n.G1)(this.a),this}_set(t,e,i,n){this.r=t,this.g=e,this.b=i,this.a=n}}u.prototype.declaredClass="esri.Color"},69052(t,e,i){i.d(e,{hr:()=>s,ie:()=>a,uC:()=>l});var n=i(34727);class s{constructor(t,e){this.min=t,this.max=e,this.range=e-t}normalize(t,e=0,i=!1){return r(this.range,this.min,this.max,t,e,i)}clamp(t,e=0){return(0,n.qE)(t-e,this.min,this.max)+e}monotonic(t,e,i){return t<e?e:e+o(this.range,t-e,i)}minimalMonotonic(t,e,i){return r(this.range,t,t+this.range,e,i)}center(t,e,i){return e=this.monotonic(t,e,i),this.normalize((t+e)/2,i)}diff(t,e,i){return this.monotonic(t,e,i)-t}shortestSignedDiff(t,e){t=this.normalize(t);const i=(e=this.normalize(e))-t,n=e<t?this.minimalMonotonic(t,e)-t:e-this.minimalMonotonic(e,t);return Math.abs(i)<Math.abs(n)?i:n}contains(t,e,i){return e=this.minimalMonotonic(t,e),(i=this.minimalMonotonic(t,i))>t&&i<e}}function r(t,e,i,n,s=0,r=!1){return(n-=s)<e?n+=o(t,e-n):n>i&&(n-=o(t,n-i)),r&&n===i&&(n=e),n+s}function o(t,e,i=0){return Math.ceil((e-i)/t)*t+i}const l=new s(0,2*Math.PI),a=(new s(-Math.PI,Math.PI),new s(0,360))},71493(t,e,i){i.r(e),i.d(e,{default:()=>R});var n=i(5482),s=i(79608),r=i(68197),o=i(69540),l=i(25482),a=i(90629),u=i(91429),h=i(56507);let p=class extends((0,l.T)(o.Pw)){constructor(t){super(t),this.type="simple",this.color=new r.A("black"),this.textColor=new r.A("black"),this.textBackgroundColor=new r.A([255,255,255,.6])}get lineSize(){return this._get("lineSize")??2}set lineSize(t){this._set("lineSize",t)}get fontSize(){return this._get("fontSize")??10}set fontSize(t){this._set("fontSize",t)}equals(t){return this===t||this.color.equals(t.color)&&this.lineSize===t.lineSize&&this.fontSize===t.fontSize&&this.textColor.equals(t.textColor)&&this.textBackgroundColor.equals(t.textBackgroundColor)}};(0,n.Cg)([(0,u.MZ)({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],p.prototype,"type",void 0),(0,n.Cg)([(0,u.MZ)({type:r.A,nonNullable:!0,json:{type:[h.jz],write:{isRequired:!0}}})],p.prototype,"color",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,cast:a.cr,nonNullable:!0,range:{min:(0,a.PN)(1)},json:{write:{isRequired:!0}}})],p.prototype,"lineSize",null),(0,n.Cg)([(0,u.MZ)({type:Number,cast:a.cr,nonNullable:!0,json:{write:{isRequired:!0}}})],p.prototype,"fontSize",null),(0,n.Cg)([(0,u.MZ)({type:r.A,nonNullable:!0,json:{type:[h.jz],write:{isRequired:!0}}})],p.prototype,"textColor",void 0),(0,n.Cg)([(0,u.MZ)({type:r.A,nonNullable:!0,json:{type:[h.jz],write:{isRequired:!0}}})],p.prototype,"textBackgroundColor",void 0),p=(0,n.Cg)([(0,u.$K)("esri.analysis.DimensionSimpleStyle")],p);var c=i(69052),y=i(97768),d=i(86738);let g=class extends((0,l.T)(o.Pw)){constructor(t){super(t),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType="direct",this.offset=0,this.orientation=0}get valid(){return null!=this.startPoint&&null!=this.endPoint}equals(t){return this===t||(0,y.CM)(this.startPoint,t.startPoint)&&(0,y.CM)(this.endPoint,t.endPoint)&&this.measureType===t.measureType&&this.offset===t.offset&&this.orientation===t.orientation}};(0,n.Cg)([(0,u.MZ)({type:["length"],json:{write:{isRequired:!0}}})],g.prototype,"type",void 0),(0,n.Cg)([(0,u.MZ)({type:d.A,json:{write:{isRequired:!0}}})],g.prototype,"startPoint",void 0),(0,n.Cg)([(0,u.MZ)({type:d.A,json:{write:{isRequired:!0}}})],g.prototype,"endPoint",void 0),(0,n.Cg)([(0,u.MZ)({type:["horizontal","vertical","direct"],nonNullable:!0,json:{write:{isRequired:!0}}})],g.prototype,"measureType",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],g.prototype,"offset",void 0),(0,n.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,u.wg)(t=>c.ie.normalize((0,h.GB)(t),0,!0))],g.prototype,"orientation",void 0),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],g.prototype,"valid",null),g=(0,n.Cg)([(0,u.$K)("esri.analysis.LengthDimension")],g);var m=i(4576),f=i(7762),b=i(62885),C=i(36708),M=i(5443),w=i(91218);const v=f.A.ofType(g);let A=class extends s.A{constructor(t){super(t),this.type="dimension",this.style=new p,this.extent=null}initialize(){this.addHandles((0,C.wB)(()=>this._computeExtent(),t=>{null==t?.pending&&this._set("extent",null!=t?t.extent:null)},C.pc))}get dimensions(){return this._get("dimensions")||new v}set dimensions(t){this._set("dimensions",(0,b.V)(t,this.dimensions,v))}get spatialReference(){for(const t of this.dimensions){if(null!=t.startPoint)return t.startPoint.spatialReference;if(null!=t.endPoint)return t.endPoint.spatialReference}return null}get valid(){return this.dimensions.every(t=>t.valid)}async waitComputeExtent(){const t=this._computeExtent();return null!=t?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(null==t)return{pending:null,extent:null};const e=[];for(const t of this.dimensions)null!=t.startPoint&&e.push(t.startPoint),null!=t.endPoint&&e.push(t.endPoint);const i=(0,w.projectOrLoadMany)(e,t);if(null!=i.pending)return{pending:i.pending,extent:null};let n=null;return null!=i.geometries&&(n=i.geometries.reduce((t,e)=>null==t?null!=e?M.A.fromPoint(e):null:null!=e?t.union(M.A.fromPoint(e)):t,null)),{pending:null,extent:n}}clear(){this.dimensions.removeAll()}equals(t){return this===t||super.equals(t)&&this.style.equals(t.style)&&(0,m.aI)(this.dimensions.toArray(),t.dimensions.toArray(),(t,e)=>t.equals(e))}};(0,n.Cg)([(0,u.MZ)({type:["dimension"]})],A.prototype,"type",void 0),(0,n.Cg)([(0,u.MZ)({cast:b.H,type:v,nonNullable:!0})],A.prototype,"dimensions",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],A.prototype,"spatialReference",null),(0,n.Cg)([(0,u.MZ)({types:{key:"type",base:null,typeMap:{simple:p}},nonNullable:!0})],A.prototype,"style",void 0),(0,n.Cg)([(0,u.MZ)({value:null,readOnly:!0})],A.prototype,"extent",void 0),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],A.prototype,"valid",null),A=(0,n.Cg)([(0,u.$K)("esri.analysis.DimensionAnalysis")],A);var x=i(25728),Z=i(4146),P=i(16131),z=i(43937);let S=class extends((0,P.q)((0,x.M)(Z.A))){constructor(t){if(super(t),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new A,this.opacity=1,t){const{source:e,style:i}=t;e&&i&&(e.style=i)}}initialize(){this.addHandles([(0,C.wB)(()=>this.source,(t,e)=>{null!=e&&e.parent===this&&(e.parent=null),null!=t&&(t.parent=this)},C.pc)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(t){this.source.style=t}get fullExtent(){return this.source.extent}releaseAnalysis(t){this.source===t&&(this.source=new A)}get analysis(){return this.source}set analysis(t){this.source=t}get dimensions(){return this.source.dimensions}set dimensions(t){this.source.dimensions=t}writeDimensions(t,e,i,n){e.dimensions=t.filter(({startPoint:t,endPoint:e})=>null!=t&&null!=e).toJSON(n)}};(0,n.Cg)([(0,u.MZ)({json:{read:!1},readOnly:!0})],S.prototype,"type",void 0),(0,n.Cg)([(0,u.MZ)({type:["ArcGISDimensionLayer"]})],S.prototype,"operationalLayerType",void 0),(0,n.Cg)([(0,u.MZ)({nonNullable:!0})],S.prototype,"source",void 0),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],S.prototype,"spatialReference",null),(0,n.Cg)([(0,u.MZ)({types:{key:"type",base:null,typeMap:{simple:p}},json:{write:{ignoreOrigin:!0}}})],S.prototype,"style",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],S.prototype,"fullExtent",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],S.prototype,"opacity",void 0),(0,n.Cg)([(0,u.MZ)({type:["show","hide"]})],S.prototype,"listMode",void 0),(0,n.Cg)([(0,u.MZ)({type:f.A.ofType(g),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],S.prototype,"dimensions",null),(0,n.Cg)([(0,z.K)("web-scene","dimensions")],S.prototype,"writeDimensions",null),S=(0,n.Cg)([(0,u.$K)("esri.layers.DimensionLayer")],S);const R=S},78553(t,e,i){i.d(e,{D:()=>r,p:()=>s});var n=i(56507);function s(t){const e=(0,n.Vr)(100*(1-t));return Math.max(0,Math.min(e,100))}function r(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}},79608(t,e,i){i.d(e,{A:()=>c});var n=i(5482),s=i(69540),r=i(91429);let o=class extends s.Pw{constructor(t){super(t),this.type="web-scene"}equals(t){return this.type===t.type}};(0,n.Cg)([(0,r.MZ)()],o.prototype,"type",void 0),o=(0,n.Cg)([(0,r.$K)("esri.analysis.support.AnalysisOriginWebScene")],o);const l=o;var a=i(69622),u=i(4902),h=i(25482);let p=0,c=class extends((0,h.T)((0,s.OU)((0,u.s)(a.A)))){constructor(t){super(t),this.id=`${Date.now().toString(16)}-analysis-${p++}`,this.origin=null}get parent(){return this._get("parent")}set parent(t){const e=this.parent;if(null!=e)switch(e.type){case"line-of-sight":case"dimension":case"viewshed":e.releaseAnalysis(this);break;case"2d":case"3d":e.analyses.includes(this)&&e.analyses.remove(this)}this._set("parent",t)}equals(t){return this.type===t.type}};(0,n.Cg)([(0,r.MZ)({type:String,constructOnly:!0,clonable:!1})],c.prototype,"id",void 0),(0,n.Cg)([(0,r.MZ)({clonable:!1,value:null})],c.prototype,"parent",null),(0,n.Cg)([(0,r.MZ)({types:{key:"type",base:null,typeMap:{"web-scene":l}}})],c.prototype,"origin",void 0),c=(0,n.Cg)([(0,r.$K)("esri.analysis.Analysis")],c)}}]);