UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 64.5 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9550],{4146(e,t,r){r.d(t,{A:()=>v});var s=r(5482),o=r(11254),i=r(49186),n=r(65529),l=r(4902),a=r(92474),u=r(53966),p=r(74887),d=r(84952),h=r(91429),c=r(5443),y=r(16930),g=r(92602),m=r(79677);let f=0,v=class extends((0,n.Zt)((0,l.s)(a.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new c.A(-180,-90,180,90,y.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+f++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:s}=await Promise.all([r.e(1218),r.e(812),r.e(5613)]).then(r.bind(r,45613));try{return await s(t)}catch(e){const r=t?.portalItem,s=r?.id||"unset",o=r?.portal?.url||g.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+s+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,p.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new i.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,o.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new i.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,s.Cg)([(0,h.MZ)({type:String})],v.prototype,"attributionDataUrl",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],v.prototype,"effectiveVisible",null),(0,s.Cg)([(0,h.MZ)({type:c.A})],v.prototype,"fullExtent",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],v.prototype,"hasAttributionData",null),(0,s.Cg)([(0,h.MZ)({type:String,clonable:!1})],v.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],v.prototype,"legendEnabled",void 0),(0,s.Cg)([(0,h.MZ)({type:["show","hide","hide-children"]})],v.prototype,"listMode",void 0),(0,s.Cg)([(0,h.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],v.prototype,"opacity",void 0),(0,s.Cg)([(0,h.MZ)({clonable:!1})],v.prototype,"parent",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],v.prototype,"parsedUrl",null),(0,s.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],v.prototype,"persistenceEnabled",void 0),(0,s.Cg)([(0,h.MZ)({type:Boolean})],v.prototype,"popupEnabled",void 0),(0,s.Cg)([(0,h.MZ)({type:Boolean})],v.prototype,"attributionVisible",void 0),(0,s.Cg)([(0,h.MZ)({type:y.A})],v.prototype,"spatialReference",void 0),(0,s.Cg)([(0,h.MZ)({type:String})],v.prototype,"title",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),(0,s.Cg)([(0,h.MZ)()],v.prototype,"url",void 0),(0,s.Cg)([(0,h.MZ)({type:m.A})],v.prototype,"visibilityTimeExtent",void 0),(0,s.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],v.prototype,"visible",void 0),v=(0,s.Cg)([(0,h.$K)("esri.layers.Layer")],v)},4902(e,t,r){r.d(t,{s:()=>n});var s=r(5482),o=r(64108);let i=0;const n=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+i++})}};return r=(0,s.Cg)([(0,o.$)("esri.core.Identifiable")],r),r};n(class{})},16215(e,t,r){r.d(t,{S:()=>o,Y:()=>s});const s=Symbol("BasemapInstance");function o(e){return null!=e&&"object"==typeof e&&s in e}},16405(e,t,r){r.d(t,{A:()=>c});var s,o=r(5482),i=r(69622),n=r(66552),l=r(4718),a=r(91429),u=r(5443),p=r(16930),d=r(28735);const h=new n.J({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let c=s=class extends i.A{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){"asc"!==e&&"desc"!==e||this._set("sortOrder",e)}clone(){return new s({categories:this.categories?(0,l.o8)(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let r=[];this.categories&&(r=this.categories.map(e=>Array.isArray(e)?JSON.stringify(e):e));let s="";if(this.extent){const e=(0,d.Cv)(this.extent,p.A.WGS84);null!=e&&(s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`)}let o=this.query;!this.disableExtraQuery&&e.extraQuery&&(o="("+o+")"+e.extraQuery);const i={categories:r,bbox:s,q:o,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(i.sortField=this.sortField.split(",").map(e=>h.toJSON(e.trim())).join(","),i.sortOrder=this.sortOrder),{query:{...t,...i}}}};(0,o.Cg)([(0,a.MZ)()],c.prototype,"categories",void 0),(0,o.Cg)([(0,a.MZ)()],c.prototype,"disableExtraQuery",void 0),(0,o.Cg)([(0,a.MZ)({type:u.A})],c.prototype,"extent",void 0),(0,o.Cg)([(0,a.MZ)()],c.prototype,"filter",void 0),(0,o.Cg)([(0,a.MZ)()],c.prototype,"num",void 0),(0,o.Cg)([(0,a.MZ)()],c.prototype,"query",void 0),(0,o.Cg)([(0,a.MZ)()],c.prototype,"sortField",void 0),(0,o.Cg)([(0,a.MZ)()],c.prototype,"sortOrder",null),(0,o.Cg)([(0,a.MZ)()],c.prototype,"start",void 0),c=s=(0,o.Cg)([(0,a.$K)("esri.portal.PortalQueryParams")],c)},16494(e,t,r){r.d(t,{Nd:()=>l,W5:()=>n});var s=r(17632);const o=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),i=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],n=new s.I({whiteList:o,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(i.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),l=new s.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},17311(e,t,r){r.d(t,{A:()=>c});var s=r(5482),o=r(69622),i=r(4576),n=r(60999),l=r(7762),a=r(16494),u=r(91429),p=r(30524),d=r(43668);const h=/<br\s*\/*>/gi;let c=class extends o.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,n.UT)(()=>(0,d.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??Promise.all([r.e(4560),r.e(9926)]).then(r.bind(r,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),s=this.fieldsIndex.get(r.at(-1)??"");s&&e.add(s.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){const s=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],r)).get(s)??""}async getTitles(e,t,r){const s=new Map,o=r?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:i}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);r?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:n,workingTitle:l}=this,u=l&&n;t.forEach(t=>{const p=t.getObjectId()??t.attributes[e.objectIdField];let d=u?i({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:n,globalAttributes:this._createFormattedAttributes(e,t,o).global,layer:e,text:l}):"";r?.removeHTML&&(d=a.Nd.sanitize(d).replaceAll(h," ")),s.set(p,d)})}catch{}return s}async _checkAndReQueryGraphics(e,t){const r=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(i.Ru);if(r.length!==t.length)return t;if(t.some(e=>!(0,p.Kl)(e,this.requiredFields))){const s=e.createQuery();s.where="1=1",s.outFields=[...this.requiredFields],s.objectIds=r;const o=await e.queryFeatures(s);if(o?.features.length===t.length)return o.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),s=e?.name??r.fieldName;r.fieldName=s,t.set(s.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const s=this.effectivePopupTemplate?.fieldInfos??[],o={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{o[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const i={...t.attributes,...o};return{global:this._featureUtils.formatAttributes({fieldInfos:s,attributes:i,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,p.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,s.Cg)([(0,u.MZ)({readOnly:!0})],c.prototype,"_arcadeTask",null),(0,s.Cg)([(0,u.MZ)()],c.prototype,"_featureUtils",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],c.prototype,"featureUtilsPromise",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],c.prototype,"calculatedExpressions",null),(0,s.Cg)([(0,u.MZ)()],c.prototype,"displayField",void 0),(0,s.Cg)([(0,u.MZ)()],c.prototype,"effectivePopupTemplate",void 0),(0,s.Cg)([(0,u.MZ)()],c.prototype,"expressionsUsedInTitle",null),(0,s.Cg)([(0,u.MZ)()],c.prototype,"fieldsIndex",void 0),(0,s.Cg)([(0,u.MZ)()],c.prototype,"fieldInfoMap",null),(0,s.Cg)([(0,u.MZ)()],c.prototype,"fields",void 0),(0,s.Cg)([(0,u.MZ)()],c.prototype,"objectIdField",void 0),(0,s.Cg)([(0,u.MZ)()],c.prototype,"requiredFields",null),c=(0,s.Cg)([(0,u.$K)("esri.layers.support.TitleCreator")],c)},20655(e,t,r){r.d(t,{A:()=>A});var s=r(5482),o=r(92602),i=r(70333),n=r(11254),l=r(49186),a=r(44208),u=r(25482),p=r(92474),d=r(97768),h=r(74887),c=r(91429),y=r(56507),g=r(5443),m=r(73444);let f;var v=r(96360),C=r(16405),M=r(69622);let b=class extends M.A{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};(0,s.Cg)([(0,c.MZ)()],b.prototype,"nextQueryParams",void 0),(0,s.Cg)([(0,c.MZ)()],b.prototype,"queryParams",void 0),(0,s.Cg)([(0,c.MZ)()],b.prototype,"results",void 0),(0,s.Cg)([(0,c.MZ)()],b.prototype,"total",void 0),b=(0,s.Cg)([(0,c.$K)("esri.portal.PortalQueryResult")],b);var w,Z=r(41318),_=r(926),S=r(36005);let T;const P={PortalGroup:()=>Promise.resolve({default:v.A}),PortalItem:()=>r.e(812).then(r.bind(r,80812)),PortalUser:()=>Promise.resolve({default:Z.A})};let A=class extends((0,u.T)(p.x_)){static{w=this}static{this.AUTH_MODE_ANONYMOUS="anonymous"}static{this.AUTH_MODE_AUTO="auto"}static{this.AUTH_MODE_IMMEDIATE="immediate"}static{this.AUTH_MODE_NO_PROMPT="no-prompt"}constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.g3DTilesGalleryGroupQuery=null,this.g3dTilesEnabled=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=o.A.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){O.unregister(this),this.defaultBasemap=(0,d.pR)(this.defaultBasemap),this.defaultDevBasemap=(0,d.pR)(this.defaultDevBasemap),this.defaultVectorBasemap=(0,d.pR)(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=(0,d.xt)(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const t of e)o.A.request.trustedServers.includes(t)||o.A.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=this.user?.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get hasAPIKey(){return(0,_.Jn)(this.restUrl)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get loaded(){return super.loaded}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.slice(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=Z.A.fromJSON(e),t.portal=this),t}load(e){const t=Promise.all([r.e(812),r.e(3116)]).then(r.bind(r,83116)).then(({default:t})=>{(0,h.Te)(e),T=t}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e)).then(e=>{if(!this.hasAPIKey&&i.id){const e=i.id;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==w.AUTH_MODE_AUTO&&this.authMode!==w.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",function(e){const t=i.id;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch(()=>{})}}(new WeakRef(this))),O.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await Promise.all([r.e(1218),r.e(3508),r.e(9953),r.e(812),r.e(9186),r.e(2369),r.e(7716)]).then(r.bind(r,62369))).default;return e?e.map(e=>new t({id:e.id,url:e.url})):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){if(this.g3dTilesEnabled&&this.g3DTilesGalleryGroupQuery&&(0,a.A)("enable-feature:basemap-groundlayers")){const e=await this._fetchBasemaps3D(this.g3DTilesGalleryGroupQuery,t);r.unshift(...e)}const s=await this._fetchBasemaps3D(e,t);r.unshift(...s)}return r}async fetchDefault3DBasemap(e){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||"none"===this.default3DBasemapQuery)return null;const t=new C.A;t.query=this.default3DBasemapQuery,t.disableExtraQuery=!0;const r=(await this.queryItems(t,e)).results.find(e=>"Web Scene"===e.type);return r?new T({portalItem:r}):null}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then(e=>e.categorySchema):(0,h.G4)(e)?Promise.reject((0,h.NK)()):Promise.resolve([])}async fetchClassificationSchema(e){return this.hasClassificationSchema?this.request(this.restUrl+"/portals/self/classification/classificationSchema",e).then(e=>e.classificationSchema):null}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new C.A({num:100,sortField:"title"});if(t?.length){const s=[];for(const e of t)s.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=s.join(" OR "),this.queryGroups(r,e).then(e=>e.results)}return(0,h.G4)(e)?Promise.reject((0,h.NK)()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return f&&!f.destroyed||(f=new w),f}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){const s=this.restUrl+"/portals/self",o={authMode:e,query:{culture:(0,m.JK)().toLowerCase()},withCredentials:!0,...r};return"auto"===o.authMode&&(o.authMode="no-prompt"),t&&(o.query.default=!0),this.request(s,o)}queryPortal(e,t,r,s){const o=(0,y.dp)(C.A,t),i=t=>this.request(this.restUrl+e,{...o.toRequestOptions(this),...s}).then(e=>{const r=o.clone();return r.start=e.nextStart,new b({nextQueryParams:r,queryParams:o,total:e.total,results:w._resultsToTypedArray(t,{portal:this},e,s)})}).then(e=>Promise.all(e.results.map(t=>"function"==typeof t.when?t.when():e)).then(()=>e,t=>((0,h.QP)(t),e)));return r&&P[r]?P[r]().then(({default:e})=>((0,h.Te)(s),i(e))):i()}signIn(){if(this.hasAPIKey)return this.load().then(()=>{if(!this.user)throw new l.A("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")});if(this.authMode===w.AUTH_MODE_ANONYMOUS||this.authMode===w.AUTH_MODE_NO_PROMPT&&!i.id)return Promise.reject(new l.A("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then(()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then(()=>null)):"loading"===this.loadStatus?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(e=>{e&&(this.sourceJSON=e,this.read(e))});return i.id?i.id.getCredential(this.restUrl,{prompt:this.authMode!==w.AUTH_MODE_NO_PROMPT}).then(t=>e(t)):e(this.credential)}normalizeUrl(e){const t=this.credential?.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then(e=>{const t=w._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map(t=>"function"==typeof t.when?t.when():e)).then(()=>t,()=>t)})}request(e,t={}){const r={f:"json",...t.query},{authMode:s=(this.authMode===w.AUTH_MODE_ANONYMOUS||this.authMode===w.AUTH_MODE_NO_PROMPT?this.authMode:"auto"),body:o=null,cacheBust:i=!1,method:l="auto",responseType:a="json",signal:u}=t,p={authMode:s,body:o,cacheBust:i,method:l,query:r,responseType:a,timeout:0,signal:u};return t.withCredentials&&(p.withCredentials=!0),(0,n.A)(this._normalizeSSL(e),p).then(e=>e.data)}toJSON(){throw new l.A("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new w({sourceJSON:e})}_getHelperService(e){const t=this.helperServices?.[e];if(!t)throw new l.A("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){const r=new C.A;r.query=e||((0,_.Dd)()?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;const s=await this.queryGroups(r,t);if(!s.total)return[];const o=s.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=o.sortField||"name",r.sortOrder=o.sortOrder||"desc";const i=await o.queryItems(r,t);return i.total?i.results.filter(e=>"Web Map"===e.type).map(e=>new T({portalItem:e})):[]}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];if((0,_.Dd)())return[];const s=new C.A({query:r,disableExtraQuery:!0}),o=await this.queryGroups(s,t);if(!o.total)return[];const i=o.results[0];s.num=100,s.query='type:"Web Scene"',s.sortField=i.sortField||"name",s.sortOrder=i.sortOrder||"desc";const n=await i.queryItems(s,t);return n.total?n.results.filter(e=>"Web Scene"===e.type).map(e=>new T({portalItem:e})):[]}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=T.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,s){let o;if(r){const i=null!=s?s.signal:null;o=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(o=o.map(r=>{const s=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof s.load&&s.load(i),s}))}else o=[];return o}};(0,s.Cg)([(0,c.MZ)()],A.prototype,"access",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"allSSL",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"authMode",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"authorizedCrossOriginDomains",void 0),(0,s.Cg)([(0,S.w)("authorizedCrossOriginDomains")],A.prototype,"readAuthorizedCrossOriginDomains",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"basemapGalleryGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)({json:{name:"3DBasemapGalleryGroupQuery"}})],A.prototype,"basemapGalleryGroupQuery3D",void 0),(0,s.Cg)([(0,c.MZ)({json:{name:"g3DTilesGalleryGroupQuery"}})],A.prototype,"g3DTilesGalleryGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)({json:{name:"g3dTilesEnabled"}})],A.prototype,"g3dTilesEnabled",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"bingKey",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canListApps",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canListData",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canListPreProvisionedItems",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canProvisionDirectPurchase",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canSearchPublic",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canShareBingPublic",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canSharePublic",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canSignInArcGIS",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"canSignInIDP",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"colorSetsGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"commentsEnabled",void 0),(0,s.Cg)([(0,c.MZ)({type:Date})],A.prototype,"created",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"credential",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"culture",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"currentVersion",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"customBaseUrl",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"default3DBasemapQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"defaultBasemap",void 0),(0,s.Cg)([(0,S.w)("defaultBasemap")],A.prototype,"readDefaultBasemap",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"defaultDevBasemap",void 0),(0,s.Cg)([(0,S.w)("defaultDevBasemap")],A.prototype,"readDefaultDevBasemap",null),(0,s.Cg)([(0,c.MZ)({type:g.A})],A.prototype,"defaultExtent",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"defaultVectorBasemap",void 0),(0,s.Cg)([(0,S.w)("defaultVectorBasemap")],A.prototype,"readDefaultVectorBasemap",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"description",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"devBasemapGalleryGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"eueiEnabled",void 0),(0,s.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"extraQuery",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"featuredGroups",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"featuredItemsGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"galleryTemplatesGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"layoutGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"livingAtlasGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"hasAPIKey",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"hasCategorySchema",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"hasClassificationSchema",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"helpBase",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"helperServices",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"helpMap",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"homePageFeaturedContent",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"homePageFeaturedContentCount",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"httpPort",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"httpsPort",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"id",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"ipCntryCode",void 0),(0,s.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"isOrganization",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"isPortal",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"isReadOnly",void 0),(0,s.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"itemPageUrl",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"layerTemplatesGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"maxTokenExpirationMinutes",void 0),(0,s.Cg)([(0,c.MZ)({type:Date})],A.prototype,"modified",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"name",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"portalHostname",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"portalMode",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"portalProperties",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"region",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"recycleBinEnabled",void 0),(0,s.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"restUrl",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"rotatorPanels",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"showHomePageDescription",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"staticImagesUrl",void 0),(0,s.Cg)([(0,c.MZ)({json:{name:"2DStylesGroupQuery"}})],A.prototype,"stylesGroupQuery2d",void 0),(0,s.Cg)([(0,c.MZ)({json:{name:"stylesGroupQuery"}})],A.prototype,"stylesGroupQuery3d",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"supportsHostedServices",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"symbolSetsGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"templatesGroupQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"thumbnail",void 0),(0,s.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"thumbnailUrl",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"units",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"url",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"urlKey",void 0),(0,s.Cg)([(0,S.w)("urlKey")],A.prototype,"readUrlKey",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"user",void 0),(0,s.Cg)([(0,S.w)("user")],A.prototype,"readUser",null),(0,s.Cg)([(0,c.MZ)()],A.prototype,"use3dBasemaps",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"useDefault3dBasemap",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"useStandardizedQuery",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"useVectorBasemaps",void 0),(0,s.Cg)([(0,c.MZ)()],A.prototype,"vectorBasemapGalleryGroupQuery",void 0),A=w=(0,s.Cg)([(0,c.$K)("esri.portal.Portal")],A);const O=new FinalizationRegistry(e=>{e.remove()})},22671(e,t,r){r.d(t,{A:()=>v});var s,o=r(5482),i=r(52106),n=r(66552),l=r(25482),a=r(4718),u=r(91429),p=r(16930),d=r(60408),h=r(65864),c=r(50498),y=r(20437),g=r(36005),m=r(43937);const f=new n.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=s=class extends l.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,i.A)}writeGeometryType(e,t,r,s){if(e)return void f.write(e,t,r,s);const{features:o}=this;if(o)for(const e of o)if(null!=e?.geometry)return void f.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,h.rS)(e);return s&&!r&&t.spatialReference&&(s.spatialReference=p.A.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,a.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e?.[r];s.geometry=t?.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,o]}=e,i=this.features,n=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-s)/t),e=>Math.round((o-e)/r));for(let e=0,t=i.length;e<t;e++)n?.(i[e].geometry)||(i.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,o],scale:[i,n]}=r;let l=null,a=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;a=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*i+s,e=>o-e*n,l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const s=p.A.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const i=e[t],n=r.fromJSON(i),l=i.geometry?.spatialReference;null==n.geometry||l||(n.geometry.spatialReference=s);const a=i.aggregateGeometries,u=n.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],r=a[e],o=r?.spatialReference;null==t||o||(t.spatialReference=s)}o.push(n)}return o}_quantizePoints(e,t,r){let s,o;const i=[];for(let n=0,l=e.length;n<l;n++){const l=e[n];if(n>0){const e=t(l[0]),n=r(l[1]);e===s&&n===o||(i.push([e-s,n-o]),s=e,o=n)}else s=t(l[0]),o=r(l[1]),i.push([s,o])}return i.length>0?i:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,d.Bi)(e)?e.rings:e.paths,o=[];for(let e=0,i=s.length;e<i;e++){const i=s[e],n=this._quantizePoints(i,t,r);n&&o.push(n)}return o.length>0?((0,d.Bi)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s&&s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,s,o){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),s&&(e.z=s(e.z))}:"polyline"===e||"polygon"===e?e=>{const i=(0,d.Bi)(e)?e.rings:e.paths;let n,l;for(let e=0,s=i.length;e<s;e++){const s=i[e];for(let e=0,o=s.length;e<o;e++){const o=s[e];e>0?(n+=o[0],l+=o[1]):(n=o[0],l=o[1]),o[0]=t(n),o[1]=r(l)}}if(s&&o)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2]),r[3]=o(r[3])}}else if(s)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),s&&null!=e.zmax&&null!=e.zmin&&(e.zmax=s(e.zmax),e.zmin=s(e.zmin)),o&&null!=e.mmax&&null!=e.mmin&&(e.mmax=o(e.mmax),e.mmin=o(e.mmin))}:"multipoint"===e?e=>{const i=e.points;let n,l;for(let e=0,s=i.length;e<s;e++){const s=i[e];e>0?(n+=s[0],l+=s[1]):(n=s[0],l=s[1]),s[0]=t(n),s[1]=r(l)}if(s&&o)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=s(t[2]),t[3]=o(t[3])}else if(s)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=s(t[2])}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=o(t[2])}}:null}};(0,o.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,o.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,o.Cg)([(0,u.MZ)({type:[i.A],json:{write:!0}})],v.prototype,"features",void 0),(0,o.Cg)([(0,g.w)("features")],v.prototype,"readFeatures",null),(0,o.Cg)([(0,u.MZ)({type:[y.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,o.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:f.read}}})],v.prototype,"geometryType",void 0),(0,o.Cg)([(0,m.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,o.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,o.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,o.Cg)([(0,u.MZ)({types:c.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,o.Cg)([(0,g.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,o.Cg)([(0,u.MZ)({type:p.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,o.Cg)([(0,m.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,o.Cg)([(0,u.MZ)({json:{write:!0}})],v.prototype,"transform",void 0),v=s=(0,o.Cg)([(0,u.$K)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0},28032(e,t,r){r.d(t,{A:()=>a});var s=r(5482),o=r(69540),i=r(25482),n=r(91429),l=r(56400);let a=class extends((0,o.OU)(i.o)){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};(0,s.Cg)([(0,n.MZ)()],a.prototype,"creatorField",void 0),(0,s.Cg)([(0,n.MZ)()],a.prototype,"creationDateField",void 0),(0,s.Cg)([(0,n.MZ)()],a.prototype,"editorField",void 0),(0,s.Cg)([(0,n.MZ)()],a.prototype,"editDateField",void 0),(0,s.Cg)([(0,n.MZ)()],a.prototype,"realm",void 0),(0,s.Cg)([(0,n.MZ)((0,l.P6)("dateFieldsTimeReference",!0))],a.prototype,"timeZone",void 0),a=(0,s.Cg)([(0,n.$K)("esri.layers.support.EditFieldsInfo")],a)},29005(e,t,r){r.d(t,{A:()=>u});var s=r(5482),o=r(69540),i=r(66552),n=r(25482),l=r(91429);const a=new i.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let u=class extends((0,o.OU)(n.o)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,s.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"name",void 0),(0,s.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"description",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:a.read,write:a.write}})],u.prototype,"drawingTool",void 0),(0,s.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"prototype",void 0),(0,s.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"thumbnail",void 0),u=(0,s.Cg)([(0,l.$K)("esri.layers.support.FeatureTemplate")],u)},32756(e,t,r){r.d(t,{Rr:()=>l,fY:()=>u,ne:()=>a});var s=r(5482),o=r(93637),i=r(91429),n=r(91880);function l(e,t,r){if(!e)return null;const s=e.find(e=>!!e.field);if(!s)return null;const o=new n.A;return o.read(s,r),[o]}const a={type:[n.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,r,s){const i=e.find(e=>!!e.field);i&&(0,o.sM)(r,[i.toJSON()],t)}}}},u=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,s.Cg)([(0,i.MZ)(a)],r.prototype,"orderBy",void 0),r=(0,s.Cg)([(0,i.$K)("esri.layers.mixins.OrderedLayer")],r),r}},33143(e,t,r){r.d(t,{A:()=>d});var s=r(5482),o=r(69540),i=r(25482),n=r(91429),l=r(8631),a=r(29005),u=r(36005),p=r(43937);let d=class extends((0,o.OU)(i.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,l.r)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,s.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"id",void 0),(0,s.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"name",void 0),(0,s.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"domains",void 0),(0,s.Cg)([(0,u.w)("domains")],d.prototype,"readDomains",null),(0,s.Cg)([(0,p.K)("domains")],d.prototype,"writeDomains",null),(0,s.Cg)([(0,n.MZ)({type:[a.A],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,s.Cg)([(0,n.$K)("esri.layers.support.FeatureType")],d)},37352(e,t,r){r.d(t,{A:()=>a});var s,o=r(5482),i=r(7762),n=r(25482),l=r(91429);let a=s=class extends n.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new i.A}clone(){return new s({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,o.Cg)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"floorField",void 0),(0,o.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],a.prototype,"viewAllMode",void 0),(0,o.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],a.prototype,"viewAllLevelIds",void 0),a=s=(0,o.Cg)([(0,l.$K)("esri.layers.support.LayerFloorInfo")],a)},41318(e,t,r){r.d(t,{A:()=>p});var s=r(5482),o=r(49186),i=r(25482),n=r(91429);let l=class extends i.o{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new o.A("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};(0,s.Cg)([(0,n.MZ)({type:Date})],l.prototype,"created",void 0),(0,s.Cg)([(0,n.MZ)()],l.prototype,"id",void 0),(0,s.Cg)([(0,n.MZ)()],l.prototype,"portal",void 0),(0,s.Cg)([(0,n.MZ)()],l.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({readOnly:!0})],l.prototype,"url",null),(0,s.Cg)([(0,n.MZ)()],l.prototype,"username",void 0),l=(0,s.Cg)([(0,n.$K)("esri.portal.PortalFolder")],l);var a,u=r(96360);let p=a=class extends i.o{constructor(e){super(e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.id=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userLicenseTypeId=null,this.userType=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t?this.portal.normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.id}`:null}get url(){const e=this.portal?.restUrl;return e?`${e}/community/users/${this.id}`:null}addItem(e){const t=e&&e.item,r=e?.data,s=e?.folder,o={method:"post"};t&&(o.query=t.createPostQuery(),null!=r&&("string"==typeof r?o.query.text=r:"object"==typeof r&&(o.query.text=JSON.stringify(r))));let i=this.userContentUrl;return s&&(i+="/"+("string"==typeof s?s:s.id)),this.portal.request(i+"/addItem",o).then(e=>(t.id=e.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}async deleteItem(e,t=!1){let r=this.userContentUrl;e.ownerFolder&&(r+="/"+e.ownerFolder);const s=t?{permanentDelete:!0}:{};await this.portal.request(r+`/items/${e.id}/delete`,{method:"post",query:s}),e.id=null,e.portal=null}async deleteItems(e,t=!1){e=e.slice();const r=this.userContentUrl+"/deleteItems",s=[],i=e.map(e=>e.id);if(i.length){const n={method:"post",query:{items:i.join(","),permanentDelete:t}},l=await this.portal.request(r,n);for(const t of l.results){const r=e.find(e=>t.itemId===e.id),i=t.success;let n=null;i?(r.id=null,r.portal=null):t.error&&(n=new o.A("portal:delete-item-failed",t.error.message,t.error)),s.push({item:r,success:i,error:n})}}return s}fetchFolders(){return this.portal.request(this.userContentUrl??"",{query:{num:1}}).then(e=>{let t;return t=e&&e.folders?e.folders.map(e=>{const t=l.fromJSON(e);return t.portal=this.portal,t}):[],t})}fetchGroups(){return this.portal.request(this.url??"").then(e=>{let t;return t=e&&e.groups?e.groups.map(e=>{const t=u.A.fromJSON(e);return t.portal=this.portal,t}):[],t})}async fetchItems(e){e??={};let t=this.userContentUrl??"";e.folder&&(t+="/"+e.folder.id);const{default:s}=await r.e(812).then(r.bind(r,80812)),o={folders:!1,inRecycleBin:!!e.inRecycleBin||null,foldersContent:!(e.folder||!e.includeSubfolderItems)||null,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"},i=await this.portal.request(t,{query:o});let n;return i?.items?(n=i.items.map(e=>{const t=s.fromJSON(e);return t.portal=this.portal,t}),await Promise.all(n.map(e=>e.load())),{items:n,nextStart:i.nextStart,total:i.total}):{items:[],nextStart:-1,total:0}}fetchTags(){return this.portal.request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||(this._favGroup=new u.A({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(e)):Promise.reject(new o.A("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}async restoreItem(e,t){const r=this.userContentUrl,s=t?{folderID:"string"==typeof t?t:t.id}:null;await this.portal.request(r+`/items/${e.id}/restore`,{method:"post",query:s})}toJSON(){throw new o.A("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new a({sourceJSON:e});return t.read(e),t}};(0,s.Cg)([(0,n.MZ)()],p.prototype,"access",void 0),(0,s.Cg)([(0,n.MZ)({type:Date})],p.prototype,"created",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"culture",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"description",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"email",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"favGroupId",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"fullName",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"id",void 0),(0,s.Cg)([(0,n.MZ)({type:Date})],p.prototype,"modified",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"orgId",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"portal",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"preferredView",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"privileges",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"region",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"role",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"roleId",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"thumbnail",void 0),(0,s.Cg)([(0,n.MZ)({readOnly:!0})],p.prototype,"thumbnailUrl",null),(0,s.Cg)([(0,n.MZ)()],p.prototype,"units",void 0),(0,s.Cg)([(0,n.MZ)({readOnly:!0})],p.prototype,"userContentUrl",null),(0,s.Cg)([(0,n.MZ)({readOnly:!0})],p.prototype,"url",null),(0,s.Cg)([(0,n.MZ)()],p.prototype,"username",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"userLicenseTypeId",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"userType",void 0),p=a=(0,s.Cg)([(0,n.$K)("esri.portal.PortalUser")],p)},45067(e,t,r){r.d(t,{A:()=>p});var s=r(5482),o=r(69540),i=r(66552),n=r(25482),l=r(91429);const a=new i.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),u=new i.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let p=class extends((0,o.OU)(n.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,s.Cg)([(0,l.MZ)({json:{read:a.read,write:a.write}})],p.prototype,"cardinality",void 0),(0,s.Cg)([(0,l.MZ)({json:{name:"catalogID"}})],p.prototype,"catalogId",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],p.prototype,"composite",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],p.prototype,"id",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],p.prototype,"keyField",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],p.prototype,"keyFieldInRelationshipTable",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],p.prototype,"name",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],p.prototype,"relatedTableId",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],p.prototype,"relationshipTableId",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],p.prototype,"role",void 0),p=(0,s.Cg)([(0,l.$K)("esri.layers.support.Relationship")],p)},52106(e,t,r){r.d(t,{A:()=>Z});var s,o,i=r(5482),n=r(37838),l=r(69540),a=r(51447),u=r(25482),p=r(53966),d=r(36708),h=r(24326),c=r(91429),y=r(12195),g=r(65864),m=r(50498),f=r(55156),v=r(60950),C=r(54339),M=r(94128),b=r(33910);function w(e){if(null==e)return null;const t={};for(const r in e){const s=e[r];s&&(t[r]=s.toJSON())}return 0!==Object.keys(t).length?t:null}let Z=class extends((0,l.OU)(u.o)){static{s=M.Z}static{o=this}constructor(e){super(e),this[s]=!0,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,h.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(p.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new o({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,v.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(